unbound 0.1
|
Structure to store DNS query and the reply packet. More...
#include <msgreply.h>
Data Fields | |
uint16_t | flags |
the flags for the answer, host byte order. | |
uint8_t | authoritative |
This flag informs unbound the answer is authoritative and the AA flag should be preserved. | |
uint8_t | qdcount |
Number of RRs in the query section. | |
uint32_t | ttl |
TTL of the entire reply (for negative caching). | |
uint32_t | prefetch_ttl |
TTL for prefetch. | |
uint32_t | padding |
32 bit padding to pad struct member alignment to 64 bits. | |
enum sec_status | security |
The security status from DNSSEC validation of this message. | |
size_t | an_numrrsets |
Number of RRsets in each section. | |
size_t | ns_numrrsets |
Count of authority section RRsets. | |
size_t | ar_numrrsets |
Count of additional section RRsets. | |
size_t | rrset_count |
number of RRsets: an_numrrsets + ns_numrrsets + ar_numrrsets | |
struct ub_packed_rrset_key ** | rrsets |
List of pointers (only) to the rrsets in the order in which they appear in the reply message. | |
struct rrset_ref | ref [1] |
Packed array of ids (see counts) and pointers to packed_rrset_key. |
Structure to store DNS query and the reply packet.
To use it, copy over the flags from reply and modify using flags from the query (RD,CD if not AA). prepend ID.
Memory layout is: o struct o rrset_ref array o packed_rrset_key* array.
Memory layout is sometimes not packed, when the message is synthesized, for easy of the generation. It is allocated packed when it is copied from the region allocation to the malloc allocation.
uint16_t reply_info::flags |
the flags for the answer, host byte order.
Referenced by construct_reply_info_base(), delegpt_add_neg_msg(), dns_cache_lookup(), dns_cache_store(), dns_msg_create(), ds_response_to_ke(), dump_msg(), error_response_cache(), libworker_enter_result(), load_msg(), local_encode(), log_dns_msg(), needs_validation(), perftestpkt(), process_dlv_response(), processClassResponse(), processFinished(), processPrimeResponse(), processQueryResponse(), reply_equal(), reply_info_answer_encode(), reply_info_copy(), response_type_from_cache(), response_type_from_server(), rrset_msg(), synth_dname_msg(), testpkt(), tomsg(), val_classify_response(), val_new_getmsg(), and val_nsec_check_dlv().
uint8_t reply_info::qdcount |
Number of RRs in the query section.
If qdcount is not 0, then it is 1, and the data that appears in the reply is the same as the query_info. Host byte order.
Referenced by construct_reply_info_base(), dns_msg_create(), dump_msg(), error_response_cache(), load_msg(), local_encode(), processClassResponse(), reply_equal(), reply_info_copy(), reply_info_encode(), rrset_msg(), synth_dname_msg(), tomsg(), and val_new_getmsg().
uint32_t reply_info::ttl |
TTL of the entire reply (for negative caching).
only for use when there are 0 RRsets in this message. if there are RRsets, check those instead.
Referenced by answer_from_cache(), construct_reply_info_base(), dns_cache_store_msg(), dump_msg(), error_response_cache(), invalidateQueryInCache(), load_msg(), parse_copy_decompress(), processClassResponse(), processFinished(), processInitRequest(), reply_equal(), reply_info_copy(), reply_info_set_ttls(), rrset_msg(), synth_dname_msg(), tomsg(), and zone_del_msg().
uint32_t reply_info::prefetch_ttl |
TTL for prefetch.
After it has expired, a prefetch is suitable. Smaller than the TTL, otherwise the prefetch would not happen.
Referenced by construct_reply_info_base(), error_response_cache(), load_msg(), parse_copy_decompress(), processClassResponse(), processFinished(), processInitRequest(), reply_equal(), reply_info_copy(), reply_info_set_ttls(), rrset_msg(), synth_dname_msg(), and tomsg().
uint32_t reply_info::padding |
32 bit padding to pad struct member alignment to 64 bits.
size_t reply_info::an_numrrsets |
Number of RRsets in each section.
The answer section. Add up the RRs in every RRset to calculate the number of RRs, and the count for the dns packet. The number of RRs in RRsets can change due to RRset updates.
Referenced by answer_from_cache(), calc_data_need(), check_delegation_secure(), construct_reply_info_base(), deleg_remove_nonsecure_additional(), delegpt_add_neg_msg(), delegpt_from_message(), detect_wrongly_truncated(), ds_response_to_ke(), dump_msg(), extract_keys(), handle_cname_response(), iter_msg_from_zone(), iter_msg_has_dnssec(), iter_prepend(), iter_scrub_ds(), load_msg(), local_encode(), needs_validation(), print_packet_rrsets(), process_dlv_response(), processClassResponse(), processFinished(), processQueryResponse(), processValidate(), reply_check_cname_chain(), reply_equal(), reply_find_answer_rrset(), reply_find_final_cname_target(), reply_find_rrset_section_an(), reply_find_rrset_section_ns(), reply_find_soa(), reply_has_nsec(), reply_info_copy(), reply_info_encode(), reply_nsec_signer(), response_type_from_cache(), response_type_from_server(), rrset_msg(), synth_dname_msg(), tomsg(), val_chase_cname(), val_check_nonsecure(), val_classify_response(), val_fill_reply(), val_find_DS(), val_find_signer(), val_has_signed_nsecs(), val_neg_addreferral(), val_neg_addreply(), val_nsec_check_dlv(), val_nsec_prove_nodata_dsreply(), validate_any_response(), validate_cname_noanswer_response(), validate_cname_response(), validate_msg_signatures(), validate_nameerror_response(), validate_nodata_response(), and validate_positive_response().
struct ub_packed_rrset_key** reply_info::rrsets |
List of pointers (only) to the rrsets in the order in which they appear in the reply message.
Number of elements is ancount+nscount+arcount RRsets. This is a pointer to that array. Use the accessor function for access.
Referenced by addr_to_additional(), answer_from_cache(), calc_data_need(), check_delegation_secure(), check_the_rrsigs(), construct_reply_info_base(), deleg_remove_nonsecure_additional(), delegpt_from_message(), detect_wrongly_truncated(), dns_cache_store(), dns_cache_store_msg(), dns_msg_authadd(), dns_msg_create(), ds_response_to_ke(), dump_msg(), extract_keys(), find_add_ds(), find_NS(), find_rrset_type(), gen_dns_msg(), handle_cname_response(), insert_section(), iter_msg_from_zone(), iter_msg_has_dnssec(), iter_prepend(), iter_scrub_ds(), iter_store_parentside_neg(), load_msg(), local_encode(), no_data_for_rrsig(), parse_copy_decompress(), print_dp_main(), print_packet_rrsets(), process_dlv_response(), processClassResponse(), processInit(), repinfo_alloc_rrset_keys(), repinfo_copy_rrsets(), reply_all_rrsets_secure(), reply_check_cname_chain(), reply_equal(), reply_find_answer_rrset(), reply_find_final_cname_target(), reply_find_rrset(), reply_find_rrset_section_an(), reply_find_rrset_section_ns(), reply_find_soa(), reply_get_NS_rrset(), reply_has_nsec(), reply_info_parsedelete(), reply_nsec_signer(), response_type_from_cache(), response_type_from_server(), rrset_msg(), store_rrsets(), synth_dname_msg(), tomsg(), val_chase_cname(), val_check_nonsecure(), val_classify_response(), val_fill_reply(), val_find_DS(), val_find_signer(), val_has_signed_nsecs(), val_mark_indeterminate(), val_mark_insecure(), val_neg_addreferral(), val_neg_addreply(), val_new_getmsg(), val_next_unchecked(), val_nsec_check_dlv(), val_nsec_prove_nodata_dsreply(), validate_any_response(), validate_cname_noanswer_response(), validate_cname_response(), validate_msg_signatures(), validate_nameerror_response(), validate_nodata_response(), validate_positive_response(), validate_referral_response(), and verifytest_entry().
struct rrset_ref reply_info::ref[1] |
Packed array of ids (see counts) and pointers to packed_rrset_key.
The number equals ancount+nscount+arcount RRsets. These are sorted in ascending pointer, the locking order. So this list can be locked (and id, ttl checked), to see if all the data is available and recent enough.
This is defined as an array of size 1, so that the compiler associates the identifier with this position in the structure. Array bound overflow on this array then gives access to the further elements of the array, which are allocated after the main structure.
It could be more pure to define as array of size 0, ref[0]. But ref[1] may be less confusing for compilers. Use the accessor function for access.
Referenced by answer_from_cache(), construct_reply_info_base(), dns_cache_store_msg(), dump_msg(), invalidateQueryInCache(), reply_info_set_ttls(), reply_info_sortref(), store_rrsets(), and tomsg().