REQUIRE(VALID_FWDTABLE(fwdtable));
dns_qpmulti_query(fwdtable->table, &qpr);
- result = dns_qp_lookup(&qpr, name, NULL, NULL, NULL, &pval, NULL);
+ result = dns_qp_lookup(&qpr, name, 0, NULL, NULL, NULL, &pval, NULL);
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) {
dns_forwarders_t *fwdrs = pval;
*forwardersp = fwdrs;
isc_result_t
dns_qp_lookup(dns_qpreadable_t qpr, const dns_name_t *name,
- dns_name_t *foundname, dns_qpiter_t *iter, dns_qpchain_t *chain,
- void **pval_r, uint32_t *ival_r);
+ dns_namespace_t space, dns_name_t *foundname, dns_qpiter_t *iter,
+ dns_qpchain_t *chain, void **pval_r, uint32_t *ival_r);
/*%<
* Look up a leaf in a qp-trie that is equal to, or an ancestor domain of,
- * 'name'.
+ * 'name' in the namespace 'space'. The namespace can either be
+ * DNS_DB_NSEC_NORMAL, DNS_DB_NSEC_NSEC, or DNS_DB_NSEC3.
*
* If 'foundname' is not NULL, it will be updated to contain the name
* that was found (if any). The return code, ISC_R_SUCCESS or
* \li ISC_R_NOTFOUND if no match was found
*/
-isc_result_t
-dns_qp_lookup2(dns_qpreadable_t qpr, const dns_name_t *name,
- dns_namespace_t space, dns_name_t *foundname, dns_qpiter_t *iter,
- dns_qpchain_t *chain, void **pval_r, uint32_t *ival_r);
-/*%<
- * The same as 'dns_qp_lookup', but with the possibility to set a namespace,
- * either DNS_DB_NSEC_NORMAL (or 0, which is the equivalent of 'dns_qp_lookup'),
- * DNS_DB_NSEC_NSEC, OR DNS_DB_NSEC3.
- */
-
isc_result_t
dns_qp_insert(dns_qp_t *qp, void *pval, uint32_t ival);
/*%<
REQUIRE(foundname != NULL);
dns_qpmulti_query(keytable->table, &qpr);
- result = dns_qp_lookup(&qpr, name, NULL, NULL, NULL, &pval, NULL);
+ result = dns_qp_lookup(&qpr, name, 0, NULL, NULL, NULL, &pval, NULL);
keynode = pval;
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) {
REQUIRE(wantdnssecp != NULL);
dns_qpmulti_query(keytable->table, &qpr);
- result = dns_qp_lookup(&qpr, name, NULL, NULL, NULL, &pval, NULL);
+ result = dns_qp_lookup(&qpr, name, 0, NULL, NULL, NULL, &pval, NULL);
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) {
keynode = pval;
if (foundname != NULL) {
REQUIRE(VALID_NAMETREE(nametree));
dns_qpmulti_query(nametree->table, &qpr);
- result = dns_qp_lookup(&qpr, name, NULL, NULL, NULL, (void **)&node,
+ result = dns_qp_lookup(&qpr, name, 0, NULL, NULL, NULL, (void **)&node,
NULL);
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) {
if (found != NULL) {
RWLOCK(&ntatable->rwlock, isc_rwlocktype_read);
dns_qpmulti_query(ntatable->table, &qpr);
- result = dns_qp_lookup(&qpr, name, NULL, NULL, NULL, &pval, NULL);
+ result = dns_qp_lookup(&qpr, name, 0, NULL, NULL, NULL, &pval, NULL);
nta = pval;
switch (result) {
}
isc_result_t
-dns_qp_lookup2(dns_qpreadable_t qpr, const dns_name_t *name,
- dns_namespace_t space, dns_name_t *foundname, dns_qpiter_t *iter,
- dns_qpchain_t *chain, void **pval_r, uint32_t *ival_r) {
+dns_qp_lookup(dns_qpreadable_t qpr, const dns_name_t *name,
+ dns_namespace_t space, dns_name_t *foundname, dns_qpiter_t *iter,
+ dns_qpchain_t *chain, void **pval_r, uint32_t *ival_r) {
dns_qpreader_t *qp = dns_qpreader(qpr);
dns_qpkey_t search, found;
size_t searchlen, foundlen;
return ISC_R_NOTFOUND;
}
-isc_result_t
-dns_qp_lookup(dns_qpreadable_t qpr, const dns_name_t *name,
- dns_name_t *foundname, dns_qpiter_t *iter, dns_qpchain_t *chain,
- void **pval_r, uint32_t *ival_r) {
- return dns_qp_lookup2(qpr, name, 0, foundname, iter, chain, pval_r,
- ival_r);
-}
-
/**********************************************************************/
/*
* Look for the node in the auxilary tree.
*/
- result = dns_qp_lookup2(search->qpdb->nsec, name, DNS_DB_NSEC_NSEC,
- NULL, &iter, NULL, (void **)&node, NULL);
+ result = dns_qp_lookup(search->qpdb->nsec, name, DNS_DB_NSEC_NSEC, NULL,
+ &iter, NULL, (void **)&node, NULL);
if (result != DNS_R_PARTIALMATCH) {
return ISC_R_NOTFOUND;
}
/*
* Search down from the root of the tree.
*/
- result = dns_qp_lookup(search.qpdb->tree, name, NULL, NULL,
+ result = dns_qp_lookup(search.qpdb->tree, name, 0, NULL, NULL,
&search.chain, (void **)&node, NULL);
if (result != ISC_R_NOTFOUND && foundname != NULL) {
dns_name_copy(&node->name, foundname);
/*
* Search down from the root of the tree.
*/
- result = dns_qp_lookup(search.qpdb->tree, name, NULL, NULL,
+ result = dns_qp_lookup(search.qpdb->tree, name, 0, NULL, NULL,
&search.chain, (void **)&node, NULL);
switch (result) {
*/
if (continuing && qpdbiter->node != NULL) {
isc_result_t result;
- result = dns_qp_lookup(qpdb->tree, qpdbiter->name, NULL,
+ result = dns_qp_lookup(qpdb->tree, qpdbiter->name, 0, NULL,
&qpdbiter->iter, NULL, NULL, NULL);
INSIST(result == ISC_R_SUCCESS);
}
dereference_iter_node(qpdbiter DNS__DB_FLARG_PASS);
- result = dns_qp_lookup(qpdb->tree, name, NULL, &qpdbiter->iter, NULL,
+ result = dns_qp_lookup(qpdb->tree, name, 0, NULL, &qpdbiter->iter, NULL,
(void **)&qpdbiter->node, NULL);
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) {
break;
}
- result = dns_qp_lookup2(&search->qpr, wname, nspace,
- NULL, &wit, NULL,
- (void **)&wnode, NULL);
+ result = dns_qp_lookup(&search->qpr, wname, nspace,
+ NULL, &wit, NULL,
+ (void **)&wnode, NULL);
if (result == ISC_R_SUCCESS) {
/*
* We have found the wildcard node. If it
* It is the first node sought in the NSEC tree.
*/
*firstp = false;
- result = dns_qp_lookup2(&qpr, name, DNS_DB_NSEC_NSEC,
- NULL, nit, NULL, NULL, NULL);
+ result = dns_qp_lookup(&qpr, name, DNS_DB_NSEC_NSEC,
+ NULL, nit, NULL, NULL, NULL);
INSIST(result != ISC_R_NOTFOUND);
if (result == ISC_R_SUCCESS) {
/*
}
*nodep = NULL;
- result = dns_qp_lookup2(&search->qpr, name, DNS_DB_NSEC_NORMAL,
- NULL, &search->iter, &search->chain,
- (void **)nodep, NULL);
+ result = dns_qp_lookup(&search->qpr, name, DNS_DB_NSEC_NORMAL,
+ NULL, &search->iter, &search->chain,
+ (void **)nodep, NULL);
if (result == ISC_R_SUCCESS) {
break;
}
/*
* Search down from the root of the tree.
*/
- result = dns_qp_lookup2(&search.qpr, name, nspace, NULL, &search.iter,
- &search.chain, (void **)&node, NULL);
+ result = dns_qp_lookup(&search.qpr, name, nspace, NULL, &search.iter,
+ &search.chain, (void **)&node, NULL);
if (result != ISC_R_NOTFOUND) {
dns_name_copy(&node->name, foundname);
}
* NSEC3 follows after all non-nsec3 nodes, seek the NSEC3
* origin node.
*/
- result = dns_qp_lookup2(qpdbiter->snap, &qpdb->common.origin,
- DNS_DB_NSEC_NSEC3, NULL,
- &qpdbiter->iter, NULL,
- (void **)&qpdbiter->node, NULL);
+ result = dns_qp_lookup(qpdbiter->snap, &qpdb->common.origin,
+ DNS_DB_NSEC_NSEC3, NULL, &qpdbiter->iter,
+ NULL, (void **)&qpdbiter->node, NULL);
if (result != ISC_R_SUCCESS ||
QPDBITER_NSEC3_ORIGIN_NODE(qpdb, qpdbiter))
{
/*
* The final non-nsec node is before the the NSEC origin node.
*/
- result = dns_qp_lookup2(qpdbiter->snap, &qpdb->common.origin,
- DNS_DB_NSEC_NSEC, NULL, &qpdbiter->iter,
- NULL, (void **)&qpdbiter->node, NULL);
+ result = dns_qp_lookup(qpdbiter->snap, &qpdb->common.origin,
+ DNS_DB_NSEC_NSEC, NULL, &qpdbiter->iter,
+ NULL, (void **)&qpdbiter->node, NULL);
if (result == ISC_R_SUCCESS) {
INSIST(QPDBITER_NSEC_ORIGIN_NODE(qpdb, qpdbiter));
/* skip the NSEC origin node */
switch (qpdbiter->nsec3mode) {
case nsec3only:
- result = dns_qp_lookup2(qpdbiter->snap, name, DNS_DB_NSEC_NSEC3,
- NULL, &qpdbiter->iter, NULL,
- (void **)&qpdbiter->node, NULL);
+ result = dns_qp_lookup(qpdbiter->snap, name, DNS_DB_NSEC_NSEC3,
+ NULL, &qpdbiter->iter, NULL,
+ (void **)&qpdbiter->node, NULL);
break;
case nonsec3:
- result = dns_qp_lookup(qpdbiter->snap, name, NULL,
- &qpdbiter->iter, NULL,
+ result = dns_qp_lookup(qpdbiter->snap, name, DNS_DB_NSEC_NORMAL,
+ NULL, &qpdbiter->iter, NULL,
(void **)&qpdbiter->node, NULL);
break;
case full:
- result = dns_qp_lookup(qpdbiter->snap, name, NULL,
- &qpdbiter->iter, NULL,
+ result = dns_qp_lookup(qpdbiter->snap, name, DNS_DB_NSEC_NORMAL,
+ NULL, &qpdbiter->iter, NULL,
(void **)&qpdbiter->node, NULL);
if (result != ISC_R_SUCCESS) {
- tresult = dns_qp_lookup2(
- qpdbiter->snap, name, DNS_DB_NSEC_NSEC3, NULL,
- &qpdbiter->iter, NULL, (void **)&qpdbiter->node,
- NULL);
+ tresult = dns_qp_lookup(qpdbiter->snap, name,
+ DNS_DB_NSEC_NSEC3, NULL,
+ &qpdbiter->iter, NULL,
+ (void **)&qpdbiter->node, NULL);
if (tresult == ISC_R_SUCCESS) {
result = tresult;
}
}
INSIST(qpdbiter->node->nspace == DNS_DB_NSEC_NSEC);
- result = dns_qp_lookup2(qpdbiter->snap, &qpdb->common.origin,
+ result = dns_qp_lookup(qpdbiter->snap, &qpdb->common.origin,
DNS_DB_NSEC_NSEC, NULL, &qpdbiter->iter,
NULL, (void **)&qpdbiter->node, NULL);
}
INSIST(qpdbiter->node->nspace == DNS_DB_NSEC_NSEC);
- result = dns_qp_lookup2(qpdbiter->snap, &qpdb->common.origin,
- DNS_DB_NSEC_NSEC3, NULL,
- &qpdbiter->iter, NULL,
- (void **)&qpdbiter->node, NULL);
+ result = dns_qp_lookup(qpdbiter->snap, &qpdb->common.origin,
+ DNS_DB_NSEC_NSEC3, NULL, &qpdbiter->iter,
+ NULL, (void **)&qpdbiter->node, NULL);
if (result != ISC_R_SUCCESS ||
QPDBITER_NSEC3_ORIGIN_NODE(qpdb, qpdbiter))
{
* NSEC3 follows after all non-nsec3 nodes,
* seek the NSEC3 origin node.
*/
- result = dns_qp_lookup2(iter->snap, &qpdb->common.origin,
- DNS_DB_NSEC_NSEC3, NULL, &iter->iter,
- NULL, NULL, NULL);
+ result = dns_qp_lookup(iter->snap, &qpdb->common.origin,
+ DNS_DB_NSEC_NSEC3, NULL, &iter->iter,
+ NULL, NULL, NULL);
INSIST(result == ISC_R_SUCCESS);
break;
default:
dns_qpmulti_query(rpzs->table, &qpr);
dns_qpchain_init(&qpr, &chain);
- result = dns_qp_lookup(&qpr, trig_name, NULL, NULL, &chain,
+ result = dns_qp_lookup(&qpr, trig_name, 0, NULL, NULL, &chain,
(void **)&data, NULL);
switch (result) {
case ISC_R_SUCCESS:
if (exactopts == DNS_ZTFIND_EXACT) {
result = dns_qp_getname(&qpr, name, 0, &pval, NULL);
} else {
- result = dns_qp_lookup(&qpr, name, NULL, NULL, &chain, &pval,
+ result = dns_qp_lookup(&qpr, name, 0, NULL, NULL, &chain, &pval,
NULL);
if (exactopts == DNS_ZTFIND_NOEXACT && result == ISC_R_SUCCESS)
{
start = isc_time_monotonic();
for (i = 0; i < n; i++) {
name = dns_fixedname_name(&items[i]);
- dns_qp_lookup(qp, name, 0, NULL, NULL, NULL, NULL);
+ dns_qp_lookup(qp, name, 0, NULL, NULL, NULL, NULL, NULL);
}
stop = isc_time_monotonic();
++search->ndata[1];
}
- dns_qp_lookup(qp, search, 0, NULL, NULL, NULL, NULL);
+ dns_qp_lookup(qp, search, 0, NULL, NULL, NULL, NULL, NULL);
}
stop = isc_time_monotonic();
void *pval = NULL;
dns_test_namefromstring(check[i].query, &fn1);
- result = dns_qp_lookup2(qp, name, space, foundname, NULL, NULL,
- &pval, NULL);
+ result = dns_qp_lookup(qp, name, space, foundname, NULL, NULL,
+ &pval, NULL);
#if 0
fprintf(stderr, "%s%s %s (expected %s) "
dns_qpchain_init(qp, &chain);
dns_test_namefromstring(check[i].query, &fn1);
- result = dns_qp_lookup2(qp, name, check[i].space, NULL, iter,
- &chain, NULL, NULL);
+ result = dns_qp_lookup(qp, name, check[i].space, NULL, iter,
+ &chain, NULL, NULL);
#if 0
fprintf(stderr,
"%s %s (expected %s), "
result = dns_name_tostring(expred, &predstr, mctx);
assert_int_equal(result, ISC_R_SUCCESS);
- result = dns_qp_lookup2(qp, name, check[i].space, NULL, &it,
- chain, NULL, NULL);
+ result = dns_qp_lookup(qp, name, check[i].space, NULL, &it,
+ chain, NULL, NULL);
#if 0
fprintf(stderr, "%s %s: expected %s got %s\n", check[i].query,
check[i].space == DNS_DB_NSEC_NSEC3