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

Added dns_keytable_finddeepestmatch()

This commit is contained in:
Brian Wellington
2000-04-18 17:47:17 +00:00
parent 605b13c0dc
commit 2e8e76e547
2 changed files with 52 additions and 0 deletions

View File

@@ -285,6 +285,36 @@ dns_keytable_findkeynode(dns_keytable_t *keytable, dns_name_t *name,
return (result);
}
isc_result_t
dns_keytable_finddeepestmatch(dns_keytable_t *keytable, dns_name_t *name,
dns_name_t *foundname)
{
isc_result_t result;
dns_keynode_t *knode;
void *data;
/*
* Search for the deepest match in 'keytable'.
*/
REQUIRE(VALID_KEYTABLE(keytable));
REQUIRE(dns_name_isabsolute(name));
REQUIRE(foundname != NULL);
RWLOCK(&keytable->rwlock, isc_rwlocktype_read);
knode = NULL;
data = NULL;
result = dns_rbt_findname(keytable->table, name, foundname, &data);
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH)
result = ISC_R_SUCCESS;
RWUNLOCK(&keytable->rwlock, isc_rwlocktype_read);
return (result);
}
void
dns_keytable_detachkeynode(dns_keytable_t *keytable,
dns_keynode_t **keynodep)