diff --git a/lib/dns/include/dns/ncache.h b/lib/dns/include/dns/ncache.h index 5aa9f23f41..0fe8922280 100644 --- a/lib/dns/include/dns/ncache.h +++ b/lib/dns/include/dns/ncache.h @@ -44,12 +44,76 @@ */ #include +#include +#include +#include #include #include ISC_LANG_BEGINDECLS +isc_result_t +dns_ncache_add(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node, + dns_rdatatype_t covers, isc_stdtime_t now, + dns_rdataset_t *addedrdataset); +/* + * Convert the authority data from 'message' into a negative cache + * rdataset, and store it in 'cache' at 'node'. + * + * Note: + * If 'addedrdataset' is not NULL, then it will be attached to the added + * rdataset. See dns_db_addrdataset() for more details. + * + * Requires: + * 'message' is a valid message with a properly formatting negative cache + * authority section. + * + * The requirements of dns_db_addrdataset() apply to 'cache', 'node', + * 'now', and 'addedrdataset'. + * + * Returns: + * ISC_R_SUCCESS + * ISC_R_NOSPACE + * + * Any result code of dns_db_addrdataset() is a possible result code + * of dns_ncache_add(). + */ + +isc_result_t +dns_ncache_towire(dns_rdataset_t *rdataset, dns_compress_t *cctx, + isc_buffer_t *target, unsigned int *countp); +/* + * Convert the negative caching rdataset 'rdataset' to wire format, + * compressing names as specified in 'cctx', and storing the result in + * 'target'. + * + * Notes: + * The number of RRs added to target will be added to *countp. + * + * Requires: + * 'rdataset' is a valid negative caching rdataset. + * + * 'rdataset' is not empty. + * + * 'countp' is a valid pointer. + * + * Ensures: + * On a return of DNS_R_SUCCESS, 'target' contains a wire format + * for the data contained in 'rdataset'. Any error return leaves + * the buffer unchanged. + * + * *countp has been incremented by the number of RRs added to + * target. + * + * Returns: + * DNS_R_SUCCESS - all ok + * DNS_R_NOSPACE - 'target' doesn't have enough room + * + * Any error returned by dns_rdata_towire(), dns_rdataset_next(), + * dns_name_towire(). + */ + ISC_LANG_ENDDECLS #endif /* DNS_NCACHE_H */