rdataslab.h File Reference

Implements storage of rdatasets into slabs of memory. More...

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

Go to the source code of this file.

Defines

#define DNS_RDATASLAB_H   1
#define DNS_RDATASLAB_FORCE   0x1
#define DNS_RDATASLAB_EXACT   0x2
#define DNS_RDATASLAB_OFFLINE   0x01
#define DNS_RDATASLAB_WARNMASK   0x0E
 RRSIG(DNSKEY) expired warnings number mask.
#define DNS_RDATASLAB_WARNSHIFT   1
 How many bits to shift to find remaining expired warning number.

Functions

isc_result_t dns_rdataslab_fromrdataset (dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region, unsigned int reservelen)
 Slabify a rdataset. The slab area will be allocated and returned in 'region'.
void dns_rdataslab_tordataset (unsigned char *slab, unsigned int reservelen, dns_rdataclass_t rdclass, dns_rdatatype_t rdtype, dns_rdatatype_t covers, dns_ttl_t ttl, dns_rdataset_t *rdataset)
 Construct an rdataset from a slab.
unsigned int dns_rdataslab_size (unsigned char *slab, unsigned int reservelen)
 Return the total size of an rdataslab.
isc_result_t dns_rdataslab_merge (unsigned char *oslab, unsigned char *nslab, unsigned int reservelen, isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_rdatatype_t type, unsigned int flags, unsigned char **tslabp)
 Merge 'oslab' and 'nslab'.
isc_result_t dns_rdataslab_subtract (unsigned char *mslab, unsigned char *sslab, unsigned int reservelen, isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_rdatatype_t type, unsigned int flags, unsigned char **tslabp)
 Subtract 'sslab' from 'mslab'. If 'exact' is true then all elements of 'sslab' must exist in 'mslab'.
isc_boolean_t dns_rdataslab_equal (unsigned char *slab1, unsigned char *slab2, unsigned int reservelen)
 Compare two rdataslabs for equality. This does _not_ do a full DNSSEC comparison.
isc_boolean_t dns_rdataslab_equalx (unsigned char *slab1, unsigned char *slab2, unsigned int reservelen, dns_rdataclass_t rdclass, dns_rdatatype_t type)
 Compare two rdataslabs for DNSSEC equality.


Detailed Description

Implements storage of rdatasets into slabs of memory.

MP:

Reliability: Resources: Security: Standards:

Definition in file rdataslab.h.


Define Documentation

#define DNS_RDATASLAB_H   1

Definition at line 21 of file rdataslab.h.

#define DNS_RDATASLAB_FORCE   0x1

Definition at line 57 of file rdataslab.h.

Referenced by add32(), and dns_rdataslab_merge().

#define DNS_RDATASLAB_EXACT   0x2

Definition at line 58 of file rdataslab.h.

Referenced by add32(), dns_rdataslab_merge(), dns_rdataslab_subtract(), and subtractrdataset().

#define DNS_RDATASLAB_OFFLINE   0x01

Definition at line 60 of file rdataslab.h.

Referenced by dns_rdataslab_fromrdataset(), rdata_from_slab(), and rdataset_current().

#define DNS_RDATASLAB_WARNMASK   0x0E

RRSIG(DNSKEY) expired warnings number mask.

Definition at line 61 of file rdataslab.h.

#define DNS_RDATASLAB_WARNSHIFT   1

How many bits to shift to find remaining expired warning number.

Definition at line 63 of file rdataslab.h.


Function Documentation

isc_result_t dns_rdataslab_fromrdataset ( dns_rdataset_t rdataset,
isc_mem_t mctx,
isc_region_t region,
unsigned int  reservelen 
)

Slabify a rdataset. The slab area will be allocated and returned in 'region'.

Requires:

Ensures: Returns:

Definition at line 126 of file rdataslab.c.

References isc_region::base, compare_rdata(), dns_rdata::data, DNS_R_SINGLETON, dns_rdata_init(), DNS_RDATA_OFFLINE, dns_rdataset_count(), dns_rdataset_current(), dns_rdataset_first(), dns_rdataset_next(), DNS_RDATASLAB_OFFLINE, dns_rdatatype_issingleton(), INSIST, isc_mem_get, isc_mem_put, ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_NOMORE, ISC_R_NOSPACE, ISC_R_SUCCESS, dns_rdata::length, isc_region::length, xrdata::order, xrdata::rdata, removed(), and dns_rdataset::type.

Referenced by addclosest(), addnoqname(), addrdataset(), loading_addrdataset(), and subtractrdataset().

void dns_rdataslab_tordataset ( unsigned char *  slab,
unsigned int  reservelen,
dns_rdataclass_t  rdclass,
dns_rdatatype_t  rdtype,
dns_rdatatype_t  covers,
dns_ttl_t  ttl,
dns_rdataset_t rdataset 
)

Construct an rdataset from a slab.

Requires:

Ensures:

Definition at line 476 of file rdataslab.c.

References dns_rdataset::covers, dns_rdataset_isassociated(), dns_rdataset::methods, dns_rdataset::private1, dns_rdataset::private2, dns_rdataset::private3, dns_rdataset::private5, dns_rdataset::privateuint4, dns_rdataset::rdclass, REQUIRE, dns_rdataset::trust, dns_rdataset::ttl, and dns_rdataset::type.

unsigned int dns_rdataslab_size ( unsigned char *  slab,
unsigned int  reservelen 
)

Return the total size of an rdataslab.

Requires:

Returns:

Definition at line 502 of file rdataslab.c.

References REQUIRE.

Referenced by destroynode(), free_noqname(), free_rdataset(), rbt_datafixer(), and rbt_datawriter().

isc_result_t dns_rdataslab_merge ( unsigned char *  oslab,
unsigned char *  nslab,
unsigned int  reservelen,
isc_mem_t mctx,
dns_rdataclass_t  rdclass,
dns_rdatatype_t  type,
unsigned int  flags,
unsigned char **  tslabp 
)

Merge 'oslab' and 'nslab'.

Definition at line 602 of file rdataslab.c.

References compare_rdata(), dns_rdata::data, DNS_R_NOTEXACT, DNS_R_SINGLETON, DNS_R_UNCHANGED, dns_rdata_init(), DNS_RDATA_INIT, dns_rdata_reset(), DNS_RDATASLAB_EXACT, DNS_RDATASLAB_FORCE, dns_rdatatype_issingleton(), INSIST, ISC_FALSE, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_NOSPACE, ISC_R_SUCCESS, ISC_TF, ISC_TRUE, dns_rdata::length, rdata_from_slab(), rdata_in_slab(), and REQUIRE.

Referenced by add32().

isc_result_t dns_rdataslab_subtract ( unsigned char *  mslab,
unsigned char *  sslab,
unsigned int  reservelen,
isc_mem_t mctx,
dns_rdataclass_t  rdclass,
dns_rdatatype_t  type,
unsigned int  flags,
unsigned char **  tslabp 
)

Subtract 'sslab' from 'mslab'. If 'exact' is true then all elements of 'sslab' must exist in 'mslab'.

XXX valid flags are DNS_RDATASLAB_EXACT

Definition at line 870 of file rdataslab.c.

References DNS_R_NOTEXACT, DNS_R_NXRRSET, DNS_R_UNCHANGED, dns_rdata_compare(), DNS_RDATA_INIT, dns_rdata_reset(), DNS_RDATASLAB_EXACT, INSIST, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, xrdata::order, rdata_from_slab(), and REQUIRE.

Referenced by subtractrdataset().

isc_boolean_t dns_rdataslab_equal ( unsigned char *  slab1,
unsigned char *  slab2,
unsigned int  reservelen 
)

Compare two rdataslabs for equality. This does _not_ do a full DNSSEC comparison.

Requires:

Returns:

Definition at line 1044 of file rdataslab.c.

References ISC_FALSE, and ISC_TRUE.

Referenced by add32().

isc_boolean_t dns_rdataslab_equalx ( unsigned char *  slab1,
unsigned char *  slab2,
unsigned int  reservelen,
dns_rdataclass_t  rdclass,
dns_rdatatype_t  type 
)

Compare two rdataslabs for DNSSEC equality.

Requires:

Returns:

Definition at line 1092 of file rdataslab.c.

References dns_rdata_compare(), DNS_RDATA_INIT, dns_rdata_reset(), ISC_FALSE, ISC_TRUE, and rdata_from_slab().

Referenced by add32().


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