From: Harlan Stenn Date: Wed, 1 Apr 2015 11:08:14 +0000 (+0000) Subject: [Bug 2798] sntp should decode and display the leap indicator X-Git-Tag: NTP_4_3_12~3^2~3^2^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cba9b5d1d89425254ed45694ad9b4a11fc6d4bea;p=thirdparty%2Fntp.git [Bug 2798] sntp should decode and display the leap indicator bk: 551bd19etX0ym8R_e0MBVyrYF73DGw --- diff --git a/html/sntp.html b/html/sntp.html index fa17203f2..84c6f29d5 100644 --- a/html/sntp.html +++ b/html/sntp.html @@ -11,7 +11,7 @@ giffrom Alice's Adventures in Wonderland, Lewis Carroll

S is for snakeoil.

Last update: - 7-Dec-2014 11:09 + 1-Apr-2015 11:05 UTC



@@ -20,8 +20,8 @@

Description

This program is a Simple Network Time Protocol (SNTP) client that can be used to query a Network Time Protocol (NTP) server and display the time offset of the system clock relative to the server clock. Run as root it can correct the system clock to this offset as well. It can be run as an interactive command or from a script by a cron job. The program implements the SNTP client protocol defined in RFC 5905, including the full on-wire protocol but does not provide the sanity checks, access controls, security functions and mitigation algorithms as in the full NTP version 4 specification, also defined in RFC 5905.

By default, sntp writes the local date and time (i.e., not UTC) to the standard output in the format

-

2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061 psp-os1 149.20.68.26

-

where the +0.006611 +/- 0.041061 indicates the time offset and error bound of the system clock relative to the server clock, in seconds.

+

2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061 psp-os1 149.20.68.26 s3 no-leap

+

where the +0.006611 +/- 0.041061 indicates the time offset and error bound of the system clock relative to the server clock, in seconds. The hostname and/or the IP is displayed, as is the stratum of the server. Finally, the leap indicator status is displayed.

If -b bcaddress is not specified, the program sends a single message to each address and waits up to uctimeout (default 5) seconds for a unicast server response. Otherwise, it sends no message and waits up to bctimeout (default 68) seconds for a broadcast NTP message.

Options

sntp recognizes the following options:

diff --git a/sntp/invoke-sntp.texi b/sntp/invoke-sntp.texi index ce9c410ee..8a2498e47 100644 --- a/sntp/invoke-sntp.texi +++ b/sntp/invoke-sntp.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-sntp.texi) # -# It has been AutoGen-ed March 30, 2015 at 04:38:37 AM by AutoGen 5.18.5pre4 +# It has been AutoGen-ed April 1, 2015 at 11:05:29 AM by AutoGen 5.18.5pre6 # From the definitions sntp-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -56,7 +56,8 @@ Otherwise, only the is displayed. Finally, the @emph{stratum} -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. This section was generated by @strong{AutoGen}, using the @code{agtexi-cmd} template and the option descriptions for the @code{sntp} program. @@ -100,7 +101,7 @@ with a status code of 0. @exampleindent 0 @example -sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2-RC1 +sntp - standard Simple Network Time Protocol client program - Ver. 4.3.9 Usage: sntp [ - [] | --[@{=| @}] ]... \ [ hostname-or-IP ...] Flg Arg Option-Name Description diff --git a/sntp/sntp-opts.c b/sntp/sntp-opts.c index 89a1e48d9..299113943 100644 --- a/sntp/sntp-opts.c +++ b/sntp/sntp-opts.c @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.c) * - * It has been AutoGen-ed March 30, 2015 at 04:36:50 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 1, 2015 at 11:05:19 AM by AutoGen 5.18.5pre6 * From the definitions sntp-opts.def * and the template file options * diff --git a/sntp/sntp-opts.def b/sntp/sntp-opts.def index c94d5e96e..fcfeaaf6c 100644 --- a/sntp/sntp-opts.def +++ b/sntp/sntp-opts.def @@ -281,7 +281,8 @@ Otherwise, only the is displayed. Finally, the .Em stratum -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. _END_PROG_MDOC_DESCRIP; }; diff --git a/sntp/sntp-opts.h b/sntp/sntp-opts.h index c0274ee6b..a9ce03b64 100644 --- a/sntp/sntp-opts.h +++ b/sntp/sntp-opts.h @@ -1,7 +1,7 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.h) * - * It has been AutoGen-ed March 30, 2015 at 04:36:49 AM by AutoGen 5.18.5pre4 + * It has been AutoGen-ed April 1, 2015 at 11:05:19 AM by AutoGen 5.18.5pre6 * From the definitions sntp-opts.def * and the template file options * diff --git a/sntp/sntp.1sntpman b/sntp/sntp.1sntpman index 9250d9ca8..7f28f4be2 100644 --- a/sntp/sntp.1sntpman +++ b/sntp/sntp.1sntpman @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH sntp 1sntpman "30 Mar 2015" "4.2.8p2-RC1" "User Commands" +.TH sntp 1sntpman "01 Apr 2015" "4.2.8p2-RC1" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-pfa4GI/ag-SfaWFI) +.\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed March 30, 2015 at 04:38:33 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 1, 2015 at 11:05:30 AM by AutoGen 5.18.5pre6 .\" From the definitions sntp-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -72,7 +72,8 @@ Otherwise, only the is displayed. Finally, the \fIstratum\f[] -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. .SH "OPTIONS" .TP .NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[] diff --git a/sntp/sntp.1sntpmdoc b/sntp/sntp.1sntpmdoc index 00da64c8b..cc286de89 100644 --- a/sntp/sntp.1sntpmdoc +++ b/sntp/sntp.1sntpmdoc @@ -1,9 +1,9 @@ -.Dd March 30 2015 +.Dd April 1 2015 .Dt SNTP 1sntpmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc) .\" -.\" It has been AutoGen-ed March 30, 2015 at 04:38:41 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 1, 2015 at 11:05:27 AM by AutoGen 5.18.5pre6 .\" From the definitions sntp-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -57,7 +57,8 @@ Otherwise, only the is displayed. Finally, the .Em stratum -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. .Sh "OPTIONS" .Bl -tag .It Fl 4 , Fl \-ipv4 diff --git a/sntp/sntp.html b/sntp/sntp.html index 49a860412..d73e6c931 100644 --- a/sntp/sntp.html +++ b/sntp/sntp.html @@ -3,7 +3,7 @@ Sntp User's Manual - + @@ -14,18 +14,20 @@ pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } - span.sc { font-variant:small-caps } - span.roman { font-family: serif; font-weight: normal; } + span.sc { font-variant:small-caps } + span.roman { font-family:serif; font-weight:normal; } + span.sansserif { font-family:sans-serif; font-weight:normal; } -->

Sntp User's Manual

+


-Next: , +Next: , Previous: (dir), Up: (dir) -
+

Simple Network Time Protocol User Manual

@@ -55,9 +57,10 @@ IETF specification.
-


-
+


+ +
@@ -76,9 +79,10 @@ the +4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock.
-


-
+


+ +

Invoking sntp

@@ -127,14 +131,15 @@ Otherwise, only the is displayed. Finally, the stratum -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed.

This section was generated by AutoGen, using the agtexi-cmd template and the option descriptions for the sntp program. This software is released under the NTP license, <http://ntp.org/license>.

+


-Next: , +Next: , Up: sntp Invocation -
+
-

sntp help/usage (--help)

+

sntp help/usage (--help)

This is the automatically generated usage text for sntp.

The text printed is the same whether selected with the help option -(--help) or the more-help option (--more-help). more-help will print +(--help) or the more-help option (--more-help). more-help will print the usage text by passing it through a pager program. more-help is disabled on platforms without a working fork(2) function. The PAGER environment variable is -used to select the program, defaulting to more. Both will exit +used to select the program, defaulting to more. Both will exit with a status code of 0. -

sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p2-RC1
+
sntp - standard Simple Network Time Protocol client program - Ver. 4.3.9
 Usage:  sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
                 [ hostname-or-IP ...]
   Flg Arg Option-Name    Description
@@ -229,11 +235,12 @@ The following option preset mechanisms are supported:
 Please send bug reports to:  <http://bugs.ntp.org, bugs@ntp.org>
 
+


-Next: , +Next: , Previous: sntp usage, Up: sntp Invocation -
+

ipv4 option (-4)

@@ -250,11 +257,12 @@ ipv6.

Force DNS resolution of the following host names on the command line to the IPv4 namespace.

+


-Next: , +Next: , Previous: sntp ipv4, Up: sntp Invocation -
+

ipv6 option (-6)

@@ -271,35 +279,37 @@ ipv4.

Force DNS resolution of the following host names on the command line to the IPv6 namespace.

+


-Next: , +Next: , Previous: sntp ipv6, Up: sntp Invocation -
+

authentication option (-a)

This is the “enable authentication with the key auth-keynumber” option. -This option takes a number argument auth-keynumber. +This option takes a number argument auth-keynumber. Enable authentication using the key specified in this option's -argument. The argument of this option is the keyid, a -number specified in the keyfile as this key's identifier. -See the keyfile option (-k) for more details. +argument. The argument of this option is the keyid, a +number specified in the keyfile as this key's identifier. +See the keyfile option (-k) for more details.

+


-Next: , +Next: , Previous: sntp authentication, Up: sntp Invocation -
+

broadcast option (-b)

This is the “listen to the address specified for broadcast time sync” option. -This option takes a string argument broadcast-address. +This option takes a string argument broadcast-address.

This option has some usage constraints. It:

    @@ -308,20 +318,21 @@ This option takes a string argument broadcast-address.

    If specified sntp will listen to the specified address for NTP broadcasts. The default maximum wait time -can (and probably should) be modified with -t. +can (and probably should) be modified with -t.

    +


    -Next: , +Next: , Previous: sntp broadcast, Up: sntp Invocation -
    +

    concurrent option (-c)

    This is the “concurrently query all ips returned for host-name” option. -This option takes a string argument host-name. +This option takes a string argument host-name.

    This option has some usage constraints. It:

      @@ -334,80 +345,85 @@ as part of a DNS lookup are assumed to be for a single instance of ntpd, and therefore sntp will send queries to these IPs one after another, with a 2-second gap in between each query. -

      The -c or --concurrent flag says that any IPs +

      The -c or --concurrent flag says that any IPs returned for the DNS lookup of the supplied host-name are on different machines, so we can send concurrent queries.

      +


      -Next: , +Next: , Previous: sntp concurrent, Up: sntp Invocation -
      +

      gap option (-g)

      This is the “the gap (in milliseconds) between time requests” option. -This option takes a number argument milliseconds. +This option takes a number argument milliseconds. Since we're only going to use the first valid response we get and there is benefit to specifying a good number of servers to query, separate the queries we send out by the specified number of milliseconds.

      +


      -Next: , +Next: , Previous: sntp gap, Up: sntp Invocation -
      +

      kod option (-K)

      This is the “kod history filename” option. -This option takes a file argument file-name. +This option takes a file argument file-name. Specifies the filename to be used for the persistent history of KoD responses received from servers. If the file does not exist, a warning message will be displayed. The file will not be created.

      +


      -Next: , +Next: , Previous: sntp kod, Up: sntp Invocation -
      +

      keyfile option (-k)

      -This is the “look in this file for the key specified with -a” option. -This option takes a file argument file-name. +This is the “look in this file for the key specified with -a” option. +This option takes a file argument file-name. This option specifies the keyfile. -sntp will search for the key specified with -a -keyno in this file. See ntp.keys(5) for more +sntp will search for the key specified with -a +keyno in this file. See ntp.keys(5) for more information.

      +


      -Next: , +Next: , Previous: sntp keyfile, Up: sntp Invocation -
      +

      logfile option (-l)

      This is the “log to specified logfile” option. -This option takes a file argument file-name. +This option takes a file argument file-name. This option causes the client to write log messages to the specified -logfile. +logfile.

      +


      -Next: , +Next: , Previous: sntp logfile, Up: sntp Invocation -
      +

      steplimit option (-M)

      @@ -415,17 +431,18 @@ Up: sntp Invocation

      This is the “adjustments less than steplimit msec will be slewed” option. This option takes a number argument. -If the time adjustment is less than steplimit milliseconds, -slew the amount using adjtime(2). Otherwise, step the -correction using settimeofday(2). The default value is 0, +If the time adjustment is less than steplimit milliseconds, +slew the amount using adjtime(2). Otherwise, step the +correction using settimeofday(2). The default value is 0, which means all adjustments will be stepped. This is a feature, as different situations demand different values.

      +


      -Next: , +Next: , Previous: sntp steplimit, Up: sntp Invocation -
      +

      ntpversion option (-o)

      @@ -434,13 +451,14 @@ Up: sntp Invocation This is the “send int as our ntp protocol version” option. This option takes a number argument. When sending requests to a remote server, tell them we are running -NTP protocol version ntpversion . +NTP protocol version ntpversion .
      +


      -Next: , +Next: , Previous: sntp ntpversion, Up: sntp Invocation -
      +

      usereservedport option (-r)

      @@ -450,29 +468,31 @@ This is the “use the ntp reserved port (port 123)” option. Use port 123, which is reserved for NTP, for our network communications.
      +


      -Next: , +Next: , Previous: sntp usereservedport, Up: sntp Invocation -
      +

      timeout option (-t)

      This is the “the number of seconds to wait for responses” option. -This option takes a number argument seconds. +This option takes a number argument seconds. When waiting for a reply, sntp will wait the number of seconds specified before giving up. The default should be more than enough for a unicast response. If sntp is only waiting for a broadcast response a longer timeout is likely needed.

      +


      -Next: , +Next: , Previous: sntp timeout, Up: sntp Invocation -
      +

      wait option

      @@ -489,11 +509,12 @@ This is the “wait for pending replies (if not setting the time)” opt

      If we are not setting the time, wait for all pending responses.

      +


      -Next: , +Next: , Previous: sntp wait, Up: sntp Invocation -
      +

      presetting/configuring sntp

      @@ -511,9 +532,9 @@ values are treated like option arguments.
    • $PWD
    The environment variables HOME, and PWD -are expanded and replaced when sntp runs. +are expanded and replaced when sntp runs. For any of these that are plain files, they are simply processed. -For any that are directories, then a file named .ntprc is searched for +For any that are directories, then a file named .ntprc is searched for within that directory and processed.

    Configuration files may be in a wide variety of formats. @@ -555,52 +576,56 @@ detail to provide. The default is to print just the version. The licensing inf Only the first letter of the argument is examined:

    -
    version
    Only print the version. This is the default. -
    copyright
    Name the copyright usage licensing terms. -
    verbose
    Print the full copyright usage licensing terms. +
    version
    Only print the version. This is the default. +
    copyright
    Name the copyright usage licensing terms. +
    verbose
    Print the full copyright usage licensing terms.
    +


    -Next: , +Next: , Previous: sntp config, Up: sntp Invocation -
    +

    sntp exit status

    One of the following exit values will be returned:

    -
    0 (EXIT_SUCCESS)
    Successful program execution. -
    1 (EXIT_FAILURE)
    The operation failed or the command syntax was not valid. -
    66 (EX_NOINPUT)
    A specified configuration file could not be loaded. -
    70 (EX_SOFTWARE)
    libopts had an internal operational error. Please report +
    0 (EXIT_SUCCESS)
    Successful program execution. +
    1 (EXIT_FAILURE)
    The operation failed or the command syntax was not valid. +
    66 (EX_NOINPUT)
    A specified configuration file could not be loaded. +
    70 (EX_SOFTWARE)
    libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you.
    +


    -Next: , +Next: , Previous: sntp exit status, Up: sntp Invocation -
    +

    sntp Usage

    +


    -Previous: sntp Usage, +Previous: sntp Usage, Up: sntp Invocation -
    +

    sntp Authors

    -


    -
    +


    + +
    diff --git a/sntp/sntp.man.in b/sntp/sntp.man.in index fccf8a1d9..888901f8c 100644 --- a/sntp/sntp.man.in +++ b/sntp/sntp.man.in @@ -10,11 +10,11 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH sntp @SNTP_MS@ "30 Mar 2015" "4.2.8p2-RC1" "User Commands" +.TH sntp @SNTP_MS@ "01 Apr 2015" "4.2.8p2-RC1" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-pfa4GI/ag-SfaWFI) +.\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" -.\" It has been AutoGen-ed March 30, 2015 at 04:38:33 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 1, 2015 at 11:05:30 AM by AutoGen 5.18.5pre6 .\" From the definitions sntp-opts.def .\" and the template file agman-cmd.tpl .SH NAME @@ -72,7 +72,8 @@ Otherwise, only the is displayed. Finally, the \fIstratum\f[] -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. .SH "OPTIONS" .TP .NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[] diff --git a/sntp/sntp.mdoc.in b/sntp/sntp.mdoc.in index cf48e7c1c..6843b5066 100644 --- a/sntp/sntp.mdoc.in +++ b/sntp/sntp.mdoc.in @@ -1,9 +1,9 @@ -.Dd March 30 2015 +.Dd April 1 2015 .Dt SNTP @SNTP_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc) .\" -.\" It has been AutoGen-ed March 30, 2015 at 04:38:41 AM by AutoGen 5.18.5pre4 +.\" It has been AutoGen-ed April 1, 2015 at 11:05:27 AM by AutoGen 5.18.5pre6 .\" From the definitions sntp-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -57,7 +57,8 @@ Otherwise, only the is displayed. Finally, the .Em stratum -of the host is reported. +of the host is reported +and the leap indicator is decoded and displayed. .Sh "OPTIONS" .Bl -tag .It Fl 4 , Fl \-ipv4