diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h index d4e52b29d7..aa0d0a47b2 100644 --- a/lib/dns/include/dns/rdataset.h +++ b/lib/dns/include/dns/rdataset.h @@ -153,6 +153,19 @@ dns_rdataset_disassociate(dns_rdataset_t *rdataset); * 'rdataset' is a valid, disassociated rdataset. */ +isc_boolean_t +dns_rdataset_isassociated(dns_rdataset_t *rdataset); +/* + * Is 'rdataset' associated? + * + * Requires: + * 'rdataset' is a valid rdataset. + * + * Returns: + * ISC_TRUE 'rdataset' is associated. + * ISC_FALSE 'rdataset' is not associated. + */ + void dns_rdataset_makequestion(dns_rdataset_t *rdataset, dns_rdataclass_t rdclass, dns_rdatatype_t type); diff --git a/lib/dns/rdataset.c b/lib/dns/rdataset.c index ceeab33e8f..bbe57dd3d8 100644 --- a/lib/dns/rdataset.c +++ b/lib/dns/rdataset.c @@ -101,6 +101,20 @@ dns_rdataset_disassociate(dns_rdataset_t *rdataset) { rdataset->private5 = NULL; } +isc_boolean_t +dns_rdataset_isassociated(dns_rdataset_t *rdataset) { + /* + * Is 'rdataset' associated? + */ + + REQUIRE(DNS_RDATASET_VALID(rdataset)); + + if (rdataset->methods != NULL) + return (ISC_TRUE); + + return (ISC_FALSE); +} + static void question_disassociate(dns_rdataset_t *rdataset) { (void)rdataset;