} dns_qpgc_t;
/*%
- * Options for fancy searches such as `dns_qp_findname_parent()`
+ * Options for fancy searches such as `dns_qp_findname_ancestor()`
*/
typedef enum dns_qpfind {
DNS_QPFIND_NOEXACT = 1 << 0,
*/
isc_result_t
-dns_qp_findname_parent(dns_qpreadable_t qpr, const dns_name_t *name,
- dns_qpfind_t options, void **pval_r, uint32_t *ival_r);
+dns_qp_findname_ancestor(dns_qpreadable_t qpr, const dns_name_t *name,
+ dns_qpfind_t options, void **pval_r, uint32_t *ival_r);
/*%<
- * Find a leaf in a qp-trie that is a parent domain of or equal to the
+ * Find a leaf in a qp-trie that is an ancestor domain of, or equal to, the
* given DNS name.
*
- * If the DNS_QPFIND_NOEXACT option is set, find a strict parent
- * domain not equal to the search name.
+ * If the DNS_QPFIND_NOEXACT option is set, find the closest ancestor
+ * domain that is not equal to the search name.
*
* The leaf values are assigned to whichever of `*pval_r` and `*ival_r`
* are not null, unless the return value is ISC_R_NOTFOUND.
*
* Returns:
* \li ISC_R_SUCCESS if an exact match was found
- * \li ISC_R_PARTIALMATCH if a parent domain was found
+ * \li ISC_R_PARTIALMATCH if an ancestor domain was found
* \li ISC_R_NOTFOUND if no match was found
*/
}
isc_result_t
-dns_qp_findname_parent(dns_qpreadable_t qpr, const dns_name_t *name,
- dns_qpfind_t options, void **pval_r, uint32_t *ival_r) {
+dns_qp_findname_ancestor(dns_qpreadable_t qpr, const dns_name_t *name,
+ dns_qpfind_t options, void **pval_r,
+ uint32_t *ival_r) {
dns_qpreader_t *qp = dns_qpreader(qpr);
dns_qpkey_t search, found;
size_t searchlen, foundlen;
if (exactopts == DNS_ZTFIND_EXACT) {
result = dns_qp_getname(&qpr, name, &pval, NULL);
} else if (exactopts == DNS_ZTFIND_NOEXACT) {
- result = dns_qp_findname_parent(&qpr, name, DNS_QPFIND_NOEXACT,
- &pval, NULL);
+ result = dns_qp_findname_ancestor(
+ &qpr, name, DNS_QPFIND_NOEXACT, &pval, NULL);
} else {
- result = dns_qp_findname_parent(&qpr, name, 0, &pval, NULL);
+ result = dns_qp_findname_ancestor(&qpr, name, 0, &pval, NULL);
}
dns_qpread_destroy(zt->multi, &qpr);
check[i].found);
#endif
dns_test_namefromstring(check[i].query, &fixed);
- result = dns_qp_findname_parent(qp, name, check[i].options,
- &pval, NULL);
+ result = dns_qp_findname_ancestor(qp, name, check[i].options,
+ &pval, NULL);
assert_int_equal(result, check[i].result);
if (check[i].found == NULL) {
assert_null(pval);