1 /* -*- Mode: Text -*- */
3 autogen definitions options;
5 #include autogen-version.def
9 prog-title = "standard Simple Network Time Protocol client program";
10 argument = '[ hostname-or-IP ...]';
16 config-header = "config.h";
26 descrip = "Force IPv4 DNS name resolution";
28 Force DNS resolution of the following host names on the command line
29 to the IPv4 namespace.
37 descrip = "Force IPv6 DNS name resolution";
39 Force DNS resolution of the following host names on the command line
40 to the IPv6 namespace.
45 name = authentication;
47 descrip = "Enable authentication with the key @var{auth-keynumber}";
49 arg-name = "auth-keynumber";
51 Enable authentication using the key specified in this option's
52 argument. The argument of this option is the @option{keyid}, a
53 number specified in the @option{keyfile} as this key's identifier.
54 See the @option{keyfile} option (@option{-k}) for more details.
61 descrip = "Listen to the address specified for broadcast time sync";
63 arg-name = "broadcast-address";
67 If specified @code{sntp} will listen to the specified address
68 for NTP broadcasts. The default maximum wait time
69 can (and probably should) be modified with @option{-t}.
76 descrip = "Concurrently query all IPs returned for host-name";
78 arg-name = "host-name";
82 Requests from an NTP "client" to a "server" should never be sent
83 more rapidly than one every 2 seconds. By default, any IPs returned
84 as part of a DNS lookup are assumed to be for a single instance of
85 @code{ntpd}, and therefore @code{sntp} will send queries to these IPs
86 one after another, with a 2-second gap in between each query.
88 The @option{-c} or @option{--concurrent} flag says that any IPs
89 returned for the DNS lookup of the supplied host-name are on
90 different machines, so we can send concurrent queries.
94 #include debug-opt.def
99 descrip = "The gap (in milliseconds) between time requests";
101 arg-name = "milliseconds";
104 Since we're only going to use the first valid response we get and
105 there is benefit to specifying a good number of servers to query,
106 separate the queries we send out by the specified number of
115 arg-name = "file-name";
116 arg-default = "/var/db/ntp-kod";
117 descrip = "KoD history filename";
119 Specifies the filename to be used for the persistent history of KoD
120 responses received from servers. If the file does not exist, a
121 warning message will be displayed. The file will not be created.
128 descrip = "Look in this file for the key specified with @option{-a}";
130 arg-name = "file-name";
132 This option specifies the keyfile.
133 @code{sntp} will search for the key specified with @option{-a}
134 @file{keyno} in this file. See @command{ntp.keys(5)} for more
143 arg-name = "file-name";
144 descrip = "Log to specified logfile";
146 This option causes the client to write log messages to the specified
156 descrip = "Adjustments less than @var{steplimit} msec will be slewed";
158 If the time adjustment is less than @file{steplimit} milliseconds,
159 slew the amount using @command{adjtime(2)}. Otherwise, step the
160 correction using @command{settimeofday(2)}. The default value is 0,
161 which means all adjustments will be stepped. This is a feature, as
162 different situations demand different values.
169 descrip = "Send @var{int} as our NTP protocol version";
174 When sending requests to a remote server, tell them we are running
175 NTP protocol version @file{ntpversion} .
180 name = usereservedport;
182 descrip = "Use the NTP Reserved Port (port 123)";
184 Use port 123, which is reserved for NTP, for our network
192 descrip = "OK to 'step' the time with @command{settimeofday(2)}";
200 descrip = "OK to 'slew' the time with @command{adjtime(2)}";
209 descrip = "The number of seconds to wait for responses";
211 arg-name = "seconds";
214 When waiting for a reply, @code{sntp} will wait the number
215 of seconds specified before giving up. The default should be
216 more than enough for a unicast response. If @code{sntp} is
217 only waiting for a broadcast response a longer timeout is
224 descrip = "Wait for pending replies (if not setting the time)";
229 If we are not setting the time, wait for all pending responses.
233 /* explain: Additional information whenever the usage routine is invoked */
234 explain = <<- _END_EXPLAIN
238 ds-type = 'DESCRIPTION';
240 ds-text = <<- _END_PROG_MDOC_DESCRIP
242 can be used as an SNTP client to query a NTP or SNTP server and either display
243 the time or set the local system's time (given suitable privilege). It can be
244 run as an interactive command or from a
248 NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
249 are defined and described by RFC 5905.
252 The default is to write the estimated correct local date and time (i.e. not
253 UTC) to the standard output in a format like:
255 .Ic "'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'"
259 means that to get to UTC from the reported local time one must
260 add 8 hours and 0 minutes,
263 indicates the local clock is 4.567 seconds behind the correct time
264 (so 4.567 seconds must be added to the local clock to get it to be correct).
265 Note that the number of decimals printed for this value will change
266 based on the reported precision of the server.
269 .Em synchronization distance
270 (in seconds), which represents the maximum error due to all causes.
271 If the server does not report valid data needed to calculate the
272 synchronization distance, this will be reported as
276 is different from the
278 both will be displayed.
284 of the host is reported
285 and the leap indicator is decoded and displayed.
286 _END_PROG_MDOC_DESCRIP;
292 ds-text = <<- _END_MDOC_USAGE
293 .Bl -tag -width indent
294 .It Li "sntp ntpserver.somewhere"
295 is the simplest use of this program
296 and can be run as an unprivileged command
297 to check the current time and error in the local clock.
298 .It Li "sntp -Ss -M 128 ntpserver.somewhere"
299 With suitable privilege,
304 .Ic "sntp -Ss -M 128 ntpserver.somewhere"
305 will request the time from the server,
306 and if that server reports that it is synchronized
307 then if the offset adjustment is less than 128 milliseconds
308 the correction will be slewed,
309 and if the correction is more than 128 milliseconds
310 the correction will be stepped.
311 .It Li "sntp -S ntpserver.somewhere"
312 With suitable privilege,
317 .Ic "sntp -S ntpserver.somewhere"
318 will set (step) the local clock from a synchronized specified server,
319 like the (deprecated)
320 .Xr ntpdate 1ntpdatemdoc ,
331 ds-text = <<- _END_MDOC_AUTHORS
332 .An "Johannes Maximilian Kuehn"