int rtnl_addrdump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
+int rtnl_addrlbldump_req(struct rtnl_handle *rth, int family)
+ __attribute__((warn_unused_result));
int rtnl_routedump_req(struct rtnl_handle *rth, int family)
__attribute__((warn_unused_result));
return -1;
}
- if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
+ if (rtnl_addrlbldump_req(&rth, af) < 0) {
perror("Cannot send dump request");
return 1;
}
return -1;
}
- if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
+ if (rtnl_addrlbldump_req(&rth, af) < 0) {
perror("Cannot send dump request");
return -1;
}
#include <errno.h>
#include <time.h>
#include <sys/uio.h>
+#include <linux/if_addrlabel.h>
#include "libnetlink.h"
return send(rth->fd, &req, sizeof(req), 0);
}
+int rtnl_addrlbldump_req(struct rtnl_handle *rth, int family)
+{
+ struct {
+ struct nlmsghdr nlh;
+ struct ifaddrlblmsg ifal;
+ } req = {
+ .nlh.nlmsg_len = sizeof(req),
+ .nlh.nlmsg_type = RTM_GETADDRLABEL,
+ .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ .nlh.nlmsg_seq = rth->dump = ++rth->seq,
+ .ifal.ifal_family = family,
+ };
+
+ return send(rth->fd, &req, sizeof(req), 0);
+}
+
int rtnl_routedump_req(struct rtnl_handle *rth, int family)
{
struct {