From 014892d86d30b7eceb0003d51788f9b5cadfc1bf Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Sat, 29 Apr 2000 01:49:37 +0000 Subject: [PATCH] added dns_rdatatype_isknown() --- CHANGES | 2 ++ lib/dns/include/dns/rdata.h | 10 ++++++++++ lib/dns/rdata.c | 12 +++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 0695e3e5f5..c41e32f81c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ + 143. [func] Added function dns_rdatatype_isknown(). + 142. [cleanup] does not need or . diff --git a/lib/dns/include/dns/rdata.h b/lib/dns/include/dns/rdata.h index 785da0efe2..7078b269e9 100644 --- a/lib/dns/include/dns/rdata.h +++ b/lib/dns/include/dns/rdata.h @@ -483,6 +483,16 @@ isc_boolean_t dns_rdatatype_iszonecutauth(dns_rdatatype_t type); * */ +isc_boolean_t dns_rdatatype_isknown(dns_rdatatype_t type); +/* + * Return true iff the rdata type 'type' is known. + * + * Requires: + * 'type' is a valid rdata type. + * + */ + + isc_result_t dns_rdata_additionaldata(dns_rdata_t *rdata, dns_additionaldatafunc_t add, void *arg); diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index dda7bb301f..8fb9e93508 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: rdata.c,v 1.80 2000/04/27 00:01:44 tale Exp $ */ +/* $Id: rdata.c,v 1.81 2000/04/29 01:48:11 gson Exp $ */ #include @@ -1635,3 +1635,13 @@ dns_rdatatype_iszonecutauth(dns_rdatatype_t type) dns_rdatatype_isdnssec(type) ? ISC_TRUE : ISC_FALSE); } + +isc_boolean_t +dns_rdatatype_isknown(dns_rdatatype_t type) +{ + if ((dns_rdatatype_attributes(type) & DNS_RDATATYPEATTR_UNKNOWN) + == 0) + return (ISC_TRUE); + return (ISC_FALSE); +} +