1 /* $NetBSD: sntp-opts.c,v 1.16 2024/08/18 20:47:20 christos Exp $ */
2
3 /*
4 * EDIT THIS FILE WITH CAUTION (sntp-opts.c)
5 *
6 * It has been AutoGen-ed May 25, 2024 at 12:02:07 AM by AutoGen 5.18.16
7 * From the definitions sntp-opts.def
8 * and the template file options
9 *
10 * Generated from AutoOpts 42:1:17 templates.
11 *
12 * AutoOpts is a copyrighted work. This source file is not encumbered
13 * by AutoOpts licensing, but is provided under the licensing terms chosen
14 * by the sntp author or copyright holder. AutoOpts is
15 * licensed under the terms of the LGPL. The redistributable library
16 * (``libopts'') is licensed under the terms of either the LGPL or, at the
17 * users discretion, the BSD license. See the AutoOpts and/or libopts sources
18 * for details.
19 *
20 * The sntp program is copyrighted and licensed
21 * under the following terms:
22 *
23 * Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.
24 * This is free software. It is licensed for use, modification and
25 * redistribution under the terms of the NTP License, copies of which
26 * can be seen at:
27 * <http://ntp.org/license>
28 * <http://opensource.org/licenses/ntp-license.php>
29 *
30 * Permission to use, copy, modify, and distribute this software and its
31 * documentation for any purpose with or without fee is hereby granted,
32 * provided that the above copyright notice appears in all copies and that
33 * both the copyright notice and this permission notice appear in
34 * supporting documentation, and that the name The University of Delaware not be used in
35 * advertising or publicity pertaining to distribution of the software
36 * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
37 * representations about the suitability this software for any purpose. It
38 * is provided "as is" without express or implied warranty.
39 */
40
41 #ifndef __doxygen__
42 #define OPTION_CODE_COMPILE 1
43 #include "sntp-opts.h"
44 #include <sys/types.h>
45 #include <sys/stat.h>
46
47 #include <errno.h>
48 #include <fcntl.h>
49 #include <limits.h>
50 #include <stdio.h>
51 #include <stdlib.h>
52 #include <string.h>
53 #include <unistd.h>
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 extern FILE * option_usage_fp;
59 #define zCopyright (sntp_opt_strs+0)
60 #define zLicenseDescrip (sntp_opt_strs+341)
61
62 /*
63 * global included definitions
64 */
65 #ifdef __windows
66 extern int atoi(const char*);
67 #else
68 # include <stdlib.h>
69 #endif
70
71 #ifndef NULL
72 # define NULL 0
73 #endif
74
75 /**
76 * static const strings for sntp options
77 */
78 static char const sntp_opt_strs[2567] =
79 /* 0 */ "sntp 4.2.8p18\n"
80 "Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n"
81 "This is free software. It is licensed for use, modification and\n"
82 "redistribution under the terms of the NTP License, copies of which\n"
83 "can be seen at:\n"
84 " <http://ntp.org/license>\n"
85 " <http://opensource.org/licenses/ntp-license.php>\n\0"
86 /* 341 */ "Permission to use, copy, modify, and distribute this software and its\n"
87 "documentation for any purpose with or without fee is hereby granted,\n"
88 "provided that the above copyright notice appears in all copies and that\n"
89 "both the copyright notice and this permission notice appear in supporting\n"
90 "documentation, and that the name The University of Delaware not be used in\n"
91 "advertising or publicity pertaining to distribution of the software without\n"
92 "specific, written prior permission. The University of Delaware and Network\n"
93 "Time Foundation makes no representations about the suitability this\n"
94 "software for any purpose. It is provided \"as is\" without express or\n"
95 "implied warranty.\n\0"
96 /* 1009 */ "Force IPv4 DNS name resolution\0"
97 /* 1040 */ "IPV4\0"
98 /* 1045 */ "ipv4\0"
99 /* 1050 */ "Force IPv6 DNS name resolution\0"
100 /* 1081 */ "IPV6\0"
101 /* 1086 */ "ipv6\0"
102 /* 1091 */ "Enable authentication with the key auth-keynumber\0"
103 /* 1141 */ "AUTHENTICATION\0"
104 /* 1156 */ "authentication\0"
105 /* 1171 */ "Listen to the address specified for broadcast time sync\0"
106 /* 1227 */ "BROADCAST\0"
107 /* 1237 */ "broadcast\0"
108 /* 1247 */ "Concurrently query all IPs returned for host-name\0"
109 /* 1297 */ "CONCURRENT\0"
110 /* 1308 */ "concurrent\0"
111 /* 1319 */ "Increase debug verbosity level\0"
112 /* 1350 */ "DEBUG_LEVEL\0"
113 /* 1362 */ "debug-level\0"
114 /* 1374 */ "Set the debug verbosity level\0"
115 /* 1404 */ "SET_DEBUG_LEVEL\0"
116 /* 1420 */ "set-debug-level\0"
117 /* 1436 */ "The gap (in milliseconds) between time requests\0"
118 /* 1484 */ "GAP\0"
119 /* 1488 */ "gap\0"
120 /* 1492 */ "KoD history filename\0"
121 /* 1513 */ "KOD\0"
122 /* 1517 */ "kod\0"
123 /* 1521 */ "/var/db/ntp-kod\0"
124 /* 1537 */ "Look in this file for the key specified with -a\0"
125 /* 1585 */ "KEYFILE\0"
126 /* 1593 */ "keyfile\0"
127 /* 1601 */ "/etc/ntp.keys\0"
128 /* 1615 */ "Log to specified logfile\0"
129 /* 1640 */ "LOGFILE\0"
130 /* 1648 */ "logfile\0"
131 /* 1656 */ "Adjustments less than steplimit msec will be slewed\0"
132 /* 1708 */ "STEPLIMIT\0"
133 /* 1718 */ "steplimit\0"
134 /* 1728 */ "Send int as our NTP protocol version\0"
135 /* 1765 */ "NTPVERSION\0"
136 /* 1776 */ "ntpversion\0"
137 /* 1787 */ "Use the NTP Reserved Port (port 123)\0"
138 /* 1824 */ "USERESERVEDPORT\0"
139 /* 1840 */ "usereservedport\0"
140 /* 1856 */ "OK to 'step' the time with settimeofday(2)\0"
141 /* 1899 */ "STEP\0"
142 /* 1904 */ "step\0"
143 /* 1909 */ "OK to 'slew' the time with adjtime(2)\0"
144 /* 1947 */ "SLEW\0"
145 /* 1952 */ "slew\0"
146 /* 1957 */ "The number of seconds to wait for responses\0"
147 /* 2001 */ "TIMEOUT\0"
148 /* 2009 */ "timeout\0"
149 /* 2017 */ "Wait for pending replies (if not setting the time)\0"
150 /* 2068 */ "WAIT\0"
151 /* 2073 */ "no-wait\0"
152 /* 2081 */ "no\0"
153 /* 2084 */ "display extended usage information and exit\0"
154 /* 2128 */ "help\0"
155 /* 2133 */ "extended usage information passed thru pager\0"
156 /* 2178 */ "more-help\0"
157 /* 2188 */ "output version information and exit\0"
158 /* 2224 */ "version\0"
159 /* 2232 */ "save the option state to a config file\0"
160 /* 2271 */ "save-opts\0"
161 /* 2281 */ "load options from a config file\0"
162 /* 2313 */ "LOAD_OPTS\0"
163 /* 2323 */ "no-load-opts\0"
164 /* 2336 */ "SNTP\0"
165 /* 2341 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p18\n"
166 "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
167 "\t\t[ hostname-or-IP ...]\n\0"
168 /* 2501 */ "$HOME\0"
169 /* 2507 */ ".\0"
170 /* 2509 */ ".ntprc\0"
171 /* 2516 */ "https://bugs.ntp.org, bugs@ntp.org\0"
172 /* 2551 */ "\n\0"
173 /* 2553 */ "sntp 4.2.8p18";
174
175 /**
176 * ipv4 option description with
177 * "Must also have options" and "Incompatible options":
178 */
179 /** Descriptive text for the ipv4 option */
180 #define IPV4_DESC (sntp_opt_strs+1009)
181 /** Upper-cased name for the ipv4 option */
182 #define IPV4_NAME (sntp_opt_strs+1040)
183 /** Name string for the ipv4 option */
184 #define IPV4_name (sntp_opt_strs+1045)
185 /** Other options that appear in conjunction with the ipv4 option */
186 static int const aIpv4CantList[] = {
187 INDEX_OPT_IPV6, NO_EQUIVALENT };
188 /** Compiled in flag settings for the ipv4 option */
189 #define IPV4_FLAGS (OPTST_DISABLED)
190
191 /**
192 * ipv6 option description with
193 * "Must also have options" and "Incompatible options":
194 */
195 /** Descriptive text for the ipv6 option */
196 #define IPV6_DESC (sntp_opt_strs+1050)
197 /** Upper-cased name for the ipv6 option */
198 #define IPV6_NAME (sntp_opt_strs+1081)
199 /** Name string for the ipv6 option */
200 #define IPV6_name (sntp_opt_strs+1086)
201 /** Other options that appear in conjunction with the ipv6 option */
202 static int const aIpv6CantList[] = {
203 INDEX_OPT_IPV4, NO_EQUIVALENT };
204 /** Compiled in flag settings for the ipv6 option */
205 #define IPV6_FLAGS (OPTST_DISABLED)
206
207 /**
208 * authentication option description:
209 */
210 /** Descriptive text for the authentication option */
211 #define AUTHENTICATION_DESC (sntp_opt_strs+1091)
212 /** Upper-cased name for the authentication option */
213 #define AUTHENTICATION_NAME (sntp_opt_strs+1141)
214 /** Name string for the authentication option */
215 #define AUTHENTICATION_name (sntp_opt_strs+1156)
216 /** Compiled in flag settings for the authentication option */
217 #define AUTHENTICATION_FLAGS (OPTST_DISABLED \
218 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
219
220 /**
221 * broadcast option description:
222 */
223 /** Descriptive text for the broadcast option */
224 #define BROADCAST_DESC (sntp_opt_strs+1171)
225 /** Upper-cased name for the broadcast option */
226 #define BROADCAST_NAME (sntp_opt_strs+1227)
227 /** Name string for the broadcast option */
228 #define BROADCAST_name (sntp_opt_strs+1237)
229 /** Compiled in flag settings for the broadcast option */
230 #define BROADCAST_FLAGS (OPTST_DISABLED | OPTST_STACKED \
231 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
232
233 /**
234 * concurrent option description:
235 */
236 /** Descriptive text for the concurrent option */
237 #define CONCURRENT_DESC (sntp_opt_strs+1247)
238 /** Upper-cased name for the concurrent option */
239 #define CONCURRENT_NAME (sntp_opt_strs+1297)
240 /** Name string for the concurrent option */
241 #define CONCURRENT_name (sntp_opt_strs+1308)
242 /** Compiled in flag settings for the concurrent option */
243 #define CONCURRENT_FLAGS (OPTST_DISABLED | OPTST_STACKED \
244 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
245
246 /**
247 * debug-level option description:
248 */
249 /** Descriptive text for the debug-level option */
250 #define DEBUG_LEVEL_DESC (sntp_opt_strs+1319)
251 /** Upper-cased name for the debug-level option */
252 #define DEBUG_LEVEL_NAME (sntp_opt_strs+1350)
253 /** Name string for the debug-level option */
254 #define DEBUG_LEVEL_name (sntp_opt_strs+1362)
255 /** Compiled in flag settings for the debug-level option */
256 #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
257
258 /**
259 * set-debug-level option description:
260 */
261 /** Descriptive text for the set-debug-level option */
262 #define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1374)
263 /** Upper-cased name for the set-debug-level option */
264 #define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1404)
265 /** Name string for the set-debug-level option */
266 #define SET_DEBUG_LEVEL_name (sntp_opt_strs+1420)
267 /** Compiled in flag settings for the set-debug-level option */
268 #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
269 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
270
271 /**
272 * gap option description:
273 */
274 /** Descriptive text for the gap option */
275 #define GAP_DESC (sntp_opt_strs+1436)
276 /** Upper-cased name for the gap option */
277 #define GAP_NAME (sntp_opt_strs+1484)
278 /** Name string for the gap option */
279 #define GAP_name (sntp_opt_strs+1488)
280 /** The compiled in default value for the gap option argument */
281 #define GAP_DFT_ARG ((char const*)50)
282 /** Compiled in flag settings for the gap option */
283 #define GAP_FLAGS (OPTST_DISABLED \
284 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
285
286 /**
287 * kod option description:
288 */
289 /** Descriptive text for the kod option */
290 #define KOD_DESC (sntp_opt_strs+1492)
291 /** Upper-cased name for the kod option */
292 #define KOD_NAME (sntp_opt_strs+1513)
293 /** Name string for the kod option */
294 #define KOD_name (sntp_opt_strs+1517)
295 /** The compiled in default value for the kod option argument */
296 #define KOD_DFT_ARG (sntp_opt_strs+1521)
297 /** Compiled in flag settings for the kod option */
298 #define KOD_FLAGS (OPTST_DISABLED \
299 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
300
301 /**
302 * keyfile option description:
303 */
304 /** Descriptive text for the keyfile option */
305 #define KEYFILE_DESC (sntp_opt_strs+1537)
306 /** Upper-cased name for the keyfile option */
307 #define KEYFILE_NAME (sntp_opt_strs+1585)
308 /** Name string for the keyfile option */
309 #define KEYFILE_name (sntp_opt_strs+1593)
310 /** The compiled in default value for the keyfile option argument */
311 #define KEYFILE_DFT_ARG (sntp_opt_strs+1601)
312 /** Compiled in flag settings for the keyfile option */
313 #define KEYFILE_FLAGS (OPTST_DISABLED \
314 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
315
316 /**
317 * logfile option description:
318 */
319 /** Descriptive text for the logfile option */
320 #define LOGFILE_DESC (sntp_opt_strs+1615)
321 /** Upper-cased name for the logfile option */
322 #define LOGFILE_NAME (sntp_opt_strs+1640)
323 /** Name string for the logfile option */
324 #define LOGFILE_name (sntp_opt_strs+1648)
325 /** Compiled in flag settings for the logfile option */
326 #define LOGFILE_FLAGS (OPTST_DISABLED \
327 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
328
329 /**
330 * steplimit option description:
331 */
332 /** Descriptive text for the steplimit option */
333 #define STEPLIMIT_DESC (sntp_opt_strs+1656)
334 /** Upper-cased name for the steplimit option */
335 #define STEPLIMIT_NAME (sntp_opt_strs+1708)
336 /** Name string for the steplimit option */
337 #define STEPLIMIT_name (sntp_opt_strs+1718)
338 /** Compiled in flag settings for the steplimit option */
339 #define STEPLIMIT_FLAGS (OPTST_DISABLED \
340 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
341
342 /**
343 * ntpversion option description:
344 */
345 /** Descriptive text for the ntpversion option */
346 #define NTPVERSION_DESC (sntp_opt_strs+1728)
347 /** Upper-cased name for the ntpversion option */
348 #define NTPVERSION_NAME (sntp_opt_strs+1765)
349 /** Name string for the ntpversion option */
350 #define NTPVERSION_name (sntp_opt_strs+1776)
351 /** The compiled in default value for the ntpversion option argument */
352 #define NTPVERSION_DFT_ARG ((char const*)4)
353 /** Compiled in flag settings for the ntpversion option */
354 #define NTPVERSION_FLAGS (OPTST_DISABLED \
355 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
356
357 /**
358 * usereservedport option description:
359 */
360 /** Descriptive text for the usereservedport option */
361 #define USERESERVEDPORT_DESC (sntp_opt_strs+1787)
362 /** Upper-cased name for the usereservedport option */
363 #define USERESERVEDPORT_NAME (sntp_opt_strs+1824)
364 /** Name string for the usereservedport option */
365 #define USERESERVEDPORT_name (sntp_opt_strs+1840)
366 /** Compiled in flag settings for the usereservedport option */
367 #define USERESERVEDPORT_FLAGS (OPTST_DISABLED)
368
369 /**
370 * step option description:
371 */
372 /** Descriptive text for the step option */
373 #define STEP_DESC (sntp_opt_strs+1856)
374 /** Upper-cased name for the step option */
375 #define STEP_NAME (sntp_opt_strs+1899)
376 /** Name string for the step option */
377 #define STEP_name (sntp_opt_strs+1904)
378 /** Compiled in flag settings for the step option */
379 #define STEP_FLAGS (OPTST_DISABLED)
380
381 /**
382 * slew option description:
383 */
384 /** Descriptive text for the slew option */
385 #define SLEW_DESC (sntp_opt_strs+1909)
386 /** Upper-cased name for the slew option */
387 #define SLEW_NAME (sntp_opt_strs+1947)
388 /** Name string for the slew option */
389 #define SLEW_name (sntp_opt_strs+1952)
390 /** Compiled in flag settings for the slew option */
391 #define SLEW_FLAGS (OPTST_DISABLED)
392
393 /**
394 * timeout option description:
395 */
396 /** Descriptive text for the timeout option */
397 #define TIMEOUT_DESC (sntp_opt_strs+1957)
398 /** Upper-cased name for the timeout option */
399 #define TIMEOUT_NAME (sntp_opt_strs+2001)
400 /** Name string for the timeout option */
401 #define TIMEOUT_name (sntp_opt_strs+2009)
402 /** The compiled in default value for the timeout option argument */
403 #define TIMEOUT_DFT_ARG ((char const*)5)
404 /** Compiled in flag settings for the timeout option */
405 #define TIMEOUT_FLAGS (OPTST_DISABLED \
406 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
407
408 /**
409 * wait option description:
410 */
411 /** Descriptive text for the wait option */
412 #define WAIT_DESC (sntp_opt_strs+2017)
413 /** Upper-cased name for the wait option */
414 #define WAIT_NAME (sntp_opt_strs+2068)
415 /** disablement name for the wait option */
416 #define NOT_WAIT_name (sntp_opt_strs+2073)
417 /** disablement prefix for the wait option */
418 #define NOT_WAIT_PFX (sntp_opt_strs+2081)
419 /** Name string for the wait option */
420 #define WAIT_name (NOT_WAIT_name + 3)
421 /** Compiled in flag settings for the wait option */
422 #define WAIT_FLAGS (OPTST_INITENABLED)
423
424 /*
425 * Help/More_Help/Version option descriptions:
426 */
427 #define HELP_DESC (sntp_opt_strs+2084)
428 #define HELP_name (sntp_opt_strs+2128)
429 #ifdef HAVE_WORKING_FORK
430 #define MORE_HELP_DESC (sntp_opt_strs+2133)
431 #define MORE_HELP_name (sntp_opt_strs+2178)
432 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
433 #else
434 #define MORE_HELP_DESC HELP_DESC
435 #define MORE_HELP_name HELP_name
436 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
437 #endif
438 #ifdef NO_OPTIONAL_OPT_ARGS
439 # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
440 #else
441 # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
442 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
443 #endif
444 #define VER_DESC (sntp_opt_strs+2188)
445 #define VER_name (sntp_opt_strs+2224)
446 #define SAVE_OPTS_DESC (sntp_opt_strs+2232)
447 #define SAVE_OPTS_name (sntp_opt_strs+2271)
448 #define LOAD_OPTS_DESC (sntp_opt_strs+2281)
449 #define LOAD_OPTS_NAME (sntp_opt_strs+2313)
450 #define NO_LOAD_OPTS_name (sntp_opt_strs+2323)
451 #define LOAD_OPTS_pfx (sntp_opt_strs+2081)
452 #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
453 /**
454 * Declare option callback procedures
455 */
456 extern tOptProc
457 ntpOptionPrintVersion, optionBooleanVal, optionNestedVal,
458 optionNumericVal, optionPagedUsage, optionResetOpt,
459 optionStackArg, optionTimeDate, optionTimeVal,
460 optionUnstackArg, optionVendorOption;
461 static tOptProc
462 doOptDebug_Level, doOptKeyfile, doOptKod, doOptLogfile,
463 doOptNtpversion, doOptSteplimit, doUsageOpt;
464 #define VER_PROC ntpOptionPrintVersion
465
466 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
467 /**
468 * Define the sntp Option Descriptions.
469 * This is an array of OPTION_CT entries, one for each
470 * option that the sntp program responds to.
471 */
472 static tOptDesc optDesc[OPTION_CT] = {
473 { /* entry idx, value */ 0, VALUE_OPT_IPV4,
474 /* equiv idx, value */ 0, VALUE_OPT_IPV4,
475 /* equivalenced to */ NO_EQUIVALENT,
476 /* min, max, act ct */ 0, 1, 0,
477 /* opt state flags */ IPV4_FLAGS, 0,
478 /* last opt argumnt */ { NULL }, /* --ipv4 */
479 /* arg list/cookie */ NULL,
480 /* must/cannot opts */ NULL, aIpv4CantList,
481 /* option proc */ NULL,
482 /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
483 /* disablement strs */ NULL, NULL },
484
485 { /* entry idx, value */ 1, VALUE_OPT_IPV6,
486 /* equiv idx, value */ 1, VALUE_OPT_IPV6,
487 /* equivalenced to */ NO_EQUIVALENT,
488 /* min, max, act ct */ 0, 1, 0,
489 /* opt state flags */ IPV6_FLAGS, 0,
490 /* last opt argumnt */ { NULL }, /* --ipv6 */
491 /* arg list/cookie */ NULL,
492 /* must/cannot opts */ NULL, aIpv6CantList,
493 /* option proc */ NULL,
494 /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
495 /* disablement strs */ NULL, NULL },
496
497 { /* entry idx, value */ 2, VALUE_OPT_AUTHENTICATION,
498 /* equiv idx, value */ 2, VALUE_OPT_AUTHENTICATION,
499 /* equivalenced to */ NO_EQUIVALENT,
500 /* min, max, act ct */ 0, 1, 0,
501 /* opt state flags */ AUTHENTICATION_FLAGS, 0,
502 /* last opt argumnt */ { NULL }, /* --authentication */
503 /* arg list/cookie */ NULL,
504 /* must/cannot opts */ NULL, NULL,
505 /* option proc */ optionNumericVal,
506 /* desc, NAME, name */ AUTHENTICATION_DESC, AUTHENTICATION_NAME, AUTHENTICATION_name,
507 /* disablement strs */ NULL, NULL },
508
509 { /* entry idx, value */ 3, VALUE_OPT_BROADCAST,
510 /* equiv idx, value */ 3, VALUE_OPT_BROADCAST,
511 /* equivalenced to */ NO_EQUIVALENT,
512 /* min, max, act ct */ 0, NOLIMIT, 0,
513 /* opt state flags */ BROADCAST_FLAGS, 0,
514 /* last opt argumnt */ { NULL }, /* --broadcast */
515 /* arg list/cookie */ NULL,
516 /* must/cannot opts */ NULL, NULL,
517 /* option proc */ optionStackArg,
518 /* desc, NAME, name */ BROADCAST_DESC, BROADCAST_NAME, BROADCAST_name,
519 /* disablement strs */ NULL, NULL },
520
521 { /* entry idx, value */ 4, VALUE_OPT_CONCURRENT,
522 /* equiv idx, value */ 4, VALUE_OPT_CONCURRENT,
523 /* equivalenced to */ NO_EQUIVALENT,
524 /* min, max, act ct */ 0, NOLIMIT, 0,
525 /* opt state flags */ CONCURRENT_FLAGS, 0,
526 /* last opt argumnt */ { NULL }, /* --concurrent */
527 /* arg list/cookie */ NULL,
528 /* must/cannot opts */ NULL, NULL,
529 /* option proc */ optionStackArg,
530 /* desc, NAME, name */ CONCURRENT_DESC, CONCURRENT_NAME, CONCURRENT_name,
531 /* disablement strs */ NULL, NULL },
532
533 { /* entry idx, value */ 5, VALUE_OPT_DEBUG_LEVEL,
534 /* equiv idx, value */ 5, VALUE_OPT_DEBUG_LEVEL,
535 /* equivalenced to */ NO_EQUIVALENT,
536 /* min, max, act ct */ 0, NOLIMIT, 0,
537 /* opt state flags */ DEBUG_LEVEL_FLAGS, 0,
538 /* last opt argumnt */ { NULL }, /* --debug-level */
539 /* arg list/cookie */ NULL,
540 /* must/cannot opts */ NULL, NULL,
541 /* option proc */ doOptDebug_Level,
542 /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
543 /* disablement strs */ NULL, NULL },
544
545 { /* entry idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL,
546 /* equiv idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL,
547 /* equivalenced to */ NO_EQUIVALENT,
548 /* min, max, act ct */ 0, NOLIMIT, 0,
549 /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0,
550 /* last opt argumnt */ { NULL }, /* --set-debug-level */
551 /* arg list/cookie */ NULL,
552 /* must/cannot opts */ NULL, NULL,
553 /* option proc */ optionNumericVal,
554 /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
555 /* disablement strs */ NULL, NULL },
556
557 { /* entry idx, value */ 7, VALUE_OPT_GAP,
558 /* equiv idx, value */ 7, VALUE_OPT_GAP,
559 /* equivalenced to */ NO_EQUIVALENT,
560 /* min, max, act ct */ 0, 1, 0,
561 /* opt state flags */ GAP_FLAGS, 0,
562 /* last opt argumnt */ { GAP_DFT_ARG },
563 /* arg list/cookie */ NULL,
564 /* must/cannot opts */ NULL, NULL,
565 /* option proc */ optionNumericVal,
566 /* desc, NAME, name */ GAP_DESC, GAP_NAME, GAP_name,
567 /* disablement strs */ NULL, NULL },
568
569 { /* entry idx, value */ 8, VALUE_OPT_KOD,
570 /* equiv idx, value */ 8, VALUE_OPT_KOD,
571 /* equivalenced to */ NO_EQUIVALENT,
572 /* min, max, act ct */ 0, 1, 0,
573 /* opt state flags */ KOD_FLAGS, 0,
574 /* last opt argumnt */ { KOD_DFT_ARG },
575 /* arg list/cookie */ NULL,
576 /* must/cannot opts */ NULL, NULL,
577 /* option proc */ doOptKod,
578 /* desc, NAME, name */ KOD_DESC, KOD_NAME, KOD_name,
579 /* disablement strs */ NULL, NULL },
580
581 { /* entry idx, value */ 9, VALUE_OPT_KEYFILE,
582 /* equiv idx, value */ 9, VALUE_OPT_KEYFILE,
583 /* equivalenced to */ NO_EQUIVALENT,
584 /* min, max, act ct */ 0, 1, 0,
585 /* opt state flags */ KEYFILE_FLAGS, 0,
586 /* last opt argumnt */ { KEYFILE_DFT_ARG },
587 /* arg list/cookie */ NULL,
588 /* must/cannot opts */ NULL, NULL,
589 /* option proc */ doOptKeyfile,
590 /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name,
591 /* disablement strs */ NULL, NULL },
592
593 { /* entry idx, value */ 10, VALUE_OPT_LOGFILE,
594 /* equiv idx, value */ 10, VALUE_OPT_LOGFILE,
595 /* equivalenced to */ NO_EQUIVALENT,
596 /* min, max, act ct */ 0, 1, 0,
597 /* opt state flags */ LOGFILE_FLAGS, 0,
598 /* last opt argumnt */ { NULL }, /* --logfile */
599 /* arg list/cookie */ NULL,
600 /* must/cannot opts */ NULL, NULL,
601 /* option proc */ doOptLogfile,
602 /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name,
603 /* disablement strs */ NULL, NULL },
604
605 { /* entry idx, value */ 11, VALUE_OPT_STEPLIMIT,
606 /* equiv idx, value */ 11, VALUE_OPT_STEPLIMIT,
607 /* equivalenced to */ NO_EQUIVALENT,
608 /* min, max, act ct */ 0, 1, 0,
609 /* opt state flags */ STEPLIMIT_FLAGS, 0,
610 /* last opt argumnt */ { NULL }, /* --steplimit */
611 /* arg list/cookie */ NULL,
612 /* must/cannot opts */ NULL, NULL,
613 /* option proc */ doOptSteplimit,
614 /* desc, NAME, name */ STEPLIMIT_DESC, STEPLIMIT_NAME, STEPLIMIT_name,
615 /* disablement strs */ NULL, NULL },
616
617 { /* entry idx, value */ 12, VALUE_OPT_NTPVERSION,
618 /* equiv idx, value */ 12, VALUE_OPT_NTPVERSION,
619 /* equivalenced to */ NO_EQUIVALENT,
620 /* min, max, act ct */ 0, 1, 0,
621 /* opt state flags */ NTPVERSION_FLAGS, 0,
622 /* last opt argumnt */ { NTPVERSION_DFT_ARG },
623 /* arg list/cookie */ NULL,
624 /* must/cannot opts */ NULL, NULL,
625 /* option proc */ doOptNtpversion,
626 /* desc, NAME, name */ NTPVERSION_DESC, NTPVERSION_NAME, NTPVERSION_name,
627 /* disablement strs */ NULL, NULL },
628
629 { /* entry idx, value */ 13, VALUE_OPT_USERESERVEDPORT,
630 /* equiv idx, value */ 13, VALUE_OPT_USERESERVEDPORT,
631 /* equivalenced to */ NO_EQUIVALENT,
632 /* min, max, act ct */ 0, 1, 0,
633 /* opt state flags */ USERESERVEDPORT_FLAGS, 0,
634 /* last opt argumnt */ { NULL }, /* --usereservedport */
635 /* arg list/cookie */ NULL,
636 /* must/cannot opts */ NULL, NULL,
637 /* option proc */ NULL,
638 /* desc, NAME, name */ USERESERVEDPORT_DESC, USERESERVEDPORT_NAME, USERESERVEDPORT_name,
639 /* disablement strs */ NULL, NULL },
640
641 { /* entry idx, value */ 14, VALUE_OPT_STEP,
642 /* equiv idx, value */ 14, VALUE_OPT_STEP,
643 /* equivalenced to */ NO_EQUIVALENT,
644 /* min, max, act ct */ 0, 1, 0,
645 /* opt state flags */ STEP_FLAGS, 0,
646 /* last opt argumnt */ { NULL }, /* --step */
647 /* arg list/cookie */ NULL,
648 /* must/cannot opts */ NULL, NULL,
649 /* option proc */ NULL,
650 /* desc, NAME, name */ STEP_DESC, STEP_NAME, STEP_name,
651 /* disablement strs */ NULL, NULL },
652
653 { /* entry idx, value */ 15, VALUE_OPT_SLEW,
654 /* equiv idx, value */ 15, VALUE_OPT_SLEW,
655 /* equivalenced to */ NO_EQUIVALENT,
656 /* min, max, act ct */ 0, 1, 0,
657 /* opt state flags */ SLEW_FLAGS, 0,
658 /* last opt argumnt */ { NULL }, /* --slew */
659 /* arg list/cookie */ NULL,
660 /* must/cannot opts */ NULL, NULL,
661 /* option proc */ NULL,
662 /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name,
663 /* disablement strs */ NULL, NULL },
664
665 { /* entry idx, value */ 16, VALUE_OPT_TIMEOUT,
666 /* equiv idx, value */ 16, VALUE_OPT_TIMEOUT,
667 /* equivalenced to */ NO_EQUIVALENT,
668 /* min, max, act ct */ 0, 1, 0,
669 /* opt state flags */ TIMEOUT_FLAGS, 0,
670 /* last opt argumnt */ { TIMEOUT_DFT_ARG },
671 /* arg list/cookie */ NULL,
672 /* must/cannot opts */ NULL, NULL,
673 /* option proc */ optionNumericVal,
674 /* desc, NAME, name */ TIMEOUT_DESC, TIMEOUT_NAME, TIMEOUT_name,
675 /* disablement strs */ NULL, NULL },
676
677 { /* entry idx, value */ 17, VALUE_OPT_WAIT,
678 /* equiv idx, value */ 17, VALUE_OPT_WAIT,
679 /* equivalenced to */ NO_EQUIVALENT,
680 /* min, max, act ct */ 0, 1, 0,
681 /* opt state flags */ WAIT_FLAGS, 0,
682 /* last opt argumnt */ { NULL }, /* --wait */
683 /* arg list/cookie */ NULL,
684 /* must/cannot opts */ NULL, NULL,
685 /* option proc */ NULL,
686 /* desc, NAME, name */ WAIT_DESC, WAIT_NAME, WAIT_name,
687 /* disablement strs */ NOT_WAIT_name, NOT_WAIT_PFX },
688
689 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
690 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
691 /* equivalenced to */ NO_EQUIVALENT,
692 /* min, max, act ct */ 0, 1, 0,
693 /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
694 /* last opt argumnt */ { NULL },
695 /* arg list/cookie */ NULL,
696 /* must/cannot opts */ NULL, NULL,
697 /* option proc */ VER_PROC,
698 /* desc, NAME, name */ VER_DESC, NULL, VER_name,
699 /* disablement strs */ NULL, NULL },
700
701
702
703 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
704 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
705 /* equivalenced to */ NO_EQUIVALENT,
706 /* min, max, act ct */ 0, 1, 0,
707 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
708 /* last opt argumnt */ { NULL },
709 /* arg list/cookie */ NULL,
710 /* must/cannot opts */ NULL, NULL,
711 /* option proc */ doUsageOpt,
712 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
713 /* disablement strs */ NULL, NULL },
714
715 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
716 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
717 /* equivalenced to */ NO_EQUIVALENT,
718 /* min, max, act ct */ 0, 1, 0,
719 /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
720 /* last opt argumnt */ { NULL },
721 /* arg list/cookie */ NULL,
722 /* must/cannot opts */ NULL, NULL,
723 /* option proc */ optionPagedUsage,
724 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
725 /* disablement strs */ NULL, NULL },
726
727 { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
728 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
729 /* equivalenced to */ NO_EQUIVALENT,
730 /* min, max, act ct */ 0, 1, 0,
731 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
732 | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
733 /* last opt argumnt */ { NULL },
734 /* arg list/cookie */ NULL,
735 /* must/cannot opts */ NULL, NULL,
736 /* option proc */ NULL,
737 /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
738 /* disablement strs */ NULL, NULL },
739
740 { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
741 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
742 /* equivalenced to */ NO_EQUIVALENT,
743 /* min, max, act ct */ 0, NOLIMIT, 0,
744 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
745 | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
746 /* last opt argumnt */ { NULL },
747 /* arg list/cookie */ NULL,
748 /* must/cannot opts */ NULL, NULL,
749 /* option proc */ optionLoadOpt,
750 /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
751 /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
752 };
753
754
755 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
756 /** Reference to the upper cased version of sntp. */
757 #define zPROGNAME (sntp_opt_strs+2336)
758 /** Reference to the title line for sntp usage. */
759 #define zUsageTitle (sntp_opt_strs+2341)
760 /** sntp configuration file name. */
761 #define zRcName (sntp_opt_strs+2509)
762 /** Directories to search for sntp config files. */
763 static char const * const apzHomeList[3] = {
764 sntp_opt_strs+2501,
765 sntp_opt_strs+2507,
766 NULL };
767 /** The sntp program bug email address. */
768 #define zBugsAddr (sntp_opt_strs+2516)
769 /** Clarification/explanation of what sntp does. */
770 #define zExplain (sntp_opt_strs+2551)
771 /** Extra detail explaining what sntp does. */
772 #define zDetail (NULL)
773 /** The full version string for sntp. */
774 #define zFullVersion (sntp_opt_strs+2553)
775 /* extracted from optcode.tlib near line 342 */
776
777 #if defined(ENABLE_NLS)
778 # define OPTPROC_BASE OPTPROC_TRANSLATE
779 static tOptionXlateProc translate_option_strings;
780 #else
781 # define OPTPROC_BASE OPTPROC_NONE
782 # define translate_option_strings NULL
783 #endif /* ENABLE_NLS */
784
785 #define sntp_full_usage (NULL)
786 #define sntp_short_usage (NULL)
787
788 #endif /* not defined __doxygen__ */
789
790 /*
791 * Create the static procedure(s) declared above.
792 */
793 /**
794 * The callout function that invokes the optionUsage function.
795 *
796 * @param[in] opts the AutoOpts option description structure
797 * @param[in] od the descriptor for the "help" (usage) option.
798 * @noreturn
799 */
800 static void
doUsageOpt(tOptions * opts,tOptDesc * od)801 doUsageOpt(tOptions * opts, tOptDesc * od)
802 {
803 int ex_code;
804 ex_code = SNTP_EXIT_SUCCESS;
805 optionUsage(&sntpOptions, ex_code);
806 /* NOTREACHED */
807 exit(SNTP_EXIT_FAILURE);
808 (void)opts;
809 (void)od;
810 }
811
812 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
813 /**
814 * Code to handle the debug-level option.
815 *
816 * @param[in] pOptions the sntp options data structure
817 * @param[in,out] pOptDesc the option descriptor for this option.
818 */
819 static void
doOptDebug_Level(tOptions * pOptions,tOptDesc * pOptDesc)820 doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
821 {
822 /*
823 * Be sure the flag-code[0] handles special values for the options pointer
824 * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
825 * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
826 * reset its state.
827 */
828 /* extracted from debug-opt.def, line 15 */
829 OPT_VALUE_SET_DEBUG_LEVEL++;
830 (void)pOptDesc;
831 (void)pOptions;
832 }
833
834 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
835 /**
836 * Code to handle the kod option.
837 * Specifies the filename to be used for the persistent history of KoD
838 * responses received from servers. If the file does not exist, a
839 * warning message will be displayed. The file will not be created.
840 * @param[in] pOptions the sntp options data structure
841 * @param[in,out] pOptDesc the option descriptor for this option.
842 */
843 static void
doOptKod(tOptions * pOptions,tOptDesc * pOptDesc)844 doOptKod(tOptions* pOptions, tOptDesc* pOptDesc)
845 {
846 static teOptFileType const type =
847 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
848 static tuFileMode mode;
849 #ifndef O_CLOEXEC
850 # define O_CLOEXEC 0
851 #endif
852 mode.file_flags = O_CLOEXEC;
853
854 /*
855 * This function handles special invalid values for "pOptions"
856 */
857 optionFileCheck(pOptions, pOptDesc, type, mode);
858 }
859
860 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
861 /**
862 * Code to handle the keyfile option.
863 * This option specifies the keyfile.
864 * @code{sntp} will search for the key specified with @option{-a}
865 * @file{keyno} in this file. See @command{ntp.keys(5)} for more
866 * information.
867 * @param[in] pOptions the sntp options data structure
868 * @param[in,out] pOptDesc the option descriptor for this option.
869 */
870 static void
doOptKeyfile(tOptions * pOptions,tOptDesc * pOptDesc)871 doOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
872 {
873 static teOptFileType const type =
874 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
875 static tuFileMode mode;
876 #ifndef O_CLOEXEC
877 # define O_CLOEXEC 0
878 #endif
879 mode.file_flags = O_CLOEXEC;
880
881 /*
882 * This function handles special invalid values for "pOptions"
883 */
884 optionFileCheck(pOptions, pOptDesc, type, mode);
885 }
886
887 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
888 /**
889 * Code to handle the logfile option.
890 * This option causes the client to write log messages to the specified
891 * @file{logfile}.
892 * @param[in] pOptions the sntp options data structure
893 * @param[in,out] pOptDesc the option descriptor for this option.
894 */
895 static void
doOptLogfile(tOptions * pOptions,tOptDesc * pOptDesc)896 doOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc)
897 {
898 static teOptFileType const type =
899 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
900 static tuFileMode mode;
901 #ifndef O_CLOEXEC
902 # define O_CLOEXEC 0
903 #endif
904 mode.file_flags = O_CLOEXEC;
905
906 /*
907 * This function handles special invalid values for "pOptions"
908 */
909 optionFileCheck(pOptions, pOptDesc, type, mode);
910 }
911
912 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
913 /**
914 * Code to handle the steplimit option.
915 * If the time adjustment is less than @file{steplimit} milliseconds,
916 * slew the amount using @command{adjtime(2)}. Otherwise, step the
917 * correction using @command{settimeofday(2)}. The default value is 0,
918 * which means all adjustments will be stepped. This is a feature, as
919 * different situations demand different values.
920 * @param[in] pOptions the sntp options data structure
921 * @param[in,out] pOptDesc the option descriptor for this option.
922 */
923 static void
doOptSteplimit(tOptions * pOptions,tOptDesc * pOptDesc)924 doOptSteplimit(tOptions* pOptions, tOptDesc* pOptDesc)
925 {
926 static struct {long rmin, rmax;} const rng[1] = {
927 { 0, LONG_MAX } };
928 int ix;
929
930 if (pOptions <= OPTPROC_EMIT_LIMIT)
931 goto emit_ranges;
932 optionNumericVal(pOptions, pOptDesc);
933
934 for (ix = 0; ix < 1; ix++) {
935 if (pOptDesc->optArg.argInt < rng[ix].rmin)
936 continue; /* ranges need not be ordered. */
937 if (pOptDesc->optArg.argInt == rng[ix].rmin)
938 return;
939 if (rng[ix].rmax == LONG_MIN)
940 continue;
941 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
942 return;
943 }
944
945 option_usage_fp = stderr;
946
947 emit_ranges:
948 optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
949 }
950
951 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
952 /**
953 * Code to handle the ntpversion option.
954 * When sending requests to a remote server, tell them we are running
955 * NTP protocol version @file{ntpversion} .
956 * @param[in] pOptions the sntp options data structure
957 * @param[in,out] pOptDesc the option descriptor for this option.
958 */
959 static void
doOptNtpversion(tOptions * pOptions,tOptDesc * pOptDesc)960 doOptNtpversion(tOptions* pOptions, tOptDesc* pOptDesc)
961 {
962 static struct {long rmin, rmax;} const rng[1] = {
963 { 0, 7 } };
964 int ix;
965
966 if (pOptions <= OPTPROC_EMIT_LIMIT)
967 goto emit_ranges;
968 optionNumericVal(pOptions, pOptDesc);
969
970 for (ix = 0; ix < 1; ix++) {
971 if (pOptDesc->optArg.argInt < rng[ix].rmin)
972 continue; /* ranges need not be ordered. */
973 if (pOptDesc->optArg.argInt == rng[ix].rmin)
974 return;
975 if (rng[ix].rmax == LONG_MIN)
976 continue;
977 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
978 return;
979 }
980
981 option_usage_fp = stderr;
982
983 emit_ranges:
984 optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
985 }
986 /* extracted from optmain.tlib near line 1250 */
987
988 /**
989 * The directory containing the data associated with sntp.
990 */
991 #ifndef PKGDATADIR
992 # define PKGDATADIR ""
993 #endif
994
995 /**
996 * Information about the person or institution that packaged sntp
997 * for the current distribution.
998 */
999 #ifndef WITH_PACKAGER
1000 # define sntp_packager_info NULL
1001 #else
1002 /** Packager information for sntp. */
1003 static char const sntp_packager_info[] =
1004 "Packaged by " WITH_PACKAGER
1005
1006 # ifdef WITH_PACKAGER_VERSION
1007 " ("WITH_PACKAGER_VERSION")"
1008 # endif
1009
1010 # ifdef WITH_PACKAGER_BUG_REPORTS
1011 "\nReport sntp bugs to " WITH_PACKAGER_BUG_REPORTS
1012 # endif
1013 "\n";
1014 #endif
1015 #ifndef __doxygen__
1016
1017 #endif /* __doxygen__ */
1018 /**
1019 * The option definitions for sntp. The one structure that
1020 * binds them all.
1021 */
1022 tOptions sntpOptions = {
1023 OPTIONS_STRUCT_VERSION,
1024 0, NULL, /* original argc + argv */
1025 ( OPTPROC_BASE
1026 + OPTPROC_ERRSTOP
1027 + OPTPROC_SHORTOPT
1028 + OPTPROC_LONGOPT
1029 + OPTPROC_NO_REQ_OPT
1030 + OPTPROC_NEGATIONS
1031 + OPTPROC_ENVIRON
1032 + OPTPROC_MISUSE ),
1033 0, NULL, /* current option index, current option */
1034 NULL, NULL, zPROGNAME,
1035 zRcName, zCopyright, zLicenseDescrip,
1036 zFullVersion, apzHomeList, zUsageTitle,
1037 zExplain, zDetail, optDesc,
1038 zBugsAddr, /* address to send bugs to */
1039 NULL, NULL, /* extensions/saved state */
1040 optionUsage, /* usage procedure */
1041 translate_option_strings, /* translation procedure */
1042 /*
1043 * Indexes to special options
1044 */
1045 { INDEX_OPT_MORE_HELP, /* more-help option index */
1046 INDEX_OPT_SAVE_OPTS, /* save option index */
1047 NO_EQUIVALENT, /* '-#' option index */
1048 NO_EQUIVALENT /* index of default opt */
1049 },
1050 23 /* full option count */, 18 /* user option count */,
1051 sntp_full_usage, sntp_short_usage,
1052 NULL, NULL,
1053 PKGDATADIR, sntp_packager_info
1054 };
1055
1056 #if ENABLE_NLS
1057 /**
1058 * This code is designed to translate translatable option text for the
1059 * sntp program. These translations happen upon entry
1060 * to optionProcess().
1061 */
1062 #include <stdio.h>
1063 #include <stdlib.h>
1064 #include <string.h>
1065 #include <unistd.h>
1066 #ifdef HAVE_DCGETTEXT
1067 # include <gettext.h>
1068 #endif
1069 #include <autoopts/usage-txt.h>
1070
1071 static char * AO_gettext(char const * pz);
1072 static void coerce_it(void ** s);
1073
1074 /**
1075 * AutoGen specific wrapper function for gettext. It relies on the macro _()
1076 * to convert from English to the target language, then strdup-duplicates the
1077 * result string. It tries the "libopts" domain first, then whatever has been
1078 * set via the \a textdomain(3) call.
1079 *
1080 * @param[in] pz the input text used as a lookup key.
1081 * @returns the translated text (if there is one),
1082 * or the original text (if not).
1083 */
1084 static char *
AO_gettext(char const * pz)1085 AO_gettext(char const * pz)
1086 {
1087 char * res;
1088 if (pz == NULL)
1089 return NULL;
1090 #ifdef HAVE_DCGETTEXT
1091 /*
1092 * While processing the option_xlateable_txt data, try to use the
1093 * "libopts" domain. Once we switch to the option descriptor data,
1094 * do *not* use that domain.
1095 */
1096 if (option_xlateable_txt.field_ct != 0) {
1097 res = dgettext("libopts", pz);
1098 if (res == pz)
1099 res = (char *)VOIDP(_(pz));
1100 } else
1101 res = (char *)VOIDP(_(pz));
1102 #else
1103 res = (char *)VOIDP(_(pz));
1104 #endif
1105 if (res == pz)
1106 return res;
1107 res = strdup(res);
1108 if (res == NULL) {
1109 fputs(_("No memory for duping translated strings\n"), stderr);
1110 exit(SNTP_EXIT_FAILURE);
1111 }
1112 return res;
1113 }
1114
1115 /**
1116 * All the pointers we use are marked "* const", but they are stored in
1117 * writable memory. Coerce the mutability and set the pointer.
1118 */
coerce_it(void ** s)1119 static void coerce_it(void ** s) { *s = AO_gettext(*s);
1120 }
1121
1122 /**
1123 * Translate all the translatable strings in the sntpOptions
1124 * structure defined above. This is done only once.
1125 */
1126 static void
translate_option_strings(void)1127 translate_option_strings(void)
1128 {
1129 tOptions * const opts = &sntpOptions;
1130
1131 /*
1132 * Guard against re-translation. It won't work. The strings will have
1133 * been changed by the first pass through this code. One shot only.
1134 */
1135 if (option_xlateable_txt.field_ct != 0) {
1136 /*
1137 * Do the translations. The first pointer follows the field count
1138 * field. The field count field is the size of a pointer.
1139 */
1140 char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
1141 int ix = option_xlateable_txt.field_ct;
1142
1143 do {
1144 ppz++; /* skip over field_ct */
1145 *ppz = AO_gettext(*ppz);
1146 } while (--ix > 0);
1147 /* prevent re-translation and disable "libopts" domain lookup */
1148 option_xlateable_txt.field_ct = 0;
1149
1150 coerce_it(VOIDP(&(opts->pzCopyright)));
1151 coerce_it(VOIDP(&(opts->pzCopyNotice)));
1152 coerce_it(VOIDP(&(opts->pzFullVersion)));
1153 coerce_it(VOIDP(&(opts->pzUsageTitle)));
1154 coerce_it(VOIDP(&(opts->pzExplain)));
1155 coerce_it(VOIDP(&(opts->pzDetail)));
1156 {
1157 tOptDesc * od = opts->pOptDesc;
1158 for (ix = opts->optCt; ix > 0; ix--, od++)
1159 coerce_it(VOIDP(&(od->pzText)));
1160 }
1161 }
1162 }
1163 #endif /* ENABLE_NLS */
1164
1165 #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
1166 /** I18N function strictly for xgettext. Do not compile. */
bogus_function(void)1167 static void bogus_function(void) {
1168 /* TRANSLATORS:
1169
1170 The following dummy function was crated solely so that xgettext can
1171 extract the correct strings. These strings are actually referenced
1172 by a field name in the sntpOptions structure noted in the
1173 comments below. The literal text is defined in sntp_opt_strs.
1174
1175 NOTE: the strings below are segmented with respect to the source string
1176 sntp_opt_strs. The strings above are handed off for translation
1177 at run time a paragraph at a time. Consequently, they are presented here
1178 for translation a paragraph at a time.
1179
1180 ALSO: often the description for an option will reference another option
1181 by name. These are set off with apostrophe quotes (I hope). Do not
1182 translate option names.
1183 */
1184 /* referenced via sntpOptions.pzCopyright */
1185 puts(_("sntp 4.2.8p18\n\
1186 Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.\n\
1187 This is free software. It is licensed for use, modification and\n\
1188 redistribution under the terms of the NTP License, copies of which\n\
1189 can be seen at:\n"));
1190 puts(_(" <http://ntp.org/license>\n\
1191 <http://opensource.org/licenses/ntp-license.php>\n"));
1192
1193 /* referenced via sntpOptions.pzCopyNotice */
1194 puts(_("Permission to use, copy, modify, and distribute this software and its\n\
1195 documentation for any purpose with or without fee is hereby granted,\n\
1196 provided that the above copyright notice appears in all copies and that\n\
1197 both the copyright notice and this permission notice appear in supporting\n\
1198 documentation, and that the name The University of Delaware not be used in\n\
1199 advertising or publicity pertaining to distribution of the software without\n\
1200 specific, written prior permission. The University of Delaware and Network\n\
1201 Time Foundation makes no representations about the suitability this\n\
1202 software for any purpose. It is provided \"as is\" without express or\n\
1203 implied warranty.\n"));
1204
1205 /* referenced via sntpOptions.pOptDesc->pzText */
1206 puts(_("Force IPv4 DNS name resolution"));
1207
1208 /* referenced via sntpOptions.pOptDesc->pzText */
1209 puts(_("Force IPv6 DNS name resolution"));
1210
1211 /* referenced via sntpOptions.pOptDesc->pzText */
1212 puts(_("Enable authentication with the key auth-keynumber"));
1213
1214 /* referenced via sntpOptions.pOptDesc->pzText */
1215 puts(_("Listen to the address specified for broadcast time sync"));
1216
1217 /* referenced via sntpOptions.pOptDesc->pzText */
1218 puts(_("Concurrently query all IPs returned for host-name"));
1219
1220 /* referenced via sntpOptions.pOptDesc->pzText */
1221 puts(_("Increase debug verbosity level"));
1222
1223 /* referenced via sntpOptions.pOptDesc->pzText */
1224 puts(_("Set the debug verbosity level"));
1225
1226 /* referenced via sntpOptions.pOptDesc->pzText */
1227 puts(_("The gap (in milliseconds) between time requests"));
1228
1229 /* referenced via sntpOptions.pOptDesc->pzText */
1230 puts(_("KoD history filename"));
1231
1232 /* referenced via sntpOptions.pOptDesc->pzText */
1233 puts(_("Look in this file for the key specified with -a"));
1234
1235 /* referenced via sntpOptions.pOptDesc->pzText */
1236 puts(_("Log to specified logfile"));
1237
1238 /* referenced via sntpOptions.pOptDesc->pzText */
1239 puts(_("Adjustments less than steplimit msec will be slewed"));
1240
1241 /* referenced via sntpOptions.pOptDesc->pzText */
1242 puts(_("Send int as our NTP protocol version"));
1243
1244 /* referenced via sntpOptions.pOptDesc->pzText */
1245 puts(_("Use the NTP Reserved Port (port 123)"));
1246
1247 /* referenced via sntpOptions.pOptDesc->pzText */
1248 puts(_("OK to 'step' the time with settimeofday(2)"));
1249
1250 /* referenced via sntpOptions.pOptDesc->pzText */
1251 puts(_("OK to 'slew' the time with adjtime(2)"));
1252
1253 /* referenced via sntpOptions.pOptDesc->pzText */
1254 puts(_("The number of seconds to wait for responses"));
1255
1256 /* referenced via sntpOptions.pOptDesc->pzText */
1257 puts(_("Wait for pending replies (if not setting the time)"));
1258
1259 /* referenced via sntpOptions.pOptDesc->pzText */
1260 puts(_("display extended usage information and exit"));
1261
1262 /* referenced via sntpOptions.pOptDesc->pzText */
1263 puts(_("extended usage information passed thru pager"));
1264
1265 /* referenced via sntpOptions.pOptDesc->pzText */
1266 puts(_("output version information and exit"));
1267
1268 /* referenced via sntpOptions.pOptDesc->pzText */
1269 puts(_("save the option state to a config file"));
1270
1271 /* referenced via sntpOptions.pOptDesc->pzText */
1272 puts(_("load options from a config file"));
1273
1274 /* referenced via sntpOptions.pzUsageTitle */
1275 puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p18\n\
1276 Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
1277 \t\t[ hostname-or-IP ...]\n"));
1278
1279 /* referenced via sntpOptions.pzExplain */
1280 puts(_("\n"));
1281
1282 /* referenced via sntpOptions.pzFullVersion */
1283 puts(_("sntp 4.2.8p18"));
1284
1285 /* referenced via sntpOptions.pzFullUsage */
1286 puts(_("<<<NOT-FOUND>>>"));
1287
1288 /* referenced via sntpOptions.pzShortUsage */
1289 puts(_("<<<NOT-FOUND>>>"));
1290 /* LIBOPTS-MESSAGES: */
1291 #line 67 "../autoopts.c"
1292 puts(_("allocation of %d bytes failed\n"));
1293 #line 89 "../autoopts.c"
1294 puts(_("allocation of %d bytes failed\n"));
1295 #line 48 "../init.c"
1296 puts(_("AutoOpts function called without option descriptor\n"));
1297 #line 81 "../init.c"
1298 puts(_("\tThis exceeds the compiled library version: "));
1299 #line 79 "../init.c"
1300 puts(_("Automated Options Processing Error!\n"
1301 "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
1302 #line 78 "../autoopts.c"
1303 puts(_("realloc of %d bytes at 0x%p failed\n"));
1304 #line 83 "../init.c"
1305 puts(_("\tThis is less than the minimum library version: "));
1306 #line 121 "../version.c"
1307 puts(_("Automated Options version %s\n"
1308 "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
1309 #line 49 "../makeshell.c"
1310 puts(_("(AutoOpts bug): %s.\n"));
1311 #line 90 "../reset.c"
1312 puts(_("optionResetOpt() called, but reset-option not configured"));
1313 #line 241 "../usage.c"
1314 puts(_("could not locate the 'help' option"));
1315 #line 330 "../autoopts.c"
1316 puts(_("optionProcess() was called with invalid data"));
1317 #line 697 "../usage.c"
1318 puts(_("invalid argument type specified"));
1319 #line 568 "../find.c"
1320 puts(_("defaulted to option with optional arg"));
1321 #line 76 "../alias.c"
1322 puts(_("aliasing option is out of range."));
1323 #line 210 "../enum.c"
1324 puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
1325 #line 78 "../find.c"
1326 puts(_(" The following options match:\n"));
1327 #line 263 "../find.c"
1328 puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
1329 #line 161 "../check.c"
1330 puts(_("%s: Command line arguments required\n"));
1331 #line 43 "../alias.c"
1332 puts(_("%d %s%s options allowed\n"));
1333 #line 56 "../makeshell.c"
1334 puts(_("%s error %d (%s) calling %s for '%s'\n"));
1335 #line 268 "../makeshell.c"
1336 puts(_("interprocess pipe"));
1337 #line 171 "../version.c"
1338 puts(_("error: version option argument '%c' invalid. Use:\n"
1339 "\t'v' - version only\n"
1340 "\t'c' - version and copyright\n"
1341 "\t'n' - version and full copyright notice\n"));
1342 #line 58 "../check.c"
1343 puts(_("%s error: the '%s' and '%s' options conflict\n"));
1344 #line 187 "../find.c"
1345 puts(_("%s: The '%s' option has been disabled."));
1346 #line 400 "../find.c"
1347 puts(_("%s: The '%s' option has been disabled."));
1348 #line 38 "../alias.c"
1349 puts(_("-equivalence"));
1350 #line 439 "../find.c"
1351 puts(_("%s: illegal option -- %c\n"));
1352 #line 110 "../reset.c"
1353 puts(_("%s: illegal option -- %c\n"));
1354 #line 241 "../find.c"
1355 puts(_("%s: illegal option -- %s\n"));
1356 #line 740 "../find.c"
1357 puts(_("%s: illegal option -- %s\n"));
1358 #line 118 "../reset.c"
1359 puts(_("%s: illegal option -- %s\n"));
1360 #line 305 "../find.c"
1361 puts(_("%s: unknown vendor extension option -- %s\n"));
1362 #line 135 "../enum.c"
1363 puts(_(" or an integer from %d through %d\n"));
1364 #line 145 "../enum.c"
1365 puts(_(" or an integer from %d through %d\n"));
1366 #line 696 "../usage.c"
1367 puts(_("%s error: invalid option descriptor for %s\n"));
1368 #line 1030 "../usage.c"
1369 puts(_("%s error: invalid option descriptor for %s\n"));
1370 #line 355 "../find.c"
1371 puts(_("%s: invalid option name: %s\n"));
1372 #line 497 "../find.c"
1373 puts(_("%s: The '%s' option requires an argument.\n"));
1374 #line 150 "../autoopts.c"
1375 puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
1376 "\t'%s' and '%s'."));
1377 #line 94 "../check.c"
1378 puts(_("%s error: The %s option is required\n"));
1379 #line 602 "../find.c"
1380 puts(_("%s: The '%s' option cannot have an argument.\n"));
1381 #line 151 "../check.c"
1382 puts(_("%s: Command line arguments are not allowed.\n"));
1383 #line 568 "../save.c"
1384 puts(_("error %d (%s) creating %s\n"));
1385 #line 210 "../enum.c"
1386 puts(_("%s error: '%s' does not match any %s keywords.\n"));
1387 #line 93 "../reset.c"
1388 puts(_("%s error: The '%s' option requires an argument.\n"));
1389 #line 122 "../save.c"
1390 puts(_("error %d (%s) stat-ing %s\n"));
1391 #line 175 "../save.c"
1392 puts(_("error %d (%s) stat-ing %s\n"));
1393 #line 143 "../restore.c"
1394 puts(_("%s error: no saved option state\n"));
1395 #line 225 "../autoopts.c"
1396 puts(_("'%s' is not a command line option.\n"));
1397 #line 113 "../time.c"
1398 puts(_("%s error: '%s' is not a recognizable date/time.\n"));
1399 #line 50 "../time.c"
1400 puts(_("%s error: '%s' is not a recognizable time duration.\n"));
1401 #line 92 "../check.c"
1402 puts(_("%s error: The %s option must appear %d times.\n"));
1403 #line 165 "../numeric.c"
1404 puts(_("%s error: '%s' is not a recognizable number.\n"));
1405 #line 176 "../enum.c"
1406 puts(_("%s error: %s exceeds %s keyword count\n"));
1407 #line 279 "../usage.c"
1408 puts(_("Try '%s %s' for more information.\n"));
1409 #line 45 "../alias.c"
1410 puts(_("one %s%s option allowed\n"));
1411 #line 170 "../makeshell.c"
1412 puts(_("standard output"));
1413 #line 905 "../makeshell.c"
1414 puts(_("standard output"));
1415 #line 223 "../usage.c"
1416 puts(_("standard output"));
1417 #line 364 "../usage.c"
1418 puts(_("standard output"));
1419 #line 574 "../usage.c"
1420 puts(_("standard output"));
1421 #line 178 "../version.c"
1422 puts(_("standard output"));
1423 #line 223 "../usage.c"
1424 puts(_("standard error"));
1425 #line 364 "../usage.c"
1426 puts(_("standard error"));
1427 #line 574 "../usage.c"
1428 puts(_("standard error"));
1429 #line 178 "../version.c"
1430 puts(_("standard error"));
1431 #line 170 "../makeshell.c"
1432 puts(_("write"));
1433 #line 905 "../makeshell.c"
1434 puts(_("write"));
1435 #line 222 "../usage.c"
1436 puts(_("write"));
1437 #line 363 "../usage.c"
1438 puts(_("write"));
1439 #line 573 "../usage.c"
1440 puts(_("write"));
1441 #line 177 "../version.c"
1442 puts(_("write"));
1443 #line 60 "../numeric.c"
1444 puts(_("%s error: %s option value %ld is out of range.\n"));
1445 #line 44 "../check.c"
1446 puts(_("%s error: %s option requires the %s option\n"));
1447 #line 121 "../save.c"
1448 puts(_("%s warning: cannot save options - %s not regular file\n"));
1449 #line 174 "../save.c"
1450 puts(_("%s warning: cannot save options - %s not regular file\n"));
1451 #line 193 "../save.c"
1452 puts(_("%s warning: cannot save options - %s not regular file\n"));
1453 #line 567 "../save.c"
1454 puts(_("%s warning: cannot save options - %s not regular file\n"));
1455 /* END-LIBOPTS-MESSAGES */
1456
1457 /* USAGE-TEXT: */
1458 #line 822 "../usage.c"
1459 puts(_("\t\t\t\t- an alternate for '%s'\n"));
1460 #line 1097 "../usage.c"
1461 puts(_("Version, usage and configuration options:"));
1462 #line 873 "../usage.c"
1463 puts(_("\t\t\t\t- default option for unnamed options\n"));
1464 #line 786 "../usage.c"
1465 puts(_("\t\t\t\t- disabled as '--%s'\n"));
1466 #line 1066 "../usage.c"
1467 puts(_(" --- %-14s %s\n"));
1468 #line 1064 "../usage.c"
1469 puts(_("This option has been disabled"));
1470 #line 813 "../usage.c"
1471 puts(_("\t\t\t\t- enabled by default\n"));
1472 #line 40 "../alias.c"
1473 puts(_("%s error: only "));
1474 #line 1143 "../usage.c"
1475 puts(_(" - examining environment variables named %s_*\n"));
1476 #line 168 "../file.c"
1477 puts(_("\t\t\t\t- file must not pre-exist\n"));
1478 #line 172 "../file.c"
1479 puts(_("\t\t\t\t- file must pre-exist\n"));
1480 #line 329 "../usage.c"
1481 puts(_("Options are specified by doubled hyphens and their name or by a single\n"
1482 "hyphen and the flag character.\n"));
1483 #line 882 "../makeshell.c"
1484 puts(_("\n"
1485 "= = = = = = = =\n\n"
1486 "This incarnation of genshell will produce\n"
1487 "a shell script to parse the options for %s:\n\n"));
1488 #line 142 "../enum.c"
1489 puts(_(" or an integer mask with any of the lower %d bits set\n"));
1490 #line 846 "../usage.c"
1491 puts(_("\t\t\t\t- is a set membership option\n"));
1492 #line 867 "../usage.c"
1493 puts(_("\t\t\t\t- must appear between %d and %d times\n"));
1494 #line 331 "../usage.c"
1495 puts(_("Options are specified by single or double hyphens and their name.\n"));
1496 #line 853 "../usage.c"
1497 puts(_("\t\t\t\t- may appear multiple times\n"));
1498 #line 840 "../usage.c"
1499 puts(_("\t\t\t\t- may not be preset\n"));
1500 #line 1258 "../usage.c"
1501 puts(_(" Arg Option-Name Description\n"));
1502 #line 1194 "../usage.c"
1503 puts(_(" Flg Arg Option-Name Description\n"));
1504 #line 1252 "../usage.c"
1505 puts(_(" Flg Arg Option-Name Description\n"));
1506 #line 1253 "../usage.c"
1507 puts(_(" %3s %s"));
1508 #line 1259 "../usage.c"
1509 puts(_(" %3s %s"));
1510 #line 336 "../usage.c"
1511 puts(_("The '-#<number>' option may omit the hash char\n"));
1512 #line 332 "../usage.c"
1513 puts(_("All arguments are named options.\n"));
1514 #line 920 "../usage.c"
1515 puts(_(" - reading file %s"));
1516 #line 358 "../usage.c"
1517 puts(_("\n"
1518 "Please send bug reports to: <%s>\n"));
1519 #line 100 "../version.c"
1520 puts(_("\n"
1521 "Please send bug reports to: <%s>\n"));
1522 #line 129 "../version.c"
1523 puts(_("\n"
1524 "Please send bug reports to: <%s>\n"));
1525 #line 852 "../usage.c"
1526 puts(_("\t\t\t\t- may NOT appear - preset only\n"));
1527 #line 893 "../usage.c"
1528 puts(_("\n"
1529 "The following option preset mechanisms are supported:\n"));
1530 #line 1141 "../usage.c"
1531 puts(_("\n"
1532 "The following option preset mechanisms are supported:\n"));
1533 #line 631 "../usage.c"
1534 puts(_("prohibits these options:\n"));
1535 #line 626 "../usage.c"
1536 puts(_("prohibits the option '%s'\n"));
1537 #line 81 "../numeric.c"
1538 puts(_("%s%ld to %ld"));
1539 #line 79 "../numeric.c"
1540 puts(_("%sgreater than or equal to %ld"));
1541 #line 75 "../numeric.c"
1542 puts(_("%s%ld exactly"));
1543 #line 68 "../numeric.c"
1544 puts(_("%sit must lie in one of the ranges:\n"));
1545 #line 68 "../numeric.c"
1546 puts(_("%sit must be in the range:\n"));
1547 #line 88 "../numeric.c"
1548 puts(_(", or\n"));
1549 #line 66 "../numeric.c"
1550 puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
1551 #line 77 "../numeric.c"
1552 puts(_("%sless than or equal to %ld"));
1553 #line 339 "../usage.c"
1554 puts(_("Operands and options may be intermixed. They will be reordered.\n"));
1555 #line 601 "../usage.c"
1556 puts(_("requires the option '%s'\n"));
1557 #line 604 "../usage.c"
1558 puts(_("requires these options:\n"));
1559 #line 1270 "../usage.c"
1560 puts(_(" Arg Option-Name Req? Description\n"));
1561 #line 1264 "../usage.c"
1562 puts(_(" Flg Arg Option-Name Req? Description\n"));
1563 #line 143 "../enum.c"
1564 puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
1565 "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
1566 "will set them all. Multiple entries may be passed as an option\n"
1567 "argument list.\n"));
1568 #line 859 "../usage.c"
1569 puts(_("\t\t\t\t- may appear up to %d times\n"));
1570 #line 52 "../enum.c"
1571 puts(_("The valid \"%s\" option keywords are:\n"));
1572 #line 1101 "../usage.c"
1573 puts(_("The next option supports vendor supported extra options:"));
1574 #line 722 "../usage.c"
1575 puts(_("These additional options are:"));
1576 /* END-USAGE-TEXT */
1577 }
1578 #endif /* uncompilable code */
1579 #ifdef __cplusplus
1580 }
1581 #endif
1582 /* sntp-opts.c ends here */
1583