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";
131 arg-default = "/etc/ntp.keys";
133 This option specifies the keyfile.
134 @code{sntp} will search for the key specified with @option{-a}
135 @file{keyno} in this file. See @command{ntp.keys(5)} for more
144 arg-name = "file-name";
145 descrip = "Log to specified logfile";
147 This option causes the client to write log messages to the specified
157 descrip = "Adjustments less than @var{steplimit} msec will be slewed";
159 If the time adjustment is less than @file{steplimit} milliseconds,
160 slew the amount using @command{adjtime(2)}. Otherwise, step the
161 correction using @command{settimeofday(2)}. The default value is 0,
162 which means all adjustments will be stepped. This is a feature, as
163 different situations demand different values.
170 descrip = "Send @var{int} as our NTP protocol version";
175 When sending requests to a remote server, tell them we are running
176 NTP protocol version @file{ntpversion} .
181 name = usereservedport;
183 descrip = "Use the NTP Reserved Port (port 123)";
185 Use port 123, which is reserved for NTP, for our network
193 descrip = "OK to 'step' the time with @command{settimeofday(2)}";
201 descrip = "OK to 'slew' the time with @command{adjtime(2)}";
210 descrip = "The number of seconds to wait for responses";
212 arg-name = "seconds";
215 When waiting for a reply, @code{sntp} will wait the number
216 of seconds specified before giving up. The default should be
217 more than enough for a unicast response. If @code{sntp} is
218 only waiting for a broadcast response a longer timeout is
225 descrip = "Wait for pending replies (if not setting the time)";
230 If we are not setting the time, wait for all pending responses.
234 /* explain: Additional information whenever the usage routine is invoked */
235 explain = <<- _END_EXPLAIN
239 ds-type = 'DESCRIPTION';
241 ds-text = <<- _END_PROG_MDOC_DESCRIP
243 can be used as an SNTP client to query a NTP or SNTP server and either display
244 the time or set the local system's time (given suitable privilege). It can be
245 run as an interactive command or from a
249 NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
250 are defined and described by RFC 5905.
253 The default is to write the estimated correct local date and time (i.e. not
254 UTC) to the standard output in a format like:
256 .Ic "'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'"
260 means that to get to UTC from the reported local time one must
261 add 8 hours and 0 minutes,
264 indicates the local clock is 4.567 seconds behind the correct time
265 (so 4.567 seconds must be added to the local clock to get it to be correct).
266 Note that the number of decimals printed for this value will change
267 based on the reported precision of the server.
270 .Em synchronization distance
271 (in seconds), which represents the maximum error due to all causes.
272 If the server does not report valid data needed to calculate the
273 synchronization distance, this will be reported as
277 is different from the
279 both will be displayed.
285 of the host is reported
286 and the leap indicator is decoded and displayed.
287 _END_PROG_MDOC_DESCRIP;
293 ds-text = <<- _END_MDOC_USAGE
294 .Bl -tag -width indent
295 .It Li "sntp ntpserver.somewhere"
296 is the simplest use of this program
297 and can be run as an unprivileged command
298 to check the current time and error in the local clock.
299 .It Li "sntp -Ss -M 128 ntpserver.somewhere"
300 With suitable privilege,
305 .Ic "sntp -Ss -M 128 ntpserver.somewhere"
306 will request the time from the server,
307 and if that server reports that it is synchronized
308 then if the offset adjustment is less than 128 milliseconds
309 the correction will be slewed,
310 and if the correction is more than 128 milliseconds
311 the correction will be stepped.
312 .It Li "sntp -S ntpserver.somewhere"
313 With suitable privilege,
318 .Ic "sntp -S ntpserver.somewhere"
319 will set (step) the local clock from a synchronized specified server,
320 like the (deprecated)
321 .Xr ntpdate 1ntpdatemdoc ,
332 ds-text = <<- _END_MDOC_AUTHORS
333 .An "Johannes Maximilian Kuehn"