2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +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:
Mark Andrews 2002-07-25 05:46:07 +00:00
parent f462e2f372
commit ec3984e9df
8 changed files with 43 additions and 29 deletions

View File

@ -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
string queries.

View File

@ -15,7 +15,7 @@
* 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 <stdlib.h>
@ -84,7 +84,7 @@ static char *argv0;
static char domainopt[DNS_NAME_MAXTEXT];
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;
static const char *opcodetext[] = {
@ -159,7 +159,7 @@ help(void) {
" (Use ixfr=version for type ixfr)\n"
" q-opt is one of:\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"
" -b address (bind to source address)\n"
" -p port (specify port number)\n"
@ -1013,11 +1013,14 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
help();
exit(0);
break;
case 'i':
ip6_int = ISC_TRUE;
return (ISC_FALSE);
case 'm': /* memdebug */
/* memdebug is handled in preparse_args() */
return (ISC_FALSE);
case 'n':
nibble = ISC_TRUE;
/* deprecated */
return (ISC_FALSE);
case 'v':
version();
@ -1121,7 +1124,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
return (value_from_next);
case 'x':
*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)
{
strncpy((*lookup)->textname, textname,
@ -1129,7 +1132,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
debug("looking up %s", (*lookup)->textname);
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
(*lookup)->ns_search_only);
(*lookup)->nibble = nibble;
(*lookup)->ip6_int = ip6_int;
if (!(*lookup)->rdtypeset)
(*lookup)->rdtype = dns_rdatatype_ptr;
if (!(*lookup)->rdclassset)

View File

@ -16,7 +16,7 @@
- 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>
@ -203,9 +203,10 @@ When this option is used, there is no need to provide the
automatically performs a lookup for a name like
<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
looked up using the IP6.ARPA domain and binary labels as defined in
RFC2874. To use the older RFC1886 method using the IP6.INT domain and
"nibble" labels, specify the <option>-n</option> (nibble) option.
looked up using nibble format under the IP6.ARPA domain.
To use the older RFC1886 method using the IP6.INT domain
specify the <option>-i</option> option. Bit string labels (RFC2874)
are now experimental and are not attempted.
</para>
<para>

View File

@ -15,7 +15,7 @@
* 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
@ -220,7 +220,7 @@ reverse_octets(const char *in, char **p, char *end) {
}
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)
{
int r;
@ -233,9 +233,13 @@ get_reverse(char *reverse, char *value, isc_boolean_t nibble,
/* This is a valid IPv6 address. */
dns_fixedname_t fname;
dns_name_t *name;
unsigned int options = DNS_BYADDROPT_IPV6NIBBLE;
if (ip6_int)
options |= DNS_BYADDROPT_IPV6INT;
dns_fixedname_init(&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)
return (result);
dns_name_format(name, reverse, MXNAME);
@ -401,7 +405,7 @@ make_empty_lookup(void) {
looknew->retries = tries;
looknew->nsfound = 0;
looknew->tcp_mode = ISC_FALSE;
looknew->nibble = ISC_FALSE;
looknew->ip6_int = ISC_FALSE;
looknew->comments = ISC_TRUE;
looknew->stats = ISC_TRUE;
looknew->section_question = ISC_TRUE;

View File

@ -15,7 +15,7 @@
* 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 <stdlib.h>
@ -120,14 +120,14 @@ struct rtype rtypes[] = {
static void
show_usage(void) {
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"
" -a is equivalent to -v -t *\n"
" -c specifies query class for non-IN data\n"
" -C compares SOA records on authoritative nameservers\n"
" -d is equivalent to -v\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"
" -r disables recursive processing\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();
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) {
switch (c) {
case 'l':
@ -533,8 +533,11 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->rdtypeset = ISC_TRUE;
short_form = ISC_FALSE;
break;
case 'i':
lookup->ip6_int = ISC_TRUE;
break;
case 'n':
lookup->nibble = ISC_TRUE;
/* deprecated */
break;
case 'w':
/*
@ -590,7 +593,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
}
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)
{
strncpy(lookup->textname, store, sizeof(lookup->textname));

View File

@ -16,7 +16,7 @@
- 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>
@ -109,10 +109,10 @@ to making a query of type AXFR.
</para>
<para>
The <option>-n</option>
The <option>-i</option>
option specifies that reverse lookups of IPv6 addresses should
use the IP6.INT domain and "nibble" labels as defined in RFC1886.
The default is to use IP6.ARPA and binary labels as defined in RFC2874.
use the IP6.INT domain as defined in RFC1886.
The default is to use IP6.ARPA.
</para>
<para>

View File

@ -15,7 +15,7 @@
* 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
#define DIG_H
@ -99,7 +99,7 @@ struct dig_lookup {
trace, /* dig +trace */
trace_root, /* initial query for either +trace or +nssearch */
tcp_mode,
nibble,
ip6_int,
comments,
stats,
section_question,
@ -190,7 +190,7 @@ void
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr);
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);
void

View File

@ -15,7 +15,7 @@
* 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>
@ -662,7 +662,7 @@ addlookup(char *opt) {
rdclass = dns_rdataclass_in;
}
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)
{
safecpy(lookup->textname, store, sizeof(lookup->textname));