From: Dave Hart Date: Sun, 19 Dec 2010 03:42:39 +0000 (+0000) Subject: sntp AutoGen 5.11.6pre5 output X-Git-Tag: NTP_4_2_7P97~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=251657265551e9f6f7b2fdc505bcd653e3eb5456;p=thirdparty%2Fntp.git sntp AutoGen 5.11.6pre5 output bk: 4d0d7f2fTdGbcNIQUixj_atw0kzp5A --- diff --git a/sntp/sntp-opts.c b/sntp/sntp-opts.c index 09950b4f1..beadc94b4 100644 --- a/sntp/sntp-opts.c +++ b/sntp/sntp-opts.c @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.c) * - * It has been AutoGen-ed November 27, 2010 at 11:50:15 PM by AutoGen 5.11.3 + * It has been AutoGen-ed December 19, 2010 at 03:41:47 AM by AutoGen 5.11.6pre5 * From the definitions sntp-opts.def * and the template file options * - * Generated from AutoOpts 33:3:8 templates. + * Generated from AutoOpts 34:0:9 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -471,33 +471,27 @@ static tOptDesc optDesc[ OPTION_CT ] = { * * Define the Sntp Option Environment */ -tSCC zPROGNAME[] = "SNTP"; -tSCC zUsageTitle[] = +static char const zPROGNAME[5] = "SNTP"; +static char const zUsageTitle[126] = "sntp - standard SNTP program - Ver. 4.2.6p3-RC11\n\ USAGE: %s [ - [] | --[{=| }] ]... hostname-or-IP ...\n"; -tSCC zRcName[] = ".ntprc"; -tSCC* apzHomeList[] = { - "$HOME", - ".", - NULL }; - -tSCC zBugsAddr[] = "http://bugs.ntp.org, bugs@ntp.org"; -#define zExplain NULL -tSCC zDetail[] = "\n\ -.I sntp\n\ -implements the Simple Network Time Protocol, and is used\n\ -to query an NTP or SNTP server and either\n\ -display the time\n\ -or\n\ -set the local system's time (given suitable privilege).\n\n\ -It can be\n\ -run interactively from the command line or as a\n\ -.I cron\n\ -job.\n\n\ -NTP and SNTP are defined by RFC 5905, which\n\ -obsoletes RFC 4330 and RFC 1305.\n"; -tSCC zFullVersion[] = SNTP_FULL_VERSION; -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 493 */ +static char const zRcName[7] = ".ntprc"; +static char const * const apzHomeList[3] = { + "$HOME", + ".", + NULL }; + +static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org"; +static char const zExplain[] = "\n\n"; +static char const zDetail[352] = "\n\ +sntp implements the Simple Network Time Protocol, and is used to query\n\ +an NTP or SNTP server and either display the time or set the local\n\ +system's time (given suitable privilege).\n\n\ +It can be run interactively from the command line or as a cron job.\n\n\ +NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC\n\ +1305.\n"; +static char const zFullVersion[] = SNTP_FULL_VERSION; +/* extracted from /usr/local/share/autogen/optcode.tpl near line 504 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -510,6 +504,10 @@ tSCC zFullVersion[] = SNTP_FULL_VERSION; #define sntp_full_usage NULL #define sntp_short_usage NULL +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + tOptions sntpOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ @@ -540,7 +538,8 @@ tOptions sntpOptions = { }, 17 /* full option count */, 12 /* user option count */, sntp_full_usage, sntp_short_usage, - NULL, NULL + NULL, NULL, + PKGDATADIR }; /* @@ -554,7 +553,7 @@ doUsageOpt( (void)pOptions; USAGE(EXIT_SUCCESS); } -/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */ +/* extracted from /usr/local/share/autogen/optmain.tpl near line 107 */ #if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */ @@ -572,7 +571,7 @@ main(int argc, char** argv) return res; } #endif /* defined TEST_SNTP_OPTS */ -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 626 */ +/* extracted from /usr/local/share/autogen/optcode.tpl near line 641 */ #if ENABLE_NLS #include diff --git a/sntp/sntp-opts.h b/sntp/sntp-opts.h index 6492e4a47..c42d9ad89 100644 --- a/sntp/sntp-opts.h +++ b/sntp/sntp-opts.h @@ -1,11 +1,11 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.h) * - * It has been AutoGen-ed November 27, 2010 at 11:50:15 PM by AutoGen 5.11.3 + * It has been AutoGen-ed December 19, 2010 at 03:41:47 AM by AutoGen 5.11.6pre5 * From the definitions sntp-opts.def * and the template file options * - * Generated from AutoOpts 33:3:8 templates. + * Generated from AutoOpts 34:0:9 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -39,7 +39,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 135171 +#define AO_TEMPLATE_VERSION 139264 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -94,6 +94,15 @@ typedef enum { DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) +/* * * * * * + * + * Enumeration of sntp exit codes + */ +typedef enum { + SNTP_EXIT_SUCCESS = 0, + SNTP_EXIT_FAILURE = 1 +} sntp_exit_code_t; + /* * Make sure there are no #define name conflicts with the option names */ @@ -200,7 +209,7 @@ typedef enum { sntpOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) #define USAGE(c) (*sntpOptions.pUsageProc)(&sntpOptions, c) -/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 408 */ +/* extracted from /usr/local/share/autogen/opthead.tpl near line 435 */ /* * * * * * * diff --git a/sntp/sntp-opts.texi b/sntp/sntp-opts.texi index 432909e52..33668451e 100644 --- a/sntp/sntp-opts.texi +++ b/sntp/sntp-opts.texi @@ -6,26 +6,38 @@ # # EDIT THIS FILE WITH CAUTION (sntp-opts.texi) # -# It has been AutoGen-ed November 27, 2010 at 11:50:25 PM by AutoGen 5.11.3 +# It has been AutoGen-ed December 19, 2010 at 03:41:53 AM by AutoGen 5.11.6pre5 # From the definitions sntp-opts.def # and the template file aginfo.tpl @end ignore -This program has no explanation. - -.I sntp -implements the Simple Network Time Protocol, and is used -to query an NTP or SNTP server and either -display the time -or -set the local system's time (given suitable privilege). - -It can be -run interactively from the command line or as a -.I cron + +@code{sntp} +can be used as a SNTP client to query a NTP or SNTP server and either display +the time or set the local system's time (given suitable privilege). It can be +run as an interactive command or in a +@code{cron} job. -NTP and SNTP are defined by RFC 5905, which -obsoletes RFC 4330 and RFC 1305. +NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) +are defined and described by RFC 5905. + +@indent +The default is to write the estimated correct local date and time (i.e. not +UTC) to the standard output in a format like +@example +1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs +@end example +where the +@example ++4.567 +/- 0.089 secs +@end example +indicates the local clock is 4.567 seconds behind the correct time +(so 4.567 seconds must be added to the local clock to get it to be correct), +and the time of +@code{1996 Oct 15 20:17:25.123} +is believed to be correct to within +@code{+/- 0.089} +seconds. This section was generated by @strong{AutoGen}, the aginfo template and the option descriptions for the @command{sntp} program. It documents the sntp usage text and option meanings. @@ -56,7 +68,61 @@ This is the automatically generated usage text for sntp: @exampleindent 0 @example -sntp is unavailable - no --help +sntp - standard SNTP program - Ver. 4.2.6p3-RC11 +USAGE: sntp [ - [] | --[@{=| @}] ]... hostname-or-IP ... + Flg Arg Option-Name Description + -4 no ipv4 Force IPv4 DNS name resolution + - prohibits these options: + ipv6 + -6 no ipv6 Force IPv6 DNS name resolution + - prohibits these options: + ipv4 + -d no normalverbose Normal verbose + -K Str kod KoD history filename + -p no syslog Logging with syslog + - prohibits these options: + filelog + -l Str filelog Log to specified logfile + - prohibits these options: + syslog + -s no settod Set (step) the time with settimeofday() + - prohibits these options: + adjtime + -j no adjtime Set (slew) the time with adjtime() + - prohibits these options: + settod + -b Str broadcast Use broadcasts to the address specified for synchronisation + -t Num timeout Specify the number of seconds to wait for broadcasts + -a Num authentication Enable authentication with the key auth-keynumber + -k Str keyfile Specify a keyfile. SNTP will look in this file for the key specified with -a + opt version Output version information and exit + -? no help Display extended usage information and exit + -! no more-help Extended usage information passed thru pager + -> opt save-opts Save the option state to a config file + -< Str load-opts Load options from a config file + - disabled as --no-load-opts + - may appear multiple times + +Options are specified by doubled hyphens and their name +or by a single hyphen and the flag character. + + + +The following option preset mechanisms are supported: + - reading file $HOME/.ntprc + - reading file ./.ntprc + - examining environment variables named SNTP_* + +sntp implements the Simple Network Time Protocol, and is used to query +an NTP or SNTP server and either display the time or set the local +system's time (given suitable privilege). + +It can be run interactively from the command line or as a cron job. + +NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC +1305. + +please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org @end example @exampleindent 4 @@ -107,7 +173,7 @@ syslog. @end itemize This option causes the client to write log messages to the specified -logfile. +logfile. @node sntp ipv4 @subsection ipv4 option (-4) @@ -146,12 +212,12 @@ to the IPv6 namespace. @cindex sntp-keyfile This is the ``specify a keyfile. sntp will look in this file for the key specified with -a'' option. -This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this +This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this file. Key files follow the following format: keyid keytype key -Where keyid is a number identifying this key +Where keyid is a number identifying this key keytype is one of the follow: S Key in 64 Bit hexadecimal number as specified in in the DES specification. N Key in 64 Bit hexadecimal number as specified in the NTP standard. @@ -214,5 +280,5 @@ When this option is set all logging will be done using syslog. @cindex sntp-timeout This is the ``specify the number of seconds to wait for broadcasts'' option. -When waiting for a broadcast packet SNTP will wait the number +When waiting for a broadcast packet SNTP will wait the number of seconds specified before giving up. Default 68 seconds. diff --git a/sntp/sntp.1 b/sntp/sntp.1 index 45aa8a13c..a7f5856ee 100644 --- a/sntp/sntp.1 +++ b/sntp/sntp.1 @@ -1,7 +1,7 @@ -.TH SNTP 1 2010-11-27 "( 4.2.6p3-RC11)" "Programmer's Manual" +.TH SNTP 1 2010-12-19 "( 4.2.6p3-RC11)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (sntp.1) .\" -.\" It has been AutoGen-ed November 27, 2010 at 11:50:24 PM by AutoGen 5.11.3 +.\" It has been AutoGen-ed December 19, 2010 at 03:41:52 AM by AutoGen 5.11.6pre5 .\" From the definitions sntp-opts.def .\" and the template file agman1.tpl .\" @@ -14,6 +14,8 @@ sntp \- standard SNTP program .br .in +8 hostname-or-IP ... +.PP + .SH "DESCRIPTION" This manual page briefly documents the \fBsntp\fP command. .I sntp @@ -85,7 +87,7 @@ This option must not appear in combination with any of the following options: syslog. .sp This option causes the client to write log messages to the specified -logfile. +logfile. .TP .BR \-s ", " \--settod Set (step) the time with settimeofday(). @@ -115,7 +117,7 @@ The default \fIseconds\fP for this option is: .ti +4 68 .sp -When waiting for a broadcast packet SNTP will wait the number +When waiting for a broadcast packet SNTP will wait the number of seconds specified before giving up. Default 68 seconds. .TP .BR \-a " \fIauth-keynumber\fP, " \--authentication "=" \fIauth-keynumber\fP @@ -129,12 +131,12 @@ key's identifier. See the keyfile option (-k) for more details. .BR \-k " \fIfile-name\fP, " \--keyfile "=" \fIfile-name\fP Specify a keyfile. SNTP will look in this file for the key specified with \-a. .sp -This option specifies the keyfile. SNTP will search for the key specified with \-a keyno in this +This option specifies the keyfile. SNTP will search for the key specified with \-a keyno in this file. Key files follow the following format: keyid keytype key -Where keyid is a number identifying this key +Where keyid is a number identifying this key keytype is one of the follow: S Key in 64 Bit hexadecimal number as specified in in the DES specification. N Key in 64 Bit hexadecimal number as specified in the NTP standard. diff --git a/sntp/sntp.html b/sntp/sntp.html index 5aa1d6f53..d6cceca48 100644 --- a/sntp/sntp.html +++ b/sntp/sntp.html @@ -79,22 +79,31 @@ error bound of the system clock relative to the server clock.

Invoking sntp

-

This program has no explanation. - -

.I sntp -implements the Simple Network Time Protocol, and is used -to query an NTP or SNTP server and either -display the time -or -set the local system's time (given suitable privilege). - -

It can be -run interactively from the command line or as a -.I cron +

+sntp +can be used as a SNTP client to query a NTP or SNTP server and either display +the time or set the local system's time (given suitable privilege). It can be +run as an interactive command or in a +cron job. -

NTP and SNTP are defined by RFC 5905, which -obsoletes RFC 4330 and RFC 1305. +

NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol) +are defined and described by RFC 5905. + +

The default is to write the estimated correct local date and time (i.e. not +UTC) to the standard output in a format like +

     1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs
+
+

where the +

     +4.567 +/- 0.089 secs
+
+

indicates the local clock is 4.567 seconds behind the correct time +(so 4.567 seconds must be added to the local clock to get it to be correct), +and the time of +1996 Oct 15 20:17:25.123 +is believed to be correct to within ++/- 0.089 +seconds.

This section was generated by AutoGen, the aginfo template and the option descriptions for the sntp program. It documents the sntp usage text and option meanings. @@ -129,7 +138,61 @@ Up: sntp Invocation

This is the automatically generated usage text for sntp: -

sntp is unavailable - no --help
+
sntp - standard SNTP program - Ver. 4.2.6p3-RC11
+USAGE:  sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ]... hostname-or-IP ...
+  Flg Arg Option-Name    Description
+   -4 no  ipv4           Force IPv4 DNS name resolution
+                                - prohibits these options:
+                                ipv6
+   -6 no  ipv6           Force IPv6 DNS name resolution
+                                - prohibits these options:
+                                ipv4
+   -d no  normalverbose  Normal verbose
+   -K Str kod            KoD history filename
+   -p no  syslog         Logging with syslog
+                                - prohibits these options:
+                                filelog
+   -l Str filelog        Log to specified logfile
+                                - prohibits these options:
+                                syslog
+   -s no  settod         Set (step) the time with settimeofday()
+                                - prohibits these options:
+                                adjtime
+   -j no  adjtime        Set (slew) the time with adjtime()
+                                - prohibits these options:
+                                settod
+   -b Str broadcast      Use broadcasts to the address specified for synchronisation
+   -t Num timeout        Specify the number of seconds to wait for broadcasts
+   -a Num authentication Enable authentication with the key auth-keynumber
+   -k Str keyfile        Specify a keyfile. SNTP will look in this file for the key specified with -a
+      opt version        Output version information and exit
+   -? no  help           Display extended usage information and exit
+   -! no  more-help      Extended usage information passed thru pager
+   -> opt save-opts      Save the option state to a config file
+   -< Str load-opts      Load options from a config file
+                                - disabled as --no-load-opts
+                                - may appear multiple times
+
+Options are specified by doubled hyphens and their name
+or by a single hyphen and the flag character.
+
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named SNTP_*
+
+sntp implements the Simple Network Time Protocol, and is used to query
+an NTP or SNTP server and either display the time or set the local
+system's time (given suitable privilege).
+
+It can be run interactively from the command line or as a cron job.
+
+NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC
+1305.
+
+please send bug reports to:  http://bugs.ntp.org, bugs@ntp.org
 


@@ -265,7 +328,7 @@ file. Key files follow the following format:

keyid keytype key -

Where keyid is a number identifying this key +

Where keyid is a number identifying this key keytype is one of the follow: S Key in 64 Bit hexadecimal number as specified in in the DES specification. N Key in 64 Bit hexadecimal number as specified in the NTP standard.