Electroneum
reply_info Struct Reference

#include <msgreply.h>

Collaboration diagram for reply_info:

Public Attributes

uint16_t flags
 
uint8_t authoritative
 
uint8_t qdcount
 
uint32_t padding
 
time_t ttl
 
time_t prefetch_ttl
 
enum sec_status security
 
size_t an_numrrsets
 
size_t ns_numrrsets
 
size_t ar_numrrsets
 
size_t rrset_count
 
struct ub_packed_rrset_key ** rrsets
 
struct rrset_ref ref [1]
 

Detailed Description

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.

Definition at line 125 of file msgreply.h.

Member Data Documentation

◆ an_numrrsets

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.

Definition at line 170 of file msgreply.h.

◆ ar_numrrsets

size_t reply_info::ar_numrrsets

Count of additional section RRsets

Definition at line 175 of file msgreply.h.

◆ authoritative

uint8_t reply_info::authoritative

This flag informs unbound the answer is authoritative and the AA flag should be preserved.

Definition at line 133 of file msgreply.h.

◆ flags

uint16_t reply_info::flags

the flags for the answer, host byte order.

Definition at line 127 of file msgreply.h.

◆ ns_numrrsets

size_t reply_info::ns_numrrsets

Count of authority section RRsets

Definition at line 173 of file msgreply.h.

◆ padding

uint32_t reply_info::padding

32 bit padding to pad struct member alignment to 64 bits.

Definition at line 144 of file msgreply.h.

◆ prefetch_ttl

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

Definition at line 157 of file msgreply.h.

◆ qdcount

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.

Definition at line 141 of file msgreply.h.

◆ ref

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.

Definition at line 205 of file msgreply.h.

◆ rrset_count

size_t reply_info::rrset_count

number of RRsets: an_numrrsets + ns_numrrsets + ar_numrrsets

Definition at line 178 of file msgreply.h.

◆ rrsets

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.

Definition at line 187 of file msgreply.h.

◆ security

enum sec_status reply_info::security

The security status from DNSSEC validation of this message.

Definition at line 162 of file msgreply.h.

◆ ttl

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

Definition at line 151 of file msgreply.h.


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