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