From: Harlan Stenn Date: Thu, 14 Aug 2014 08:27:49 +0000 (+0000) Subject: [Bug 1128] ntpq truncates "remote" host information X-Git-Tag: NTP_4_2_7P461~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e950874360f5464d09bf3bd94f037d28f3752dec;p=thirdparty%2Fntp.git [Bug 1128] ntpq truncates "remote" host information bk: 53ec7305saDmQyLcGZA6-_J__0e7BA --- diff --git a/ChangeLog b/ChangeLog index 8a169f161..be2e50ff2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 1128] ntpq truncates "remote" host information. (4.2.7p460) 2014/08/13 Released by Harlan Stenn * More autogen-5.18.4pre14 cleanup. (4.2.7p459) 2014/08/12 Released by Harlan Stenn diff --git a/ntpq/invoke-ntpq.texi b/ntpq/invoke-ntpq.texi index 9d0515049..b83a10022 100644 --- a/ntpq/invoke-ntpq.texi +++ b/ntpq/invoke-ntpq.texi @@ -6,7 +6,7 @@ # # EDIT THIS FILE WITH CAUTION (invoke-ntpq.texi) # -# It has been AutoGen-ed August 13, 2014 at 11:27:28 AM by AutoGen 5.18.4pre14 +# It has been AutoGen-ed August 14, 2014 at 07:57:37 AM by AutoGen 5.18.4pre14 # From the definitions ntpq-opts.def # and the template file agtexi-cmd.tpl @end ignore @@ -391,7 +391,12 @@ single-character code indicating current value of the field of the .Lk decode.html#peer "peer status word" @item @code{remote} -host name (or IP number) of peer +host name (or IP number) of peer. +The value displayed will be truncated to 15 characters unless the +@code{-w} +flag is given, in which case the full value will be displayed +on the first line, +and the remaining data is displayed on the next line. @item @code{refid} association ID or .Lk decode.html#kiss "'kiss code" @@ -746,10 +751,11 @@ This software is released under the NTP license, . * ntpq ipv4:: ipv4 option (-4) * ntpq ipv6:: ipv6 option (-6) * ntpq command:: command option (-c) -* ntpq peers:: peers option (-p) * ntpq interactive:: interactive option (-i) * ntpq numeric:: numeric option (-n) * ntpq old-rv:: old-rv option +* ntpq peers:: peers option (-p) +* ntpq wide:: wide option (-w) * ntpq config:: presetting/configuring ntpq * ntpq exit status:: exit status @end menu @@ -778,19 +784,20 @@ Usage: ntpq [ - [] | --[@{=| @}] ]... [ host ...] -6 no ipv6 Force IPv6 DNS name resolution - prohibits the option 'ipv4' -c Str command run a command and exit - - may appear up to 512 times + - may appear multiple times -d no debug-level Increase debug verbosity level - may appear multiple times -D Num set-debug-level Set the debug verbosity level - may appear multiple times - -p no peers Print a list of the peers - - prohibits the option '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 + -p no peers Print a list of the peers + - prohibits the option 'interactive' + -w no wide Display the full 'remote' value opt version output version information and exit -? no help display extended usage information and exit -! no more-help extended usage information passed thru pager @@ -856,28 +863,12 @@ This option takes a string argument @file{cmd}. This option has some usage constraints. It: @itemize @bullet @item -may appear up to 512 times. +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 peers -@subsection peers option (-p) -@cindex ntpq-peers - -This is the ``print a list of the peers'' option. - -@noindent -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 @@ -916,6 +907,30 @@ for a single-variable @code{readvar}. Using an environment variable to preset this option in a script will enable both older and newer @code{ntpq} to behave identically in this regard. +@node ntpq peers +@subsection peers option (-p) +@cindex ntpq-peers + +This is the ``print a list of the peers'' option. + +@noindent +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 wide +@subsection wide option (-w) +@cindex ntpq-wide + +This is the ``display the full 'remote' value'' option. +Display the full value of the 'remote' value. If this requires +more than 15 characters, display the full value, emit a newline, +and continue the data display properly indented on the next line. @node ntpq config diff --git a/ntpq/ntpq-opts.c b/ntpq/ntpq-opts.c index 5055a4387..a08929d82 100644 --- a/ntpq/ntpq-opts.c +++ b/ntpq/ntpq-opts.c @@ -68,7 +68,7 @@ extern FILE * option_usage_fp; /** * static const strings for ntpq options */ -static char const ntpq_opt_strs[1833] = +static char const ntpq_opt_strs[1875] = /* 0 */ "ntpq 4.2.7p460\n" "Copyright (C) 1970-2014 The University of Delaware, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" @@ -100,38 +100,41 @@ static char const ntpq_opt_strs[1833] = /* 1130 */ "Set the debug verbosity level\0" /* 1160 */ "SET_DEBUG_LEVEL\0" /* 1176 */ "set-debug-level\0" -/* 1192 */ "Print a list of the peers\0" -/* 1218 */ "PEERS\0" -/* 1224 */ "peers\0" -/* 1230 */ "Force ntpq to operate in interactive mode\0" -/* 1272 */ "INTERACTIVE\0" -/* 1284 */ "interactive\0" -/* 1296 */ "numeric host addresses\0" -/* 1319 */ "NUMERIC\0" -/* 1327 */ "numeric\0" -/* 1335 */ "Always output status line with readvar\0" -/* 1374 */ "OLD_RV\0" -/* 1381 */ "old-rv\0" -/* 1388 */ "display extended usage information and exit\0" -/* 1432 */ "help\0" -/* 1437 */ "extended usage information passed thru pager\0" -/* 1482 */ "more-help\0" -/* 1492 */ "output version information and exit\0" -/* 1528 */ "version\0" -/* 1536 */ "save the option state to a config file\0" -/* 1575 */ "save-opts\0" -/* 1585 */ "load options from a config file\0" -/* 1617 */ "LOAD_OPTS\0" -/* 1627 */ "no-load-opts\0" -/* 1640 */ "no\0" -/* 1643 */ "NTPQ\0" -/* 1648 */ "ntpq - standard NTP query program - Ver. 4.2.7p460\n" +/* 1192 */ "Force ntpq to operate in interactive mode\0" +/* 1234 */ "INTERACTIVE\0" +/* 1246 */ "interactive\0" +/* 1258 */ "numeric host addresses\0" +/* 1281 */ "NUMERIC\0" +/* 1289 */ "numeric\0" +/* 1297 */ "Always output status line with readvar\0" +/* 1336 */ "OLD_RV\0" +/* 1343 */ "old-rv\0" +/* 1350 */ "Print a list of the peers\0" +/* 1376 */ "PEERS\0" +/* 1382 */ "peers\0" +/* 1388 */ "Display the full 'remote' value\0" +/* 1420 */ "WIDE\0" +/* 1425 */ "wide\0" +/* 1430 */ "display extended usage information and exit\0" +/* 1474 */ "help\0" +/* 1479 */ "extended usage information passed thru pager\0" +/* 1524 */ "more-help\0" +/* 1534 */ "output version information and exit\0" +/* 1570 */ "version\0" +/* 1578 */ "save the option state to a config file\0" +/* 1617 */ "save-opts\0" +/* 1627 */ "load options from a config file\0" +/* 1659 */ "LOAD_OPTS\0" +/* 1669 */ "no-load-opts\0" +/* 1682 */ "no\0" +/* 1685 */ "NTPQ\0" +/* 1690 */ "ntpq - standard NTP query program - Ver. 4.2.7p460\n" "Usage: %s [ - [] | --[{=| }] ]... [ host ...]\n\0" -/* 1769 */ "$HOME\0" -/* 1775 */ ".\0" -/* 1777 */ ".ntprc\0" -/* 1784 */ "http://bugs.ntp.org, bugs@ntp.org\0" -/* 1818 */ "ntpq 4.2.7p460"; +/* 1811 */ "$HOME\0" +/* 1817 */ ".\0" +/* 1819 */ ".ntprc\0" +/* 1826 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 1860 */ "ntpq 4.2.7p460"; /** * ipv4 option description with @@ -203,32 +206,16 @@ static int const aIpv6CantList[] = { #define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) -/** - * peers option description with - * "Must also have options" and "Incompatible options": - */ -/** Descriptive text for the peers option */ -#define PEERS_DESC (ntpq_opt_strs+1192) -/** Upper-cased name for the peers option */ -#define PEERS_NAME (ntpq_opt_strs+1218) -/** Name string for the peers option */ -#define PEERS_name (ntpq_opt_strs+1224) -/** Other options that appear in conjunction with the peers option */ -static int const aPeersCantList[] = { - INDEX_OPT_INTERACTIVE, NO_EQUIVALENT }; -/** Compiled in flag settings for the peers option */ -#define PEERS_FLAGS (OPTST_DISABLED) - /** * interactive option description with * "Must also have options" and "Incompatible options": */ /** Descriptive text for the interactive option */ -#define INTERACTIVE_DESC (ntpq_opt_strs+1230) +#define INTERACTIVE_DESC (ntpq_opt_strs+1192) /** Upper-cased name for the interactive option */ -#define INTERACTIVE_NAME (ntpq_opt_strs+1272) +#define INTERACTIVE_NAME (ntpq_opt_strs+1234) /** Name string for the interactive option */ -#define INTERACTIVE_name (ntpq_opt_strs+1284) +#define INTERACTIVE_name (ntpq_opt_strs+1246) /** Other options that appear in conjunction with the interactive option */ static int const aInteractiveCantList[] = { INDEX_OPT_COMMAND, @@ -240,11 +227,11 @@ static int const aInteractiveCantList[] = { * numeric option description: */ /** Descriptive text for the numeric option */ -#define NUMERIC_DESC (ntpq_opt_strs+1296) +#define NUMERIC_DESC (ntpq_opt_strs+1258) /** Upper-cased name for the numeric option */ -#define NUMERIC_NAME (ntpq_opt_strs+1319) +#define NUMERIC_NAME (ntpq_opt_strs+1281) /** Name string for the numeric option */ -#define NUMERIC_name (ntpq_opt_strs+1327) +#define NUMERIC_name (ntpq_opt_strs+1289) /** Compiled in flag settings for the numeric option */ #define NUMERIC_FLAGS (OPTST_DISABLED) @@ -252,22 +239,50 @@ static int const aInteractiveCantList[] = { * old-rv option description: */ /** Descriptive text for the old-rv option */ -#define OLD_RV_DESC (ntpq_opt_strs+1335) +#define OLD_RV_DESC (ntpq_opt_strs+1297) /** Upper-cased name for the old-rv option */ -#define OLD_RV_NAME (ntpq_opt_strs+1374) +#define OLD_RV_NAME (ntpq_opt_strs+1336) /** Name string for the old-rv option */ -#define OLD_RV_name (ntpq_opt_strs+1381) +#define OLD_RV_name (ntpq_opt_strs+1343) /** Compiled in flag settings for the old-rv option */ #define OLD_RV_FLAGS (OPTST_DISABLED) +/** + * peers option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the peers option */ +#define PEERS_DESC (ntpq_opt_strs+1350) +/** Upper-cased name for the peers option */ +#define PEERS_NAME (ntpq_opt_strs+1376) +/** Name string for the peers option */ +#define PEERS_name (ntpq_opt_strs+1382) +/** Other options that appear in conjunction with the peers option */ +static int const aPeersCantList[] = { + INDEX_OPT_INTERACTIVE, NO_EQUIVALENT }; +/** Compiled in flag settings for the peers option */ +#define PEERS_FLAGS (OPTST_DISABLED) + +/** + * wide option description: + */ +/** Descriptive text for the wide option */ +#define WIDE_DESC (ntpq_opt_strs+1388) +/** Upper-cased name for the wide option */ +#define WIDE_NAME (ntpq_opt_strs+1420) +/** Name string for the wide option */ +#define WIDE_name (ntpq_opt_strs+1425) +/** 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+1388) -#define HELP_name (ntpq_opt_strs+1432) +#define HELP_DESC (ntpq_opt_strs+1430) +#define HELP_name (ntpq_opt_strs+1474) #ifdef HAVE_WORKING_FORK -#define MORE_HELP_DESC (ntpq_opt_strs+1437) -#define MORE_HELP_name (ntpq_opt_strs+1482) +#define MORE_HELP_DESC (ntpq_opt_strs+1479) +#define MORE_HELP_name (ntpq_opt_strs+1524) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC HELP_DESC @@ -280,14 +295,14 @@ static int const aInteractiveCantList[] = { # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif -#define VER_DESC (ntpq_opt_strs+1492) -#define VER_name (ntpq_opt_strs+1528) -#define SAVE_OPTS_DESC (ntpq_opt_strs+1536) -#define SAVE_OPTS_name (ntpq_opt_strs+1575) -#define LOAD_OPTS_DESC (ntpq_opt_strs+1585) -#define LOAD_OPTS_NAME (ntpq_opt_strs+1617) -#define NO_LOAD_OPTS_name (ntpq_opt_strs+1627) -#define LOAD_OPTS_pfx (ntpq_opt_strs+1640) +#define VER_DESC (ntpq_opt_strs+1534) +#define VER_name (ntpq_opt_strs+1570) +#define SAVE_OPTS_DESC (ntpq_opt_strs+1578) +#define SAVE_OPTS_name (ntpq_opt_strs+1617) +#define LOAD_OPTS_DESC (ntpq_opt_strs+1627) +#define LOAD_OPTS_NAME (ntpq_opt_strs+1659) +#define NO_LOAD_OPTS_name (ntpq_opt_strs+1669) +#define LOAD_OPTS_pfx (ntpq_opt_strs+1682) #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) /** * Declare option callback procedures @@ -369,7 +384,7 @@ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 2, VALUE_OPT_COMMAND, /* equiv idx, value */ 2, VALUE_OPT_COMMAND, /* equivalenced to */ NO_EQUIVALENT, - /* min, max, act ct */ 0, 512, 0, + /* min, max, act ct */ 0, NOLIMIT, 0, /* opt state flags */ COMMAND_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --command */ /* arg list/cookie */ NULL, @@ -402,20 +417,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 5, VALUE_OPT_PEERS, - /* equiv idx, value */ 5, VALUE_OPT_PEERS, - /* equivalenced to */ NO_EQUIVALENT, - /* min, max, act ct */ 0, 1, 0, - /* opt state flags */ PEERS_FLAGS, 0, - /* last opt argumnt */ { NULL }, /* --peers */ - /* arg list/cookie */ NULL, - /* must/cannot opts */ NULL, aPeersCantList, - /* option proc */ PEERS_OPT_PROC, - /* desc, NAME, name */ PEERS_DESC, PEERS_NAME, PEERS_name, - /* disablement strs */ NULL, NULL }, - - { /* entry idx, value */ 6, VALUE_OPT_INTERACTIVE, - /* equiv idx, value */ 6, VALUE_OPT_INTERACTIVE, + { /* entry idx, value */ 5, VALUE_OPT_INTERACTIVE, + /* equiv idx, value */ 5, VALUE_OPT_INTERACTIVE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ INTERACTIVE_FLAGS, 0, @@ -426,8 +429,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ INTERACTIVE_DESC, INTERACTIVE_NAME, INTERACTIVE_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 7, VALUE_OPT_NUMERIC, - /* equiv idx, value */ 7, VALUE_OPT_NUMERIC, + { /* entry idx, value */ 6, VALUE_OPT_NUMERIC, + /* equiv idx, value */ 6, VALUE_OPT_NUMERIC, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NUMERIC_FLAGS, 0, @@ -438,8 +441,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ NUMERIC_DESC, NUMERIC_NAME, NUMERIC_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 8, VALUE_OPT_OLD_RV, - /* equiv idx, value */ 8, VALUE_OPT_OLD_RV, + { /* entry idx, value */ 7, VALUE_OPT_OLD_RV, + /* equiv idx, value */ 7, VALUE_OPT_OLD_RV, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OLD_RV_FLAGS, 0, @@ -450,6 +453,30 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ OLD_RV_DESC, OLD_RV_NAME, OLD_RV_name, /* disablement strs */ NULL, NULL }, + { /* entry idx, value */ 8, VALUE_OPT_PEERS, + /* equiv idx, value */ 8, VALUE_OPT_PEERS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PEERS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --peers */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aPeersCantList, + /* option proc */ PEERS_OPT_PROC, + /* 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, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ WIDE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --wide */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ WIDE_DESC, WIDE_NAME, WIDE_name, + /* disablement strs */ NULL, NULL }, + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, /* equivalenced to */ NO_EQUIVALENT, @@ -518,24 +545,24 @@ static tOptDesc optDesc[OPTION_CT] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** Reference to the upper cased version of ntpq. */ -#define zPROGNAME (ntpq_opt_strs+1643) +#define zPROGNAME (ntpq_opt_strs+1685) /** Reference to the title line for ntpq usage. */ -#define zUsageTitle (ntpq_opt_strs+1648) +#define zUsageTitle (ntpq_opt_strs+1690) /** ntpq configuration file name. */ -#define zRcName (ntpq_opt_strs+1777) +#define zRcName (ntpq_opt_strs+1819) /** Directories to search for ntpq config files. */ static char const * const apzHomeList[3] = { - ntpq_opt_strs+1769, - ntpq_opt_strs+1775, + ntpq_opt_strs+1811, + ntpq_opt_strs+1817, NULL }; /** The ntpq program bug email address. */ -#define zBugsAddr (ntpq_opt_strs+1784) +#define zBugsAddr (ntpq_opt_strs+1826) /** 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+1818) +#define zFullVersion (ntpq_opt_strs+1860) /* extracted from optcode.tlib near line 364 */ #if defined(ENABLE_NLS) @@ -687,7 +714,7 @@ tOptions ntpqOptions = { NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, - 14 /* full option count */, 9 /* user option count */, + 15 /* full option count */, 10 /* user option count */, ntpq_full_usage, ntpq_short_usage, NULL, NULL, PKGDATADIR, ntpq_packager_info @@ -856,9 +883,6 @@ provided \"as is\" without express or implied warranty.\n")); /* referenced via ntpqOptions.pOptDesc->pzText */ puts(_("Set the debug verbosity level")); - /* referenced via ntpqOptions.pOptDesc->pzText */ - puts(_("Print a list of the peers")); - /* referenced via ntpqOptions.pOptDesc->pzText */ puts(_("Force ntpq to operate in interactive mode")); @@ -868,6 +892,12 @@ provided \"as is\" without express or implied warranty.\n")); /* referenced via ntpqOptions.pOptDesc->pzText */ puts(_("Always output status line with readvar")); + /* referenced via ntpqOptions.pOptDesc->pzText */ + puts(_("Print a list of the peers")); + + /* referenced via ntpqOptions.pOptDesc->pzText */ + puts(_("Display the full 'remote' value")); + /* referenced via ntpqOptions.pOptDesc->pzText */ puts(_("display extended usage information and exit")); diff --git a/ntpq/ntpq-opts.def b/ntpq/ntpq-opts.def index 3028b6d2c..a3054f669 100644 --- a/ntpq/ntpq-opts.def +++ b/ntpq/ntpq-opts.def @@ -39,7 +39,7 @@ flag = { value = c; arg-type = string; descrip = "run a command and exit"; - max = 512; + max = NOLIMIT; arg-name = cmd; call-proc = ntpq_custom_opt_handler; doc = <<- _EndOfDoc_ @@ -51,18 +51,6 @@ flag = { #include debug-opt.def -flag = { - name = peers; - value = p; - descrip = "Print a list of the peers"; - flags-cant = interactive; - call-proc = ntpq_custom_opt_handler; - doc = <<- _EndOfDoc_ - 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. - _EndOfDoc_; -}; - flag = { name = interactive; value = i; @@ -101,6 +89,29 @@ flag = { _EndOfDoc_; }; +flag = { + name = peers; + value = p; + descrip = "Print a list of the peers"; + flags-cant = interactive; + call-proc = ntpq_custom_opt_handler; + doc = <<- _EndOfDoc_ + 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. + _EndOfDoc_; +}; + +flag = { + name = wide; + value = w; + descrip = "Display the full 'remote' value"; + doc = <<- _EndOfDoc_ + Display the full value of the 'remote' value. If this requires + more than 15 characters, display the full value, emit a newline, + and continue the data display properly indented on the next line. + _EndOfDoc_; +}; + doc-section = { ds-type = 'DESCRIPTION'; ds-format = 'mdoc'; @@ -496,7 +507,12 @@ single-character code indicating current value of the field of the .Lk decode.html#peer "peer status word" .It Ic remote -host name (or IP number) of peer +host name (or IP number) of peer. +The value displayed will be truncated to 15 characters unless the +.Fl w +flag is given, in which case the full value will be displayed +on the first line, +and the remaining data is displayed on the next line. .It Ic refid association ID or .Lk decode.html#kiss "'kiss code" diff --git a/ntpq/ntpq-opts.h b/ntpq/ntpq-opts.h index d57b1a1a0..2197cca33 100644 --- a/ntpq/ntpq-opts.h +++ b/ntpq/ntpq-opts.h @@ -69,18 +69,19 @@ typedef enum { INDEX_OPT_COMMAND = 2, INDEX_OPT_DEBUG_LEVEL = 3, INDEX_OPT_SET_DEBUG_LEVEL = 4, - INDEX_OPT_PEERS = 5, - INDEX_OPT_INTERACTIVE = 6, - INDEX_OPT_NUMERIC = 7, - INDEX_OPT_OLD_RV = 8, - INDEX_OPT_VERSION = 9, - INDEX_OPT_HELP = 10, - INDEX_OPT_MORE_HELP = 11, - INDEX_OPT_SAVE_OPTS = 12, - INDEX_OPT_LOAD_OPTS = 13 + INDEX_OPT_INTERACTIVE = 5, + INDEX_OPT_NUMERIC = 6, + INDEX_OPT_OLD_RV = 7, + INDEX_OPT_PEERS = 8, + INDEX_OPT_WIDE = 9, + INDEX_OPT_VERSION = 10, + INDEX_OPT_HELP = 11, + INDEX_OPT_MORE_HELP = 12, + INDEX_OPT_SAVE_OPTS = 13, + INDEX_OPT_LOAD_OPTS = 14 } teOptIndex; /** count of all options for ntpq */ -#define OPTION_CT 14 +#define OPTION_CT 15 /** ntpq version */ #define NTPQ_VERSION "4.2.7p460" /** Full ntpq version text */ @@ -157,10 +158,6 @@ typedef enum { # warning undefining SET_DEBUG_LEVEL due to option name conflict # undef SET_DEBUG_LEVEL # endif -# ifdef PEERS -# warning undefining PEERS due to option name conflict -# undef PEERS -# endif # ifdef INTERACTIVE # warning undefining INTERACTIVE due to option name conflict # undef INTERACTIVE @@ -173,16 +170,25 @@ typedef enum { # warning undefining OLD_RV due to option name conflict # undef OLD_RV # endif +# ifdef PEERS +# warning undefining PEERS due to option name conflict +# undef PEERS +# endif +# ifdef WIDE +# warning undefining WIDE due to option name conflict +# undef WIDE +# endif #else /* NO_OPTION_NAME_WARNINGS */ # undef IPV4 # undef IPV6 # undef COMMAND # undef DEBUG_LEVEL # undef SET_DEBUG_LEVEL -# undef PEERS # undef INTERACTIVE # undef NUMERIC # undef OLD_RV +# undef PEERS +# undef WIDE #endif /* NO_OPTION_NAME_WARNINGS */ /** @@ -196,10 +202,11 @@ typedef enum { #define VALUE_OPT_SET_DEBUG_LEVEL 'D' #define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt) -#define VALUE_OPT_PEERS 'p' #define VALUE_OPT_INTERACTIVE 'i' #define VALUE_OPT_NUMERIC 'n' #define VALUE_OPT_OLD_RV 0x1001 +#define VALUE_OPT_PEERS 'p' +#define VALUE_OPT_WIDE 'w' /** option flag (value) for help-value option */ #define VALUE_OPT_HELP '?' /** option flag (value) for more-help-value option */ diff --git a/ntpq/ntpq-subs.c b/ntpq/ntpq-subs.c index fa819eb60..9c6edfa49 100644 --- a/ntpq/ntpq-subs.c +++ b/ntpq/ntpq-subs.c @@ -277,6 +277,7 @@ struct varlist { * Imported from ntpq.c */ extern int showhostnames; +extern int wideremote; extern int rawmode; extern struct servent *server_entry; extern struct association *assoc_cache; @@ -1768,7 +1769,10 @@ doprintpeers( if (!have_srchost) strlcpy(clock_name, nntohost(&srcadr), sizeof(clock_name)); - fprintf(fp, "%c%-15.15s ", c, clock_name); + if (wideremote && 15 < strlen(clock_name)) + fprintf(fp, "%c%s\n ", c, clock_name); + else + fprintf(fp, "%c%-15.15s ", c, clock_name); if (!have_da_rid) { drlen = 0; } else { diff --git a/ntpq/ntpq.1ntpqman b/ntpq/ntpq.1ntpqman index 1e86ed82e..f4b64e1a2 100644 --- a/ntpq/ntpq.1ntpqman +++ b/ntpq/ntpq.1ntpqman @@ -10,9 +10,9 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpq 1ntpqman "13 Aug 2014" "4.2.7p460" "User Commands" +.TH ntpq 1ntpqman "14 Aug 2014" "4.2.7p460" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-7SaOpK/ag-iTaOoK) +.\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" .\" It has been AutoGen-ed .\" From the definitions ntpq-opts.def @@ -526,7 +526,12 @@ field of the .ns .TP 10 .NOP \f\*[B-Font]remote\f[] -host name (or IP number) of peer +host name (or IP number) of peer. +The value displayed will be truncated to 15 characters unless the +\f\*[B-Font]\-w\f[] +flag is given, in which case the full value will be displayed +on the first line, +and the remaining data is displayed on the next line. .br .ns .TP 10 @@ -1172,7 +1177,7 @@ to the IPv6 namespace. .TP .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]cmd\f[], \f\*[B-Font]\-\-command\f[]=\f\*[I-Font]cmd\f[] run a command and exit. -This option may appear up to 512 times. +This option may appear an unlimited number of times. .sp The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified @@ -1189,14 +1194,6 @@ This option may appear an unlimited number of times. This option takes an integer number as its argument. .sp .TP -.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[] -Print a list of the peers. -This option must not appear in combination with any of the following options: -interactive. -.sp -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. -.TP .NOP \f\*[B-Font]\-i\f[], \f\*[B-Font]\-\-interactive\f[] Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: @@ -1225,6 +1222,21 @@ Using an environment variable to preset this option in a script will enable both older and newer \fBntpq\fP to behave identically in this regard. .TP +.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[] +Print a list of the peers. +This option must not appear in combination with any of the following options: +interactive. +.sp +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. +.TP +.NOP \f\*[B-Font]\-w\f[], \f\*[B-Font]\-\-wide\f[] +Display the full 'remote' value. +.sp +Display the full value of the 'remote' value. If this requires +more than 15 characters, display the full value, emit a newline, +and continue the data display properly indented on the next line. +.TP .NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] Display usage information and exit. .TP @@ -1260,35 +1272,6 @@ 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 is searched for within those directories. -.TH ntpq 1ntpqman "13 Aug 2014" "4.2.7p460" "User Commands" -.\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-7SaOpK/ag-iTaOoK) -.\" -.\" It has been AutoGen-ed -.\" From the definitions ntpq-opts.def -.\" and the template file agman-cmd.tpl -.SH NAME -\f\*[B-Font]ntpq\fP ntpq -\- standard NTP query program -cvt_prog='/usr/local/gnu/share/autogen/texi2man' -cvt_prog=`cd \`dirname "$cvt_prog"\` >/dev/null && pwd - `/`basename "$cvt_prog"` -cd $tmp_dir -test \-x "$cvt_prog" || die "'$cvt_prog' is not executable" -{ - list='synopsis description options option-presets' - for f in $list ; do cat $f ; echo ; done - rm \-f $list name - list='implementation-notes environment files examples exit-status errors - compatibility see-also conforming-to history authors copyright bugs - notes' - for f in $list ; do cat $f ; echo ; done > .end-doc - rm \-f $list - list=`ls \-1 *`' .end-doc' - for f in $list ; do cat $f ; echo ; done - rm \-f $list -} 1>.doc 2>/dev/null -/opt/csw/bin/ggrep \-E \-v '^[ ]*$' .doc | $cvt_prog .SH "ENVIRONMENT" See \fBOPTION PRESETS\fP for configuration environment variables. .SH "FILES" diff --git a/ntpq/ntpq.1ntpqmdoc b/ntpq/ntpq.1ntpqmdoc index b220d6858..90b6bb85a 100644 --- a/ntpq/ntpq.1ntpqmdoc +++ b/ntpq/ntpq.1ntpqmdoc @@ -1,9 +1,9 @@ -.Dd August 13 2014 +.Dd August 14 2014 .Dt NTPQ 1ntpqmdoc User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) .\" -.\" It has been AutoGen-ed August 13, 2014 at 07:49:10 AM by AutoGen 5.18.4pre14 +.\" It has been AutoGen-ed .\" From the definitions ntpq-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -403,7 +403,12 @@ single\-character code indicating current value of the field of the .Lk decode.html#peer "peer status word" .It Ic remote -host name (or IP number) of peer +host name (or IP number) of peer. +The value displayed will be truncated to 15 characters unless the +.Fl w +flag is given, in which case the full value will be displayed +on the first line, +and the remaining data is displayed on the next line. .It Ic refid association ID or .Lk decode.html#kiss "'kiss code" @@ -759,7 +764,7 @@ Force DNS resolution of following host names on the command line to the IPv6 namespace. .It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd run a command and exit. -This option may appear up to 512 times. +This option may appear an unlimited number of times. .sp The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified @@ -773,13 +778,6 @@ Set the debug verbosity level. This option may appear an unlimited number of times. This option takes an integer number as its argument. .sp -.It Fl p , Fl \-peers -Print a list of the peers. -This option must not appear in combination with any of the following options: -interactive. -.sp -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. .It Fl i , Fl \-interactive Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: @@ -805,6 +803,19 @@ for a single\-variable \fBreadvar\fP. Using an environment variable to preset this option in a script will enable both older and newer \fBntpq\fP to behave identically in this regard. +.It Fl p , Fl \-peers +Print a list of the peers. +This option must not appear in combination with any of the following options: +interactive. +.sp +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. +.It Fl w , Fl \-wide +Display the full 'remote' value. +.sp +Display the full value of the 'remote' value. If this requires +more than 15 characters, display the full value, emit a newline, +and continue the data display properly indented on the next line. .It Fl \&? , Fl \-help Display usage information and exit. .It Fl \&! , Fl \-more\-help @@ -836,25 +847,6 @@ 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 is searched for within those directories. -cvt_prog='/usr/local/gnu/share/autogen/texi2mdoc' -cvt_prog=`cd \`dirname "$cvt_prog"\` >/dev/null && pwd - `/`basename "$cvt_prog"` -cd $tmp_dir -test \-x "$cvt_prog" || die "'$cvt_prog' is not executable" -{ - list='synopsis description options option\-presets' - for f in $list ; do cat $f ; echo ; done - rm \-f $list name - list='implementation\-notes environment files examples exit\-status errors - compatibility see\-also conforming\-to history authors copyright bugs - notes' - for f in $list ; do cat $f ; echo ; done > .end\-doc - rm \-f $list - list=`ls \-1 *`' .end\-doc' - for f in $list ; do cat $f ; echo ; done - rm \-f $list -} 1>.doc 2>/dev/null -/opt/csw/bin/ggrep \-E \-v '^[ ]*$' .doc | $cvt_prog .Sh "ENVIRONMENT" See \fBOPTION PRESETS\fP for configuration environment variables. .Sh "FILES" diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index 971505fea..33cdd4442 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -317,6 +317,7 @@ char currenthost[LENHOSTNAME]; /* current host name */ int currenthostisnum; /* is prior text from IP? */ struct sockaddr_in hostaddr = { 0 }; /* host address */ int showhostnames = 1; /* show host names by default */ +int wideremote = 0; /* show wide remote names? */ int ai_fam_templ; /* address family */ int ai_fam_default; /* default address family */ @@ -483,6 +484,9 @@ ntpqmain( if (HAVE_OPT(NUMERIC)) showhostnames = 0; + if (HAVE_OPT(WIDE)) + wideremote = 1; + old_rv = HAVE_OPT(OLD_RV); if (0 == argc) { diff --git a/ntpq/ntpq.man.in b/ntpq/ntpq.man.in index 6ab70802a..81bd8259d 100644 --- a/ntpq/ntpq.man.in +++ b/ntpq/ntpq.man.in @@ -10,9 +10,9 @@ .ds B-Font B .ds I-Font I .ds R-Font R -.TH ntpq @NTPQ_MS@ "13 Aug 2014" "4.2.7p460" "User Commands" +.TH ntpq @NTPQ_MS@ "14 Aug 2014" "4.2.7p460" "User Commands" .\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-7SaOpK/ag-iTaOoK) +.\" EDIT THIS FILE WITH CAUTION (in-mem file) .\" .\" It has been AutoGen-ed .\" From the definitions ntpq-opts.def @@ -526,7 +526,12 @@ field of the .ns .TP 10 .NOP \f\*[B-Font]remote\f[] -host name (or IP number) of peer +host name (or IP number) of peer. +The value displayed will be truncated to 15 characters unless the +\f\*[B-Font]\-w\f[] +flag is given, in which case the full value will be displayed +on the first line, +and the remaining data is displayed on the next line. .br .ns .TP 10 @@ -1172,7 +1177,7 @@ to the IPv6 namespace. .TP .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]cmd\f[], \f\*[B-Font]\-\-command\f[]=\f\*[I-Font]cmd\f[] run a command and exit. -This option may appear up to 512 times. +This option may appear an unlimited number of times. .sp The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified @@ -1189,14 +1194,6 @@ This option may appear an unlimited number of times. This option takes an integer number as its argument. .sp .TP -.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[] -Print a list of the peers. -This option must not appear in combination with any of the following options: -interactive. -.sp -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. -.TP .NOP \f\*[B-Font]\-i\f[], \f\*[B-Font]\-\-interactive\f[] Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: @@ -1225,6 +1222,21 @@ Using an environment variable to preset this option in a script will enable both older and newer \fBntpq\fP to behave identically in this regard. .TP +.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[] +Print a list of the peers. +This option must not appear in combination with any of the following options: +interactive. +.sp +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. +.TP +.NOP \f\*[B-Font]\-w\f[], \f\*[B-Font]\-\-wide\f[] +Display the full 'remote' value. +.sp +Display the full value of the 'remote' value. If this requires +more than 15 characters, display the full value, emit a newline, +and continue the data display properly indented on the next line. +.TP .NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] Display usage information and exit. .TP @@ -1260,35 +1272,6 @@ 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 is searched for within those directories. -.TH ntpq @NTPQ_MS@ "13 Aug 2014" "4.2.7p460" "User Commands" -.\" -.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-7SaOpK/ag-iTaOoK) -.\" -.\" It has been AutoGen-ed -.\" From the definitions ntpq-opts.def -.\" and the template file agman-cmd.tpl -.SH NAME -\f\*[B-Font]ntpq\fP ntpq -\- standard NTP query program -cvt_prog='/usr/local/gnu/share/autogen/texi2man' -cvt_prog=`cd \`dirname "$cvt_prog"\` >/dev/null && pwd - `/`basename "$cvt_prog"` -cd $tmp_dir -test \-x "$cvt_prog" || die "'$cvt_prog' is not executable" -{ - list='synopsis description options option-presets' - for f in $list ; do cat $f ; echo ; done - rm \-f $list name - list='implementation-notes environment files examples exit-status errors - compatibility see-also conforming-to history authors copyright bugs - notes' - for f in $list ; do cat $f ; echo ; done > .end-doc - rm \-f $list - list=`ls \-1 *`' .end-doc' - for f in $list ; do cat $f ; echo ; done - rm \-f $list -} 1>.doc 2>/dev/null -/opt/csw/bin/ggrep \-E \-v '^[ ]*$' .doc | $cvt_prog .SH "ENVIRONMENT" See \fBOPTION PRESETS\fP for configuration environment variables. .SH "FILES" diff --git a/ntpq/ntpq.mdoc.in b/ntpq/ntpq.mdoc.in index 754818ee1..b5dc1536e 100644 --- a/ntpq/ntpq.mdoc.in +++ b/ntpq/ntpq.mdoc.in @@ -1,9 +1,9 @@ -.Dd August 13 2014 +.Dd August 14 2014 .Dt NTPQ @NTPQ_MS@ User Commands .Os .\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) .\" -.\" It has been AutoGen-ed August 13, 2014 at 07:49:10 AM by AutoGen 5.18.4pre14 +.\" It has been AutoGen-ed .\" From the definitions ntpq-opts.def .\" and the template file agmdoc-cmd.tpl .Sh NAME @@ -403,7 +403,12 @@ single\-character code indicating current value of the field of the .Lk decode.html#peer "peer status word" .It Ic remote -host name (or IP number) of peer +host name (or IP number) of peer. +The value displayed will be truncated to 15 characters unless the +.Fl w +flag is given, in which case the full value will be displayed +on the first line, +and the remaining data is displayed on the next line. .It Ic refid association ID or .Lk decode.html#kiss "'kiss code" @@ -759,7 +764,7 @@ Force DNS resolution of following host names on the command line to the IPv6 namespace. .It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd run a command and exit. -This option may appear up to 512 times. +This option may appear an unlimited number of times. .sp The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified @@ -773,13 +778,6 @@ Set the debug verbosity level. This option may appear an unlimited number of times. This option takes an integer number as its argument. .sp -.It Fl p , Fl \-peers -Print a list of the peers. -This option must not appear in combination with any of the following options: -interactive. -.sp -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. .It Fl i , Fl \-interactive Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: @@ -805,6 +803,19 @@ for a single\-variable \fBreadvar\fP. Using an environment variable to preset this option in a script will enable both older and newer \fBntpq\fP to behave identically in this regard. +.It Fl p , Fl \-peers +Print a list of the peers. +This option must not appear in combination with any of the following options: +interactive. +.sp +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. +.It Fl w , Fl \-wide +Display the full 'remote' value. +.sp +Display the full value of the 'remote' value. If this requires +more than 15 characters, display the full value, emit a newline, +and continue the data display properly indented on the next line. .It Fl \&? , Fl \-help Display usage information and exit. .It Fl \&! , Fl \-more\-help @@ -836,25 +847,6 @@ 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 is searched for within those directories. -cvt_prog='/usr/local/gnu/share/autogen/texi2mdoc' -cvt_prog=`cd \`dirname "$cvt_prog"\` >/dev/null && pwd - `/`basename "$cvt_prog"` -cd $tmp_dir -test \-x "$cvt_prog" || die "'$cvt_prog' is not executable" -{ - list='synopsis description options option\-presets' - for f in $list ; do cat $f ; echo ; done - rm \-f $list name - list='implementation\-notes environment files examples exit\-status errors - compatibility see\-also conforming\-to history authors copyright bugs - notes' - for f in $list ; do cat $f ; echo ; done > .end\-doc - rm \-f $list - list=`ls \-1 *`' .end\-doc' - for f in $list ; do cat $f ; echo ; done - rm \-f $list -} 1>.doc 2>/dev/null -/opt/csw/bin/ggrep \-E \-v '^[ ]*$' .doc | $cvt_prog .Sh "ENVIRONMENT" See \fBOPTION PRESETS\fP for configuration environment variables. .Sh "FILES"