1
/* -*- buffer-read-only: t -*- vi: set ro:
3
* DO NOT EDIT THIS FILE (ntpd-opts.c)
5
* It has been AutoGen-ed Monday September 10, 2007 at 08:31:16 PM EDT
6
* From the definitions ntpd-opts.def
7
* and the template file options
9
* Generated from AutoOpts 29:0:4 templates.
13
* This file was produced by an AutoOpts template. AutoOpts is a
14
* copyrighted work. This source file is not encumbered by AutoOpts
15
* licensing, but is provided under the licensing terms chosen by the
16
* ntpd author or copyright holder. AutoOpts is licensed under
17
* the terms of the LGPL. The redistributable library (``libopts'') is
18
* licensed under the terms of either the LGPL or, at the users discretion,
19
* the BSD license. See the AutoOpts and/or libopts sources for details.
21
* This source file is copyrighted and licensed under the following terms:
23
* ntpd copyright 1970-2007 David L. Mills and/or others - all rights reserved
25
* see html/copyright.html
31
#define OPTION_CODE_COMPILE 1
32
#include "ntpd-opts.h"
38
"ntpd copyright (c) 1970-2007 David L. Mills and/or others, all rights reserved";
39
tSCC zCopyrightNotice[] =
41
/* extracted from ../include/copyright.def near line 8 */
42
"see html/copyright.html";
43
extern tUsageProc optionUsage;
46
* global included definitions
49
extern int atoi(const char*);
58
# define EXIT_SUCCESS 0
61
# define EXIT_FAILURE 1
64
* Ipv4 option description:
67
"Force IPv4 DNS name resolution";
68
tSCC zIpv4_NAME[] = "IPV4";
69
tSCC zIpv4_Name[] = "ipv4";
70
#define IPV4_FLAGS (OPTST_DISABLED)
73
* Ipv6 option description:
76
"Force IPv6 DNS name resolution";
77
tSCC zIpv6_NAME[] = "IPV6";
78
tSCC zIpv6_Name[] = "ipv6";
79
#define IPV6_FLAGS (OPTST_DISABLED)
82
* Authreq option description with
83
* "Must also have options" and "Incompatible options":
86
"Require crypto authentication";
87
tSCC zAuthreq_NAME[] = "AUTHREQ";
88
tSCC zAuthreq_Name[] = "authreq";
90
aAuthreqCantList[] = {
91
INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT };
92
#define AUTHREQ_FLAGS (OPTST_DISABLED)
95
* Authnoreq option description with
96
* "Must also have options" and "Incompatible options":
98
tSCC zAuthnoreqText[] =
99
"Do not require crypto authentication";
100
tSCC zAuthnoreq_NAME[] = "AUTHNOREQ";
101
tSCC zAuthnoreq_Name[] = "authnoreq";
103
aAuthnoreqCantList[] = {
104
INDEX_OPT_AUTHREQ, NO_EQUIVALENT };
105
#define AUTHNOREQ_FLAGS (OPTST_DISABLED)
108
* Bcastsync option description:
110
tSCC zBcastsyncText[] =
111
"Allow us to sync to broadcast servers";
112
tSCC zBcastsync_NAME[] = "BCASTSYNC";
113
tSCC zBcastsync_Name[] = "bcastsync";
114
#define BCASTSYNC_FLAGS (OPTST_DISABLED)
117
* Configfile option description:
119
tSCC zConfigfileText[] =
120
"configuration file name";
121
tSCC zConfigfile_NAME[] = "CONFIGFILE";
122
tSCC zConfigfile_Name[] = "configfile";
123
#define CONFIGFILE_FLAGS (OPTST_DISABLED \
124
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
127
* Debug_Level option description:
130
tSCC zDebug_LevelText[] =
131
"Increase output debug message level";
132
tSCC zDebug_Level_NAME[] = "DEBUG_LEVEL";
133
tSCC zDebug_Level_Name[] = "debug-level";
134
#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
136
#else /* disable Debug_Level */
137
#define VALUE_OPT_DEBUG_LEVEL NO_EQUIVALENT
138
#define DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
139
#define zDebug_LevelText NULL
140
#define zDebug_Level_NAME NULL
141
#define zDebug_Level_Name NULL
145
* Set_Debug_Level option description:
148
tSCC zSet_Debug_LevelText[] =
149
"Set the output debug message level";
150
tSCC zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL";
151
tSCC zSet_Debug_Level_Name[] = "set-debug-level";
152
#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
153
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
155
#else /* disable Set_Debug_Level */
156
#define VALUE_OPT_SET_DEBUG_LEVEL NO_EQUIVALENT
157
#define SET_DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
158
#define zSet_Debug_LevelText NULL
159
#define zSet_Debug_Level_NAME NULL
160
#define zSet_Debug_Level_Name NULL
164
* Driftfile option description:
166
tSCC zDriftfileText[] =
167
"frequency drift file name";
168
tSCC zDriftfile_NAME[] = "DRIFTFILE";
169
tSCC zDriftfile_Name[] = "driftfile";
170
#define DRIFTFILE_FLAGS (OPTST_DISABLED \
171
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
174
* Panicgate option description:
176
tSCC zPanicgateText[] =
177
"Allow the first adjustment to be Big";
178
tSCC zPanicgate_NAME[] = "PANICGATE";
179
tSCC zPanicgate_Name[] = "panicgate";
180
#define PANICGATE_FLAGS (OPTST_DISABLED)
183
* Jaildir option description:
185
tSCC zJaildirText[] =
187
tSCC zJaildir_NAME[] = "JAILDIR";
188
tSCC zJaildir_Name[] = "jaildir";
189
#define JAILDIR_FLAGS (OPTST_DISABLED \
190
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
193
* Interface option description:
195
tSCC zInterfaceText[] =
196
"Listen on interface";
197
tSCC zInterface_NAME[] = "INTERFACE";
198
tSCC zInterface_Name[] = "interface";
199
#define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \
200
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
203
* Keyfile option description:
205
tSCC zKeyfileText[] =
206
"path to symmetric keys";
207
tSCC zKeyfile_NAME[] = "KEYFILE";
208
tSCC zKeyfile_Name[] = "keyfile";
209
#define KEYFILE_FLAGS (OPTST_DISABLED \
210
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
213
* Logfile option description:
215
tSCC zLogfileText[] =
216
"path to the log file";
217
tSCC zLogfile_NAME[] = "LOGFILE";
218
tSCC zLogfile_Name[] = "logfile";
219
#define LOGFILE_FLAGS (OPTST_DISABLED \
220
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
223
* Novirtualips option description:
225
tSCC zNovirtualipsText[] =
226
"Do not listen to virtual IPs";
227
tSCC zNovirtualips_NAME[] = "NOVIRTUALIPS";
228
tSCC zNovirtualips_Name[] = "novirtualips";
229
#define NOVIRTUALIPS_FLAGS (OPTST_DISABLED)
232
* Modifymmtimer option description:
235
tSCC zModifymmtimerText[] =
236
"Modify Multimedia Timer (Windows only)";
237
tSCC zModifymmtimer_NAME[] = "MODIFYMMTIMER";
238
tSCC zModifymmtimer_Name[] = "modifymmtimer";
239
#define MODIFYMMTIMER_FLAGS (OPTST_DISABLED)
241
#else /* disable Modifymmtimer */
242
#define VALUE_OPT_MODIFYMMTIMER NO_EQUIVALENT
243
#define MODIFYMMTIMER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
244
#define zModifymmtimerText NULL
245
#define zModifymmtimer_NAME NULL
246
#define zModifymmtimer_Name NULL
247
#endif /* SYS_WINNT */
250
* Nofork option description:
254
tSCC zNofork_NAME[] = "NOFORK";
255
tSCC zNofork_Name[] = "nofork";
256
#define NOFORK_FLAGS (OPTST_DISABLED)
259
* Nice option description:
262
"Run at high priority";
263
tSCC zNice_NAME[] = "NICE";
264
tSCC zNice_Name[] = "nice";
265
#define NICE_FLAGS (OPTST_DISABLED)
268
* Pidfile option description:
270
tSCC zPidfileText[] =
271
"path to the PID file";
272
tSCC zPidfile_NAME[] = "PIDFILE";
273
tSCC zPidfile_Name[] = "pidfile";
274
#define PIDFILE_FLAGS (OPTST_DISABLED \
275
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
278
* Priority option description:
280
tSCC zPriorityText[] =
282
tSCC zPriority_NAME[] = "PRIORITY";
283
tSCC zPriority_Name[] = "priority";
284
#define PRIORITY_FLAGS (OPTST_DISABLED \
285
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
288
* Quit option description:
291
"Set the time and quit";
292
tSCC zQuit_NAME[] = "QUIT";
293
tSCC zQuit_Name[] = "quit";
294
#define QUIT_FLAGS (OPTST_DISABLED)
297
* Propagationdelay option description:
299
tSCC zPropagationdelayText[] =
300
"Broadcast/propagation delay";
301
tSCC zPropagationdelay_NAME[] = "PROPAGATIONDELAY";
302
tSCC zPropagationdelay_Name[] = "propagationdelay";
303
#define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \
304
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
307
* Updateinterval option description:
309
tSCC zUpdateintervalText[] =
310
"interval in seconds between scans for new or dropped interfaces";
311
tSCC zUpdateinterval_NAME[] = "UPDATEINTERVAL";
312
tSCC zUpdateinterval_Name[] = "updateinterval";
313
#define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \
314
| OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
317
* Statsdir option description:
319
tSCC zStatsdirText[] =
320
"Statistics file location";
321
tSCC zStatsdir_NAME[] = "STATSDIR";
322
tSCC zStatsdir_Name[] = "statsdir";
323
#define STATSDIR_FLAGS (OPTST_DISABLED \
324
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
327
* Trustedkey option description:
329
tSCC zTrustedkeyText[] =
330
"Trusted key number";
331
tSCC zTrustedkey_NAME[] = "TRUSTEDKEY";
332
tSCC zTrustedkey_Name[] = "trustedkey";
333
#define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \
334
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
337
* User option description:
340
"Run as userid (or userid:groupid)";
341
tSCC zUser_NAME[] = "USER";
342
tSCC zUser_Name[] = "user";
343
#define USER_FLAGS (OPTST_DISABLED \
344
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
347
* Var option description:
350
"make ARG an ntp variable (RW)";
351
tSCC zVar_NAME[] = "VAR";
352
tSCC zVar_Name[] = "var";
353
#define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
354
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
357
* Dvar option description:
360
"make ARG an ntp variable (RW|DEF)";
361
tSCC zDvar_NAME[] = "DVAR";
362
tSCC zDvar_Name[] = "dvar";
363
#define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
364
| OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
367
* Slew option description:
370
"Slew up to 600 seconds";
371
tSCC zSlew_NAME[] = "SLEW";
372
tSCC zSlew_Name[] = "slew";
373
#define SLEW_FLAGS (OPTST_DISABLED)
376
* Help/More_Help/Version option descriptions:
378
tSCC zHelpText[] = "Display usage information and exit";
379
tSCC zHelp_Name[] = "help";
381
tSCC zMore_HelpText[] = "Extended usage information passed thru pager";
382
tSCC zMore_Help_Name[] = "more-help";
384
tSCC zVersionText[] = "Output version information and exit";
385
tSCC zVersion_Name[] = "version";
387
* Declare option callback procedures
390
static tOptProc doOptSet_Debug_Level;
391
#else /* not DEBUG */
392
# define doOptSet_Debug_Level NULL
393
#endif /* def/not DEBUG */
394
#if defined(TEST_NTPD_OPTS)
396
* Under test, omit argument processing, or call optionStackArg,
397
* if multiple copies are allowed.
400
optionNumericVal, optionPagedUsage, optionStackArg,
406
* #define map the "normal" callout procs to the test ones...
408
#define SET_DEBUG_LEVEL_OPT_PROC optionStackArg
411
#else /* NOT defined TEST_NTPD_OPTS */
413
* When not under test, there are different procs to use
416
optionNumericVal, optionPagedUsage, optionPrintVersion, optionStackArg;
421
* #define map the "normal" callout procs
423
#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level
425
#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level
426
#endif /* defined(TEST_NTPD_OPTS) */
427
#ifdef TEST_NTPD_OPTS
428
# define DOVERPROC optionVersionStderr
430
# define DOVERPROC optionPrintVersion
431
#endif /* TEST_NTPD_OPTS */
433
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
435
* Define the Ntpd Option Descriptions.
437
static tOptDesc optDesc[ OPTION_CT ] = {
438
{ /* entry idx, value */ 0, VALUE_OPT_IPV4,
439
/* equiv idx, value */ NO_EQUIVALENT, 0,
440
/* equivalenced to */ NO_EQUIVALENT,
441
/* min, max, act ct */ 0, 1, 0,
442
/* opt state flags */ IPV4_FLAGS, 0,
443
/* last opt argumnt */ { NULL },
444
/* arg list/cookie */ NULL,
445
/* must/cannot opts */ NULL, NULL,
446
/* option proc */ NULL,
447
/* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name,
448
/* disablement strs */ NULL, NULL },
450
{ /* entry idx, value */ 1, VALUE_OPT_IPV6,
451
/* equiv idx, value */ NOLIMIT, NOLIMIT,
452
/* equivalenced to */ INDEX_OPT_IPV4,
453
/* min, max, act ct */ 0, 1, 0,
454
/* opt state flags */ IPV6_FLAGS, 0,
455
/* last opt argumnt */ { NULL },
456
/* arg list/cookie */ NULL,
457
/* must/cannot opts */ NULL, NULL,
458
/* option proc */ NULL,
459
/* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name,
460
/* disablement strs */ NULL, NULL },
462
{ /* entry idx, value */ 2, VALUE_OPT_AUTHREQ,
463
/* equiv idx, value */ 2, VALUE_OPT_AUTHREQ,
464
/* equivalenced to */ NO_EQUIVALENT,
465
/* min, max, act ct */ 0, 1, 0,
466
/* opt state flags */ AUTHREQ_FLAGS, 0,
467
/* last opt argumnt */ { NULL },
468
/* arg list/cookie */ NULL,
469
/* must/cannot opts */ NULL, aAuthreqCantList,
470
/* option proc */ NULL,
471
/* desc, NAME, name */ zAuthreqText, zAuthreq_NAME, zAuthreq_Name,
472
/* disablement strs */ NULL, NULL },
474
{ /* entry idx, value */ 3, VALUE_OPT_AUTHNOREQ,
475
/* equiv idx, value */ 3, VALUE_OPT_AUTHNOREQ,
476
/* equivalenced to */ NO_EQUIVALENT,
477
/* min, max, act ct */ 0, 1, 0,
478
/* opt state flags */ AUTHNOREQ_FLAGS, 0,
479
/* last opt argumnt */ { NULL },
480
/* arg list/cookie */ NULL,
481
/* must/cannot opts */ NULL, aAuthnoreqCantList,
482
/* option proc */ NULL,
483
/* desc, NAME, name */ zAuthnoreqText, zAuthnoreq_NAME, zAuthnoreq_Name,
484
/* disablement strs */ NULL, NULL },
486
{ /* entry idx, value */ 4, VALUE_OPT_BCASTSYNC,
487
/* equiv idx, value */ 4, VALUE_OPT_BCASTSYNC,
488
/* equivalenced to */ NO_EQUIVALENT,
489
/* min, max, act ct */ 0, 1, 0,
490
/* opt state flags */ BCASTSYNC_FLAGS, 0,
491
/* last opt argumnt */ { NULL },
492
/* arg list/cookie */ NULL,
493
/* must/cannot opts */ NULL, NULL,
494
/* option proc */ NULL,
495
/* desc, NAME, name */ zBcastsyncText, zBcastsync_NAME, zBcastsync_Name,
496
/* disablement strs */ NULL, NULL },
498
{ /* entry idx, value */ 5, VALUE_OPT_CONFIGFILE,
499
/* equiv idx, value */ 5, VALUE_OPT_CONFIGFILE,
500
/* equivalenced to */ NO_EQUIVALENT,
501
/* min, max, act ct */ 0, 1, 0,
502
/* opt state flags */ CONFIGFILE_FLAGS, 0,
503
/* last opt argumnt */ { NULL },
504
/* arg list/cookie */ NULL,
505
/* must/cannot opts */ NULL, NULL,
506
/* option proc */ NULL,
507
/* desc, NAME, name */ zConfigfileText, zConfigfile_NAME, zConfigfile_Name,
508
/* disablement strs */ NULL, NULL },
510
{ /* entry idx, value */ 6, VALUE_OPT_DEBUG_LEVEL,
511
/* equiv idx, value */ 6, VALUE_OPT_DEBUG_LEVEL,
512
/* equivalenced to */ NO_EQUIVALENT,
513
/* min, max, act ct */ 0, NOLIMIT, 0,
514
/* opt state flags */ DEBUG_LEVEL_FLAGS, 0,
515
/* last opt argumnt */ { NULL },
516
/* arg list/cookie */ NULL,
517
/* must/cannot opts */ NULL, NULL,
518
/* option proc */ NULL,
519
/* desc, NAME, name */ zDebug_LevelText, zDebug_Level_NAME, zDebug_Level_Name,
520
/* disablement strs */ NULL, NULL },
522
{ /* entry idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL,
523
/* equiv idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL,
524
/* equivalenced to */ NO_EQUIVALENT,
525
/* min, max, act ct */ 0, NOLIMIT, 0,
526
/* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0,
527
/* last opt argumnt */ { NULL },
528
/* arg list/cookie */ NULL,
529
/* must/cannot opts */ NULL, NULL,
530
/* option proc */ SET_DEBUG_LEVEL_OPT_PROC,
531
/* desc, NAME, name */ zSet_Debug_LevelText, zSet_Debug_Level_NAME, zSet_Debug_Level_Name,
532
/* disablement strs */ NULL, NULL },
534
{ /* entry idx, value */ 8, VALUE_OPT_DRIFTFILE,
535
/* equiv idx, value */ 8, VALUE_OPT_DRIFTFILE,
536
/* equivalenced to */ NO_EQUIVALENT,
537
/* min, max, act ct */ 0, 1, 0,
538
/* opt state flags */ DRIFTFILE_FLAGS, 0,
539
/* last opt argumnt */ { NULL },
540
/* arg list/cookie */ NULL,
541
/* must/cannot opts */ NULL, NULL,
542
/* option proc */ NULL,
543
/* desc, NAME, name */ zDriftfileText, zDriftfile_NAME, zDriftfile_Name,
544
/* disablement strs */ NULL, NULL },
546
{ /* entry idx, value */ 9, VALUE_OPT_PANICGATE,
547
/* equiv idx, value */ 9, VALUE_OPT_PANICGATE,
548
/* equivalenced to */ NO_EQUIVALENT,
549
/* min, max, act ct */ 0, 1, 0,
550
/* opt state flags */ PANICGATE_FLAGS, 0,
551
/* last opt argumnt */ { NULL },
552
/* arg list/cookie */ NULL,
553
/* must/cannot opts */ NULL, NULL,
554
/* option proc */ NULL,
555
/* desc, NAME, name */ zPanicgateText, zPanicgate_NAME, zPanicgate_Name,
556
/* disablement strs */ NULL, NULL },
558
{ /* entry idx, value */ 10, VALUE_OPT_JAILDIR,
559
/* equiv idx, value */ 10, VALUE_OPT_JAILDIR,
560
/* equivalenced to */ NO_EQUIVALENT,
561
/* min, max, act ct */ 0, 1, 0,
562
/* opt state flags */ JAILDIR_FLAGS, 0,
563
/* last opt argumnt */ { NULL },
564
/* arg list/cookie */ NULL,
565
/* must/cannot opts */ NULL, NULL,
566
/* option proc */ NULL,
567
/* desc, NAME, name */ zJaildirText, zJaildir_NAME, zJaildir_Name,
568
/* disablement strs */ NULL, NULL },
570
{ /* entry idx, value */ 11, VALUE_OPT_INTERFACE,
571
/* equiv idx, value */ 11, VALUE_OPT_INTERFACE,
572
/* equivalenced to */ NO_EQUIVALENT,
573
/* min, max, act ct */ 0, NOLIMIT, 0,
574
/* opt state flags */ INTERFACE_FLAGS, 0,
575
/* last opt argumnt */ { NULL },
576
/* arg list/cookie */ NULL,
577
/* must/cannot opts */ NULL, NULL,
578
/* option proc */ optionStackArg,
579
/* desc, NAME, name */ zInterfaceText, zInterface_NAME, zInterface_Name,
580
/* disablement strs */ NULL, NULL },
582
{ /* entry idx, value */ 12, VALUE_OPT_KEYFILE,
583
/* equiv idx, value */ 12, VALUE_OPT_KEYFILE,
584
/* equivalenced to */ NO_EQUIVALENT,
585
/* min, max, act ct */ 0, 1, 0,
586
/* opt state flags */ KEYFILE_FLAGS, 0,
587
/* last opt argumnt */ { NULL },
588
/* arg list/cookie */ NULL,
589
/* must/cannot opts */ NULL, NULL,
590
/* option proc */ NULL,
591
/* desc, NAME, name */ zKeyfileText, zKeyfile_NAME, zKeyfile_Name,
592
/* disablement strs */ NULL, NULL },
594
{ /* entry idx, value */ 13, VALUE_OPT_LOGFILE,
595
/* equiv idx, value */ 13, VALUE_OPT_LOGFILE,
596
/* equivalenced to */ NO_EQUIVALENT,
597
/* min, max, act ct */ 0, 1, 0,
598
/* opt state flags */ LOGFILE_FLAGS, 0,
599
/* last opt argumnt */ { NULL },
600
/* arg list/cookie */ NULL,
601
/* must/cannot opts */ NULL, NULL,
602
/* option proc */ NULL,
603
/* desc, NAME, name */ zLogfileText, zLogfile_NAME, zLogfile_Name,
604
/* disablement strs */ NULL, NULL },
606
{ /* entry idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
607
/* equiv idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
608
/* equivalenced to */ NO_EQUIVALENT,
609
/* min, max, act ct */ 0, 1, 0,
610
/* opt state flags */ NOVIRTUALIPS_FLAGS, 0,
611
/* last opt argumnt */ { NULL },
612
/* arg list/cookie */ NULL,
613
/* must/cannot opts */ NULL, NULL,
614
/* option proc */ NULL,
615
/* desc, NAME, name */ zNovirtualipsText, zNovirtualips_NAME, zNovirtualips_Name,
616
/* disablement strs */ NULL, NULL },
618
{ /* entry idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
619
/* equiv idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
620
/* equivalenced to */ NO_EQUIVALENT,
621
/* min, max, act ct */ 0, 1, 0,
622
/* opt state flags */ MODIFYMMTIMER_FLAGS, 0,
623
/* last opt argumnt */ { NULL },
624
/* arg list/cookie */ NULL,
625
/* must/cannot opts */ NULL, NULL,
626
/* option proc */ NULL,
627
/* desc, NAME, name */ zModifymmtimerText, zModifymmtimer_NAME, zModifymmtimer_Name,
628
/* disablement strs */ NULL, NULL },
630
{ /* entry idx, value */ 16, VALUE_OPT_NOFORK,
631
/* equiv idx, value */ 16, VALUE_OPT_NOFORK,
632
/* equivalenced to */ NO_EQUIVALENT,
633
/* min, max, act ct */ 0, 1, 0,
634
/* opt state flags */ NOFORK_FLAGS, 0,
635
/* last opt argumnt */ { NULL },
636
/* arg list/cookie */ NULL,
637
/* must/cannot opts */ NULL, NULL,
638
/* option proc */ NULL,
639
/* desc, NAME, name */ zNoforkText, zNofork_NAME, zNofork_Name,
640
/* disablement strs */ NULL, NULL },
642
{ /* entry idx, value */ 17, VALUE_OPT_NICE,
643
/* equiv idx, value */ 17, VALUE_OPT_NICE,
644
/* equivalenced to */ NO_EQUIVALENT,
645
/* min, max, act ct */ 0, 1, 0,
646
/* opt state flags */ NICE_FLAGS, 0,
647
/* last opt argumnt */ { NULL },
648
/* arg list/cookie */ NULL,
649
/* must/cannot opts */ NULL, NULL,
650
/* option proc */ NULL,
651
/* desc, NAME, name */ zNiceText, zNice_NAME, zNice_Name,
652
/* disablement strs */ NULL, NULL },
654
{ /* entry idx, value */ 18, VALUE_OPT_PIDFILE,
655
/* equiv idx, value */ 18, VALUE_OPT_PIDFILE,
656
/* equivalenced to */ NO_EQUIVALENT,
657
/* min, max, act ct */ 0, 1, 0,
658
/* opt state flags */ PIDFILE_FLAGS, 0,
659
/* last opt argumnt */ { NULL },
660
/* arg list/cookie */ NULL,
661
/* must/cannot opts */ NULL, NULL,
662
/* option proc */ NULL,
663
/* desc, NAME, name */ zPidfileText, zPidfile_NAME, zPidfile_Name,
664
/* disablement strs */ NULL, NULL },
666
{ /* entry idx, value */ 19, VALUE_OPT_PRIORITY,
667
/* equiv idx, value */ 19, VALUE_OPT_PRIORITY,
668
/* equivalenced to */ NO_EQUIVALENT,
669
/* min, max, act ct */ 0, 1, 0,
670
/* opt state flags */ PRIORITY_FLAGS, 0,
671
/* last opt argumnt */ { NULL },
672
/* arg list/cookie */ NULL,
673
/* must/cannot opts */ NULL, NULL,
674
/* option proc */ optionNumericVal,
675
/* desc, NAME, name */ zPriorityText, zPriority_NAME, zPriority_Name,
676
/* disablement strs */ NULL, NULL },
678
{ /* entry idx, value */ 20, VALUE_OPT_QUIT,
679
/* equiv idx, value */ 20, VALUE_OPT_QUIT,
680
/* equivalenced to */ NO_EQUIVALENT,
681
/* min, max, act ct */ 0, 1, 0,
682
/* opt state flags */ QUIT_FLAGS, 0,
683
/* last opt argumnt */ { NULL },
684
/* arg list/cookie */ NULL,
685
/* must/cannot opts */ NULL, NULL,
686
/* option proc */ NULL,
687
/* desc, NAME, name */ zQuitText, zQuit_NAME, zQuit_Name,
688
/* disablement strs */ NULL, NULL },
690
{ /* entry idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
691
/* equiv idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
692
/* equivalenced to */ NO_EQUIVALENT,
693
/* min, max, act ct */ 0, 1, 0,
694
/* opt state flags */ PROPAGATIONDELAY_FLAGS, 0,
695
/* last opt argumnt */ { NULL },
696
/* arg list/cookie */ NULL,
697
/* must/cannot opts */ NULL, NULL,
698
/* option proc */ NULL,
699
/* desc, NAME, name */ zPropagationdelayText, zPropagationdelay_NAME, zPropagationdelay_Name,
700
/* disablement strs */ NULL, NULL },
702
{ /* entry idx, value */ 22, VALUE_OPT_UPDATEINTERVAL,
703
/* equiv idx, value */ 22, VALUE_OPT_UPDATEINTERVAL,
704
/* equivalenced to */ NO_EQUIVALENT,
705
/* min, max, act ct */ 0, 1, 0,
706
/* opt state flags */ UPDATEINTERVAL_FLAGS, 0,
707
/* last opt argumnt */ { NULL },
708
/* arg list/cookie */ NULL,
709
/* must/cannot opts */ NULL, NULL,
710
/* option proc */ optionNumericVal,
711
/* desc, NAME, name */ zUpdateintervalText, zUpdateinterval_NAME, zUpdateinterval_Name,
712
/* disablement strs */ NULL, NULL },
714
{ /* entry idx, value */ 23, VALUE_OPT_STATSDIR,
715
/* equiv idx, value */ 23, VALUE_OPT_STATSDIR,
716
/* equivalenced to */ NO_EQUIVALENT,
717
/* min, max, act ct */ 0, 1, 0,
718
/* opt state flags */ STATSDIR_FLAGS, 0,
719
/* last opt argumnt */ { NULL },
720
/* arg list/cookie */ NULL,
721
/* must/cannot opts */ NULL, NULL,
722
/* option proc */ NULL,
723
/* desc, NAME, name */ zStatsdirText, zStatsdir_NAME, zStatsdir_Name,
724
/* disablement strs */ NULL, NULL },
726
{ /* entry idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
727
/* equiv idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
728
/* equivalenced to */ NO_EQUIVALENT,
729
/* min, max, act ct */ 0, NOLIMIT, 0,
730
/* opt state flags */ TRUSTEDKEY_FLAGS, 0,
731
/* last opt argumnt */ { NULL },
732
/* arg list/cookie */ NULL,
733
/* must/cannot opts */ NULL, NULL,
734
/* option proc */ optionStackArg,
735
/* desc, NAME, name */ zTrustedkeyText, zTrustedkey_NAME, zTrustedkey_Name,
736
/* disablement strs */ NULL, NULL },
738
{ /* entry idx, value */ 25, VALUE_OPT_USER,
739
/* equiv idx, value */ 25, VALUE_OPT_USER,
740
/* equivalenced to */ NO_EQUIVALENT,
741
/* min, max, act ct */ 0, 1, 0,
742
/* opt state flags */ USER_FLAGS, 0,
743
/* last opt argumnt */ { NULL },
744
/* arg list/cookie */ NULL,
745
/* must/cannot opts */ NULL, NULL,
746
/* option proc */ NULL,
747
/* desc, NAME, name */ zUserText, zUser_NAME, zUser_Name,
748
/* disablement strs */ NULL, NULL },
750
{ /* entry idx, value */ 26, VALUE_OPT_VAR,
751
/* equiv idx, value */ 26, VALUE_OPT_VAR,
752
/* equivalenced to */ NO_EQUIVALENT,
753
/* min, max, act ct */ 0, NOLIMIT, 0,
754
/* opt state flags */ VAR_FLAGS, 0,
755
/* last opt argumnt */ { NULL },
756
/* arg list/cookie */ NULL,
757
/* must/cannot opts */ NULL, NULL,
758
/* option proc */ optionStackArg,
759
/* desc, NAME, name */ zVarText, zVar_NAME, zVar_Name,
760
/* disablement strs */ NULL, NULL },
762
{ /* entry idx, value */ 27, VALUE_OPT_DVAR,
763
/* equiv idx, value */ 27, VALUE_OPT_DVAR,
764
/* equivalenced to */ NO_EQUIVALENT,
765
/* min, max, act ct */ 0, NOLIMIT, 0,
766
/* opt state flags */ DVAR_FLAGS, 0,
767
/* last opt argumnt */ { NULL },
768
/* arg list/cookie */ NULL,
769
/* must/cannot opts */ NULL, NULL,
770
/* option proc */ optionStackArg,
771
/* desc, NAME, name */ zDvarText, zDvar_NAME, zDvar_Name,
772
/* disablement strs */ NULL, NULL },
774
{ /* entry idx, value */ 28, VALUE_OPT_SLEW,
775
/* equiv idx, value */ 28, VALUE_OPT_SLEW,
776
/* equivalenced to */ NO_EQUIVALENT,
777
/* min, max, act ct */ 0, 1, 0,
778
/* opt state flags */ SLEW_FLAGS, 0,
779
/* last opt argumnt */ { NULL },
780
/* arg list/cookie */ NULL,
781
/* must/cannot opts */ NULL, NULL,
782
/* option proc */ NULL,
783
/* desc, NAME, name */ zSlewText, zSlew_NAME, zSlew_Name,
784
/* disablement strs */ NULL, NULL },
786
#ifdef NO_OPTIONAL_OPT_ARGS
787
# define VERSION_OPT_FLAGS OPTST_IMM | OPTST_NO_INIT
789
# define VERSION_OPT_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
790
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
793
{ /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
794
/* equiv idx value */ NO_EQUIVALENT, 0,
795
/* equivalenced to */ NO_EQUIVALENT,
796
/* min, max, act ct */ 0, 1, 0,
797
/* opt state flags */ VERSION_OPT_FLAGS, 0,
798
/* last opt argumnt */ { NULL },
799
/* arg list/cookie */ NULL,
800
/* must/cannot opts */ NULL, NULL,
801
/* option proc */ DOVERPROC,
802
/* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
803
/* disablement strs */ NULL, NULL },
805
#undef VERSION_OPT_FLAGS
808
{ /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
809
/* equiv idx value */ NO_EQUIVALENT, 0,
810
/* equivalenced to */ NO_EQUIVALENT,
811
/* min, max, act ct */ 0, 1, 0,
812
/* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
813
/* last opt argumnt */ { NULL },
814
/* arg list/cookie */ NULL,
815
/* must/cannot opts */ NULL, NULL,
816
/* option proc */ doUsageOpt,
817
/* desc, NAME, name */ zHelpText, NULL, zHelp_Name,
818
/* disablement strs */ NULL, NULL },
820
{ /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
821
/* equiv idx value */ NO_EQUIVALENT, 0,
822
/* equivalenced to */ NO_EQUIVALENT,
823
/* min, max, act ct */ 0, 1, 0,
824
/* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
825
/* last opt argumnt */ { NULL },
826
/* arg list/cookie */ NULL,
827
/* must/cannot opts */ NULL, NULL,
828
/* option proc */ optionPagedUsage,
829
/* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name,
830
/* disablement strs */ NULL, NULL }
833
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
835
* Define the Ntpd Option Environment
837
tSCC zPROGNAME[] = "NTPD";
839
"ntpd - NTP daemon program - Ver. 4.2.4p4\n\
840
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n";
842
#define apzHomeList NULL
844
tSCC zBugsAddr[] = "http://bugs.ntp.isc.org, bugs@ntp.org";
845
#define zExplain NULL
846
tSCC zDetail[] = "\n\n";
847
tSCC zFullVersion[] = NTPD_FULL_VERSION;
848
/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 408 */
850
#if defined(ENABLE_NLS)
851
# define OPTPROC_BASE OPTPROC_TRANSLATE
852
static tOptionXlateProc translate_option_strings;
854
# define OPTPROC_BASE OPTPROC_NONE
855
# define translate_option_strings NULL
856
#endif /* ENABLE_NLS */
858
tOptions ntpdOptions = {
859
OPTIONS_STRUCT_VERSION,
860
0, NULL, /* original argc + argv */
868
0, NULL, /* current option index, current option */
869
NULL, NULL, zPROGNAME,
870
zRcName, zCopyright, zCopyrightNotice,
871
zFullVersion, apzHomeList, zUsageTitle,
872
zExplain, zDetail, optDesc,
873
zBugsAddr, /* address to send bugs to */
874
NULL, NULL, /* extensions/saved state */
875
optionUsage, /* usage procedure */
876
translate_option_strings, /* translation procedure */
878
* Indexes to special options
880
{ INDEX_OPT_MORE_HELP,
881
0 /* no option state saving */,
882
NO_EQUIVALENT /* index of '-#' option */,
883
NO_EQUIVALENT /* index of default opt */
885
32 /* full option count */, 29 /* user option count */
889
* Create the static procedure(s) declared above.
896
USAGE( EXIT_SUCCESS );
899
#if ! defined(TEST_NTPD_OPTS)
903
* For the set-debug-level option, when DEBUG is #define-d.
907
doOptSet_Debug_Level(
911
/* extracted from ../include/debug-opt.def, line 29 */
912
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
914
#endif /* defined DEBUG */
916
#endif /* defined(TEST_NTPD_OPTS) */
918
/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 92 */
920
#if defined(TEST_NTPD_OPTS) /* TEST MAIN PROCEDURE: */
923
main( int argc, char** argv )
925
int res = EXIT_SUCCESS;
926
(void)optionProcess( &ntpdOptions, argc, argv );
928
void optionPutShell( tOptions* );
929
optionPutShell( &ntpdOptions );
933
#endif /* defined TEST_NTPD_OPTS */
934
/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 514 */
941
#include <autoopts/usage-txt.h>
943
static char* AO_gettext( char const* pz );
944
static void coerce_it(void** s);
947
AO_gettext( char const* pz )
955
pzRes = strdup( pzRes );
957
fputs( _("No memory for duping translated strings\n"), stderr );
958
exit( EXIT_FAILURE );
963
static void coerce_it(void** s) { *s = AO_gettext(*s); }
964
#define COERSION(_f) \
965
coerce_it((void*)&(ntpdOptions._f))
968
* This invokes the translation code (e.g. gettext(3)).
971
translate_option_strings( void )
974
* Guard against re-translation. It won't work. The strings will have
975
* been changed by the first pass through this code. One shot only.
977
if (option_usage_text.field_ct == 0)
980
* Do the translations. The first pointer follows the field count field.
981
* The field count field is the size of a pointer.
984
char** ppz = (char**)(void*)&(option_usage_text);
985
int ix = option_usage_text.field_ct;
989
*ppz = AO_gettext(*ppz);
992
option_usage_text.field_ct = 0;
995
tOptDesc* pOD = ntpdOptions.pOptDesc;
996
int ix = ntpdOptions.optCt;
999
pOD->pzText = AO_gettext(pOD->pzText);
1000
pOD->pz_NAME = AO_gettext(pOD->pz_NAME);
1001
pOD->pz_Name = AO_gettext(pOD->pz_Name);
1002
pOD->pz_DisableName = AO_gettext(pOD->pz_DisableName);
1003
pOD->pz_DisablePfx = AO_gettext(pOD->pz_DisablePfx);
1009
COERSION(pzCopyright);
1010
COERSION(pzCopyNotice);
1011
COERSION(pzFullVersion);
1012
COERSION(pzUsageTitle);
1013
COERSION(pzExplain);
1017
#endif /* ENABLE_NLS */
1022
/* ntpd-opts.c ends here */