]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/ipntable.c
fix print_0xhex on 32 bit
[mirror_iproute2.git] / ip / ipntable.c
index 82f40f87ae1528093befaebdedb91f329a91453d..50fc949f1fcc43fa63df03094b604fbbf0f47bfd 100644 (file)
@@ -346,7 +346,7 @@ static void print_ndtconfig(const struct ndt_config *ndtc)
                   "entry_size %u ", ndtc->ndtc_entry_size);
        print_uint(PRINT_ANY, "entries", "entries %u ", ndtc->ndtc_entries);
 
-       print_string(PRINT_FP, NULL, "%s", _SL_);
+       print_nl();
 
        print_string(PRINT_ANY, "last_flush",
                     "        last_flush %s ",
@@ -355,19 +355,19 @@ static void print_ndtconfig(const struct ndt_config *ndtc)
                     "last_rand %s ",
                     ntable_strtime_delta(ndtc->ndtc_last_rand));
 
-       print_string(PRINT_FP, NULL, "%s", _SL_);
+       print_nl();
 
        print_uint(PRINT_ANY, "hash_rnd",
                   "        hash_rnd %u ", ndtc->ndtc_hash_rnd);
        print_0xhex(PRINT_ANY, "hash_mask",
-                   "hash_mask %08x ", ndtc->ndtc_hash_mask);
+                   "hash_mask %08llx ", ndtc->ndtc_hash_mask);
 
        print_uint(PRINT_ANY, "hash_chain_gc",
                   "hash_chain_gc %u ", ndtc->ndtc_hash_chain_gc);
        print_uint(PRINT_ANY, "proxy_qlen",
                   "proxy_qlen %u ", ndtc->ndtc_proxy_qlen);
 
-       print_string(PRINT_FP, NULL, "%s", _SL_);
+       print_nl();
 }
 
 static void print_ndtparams(struct rtattr *tpb[])
@@ -379,7 +379,7 @@ static void print_ndtparams(struct rtattr *tpb[])
                print_string(PRINT_FP, NULL, "    dev ", NULL);
                print_color_string(PRINT_ANY, COLOR_IFNAME,
                                   "dev", "%s ", ll_index_to_name(ifindex));
-               print_string(PRINT_FP, NULL, "%s", _SL_);
+               print_nl();
        }
 
        print_string(PRINT_FP, NULL, "    ", NULL);
@@ -392,7 +392,7 @@ static void print_ndtparams(struct rtattr *tpb[])
        if (tpb[NDTPA_REACHABLE_TIME]) {
                __u64 reachable = rta_getattr_u64(tpb[NDTPA_REACHABLE_TIME]);
 
-               print_uint(PRINT_ANY, "reachable",
+               print_u64(PRINT_ANY, "reachable",
                           "reachable %llu ", reachable);
        }
 
@@ -400,14 +400,14 @@ static void print_ndtparams(struct rtattr *tpb[])
                __u64 breachable
                        = rta_getattr_u64(tpb[NDTPA_BASE_REACHABLE_TIME]);
 
-               print_uint(PRINT_ANY, "base_reachable",
+               print_u64(PRINT_ANY, "base_reachable",
                           "base_reachable %llu ", breachable);
        }
 
        if (tpb[NDTPA_RETRANS_TIME]) {
                __u64 retrans = rta_getattr_u64(tpb[NDTPA_RETRANS_TIME]);
 
-               print_uint(PRINT_ANY, "retrans", "retrans %llu ", retrans);
+               print_u64(PRINT_ANY, "retrans", "retrans %llu ", retrans);
        }
 
        print_string(PRINT_FP, NULL, "%s    ", _SL_);
@@ -415,14 +415,14 @@ static void print_ndtparams(struct rtattr *tpb[])
        if (tpb[NDTPA_GC_STALETIME]) {
                __u64 gc_stale = rta_getattr_u64(tpb[NDTPA_GC_STALETIME]);
 
-               print_uint(PRINT_ANY, "gc_stale", "gc_stale %llu ", gc_stale);
+               print_u64(PRINT_ANY, "gc_stale", "gc_stale %llu ", gc_stale);
        }
 
        if (tpb[NDTPA_DELAY_PROBE_TIME]) {
                __u64 delay_probe
                        = rta_getattr_u64(tpb[NDTPA_DELAY_PROBE_TIME]);
 
-               print_uint(PRINT_ANY, "delay_probe",
+               print_u64(PRINT_ANY, "delay_probe",
                           "delay_probe %llu ", delay_probe);
        }
 
@@ -459,14 +459,14 @@ static void print_ndtparams(struct rtattr *tpb[])
        if (tpb[NDTPA_ANYCAST_DELAY]) {
                __u64 anycast_delay = rta_getattr_u64(tpb[NDTPA_ANYCAST_DELAY]);
 
-               print_uint(PRINT_ANY, "anycast_delay",
+               print_u64(PRINT_ANY, "anycast_delay",
                           "anycast_delay %llu ", anycast_delay);
        }
 
        if (tpb[NDTPA_PROXY_DELAY]) {
                __u64 proxy_delay = rta_getattr_u64(tpb[NDTPA_PROXY_DELAY]);
 
-               print_uint(PRINT_ANY, "proxy_delay",
+               print_u64(PRINT_ANY, "proxy_delay",
                           "proxy_delay %llu ", proxy_delay);
        }
 
@@ -479,10 +479,10 @@ static void print_ndtparams(struct rtattr *tpb[])
        if (tpb[NDTPA_LOCKTIME]) {
                __u64 locktime = rta_getattr_u64(tpb[NDTPA_LOCKTIME]);
 
-               print_uint(PRINT_ANY, "locktime", "locktime %llu ", locktime);
+               print_u64(PRINT_ANY, "locktime", "locktime %llu ", locktime);
        }
 
-       print_string(PRINT_FP, NULL, "%s", _SL_);
+       print_nl();
 }
 
 static void print_ndtstats(const struct ndt_stats *ndts)
@@ -490,38 +490,37 @@ static void print_ndtstats(const struct ndt_stats *ndts)
 
        print_string(PRINT_FP, NULL, "    stats ", NULL);
 
-       print_uint(PRINT_ANY, "allocs", "allocs %llu ", ndts->ndts_allocs);
-       print_uint(PRINT_ANY, "destroys", "destroys %llu ",
+       print_u64(PRINT_ANY, "allocs", "allocs %llu ", ndts->ndts_allocs);
+       print_u64(PRINT_ANY, "destroys", "destroys %llu ",
                   ndts->ndts_destroys);
-       print_uint(PRINT_ANY, "hash_grows", "hash_grows %llu ",
+       print_u64(PRINT_ANY, "hash_grows", "hash_grows %llu ",
                   ndts->ndts_hash_grows);
 
        print_string(PRINT_FP, NULL, "%s    ", _SL_);
 
-       print_uint(PRINT_ANY, "res_failed", "res_failed %llu ",
+       print_u64(PRINT_ANY, "res_failed", "res_failed %llu ",
                   ndts->ndts_res_failed);
-       print_uint(PRINT_ANY, "lookups", "lookups %llu ", ndts->ndts_lookups);
-       print_uint(PRINT_ANY, "hits", "hits %llu ", ndts->ndts_hits);
+       print_u64(PRINT_ANY, "lookups", "lookups %llu ", ndts->ndts_lookups);
+       print_u64(PRINT_ANY, "hits", "hits %llu ", ndts->ndts_hits);
 
        print_string(PRINT_FP, NULL, "%s    ", _SL_);
 
-       print_uint(PRINT_ANY, "rcv_probes_mcast", "rcv_probes_mcast %llu ",
+       print_u64(PRINT_ANY, "rcv_probes_mcast", "rcv_probes_mcast %llu ",
                   ndts->ndts_rcv_probes_mcast);
-       print_uint(PRINT_ANY, "rcv_probes_ucast", "rcv_probes_ucast %llu ",
+       print_u64(PRINT_ANY, "rcv_probes_ucast", "rcv_probes_ucast %llu ",
                   ndts->ndts_rcv_probes_ucast);
 
        print_string(PRINT_FP, NULL, "%s    ", _SL_);
 
-       print_uint(PRINT_ANY, "periodic_gc_runs", "periodic_gc_runs %llu ",
+       print_u64(PRINT_ANY, "periodic_gc_runs", "periodic_gc_runs %llu ",
                   ndts->ndts_periodic_gc_runs);
-       print_uint(PRINT_ANY, "forced_gc_runs", "forced_gc_runs %llu ",
+       print_u64(PRINT_ANY, "forced_gc_runs", "forced_gc_runs %llu ",
                   ndts->ndts_forced_gc_runs);
 
-       print_string(PRINT_FP, NULL, "%s", _SL_);
+       print_nl();
 }
 
-static int print_ntable(const struct sockaddr_nl *who,
-                       struct nlmsghdr *n, void *arg)
+static int print_ntable(struct nlmsghdr *n, void *arg)
 {
        FILE *fp = (FILE *)arg;
        struct ndtmsg *ndtm = NLMSG_DATA(n);
@@ -579,7 +578,7 @@ static int print_ntable(const struct sockaddr_nl *who,
                print_string(PRINT_ANY, "name", "%s ", name);
        }
 
-       print_string(PRINT_FP, NULL, "%s", _SL_);
+       print_nl();
 
        ret = (tb[NDTA_THRESH1] || tb[NDTA_THRESH2] || tb[NDTA_THRESH3] ||
               tb[NDTA_GC_INTERVAL]);
@@ -607,11 +606,11 @@ static int print_ntable(const struct sockaddr_nl *who,
        if (tb[NDTA_GC_INTERVAL]) {
                __u64 gc_int = rta_getattr_u64(tb[NDTA_GC_INTERVAL]);
 
-               print_uint(PRINT_ANY, "gc_interval", "gc_int %llu ", gc_int);
+               print_u64(PRINT_ANY, "gc_interval", "gc_int %llu ", gc_int);
        }
 
        if (ret)
-               print_string(PRINT_FP, NULL, "%s", _SL_);
+               print_nl();
 
        if (tb[NDTA_CONFIG] && show_stats)
                print_ndtconfig(RTA_DATA(tb[NDTA_CONFIG]));
@@ -658,7 +657,7 @@ static int ipntable_show(int argc, char **argv)
                argc--; argv++;
        }
 
-       if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETNEIGHTBL) < 0) {
+       if (rtnl_neightbldump_req(&rth, preferred_family) < 0) {
                perror("Cannot send dump request");
                exit(1);
        }