xref: /freebsd/contrib/ntp/ntpd/ntpd-opts.c (revision 788ca347b816afd83b2885e0c79aeeb88649b2ab)
1 /*
2  *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.c)
3  *
4  *  It has been AutoGen-ed  February  4, 2015 at 02:39:17 AM by AutoGen 5.18.5pre4
5  *  From the definitions    ntpd-opts.def
6  *  and the template file   options
7  *
8  * Generated from AutoOpts 41:0:16 templates.
9  *
10  *  AutoOpts is a copyrighted work.  This source file is not encumbered
11  *  by AutoOpts licensing, but is provided under the licensing terms chosen
12  *  by the ntpd author or copyright holder.  AutoOpts is
13  *  licensed under the terms of the LGPL.  The redistributable library
14  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
15  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
16  *  for details.
17  *
18  * The ntpd program is copyrighted and licensed
19  * under the following terms:
20  *
21  *  Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.
22  *  This is free software. It is licensed for use, modification and
23  *  redistribution under the terms of the NTP License, copies of which
24  *  can be seen at:
25  *    <http://ntp.org/license>
26  *    <http://opensource.org/licenses/ntp-license.php>
27  *
28  *  Permission to use, copy, modify, and distribute this software and its
29  *  documentation for any purpose with or without fee is hereby granted,
30  *  provided that the above copyright notice appears in all copies and that
31  *  both the copyright notice and this permission notice appear in
32  *  supporting documentation, and that the name The University of Delaware not be used in
33  *  advertising or publicity pertaining to distribution of the software
34  *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
35  *  representations about the suitability this software for any purpose. It
36  *  is provided "as is" without express or implied warranty.
37  */
38 
39 #ifndef __doxygen__
40 #define OPTION_CODE_COMPILE 1
41 #include "ntpd-opts.h"
42 #include <sys/types.h>
43 
44 #include <limits.h>
45 #include <stdio.h>
46 #include <stdlib.h>
47 
48 #ifdef  __cplusplus
49 extern "C" {
50 #endif
51 extern FILE * option_usage_fp;
52 #define zCopyright      (ntpd_opt_strs+0)
53 #define zLicenseDescrip (ntpd_opt_strs+340)
54 
55 /*
56  *  global included definitions
57  */
58 #ifdef __windows
59   extern int atoi(const char *);
60 #else
61 # include <stdlib.h>
62 #endif
63 
64 #ifdef __windows
65   extern int atoi(const char*);
66 #else
67 # include <stdlib.h>
68 #endif
69 
70 #ifndef NULL
71 #  define NULL 0
72 #endif
73 
74 /**
75  *  static const strings for ntpd options
76  */
77 static char const ntpd_opt_strs[3061] =
78 /*     0 */ "ntpd 4.2.8p1\n"
79             "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
80             "This is free software. It is licensed for use, modification and\n"
81             "redistribution under the terms of the NTP License, copies of which\n"
82             "can be seen at:\n"
83             "  <http://ntp.org/license>\n"
84             "  <http://opensource.org/licenses/ntp-license.php>\n\0"
85 /*   340 */ "Permission to use, copy, modify, and distribute this software and its\n"
86             "documentation for any purpose with or without fee is hereby granted,\n"
87             "provided that the above copyright notice appears in all copies and that\n"
88             "both the copyright notice and this permission notice appear in supporting\n"
89             "documentation, and that the name The University of Delaware not be used in\n"
90             "advertising or publicity pertaining to distribution of the software without\n"
91             "specific, written prior permission.  The University of Delaware and Network\n"
92             "Time Foundation makes no representations about the suitability this\n"
93             "software for any purpose.  It is provided \"as is\" without express or\n"
94             "implied warranty.\n\0"
95 /*  1008 */ "Force IPv4 DNS name resolution\0"
96 /*  1039 */ "IPV4\0"
97 /*  1044 */ "ipv4\0"
98 /*  1049 */ "Force IPv6 DNS name resolution\0"
99 /*  1080 */ "IPV6\0"
100 /*  1085 */ "ipv6\0"
101 /*  1090 */ "Require crypto authentication\0"
102 /*  1120 */ "AUTHREQ\0"
103 /*  1128 */ "authreq\0"
104 /*  1136 */ "Do not require crypto authentication\0"
105 /*  1173 */ "AUTHNOREQ\0"
106 /*  1183 */ "authnoreq\0"
107 /*  1193 */ "Allow us to sync to broadcast servers\0"
108 /*  1231 */ "BCASTSYNC\0"
109 /*  1241 */ "bcastsync\0"
110 /*  1251 */ "configuration file name\0"
111 /*  1275 */ "CONFIGFILE\0"
112 /*  1286 */ "configfile\0"
113 /*  1297 */ "Increase debug verbosity level\0"
114 /*  1328 */ "DEBUG_LEVEL\0"
115 /*  1340 */ "debug-level\0"
116 /*  1352 */ "Set the debug verbosity level\0"
117 /*  1382 */ "SET_DEBUG_LEVEL\0"
118 /*  1398 */ "set-debug-level\0"
119 /*  1414 */ "frequency drift file name\0"
120 /*  1440 */ "DRIFTFILE\0"
121 /*  1450 */ "driftfile\0"
122 /*  1460 */ "Allow the first adjustment to be Big\0"
123 /*  1497 */ "PANICGATE\0"
124 /*  1507 */ "panicgate\0"
125 /*  1517 */ "Jail directory\0"
126 /*  1532 */ "JAILDIR\0"
127 /*  1540 */ "jaildir\0"
128 /*  1548 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0"
129 /*  1627 */ "Listen on an interface name or address\0"
130 /*  1666 */ "INTERFACE\0"
131 /*  1676 */ "interface\0"
132 /*  1686 */ "path to symmetric keys\0"
133 /*  1709 */ "KEYFILE\0"
134 /*  1717 */ "keyfile\0"
135 /*  1725 */ "path to the log file\0"
136 /*  1746 */ "LOGFILE\0"
137 /*  1754 */ "logfile\0"
138 /*  1762 */ "Do not listen to virtual interfaces\0"
139 /*  1798 */ "NOVIRTUALIPS\0"
140 /*  1811 */ "novirtualips\0"
141 /*  1824 */ "Modify Multimedia Timer (Windows only)\0"
142 /*  1863 */ "MODIFYMMTIMER\0"
143 /*  1877 */ "modifymmtimer\0"
144 /*  1891 */ "Do not fork\0"
145 /*  1903 */ "NOFORK\0"
146 /*  1910 */ "nofork\0"
147 /*  1917 */ "Run at high priority\0"
148 /*  1938 */ "NICE\0"
149 /*  1943 */ "nice\0"
150 /*  1948 */ "path to the PID file\0"
151 /*  1969 */ "PIDFILE\0"
152 /*  1977 */ "pidfile\0"
153 /*  1985 */ "Process priority\0"
154 /*  2002 */ "PRIORITY\0"
155 /*  2011 */ "priority\0"
156 /*  2020 */ "Set the time and quit\0"
157 /*  2042 */ "QUIT\0"
158 /*  2047 */ "quit\0"
159 /*  2052 */ "Broadcast/propagation delay\0"
160 /*  2080 */ "PROPAGATIONDELAY\0"
161 /*  2097 */ "propagationdelay\0"
162 /*  2114 */ "Save parsed configuration and quit\0"
163 /*  2149 */ "SAVECONFIGQUIT\0"
164 /*  2164 */ "saveconfigquit\0"
165 /*  2179 */ "Statistics file location\0"
166 /*  2204 */ "STATSDIR\0"
167 /*  2213 */ "statsdir\0"
168 /*  2222 */ "Trusted key number\0"
169 /*  2241 */ "TRUSTEDKEY\0"
170 /*  2252 */ "trustedkey\0"
171 /*  2263 */ "Run as userid (or userid:groupid)\0"
172 /*  2297 */ "USER\0"
173 /*  2302 */ "user\0"
174 /*  2307 */ "interval in seconds between scans for new or dropped interfaces\0"
175 /*  2371 */ "UPDATEINTERVAL\0"
176 /*  2386 */ "updateinterval\0"
177 /*  2401 */ "make ARG an ntp variable (RW)\0"
178 /*  2431 */ "VAR\0"
179 /*  2435 */ "var\0"
180 /*  2439 */ "make ARG an ntp variable (RW|DEF)\0"
181 /*  2473 */ "DVAR\0"
182 /*  2478 */ "dvar\0"
183 /*  2483 */ "Seconds to wait for first clock sync\0"
184 /*  2520 */ "WAIT_SYNC\0"
185 /*  2530 */ "wait-sync\0"
186 /*  2540 */ "Slew up to 600 seconds\0"
187 /*  2563 */ "SLEW\0"
188 /*  2568 */ "slew\0"
189 /*  2573 */ "Use CPU cycle counter (Windows only)\0"
190 /*  2610 */ "USEPCC\0"
191 /*  2617 */ "usepcc\0"
192 /*  2624 */ "Force CPU cycle counter use (Windows only)\0"
193 /*  2667 */ "PCCFREQ\0"
194 /*  2675 */ "pccfreq\0"
195 /*  2683 */ "Register with mDNS as a NTP server\0"
196 /*  2718 */ "MDNS\0"
197 /*  2723 */ "mdns\0"
198 /*  2728 */ "display extended usage information and exit\0"
199 /*  2772 */ "help\0"
200 /*  2777 */ "extended usage information passed thru pager\0"
201 /*  2822 */ "more-help\0"
202 /*  2832 */ "output version information and exit\0"
203 /*  2868 */ "version\0"
204 /*  2876 */ "NTPD\0"
205 /*  2881 */ "ntpd - NTP daemon program - Ver. 4.2.8p1\n"
206             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
207             "\t\t[ <server1> ... <serverN> ]\n\0"
208 /*  3012 */ "http://bugs.ntp.org, bugs@ntp.org\0"
209 /*  3046 */ "\n\0"
210 /*  3048 */ "ntpd 4.2.8p1";
211 
212 /**
213  *  ipv4 option description with
214  *  "Must also have options" and "Incompatible options":
215  */
216 /** Descriptive text for the ipv4 option */
217 #define IPV4_DESC      (ntpd_opt_strs+1008)
218 /** Upper-cased name for the ipv4 option */
219 #define IPV4_NAME      (ntpd_opt_strs+1039)
220 /** Name string for the ipv4 option */
221 #define IPV4_name      (ntpd_opt_strs+1044)
222 /** Other options that appear in conjunction with the ipv4 option */
223 static int const aIpv4CantList[] = {
224     INDEX_OPT_IPV6, NO_EQUIVALENT };
225 /** Compiled in flag settings for the ipv4 option */
226 #define IPV4_FLAGS     (OPTST_DISABLED)
227 
228 /**
229  *  ipv6 option description with
230  *  "Must also have options" and "Incompatible options":
231  */
232 /** Descriptive text for the ipv6 option */
233 #define IPV6_DESC      (ntpd_opt_strs+1049)
234 /** Upper-cased name for the ipv6 option */
235 #define IPV6_NAME      (ntpd_opt_strs+1080)
236 /** Name string for the ipv6 option */
237 #define IPV6_name      (ntpd_opt_strs+1085)
238 /** Other options that appear in conjunction with the ipv6 option */
239 static int const aIpv6CantList[] = {
240     INDEX_OPT_IPV4, NO_EQUIVALENT };
241 /** Compiled in flag settings for the ipv6 option */
242 #define IPV6_FLAGS     (OPTST_DISABLED)
243 
244 /**
245  *  authreq option description with
246  *  "Must also have options" and "Incompatible options":
247  */
248 /** Descriptive text for the authreq option */
249 #define AUTHREQ_DESC      (ntpd_opt_strs+1090)
250 /** Upper-cased name for the authreq option */
251 #define AUTHREQ_NAME      (ntpd_opt_strs+1120)
252 /** Name string for the authreq option */
253 #define AUTHREQ_name      (ntpd_opt_strs+1128)
254 /** Other options that appear in conjunction with the authreq option */
255 static int const aAuthreqCantList[] = {
256     INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT };
257 /** Compiled in flag settings for the authreq option */
258 #define AUTHREQ_FLAGS     (OPTST_DISABLED)
259 
260 /**
261  *  authnoreq option description with
262  *  "Must also have options" and "Incompatible options":
263  */
264 /** Descriptive text for the authnoreq option */
265 #define AUTHNOREQ_DESC      (ntpd_opt_strs+1136)
266 /** Upper-cased name for the authnoreq option */
267 #define AUTHNOREQ_NAME      (ntpd_opt_strs+1173)
268 /** Name string for the authnoreq option */
269 #define AUTHNOREQ_name      (ntpd_opt_strs+1183)
270 /** Other options that appear in conjunction with the authnoreq option */
271 static int const aAuthnoreqCantList[] = {
272     INDEX_OPT_AUTHREQ, NO_EQUIVALENT };
273 /** Compiled in flag settings for the authnoreq option */
274 #define AUTHNOREQ_FLAGS     (OPTST_DISABLED)
275 
276 /**
277  *  bcastsync option description:
278  */
279 /** Descriptive text for the bcastsync option */
280 #define BCASTSYNC_DESC      (ntpd_opt_strs+1193)
281 /** Upper-cased name for the bcastsync option */
282 #define BCASTSYNC_NAME      (ntpd_opt_strs+1231)
283 /** Name string for the bcastsync option */
284 #define BCASTSYNC_name      (ntpd_opt_strs+1241)
285 /** Compiled in flag settings for the bcastsync option */
286 #define BCASTSYNC_FLAGS     (OPTST_DISABLED)
287 
288 /**
289  *  configfile option description:
290  */
291 /** Descriptive text for the configfile option */
292 #define CONFIGFILE_DESC      (ntpd_opt_strs+1251)
293 /** Upper-cased name for the configfile option */
294 #define CONFIGFILE_NAME      (ntpd_opt_strs+1275)
295 /** Name string for the configfile option */
296 #define CONFIGFILE_name      (ntpd_opt_strs+1286)
297 /** Compiled in flag settings for the configfile option */
298 #define CONFIGFILE_FLAGS     (OPTST_DISABLED \
299         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
300 
301 /**
302  *  debug-level option description:
303  */
304 /** Descriptive text for the debug-level option */
305 #define DEBUG_LEVEL_DESC      (ntpd_opt_strs+1297)
306 /** Upper-cased name for the debug-level option */
307 #define DEBUG_LEVEL_NAME      (ntpd_opt_strs+1328)
308 /** Name string for the debug-level option */
309 #define DEBUG_LEVEL_name      (ntpd_opt_strs+1340)
310 /** Compiled in flag settings for the debug-level option */
311 #define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
312 
313 /**
314  *  set-debug-level option description:
315  */
316 /** Descriptive text for the set-debug-level option */
317 #define SET_DEBUG_LEVEL_DESC      (ntpd_opt_strs+1352)
318 /** Upper-cased name for the set-debug-level option */
319 #define SET_DEBUG_LEVEL_NAME      (ntpd_opt_strs+1382)
320 /** Name string for the set-debug-level option */
321 #define SET_DEBUG_LEVEL_name      (ntpd_opt_strs+1398)
322 /** Compiled in flag settings for the set-debug-level option */
323 #define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
324         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
325 
326 /**
327  *  driftfile option description:
328  */
329 /** Descriptive text for the driftfile option */
330 #define DRIFTFILE_DESC      (ntpd_opt_strs+1414)
331 /** Upper-cased name for the driftfile option */
332 #define DRIFTFILE_NAME      (ntpd_opt_strs+1440)
333 /** Name string for the driftfile option */
334 #define DRIFTFILE_name      (ntpd_opt_strs+1450)
335 /** Compiled in flag settings for the driftfile option */
336 #define DRIFTFILE_FLAGS     (OPTST_DISABLED \
337         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
338 
339 /**
340  *  panicgate option description:
341  */
342 /** Descriptive text for the panicgate option */
343 #define PANICGATE_DESC      (ntpd_opt_strs+1460)
344 /** Upper-cased name for the panicgate option */
345 #define PANICGATE_NAME      (ntpd_opt_strs+1497)
346 /** Name string for the panicgate option */
347 #define PANICGATE_name      (ntpd_opt_strs+1507)
348 /** Compiled in flag settings for the panicgate option */
349 #define PANICGATE_FLAGS     (OPTST_DISABLED)
350 
351 /**
352  *  jaildir option description:
353  */
354 #ifdef HAVE_DROPROOT
355 /** Descriptive text for the jaildir option */
356 #define JAILDIR_DESC      (ntpd_opt_strs+1517)
357 /** Upper-cased name for the jaildir option */
358 #define JAILDIR_NAME      (ntpd_opt_strs+1532)
359 /** Name string for the jaildir option */
360 #define JAILDIR_name      (ntpd_opt_strs+1540)
361 /** Compiled in flag settings for the jaildir option */
362 #define JAILDIR_FLAGS     (OPTST_DISABLED \
363         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
364 
365 #else   /* disable jaildir */
366 #define JAILDIR_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
367 #define JAILDIR_NAME      NULL
368 /** Descriptive text for the jaildir option */
369 #define JAILDIR_DESC      (ntpd_opt_strs+1548)
370 #define JAILDIR_name      (ntpd_opt_strs+1540)
371 #endif  /* HAVE_DROPROOT */
372 
373 /**
374  *  interface option description:
375  */
376 /** Descriptive text for the interface option */
377 #define INTERFACE_DESC      (ntpd_opt_strs+1627)
378 /** Upper-cased name for the interface option */
379 #define INTERFACE_NAME      (ntpd_opt_strs+1666)
380 /** Name string for the interface option */
381 #define INTERFACE_name      (ntpd_opt_strs+1676)
382 /** Compiled in flag settings for the interface option */
383 #define INTERFACE_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
384         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
385 
386 /**
387  *  keyfile option description:
388  */
389 /** Descriptive text for the keyfile option */
390 #define KEYFILE_DESC      (ntpd_opt_strs+1686)
391 /** Upper-cased name for the keyfile option */
392 #define KEYFILE_NAME      (ntpd_opt_strs+1709)
393 /** Name string for the keyfile option */
394 #define KEYFILE_name      (ntpd_opt_strs+1717)
395 /** Compiled in flag settings for the keyfile option */
396 #define KEYFILE_FLAGS     (OPTST_DISABLED \
397         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
398 
399 /**
400  *  logfile option description:
401  */
402 /** Descriptive text for the logfile option */
403 #define LOGFILE_DESC      (ntpd_opt_strs+1725)
404 /** Upper-cased name for the logfile option */
405 #define LOGFILE_NAME      (ntpd_opt_strs+1746)
406 /** Name string for the logfile option */
407 #define LOGFILE_name      (ntpd_opt_strs+1754)
408 /** Compiled in flag settings for the logfile option */
409 #define LOGFILE_FLAGS     (OPTST_DISABLED \
410         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
411 
412 /**
413  *  novirtualips option description:
414  */
415 /** Descriptive text for the novirtualips option */
416 #define NOVIRTUALIPS_DESC      (ntpd_opt_strs+1762)
417 /** Upper-cased name for the novirtualips option */
418 #define NOVIRTUALIPS_NAME      (ntpd_opt_strs+1798)
419 /** Name string for the novirtualips option */
420 #define NOVIRTUALIPS_name      (ntpd_opt_strs+1811)
421 /** Compiled in flag settings for the novirtualips option */
422 #define NOVIRTUALIPS_FLAGS     (OPTST_DISABLED)
423 
424 /**
425  *  modifymmtimer option description:
426  */
427 #ifdef SYS_WINNT
428 /** Descriptive text for the modifymmtimer option */
429 #define MODIFYMMTIMER_DESC      (ntpd_opt_strs+1824)
430 /** Upper-cased name for the modifymmtimer option */
431 #define MODIFYMMTIMER_NAME      (ntpd_opt_strs+1863)
432 /** Name string for the modifymmtimer option */
433 #define MODIFYMMTIMER_name      (ntpd_opt_strs+1877)
434 /** Compiled in flag settings for the modifymmtimer option */
435 #define MODIFYMMTIMER_FLAGS     (OPTST_DISABLED)
436 
437 #else   /* disable modifymmtimer */
438 #define MODIFYMMTIMER_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
439 #define MODIFYMMTIMER_NAME      NULL
440 #define MODIFYMMTIMER_DESC      NULL
441 #define MODIFYMMTIMER_name      NULL
442 #endif  /* SYS_WINNT */
443 
444 /**
445  *  nofork option description with
446  *  "Must also have options" and "Incompatible options":
447  */
448 /** Descriptive text for the nofork option */
449 #define NOFORK_DESC      (ntpd_opt_strs+1891)
450 /** Upper-cased name for the nofork option */
451 #define NOFORK_NAME      (ntpd_opt_strs+1903)
452 /** Name string for the nofork option */
453 #define NOFORK_name      (ntpd_opt_strs+1910)
454 /** Other options that appear in conjunction with the nofork option */
455 static int const aNoforkCantList[] = {
456     INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT };
457 /** Compiled in flag settings for the nofork option */
458 #define NOFORK_FLAGS     (OPTST_DISABLED)
459 
460 /**
461  *  nice option description:
462  */
463 /** Descriptive text for the nice option */
464 #define NICE_DESC      (ntpd_opt_strs+1917)
465 /** Upper-cased name for the nice option */
466 #define NICE_NAME      (ntpd_opt_strs+1938)
467 /** Name string for the nice option */
468 #define NICE_name      (ntpd_opt_strs+1943)
469 /** Compiled in flag settings for the nice option */
470 #define NICE_FLAGS     (OPTST_DISABLED)
471 
472 /**
473  *  pidfile option description:
474  */
475 /** Descriptive text for the pidfile option */
476 #define PIDFILE_DESC      (ntpd_opt_strs+1948)
477 /** Upper-cased name for the pidfile option */
478 #define PIDFILE_NAME      (ntpd_opt_strs+1969)
479 /** Name string for the pidfile option */
480 #define PIDFILE_name      (ntpd_opt_strs+1977)
481 /** Compiled in flag settings for the pidfile option */
482 #define PIDFILE_FLAGS     (OPTST_DISABLED \
483         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
484 
485 /**
486  *  priority option description:
487  */
488 /** Descriptive text for the priority option */
489 #define PRIORITY_DESC      (ntpd_opt_strs+1985)
490 /** Upper-cased name for the priority option */
491 #define PRIORITY_NAME      (ntpd_opt_strs+2002)
492 /** Name string for the priority option */
493 #define PRIORITY_name      (ntpd_opt_strs+2011)
494 /** Compiled in flag settings for the priority option */
495 #define PRIORITY_FLAGS     (OPTST_DISABLED \
496         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
497 
498 /**
499  *  quit option description with
500  *  "Must also have options" and "Incompatible options":
501  */
502 /** Descriptive text for the quit option */
503 #define QUIT_DESC      (ntpd_opt_strs+2020)
504 /** Upper-cased name for the quit option */
505 #define QUIT_NAME      (ntpd_opt_strs+2042)
506 /** Name string for the quit option */
507 #define QUIT_name      (ntpd_opt_strs+2047)
508 /** Other options that appear in conjunction with the quit option */
509 static int const aQuitCantList[] = {
510     INDEX_OPT_SAVECONFIGQUIT,
511     INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT };
512 /** Compiled in flag settings for the quit option */
513 #define QUIT_FLAGS     (OPTST_DISABLED)
514 
515 /**
516  *  propagationdelay option description:
517  */
518 /** Descriptive text for the propagationdelay option */
519 #define PROPAGATIONDELAY_DESC      (ntpd_opt_strs+2052)
520 /** Upper-cased name for the propagationdelay option */
521 #define PROPAGATIONDELAY_NAME      (ntpd_opt_strs+2080)
522 /** Name string for the propagationdelay option */
523 #define PROPAGATIONDELAY_name      (ntpd_opt_strs+2097)
524 /** Compiled in flag settings for the propagationdelay option */
525 #define PROPAGATIONDELAY_FLAGS     (OPTST_DISABLED \
526         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
527 
528 /**
529  *  saveconfigquit option description with
530  *  "Must also have options" and "Incompatible options":
531  */
532 #ifdef SAVECONFIG
533 /** Descriptive text for the saveconfigquit option */
534 #define SAVECONFIGQUIT_DESC      (ntpd_opt_strs+2114)
535 /** Upper-cased name for the saveconfigquit option */
536 #define SAVECONFIGQUIT_NAME      (ntpd_opt_strs+2149)
537 /** Name string for the saveconfigquit option */
538 #define SAVECONFIGQUIT_name      (ntpd_opt_strs+2164)
539 /** Other options that appear in conjunction with the saveconfigquit option */
540 static int const aSaveconfigquitCantList[] = {
541     INDEX_OPT_QUIT,
542     INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT };
543 /** Compiled in flag settings for the saveconfigquit option */
544 #define SAVECONFIGQUIT_FLAGS     (OPTST_DISABLED \
545         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
546 
547 #else   /* disable saveconfigquit */
548 #define SAVECONFIGQUIT_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
549 #define aSaveconfigquitCantList   NULL
550 #define SAVECONFIGQUIT_NAME      NULL
551 #define SAVECONFIGQUIT_DESC      NULL
552 #define SAVECONFIGQUIT_name      NULL
553 #endif  /* SAVECONFIG */
554 
555 /**
556  *  statsdir option description:
557  */
558 /** Descriptive text for the statsdir option */
559 #define STATSDIR_DESC      (ntpd_opt_strs+2179)
560 /** Upper-cased name for the statsdir option */
561 #define STATSDIR_NAME      (ntpd_opt_strs+2204)
562 /** Name string for the statsdir option */
563 #define STATSDIR_name      (ntpd_opt_strs+2213)
564 /** Compiled in flag settings for the statsdir option */
565 #define STATSDIR_FLAGS     (OPTST_DISABLED \
566         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
567 
568 /**
569  *  trustedkey option description:
570  */
571 /** Descriptive text for the trustedkey option */
572 #define TRUSTEDKEY_DESC      (ntpd_opt_strs+2222)
573 /** Upper-cased name for the trustedkey option */
574 #define TRUSTEDKEY_NAME      (ntpd_opt_strs+2241)
575 /** Name string for the trustedkey option */
576 #define TRUSTEDKEY_name      (ntpd_opt_strs+2252)
577 /** Compiled in flag settings for the trustedkey option */
578 #define TRUSTEDKEY_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
579         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
580 
581 /**
582  *  user option description:
583  */
584 #ifdef HAVE_DROPROOT
585 /** Descriptive text for the user option */
586 #define USER_DESC      (ntpd_opt_strs+2263)
587 /** Upper-cased name for the user option */
588 #define USER_NAME      (ntpd_opt_strs+2297)
589 /** Name string for the user option */
590 #define USER_name      (ntpd_opt_strs+2302)
591 /** Compiled in flag settings for the user option */
592 #define USER_FLAGS     (OPTST_DISABLED \
593         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
594 
595 #else   /* disable user */
596 #define USER_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
597 #define USER_NAME      NULL
598 /** Descriptive text for the user option */
599 #define USER_DESC      (ntpd_opt_strs+1548)
600 #define USER_name      (ntpd_opt_strs+2302)
601 #endif  /* HAVE_DROPROOT */
602 
603 /**
604  *  updateinterval option description:
605  */
606 /** Descriptive text for the updateinterval option */
607 #define UPDATEINTERVAL_DESC      (ntpd_opt_strs+2307)
608 /** Upper-cased name for the updateinterval option */
609 #define UPDATEINTERVAL_NAME      (ntpd_opt_strs+2371)
610 /** Name string for the updateinterval option */
611 #define UPDATEINTERVAL_name      (ntpd_opt_strs+2386)
612 /** Compiled in flag settings for the updateinterval option */
613 #define UPDATEINTERVAL_FLAGS     (OPTST_DISABLED \
614         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
615 
616 /**
617  *  var option description:
618  */
619 /** Descriptive text for the var option */
620 #define VAR_DESC      (ntpd_opt_strs+2401)
621 /** Upper-cased name for the var option */
622 #define VAR_NAME      (ntpd_opt_strs+2431)
623 /** Name string for the var option */
624 #define VAR_name      (ntpd_opt_strs+2435)
625 /** Compiled in flag settings for the var option */
626 #define VAR_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
627         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
628 
629 /**
630  *  dvar option description:
631  */
632 /** Descriptive text for the dvar option */
633 #define DVAR_DESC      (ntpd_opt_strs+2439)
634 /** Upper-cased name for the dvar option */
635 #define DVAR_NAME      (ntpd_opt_strs+2473)
636 /** Name string for the dvar option */
637 #define DVAR_name      (ntpd_opt_strs+2478)
638 /** Compiled in flag settings for the dvar option */
639 #define DVAR_FLAGS     (OPTST_DISABLED | OPTST_STACKED \
640         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
641 
642 /**
643  *  wait-sync option description with
644  *  "Must also have options" and "Incompatible options":
645  */
646 #ifdef HAVE_WORKING_FORK
647 /** Descriptive text for the wait-sync option */
648 #define WAIT_SYNC_DESC      (ntpd_opt_strs+2483)
649 /** Upper-cased name for the wait-sync option */
650 #define WAIT_SYNC_NAME      (ntpd_opt_strs+2520)
651 /** Name string for the wait-sync option */
652 #define WAIT_SYNC_name      (ntpd_opt_strs+2530)
653 /** Other options that appear in conjunction with the wait-sync option */
654 static int const aWait_SyncCantList[] = {
655     INDEX_OPT_NOFORK,
656     INDEX_OPT_QUIT,
657     INDEX_OPT_SAVECONFIGQUIT, NO_EQUIVALENT };
658 /** Compiled in flag settings for the wait-sync option */
659 #define WAIT_SYNC_FLAGS     (OPTST_DISABLED \
660         | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
661 
662 #else   /* disable wait-sync */
663 #define WAIT_SYNC_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
664 #define aWait_SyncCantList   NULL
665 #define WAIT_SYNC_NAME      NULL
666 #define WAIT_SYNC_DESC      NULL
667 #define WAIT_SYNC_name      NULL
668 #endif  /* HAVE_WORKING_FORK */
669 
670 /**
671  *  slew option description:
672  */
673 /** Descriptive text for the slew option */
674 #define SLEW_DESC      (ntpd_opt_strs+2540)
675 /** Upper-cased name for the slew option */
676 #define SLEW_NAME      (ntpd_opt_strs+2563)
677 /** Name string for the slew option */
678 #define SLEW_name      (ntpd_opt_strs+2568)
679 /** Compiled in flag settings for the slew option */
680 #define SLEW_FLAGS     (OPTST_DISABLED)
681 
682 /**
683  *  usepcc option description:
684  */
685 #ifdef SYS_WINNT
686 /** Descriptive text for the usepcc option */
687 #define USEPCC_DESC      (ntpd_opt_strs+2573)
688 /** Upper-cased name for the usepcc option */
689 #define USEPCC_NAME      (ntpd_opt_strs+2610)
690 /** Name string for the usepcc option */
691 #define USEPCC_name      (ntpd_opt_strs+2617)
692 /** Compiled in flag settings for the usepcc option */
693 #define USEPCC_FLAGS     (OPTST_DISABLED)
694 
695 #else   /* disable usepcc */
696 #define USEPCC_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
697 #define USEPCC_NAME      NULL
698 #define USEPCC_DESC      NULL
699 #define USEPCC_name      NULL
700 #endif  /* SYS_WINNT */
701 
702 /**
703  *  pccfreq option description:
704  */
705 #ifdef SYS_WINNT
706 /** Descriptive text for the pccfreq option */
707 #define PCCFREQ_DESC      (ntpd_opt_strs+2624)
708 /** Upper-cased name for the pccfreq option */
709 #define PCCFREQ_NAME      (ntpd_opt_strs+2667)
710 /** Name string for the pccfreq option */
711 #define PCCFREQ_name      (ntpd_opt_strs+2675)
712 /** Compiled in flag settings for the pccfreq option */
713 #define PCCFREQ_FLAGS     (OPTST_DISABLED \
714         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
715 
716 #else   /* disable pccfreq */
717 #define PCCFREQ_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
718 #define PCCFREQ_NAME      NULL
719 #define PCCFREQ_DESC      NULL
720 #define PCCFREQ_name      NULL
721 #endif  /* SYS_WINNT */
722 
723 /**
724  *  mdns option description:
725  */
726 #ifdef HAVE_DNSREGISTRATION
727 /** Descriptive text for the mdns option */
728 #define MDNS_DESC      (ntpd_opt_strs+2683)
729 /** Upper-cased name for the mdns option */
730 #define MDNS_NAME      (ntpd_opt_strs+2718)
731 /** Name string for the mdns option */
732 #define MDNS_name      (ntpd_opt_strs+2723)
733 /** Compiled in flag settings for the mdns option */
734 #define MDNS_FLAGS     (OPTST_DISABLED)
735 
736 #else   /* disable mdns */
737 #define MDNS_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
738 #define MDNS_NAME      NULL
739 #define MDNS_DESC      NULL
740 #define MDNS_name      NULL
741 #endif  /* HAVE_DNSREGISTRATION */
742 
743 /*
744  *  Help/More_Help/Version option descriptions:
745  */
746 #define HELP_DESC       (ntpd_opt_strs+2728)
747 #define HELP_name       (ntpd_opt_strs+2772)
748 #ifdef HAVE_WORKING_FORK
749 #define MORE_HELP_DESC  (ntpd_opt_strs+2777)
750 #define MORE_HELP_name  (ntpd_opt_strs+2822)
751 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
752 #else
753 #define MORE_HELP_DESC  HELP_DESC
754 #define MORE_HELP_name  HELP_name
755 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
756 #endif
757 #ifdef NO_OPTIONAL_OPT_ARGS
758 #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
759 #else
760 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
761                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
762 #endif
763 #define VER_DESC        (ntpd_opt_strs+2832)
764 #define VER_name        (ntpd_opt_strs+2868)
765 /**
766  *  Declare option callback procedures
767  */
768 extern tOptProc
769     ntpOptionPrintVersion, optionBooleanVal,      optionNestedVal,
770     optionNumericVal,      optionPagedUsage,      optionResetOpt,
771     optionStackArg,        optionTimeDate,        optionTimeVal,
772     optionUnstackArg,      optionVendorOption;
773 static tOptProc
774     doOptDebug_Level, doUsageOpt;
775 #define VER_PROC        ntpOptionPrintVersion
776 
777 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
778 /**
779  *  Define the ntpd Option Descriptions.
780  * This is an array of OPTION_CT entries, one for each
781  * option that the ntpd program responds to.
782  */
783 static tOptDesc optDesc[OPTION_CT] = {
784   {  /* entry idx, value */ 0, VALUE_OPT_IPV4,
785      /* equiv idx, value */ 0, VALUE_OPT_IPV4,
786      /* equivalenced to  */ NO_EQUIVALENT,
787      /* min, max, act ct */ 0, 1, 0,
788      /* opt state flags  */ IPV4_FLAGS, 0,
789      /* last opt argumnt */ { NULL }, /* --ipv4 */
790      /* arg list/cookie  */ NULL,
791      /* must/cannot opts */ NULL, aIpv4CantList,
792      /* option proc      */ NULL,
793      /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
794      /* disablement strs */ NULL, NULL },
795 
796   {  /* entry idx, value */ 1, VALUE_OPT_IPV6,
797      /* equiv idx, value */ 1, VALUE_OPT_IPV6,
798      /* equivalenced to  */ NO_EQUIVALENT,
799      /* min, max, act ct */ 0, 1, 0,
800      /* opt state flags  */ IPV6_FLAGS, 0,
801      /* last opt argumnt */ { NULL }, /* --ipv6 */
802      /* arg list/cookie  */ NULL,
803      /* must/cannot opts */ NULL, aIpv6CantList,
804      /* option proc      */ NULL,
805      /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
806      /* disablement strs */ NULL, NULL },
807 
808   {  /* entry idx, value */ 2, VALUE_OPT_AUTHREQ,
809      /* equiv idx, value */ 2, VALUE_OPT_AUTHREQ,
810      /* equivalenced to  */ NO_EQUIVALENT,
811      /* min, max, act ct */ 0, 1, 0,
812      /* opt state flags  */ AUTHREQ_FLAGS, 0,
813      /* last opt argumnt */ { NULL }, /* --authreq */
814      /* arg list/cookie  */ NULL,
815      /* must/cannot opts */ NULL, aAuthreqCantList,
816      /* option proc      */ NULL,
817      /* desc, NAME, name */ AUTHREQ_DESC, AUTHREQ_NAME, AUTHREQ_name,
818      /* disablement strs */ NULL, NULL },
819 
820   {  /* entry idx, value */ 3, VALUE_OPT_AUTHNOREQ,
821      /* equiv idx, value */ 3, VALUE_OPT_AUTHNOREQ,
822      /* equivalenced to  */ NO_EQUIVALENT,
823      /* min, max, act ct */ 0, 1, 0,
824      /* opt state flags  */ AUTHNOREQ_FLAGS, 0,
825      /* last opt argumnt */ { NULL }, /* --authnoreq */
826      /* arg list/cookie  */ NULL,
827      /* must/cannot opts */ NULL, aAuthnoreqCantList,
828      /* option proc      */ NULL,
829      /* desc, NAME, name */ AUTHNOREQ_DESC, AUTHNOREQ_NAME, AUTHNOREQ_name,
830      /* disablement strs */ NULL, NULL },
831 
832   {  /* entry idx, value */ 4, VALUE_OPT_BCASTSYNC,
833      /* equiv idx, value */ 4, VALUE_OPT_BCASTSYNC,
834      /* equivalenced to  */ NO_EQUIVALENT,
835      /* min, max, act ct */ 0, 1, 0,
836      /* opt state flags  */ BCASTSYNC_FLAGS, 0,
837      /* last opt argumnt */ { NULL }, /* --bcastsync */
838      /* arg list/cookie  */ NULL,
839      /* must/cannot opts */ NULL, NULL,
840      /* option proc      */ NULL,
841      /* desc, NAME, name */ BCASTSYNC_DESC, BCASTSYNC_NAME, BCASTSYNC_name,
842      /* disablement strs */ NULL, NULL },
843 
844   {  /* entry idx, value */ 5, VALUE_OPT_CONFIGFILE,
845      /* equiv idx, value */ 5, VALUE_OPT_CONFIGFILE,
846      /* equivalenced to  */ NO_EQUIVALENT,
847      /* min, max, act ct */ 0, 1, 0,
848      /* opt state flags  */ CONFIGFILE_FLAGS, 0,
849      /* last opt argumnt */ { NULL }, /* --configfile */
850      /* arg list/cookie  */ NULL,
851      /* must/cannot opts */ NULL, NULL,
852      /* option proc      */ NULL,
853      /* desc, NAME, name */ CONFIGFILE_DESC, CONFIGFILE_NAME, CONFIGFILE_name,
854      /* disablement strs */ NULL, NULL },
855 
856   {  /* entry idx, value */ 6, VALUE_OPT_DEBUG_LEVEL,
857      /* equiv idx, value */ 6, VALUE_OPT_DEBUG_LEVEL,
858      /* equivalenced to  */ NO_EQUIVALENT,
859      /* min, max, act ct */ 0, NOLIMIT, 0,
860      /* opt state flags  */ DEBUG_LEVEL_FLAGS, 0,
861      /* last opt argumnt */ { NULL }, /* --debug-level */
862      /* arg list/cookie  */ NULL,
863      /* must/cannot opts */ NULL, NULL,
864      /* option proc      */ doOptDebug_Level,
865      /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
866      /* disablement strs */ NULL, NULL },
867 
868   {  /* entry idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL,
869      /* equiv idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL,
870      /* equivalenced to  */ NO_EQUIVALENT,
871      /* min, max, act ct */ 0, NOLIMIT, 0,
872      /* opt state flags  */ SET_DEBUG_LEVEL_FLAGS, 0,
873      /* last opt argumnt */ { NULL }, /* --set-debug-level */
874      /* arg list/cookie  */ NULL,
875      /* must/cannot opts */ NULL, NULL,
876      /* option proc      */ optionNumericVal,
877      /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
878      /* disablement strs */ NULL, NULL },
879 
880   {  /* entry idx, value */ 8, VALUE_OPT_DRIFTFILE,
881      /* equiv idx, value */ 8, VALUE_OPT_DRIFTFILE,
882      /* equivalenced to  */ NO_EQUIVALENT,
883      /* min, max, act ct */ 0, 1, 0,
884      /* opt state flags  */ DRIFTFILE_FLAGS, 0,
885      /* last opt argumnt */ { NULL }, /* --driftfile */
886      /* arg list/cookie  */ NULL,
887      /* must/cannot opts */ NULL, NULL,
888      /* option proc      */ NULL,
889      /* desc, NAME, name */ DRIFTFILE_DESC, DRIFTFILE_NAME, DRIFTFILE_name,
890      /* disablement strs */ NULL, NULL },
891 
892   {  /* entry idx, value */ 9, VALUE_OPT_PANICGATE,
893      /* equiv idx, value */ 9, VALUE_OPT_PANICGATE,
894      /* equivalenced to  */ NO_EQUIVALENT,
895      /* min, max, act ct */ 0, NOLIMIT, 0,
896      /* opt state flags  */ PANICGATE_FLAGS, 0,
897      /* last opt argumnt */ { NULL }, /* --panicgate */
898      /* arg list/cookie  */ NULL,
899      /* must/cannot opts */ NULL, NULL,
900      /* option proc      */ NULL,
901      /* desc, NAME, name */ PANICGATE_DESC, PANICGATE_NAME, PANICGATE_name,
902      /* disablement strs */ NULL, NULL },
903 
904   {  /* entry idx, value */ 10, VALUE_OPT_JAILDIR,
905      /* equiv idx, value */ 10, VALUE_OPT_JAILDIR,
906      /* equivalenced to  */ NO_EQUIVALENT,
907      /* min, max, act ct */ 0, 1, 0,
908      /* opt state flags  */ JAILDIR_FLAGS, 0,
909      /* last opt argumnt */ { NULL }, /* --jaildir */
910      /* arg list/cookie  */ NULL,
911      /* must/cannot opts */ NULL, NULL,
912      /* option proc      */ NULL,
913      /* desc, NAME, name */ JAILDIR_DESC, JAILDIR_NAME, JAILDIR_name,
914      /* disablement strs */ NULL, NULL },
915 
916   {  /* entry idx, value */ 11, VALUE_OPT_INTERFACE,
917      /* equiv idx, value */ 11, VALUE_OPT_INTERFACE,
918      /* equivalenced to  */ NO_EQUIVALENT,
919      /* min, max, act ct */ 0, NOLIMIT, 0,
920      /* opt state flags  */ INTERFACE_FLAGS, 0,
921      /* last opt argumnt */ { NULL }, /* --interface */
922      /* arg list/cookie  */ NULL,
923      /* must/cannot opts */ NULL, NULL,
924      /* option proc      */ optionStackArg,
925      /* desc, NAME, name */ INTERFACE_DESC, INTERFACE_NAME, INTERFACE_name,
926      /* disablement strs */ NULL, NULL },
927 
928   {  /* entry idx, value */ 12, VALUE_OPT_KEYFILE,
929      /* equiv idx, value */ 12, VALUE_OPT_KEYFILE,
930      /* equivalenced to  */ NO_EQUIVALENT,
931      /* min, max, act ct */ 0, 1, 0,
932      /* opt state flags  */ KEYFILE_FLAGS, 0,
933      /* last opt argumnt */ { NULL }, /* --keyfile */
934      /* arg list/cookie  */ NULL,
935      /* must/cannot opts */ NULL, NULL,
936      /* option proc      */ NULL,
937      /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name,
938      /* disablement strs */ NULL, NULL },
939 
940   {  /* entry idx, value */ 13, VALUE_OPT_LOGFILE,
941      /* equiv idx, value */ 13, VALUE_OPT_LOGFILE,
942      /* equivalenced to  */ NO_EQUIVALENT,
943      /* min, max, act ct */ 0, 1, 0,
944      /* opt state flags  */ LOGFILE_FLAGS, 0,
945      /* last opt argumnt */ { NULL }, /* --logfile */
946      /* arg list/cookie  */ NULL,
947      /* must/cannot opts */ NULL, NULL,
948      /* option proc      */ NULL,
949      /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name,
950      /* disablement strs */ NULL, NULL },
951 
952   {  /* entry idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
953      /* equiv idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
954      /* equivalenced to  */ NO_EQUIVALENT,
955      /* min, max, act ct */ 0, 1, 0,
956      /* opt state flags  */ NOVIRTUALIPS_FLAGS, 0,
957      /* last opt argumnt */ { NULL }, /* --novirtualips */
958      /* arg list/cookie  */ NULL,
959      /* must/cannot opts */ NULL, NULL,
960      /* option proc      */ NULL,
961      /* desc, NAME, name */ NOVIRTUALIPS_DESC, NOVIRTUALIPS_NAME, NOVIRTUALIPS_name,
962      /* disablement strs */ NULL, NULL },
963 
964   {  /* entry idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
965      /* equiv idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
966      /* equivalenced to  */ NO_EQUIVALENT,
967      /* min, max, act ct */ 0, 1, 0,
968      /* opt state flags  */ MODIFYMMTIMER_FLAGS, 0,
969      /* last opt argumnt */ { NULL }, /* --modifymmtimer */
970      /* arg list/cookie  */ NULL,
971      /* must/cannot opts */ NULL, NULL,
972      /* option proc      */ NULL,
973      /* desc, NAME, name */ MODIFYMMTIMER_DESC, MODIFYMMTIMER_NAME, MODIFYMMTIMER_name,
974      /* disablement strs */ NULL, NULL },
975 
976   {  /* entry idx, value */ 16, VALUE_OPT_NOFORK,
977      /* equiv idx, value */ 16, VALUE_OPT_NOFORK,
978      /* equivalenced to  */ NO_EQUIVALENT,
979      /* min, max, act ct */ 0, 1, 0,
980      /* opt state flags  */ NOFORK_FLAGS, 0,
981      /* last opt argumnt */ { NULL }, /* --nofork */
982      /* arg list/cookie  */ NULL,
983      /* must/cannot opts */ NULL, aNoforkCantList,
984      /* option proc      */ NULL,
985      /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name,
986      /* disablement strs */ NULL, NULL },
987 
988   {  /* entry idx, value */ 17, VALUE_OPT_NICE,
989      /* equiv idx, value */ 17, VALUE_OPT_NICE,
990      /* equivalenced to  */ NO_EQUIVALENT,
991      /* min, max, act ct */ 0, 1, 0,
992      /* opt state flags  */ NICE_FLAGS, 0,
993      /* last opt argumnt */ { NULL }, /* --nice */
994      /* arg list/cookie  */ NULL,
995      /* must/cannot opts */ NULL, NULL,
996      /* option proc      */ NULL,
997      /* desc, NAME, name */ NICE_DESC, NICE_NAME, NICE_name,
998      /* disablement strs */ NULL, NULL },
999 
1000   {  /* entry idx, value */ 18, VALUE_OPT_PIDFILE,
1001      /* equiv idx, value */ 18, VALUE_OPT_PIDFILE,
1002      /* equivalenced to  */ NO_EQUIVALENT,
1003      /* min, max, act ct */ 0, 1, 0,
1004      /* opt state flags  */ PIDFILE_FLAGS, 0,
1005      /* last opt argumnt */ { NULL }, /* --pidfile */
1006      /* arg list/cookie  */ NULL,
1007      /* must/cannot opts */ NULL, NULL,
1008      /* option proc      */ NULL,
1009      /* desc, NAME, name */ PIDFILE_DESC, PIDFILE_NAME, PIDFILE_name,
1010      /* disablement strs */ NULL, NULL },
1011 
1012   {  /* entry idx, value */ 19, VALUE_OPT_PRIORITY,
1013      /* equiv idx, value */ 19, VALUE_OPT_PRIORITY,
1014      /* equivalenced to  */ NO_EQUIVALENT,
1015      /* min, max, act ct */ 0, 1, 0,
1016      /* opt state flags  */ PRIORITY_FLAGS, 0,
1017      /* last opt argumnt */ { NULL }, /* --priority */
1018      /* arg list/cookie  */ NULL,
1019      /* must/cannot opts */ NULL, NULL,
1020      /* option proc      */ optionNumericVal,
1021      /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name,
1022      /* disablement strs */ NULL, NULL },
1023 
1024   {  /* entry idx, value */ 20, VALUE_OPT_QUIT,
1025      /* equiv idx, value */ 20, VALUE_OPT_QUIT,
1026      /* equivalenced to  */ NO_EQUIVALENT,
1027      /* min, max, act ct */ 0, 1, 0,
1028      /* opt state flags  */ QUIT_FLAGS, 0,
1029      /* last opt argumnt */ { NULL }, /* --quit */
1030      /* arg list/cookie  */ NULL,
1031      /* must/cannot opts */ NULL, aQuitCantList,
1032      /* option proc      */ NULL,
1033      /* desc, NAME, name */ QUIT_DESC, QUIT_NAME, QUIT_name,
1034      /* disablement strs */ NULL, NULL },
1035 
1036   {  /* entry idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
1037      /* equiv idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
1038      /* equivalenced to  */ NO_EQUIVALENT,
1039      /* min, max, act ct */ 0, 1, 0,
1040      /* opt state flags  */ PROPAGATIONDELAY_FLAGS, 0,
1041      /* last opt argumnt */ { NULL }, /* --propagationdelay */
1042      /* arg list/cookie  */ NULL,
1043      /* must/cannot opts */ NULL, NULL,
1044      /* option proc      */ NULL,
1045      /* desc, NAME, name */ PROPAGATIONDELAY_DESC, PROPAGATIONDELAY_NAME, PROPAGATIONDELAY_name,
1046      /* disablement strs */ NULL, NULL },
1047 
1048   {  /* entry idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
1049      /* equiv idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
1050      /* equivalenced to  */ NO_EQUIVALENT,
1051      /* min, max, act ct */ 0, 1, 0,
1052      /* opt state flags  */ SAVECONFIGQUIT_FLAGS, 0,
1053      /* last opt argumnt */ { NULL }, /* --saveconfigquit */
1054      /* arg list/cookie  */ NULL,
1055      /* must/cannot opts */ NULL, aSaveconfigquitCantList,
1056      /* option proc      */ NULL,
1057      /* desc, NAME, name */ SAVECONFIGQUIT_DESC, SAVECONFIGQUIT_NAME, SAVECONFIGQUIT_name,
1058      /* disablement strs */ NULL, NULL },
1059 
1060   {  /* entry idx, value */ 23, VALUE_OPT_STATSDIR,
1061      /* equiv idx, value */ 23, VALUE_OPT_STATSDIR,
1062      /* equivalenced to  */ NO_EQUIVALENT,
1063      /* min, max, act ct */ 0, 1, 0,
1064      /* opt state flags  */ STATSDIR_FLAGS, 0,
1065      /* last opt argumnt */ { NULL }, /* --statsdir */
1066      /* arg list/cookie  */ NULL,
1067      /* must/cannot opts */ NULL, NULL,
1068      /* option proc      */ NULL,
1069      /* desc, NAME, name */ STATSDIR_DESC, STATSDIR_NAME, STATSDIR_name,
1070      /* disablement strs */ NULL, NULL },
1071 
1072   {  /* entry idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
1073      /* equiv idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
1074      /* equivalenced to  */ NO_EQUIVALENT,
1075      /* min, max, act ct */ 0, NOLIMIT, 0,
1076      /* opt state flags  */ TRUSTEDKEY_FLAGS, 0,
1077      /* last opt argumnt */ { NULL }, /* --trustedkey */
1078      /* arg list/cookie  */ NULL,
1079      /* must/cannot opts */ NULL, NULL,
1080      /* option proc      */ optionStackArg,
1081      /* desc, NAME, name */ TRUSTEDKEY_DESC, TRUSTEDKEY_NAME, TRUSTEDKEY_name,
1082      /* disablement strs */ NULL, NULL },
1083 
1084   {  /* entry idx, value */ 25, VALUE_OPT_USER,
1085      /* equiv idx, value */ 25, VALUE_OPT_USER,
1086      /* equivalenced to  */ NO_EQUIVALENT,
1087      /* min, max, act ct */ 0, 1, 0,
1088      /* opt state flags  */ USER_FLAGS, 0,
1089      /* last opt argumnt */ { NULL }, /* --user */
1090      /* arg list/cookie  */ NULL,
1091      /* must/cannot opts */ NULL, NULL,
1092      /* option proc      */ NULL,
1093      /* desc, NAME, name */ USER_DESC, USER_NAME, USER_name,
1094      /* disablement strs */ NULL, NULL },
1095 
1096   {  /* entry idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
1097      /* equiv idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
1098      /* equivalenced to  */ NO_EQUIVALENT,
1099      /* min, max, act ct */ 0, 1, 0,
1100      /* opt state flags  */ UPDATEINTERVAL_FLAGS, 0,
1101      /* last opt argumnt */ { NULL }, /* --updateinterval */
1102      /* arg list/cookie  */ NULL,
1103      /* must/cannot opts */ NULL, NULL,
1104      /* option proc      */ optionNumericVal,
1105      /* desc, NAME, name */ UPDATEINTERVAL_DESC, UPDATEINTERVAL_NAME, UPDATEINTERVAL_name,
1106      /* disablement strs */ NULL, NULL },
1107 
1108   {  /* entry idx, value */ 27, VALUE_OPT_VAR,
1109      /* equiv idx, value */ 27, VALUE_OPT_VAR,
1110      /* equivalenced to  */ NO_EQUIVALENT,
1111      /* min, max, act ct */ 0, NOLIMIT, 0,
1112      /* opt state flags  */ VAR_FLAGS, 0,
1113      /* last opt argumnt */ { NULL }, /* --var */
1114      /* arg list/cookie  */ NULL,
1115      /* must/cannot opts */ NULL, NULL,
1116      /* option proc      */ optionStackArg,
1117      /* desc, NAME, name */ VAR_DESC, VAR_NAME, VAR_name,
1118      /* disablement strs */ NULL, NULL },
1119 
1120   {  /* entry idx, value */ 28, VALUE_OPT_DVAR,
1121      /* equiv idx, value */ 28, VALUE_OPT_DVAR,
1122      /* equivalenced to  */ NO_EQUIVALENT,
1123      /* min, max, act ct */ 0, NOLIMIT, 0,
1124      /* opt state flags  */ DVAR_FLAGS, 0,
1125      /* last opt argumnt */ { NULL }, /* --dvar */
1126      /* arg list/cookie  */ NULL,
1127      /* must/cannot opts */ NULL, NULL,
1128      /* option proc      */ optionStackArg,
1129      /* desc, NAME, name */ DVAR_DESC, DVAR_NAME, DVAR_name,
1130      /* disablement strs */ NULL, NULL },
1131 
1132   {  /* entry idx, value */ 29, VALUE_OPT_WAIT_SYNC,
1133      /* equiv idx, value */ 29, VALUE_OPT_WAIT_SYNC,
1134      /* equivalenced to  */ NO_EQUIVALENT,
1135      /* min, max, act ct */ 0, 1, 0,
1136      /* opt state flags  */ WAIT_SYNC_FLAGS, 0,
1137      /* last opt argumnt */ { NULL }, /* --wait-sync */
1138      /* arg list/cookie  */ NULL,
1139      /* must/cannot opts */ NULL, aWait_SyncCantList,
1140      /* option proc      */ optionNumericVal,
1141      /* desc, NAME, name */ WAIT_SYNC_DESC, WAIT_SYNC_NAME, WAIT_SYNC_name,
1142      /* disablement strs */ NULL, NULL },
1143 
1144   {  /* entry idx, value */ 30, VALUE_OPT_SLEW,
1145      /* equiv idx, value */ 30, VALUE_OPT_SLEW,
1146      /* equivalenced to  */ NO_EQUIVALENT,
1147      /* min, max, act ct */ 0, 1, 0,
1148      /* opt state flags  */ SLEW_FLAGS, 0,
1149      /* last opt argumnt */ { NULL }, /* --slew */
1150      /* arg list/cookie  */ NULL,
1151      /* must/cannot opts */ NULL, NULL,
1152      /* option proc      */ NULL,
1153      /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name,
1154      /* disablement strs */ NULL, NULL },
1155 
1156   {  /* entry idx, value */ 31, VALUE_OPT_USEPCC,
1157      /* equiv idx, value */ 31, VALUE_OPT_USEPCC,
1158      /* equivalenced to  */ NO_EQUIVALENT,
1159      /* min, max, act ct */ 0, 1, 0,
1160      /* opt state flags  */ USEPCC_FLAGS, 0,
1161      /* last opt argumnt */ { NULL }, /* --usepcc */
1162      /* arg list/cookie  */ NULL,
1163      /* must/cannot opts */ NULL, NULL,
1164      /* option proc      */ NULL,
1165      /* desc, NAME, name */ USEPCC_DESC, USEPCC_NAME, USEPCC_name,
1166      /* disablement strs */ NULL, NULL },
1167 
1168   {  /* entry idx, value */ 32, VALUE_OPT_PCCFREQ,
1169      /* equiv idx, value */ 32, VALUE_OPT_PCCFREQ,
1170      /* equivalenced to  */ NO_EQUIVALENT,
1171      /* min, max, act ct */ 0, 1, 0,
1172      /* opt state flags  */ PCCFREQ_FLAGS, 0,
1173      /* last opt argumnt */ { NULL }, /* --pccfreq */
1174      /* arg list/cookie  */ NULL,
1175      /* must/cannot opts */ NULL, NULL,
1176      /* option proc      */ NULL,
1177      /* desc, NAME, name */ PCCFREQ_DESC, PCCFREQ_NAME, PCCFREQ_name,
1178      /* disablement strs */ NULL, NULL },
1179 
1180   {  /* entry idx, value */ 33, VALUE_OPT_MDNS,
1181      /* equiv idx, value */ 33, VALUE_OPT_MDNS,
1182      /* equivalenced to  */ NO_EQUIVALENT,
1183      /* min, max, act ct */ 0, 1, 0,
1184      /* opt state flags  */ MDNS_FLAGS, 0,
1185      /* last opt argumnt */ { NULL }, /* --mdns */
1186      /* arg list/cookie  */ NULL,
1187      /* must/cannot opts */ NULL, NULL,
1188      /* option proc      */ NULL,
1189      /* desc, NAME, name */ MDNS_DESC, MDNS_NAME, MDNS_name,
1190      /* disablement strs */ NULL, NULL },
1191 
1192   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
1193      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
1194      /* equivalenced to  */ NO_EQUIVALENT,
1195      /* min, max, act ct */ 0, 1, 0,
1196      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
1197      /* last opt argumnt */ { NULL },
1198      /* arg list/cookie  */ NULL,
1199      /* must/cannot opts */ NULL, NULL,
1200      /* option proc      */ VER_PROC,
1201      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
1202      /* disablement strs */ NULL, NULL },
1203 
1204 
1205 
1206   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
1207      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
1208      /* equivalenced to  */ NO_EQUIVALENT,
1209      /* min, max, act ct */ 0, 1, 0,
1210      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
1211      /* last opt argumnt */ { NULL },
1212      /* arg list/cookie  */ NULL,
1213      /* must/cannot opts */ NULL, NULL,
1214      /* option proc      */ doUsageOpt,
1215      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
1216      /* disablement strs */ NULL, NULL },
1217 
1218   {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
1219      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
1220      /* equivalenced to  */ NO_EQUIVALENT,
1221      /* min, max, act ct */ 0, 1, 0,
1222      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
1223      /* last opt argumnt */ { NULL },
1224      /* arg list/cookie  */ NULL,
1225      /* must/cannot opts */ NULL,  NULL,
1226      /* option proc      */ optionPagedUsage,
1227      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
1228      /* disablement strs */ NULL, NULL }
1229 };
1230 
1231 
1232 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1233 /** Reference to the upper cased version of ntpd. */
1234 #define zPROGNAME       (ntpd_opt_strs+2876)
1235 /** Reference to the title line for ntpd usage. */
1236 #define zUsageTitle     (ntpd_opt_strs+2881)
1237 /** There is no ntpd configuration file. */
1238 #define zRcName         NULL
1239 /** There are no directories to search for ntpd config files. */
1240 #define apzHomeList     NULL
1241 /** The ntpd program bug email address. */
1242 #define zBugsAddr       (ntpd_opt_strs+3012)
1243 /** Clarification/explanation of what ntpd does. */
1244 #define zExplain        (ntpd_opt_strs+3046)
1245 /** Extra detail explaining what ntpd does. */
1246 #define zDetail         (NULL)
1247 /** The full version string for ntpd. */
1248 #define zFullVersion    (ntpd_opt_strs+3048)
1249 /* extracted from optcode.tlib near line 364 */
1250 
1251 #if defined(ENABLE_NLS)
1252 # define OPTPROC_BASE OPTPROC_TRANSLATE
1253   static tOptionXlateProc translate_option_strings;
1254 #else
1255 # define OPTPROC_BASE OPTPROC_NONE
1256 # define translate_option_strings NULL
1257 #endif /* ENABLE_NLS */
1258 
1259 #define ntpd_full_usage (NULL)
1260 #define ntpd_short_usage (NULL)
1261 
1262 #endif /* not defined __doxygen__ */
1263 
1264 /*
1265  *  Create the static procedure(s) declared above.
1266  */
1267 /**
1268  * The callout function that invokes the optionUsage function.
1269  *
1270  * @param[in] opts the AutoOpts option description structure
1271  * @param[in] od   the descriptor for the "help" (usage) option.
1272  * @noreturn
1273  */
1274 static void
1275 doUsageOpt(tOptions * opts, tOptDesc * od)
1276 {
1277     int ex_code;
1278     ex_code = NTPD_EXIT_SUCCESS;
1279     optionUsage(&ntpdOptions, ex_code);
1280     /* NOTREACHED */
1281     exit(1);
1282     (void)opts;
1283     (void)od;
1284 }
1285 
1286 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1287 /**
1288  * Code to handle the debug-level option.
1289  *
1290  * @param[in] pOptions the ntpd options data structure
1291  * @param[in,out] pOptDesc the option descriptor for this option.
1292  */
1293 static void
1294 doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
1295 {
1296     /*
1297      * Be sure the flag-code[0] handles special values for the options pointer
1298      * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
1299      * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
1300      * reset its state.
1301      */
1302     /* extracted from debug-opt.def, line 15 */
1303 OPT_VALUE_SET_DEBUG_LEVEL++;
1304     (void)pOptDesc;
1305     (void)pOptions;
1306 }
1307 /* extracted from optmain.tlib near line 1245 */
1308 
1309 /**
1310  * The directory containing the data associated with ntpd.
1311  */
1312 #ifndef  PKGDATADIR
1313 # define PKGDATADIR ""
1314 #endif
1315 
1316 /**
1317  * Information about the person or institution that packaged ntpd
1318  * for the current distribution.
1319  */
1320 #ifndef  WITH_PACKAGER
1321 # define ntpd_packager_info NULL
1322 #else
1323 /** Packager information for ntpd. */
1324 static char const ntpd_packager_info[] =
1325     "Packaged by " WITH_PACKAGER
1326 
1327 # ifdef WITH_PACKAGER_VERSION
1328         " ("WITH_PACKAGER_VERSION")"
1329 # endif
1330 
1331 # ifdef WITH_PACKAGER_BUG_REPORTS
1332     "\nReport ntpd bugs to " WITH_PACKAGER_BUG_REPORTS
1333 # endif
1334     "\n";
1335 #endif
1336 #ifndef __doxygen__
1337 
1338 #endif /* __doxygen__ */
1339 /**
1340  * The option definitions for ntpd.  The one structure that
1341  * binds them all.
1342  */
1343 tOptions ntpdOptions = {
1344     OPTIONS_STRUCT_VERSION,
1345     0, NULL,                    /* original argc + argv    */
1346     ( OPTPROC_BASE
1347     + OPTPROC_ERRSTOP
1348     + OPTPROC_SHORTOPT
1349     + OPTPROC_LONGOPT
1350     + OPTPROC_NO_REQ_OPT
1351     + OPTPROC_ENVIRON
1352     + OPTPROC_MISUSE ),
1353     0, NULL,                    /* current option index, current option */
1354     NULL,         NULL,         zPROGNAME,
1355     zRcName,      zCopyright,   zLicenseDescrip,
1356     zFullVersion, apzHomeList,  zUsageTitle,
1357     zExplain,     zDetail,      optDesc,
1358     zBugsAddr,                  /* address to send bugs to */
1359     NULL, NULL,                 /* extensions/saved state  */
1360     optionUsage, /* usage procedure */
1361     translate_option_strings,   /* translation procedure */
1362     /*
1363      *  Indexes to special options
1364      */
1365     { INDEX_OPT_MORE_HELP, /* more-help option index */
1366       NO_EQUIVALENT, /* save option index */
1367       NO_EQUIVALENT, /* '-#' option index */
1368       NO_EQUIVALENT /* index of default opt */
1369     },
1370     37 /* full option count */, 34 /* user option count */,
1371     ntpd_full_usage, ntpd_short_usage,
1372     NULL, NULL,
1373     PKGDATADIR, ntpd_packager_info
1374 };
1375 
1376 #if ENABLE_NLS
1377 /**
1378  * This code is designed to translate translatable option text for the
1379  * ntpd program.  These translations happen upon entry
1380  * to optionProcess().
1381  */
1382 #include <stdio.h>
1383 #include <stdlib.h>
1384 #include <string.h>
1385 #include <unistd.h>
1386 #ifdef HAVE_DCGETTEXT
1387 # include <gettext.h>
1388 #endif
1389 #include <autoopts/usage-txt.h>
1390 
1391 static char * AO_gettext(char const * pz);
1392 static void   coerce_it(void ** s);
1393 
1394 /**
1395  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
1396  * to convert from English to the target language, then strdup-duplicates the
1397  * result string.  It tries the "libopts" domain first, then whatever has been
1398  * set via the \a textdomain(3) call.
1399  *
1400  * @param[in] pz the input text used as a lookup key.
1401  * @returns the translated text (if there is one),
1402  *   or the original text (if not).
1403  */
1404 static char *
1405 AO_gettext(char const * pz)
1406 {
1407     char * res;
1408     if (pz == NULL)
1409         return NULL;
1410 #ifdef HAVE_DCGETTEXT
1411     /*
1412      * While processing the option_xlateable_txt data, try to use the
1413      * "libopts" domain.  Once we switch to the option descriptor data,
1414      * do *not* use that domain.
1415      */
1416     if (option_xlateable_txt.field_ct != 0) {
1417         res = dgettext("libopts", pz);
1418         if (res == pz)
1419             res = (char *)(void *)_(pz);
1420     } else
1421         res = (char *)(void *)_(pz);
1422 #else
1423     res = (char *)(void *)_(pz);
1424 #endif
1425     if (res == pz)
1426         return res;
1427     res = strdup(res);
1428     if (res == NULL) {
1429         fputs(_("No memory for duping translated strings\n"), stderr);
1430         exit(NTPD_EXIT_FAILURE);
1431     }
1432     return res;
1433 }
1434 
1435 /**
1436  * All the pointers we use are marked "* const", but they are stored in
1437  * writable memory.  Coerce the mutability and set the pointer.
1438  */
1439 static void coerce_it(void ** s) { *s = AO_gettext(*s);
1440 }
1441 
1442 /**
1443  * Translate all the translatable strings in the ntpdOptions
1444  * structure defined above.  This is done only once.
1445  */
1446 static void
1447 translate_option_strings(void)
1448 {
1449     tOptions * const opts = &ntpdOptions;
1450 
1451     /*
1452      *  Guard against re-translation.  It won't work.  The strings will have
1453      *  been changed by the first pass through this code.  One shot only.
1454      */
1455     if (option_xlateable_txt.field_ct != 0) {
1456         /*
1457          *  Do the translations.  The first pointer follows the field count
1458          *  field.  The field count field is the size of a pointer.
1459          */
1460         char ** ppz = (char**)(void*)&(option_xlateable_txt);
1461         int     ix  = option_xlateable_txt.field_ct;
1462 
1463         do {
1464             ppz++; /* skip over field_ct */
1465             *ppz = AO_gettext(*ppz);
1466         } while (--ix > 0);
1467         /* prevent re-translation and disable "libopts" domain lookup */
1468         option_xlateable_txt.field_ct = 0;
1469 
1470         coerce_it((void*)&(opts->pzCopyright));
1471         coerce_it((void*)&(opts->pzCopyNotice));
1472         coerce_it((void*)&(opts->pzFullVersion));
1473         coerce_it((void*)&(opts->pzUsageTitle));
1474         coerce_it((void*)&(opts->pzExplain));
1475         coerce_it((void*)&(opts->pzDetail));
1476         {
1477             tOptDesc * od = opts->pOptDesc;
1478             for (ix = opts->optCt; ix > 0; ix--, od++)
1479                 coerce_it((void*)&(od->pzText));
1480         }
1481     }
1482 }
1483 #endif /* ENABLE_NLS */
1484 
1485 #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
1486 /** I18N function strictly for xgettext.  Do not compile. */
1487 static void bogus_function(void) {
1488   /* TRANSLATORS:
1489 
1490      The following dummy function was crated solely so that xgettext can
1491      extract the correct strings.  These strings are actually referenced
1492      by a field name in the ntpdOptions structure noted in the
1493      comments below.  The literal text is defined in ntpd_opt_strs.
1494 
1495      NOTE: the strings below are segmented with respect to the source string
1496      ntpd_opt_strs.  The strings above are handed off for translation
1497      at run time a paragraph at a time.  Consequently, they are presented here
1498      for translation a paragraph at a time.
1499 
1500      ALSO: often the description for an option will reference another option
1501      by name.  These are set off with apostrophe quotes (I hope).  Do not
1502      translate option names.
1503    */
1504   /* referenced via ntpdOptions.pzCopyright */
1505   puts(_("ntpd 4.2.8p1\n\
1506 Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
1507 This is free software. It is licensed for use, modification and\n\
1508 redistribution under the terms of the NTP License, copies of which\n\
1509 can be seen at:\n"));
1510   puts(_("  <http://ntp.org/license>\n\
1511   <http://opensource.org/licenses/ntp-license.php>\n"));
1512 
1513   /* referenced via ntpdOptions.pzCopyNotice */
1514   puts(_("Permission to use, copy, modify, and distribute this software and its\n\
1515 documentation for any purpose with or without fee is hereby granted,\n\
1516 provided that the above copyright notice appears in all copies and that\n\
1517 both the copyright notice and this permission notice appear in supporting\n\
1518 documentation, and that the name The University of Delaware not be used in\n\
1519 advertising or publicity pertaining to distribution of the software without\n\
1520 specific, written prior permission.  The University of Delaware and Network\n\
1521 Time Foundation makes no representations about the suitability this\n\
1522 software for any purpose.  It is provided \"as is\" without express or\n\
1523 implied warranty.\n"));
1524 
1525   /* referenced via ntpdOptions.pOptDesc->pzText */
1526   puts(_("Force IPv4 DNS name resolution"));
1527 
1528   /* referenced via ntpdOptions.pOptDesc->pzText */
1529   puts(_("Force IPv6 DNS name resolution"));
1530 
1531   /* referenced via ntpdOptions.pOptDesc->pzText */
1532   puts(_("Require crypto authentication"));
1533 
1534   /* referenced via ntpdOptions.pOptDesc->pzText */
1535   puts(_("Do not require crypto authentication"));
1536 
1537   /* referenced via ntpdOptions.pOptDesc->pzText */
1538   puts(_("Allow us to sync to broadcast servers"));
1539 
1540   /* referenced via ntpdOptions.pOptDesc->pzText */
1541   puts(_("configuration file name"));
1542 
1543   /* referenced via ntpdOptions.pOptDesc->pzText */
1544   puts(_("Increase debug verbosity level"));
1545 
1546   /* referenced via ntpdOptions.pOptDesc->pzText */
1547   puts(_("Set the debug verbosity level"));
1548 
1549   /* referenced via ntpdOptions.pOptDesc->pzText */
1550   puts(_("frequency drift file name"));
1551 
1552   /* referenced via ntpdOptions.pOptDesc->pzText */
1553   puts(_("Allow the first adjustment to be Big"));
1554 
1555   /* referenced via ntpdOptions.pOptDesc->pzText */
1556   puts(_("Jail directory"));
1557 
1558   /* referenced via ntpdOptions.pOptDesc->pzText */
1559   puts(_("built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs"));
1560 
1561   /* referenced via ntpdOptions.pOptDesc->pzText */
1562   puts(_("Listen on an interface name or address"));
1563 
1564   /* referenced via ntpdOptions.pOptDesc->pzText */
1565   puts(_("path to symmetric keys"));
1566 
1567   /* referenced via ntpdOptions.pOptDesc->pzText */
1568   puts(_("path to the log file"));
1569 
1570   /* referenced via ntpdOptions.pOptDesc->pzText */
1571   puts(_("Do not listen to virtual interfaces"));
1572 
1573   /* referenced via ntpdOptions.pOptDesc->pzText */
1574   puts(_("Modify Multimedia Timer (Windows only)"));
1575 
1576   /* referenced via ntpdOptions.pOptDesc->pzText */
1577   puts(_("Do not fork"));
1578 
1579   /* referenced via ntpdOptions.pOptDesc->pzText */
1580   puts(_("Run at high priority"));
1581 
1582   /* referenced via ntpdOptions.pOptDesc->pzText */
1583   puts(_("path to the PID file"));
1584 
1585   /* referenced via ntpdOptions.pOptDesc->pzText */
1586   puts(_("Process priority"));
1587 
1588   /* referenced via ntpdOptions.pOptDesc->pzText */
1589   puts(_("Set the time and quit"));
1590 
1591   /* referenced via ntpdOptions.pOptDesc->pzText */
1592   puts(_("Broadcast/propagation delay"));
1593 
1594   /* referenced via ntpdOptions.pOptDesc->pzText */
1595   puts(_("Save parsed configuration and quit"));
1596 
1597   /* referenced via ntpdOptions.pOptDesc->pzText */
1598   puts(_("Statistics file location"));
1599 
1600   /* referenced via ntpdOptions.pOptDesc->pzText */
1601   puts(_("Trusted key number"));
1602 
1603   /* referenced via ntpdOptions.pOptDesc->pzText */
1604   puts(_("Run as userid (or userid:groupid)"));
1605 
1606   /* referenced via ntpdOptions.pOptDesc->pzText */
1607   puts(_("built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs"));
1608 
1609   /* referenced via ntpdOptions.pOptDesc->pzText */
1610   puts(_("interval in seconds between scans for new or dropped interfaces"));
1611 
1612   /* referenced via ntpdOptions.pOptDesc->pzText */
1613   puts(_("make ARG an ntp variable (RW)"));
1614 
1615   /* referenced via ntpdOptions.pOptDesc->pzText */
1616   puts(_("make ARG an ntp variable (RW|DEF)"));
1617 
1618   /* referenced via ntpdOptions.pOptDesc->pzText */
1619   puts(_("Seconds to wait for first clock sync"));
1620 
1621   /* referenced via ntpdOptions.pOptDesc->pzText */
1622   puts(_("Slew up to 600 seconds"));
1623 
1624   /* referenced via ntpdOptions.pOptDesc->pzText */
1625   puts(_("Use CPU cycle counter (Windows only)"));
1626 
1627   /* referenced via ntpdOptions.pOptDesc->pzText */
1628   puts(_("Force CPU cycle counter use (Windows only)"));
1629 
1630   /* referenced via ntpdOptions.pOptDesc->pzText */
1631   puts(_("Register with mDNS as a NTP server"));
1632 
1633   /* referenced via ntpdOptions.pOptDesc->pzText */
1634   puts(_("display extended usage information and exit"));
1635 
1636   /* referenced via ntpdOptions.pOptDesc->pzText */
1637   puts(_("extended usage information passed thru pager"));
1638 
1639   /* referenced via ntpdOptions.pOptDesc->pzText */
1640   puts(_("output version information and exit"));
1641 
1642   /* referenced via ntpdOptions.pzUsageTitle */
1643   puts(_("ntpd - NTP daemon program - Ver. 4.2.8p1\n\
1644 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
1645 \t\t[ <server1> ... <serverN> ]\n"));
1646 
1647   /* referenced via ntpdOptions.pzExplain */
1648   puts(_("\n"));
1649 
1650   /* referenced via ntpdOptions.pzFullVersion */
1651   puts(_("ntpd 4.2.8p1"));
1652 
1653   /* referenced via ntpdOptions.pzFullUsage */
1654   puts(_("<<<NOT-FOUND>>>"));
1655 
1656   /* referenced via ntpdOptions.pzShortUsage */
1657   puts(_("<<<NOT-FOUND>>>"));
1658   /* LIBOPTS-MESSAGES: */
1659 #line 67 "../autoopts.c"
1660   puts(_("allocation of %d bytes failed\n"));
1661 #line 93 "../autoopts.c"
1662   puts(_("allocation of %d bytes failed\n"));
1663 #line 53 "../init.c"
1664   puts(_("AutoOpts function called without option descriptor\n"));
1665 #line 86 "../init.c"
1666   puts(_("\tThis exceeds the compiled library version:  "));
1667 #line 84 "../init.c"
1668   puts(_("Automated Options Processing Error!\n"
1669        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
1670 #line 80 "../autoopts.c"
1671   puts(_("realloc of %d bytes at 0x%p failed\n"));
1672 #line 88 "../init.c"
1673   puts(_("\tThis is less than the minimum library version:  "));
1674 #line 121 "../version.c"
1675   puts(_("Automated Options version %s\n"
1676        "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
1677 #line 82 "../makeshell.c"
1678   puts(_("(AutoOpts bug):  %s.\n"));
1679 #line 90 "../reset.c"
1680   puts(_("optionResetOpt() called, but reset-option not configured"));
1681 #line 292 "../usage.c"
1682   puts(_("could not locate the 'help' option"));
1683 #line 336 "../autoopts.c"
1684   puts(_("optionProcess() was called with invalid data"));
1685 #line 748 "../usage.c"
1686   puts(_("invalid argument type specified"));
1687 #line 598 "../find.c"
1688   puts(_("defaulted to option with optional arg"));
1689 #line 76 "../alias.c"
1690   puts(_("aliasing option is out of range."));
1691 #line 234 "../enum.c"
1692   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
1693 #line 108 "../find.c"
1694   puts(_("  The following options match:\n"));
1695 #line 293 "../find.c"
1696   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
1697 #line 161 "../check.c"
1698   puts(_("%s: Command line arguments required\n"));
1699 #line 43 "../alias.c"
1700   puts(_("%d %s%s options allowed\n"));
1701 #line 89 "../makeshell.c"
1702   puts(_("%s error %d (%s) calling %s for '%s'\n"));
1703 #line 301 "../makeshell.c"
1704   puts(_("interprocess pipe"));
1705 #line 168 "../version.c"
1706   puts(_("error: version option argument '%c' invalid.  Use:\n"
1707        "\t'v' - version only\n"
1708        "\t'c' - version and copyright\n"
1709        "\t'n' - version and full copyright notice\n"));
1710 #line 58 "../check.c"
1711   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
1712 #line 217 "../find.c"
1713   puts(_("%s: The '%s' option has been disabled."));
1714 #line 430 "../find.c"
1715   puts(_("%s: The '%s' option has been disabled."));
1716 #line 38 "../alias.c"
1717   puts(_("-equivalence"));
1718 #line 469 "../find.c"
1719   puts(_("%s: illegal option -- %c\n"));
1720 #line 110 "../reset.c"
1721   puts(_("%s: illegal option -- %c\n"));
1722 #line 271 "../find.c"
1723   puts(_("%s: illegal option -- %s\n"));
1724 #line 755 "../find.c"
1725   puts(_("%s: illegal option -- %s\n"));
1726 #line 118 "../reset.c"
1727   puts(_("%s: illegal option -- %s\n"));
1728 #line 335 "../find.c"
1729   puts(_("%s: unknown vendor extension option -- %s\n"));
1730 #line 159 "../enum.c"
1731   puts(_("  or an integer from %d through %d\n"));
1732 #line 169 "../enum.c"
1733   puts(_("  or an integer from %d through %d\n"));
1734 #line 747 "../usage.c"
1735   puts(_("%s error:  invalid option descriptor for %s\n"));
1736 #line 1081 "../usage.c"
1737   puts(_("%s error:  invalid option descriptor for %s\n"));
1738 #line 385 "../find.c"
1739   puts(_("%s: invalid option name: %s\n"));
1740 #line 527 "../find.c"
1741   puts(_("%s: The '%s' option requires an argument.\n"));
1742 #line 156 "../autoopts.c"
1743   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
1744        "\t'%s' and '%s'."));
1745 #line 94 "../check.c"
1746   puts(_("%s error:  The %s option is required\n"));
1747 #line 632 "../find.c"
1748   puts(_("%s: The '%s' option cannot have an argument.\n"));
1749 #line 151 "../check.c"
1750   puts(_("%s: Command line arguments are not allowed.\n"));
1751 #line 535 "../save.c"
1752   puts(_("error %d (%s) creating %s\n"));
1753 #line 234 "../enum.c"
1754   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
1755 #line 93 "../reset.c"
1756   puts(_("%s error: The '%s' option requires an argument.\n"));
1757 #line 184 "../save.c"
1758   puts(_("error %d (%s) stat-ing %s\n"));
1759 #line 238 "../save.c"
1760   puts(_("error %d (%s) stat-ing %s\n"));
1761 #line 143 "../restore.c"
1762   puts(_("%s error: no saved option state\n"));
1763 #line 231 "../autoopts.c"
1764   puts(_("'%s' is not a command line option.\n"));
1765 #line 111 "../time.c"
1766   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
1767 #line 132 "../save.c"
1768   puts(_("'%s' not defined\n"));
1769 #line 50 "../time.c"
1770   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
1771 #line 92 "../check.c"
1772   puts(_("%s error:  The %s option must appear %d times.\n"));
1773 #line 164 "../numeric.c"
1774   puts(_("%s error:  '%s' is not a recognizable number.\n"));
1775 #line 200 "../enum.c"
1776   puts(_("%s error:  %s exceeds %s keyword count\n"));
1777 #line 330 "../usage.c"
1778   puts(_("Try '%s %s' for more information.\n"));
1779 #line 45 "../alias.c"
1780   puts(_("one %s%s option allowed\n"));
1781 #line 203 "../makeshell.c"
1782   puts(_("standard output"));
1783 #line 938 "../makeshell.c"
1784   puts(_("standard output"));
1785 #line 274 "../usage.c"
1786   puts(_("standard output"));
1787 #line 415 "../usage.c"
1788   puts(_("standard output"));
1789 #line 625 "../usage.c"
1790   puts(_("standard output"));
1791 #line 175 "../version.c"
1792   puts(_("standard output"));
1793 #line 274 "../usage.c"
1794   puts(_("standard error"));
1795 #line 415 "../usage.c"
1796   puts(_("standard error"));
1797 #line 625 "../usage.c"
1798   puts(_("standard error"));
1799 #line 175 "../version.c"
1800   puts(_("standard error"));
1801 #line 203 "../makeshell.c"
1802   puts(_("write"));
1803 #line 938 "../makeshell.c"
1804   puts(_("write"));
1805 #line 273 "../usage.c"
1806   puts(_("write"));
1807 #line 414 "../usage.c"
1808   puts(_("write"));
1809 #line 624 "../usage.c"
1810   puts(_("write"));
1811 #line 174 "../version.c"
1812   puts(_("write"));
1813 #line 60 "../numeric.c"
1814   puts(_("%s error:  %s option value %ld is out of range.\n"));
1815 #line 44 "../check.c"
1816   puts(_("%s error:  %s option requires the %s option\n"));
1817 #line 131 "../save.c"
1818   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1819 #line 183 "../save.c"
1820   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1821 #line 237 "../save.c"
1822   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1823 #line 256 "../save.c"
1824   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1825 #line 534 "../save.c"
1826   puts(_("%s warning:  cannot save options - %s not regular file\n"));
1827   /* END-LIBOPTS-MESSAGES */
1828 
1829   /* USAGE-TEXT: */
1830 #line 873 "../usage.c"
1831   puts(_("\t\t\t\t- an alternate for '%s'\n"));
1832 #line 1148 "../usage.c"
1833   puts(_("Version, usage and configuration options:"));
1834 #line 924 "../usage.c"
1835   puts(_("\t\t\t\t- default option for unnamed options\n"));
1836 #line 837 "../usage.c"
1837   puts(_("\t\t\t\t- disabled as '--%s'\n"));
1838 #line 1117 "../usage.c"
1839   puts(_(" --- %-14s %s\n"));
1840 #line 1115 "../usage.c"
1841   puts(_("This option has been disabled"));
1842 #line 864 "../usage.c"
1843   puts(_("\t\t\t\t- enabled by default\n"));
1844 #line 40 "../alias.c"
1845   puts(_("%s error:  only "));
1846 #line 1194 "../usage.c"
1847   puts(_(" - examining environment variables named %s_*\n"));
1848 #line 168 "../file.c"
1849   puts(_("\t\t\t\t- file must not pre-exist\n"));
1850 #line 172 "../file.c"
1851   puts(_("\t\t\t\t- file must pre-exist\n"));
1852 #line 380 "../usage.c"
1853   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
1854        "hyphen and the flag character.\n"));
1855 #line 916 "../makeshell.c"
1856   puts(_("\n"
1857        "= = = = = = = =\n\n"
1858        "This incarnation of genshell will produce\n"
1859        "a shell script to parse the options for %s:\n\n"));
1860 #line 166 "../enum.c"
1861   puts(_("  or an integer mask with any of the lower %d bits set\n"));
1862 #line 897 "../usage.c"
1863   puts(_("\t\t\t\t- is a set membership option\n"));
1864 #line 918 "../usage.c"
1865   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
1866 #line 382 "../usage.c"
1867   puts(_("Options are specified by single or double hyphens and their name.\n"));
1868 #line 904 "../usage.c"
1869   puts(_("\t\t\t\t- may appear multiple times\n"));
1870 #line 891 "../usage.c"
1871   puts(_("\t\t\t\t- may not be preset\n"));
1872 #line 1309 "../usage.c"
1873   puts(_("   Arg Option-Name    Description\n"));
1874 #line 1245 "../usage.c"
1875   puts(_("  Flg Arg Option-Name    Description\n"));
1876 #line 1303 "../usage.c"
1877   puts(_("  Flg Arg Option-Name    Description\n"));
1878 #line 1304 "../usage.c"
1879   puts(_(" %3s %s"));
1880 #line 1310 "../usage.c"
1881   puts(_(" %3s %s"));
1882 #line 387 "../usage.c"
1883   puts(_("The '-#<number>' option may omit the hash char\n"));
1884 #line 383 "../usage.c"
1885   puts(_("All arguments are named options.\n"));
1886 #line 971 "../usage.c"
1887   puts(_(" - reading file %s"));
1888 #line 409 "../usage.c"
1889   puts(_("\n"
1890        "Please send bug reports to:  <%s>\n"));
1891 #line 100 "../version.c"
1892   puts(_("\n"
1893        "Please send bug reports to:  <%s>\n"));
1894 #line 129 "../version.c"
1895   puts(_("\n"
1896        "Please send bug reports to:  <%s>\n"));
1897 #line 903 "../usage.c"
1898   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
1899 #line 944 "../usage.c"
1900   puts(_("\n"
1901        "The following option preset mechanisms are supported:\n"));
1902 #line 1192 "../usage.c"
1903   puts(_("\n"
1904        "The following option preset mechanisms are supported:\n"));
1905 #line 682 "../usage.c"
1906   puts(_("prohibits these options:\n"));
1907 #line 677 "../usage.c"
1908   puts(_("prohibits the option '%s'\n"));
1909 #line 81 "../numeric.c"
1910   puts(_("%s%ld to %ld"));
1911 #line 79 "../numeric.c"
1912   puts(_("%sgreater than or equal to %ld"));
1913 #line 75 "../numeric.c"
1914   puts(_("%s%ld exactly"));
1915 #line 68 "../numeric.c"
1916   puts(_("%sit must lie in one of the ranges:\n"));
1917 #line 68 "../numeric.c"
1918   puts(_("%sit must be in the range:\n"));
1919 #line 88 "../numeric.c"
1920   puts(_(", or\n"));
1921 #line 66 "../numeric.c"
1922   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
1923 #line 77 "../numeric.c"
1924   puts(_("%sless than or equal to %ld"));
1925 #line 390 "../usage.c"
1926   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
1927 #line 652 "../usage.c"
1928   puts(_("requires the option '%s'\n"));
1929 #line 655 "../usage.c"
1930   puts(_("requires these options:\n"));
1931 #line 1321 "../usage.c"
1932   puts(_("   Arg Option-Name   Req?  Description\n"));
1933 #line 1315 "../usage.c"
1934   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
1935 #line 167 "../enum.c"
1936   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
1937        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
1938        "will set them all.  Multiple entries may be passed as an option\n"
1939        "argument list.\n"));
1940 #line 910 "../usage.c"
1941   puts(_("\t\t\t\t- may appear up to %d times\n"));
1942 #line 77 "../enum.c"
1943   puts(_("The valid \"%s\" option keywords are:\n"));
1944 #line 1152 "../usage.c"
1945   puts(_("The next option supports vendor supported extra options:"));
1946 #line 773 "../usage.c"
1947   puts(_("These additional options are:"));
1948   /* END-USAGE-TEXT */
1949 }
1950 #endif /* uncompilable code */
1951 #ifdef  __cplusplus
1952 }
1953 #endif
1954 /* ntpd-opts.c ends here */
1955