mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-08 19:19:16 +00:00
libnetlink: Convert GETNEIGHTBL dumps to use rtnl_neightbldump_req
Add rtnl_neightbldump_req for neighbor table dumps using the proper ndtmsg as the header. Convert existing RTM_GETNEIGHTBL dumps to use it. Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
parent
9e0ab19c4d
commit
ff41db8a75
@ -57,6 +57,8 @@ int rtnl_ruledump_req(struct rtnl_handle *rth, int family)
|
||||
__attribute__((warn_unused_result));
|
||||
int rtnl_neighdump_req(struct rtnl_handle *rth, int family)
|
||||
__attribute__((warn_unused_result));
|
||||
int rtnl_neightbldump_req(struct rtnl_handle *rth, int family)
|
||||
__attribute__((warn_unused_result));
|
||||
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
|
||||
__attribute__((warn_unused_result));
|
||||
int rtnl_netconfdump_req(struct rtnl_handle *rth, int family)
|
||||
|
||||
@ -658,7 +658,7 @@ static int ipntable_show(int argc, char **argv)
|
||||
argc--; argv++;
|
||||
}
|
||||
|
||||
if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETNEIGHTBL) < 0) {
|
||||
if (rtnl_neightbldump_req(&rth, preferred_family) < 0) {
|
||||
perror("Cannot send dump request");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -282,6 +282,22 @@ int rtnl_neighdump_req(struct rtnl_handle *rth, int family)
|
||||
return send(rth->fd, &req, sizeof(req), 0);
|
||||
}
|
||||
|
||||
int rtnl_neightbldump_req(struct rtnl_handle *rth, int family)
|
||||
{
|
||||
struct {
|
||||
struct nlmsghdr nlh;
|
||||
struct ndtmsg ndtmsg;
|
||||
} req = {
|
||||
.nlh.nlmsg_len = sizeof(req),
|
||||
.nlh.nlmsg_type = RTM_GETNEIGHTBL,
|
||||
.nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
|
||||
.nlh.nlmsg_seq = rth->dump = ++rth->seq,
|
||||
.ndtmsg.ndtm_family = family,
|
||||
};
|
||||
|
||||
return send(rth->fd, &req, sizeof(req), 0);
|
||||
}
|
||||
|
||||
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
|
||||
{
|
||||
struct {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user