@node sntp Invocation
@section Invoking sntp
@pindex sntp
@cindex standard Simple Network Time Protocol program
@ignore
# 
# EDIT THIS FILE WITH CAUTION  (sntp-opts.texi)
# 
# It has been AutoGen-ed  December 24, 2011 at 06:34:00 PM by AutoGen 5.12
# From the definitions    sntp-opts.def
# and the template file   aginfo.tpl
@end ignore

@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 (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-10-15 20:17:25.123 (+0800) +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 (local) time of
@code{1996-10-15 20:17:25.123}
can be converted to UTC time by adding 8 hours and 0 minutes, and
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 @command{sntp} usage text and option meanings.

This software is released under a specialized copyright license.

@menu
* sntp usage::                  sntp usage help (-?)
* sntp adjtime::               adjtime option (-j)
* sntp authentication::        authentication option (-a)
* sntp broadcast::             broadcast option (-b)
* sntp ipv4::                  ipv4 option (-4)
* sntp ipv6::                  ipv6 option (-6)
* sntp keyfile::               keyfile option (-k)
* sntp kod::                   kod option (-K)
* sntp logfile::               logfile option (-l)
* sntp normalverbose::         normalverbose option (-d)
* sntp settod::                settod option (-s)
* sntp syslog::                syslog option (-p)
* sntp timeout::               timeout option (-t)
@end menu

@node sntp usage
@subsection sntp usage help (-?)
@cindex sntp usage

This is the automatically generated usage text for sntp:

@exampleindent 0
@example
sntp - standard Simple Network Time Protocol program - Ver. 4.2.6p5
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:
                                logfile
   -l Str logfile        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

@node sntp adjtime
@subsection adjtime option (-j)
@cindex sntp-adjtime

This is the ``set (slew) the time with adjtime()'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
settod.
@end itemize



@node sntp authentication
@subsection authentication option (-a)
@cindex sntp-authentication

This is the ``enable authentication with the key auth-keynumber'' option.
This option enables 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.

@node sntp broadcast
@subsection broadcast option (-b)
@cindex sntp-broadcast

This is the ``use broadcasts to the address specified for synchronisation'' option.
If specified SNTP will listen to the specified broadcast address
for NTP broadcasts.  The default maximum wait time,
68 seconds, can be modified with -t.

@node sntp ipv4
@subsection ipv4 option (-4)
@cindex sntp-ipv4

This is the ``force ipv4 dns name resolution'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
ipv6.
@end itemize

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

@node sntp ipv6
@subsection ipv6 option (-6)
@cindex sntp-ipv6

This is the ``force ipv6 dns name resolution'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
ipv4.
@end itemize

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

@node sntp keyfile
@subsection keyfile option (-k)
@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
file. Key files follow the following format:

keyid keytype 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.
A  Key in a 1-to-8 character ASCII string.
M  Key in a 1-to-8 character ASCII string using the MD5 authentication scheme.

For more information see ntp.keys(5).

@node sntp kod
@subsection kod option (-K)
@cindex sntp-kod

This is the ``kod history filename'' option.
Specifies the filename to be used to persist the history of KoD
responses received from servers.  The default is
/var/db/ntp-kod.

@node sntp logfile
@subsection logfile option (-l)
@cindex sntp-logfile

This is the ``log to specified logfile'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
syslog.
@end itemize

This option causes the client to write log messages to the specified
logfile.

@node sntp normalverbose
@subsection normalverbose option (-d)
@cindex sntp-normalverbose

This is the ``normal verbose'' option.
Diagnostic messages for non-fatal errors and a limited amount of
tracing should be written to standard error.  Fatal ones always
produce a diagnostic.  This option should be set when there is a
suspected problem with the server, network or the source.

@node sntp settod
@subsection settod option (-s)
@cindex sntp-settod

This is the ``set (step) the time with settimeofday()'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
adjtime.
@end itemize



@node sntp syslog
@subsection syslog option (-p)
@cindex sntp-syslog

This is the ``logging with syslog'' option.

This option has some usage constraints.  It:
@itemize @bullet
@item
must not appear in combination with any of the following options:
logfile.
@end itemize

When this option is set all logging will be done using syslog.

@node sntp timeout
@subsection timeout option (-t)
@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
of seconds specified before giving up.  Default 68 seconds.
