/contrib/ntp/ntpd/ntpdsim-opts.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 422 lines · 350 code · 12 blank · 60 comment · 7 complexity · 34e5daee931490acb0788234d0785f7f MD5 · raw file

  1. /*
  2. * EDIT THIS FILE WITH CAUTION (ntpdsim-opts.h)
  3. *
  4. * It has been AutoGen-ed Tuesday December 8, 2009 at 08:13:12 AM EST
  5. * From the definitions ntpdsim-opts.def
  6. * and the template file options
  7. *
  8. * Generated from AutoOpts 29:0:4 templates.
  9. */
  10. /*
  11. * This file was produced by an AutoOpts template. AutoOpts is a
  12. * copyrighted work. This header file is not encumbered by AutoOpts
  13. * licensing, but is provided under the licensing terms chosen by the
  14. * ntpdsim author or copyright holder. AutoOpts is licensed under
  15. * the terms of the LGPL. The redistributable library (``libopts'') is
  16. * licensed under the terms of either the LGPL or, at the users discretion,
  17. * the BSD license. See the AutoOpts and/or libopts sources for details.
  18. *
  19. * This source file is copyrighted and licensed under the following terms:
  20. *
  21. * ntpdsim copyright 1970-2009 David L. Mills and/or others - all rights reserved
  22. *
  23. * see html/copyright.html
  24. */
  25. /*
  26. * This file contains the programmatic interface to the Automated
  27. * Options generated for the ntpdsim program.
  28. * These macros are documented in the AutoGen info file in the
  29. * "AutoOpts" chapter. Please refer to that doc for usage help.
  30. */
  31. #ifndef AUTOOPTS_NTPDSIM_OPTS_H_GUARD
  32. #define AUTOOPTS_NTPDSIM_OPTS_H_GUARD
  33. #include "config.h"
  34. #include <autoopts/options.h>
  35. /*
  36. * Ensure that the library used for compiling this generated header is at
  37. * least as new as the version current when the header template was released
  38. * (not counting patch version increments). Also ensure that the oldest
  39. * tolerable version is at least as old as what was current when the header
  40. * template was released.
  41. */
  42. #define AO_TEMPLATE_VERSION 118784
  43. #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
  44. || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
  45. # error option template version mismatches autoopts/options.h header
  46. Choke Me.
  47. #endif
  48. /*
  49. * Enumeration of each option:
  50. */
  51. typedef enum {
  52. INDEX_OPT_IPV4 = 0,
  53. INDEX_OPT_IPV6 = 1,
  54. INDEX_OPT_AUTHREQ = 2,
  55. INDEX_OPT_AUTHNOREQ = 3,
  56. INDEX_OPT_BCASTSYNC = 4,
  57. INDEX_OPT_SIMBROADCASTDELAY = 5,
  58. INDEX_OPT_CONFIGFILE = 6,
  59. INDEX_OPT_PHASENOISE = 7,
  60. INDEX_OPT_DEBUG_LEVEL = 8,
  61. INDEX_OPT_SET_DEBUG_LEVEL = 9,
  62. INDEX_OPT_DRIFTFILE = 10,
  63. INDEX_OPT_PANICGATE = 11,
  64. INDEX_OPT_SIMSLEW = 12,
  65. INDEX_OPT_JAILDIR = 13,
  66. INDEX_OPT_INTERFACE = 14,
  67. INDEX_OPT_KEYFILE = 15,
  68. INDEX_OPT_LOGFILE = 16,
  69. INDEX_OPT_NOVIRTUALIPS = 17,
  70. INDEX_OPT_MODIFYMMTIMER = 18,
  71. INDEX_OPT_NOFORK = 19,
  72. INDEX_OPT_NICE = 20,
  73. INDEX_OPT_SERVERTIME = 21,
  74. INDEX_OPT_PIDFILE = 22,
  75. INDEX_OPT_PRIORITY = 23,
  76. INDEX_OPT_QUIT = 24,
  77. INDEX_OPT_PROPAGATIONDELAY = 25,
  78. INDEX_OPT_UPDATEINTERVAL = 26,
  79. INDEX_OPT_STATSDIR = 27,
  80. INDEX_OPT_ENDSIMTIME = 28,
  81. INDEX_OPT_TRUSTEDKEY = 29,
  82. INDEX_OPT_FREQERR = 30,
  83. INDEX_OPT_WALKNOISE = 31,
  84. INDEX_OPT_USER = 32,
  85. INDEX_OPT_VAR = 33,
  86. INDEX_OPT_DVAR = 34,
  87. INDEX_OPT_SLEW = 35,
  88. INDEX_OPT_NDELAY = 36,
  89. INDEX_OPT_PDELAY = 37,
  90. INDEX_OPT_VERSION = 38,
  91. INDEX_OPT_HELP = 39,
  92. INDEX_OPT_MORE_HELP = 40,
  93. INDEX_OPT_SAVE_OPTS = 41,
  94. INDEX_OPT_LOAD_OPTS = 42
  95. } teOptIndex;
  96. #define OPTION_CT 43
  97. #define NTPDSIM_VERSION "4.2.4p8"
  98. #define NTPDSIM_FULL_VERSION "ntpdsim - NTP daemon simulation program - Ver. 4.2.4p8"
  99. /*
  100. * Interface defines for all options. Replace "n" with the UPPER_CASED
  101. * option name (as in the teOptIndex enumeration above).
  102. * e.g. HAVE_OPT( IPV4 )
  103. */
  104. #define DESC(n) (ntpdsimOptions.pOptDesc[INDEX_OPT_## n])
  105. #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
  106. #define OPT_ARG(n) (DESC(n).optArg.argString)
  107. #define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
  108. #define COUNT_OPT(n) (DESC(n).optOccCt)
  109. #define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
  110. #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
  111. #define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
  112. #define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
  113. #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
  114. #define CLEAR_OPT(n) STMTS( \
  115. DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
  116. if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
  117. DESC(n).fOptState |= OPTST_DISABLED; \
  118. DESC(n).optCookie = NULL )
  119. /*
  120. * Make sure there are no #define name conflicts with the option names
  121. */
  122. #ifndef NO_OPTION_NAME_WARNINGS
  123. # ifdef IPV4
  124. # warning undefining IPV4 due to option name conflict
  125. # undef IPV4
  126. # endif
  127. # ifdef IPV6
  128. # warning undefining IPV6 due to option name conflict
  129. # undef IPV6
  130. # endif
  131. # ifdef AUTHREQ
  132. # warning undefining AUTHREQ due to option name conflict
  133. # undef AUTHREQ
  134. # endif
  135. # ifdef AUTHNOREQ
  136. # warning undefining AUTHNOREQ due to option name conflict
  137. # undef AUTHNOREQ
  138. # endif
  139. # ifdef BCASTSYNC
  140. # warning undefining BCASTSYNC due to option name conflict
  141. # undef BCASTSYNC
  142. # endif
  143. # ifdef SIMBROADCASTDELAY
  144. # warning undefining SIMBROADCASTDELAY due to option name conflict
  145. # undef SIMBROADCASTDELAY
  146. # endif
  147. # ifdef CONFIGFILE
  148. # warning undefining CONFIGFILE due to option name conflict
  149. # undef CONFIGFILE
  150. # endif
  151. # ifdef PHASENOISE
  152. # warning undefining PHASENOISE due to option name conflict
  153. # undef PHASENOISE
  154. # endif
  155. # ifdef DEBUG_LEVEL
  156. # warning undefining DEBUG_LEVEL due to option name conflict
  157. # undef DEBUG_LEVEL
  158. # endif
  159. # ifdef SET_DEBUG_LEVEL
  160. # warning undefining SET_DEBUG_LEVEL due to option name conflict
  161. # undef SET_DEBUG_LEVEL
  162. # endif
  163. # ifdef DRIFTFILE
  164. # warning undefining DRIFTFILE due to option name conflict
  165. # undef DRIFTFILE
  166. # endif
  167. # ifdef PANICGATE
  168. # warning undefining PANICGATE due to option name conflict
  169. # undef PANICGATE
  170. # endif
  171. # ifdef SIMSLEW
  172. # warning undefining SIMSLEW due to option name conflict
  173. # undef SIMSLEW
  174. # endif
  175. # ifdef JAILDIR
  176. # warning undefining JAILDIR due to option name conflict
  177. # undef JAILDIR
  178. # endif
  179. # ifdef INTERFACE
  180. # warning undefining INTERFACE due to option name conflict
  181. # undef INTERFACE
  182. # endif
  183. # ifdef KEYFILE
  184. # warning undefining KEYFILE due to option name conflict
  185. # undef KEYFILE
  186. # endif
  187. # ifdef LOGFILE
  188. # warning undefining LOGFILE due to option name conflict
  189. # undef LOGFILE
  190. # endif
  191. # ifdef NOVIRTUALIPS
  192. # warning undefining NOVIRTUALIPS due to option name conflict
  193. # undef NOVIRTUALIPS
  194. # endif
  195. # ifdef MODIFYMMTIMER
  196. # warning undefining MODIFYMMTIMER due to option name conflict
  197. # undef MODIFYMMTIMER
  198. # endif
  199. # ifdef NOFORK
  200. # warning undefining NOFORK due to option name conflict
  201. # undef NOFORK
  202. # endif
  203. # ifdef NICE
  204. # warning undefining NICE due to option name conflict
  205. # undef NICE
  206. # endif
  207. # ifdef SERVERTIME
  208. # warning undefining SERVERTIME due to option name conflict
  209. # undef SERVERTIME
  210. # endif
  211. # ifdef PIDFILE
  212. # warning undefining PIDFILE due to option name conflict
  213. # undef PIDFILE
  214. # endif
  215. # ifdef PRIORITY
  216. # warning undefining PRIORITY due to option name conflict
  217. # undef PRIORITY
  218. # endif
  219. # ifdef QUIT
  220. # warning undefining QUIT due to option name conflict
  221. # undef QUIT
  222. # endif
  223. # ifdef PROPAGATIONDELAY
  224. # warning undefining PROPAGATIONDELAY due to option name conflict
  225. # undef PROPAGATIONDELAY
  226. # endif
  227. # ifdef UPDATEINTERVAL
  228. # warning undefining UPDATEINTERVAL due to option name conflict
  229. # undef UPDATEINTERVAL
  230. # endif
  231. # ifdef STATSDIR
  232. # warning undefining STATSDIR due to option name conflict
  233. # undef STATSDIR
  234. # endif
  235. # ifdef ENDSIMTIME
  236. # warning undefining ENDSIMTIME due to option name conflict
  237. # undef ENDSIMTIME
  238. # endif
  239. # ifdef TRUSTEDKEY
  240. # warning undefining TRUSTEDKEY due to option name conflict
  241. # undef TRUSTEDKEY
  242. # endif
  243. # ifdef FREQERR
  244. # warning undefining FREQERR due to option name conflict
  245. # undef FREQERR
  246. # endif
  247. # ifdef WALKNOISE
  248. # warning undefining WALKNOISE due to option name conflict
  249. # undef WALKNOISE
  250. # endif
  251. # ifdef USER
  252. # warning undefining USER due to option name conflict
  253. # undef USER
  254. # endif
  255. # ifdef VAR
  256. # warning undefining VAR due to option name conflict
  257. # undef VAR
  258. # endif
  259. # ifdef DVAR
  260. # warning undefining DVAR due to option name conflict
  261. # undef DVAR
  262. # endif
  263. # ifdef SLEW
  264. # warning undefining SLEW due to option name conflict
  265. # undef SLEW
  266. # endif
  267. # ifdef NDELAY
  268. # warning undefining NDELAY due to option name conflict
  269. # undef NDELAY
  270. # endif
  271. # ifdef PDELAY
  272. # warning undefining PDELAY due to option name conflict
  273. # undef PDELAY
  274. # endif
  275. #else /* NO_OPTION_NAME_WARNINGS */
  276. # undef IPV4
  277. # undef IPV6
  278. # undef AUTHREQ
  279. # undef AUTHNOREQ
  280. # undef BCASTSYNC
  281. # undef SIMBROADCASTDELAY
  282. # undef CONFIGFILE
  283. # undef PHASENOISE
  284. # undef DEBUG_LEVEL
  285. # undef SET_DEBUG_LEVEL
  286. # undef DRIFTFILE
  287. # undef PANICGATE
  288. # undef SIMSLEW
  289. # undef JAILDIR
  290. # undef INTERFACE
  291. # undef KEYFILE
  292. # undef LOGFILE
  293. # undef NOVIRTUALIPS
  294. # undef MODIFYMMTIMER
  295. # undef NOFORK
  296. # undef NICE
  297. # undef SERVERTIME
  298. # undef PIDFILE
  299. # undef PRIORITY
  300. # undef QUIT
  301. # undef PROPAGATIONDELAY
  302. # undef UPDATEINTERVAL
  303. # undef STATSDIR
  304. # undef ENDSIMTIME
  305. # undef TRUSTEDKEY
  306. # undef FREQERR
  307. # undef WALKNOISE
  308. # undef USER
  309. # undef VAR
  310. # undef DVAR
  311. # undef SLEW
  312. # undef NDELAY
  313. # undef PDELAY
  314. #endif /* NO_OPTION_NAME_WARNINGS */
  315. /*
  316. * Interface defines for specific options.
  317. */
  318. #define VALUE_OPT_IPV4 '4'
  319. #define WHICH_OPT_IPV4 (DESC(IPV4).optActualValue)
  320. #define WHICH_IDX_IPV4 (DESC(IPV4).optActualIndex)
  321. #define VALUE_OPT_IPV6 '6'
  322. #define VALUE_OPT_AUTHREQ 'a'
  323. #define VALUE_OPT_AUTHNOREQ 'A'
  324. #define VALUE_OPT_BCASTSYNC 'b'
  325. #define VALUE_OPT_SIMBROADCASTDELAY 'B'
  326. #define VALUE_OPT_CONFIGFILE 'c'
  327. #define VALUE_OPT_PHASENOISE 'C'
  328. #ifdef DEBUG
  329. #define VALUE_OPT_DEBUG_LEVEL 'd'
  330. #endif /* DEBUG */
  331. #ifdef DEBUG
  332. #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
  333. #endif /* DEBUG */
  334. #define VALUE_OPT_DRIFTFILE 'f'
  335. #define VALUE_OPT_PANICGATE 'g'
  336. #define VALUE_OPT_SIMSLEW 'H'
  337. #define VALUE_OPT_JAILDIR 'i'
  338. #define VALUE_OPT_INTERFACE 'I'
  339. #define VALUE_OPT_KEYFILE 'k'
  340. #define VALUE_OPT_LOGFILE 'l'
  341. #define VALUE_OPT_NOVIRTUALIPS 'L'
  342. #ifdef SYS_WINNT
  343. #define VALUE_OPT_MODIFYMMTIMER 'M'
  344. #endif /* SYS_WINNT */
  345. #define VALUE_OPT_NOFORK 'n'
  346. #define VALUE_OPT_NICE 'N'
  347. #define VALUE_OPT_SERVERTIME 'O'
  348. #define VALUE_OPT_PIDFILE 'p'
  349. #define VALUE_OPT_PRIORITY 'P'
  350. #define OPT_VALUE_PRIORITY (DESC(PRIORITY).optArg.argInt)
  351. #define VALUE_OPT_QUIT 'q'
  352. #define VALUE_OPT_PROPAGATIONDELAY 'r'
  353. #define VALUE_OPT_UPDATEINTERVAL 'U'
  354. #define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
  355. #define VALUE_OPT_STATSDIR 's'
  356. #define VALUE_OPT_ENDSIMTIME 'S'
  357. #define VALUE_OPT_TRUSTEDKEY 't'
  358. #define VALUE_OPT_FREQERR 'T'
  359. #define VALUE_OPT_WALKNOISE 'W'
  360. #define VALUE_OPT_USER 'u'
  361. #define VALUE_OPT_VAR 'v'
  362. #define VALUE_OPT_DVAR 'V'
  363. #define VALUE_OPT_SLEW 'x'
  364. #define VALUE_OPT_NDELAY 'Y'
  365. #define VALUE_OPT_PDELAY 'Z'
  366. #define VALUE_OPT_VERSION 'v'
  367. #define VALUE_OPT_HELP '?'
  368. #define VALUE_OPT_MORE_HELP '!'
  369. #define VALUE_OPT_SAVE_OPTS '>'
  370. #define VALUE_OPT_LOAD_OPTS '<'
  371. #define SET_OPT_SAVE_OPTS(a) STMTS( \
  372. DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
  373. DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
  374. DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
  375. /*
  376. * Interface defines not associated with particular options
  377. */
  378. #define ERRSKIP_OPTERR STMTS( ntpdsimOptions.fOptSet &= ~OPTPROC_ERRSTOP )
  379. #define ERRSTOP_OPTERR STMTS( ntpdsimOptions.fOptSet |= OPTPROC_ERRSTOP )
  380. #define RESTART_OPT(n) STMTS( \
  381. ntpdsimOptions.curOptIdx = (n); \
  382. ntpdsimOptions.pzCurOpt = NULL )
  383. #define START_OPT RESTART_OPT(1)
  384. #define USAGE(c) (*ntpdsimOptions.pUsageProc)( &ntpdsimOptions, c )
  385. /* extracted from /usr/local/gnu/autogen-5.9.1/share/autogen/opthead.tpl near line 360 */
  386. /* * * * * *
  387. *
  388. * Declare the ntpdsim option descriptor.
  389. */
  390. #ifdef __cplusplus
  391. extern "C" {
  392. #endif
  393. extern tOptions ntpdsimOptions;
  394. #ifndef _
  395. # if ENABLE_NLS
  396. # include <stdio.h>
  397. static inline char* aoGetsText( char const* pz ) {
  398. if (pz == NULL) return NULL;
  399. return (char*)gettext( pz );
  400. }
  401. # define _(s) aoGetsText(s)
  402. # else /* ENABLE_NLS */
  403. # define _(s) s
  404. # endif /* ENABLE_NLS */
  405. #endif
  406. #ifdef __cplusplus
  407. }
  408. #endif
  409. #endif /* AUTOOPTS_NTPDSIM_OPTS_H_GUARD */
  410. /* ntpdsim-opts.h ends here */