sntp-opts.def revision 1.1.1.1.6.1 1 /* -*- Mode: Text -*- */
2
3 autogen definitions options;
4
5 #include autogen-version.def
6 #include copyright.def
7
8 prog-name = "sntp";
9 prog-title = "standard Simple Network Time Protocol program";
10 argument = '[ hostname-or-IP ...]';
11
12 #include homerc.def
13
14 long-opts;
15
16 config-header = "config.h";
17
18 environrc;
19
20 #include version.def
21
22 test-main;
23
24 flag = {
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
35 flag = {
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
47 flag = {
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
59 flag = {
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
73 flag = {
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
83 flag = {
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
96 flag = {
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
105 flag = {
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
114 flag = {
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
127 flag = {
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
140 flag = {
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
153 flag = {
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 */
178 explain = <<- _END_EXPLAIN
179 _END_EXPLAIN;
180
181 detail = <<- _END_DETAIL
182 sntp implements the Simple Network Time Protocol, and is used to query
183 an NTP or SNTP server and either display the time or set the local
184 system's time (given suitable privilege).
185
186 It can be run interactively from the command line or as a cron job.
187
188 NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC
189 1305.
190 _END_DETAIL;
191
192 prog-man-descrip = <<- _END_PROG_MAN_DESCRIP
193 .I sntp
194 can be used as a SNTP client to query a NTP or SNTP server and either display
195 the time or set the local system's time (given suitable privilege). It can be
196 run as an interactive command or in a
197 .I cron
198 job.
199
200 NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
201 are defined and described by RFC 5905.
202
203 .PP
204 The default is to write the estimated correct local date and time (i.e. not
205 UTC) to the standard output in a format like
206 .BR "'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs'" ,
207 where the
208 .B "'(+0800)'"
209 means that to get to UTC from the reported local time one must
210 add 8 hours and 0 minutes,
211 and the
212 .B "'+4.567 +/- 0.089 secs'"
213 indicates 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),
215 and the time of
216 '1996-10-15 20:17:25.123'
217 is believed to be correct to within
218 +/- 0.089
219 seconds.
220 _END_PROG_MAN_DESCRIP;
221
222 prog-info-descrip = <<- _END_PROG_INFO_DESCRIP
223 @code{sntp}
224 can be used as a SNTP client to query a NTP or SNTP server and either display
225 the time or set the local system's time (given suitable privilege). It can be
226 run as an interactive command or in a
227 @code{cron}
228 job.
229
230 NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
231 are defined and described by RFC 5905.
232
233 @indent
234 The default is to write the estimated correct local date and time (i.e. not
235 UTC) to the standard output in a format like
236 @example
237 1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
238 @end example
239 where the
240 @example
241 +4.567 +/- 0.089 secs
242 @end example
243 indicates 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),
245 and the (local) time of
246 @code{1996-10-15 20:17:25.123}
247 can be converted to UTC time by adding 8 hours and 0 minutes, and
248 is believed to be correct to within
249 @code{+/- 0.089}
250 seconds.
251 _END_PROG_INFO_DESCRIP;
252
253 man-doc = <<- _END_MAN_DOC
254 .SH USAGE
255 The simplest use of this program is as an unprivileged command to check the
256 current time and error in the local clock. For example:
257 .IP
258 .B sntp ntpserver.somewhere
259 .PP
260 With suitable privilege, it can be run as a command or in a
261 .I cron
262 job to reset the local clock from a reliable server, like the
263 .I ntpdate
264 and
265 .I rdate
266 commands. For example:
267 .IP
268 .B sntp -a ntpserver.somewhere
269 .SH RETURN VALUE
270 The program returns a zero exit
271 status for success, and a non-zero one otherwise.
272 .SH BUGS
273 Please report bugs to http://bugs.ntp.org .
274 _END_MAN_DOC;
275