__attribute__((warn_unused_result));
int rtnl_routedump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_ruledump_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, af, RTM_GETRULE) < 0) {
+ if (rtnl_ruledump_req(&rth, af) < 0) {
perror("Cannot send dump request");
return 1;
}
#include <errno.h>
#include <time.h>
#include <sys/uio.h>
+#include <linux/fib_rules.h>
#include <linux/if_addrlabel.h>
#include <linux/if_bridge.h>
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_ruledump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct fib_rule_hdr frh;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETRULE,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .frh.family = family
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_mdbdump_req(struct rtnl_handle *rth, int family)
{
struct {