unbound: packed_rrset_data Struct Reference

unbound 0.1

Data Fields
packed_rrset_data Struct Reference

RRset data. More...

`#include <packed_rrset.h>`

## Data Fields
time_t | ttl_add
| Timestamp added to TTLs in the packed data.
time_t | ttl
| TTL (in seconds like time()) of the rrset.
size_t | count
| number of rrs.
size_t | rrsig_count
| number of rrsigs, if 0 no rrsigs
enum rrset_trust | trust
| the trustworthiness of the rrset data
enum sec_status | security
| security status of the rrset data
size_t * | rr_len
| length of every rr's rdata, rr_len[i] is size of rr_data[i].
time_t * | rr_ttl
| ttl of every rr.
uint8_t ** | rr_data
| Array of pointers to every rr's rdata.

## Detailed Description

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.

## Field Documentation

## ◆ ttl_add

time_t packed_rrset_data::ttl_add

Timestamp added to TTLs in the packed data.

Needed to support serving original TTLs.

Referenced by packed_rr_to_string(), packed_rrset_copy_region(), packed_rrset_encode(), packed_rrset_ttl_add(), reply_info_absolute_ttls(), reply_info_set_ttls(), rrset_cache_lookup(), and rrset_update_sec_status().

## ◆ ttl

time_t packed_rrset_data::ttl

TTL (in seconds like time()) of the rrset.

Same for all RRs see rfc2181(5.2).

Referenced by addr_to_additional(), adjust_ttl(), az_add_negative_soa(), bogus_del_rrset(), create_synth_cname(), dns_msg_ansadd(), dns_msg_authadd(), dump_rrset(), fill_res(), find_add_ds(), get_rrset_ttl(), invalidateQueryInCache(), iter_store_parentside_neg(), key_entry_create_rrset(), key_ttl(), limit_nsec_ttl(), load_rrset(), local_data_answer(), local_data_find_tag_datas(), local_zone_enter_rr(), local_zones_zone_answer(), lz_enter_rr_into_zone(), need_to_update_rrset(), negative_del_rrset(), packed_rrset_copy_region(), packed_rrset_heap_data(), packed_rrset_ttl_add(), parse_copy_decompress(), parse_copy_decompress_rrset(), parse_rr_copy(), rdata_copy(), reply_info_absolute_ttls(), reply_info_set_ttls(), rrset_add_rr(), rrset_array_lock(), rrset_cache_expired_above(), rrset_cache_lookup(), rrset_cache_remove_above(), rrset_canonical_equal(), rrset_check_sec_status(), rrset_create(), rrset_get_ttl(), rrset_get_ttl(), rrset_insert_rr(), rrset_moveover_rrsigs(), rrset_msg(), rrset_remove_rr(), rrset_update_sec_status(), store_rrsets(), synth_dname_msg(), tomsg(), ub_packed_rrset_ttl(), val_find_DS(), and zone_del_rrset().

## ◆ rr_ttl

time_t* packed_rrset_data::rr_ttl

ttl of every rr.

rr_ttl[i] ttl of rr i.

Referenced by add_item(), add_rrlist_rrsigs_into_data(), assemble_it(), assembled_rrset_delete(), auth_rr_to_string(), az_add_negative_soa(), create_synth_cname(), invalidateQueryInCache(), iter_store_parentside_neg(), load_rr(), load_rrset(), local_data_answer(), local_data_find_tag_datas(), local_rrset_remove_rr(), local_zones_zone_answer(), mesh_state_add_reply(), move_into_cache(), need_to_update_rrset(), new_cname_override(), packed_rr_to_string(), packed_rrset_copy_region(), packed_rrset_encode(), packed_rrset_heap_data(), packed_rrset_ptr_fixup(), packed_rrset_ttl_add(), parse_rr_copy(), reply_info_absolute_ttls(), reply_info_set_ttls(), respip_copy_rrset(), rpz_local_encode(), rrset_add_rr(), rrset_canonicalize_to_buffer(), rrset_check_sec_status(), rrset_create(), rrset_insert_rr(), rrset_moveover_rrsigs(), rrset_remove_rr(), rrset_update_sec_status(), rrsigs_copy_from_rrset_to_rrsigset(), synth_dname_msg(), update_events(), and zonemd_simple_rrsig_allocs().

## ◆ rr_data

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.

Referenced by add_item(), add_rrlist_rrsigs_into_data(), assemble_it(), assembled_rrset_delete(), auth_rr_to_string(), auth_zone_get_serial(), az_add_additionals_from(), az_add_negative_soa(), az_nsec3_param(), az_rrset_find_rrsig(), canonical_compare(), canonical_compare_byfield(), check_contains_revoked(), create_synth_cname(), delegpt_add_rrset_A(), delegpt_add_rrset_AAAA(), delegpt_rrset_add_ns(), dnskey_get_keysize(), fill_res(), follow_cname_chain(), get_cname_target(), iter_store_parentside_neg(), kd_get_flags(), load_rr(), load_rrset(), local_alias_shallow_copy_qname(), local_data_answer(), local_data_find_tag_datas(), local_rrset_remove_rr(), local_zones_zone_answer(), mesh_state_add_reply(), min_expiry(), move_into_cache(), new_cname_override(), nsec3_get_algo(), nsec3_get_iter(), nsec3_get_nextowner(), nsec3_get_salt(), nsec3_has_optout(), nsec3_has_type(), nsec3_known_algo(), nsec3_unknown_flags(), nsec_get_next(), nsec_has_type(), packed_rr_to_string(), packed_rrset_encode(), packed_rrset_find_rr(), packed_rrset_heap_data(), packed_rrset_ptr_fixup(), packed_rrset_sizeof(), parse_rr_copy(), rdata2sockaddr(), rdata_duplicate(), respip_copy_rrset(), rr_is_duplicate(), rrset_add_rr(), rrset_canonical(), rrset_canonical_equal(), rrset_canonicalize_to_buffer(), rrset_create(), rrset_equal(), rrset_get_rdata(), rrset_get_sig_algo(), rrset_get_sig_keytag(), rrset_has_signer(), rrset_insert_rr(), rrset_moveover_rrsigs(), rrset_remove_rr(), rrsetdata_equal(), rrsig_get_labcount(), rrsig_num_that_cover(), rrsigs_copy_from_rrset_to_rrsigset(), synth_dname_msg(), update_events(), val_find_best_signer(), val_find_rrset_signer(), wipeout(), xfr_find_soa(), xfr_master_add_addrs(), zonemd_fetch_parameters(), and zonemd_simple_rrsig_allocs().

The documentation for this struct was generated from the following file:

- util/data/packed_rrset.h