X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Ftincctl.c;fp=src%2Ftincctl.c;h=12e5ead920b5a3209030adcf855b4bb09b3989c8;hb=22ae0c3549628739ca7c40e48ce1a276469ded92;hp=cf19d4818554d641191dba148b4d9c355d972d86;hpb=15341e7697fe88a9f3b4646a2cb784dc515609bd;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index cf19d481..12e5ead9 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1298,12 +1298,14 @@ static int cmd_dump(int argc, char *argv[]) { unsigned int options, status_int; node_status_t status; long int last_state_change; + int udp_ping_rtt; + uint64_t in_packets, in_bytes, out_packets, out_bytes; switch(req) { case REQ_DUMP_NODES: { - int n = sscanf(line, "%*d %*d %4095s %4095s %4095s port %4095s %d %d %d %d %x %x %4095s %4095s %d %hd %hd %hd %ld", node, id, host, port, &cipher, &digest, &maclength, &compression, &options, &status_int, nexthop, via, &distance, &pmtu, &minmtu, &maxmtu, &last_state_change); + int n = sscanf(line, "%*d %*d %4095s %4095s %4095s port %4095s %d %d %d %d %x %x %4095s %4095s %d %hd %hd %hd %ld %d %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64, node, id, host, port, &cipher, &digest, &maclength, &compression, &options, &status_int, nexthop, via, &distance, &pmtu, &minmtu, &maxmtu, &last_state_change, &udp_ping_rtt, &in_packets, &in_bytes, &out_packets, &out_bytes); - if(n != 17) { + if(n != 22) { fprintf(stderr, "Unable to parse node dump from tincd: %s\n", line); return 1; } @@ -1331,8 +1333,14 @@ static int cmd_dump(int argc, char *argv[]) { continue; } - printf("%s id %s at %s port %s cipher %d digest %d maclength %d compression %d options %x status %04x nexthop %s via %s distance %d pmtu %d (min %d max %d)\n", - node, id, host, port, cipher, digest, maclength, compression, options, status_int, nexthop, via, distance, pmtu, minmtu, maxmtu); + printf("%s id %s at %s port %s cipher %d digest %d maclength %d compression %d options %x status %04x nexthop %s via %s distance %d pmtu %d (min %d max %d) rx %"PRIu64" %"PRIu64" tx %"PRIu64" %"PRIu64, + node, id, host, port, cipher, digest, maclength, compression, options, status_int, nexthop, via, distance, pmtu, minmtu, maxmtu, in_packets, in_bytes, out_packets, out_bytes); + + if(udp_ping_rtt != -1) { + printf(" rtt %d.%03d", udp_ping_rtt / 1000, udp_ping_rtt % 1000); + } + + printf("\n"); } } break;