IPAddr ip_addr;
uint8_t state_char;
uint8_t authentication;
- uint8_t pad[2];
+ uint8_t leap;
+ uint8_t pad;
uint16_t conf_options;
uint16_t eff_options;
uint32_t last_sample_ago;
integer = va_arg(ap, int);
switch (integer) {
case LEAP_Normal:
- string = "Normal";
+ string = width != 1 ? "Normal" : "N";
break;
case LEAP_InsertSecond:
- string = "Insert second";
+ string = width != 1 ? "Insert second" : "+";
break;
case LEAP_DeleteSecond:
- string = "Delete second";
+ string = width != 1 ? "Delete second" : "-";
break;
case LEAP_Unsynchronised:
- string = "Not synchronised";
+ string = width != 1 ? "Not synchronised" : "?";
break;
default:
- string = "Invalid";
+ string = width != 1 ? "Invalid" : "?";
break;
}
printf("%s", string);
printf( "| | | | |\n");
}
- print_header("S Name/IP Address Auth COpts EOpts Last Score Interval ");
+ print_header("S Name/IP Address Auth COpts EOpts Last Score Interval Leap");
- /* "S NNNNNNNNNNNNNNNNNNNNNNNNN A OOOO- OOOO- LLLL SSSSS LLLLLLL LLLLLLL" */
+ /* "S NNNNNNNNNNNNNNNNNNNNNNNNN A OOOO- OOOO- LLLL SSSSS IIIIIII IIIIIII L" */
for (i = 0; i < n_sources; i++) {
request.command = htons(REQ_SELECT_DATA);
conf_options = ntohs(reply.data.select_data.conf_options);
eff_options = ntohs(reply.data.select_data.eff_options);
- print_report("%c %-25s %c %c%c%c%c%c %c%c%c%c%c %I %5.1f %+S %+S\n",
+ print_report("%c %-25s %c %c%c%c%c%c %c%c%c%c%c %I %5.1f %+S %+S %1L\n",
reply.data.select_data.state_char,
name,
reply.data.select_data.authentication ? 'Y' : 'N',
UTI_FloatNetworkToHost(reply.data.select_data.score),
UTI_FloatNetworkToHost(reply.data.select_data.lo_limit),
UTI_FloatNetworkToHost(reply.data.select_data.hi_limit),
+ reply.data.select_data.leap,
REPORT_END);
}
UTI_IPHostToNetwork(&report.ip_addr, &tx_message->data.select_data.ip_addr);
tx_message->data.select_data.state_char = report.state_char;
tx_message->data.select_data.authentication = report.authentication;
+ tx_message->data.select_data.leap = report.leap;
tx_message->data.select_data.conf_options = htons(convert_select_options(report.conf_options));
tx_message->data.select_data.eff_options = htons(convert_select_options(report.eff_options));
tx_message->data.select_data.last_sample_ago = htonl(report.last_sample_ago);
An example of the output is shown below.
+
----
-S Name/IP Address Auth COpts EOpts Last Score Interval
-====================================================================
-D foo.example.net Y ----- --TR- 4 1.0 -61ms +62ms
-* bar.example.net N ----- ----- 0 1.0 -6846us +7305us
-+ baz.example.net N ----- ----- 10 1.0 -7381us +7355us
+S Name/IP Address Auth COpts EOpts Last Score Interval Leap
+=======================================================================
+D foo.example.net Y ----- --TR- 4 1.0 -61ms +62ms N
+* bar.example.net N ----- ----- 0 1.0 -6846us +7305us N
++ baz.example.net N ----- ----- 10 1.0 -7381us +7355us N
----
+
The columns are as follows:
This column displays the lower and upper endpoint of the interval which was
expected to contain the true offset of the local clock considering the root
distance at the time of the selection.
+*Leap*:::
+This column displays the current leap status of the source.
+* _N_ indicates the normal status (no leap second).
+* _+_ indicates that a leap second will be inserted at the end of the month.
+* _-_ indicates that a leap second will be deleted at the end of the month.
+* _?_ indicates the unknown status (i.e. no valid measurement was made).
[[reselect]]*reselect*::
To avoid excessive switching between sources, *chronyd* can stay synchronised
IPAddr ip_addr;
char state_char;
int authentication;
+ NTP_Leap leap;
int conf_options;
int eff_options;
uint32_t last_sample_ago;
report->ip_addr.family = IPADDR_UNSPEC;
report->state_char = get_status_char(inst->status);
report->authentication = inst->authenticated;
+ report->leap = inst->leap;
report->conf_options = inst->conf_sel_options;
report->eff_options = inst->sel_options;
report->last_sample_ago = inst->sel_info.last_sample_ago;
Total valid RX : [0-9]+$" || test_fail
run_chronyc "selectdata" || test_fail
-check_chronyc_output "^S Name/IP Address Auth COpts EOpts Last Score Interval +
-====================================================================
-M 127\.0\.0\.1 N ----- ----- 0 1\.0 \+0ns \+0ns$" || test_fail
+check_chronyc_output "^S Name/IP Address Auth COpts EOpts Last Score Interval Leap
+=======================================================================
+M 127\.0\.0\.1 N ----- ----- 0 1\.0 \+0ns \+0ns \?$" || test_fail
run_chronyc "serverstats" || test_fail
check_chronyc_output "^NTP packets received : [0-9]+