__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)
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);
}
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 {