ncache.h File Reference

DNS Ncache. More...

#include <isc/lang.h>
#include <isc/stdtime.h>
#include <dns/types.h>

Go to the source code of this file.

Defines

#define DNS_NCACHE_H   1
#define DNS_NCACHETOWIRE_OMITDNSSEC   0x0001
 _OMITDNSSEC: Omit DNSSEC records when rendering.

Functions

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'.
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'.
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.
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.


Detailed Description

DNS Ncache.

XXX TBS XXX

MP:

Reliability: Resources: Security: Standards:

Definition in file ncache.h.


Define Documentation

#define DNS_NCACHE_H   1

Definition at line 21 of file ncache.h.

#define DNS_NCACHETOWIRE_OMITDNSSEC   0x0001

_OMITDNSSEC: Omit DNSSEC records when rendering.

Definition at line 60 of file ncache.h.

Referenced by dns_ncache_towire(), and towiresorted().


Function Documentation

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 
)

Definition at line 101 of file ncache.c.

References addoptout(), and ISC_FALSE.

Referenced by ncache_adderesult().

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'.

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:

Requires: Returns:

Definition at line 110 of file ncache.c.

References addoptout(), and ISC_TRUE.

Referenced by ncache_adderesult().

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:

Requires: Ensures: Returns:

Definition at line 273 of file ncache.c.

References dns_rdataset::attributes, isc_region::base, dns_rdata::data, DNS_COMPRESS_GLOBAL14, dns_compress_rollback(), dns_compress_setmethods(), dns_name_fromregion(), dns_name_init(), dns_name_towire(), DNS_NCACHETOWIRE_OMITDNSSEC, DNS_RDATA_INIT, dns_rdata_reset(), dns_rdata_towire(), dns_rdataset_current(), dns_rdataset_first(), dns_rdataset_next(), DNS_RDATASETATTR_NEGATIVE, dns_rdatatype_isdnssec(), INSIST, isc_buffer_add, isc_buffer_availableregion, isc_buffer_forward, isc_buffer_getuint16(), isc_buffer_init, isc_buffer_putuint16, isc_buffer_putuint32, isc_buffer_remaininglength, isc_buffer_remainingregion, ISC_R_NOMORE, ISC_R_NOSPACE, ISC_R_SUCCESS, dns_name::length, isc_region::length, dns_rdata::length, name, dns_rdataset::rdclass, dns_rdata::rdclass, REQUIRE, dns_rdataset::ttl, dns_rdata::type, dns_rdataset::type, and isc_buffer::used.

Referenced by towiresorted().

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:

Ensures: Returns:

Definition at line 511 of file ncache.c.

References dns_rdataset::attributes, isc_region::base, dns_rdataset::covers, dns_rdata::data, dns_name_equal(), dns_name_fromregion(), dns_name_init(), DNS_RDATA_INIT, dns_rdata_reset(), dns_rdataset_clone(), dns_rdataset_current(), dns_rdataset_disassociate(), dns_rdataset_first(), dns_rdataset_init(), dns_rdataset_isassociated(), dns_rdataset_next(), DNS_RDATASETATTR_NEGATIVE, dns_trust_none, dns_trust_ultimate, INSIST, isc_buffer_add, isc_buffer_forward, isc_buffer_getuint16(), isc_buffer_getuint8(), isc_buffer_init, isc_buffer_remainingregion, ISC_R_NOMORE, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_name::length, isc_region::length, dns_rdata::length, dns_rdataset::methods, dns_rdataset::private1, dns_rdataset::private2, dns_rdataset::private3, dns_rdataset::private5, dns_rdataset::private6, dns_rdataset::privateuint4, dns_rdataset::rdclass, REQUIRE, dns_rdataset::trust, dns_rdataset::ttl, and dns_rdataset::type.

Referenced by isdelegation(), and warn_rfc1918().

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.

Definition at line 585 of file ncache.c.

References dns_rdataset::attributes, isc_region::base, dns_rdataset::covers, dns_rdata::data, dns_name_equal(), dns_name_fromregion(), dns_name_init(), dns_rdata_fromregion(), DNS_RDATA_INIT, dns_rdata_reset(), dns_rdata_tostruct(), dns_rdataset_clone(), dns_rdataset_current(), dns_rdataset_disassociate(), dns_rdataset_first(), dns_rdataset_init(), dns_rdataset_isassociated(), dns_rdataset_next(), DNS_RDATASETATTR_NEGATIVE, dns_trust_none, dns_trust_ultimate, INSIST, isc_buffer_add, isc_buffer_forward, isc_buffer_getuint16(), isc_buffer_getuint8(), isc_buffer_init, isc_buffer_remainingregion, ISC_R_NOMORE, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_name::length, isc_region::length, dns_rdata::length, dns_rdataset::methods, dns_rdataset::private1, dns_rdataset::private2, dns_rdataset::private3, dns_rdataset::private5, dns_rdataset::private6, dns_rdataset::privateuint4, dns_rdataset::rdclass, REQUIRE, dns_rdataset::trust, dns_rdataset::ttl, and dns_rdataset::type.

Referenced by validate_ncache().

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:

Definition at line 687 of file ncache.c.

References dns_rdataset::attributes, isc_region::base, dns_rdataset::covers, dns_rdata::data, dns_name_fromregion(), dns_name_init(), dns_rdata_fromregion(), DNS_RDATA_INIT, dns_rdata_reset(), dns_rdata_tostruct(), dns_rdataset_current(), dns_rdataset_isassociated(), DNS_RDATASETATTR_NEGATIVE, dns_trust_ultimate, INSIST, isc_buffer_add, isc_buffer_forward, isc_buffer_getuint16(), isc_buffer_getuint8(), isc_buffer_init, isc_buffer_remainingregion, dns_name::length, isc_region::length, dns_rdata::length, dns_rdataset::methods, dns_rdataset::private1, dns_rdataset::private2, dns_rdataset::private3, dns_rdataset::private5, dns_rdataset::private6, dns_rdataset::privateuint4, dns_rdataset::rdclass, REQUIRE, dns_rdataset::trust, dns_rdataset::ttl, and dns_rdataset::type.

Referenced by isdelegation(), ncache_summary(), query_find(), redirect(), redirect2(), rpz_ck_dnssec(), val_rdataset_first(), val_rdataset_next(), and validate_ncache().


Generated on Tue Apr 28 17:41:09 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha