client: print addresses with refids in ntpdata report

This commit is contained in:
Miroslav Lichvar 2016-12-05 10:44:04 +01:00
parent 46061d8eec
commit 979b53866d
2 changed files with 10 additions and 8 deletions

View file

@ -2215,9 +2215,9 @@ process_cmd_ntpdata(char *line)
UTI_IPNetworkToHost(&reply.data.ntp_data.local_addr, &local_addr); UTI_IPNetworkToHost(&reply.data.ntp_data.local_addr, &local_addr);
UTI_TimespecNetworkToHost(&reply.data.ntp_data.ref_time, &ref_time); UTI_TimespecNetworkToHost(&reply.data.ntp_data.ref_time, &ref_time);
print_report("Remote address : %s\n" print_report("Remote address : %s (%R)\n"
"Remote port : %u\n" "Remote port : %u\n"
"Local address : %s\n" "Local address : %s (%R)\n"
"Leap status : %L\n" "Leap status : %L\n"
"Version : %u\n" "Version : %u\n"
"Mode : %M\n" "Mode : %M\n"
@ -2241,8 +2241,9 @@ process_cmd_ntpdata(char *line)
"Total TX : %U\n" "Total TX : %U\n"
"Total RX : %U\n" "Total RX : %U\n"
"Total valid RX : %U\n", "Total valid RX : %U\n",
UTI_IPToString(&remote_addr), ntohs(reply.data.ntp_data.remote_port), UTI_IPToString(&remote_addr), (unsigned long)UTI_IPToRefid(&remote_addr),
UTI_IPToString(&local_addr), ntohs(reply.data.ntp_data.remote_port),
UTI_IPToString(&local_addr), (unsigned long)UTI_IPToRefid(&local_addr),
reply.data.ntp_data.leap, reply.data.ntp_data.version, reply.data.ntp_data.leap, reply.data.ntp_data.version,
reply.data.ntp_data.mode, reply.data.ntp_data.stratum, reply.data.ntp_data.mode, reply.data.ntp_data.stratum,
reply.data.ntp_data.poll, UTI_Log2ToDouble(reply.data.ntp_data.precision), reply.data.ntp_data.poll, UTI_Log2ToDouble(reply.data.ntp_data.precision),

View file

@ -447,9 +447,9 @@ NTP-specific information about the NTP source. An example of the output is
shown below. shown below.
+ +
---- ----
Remote address : 203.0.113.15 Remote address : 203.0.113.15 (CB00710F)
Remote port : 123 Remote port : 123
Local address : 203.0.113.74 Local address : 203.0.113.74 (CB00714A)
Leap status : Normal Leap status : Normal
Version : 4 Version : 4
Mode : Server Mode : Server
@ -478,12 +478,13 @@ Total valid RX : 24
The fields are explained as follows: The fields are explained as follows:
+ +
*Remote address*::: *Remote address*:::
The IP address of the NTP server or peer. The IP address of the NTP server or peer, and the corresponding reference ID.
*Remote port*::: *Remote port*:::
The UDP port number to which the request was sent. The standard NTP port is The UDP port number to which the request was sent. The standard NTP port is
123. 123.
*Local address*::: *Local address*:::
The local IP address which received the response. The local IP address which received the response, and the corresponding
reference ID.
*Leap status*::: *Leap status*:::
*Version*::: *Version*:::
*Mode*::: *Mode*:::