summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/ntpq/ntpq-opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/ntpq/ntpq-opts.c')
-rw-r--r--contrib/ntp/ntpq/ntpq-opts.c166
1 files changed, 112 insertions, 54 deletions
diff --git a/contrib/ntp/ntpq/ntpq-opts.c b/contrib/ntp/ntpq/ntpq-opts.c
index 42131a3..a3ff412 100644
--- a/contrib/ntp/ntpq/ntpq-opts.c
+++ b/contrib/ntp/ntpq/ntpq-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.c)
*
- * It has been AutoGen-ed January 20, 2016 at 04:18:42 AM by AutoGen 5.18.5
+ * It has been AutoGen-ed April 26, 2016 at 08:29:11 PM by AutoGen 5.18.5
* From the definitions ntpq-opts.def
* and the template file options
*
@@ -68,8 +68,8 @@ extern FILE * option_usage_fp;
/**
* static const strings for ntpq options
*/
-static char const ntpq_opt_strs[1925] =
-/* 0 */ "ntpq 4.2.8p6\n"
+static char const ntpq_opt_strs[1982] =
+/* 0 */ "ntpq 4.2.8p7\n"
"Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -113,29 +113,33 @@ static char const ntpq_opt_strs[1925] =
/* 1404 */ "Print a list of the peers\0"
/* 1430 */ "PEERS\0"
/* 1436 */ "peers\0"
-/* 1442 */ "Display the full 'remote' value\0"
-/* 1474 */ "WIDE\0"
-/* 1479 */ "wide\0"
-/* 1484 */ "display extended usage information and exit\0"
-/* 1528 */ "help\0"
-/* 1533 */ "extended usage information passed thru pager\0"
-/* 1578 */ "more-help\0"
-/* 1588 */ "output version information and exit\0"
-/* 1624 */ "version\0"
-/* 1632 */ "save the option state to a config file\0"
-/* 1671 */ "save-opts\0"
-/* 1681 */ "load options from a config file\0"
-/* 1713 */ "LOAD_OPTS\0"
-/* 1723 */ "no-load-opts\0"
-/* 1736 */ "no\0"
-/* 1739 */ "NTPQ\0"
-/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p6\n"
+/* 1442 */ "Set default display type for S2+ refids\0"
+/* 1482 */ "REFID\0"
+/* 1488 */ "refid\0"
+/* 1494 */ "Display the full 'remote' value\0"
+/* 1526 */ "WIDE\0"
+/* 1531 */ "wide\0"
+/* 1536 */ "display extended usage information and exit\0"
+/* 1580 */ "help\0"
+/* 1585 */ "extended usage information passed thru pager\0"
+/* 1630 */ "more-help\0"
+/* 1640 */ "output version information and exit\0"
+/* 1676 */ "version\0"
+/* 1684 */ "save the option state to a config file\0"
+/* 1723 */ "save-opts\0"
+/* 1733 */ "load options from a config file\0"
+/* 1765 */ "LOAD_OPTS\0"
+/* 1775 */ "no-load-opts\0"
+/* 1788 */ "no\0"
+/* 1791 */ "NTPQ\0"
+/* 1796 */ "ntpq - standard NTP query program - Ver. 4.2.8p7\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
-/* 1863 */ "$HOME\0"
-/* 1869 */ ".\0"
-/* 1871 */ ".ntprc\0"
-/* 1878 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/* 1912 */ "ntpq 4.2.8p6";
+/* 1915 */ "$HOME\0"
+/* 1921 */ ".\0"
+/* 1923 */ ".ntprc\0"
+/* 1930 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 1964 */ "ntpq 4.2.8p7\0"
+/* 1977 */ "hash";
/**
* ipv4 option description with
@@ -265,25 +269,40 @@ static int const aPeersCantList[] = {
#define PEERS_FLAGS (OPTST_DISABLED)
/**
+ * refid option description:
+ */
+/** Descriptive text for the refid option */
+#define REFID_DESC (ntpq_opt_strs+1442)
+/** Upper-cased name for the refid option */
+#define REFID_NAME (ntpq_opt_strs+1482)
+/** Name string for the refid option */
+#define REFID_name (ntpq_opt_strs+1488)
+/** The compiled in default value for the refid option argument */
+#define REFID_DFT_ARG ((char const*)REFID_IPV4)
+/** Compiled in flag settings for the refid option */
+#define REFID_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_ENUMERATION))
+
+/**
* wide option description:
*/
/** Descriptive text for the wide option */
-#define WIDE_DESC (ntpq_opt_strs+1442)
+#define WIDE_DESC (ntpq_opt_strs+1494)
/** Upper-cased name for the wide option */
-#define WIDE_NAME (ntpq_opt_strs+1474)
+#define WIDE_NAME (ntpq_opt_strs+1526)
/** Name string for the wide option */
-#define WIDE_name (ntpq_opt_strs+1479)
+#define WIDE_name (ntpq_opt_strs+1531)
/** Compiled in flag settings for the wide option */
#define WIDE_FLAGS (OPTST_DISABLED)
/*
* Help/More_Help/Version option descriptions:
*/
-#define HELP_DESC (ntpq_opt_strs+1484)
-#define HELP_name (ntpq_opt_strs+1528)
+#define HELP_DESC (ntpq_opt_strs+1536)
+#define HELP_name (ntpq_opt_strs+1580)
#ifdef HAVE_WORKING_FORK
-#define MORE_HELP_DESC (ntpq_opt_strs+1533)
-#define MORE_HELP_name (ntpq_opt_strs+1578)
+#define MORE_HELP_DESC (ntpq_opt_strs+1585)
+#define MORE_HELP_name (ntpq_opt_strs+1630)
#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
#else
#define MORE_HELP_DESC HELP_DESC
@@ -296,14 +315,14 @@ static int const aPeersCantList[] = {
# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
#endif
-#define VER_DESC (ntpq_opt_strs+1588)
-#define VER_name (ntpq_opt_strs+1624)
-#define SAVE_OPTS_DESC (ntpq_opt_strs+1632)
-#define SAVE_OPTS_name (ntpq_opt_strs+1671)
-#define LOAD_OPTS_DESC (ntpq_opt_strs+1681)
-#define LOAD_OPTS_NAME (ntpq_opt_strs+1713)
-#define NO_LOAD_OPTS_name (ntpq_opt_strs+1723)
-#define LOAD_OPTS_pfx (ntpq_opt_strs+1736)
+#define VER_DESC (ntpq_opt_strs+1640)
+#define VER_name (ntpq_opt_strs+1676)
+#define SAVE_OPTS_DESC (ntpq_opt_strs+1684)
+#define SAVE_OPTS_name (ntpq_opt_strs+1723)
+#define LOAD_OPTS_DESC (ntpq_opt_strs+1733)
+#define LOAD_OPTS_NAME (ntpq_opt_strs+1765)
+#define NO_LOAD_OPTS_name (ntpq_opt_strs+1775)
+#define LOAD_OPTS_pfx (ntpq_opt_strs+1788)
#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
/**
* Declare option callback procedures
@@ -314,7 +333,7 @@ extern tOptProc
optionResetOpt, optionStackArg, optionTimeDate,
optionTimeVal, optionUnstackArg, optionVendorOption;
static tOptProc
- doOptDebug_Level, doUsageOpt;
+ doOptDebug_Level, doOptRefid, doUsageOpt;
#define VER_PROC ntpOptionPrintVersion
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -432,8 +451,20 @@ static tOptDesc optDesc[OPTION_CT] = {
/* desc, NAME, name */ PEERS_DESC, PEERS_NAME, PEERS_name,
/* disablement strs */ NULL, NULL },
- { /* entry idx, value */ 9, VALUE_OPT_WIDE,
- /* equiv idx, value */ 9, VALUE_OPT_WIDE,
+ { /* entry idx, value */ 9, VALUE_OPT_REFID,
+ /* equiv idx, value */ 9, VALUE_OPT_REFID,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ REFID_FLAGS, 0,
+ /* last opt argumnt */ { REFID_DFT_ARG },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptRefid,
+ /* desc, NAME, name */ REFID_DESC, REFID_NAME, REFID_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 10, VALUE_OPT_WIDE,
+ /* equiv idx, value */ 10, VALUE_OPT_WIDE,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ WIDE_FLAGS, 0,
@@ -512,24 +543,24 @@ static tOptDesc optDesc[OPTION_CT] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** Reference to the upper cased version of ntpq. */
-#define zPROGNAME (ntpq_opt_strs+1739)
+#define zPROGNAME (ntpq_opt_strs+1791)
/** Reference to the title line for ntpq usage. */
-#define zUsageTitle (ntpq_opt_strs+1744)
+#define zUsageTitle (ntpq_opt_strs+1796)
/** ntpq configuration file name. */
-#define zRcName (ntpq_opt_strs+1871)
+#define zRcName (ntpq_opt_strs+1923)
/** Directories to search for ntpq config files. */
static char const * const apzHomeList[3] = {
- ntpq_opt_strs+1863,
- ntpq_opt_strs+1869,
+ ntpq_opt_strs+1915,
+ ntpq_opt_strs+1921,
NULL };
/** The ntpq program bug email address. */
-#define zBugsAddr (ntpq_opt_strs+1878)
+#define zBugsAddr (ntpq_opt_strs+1930)
/** Clarification/explanation of what ntpq does. */
#define zExplain (NULL)
/** Extra detail explaining what ntpq does. */
#define zDetail (NULL)
/** The full version string for ntpq. */
-#define zFullVersion (ntpq_opt_strs+1912)
+#define zFullVersion (ntpq_opt_strs+1964)
/* extracted from optcode.tlib near line 364 */
#if defined(ENABLE_NLS)
@@ -588,6 +619,30 @@ OPT_VALUE_SET_DEBUG_LEVEL++;
(void)pOptDesc;
(void)pOptions;
}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the refid option.
+ * Set the default display format for S2+ refids.
+ * @param[in] pOptions the ntpq options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptRefid(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+
+/* extracted from optmain.tlib near line 945 */
+ static char const * const names[2] = {
+ ntpq_opt_strs+1977, ntpq_opt_strs+1044 };
+
+ if (pOptions <= OPTPROC_EMIT_LIMIT) {
+ (void) optionEnumerationVal(pOptions, pOptDesc, names, 2);
+ return; /* protect AutoOpts client code from internal callbacks */
+ }
+
+ pOptDesc->optArg.argEnum =
+ optionEnumerationVal(pOptions, pOptDesc, names, 2);
+}
/* extracted from optmain.tlib near line 1250 */
/**
@@ -651,7 +706,7 @@ tOptions ntpqOptions = {
NO_EQUIVALENT, /* '-#' option index */
NO_EQUIVALENT /* index of default opt */
},
- 15 /* full option count */, 10 /* user option count */,
+ 16 /* full option count */, 11 /* user option count */,
ntpq_full_usage, ntpq_short_usage,
NULL, NULL,
PKGDATADIR, ntpq_packager_info
@@ -786,7 +841,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpqOptions.pzCopyright */
- puts(_("ntpq 4.2.8p6\n\
+ puts(_("ntpq 4.2.8p7\n\
Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -834,6 +889,9 @@ implied warranty.\n"));
puts(_("Print a list of the peers"));
/* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Set default display type for S2+ refids"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
puts(_("Display the full 'remote' value"));
/* referenced via ntpqOptions.pOptDesc->pzText */
@@ -852,11 +910,11 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpqOptions.pzUsageTitle */
- puts(_("ntpq - standard NTP query program - Ver. 4.2.8p6\n\
+ puts(_("ntpq - standard NTP query program - Ver. 4.2.8p7\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
/* referenced via ntpqOptions.pzFullVersion */
- puts(_("ntpq 4.2.8p6"));
+ puts(_("ntpq 4.2.8p7"));
/* referenced via ntpqOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
OpenPOWER on IntegriCloud