/*
* 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
*
* 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 [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 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
#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 */
},
17 /* full option count */, 12 /* user option count */,
sntp_full_usage, sntp_short_usage,
- NULL, NULL
+ NULL, NULL,
+ PKGDATADIR
};
/*
(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: */
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 <stdio.h>
/*
* 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
* 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
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
*/
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 */
/* * * * * *
*
#
# 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.
@exampleindent 0
@example
-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
@end example
@exampleindent 4
@end itemize
This option causes the client to write log messages to the specified
-logfile.
+logfile.
@node sntp ipv4
@subsection ipv4 option (-4)
@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.
@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.
-.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
.\"
.br
.in +8
hostname-or-IP ...
+.PP
+
.SH "DESCRIPTION"
This manual page briefly documents the \fBsntp\fP command.
.I sntp
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().
.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
.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.
<h3 class="section">Invoking sntp</h3>
-<p><a name="index-sntp-1"></a><a name="index-standard-SNTP-program-2"></a>This program has no explanation.
-
- <p>.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).
-
- <p>It can be
-run interactively from the command line or as a
-.I cron
+<p><a name="index-sntp-1"></a><a name="index-standard-SNTP-program-2"></a>
+<code>sntp</code>
+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</code>
job.
- <p>NTP and SNTP are defined by RFC 5905, which
-obsoletes RFC 4330 and RFC 1305.
+ <p>NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+
+ <p class="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
+<pre class="example"> 1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs
+</pre>
+ <p>where the
+<pre class="example"> +4.567 +/- 0.089 secs
+</pre>
+ <p>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</code>
+is believed to be correct to within
+<code>+/- 0.089</code>
+seconds.
<p>This section was generated by <strong>AutoGen</strong>,
the aginfo template and the option descriptions for the <span class="command">sntp</span> program. It documents the sntp usage text and option meanings.
<p><a name="index-sntp-usage-3"></a>
This is the automatically generated usage text for sntp:
-<pre class="example">sntp is unavailable - no --help
+<pre class="example">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
</pre>
<div class="node">
<p><hr>
<p>keyid keytype key
- <p>Where keyid is a number identifying this key
+ <p>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.