]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/rtmon.c
ll_map: Add function to remove link cache entry by index
[mirror_iproute2.git] / ip / rtmon.c
index 94baa38e3b7cbc16d042e31ca40a3c2c91f1c819..7373443f2f8ab18380ac21534d41ba492c217f9c 100644 (file)
@@ -13,7 +13,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/time.h>
@@ -44,7 +43,7 @@ static void write_stamp(FILE *fp)
        fwrite((void *)n1, 1, NLMSG_ALIGN(n1->nlmsg_len), fp);
 }
 
-static int dump_msg(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
+static int dump_msg(struct rtnl_ctrl_data *ctrl,
                    struct nlmsghdr *n, void *arg)
 {
        FILE *fp = (FILE *)arg;
@@ -56,15 +55,16 @@ static int dump_msg(const struct sockaddr_nl *who, struct rtnl_ctrl_data *ctrl,
        return 0;
 }
 
-static int dump_msg2(const struct sockaddr_nl *who,
-                    struct nlmsghdr *n, void *arg)
+static int dump_msg2(struct nlmsghdr *n, void *arg)
 {
-       return dump_msg(who, NULL, n, arg);
+       return dump_msg(NULL, n, arg);
 }
 
 static void usage(void)
 {
-       fprintf(stderr, "Usage: rtmon file FILE [ all | LISTofOBJECTS]\n");
+       fprintf(stderr, "Usage: rtmon [ OPTIONS ] file FILE [ all | LISTofOBJECTS ]\n");
+       fprintf(stderr, "OPTIONS := { -f[amily] { inet | inet6 | link | help } |\n"
+                       "             -4 | -6 | -0 | -V[ersion] }\n");
        fprintf(stderr, "LISTofOBJECTS := [ link ] [ address ] [ route ]\n");
        exit(-1);
 }
@@ -162,7 +162,7 @@ main(int argc, char **argv)
        if (rtnl_open(&rth, groups) < 0)
                exit(1);
 
-       if (rtnl_wilddump_request(&rth, AF_UNSPEC, RTM_GETLINK) < 0) {
+       if (rtnl_linkdump_req(&rth, AF_UNSPEC) < 0) {
                perror("Cannot send dump request");
                exit(1);
        }