From 5fee3ed5e98604404d8d6d906f249a92251f2f5b Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 5 Jan 2017 11:48:34 +0100 Subject: [PATCH] client: print refid also as string in ntpdata output --- client.c | 7 +++++-- doc/chronyc.adoc | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client.c b/client.c index b4dc271..dbc9d6f 100644 --- a/client.c +++ b/client.c @@ -2301,7 +2301,7 @@ process_cmd_ntpdata(char *line) "Precision : %d (%.9f seconds)\n" "Root delay : %.6f seconds\n" "Root dispersion : %.6f seconds\n" - "Reference ID : %R\n" + "Reference ID : %R (%s)\n" "Reference time : %T\n" "Offset : %+.9f seconds\n" "Peer delay : %.9f seconds\n" @@ -2325,7 +2325,10 @@ process_cmd_ntpdata(char *line) reply.data.ntp_data.precision, UTI_Log2ToDouble(reply.data.ntp_data.precision), UTI_FloatNetworkToHost(reply.data.ntp_data.root_delay), UTI_FloatNetworkToHost(reply.data.ntp_data.root_dispersion), - (unsigned long)ntohl(reply.data.ntp_data.ref_id), &ref_time, + (unsigned long)ntohl(reply.data.ntp_data.ref_id), + reply.data.ntp_data.stratum <= 1 ? + UTI_RefidToString(ntohl(reply.data.ntp_data.ref_id)) : "", + &ref_time, UTI_FloatNetworkToHost(reply.data.ntp_data.offset), UTI_FloatNetworkToHost(reply.data.ntp_data.peer_delay), UTI_FloatNetworkToHost(reply.data.ntp_data.peer_dispersion), diff --git a/doc/chronyc.adoc b/doc/chronyc.adoc index fe79e44..2bdc9be 100644 --- a/doc/chronyc.adoc +++ b/doc/chronyc.adoc @@ -458,7 +458,7 @@ Poll interval : 10 (1024 seconds) Precision : -24 (0.000000060 seconds) Root delay : 0.000015 seconds Root dispersion : 0.000015 seconds -Reference ID : 50505331 +Reference ID : 47505300 (GPS) Reference time : Fri Nov 25 15:22:12 2016 Offset : -0.000060878 seconds Peer delay : 0.000175634 seconds