mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
add new functions to classify rdata types
- dns_rdatatype_ismulti() returns true if a given type can have multiple answers: ANY, RRSIG, or SIG. - dns_rdatatype_issig() returns true for a signature: RRSIG or SIG. - dns_rdatatype_isaddr() returns true for an address: A or AAAA. - dns_rdatatype_isalias() returns true for an alias: CNAME or DNAME.
This commit is contained in:
@@ -594,6 +594,31 @@ dns_rdatatype_isknown(dns_rdatatype_t type);
|
||||
*
|
||||
*/
|
||||
|
||||
bool
|
||||
dns_rdatatype_ismulti(dns_rdatatype_t type);
|
||||
/*%<
|
||||
* Return true iff a query for the rdata type can have multiple
|
||||
* unrelated answers in a response: ANY, RRSIG, or SIG.
|
||||
*/
|
||||
|
||||
bool
|
||||
dns_rdatatype_issig(dns_rdatatype_t type);
|
||||
/*%<
|
||||
* Return true iff the rdata type is a signature: either RRSIG or SIG.
|
||||
*/
|
||||
|
||||
bool
|
||||
dns_rdatatype_isaddr(dns_rdatatype_t type);
|
||||
/*%<
|
||||
* Return true iff the rdata type is an address: either A or AAAA.
|
||||
*/
|
||||
|
||||
bool
|
||||
dns_rdatatype_isalias(dns_rdatatype_t type);
|
||||
/*%<
|
||||
* Return true iff the rdata type is an alias: either CNAME or DNAME.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_rdata_additionaldata(dns_rdata_t *rdata, const dns_name_t *owner,
|
||||
dns_additionaldatafunc_t add, void *arg);
|
||||
|
@@ -2461,6 +2461,27 @@ dns_rdatatype_isknown(dns_rdatatype_t type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
dns_rdatatype_ismulti(dns_rdatatype_t type) {
|
||||
return type == dns_rdatatype_any || type == dns_rdatatype_rrsig ||
|
||||
type == dns_rdatatype_sig;
|
||||
}
|
||||
|
||||
bool
|
||||
dns_rdatatype_issig(dns_rdatatype_t type) {
|
||||
return type == dns_rdatatype_rrsig || type == dns_rdatatype_sig;
|
||||
}
|
||||
|
||||
bool
|
||||
dns_rdatatype_isaddr(dns_rdatatype_t type) {
|
||||
return type == dns_rdatatype_a || type == dns_rdatatype_aaaa;
|
||||
}
|
||||
|
||||
bool
|
||||
dns_rdatatype_isalias(dns_rdatatype_t type) {
|
||||
return type == dns_rdatatype_cname || type == dns_rdatatype_dname;
|
||||
}
|
||||
|
||||
void
|
||||
dns_rdata_exists(dns_rdata_t *rdata, dns_rdatatype_t type) {
|
||||
REQUIRE(rdata != NULL);
|
||||
|
Reference in New Issue
Block a user