From: Harlan Stenn Date: Sat, 20 Nov 2010 05:14:13 +0000 (-0500) Subject: autogen upgrade X-Git-Tag: NTP_4_2_7P84~8^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c16ed5205f03fa85432f47fcf494b32468714cb;p=thirdparty%2Fntp.git autogen upgrade bk: 4ce759257bFKJt5EUgEASDbGgC5ukA --- diff --git a/ntpd/ntpd-opts.c b/ntpd/ntpd-opts.c index 9a4949b6a..f9a376ea4 100644 --- a/ntpd/ntpd-opts.c +++ b/ntpd/ntpd-opts.c @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.c) * - * It has been AutoGen-ed November 14, 2010 at 08:53:30 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:36:11 PM by AutoGen 5.11.3 * From the definitions ntpd-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This source file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntpd author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpd author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -70,10 +68,10 @@ extern tUsageProc optionUsage; * Ipv4 option description with * "Must also have options" and "Incompatible options": */ -tSCC zIpv4Text[] = +static char const zIpv4Text[] = "Force IPv4 DNS name resolution"; -tSCC zIpv4_NAME[] = "IPV4"; -tSCC zIpv4_Name[] = "ipv4"; +static char const zIpv4_NAME[] = "IPV4"; +static char const zIpv4_Name[] = "ipv4"; static const int aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; @@ -83,10 +81,10 @@ static const int * Ipv6 option description with * "Must also have options" and "Incompatible options": */ -tSCC zIpv6Text[] = +static char const zIpv6Text[] = "Force IPv6 DNS name resolution"; -tSCC zIpv6_NAME[] = "IPV6"; -tSCC zIpv6_Name[] = "ipv6"; +static char const zIpv6_NAME[] = "IPV6"; +static char const zIpv6_Name[] = "ipv6"; static const int aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; @@ -96,10 +94,10 @@ static const int * Authreq option description with * "Must also have options" and "Incompatible options": */ -tSCC zAuthreqText[] = +static char const zAuthreqText[] = "Require crypto authentication"; -tSCC zAuthreq_NAME[] = "AUTHREQ"; -tSCC zAuthreq_Name[] = "authreq"; +static char const zAuthreq_NAME[] = "AUTHREQ"; +static char const zAuthreq_Name[] = "authreq"; static const int aAuthreqCantList[] = { INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT }; @@ -109,10 +107,10 @@ static const int * Authnoreq option description with * "Must also have options" and "Incompatible options": */ -tSCC zAuthnoreqText[] = +static char const zAuthnoreqText[] = "Do not require crypto authentication"; -tSCC zAuthnoreq_NAME[] = "AUTHNOREQ"; -tSCC zAuthnoreq_Name[] = "authnoreq"; +static char const zAuthnoreq_NAME[] = "AUTHNOREQ"; +static char const zAuthnoreq_Name[] = "authnoreq"; static const int aAuthnoreqCantList[] = { INDEX_OPT_AUTHREQ, NO_EQUIVALENT }; @@ -121,19 +119,19 @@ static const int /* * Bcastsync option description: */ -tSCC zBcastsyncText[] = +static char const zBcastsyncText[] = "Allow us to sync to broadcast servers"; -tSCC zBcastsync_NAME[] = "BCASTSYNC"; -tSCC zBcastsync_Name[] = "bcastsync"; +static char const zBcastsync_NAME[] = "BCASTSYNC"; +static char const zBcastsync_Name[] = "bcastsync"; #define BCASTSYNC_FLAGS (OPTST_DISABLED) /* * Configfile option description: */ -tSCC zConfigfileText[] = +static char const zConfigfileText[] = "configuration file name"; -tSCC zConfigfile_NAME[] = "CONFIGFILE"; -tSCC zConfigfile_Name[] = "configfile"; +static char const zConfigfile_NAME[] = "CONFIGFILE"; +static char const zConfigfile_Name[] = "configfile"; #define CONFIGFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -141,121 +139,121 @@ tSCC zConfigfile_Name[] = "configfile"; * Debug_Level option description: */ #ifdef DEBUG -tSCC zDebug_LevelText[] = +static char const zDebug_LevelText[] = "Increase output debug message level"; -tSCC zDebug_Level_NAME[] = "DEBUG_LEVEL"; -tSCC zDebug_Level_Name[] = "debug-level"; +static char const zDebug_Level_NAME[] = "DEBUG_LEVEL"; +static char const zDebug_Level_Name[] = "debug-level"; #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) #else /* disable Debug_Level */ #define DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zDebug_Level_NAME NULL -tSCC zDebug_Level_Name[] = "debug-level"; -tSCC zDebug_LevelText[] = "this package was built using 'configure --disable--debug'"; +static char const zDebug_Level_Name[] = "debug-level"; +static char const zDebug_LevelText[] = "this package was built using 'configure --disable--debug'"; #endif /* DEBUG */ /* * Set_Debug_Level option description: */ #ifdef DEBUG -tSCC zSet_Debug_LevelText[] = +static char const zSet_Debug_LevelText[] = "Set the output debug message level"; -tSCC zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; -tSCC zSet_Debug_Level_Name[] = "set-debug-level"; +static char const zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; +static char const zSet_Debug_Level_Name[] = "set-debug-level"; #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable Set_Debug_Level */ #define SET_DEBUG_LEVEL_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zSet_Debug_Level_NAME NULL -tSCC zSet_Debug_Level_Name[] = "set-debug-level"; -tSCC zSet_Debug_LevelText[] = "this package was built using 'configure --disable--debug'"; +static char const zSet_Debug_Level_Name[] = "set-debug-level"; +static char const zSet_Debug_LevelText[] = "this package was built using 'configure --disable--debug'"; #endif /* DEBUG */ /* * Driftfile option description: */ -tSCC zDriftfileText[] = +static char const zDriftfileText[] = "frequency drift file name"; -tSCC zDriftfile_NAME[] = "DRIFTFILE"; -tSCC zDriftfile_Name[] = "driftfile"; +static char const zDriftfile_NAME[] = "DRIFTFILE"; +static char const zDriftfile_Name[] = "driftfile"; #define DRIFTFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Panicgate option description: */ -tSCC zPanicgateText[] = +static char const zPanicgateText[] = "Allow the first adjustment to be Big"; -tSCC zPanicgate_NAME[] = "PANICGATE"; -tSCC zPanicgate_Name[] = "panicgate"; +static char const zPanicgate_NAME[] = "PANICGATE"; +static char const zPanicgate_Name[] = "panicgate"; #define PANICGATE_FLAGS (OPTST_DISABLED) /* * Jaildir option description: */ #ifdef HAVE_DROPROOT -tSCC zJaildirText[] = +static char const zJaildirText[] = "Jail directory"; -tSCC zJaildir_NAME[] = "JAILDIR"; -tSCC zJaildir_Name[] = "jaildir"; +static char const zJaildir_NAME[] = "JAILDIR"; +static char const zJaildir_Name[] = "jaildir"; #define JAILDIR_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable Jaildir */ #define JAILDIR_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zJaildir_NAME NULL -tSCC zJaildir_Name[] = "jaildir"; -tSCC zJaildirText[] = "built without --enable-clockctl or --enable-linuxcaps"; +static char const zJaildir_Name[] = "jaildir"; +static char const zJaildirText[] = "built without --enable-clockctl or --enable-linuxcaps"; #endif /* HAVE_DROPROOT */ /* * Interface option description: */ -tSCC zInterfaceText[] = +static char const zInterfaceText[] = "Listen on an interface name or address"; -tSCC zInterface_NAME[] = "INTERFACE"; -tSCC zInterface_Name[] = "interface"; +static char const zInterface_NAME[] = "INTERFACE"; +static char const zInterface_Name[] = "interface"; #define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Keyfile option description: */ -tSCC zKeyfileText[] = +static char const zKeyfileText[] = "path to symmetric keys"; -tSCC zKeyfile_NAME[] = "KEYFILE"; -tSCC zKeyfile_Name[] = "keyfile"; +static char const zKeyfile_NAME[] = "KEYFILE"; +static char const zKeyfile_Name[] = "keyfile"; #define KEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Logfile option description: */ -tSCC zLogfileText[] = +static char const zLogfileText[] = "path to the log file"; -tSCC zLogfile_NAME[] = "LOGFILE"; -tSCC zLogfile_Name[] = "logfile"; +static char const zLogfile_NAME[] = "LOGFILE"; +static char const zLogfile_Name[] = "logfile"; #define LOGFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Novirtualips option description: */ -tSCC zNovirtualipsText[] = +static char const zNovirtualipsText[] = "Do not listen to virtual interfaces"; -tSCC zNovirtualips_NAME[] = "NOVIRTUALIPS"; -tSCC zNovirtualips_Name[] = "novirtualips"; +static char const zNovirtualips_NAME[] = "NOVIRTUALIPS"; +static char const zNovirtualips_Name[] = "novirtualips"; #define NOVIRTUALIPS_FLAGS (OPTST_DISABLED) /* * Modifymmtimer option description: */ #ifdef SYS_WINNT -tSCC zModifymmtimerText[] = +static char const zModifymmtimerText[] = "Modify Multimedia Timer (Windows only)"; -tSCC zModifymmtimer_NAME[] = "MODIFYMMTIMER"; -tSCC zModifymmtimer_Name[] = "modifymmtimer"; +static char const zModifymmtimer_NAME[] = "MODIFYMMTIMER"; +static char const zModifymmtimer_Name[] = "modifymmtimer"; #define MODIFYMMTIMER_FLAGS (OPTST_DISABLED) #else /* disable Modifymmtimer */ @@ -268,57 +266,57 @@ tSCC zModifymmtimer_Name[] = "modifymmtimer"; /* * Nofork option description: */ -tSCC zNoforkText[] = +static char const zNoforkText[] = "Do not fork"; -tSCC zNofork_NAME[] = "NOFORK"; -tSCC zNofork_Name[] = "nofork"; +static char const zNofork_NAME[] = "NOFORK"; +static char const zNofork_Name[] = "nofork"; #define NOFORK_FLAGS (OPTST_DISABLED) /* * Nice option description: */ -tSCC zNiceText[] = +static char const zNiceText[] = "Run at high priority"; -tSCC zNice_NAME[] = "NICE"; -tSCC zNice_Name[] = "nice"; +static char const zNice_NAME[] = "NICE"; +static char const zNice_Name[] = "nice"; #define NICE_FLAGS (OPTST_DISABLED) /* * Pidfile option description: */ -tSCC zPidfileText[] = +static char const zPidfileText[] = "path to the PID file"; -tSCC zPidfile_NAME[] = "PIDFILE"; -tSCC zPidfile_Name[] = "pidfile"; +static char const zPidfile_NAME[] = "PIDFILE"; +static char const zPidfile_Name[] = "pidfile"; #define PIDFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Priority option description: */ -tSCC zPriorityText[] = +static char const zPriorityText[] = "Process priority"; -tSCC zPriority_NAME[] = "PRIORITY"; -tSCC zPriority_Name[] = "priority"; +static char const zPriority_NAME[] = "PRIORITY"; +static char const zPriority_Name[] = "priority"; #define PRIORITY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * Quit option description: */ -tSCC zQuitText[] = +static char const zQuitText[] = "Set the time and quit"; -tSCC zQuit_NAME[] = "QUIT"; -tSCC zQuit_Name[] = "quit"; +static char const zQuit_NAME[] = "QUIT"; +static char const zQuit_Name[] = "quit"; #define QUIT_FLAGS (OPTST_DISABLED) /* * Propagationdelay option description: */ -tSCC zPropagationdelayText[] = +static char const zPropagationdelayText[] = "Broadcast/propagation delay"; -tSCC zPropagationdelay_NAME[] = "PROPAGATIONDELAY"; -tSCC zPropagationdelay_Name[] = "propagationdelay"; +static char const zPropagationdelay_NAME[] = "PROPAGATIONDELAY"; +static char const zPropagationdelay_Name[] = "propagationdelay"; #define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -326,10 +324,10 @@ tSCC zPropagationdelay_Name[] = "propagationdelay"; * Saveconfigquit option description: */ #ifdef SAVECONFIG -tSCC zSaveconfigquitText[] = +static char const zSaveconfigquitText[] = "Save parsed configuration and quit"; -tSCC zSaveconfigquit_NAME[] = "SAVECONFIGQUIT"; -tSCC zSaveconfigquit_Name[] = "saveconfigquit"; +static char const zSaveconfigquit_NAME[] = "SAVECONFIGQUIT"; +static char const zSaveconfigquit_Name[] = "saveconfigquit"; #define SAVECONFIGQUIT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -343,20 +341,20 @@ tSCC zSaveconfigquit_Name[] = "saveconfigquit"; /* * Statsdir option description: */ -tSCC zStatsdirText[] = +static char const zStatsdirText[] = "Statistics file location"; -tSCC zStatsdir_NAME[] = "STATSDIR"; -tSCC zStatsdir_Name[] = "statsdir"; +static char const zStatsdir_NAME[] = "STATSDIR"; +static char const zStatsdir_Name[] = "statsdir"; #define STATSDIR_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Trustedkey option description: */ -tSCC zTrustedkeyText[] = +static char const zTrustedkeyText[] = "Trusted key number"; -tSCC zTrustedkey_NAME[] = "TRUSTEDKEY"; -tSCC zTrustedkey_Name[] = "trustedkey"; +static char const zTrustedkey_NAME[] = "TRUSTEDKEY"; +static char const zTrustedkey_Name[] = "trustedkey"; #define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -364,67 +362,67 @@ tSCC zTrustedkey_Name[] = "trustedkey"; * User option description: */ #ifdef HAVE_DROPROOT -tSCC zUserText[] = +static char const zUserText[] = "Run as userid (or userid:groupid)"; -tSCC zUser_NAME[] = "USER"; -tSCC zUser_Name[] = "user"; +static char const zUser_NAME[] = "USER"; +static char const zUser_Name[] = "user"; #define USER_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) #else /* disable User */ #define USER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zUser_NAME NULL -tSCC zUser_Name[] = "user"; -tSCC zUserText[] = "built without --enable-clockctl or --enable-linuxcaps"; +static char const zUser_Name[] = "user"; +static char const zUserText[] = "built without --enable-clockctl or --enable-linuxcaps"; #endif /* HAVE_DROPROOT */ /* * Updateinterval option description: */ -tSCC zUpdateintervalText[] = +static char const zUpdateintervalText[] = "interval in seconds between scans for new or dropped interfaces"; -tSCC zUpdateinterval_NAME[] = "UPDATEINTERVAL"; -tSCC zUpdateinterval_Name[] = "updateinterval"; +static char const zUpdateinterval_NAME[] = "UPDATEINTERVAL"; +static char const zUpdateinterval_Name[] = "updateinterval"; #define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * Var option description: */ -tSCC zVarText[] = +static char const zVarText[] = "make ARG an ntp variable (RW)"; -tSCC zVar_NAME[] = "VAR"; -tSCC zVar_Name[] = "var"; +static char const zVar_NAME[] = "VAR"; +static char const zVar_Name[] = "var"; #define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Dvar option description: */ -tSCC zDvarText[] = +static char const zDvarText[] = "make ARG an ntp variable (RW|DEF)"; -tSCC zDvar_NAME[] = "DVAR"; -tSCC zDvar_Name[] = "dvar"; +static char const zDvar_NAME[] = "DVAR"; +static char const zDvar_Name[] = "dvar"; #define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Slew option description: */ -tSCC zSlewText[] = +static char const zSlewText[] = "Slew up to 600 seconds"; -tSCC zSlew_NAME[] = "SLEW"; -tSCC zSlew_Name[] = "slew"; +static char const zSlew_NAME[] = "SLEW"; +static char const zSlew_Name[] = "slew"; #define SLEW_FLAGS (OPTST_DISABLED) /* * Usepcc option description: */ #ifdef SYS_WINNT -tSCC zUsepccText[] = +static char const zUsepccText[] = "Use CPU cycle counter (Windows only)"; -tSCC zUsepcc_NAME[] = "USEPCC"; -tSCC zUsepcc_Name[] = "usepcc"; +static char const zUsepcc_NAME[] = "USEPCC"; +static char const zUsepcc_Name[] = "usepcc"; #define USEPCC_FLAGS (OPTST_DISABLED) #else /* disable Usepcc */ @@ -438,10 +436,10 @@ tSCC zUsepcc_Name[] = "usepcc"; * Pccfreq option description: */ #ifdef SYS_WINNT -tSCC zPccfreqText[] = +static char const zPccfreqText[] = "Force CPU cycle counter use (Windows only)"; -tSCC zPccfreq_NAME[] = "PCCFREQ"; -tSCC zPccfreq_Name[] = "pccfreq"; +static char const zPccfreq_NAME[] = "PCCFREQ"; +static char const zPccfreq_Name[] = "pccfreq"; #define PCCFREQ_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -455,12 +453,12 @@ tSCC zPccfreq_Name[] = "pccfreq"; /* * Help/More_Help/Version option descriptions: */ -tSCC zHelpText[] = "Display extended usage information and exit"; -tSCC zHelp_Name[] = "help"; +static char const zHelpText[] = "Display extended usage information and exit"; +static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) -tSCC zMore_Help_Name[] = "more-help"; -tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; +static char const zMore_Help_Name[] = "more-help"; +static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL @@ -473,8 +471,8 @@ tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif -tSCC zVersionText[] = "Output version information and exit"; -tSCC zVersion_Name[] = "version"; +static char const zVersionText[] = "Output version information and exit"; +static char const zVersion_Name[] = "version"; /* * Declare option callback procedures */ @@ -488,9 +486,6 @@ tSCC zVersion_Name[] = "version"; * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ -extern tOptProc - optionNumericVal, optionPagedUsage, optionStackArg, - optionVersionStderr; static tOptProc doUsageOpt; @@ -505,7 +500,10 @@ static tOptProc * When not under test, there are different procs to use */ extern tOptProc - optionNumericVal, optionPagedUsage, optionPrintVersion, optionStackArg; + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeVal, optionUnstackArg, + optionVersionStderr; static tOptProc doUsageOpt; @@ -965,7 +963,7 @@ tSCC zBugsAddr[] = "http://bugs.ntp.org, bugs@ntp.org"; #define zExplain NULL tSCC zDetail[] = "\n\n"; tSCC zFullVersion[] = NTPD_FULL_VERSION; -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 493 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -987,7 +985,8 @@ tOptions ntpdOptions = { + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON - + OPTPROC_NO_ARGS ), + + OPTPROC_NO_ARGS + + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zCopyrightNotice, @@ -1019,7 +1018,7 @@ doUsageOpt( tOptDesc* pOptDesc ) { (void)pOptions; - USAGE( EXIT_SUCCESS ); + USAGE(EXIT_SUCCESS); } #if ! defined(TEST_NTPD_OPTS) @@ -1037,22 +1036,25 @@ DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); } #endif /* defined DEBUG */ #endif /* defined(TEST_NTPD_OPTS) */ -/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */ +/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */ #if defined(TEST_NTPD_OPTS) /* TEST MAIN PROCEDURE: */ -extern void optionPutShell( tOptions* ); +extern void optionPutShell(tOptions*); int main(int argc, char** argv) { int res = EXIT_SUCCESS; - (void)optionProcess( &ntpdOptions, argc, argv ); - optionPutShell( &ntpdOptions ); + (void)optionProcess(&ntpdOptions, argc, argv); + optionPutShell(&ntpdOptions); + res = ferror(stdout); + if (res != 0) + fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTPD_OPTS */ -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 626 */ #if ENABLE_NLS #include @@ -1061,11 +1063,11 @@ main(int argc, char** argv) #include #include -static char* AO_gettext( char const* pz ); +static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* -AO_gettext( char const* pz ) +AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) @@ -1073,10 +1075,10 @@ AO_gettext( char const* pz ) pzRes = _(pz); if (pzRes == pz) return pzRes; - pzRes = strdup( pzRes ); + pzRes = strdup(pzRes); if (pzRes == NULL) { - fputs( _("No memory for duping translated strings\n"), stderr ); - exit( EXIT_FAILURE ); + fputs(_("No memory for duping translated strings\n"), stderr); + exit(EXIT_FAILURE); } return pzRes; } @@ -1089,7 +1091,7 @@ static void coerce_it(void** s) { *s = AO_gettext(*s); } * This invokes the translation code (e.g. gettext(3)). */ static void -translate_option_strings( void ) +translate_option_strings(void) { /* * Guard against re-translation. It won't work. The strings will have diff --git a/ntpd/ntpd-opts.h b/ntpd/ntpd-opts.h index d363d4af1..c1d03e233 100644 --- a/ntpd/ntpd-opts.h +++ b/ntpd/ntpd-opts.h @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpd-opts.h) * - * It has been AutoGen-ed November 14, 2010 at 08:53:29 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:36:11 PM by AutoGen 5.11.3 * From the definitions ntpd-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This header file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntpd author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpd author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -41,7 +39,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 135168 +#define AO_TEMPLATE_VERSION 135171 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -96,7 +94,7 @@ typedef enum { /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). - * e.g. HAVE_OPT( IPV4 ) + * e.g. HAVE_OPT(IPV4) */ #define DESC(n) (ntpdOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) @@ -110,7 +108,7 @@ typedef enum { #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ - if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) @@ -327,14 +325,14 @@ typedef enum { /* * Interface defines not associated with particular options */ -#define ERRSKIP_OPTERR STMTS( ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP ) -#define ERRSTOP_OPTERR STMTS( ntpdOptions.fOptSet |= OPTPROC_ERRSTOP ) +#define ERRSKIP_OPTERR STMTS(ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(ntpdOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntpdOptions.curOptIdx = (n); \ - ntpdOptions.pzCurOpt = NULL ) + ntpdOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) -#define USAGE(c) (*ntpdOptions.pUsageProc)( &ntpdOptions, c ) -/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */ +#define USAGE(c) (*ntpdOptions.pUsageProc)(&ntpdOptions, c) +/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 408 */ /* * * * * * * @@ -349,9 +347,9 @@ extern tOptions ntpdOptions; #if defined(ENABLE_NLS) # ifndef _ # include - static inline char* aoGetsText( char const* pz ) { + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; - return (char*)gettext( pz ); + return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ diff --git a/ntpd/ntpd-opts.texi b/ntpd/ntpd-opts.texi index b1f3afbe7..02cf138ea 100644 --- a/ntpd/ntpd-opts.texi +++ b/ntpd/ntpd-opts.texi @@ -3,586 +3,3 @@ @pindex ntpd @cindex NTP daemon program @ignore -# -# EDIT THIS FILE WITH CAUTION (ntpd-opts.texi) -# -# It has been AutoGen-ed November 14, 2010 at 08:54:06 AM by AutoGen 5.10 -# From the definitions ntpd-opts.def -# and the template file aginfo.tpl -@end ignore -This program has no explanation. - - - -This section was generated by @strong{AutoGen}, -the aginfo template and the option descriptions for the @command{ntpd} program. It documents the ntpd usage text and option meanings. - -This software is released under a specialized copyright license. - -@menu -* ntpd usage:: ntpd usage help (-?) -* ntpd authnoreq:: authnoreq option (-A) -* ntpd authreq:: authreq option (-a) -* ntpd bcastsync:: bcastsync option (-b) -* ntpd configfile:: configfile option (-c) -* ntpd debug-level:: debug-level option (-d) -* ntpd driftfile:: driftfile option (-f) -* ntpd dvar:: dvar option -* ntpd interface:: interface option (-I) -* ntpd ipv4:: ipv4 option (-4) -* ntpd ipv6:: ipv6 option (-6) -* ntpd jaildir:: jaildir option (-i) -* ntpd keyfile:: keyfile option (-k) -* ntpd logfile:: logfile option (-l) -* ntpd modifymmtimer:: modifymmtimer option (-M) -* ntpd nice:: nice option (-N) -* ntpd nofork:: nofork option (-n) -* ntpd novirtualips:: novirtualips option (-L) -* ntpd panicgate:: panicgate option (-g) -* ntpd pccfreq:: pccfreq option -* ntpd pidfile:: pidfile option (-p) -* ntpd priority:: priority option (-P) -* ntpd propagationdelay:: propagationdelay option (-r) -* ntpd quit:: quit option (-q) -* ntpd saveconfigquit:: saveconfigquit option -* ntpd set-debug-level:: set-debug-level option (-D) -* ntpd slew:: slew option (-x) -* ntpd statsdir:: statsdir option (-s) -* ntpd trustedkey:: trustedkey option (-t) -* ntpd updateinterval:: updateinterval option (-U) -* ntpd usepcc:: usepcc option -* ntpd user:: user option (-u) -* ntpd var:: var option -@end menu - -@node ntpd usage -@subsection ntpd usage help (-?) -@cindex ntpd usage - -This is the automatically generated usage text for ntpd: - -@exampleindent 0 -@example -ntpd - NTP daemon program - Ver. 4.2.6p3-RC10 -USAGE: ntpd [ - [] | --[@{=| @}] ]... - Flg Arg Option-Name Description - -4 no ipv4 Force IPv4 DNS name resolution - - prohibits these options: - ipv6 - -6 no ipv6 Force IPv6 DNS name resolution - - prohibits these options: - ipv4 - -a no authreq Require crypto authentication - - prohibits these options: - authnoreq - -A no authnoreq Do not require crypto authentication - - prohibits these options: - authreq - -b no bcastsync Allow us to sync to broadcast servers - -c Str configfile configuration file name - -d no debug-level Increase output debug message level - - may appear multiple times - -D Str set-debug-level Set the output debug message level - - may appear multiple times - -f Str driftfile frequency drift file name - -g no panicgate Allow the first adjustment to be Big - - may appear multiple times - -i --- jaildir built without --enable-clockctl or --enable-linuxcaps - -I Str interface Listen on an interface name or address - - may appear multiple times - -k Str keyfile path to symmetric keys - -l Str logfile path to the log file - -L no novirtualips Do not listen to virtual interfaces - -n no nofork Do not fork - -N no nice Run at high priority - -p Str pidfile path to the PID file - -P Num priority Process priority - -q no quit Set the time and quit - -r Str propagationdelay Broadcast/propagation delay - Str saveconfigquit Save parsed configuration and quit - -s Str statsdir Statistics file location - -t Str trustedkey Trusted key number - - may appear multiple times - -u --- user built without --enable-clockctl or --enable-linuxcaps - -U Num updateinterval interval in seconds between scans for new or dropped interfaces - Str var make ARG an ntp variable (RW) - - may appear multiple times - Str dvar make ARG an ntp variable (RW|DEF) - - may appear multiple times - -x no slew Slew up to 600 seconds - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -Options are specified by doubled hyphens and their name -or by a single hyphen and the flag character. - -The following option preset mechanisms are supported: - - examining environment variables named NTPD_* - - - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org -@end example -@exampleindent 4 - -@node ntpd ipv4 -@subsection ipv4 option (-4) -@cindex ntpd-ipv4 - -This is the ``force ipv4 dns name resolution'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -ipv6. -@end itemize - -Force DNS resolution of following host names on the command line -to the IPv4 namespace. - -@node ntpd ipv6 -@subsection ipv6 option (-6) -@cindex ntpd-ipv6 - -This is the ``force ipv6 dns name resolution'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -ipv4. -@end itemize - -Force DNS resolution of following host names on the command line -to the IPv6 namespace. - -@node ntpd authreq -@subsection authreq option (-a) -@cindex ntpd-authreq - -This is the ``require crypto authentication'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -authnoreq. -@end itemize - -Require cryptographic authentication for broadcast client, -multicast client and symmetric passive associations. -This is the default. - -@node ntpd authnoreq -@subsection authnoreq option (-A) -@cindex ntpd-authnoreq - -This is the ``do not require crypto authentication'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -authreq. -@end itemize - -Do not require cryptographic authentication for broadcast client, -multicast client and symmetric passive associations. -This is almost never a good idea. - -@node ntpd bcastsync -@subsection bcastsync option (-b) -@cindex ntpd-bcastsync - -This is the ``allow us to sync to broadcast servers'' option. - - -@node ntpd configfile -@subsection configfile option (-c) -@cindex ntpd-configfile - -This is the ``configuration file name'' option. -The name and path of the configuration file, -/etc/ntp.conf -by default. - -@node ntpd debug-level -@subsection debug-level option (-d) -@cindex ntpd-debug-level - -This is the ``increase output debug message level'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@item -must be compiled in by defining @code{DEBUG} during the compilation. -@end itemize - -Increase the debugging message output level. - -@node ntpd set-debug-level -@subsection set-debug-level option (-D) -@cindex ntpd-set-debug-level - -This is the ``set the output debug message level'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@item -must be compiled in by defining @code{DEBUG} during the compilation. -@end itemize - -Set the output debugging level. Can be supplied multiple times, -but each overrides the previous value(s). - -@node ntpd driftfile -@subsection driftfile option (-f) -@cindex ntpd-driftfile - -This is the ``frequency drift file name'' option. -The name and path of the frequency file, -/etc/ntp.drift -by default. -This is the same operation as the -driftfile driftfile -configuration specification in the -/etc/ntp.conf -file. - -@node ntpd panicgate -@subsection panicgate option (-g) -@cindex ntpd-panicgate - -This is the ``allow the first adjustment to be big'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Normally, -ntpd -exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, -ntpd -will exit with a message to the system log. This option can be used with the --q -and --x -options. -See the -tinker -configuration file directive for other options. - -@node ntpd jaildir -@subsection jaildir option (-i) -@cindex ntpd-jaildir - -This is the ``jail directory'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{HAVE_DROPROOT} during the compilation. -@end itemize - -Chroot the server to the directory -jaildir -. -This option also implies that the server attempts to drop root privileges at startup. -You may need to also specify a --u -option. -This option is only available if the OS supports adjusting the clock -without full root privileges. -This option is supported under NetBSD (configure with ---enable-clockctl -) and Linux (configure with ---enable-linuxcaps -). - -@node ntpd interface -@subsection interface option (-I) -@cindex ntpd-interface - -This is the ``listen on an interface name or address'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Open the network address given, or all the addresses associated with the -given interface name. This option may appear multiple times. This option -also implies not opening other addresses, except wildcard and localhost. -This option is deprecated. Please consider using the configuration file -interface command, which is more versatile. - -@node ntpd keyfile -@subsection keyfile option (-k) -@cindex ntpd-keyfile - -This is the ``path to symmetric keys'' option. -Specify the name and path of the symmetric key file. -/etc/ntp.keys -is the default. -This is the same operation as the -keys keyfile -configuration file directive. - -@node ntpd logfile -@subsection logfile option (-l) -@cindex ntpd-logfile - -This is the ``path to the log file'' option. -Specify the name and path of the log file. -The default is the system log file. -This is the same operation as the -logfile logfile -configuration file directive. - -@node ntpd novirtualips -@subsection novirtualips option (-L) -@cindex ntpd-novirtualips - -This is the ``do not listen to virtual interfaces'' option. -Do not listen to virtual interfaces, defined as those with -names containing a colon. This option is deprecated. Please -consider using the configuration file interface command, which -is more versatile. - -@node ntpd modifymmtimer -@subsection modifymmtimer option (-M) -@cindex ntpd-modifymmtimer - -This is the ``modify multimedia timer (windows only)'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{SYS_WINNT} during the compilation. -@end itemize - -Set the Windows Multimedia Timer to highest resolution. This -ensures the resolution does not change while ntpd is running, -avoiding timekeeping glitches associated with changes. - -@node ntpd nofork -@subsection nofork option (-n) -@cindex ntpd-nofork - -This is the ``do not fork'' option. - - -@node ntpd nice -@subsection nice option (-N) -@cindex ntpd-nice - -This is the ``run at high priority'' option. -To the extent permitted by the operating system, run -ntpd -at the highest priority. - -@node ntpd pidfile -@subsection pidfile option (-p) -@cindex ntpd-pidfile - -This is the ``path to the pid file'' option. -Specify the name and path of the file used to record -ntpd's -process ID. -This is the same operation as the -pidfile pidfile -configuration file directive. - -@node ntpd priority -@subsection priority option (-P) -@cindex ntpd-priority - -This is the ``process priority'' option. -To the extent permitted by the operating system, run -ntpd -at the specified -sched_setscheduler(SCHED_FIFO) -priority. - -@node ntpd quit -@subsection quit option (-q) -@cindex ntpd-quit - -This is the ``set the time and quit'' option. -ntpd -will exit just after the first time the clock is set. This behavior mimics that of the -ntpdate -program, which is to be retired. -The --g -and --x -options can be used with this option. -Note: The kernel time discipline is disabled with this option. - -@node ntpd propagationdelay -@subsection propagationdelay option (-r) -@cindex ntpd-propagationdelay - -This is the ``broadcast/propagation delay'' option. -Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol. - -@node ntpd saveconfigquit -@subsection saveconfigquit option -@cindex ntpd-saveconfigquit - -This is the ``save parsed configuration and quit'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{SAVECONFIG} during the compilation. -@end itemize - -Cause ntpd to parse its startup configuration file and save an -equivalent to the given filename and exit. This option was -designed for automated testing. - -@node ntpd statsdir -@subsection statsdir option (-s) -@cindex ntpd-statsdir - -This is the ``statistics file location'' option. -Specify the directory path for files created by the statistics facility. -This is the same operation as the -statsdir statsdir -configuration file directive. - -@node ntpd trustedkey -@subsection trustedkey option (-t) -@cindex ntpd-trustedkey - -This is the ``trusted key number'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Add a key number to the trusted key list. - -@node ntpd user -@subsection user option (-u) -@cindex ntpd-user - -This is the ``run as userid (or userid:groupid)'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{HAVE_DROPROOT} during the compilation. -@end itemize - -Specify a user, and optionally a group, to switch to. -This option is only available if the OS supports adjusting the clock -without full root privileges. -This option is supported under NetBSD (configure with ---enable-clockctl -) and Linux (configure with ---enable-linuxcaps -). - -@node ntpd updateinterval -@subsection updateinterval option (-U) -@cindex ntpd-updateinterval - -This is the ``interval in seconds between scans for new or dropped interfaces'' option. -Give the time in seconds between two scans for new or dropped interfaces. -For systems with routing socket support the scans will be performed shortly after the interface change -has been detected by the system. -Use 0 to disable scanning. 60 seconds is the minimum time between scans. - -@node ntpd var -@subsection var option -@cindex ntpd-var - -This is the ``make arg an ntp variable (rw)'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - - - -@node ntpd dvar -@subsection dvar option -@cindex ntpd-dvar - -This is the ``make arg an ntp variable (rw|def)'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - - - -@node ntpd slew -@subsection slew option (-x) -@cindex ntpd-slew - -This is the ``slew up to 600 seconds'' option. -Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. -This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. -Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. -Thus, an adjustment as much as 600 s will take almost 14 days to complete. -This option can be used with the --g -and --q -options. -See the -tinker -configuration file directive for other options. -Note: The kernel time discipline is disabled with this option. - -@node ntpd usepcc -@subsection usepcc option -@cindex ntpd-usepcc - -This is the ``use cpu cycle counter (windows only)'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{SYS_WINNT} during the compilation. -@end itemize - -Attempt to substitute the CPU counter for QueryPerformanceCounter. -The CPU counter and QueryPerformanceCounter are compared, and if -they have the same frequency, the CPU counter (RDTSC on x86) is -used directly, saving the overhead of a system call. - -@node ntpd pccfreq -@subsection pccfreq option -@cindex ntpd-pccfreq - -This is the ``force cpu cycle counter use (windows only)'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{SYS_WINNT} during the compilation. -@end itemize - -Force substitution the CPU counter for QueryPerformanceCounter. -The CPU counter (RDTSC on x86) is used unconditionally with the -given frequency (in Hz). diff --git a/ntpd/ntpd.1 b/ntpd/ntpd.1 index 85a02f529..fade6b49a 100644 --- a/ntpd/ntpd.1 +++ b/ntpd/ntpd.1 @@ -1,7 +1,7 @@ -.TH NTPD 1 2010-11-14 "( 4.2.6p3-RC10)" "Programmer's Manual" +.TH NTPD 1 2010-11-19 "( 4.2.6p3-RC10)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntpd.1) .\" -.\" It has been AutoGen-ed November 14, 2010 at 08:54:05 AM by AutoGen 5.10 +.\" It has been AutoGen-ed November 19, 2010 at 11:46:44 PM by AutoGen 5.11.3 .\" From the definitions ntpd-opts.def .\" and the template file agman1.tpl .\" diff --git a/ntpdc/ntpdc-opts.c b/ntpdc/ntpdc-opts.c index c7b293395..c47999cde 100644 --- a/ntpdc/ntpdc-opts.c +++ b/ntpdc/ntpdc-opts.c @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.c) * - * It has been AutoGen-ed November 14, 2010 at 08:54:11 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:46:55 PM by AutoGen 5.11.3 * From the definitions ntpdc-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This source file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntpdc author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpdc author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -70,10 +68,10 @@ extern tUsageProc optionUsage; * Ipv4 option description with * "Must also have options" and "Incompatible options": */ -tSCC zIpv4Text[] = +static char const zIpv4Text[] = "Force IPv4 DNS name resolution"; -tSCC zIpv4_NAME[] = "IPV4"; -tSCC zIpv4_Name[] = "ipv4"; +static char const zIpv4_NAME[] = "IPV4"; +static char const zIpv4_Name[] = "ipv4"; static const int aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; @@ -83,10 +81,10 @@ static const int * Ipv6 option description with * "Must also have options" and "Incompatible options": */ -tSCC zIpv6Text[] = +static char const zIpv6Text[] = "Force IPv6 DNS name resolution"; -tSCC zIpv6_NAME[] = "IPV6"; -tSCC zIpv6_Name[] = "ipv6"; +static char const zIpv6_NAME[] = "IPV6"; +static char const zIpv6_Name[] = "ipv6"; static const int aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; @@ -95,10 +93,10 @@ static const int /* * Command option description: */ -tSCC zCommandText[] = +static char const zCommandText[] = "run a command and exit"; -tSCC zCommand_NAME[] = "COMMAND"; -tSCC zCommand_Name[] = "command"; +static char const zCommand_NAME[] = "COMMAND"; +static char const zCommand_Name[] = "command"; #define COMMAND_FLAGS (OPTST_DISABLED | OPTST_STACKED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -106,10 +104,10 @@ tSCC zCommand_Name[] = "command"; * Listpeers option description with * "Must also have options" and "Incompatible options": */ -tSCC zListpeersText[] = +static char const zListpeersText[] = "Print a list of the peers"; -tSCC zListpeers_NAME[] = "LISTPEERS"; -tSCC zListpeers_Name[] = "listpeers"; +static char const zListpeers_NAME[] = "LISTPEERS"; +static char const zListpeers_Name[] = "listpeers"; static const int aListpeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; @@ -119,10 +117,10 @@ static const int * Peers option description with * "Must also have options" and "Incompatible options": */ -tSCC zPeersText[] = +static char const zPeersText[] = "Print a list of the peers"; -tSCC zPeers_NAME[] = "PEERS"; -tSCC zPeers_Name[] = "peers"; +static char const zPeers_NAME[] = "PEERS"; +static char const zPeers_Name[] = "peers"; static const int aPeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; @@ -132,10 +130,10 @@ static const int * Showpeers option description with * "Must also have options" and "Incompatible options": */ -tSCC zShowpeersText[] = +static char const zShowpeersText[] = "Show a list of the peers"; -tSCC zShowpeers_NAME[] = "SHOWPEERS"; -tSCC zShowpeers_Name[] = "showpeers"; +static char const zShowpeers_NAME[] = "SHOWPEERS"; +static char const zShowpeers_Name[] = "showpeers"; static const int aShowpeersCantList[] = { INDEX_OPT_COMMAND, NO_EQUIVALENT }; @@ -145,10 +143,10 @@ static const int * Interactive option description with * "Must also have options" and "Incompatible options": */ -tSCC zInteractiveText[] = +static char const zInteractiveText[] = "Force ntpq to operate in interactive mode"; -tSCC zInteractive_NAME[] = "INTERACTIVE"; -tSCC zInteractive_Name[] = "interactive"; +static char const zInteractive_NAME[] = "INTERACTIVE"; +static char const zInteractive_Name[] = "interactive"; static const int aInteractiveCantList[] = { INDEX_OPT_COMMAND, @@ -160,40 +158,40 @@ static const int /* * Debug_Level option description: */ -tSCC zDebug_LevelText[] = +static char const zDebug_LevelText[] = "Increase output debug message level"; -tSCC zDebug_Level_NAME[] = "DEBUG_LEVEL"; -tSCC zDebug_Level_Name[] = "debug-level"; +static char const zDebug_Level_NAME[] = "DEBUG_LEVEL"; +static char const zDebug_Level_Name[] = "debug-level"; #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * Set_Debug_Level option description: */ -tSCC zSet_Debug_LevelText[] = +static char const zSet_Debug_LevelText[] = "Set the output debug message level"; -tSCC zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; -tSCC zSet_Debug_Level_Name[] = "set-debug-level"; +static char const zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; +static char const zSet_Debug_Level_Name[] = "set-debug-level"; #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Numeric option description: */ -tSCC zNumericText[] = +static char const zNumericText[] = "numeric host addresses"; -tSCC zNumeric_NAME[] = "NUMERIC"; -tSCC zNumeric_Name[] = "numeric"; +static char const zNumeric_NAME[] = "NUMERIC"; +static char const zNumeric_Name[] = "numeric"; #define NUMERIC_FLAGS (OPTST_DISABLED) /* * Help/More_Help/Version option descriptions: */ -tSCC zHelpText[] = "Display extended usage information and exit"; -tSCC zHelp_Name[] = "help"; +static char const zHelpText[] = "Display extended usage information and exit"; +static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) -tSCC zMore_Help_Name[] = "more-help"; -tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; +static char const zMore_Help_Name[] = "more-help"; +static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL @@ -206,14 +204,14 @@ tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif -tSCC zVersionText[] = "Output version information and exit"; -tSCC zVersion_Name[] = "version"; -tSCC zSave_OptsText[] = "Save the option state to a config file"; -tSCC zSave_Opts_Name[] = "save-opts"; -tSCC zLoad_OptsText[] = "Load options from a config file"; -tSCC zLoad_Opts_NAME[] = "LOAD_OPTS"; -tSCC zNotLoad_Opts_Name[] = "no-load-opts"; -tSCC zNotLoad_Opts_Pfx[] = "no"; +static char const zVersionText[] = "Output version information and exit"; +static char const zVersion_Name[] = "version"; +static char const zSave_OptsText[] = "Save the option state to a config file"; +static char const zSave_Opts_Name[] = "save-opts"; +static char const zLoad_OptsText[] = "Load options from a config file"; +static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; +static char const zNotLoad_Opts_Name[] = "no-load-opts"; +static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures @@ -223,8 +221,6 @@ tSCC zNotLoad_Opts_Pfx[] = "no"; * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ -extern tOptProc - optionPagedUsage, optionStackArg, optionVersionStderr; static tOptProc doUsageOpt; @@ -239,7 +235,10 @@ static tOptProc * When not under test, there are different procs to use */ extern tOptProc - optionPagedUsage, optionPrintVersion, optionStackArg; + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeVal, optionUnstackArg, + optionVersionStderr; static tOptProc doOptSet_Debug_Level, doUsageOpt; @@ -480,7 +479,7 @@ configuration options which can be specified at startup using\n\ ntpd's configuration file may also be specified at run time using\n\ [= prog-name =] .\n"; tSCC zFullVersion[] = NTPDC_FULL_VERSION; -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 493 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -501,7 +500,8 @@ tOptions ntpdcOptions = { + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT - + OPTPROC_ENVIRON ), + + OPTPROC_ENVIRON + + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zCopyrightNotice, @@ -533,7 +533,7 @@ doUsageOpt( tOptDesc* pOptDesc ) { (void)pOptions; - USAGE( EXIT_SUCCESS ); + USAGE(EXIT_SUCCESS); } #if ! defined(TEST_NTPDC_OPTS) @@ -549,22 +549,25 @@ doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); } #endif /* defined(TEST_NTPDC_OPTS) */ -/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */ +/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */ #if defined(TEST_NTPDC_OPTS) /* TEST MAIN PROCEDURE: */ -extern void optionPutShell( tOptions* ); +extern void optionPutShell(tOptions*); int main(int argc, char** argv) { int res = EXIT_SUCCESS; - (void)optionProcess( &ntpdcOptions, argc, argv ); - optionPutShell( &ntpdcOptions ); + (void)optionProcess(&ntpdcOptions, argc, argv); + optionPutShell(&ntpdcOptions); + res = ferror(stdout); + if (res != 0) + fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTPDC_OPTS */ -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 626 */ #if ENABLE_NLS #include @@ -573,11 +576,11 @@ main(int argc, char** argv) #include #include -static char* AO_gettext( char const* pz ); +static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* -AO_gettext( char const* pz ) +AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) @@ -585,10 +588,10 @@ AO_gettext( char const* pz ) pzRes = _(pz); if (pzRes == pz) return pzRes; - pzRes = strdup( pzRes ); + pzRes = strdup(pzRes); if (pzRes == NULL) { - fputs( _("No memory for duping translated strings\n"), stderr ); - exit( EXIT_FAILURE ); + fputs(_("No memory for duping translated strings\n"), stderr); + exit(EXIT_FAILURE); } return pzRes; } @@ -601,7 +604,7 @@ static void coerce_it(void** s) { *s = AO_gettext(*s); } * This invokes the translation code (e.g. gettext(3)). */ static void -translate_option_strings( void ) +translate_option_strings(void) { /* * Guard against re-translation. It won't work. The strings will have diff --git a/ntpdc/ntpdc-opts.h b/ntpdc/ntpdc-opts.h index 7147967ae..b1bcbc19c 100644 --- a/ntpdc/ntpdc-opts.h +++ b/ntpdc/ntpdc-opts.h @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h) * - * It has been AutoGen-ed November 14, 2010 at 08:54:11 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:46:55 PM by AutoGen 5.11.3 * From the definitions ntpdc-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This header file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntpdc author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpdc author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -41,7 +39,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 135168 +#define AO_TEMPLATE_VERSION 135171 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -76,7 +74,7 @@ typedef enum { /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). - * e.g. HAVE_OPT( IPV4 ) + * e.g. HAVE_OPT(IPV4) */ #define DESC(n) (ntpdcOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) @@ -90,7 +88,7 @@ typedef enum { #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ - if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) @@ -177,14 +175,14 @@ typedef enum { /* * Interface defines not associated with particular options */ -#define ERRSKIP_OPTERR STMTS( ntpdcOptions.fOptSet &= ~OPTPROC_ERRSTOP ) -#define ERRSTOP_OPTERR STMTS( ntpdcOptions.fOptSet |= OPTPROC_ERRSTOP ) +#define ERRSKIP_OPTERR STMTS(ntpdcOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(ntpdcOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntpdcOptions.curOptIdx = (n); \ - ntpdcOptions.pzCurOpt = NULL ) + ntpdcOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) -#define USAGE(c) (*ntpdcOptions.pUsageProc)( &ntpdcOptions, c ) -/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */ +#define USAGE(c) (*ntpdcOptions.pUsageProc)(&ntpdcOptions, c) +/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 408 */ /* * * * * * * @@ -199,9 +197,9 @@ extern tOptions ntpdcOptions; #if defined(ENABLE_NLS) # ifndef _ # include - static inline char* aoGetsText( char const* pz ) { + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; - return (char*)gettext( pz ); + return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ diff --git a/ntpdc/ntpdc-opts.texi b/ntpdc/ntpdc-opts.texi index 7c569253a..6a5ecfffb 100644 --- a/ntpdc/ntpdc-opts.texi +++ b/ntpdc/ntpdc-opts.texi @@ -3,274 +3,3 @@ @pindex ntpdc @cindex vendor-specific NTP query program @ignore -# -# EDIT THIS FILE WITH CAUTION (ntpdc-opts.texi) -# -# It has been AutoGen-ed November 14, 2010 at 08:54:21 AM by AutoGen 5.10 -# From the definitions ntpdc-opts.def -# and the template file aginfo.tpl -@end ignore -This program has no explanation. - -The -[= prog-name =] -utility program is used to query an NTP daemon about its -current state and to request changes in that state. -It uses NTP mode 7 control message formats described in the source code. -The program may -be run either in interactive mode or controlled using command line -arguments. -Extensive state and statistics information is available -through the -[= prog-name =] -interface. -In addition, nearly all the -configuration options which can be specified at startup using -ntpd's configuration file may also be specified at run time using -[= prog-name =] . - - - -This section was generated by @strong{AutoGen}, -the aginfo template and the option descriptions for the @command{ntpdc} program. It documents the ntpdc usage text and option meanings. - -This software is released under a specialized copyright license. - -@menu -* ntpdc usage:: ntpdc usage help (-?) -* ntpdc command:: command option (-c) -* ntpdc debug-level:: debug-level option (-d) -* ntpdc interactive:: interactive option (-i) -* ntpdc ipv4:: ipv4 option (-4) -* ntpdc ipv6:: ipv6 option (-6) -* ntpdc listpeers:: listpeers option (-l) -* ntpdc numeric:: numeric option (-n) -* ntpdc peers:: peers option (-p) -* ntpdc set-debug-level:: set-debug-level option (-D) -* ntpdc showpeers:: showpeers option (-s) -@end menu - -@node ntpdc usage -@subsection ntpdc usage help (-?) -@cindex ntpdc usage - -This is the automatically generated usage text for ntpdc: - -@exampleindent 0 -@example -ntpdc - vendor-specific NTP query program - Ver. 4.2.6p3-RC10 -USAGE: ntpdc [ - [] | --[@{=| @}] ]... [ host ...] - Flg Arg Option-Name Description - -4 no ipv4 Force IPv4 DNS name resolution - - prohibits these options: - ipv6 - -6 no ipv6 Force IPv6 DNS name resolution - - prohibits these options: - ipv4 - -c Str command run a command and exit - - may appear multiple times - -l no listpeers Print a list of the peers - - prohibits these options: - command - -p no peers Print a list of the peers - - prohibits these options: - command - -s no showpeers Show a list of the peers - - prohibits these options: - command - -i no interactive Force ntpq to operate in interactive mode - - prohibits these options: - command - listpeers - peers - showpeers - -d no debug-level Increase output debug message level - - may appear multiple times - -D Str set-debug-level Set the output debug message level - - may appear multiple times - -n no numeric numeric host addresses - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -> opt save-opts Save the option state to a config file - -< Str load-opts Load options from a config file - - disabled as --no-load-opts - - may appear multiple times - -Options are specified by doubled hyphens and their name -or by a single hyphen and the flag character. - -The following option preset mechanisms are supported: - - reading file /deacon/users/stenn/.ntprc - - reading file /deacon/backroom/snaps/ntp-stable/ntpdc/.ntprc - - examining environment variables named NTPDC_* - -The -[= prog-name =] -utility program is used to query an NTP daemon about its -current state and to request changes in that state. -It uses NTP mode 7 control message formats described in the source code. -The program may -be run either in interactive mode or controlled using command line -arguments. -Extensive state and statistics information is available -through the -[= prog-name =] -interface. -In addition, nearly all the -configuration options which can be specified at startup using -ntpd's configuration file may also be specified at run time using -[= prog-name =] . - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org -@end example -@exampleindent 4 - -@node ntpdc ipv4 -@subsection ipv4 option (-4) -@cindex ntpdc-ipv4 - -This is the ``force ipv4 dns name resolution'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -ipv6. -@end itemize - -Force DNS resolution of following host names on the command line -to the IPv4 namespace. - -@node ntpdc ipv6 -@subsection ipv6 option (-6) -@cindex ntpdc-ipv6 - -This is the ``force ipv6 dns name resolution'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -ipv4. -@end itemize - -Force DNS resolution of following host names on the command line -to the IPv6 namespace. - -@node ntpdc command -@subsection command option (-c) -@cindex ntpdc-command - -This is the ``run a command and exit'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -The following argument is interpreted as an interactive format command -and is added to the list of commands to be executed on the specified -host(s). - -@node ntpdc listpeers -@subsection listpeers option (-l) -@cindex ntpdc-listpeers - -This is the ``print a list of the peers'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -command. -@end itemize - -Print a list of the peers known to the server as well as a summary of -their state. This is equivalent to the 'listpeers' interactive command. - -@node ntpdc peers -@subsection peers option (-p) -@cindex ntpdc-peers - -This is the ``print a list of the peers'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -command. -@end itemize - -Print a list of the peers known to the server as well as a summary -of their state. This is equivalent to the 'peers' interactive command. - -@node ntpdc showpeers -@subsection showpeers option (-s) -@cindex ntpdc-showpeers - -This is the ``show a list of the peers'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -command. -@end itemize - -Print a list of the peers known to the server as well as a summary -of their state. This is equivalent to the 'dmpeers' interactive command. - -@node ntpdc interactive -@subsection interactive option (-i) -@cindex ntpdc-interactive - -This is the ``force ntpq to operate in interactive mode'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -command, listpeers, peers, showpeers. -@end itemize - -Force ntpq to operate in interactive mode. Prompts will be written -to the standard output and commands read from the standard input. - -@node ntpdc debug-level -@subsection debug-level option (-d) -@cindex ntpdc-debug-level - -This is the ``increase output debug message level'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Increase the debugging message output level. - -@node ntpdc set-debug-level -@subsection set-debug-level option (-D) -@cindex ntpdc-set-debug-level - -This is the ``set the output debug message level'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Set the output debugging level. Can be supplied multiple times, -but each overrides the previous value(s). - -@node ntpdc numeric -@subsection numeric option (-n) -@cindex ntpdc-numeric - -This is the ``numeric host addresses'' option. -Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. diff --git a/ntpdc/ntpdc.1 b/ntpdc/ntpdc.1 index 17563bb37..deb3bec5c 100644 --- a/ntpdc/ntpdc.1 +++ b/ntpdc/ntpdc.1 @@ -1,7 +1,7 @@ -.TH NTPDC 1 2010-11-14 "( 4.2.6p3-RC10)" "Programmer's Manual" +.TH NTPDC 1 2010-11-19 "( 4.2.6p3-RC10)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntpdc.1) .\" -.\" It has been AutoGen-ed November 14, 2010 at 08:54:21 AM by AutoGen 5.10 +.\" It has been AutoGen-ed November 19, 2010 at 11:47:05 PM by AutoGen 5.11.3 .\" From the definitions ntpdc-opts.def .\" and the template file agman1.tpl .\" diff --git a/ntpq/ntpq-opts.c b/ntpq/ntpq-opts.c index a790bad1e..483f4b599 100644 --- a/ntpq/ntpq-opts.c +++ b/ntpq/ntpq-opts.c @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpq-opts.c) * - * It has been AutoGen-ed November 14, 2010 at 08:54:21 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:47:06 PM by AutoGen 5.11.3 * From the definitions ntpq-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This source file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntpq author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpq author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -70,10 +68,10 @@ extern tUsageProc optionUsage; * Ipv4 option description with * "Must also have options" and "Incompatible options": */ -tSCC zIpv4Text[] = +static char const zIpv4Text[] = "Force IPv4 DNS name resolution"; -tSCC zIpv4_NAME[] = "IPV4"; -tSCC zIpv4_Name[] = "ipv4"; +static char const zIpv4_NAME[] = "IPV4"; +static char const zIpv4_Name[] = "ipv4"; static const int aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; @@ -83,10 +81,10 @@ static const int * Ipv6 option description with * "Must also have options" and "Incompatible options": */ -tSCC zIpv6Text[] = +static char const zIpv6Text[] = "Force IPv6 DNS name resolution"; -tSCC zIpv6_NAME[] = "IPV6"; -tSCC zIpv6_Name[] = "ipv6"; +static char const zIpv6_NAME[] = "IPV6"; +static char const zIpv6_Name[] = "ipv6"; static const int aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; @@ -95,29 +93,29 @@ static const int /* * Command option description: */ -tSCC zCommandText[] = +static char const zCommandText[] = "run a command and exit"; -tSCC zCommand_NAME[] = "COMMAND"; -tSCC zCommand_Name[] = "command"; +static char const zCommand_NAME[] = "COMMAND"; +static char const zCommand_Name[] = "command"; #define COMMAND_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Debug_Level option description: */ -tSCC zDebug_LevelText[] = +static char const zDebug_LevelText[] = "Increase output debug message level"; -tSCC zDebug_Level_NAME[] = "DEBUG_LEVEL"; -tSCC zDebug_Level_Name[] = "debug-level"; +static char const zDebug_Level_NAME[] = "DEBUG_LEVEL"; +static char const zDebug_Level_Name[] = "debug-level"; #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * Set_Debug_Level option description: */ -tSCC zSet_Debug_LevelText[] = +static char const zSet_Debug_LevelText[] = "Set the output debug message level"; -tSCC zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; -tSCC zSet_Debug_Level_Name[] = "set-debug-level"; +static char const zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; +static char const zSet_Debug_Level_Name[] = "set-debug-level"; #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -125,10 +123,10 @@ tSCC zSet_Debug_Level_Name[] = "set-debug-level"; * Peers option description with * "Must also have options" and "Incompatible options": */ -tSCC zPeersText[] = +static char const zPeersText[] = "Print a list of the peers"; -tSCC zPeers_NAME[] = "PEERS"; -tSCC zPeers_Name[] = "peers"; +static char const zPeers_NAME[] = "PEERS"; +static char const zPeers_Name[] = "peers"; static const int aPeersCantList[] = { INDEX_OPT_INTERACTIVE, NO_EQUIVALENT }; @@ -138,10 +136,10 @@ static const int * Interactive option description with * "Must also have options" and "Incompatible options": */ -tSCC zInteractiveText[] = +static char const zInteractiveText[] = "Force ntpq to operate in interactive mode"; -tSCC zInteractive_NAME[] = "INTERACTIVE"; -tSCC zInteractive_Name[] = "interactive"; +static char const zInteractive_NAME[] = "INTERACTIVE"; +static char const zInteractive_Name[] = "interactive"; static const int aInteractiveCantList[] = { INDEX_OPT_COMMAND, @@ -151,30 +149,30 @@ static const int /* * Numeric option description: */ -tSCC zNumericText[] = +static char const zNumericText[] = "numeric host addresses"; -tSCC zNumeric_NAME[] = "NUMERIC"; -tSCC zNumeric_Name[] = "numeric"; +static char const zNumeric_NAME[] = "NUMERIC"; +static char const zNumeric_Name[] = "numeric"; #define NUMERIC_FLAGS (OPTST_DISABLED) /* * Old_Rv option description: */ -tSCC zOld_RvText[] = +static char const zOld_RvText[] = "Always output status line with readvar"; -tSCC zOld_Rv_NAME[] = "OLD_RV"; -tSCC zOld_Rv_Name[] = "old-rv"; +static char const zOld_Rv_NAME[] = "OLD_RV"; +static char const zOld_Rv_Name[] = "old-rv"; #define OLD_RV_FLAGS (OPTST_DISABLED) /* * Help/More_Help/Version option descriptions: */ -tSCC zHelpText[] = "Display extended usage information and exit"; -tSCC zHelp_Name[] = "help"; +static char const zHelpText[] = "Display extended usage information and exit"; +static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) -tSCC zMore_Help_Name[] = "more-help"; -tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; +static char const zMore_Help_Name[] = "more-help"; +static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL @@ -187,14 +185,14 @@ tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif -tSCC zVersionText[] = "Output version information and exit"; -tSCC zVersion_Name[] = "version"; -tSCC zSave_OptsText[] = "Save the option state to a config file"; -tSCC zSave_Opts_Name[] = "save-opts"; -tSCC zLoad_OptsText[] = "Load options from a config file"; -tSCC zLoad_Opts_NAME[] = "LOAD_OPTS"; -tSCC zNotLoad_Opts_Name[] = "no-load-opts"; -tSCC zNotLoad_Opts_Pfx[] = "no"; +static char const zVersionText[] = "Output version information and exit"; +static char const zVersion_Name[] = "version"; +static char const zSave_OptsText[] = "Save the option state to a config file"; +static char const zSave_Opts_Name[] = "save-opts"; +static char const zLoad_OptsText[] = "Load options from a config file"; +static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; +static char const zNotLoad_Opts_Name[] = "no-load-opts"; +static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures @@ -205,7 +203,7 @@ tSCC zNotLoad_Opts_Pfx[] = "no"; * if multiple copies are allowed. */ extern tOptProc - optionPagedUsage, optionStackArg, optionVersionStderr; + optionStackArg; static tOptProc doUsageOpt; @@ -222,7 +220,10 @@ static tOptProc * When not under test, there are different procs to use */ extern tOptProc - ntpq_custom_opt_handler, optionPagedUsage, optionPrintVersion; + ntpq_custom_opt_handler, optionBooleanVal, optionNestedVal, + optionNumericVal, optionPagedUsage, optionPrintVersion, + optionResetOpt, optionStackArg, optionTimeVal, + optionUnstackArg, optionVersionStderr; static tOptProc doOptSet_Debug_Level, doUsageOpt; @@ -447,7 +448,7 @@ information about current state and/or changes in that state.\n\ The same formats are used in NTPv4, although some of the\n\ variables have changed and new ones added.\n"; tSCC zFullVersion[] = NTPQ_FULL_VERSION; -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 493 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -468,7 +469,8 @@ tOptions ntpqOptions = { + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT - + OPTPROC_ENVIRON ), + + OPTPROC_ENVIRON + + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zCopyrightNotice, @@ -500,7 +502,7 @@ doUsageOpt( tOptDesc* pOptDesc ) { (void)pOptions; - USAGE( EXIT_SUCCESS ); + USAGE(EXIT_SUCCESS); } #if ! defined(TEST_NTPQ_OPTS) @@ -516,22 +518,25 @@ doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc) DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg ); } #endif /* defined(TEST_NTPQ_OPTS) */ -/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */ +/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */ #if defined(TEST_NTPQ_OPTS) /* TEST MAIN PROCEDURE: */ -extern void optionPutShell( tOptions* ); +extern void optionPutShell(tOptions*); int main(int argc, char** argv) { int res = EXIT_SUCCESS; - (void)optionProcess( &ntpqOptions, argc, argv ); - optionPutShell( &ntpqOptions ); + (void)optionProcess(&ntpqOptions, argc, argv); + optionPutShell(&ntpqOptions); + res = ferror(stdout); + if (res != 0) + fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTPQ_OPTS */ -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 626 */ #if ENABLE_NLS #include @@ -540,11 +545,11 @@ main(int argc, char** argv) #include #include -static char* AO_gettext( char const* pz ); +static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* -AO_gettext( char const* pz ) +AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) @@ -552,10 +557,10 @@ AO_gettext( char const* pz ) pzRes = _(pz); if (pzRes == pz) return pzRes; - pzRes = strdup( pzRes ); + pzRes = strdup(pzRes); if (pzRes == NULL) { - fputs( _("No memory for duping translated strings\n"), stderr ); - exit( EXIT_FAILURE ); + fputs(_("No memory for duping translated strings\n"), stderr); + exit(EXIT_FAILURE); } return pzRes; } @@ -568,7 +573,7 @@ static void coerce_it(void** s) { *s = AO_gettext(*s); } * This invokes the translation code (e.g. gettext(3)). */ static void -translate_option_strings( void ) +translate_option_strings(void) { /* * Guard against re-translation. It won't work. The strings will have diff --git a/ntpq/ntpq-opts.h b/ntpq/ntpq-opts.h index 24d22c0fe..495a30a76 100644 --- a/ntpq/ntpq-opts.h +++ b/ntpq/ntpq-opts.h @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpq-opts.h) * - * It has been AutoGen-ed November 14, 2010 at 08:54:21 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:47:06 PM by AutoGen 5.11.3 * From the definitions ntpq-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This header file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntpq author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpq author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -41,7 +39,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 135168 +#define AO_TEMPLATE_VERSION 135171 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -75,7 +73,7 @@ typedef enum { /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). - * e.g. HAVE_OPT( IPV4 ) + * e.g. HAVE_OPT(IPV4) */ #define DESC(n) (ntpqOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) @@ -89,7 +87,7 @@ typedef enum { #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ - if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) @@ -170,14 +168,14 @@ typedef enum { /* * Interface defines not associated with particular options */ -#define ERRSKIP_OPTERR STMTS( ntpqOptions.fOptSet &= ~OPTPROC_ERRSTOP ) -#define ERRSTOP_OPTERR STMTS( ntpqOptions.fOptSet |= OPTPROC_ERRSTOP ) +#define ERRSKIP_OPTERR STMTS(ntpqOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(ntpqOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntpqOptions.curOptIdx = (n); \ - ntpqOptions.pzCurOpt = NULL ) + ntpqOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) -#define USAGE(c) (*ntpqOptions.pUsageProc)( &ntpqOptions, c ) -/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */ +#define USAGE(c) (*ntpqOptions.pUsageProc)(&ntpqOptions, c) +/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 408 */ /* * * * * * * @@ -192,9 +190,9 @@ extern tOptions ntpqOptions; #if defined(ENABLE_NLS) # ifndef _ # include - static inline char* aoGetsText( char const* pz ) { + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; - return (char*)gettext( pz ); + return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ diff --git a/ntpq/ntpq-opts.texi b/ntpq/ntpq-opts.texi index c7b72f831..fcd1e9e23 100644 --- a/ntpq/ntpq-opts.texi +++ b/ntpq/ntpq-opts.texi @@ -3,229 +3,3 @@ @pindex ntpq @cindex standard NTP query program @ignore -# -# EDIT THIS FILE WITH CAUTION (ntpq-opts.texi) -# -# It has been AutoGen-ed November 14, 2010 at 08:54:30 AM by AutoGen 5.10 -# From the definitions ntpq-opts.def -# and the template file aginfo.tpl -@end ignore -This program has no explanation. - -The -[= prog-name =] -utility program is used to query NTP servers which -implement the standard NTP mode 6 control message formats defined -in Appendix B of the NTPv3 specification RFC1305, requesting -information about current state and/or changes in that state. -The same formats are used in NTPv4, although some of the -variables have changed and new ones added. - -This section was generated by @strong{AutoGen}, -the aginfo template and the option descriptions for the @command{ntpq} program. It documents the ntpq usage text and option meanings. - -This software is released under a specialized copyright license. - -@menu -* ntpq usage:: ntpq usage help (-?) -* ntpq command:: command option (-c) -* ntpq debug-level:: debug-level option (-d) -* ntpq interactive:: interactive option (-i) -* ntpq ipv4:: ipv4 option (-4) -* ntpq ipv6:: ipv6 option (-6) -* ntpq numeric:: numeric option (-n) -* ntpq old-rv:: old-rv option -* ntpq peers:: peers option (-p) -* ntpq set-debug-level:: set-debug-level option (-D) -@end menu - -@node ntpq usage -@subsection ntpq usage help (-?) -@cindex ntpq usage - -This is the automatically generated usage text for ntpq: - -@exampleindent 0 -@example -ntpq - standard NTP query program - Ver. 4.2.6p3-RC10 -USAGE: ntpq [ - [] | --[@{=| @}] ]... [ host ...] - Flg Arg Option-Name Description - -4 no ipv4 Force IPv4 DNS name resolution - - prohibits these options: - ipv6 - -6 no ipv6 Force IPv6 DNS name resolution - - prohibits these options: - ipv4 - -c Str command run a command and exit - - may appear multiple times - -d no debug-level Increase output debug message level - - may appear multiple times - -D Str set-debug-level Set the output debug message level - - may appear multiple times - -p no peers Print a list of the peers - - prohibits these options: - interactive - -i no interactive Force ntpq to operate in interactive mode - - prohibits these options: - command - peers - -n no numeric numeric host addresses - no old-rv Always output status line with readvar - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -> opt save-opts Save the option state to a config file - -< Str load-opts Load options from a config file - - disabled as --no-load-opts - - may appear multiple times - -Options are specified by doubled hyphens and their name -or by a single hyphen and the flag character. - -The following option preset mechanisms are supported: - - reading file /deacon/users/stenn/.ntprc - - reading file /deacon/backroom/snaps/ntp-stable/ntpq/.ntprc - - examining environment variables named NTPQ_* - -The -[= prog-name =] -utility program is used to query NTP servers which -implement the standard NTP mode 6 control message formats defined -in Appendix B of the NTPv3 specification RFC1305, requesting -information about current state and/or changes in that state. -The same formats are used in NTPv4, although some of the -variables have changed and new ones added. - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org -@end example -@exampleindent 4 - -@node ntpq ipv4 -@subsection ipv4 option (-4) -@cindex ntpq-ipv4 - -This is the ``force ipv4 dns name resolution'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -ipv6. -@end itemize - -Force DNS resolution of following host names on the command line -to the IPv4 namespace. - -@node ntpq ipv6 -@subsection ipv6 option (-6) -@cindex ntpq-ipv6 - -This is the ``force ipv6 dns name resolution'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -ipv4. -@end itemize - -Force DNS resolution of following host names on the command line -to the IPv6 namespace. - -@node ntpq command -@subsection command option (-c) -@cindex ntpq-command - -This is the ``run a command and exit'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -The following argument is interpreted as an interactive format command -and is added to the list of commands to be executed on the specified -host(s). - -@node ntpq debug-level -@subsection debug-level option (-d) -@cindex ntpq-debug-level - -This is the ``increase output debug message level'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Increase the debugging message output level. - -@node ntpq set-debug-level -@subsection set-debug-level option (-D) -@cindex ntpq-set-debug-level - -This is the ``set the output debug message level'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Set the output debugging level. Can be supplied multiple times, -but each overrides the previous value(s). - -@node ntpq peers -@subsection peers option (-p) -@cindex ntpq-peers - -This is the ``print a list of the peers'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -interactive. -@end itemize - -Print a list of the peers known to the server as well as a summary -of their state. This is equivalent to the 'peers' interactive command. - -@node ntpq interactive -@subsection interactive option (-i) -@cindex ntpq-interactive - -This is the ``force ntpq to operate in interactive mode'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -command, peers. -@end itemize - -Force ntpq to operate in interactive mode. Prompts will be written -to the standard output and commands read from the standard input. - -@node ntpq numeric -@subsection numeric option (-n) -@cindex ntpq-numeric - -This is the ``numeric host addresses'' option. -Output all host addresses in dotted-quad numeric format rather than -converting to the canonical host names. - -@node ntpq old-rv -@subsection old-rv option -@cindex ntpq-old-rv - -This is the ``always output status line with readvar'' option. -By default, ntpq now suppresses the associd=... line that -precedes the output of "readvar" (alias "rv") when a single -variable is requested, such as ntpq -c "rv 0 offset". This -option causes ntpq to include both lines of output for a -single-variable readvar. Using an environment variable to -preset this option in a script will enable both older and -newer ntpq to behave identically in this regard. diff --git a/ntpq/ntpq.1 b/ntpq/ntpq.1 index 95cd596a8..cc35dee1e 100644 --- a/ntpq/ntpq.1 +++ b/ntpq/ntpq.1 @@ -1,7 +1,7 @@ -.TH NTPQ 1 2010-11-14 "( 4.2.6p3-RC10)" "Programmer's Manual" +.TH NTPQ 1 2010-11-19 "( 4.2.6p3-RC10)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntpq.1) .\" -.\" It has been AutoGen-ed November 14, 2010 at 08:54:30 AM by AutoGen 5.10 +.\" It has been AutoGen-ed November 19, 2010 at 11:47:22 PM by AutoGen 5.11.3 .\" From the definitions ntpq-opts.def .\" and the template file agman1.tpl .\" diff --git a/ntpsnmpd/ntpsnmpd-opts.c b/ntpsnmpd/ntpsnmpd-opts.c index 844a46b10..128dfbbe2 100644 --- a/ntpsnmpd/ntpsnmpd-opts.c +++ b/ntpsnmpd/ntpsnmpd-opts.c @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c) * - * It has been AutoGen-ed November 14, 2010 at 08:54:33 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:47:23 PM by AutoGen 5.11.3 * From the definitions ntpsnmpd-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This source file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntpsnmpd author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpsnmpd author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -60,41 +58,41 @@ extern tUsageProc optionUsage; /* * Nofork option description: */ -tSCC zNoforkText[] = +static char const zNoforkText[] = "Do not fork"; -tSCC zNofork_NAME[] = "NOFORK"; -tSCC zNofork_Name[] = "nofork"; +static char const zNofork_NAME[] = "NOFORK"; +static char const zNofork_Name[] = "nofork"; #define NOFORK_FLAGS (OPTST_DISABLED) /* * Syslog option description: */ -tSCC zSyslogText[] = +static char const zSyslogText[] = "Log to syslog()"; -tSCC zSyslog_NAME[] = "SYSLOG"; -tSCC zSyslog_Name[] = "syslog"; +static char const zSyslog_NAME[] = "SYSLOG"; +static char const zSyslog_Name[] = "syslog"; #define SYSLOG_FLAGS (OPTST_DISABLED) /* * Agentxsocket option description: */ -tSCC zAgentxsocketText[] = +static char const zAgentxsocketText[] = "The socket address ntpsnmpd uses to connect to net-snmpd"; -tSCC zAgentxsocket_NAME[] = "AGENTXSOCKET"; -tSCC zAgentxsocket_Name[] = "agentxsocket"; -tSCC zAgentxsocketDefaultArg[] = "unix:/var/agentx/master"; +static char const zAgentxsocket_NAME[] = "AGENTXSOCKET"; +static char const zAgentxsocket_Name[] = "agentxsocket"; +static char const zAgentxsocketDefaultArg[] = "unix:/var/agentx/master"; #define AGENTXSOCKET_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Help/More_Help/Version option descriptions: */ -tSCC zHelpText[] = "Display extended usage information and exit"; -tSCC zHelp_Name[] = "help"; +static char const zHelpText[] = "Display extended usage information and exit"; +static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) -tSCC zMore_Help_Name[] = "more-help"; -tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; +static char const zMore_Help_Name[] = "more-help"; +static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL @@ -107,14 +105,14 @@ tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif -tSCC zVersionText[] = "Output version information and exit"; -tSCC zVersion_Name[] = "version"; -tSCC zSave_OptsText[] = "Save the option state to a config file"; -tSCC zSave_Opts_Name[] = "save-opts"; -tSCC zLoad_OptsText[] = "Load options from a config file"; -tSCC zLoad_Opts_NAME[] = "LOAD_OPTS"; -tSCC zNotLoad_Opts_Name[] = "no-load-opts"; -tSCC zNotLoad_Opts_Pfx[] = "no"; +static char const zVersionText[] = "Output version information and exit"; +static char const zVersion_Name[] = "version"; +static char const zSave_OptsText[] = "Save the option state to a config file"; +static char const zSave_Opts_Name[] = "save-opts"; +static char const zLoad_OptsText[] = "Load options from a config file"; +static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; +static char const zNotLoad_Opts_Name[] = "no-load-opts"; +static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures @@ -124,8 +122,6 @@ tSCC zNotLoad_Opts_Pfx[] = "no"; * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ -extern tOptProc - optionPagedUsage, optionVersionStderr; static tOptProc doUsageOpt; @@ -134,7 +130,10 @@ static tOptProc * When not under test, there are different procs to use */ extern tOptProc - optionPagedUsage, optionPrintVersion; + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeVal, optionUnstackArg, + optionVersionStderr; static tOptProc doUsageOpt; #endif /* defined(TEST_NTPSNMPD_OPTS) */ @@ -268,7 +267,7 @@ tSCC zBugsAddr[] = "http://bugs.ntp.org, bugs@ntp.org"; #define zExplain NULL #define zDetail NULL tSCC zFullVersion[] = NTPSNMPD_FULL_VERSION; -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 493 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -290,7 +289,8 @@ tOptions ntpsnmpdOptions = { + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON - + OPTPROC_NO_ARGS ), + + OPTPROC_NO_ARGS + + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zCopyrightNotice, @@ -322,24 +322,27 @@ doUsageOpt( tOptDesc* pOptDesc ) { (void)pOptions; - USAGE( EXIT_SUCCESS ); + USAGE(EXIT_SUCCESS); } -/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */ +/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */ #if defined(TEST_NTPSNMPD_OPTS) /* TEST MAIN PROCEDURE: */ -extern void optionPutShell( tOptions* ); +extern void optionPutShell(tOptions*); int main(int argc, char** argv) { int res = EXIT_SUCCESS; - (void)optionProcess( &ntpsnmpdOptions, argc, argv ); - optionPutShell( &ntpsnmpdOptions ); + (void)optionProcess(&ntpsnmpdOptions, argc, argv); + optionPutShell(&ntpsnmpdOptions); + res = ferror(stdout); + if (res != 0) + fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTPSNMPD_OPTS */ -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 626 */ #if ENABLE_NLS #include @@ -348,11 +351,11 @@ main(int argc, char** argv) #include #include -static char* AO_gettext( char const* pz ); +static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* -AO_gettext( char const* pz ) +AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) @@ -360,10 +363,10 @@ AO_gettext( char const* pz ) pzRes = _(pz); if (pzRes == pz) return pzRes; - pzRes = strdup( pzRes ); + pzRes = strdup(pzRes); if (pzRes == NULL) { - fputs( _("No memory for duping translated strings\n"), stderr ); - exit( EXIT_FAILURE ); + fputs(_("No memory for duping translated strings\n"), stderr); + exit(EXIT_FAILURE); } return pzRes; } @@ -376,7 +379,7 @@ static void coerce_it(void** s) { *s = AO_gettext(*s); } * This invokes the translation code (e.g. gettext(3)). */ static void -translate_option_strings( void ) +translate_option_strings(void) { /* * Guard against re-translation. It won't work. The strings will have diff --git a/ntpsnmpd/ntpsnmpd-opts.h b/ntpsnmpd/ntpsnmpd-opts.h index 7d4ecd53b..b2aa2639f 100644 --- a/ntpsnmpd/ntpsnmpd-opts.h +++ b/ntpsnmpd/ntpsnmpd-opts.h @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h) * - * It has been AutoGen-ed November 14, 2010 at 08:54:33 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:47:23 PM by AutoGen 5.11.3 * From the definitions ntpsnmpd-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This header file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntpsnmpd author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpsnmpd author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -41,7 +39,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 135168 +#define AO_TEMPLATE_VERSION 135171 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -69,7 +67,7 @@ typedef enum { /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). - * e.g. HAVE_OPT( NOFORK ) + * e.g. HAVE_OPT(NOFORK) */ #define DESC(n) (ntpsnmpdOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) @@ -83,7 +81,7 @@ typedef enum { #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ - if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) @@ -128,14 +126,14 @@ typedef enum { /* * Interface defines not associated with particular options */ -#define ERRSKIP_OPTERR STMTS( ntpsnmpdOptions.fOptSet &= ~OPTPROC_ERRSTOP ) -#define ERRSTOP_OPTERR STMTS( ntpsnmpdOptions.fOptSet |= OPTPROC_ERRSTOP ) +#define ERRSKIP_OPTERR STMTS(ntpsnmpdOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(ntpsnmpdOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntpsnmpdOptions.curOptIdx = (n); \ - ntpsnmpdOptions.pzCurOpt = NULL ) + ntpsnmpdOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) -#define USAGE(c) (*ntpsnmpdOptions.pUsageProc)( &ntpsnmpdOptions, c ) -/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */ +#define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c) +/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 408 */ /* * * * * * * @@ -150,9 +148,9 @@ extern tOptions ntpsnmpdOptions; #if defined(ENABLE_NLS) # ifndef _ # include - static inline char* aoGetsText( char const* pz ) { + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; - return (char*)gettext( pz ); + return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ diff --git a/ntpsnmpd/ntpsnmpd-opts.texi b/ntpsnmpd/ntpsnmpd-opts.texi index dae6e1107..eb52ccfa5 100644 --- a/ntpsnmpd/ntpsnmpd-opts.texi +++ b/ntpsnmpd/ntpsnmpd-opts.texi @@ -3,81 +3,3 @@ @pindex ntpsnmpd @cindex NTP SNMP MIB agent @ignore -# -# EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.texi) -# -# It has been AutoGen-ed November 14, 2010 at 08:54:39 AM by AutoGen 5.10 -# From the definitions ntpsnmpd-opts.def -# and the template file aginfo.tpl -@end ignore -This program has no explanation. - - - -This section was generated by @strong{AutoGen}, -the aginfo template and the option descriptions for the @command{ntpsnmpd} program. It documents the ntpsnmpd usage text and option meanings. - -This software is released under a specialized copyright license. - -@menu -* ntpsnmpd usage:: ntpsnmpd usage help (-?) -* ntpsnmpd agentxsocket:: agentxsocket option -* ntpsnmpd nofork:: nofork option (-n) -* ntpsnmpd syslog:: syslog option (-p) -@end menu - -@node ntpsnmpd usage -@subsection ntpsnmpd usage help (-?) -@cindex ntpsnmpd usage - -This is the automatically generated usage text for ntpsnmpd: - -@exampleindent 0 -@example -ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6p3-RC10 -USAGE: ntpsnmpd [ - [] | --[@{=| @}] ]... - Flg Arg Option-Name Description - -n no nofork Do not fork - -p no syslog Log to syslog() - Str agentxsocket The socket address ntpsnmpd uses to connect to net-snmpd - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -> opt save-opts Save the option state to a config file - -< Str load-opts Load options from a config file - - disabled as --no-load-opts - - may appear multiple times - -Options are specified by doubled hyphens and their name -or by a single hyphen and the flag character. - -The following option preset mechanisms are supported: - - reading file /deacon/users/stenn/.ntprc - - reading file /deacon/backroom/snaps/ntp-stable/ntpsnmpd/.ntprc - - examining environment variables named NTPSNMPD_* - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org -@end example -@exampleindent 4 - -@node ntpsnmpd nofork -@subsection nofork option (-n) -@cindex ntpsnmpd-nofork - -This is the ``do not fork'' option. - - -@node ntpsnmpd syslog -@subsection syslog option (-p) -@cindex ntpsnmpd-syslog - -This is the ``log to syslog()'' option. - - -@node ntpsnmpd agentxsocket -@subsection agentxsocket option -@cindex ntpsnmpd-agentxsocket - -This is the ``the socket address ntpsnmpd uses to connect to net-snmpd'' option. -[:] -The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705. diff --git a/ntpsnmpd/ntpsnmpd.1 b/ntpsnmpd/ntpsnmpd.1 index 487f3f21d..1479fb6a7 100644 --- a/ntpsnmpd/ntpsnmpd.1 +++ b/ntpsnmpd/ntpsnmpd.1 @@ -1,7 +1,7 @@ -.TH NTPSNMPD 1 2010-11-14 "( 4.2.6p3-RC10)" "Programmer's Manual" +.TH NTPSNMPD 1 2010-11-19 "( 4.2.6p3-RC10)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntpsnmpd.1) .\" -.\" It has been AutoGen-ed November 14, 2010 at 08:54:38 AM by AutoGen 5.10 +.\" It has been AutoGen-ed November 19, 2010 at 11:47:33 PM by AutoGen 5.11.3 .\" From the definitions ntpsnmpd-opts.def .\" and the template file agman1.tpl .\" diff --git a/sntp/sntp-opts.c b/sntp/sntp-opts.c index 8f53fcb76..0f1fd3c45 100644 --- a/sntp/sntp-opts.c +++ b/sntp/sntp-opts.c @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.c) * - * It has been AutoGen-ed November 14, 2010 at 08:55:47 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:48:43 PM by AutoGen 5.11.3 * From the definitions sntp-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This source file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * sntp author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the sntp author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -61,10 +59,10 @@ extern tUsageProc optionUsage; * Ipv4 option description with * "Must also have options" and "Incompatible options": */ -tSCC zIpv4Text[] = +static char const zIpv4Text[] = "Force IPv4 DNS name resolution"; -tSCC zIpv4_NAME[] = "IPV4"; -tSCC zIpv4_Name[] = "ipv4"; +static char const zIpv4_NAME[] = "IPV4"; +static char const zIpv4_Name[] = "ipv4"; static const int aIpv4CantList[] = { INDEX_OPT_IPV6, NO_EQUIVALENT }; @@ -74,10 +72,10 @@ static const int * Ipv6 option description with * "Must also have options" and "Incompatible options": */ -tSCC zIpv6Text[] = +static char const zIpv6Text[] = "Force IPv6 DNS name resolution"; -tSCC zIpv6_NAME[] = "IPV6"; -tSCC zIpv6_Name[] = "ipv6"; +static char const zIpv6_NAME[] = "IPV6"; +static char const zIpv6_Name[] = "ipv6"; static const int aIpv6CantList[] = { INDEX_OPT_IPV4, NO_EQUIVALENT }; @@ -86,19 +84,19 @@ static const int /* * Normalverbose option description: */ -tSCC zNormalverboseText[] = +static char const zNormalverboseText[] = "Normal verbose"; -tSCC zNormalverbose_NAME[] = "NORMALVERBOSE"; -tSCC zNormalverbose_Name[] = "normalverbose"; +static char const zNormalverbose_NAME[] = "NORMALVERBOSE"; +static char const zNormalverbose_Name[] = "normalverbose"; #define NORMALVERBOSE_FLAGS (OPTST_DISABLED) /* * Kod option description: */ -tSCC zKodText[] = +static char const zKodText[] = "KoD history filename"; -tSCC zKod_NAME[] = "KOD"; -tSCC zKod_Name[] = "kod"; +static char const zKod_NAME[] = "KOD"; +static char const zKod_Name[] = "kod"; #define KOD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -106,10 +104,10 @@ tSCC zKod_Name[] = "kod"; * Syslog option description with * "Must also have options" and "Incompatible options": */ -tSCC zSyslogText[] = +static char const zSyslogText[] = "Logging with syslog"; -tSCC zSyslog_NAME[] = "SYSLOG"; -tSCC zSyslog_Name[] = "syslog"; +static char const zSyslog_NAME[] = "SYSLOG"; +static char const zSyslog_Name[] = "syslog"; static const int aSyslogCantList[] = { INDEX_OPT_FILELOG, NO_EQUIVALENT }; @@ -119,10 +117,10 @@ static const int * Filelog option description with * "Must also have options" and "Incompatible options": */ -tSCC zFilelogText[] = +static char const zFilelogText[] = "Log to specified logfile"; -tSCC zFilelog_NAME[] = "FILELOG"; -tSCC zFilelog_Name[] = "filelog"; +static char const zFilelog_NAME[] = "FILELOG"; +static char const zFilelog_Name[] = "filelog"; static const int aFilelogCantList[] = { INDEX_OPT_SYSLOG, NO_EQUIVALENT }; @@ -133,10 +131,10 @@ static const int * Settod option description with * "Must also have options" and "Incompatible options": */ -tSCC zSettodText[] = +static char const zSettodText[] = "Set (step) the time with settimeofday()"; -tSCC zSettod_NAME[] = "SETTOD"; -tSCC zSettod_Name[] = "settod"; +static char const zSettod_NAME[] = "SETTOD"; +static char const zSettod_Name[] = "settod"; static const int aSettodCantList[] = { INDEX_OPT_ADJTIME, NO_EQUIVALENT }; @@ -146,10 +144,10 @@ static const int * Adjtime option description with * "Must also have options" and "Incompatible options": */ -tSCC zAdjtimeText[] = +static char const zAdjtimeText[] = "Set (slew) the time with adjtime()"; -tSCC zAdjtime_NAME[] = "ADJTIME"; -tSCC zAdjtime_Name[] = "adjtime"; +static char const zAdjtime_NAME[] = "ADJTIME"; +static char const zAdjtime_Name[] = "adjtime"; static const int aAdjtimeCantList[] = { INDEX_OPT_SETTOD, NO_EQUIVALENT }; @@ -158,20 +156,20 @@ static const int /* * Broadcast option description: */ -tSCC zBroadcastText[] = +static char const zBroadcastText[] = "Use broadcasts to the address specified for synchronisation"; -tSCC zBroadcast_NAME[] = "BROADCAST"; -tSCC zBroadcast_Name[] = "broadcast"; +static char const zBroadcast_NAME[] = "BROADCAST"; +static char const zBroadcast_Name[] = "broadcast"; #define BROADCAST_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Timeout option description: */ -tSCC zTimeoutText[] = +static char const zTimeoutText[] = "Specify the number of seconds to wait for broadcasts"; -tSCC zTimeout_NAME[] = "TIMEOUT"; -tSCC zTimeout_Name[] = "timeout"; +static char const zTimeout_NAME[] = "TIMEOUT"; +static char const zTimeout_Name[] = "timeout"; #define zTimeoutDefaultArg ((char const*)68) #define TIMEOUT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -179,32 +177,32 @@ tSCC zTimeout_Name[] = "timeout"; /* * Authentication option description: */ -tSCC zAuthenticationText[] = +static char const zAuthenticationText[] = "Enable authentication with the key auth-keynumber"; -tSCC zAuthentication_NAME[] = "AUTHENTICATION"; -tSCC zAuthentication_Name[] = "authentication"; +static char const zAuthentication_NAME[] = "AUTHENTICATION"; +static char const zAuthentication_Name[] = "authentication"; #define AUTHENTICATION_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * Keyfile option description: */ -tSCC zKeyfileText[] = +static char const zKeyfileText[] = "Specify a keyfile. SNTP will look in this file for the key specified with -a"; -tSCC zKeyfile_NAME[] = "KEYFILE"; -tSCC zKeyfile_Name[] = "keyfile"; +static char const zKeyfile_NAME[] = "KEYFILE"; +static char const zKeyfile_Name[] = "keyfile"; #define KEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * Help/More_Help/Version option descriptions: */ -tSCC zHelpText[] = "Display extended usage information and exit"; -tSCC zHelp_Name[] = "help"; +static char const zHelpText[] = "Display extended usage information and exit"; +static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) -tSCC zMore_Help_Name[] = "more-help"; -tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; +static char const zMore_Help_Name[] = "more-help"; +static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL @@ -217,14 +215,14 @@ tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif -tSCC zVersionText[] = "Output version information and exit"; -tSCC zVersion_Name[] = "version"; -tSCC zSave_OptsText[] = "Save the option state to a config file"; -tSCC zSave_Opts_Name[] = "save-opts"; -tSCC zLoad_OptsText[] = "Load options from a config file"; -tSCC zLoad_Opts_NAME[] = "LOAD_OPTS"; -tSCC zNotLoad_Opts_Name[] = "no-load-opts"; -tSCC zNotLoad_Opts_Pfx[] = "no"; +static char const zVersionText[] = "Output version information and exit"; +static char const zVersion_Name[] = "version"; +static char const zSave_OptsText[] = "Save the option state to a config file"; +static char const zSave_Opts_Name[] = "save-opts"; +static char const zLoad_OptsText[] = "Load options from a config file"; +static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; +static char const zNotLoad_Opts_Name[] = "no-load-opts"; +static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures @@ -234,8 +232,6 @@ tSCC zNotLoad_Opts_Pfx[] = "no"; * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ -extern tOptProc - optionNumericVal, optionPagedUsage, optionVersionStderr; static tOptProc doUsageOpt; @@ -244,7 +240,10 @@ static tOptProc * When not under test, there are different procs to use */ extern tOptProc - optionNumericVal, optionPagedUsage, optionPrintVersion; + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeVal, optionUnstackArg, + optionVersionStderr; static tOptProc doUsageOpt; #endif /* defined(TEST_SNTP_OPTS) */ @@ -498,7 +497,7 @@ job.\n\n\ NTP and SNTP are defined by RFC 5905, which\n\ obsoletes RFC 4330 and RFC 1305.\n"; tSCC zFullVersion[] = SNTP_FULL_VERSION; -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 493 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -520,7 +519,8 @@ tOptions sntpOptions = { + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON - + OPTPROC_ARGS_REQ ), + + OPTPROC_ARGS_REQ + + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zCopyrightNotice, @@ -552,24 +552,27 @@ doUsageOpt( tOptDesc* pOptDesc ) { (void)pOptions; - USAGE( EXIT_SUCCESS ); + USAGE(EXIT_SUCCESS); } -/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */ +/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */ #if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */ -extern void optionPutShell( tOptions* ); +extern void optionPutShell(tOptions*); int main(int argc, char** argv) { int res = EXIT_SUCCESS; - (void)optionProcess( &sntpOptions, argc, argv ); - optionPutShell( &sntpOptions ); + (void)optionProcess(&sntpOptions, argc, argv); + optionPutShell(&sntpOptions); + res = ferror(stdout); + if (res != 0) + fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_SNTP_OPTS */ -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 626 */ #if ENABLE_NLS #include @@ -578,11 +581,11 @@ main(int argc, char** argv) #include #include -static char* AO_gettext( char const* pz ); +static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* -AO_gettext( char const* pz ) +AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) @@ -590,10 +593,10 @@ AO_gettext( char const* pz ) pzRes = _(pz); if (pzRes == pz) return pzRes; - pzRes = strdup( pzRes ); + pzRes = strdup(pzRes); if (pzRes == NULL) { - fputs( _("No memory for duping translated strings\n"), stderr ); - exit( EXIT_FAILURE ); + fputs(_("No memory for duping translated strings\n"), stderr); + exit(EXIT_FAILURE); } return pzRes; } @@ -606,7 +609,7 @@ static void coerce_it(void** s) { *s = AO_gettext(*s); } * This invokes the translation code (e.g. gettext(3)). */ static void -translate_option_strings( void ) +translate_option_strings(void) { /* * Guard against re-translation. It won't work. The strings will have diff --git a/sntp/sntp-opts.h b/sntp/sntp-opts.h index 2ed4ec227..b117f0fd2 100644 --- a/sntp/sntp-opts.h +++ b/sntp/sntp-opts.h @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (sntp-opts.h) * - * It has been AutoGen-ed November 14, 2010 at 08:55:47 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:48:43 PM by AutoGen 5.11.3 * From the definitions sntp-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This header file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * sntp author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the sntp author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -41,7 +39,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 135168 +#define AO_TEMPLATE_VERSION 135171 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -78,7 +76,7 @@ typedef enum { /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). - * e.g. HAVE_OPT( IPV4 ) + * e.g. HAVE_OPT(IPV4) */ #define DESC(n) (sntpOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) @@ -92,7 +90,7 @@ typedef enum { #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ - if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) @@ -195,14 +193,14 @@ typedef enum { /* * Interface defines not associated with particular options */ -#define ERRSKIP_OPTERR STMTS( sntpOptions.fOptSet &= ~OPTPROC_ERRSTOP ) -#define ERRSTOP_OPTERR STMTS( sntpOptions.fOptSet |= OPTPROC_ERRSTOP ) +#define ERRSKIP_OPTERR STMTS(sntpOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(sntpOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ sntpOptions.curOptIdx = (n); \ - sntpOptions.pzCurOpt = NULL ) + sntpOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) -#define USAGE(c) (*sntpOptions.pUsageProc)( &sntpOptions, c ) -/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */ +#define USAGE(c) (*sntpOptions.pUsageProc)(&sntpOptions, c) +/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 408 */ /* * * * * * * @@ -217,9 +215,9 @@ extern tOptions sntpOptions; #if defined(ENABLE_NLS) # ifndef _ # include - static inline char* aoGetsText( char const* pz ) { + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; - return (char*)gettext( pz ); + return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ diff --git a/sntp/sntp-opts.texi b/sntp/sntp-opts.texi index bc7cd1dc2..c4a535783 100644 --- a/sntp/sntp-opts.texi +++ b/sntp/sntp-opts.texi @@ -3,216 +3,3 @@ @pindex sntp @cindex standard SNTP program @ignore -# -# EDIT THIS FILE WITH CAUTION (sntp-opts.texi) -# -# It has been AutoGen-ed November 14, 2010 at 08:55:57 AM by AutoGen 5.10 -# From the definitions sntp-opts.def -# and the template file aginfo.tpl -@end ignore -This program has no explanation. - -.I sntp -implements the Simple Network Time Protocol, and is used -to query an NTP or SNTP server and either -display the time -or -set the local system's time (given suitable privilege). - -It can be -run interactively from the command line or as a -.I cron -job. - -NTP and SNTP are defined by RFC 5905, which -obsoletes RFC 4330 and RFC 1305. - -This section was generated by @strong{AutoGen}, -the aginfo template and the option descriptions for the @command{sntp} program. It documents the sntp usage text and option meanings. - -This software is released under a specialized copyright license. - -@menu -* sntp usage:: sntp usage help (-?) -* sntp adjtime:: adjtime option (-j) -* sntp authentication:: authentication option (-a) -* sntp broadcast:: broadcast option (-b) -* sntp filelog:: filelog option (-l) -* sntp ipv4:: ipv4 option (-4) -* sntp ipv6:: ipv6 option (-6) -* sntp keyfile:: keyfile option (-k) -* sntp kod:: kod option (-K) -* sntp normalverbose:: normalverbose option (-d) -* sntp settod:: settod option (-s) -* sntp syslog:: syslog option (-p) -* sntp timeout:: timeout option (-t) -@end menu - -@node sntp usage -@subsection sntp usage help (-?) -@cindex sntp usage - -This is the automatically generated usage text for sntp: - -@exampleindent 0 -@example -sntp is unavailable - no --help -@end example -@exampleindent 4 - -@node sntp ipv4 -@subsection ipv4 option (-4) -@cindex sntp-ipv4 - -This is the ``force ipv4 dns name resolution'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -ipv6. -@end itemize - -Force DNS resolution of following host names on the command line -to the IPv4 namespace. - -@node sntp ipv6 -@subsection ipv6 option (-6) -@cindex sntp-ipv6 - -This is the ``force ipv6 dns name resolution'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -ipv4. -@end itemize - -Force DNS resolution of following host names on the command line -to the IPv6 namespace. - -@node sntp normalverbose -@subsection normalverbose option (-d) -@cindex sntp-normalverbose - -This is the ``normal verbose'' option. -Diagnostic messages for non-fatal errors and a limited amount of -tracing should be written to standard error. Fatal ones always -produce a diagnostic. This option should be set when there is a -suspected problem with the server, network or the source. - -@node sntp kod -@subsection kod option (-K) -@cindex sntp-kod - -This is the ``kod history filename'' option. -Modifies the filename to be used to persist the history of KoD -responses received from servers. The default is -/var/db/ntp-kod. - -@node sntp syslog -@subsection syslog option (-p) -@cindex sntp-syslog - -This is the ``logging with syslog'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -filelog. -@end itemize - -When this option is set all logging will be done using syslog. - -@node sntp filelog -@subsection filelog option (-l) -@cindex sntp-filelog - -This is the ``log to specified logfile'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -syslog. -@end itemize - -This option causes the client to write log messages to the specified -logfile. - -@node sntp settod -@subsection settod option (-s) -@cindex sntp-settod - -This is the ``set (step) the time with settimeofday()'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -adjtime. -@end itemize - - - -@node sntp adjtime -@subsection adjtime option (-j) -@cindex sntp-adjtime - -This is the ``set (slew) the time with adjtime()'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must not appear in combination with any of the following options: -settod. -@end itemize - - - -@node sntp broadcast -@subsection broadcast option (-b) -@cindex sntp-broadcast - -This is the ``use broadcasts to the address specified for synchronisation'' option. -If specified SNTP will listen to the specified broadcast address -for NTP broadcasts. The default maximum wait time, -68 seconds, can be modified with -t. - -@node sntp timeout -@subsection timeout option (-t) -@cindex sntp-timeout - -This is the ``specify the number of seconds to wait for broadcasts'' option. -When waiting for a broadcast packet SNTP will wait the number -of seconds specified before giving up. Default 68 seconds. - -@node sntp authentication -@subsection authentication option (-a) -@cindex sntp-authentication - -This is the ``enable authentication with the key auth-keynumber'' option. -This option enables authentication using the key specified in this option's argument. -The argument of this option is the keyid, a number specified in the keyfile as this -key's identifier. See the keyfile option (-k) for more details. - -@node sntp keyfile -@subsection keyfile option (-k) -@cindex sntp-keyfile - -This is the ``specify a keyfile. sntp will look in this file for the key specified with -a'' option. -This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this -file. Key files follow the following format: - -keyid keytype key - -Where keyid is a number identifying this key -keytype is one of the follow: -S Key in 64 Bit hexadecimal number as specified in in the DES specification. -N Key in 64 Bit hexadecimal number as specified in the NTP standard. -A Key in a 1-to-8 character ASCII string. -M Key in a 1-to-8 character ASCII string using the MD5 authentication scheme. - -For more information see ntp.keys(5). diff --git a/sntp/sntp.1 b/sntp/sntp.1 index 72a609f4f..012556d81 100644 --- a/sntp/sntp.1 +++ b/sntp/sntp.1 @@ -1,7 +1,7 @@ -.TH SNTP 1 2010-11-14 "( 4.2.6p3-RC10)" "Programmer's Manual" +.TH SNTP 1 2010-11-19 "( 4.2.6p3-RC10)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (sntp.1) .\" -.\" It has been AutoGen-ed November 14, 2010 at 08:55:57 AM by AutoGen 5.10 +.\" It has been AutoGen-ed November 19, 2010 at 11:48:53 PM by AutoGen 5.11.3 .\" From the definitions sntp-opts.def .\" and the template file agman1.tpl .\" diff --git a/sntp/sntp.html b/sntp/sntp.html index 59ba97d61..3f600f7f7 100644 --- a/sntp/sntp.html +++ b/sntp/sntp.html @@ -50,9 +50,65 @@ IETF specification. +This program has no explanation. + +

.I sntp +implements the Simple Network Time Protocol, and is used +to query an NTP or SNTP server and either +display the time +or +set the local system's time (given suitable privilege). + +

It can be +run interactively from the command line or as a +.I cron +job. + +

NTP and SNTP are defined by RFC 5905, which +obsoletes RFC 4330 and RFC 1305. + +

This section was generated by AutoGen, +the aginfo template and the option descriptions for the sntp program. It documents the sntp usage text and option meanings. + +

This software is released under a specialized copyright license. + +

+ +
+


+ +
+
+ +

sntp usage help (-?)

+ +

+This is the automatically generated usage text for sntp: + +

sntp is unavailable - no --help
+
+

* Usage:: Usage


@@ -68,7 +124,7 @@ Up: Top

By default, sntp writes the local data and time (i.e., not UTC) to the standard output in the format: -

     1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs
+
    1996 Oct 15 20:17:25.123 +4.567 +/- 0.089 secs
 

where the +4.567 +/- 0.089 secs indicates the time offset and error bound of the system clock relative to the server clock. @@ -88,14 +144,14 @@ Up: Top check the current time, offset, and error in the local clock. For example: -

     sntp ntpserver.somewhere
+
    sntp ntpserver.somewhere
 

With suitable privilege, it can be run as a command or in a crom job to reset the local clock from a reliable server, like the ntpdate and rdate commands. For example: -

     sntp -a ntpserver.somewhere
+
    sntp -a ntpserver.somewhere
 
diff --git a/util/ntp-keygen-opts.c b/util/ntp-keygen-opts.c index ad77dac5e..7db18c3dc 100644 --- a/util/ntp-keygen-opts.c +++ b/util/ntp-keygen-opts.c @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c) * - * It has been AutoGen-ed November 14, 2010 at 08:55:57 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:51:05 PM by AutoGen 5.11.3 * From the definitions ntp-keygen-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This source file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntp-keygen author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntp-keygen author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -72,10 +70,10 @@ extern tUsageProc optionUsage; * Certificate option description: */ #ifdef OPENSSL -tSCC zCertificateText[] = +static char const zCertificateText[] = "certificate scheme"; -tSCC zCertificate_NAME[] = "CERTIFICATE"; -tSCC zCertificate_Name[] = "certificate"; +static char const zCertificate_NAME[] = "CERTIFICATE"; +static char const zCertificate_Name[] = "certificate"; #define CERTIFICATE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -89,19 +87,19 @@ tSCC zCertificate_Name[] = "certificate"; /* * Debug_Level option description: */ -tSCC zDebug_LevelText[] = +static char const zDebug_LevelText[] = "Increase output debug message level"; -tSCC zDebug_Level_NAME[] = "DEBUG_LEVEL"; -tSCC zDebug_Level_Name[] = "debug-level"; +static char const zDebug_Level_NAME[] = "DEBUG_LEVEL"; +static char const zDebug_Level_Name[] = "debug-level"; #define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) /* * Set_Debug_Level option description: */ -tSCC zSet_Debug_LevelText[] = +static char const zSet_Debug_LevelText[] = "Set the output debug message level"; -tSCC zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; -tSCC zSet_Debug_Level_Name[] = "set-debug-level"; +static char const zSet_Debug_Level_NAME[] = "SET_DEBUG_LEVEL"; +static char const zSet_Debug_Level_Name[] = "set-debug-level"; #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -109,10 +107,10 @@ tSCC zSet_Debug_Level_Name[] = "set-debug-level"; * Id_Key option description: */ #ifdef OPENSSL -tSCC zId_KeyText[] = +static char const zId_KeyText[] = "Write IFF or GQ identity keys"; -tSCC zId_Key_NAME[] = "ID_KEY"; -tSCC zId_Key_Name[] = "id-key"; +static char const zId_Key_NAME[] = "ID_KEY"; +static char const zId_Key_Name[] = "id-key"; #define ID_KEY_FLAGS (OPTST_DISABLED) #else /* disable Id_Key */ @@ -126,10 +124,10 @@ tSCC zId_Key_Name[] = "id-key"; * Gq_Params option description: */ #ifdef OPENSSL -tSCC zGq_ParamsText[] = +static char const zGq_ParamsText[] = "Generate GQ parameters and keys"; -tSCC zGq_Params_NAME[] = "GQ_PARAMS"; -tSCC zGq_Params_Name[] = "gq-params"; +static char const zGq_Params_NAME[] = "GQ_PARAMS"; +static char const zGq_Params_Name[] = "gq-params"; #define GQ_PARAMS_FLAGS (OPTST_DISABLED) #else /* disable Gq_Params */ @@ -143,10 +141,10 @@ tSCC zGq_Params_Name[] = "gq-params"; * Host_Key option description: */ #ifdef OPENSSL -tSCC zHost_KeyText[] = +static char const zHost_KeyText[] = "generate RSA host key"; -tSCC zHost_Key_NAME[] = "HOST_KEY"; -tSCC zHost_Key_Name[] = "host-key"; +static char const zHost_Key_NAME[] = "HOST_KEY"; +static char const zHost_Key_Name[] = "host-key"; #define HOST_KEY_FLAGS (OPTST_DISABLED) #else /* disable Host_Key */ @@ -160,10 +158,10 @@ tSCC zHost_Key_Name[] = "host-key"; * Iffkey option description: */ #ifdef OPENSSL -tSCC zIffkeyText[] = +static char const zIffkeyText[] = "generate IFF parameters"; -tSCC zIffkey_NAME[] = "IFFKEY"; -tSCC zIffkey_Name[] = "iffkey"; +static char const zIffkey_NAME[] = "IFFKEY"; +static char const zIffkey_Name[] = "iffkey"; #define IFFKEY_FLAGS (OPTST_DISABLED) #else /* disable Iffkey */ @@ -177,10 +175,10 @@ tSCC zIffkey_Name[] = "iffkey"; * Issuer_Name option description: */ #ifdef OPENSSL -tSCC zIssuer_NameText[] = +static char const zIssuer_NameText[] = "set issuer name"; -tSCC zIssuer_Name_NAME[] = "ISSUER_NAME"; -tSCC zIssuer_Name_Name[] = "issuer-name"; +static char const zIssuer_Name_NAME[] = "ISSUER_NAME"; +static char const zIssuer_Name_Name[] = "issuer-name"; #define ISSUER_NAME_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -194,20 +192,20 @@ tSCC zIssuer_Name_Name[] = "issuer-name"; /* * Md5key option description: */ -tSCC zMd5keyText[] = +static char const zMd5keyText[] = "generate MD5 keys"; -tSCC zMd5key_NAME[] = "MD5KEY"; -tSCC zMd5key_Name[] = "md5key"; +static char const zMd5key_NAME[] = "MD5KEY"; +static char const zMd5key_Name[] = "md5key"; #define MD5KEY_FLAGS (OPTST_DISABLED) /* * Modulus option description: */ #ifdef OPENSSL -tSCC zModulusText[] = +static char const zModulusText[] = "modulus"; -tSCC zModulus_NAME[] = "MODULUS"; -tSCC zModulus_Name[] = "modulus"; +static char const zModulus_NAME[] = "MODULUS"; +static char const zModulus_Name[] = "modulus"; #define MODULUS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -222,10 +220,10 @@ tSCC zModulus_Name[] = "modulus"; * Pvt_Cert option description: */ #ifdef OPENSSL -tSCC zPvt_CertText[] = +static char const zPvt_CertText[] = "generate PC private certificate"; -tSCC zPvt_Cert_NAME[] = "PVT_CERT"; -tSCC zPvt_Cert_Name[] = "pvt-cert"; +static char const zPvt_Cert_NAME[] = "PVT_CERT"; +static char const zPvt_Cert_Name[] = "pvt-cert"; #define PVT_CERT_FLAGS (OPTST_DISABLED) #else /* disable Pvt_Cert */ @@ -239,10 +237,10 @@ tSCC zPvt_Cert_Name[] = "pvt-cert"; * Pvt_Passwd option description: */ #ifdef OPENSSL -tSCC zPvt_PasswdText[] = +static char const zPvt_PasswdText[] = "output private password"; -tSCC zPvt_Passwd_NAME[] = "PVT_PASSWD"; -tSCC zPvt_Passwd_Name[] = "pvt-passwd"; +static char const zPvt_Passwd_NAME[] = "PVT_PASSWD"; +static char const zPvt_Passwd_Name[] = "pvt-passwd"; #define PVT_PASSWD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -257,10 +255,10 @@ tSCC zPvt_Passwd_Name[] = "pvt-passwd"; * Get_Pvt_Passwd option description: */ #ifdef OPENSSL -tSCC zGet_Pvt_PasswdText[] = +static char const zGet_Pvt_PasswdText[] = "input private password"; -tSCC zGet_Pvt_Passwd_NAME[] = "GET_PVT_PASSWD"; -tSCC zGet_Pvt_Passwd_Name[] = "get-pvt-passwd"; +static char const zGet_Pvt_Passwd_NAME[] = "GET_PVT_PASSWD"; +static char const zGet_Pvt_Passwd_Name[] = "get-pvt-passwd"; #define GET_PVT_PASSWD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -275,10 +273,10 @@ tSCC zGet_Pvt_Passwd_Name[] = "get-pvt-passwd"; * Sign_Key option description: */ #ifdef OPENSSL -tSCC zSign_KeyText[] = +static char const zSign_KeyText[] = "generate sign key (RSA or DSA)"; -tSCC zSign_Key_NAME[] = "SIGN_KEY"; -tSCC zSign_Key_Name[] = "sign-key"; +static char const zSign_Key_NAME[] = "SIGN_KEY"; +static char const zSign_Key_Name[] = "sign-key"; #define SIGN_KEY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -293,10 +291,10 @@ tSCC zSign_Key_Name[] = "sign-key"; * Subject_Name option description: */ #ifdef OPENSSL -tSCC zSubject_NameText[] = +static char const zSubject_NameText[] = "set subject name"; -tSCC zSubject_Name_NAME[] = "SUBJECT_NAME"; -tSCC zSubject_Name_Name[] = "subject-name"; +static char const zSubject_Name_NAME[] = "SUBJECT_NAME"; +static char const zSubject_Name_Name[] = "subject-name"; #define SUBJECT_NAME_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) @@ -311,10 +309,10 @@ tSCC zSubject_Name_Name[] = "subject-name"; * Trusted_Cert option description: */ #ifdef OPENSSL -tSCC zTrusted_CertText[] = +static char const zTrusted_CertText[] = "trusted certificate (TC scheme)"; -tSCC zTrusted_Cert_NAME[] = "TRUSTED_CERT"; -tSCC zTrusted_Cert_Name[] = "trusted-cert"; +static char const zTrusted_Cert_NAME[] = "TRUSTED_CERT"; +static char const zTrusted_Cert_Name[] = "trusted-cert"; #define TRUSTED_CERT_FLAGS (OPTST_DISABLED) #else /* disable Trusted_Cert */ @@ -328,10 +326,10 @@ tSCC zTrusted_Cert_Name[] = "trusted-cert"; * Mv_Params option description: */ #ifdef OPENSSL -tSCC zMv_ParamsText[] = +static char const zMv_ParamsText[] = "generate MV parameters"; -tSCC zMv_Params_NAME[] = "MV_PARAMS"; -tSCC zMv_Params_Name[] = "mv-params"; +static char const zMv_Params_NAME[] = "MV_PARAMS"; +static char const zMv_Params_Name[] = "mv-params"; #define MV_PARAMS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -346,10 +344,10 @@ tSCC zMv_Params_Name[] = "mv-params"; * Mv_Keys option description: */ #ifdef OPENSSL -tSCC zMv_KeysText[] = +static char const zMv_KeysText[] = "update MV keys"; -tSCC zMv_Keys_NAME[] = "MV_KEYS"; -tSCC zMv_Keys_Name[] = "mv-keys"; +static char const zMv_Keys_NAME[] = "MV_KEYS"; +static char const zMv_Keys_Name[] = "mv-keys"; #define MV_KEYS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) @@ -363,12 +361,12 @@ tSCC zMv_Keys_Name[] = "mv-keys"; /* * Help/More_Help/Version option descriptions: */ -tSCC zHelpText[] = "Display extended usage information and exit"; -tSCC zHelp_Name[] = "help"; +static char const zHelpText[] = "Display extended usage information and exit"; +static char const zHelp_Name[] = "help"; #ifdef HAVE_WORKING_FORK #define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) -tSCC zMore_Help_Name[] = "more-help"; -tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; +static char const zMore_Help_Name[] = "more-help"; +static char const zMore_HelpText[] = "Extended usage information passed thru pager"; #else #define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #define zMore_Help_Name NULL @@ -381,14 +379,14 @@ tSCC zMore_HelpText[] = "Extended usage information passed thru pager"; OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT #endif -tSCC zVersionText[] = "Output version information and exit"; -tSCC zVersion_Name[] = "version"; -tSCC zSave_OptsText[] = "Save the option state to a config file"; -tSCC zSave_Opts_Name[] = "save-opts"; -tSCC zLoad_OptsText[] = "Load options from a config file"; -tSCC zLoad_Opts_NAME[] = "LOAD_OPTS"; -tSCC zNotLoad_Opts_Name[] = "no-load-opts"; -tSCC zNotLoad_Opts_Pfx[] = "no"; +static char const zVersionText[] = "Output version information and exit"; +static char const zVersion_Name[] = "version"; +static char const zSave_OptsText[] = "Save the option state to a config file"; +static char const zSave_Opts_Name[] = "save-opts"; +static char const zLoad_OptsText[] = "Load options from a config file"; +static char const zLoad_Opts_NAME[] = "LOAD_OPTS"; +static char const zNotLoad_Opts_Name[] = "no-load-opts"; +static char const zNotLoad_Opts_Pfx[] = "no"; #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3) /* * Declare option callback procedures @@ -398,23 +396,11 @@ tSCC zNotLoad_Opts_Pfx[] = "no"; #else /* not OPENSSL */ # define doOptModulus NULL #endif /* def/not OPENSSL */ -#ifdef OPENSSL - extern tOptProc optionNumericVal; -#else /* not OPENSSL */ -# define optionNumericVal NULL -#endif /* def/not OPENSSL */ -#ifdef OPENSSL - extern tOptProc optionNumericVal; -#else /* not OPENSSL */ -# define optionNumericVal NULL -#endif /* def/not OPENSSL */ #if defined(TEST_NTP_KEYGEN_OPTS) /* * Under test, omit argument processing, or call optionStackArg, * if multiple copies are allowed. */ -extern tOptProc - optionNumericVal, optionPagedUsage, optionVersionStderr; static tOptProc doOptModulus, doUsageOpt; @@ -429,7 +415,10 @@ static tOptProc * When not under test, there are different procs to use */ extern tOptProc - optionPagedUsage, optionPrintVersion; + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeVal, optionUnstackArg, + optionVersionStderr; static tOptProc doOptSet_Debug_Level, doUsageOpt; @@ -752,7 +741,7 @@ tSCC zDetail[] = "\n\ If there is no new host key, look for an existing one.\n\ If one is not found, create it.\n"; tSCC zFullVersion[] = NTP_KEYGEN_FULL_VERSION; -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 493 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE @@ -774,7 +763,8 @@ tOptions ntp_keygenOptions = { + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_ENVIRON - + OPTPROC_NO_ARGS ), + + OPTPROC_NO_ARGS + + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zCopyrightNotice, @@ -806,7 +796,7 @@ doUsageOpt( tOptDesc* pOptDesc ) { (void)pOptions; - USAGE( EXIT_SUCCESS ); + USAGE(EXIT_SUCCESS); } #if ! defined(TEST_NTP_KEYGEN_OPTS) @@ -874,22 +864,25 @@ doOptModulus(tOptions* pOptions, tOptDesc* pOptDesc) pOptDesc->optArg.argInt = val; } #endif /* defined OPENSSL */ -/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */ +/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */ #if defined(TEST_NTP_KEYGEN_OPTS) /* TEST MAIN PROCEDURE: */ -extern void optionPutShell( tOptions* ); +extern void optionPutShell(tOptions*); int main(int argc, char** argv) { int res = EXIT_SUCCESS; - (void)optionProcess( &ntp_keygenOptions, argc, argv ); - optionPutShell( &ntp_keygenOptions ); + (void)optionProcess(&ntp_keygenOptions, argc, argv); + optionPutShell(&ntp_keygenOptions); + res = ferror(stdout); + if (res != 0) + fputs("output error writing to stdout\n", stderr); return res; } #endif /* defined TEST_NTP_KEYGEN_OPTS */ -/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */ +/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 626 */ #if ENABLE_NLS #include @@ -898,11 +891,11 @@ main(int argc, char** argv) #include #include -static char* AO_gettext( char const* pz ); +static char* AO_gettext(char const* pz); static void coerce_it(void** s); static char* -AO_gettext( char const* pz ) +AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) @@ -910,10 +903,10 @@ AO_gettext( char const* pz ) pzRes = _(pz); if (pzRes == pz) return pzRes; - pzRes = strdup( pzRes ); + pzRes = strdup(pzRes); if (pzRes == NULL) { - fputs( _("No memory for duping translated strings\n"), stderr ); - exit( EXIT_FAILURE ); + fputs(_("No memory for duping translated strings\n"), stderr); + exit(EXIT_FAILURE); } return pzRes; } @@ -926,7 +919,7 @@ static void coerce_it(void** s) { *s = AO_gettext(*s); } * This invokes the translation code (e.g. gettext(3)). */ static void -translate_option_strings( void ) +translate_option_strings(void) { /* * Guard against re-translation. It won't work. The strings will have diff --git a/util/ntp-keygen-opts.h b/util/ntp-keygen-opts.h index 083502cb5..0dd8cc5f7 100644 --- a/util/ntp-keygen-opts.h +++ b/util/ntp-keygen-opts.h @@ -1,21 +1,19 @@ /* * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h) * - * It has been AutoGen-ed November 14, 2010 at 08:55:57 AM by AutoGen 5.10 + * It has been AutoGen-ed November 19, 2010 at 11:51:05 PM by AutoGen 5.11.3 * From the definitions ntp-keygen-opts.def * and the template file options * - * Generated from AutoOpts 33:0:8 templates. - */ - -/* - * This file was produced by an AutoOpts template. AutoOpts is a - * copyrighted work. This header file is not encumbered by AutoOpts - * licensing, but is provided under the licensing terms chosen by the - * ntp-keygen author or copyright holder. AutoOpts is licensed under - * the terms of the LGPL. The redistributable library (``libopts'') is - * licensed under the terms of either the LGPL or, at the users discretion, - * the BSD license. See the AutoOpts and/or libopts sources for details. + * Generated from AutoOpts 33:3:8 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntp-keygen author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. * * This source file is copyrighted and licensed under the following terms: * @@ -41,7 +39,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 135168 +#define AO_TEMPLATE_VERSION 135171 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header @@ -84,7 +82,7 @@ typedef enum { /* * Interface defines for all options. Replace "n" with the UPPER_CASED * option name (as in the teOptIndex enumeration above). - * e.g. HAVE_OPT( CERTIFICATE ) + * e.g. HAVE_OPT(CERTIFICATE) */ #define DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n]) #define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) @@ -98,7 +96,7 @@ typedef enum { #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) #define CLEAR_OPT(n) STMTS( \ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ - if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ DESC(n).fOptState |= OPTST_DISABLED; \ DESC(n).optCookie = NULL ) @@ -245,14 +243,14 @@ typedef enum { /* * Interface defines not associated with particular options */ -#define ERRSKIP_OPTERR STMTS( ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP ) -#define ERRSTOP_OPTERR STMTS( ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP ) +#define ERRSKIP_OPTERR STMTS(ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP) #define RESTART_OPT(n) STMTS( \ ntp_keygenOptions.curOptIdx = (n); \ - ntp_keygenOptions.pzCurOpt = NULL ) + ntp_keygenOptions.pzCurOpt = NULL) #define START_OPT RESTART_OPT(1) -#define USAGE(c) (*ntp_keygenOptions.pUsageProc)( &ntp_keygenOptions, c ) -/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */ +#define USAGE(c) (*ntp_keygenOptions.pUsageProc)(&ntp_keygenOptions, c) +/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 408 */ /* * * * * * * @@ -267,9 +265,9 @@ extern tOptions ntp_keygenOptions; #if defined(ENABLE_NLS) # ifndef _ # include - static inline char* aoGetsText( char const* pz ) { + static inline char* aoGetsText(char const* pz) { if (pz == NULL) return NULL; - return (char*)gettext( pz ); + return (char*)gettext(pz); } # define _(s) aoGetsText(s) # endif /* _() */ diff --git a/util/ntp-keygen-opts.texi b/util/ntp-keygen-opts.texi index bcbb64d8c..38b75a253 100644 --- a/util/ntp-keygen-opts.texi +++ b/util/ntp-keygen-opts.texi @@ -3,361 +3,3 @@ @pindex ntp-keygen @cindex Create a NTP host key @ignore -# -# EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.texi) -# -# It has been AutoGen-ed November 14, 2010 at 08:56:07 AM by AutoGen 5.10 -# From the definitions ntp-keygen-opts.def -# and the template file aginfo.tpl -@end ignore -This program has no explanation. - -If there is no new host key, look for an existing one. -If one is not found, create it. - -This section was generated by @strong{AutoGen}, -the aginfo template and the option descriptions for the @command{ntp-keygen} program. It documents the ntp-keygen usage text and option meanings. - -This software is released under a specialized copyright license. - -@menu -* ntp-keygen usage:: ntp-keygen usage help (-?) -* ntp-keygen certificate:: certificate option (-c) -* ntp-keygen debug-level:: debug-level option (-d) -* ntp-keygen get-pvt-passwd:: get-pvt-passwd option (-q) -* ntp-keygen gq-params:: gq-params option (-G) -* ntp-keygen host-key:: host-key option (-H) -* ntp-keygen id-key:: id-key option (-e) -* ntp-keygen iffkey:: iffkey option (-I) -* ntp-keygen issuer-name:: issuer-name option (-i) -* ntp-keygen md5key:: md5key option (-M) -* ntp-keygen modulus:: modulus option (-m) -* ntp-keygen mv-keys:: mv-keys option (-v) -* ntp-keygen mv-params:: mv-params option (-V) -* ntp-keygen pvt-cert:: pvt-cert option (-P) -* ntp-keygen pvt-passwd:: pvt-passwd option (-p) -* ntp-keygen set-debug-level:: set-debug-level option (-D) -* ntp-keygen sign-key:: sign-key option (-S) -* ntp-keygen subject-name:: subject-name option (-s) -* ntp-keygen trusted-cert:: trusted-cert option (-T) -@end menu - -@node ntp-keygen usage -@subsection ntp-keygen usage help (-?) -@cindex ntp-keygen usage - -This is the automatically generated usage text for ntp-keygen: - -@exampleindent 0 -@example -Using OpenSSL version 90704f -ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.6p3-RC10 -USAGE: ntp-keygen [ - [] | --[@{=| @}] ]... - Flg Arg Option-Name Description - -c Str certificate certificate scheme - -d no debug-level Increase output debug message level - - may appear multiple times - -D Str set-debug-level Set the output debug message level - - may appear multiple times - -e no id-key Write IFF or GQ identity keys - -G no gq-params Generate GQ parameters and keys - -H no host-key generate RSA host key - -I no iffkey generate IFF parameters - -i Str issuer-name set issuer name - -M no md5key generate MD5 keys - -m Num modulus modulus - - it must be: 256 to 2048 - -P no pvt-cert generate PC private certificate - -p Str pvt-passwd output private password - -q Str get-pvt-passwd input private password - -S Str sign-key generate sign key (RSA or DSA) - -s Str subject-name set subject name - -T no trusted-cert trusted certificate (TC scheme) - -V Num mv-params generate MV parameters - -v Num mv-keys update MV keys - opt version Output version information and exit - -? no help Display extended usage information and exit - -! no more-help Extended usage information passed thru pager - -> opt save-opts Save the option state to a config file - -< Str load-opts Load options from a config file - - disabled as --no-load-opts - - may appear multiple times - -Options are specified by doubled hyphens and their name -or by a single hyphen and the flag character. - -The following option preset mechanisms are supported: - - reading file /deacon/users/stenn/.ntprc - - reading file /deacon/backroom/snaps/ntp-stable/util/.ntprc - - examining environment variables named NTP_KEYGEN_* - -If there is no new host key, look for an existing one. -If one is not found, create it. - -please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org -@end example -@exampleindent 4 - -@node ntp-keygen certificate -@subsection certificate option (-c) -@cindex ntp-keygen-certificate - -This is the ``certificate scheme'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -scheme is one of -RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, -DSA-SHA, or DSA-SHA1. - -Select the certificate message digest/signature encryption scheme. -Note that RSA schemes must be used with a RSA sign key and DSA -schemes must be used with a DSA sign key. The default without -this option is RSA-MD5. - -@node ntp-keygen debug-level -@subsection debug-level option (-d) -@cindex ntp-keygen-debug-level - -This is the ``increase output debug message level'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Increase the debugging message output level. - -@node ntp-keygen set-debug-level -@subsection set-debug-level option (-D) -@cindex ntp-keygen-set-debug-level - -This is the ``set the output debug message level'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -may appear an unlimited number of times. -@end itemize - -Set the output debugging level. Can be supplied multiple times, -but each overrides the previous value(s). - -@node ntp-keygen id-key -@subsection id-key option (-e) -@cindex ntp-keygen-id-key - -This is the ``write iff or gq identity keys'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Write the IFF or GQ client keys to the standard output. This is -intended for automatic key distribution by mail. - -@node ntp-keygen gq-params -@subsection gq-params option (-G) -@cindex ntp-keygen-gq-params - -This is the ``generate gq parameters and keys'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Generate parameters and keys for the GQ identification scheme, -obsoleting any that may exist. - -@node ntp-keygen host-key -@subsection host-key option (-H) -@cindex ntp-keygen-host-key - -This is the ``generate rsa host key'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Generate new host keys, obsoleting any that may exist. - -@node ntp-keygen iffkey -@subsection iffkey option (-I) -@cindex ntp-keygen-iffkey - -This is the ``generate iff parameters'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Generate parameters for the IFF identification scheme, obsoleting -any that may exist. - -@node ntp-keygen issuer-name -@subsection issuer-name option (-i) -@cindex ntp-keygen-issuer-name - -This is the ``set issuer name'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Set the suject name to name. This is used as the subject field -in certificates and in the file name for host and sign keys. - -@node ntp-keygen md5key -@subsection md5key option (-M) -@cindex ntp-keygen-md5key - -This is the ``generate md5 keys'' option. -Generate MD5 keys, obsoleting any that may exist. - -@node ntp-keygen modulus -@subsection modulus option (-m) -@cindex ntp-keygen-modulus - -This is the ``modulus'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -The number of bits in the prime modulus. The default is 512. - -@node ntp-keygen pvt-cert -@subsection pvt-cert option (-P) -@cindex ntp-keygen-pvt-cert - -This is the ``generate pc private certificate'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Generate a private certificate. By default, the program generates -public certificates. - -@node ntp-keygen pvt-passwd -@subsection pvt-passwd option (-p) -@cindex ntp-keygen-pvt-passwd - -This is the ``output private password'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Encrypt generated files containing private data with the specified -password and the DES-CBC algorithm. - -@node ntp-keygen get-pvt-passwd -@subsection get-pvt-passwd option (-q) -@cindex ntp-keygen-get-pvt-passwd - -This is the ``input private password'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Set the password for reading files to the specified password. - -@node ntp-keygen sign-key -@subsection sign-key option (-S) -@cindex ntp-keygen-sign-key - -This is the ``generate sign key (rsa or dsa)'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Generate a new sign key of the designated type, obsoleting any -that may exist. By default, the program uses the host key as the -sign key. - -@node ntp-keygen subject-name -@subsection subject-name option (-s) -@cindex ntp-keygen-subject-name - -This is the ``set subject name'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Set the issuer name to name. This is used for the issuer field -in certificates and in the file name for identity files. - -@node ntp-keygen trusted-cert -@subsection trusted-cert option (-T) -@cindex ntp-keygen-trusted-cert - -This is the ``trusted certificate (tc scheme)'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Generate a trusted certificate. By default, the program generates -a non-trusted certificate. - -@node ntp-keygen mv-params -@subsection mv-params option (-V) -@cindex ntp-keygen-mv-params - -This is the ``generate mv parameters'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -Generate parameters and keys for the Mu-Varadharajan (MV) -identification scheme. - -@node ntp-keygen mv-keys -@subsection mv-keys option (-v) -@cindex ntp-keygen-mv-keys - -This is the ``update mv keys'' option. - -This option has some usage constraints. It: -@itemize @bullet -@item -must be compiled in by defining @code{OPENSSL} during the compilation. -@end itemize - -This option has no @samp{doc} documentation. diff --git a/util/ntp-keygen.1 b/util/ntp-keygen.1 index abca37de9..6b8257277 100644 --- a/util/ntp-keygen.1 +++ b/util/ntp-keygen.1 @@ -1,7 +1,7 @@ -.TH NTP-KEYGEN 1 2010-11-14 "(ntp 4.2.6p3-RC10)" "Programmer's Manual" +.TH NTP-KEYGEN 1 2010-11-19 "(ntp 4.2.6p3-RC10)" "Programmer's Manual" .\" EDIT THIS FILE WITH CAUTION (ntp-keygen.1) .\" -.\" It has been AutoGen-ed November 14, 2010 at 08:56:07 AM by AutoGen 5.10 +.\" It has been AutoGen-ed November 19, 2010 at 11:51:15 PM by AutoGen 5.11.3 .\" From the definitions ntp-keygen-opts.def .\" and the template file agman1.tpl .\"