X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Finfo.c;h=9ac7bbcae36181bd264a1f083a04c8d65e3fb629;hb=72136f8418bc7e8a0a5bf3c11215aa49dc679659;hp=652c4aebcbecb44af6824f0b036876913f2ddb0d;hpb=0f0585d71b28428792e53258bc570dddc17b0b27;p=tinc diff --git a/src/info.c b/src/info.c index 652c4aeb..9ac7bbca 100644 --- a/src/info.c +++ b/src/info.c @@ -71,15 +71,16 @@ static int info_node(int fd, const char *item) { node_status_t status; long int last_state_change; long int udp_ping_rtt; + uint64_t in_packets, in_bytes, out_packets, out_bytes; while(recvline(fd, line, sizeof(line))) { - int n = sscanf(line, "%d %d %4095s %4095s %4095s port %4095s %d %d %d %d %x %"PRIx32" %4095s %4095s %d %hd %hd %hd %ld %ld", &code, &req, node, id, host, port, &cipher, &digest, &maclength, &compression, &options, &status_union.raw, nexthop, via, &distance, &pmtu, &minmtu, &maxmtu, &last_state_change, &udp_ping_rtt); + int n = sscanf(line, "%d %d %4095s %4095s %4095s port %4095s %d %d %d %d %x %"PRIx32" %4095s %4095s %d %hd %hd %hd %ld %ld %lu %lu %lu %lu", &code, &req, node, id, host, port, &cipher, &digest, &maclength, &compression, &options, &status_union.raw, nexthop, via, &distance, &pmtu, &minmtu, &maxmtu, &last_state_change, &udp_ping_rtt, &in_packets, &in_bytes, &out_packets, &out_bytes); if(n == 2) { break; } - if(n != 20) { + if(n != 24) { fprintf(stderr, "Unable to parse node dump from tincd.\n"); return 1; } @@ -188,6 +189,9 @@ static int info_node(int fd, const char *item) { printf("none, forwarded via %s\n", nexthop); } + printf("RX: %lu packets %lu bytes\n", in_packets, in_bytes); + printf("TX: %lu packets %lu bytes\n", out_packets, out_bytes); + // List edges printf("Edges: "); sendline(fd, "%d %d %s", CONTROL, REQ_DUMP_EDGES, item);