X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Finfo.c;h=652c4aebcbecb44af6824f0b036876913f2ddb0d;hb=0f0585d71b28428792e53258bc570dddc17b0b27;hp=09e65805d901c19d6e07337c4dfae9162c191ac3;hpb=f6e87ab476a0faf8b124ecaaa27f967d825e6457;p=tinc diff --git a/src/info.c b/src/info.c index 09e65805..652c4aeb 100644 --- a/src/info.c +++ b/src/info.c @@ -70,15 +70,16 @@ static int info_node(int fd, const char *item) { } status_union; node_status_t status; long int last_state_change; + long int udp_ping_rtt; 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", &code, &req, node, id, host, port, &cipher, &digest, &maclength, &compression, &options, &status_union.raw, 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 %"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); if(n == 2) { break; } - if(n != 19) { + if(n != 20) { fprintf(stderr, "Unable to parse node dump from tincd.\n"); return 1; } @@ -143,6 +144,8 @@ static int info_node(int fd, const char *item) { if(status.udp_confirmed) { printf(" udp_confirmed"); + if(udp_ping_rtt != -1) + printf(" (rtt %ld.%03ld)", udp_ping_rtt/1000, udp_ping_rtt%1000); } printf("\n");