mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
[master] add "version" options to host/nslookup/nsupdate
3773. [func] "host", "nslookup" and "nsupdate" now have options and commands to print the version number. [RT #26057]
This commit is contained in:
4
CHANGES
4
CHANGES
@@ -1,3 +1,7 @@
|
|||||||
|
3773. [func] "host", "nslookup" and "nsupdate" now have
|
||||||
|
options to print the version number and exit.
|
||||||
|
[RT #26057]
|
||||||
|
|
||||||
3772. [contrib] Added sqlite3 dynamically-loadable DLZ module.
|
3772. [contrib] Added sqlite3 dynamically-loadable DLZ module.
|
||||||
(Based in part on a contribution from Tim Tessier.)
|
(Based in part on a contribution from Tim Tessier.)
|
||||||
[RT #20822]
|
[RT #20822]
|
||||||
|
@@ -70,6 +70,7 @@
|
|||||||
<arg><option>-p <replaceable class="parameter">port#</replaceable></option></arg>
|
<arg><option>-p <replaceable class="parameter">port#</replaceable></option></arg>
|
||||||
<arg><option>-q <replaceable class="parameter">name</replaceable></option></arg>
|
<arg><option>-q <replaceable class="parameter">name</replaceable></option></arg>
|
||||||
<arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
|
<arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
|
||||||
|
<arg><option>-v</option></arg>
|
||||||
<arg><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
|
<arg><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
|
||||||
<arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>name:key</replaceable></option></arg>
|
<arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>name:key</replaceable></option></arg>
|
||||||
<arg><option>-4</option></arg>
|
<arg><option>-4</option></arg>
|
||||||
@@ -285,6 +286,11 @@
|
|||||||
<parameter>name</parameter> from other arguments.
|
<parameter>name</parameter> from other arguments.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The <option>-v</option> causes <command>dig</command> to
|
||||||
|
print the version number and exit.
|
||||||
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Reverse lookups — mapping addresses to names — are simplified by the
|
Reverse lookups — mapping addresses to names — are simplified by the
|
||||||
<option>-x</option> option. <parameter>addr</parameter> is
|
<option>-x</option> option. <parameter>addr</parameter> is
|
||||||
|
@@ -15,8 +15,6 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: host.c,v 1.127 2011/03/11 06:11:20 marka Exp $ */
|
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@@ -166,7 +164,8 @@ show_usage(void) {
|
|||||||
" -W specifies how long to wait for a reply\n"
|
" -W specifies how long to wait for a reply\n"
|
||||||
" -4 use IPv4 query transport only\n"
|
" -4 use IPv4 query transport only\n"
|
||||||
" -6 use IPv6 query transport only\n"
|
" -6 use IPv6 query transport only\n"
|
||||||
" -m set memory debugging flag (trace|record|usage)\n", stderr);
|
" -m set memory debugging flag (trace|record|usage)\n"
|
||||||
|
" -v print version number and exit\n", stderr);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -603,7 +602,13 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * optstring = "46ac:dilnm:rst:vwCDN:R:TW:";
|
static const char * optstring = "46ac:dilnm:rst:vVwCDN:R:TW:";
|
||||||
|
|
||||||
|
/*% version */
|
||||||
|
static void
|
||||||
|
version(void) {
|
||||||
|
fputs("host " VERSION "\n", stderr);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pre_parse_args(int argc, char **argv) {
|
pre_parse_args(int argc, char **argv) {
|
||||||
@@ -635,6 +640,10 @@ pre_parse_args(int argc, char **argv) {
|
|||||||
case 's': break;
|
case 's': break;
|
||||||
case 't': break;
|
case 't': break;
|
||||||
case 'v': break;
|
case 'v': break;
|
||||||
|
case 'V':
|
||||||
|
version();
|
||||||
|
exit(0);
|
||||||
|
break;
|
||||||
case 'w': break;
|
case 'w': break;
|
||||||
case 'C': break;
|
case 'C': break;
|
||||||
case 'D':
|
case 'D':
|
||||||
|
@@ -65,6 +65,8 @@
|
|||||||
<arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
|
<arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
|
||||||
<arg><option>-4</option></arg>
|
<arg><option>-4</option></arg>
|
||||||
<arg><option>-6</option></arg>
|
<arg><option>-6</option></arg>
|
||||||
|
<arg><option>-v</option></arg>
|
||||||
|
<arg><option>-V</option></arg>
|
||||||
<arg choice="req">name</arg>
|
<arg choice="req">name</arg>
|
||||||
<arg choice="opt">server</arg>
|
<arg choice="opt">server</arg>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
@@ -238,6 +240,11 @@
|
|||||||
<parameter>record</parameter>, <parameter>usage</parameter> and
|
<parameter>record</parameter>, <parameter>usage</parameter> and
|
||||||
<parameter>trace</parameter>.
|
<parameter>trace</parameter>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The <option>-V</option> option causes <command>host</command>
|
||||||
|
to print the version number and exit.
|
||||||
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
@@ -15,8 +15,6 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: nslookup.c,v 1.130 2011/12/16 23:01:16 each Exp $ */
|
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -581,6 +579,11 @@ set_ndots(const char *value) {
|
|||||||
ndots = n;
|
ndots = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
version(void) {
|
||||||
|
fputs("nslookup " VERSION "\n", stderr);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setoption(char *opt) {
|
setoption(char *opt) {
|
||||||
if (strncasecmp(opt, "all", 4) == 0) {
|
if (strncasecmp(opt, "all", 4) == 0) {
|
||||||
@@ -751,6 +754,8 @@ do_next_command(char *input) {
|
|||||||
show_settings(ISC_TRUE, ISC_TRUE);
|
show_settings(ISC_TRUE, ISC_TRUE);
|
||||||
} else if (strcasecmp(ptr, "exit") == 0) {
|
} else if (strcasecmp(ptr, "exit") == 0) {
|
||||||
in_use = ISC_FALSE;
|
in_use = ISC_FALSE;
|
||||||
|
} else if (strncasecmp(ptr, "ver", 3) == 0) {
|
||||||
|
version();
|
||||||
} else if (strcasecmp(ptr, "help") == 0 ||
|
} else if (strcasecmp(ptr, "help") == 0 ||
|
||||||
strcasecmp(ptr, "?") == 0) {
|
strcasecmp(ptr, "?") == 0) {
|
||||||
printf("The '%s' command is not yet implemented.\n", ptr);
|
printf("The '%s' command is not yet implemented.\n", ptr);
|
||||||
@@ -805,9 +810,12 @@ parse_args(int argc, char **argv) {
|
|||||||
for (argc--, argv++; argc > 0; argc--, argv++) {
|
for (argc--, argv++; argc > 0; argc--, argv++) {
|
||||||
debug("main parsing %s", argv[0]);
|
debug("main parsing %s", argv[0]);
|
||||||
if (argv[0][0] == '-') {
|
if (argv[0][0] == '-') {
|
||||||
if (argv[0][1] != 0)
|
if (strncasecmp(argv[0], "-ver", 4) == 0) {
|
||||||
|
version();
|
||||||
|
exit(0);
|
||||||
|
} else if (argv[0][1] != 0) {
|
||||||
setoption(&argv[0][1]);
|
setoption(&argv[0][1]);
|
||||||
else
|
} else
|
||||||
have_lookup = ISC_TRUE;
|
have_lookup = ISC_TRUE;
|
||||||
} else {
|
} else {
|
||||||
if (!have_lookup) {
|
if (!have_lookup) {
|
||||||
|
@@ -230,6 +230,18 @@ nslookup -query=hinfo -timeout=10
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><constant>version</constant></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Prints the version number. (This can also be
|
||||||
|
done from the command line by using
|
||||||
|
<option>-version</option>, which will print
|
||||||
|
the version number and immediately exit.)
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><constant>exit</constant></term>
|
<term><constant>exit</constant></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@@ -30,7 +30,7 @@ DST_GSSAPI_INC = @DST_GSSAPI_INC@
|
|||||||
CINCLUDES = ${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \
|
CINCLUDES = ${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \
|
||||||
${ISC_INCLUDES} ${ISCCFG_INCLUDES} ${DST_GSSAPI_INC}
|
${ISC_INCLUDES} ${ISCCFG_INCLUDES} ${DST_GSSAPI_INC}
|
||||||
|
|
||||||
CDEFINES = @USE_GSSAPI@
|
CDEFINES = -DVERSION=\"${VERSION}\" @USE_GSSAPI@
|
||||||
CWARNINGS =
|
CWARNINGS =
|
||||||
|
|
||||||
LWRESLIBS = ../../lib/lwres/liblwres.@A@
|
LWRESLIBS = ../../lib/lwres/liblwres.@A@
|
||||||
|
@@ -962,7 +962,7 @@ get_addresses(char *host, in_port_t port,
|
|||||||
host, isc_result_totext(result));
|
host, isc_result_totext(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PARSE_ARGS_FMT "dDML:y:ghlovk:p:Pr:R::t:Tu:"
|
#define PARSE_ARGS_FMT "dDML:y:ghlovk:p:Pr:R::t:Tu:V"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pre_parse_args(int argc, char **argv) {
|
pre_parse_args(int argc, char **argv) {
|
||||||
@@ -1023,6 +1023,11 @@ pre_parse_args(int argc, char **argv) {
|
|||||||
isc_commandline_index = 1;
|
isc_commandline_index = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
version(void) {
|
||||||
|
fputs("nsupdate " VERSION "\n", stderr);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
|
parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
|
||||||
int ch;
|
int ch;
|
||||||
@@ -1060,6 +1065,10 @@ parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
|
|||||||
case 'v':
|
case 'v':
|
||||||
usevc = ISC_TRUE;
|
usevc = ISC_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'V':
|
||||||
|
version();
|
||||||
|
exit(0);
|
||||||
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
keyfile = isc_commandline_argument;
|
keyfile = isc_commandline_argument;
|
||||||
break;
|
break;
|
||||||
@@ -2022,6 +2031,7 @@ do_next_command(char *cmdline) {
|
|||||||
}
|
}
|
||||||
if (strcasecmp(word, "help") == 0) {
|
if (strcasecmp(word, "help") == 0) {
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
|
"nsupdate " VERSION ":\n"
|
||||||
"local address [port] (set local resolver)\n"
|
"local address [port] (set local resolver)\n"
|
||||||
"server address [port] (set master server for zone)\n"
|
"server address [port] (set master server for zone)\n"
|
||||||
"send (send the update request)\n"
|
"send (send the update request)\n"
|
||||||
@@ -2042,6 +2052,10 @@ do_next_command(char *cmdline) {
|
|||||||
"[update] del[ete] .... (remove the given record(s) from the zone)\n");
|
"[update] del[ete] .... (remove the given record(s) from the zone)\n");
|
||||||
return (STATUS_MORE);
|
return (STATUS_MORE);
|
||||||
}
|
}
|
||||||
|
if (strcasecmp(word, "version") == 0) {
|
||||||
|
fprintf(stdout, "nsupdate " VERSION "\n");
|
||||||
|
return (STATUS_MORE);
|
||||||
|
}
|
||||||
fprintf(stderr, "incorrect section name: %s\n", word);
|
fprintf(stderr, "incorrect section name: %s\n", word);
|
||||||
return (STATUS_SYNTAX);
|
return (STATUS_SYNTAX);
|
||||||
}
|
}
|
||||||
|
@@ -74,6 +74,7 @@
|
|||||||
<arg><option>-v</option></arg>
|
<arg><option>-v</option></arg>
|
||||||
<arg><option>-T</option></arg>
|
<arg><option>-T</option></arg>
|
||||||
<arg><option>-P</option></arg>
|
<arg><option>-P</option></arg>
|
||||||
|
<arg><option>-V</option></arg>
|
||||||
<arg>filename</arg>
|
<arg>filename</arg>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
@@ -256,6 +257,10 @@
|
|||||||
may be combined. <command>nsupdate</command> will exit after the
|
may be combined. <command>nsupdate</command> will exit after the
|
||||||
lists are printed.
|
lists are printed.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
The -V option causes <command>nsupdate</command> to print the
|
||||||
|
version number and exit.
|
||||||
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -641,6 +646,28 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<command>version</command>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Print version number.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<command>help</command>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Print a list of commands.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user