1: /*
2: * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
3: *
4: * It has been AutoGen-ed December 24, 2011 at 06:34:40 PM by AutoGen 5.12
5: * From the definitions ntp-keygen-opts.def
6: * and the template file options
7: *
8: * Generated from AutoOpts 35:0:10 templates.
9: *
10: * AutoOpts is a copyrighted work. This header file is not encumbered
11: * by AutoOpts licensing, but is provided under the licensing terms chosen
12: * by the ntp-keygen 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: * This source file is copyrighted and licensed under the following terms:
19: *
20: * see html/copyright.html
21: *
22: */
23: /*
24: * This file contains the programmatic interface to the Automated
25: * Options generated for the ntp-keygen program.
26: * These macros are documented in the AutoGen info file in the
27: * "AutoOpts" chapter. Please refer to that doc for usage help.
28: */
29: #ifndef AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD
30: #define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD 1
31: #include "config.h"
32: #include <autoopts/options.h>
33:
34: /*
35: * Ensure that the library used for compiling this generated header is at
36: * least as new as the version current when the header template was released
37: * (not counting patch version increments). Also ensure that the oldest
38: * tolerable version is at least as old as what was current when the header
39: * template was released.
40: */
41: #define AO_TEMPLATE_VERSION 143360
42: #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
43: || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
44: # error option template version mismatches autoopts/options.h header
45: Choke Me.
46: #endif
47:
48: /*
49: * Enumeration of each option:
50: */
51: typedef enum {
52: INDEX_OPT_CERTIFICATE = 0,
53: INDEX_OPT_DEBUG_LEVEL = 1,
54: INDEX_OPT_SET_DEBUG_LEVEL = 2,
55: INDEX_OPT_ID_KEY = 3,
56: INDEX_OPT_GQ_PARAMS = 4,
57: INDEX_OPT_HOST_KEY = 5,
58: INDEX_OPT_IFFKEY = 6,
59: INDEX_OPT_ISSUER_NAME = 7,
60: INDEX_OPT_MD5KEY = 8,
61: INDEX_OPT_MODULUS = 9,
62: INDEX_OPT_PVT_CERT = 10,
63: INDEX_OPT_PVT_PASSWD = 11,
64: INDEX_OPT_GET_PVT_PASSWD = 12,
65: INDEX_OPT_SIGN_KEY = 13,
66: INDEX_OPT_SUBJECT_NAME = 14,
67: INDEX_OPT_TRUSTED_CERT = 15,
68: INDEX_OPT_MV_PARAMS = 16,
69: INDEX_OPT_MV_KEYS = 17,
70: INDEX_OPT_VERSION = 18,
71: INDEX_OPT_HELP = 19,
72: INDEX_OPT_MORE_HELP = 20,
73: INDEX_OPT_SAVE_OPTS = 21,
74: INDEX_OPT_LOAD_OPTS = 22
75: } teOptIndex;
76:
77: #define OPTION_CT 23
78: #define NTP_KEYGEN_VERSION "4.2.6p5"
79: #define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.6p5"
80:
81: /*
82: * Interface defines for all options. Replace "n" with the UPPER_CASED
83: * option name (as in the teOptIndex enumeration above).
84: * e.g. HAVE_OPT(CERTIFICATE)
85: */
86: #define DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n])
87: #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
88: #define OPT_ARG(n) (DESC(n).optArg.argString)
89: #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
90: #define COUNT_OPT(n) (DESC(n).optOccCt)
91: #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
92: #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
93: #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
94: #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
95: #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
96: #define CLEAR_OPT(n) STMTS( \
97: DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
98: if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
99: DESC(n).fOptState |= OPTST_DISABLED; \
100: DESC(n).optCookie = NULL )
101:
102: /* * * * * *
103: *
104: * Enumeration of ntp-keygen exit codes
105: */
106: typedef enum {
107: NTP_KEYGEN_EXIT_SUCCESS = 0,
108: NTP_KEYGEN_EXIT_FAILURE = 1
109: } ntp_keygen_exit_code_t;
110: /*
111: * Make sure there are no #define name conflicts with the option names
112: */
113: #ifndef NO_OPTION_NAME_WARNINGS
114: # ifdef CERTIFICATE
115: # warning undefining CERTIFICATE due to option name conflict
116: # undef CERTIFICATE
117: # endif
118: # ifdef DEBUG_LEVEL
119: # warning undefining DEBUG_LEVEL due to option name conflict
120: # undef DEBUG_LEVEL
121: # endif
122: # ifdef SET_DEBUG_LEVEL
123: # warning undefining SET_DEBUG_LEVEL due to option name conflict
124: # undef SET_DEBUG_LEVEL
125: # endif
126: # ifdef ID_KEY
127: # warning undefining ID_KEY due to option name conflict
128: # undef ID_KEY
129: # endif
130: # ifdef GQ_PARAMS
131: # warning undefining GQ_PARAMS due to option name conflict
132: # undef GQ_PARAMS
133: # endif
134: # ifdef HOST_KEY
135: # warning undefining HOST_KEY due to option name conflict
136: # undef HOST_KEY
137: # endif
138: # ifdef IFFKEY
139: # warning undefining IFFKEY due to option name conflict
140: # undef IFFKEY
141: # endif
142: # ifdef ISSUER_NAME
143: # warning undefining ISSUER_NAME due to option name conflict
144: # undef ISSUER_NAME
145: # endif
146: # ifdef MD5KEY
147: # warning undefining MD5KEY due to option name conflict
148: # undef MD5KEY
149: # endif
150: # ifdef MODULUS
151: # warning undefining MODULUS due to option name conflict
152: # undef MODULUS
153: # endif
154: # ifdef PVT_CERT
155: # warning undefining PVT_CERT due to option name conflict
156: # undef PVT_CERT
157: # endif
158: # ifdef PVT_PASSWD
159: # warning undefining PVT_PASSWD due to option name conflict
160: # undef PVT_PASSWD
161: # endif
162: # ifdef GET_PVT_PASSWD
163: # warning undefining GET_PVT_PASSWD due to option name conflict
164: # undef GET_PVT_PASSWD
165: # endif
166: # ifdef SIGN_KEY
167: # warning undefining SIGN_KEY due to option name conflict
168: # undef SIGN_KEY
169: # endif
170: # ifdef SUBJECT_NAME
171: # warning undefining SUBJECT_NAME due to option name conflict
172: # undef SUBJECT_NAME
173: # endif
174: # ifdef TRUSTED_CERT
175: # warning undefining TRUSTED_CERT due to option name conflict
176: # undef TRUSTED_CERT
177: # endif
178: # ifdef MV_PARAMS
179: # warning undefining MV_PARAMS due to option name conflict
180: # undef MV_PARAMS
181: # endif
182: # ifdef MV_KEYS
183: # warning undefining MV_KEYS due to option name conflict
184: # undef MV_KEYS
185: # endif
186: #else /* NO_OPTION_NAME_WARNINGS */
187: # undef CERTIFICATE
188: # undef DEBUG_LEVEL
189: # undef SET_DEBUG_LEVEL
190: # undef ID_KEY
191: # undef GQ_PARAMS
192: # undef HOST_KEY
193: # undef IFFKEY
194: # undef ISSUER_NAME
195: # undef MD5KEY
196: # undef MODULUS
197: # undef PVT_CERT
198: # undef PVT_PASSWD
199: # undef GET_PVT_PASSWD
200: # undef SIGN_KEY
201: # undef SUBJECT_NAME
202: # undef TRUSTED_CERT
203: # undef MV_PARAMS
204: # undef MV_KEYS
205: #endif /* NO_OPTION_NAME_WARNINGS */
206:
207: /* * * * * *
208: *
209: * Interface defines for specific options.
210: */
211: #define VALUE_OPT_CERTIFICATE 'c'
212: #define VALUE_OPT_DEBUG_LEVEL 'd'
213: #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
214: #define VALUE_OPT_ID_KEY 'e'
215: #define VALUE_OPT_GQ_PARAMS 'G'
216: #define VALUE_OPT_HOST_KEY 'H'
217: #define VALUE_OPT_IFFKEY 'I'
218: #define VALUE_OPT_ISSUER_NAME 'i'
219: #define VALUE_OPT_MD5KEY 'M'
220: #define VALUE_OPT_MODULUS 'm'
221: #ifdef OPENSSL
222:
223: #define OPT_VALUE_MODULUS (DESC(MODULUS).optArg.argInt)
224: #endif /* OPENSSL */
225: #define VALUE_OPT_PVT_CERT 'P'
226: #define VALUE_OPT_PVT_PASSWD 'p'
227: #define VALUE_OPT_GET_PVT_PASSWD 'q'
228: #define VALUE_OPT_SIGN_KEY 'S'
229: #define VALUE_OPT_SUBJECT_NAME 's'
230: #define VALUE_OPT_TRUSTED_CERT 'T'
231: #define VALUE_OPT_MV_PARAMS 'V'
232: #ifdef OPENSSL
233:
234: #define OPT_VALUE_MV_PARAMS (DESC(MV_PARAMS).optArg.argInt)
235: #endif /* OPENSSL */
236: #define VALUE_OPT_MV_KEYS 'v'
237: #ifdef OPENSSL
238:
239: #define OPT_VALUE_MV_KEYS (DESC(MV_KEYS).optArg.argInt)
240: #endif /* OPENSSL */
241: #define VALUE_OPT_HELP '?'
242: #define VALUE_OPT_MORE_HELP '!'
243: #define VALUE_OPT_VERSION INDEX_OPT_VERSION
244: #define VALUE_OPT_SAVE_OPTS '>'
245: #define VALUE_OPT_LOAD_OPTS '<'
246: #define SET_OPT_SAVE_OPTS(a) STMTS( \
247: DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
248: DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
249: DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
250: /*
251: * Interface defines not associated with particular options
252: */
253: #define ERRSKIP_OPTERR STMTS(ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP)
254: #define ERRSTOP_OPTERR STMTS(ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP)
255: #define RESTART_OPT(n) STMTS( \
256: ntp_keygenOptions.curOptIdx = (n); \
257: ntp_keygenOptions.pzCurOpt = NULL)
258: #define START_OPT RESTART_OPT(1)
259: #define USAGE(c) (*ntp_keygenOptions.pUsageProc)(&ntp_keygenOptions, c)
260: /* extracted from opthead.tlib near line 451 */
261:
262: #ifdef __cplusplus
263: extern "C" {
264: #endif
265:
266: /* * * * * *
267: *
268: * Declare the ntp-keygen option descriptor.
269: */
270: extern tOptions ntp_keygenOptions;
271:
272: #if defined(ENABLE_NLS)
273: # ifndef _
274: # include <stdio.h>
275: static inline char* aoGetsText(char const* pz) {
276: if (pz == NULL) return NULL;
277: return (char*)gettext(pz);
278: }
279: # define _(s) aoGetsText(s)
280: # endif /* _() */
281:
282: # define OPT_NO_XLAT_CFG_NAMES STMTS(ntp_keygenOptions.fOptSet |= \
283: OPTPROC_NXLAT_OPT_CFG;)
284: # define OPT_NO_XLAT_OPT_NAMES STMTS(ntp_keygenOptions.fOptSet |= \
285: OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
286:
287: # define OPT_XLAT_CFG_NAMES STMTS(ntp_keygenOptions.fOptSet &= \
288: ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
289: # define OPT_XLAT_OPT_NAMES STMTS(ntp_keygenOptions.fOptSet &= \
290: ~OPTPROC_NXLAT_OPT;)
291:
292: #else /* ENABLE_NLS */
293: # define OPT_NO_XLAT_CFG_NAMES
294: # define OPT_NO_XLAT_OPT_NAMES
295:
296: # define OPT_XLAT_CFG_NAMES
297: # define OPT_XLAT_OPT_NAMES
298:
299: # ifndef _
300: # define _(_s) _s
301: # endif
302: #endif /* ENABLE_NLS */
303:
304: #ifdef __cplusplus
305: }
306: #endif
307: #endif /* AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD */
308: /* ntp-keygen-opts.h ends here */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>