diff --git a/lib/dns/include/dns/rdata.h b/lib/dns/include/dns/rdata.h index 27a1892ec3..7da8f5370e 100644 --- a/lib/dns/include/dns/rdata.h +++ b/lib/dns/include/dns/rdata.h @@ -477,6 +477,51 @@ dns_rdata_additionaldata(dns_rdata_t *rdata, dns_additionaldatafunc_t add, * Many other results are possible if not successful. */ +dns_result_t +dns_rdata_digest(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg); +/* + * Send 'rdata' in DNSSEC canonical form to 'digest'. + * + * Note: + * 'digest' may be called more than once by dns_rdata_digest(). The + * concatenation of all the regions, in the order they were given + * to 'digest', will be the DNSSEC canonical form of 'rdata'. + * + * Requires: + * + * 'rdata' is a valid, non-empty rdata. + * + * 'digest' is a valid dns_digestfunc_t. + * + * Ensures: + * + * If successful, then all of the rdata's data has been sent, in + * DNSSEC canonical form, to 'digest'. + * + * If digest() returns something other than DNS_R_SUCCESS, that result + * will be returned as the result of dns_rdata_digest(). + * + * Returns: + * + * DNS_R_SUCCESS + * + * Many other results are possible if not successful. + */ + +dns_rdatatype_t +dns_rdata_covers(dns_rdata_t *rdata); +/* + * Return the rdatatype that this type covers. + * + * Requires: + * 'rdata' is a valid, non-empty rdata. + * + * 'rdata' is a type that covers other rdata types. + * + * Returns: + * The type covered. + */ + ISC_LANG_ENDDECLS #endif /* DNS_RDATA_H */ diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index e76fca7820..e647644381 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: rdata.c,v 1.58 1999/08/16 06:45:13 gson Exp $ */ + /* $Id: rdata.c,v 1.59 1999/08/31 22:08:07 halley Exp $ */ #include @@ -548,7 +548,7 @@ dns_result_t dns_rdata_additionaldata(dns_rdata_t *rdata, dns_additionaldatafunc_t add, void *arg) { - dns_result_t result = ISC_R_SUCCESS; + dns_result_t result = DNS_R_NOTIMPLEMENTED; isc_boolean_t use_default = ISC_FALSE; /* @@ -567,6 +567,26 @@ dns_rdata_additionaldata(dns_rdata_t *rdata, dns_additionaldatafunc_t add, return (result); } +dns_result_t +dns_rdata_digest(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) { + dns_result_t result = DNS_R_NOTIMPLEMENTED; + isc_boolean_t use_default = ISC_FALSE; + + /* + * Send 'rdata' in DNSSEC canonical form to 'digest'. + */ + + REQUIRE(rdata != NULL); + REQUIRE(digest != NULL); + + DIGESTSWITCH + + if (use_default) + (void)NULL; + + return (result); +} + dns_result_t dns_rdataclass_fromtext(dns_rdataclass_t *classp, isc_textregion_t *source) { int i = 0; @@ -1393,7 +1413,13 @@ fromtext_error(void (*callback)(dns_rdatacallbacks_t *, char *, ...), } } -static isc_boolean_t ismeta(unsigned int code, struct tbl *table) { +dns_rdatatype_t +dns_rdata_covers(dns_rdata_t *rdata) { + return (covers_sig(rdata)); +} + +static isc_boolean_t +ismeta(unsigned int code, struct tbl *table) { struct tbl *t; REQUIRE(code < 65536); for (t = table; t->name != NULL; t++) {