sntp-opts.def   [plain text]

/* -*- Mode: Text -*- */

autogen definitions options;

#include autogen-version.def
#include copyright.def

prog-name      = "sntp";
prog-title     = "standard SNTP program";
homerc         =  $HOME, ".";
argument       = 'hostname-or-IP ...';


config-header  = "config.h";

#ifndef __windows__
rcfile         = ".ntprc";
rcfile         = "ntp.ini";


#include version.def


flag = {
    name      = ipv4;
    value     = 4;
    flags-cant = ipv6;
    descrip   = "Force IPv4 DNS name resolution";
    doc = <<-  _EndOfDoc_
	Force DNS resolution of following host names on the command line
	to the IPv4 namespace.

flag = {
    name      = ipv6;
    value     = 6;
    flags-cant = ipv4;
    descrip   = "Force IPv6 DNS name resolution";
    doc = <<-  _EndOfDoc_
	Force DNS resolution of following host names on the command line
	to the IPv6 namespace.

flag = {
    name      = normalverbose;
    value     = d;
    descrip   = "Normal verbose";
    doc = <<-  _EndOfDoc_
	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.

flag = {
    name      = kod;
    value     = K;
    arg-type  = string;
    arg-name  = "file-name";
    descrip   = "KoD history filename";
    doc = <<-  _EndOfDoc_
	Modifies the filename to be used to persist the history of KoD
	responses received from servers.  The default is

flag = {
	name 	= syslog;
	value	= p;
	flags-cant = filelog;
	descrip = "Logging with syslog";
	doc = <<-  _EndOfDoc_
	When this option is set all logging will be done using syslog.

flag = {
	name	   = filelog;
	value	   = l;
	arg-type   = string;
	arg-name   = "file-name";
	flags-cant = syslog;
	descrip = "Log to specified logfile";
	doc = <<-  _EndOfDoc_
	This option causes the client to write log messages to the specified

flag = {
    name      = settod;
    value     = s;
    flags-cant = adjtime;
    descrip   = "Set (step) the time with settimeofday()";
    doc = <<-  _EndOfDoc_

flag = {
    name      = adjtime;
    value     = j;
    flags-cant = settod;
    descrip   = "Set (slew) the time with adjtime()";
    doc = <<-  _EndOfDoc_

flag = {
	name 	= broadcast;
	value 	= b;
	descrip	= "Use broadcasts to the address specified for synchronisation";
	arg-type = string;
	arg-name = "broadcast-address";
	doc 	= <<-  _EndOfDoc_
	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.

flag = {
	name 	= timeout;
	value 	= t;
	descrip	= "Specify the number of seconds to wait for broadcasts";
	arg-type = number;
	arg-name = "seconds";
	arg-default = 68;
	doc	= <<-  _EndOfDoc_
	When waiting for a broadcast packet SNTP will wait the number 
	of seconds specified before giving up.  Default 68 seconds.

flag = {
	name 	= authentication;
	value	= a;
	descrip	= "Enable authentication with the key auth-keynumber";
	arg-type = number;
	arg-name = "auth-keynumber";
	doc	= <<- _EndOfDoc_
	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.

flag = {
	name 	= keyfile;
	value	= k;
	descrip	= "Specify a keyfile. SNTP will look in this file for the key specified with -a";
	arg-type = string;
	arg-name = "file-name";
	doc	= <<-  _EndOfDoc_
	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).


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

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

NTP and SNTP are defined by draft-ietf-ntp-ntpv4-proto-13, which
obsoletes RFC 4330 and RFC 1305.

prog-man-descrip = <<-  _END_PROG_MAN_DESCRIP
.I 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
.I cron

NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
are defined and described by
which should become a full RFC any month now.

The default is to write the estimated correct local date and time (i.e. not
UTC) to the standard output in a format like
.BR "'1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs'" ,
where the
.B "'+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

man-doc = <<-  _END_MAN_DOC
The simplest use of this program is as an unprivileged command to check the
current time and error in the local clock.  For example:
.B sntp ntpserver.somewhere
With suitable privilege, it can be run as a command or in a
.I cron
job to reset the local clock from a reliable server, like the
.I ntpdate
.I rdate
commands.  For example:
.B sntp -a ntpserver.somewhere
The program returns a zero exit
status for success, and a non-zero one otherwise.
Please report bugs to .