/* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ #ifndef DNS_NCACHE_H #define DNS_NCACHE_H 1 /***** ***** Module Info *****/ /*! \file dns/ncache.h *\brief * DNS Ncache * * XXX TBS XXX * * MP: *\li The caller must ensure any required synchronization. * * Reliability: *\li No anticipated impact. * * Resources: *\li TBS * * Security: *\li No anticipated impact. * * Standards: *\li RFC2308 */ #include <isc/lang.h> #include <isc/stdtime.h> #include <dns/types.h> ISC_LANG_BEGINDECLS /*% * _OMITDNSSEC: * Omit DNSSEC records when rendering. */ #define DNS_NCACHETOWIRE_OMITDNSSEC 0x0001 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_ttl_t maxttl, dns_rdataset_t *addedrdataset); isc_result_t dns_ncache_addoptout(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node, dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t maxttl, isc_boolean_t optout, dns_rdataset_t *addedrdataset); /*%< * Convert the authority data from 'message' into a negative cache * rdataset, and store it in 'cache' at 'node' with a TTL limited to * 'maxttl'. * * \li dns_ncache_add produces a negative cache entry with a trust of no * more than answer * \li dns_ncache_addoptout produces a negative cache entry which will have * a trust of secure if all the records that make up the entry are secure. * * The 'covers' argument is the RR type whose nonexistence we are caching, * or dns_rdatatype_any when caching a NXDOMAIN response. * * 'optout' indicates a DNS_RDATASETATTR_OPTOUT should be set. * * Note: *\li If 'addedrdataset' is not NULL, then it will be attached to the added * rdataset. See dns_db_addrdataset() for more details. * * Requires: *\li 'message' is a valid message with a properly formatting negative cache * authority section. * *\li The requirements of dns_db_addrdataset() apply to 'cache', 'node', * 'now', and 'addedrdataset'. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOSPACE * *\li 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 options, unsigned int *countp); /*%< * Convert the negative caching rdataset 'rdataset' to wire format, * compressing names as specified in 'cctx', and storing the result in * 'target'. If 'omit_dnssec' is set, DNSSEC records will not * be added to 'target'. * * Notes: *\li The number of RRs added to target will be added to *countp. * * Requires: *\li 'rdataset' is a valid negative caching rdataset. * *\li 'rdataset' is not empty. * *\li 'countp' is a valid pointer. * * Ensures: *\li On a return of ISC_R_SUCCESS, 'target' contains a wire format * for the data contained in 'rdataset'. Any error return leaves * the buffer unchanged. * *\li *countp has been incremented by the number of RRs added to * target. * * Returns: *\li #ISC_R_SUCCESS - all ok *\li #ISC_R_NOSPACE - 'target' doesn't have enough room * *\li Any error returned by dns_rdata_towire(), dns_rdataset_next(), * dns_name_towire(). */ isc_result_t dns_ncache_getrdataset(dns_rdataset_t *ncacherdataset, dns_name_t *name, dns_rdatatype_t type, dns_rdataset_t *rdataset); /*%< * Search the negative caching rdataset for an rdataset with the * specified name and type. * * Requires: *\li 'ncacherdataset' is a valid negative caching rdataset. * *\li 'ncacherdataset' is not empty. * *\li 'name' is a valid name. * *\li 'type' is not SIG, or a meta-RR type. * *\li 'rdataset' is a valid disassociated rdataset. * * Ensures: *\li On a return of ISC_R_SUCCESS, 'rdataset' is bound to the found * rdataset. * * Returns: *\li #ISC_R_SUCCESS - the rdataset was found. *\li #ISC_R_NOTFOUND - the rdataset was not found. * */ isc_result_t dns_ncache_getsigrdataset(dns_rdataset_t *ncacherdataset, dns_name_t *name, dns_rdatatype_t covers, dns_rdataset_t *rdataset); /*%< * Similar to dns_ncache_getrdataset() but get the rrsig that matches. */ void dns_ncache_current(dns_rdataset_t *ncacherdataset, dns_name_t *found, dns_rdataset_t *rdataset); /*%< * Extract the current rdataset and name from a ncache entry. * * Requires: * \li 'ncacherdataset' to be valid and to be a negative cache entry * \li 'found' to be valid. * \li 'rdataset' to be unassociated. */ ISC_LANG_ENDDECLS #endif /* DNS_NCACHE_H */
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
acache.h | File | 13.99 KB | 0644 |
|
acl.h | File | 7.1 KB | 0644 |
|
adb.h | File | 22.03 KB | 0644 |
|
badcache.h | File | 3.28 KB | 0644 |
|
bit.h | File | 856 B | 0644 |
|
byaddr.h | File | 3.89 KB | 0644 |
|
cache.h | File | 7.95 KB | 0644 |
|
callbacks.h | File | 2.22 KB | 0644 |
|
catz.h | File | 11.54 KB | 0644 |
|
cert.h | File | 1.43 KB | 0644 |
|
client.h | File | 21.52 KB | 0644 |
|
clientinfo.h | File | 1.95 KB | 0644 |
|
compress.h | File | 6.51 KB | 0644 |
|
db.h | File | 44.68 KB | 0644 |
|
dbiterator.h | File | 7.26 KB | 0644 |
|
dbtable.h | File | 3.09 KB | 0644 |
|
diff.h | File | 6.82 KB | 0644 |
|
dispatch.h | File | 16.05 KB | 0644 |
|
dlz.h | File | 10.38 KB | 0644 |
|
dlz_dlopen.h | File | 4.54 KB | 0644 |
|
dns64.h | File | 5.51 KB | 0644 |
|
dnssec.h | File | 12 KB | 0644 |
|
dnstap.h | File | 9.2 KB | 0644 |
|
ds.h | File | 1.19 KB | 0644 |
|
dsdigest.h | File | 1.68 KB | 0644 |
|
dyndb.h | File | 4.72 KB | 0644 |
|
ecdb.h | File | 808 B | 0644 |
|
edns.h | File | 721 B | 0644 |
|
enumclass.h | File | 1.19 KB | 0644 |
|
enumtype.h | File | 7.74 KB | 0644 |
|
events.h | File | 3.96 KB | 0644 |
|
fixedname.h | File | 1.56 KB | 0644 |
|
forward.h | File | 3.37 KB | 0644 |
|
geoip.h | File | 2.34 KB | 0644 |
|
ipkeylist.h | File | 2.12 KB | 0644 |
|
iptable.h | File | 1.6 KB | 0644 |
|
journal.h | File | 8.05 KB | 0644 |
|
keydata.h | File | 1.02 KB | 0644 |
|
keyflags.h | File | 1.25 KB | 0644 |
|
keytable.h | File | 9.28 KB | 0644 |
|
keyvalues.h | File | 4.06 KB | 0644 |
|
lib.h | File | 1.16 KB | 0644 |
|
log.h | File | 3.87 KB | 0644 |
|
lookup.h | File | 2.85 KB | 0644 |
|
master.h | File | 11.08 KB | 0644 |
|
masterdump.h | File | 12.35 KB | 0644 |
|
message.h | File | 37.27 KB | 0644 |
|
name.h | File | 36.49 KB | 0644 |
|
ncache.h | File | 4.8 KB | 0644 |
|
nsec.h | File | 2.88 KB | 0644 |
|
nsec3.h | File | 8.17 KB | 0644 |
|
nta.h | File | 4.32 KB | 0644 |
|
opcode.h | File | 1006 B | 0644 |
|
order.h | File | 1.95 KB | 0644 |
|
peer.h | File | 6.06 KB | 0644 |
|
portlist.h | File | 2.05 KB | 0644 |
|
private.h | File | 1.9 KB | 0644 |
|
rbt.h | File | 39.7 KB | 0644 |
|
rcode.h | File | 2.42 KB | 0644 |
|
rdata.h | File | 20.92 KB | 0644 |
|
rdataclass.h | File | 2.2 KB | 0644 |
|
rdatalist.h | File | 2.51 KB | 0644 |
|
rdataset.h | File | 20.47 KB | 0644 |
|
rdatasetiter.h | File | 3.83 KB | 0644 |
|
rdataslab.h | File | 4.29 KB | 0644 |
|
rdatastruct.h | File | 57.57 KB | 0644 |
|
rdatatype.h | File | 2.24 KB | 0644 |
|
request.h | File | 10.89 KB | 0644 |
|
resolver.h | File | 18.63 KB | 0644 |
|
result.h | File | 8.57 KB | 0644 |
|
rootns.h | File | 891 B | 0644 |
|
rpz.h | File | 10.09 KB | 0644 |
|
rriterator.h | File | 4.17 KB | 0644 |
|
rrl.h | File | 6.49 KB | 0644 |
|
sdb.h | File | 7.04 KB | 0644 |
|
sdlz.h | File | 13.87 KB | 0644 |
|
secalg.h | File | 1.67 KB | 0644 |
|
secproto.h | File | 1.52 KB | 0644 |
|
soa.h | File | 2.17 KB | 0644 |
|
ssu.h | File | 8.09 KB | 0644 |
|
stats.h | File | 13.15 KB | 0644 |
|
tcpmsg.h | File | 3.05 KB | 0644 |
|
time.h | File | 1.66 KB | 0644 |
|
timer.h | File | 1.02 KB | 0644 |
|
tkey.h | File | 7.43 KB | 0644 |
|
tsec.h | File | 2.88 KB | 0644 |
|
tsig.h | File | 8.06 KB | 0644 |
|
ttl.h | File | 1.93 KB | 0644 |
|
types.h | File | 13.65 KB | 0644 |
|
update.h | File | 1.61 KB | 0644 |
|
validator.h | File | 7.02 KB | 0644 |
|
version.h | File | 867 B | 0644 |
|
view.h | File | 34.69 KB | 0644 |
|
xfrin.h | File | 2.85 KB | 0644 |
|
zone.h | File | 59.8 KB | 0644 |
|
zonekey.h | File | 763 B | 0644 |
|
zt.h | File | 5.31 KB | 0644 |
|