Home | History | Annotate | Line # | Download | only in sntp
sntp-opts.def revision 1.1
      1  1.1  kardel /* -*- Mode: Text -*- */
      2  1.1  kardel 
      3  1.1  kardel autogen definitions options;
      4  1.1  kardel 
      5  1.1  kardel #include autogen-version.def
      6  1.1  kardel #include copyright.def
      7  1.1  kardel 
      8  1.1  kardel prog-name      = "sntp";
      9  1.1  kardel prog-title     = "standard SNTP program";
     10  1.1  kardel homerc         =  $HOME, ".";
     11  1.1  kardel argument       = 'hostname-or-IP ...';
     12  1.1  kardel 
     13  1.1  kardel long-opts;
     14  1.1  kardel 
     15  1.1  kardel config-header  = "config.h";
     16  1.1  kardel 
     17  1.1  kardel #ifndef __windows__
     18  1.1  kardel rcfile         = ".ntprc";
     19  1.1  kardel #else
     20  1.1  kardel rcfile         = "ntp.ini";
     21  1.1  kardel #endif
     22  1.1  kardel 
     23  1.1  kardel environrc;
     24  1.1  kardel 
     25  1.1  kardel #include version.def
     26  1.1  kardel 
     27  1.1  kardel test-main;
     28  1.1  kardel 
     29  1.1  kardel flag = {
     30  1.1  kardel     name      = ipv4;
     31  1.1  kardel     value     = 4;
     32  1.1  kardel     flags-cant = ipv6;
     33  1.1  kardel     descrip   = "Force IPv4 DNS name resolution";
     34  1.1  kardel     doc = <<-  _EndOfDoc_
     35  1.1  kardel 	Force DNS resolution of following host names on the command line
     36  1.1  kardel 	to the IPv4 namespace.
     37  1.1  kardel 	_EndOfDoc_;
     38  1.1  kardel };
     39  1.1  kardel 
     40  1.1  kardel flag = {
     41  1.1  kardel     name      = ipv6;
     42  1.1  kardel     value     = 6;
     43  1.1  kardel     flags-cant = ipv4;
     44  1.1  kardel     descrip   = "Force IPv6 DNS name resolution";
     45  1.1  kardel     doc = <<-  _EndOfDoc_
     46  1.1  kardel 	Force DNS resolution of following host names on the command line
     47  1.1  kardel 	to the IPv6 namespace.
     48  1.1  kardel 	_EndOfDoc_;
     49  1.1  kardel };
     50  1.1  kardel 
     51  1.1  kardel 
     52  1.1  kardel flag = {
     53  1.1  kardel     name      = normalverbose;
     54  1.1  kardel     value     = d;
     55  1.1  kardel     descrip   = "Normal verbose";
     56  1.1  kardel     doc = <<-  _EndOfDoc_
     57  1.1  kardel 	Diagnostic messages for non-fatal errors and a limited amount of
     58  1.1  kardel 	tracing should be written to standard error.  Fatal ones always
     59  1.1  kardel 	produce a diagnostic.  This option should be set when there is a
     60  1.1  kardel 	suspected problem with the server, network or the source.
     61  1.1  kardel 	_EndOfDoc_;
     62  1.1  kardel };
     63  1.1  kardel 
     64  1.1  kardel flag = {
     65  1.1  kardel     name      = kod;
     66  1.1  kardel     value     = K;
     67  1.1  kardel     arg-type  = string;
     68  1.1  kardel     arg-name  = "file-name";
     69  1.1  kardel     descrip   = "KoD history filename";
     70  1.1  kardel     doc = <<-  _EndOfDoc_
     71  1.1  kardel 	Modifies the filename to be used to persist the history of KoD
     72  1.1  kardel 	responses received from servers.  The default is
     73  1.1  kardel 	/var/db/ntp-kod.
     74  1.1  kardel 	_EndOfDoc_;
     75  1.1  kardel };
     76  1.1  kardel 
     77  1.1  kardel 
     78  1.1  kardel flag = {
     79  1.1  kardel 	name 	= syslog;
     80  1.1  kardel 	value	= p;
     81  1.1  kardel 	flags-cant = filelog;
     82  1.1  kardel 	descrip = "Logging with syslog";
     83  1.1  kardel 	doc = <<-  _EndOfDoc_
     84  1.1  kardel 	When this option is set all logging will be done using syslog.
     85  1.1  kardel 	_EndOfDoc_;
     86  1.1  kardel };
     87  1.1  kardel 
     88  1.1  kardel flag = {
     89  1.1  kardel 	name	   = filelog;
     90  1.1  kardel 	value	   = l;
     91  1.1  kardel 	arg-type   = string;
     92  1.1  kardel 	arg-name   = "file-name";
     93  1.1  kardel 	flags-cant = syslog;
     94  1.1  kardel 	descrip = "Log to specified logfile";
     95  1.1  kardel 	doc = <<-  _EndOfDoc_
     96  1.1  kardel 	This option causes the client to write log messages to the specified
     97  1.1  kardel 	logfile.
     98  1.1  kardel 	_EndOfDoc_;
     99  1.1  kardel };
    100  1.1  kardel 
    101  1.1  kardel flag = {
    102  1.1  kardel     name      = settod;
    103  1.1  kardel     value     = s;
    104  1.1  kardel     flags-cant = adjtime;
    105  1.1  kardel     descrip   = "Set (step) the time with settimeofday()";
    106  1.1  kardel     doc = <<-  _EndOfDoc_
    107  1.1  kardel 	_EndOfDoc_;
    108  1.1  kardel };
    109  1.1  kardel 
    110  1.1  kardel flag = {
    111  1.1  kardel     name      = adjtime;
    112  1.1  kardel     value     = j;
    113  1.1  kardel     flags-cant = settod;
    114  1.1  kardel     descrip   = "Set (slew) the time with adjtime()";
    115  1.1  kardel     doc = <<-  _EndOfDoc_
    116  1.1  kardel 	_EndOfDoc_;
    117  1.1  kardel };
    118  1.1  kardel 
    119  1.1  kardel flag = {
    120  1.1  kardel 	name 	= broadcast;
    121  1.1  kardel 	value 	= b;
    122  1.1  kardel 	descrip	= "Use broadcasts to the address specified for synchronisation";
    123  1.1  kardel 	arg-type = string;
    124  1.1  kardel 	arg-name = "broadcast-address";
    125  1.1  kardel 	doc 	= <<-  _EndOfDoc_
    126  1.1  kardel 	If specified SNTP will listen to the specified broadcast address
    127  1.1  kardel 	for NTP broadcasts.  The default maximum wait time,
    128  1.1  kardel 	68 seconds, can be modified with -t.
    129  1.1  kardel 	_EndOfDoc_;
    130  1.1  kardel };
    131  1.1  kardel 
    132  1.1  kardel flag = {
    133  1.1  kardel 	name 	= timeout;
    134  1.1  kardel 	value 	= t;
    135  1.1  kardel 	descrip	= "Specify the number of seconds to wait for broadcasts";
    136  1.1  kardel 	arg-type = number;
    137  1.1  kardel 	arg-name = "seconds";
    138  1.1  kardel 	arg-default = 68;
    139  1.1  kardel 	doc	= <<-  _EndOfDoc_
    140  1.1  kardel 	When waiting for a broadcast packet SNTP will wait the number
    141  1.1  kardel 	of seconds specified before giving up.  Default 68 seconds.
    142  1.1  kardel 	_EndOfDoc_;
    143  1.1  kardel };
    144  1.1  kardel 
    145  1.1  kardel flag = {
    146  1.1  kardel 	name 	= authentication;
    147  1.1  kardel 	value	= a;
    148  1.1  kardel 	descrip	= "Enable authentication with the key auth-keynumber";
    149  1.1  kardel 	arg-type = number;
    150  1.1  kardel 	arg-name = "auth-keynumber";
    151  1.1  kardel 	doc	= <<- _EndOfDoc_
    152  1.1  kardel 	This option enables authentication using the key specified in this option's argument.
    153  1.1  kardel 	The argument of this option is the keyid, a number specified in the keyfile as this
    154  1.1  kardel 	key's identifier. See the keyfile option (-k) for more details.
    155  1.1  kardel 	_EndOfDoc_;
    156  1.1  kardel };
    157  1.1  kardel 
    158  1.1  kardel flag = {
    159  1.1  kardel 	name 	= keyfile;
    160  1.1  kardel 	value	= k;
    161  1.1  kardel 	descrip	= "Specify a keyfile. SNTP will look in this file for the key specified with -a";
    162  1.1  kardel 	arg-type = string;
    163  1.1  kardel 	arg-name = "file-name";
    164  1.1  kardel 	doc	= <<-  _EndOfDoc_
    165  1.1  kardel 	This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this
    166  1.1  kardel 	file. Key files follow the following format:
    167  1.1  kardel 
    168  1.1  kardel 	keyid keytype key
    169  1.1  kardel 
    170  1.1  kardel 	Where 	keyid is a number identifying this key
    171  1.1  kardel 		keytype is one of the follow:
    172  1.1  kardel 			S  Key in 64 Bit hexadecimal number as specified in in the DES specification.
    173  1.1  kardel 			N  Key in 64 Bit hexadecimal number as specified in the NTP standard.
    174  1.1  kardel 			A  Key in a 1-to-8 character ASCII string.
    175  1.1  kardel 			M  Key in a 1-to-8 character ASCII string using the MD5 authentication scheme.
    176  1.1  kardel 
    177  1.1  kardel 	For more information see ntp.keys(5).
    178  1.1  kardel 	_EndOfDoc_;
    179  1.1  kardel };
    180  1.1  kardel 
    181  1.1  kardel 
    182  1.1  kardel 
    183  1.1  kardel 
    184  1.1  kardel detail = <<-  _END_DETAIL
    185  1.1  kardel .I sntp
    186  1.1  kardel implements the Simple Network Time Protocol, and is used
    187  1.1  kardel to query an NTP or SNTP server and either
    188  1.1  kardel display the time
    189  1.1  kardel or
    190  1.1  kardel set the local system's time (given suitable privilege).
    191  1.1  kardel 
    192  1.1  kardel It can be
    193  1.1  kardel run interactively from the command line or as a
    194  1.1  kardel .I cron
    195  1.1  kardel job.
    196  1.1  kardel 
    197  1.1  kardel NTP and SNTP are defined by draft-ietf-ntp-ntpv4-proto-13, which
    198  1.1  kardel obsoletes RFC 4330 and RFC 1305.
    199  1.1  kardel 	_END_DETAIL;
    200  1.1  kardel 
    201  1.1  kardel prog-man-descrip = <<-  _END_PROG_MAN_DESCRIP
    202  1.1  kardel .I sntp
    203  1.1  kardel can be used as a SNTP client to query a NTP or SNTP server and either display
    204  1.1  kardel the time or set the local system's time (given suitable privilege).  It can be
    205  1.1  kardel run as an interactive command or in a
    206  1.1  kardel .I cron
    207  1.1  kardel job.
    208  1.1  kardel 
    209  1.1  kardel NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
    210  1.1  kardel are defined and described by
    211  1.1  kardel draft-ietf-ntp-ntpv4-proto-13,
    212  1.1  kardel which should become a full RFC any month now.
    213  1.1  kardel 
    214  1.1  kardel .PP
    215  1.1  kardel The default is to write the estimated correct local date and time (i.e. not
    216  1.1  kardel UTC) to the standard output in a format like
    217  1.1  kardel .BR "'1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs'" ,
    218  1.1  kardel where the
    219  1.1  kardel .B "'+4.567 +/- 0.089 secs'"
    220  1.1  kardel indicates the local clock is 4.567 seconds behind the correct time
    221  1.1  kardel (so 4.567 seconds must be added to the local clock to get it to be correct),
    222  1.1  kardel and the time of
    223  1.1  kardel '1996 Oct 15 20:17:25.123'
    224  1.1  kardel is believed to be correct to within
    225  1.1  kardel +/- 0.089
    226  1.1  kardel seconds.
    227  1.1  kardel 	_END_PROG_MAN_DESCRIP;
    228  1.1  kardel 
    229  1.1  kardel man-doc = <<-  _END_MAN_DOC
    230  1.1  kardel .SH USAGE
    231  1.1  kardel The simplest use of this program is as an unprivileged command to check the
    232  1.1  kardel current time and error in the local clock.  For example:
    233  1.1  kardel .IP
    234  1.1  kardel .B sntp ntpserver.somewhere
    235  1.1  kardel .PP
    236  1.1  kardel With suitable privilege, it can be run as a command or in a
    237  1.1  kardel .I cron
    238  1.1  kardel job to reset the local clock from a reliable server, like the
    239  1.1  kardel .I ntpdate
    240  1.1  kardel and
    241  1.1  kardel .I rdate
    242  1.1  kardel commands.  For example:
    243  1.1  kardel .IP
    244  1.1  kardel .B sntp -a ntpserver.somewhere
    245  1.1  kardel .SH RETURN VALUE
    246  1.1  kardel The program returns a zero exit
    247  1.1  kardel status for success, and a non-zero one otherwise.
    248  1.1  kardel .SH BUGS
    249  1.1  kardel Please report bugs to http://bugs.ntp.org .
    250  1.1  kardel 	_END_MAN_DOC;
    251