1181834Sroberto/* 2181834Sroberto * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h) 3181834Sroberto * 4200576Sroberto * It has been AutoGen-ed Tuesday December 8, 2009 at 08:14:55 AM EST 5181834Sroberto * From the definitions ntp-keygen-opts.def 6181834Sroberto * and the template file options 7181834Sroberto * 8181834Sroberto * Generated from AutoOpts 29:0:4 templates. 9181834Sroberto */ 10181834Sroberto 11181834Sroberto/* 12181834Sroberto * This file was produced by an AutoOpts template. AutoOpts is a 13181834Sroberto * copyrighted work. This header file is not encumbered by AutoOpts 14181834Sroberto * licensing, but is provided under the licensing terms chosen by the 15181834Sroberto * ntp-keygen author or copyright holder. AutoOpts is licensed under 16181834Sroberto * the terms of the LGPL. The redistributable library (``libopts'') is 17181834Sroberto * licensed under the terms of either the LGPL or, at the users discretion, 18181834Sroberto * the BSD license. See the AutoOpts and/or libopts sources for details. 19181834Sroberto * 20181834Sroberto * This source file is copyrighted and licensed under the following terms: 21181834Sroberto * 22200576Sroberto * ntp-keygen copyright 1970-2009 David L. Mills and/or others - all rights reserved 23181834Sroberto * 24181834Sroberto * see html/copyright.html 25181834Sroberto */ 26181834Sroberto/* 27181834Sroberto * This file contains the programmatic interface to the Automated 28181834Sroberto * Options generated for the ntp-keygen program. 29181834Sroberto * These macros are documented in the AutoGen info file in the 30181834Sroberto * "AutoOpts" chapter. Please refer to that doc for usage help. 31181834Sroberto */ 32181834Sroberto#ifndef AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD 33181834Sroberto#define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD 34181834Sroberto#include "config.h" 35181834Sroberto#include <autoopts/options.h> 36181834Sroberto 37181834Sroberto/* 38181834Sroberto * Ensure that the library used for compiling this generated header is at 39181834Sroberto * least as new as the version current when the header template was released 40181834Sroberto * (not counting patch version increments). Also ensure that the oldest 41181834Sroberto * tolerable version is at least as old as what was current when the header 42181834Sroberto * template was released. 43181834Sroberto */ 44181834Sroberto#define AO_TEMPLATE_VERSION 118784 45181834Sroberto#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ 46181834Sroberto || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) 47181834Sroberto# error option template version mismatches autoopts/options.h header 48181834Sroberto Choke Me. 49181834Sroberto#endif 50181834Sroberto 51181834Sroberto/* 52181834Sroberto * Enumeration of each option: 53181834Sroberto */ 54181834Srobertotypedef enum { 55181834Sroberto INDEX_OPT_CERTIFICATE = 0, 56181834Sroberto INDEX_OPT_DEBUG_LEVEL = 1, 57181834Sroberto INDEX_OPT_SET_DEBUG_LEVEL = 2, 58181834Sroberto INDEX_OPT_ID_KEY = 3, 59181834Sroberto INDEX_OPT_GQ_PARAMS = 4, 60181834Sroberto INDEX_OPT_GQ_KEYS = 5, 61181834Sroberto INDEX_OPT_HOST_KEY = 6, 62181834Sroberto INDEX_OPT_IFFKEY = 7, 63181834Sroberto INDEX_OPT_ISSUER_NAME = 8, 64181834Sroberto INDEX_OPT_MD5KEY = 9, 65181834Sroberto INDEX_OPT_MODULUS = 10, 66181834Sroberto INDEX_OPT_PVT_CERT = 11, 67181834Sroberto INDEX_OPT_PVT_PASSWD = 12, 68181834Sroberto INDEX_OPT_GET_PVT_PASSWD = 13, 69181834Sroberto INDEX_OPT_SIGN_KEY = 14, 70181834Sroberto INDEX_OPT_SUBJECT_NAME = 15, 71181834Sroberto INDEX_OPT_TRUSTED_CERT = 16, 72181834Sroberto INDEX_OPT_MV_PARAMS = 17, 73181834Sroberto INDEX_OPT_MV_KEYS = 18, 74181834Sroberto INDEX_OPT_VERSION = 19, 75181834Sroberto INDEX_OPT_HELP = 20, 76181834Sroberto INDEX_OPT_MORE_HELP = 21, 77181834Sroberto INDEX_OPT_SAVE_OPTS = 22, 78181834Sroberto INDEX_OPT_LOAD_OPTS = 23 79181834Sroberto} teOptIndex; 80181834Sroberto 81181834Sroberto#define OPTION_CT 24 82200576Sroberto#define NTP_KEYGEN_VERSION "4.2.4p8" 83200576Sroberto#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.4p8" 84181834Sroberto 85181834Sroberto/* 86181834Sroberto * Interface defines for all options. Replace "n" with the UPPER_CASED 87181834Sroberto * option name (as in the teOptIndex enumeration above). 88181834Sroberto * e.g. HAVE_OPT( CERTIFICATE ) 89181834Sroberto */ 90181834Sroberto#define DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n]) 91181834Sroberto#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) 92181834Sroberto#define OPT_ARG(n) (DESC(n).optArg.argString) 93181834Sroberto#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) 94181834Sroberto#define COUNT_OPT(n) (DESC(n).optOccCt) 95181834Sroberto#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) 96181834Sroberto#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) 97181834Sroberto#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) 98181834Sroberto#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) 99181834Sroberto#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) 100181834Sroberto#define CLEAR_OPT(n) STMTS( \ 101181834Sroberto DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ 102181834Sroberto if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \ 103181834Sroberto DESC(n).fOptState |= OPTST_DISABLED; \ 104181834Sroberto DESC(n).optCookie = NULL ) 105181834Sroberto 106181834Sroberto/* 107181834Sroberto * Make sure there are no #define name conflicts with the option names 108181834Sroberto */ 109181834Sroberto#ifndef NO_OPTION_NAME_WARNINGS 110181834Sroberto# ifdef CERTIFICATE 111181834Sroberto# warning undefining CERTIFICATE due to option name conflict 112181834Sroberto# undef CERTIFICATE 113181834Sroberto# endif 114181834Sroberto# ifdef DEBUG_LEVEL 115181834Sroberto# warning undefining DEBUG_LEVEL due to option name conflict 116181834Sroberto# undef DEBUG_LEVEL 117181834Sroberto# endif 118181834Sroberto# ifdef SET_DEBUG_LEVEL 119181834Sroberto# warning undefining SET_DEBUG_LEVEL due to option name conflict 120181834Sroberto# undef SET_DEBUG_LEVEL 121181834Sroberto# endif 122181834Sroberto# ifdef ID_KEY 123181834Sroberto# warning undefining ID_KEY due to option name conflict 124181834Sroberto# undef ID_KEY 125181834Sroberto# endif 126181834Sroberto# ifdef GQ_PARAMS 127181834Sroberto# warning undefining GQ_PARAMS due to option name conflict 128181834Sroberto# undef GQ_PARAMS 129181834Sroberto# endif 130181834Sroberto# ifdef GQ_KEYS 131181834Sroberto# warning undefining GQ_KEYS due to option name conflict 132181834Sroberto# undef GQ_KEYS 133181834Sroberto# endif 134181834Sroberto# ifdef HOST_KEY 135181834Sroberto# warning undefining HOST_KEY due to option name conflict 136181834Sroberto# undef HOST_KEY 137181834Sroberto# endif 138181834Sroberto# ifdef IFFKEY 139181834Sroberto# warning undefining IFFKEY due to option name conflict 140181834Sroberto# undef IFFKEY 141181834Sroberto# endif 142181834Sroberto# ifdef ISSUER_NAME 143181834Sroberto# warning undefining ISSUER_NAME due to option name conflict 144181834Sroberto# undef ISSUER_NAME 145181834Sroberto# endif 146181834Sroberto# ifdef MD5KEY 147181834Sroberto# warning undefining MD5KEY due to option name conflict 148181834Sroberto# undef MD5KEY 149181834Sroberto# endif 150181834Sroberto# ifdef MODULUS 151181834Sroberto# warning undefining MODULUS due to option name conflict 152181834Sroberto# undef MODULUS 153181834Sroberto# endif 154181834Sroberto# ifdef PVT_CERT 155181834Sroberto# warning undefining PVT_CERT due to option name conflict 156181834Sroberto# undef PVT_CERT 157181834Sroberto# endif 158181834Sroberto# ifdef PVT_PASSWD 159181834Sroberto# warning undefining PVT_PASSWD due to option name conflict 160181834Sroberto# undef PVT_PASSWD 161181834Sroberto# endif 162181834Sroberto# ifdef GET_PVT_PASSWD 163181834Sroberto# warning undefining GET_PVT_PASSWD due to option name conflict 164181834Sroberto# undef GET_PVT_PASSWD 165181834Sroberto# endif 166181834Sroberto# ifdef SIGN_KEY 167181834Sroberto# warning undefining SIGN_KEY due to option name conflict 168181834Sroberto# undef SIGN_KEY 169181834Sroberto# endif 170181834Sroberto# ifdef SUBJECT_NAME 171181834Sroberto# warning undefining SUBJECT_NAME due to option name conflict 172181834Sroberto# undef SUBJECT_NAME 173181834Sroberto# endif 174181834Sroberto# ifdef TRUSTED_CERT 175181834Sroberto# warning undefining TRUSTED_CERT due to option name conflict 176181834Sroberto# undef TRUSTED_CERT 177181834Sroberto# endif 178181834Sroberto# ifdef MV_PARAMS 179181834Sroberto# warning undefining MV_PARAMS due to option name conflict 180181834Sroberto# undef MV_PARAMS 181181834Sroberto# endif 182181834Sroberto# ifdef MV_KEYS 183181834Sroberto# warning undefining MV_KEYS due to option name conflict 184181834Sroberto# undef MV_KEYS 185181834Sroberto# endif 186181834Sroberto#else /* NO_OPTION_NAME_WARNINGS */ 187181834Sroberto# undef CERTIFICATE 188181834Sroberto# undef DEBUG_LEVEL 189181834Sroberto# undef SET_DEBUG_LEVEL 190181834Sroberto# undef ID_KEY 191181834Sroberto# undef GQ_PARAMS 192181834Sroberto# undef GQ_KEYS 193181834Sroberto# undef HOST_KEY 194181834Sroberto# undef IFFKEY 195181834Sroberto# undef ISSUER_NAME 196181834Sroberto# undef MD5KEY 197181834Sroberto# undef MODULUS 198181834Sroberto# undef PVT_CERT 199181834Sroberto# undef PVT_PASSWD 200181834Sroberto# undef GET_PVT_PASSWD 201181834Sroberto# undef SIGN_KEY 202181834Sroberto# undef SUBJECT_NAME 203181834Sroberto# undef TRUSTED_CERT 204181834Sroberto# undef MV_PARAMS 205181834Sroberto# undef MV_KEYS 206181834Sroberto#endif /* NO_OPTION_NAME_WARNINGS */ 207181834Sroberto 208181834Sroberto/* 209181834Sroberto * Interface defines for specific options. 210181834Sroberto */ 211181834Sroberto#ifdef OPENSSL 212181834Sroberto#define VALUE_OPT_CERTIFICATE 'c' 213181834Sroberto#endif /* OPENSSL */ 214181834Sroberto#ifdef DEBUG 215181834Sroberto#define VALUE_OPT_DEBUG_LEVEL 'd' 216181834Sroberto#endif /* DEBUG */ 217181834Sroberto#ifdef DEBUG 218181834Sroberto#define VALUE_OPT_SET_DEBUG_LEVEL 'D' 219181834Sroberto#endif /* DEBUG */ 220181834Sroberto#ifdef OPENSSL 221181834Sroberto#define VALUE_OPT_ID_KEY 'e' 222181834Sroberto#endif /* OPENSSL */ 223181834Sroberto#ifdef OPENSSL 224181834Sroberto#define VALUE_OPT_GQ_PARAMS 'G' 225181834Sroberto#endif /* OPENSSL */ 226181834Sroberto#ifdef OPENSSL 227181834Sroberto#define VALUE_OPT_GQ_KEYS 'g' 228181834Sroberto#endif /* OPENSSL */ 229181834Sroberto#ifdef OPENSSL 230181834Sroberto#define VALUE_OPT_HOST_KEY 'H' 231181834Sroberto#endif /* OPENSSL */ 232181834Sroberto#ifdef OPENSSL 233181834Sroberto#define VALUE_OPT_IFFKEY 'I' 234181834Sroberto#endif /* OPENSSL */ 235181834Sroberto#ifdef OPENSSL 236181834Sroberto#define VALUE_OPT_ISSUER_NAME 'i' 237181834Sroberto#endif /* OPENSSL */ 238181834Sroberto#define VALUE_OPT_MD5KEY 'M' 239181834Sroberto#ifdef OPENSSL 240181834Sroberto#define VALUE_OPT_MODULUS 'm' 241181834Sroberto#define OPT_VALUE_MODULUS (DESC(MODULUS).optArg.argInt) 242181834Sroberto#endif /* OPENSSL */ 243181834Sroberto#ifdef OPENSSL 244181834Sroberto#define VALUE_OPT_PVT_CERT 'P' 245181834Sroberto#endif /* OPENSSL */ 246181834Sroberto#ifdef OPENSSL 247181834Sroberto#define VALUE_OPT_PVT_PASSWD 'p' 248181834Sroberto#endif /* OPENSSL */ 249181834Sroberto#ifdef OPENSSL 250181834Sroberto#define VALUE_OPT_GET_PVT_PASSWD 'q' 251181834Sroberto#endif /* OPENSSL */ 252181834Sroberto#ifdef OPENSSL 253181834Sroberto#define VALUE_OPT_SIGN_KEY 'S' 254181834Sroberto#endif /* OPENSSL */ 255181834Sroberto#ifdef OPENSSL 256181834Sroberto#define VALUE_OPT_SUBJECT_NAME 's' 257181834Sroberto#endif /* OPENSSL */ 258181834Sroberto#ifdef OPENSSL 259181834Sroberto#define VALUE_OPT_TRUSTED_CERT 'T' 260181834Sroberto#endif /* OPENSSL */ 261181834Sroberto#ifdef OPENSSL 262181834Sroberto#define VALUE_OPT_MV_PARAMS 'V' 263181834Sroberto#define OPT_VALUE_MV_PARAMS (DESC(MV_PARAMS).optArg.argInt) 264181834Sroberto#endif /* OPENSSL */ 265181834Sroberto#ifdef OPENSSL 266181834Sroberto#define VALUE_OPT_MV_KEYS 'v' 267181834Sroberto#define OPT_VALUE_MV_KEYS (DESC(MV_KEYS).optArg.argInt) 268181834Sroberto#endif /* OPENSSL */ 269181834Sroberto 270181834Sroberto#define VALUE_OPT_VERSION 'v' 271181834Sroberto#define VALUE_OPT_HELP '?' 272181834Sroberto#define VALUE_OPT_MORE_HELP '!' 273181834Sroberto#define VALUE_OPT_SAVE_OPTS '>' 274181834Sroberto#define VALUE_OPT_LOAD_OPTS '<' 275181834Sroberto#define SET_OPT_SAVE_OPTS(a) STMTS( \ 276181834Sroberto DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ 277181834Sroberto DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ 278181834Sroberto DESC(SAVE_OPTS).optArg.argString = (char const*)(a) ) 279181834Sroberto/* 280181834Sroberto * Interface defines not associated with particular options 281181834Sroberto */ 282181834Sroberto#define ERRSKIP_OPTERR STMTS( ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP ) 283181834Sroberto#define ERRSTOP_OPTERR STMTS( ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP ) 284181834Sroberto#define RESTART_OPT(n) STMTS( \ 285181834Sroberto ntp_keygenOptions.curOptIdx = (n); \ 286181834Sroberto ntp_keygenOptions.pzCurOpt = NULL ) 287181834Sroberto#define START_OPT RESTART_OPT(1) 288181834Sroberto#define USAGE(c) (*ntp_keygenOptions.pUsageProc)( &ntp_keygenOptions, c ) 289200576Sroberto/* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/opthead.tpl near line 360 */ 290181834Sroberto 291181834Sroberto/* * * * * * 292181834Sroberto * 293181834Sroberto * Declare the ntp-keygen option descriptor. 294181834Sroberto */ 295181834Sroberto#ifdef __cplusplus 296181834Srobertoextern "C" { 297181834Sroberto#endif 298181834Sroberto 299181834Srobertoextern tOptions ntp_keygenOptions; 300181834Sroberto 301181834Sroberto#ifndef _ 302181834Sroberto# if ENABLE_NLS 303181834Sroberto# include <stdio.h> 304181834Sroberto static inline char* aoGetsText( char const* pz ) { 305181834Sroberto if (pz == NULL) return NULL; 306181834Sroberto return (char*)gettext( pz ); 307181834Sroberto } 308181834Sroberto# define _(s) aoGetsText(s) 309181834Sroberto# else /* ENABLE_NLS */ 310181834Sroberto# define _(s) s 311181834Sroberto# endif /* ENABLE_NLS */ 312181834Sroberto#endif 313181834Sroberto 314181834Sroberto#ifdef __cplusplus 315181834Sroberto} 316181834Sroberto#endif 317181834Sroberto#endif /* AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD */ 318181834Sroberto/* ntp-keygen-opts.h ends here */ 319