]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/iproute.c
Merge branch 'iproute2-master' into iproute2-next
[mirror_iproute2.git] / ip / iproute.c
index 1a68183c4f49bca11289b959e2f0298620e2d33e..26f7cd8915bfaa6fa50ddeb2e0fb8cbbf2147edf 100644 (file)
@@ -83,7 +83,7 @@ static void usage(void)
                "INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...\n"
                "NH := [ encap ENCAPTYPE ENCAPHDR ] [ via [ FAMILY ] ADDRESS ]\n"
                "           [ dev STRING ] [ weight NUMBER ] NHFLAGS\n"
-               "FAMILY := [ inet | inet6 | ipx | dnet | mpls | bridge | link ]\n"
+               "FAMILY := [ inet | inet6 | dnet | mpls | bridge | link ]\n"
                "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ] [ as [ to ] ADDRESS ]\n"
                "           [ rtt TIME ] [ rttvar TIME ] [ reordering NUMBER ]\n"
                "           [ window NUMBER ] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"
@@ -708,7 +708,7 @@ static void print_rta_multipath(FILE *fp, const struct rtmsg *r,
        }
 }
 
-int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_route(struct nlmsghdr *n, void *arg)
 {
        FILE *fp = (FILE *)arg;
        struct rtmsg *r = NLMSG_DATA(n);
@@ -1580,8 +1580,7 @@ static int iproute_flush_cache(void)
 
 static __u32 route_dump_magic = 0x45311224;
 
-static int save_route(const struct sockaddr_nl *who, struct nlmsghdr *n,
-                     void *arg)
+static int save_route(struct nlmsghdr *n, void *arg)
 {
        int ret;
        int len = n->nlmsg_len;
@@ -1645,7 +1644,7 @@ static int iproute_flush(int do_ipv6, rtnl_filter_t filter_fn)
        filter.flushe = sizeof(flushb);
 
        for (;;) {
-               if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
+               if (rtnl_routedump_req(&rth, do_ipv6) < 0) {
                        perror("Cannot send dump request");
                        return -2;
                }
@@ -1891,7 +1890,7 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
                return iproute_flush(do_ipv6, filter_fn);
 
        if (!filter.cloned) {
-               if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
+               if (rtnl_routedump_req(&rth, do_ipv6) < 0) {
                        perror("Cannot send dump request");
                        return -2;
                }
@@ -2082,7 +2081,7 @@ static int iproute_get(int argc, char **argv)
                int len = answer->nlmsg_len;
                struct rtattr *tb[RTA_MAX+1];
 
-               if (print_route(NULL, answer, (void *)stdout) < 0) {
+               if (print_route(answer, (void *)stdout) < 0) {
                        fprintf(stderr, "An error :-)\n");
                        free(answer);
                        return -1;
@@ -2126,7 +2125,7 @@ static int iproute_get(int argc, char **argv)
                        return -2;
        }
 
-       if (print_route(NULL, answer, (void *)stdout) < 0) {
+       if (print_route(answer, (void *)stdout) < 0) {
                fprintf(stderr, "An error :-)\n");
                free(answer);
                return -1;
@@ -2144,8 +2143,7 @@ static int rtattr_cmp(const struct rtattr *rta1, const struct rtattr *rta2)
        return memcmp(RTA_DATA(rta1), RTA_DATA(rta2), RTA_PAYLOAD(rta1));
 }
 
-static int restore_handler(const struct sockaddr_nl *nl,
-                          struct rtnl_ctrl_data *ctrl,
+static int restore_handler(struct rtnl_ctrl_data *ctrl,
                           struct nlmsghdr *n, void *arg)
 {
        struct rtmsg *r = NLMSG_DATA(n);
@@ -2231,11 +2229,10 @@ static int iproute_restore(void)
        return 0;
 }
 
-static int show_handler(const struct sockaddr_nl *nl,
-                       struct rtnl_ctrl_data *ctrl,
+static int show_handler(struct rtnl_ctrl_data *ctrl,
                        struct nlmsghdr *n, void *arg)
 {
-       print_route(nl, n, stdout);
+       print_route(n, stdout);
        return 0;
 }