From b8fff4f0d70bb9c5e53023ad0dae0acda67b5cda Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 17 Oct 2002 23:44:35 +0000 Subject: [PATCH] 1390. [func] host now supports ixfr. developer: marka reviewer: jinmei --- CHANGES | 2 ++ bin/dig/host.c | 23 ++++++++++++++++++----- bin/dig/host.docbook | 12 +++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index fc051e723c..7777e5ff18 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +1390. [func] host now supports ixfr. + 1389. [bug] named could fail to rotate long log files. [RT #3666] 1388. [port] irix: check for sys/sysctl.h and NET_RT_IFLIST before diff --git a/bin/dig/host.c b/bin/dig/host.c index d2f92e0d3f..a0ae986d93 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: host.c,v 1.87 2002/09/26 11:17:06 jinmei Exp $ */ +/* $Id: host.c,v 1.88 2002/10/17 23:44:35 marka Exp $ */ #include #include @@ -500,6 +500,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { isc_result_t result = ISC_R_SUCCESS; dns_rdatatype_t rdtype; dns_rdataclass_t rdclass; + isc_uint32_t serial = 0; UNUSED(is_batchfile); @@ -522,10 +523,19 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { lookup->recurse = ISC_FALSE; break; case 't': - tr.base = isc_commandline_argument; - tr.length = strlen(isc_commandline_argument); - result = dns_rdatatype_fromtext(&rdtype, + if (strncasecmp(isc_commandline_argument, + "ixfr=", 5) == 0) { + rdtype = dns_rdatatype_ixfr; + /* XXXMPA add error checking */ + serial = strtoul(isc_commandline_argument + 5, + NULL, 10); + result = ISC_R_SUCCESS; + } else { + tr.base = isc_commandline_argument; + tr.length = strlen(isc_commandline_argument); + result = dns_rdatatype_fromtext(&rdtype, (isc_textregion_t *)&tr); + } if (result != ISC_R_SUCCESS) { fatalexit = 2; @@ -541,7 +551,10 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { list_type = dns_rdatatype_any; short_form = ISC_FALSE; lookup->tcp_mode = ISC_TRUE; - } else + } else if (rdtype == dns_rdatatype_ixfr) { + lookup->ixfr_serial = serial; + list_type = rdtype; + } else list_type = rdtype; list_addresses = ISC_FALSE; break; diff --git a/bin/dig/host.docbook b/bin/dig/host.docbook index 85d562b902..77a5e1229d 100644 --- a/bin/dig/host.docbook +++ b/bin/dig/host.docbook @@ -16,7 +16,7 @@ - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --> - + @@ -103,9 +103,9 @@ output. List mode is selected by the option. This makes host perform a zone transfer for zone -name. The argument is provided for -compatibility with older implemementations. This option is equivalent -to making a query of type AXFR. +name. Transfer the zone printing out the NS, PTR +and address records (A/AAAA). If combined with +all records will be printed. @@ -163,7 +163,9 @@ type. By default it looks for A records, but if the option was given, queries will be made for SOA records, and if name is a dotted-decimal IPv4 address or colon-delimited IPv6 address, host will -query for PTR records. +query for PTR records. If a query type of IXFR is chosen the starting +serial number can be specified by appending an equal followed by the +starting serial number (e.g. -t IXFR=12345678).