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