|
Electroneum
|
#include <packed_rrset.h>

Public Attributes | |
| time_t | ttl |
| size_t | count |
| size_t | rrsig_count |
| enum rrset_trust | trust |
| enum sec_status | security |
| size_t * | rr_len |
| time_t * | rr_ttl |
| uint8_t ** | rr_data |
RRset data.
The data is packed, stored contiguously in memory.
It is not always stored contiguously, in that case, an unpacked-packed rrset has the arrays separate. A bunch of routines work on that, but the packed rrset that is contiguous is for the rrset-cache and the cache-response routines in daemon/worker.c.
memory layout: o base struct o rr_len size_t array o rr_data uint8_t* array o rr_ttl time_t array (after size_t and ptrs because those may be 64bit and this array before those would make them unaligned). Since the stuff before is 32/64bit, rr_ttl is 32 bit aligned. o rr_data rdata wireformats o rrsig_data rdata wireformat(s)
Rdata is stored in wireformat. The dname is stored in wireformat. TTLs are stored as absolute values (and could be expired).
RRSIGs are stored in the arrays after the regular rrs.
You need the packed_rrset_key to know dname, type, class of the resource records in this RRset. (if signed the rrsig gives the type too).
On the wire an RR is: name, type, class, ttl, rdlength, rdata. So we need to send the following per RR: key.dname, ttl, rr_data[i]. since key.dname ends with type and class. and rr_data starts with the rdlength. the ttl value to send changes due to time.
Definition at line 235 of file packed_rrset.h.
| size_t packed_rrset_data::count |
number of rrs.
Definition at line 240 of file packed_rrset.h.
| uint8_t** packed_rrset_data::rr_data |
Array of pointers to every rr's rdata. The rr_data[i] rdata is stored in uncompressed wireformat. The first uint16_t of rr_data[i] is network format rdlength.
rr_data[count] to rr_data[count+rrsig_count] contain the rrsig data.
Definition at line 258 of file packed_rrset.h.
| size_t* packed_rrset_data::rr_len |
length of every rr's rdata, rr_len[i] is size of rr_data[i].
Definition at line 248 of file packed_rrset.h.
| time_t* packed_rrset_data::rr_ttl |
ttl of every rr. rr_ttl[i] ttl of rr i.
Definition at line 250 of file packed_rrset.h.
| size_t packed_rrset_data::rrsig_count |
number of rrsigs, if 0 no rrsigs
Definition at line 242 of file packed_rrset.h.
| enum sec_status packed_rrset_data::security |
security status of the rrset data
Definition at line 246 of file packed_rrset.h.
| enum rrset_trust packed_rrset_data::trust |
the trustworthiness of the rrset data
Definition at line 244 of file packed_rrset.h.
| time_t packed_rrset_data::ttl |
TTL (in seconds like time()) of the rrset. Same for all RRs see rfc2181(5.2).
Definition at line 238 of file packed_rrset.h.