+(4.2.7p160) 2011/05/01 Released by Harlan Stenn <stenn@ntp.org>
* from 4.2.6p4-RC1: Upgrade to libopts 35.0.10 from AutoGen 5.11.9pre8.
* [Bug 1901] Simulator does not set progname.
(4.2.7p159) 2011/04/28 Released by Harlan Stenn <stenn@ntp.org>
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
*
- * It has been AutoGen-ed April 28, 2011 at 06:46:25 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 08:13:49 AM by AutoGen 5.11.9pre8
* From the definitions ntpd-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntpd copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
#include <sys/types.h>
+
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
+extern FILE * option_usage_fp;
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
-tSCC zCopyright[] =
- "ntpd copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from copyright.def near line 8 */
-;
-tSCC zCopyrightNotice[24] =
-"see html/copyright.html";
+static char const zCopyright[40] =
+"ntpd 4.2.7p160\n\
+see html/copyright.html\n";
+static char const zCopyrightNotice[25] =
+"see html/copyright.html\n";
extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
#endif
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
/*
* Ipv4 option description with
extern tOptProc
optionBooleanVal, optionNestedVal, optionNumericVal,
optionPagedUsage, optionPrintVersion, optionResetOpt,
- optionStackArg, optionTimeVal, optionUnstackArg,
- optionVersionStderr;
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVersionStderr;
static tOptProc
doUsageOpt;
*
* Define the Ntpd Option Descriptions.
*/
-static tOptDesc optDesc[ OPTION_CT ] = {
+static tOptDesc optDesc[OPTION_CT] = {
{ /* entry idx, value */ 0, VALUE_OPT_IPV4,
/* equiv idx, value */ 0, VALUE_OPT_IPV4,
/* equivalenced to */ NO_EQUIVALENT,
*/
static char const zPROGNAME[5] = "NTPD";
static char const zUsageTitle[133] =
-"ntpd - NTP daemon program - Ver. 4.2.7p159\n\
+"ntpd - NTP daemon program - Ver. 4.2.7p160\n\
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ <server1> ... <serverN> ]\n";
#define zRcName NULL
#define zExplain NULL
static char const zDetail[7] = "\n\n";
static char const zFullVersion[] = NTPD_FULL_VERSION;
-/* extracted from optcode.tlib near line 504 */
+/* extracted from optcode.tlib near line 515 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
* Create the static procedure(s) declared above.
*/
static void
-doUsageOpt(
- tOptions* pOptions,
- tOptDesc* pOptDesc )
+doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
{
(void)pOptions;
- USAGE(EXIT_SUCCESS);
+ USAGE(NTPD_EXIT_SUCCESS);
}
#if ! defined(TEST_NTPD_OPTS)
}
#endif /* defined DEBUG */
#endif /* defined(TEST_NTPD_OPTS) */
-/* extracted from optmain.tlib near line 107 */
+/* extracted from optmain.tlib near line 128 */
#if defined(TEST_NTPD_OPTS) /* TEST MAIN PROCEDURE: */
extern void optionPutShell(tOptions*);
int
-main(int argc, char** argv)
+main(int argc, char ** argv)
{
- int res = EXIT_SUCCESS;
+ int res = NTPD_EXIT_SUCCESS;
(void)optionProcess(&ntpdOptions, argc, argv);
optionPutShell(&ntpdOptions);
res = ferror(stdout);
return res;
}
#endif /* defined TEST_NTPD_OPTS */
-/* extracted from optcode.tlib near line 657 */
+/* extracted from optcode.tlib near line 666 */
#if ENABLE_NLS
#include <stdio.h>
pzRes = strdup(pzRes);
if (pzRes == NULL) {
fputs(_("No memory for duping translated strings\n"), stderr);
- exit(EXIT_FAILURE);
+ exit(NTPD_EXIT_FAILURE);
}
return pzRes;
}
-static void coerce_it(void** s) { *s = AO_gettext(*s); }
-#define COERSION(_f) \
- coerce_it((void*)&(ntpdOptions._f))
+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)
{
+ tOptions * const pOpt = &ntpdOptions;
+
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
*/
- tOptDesc* pOD = ntpdOptions.pOptDesc;
- char** ppz = (char**)(void*)&(option_usage_text);
- int ix = option_usage_text.field_ct;
+ tOptDesc * pOD = pOpt->pOptDesc;
+ char ** ppz = (char**)(void*)&(option_usage_text);
+ int ix = option_usage_text.field_ct;
do {
ppz++;
*ppz = AO_gettext(*ppz);
} while (--ix > 0);
- COERSION(pzCopyright);
- COERSION(pzCopyNotice);
- COERSION(pzFullVersion);
- COERSION(pzUsageTitle);
- COERSION(pzExplain);
- COERSION(pzDetail);
- COERSION(pzPackager);
+ coerce_it((void*)&(pOpt->pzCopyright));
+ coerce_it((void*)&(pOpt->pzCopyNotice));
+ coerce_it((void*)&(pOpt->pzFullVersion));
+ coerce_it((void*)&(pOpt->pzUsageTitle));
+ coerce_it((void*)&(pOpt->pzExplain));
+ coerce_it((void*)&(pOpt->pzDetail));
+ coerce_it((void*)&(pOpt->pzPackager));
option_usage_text.field_ct = 0;
- for (ix = ntpdOptions.optCt; ix > 0; ix--, pOD++)
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
coerce_it((void*)&(pOD->pzText));
}
- if ((ntpdOptions.fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
- tOptDesc* pOD = ntpdOptions.pOptDesc;
- int ix;
+ if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
+ tOptDesc * pOD = pOpt->pOptDesc;
+ int ix;
- for (ix = ntpdOptions.optCt; ix > 0; ix--, pOD++) {
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
coerce_it((void*)&(pOD->pz_Name));
coerce_it((void*)&(pOD->pz_DisableName));
coerce_it((void*)&(pOD->pz_DisablePfx));
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
*
- * It has been AutoGen-ed April 28, 2011 at 06:46:25 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 08:13:49 AM by AutoGen 5.11.9pre8
* From the definitions ntpd-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This header file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntpd copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
/*
* This file contains the programmatic interface to the Automated
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 139264
+#define AO_TEMPLATE_VERSION 143360
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
} teOptIndex;
#define OPTION_CT 36
-#define NTPD_VERSION "4.2.7p159"
-#define NTPD_FULL_VERSION "ntpd - NTP daemon program - Ver. 4.2.7p159"
+#define NTPD_VERSION "4.2.7p160"
+#define NTPD_FULL_VERSION "ntpd 4.2.7p160"
/*
* Interface defines for all options. Replace "n" with the UPPER_CASED
NTPD_EXIT_SUCCESS = 0,
NTPD_EXIT_FAILURE = 1
} ntpd_exit_code_t;
-
/*
* Make sure there are no #define name conflicts with the option names
*/
ntpdOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpdOptions.pUsageProc)(&ntpdOptions, c)
-/* extracted from opthead.tlib near line 435 */
+/* extracted from opthead.tlib near line 451 */
-/* * * * * *
- *
- * Declare the ntpd option descriptor.
- */
#ifdef __cplusplus
extern "C" {
#endif
-extern tOptions ntpdOptions;
+/* * * * * *
+ *
+ * Declare the ntpd option descriptor.
+ */
+extern tOptions ntpdOptions;
#if defined(ENABLE_NLS)
# ifndef _
#
# EDIT THIS FILE WITH CAUTION (ntpd-opts.texi)
#
-# It has been AutoGen-ed April 28, 2011 at 06:46:56 AM by AutoGen 5.11.6
+# It has been AutoGen-ed May 1, 2011 at 04:28:25 AM by AutoGen 5.11.9pre8
# From the definitions ntpd-opts.def
# and the template file aginfo.tpl
@end ignore
@exampleindent 0
@example
-ntpd - NTP daemon program - Ver. 4.2.7p159
+ntpd - NTP daemon program - Ver. 4.2.7p160
USAGE: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ <server1> ... <serverN> ]
Flg Arg Option-Name Description
-.TH NTPD 1 2011-04-28 "( 4.2.7p159)" "Programmer's Manual"
+.TH NTPD 1 2011-05-01 "( 4.2.7p160)" "Programmer's Manual"
.\" EDIT THIS FILE WITH CAUTION (ntpd.1)
.\"
-.\" It has been AutoGen-ed April 28, 2011 at 06:46:56 AM by AutoGen 5.11.6
+.\" It has been AutoGen-ed May 1, 2011 at 08:14:09 AM by AutoGen 5.11.9pre8
.\" From the definitions ntpd-opts.def
.\" and the template file agman1.tpl
.\"
.nf
.na
see html/copyright.html
+
.fi
.ad
.PP
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.c)
*
- * It has been AutoGen-ed April 28, 2011 at 06:47:02 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 04:28:32 AM by AutoGen 5.11.9pre8
* From the definitions ntpdc-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntpdc copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
#include <sys/types.h>
+
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
+extern FILE * option_usage_fp;
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
-tSCC zCopyright[] =
- "ntpdc copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from copyright.def near line 8 */
-;
-tSCC zCopyrightNotice[24] =
-"see html/copyright.html";
+static char const zCopyright[41] =
+"ntpdc 4.2.7p160\n\
+see html/copyright.html\n";
+static char const zCopyrightNotice[25] =
+"see html/copyright.html\n";
extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
#endif
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
/*
* Ipv4 option description with
extern tOptProc
optionBooleanVal, optionNestedVal, optionNumericVal,
optionPagedUsage, optionPrintVersion, optionResetOpt,
- optionStackArg, optionTimeVal, optionUnstackArg,
- optionVersionStderr;
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVersionStderr;
static tOptProc
doOptSet_Debug_Level, doUsageOpt;
*
* Define the Ntpdc Option Descriptions.
*/
-static tOptDesc optDesc[ OPTION_CT ] = {
+static tOptDesc optDesc[OPTION_CT] = {
{ /* entry idx, value */ 0, VALUE_OPT_IPV4,
/* equiv idx, value */ 0, VALUE_OPT_IPV4,
/* equivalenced to */ NO_EQUIVALENT,
*/
static char const zPROGNAME[6] = "NTPDC";
static char const zUsageTitle[129] =
-"ntpdc - vendor-specific NTP query program - Ver. 4.2.7p159\n\
+"ntpdc - vendor-specific NTP query program - Ver. 4.2.7p160\n\
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n";
static char const zRcName[7] = ".ntprc";
static char const * const apzHomeList[3] = {
configuration file may also be specified at run time using [= prog-name =]\n\
.\n";
static char const zFullVersion[] = NTPDC_FULL_VERSION;
-/* extracted from optcode.tlib near line 504 */
+/* extracted from optcode.tlib near line 515 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
* Create the static procedure(s) declared above.
*/
static void
-doUsageOpt(
- tOptions* pOptions,
- tOptDesc* pOptDesc )
+doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
{
(void)pOptions;
- USAGE(EXIT_SUCCESS);
+ USAGE(NTPDC_EXIT_SUCCESS);
}
#if ! defined(TEST_NTPDC_OPTS)
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
}
#endif /* defined(TEST_NTPDC_OPTS) */
-/* extracted from optmain.tlib near line 107 */
+/* extracted from optmain.tlib near line 128 */
#if defined(TEST_NTPDC_OPTS) /* TEST MAIN PROCEDURE: */
extern void optionPutShell(tOptions*);
int
-main(int argc, char** argv)
+main(int argc, char ** argv)
{
- int res = EXIT_SUCCESS;
+ int res = NTPDC_EXIT_SUCCESS;
(void)optionProcess(&ntpdcOptions, argc, argv);
optionPutShell(&ntpdcOptions);
res = ferror(stdout);
return res;
}
#endif /* defined TEST_NTPDC_OPTS */
-/* extracted from optcode.tlib near line 657 */
+/* extracted from optcode.tlib near line 666 */
#if ENABLE_NLS
#include <stdio.h>
pzRes = strdup(pzRes);
if (pzRes == NULL) {
fputs(_("No memory for duping translated strings\n"), stderr);
- exit(EXIT_FAILURE);
+ exit(NTPDC_EXIT_FAILURE);
}
return pzRes;
}
-static void coerce_it(void** s) { *s = AO_gettext(*s); }
-#define COERSION(_f) \
- coerce_it((void*)&(ntpdcOptions._f))
+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)
{
+ tOptions * const pOpt = &ntpdcOptions;
+
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
*/
- tOptDesc* pOD = ntpdcOptions.pOptDesc;
- char** ppz = (char**)(void*)&(option_usage_text);
- int ix = option_usage_text.field_ct;
+ tOptDesc * pOD = pOpt->pOptDesc;
+ char ** ppz = (char**)(void*)&(option_usage_text);
+ int ix = option_usage_text.field_ct;
do {
ppz++;
*ppz = AO_gettext(*ppz);
} while (--ix > 0);
- COERSION(pzCopyright);
- COERSION(pzCopyNotice);
- COERSION(pzFullVersion);
- COERSION(pzUsageTitle);
- COERSION(pzExplain);
- COERSION(pzDetail);
- COERSION(pzPackager);
+ coerce_it((void*)&(pOpt->pzCopyright));
+ coerce_it((void*)&(pOpt->pzCopyNotice));
+ coerce_it((void*)&(pOpt->pzFullVersion));
+ coerce_it((void*)&(pOpt->pzUsageTitle));
+ coerce_it((void*)&(pOpt->pzExplain));
+ coerce_it((void*)&(pOpt->pzDetail));
+ coerce_it((void*)&(pOpt->pzPackager));
option_usage_text.field_ct = 0;
- for (ix = ntpdcOptions.optCt; ix > 0; ix--, pOD++)
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
coerce_it((void*)&(pOD->pzText));
}
- if ((ntpdcOptions.fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
- tOptDesc* pOD = ntpdcOptions.pOptDesc;
- int ix;
+ if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
+ tOptDesc * pOD = pOpt->pOptDesc;
+ int ix;
- for (ix = ntpdcOptions.optCt; ix > 0; ix--, pOD++) {
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
coerce_it((void*)&(pOD->pz_Name));
coerce_it((void*)&(pOD->pz_DisableName));
coerce_it((void*)&(pOD->pz_DisablePfx));
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
*
- * It has been AutoGen-ed April 28, 2011 at 06:47:02 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 04:28:32 AM by AutoGen 5.11.9pre8
* From the definitions ntpdc-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This header file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntpdc copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
/*
* This file contains the programmatic interface to the Automated
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 139264
+#define AO_TEMPLATE_VERSION 143360
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
} teOptIndex;
#define OPTION_CT 15
-#define NTPDC_VERSION "4.2.7p159"
-#define NTPDC_FULL_VERSION "ntpdc - vendor-specific NTP query program - Ver. 4.2.7p159"
+#define NTPDC_VERSION "4.2.7p160"
+#define NTPDC_FULL_VERSION "ntpdc 4.2.7p160"
/*
* Interface defines for all options. Replace "n" with the UPPER_CASED
NTPDC_EXIT_SUCCESS = 0,
NTPDC_EXIT_FAILURE = 1
} ntpdc_exit_code_t;
-
/*
* Make sure there are no #define name conflicts with the option names
*/
ntpdcOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpdcOptions.pUsageProc)(&ntpdcOptions, c)
-/* extracted from opthead.tlib near line 435 */
+/* extracted from opthead.tlib near line 451 */
-/* * * * * *
- *
- * Declare the ntpdc option descriptor.
- */
#ifdef __cplusplus
extern "C" {
#endif
-extern tOptions ntpdcOptions;
+/* * * * * *
+ *
+ * Declare the ntpdc option descriptor.
+ */
+extern tOptions ntpdcOptions;
#if defined(ENABLE_NLS)
# ifndef _
#
# EDIT THIS FILE WITH CAUTION (ntpdc-opts.texi)
#
-# It has been AutoGen-ed April 28, 2011 at 06:47:12 AM by AutoGen 5.11.6
+# It has been AutoGen-ed May 1, 2011 at 04:28:41 AM by AutoGen 5.11.9pre8
# From the definitions ntpdc-opts.def
# and the template file aginfo.tpl
@end ignore
@exampleindent 0
@example
-ntpdc - vendor-specific NTP query program - Ver. 4.2.7p159
+ntpdc - vendor-specific NTP query program - Ver. 4.2.7p160
USAGE: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
-.TH NTPDC 1 2011-04-28 "( 4.2.7p159)" "Programmer's Manual"
+.TH NTPDC 1 2011-05-01 "( 4.2.7p160)" "Programmer's Manual"
.\" EDIT THIS FILE WITH CAUTION (ntpdc.1)
.\"
-.\" It has been AutoGen-ed April 28, 2011 at 06:47:11 AM by AutoGen 5.11.6
+.\" It has been AutoGen-ed May 1, 2011 at 04:28:41 AM by AutoGen 5.11.9pre8
.\" From the definitions ntpdc-opts.def
.\" and the template file agman1.tpl
.\"
.nf
.na
see html/copyright.html
+
.fi
.ad
.PP
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.c)
*
- * It has been AutoGen-ed April 28, 2011 at 06:47:12 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 04:28:42 AM by AutoGen 5.11.9pre8
* From the definitions ntpq-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntpq copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
#include <sys/types.h>
+
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
+extern FILE * option_usage_fp;
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
-tSCC zCopyright[] =
- "ntpq copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from copyright.def near line 8 */
-;
-tSCC zCopyrightNotice[24] =
-"see html/copyright.html";
+static char const zCopyright[40] =
+"ntpq 4.2.7p160\n\
+see html/copyright.html\n";
+static char const zCopyrightNotice[25] =
+"see html/copyright.html\n";
extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
#endif
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
/*
* Ipv4 option description with
extern tOptProc
ntpq_custom_opt_handler, optionBooleanVal, optionNestedVal,
optionNumericVal, optionPagedUsage, optionPrintVersion,
- optionResetOpt, optionStackArg, optionTimeVal,
- optionUnstackArg, optionVersionStderr;
+ optionResetOpt, optionStackArg, optionTimeDate,
+ optionTimeVal, optionUnstackArg, optionVersionStderr;
static tOptProc
doOptSet_Debug_Level, doUsageOpt;
*
* Define the Ntpq Option Descriptions.
*/
-static tOptDesc optDesc[ OPTION_CT ] = {
+static tOptDesc optDesc[OPTION_CT] = {
{ /* entry idx, value */ 0, VALUE_OPT_IPV4,
/* equiv idx, value */ 0, VALUE_OPT_IPV4,
/* equivalenced to */ NO_EQUIVALENT,
*/
static char const zPROGNAME[5] = "NTPQ";
static char const zUsageTitle[121] =
-"ntpq - standard NTP query program - Ver. 4.2.7p159\n\
+"ntpq - standard NTP query program - Ver. 4.2.7p160\n\
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n";
static char const zRcName[7] = ".ntprc";
static char const * const apzHomeList[3] = {
used in NTPv4, although some of the variables have changed and new ones\n\
added.\n";
static char const zFullVersion[] = NTPQ_FULL_VERSION;
-/* extracted from optcode.tlib near line 504 */
+/* extracted from optcode.tlib near line 515 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
* Create the static procedure(s) declared above.
*/
static void
-doUsageOpt(
- tOptions* pOptions,
- tOptDesc* pOptDesc )
+doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
{
(void)pOptions;
- USAGE(EXIT_SUCCESS);
+ USAGE(NTPQ_EXIT_SUCCESS);
}
#if ! defined(TEST_NTPQ_OPTS)
DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
}
#endif /* defined(TEST_NTPQ_OPTS) */
-/* extracted from optmain.tlib near line 107 */
+/* extracted from optmain.tlib near line 128 */
#if defined(TEST_NTPQ_OPTS) /* TEST MAIN PROCEDURE: */
extern void optionPutShell(tOptions*);
int
-main(int argc, char** argv)
+main(int argc, char ** argv)
{
- int res = EXIT_SUCCESS;
+ int res = NTPQ_EXIT_SUCCESS;
(void)optionProcess(&ntpqOptions, argc, argv);
optionPutShell(&ntpqOptions);
res = ferror(stdout);
return res;
}
#endif /* defined TEST_NTPQ_OPTS */
-/* extracted from optcode.tlib near line 657 */
+/* extracted from optcode.tlib near line 666 */
#if ENABLE_NLS
#include <stdio.h>
pzRes = strdup(pzRes);
if (pzRes == NULL) {
fputs(_("No memory for duping translated strings\n"), stderr);
- exit(EXIT_FAILURE);
+ exit(NTPQ_EXIT_FAILURE);
}
return pzRes;
}
-static void coerce_it(void** s) { *s = AO_gettext(*s); }
-#define COERSION(_f) \
- coerce_it((void*)&(ntpqOptions._f))
+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)
{
+ tOptions * const pOpt = &ntpqOptions;
+
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
*/
- tOptDesc* pOD = ntpqOptions.pOptDesc;
- char** ppz = (char**)(void*)&(option_usage_text);
- int ix = option_usage_text.field_ct;
+ tOptDesc * pOD = pOpt->pOptDesc;
+ char ** ppz = (char**)(void*)&(option_usage_text);
+ int ix = option_usage_text.field_ct;
do {
ppz++;
*ppz = AO_gettext(*ppz);
} while (--ix > 0);
- COERSION(pzCopyright);
- COERSION(pzCopyNotice);
- COERSION(pzFullVersion);
- COERSION(pzUsageTitle);
- COERSION(pzExplain);
- COERSION(pzDetail);
- COERSION(pzPackager);
+ coerce_it((void*)&(pOpt->pzCopyright));
+ coerce_it((void*)&(pOpt->pzCopyNotice));
+ coerce_it((void*)&(pOpt->pzFullVersion));
+ coerce_it((void*)&(pOpt->pzUsageTitle));
+ coerce_it((void*)&(pOpt->pzExplain));
+ coerce_it((void*)&(pOpt->pzDetail));
+ coerce_it((void*)&(pOpt->pzPackager));
option_usage_text.field_ct = 0;
- for (ix = ntpqOptions.optCt; ix > 0; ix--, pOD++)
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
coerce_it((void*)&(pOD->pzText));
}
- if ((ntpqOptions.fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
- tOptDesc* pOD = ntpqOptions.pOptDesc;
- int ix;
+ if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
+ tOptDesc * pOD = pOpt->pOptDesc;
+ int ix;
- for (ix = ntpqOptions.optCt; ix > 0; ix--, pOD++) {
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
coerce_it((void*)&(pOD->pz_Name));
coerce_it((void*)&(pOD->pz_DisableName));
coerce_it((void*)&(pOD->pz_DisablePfx));
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.h)
*
- * It has been AutoGen-ed April 28, 2011 at 06:47:12 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 04:28:41 AM by AutoGen 5.11.9pre8
* From the definitions ntpq-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This header file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntpq copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
/*
* This file contains the programmatic interface to the Automated
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 139264
+#define AO_TEMPLATE_VERSION 143360
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
} teOptIndex;
#define OPTION_CT 14
-#define NTPQ_VERSION "4.2.7p159"
-#define NTPQ_FULL_VERSION "ntpq - standard NTP query program - Ver. 4.2.7p159"
+#define NTPQ_VERSION "4.2.7p160"
+#define NTPQ_FULL_VERSION "ntpq 4.2.7p160"
/*
* Interface defines for all options. Replace "n" with the UPPER_CASED
NTPQ_EXIT_SUCCESS = 0,
NTPQ_EXIT_FAILURE = 1
} ntpq_exit_code_t;
-
/*
* Make sure there are no #define name conflicts with the option names
*/
ntpqOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpqOptions.pUsageProc)(&ntpqOptions, c)
-/* extracted from opthead.tlib near line 435 */
+/* extracted from opthead.tlib near line 451 */
-/* * * * * *
- *
- * Declare the ntpq option descriptor.
- */
#ifdef __cplusplus
extern "C" {
#endif
-extern tOptions ntpqOptions;
+/* * * * * *
+ *
+ * Declare the ntpq option descriptor.
+ */
+extern tOptions ntpqOptions;
#if defined(ENABLE_NLS)
# ifndef _
#
# EDIT THIS FILE WITH CAUTION (ntpq-opts.texi)
#
-# It has been AutoGen-ed April 28, 2011 at 06:47:23 AM by AutoGen 5.11.6
+# It has been AutoGen-ed May 1, 2011 at 04:29:04 AM by AutoGen 5.11.9pre8
# From the definitions ntpq-opts.def
# and the template file aginfo.tpl
@end ignore
@exampleindent 0
@example
-ntpq - standard NTP query program - Ver. 4.2.7p159
+ntpq - standard NTP query program - Ver. 4.2.7p160
USAGE: ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
-.TH NTPQ 1 2011-04-28 "( 4.2.7p159)" "Programmer's Manual"
+.TH NTPQ 1 2011-05-01 "( 4.2.7p160)" "Programmer's Manual"
.\" EDIT THIS FILE WITH CAUTION (ntpq.1)
.\"
-.\" It has been AutoGen-ed April 28, 2011 at 06:47:23 AM by AutoGen 5.11.6
+.\" It has been AutoGen-ed May 1, 2011 at 04:29:03 AM by AutoGen 5.11.9pre8
.\" From the definitions ntpq-opts.def
.\" and the template file agman1.tpl
.\"
.nf
.na
see html/copyright.html
+
.fi
.ad
.PP
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c)
*
- * It has been AutoGen-ed April 28, 2011 at 06:47:24 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 04:29:04 AM by AutoGen 5.11.9pre8
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntpsnmpd copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
#include <sys/types.h>
+
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
+extern FILE * option_usage_fp;
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
-tSCC zCopyright[] =
- "ntpsnmpd copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from copyright.def near line 8 */
-;
-tSCC zCopyrightNotice[24] =
-"see html/copyright.html";
+static char const zCopyright[44] =
+"ntpsnmpd 4.2.7p160\n\
+see html/copyright.html\n";
+static char const zCopyrightNotice[25] =
+"see html/copyright.html\n";
extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
#endif
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
/*
* Nofork option description:
extern tOptProc
optionBooleanVal, optionNestedVal, optionNumericVal,
optionPagedUsage, optionPrintVersion, optionResetOpt,
- optionStackArg, optionTimeVal, optionUnstackArg,
- optionVersionStderr;
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVersionStderr;
static tOptProc
doUsageOpt;
#endif /* defined(TEST_NTPSNMPD_OPTS) */
*
* Define the Ntpsnmpd Option Descriptions.
*/
-static tOptDesc optDesc[ OPTION_CT ] = {
+static tOptDesc optDesc[OPTION_CT] = {
{ /* entry idx, value */ 0, VALUE_OPT_NOFORK,
/* equiv idx, value */ 0, VALUE_OPT_NOFORK,
/* equivalenced to */ NO_EQUIVALENT,
*/
static char const zPROGNAME[9] = "NTPSNMPD";
static char const zUsageTitle[105] =
-"ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p159\n\
+"ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p160\n\
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n";
static char const zRcName[7] = ".ntprc";
static char const * const apzHomeList[3] = {
#define zExplain NULL
#define zDetail NULL
static char const zFullVersion[] = NTPSNMPD_FULL_VERSION;
-/* extracted from optcode.tlib near line 504 */
+/* extracted from optcode.tlib near line 515 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
* Create the static procedure(s) declared above.
*/
static void
-doUsageOpt(
- tOptions* pOptions,
- tOptDesc* pOptDesc )
+doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
{
(void)pOptions;
- USAGE(EXIT_SUCCESS);
+ USAGE(NTPSNMPD_EXIT_SUCCESS);
}
-/* extracted from optmain.tlib near line 107 */
+/* extracted from optmain.tlib near line 128 */
#if defined(TEST_NTPSNMPD_OPTS) /* TEST MAIN PROCEDURE: */
extern void optionPutShell(tOptions*);
int
-main(int argc, char** argv)
+main(int argc, char ** argv)
{
- int res = EXIT_SUCCESS;
+ int res = NTPSNMPD_EXIT_SUCCESS;
(void)optionProcess(&ntpsnmpdOptions, argc, argv);
optionPutShell(&ntpsnmpdOptions);
res = ferror(stdout);
return res;
}
#endif /* defined TEST_NTPSNMPD_OPTS */
-/* extracted from optcode.tlib near line 657 */
+/* extracted from optcode.tlib near line 666 */
#if ENABLE_NLS
#include <stdio.h>
pzRes = strdup(pzRes);
if (pzRes == NULL) {
fputs(_("No memory for duping translated strings\n"), stderr);
- exit(EXIT_FAILURE);
+ exit(NTPSNMPD_EXIT_FAILURE);
}
return pzRes;
}
-static void coerce_it(void** s) { *s = AO_gettext(*s); }
-#define COERSION(_f) \
- coerce_it((void*)&(ntpsnmpdOptions._f))
+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)
{
+ tOptions * const pOpt = &ntpsnmpdOptions;
+
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
*/
- tOptDesc* pOD = ntpsnmpdOptions.pOptDesc;
- char** ppz = (char**)(void*)&(option_usage_text);
- int ix = option_usage_text.field_ct;
+ tOptDesc * pOD = pOpt->pOptDesc;
+ char ** ppz = (char**)(void*)&(option_usage_text);
+ int ix = option_usage_text.field_ct;
do {
ppz++;
*ppz = AO_gettext(*ppz);
} while (--ix > 0);
- COERSION(pzCopyright);
- COERSION(pzCopyNotice);
- COERSION(pzFullVersion);
- COERSION(pzUsageTitle);
- COERSION(pzExplain);
- COERSION(pzDetail);
- COERSION(pzPackager);
+ coerce_it((void*)&(pOpt->pzCopyright));
+ coerce_it((void*)&(pOpt->pzCopyNotice));
+ coerce_it((void*)&(pOpt->pzFullVersion));
+ coerce_it((void*)&(pOpt->pzUsageTitle));
+ coerce_it((void*)&(pOpt->pzExplain));
+ coerce_it((void*)&(pOpt->pzDetail));
+ coerce_it((void*)&(pOpt->pzPackager));
option_usage_text.field_ct = 0;
- for (ix = ntpsnmpdOptions.optCt; ix > 0; ix--, pOD++)
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
coerce_it((void*)&(pOD->pzText));
}
- if ((ntpsnmpdOptions.fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
- tOptDesc* pOD = ntpsnmpdOptions.pOptDesc;
- int ix;
+ if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
+ tOptDesc * pOD = pOpt->pOptDesc;
+ int ix;
- for (ix = ntpsnmpdOptions.optCt; ix > 0; ix--, pOD++) {
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
coerce_it((void*)&(pOD->pz_Name));
coerce_it((void*)&(pOD->pz_DisableName));
coerce_it((void*)&(pOD->pz_DisablePfx));
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h)
*
- * It has been AutoGen-ed April 28, 2011 at 06:47:23 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 04:29:04 AM by AutoGen 5.11.9pre8
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This header file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntpsnmpd copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
/*
* This file contains the programmatic interface to the Automated
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 139264
+#define AO_TEMPLATE_VERSION 143360
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
} teOptIndex;
#define OPTION_CT 8
-#define NTPSNMPD_VERSION "4.2.7p159"
-#define NTPSNMPD_FULL_VERSION "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p159"
+#define NTPSNMPD_VERSION "4.2.7p160"
+#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.7p160"
/*
* Interface defines for all options. Replace "n" with the UPPER_CASED
NTPSNMPD_EXIT_SUCCESS = 0,
NTPSNMPD_EXIT_FAILURE = 1
} ntpsnmpd_exit_code_t;
-
/*
* Make sure there are no #define name conflicts with the option names
*/
ntpsnmpdOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c)
-/* extracted from opthead.tlib near line 435 */
+/* extracted from opthead.tlib near line 451 */
-/* * * * * *
- *
- * Declare the ntpsnmpd option descriptor.
- */
#ifdef __cplusplus
extern "C" {
#endif
-extern tOptions ntpsnmpdOptions;
+/* * * * * *
+ *
+ * Declare the ntpsnmpd option descriptor.
+ */
+extern tOptions ntpsnmpdOptions;
#if defined(ENABLE_NLS)
# ifndef _
#
# EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.texi)
#
-# It has been AutoGen-ed April 28, 2011 at 06:47:29 AM by AutoGen 5.11.6
+# It has been AutoGen-ed May 1, 2011 at 04:29:14 AM by AutoGen 5.11.9pre8
# From the definitions ntpsnmpd-opts.def
# and the template file aginfo.tpl
@end ignore
@exampleindent 0
@example
-ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p159
+ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p160
USAGE: ntpsnmpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
Flg Arg Option-Name Description
-n no nofork Do not fork
-.TH NTPSNMPD 1 2011-04-28 "( 4.2.7p159)" "Programmer's Manual"
+.TH NTPSNMPD 1 2011-05-01 "( 4.2.7p160)" "Programmer's Manual"
.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd.1)
.\"
-.\" It has been AutoGen-ed April 28, 2011 at 06:47:29 AM by AutoGen 5.11.6
+.\" It has been AutoGen-ed May 1, 2011 at 04:29:14 AM by AutoGen 5.11.9pre8
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agman1.tpl
.\"
.nf
.na
see html/copyright.html
+
.fi
.ad
.PP
# - Numeric values increment
# - empty 'increments' to 1
# - NEW 'increments' to empty
-point=159
+point=160
### betapoint is normally modified by script.
# ntp-stable Beta number (betapoint)
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.c)
*
- * It has been AutoGen-ed April 28, 2011 at 06:44:05 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 08:11:05 AM by AutoGen 5.11.9pre8
* From the definitions sntp-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* sntp copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
#include <sys/types.h>
+
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-extern FILE * option_usage_fp;
#define OPTION_CODE_COMPILE 1
#include "sntp-opts.h"
#ifdef __cplusplus
extern "C" {
#endif
+extern FILE * option_usage_fp;
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
-tSCC zCopyright[] =
- "sntp copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from copyright.def near line 8 */
-;
-tSCC zCopyrightNotice[24] =
-"see html/copyright.html";
+static char const zCopyright[40] =
+"sntp 4.2.7p160\n\
+see html/copyright.html\n";
+static char const zCopyrightNotice[25] =
+"see html/copyright.html\n";
extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
#endif
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
/*
* Debug_Level option description:
extern tOptProc
optionBooleanVal, optionNestedVal, optionNumericVal,
optionPagedUsage, optionPrintVersion, optionResetOpt,
- optionStackArg, optionTimeVal, optionUnstackArg,
- optionVersionStderr;
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVersionStderr;
static tOptProc
doOptFilelog, doOptKeyfile, doOptKod,
doOptNtpversion, doOptSet_Debug_Level, doOptSteplimit,
*
* Define the Sntp Option Descriptions.
*/
-static tOptDesc optDesc[ OPTION_CT ] = {
+static tOptDesc optDesc[OPTION_CT] = {
{ /* entry idx, value */ 0, VALUE_OPT_DEBUG_LEVEL,
/* equiv idx, value */ 0, VALUE_OPT_DEBUG_LEVEL,
/* equivalenced to */ NO_EQUIVALENT,
*/
static char const zPROGNAME[5] = "SNTP";
static char const zUsageTitle[154] =
-"sntp - standard Simple Network Time Protocol program - Ver. 4.2.7p159\n\
+"sntp - standard Simple Network Time Protocol program - Ver. 4.2.7p160\n\
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ hostname-or-IP ...]\n";
static char const zRcName[7] = ".ntprc";
NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC\n\
1305.\n";
static char const zFullVersion[] = SNTP_FULL_VERSION;
-/* extracted from optcode.tlib near line 504 */
+/* extracted from optcode.tlib near line 515 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
* Create the static procedure(s) declared above.
*/
static void
-doUsageOpt(
- tOptions* pOptions,
- tOptDesc* pOptDesc )
+doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
{
(void)pOptions;
- USAGE(EXIT_SUCCESS);
+ USAGE(SNTP_EXIT_SUCCESS);
}
#if ! defined(TEST_SNTP_OPTS)
{
static const struct {long const rmin, rmax;} rng[1] = {
{ 0, LONG_MAX } };
- long val;
int ix;
- char * pzEnd;
if (pOptions <= OPTPROC_EMIT_LIMIT)
goto emit_ranges;
+ optionNumericVal(pOptions, pOptDesc);
- errno = 0;
- val = strtol(pOptDesc->optArg.argString, &pzEnd, 0);
- if ((pOptDesc->optArg.argString == pzEnd) || (errno != 0))
- goto bad_value;
-
- if (*pzEnd != '\0')
- goto bad_value;
for (ix = 0; ix < 1; ix++) {
- if (val < rng[ix].rmin)
+ if (pOptDesc->optArg.argInt < rng[ix].rmin)
continue; /* ranges need not be ordered. */
- if (val == rng[ix].rmin)
- goto valid_return;
+ if (pOptDesc->optArg.argInt == rng[ix].rmin)
+ return;
if (rng[ix].rmax == LONG_MIN)
continue;
- if (val <= rng[ix].rmax)
- goto valid_return;
+ if (pOptDesc->optArg.argInt <= rng[ix].rmax)
+ return;
}
- bad_value:
-
option_usage_fp = stderr;
- emit_ranges:
- optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
- return;
+emit_ranges:
- valid_return:
- if ((pOptDesc->fOptState & OPTST_ALLOC_ARG) != 0) {
- free((void *)pOptDesc->optArg.argString);
- pOptDesc->fOptState &= ~OPTST_ALLOC_ARG;
- }
- pOptDesc->optArg.argInt = val;
+ optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
{
static const struct {long const rmin, rmax;} rng[1] = {
{ 0, 7 } };
- long val;
int ix;
- char * pzEnd;
if (pOptions <= OPTPROC_EMIT_LIMIT)
goto emit_ranges;
+ optionNumericVal(pOptions, pOptDesc);
- errno = 0;
- val = strtol(pOptDesc->optArg.argString, &pzEnd, 0);
- if ((pOptDesc->optArg.argString == pzEnd) || (errno != 0))
- goto bad_value;
-
- if (*pzEnd != '\0')
- goto bad_value;
for (ix = 0; ix < 1; ix++) {
- if (val < rng[ix].rmin)
+ if (pOptDesc->optArg.argInt < rng[ix].rmin)
continue; /* ranges need not be ordered. */
- if (val == rng[ix].rmin)
- goto valid_return;
+ if (pOptDesc->optArg.argInt == rng[ix].rmin)
+ return;
if (rng[ix].rmax == LONG_MIN)
continue;
- if (val <= rng[ix].rmax)
- goto valid_return;
+ if (pOptDesc->optArg.argInt <= rng[ix].rmax)
+ return;
}
- bad_value:
-
option_usage_fp = stderr;
- emit_ranges:
- optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
- return;
+emit_ranges:
- valid_return:
- if ((pOptDesc->fOptState & OPTST_ALLOC_ARG) != 0) {
- free((void *)pOptDesc->optArg.argString);
- pOptDesc->fOptState &= ~OPTST_ALLOC_ARG;
- }
- pOptDesc->optArg.argInt = val;
+ optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
}
-/* extracted from optmain.tlib near line 107 */
+/* extracted from optmain.tlib near line 128 */
#if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */
extern void optionPutShell(tOptions*);
int
-main(int argc, char** argv)
+main(int argc, char ** argv)
{
- int res = EXIT_SUCCESS;
+ int res = SNTP_EXIT_SUCCESS;
(void)optionProcess(&sntpOptions, argc, argv);
optionPutShell(&sntpOptions);
res = ferror(stdout);
return res;
}
#endif /* defined TEST_SNTP_OPTS */
-/* extracted from optcode.tlib near line 657 */
+/* extracted from optcode.tlib near line 666 */
#if ENABLE_NLS
#include <stdio.h>
pzRes = strdup(pzRes);
if (pzRes == NULL) {
fputs(_("No memory for duping translated strings\n"), stderr);
- exit(EXIT_FAILURE);
+ exit(SNTP_EXIT_FAILURE);
}
return pzRes;
}
-static void coerce_it(void** s) { *s = AO_gettext(*s); }
-#define COERSION(_f) \
- coerce_it((void*)&(sntpOptions._f))
+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)
{
+ tOptions * const pOpt = &sntpOptions;
+
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
*/
- tOptDesc* pOD = sntpOptions.pOptDesc;
- char** ppz = (char**)(void*)&(option_usage_text);
- int ix = option_usage_text.field_ct;
+ tOptDesc * pOD = pOpt->pOptDesc;
+ char ** ppz = (char**)(void*)&(option_usage_text);
+ int ix = option_usage_text.field_ct;
do {
ppz++;
*ppz = AO_gettext(*ppz);
} while (--ix > 0);
- COERSION(pzCopyright);
- COERSION(pzCopyNotice);
- COERSION(pzFullVersion);
- COERSION(pzUsageTitle);
- COERSION(pzExplain);
- COERSION(pzDetail);
- COERSION(pzPackager);
+ coerce_it((void*)&(pOpt->pzCopyright));
+ coerce_it((void*)&(pOpt->pzCopyNotice));
+ coerce_it((void*)&(pOpt->pzFullVersion));
+ coerce_it((void*)&(pOpt->pzUsageTitle));
+ coerce_it((void*)&(pOpt->pzExplain));
+ coerce_it((void*)&(pOpt->pzDetail));
+ coerce_it((void*)&(pOpt->pzPackager));
option_usage_text.field_ct = 0;
- for (ix = sntpOptions.optCt; ix > 0; ix--, pOD++)
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
coerce_it((void*)&(pOD->pzText));
}
- if ((sntpOptions.fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
- tOptDesc* pOD = sntpOptions.pOptDesc;
- int ix;
+ if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
+ tOptDesc * pOD = pOpt->pOptDesc;
+ int ix;
- for (ix = sntpOptions.optCt; ix > 0; ix--, pOD++) {
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
coerce_it((void*)&(pOD->pz_Name));
coerce_it((void*)&(pOD->pz_DisableName));
coerce_it((void*)&(pOD->pz_DisablePfx));
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.h)
*
- * It has been AutoGen-ed April 28, 2011 at 06:44:05 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 08:11:05 AM by AutoGen 5.11.9pre8
* From the definitions sntp-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This header file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* sntp copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
/*
* This file contains the programmatic interface to the Automated
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 139264
+#define AO_TEMPLATE_VERSION 143360
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
} teOptIndex;
#define OPTION_CT 24
-#define SNTP_VERSION "4.2.7p159"
-#define SNTP_FULL_VERSION "sntp - standard Simple Network Time Protocol program - Ver. 4.2.7p159"
+#define SNTP_VERSION "4.2.7p160"
+#define SNTP_FULL_VERSION "sntp 4.2.7p160"
/*
* Interface defines for all options. Replace "n" with the UPPER_CASED
SNTP_EXIT_SUCCESS = 0,
SNTP_EXIT_FAILURE = 1
} sntp_exit_code_t;
-
/*
* Make sure there are no #define name conflicts with the option names
*/
sntpOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*sntpOptions.pUsageProc)(&sntpOptions, c)
-/* extracted from opthead.tlib near line 435 */
+/* extracted from opthead.tlib near line 451 */
-/* * * * * *
- *
- * Declare the sntp option descriptor.
- */
#ifdef __cplusplus
extern "C" {
#endif
-extern tOptions sntpOptions;
+/* * * * * *
+ *
+ * Declare the sntp option descriptor.
+ */
+extern tOptions sntpOptions;
#if defined(ENABLE_NLS)
# ifndef _
#
# EDIT THIS FILE WITH CAUTION (sntp-opts.texi)
#
-# It has been AutoGen-ed April 28, 2011 at 06:47:46 AM by AutoGen 5.11.6
+# It has been AutoGen-ed May 1, 2011 at 04:29:47 AM by AutoGen 5.11.9pre8
# From the definitions sntp-opts.def
# and the template file aginfo.tpl
@end ignore
@exampleindent 0
@example
-sntp - standard Simple Network Time Protocol program - Ver. 4.2.7p159
+sntp - standard Simple Network Time Protocol program - Ver. 4.2.7p160
USAGE: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
-k Fil keyfile Look in this file for the key specified with -a
-l Fil filelog Log to specified logfile
-M Num steplimit Adjustments less than steplimit msec will be slewed.
- - it must be: greater than or equal to 0
+ - It must be in the range:
+ greater than or equal to 0
-o Num ntpversion Send <int> as our NTP version
- - it must be: 0 to 7
+ - It must be in the range:
+ 0 to 7
-r no usereservedport Use the NTP Reserved Port (port 123)
-S no step OK to 'step' the time with settimeofday()
-s no slew OK to 'slew' the time with adjtime()
-.TH SNTP 1 2011-04-28 "( 4.2.7p159)" "Programmer's Manual"
-.\" EDIT THIS FILE WITH CAUTION (sntp.1)
+.TH sntp 1 "01 May 2011" "4.2.7p160" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (sntp.man)
.\"
-.\" It has been AutoGen-ed April 28, 2011 at 06:47:46 AM by AutoGen 5.11.6
+.\" It has been AutoGen-ed May 1, 2011 at 04:29:46 AM by AutoGen 5.11.9pre8
.\" From the definitions sntp-opts.def
-.\" and the template file agman1.tpl
+.\" and the template file agman-cmd.tpl
.\"
.SH NAME
sntp \- standard Simple Network Time Protocol program
.SH SYNOPSIS
.B sntp
.\" Mixture of short (flag) options and long options
-.RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
-.br
-.in +8
-[ hostname-or-IP ...]
+.RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \-\-\fIopt\-name\fP " [[=| ]\fIvalue\fP]]..." [ hostname-or-IP ...]
.PP
-
-.SH "DESCRIPTION"
-This manual page briefly documents the \fBsntp\fP command.
+.SH DESCRIPTION
.I sntp
can be used as a SNTP client to query a NTP or SNTP server and either display
the time or set the local system's time (given suitable privilege). It can be
run as an interactive command or in a
.I cron
job.
-
NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
are defined and described by RFC 5905.
-
.PP
The default is to write the estimated correct local date and time (i.e. not
UTC) to the standard output in a format like
seconds.
.SH OPTIONS
.TP
-.BR \-d ", " \--debug-level
+.BR \-d ", " -\-debug\-level
Increase output debug message level.
This option may appear an unlimited number of times.
.sp
Increase the debugging message output level.
.TP
-.BR \-D " \fIstring\fP, " \--set-debug-level "=" \fIstring\fP
+.BR \-D " \fIstring\fP, " \-\-set\-debug\-level "=" \fIstring\fP
Set the output debug message level.
This option may appear an unlimited number of times.
.sp
Set the output debugging level. Can be supplied multiple times,
but each overrides the previous value(s).
.TP
-.BR \-4 ", " \--ipv4
+.BR \-4 ", " -\-ipv4
Force IPv4 DNS name resolution.
This option must not appear in combination with any of the following options:
ipv6.
Force DNS resolution of following host names on the command line
to the IPv4 namespace.
.TP
-.BR \-6 ", " \--ipv6
+.BR \-6 ", " -\-ipv6
Force IPv6 DNS name resolution.
This option must not appear in combination with any of the following options:
ipv4.
Force DNS resolution of following host names on the command line
to the IPv6 namespace.
.TP
-.BR \-a " \fIauth-keynumber\fP, " \--authentication "=" \fIauth-keynumber\fP
+.BR \-a " \fIauth\-keynumber\fP, " \-\-authentication "=" \fIauth\-keynumber\fP
Enable authentication with the key auth-keynumber.
This option takes an integer number as its argument.
.sp
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.
.TP
-.BR \-B " \fIseconds\fP, " \--bctimeout "=" \fIseconds\fP
+.BR \-B " \fIseconds\fP, " \-\-bctimeout "=" \fIseconds\fP
The number of seconds to wait for broadcasts.
This option takes an integer number as its argument.
-The default \fIseconds\fP for this option is:
+The default \fIseconds\fP for this option is:
.ti +4
68
.sp
When waiting for a broadcast packet SNTP will wait the number
of seconds specified before giving up. Default 68 seconds.
.TP
-.BR \-b " \fIbroadcast-address\fP, " \--broadcast "=" \fIbroadcast-address\fP
+.BR \-b " \fIbroadcast\-address\fP, " \-\-broadcast "=" \fIbroadcast\-address\fP
Listen to the address specified for broadcast time sync.
This option may appear an unlimited number of times.
.sp
If specified SNTP will listen to the specified address
for NTP broadcasts. The default maximum wait time,
-68 seconds, can be modified with \-B.
+68 seconds, can be modified with -B.
.TP
-.BR \-c " \fIhost-name\fP, " \--concurrent "=" \fIhost-name\fP
+.BR \-c " \fIhost\-name\fP, " \-\-concurrent "=" \fIhost\-name\fP
Concurrent query all IPs returned for host-name.
This option may appear an unlimited number of times.
.sp
as part of a DNS lookup are assumed to be for a single instance of
ntpd, and therefore sntp will send queries to these IPs one after
another, with a 2-second gap in between each query.
-
-The \-c or \--concurrent flag says that any IPs returned for the
+The -c or --concurrent flag says that any IPs returned for the
DNS lookup of the supplied host-name are on different machines,
so we can send concurrent queries.
.TP
-.BR \-h " \fImilliseconds\fP, " \--headspace "=" \fImilliseconds\fP
+.BR \-h " \fImilliseconds\fP, " \-\-headspace "=" \fImilliseconds\fP
The gap (in milliseconds) between time requests.
This option takes an integer number as its argument.
-The default \fImilliseconds\fP for this option is:
+The default \fImilliseconds\fP for this option is:
.ti +4
10
.sp
milliseconds.
Default 10 milliseconds.
.TP
-.BR \-K " \fIfile-name\fP, " \--kod "=" \fIfile-name\fP
+.BR \-K " \fIfile\-name\fP, " \-\-kod "=" \fIfile\-name\fP
KoD history filename.
-The default \fIfile-name\fP for this option is:
+The default \fIfile\-name\fP for this option is:
.ti +4
/var/db/ntp-kod
.sp
responses received from servers. The default is
/var/db/ntp-kod.
.TP
-.BR \-k " \fIfile-name\fP, " \--keyfile "=" \fIfile-name\fP
-Look in this file for the key specified with \-a.
+.BR \-k " \fIfile\-name\fP, " \-\-keyfile "=" \fIfile\-name\fP
+Look in this file for the key specified with -a.
.sp
-This option specifies the keyfile. SNTP will search for the key specified with \-a keyno in this
+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).
.TP
-.BR \-l " \fIfile-name\fP, " \--filelog "=" \fIfile-name\fP
+.BR \-l " \fIfile\-name\fP, " \-\-filelog "=" \fIfile\-name\fP
Log to specified logfile.
.sp
This option causes the client to write log messages to the specified
logfile.
.TP
-.BR \-M " \fInumber\fP, " \--steplimit "=" \fInumber\fP
+.BR \-M " \fInumber\fP, " \-\-steplimit "=" \fInumber\fP
Adjustments less than steplimit msec will be slewed..
This option takes an integer number as its argument.
-The value of \fInumber\fP is constrained to being:
+The value of \fInumber\fP is constrained to being:
.in +4
.nf
.na
.sp
If the time adjustment is less than steplimit milliseconds, slew the amount using adjtime(). Otherwise, step the correction using settimeofday().
.TP
-.BR \-o " \fInumber\fP, " \--ntpversion "=" \fInumber\fP
+.BR \-o " \fInumber\fP, " \-\-ntpversion "=" \fInumber\fP
Send <int> as our NTP version.
This option takes an integer number as its argument.
-The value of \fInumber\fP is constrained to being:
+The value of \fInumber\fP is constrained to being:
.in +4
.nf
.na
in the range 0 through 7
.fi
.in -4
-The default \fInumber\fP for this option is:
+The default \fInumber\fP for this option is:
.ti +4
4
.sp
When sending requests to a remote server, tell them we are running
NTP protocol version <ntpversion> .
.TP
-.BR \-r ", " \--usereservedport
+.BR \-r ", " -\-usereservedport
Use the NTP Reserved Port (port 123).
.sp
Use port 123, which is reserved for NTP, for our network communications.
.TP
-.BR \-S ", " \--step
+.BR \-S ", " -\-step
OK to 'step' the time with settimeofday().
.sp
-
.TP
-.BR \-s ", " \--slew
+.BR \-s ", " -\-slew
OK to 'slew' the time with adjtime().
.sp
-
.TP
-.BR \-u " \fIseconds\fP, " \--uctimeout "=" \fIseconds\fP
+.BR \-u " \fIseconds\fP, " \-\-uctimeout "=" \fIseconds\fP
The number of seconds to wait for unicast responses.
This option takes an integer number as its argument.
-The default \fIseconds\fP for this option is:
+The default \fIseconds\fP for this option is:
.ti +4
5
.sp
When waiting for a unicast reply, SNTP will wait the number
of seconds specified before giving up. Default 5 seconds.
.TP
-.BR \--wait, " \fB--no-wait\fP"
+.BR \-\-wait, " \fB\-\-no\-wait\fP"
Wait for pending replies (if not setting the time).
-The \fIno-wait\fP form will disable the option.
+The \fIno\-wait\fP form will disable the option.
This option is enabled by default.
.sp
If we are not setting the time, wait for all pending responses.
.TP
-.BR \-? , " \--help"
-Display extended usage information and exit.
+.BR \-? , " \-\-help"
+Display usage information and exit.
.TP
-.BR \-! , " \--more-help"
-Extended usage information passed thru pager.
+.BR \-! , " \-\-more-help"
+Pass the extended usage information through a pager.
.TP
-.BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
-Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
-configuration file listed in the \fBOPTION PRESETS\fP section, below.
+.BR \-> " [\fIrcfile\fP]," " \-\-save-opts" "[=\fIrcfile\fP]"
+Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
.TP
-.BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts"
-Load options from \fIrcfile\fP.
-The \fIno-load-opts\fP form will disable the loading
-of earlier RC/INI files. \fI--no-load-opts\fP is handled early,
+.BR \-< " \fIrcfile\fP," " \-\-load-opts" "=\fIrcfile\fP," " \-\-no-load-opts"
+Load options from \fIrcfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier RC/INI files. \fI\-\-no-load-opts\fP is handled early,
out of order.
.TP
-.BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]"
+.BR \- " [{\fIv|c|n\fP}]," " \-\-version" "[=\fI{v|c|n}\fP]"
Output version of program and exit. The default mode is `v', a simple
version. The `c' mode will print copyright information and `n' will
print the full copyright notice.
-.SH OPTION PRESETS
-Any option that is not marked as \fInot presettable\fP may be preset
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
by loading values from configuration ("RC" or ".INI") file(s) and values from
environment variables named:
.nf
- \fBSNTP_<option-name>\fP or \fBSNTP\fP
+ \fBSNTP_<option-name>\fP or \fBSNTP\fP
.fi
.ad
The environmental presets take precedence (are processed later than)
the configuration files.
-The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
-If any of these are directories, then the file \fI.ntprc\fP
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
is searched for within those directories.
-.SH USAGE
-The simplest use of this program is as an unprivileged command to check the
-current time and error in the local clock. For example:
-.IP
-.B sntp ntpserver.somewhere
-.PP
-With suitable privilege, it can be run as a command or in a
-.I cron
-job to reset the local clock from a reliable server, like the
-.I ntpdate
-and
-.I rdate
-commands. For example:
-.IP
-.B sntp \-a ntpserver.somewhere
-.SH RETURN VALUE
-The program returns a zero exit
-status for success, and a non-zero one otherwise.
-.SH BUGS
-Please report bugs to http://bugs.ntp.org .
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.BR 0
+Successful program execution.
+.TP
+.BR 1
+The operation failed or the command syntax was not valid.
+.SH ENVIRONMENT
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH FILES
+See \fBOPTION PRESETS\fP for configuration files.
.SH AUTHOR
David L. Mills and/or others
.br
Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
-
.PP
.nf
.na
.fi
.ad
.PP
-This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP
+This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP
option definitions.
<p><a name="index-sntp-usage-3"></a>
This is the automatically generated usage text for sntp:
-<pre class="example">sntp - standard Simple Network Time Protocol program - Ver. 4.2.7p159
+<pre class="example">sntp - standard Simple Network Time Protocol program - Ver. 4.2.7p160
USAGE: sntp [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
-k Fil keyfile Look in this file for the key specified with -a
-l Fil filelog Log to specified logfile
-M Num steplimit Adjustments less than steplimit msec will be slewed.
- - it must be: greater than or equal to 0
+ - It must be in the range:
+ greater than or equal to 0
-o Num ntpversion Send <int> as our NTP version
- - it must be: 0 to 7
+ - It must be in the range:
+ 0 to 7
-r no usereservedport Use the NTP Reserved Port (port 123)
-S no step OK to 'step' the time with settimeofday()
-s no slew OK to 'slew' the time with adjtime()
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c)
*
- * It has been AutoGen-ed April 28, 2011 at 06:47:31 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 04:29:19 AM by AutoGen 5.11.9pre8
* From the definitions ntp-keygen-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntp-keygen copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
#include <sys/types.h>
+
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-extern FILE * option_usage_fp;
#define OPTION_CODE_COMPILE 1
#include "ntp-keygen-opts.h"
#ifdef __cplusplus
extern "C" {
#endif
+extern FILE * option_usage_fp;
/* TRANSLATORS: choose the translation for option names wisely because you
cannot ever change your mind. */
-tSCC zCopyright[] =
- "ntp-keygen copyright (c) 1970-2011 David L. Mills and/or others, all rights reserved"
-/* extracted from copyright.def near line 8 */
-;
-tSCC zCopyrightNotice[24] =
-"see html/copyright.html";
+static char const zCopyright[52] =
+"ntp-keygen (ntp) 4.2.7p160\n\
+see html/copyright.html\n";
+static char const zCopyrightNotice[25] =
+"see html/copyright.html\n";
extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
#endif
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
/*
* Certificate option description:
* if multiple copies are allowed.
*/
static tOptProc
- doOptModulus, doUsageOpt;
+ doUsageOpt;
/*
* #define map the "normal" callout procs to the test ones...
extern tOptProc
optionBooleanVal, optionNestedVal, optionNumericVal,
optionPagedUsage, optionPrintVersion, optionResetOpt,
- optionStackArg, optionTimeVal, optionUnstackArg,
- optionVersionStderr;
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVersionStderr;
static tOptProc
doOptSet_Debug_Level, doUsageOpt;
*
* Define the Ntp_Keygen Option Descriptions.
*/
-static tOptDesc optDesc[ OPTION_CT ] = {
+static tOptDesc optDesc[OPTION_CT] = {
{ /* entry idx, value */ 0, VALUE_OPT_CERTIFICATE,
/* equiv idx, value */ 0, VALUE_OPT_CERTIFICATE,
/* equivalenced to */ NO_EQUIVALENT,
*/
static char const zPROGNAME[11] = "NTP_KEYGEN";
static char const zUsageTitle[116] =
-"ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p159\n\
+"ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p160\n\
USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n";
static char const zRcName[7] = ".ntprc";
static char const * const apzHomeList[3] = {
If there is no new host key, look for an existing one. If one is not\n\
found, create it.\n";
static char const zFullVersion[] = NTP_KEYGEN_FULL_VERSION;
-/* extracted from optcode.tlib near line 504 */
+/* extracted from optcode.tlib near line 515 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
* Create the static procedure(s) declared above.
*/
static void
-doUsageOpt(
- tOptions* pOptions,
- tOptDesc* pOptDesc )
+doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
{
(void)pOptions;
- USAGE(EXIT_SUCCESS);
+ USAGE(NTP_KEYGEN_EXIT_SUCCESS);
}
#if ! defined(TEST_NTP_KEYGEN_OPTS)
{
static const struct {long const rmin, rmax;} rng[1] = {
{ 256, 2048 } };
- long val;
int ix;
- char * pzEnd;
if (pOptions <= OPTPROC_EMIT_LIMIT)
goto emit_ranges;
+ optionNumericVal(pOptions, pOptDesc);
- errno = 0;
- val = strtol(pOptDesc->optArg.argString, &pzEnd, 0);
- if ((pOptDesc->optArg.argString == pzEnd) || (errno != 0))
- goto bad_value;
-
- if (*pzEnd != '\0')
- goto bad_value;
for (ix = 0; ix < 1; ix++) {
- if (val < rng[ix].rmin)
+ if (pOptDesc->optArg.argInt < rng[ix].rmin)
continue; /* ranges need not be ordered. */
- if (val == rng[ix].rmin)
- goto valid_return;
+ if (pOptDesc->optArg.argInt == rng[ix].rmin)
+ return;
if (rng[ix].rmax == LONG_MIN)
continue;
- if (val <= rng[ix].rmax)
- goto valid_return;
+ if (pOptDesc->optArg.argInt <= rng[ix].rmax)
+ return;
}
- bad_value:
-
option_usage_fp = stderr;
- emit_ranges:
- optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
- return;
+emit_ranges:
- valid_return:
- if ((pOptDesc->fOptState & OPTST_ALLOC_ARG) != 0) {
- free((void *)pOptDesc->optArg.argString);
- pOptDesc->fOptState &= ~OPTST_ALLOC_ARG;
- }
- pOptDesc->optArg.argInt = val;
+ optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
}
#endif /* defined AUTOKEY */
-/* extracted from optmain.tlib near line 107 */
+/* extracted from optmain.tlib near line 128 */
#if defined(TEST_NTP_KEYGEN_OPTS) /* TEST MAIN PROCEDURE: */
extern void optionPutShell(tOptions*);
int
-main(int argc, char** argv)
+main(int argc, char ** argv)
{
- int res = EXIT_SUCCESS;
+ int res = NTP_KEYGEN_EXIT_SUCCESS;
(void)optionProcess(&ntp_keygenOptions, argc, argv);
optionPutShell(&ntp_keygenOptions);
res = ferror(stdout);
return res;
}
#endif /* defined TEST_NTP_KEYGEN_OPTS */
-/* extracted from optcode.tlib near line 657 */
+/* extracted from optcode.tlib near line 666 */
#if ENABLE_NLS
#include <stdio.h>
pzRes = strdup(pzRes);
if (pzRes == NULL) {
fputs(_("No memory for duping translated strings\n"), stderr);
- exit(EXIT_FAILURE);
+ exit(NTP_KEYGEN_EXIT_FAILURE);
}
return pzRes;
}
-static void coerce_it(void** s) { *s = AO_gettext(*s); }
-#define COERSION(_f) \
- coerce_it((void*)&(ntp_keygenOptions._f))
+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)
{
+ tOptions * const pOpt = &ntp_keygenOptions;
+
/*
* Guard against re-translation. It won't work. The strings will have
* been changed by the first pass through this code. One shot only.
* Do the translations. The first pointer follows the field count
* field. The field count field is the size of a pointer.
*/
- tOptDesc* pOD = ntp_keygenOptions.pOptDesc;
- char** ppz = (char**)(void*)&(option_usage_text);
- int ix = option_usage_text.field_ct;
+ tOptDesc * pOD = pOpt->pOptDesc;
+ char ** ppz = (char**)(void*)&(option_usage_text);
+ int ix = option_usage_text.field_ct;
do {
ppz++;
*ppz = AO_gettext(*ppz);
} while (--ix > 0);
- COERSION(pzCopyright);
- COERSION(pzCopyNotice);
- COERSION(pzFullVersion);
- COERSION(pzUsageTitle);
- COERSION(pzExplain);
- COERSION(pzDetail);
- COERSION(pzPackager);
+ coerce_it((void*)&(pOpt->pzCopyright));
+ coerce_it((void*)&(pOpt->pzCopyNotice));
+ coerce_it((void*)&(pOpt->pzFullVersion));
+ coerce_it((void*)&(pOpt->pzUsageTitle));
+ coerce_it((void*)&(pOpt->pzExplain));
+ coerce_it((void*)&(pOpt->pzDetail));
+ coerce_it((void*)&(pOpt->pzPackager));
option_usage_text.field_ct = 0;
- for (ix = ntp_keygenOptions.optCt; ix > 0; ix--, pOD++)
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
coerce_it((void*)&(pOD->pzText));
}
- if ((ntp_keygenOptions.fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
- tOptDesc* pOD = ntp_keygenOptions.pOptDesc;
- int ix;
+ if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
+ tOptDesc * pOD = pOpt->pOptDesc;
+ int ix;
- for (ix = ntp_keygenOptions.optCt; ix > 0; ix--, pOD++) {
+ for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
coerce_it((void*)&(pOD->pz_Name));
coerce_it((void*)&(pOD->pz_DisableName));
coerce_it((void*)&(pOD->pz_DisablePfx));
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
*
- * It has been AutoGen-ed April 28, 2011 at 06:47:31 AM by AutoGen 5.11.6
+ * It has been AutoGen-ed May 1, 2011 at 04:29:18 AM by AutoGen 5.11.9pre8
* From the definitions ntp-keygen-opts.def
* and the template file options
*
- * Generated from AutoOpts 34:0:9 templates.
+ * Generated from AutoOpts 35:0:10 templates.
*
* AutoOpts is a copyrighted work. This header file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
* ntp-keygen copyright (c) 1970-2011 David L. Mills and/or others - all rights reserved
*
* see html/copyright.html
+ *
*/
/*
* This file contains the programmatic interface to the Automated
* tolerable version is at least as old as what was current when the header
* template was released.
*/
-#define AO_TEMPLATE_VERSION 139264
+#define AO_TEMPLATE_VERSION 143360
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
} teOptIndex;
#define OPTION_CT 24
-#define NTP_KEYGEN_VERSION "4.2.7p159"
-#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p159"
+#define NTP_KEYGEN_VERSION "4.2.7p160"
+#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.7p160"
/*
* Interface defines for all options. Replace "n" with the UPPER_CASED
NTP_KEYGEN_EXIT_SUCCESS = 0,
NTP_KEYGEN_EXIT_FAILURE = 1
} ntp_keygen_exit_code_t;
-
/*
* Make sure there are no #define name conflicts with the option names
*/
ntp_keygenOptions.pzCurOpt = NULL)
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntp_keygenOptions.pUsageProc)(&ntp_keygenOptions, c)
-/* extracted from opthead.tlib near line 435 */
+/* extracted from opthead.tlib near line 451 */
-/* * * * * *
- *
- * Declare the ntp-keygen option descriptor.
- */
#ifdef __cplusplus
extern "C" {
#endif
-extern tOptions ntp_keygenOptions;
+/* * * * * *
+ *
+ * Declare the ntp-keygen option descriptor.
+ */
+extern tOptions ntp_keygenOptions;
#if defined(ENABLE_NLS)
# ifndef _
#
# EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.texi)
#
-# It has been AutoGen-ed April 28, 2011 at 06:47:40 AM by AutoGen 5.11.6
+# It has been AutoGen-ed May 1, 2011 at 04:29:27 AM by AutoGen 5.11.9pre8
# From the definitions ntp-keygen-opts.def
# and the template file aginfo.tpl
@end ignore
@exampleindent 0
@example
-ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p159
+ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p160
USAGE: ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
Flg Arg Option-Name Description
-c Str certificate certificate scheme
-l Num lifetime set certificate lifetime
-M no md5key generate MD5 keys
-m Num modulus modulus
- - it must be: 256 to 2048
+ - It must be in the range:
+ 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
-.TH NTP-KEYGEN 1 2011-04-28 "(ntp 4.2.7p159)" "Programmer's Manual"
+.TH NTP-KEYGEN 1 2011-05-01 "(ntp 4.2.7p160)" "Programmer's Manual"
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen.1)
.\"
-.\" It has been AutoGen-ed April 28, 2011 at 06:47:40 AM by AutoGen 5.11.6
+.\" It has been AutoGen-ed May 1, 2011 at 04:29:27 AM by AutoGen 5.11.9pre8
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agman1.tpl
.\"
.nf
.na
see html/copyright.html
+
.fi
.ad
.PP