aboutsummaryrefslogtreecommitdiff
path: root/sntp/sntp-opts.def
blob: 4a625413c8f88f5f40aa89bf12197ca27640d5fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
/* -*- Mode: Text -*- */

autogen definitions options;

#include autogen-version.def
#include copyright.def

prog-name      = "sntp";
prog-title	= "standard Simple Network Time Protocol program";
argument	= '[ hostname-or-IP ...]';

#include homerc.def

long-opts;

config-header  = "config.h";

environrc;

#include version.def

test-main;

flag = {
    name      = ipv4;
    value     = 4;
    flags-cant = ipv6;
    descrip   = "Force IPv4 DNS name resolution";
    doc = <<-  _EndOfDoc_
	Force DNS resolution of the following host names on the command line
	to the IPv4 namespace.
	_EndOfDoc_;
};

flag = {
    name      = ipv6;
    value     = 6;
    flags-cant = ipv4;
    descrip   = "Force IPv6 DNS name resolution";
    doc = <<-  _EndOfDoc_
	Force DNS resolution of the following host names on the command line
	to the IPv6 namespace.
	_EndOfDoc_;
};


flag = {
    name      = normalverbose;
    value     = d;
    descrip   = "Normal verbose";
    doc = <<-  _EndOfDoc_
	Diagnostic messages for non-fatal errors and a limited amount of
	tracing should be written to standard error.  Fatal ones always
	produce a diagnostic.  This option should be set when there is a
	suspected problem with the server, network or the source.
	_EndOfDoc_;
};

flag = {
    name      = kod;
    value     = K;
    arg-type  = string;
    arg-name  = "file-name";
    descrip   = "KoD history filename";
    doc = <<-  _EndOfDoc_
	Specifies the filename to be used to persist the history of KoD
	responses received from servers.  The default is
	/var/db/ntp-kod.
	_EndOfDoc_;
};


flag = {
	name	= syslog;
	value	= p;
	flags-cant = logfile;
	descrip = "Logging with syslog";
	doc = <<-  _EndOfDoc_
	When this option is set all logging will be done using syslog.
	_EndOfDoc_;
};

flag = {
	name	   = logfile;
	value	   = l;
	arg-type   = string;
	arg-name   = "file-name";
	flags-cant = syslog;
	descrip = "Log to specified logfile";
	doc = <<-  _EndOfDoc_
	This option causes the client to write log messages to the specified
	logfile.
	_EndOfDoc_;
};

flag = {
    name      = settod;
    value     = s;
    flags-cant = adjtime;
    descrip   = "Set (step) the time with settimeofday()";
    doc = <<-  _EndOfDoc_
	_EndOfDoc_;
};

flag = {
    name      = adjtime;
    value     = j;
    flags-cant = settod;
    descrip   = "Set (slew) the time with adjtime()";
    doc = <<-  _EndOfDoc_
	_EndOfDoc_;
};

flag = {
	name	= broadcast;
	value	= b;
	descrip	= "Use broadcasts to the address specified for synchronisation";
	arg-type = string;
	arg-name = "broadcast-address";
	doc	= <<-  _EndOfDoc_
	If specified SNTP will listen to the specified broadcast address
	for NTP broadcasts.  The default maximum wait time,
	68 seconds, can be modified with -t.
	_EndOfDoc_;
};

flag = {
	name	= timeout;
	value	= t;
	descrip	= "Specify the number of seconds to wait for broadcasts";
	arg-type = number;
	arg-name = "seconds";
	arg-default = 68;
	doc	= <<-  _EndOfDoc_
	When waiting for a broadcast packet SNTP will wait the number
	of seconds specified before giving up.  Default 68 seconds.
	_EndOfDoc_;
};

flag = {
	name	= authentication;
	value	= a;
	descrip	= "Enable authentication with the key auth-keynumber";
	arg-type = number;
	arg-name = "auth-keynumber";
	doc	= <<- _EndOfDoc_
	This option enables authentication using the key specified in this option's argument.
	The argument of this option is the keyid, a number specified in the keyfile as this
	key's identifier. See the keyfile option (-k) for more details.
	_EndOfDoc_;
};

flag = {
	name	= keyfile;
	value	= k;
	descrip	= "Specify a keyfile. SNTP will look in this file for the key specified with -a";
	arg-type = string;
	arg-name = "file-name";
	doc	= <<-  _EndOfDoc_
	This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this
	file. Key files follow the following format:

	keyid keytype key

	Where	keyid is a number identifying this key
		keytype is one of the follow:
			S  Key in 64 Bit hexadecimal number as specified in in the DES specification.
			N  Key in 64 Bit hexadecimal number as specified in the NTP standard.
			A  Key in a 1-to-8 character ASCII string.
			M  Key in a 1-to-8 character ASCII string using the MD5 authentication scheme.

	For more information see ntp.keys(5).
	_EndOfDoc_;
};


/* explain: Additional information whenever the usage routine is invoked */
explain = <<- _END_EXPLAIN
	_END_EXPLAIN;

detail = <<-  _END_DETAIL
sntp implements the Simple Network Time Protocol, and is used to query
an NTP or SNTP server and either display the time or set the local
system's time (given suitable privilege).

It can be run interactively from the command line or as a cron job.

NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC
1305.
	_END_DETAIL;

prog-man-descrip = <<-  _END_PROG_MAN_DESCRIP
.I sntp
can be used as a SNTP client to query a NTP or SNTP server and either display
the time or set the local system's time (given suitable privilege).  It can be
run as an interactive command or in a
.I cron
job.

NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
are defined and described by RFC 5905.

.PP
The default is to write the estimated correct local date and time (i.e. not
UTC) to the standard output in a format like
.BR "'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs'" ,
where the
.B "'(+0800)'"
means that to get to UTC from the reported local time one must
add 8 hours and 0 minutes,
and the
.B "'+4.567 +/- 0.089 secs'"
indicates the local clock is 4.567 seconds behind the correct time
(so 4.567 seconds must be added to the local clock to get it to be correct),
and the time of
'1996-10-15 20:17:25.123'
is believed to be correct to within
+/- 0.089
seconds.
	_END_PROG_MAN_DESCRIP;

prog-info-descrip = <<-  _END_PROG_INFO_DESCRIP
@code{sntp}
can be used as a SNTP client to query a NTP or SNTP server and either display
the time or set the local system's time (given suitable privilege).  It can be
run as an interactive command or in a
@code{cron}
job.

NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
are defined and described by RFC 5905.

@indent
The default is to write the estimated correct local date and time (i.e. not
UTC) to the standard output in a format like
@example
1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
@end example
where the
@example
+4.567 +/- 0.089 secs
@end example
indicates the local clock is 4.567 seconds behind the correct time
(so 4.567 seconds must be added to the local clock to get it to be correct),
and the (local) time of
@code{1996-10-15 20:17:25.123}
can be converted to UTC time by adding 8 hours and 0 minutes, and
is believed to be correct to within
@code{+/- 0.089}
seconds.
	_END_PROG_INFO_DESCRIP;

man-doc = <<-  _END_MAN_DOC
.SH USAGE
The simplest use of this program is as an unprivileged command to check the
current time and error in the local clock.  For example:
.IP
.B sntp ntpserver.somewhere
.PP
With suitable privilege, it can be run as a command or in a
.I cron
job to reset the local clock from a reliable server, like the
.I ntpdate
and
.I rdate
commands.  For example:
.IP
.B sntp -a ntpserver.somewhere
.SH RETURN VALUE
The program returns a zero exit
status for success, and a non-zero one otherwise.
.SH BUGS
Please report bugs to http://bugs.ntp.org .
	_END_MAN_DOC;