2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 06:55:30 +00:00

start on ipv6 bits

This commit is contained in:
Michael Graff
1999-10-28 21:50:27 +00:00
parent dbb7554504
commit 1f90c10828
3 changed files with 24 additions and 18 deletions

View File

@@ -347,8 +347,8 @@ lookup(char *target)
check_result(result, "dns_name_dup %s", target); check_result(result, "dns_name_dup %s", target);
result = dns_adb_lookup(adb, t2, lookup_callback, client, result = dns_adb_lookup(adb, t2, lookup_callback, client,
&client->name, dns_rootname, now, &client->name, dns_rootname,
&client->handle); DNS_ADBFAMILY_INET, now, &client->handle);
switch (result) { switch (result) {
case ISC_R_NOTFOUND: case ISC_R_NOTFOUND:

View File

@@ -142,7 +142,7 @@ struct dns_adbname {
unsigned int magic; unsigned int magic;
dns_name_t name; dns_name_t name;
dns_adb_t *adb; dns_adb_t *adb;
isc_boolean_t partial_result; unsigned int partial_result;
isc_boolean_t dead; isc_boolean_t dead;
isc_stdtime_t expire_time; isc_stdtime_t expire_time;
int lock_bucket; int lock_bucket;
@@ -284,7 +284,7 @@ import_rdataset(dns_adb_t *adb, dns_adbname_t *adbname,
while (result == ISC_R_SUCCESS) { while (result == ISC_R_SUCCESS) {
nh = new_adbnamehook(adb, NULL); nh = new_adbnamehook(adb, NULL);
if (nh == NULL) { if (nh == NULL) {
adbname->partial_result = ISC_TRUE; adbname->partial_result |= DNS_ADBFAMILY_INET;
result = ISC_R_NOMEMORY; result = ISC_R_NOMEMORY;
goto fail; goto fail;
} }
@@ -300,7 +300,7 @@ import_rdataset(dns_adb_t *adb, dns_adbname_t *adbname,
entry = new_adbentry(adb); entry = new_adbentry(adb);
if (entry == NULL) { if (entry == NULL) {
adbname->partial_result = ISC_TRUE; adbname->partial_result |= DNS_ADBFAMILY_INET;
result = ISC_R_NOMEMORY; result = ISC_R_NOMEMORY;
goto fail; goto fail;
} }
@@ -691,7 +691,7 @@ new_adbname(dns_adb_t *adb, dns_name_t *dnsname)
name->magic = DNS_ADBNAME_MAGIC; name->magic = DNS_ADBNAME_MAGIC;
name->adb = adb; name->adb = adb;
name->partial_result = ISC_FALSE; name->partial_result = 0;
name->dead = ISC_FALSE; name->dead = ISC_FALSE;
name->expire_time = INT_MAX; name->expire_time = INT_MAX;
name->lock_bucket = DNS_ADB_INVALIDBUCKET; name->lock_bucket = DNS_ADB_INVALIDBUCKET;
@@ -861,8 +861,8 @@ new_adbhandle(dns_adb_t *adb)
*/ */
h->magic = 0; h->magic = 0;
h->adb = adb; h->adb = adb;
h->query_pending = ISC_FALSE; h->query_pending = 0;
h->partial_result = ISC_FALSE; h->partial_result = 0;
h->result = ISC_R_UNEXPECTED; h->result = ISC_R_UNEXPECTED;
ISC_LINK_INIT(h, plink); ISC_LINK_INIT(h, plink);
ISC_LIST_INIT(h->list); ISC_LIST_INIT(h->list);
@@ -1148,7 +1148,7 @@ copy_namehook_list(dns_adb_t *adb, dns_adbhandle_t *handle,
goto next; goto next;
addrinfo = new_adbaddrinfo(adb, namehook->entry); addrinfo = new_adbaddrinfo(adb, namehook->entry);
if (addrinfo == NULL) { if (addrinfo == NULL) {
handle->partial_result = ISC_TRUE; handle->partial_result |= DNS_ADBFAMILY_INET;
handle->result = ISC_R_NOMEMORY; handle->result = ISC_R_NOMEMORY;
goto out; goto out;
} }
@@ -1440,7 +1440,8 @@ dns_adb_detach(dns_adb_t **adbx)
isc_result_t isc_result_t
dns_adb_lookup(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action, dns_adb_lookup(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
void *arg, dns_name_t *name, dns_name_t *zone, void *arg, dns_name_t *name, dns_name_t *zone,
isc_stdtime_t now, dns_adbhandle_t **handlep) unsigned int families, isc_stdtime_t now,
dns_adbhandle_t **handlep)
{ {
dns_adbhandle_t *handle; dns_adbhandle_t *handle;
dns_adbname_t *adbname; dns_adbname_t *adbname;
@@ -1577,12 +1578,12 @@ dns_adb_lookup(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
handle->adbname = adbname; handle->adbname = adbname;
handle->name_bucket = bucket; handle->name_bucket = bucket;
ISC_LIST_APPEND(adbname->handles, handle, link); ISC_LIST_APPEND(adbname->handles, handle, link);
handle->query_pending = ISC_TRUE; handle->query_pending |= DNS_ADBFAMILY_INET;
attach_to_task = ISC_TRUE; attach_to_task = ISC_TRUE;
} }
if (adbname->partial_result) if (adbname->partial_result & DNS_ADBFAMILY_INET)
handle->partial_result = ISC_TRUE; handle->partial_result |= DNS_ADBFAMILY_INET;
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
goto success; goto success;
@@ -1997,7 +1998,7 @@ dns_adb_dumphandle(dns_adbhandle_t *handle, FILE *f)
LOCK(&handle->lock); LOCK(&handle->lock);
fprintf(f, "Handle %p\n", handle); fprintf(f, "Handle %p\n", handle);
fprintf(f, "\tquery_pending %d, result %d (%s)\n", fprintf(f, "\tquery_pending %04x, result %d (%s)\n",
handle->query_pending, handle->result, handle->query_pending, handle->result,
isc_result_totext(handle->result)); isc_result_totext(handle->result));
fprintf(f, "\tname_bucket %d, name %p, event sender %p\n", fprintf(f, "\tname_bucket %d, name %p, event sender %p\n",
@@ -2114,7 +2115,7 @@ construct_name(dns_adb_t *adb, dns_adbhandle_t *handle, dns_name_t *zone,
use_hints = dns_name_equal(zone, dns_rootname); use_hints = dns_name_equal(zone, dns_rootname);
dns_rdataset_init(&rdataset); dns_rdataset_init(&rdataset);
adbname->partial_result = ISC_FALSE; adbname->partial_result = 0;
result = dns_view_find(adb->view, &adbname->name, dns_rdatatype_a, result = dns_view_find(adb->view, &adbname->name, dns_rdatatype_a,
now, DNS_DBFIND_GLUEOK, use_hints, now, DNS_DBFIND_GLUEOK, use_hints,

View File

@@ -119,9 +119,10 @@ struct dns_adbhandle {
/* Public */ /* Public */
unsigned int magic; /* RO: magic */ unsigned int magic; /* RO: magic */
ISC_LIST(dns_adbaddrinfo_t) list; /* RO: list of addrs */ ISC_LIST(dns_adbaddrinfo_t) list; /* RO: list of addrs */
isc_boolean_t query_pending; /* RO: partial list */
isc_boolean_t partial_result; /* RO: addrs missing */
isc_result_t result; /* RO: extra result */ isc_result_t result; /* RO: extra result */
unsigned int query_pending; /* RO: partial list */
unsigned int partial_result; /* RO: addrs missing */
unsigned int families; /* RO: addr families */
ISC_LINK(dns_adbhandle_t) plink; /* RW: client use */ ISC_LINK(dns_adbhandle_t) plink; /* RW: client use */
/* Private */ /* Private */
@@ -133,6 +134,9 @@ struct dns_adbhandle {
ISC_LINK(dns_adbhandle_t) link; ISC_LINK(dns_adbhandle_t) link;
}; };
#define DNS_ADBFAMILY_INET 0x0001
#define DNS_ADBFAMILY_INET6 0x0002
/* dns_adbaddr_t /* dns_adbaddr_t
* *
* The answers to queries come back as a list of these. * The answers to queries come back as a list of these.
@@ -216,7 +220,8 @@ dns_adb_detach(dns_adb_t **adb);
isc_result_t isc_result_t
dns_adb_lookup(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action, dns_adb_lookup(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
void *arg, dns_name_t *name, dns_name_t *zone, void *arg, dns_name_t *name, dns_name_t *zone,
isc_stdtime_t now, dns_adbhandle_t **handle); unsigned int families, isc_stdtime_t now,
dns_adbhandle_t **handle);
/* /*
* Main interface for clients. The adb will look up the name given in * Main interface for clients. The adb will look up the name given in
* "name" and will build up a list of found addresses, and perhaps start * "name" and will build up a list of found addresses, and perhaps start