mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
sd-ndisc-router: adjust function names and type of returned value
- prefix length and preference should be fit in uint8_t, and actually the kernel and networkd uses uint8_t to store them. - captive portal is now stored as a NUL-terminated string. Hence, it is not necessary to also provide its length.
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include "alloc-util.h"
|
||||
#include "ndisc-internal.h"
|
||||
#include "ndisc-router-internal.h"
|
||||
#include "strv.h"
|
||||
|
||||
static sd_ndisc_router* ndisc_router_free(sd_ndisc_router *rt) {
|
||||
if (!rt)
|
||||
@@ -41,7 +40,7 @@ sd_ndisc_router* ndisc_router_new(ICMP6Packet *packet) {
|
||||
return rt;
|
||||
}
|
||||
|
||||
int sd_ndisc_router_get_address(sd_ndisc_router *rt, struct in6_addr *ret) {
|
||||
int sd_ndisc_router_get_sender_address(sd_ndisc_router *rt, struct in6_addr *ret) {
|
||||
assert_return(rt, -EINVAL);
|
||||
|
||||
return icmp6_packet_get_sender_address(rt->packet, ret);
|
||||
@@ -167,7 +166,7 @@ int sd_ndisc_router_get_lifetime(sd_ndisc_router *rt, uint64_t *ret) {
|
||||
return rt->lifetime_usec > 0; /* Indicate if the router is still valid or not. */
|
||||
}
|
||||
|
||||
int sd_ndisc_router_get_preference(sd_ndisc_router *rt, unsigned *ret) {
|
||||
int sd_ndisc_router_get_preference(sd_ndisc_router *rt, uint8_t *ret) {
|
||||
assert_return(rt, -EINVAL);
|
||||
assert_return(ret, -EINVAL);
|
||||
|
||||
@@ -193,7 +192,7 @@ int sd_ndisc_router_get_mtu(sd_ndisc_router *rt, uint32_t *ret) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sd_ndisc_router_captive_portal_get_uri(sd_ndisc_router *rt, const char **ret, size_t *ret_size) {
|
||||
int sd_ndisc_router_get_captive_portal(sd_ndisc_router *rt, const char **ret) {
|
||||
assert_return(rt, -EINVAL);
|
||||
assert_return(ret, -EINVAL);
|
||||
|
||||
@@ -202,7 +201,6 @@ int sd_ndisc_router_captive_portal_get_uri(sd_ndisc_router *rt, const char **ret
|
||||
return -ENODATA;
|
||||
|
||||
*ret = p->captive_portal;
|
||||
*ret_size = strlen(p->captive_portal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -243,13 +241,13 @@ int sd_ndisc_router_option_is_type(sd_ndisc_router *rt, uint8_t type) {
|
||||
return t == type;
|
||||
}
|
||||
|
||||
int sd_ndisc_router_option_get_raw(sd_ndisc_router *rt, const void **ret, size_t *ret_size) {
|
||||
int sd_ndisc_router_option_get_raw(sd_ndisc_router *rt, const uint8_t **ret, size_t *ret_size) {
|
||||
assert_return(rt, -EINVAL);
|
||||
|
||||
if (!rt->current_option)
|
||||
return -ENODATA;
|
||||
|
||||
return ndisc_option_parse(rt->packet, rt->current_option->offset, NULL, ret_size, (const uint8_t**) ret);
|
||||
return ndisc_option_parse(rt->packet, rt->current_option->offset, NULL, ret_size, ret);
|
||||
}
|
||||
|
||||
#define DEFINE_GETTER(name, type, element, element_type) \
|
||||
@@ -273,13 +271,13 @@ int sd_ndisc_router_option_get_raw(sd_ndisc_router *rt, const void **ret, size_t
|
||||
}
|
||||
|
||||
DEFINE_GETTER(prefix, SD_NDISC_OPTION_PREFIX_INFORMATION, flags, uint8_t);
|
||||
DEFINE_GETTER(prefix, SD_NDISC_OPTION_PREFIX_INFORMATION, prefixlen, unsigned);
|
||||
DEFINE_GETTER(prefix, SD_NDISC_OPTION_PREFIX_INFORMATION, prefixlen, uint8_t);
|
||||
DEFINE_GETTER(prefix, SD_NDISC_OPTION_PREFIX_INFORMATION, address, struct in6_addr);
|
||||
DEFINE_GETTER(prefix, SD_NDISC_OPTION_PREFIX_INFORMATION, valid_lifetime, uint64_t);
|
||||
DEFINE_GETTER(prefix, SD_NDISC_OPTION_PREFIX_INFORMATION, preferred_lifetime, uint64_t);
|
||||
|
||||
DEFINE_GETTER(route, SD_NDISC_OPTION_ROUTE_INFORMATION, preference, unsigned);
|
||||
DEFINE_GETTER(route, SD_NDISC_OPTION_ROUTE_INFORMATION, prefixlen, unsigned);
|
||||
DEFINE_GETTER(route, SD_NDISC_OPTION_ROUTE_INFORMATION, preference, uint8_t);
|
||||
DEFINE_GETTER(route, SD_NDISC_OPTION_ROUTE_INFORMATION, prefixlen, uint8_t);
|
||||
DEFINE_GETTER(route, SD_NDISC_OPTION_ROUTE_INFORMATION, address, struct in6_addr);
|
||||
DEFINE_GETTER(route, SD_NDISC_OPTION_ROUTE_INFORMATION, lifetime, uint64_t);
|
||||
|
||||
@@ -301,28 +299,9 @@ int sd_ndisc_router_rdnss_get_addresses(sd_ndisc_router *rt, const struct in6_ad
|
||||
return (int) rt->current_option->rdnss.n_addresses;
|
||||
}
|
||||
|
||||
DEFINE_GETTER(dnssl, SD_NDISC_OPTION_DNSSL, domains, char**);
|
||||
DEFINE_GETTER(dnssl, SD_NDISC_OPTION_DNSSL, lifetime, uint64_t);
|
||||
|
||||
int sd_ndisc_router_dnssl_get_domains(sd_ndisc_router *rt, char ***ret) {
|
||||
int r;
|
||||
|
||||
assert_return(rt, -EINVAL);
|
||||
assert_return(ret, -EINVAL);
|
||||
|
||||
r = sd_ndisc_router_option_is_type(rt, SD_NDISC_OPTION_DNSSL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
return -EMEDIUMTYPE;
|
||||
|
||||
char **q = strv_copy(rt->current_option->dnssl.domains);
|
||||
if (!q)
|
||||
return -ENOMEM;
|
||||
|
||||
*ret = q;
|
||||
return (int) strv_length(q);
|
||||
}
|
||||
|
||||
DEFINE_GETTER(prefix64, SD_NDISC_OPTION_PREF64, prefixlen, unsigned);
|
||||
DEFINE_GETTER(prefix64, SD_NDISC_OPTION_PREF64, prefixlen, uint8_t);
|
||||
DEFINE_GETTER(prefix64, SD_NDISC_OPTION_PREF64, prefix, struct in6_addr);
|
||||
DEFINE_GETTER(prefix64, SD_NDISC_OPTION_PREF64, lifetime, uint64_t);
|
||||
|
||||
@@ -31,13 +31,13 @@ static void router_dump(sd_ndisc_router *rt) {
|
||||
usec_t t, lifetime, retrans_time;
|
||||
uint64_t flags;
|
||||
uint32_t mtu;
|
||||
unsigned preference;
|
||||
uint8_t preference;
|
||||
int r;
|
||||
|
||||
assert_se(rt);
|
||||
|
||||
log_info("--");
|
||||
assert_se(sd_ndisc_router_get_address(rt, &addr) >= 0);
|
||||
assert_se(sd_ndisc_router_get_sender_address(rt, &addr) >= 0);
|
||||
log_info("Sender: %s", IN6_ADDR_TO_STRING(&addr));
|
||||
|
||||
assert_se(sd_ndisc_router_get_timestamp(rt, CLOCK_REALTIME, &t) >= 0);
|
||||
@@ -91,20 +91,19 @@ static void router_dump(sd_ndisc_router *rt) {
|
||||
case SD_NDISC_OPTION_SOURCE_LL_ADDRESS:
|
||||
case SD_NDISC_OPTION_TARGET_LL_ADDRESS: {
|
||||
_cleanup_free_ char *c = NULL;
|
||||
const void *p;
|
||||
const uint8_t *p;
|
||||
size_t n;
|
||||
|
||||
assert_se(sd_ndisc_router_option_get_raw(rt, &p, &n) >= 0);
|
||||
assert_se(n > 2);
|
||||
assert_se(c = hexmem((uint8_t*) p + 2, n - 2));
|
||||
assert_se(c = hexmem(p + 2, n - 2));
|
||||
|
||||
log_info("Address: %s", c);
|
||||
break;
|
||||
}
|
||||
|
||||
case SD_NDISC_OPTION_PREFIX_INFORMATION: {
|
||||
unsigned prefix_len;
|
||||
uint8_t pfl;
|
||||
uint8_t prefix_len, pfl;
|
||||
struct in6_addr a;
|
||||
|
||||
assert_se(sd_ndisc_router_prefix_get_valid_lifetime(rt, &lifetime) >= 0);
|
||||
@@ -146,18 +145,12 @@ static void router_dump(sd_ndisc_router *rt) {
|
||||
}
|
||||
|
||||
case SD_NDISC_OPTION_DNSSL: {
|
||||
_cleanup_strv_free_ char **l = NULL;
|
||||
int n, i;
|
||||
char **l;
|
||||
|
||||
n = sd_ndisc_router_dnssl_get_domains(rt, &l);
|
||||
if (n == -EBADMSG) {
|
||||
log_info("Invalid domain(s).");
|
||||
break;
|
||||
}
|
||||
assert_se(n > 0);
|
||||
assert_se(sd_ndisc_router_dnssl_get_domains(rt, &l) >= 0);
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
log_info("Domain: %s", l[i]);
|
||||
STRV_FOREACH(s, l)
|
||||
log_info("Domain: %s", *s);
|
||||
|
||||
assert_se(sd_ndisc_router_dnssl_get_lifetime(rt, &lifetime) >= 0);
|
||||
assert_se(sd_ndisc_router_dnssl_get_lifetime_timestamp(rt, CLOCK_REALTIME, &t) >= 0);
|
||||
|
||||
@@ -190,7 +190,7 @@ static int ndisc_request_route(Route *route, Link *link, sd_ndisc_router *rt) {
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &router);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -336,7 +336,7 @@ static int ndisc_request_address(Address *address, Link *link, sd_ndisc_router *
|
||||
assert(link);
|
||||
assert(rt);
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &router);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -387,7 +387,7 @@ static int ndisc_router_drop_default(Link *link, sd_ndisc_router *rt) {
|
||||
assert(link->network);
|
||||
assert(rt);
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &gateway);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &gateway);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get router address from RA: %m");
|
||||
|
||||
@@ -430,7 +430,7 @@ static int ndisc_router_drop_default(Link *link, sd_ndisc_router *rt) {
|
||||
static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
|
||||
usec_t lifetime_usec;
|
||||
struct in6_addr gateway;
|
||||
unsigned preference;
|
||||
uint8_t preference;
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
@@ -452,7 +452,7 @@ static int ndisc_router_process_default(Link *link, sd_ndisc_router *rt) {
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get gateway lifetime from RA: %m");
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &gateway);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &gateway);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get gateway address from RA: %m");
|
||||
|
||||
@@ -625,7 +625,7 @@ static int ndisc_router_process_autonomous_prefix(Link *link, sd_ndisc_router *r
|
||||
usec_t lifetime_valid_usec, lifetime_preferred_usec;
|
||||
_cleanup_set_free_ Set *addresses = NULL;
|
||||
struct in6_addr prefix, *a;
|
||||
unsigned prefixlen;
|
||||
uint8_t prefixlen;
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
@@ -703,7 +703,7 @@ static int ndisc_router_process_autonomous_prefix(Link *link, sd_ndisc_router *r
|
||||
|
||||
static int ndisc_router_process_onlink_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
_cleanup_(route_unrefp) Route *route = NULL;
|
||||
unsigned prefixlen, preference;
|
||||
uint8_t prefixlen, preference;
|
||||
usec_t lifetime_usec;
|
||||
struct in6_addr prefix;
|
||||
int r;
|
||||
@@ -751,7 +751,7 @@ static int ndisc_router_process_onlink_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
|
||||
static int ndisc_router_drop_onlink_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
_cleanup_(route_unrefp) Route *route = NULL;
|
||||
unsigned prefixlen;
|
||||
uint8_t prefixlen;
|
||||
struct in6_addr prefix;
|
||||
usec_t lifetime_usec;
|
||||
int r;
|
||||
@@ -800,9 +800,8 @@ static int ndisc_router_drop_onlink_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
}
|
||||
|
||||
static int ndisc_router_process_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
unsigned prefixlen;
|
||||
uint8_t flags, prefixlen;
|
||||
struct in6_addr a;
|
||||
uint8_t flags;
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
@@ -856,7 +855,7 @@ static int ndisc_router_process_prefix(Link *link, sd_ndisc_router *rt) {
|
||||
|
||||
static int ndisc_router_process_route(Link *link, sd_ndisc_router *rt) {
|
||||
_cleanup_(route_unrefp) Route *route = NULL;
|
||||
unsigned preference, prefixlen;
|
||||
uint8_t preference, prefixlen;
|
||||
struct in6_addr gateway, dst;
|
||||
usec_t lifetime_usec;
|
||||
int r;
|
||||
@@ -895,7 +894,7 @@ static int ndisc_router_process_route(Link *link, sd_ndisc_router *rt) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &gateway);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &gateway);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get gateway address from RA: %m");
|
||||
|
||||
@@ -962,7 +961,7 @@ static int ndisc_router_process_rdnss(Link *link, sd_ndisc_router *rt) {
|
||||
if (!link->network->ndisc_use_dns)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &router);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get router address from RA: %m");
|
||||
|
||||
@@ -1041,7 +1040,7 @@ DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
free);
|
||||
|
||||
static int ndisc_router_process_dnssl(Link *link, sd_ndisc_router *rt) {
|
||||
_cleanup_strv_free_ char **l = NULL;
|
||||
char **l;
|
||||
usec_t lifetime_usec;
|
||||
struct in6_addr router;
|
||||
bool updated = false, logged_about_too_many = false;
|
||||
@@ -1054,7 +1053,7 @@ static int ndisc_router_process_dnssl(Link *link, sd_ndisc_router *rt) {
|
||||
if (link->network->ndisc_use_domains == DHCP_USE_DOMAINS_NO)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &router);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get router address from RA: %m");
|
||||
|
||||
@@ -1145,11 +1144,10 @@ DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt) {
|
||||
_cleanup_(ndisc_captive_portal_freep) NDiscCaptivePortal *new_entry = NULL;
|
||||
_cleanup_free_ char *captive_portal = NULL;
|
||||
const char *uri;
|
||||
usec_t lifetime_usec;
|
||||
NDiscCaptivePortal *exist;
|
||||
struct in6_addr router;
|
||||
const char *uri;
|
||||
size_t len;
|
||||
int r;
|
||||
|
||||
assert(link);
|
||||
@@ -1159,7 +1157,7 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
|
||||
if (!link->network->ndisc_use_captive_portal)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &router);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get router address from RA: %m");
|
||||
|
||||
@@ -1170,31 +1168,25 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get lifetime of RA message: %m");
|
||||
|
||||
r = sd_ndisc_router_captive_portal_get_uri(rt, &uri, &len);
|
||||
r = sd_ndisc_router_get_captive_portal(rt, &uri);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get captive portal from RA: %m");
|
||||
|
||||
if (len == 0)
|
||||
return log_link_warning_errno(link, SYNTHETIC_ERRNO(EBADMSG), "Received empty captive portal, ignoring.");
|
||||
|
||||
r = make_cstring(uri, len, MAKE_CSTRING_REFUSE_TRAILING_NUL, &captive_portal);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to convert captive portal URI: %m");
|
||||
|
||||
if (!in_charset(captive_portal, URI_VALID))
|
||||
return log_link_warning_errno(link, SYNTHETIC_ERRNO(EBADMSG), "Received invalid captive portal, ignoring.");
|
||||
captive_portal = strdup(uri);
|
||||
if (!captive_portal)
|
||||
return log_oom();
|
||||
|
||||
if (lifetime_usec == 0) {
|
||||
/* Drop the portal with zero lifetime. */
|
||||
ndisc_captive_portal_free(set_remove(link->ndisc_captive_portals,
|
||||
&(NDiscCaptivePortal) {
|
||||
&(const NDiscCaptivePortal) {
|
||||
.captive_portal = captive_portal,
|
||||
}));
|
||||
return 0;
|
||||
}
|
||||
|
||||
exist = set_get(link->ndisc_captive_portals,
|
||||
&(NDiscCaptivePortal) {
|
||||
&(const NDiscCaptivePortal) {
|
||||
.captive_portal = captive_portal,
|
||||
});
|
||||
if (exist) {
|
||||
@@ -1268,7 +1260,7 @@ static int ndisc_router_process_pref64(Link *link, sd_ndisc_router *rt) {
|
||||
_cleanup_free_ NDiscPREF64 *new_entry = NULL;
|
||||
usec_t lifetime_usec;
|
||||
struct in6_addr a, router;
|
||||
unsigned prefix_len;
|
||||
uint8_t prefix_len;
|
||||
NDiscPREF64 *exist;
|
||||
int r;
|
||||
|
||||
@@ -1279,7 +1271,7 @@ static int ndisc_router_process_pref64(Link *link, sd_ndisc_router *rt) {
|
||||
if (!link->network->ndisc_use_pref64)
|
||||
return 0;
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &router);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to get router address from RA: %m");
|
||||
|
||||
@@ -1617,7 +1609,7 @@ static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) {
|
||||
assert(link->manager);
|
||||
assert(rt);
|
||||
|
||||
r = sd_ndisc_router_get_address(rt, &router);
|
||||
r = sd_ndisc_router_get_sender_address(rt, &router);
|
||||
if (r == -ENODATA) {
|
||||
log_link_debug(link, "Received RA without router address, ignoring.");
|
||||
return 0;
|
||||
|
||||
@@ -33,25 +33,26 @@ sd_ndisc_router *sd_ndisc_router_ref(sd_ndisc_router *rt);
|
||||
sd_ndisc_router *sd_ndisc_router_unref(sd_ndisc_router *rt);
|
||||
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ndisc_router, sd_ndisc_router_unref);
|
||||
|
||||
int sd_ndisc_router_get_address(sd_ndisc_router *rt, struct in6_addr *ret);
|
||||
int sd_ndisc_router_get_sender_address(sd_ndisc_router *rt, struct in6_addr *ret);
|
||||
int sd_ndisc_router_get_timestamp(sd_ndisc_router *rt, clockid_t clock, uint64_t *ret);
|
||||
|
||||
int sd_ndisc_router_get_hop_limit(sd_ndisc_router *rt, uint8_t *ret);
|
||||
int sd_ndisc_router_get_flags(sd_ndisc_router *rt, uint64_t *ret);
|
||||
int sd_ndisc_router_get_preference(sd_ndisc_router *rt, unsigned *ret);
|
||||
int sd_ndisc_router_get_preference(sd_ndisc_router *rt, uint8_t *ret);
|
||||
int sd_ndisc_router_get_lifetime(sd_ndisc_router *rt, uint64_t *ret);
|
||||
int sd_ndisc_router_get_lifetime_timestamp(sd_ndisc_router *rt, clockid_t clock, uint64_t *ret);
|
||||
int sd_ndisc_router_get_reachable_time(sd_ndisc_router *rt, uint64_t *ret);
|
||||
int sd_ndisc_router_get_retransmission_time(sd_ndisc_router *rt, uint64_t *ret);
|
||||
int sd_ndisc_router_get_sender_mac(sd_ndisc_router *rt, struct ether_addr *ret);
|
||||
int sd_ndisc_router_get_mtu(sd_ndisc_router *rt, uint32_t *ret);
|
||||
int sd_ndisc_router_get_captive_portal(sd_ndisc_router *rt, const char **ret);
|
||||
|
||||
/* Generic option access */
|
||||
int sd_ndisc_router_option_rewind(sd_ndisc_router *rt);
|
||||
int sd_ndisc_router_option_next(sd_ndisc_router *rt);
|
||||
int sd_ndisc_router_option_get_type(sd_ndisc_router *rt, uint8_t *ret);
|
||||
int sd_ndisc_router_option_is_type(sd_ndisc_router *rt, uint8_t type);
|
||||
int sd_ndisc_router_option_get_raw(sd_ndisc_router *rt, const void **ret, size_t *ret_size);
|
||||
int sd_ndisc_router_option_get_raw(sd_ndisc_router *rt, const uint8_t **ret, size_t *ret_size);
|
||||
|
||||
/* Specific option access: SD_NDISC_OPTION_PREFIX_INFORMATION */
|
||||
int sd_ndisc_router_prefix_get_valid_lifetime(sd_ndisc_router *rt, uint64_t *ret);
|
||||
@@ -60,14 +61,14 @@ int sd_ndisc_router_prefix_get_preferred_lifetime(sd_ndisc_router *rt, uint64_t
|
||||
int sd_ndisc_router_prefix_get_preferred_lifetime_timestamp(sd_ndisc_router *rt, clockid_t clock, uint64_t *ret);
|
||||
int sd_ndisc_router_prefix_get_flags(sd_ndisc_router *rt, uint8_t *ret);
|
||||
int sd_ndisc_router_prefix_get_address(sd_ndisc_router *rt, struct in6_addr *ret);
|
||||
int sd_ndisc_router_prefix_get_prefixlen(sd_ndisc_router *rt, unsigned *ret);
|
||||
int sd_ndisc_router_prefix_get_prefixlen(sd_ndisc_router *rt, uint8_t *ret);
|
||||
|
||||
/* Specific option access: SD_NDISC_OPTION_ROUTE_INFORMATION */
|
||||
int sd_ndisc_router_route_get_lifetime(sd_ndisc_router *rt, uint64_t *ret);
|
||||
int sd_ndisc_router_route_get_lifetime_timestamp(sd_ndisc_router *rt, clockid_t clock, uint64_t *ret);
|
||||
int sd_ndisc_router_route_get_address(sd_ndisc_router *rt, struct in6_addr *ret);
|
||||
int sd_ndisc_router_route_get_prefixlen(sd_ndisc_router *rt, unsigned *ret);
|
||||
int sd_ndisc_router_route_get_preference(sd_ndisc_router *rt, unsigned *ret);
|
||||
int sd_ndisc_router_route_get_prefixlen(sd_ndisc_router *rt, uint8_t *ret);
|
||||
int sd_ndisc_router_route_get_preference(sd_ndisc_router *rt, uint8_t *ret);
|
||||
|
||||
/* Specific option access: SD_NDISC_OPTION_RDNSS */
|
||||
int sd_ndisc_router_rdnss_get_addresses(sd_ndisc_router *rt, const struct in6_addr **ret);
|
||||
@@ -79,12 +80,9 @@ int sd_ndisc_router_dnssl_get_domains(sd_ndisc_router *rt, char ***ret);
|
||||
int sd_ndisc_router_dnssl_get_lifetime(sd_ndisc_router *rt, uint64_t *ret);
|
||||
int sd_ndisc_router_dnssl_get_lifetime_timestamp(sd_ndisc_router *rt, clockid_t clock, uint64_t *ret);
|
||||
|
||||
/* Specific option access: SD_NDISC_OPTION_CAPTIVE_PORTAL */
|
||||
int sd_ndisc_router_captive_portal_get_uri(sd_ndisc_router *rt, const char **ret, size_t *ret_size);
|
||||
|
||||
/* Specific option access: SD_NDISC_OPTION_PREF64 */
|
||||
int sd_ndisc_router_prefix64_get_prefix(sd_ndisc_router *rt, struct in6_addr *ret);
|
||||
int sd_ndisc_router_prefix64_get_prefixlen(sd_ndisc_router *rt, unsigned *ret);
|
||||
int sd_ndisc_router_prefix64_get_prefixlen(sd_ndisc_router *rt, uint8_t *ret);
|
||||
int sd_ndisc_router_prefix64_get_lifetime(sd_ndisc_router *rt, uint64_t *ret);
|
||||
int sd_ndisc_router_prefix64_get_lifetime_timestamp(sd_ndisc_router *rt, clockid_t clock, uint64_t *ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user