mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-03 01:17:45 +03:00
parent
d30d6d8166
commit
073eba2319
@ -34,27 +34,6 @@ sd_ndisc_router *ndisc_router_new(size_t raw_size) {
|
|||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sd_ndisc_router_from_raw(sd_ndisc_router **ret, const void *raw, size_t raw_size) {
|
|
||||||
_cleanup_(sd_ndisc_router_unrefp) sd_ndisc_router *rt = NULL;
|
|
||||||
int r;
|
|
||||||
|
|
||||||
assert_return(ret, -EINVAL);
|
|
||||||
assert_return(raw || raw_size <= 0, -EINVAL);
|
|
||||||
|
|
||||||
rt = ndisc_router_new(raw_size);
|
|
||||||
if (!rt)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
memcpy(NDISC_ROUTER_RAW(rt), raw, raw_size);
|
|
||||||
r = ndisc_router_parse(NULL, rt);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
*ret = TAKE_PTR(rt);
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sd_ndisc_router_get_address(sd_ndisc_router *rt, struct in6_addr *ret_addr) {
|
int sd_ndisc_router_get_address(sd_ndisc_router *rt, struct in6_addr *ret_addr) {
|
||||||
assert_return(rt, -EINVAL);
|
assert_return(rt, -EINVAL);
|
||||||
assert_return(ret_addr, -EINVAL);
|
assert_return(ret_addr, -EINVAL);
|
||||||
|
@ -82,7 +82,6 @@ int sd_ndisc_set_ifname(sd_ndisc *nd, const char *interface_name);
|
|||||||
int sd_ndisc_get_ifname(sd_ndisc *nd, const char **ret);
|
int sd_ndisc_get_ifname(sd_ndisc *nd, const char **ret);
|
||||||
int sd_ndisc_set_mac(sd_ndisc *nd, const struct ether_addr *mac_addr);
|
int sd_ndisc_set_mac(sd_ndisc *nd, const struct ether_addr *mac_addr);
|
||||||
|
|
||||||
int sd_ndisc_router_from_raw(sd_ndisc_router **ret, const void *raw, size_t raw_size);
|
|
||||||
sd_ndisc_router *sd_ndisc_router_ref(sd_ndisc_router *rt);
|
sd_ndisc_router *sd_ndisc_router_ref(sd_ndisc_router *rt);
|
||||||
sd_ndisc_router *sd_ndisc_router_unref(sd_ndisc_router *rt);
|
sd_ndisc_router *sd_ndisc_router_unref(sd_ndisc_router *rt);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user