mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
rtnlutil: Add utility to DUMP ipv4 routes
This commit is contained in:
parent
83db65e929
commit
1c7e803dbb
@ -295,3 +295,17 @@ void rtnl_route_extract_ipv4(const struct rtmsg *rtmsg, uint32_t len,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t rtnl_route_dump_ipv4(struct l_netlink *rtnl,
|
||||
l_netlink_command_func_t cb, void *user_data,
|
||||
l_netlink_destroy_func_t destroy)
|
||||
{
|
||||
struct rtmsg rtmsg;
|
||||
|
||||
memset(&rtmsg, 0, sizeof(struct rtmsg));
|
||||
rtmsg.rtm_family = AF_INET;
|
||||
|
||||
return l_netlink_send(rtnl, RTM_GETROUTE, NLM_F_DUMP, &rtmsg,
|
||||
sizeof(struct rtmsg), cb, user_data,
|
||||
destroy);
|
||||
}
|
||||
|
@ -51,3 +51,6 @@ uint32_t rtnl_ifaddr_delete(struct l_netlink *rtnl, int ifindex,
|
||||
void rtnl_route_extract_ipv4(const struct rtmsg *rtmsg, uint32_t len,
|
||||
uint32_t *ifindex, char **dst, char **gateway,
|
||||
char **src);
|
||||
uint32_t rtnl_route_dump_ipv4(struct l_netlink *rtnl,
|
||||
l_netlink_command_func_t cb, void *user_data,
|
||||
l_netlink_destroy_func_t destroy);
|
||||
|
Loading…
Reference in New Issue
Block a user