#include <fcntl.h>
#include <sys/socket.h>
#include <sys/time.h>
-#include <net/if.h>
#include <netinet/in.h>
#include <string.h>
fwrite((void*)n1, 1, NLMSG_ALIGN(n1->nlmsg_len), fp);
}
-static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
+static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
void *arg)
{
FILE *fp = (FILE*)arg;
exit(-1);
}
if (llink)
- groups |= RTMGRP_LINK;
+ groups |= nl_mgrp(RTNLGRP_LINK);
if (laddr) {
if (!family || family == AF_INET)
- groups |= RTMGRP_IPV4_IFADDR;
+ groups |= nl_mgrp(RTNLGRP_IPV4_IFADDR);
if (!family || family == AF_INET6)
- groups |= RTMGRP_IPV6_IFADDR;
+ groups |= nl_mgrp(RTNLGRP_IPV6_IFADDR);
}
if (lroute) {
if (!family || family == AF_INET)
- groups |= RTMGRP_IPV4_ROUTE;
+ groups |= nl_mgrp(RTNLGRP_IPV4_ROUTE);
if (!family || family == AF_INET6)
- groups |= RTMGRP_IPV6_ROUTE;
+ groups |= nl_mgrp(RTNLGRP_IPV6_ROUTE);
}
fp = fopen(file, "w");