]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/tcp_metrics.c
lib: Add parse_one_of(), parse_on_off()
[mirror_iproute2.git] / ip / tcp_metrics.c
index ad3d6f363003dfc9ab6f29ce37c88c6950ea68ab..acbd745ab09ed596f01c0a9f6a11b3e00342b05a 100644 (file)
 
 static void usage(void)
 {
-       fprintf(stderr, "Usage: ip tcp_metrics/tcpmetrics { COMMAND | help }\n");
-       fprintf(stderr, "       ip tcp_metrics { show | flush } SELECTOR\n");
-       fprintf(stderr, "       ip tcp_metrics delete [ address ] ADDRESS\n");
-       fprintf(stderr, "SELECTOR := [ [ address ] PREFIX ]\n");
+       fprintf(stderr,
+               "Usage: ip tcp_metrics/tcpmetrics { COMMAND | help }\n"
+               "       ip tcp_metrics { show | flush } SELECTOR\n"
+               "       ip tcp_metrics delete [ address ] ADDRESS\n"
+               "SELECTOR := [ [ address ] PREFIX ]\n");
        exit(-1);
 }
 
@@ -156,8 +157,7 @@ static void print_tcp_metrics(struct rtattr *a)
        }
 }
 
-static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
-                      void *arg)
+static int process_msg(struct nlmsghdr *n, void *arg)
 {
        FILE *fp = (FILE *) arg;
        struct genlmsghdr *ghdr;
@@ -501,7 +501,7 @@ static int tcpm_do_cmd(int cmd, int argc, char **argv)
        } else if (atype >= 0) {
                if (rtnl_talk(&grth, &req.n, &answer) < 0)
                        return -2;
-               if (process_msg(NULL, answer, stdout) < 0) {
+               if (process_msg(answer, stdout) < 0) {
                        fprintf(stderr, "Dump terminated\n");
                        exit(1);
                }