diff --git a/src/rtnlutil.c b/src/rtnlutil.c index b1d6450e..0cee5ff5 100644 --- a/src/rtnlutil.c +++ b/src/rtnlutil.c @@ -448,3 +448,24 @@ void rtnl_ifaddr_ipv6_extract(const struct ifaddrmsg *ifa, int len, char **ip) } } } + +uint32_t rtnl_ifaddr_ipv6_get(struct l_netlink *rtnl, + l_netlink_command_func_t cb, void *user_data, + l_netlink_destroy_func_t destroy) +{ + struct ifaddrmsg *rtmmsg; + uint32_t id; + + rtmmsg = l_malloc(sizeof(struct ifaddrmsg)); + memset(rtmmsg, 0, sizeof(struct ifaddrmsg)); + + rtmmsg->ifa_family = AF_INET6; + + id = l_netlink_send(rtnl, RTM_GETADDR, NLM_F_DUMP, rtmmsg, + sizeof(struct ifaddrmsg), cb, user_data, + destroy); + + l_free(rtmmsg); + + return id; +} diff --git a/src/rtnlutil.h b/src/rtnlutil.h index 8c0a923d..ff1427c5 100644 --- a/src/rtnlutil.h +++ b/src/rtnlutil.h @@ -70,3 +70,7 @@ uint32_t rtnl_route_ipv4_add_gateway(struct l_netlink *rtnl, int ifindex, void rtnl_ifaddr_ipv6_extract(const struct ifaddrmsg *ifa, int bytes, char **ip); +uint32_t rtnl_ifaddr_ipv6_get(struct l_netlink *rtnl, + l_netlink_command_func_t cb, + void *user_data, + l_netlink_destroy_func_t destroy);