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