1 /* $NetBSD: ntpd-opts.h,v 1.1.1.1 2009/12/13 16:56:16 kardel Exp $ */
4 * EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
6 * It has been AutoGen-ed December 10, 2009 at 04:56:47 AM by AutoGen 5.10
7 * From the definitions ntpd-opts.def
8 * and the template file options
10 * Generated from AutoOpts 33:0:8 templates.
14 * This file was produced by an AutoOpts template. AutoOpts is a
15 * copyrighted work. This header file is not encumbered by AutoOpts
16 * licensing, but is provided under the licensing terms chosen by the
17 * ntpd author or copyright holder. AutoOpts is licensed under
18 * the terms of the LGPL. The redistributable library (``libopts'') is
19 * licensed under the terms of either the LGPL or, at the users discretion,
20 * the BSD license. See the AutoOpts and/or libopts sources for details.
22 * This source file is copyrighted and licensed under the following terms:
24 * ntpd copyright (c) 1970-2009 David L. Mills and/or others - all rights reserved
26 * see html/copyright.html
29 * This file contains the programmatic interface to the Automated
30 * Options generated for the ntpd program.
31 * These macros are documented in the AutoGen info file in the
32 * "AutoOpts" chapter. Please refer to that doc for usage help.
34 #ifndef AUTOOPTS_NTPD_OPTS_H_GUARD
35 #define AUTOOPTS_NTPD_OPTS_H_GUARD 1
37 #include <autoopts/options.h>
40 * Ensure that the library used for compiling this generated header is at
41 * least as new as the version current when the header template was released
42 * (not counting patch version increments). Also ensure that the oldest
43 * tolerable version is at least as old as what was current when the header
44 * template was released.
46 #define AO_TEMPLATE_VERSION 135168
47 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
48 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
49 # error option template version mismatches autoopts/options.h header
54 * Enumeration of each option:
59 INDEX_OPT_AUTHREQ
= 2,
60 INDEX_OPT_AUTHNOREQ
= 3,
61 INDEX_OPT_BCASTSYNC
= 4,
62 INDEX_OPT_CONFIGFILE
= 5,
63 INDEX_OPT_DEBUG_LEVEL
= 6,
64 INDEX_OPT_SET_DEBUG_LEVEL
= 7,
65 INDEX_OPT_DRIFTFILE
= 8,
66 INDEX_OPT_PANICGATE
= 9,
67 INDEX_OPT_JAILDIR
= 10,
68 INDEX_OPT_INTERFACE
= 11,
69 INDEX_OPT_KEYFILE
= 12,
70 INDEX_OPT_LOGFILE
= 13,
71 INDEX_OPT_NOVIRTUALIPS
= 14,
72 INDEX_OPT_MODIFYMMTIMER
= 15,
73 INDEX_OPT_NOFORK
= 16,
75 INDEX_OPT_PIDFILE
= 18,
76 INDEX_OPT_PRIORITY
= 19,
78 INDEX_OPT_PROPAGATIONDELAY
= 21,
79 INDEX_OPT_SAVECONFIGQUIT
= 22,
80 INDEX_OPT_STATSDIR
= 23,
81 INDEX_OPT_TRUSTEDKEY
= 24,
83 INDEX_OPT_UPDATEINTERVAL
= 26,
87 INDEX_OPT_USEPCC
= 30,
88 INDEX_OPT_PCCFREQ
= 31,
89 INDEX_OPT_VERSION
= 32,
91 INDEX_OPT_MORE_HELP
= 34
95 #define NTPD_VERSION "4.2.6"
96 #define NTPD_FULL_VERSION "ntpd - NTP daemon program - Ver. 4.2.6"
99 * Interface defines for all options. Replace "n" with the UPPER_CASED
100 * option name (as in the teOptIndex enumeration above).
101 * e.g. HAVE_OPT( IPV4 )
103 #define DESC(n) (ntpdOptions.pOptDesc[INDEX_OPT_## n])
104 #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
105 #define OPT_ARG(n) (DESC(n).optArg.argString)
106 #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
107 #define COUNT_OPT(n) (DESC(n).optOccCt)
108 #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
109 #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
110 #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
111 #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
112 #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
113 #define CLEAR_OPT(n) STMTS( \
114 DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
115 if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
116 DESC(n).fOptState |= OPTST_DISABLED; \
117 DESC(n).optCookie = NULL )
120 * Make sure there are no #define name conflicts with the option names
122 #ifndef NO_OPTION_NAME_WARNINGS
124 # warning undefining IPV4 due to option name conflict
128 # warning undefining IPV6 due to option name conflict
132 # warning undefining AUTHREQ due to option name conflict
136 # warning undefining AUTHNOREQ due to option name conflict
140 # warning undefining BCASTSYNC due to option name conflict
144 # warning undefining CONFIGFILE due to option name conflict
148 # warning undefining DEBUG_LEVEL due to option name conflict
151 # ifdef SET_DEBUG_LEVEL
152 # warning undefining SET_DEBUG_LEVEL due to option name conflict
153 # undef SET_DEBUG_LEVEL
156 # warning undefining DRIFTFILE due to option name conflict
160 # warning undefining PANICGATE due to option name conflict
164 # warning undefining JAILDIR due to option name conflict
168 # warning undefining INTERFACE due to option name conflict
172 # warning undefining KEYFILE due to option name conflict
176 # warning undefining LOGFILE due to option name conflict
180 # warning undefining NOVIRTUALIPS due to option name conflict
183 # ifdef MODIFYMMTIMER
184 # warning undefining MODIFYMMTIMER due to option name conflict
185 # undef MODIFYMMTIMER
188 # warning undefining NOFORK due to option name conflict
192 # warning undefining NICE due to option name conflict
196 # warning undefining PIDFILE due to option name conflict
200 # warning undefining PRIORITY due to option name conflict
204 # warning undefining QUIT due to option name conflict
207 # ifdef PROPAGATIONDELAY
208 # warning undefining PROPAGATIONDELAY due to option name conflict
209 # undef PROPAGATIONDELAY
211 # ifdef SAVECONFIGQUIT
212 # warning undefining SAVECONFIGQUIT due to option name conflict
213 # undef SAVECONFIGQUIT
216 # warning undefining STATSDIR due to option name conflict
220 # warning undefining TRUSTEDKEY due to option name conflict
224 # warning undefining USER due to option name conflict
227 # ifdef UPDATEINTERVAL
228 # warning undefining UPDATEINTERVAL due to option name conflict
229 # undef UPDATEINTERVAL
232 # warning undefining VAR due to option name conflict
236 # warning undefining DVAR due to option name conflict
240 /* Defined in ntpsim.h!
242 # warning undefining SLEW due to option name conflict
248 # warning undefining USEPCC due to option name conflict
252 # warning undefining PCCFREQ due to option name conflict
255 #else /* NO_OPTION_NAME_WARNINGS */
263 # undef SET_DEBUG_LEVEL
271 # undef MODIFYMMTIMER
277 # undef PROPAGATIONDELAY
278 # undef SAVECONFIGQUIT
282 # undef UPDATEINTERVAL
288 #endif /* NO_OPTION_NAME_WARNINGS */
292 * Interface defines for specific options.
294 #define VALUE_OPT_IPV4 '4'
295 #define VALUE_OPT_IPV6 '6'
296 #define VALUE_OPT_AUTHREQ 'a'
297 #define VALUE_OPT_AUTHNOREQ 'A'
298 #define VALUE_OPT_BCASTSYNC 'b'
299 #define VALUE_OPT_CONFIGFILE 'c'
300 #define VALUE_OPT_DEBUG_LEVEL 'd'
301 #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
302 #define VALUE_OPT_DRIFTFILE 'f'
303 #define VALUE_OPT_PANICGATE 'g'
304 #define VALUE_OPT_JAILDIR 'i'
305 #define VALUE_OPT_INTERFACE 'I'
306 #define VALUE_OPT_KEYFILE 'k'
307 #define VALUE_OPT_LOGFILE 'l'
308 #define VALUE_OPT_NOVIRTUALIPS 'L'
309 #define VALUE_OPT_MODIFYMMTIMER 'M'
310 #define VALUE_OPT_NOFORK 'n'
311 #define VALUE_OPT_NICE 'N'
312 #define VALUE_OPT_PIDFILE 'p'
313 #define VALUE_OPT_PRIORITY 'P'
315 #define OPT_VALUE_PRIORITY (DESC(PRIORITY).optArg.argInt)
316 #define VALUE_OPT_QUIT 'q'
317 #define VALUE_OPT_PROPAGATIONDELAY 'r'
318 #define VALUE_OPT_SAVECONFIGQUIT 22
319 #define VALUE_OPT_STATSDIR 's'
320 #define VALUE_OPT_TRUSTEDKEY 't'
321 #define VALUE_OPT_USER 'u'
322 #define VALUE_OPT_UPDATEINTERVAL 'U'
324 #define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
325 #define VALUE_OPT_VAR 27
326 #define VALUE_OPT_DVAR 28
327 #define VALUE_OPT_SLEW 'x'
328 #define VALUE_OPT_USEPCC 30
329 #define VALUE_OPT_PCCFREQ 31
330 #define VALUE_OPT_HELP '?'
331 #define VALUE_OPT_MORE_HELP '!'
332 #define VALUE_OPT_VERSION INDEX_OPT_VERSION
334 * Interface defines not associated with particular options
336 #define ERRSKIP_OPTERR STMTS( ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP )
337 #define ERRSTOP_OPTERR STMTS( ntpdOptions.fOptSet |= OPTPROC_ERRSTOP )
338 #define RESTART_OPT(n) STMTS( \
339 ntpdOptions.curOptIdx = (n); \
340 ntpdOptions.pzCurOpt = NULL )
341 #define START_OPT RESTART_OPT(1)
342 #define USAGE(c) (*ntpdOptions.pUsageProc)( &ntpdOptions, c )
343 /* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */
347 * Declare the ntpd option descriptor.
353 extern tOptions ntpdOptions
;
355 #if defined(ENABLE_NLS)
358 static inline char* aoGetsText( char const* pz
) {
359 if (pz
== NULL
) return NULL
;
360 return (char*)gettext( pz
);
362 # define _(s) aoGetsText(s)
365 # define OPT_NO_XLAT_CFG_NAMES STMTS(ntpdOptions.fOptSet |= \
366 OPTPROC_NXLAT_OPT_CFG;)
367 # define OPT_NO_XLAT_OPT_NAMES STMTS(ntpdOptions.fOptSet |= \
368 OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
370 # define OPT_XLAT_CFG_NAMES STMTS(ntpdOptions.fOptSet &= \
371 ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
372 # define OPT_XLAT_OPT_NAMES STMTS(ntpdOptions.fOptSet &= \
375 #else /* ENABLE_NLS */
376 # define OPT_NO_XLAT_CFG_NAMES
377 # define OPT_NO_XLAT_OPT_NAMES
379 # define OPT_XLAT_CFG_NAMES
380 # define OPT_XLAT_OPT_NAMES
385 #endif /* ENABLE_NLS */
390 #endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
391 /* ntpd-opts.h ends here */