mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
1339. [func] dig, host and nslookup now use IP6.ARPA for nibble
lookups. Bit string lookups are no longer attempted.
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
1339. [func] dig, host and nslookup now use IP6.ARPA for nibble
|
||||||
|
lookups. Bit string lookups are no longer attempted.
|
||||||
|
|
||||||
1338. [func] IPv6 synthesis is now performed for IP6.ARPA bit
|
1338. [func] IPv6 synthesis is now performed for IP6.ARPA bit
|
||||||
string queries.
|
string queries.
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dig.c,v 1.178 2002/05/29 05:30:59 marka Exp $ */
|
/* $Id: dig.c,v 1.179 2002/07/25 05:46:07 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -84,7 +84,7 @@ static char *argv0;
|
|||||||
static char domainopt[DNS_NAME_MAXTEXT];
|
static char domainopt[DNS_NAME_MAXTEXT];
|
||||||
|
|
||||||
static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
|
static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
|
||||||
nibble = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
|
ip6_int = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
|
||||||
multiline = ISC_FALSE, nottl = ISC_FALSE, noclass = ISC_FALSE;
|
multiline = ISC_FALSE, nottl = ISC_FALSE, noclass = ISC_FALSE;
|
||||||
|
|
||||||
static const char *opcodetext[] = {
|
static const char *opcodetext[] = {
|
||||||
@@ -159,7 +159,7 @@ help(void) {
|
|||||||
" (Use ixfr=version for type ixfr)\n"
|
" (Use ixfr=version for type ixfr)\n"
|
||||||
" q-opt is one of:\n"
|
" q-opt is one of:\n"
|
||||||
" -x dot-notation (shortcut for in-addr lookups)\n"
|
" -x dot-notation (shortcut for in-addr lookups)\n"
|
||||||
" -n (nibble form for reverse IPv6 lookups)\n"
|
" -i (IP6.INT reverse IPv6 lookups)\n"
|
||||||
" -f filename (batch mode)\n"
|
" -f filename (batch mode)\n"
|
||||||
" -b address (bind to source address)\n"
|
" -b address (bind to source address)\n"
|
||||||
" -p port (specify port number)\n"
|
" -p port (specify port number)\n"
|
||||||
@@ -1013,11 +1013,14 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||||||
help();
|
help();
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
|
case 'i':
|
||||||
|
ip6_int = ISC_TRUE;
|
||||||
|
return (ISC_FALSE);
|
||||||
case 'm': /* memdebug */
|
case 'm': /* memdebug */
|
||||||
/* memdebug is handled in preparse_args() */
|
/* memdebug is handled in preparse_args() */
|
||||||
return (ISC_FALSE);
|
return (ISC_FALSE);
|
||||||
case 'n':
|
case 'n':
|
||||||
nibble = ISC_TRUE;
|
/* deprecated */
|
||||||
return (ISC_FALSE);
|
return (ISC_FALSE);
|
||||||
case 'v':
|
case 'v':
|
||||||
version();
|
version();
|
||||||
@@ -1121,7 +1124,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||||||
return (value_from_next);
|
return (value_from_next);
|
||||||
case 'x':
|
case 'x':
|
||||||
*lookup = clone_lookup(default_lookup, ISC_TRUE);
|
*lookup = clone_lookup(default_lookup, ISC_TRUE);
|
||||||
if (get_reverse(textname, value, nibble, ISC_FALSE)
|
if (get_reverse(textname, value, ip6_int, ISC_FALSE)
|
||||||
== ISC_R_SUCCESS)
|
== ISC_R_SUCCESS)
|
||||||
{
|
{
|
||||||
strncpy((*lookup)->textname, textname,
|
strncpy((*lookup)->textname, textname,
|
||||||
@@ -1129,7 +1132,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||||||
debug("looking up %s", (*lookup)->textname);
|
debug("looking up %s", (*lookup)->textname);
|
||||||
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
|
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
|
||||||
(*lookup)->ns_search_only);
|
(*lookup)->ns_search_only);
|
||||||
(*lookup)->nibble = nibble;
|
(*lookup)->ip6_int = ip6_int;
|
||||||
if (!(*lookup)->rdtypeset)
|
if (!(*lookup)->rdtypeset)
|
||||||
(*lookup)->rdtype = dns_rdatatype_ptr;
|
(*lookup)->rdtype = dns_rdatatype_ptr;
|
||||||
if (!(*lookup)->rdclassset)
|
if (!(*lookup)->rdclassset)
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- $Id: dig.docbook,v 1.11 2002/05/22 04:58:30 marka Exp $ -->
|
<!-- $Id: dig.docbook,v 1.12 2002/07/25 05:46:07 marka Exp $ -->
|
||||||
|
|
||||||
<refentry>
|
<refentry>
|
||||||
|
|
||||||
@@ -203,9 +203,10 @@ When this option is used, there is no need to provide the
|
|||||||
automatically performs a lookup for a name like
|
automatically performs a lookup for a name like
|
||||||
<literal>11.12.13.10.in-addr.arpa</literal> and sets the query type and
|
<literal>11.12.13.10.in-addr.arpa</literal> and sets the query type and
|
||||||
class to PTR and IN respectively. By default, IPv6 addresses are
|
class to PTR and IN respectively. By default, IPv6 addresses are
|
||||||
looked up using the IP6.ARPA domain and binary labels as defined in
|
looked up using nibble format under the IP6.ARPA domain.
|
||||||
RFC2874. To use the older RFC1886 method using the IP6.INT domain and
|
To use the older RFC1886 method using the IP6.INT domain
|
||||||
"nibble" labels, specify the <option>-n</option> (nibble) option.
|
specify the <option>-i</option> option. Bit string labels (RFC2874)
|
||||||
|
are now experimental and are not attempted.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dighost.c,v 1.245 2002/07/10 01:03:14 marka Exp $ */
|
/* $Id: dighost.c,v 1.246 2002/07/25 05:46:07 marka Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notice to programmers: Do not use this code as an example of how to
|
* Notice to programmers: Do not use this code as an example of how to
|
||||||
@@ -220,7 +220,7 @@ reverse_octets(const char *in, char **p, char *end) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
get_reverse(char *reverse, char *value, isc_boolean_t nibble,
|
get_reverse(char *reverse, char *value, isc_boolean_t ip6_int,
|
||||||
isc_boolean_t strict)
|
isc_boolean_t strict)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
@@ -233,9 +233,13 @@ get_reverse(char *reverse, char *value, isc_boolean_t nibble,
|
|||||||
/* This is a valid IPv6 address. */
|
/* This is a valid IPv6 address. */
|
||||||
dns_fixedname_t fname;
|
dns_fixedname_t fname;
|
||||||
dns_name_t *name;
|
dns_name_t *name;
|
||||||
|
unsigned int options = DNS_BYADDROPT_IPV6NIBBLE;
|
||||||
|
|
||||||
|
if (ip6_int)
|
||||||
|
options |= DNS_BYADDROPT_IPV6INT;
|
||||||
dns_fixedname_init(&fname);
|
dns_fixedname_init(&fname);
|
||||||
name = dns_fixedname_name(&fname);
|
name = dns_fixedname_name(&fname);
|
||||||
result = dns_byaddr_createptrname(&addr, nibble, name);
|
result = dns_byaddr_createptrname2(&addr, options, name);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
dns_name_format(name, reverse, MXNAME);
|
dns_name_format(name, reverse, MXNAME);
|
||||||
@@ -401,7 +405,7 @@ make_empty_lookup(void) {
|
|||||||
looknew->retries = tries;
|
looknew->retries = tries;
|
||||||
looknew->nsfound = 0;
|
looknew->nsfound = 0;
|
||||||
looknew->tcp_mode = ISC_FALSE;
|
looknew->tcp_mode = ISC_FALSE;
|
||||||
looknew->nibble = ISC_FALSE;
|
looknew->ip6_int = ISC_FALSE;
|
||||||
looknew->comments = ISC_TRUE;
|
looknew->comments = ISC_TRUE;
|
||||||
looknew->stats = ISC_TRUE;
|
looknew->stats = ISC_TRUE;
|
||||||
looknew->section_question = ISC_TRUE;
|
looknew->section_question = ISC_TRUE;
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: host.c,v 1.83 2001/12/19 12:16:40 marka Exp $ */
|
/* $Id: host.c,v 1.84 2002/07/25 05:46:07 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -120,14 +120,14 @@ struct rtype rtypes[] = {
|
|||||||
static void
|
static void
|
||||||
show_usage(void) {
|
show_usage(void) {
|
||||||
fputs(
|
fputs(
|
||||||
"Usage: host [-aCdlrTwv] [-c class] [-n] [-N ndots] [-t type] [-W time]\n"
|
"Usage: host [-aCdlriTwv] [-c class] [-N ndots] [-t type] [-W time]\n"
|
||||||
" [-R number] hostname [server]\n"
|
" [-R number] hostname [server]\n"
|
||||||
" -a is equivalent to -v -t *\n"
|
" -a is equivalent to -v -t *\n"
|
||||||
" -c specifies query class for non-IN data\n"
|
" -c specifies query class for non-IN data\n"
|
||||||
" -C compares SOA records on authoritative nameservers\n"
|
" -C compares SOA records on authoritative nameservers\n"
|
||||||
" -d is equivalent to -v\n"
|
" -d is equivalent to -v\n"
|
||||||
" -l lists all hosts in a domain, using AXFR\n"
|
" -l lists all hosts in a domain, using AXFR\n"
|
||||||
" -n Use the nibble form of IPv6 reverse lookup\n"
|
" -i IP6.INT reverse lookups\n"
|
||||||
" -N changes the number of dots allowed before root lookup is done\n"
|
" -N changes the number of dots allowed before root lookup is done\n"
|
||||||
" -r disables recursive processing\n"
|
" -r disables recursive processing\n"
|
||||||
" -R specifies number of retries for UDP packets\n"
|
" -R specifies number of retries for UDP packets\n"
|
||||||
@@ -485,7 +485,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
|||||||
|
|
||||||
lookup = make_empty_lookup();
|
lookup = make_empty_lookup();
|
||||||
|
|
||||||
while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dn"))
|
while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dni"))
|
||||||
!= EOF) {
|
!= EOF) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'l':
|
case 'l':
|
||||||
@@ -533,8 +533,11 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
|||||||
lookup->rdtypeset = ISC_TRUE;
|
lookup->rdtypeset = ISC_TRUE;
|
||||||
short_form = ISC_FALSE;
|
short_form = ISC_FALSE;
|
||||||
break;
|
break;
|
||||||
|
case 'i':
|
||||||
|
lookup->ip6_int = ISC_TRUE;
|
||||||
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
lookup->nibble = ISC_TRUE;
|
/* deprecated */
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
/*
|
/*
|
||||||
@@ -590,7 +593,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lookup->pending = ISC_FALSE;
|
lookup->pending = ISC_FALSE;
|
||||||
if (get_reverse(store, hostname, lookup->nibble, ISC_TRUE)
|
if (get_reverse(store, hostname, lookup->ip6_int, ISC_TRUE)
|
||||||
== ISC_R_SUCCESS)
|
== ISC_R_SUCCESS)
|
||||||
{
|
{
|
||||||
strncpy(lookup->textname, store, sizeof(lookup->textname));
|
strncpy(lookup->textname, store, sizeof(lookup->textname));
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- $Id: host.docbook,v 1.2 2001/06/08 17:18:13 gson Exp $ -->
|
<!-- $Id: host.docbook,v 1.3 2002/07/25 05:46:07 marka Exp $ -->
|
||||||
|
|
||||||
<refentry>
|
<refentry>
|
||||||
|
|
||||||
@@ -109,10 +109,10 @@ to making a query of type AXFR.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <option>-n</option>
|
The <option>-i</option>
|
||||||
option specifies that reverse lookups of IPv6 addresses should
|
option specifies that reverse lookups of IPv6 addresses should
|
||||||
use the IP6.INT domain and "nibble" labels as defined in RFC1886.
|
use the IP6.INT domain as defined in RFC1886.
|
||||||
The default is to use IP6.ARPA and binary labels as defined in RFC2874.
|
The default is to use IP6.ARPA.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dig.h,v 1.77 2002/05/29 05:31:05 marka Exp $ */
|
/* $Id: dig.h,v 1.78 2002/07/25 05:46:07 marka Exp $ */
|
||||||
|
|
||||||
#ifndef DIG_H
|
#ifndef DIG_H
|
||||||
#define DIG_H
|
#define DIG_H
|
||||||
@@ -99,7 +99,7 @@ struct dig_lookup {
|
|||||||
trace, /* dig +trace */
|
trace, /* dig +trace */
|
||||||
trace_root, /* initial query for either +trace or +nssearch */
|
trace_root, /* initial query for either +trace or +nssearch */
|
||||||
tcp_mode,
|
tcp_mode,
|
||||||
nibble,
|
ip6_int,
|
||||||
comments,
|
comments,
|
||||||
stats,
|
stats,
|
||||||
section_question,
|
section_question,
|
||||||
@@ -190,7 +190,7 @@ void
|
|||||||
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr);
|
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr);
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
get_reverse(char *reverse, char *value, isc_boolean_t nibble,
|
get_reverse(char *reverse, char *value, isc_boolean_t ip6_int,
|
||||||
isc_boolean_t strict);
|
isc_boolean_t strict);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: nslookup.c,v 1.96 2002/03/20 18:20:03 marka Exp $ */
|
/* $Id: nslookup.c,v 1.97 2002/07/25 05:46:07 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -662,7 +662,7 @@ addlookup(char *opt) {
|
|||||||
rdclass = dns_rdataclass_in;
|
rdclass = dns_rdataclass_in;
|
||||||
}
|
}
|
||||||
lookup = make_empty_lookup();
|
lookup = make_empty_lookup();
|
||||||
if (get_reverse(store, opt, lookup->nibble, ISC_TRUE)
|
if (get_reverse(store, opt, lookup->ip6_int, ISC_TRUE)
|
||||||
== ISC_R_SUCCESS)
|
== ISC_R_SUCCESS)
|
||||||
{
|
{
|
||||||
safecpy(lookup->textname, store, sizeof(lookup->textname));
|
safecpy(lookup->textname, store, sizeof(lookup->textname));
|
||||||
|
Reference in New Issue
Block a user