iter_qstate Struct Reference

Per query state for the iterator module. More...

#include <iterator.h>

Data Fields

enum iter_state state
 State of the iterator module. More...
 
enum iter_state final_state
 Final state for the iterator module. More...
 
int depth
 The depth of this query, this means the depth of recursion. More...
 
struct dns_msgresponse
 The response.
 
struct iter_prep_listan_prepend_list
 This is a list of RRsets that must be prepended to the ANSWER section of a response before being sent upstream.
 
struct iter_prep_listan_prepend_last
 Last element of the prepend list.
 
struct iter_prep_listns_prepend_list
 This is the list of RRsets that must be prepended to the AUTHORITY section of the response before being sent upstream.
 
struct iter_prep_listns_prepend_last
 Last element of the authority prepend list.
 
struct query_info qchase
 query name used for chasing the results. More...
 
uint16_t chase_flags
 query flags to use when chasing the answer (i.e. More...
 
int chase_to_rd
 true if we set RD bit because of last resort recursion lame query
 
struct delegptdp
 This is the current delegation point for an in-progress query. More...
 
int caps_fallback
 state for 0x20 fallback when capsfail happens, 0 not a fallback
 
size_t caps_server
 state for capsfail: current server number to try
 
struct reply_infocaps_reply
 state for capsfail: stored query for comparisons. More...
 
struct dns_msgcaps_response
 
struct dns_msgdeleg_msg
 Current delegation message - returned for non-RD queries.
 
int num_target_queries
 number of outstanding target sub queries
 
int num_current_queries
 outstanding direct queries
 
int query_restart_count
 the number of times this query has been restarted.
 
int referral_count
 the number of times this query has followed a referral.
 
int sent_count
 number of queries fired off
 
int * target_count
 malloced-array shared with this query and its subqueries. More...
 
int dp_target_count
 number of target lookups per delegation point. More...
 
uint8_t ** nxns_dp
 Delegation point that triggered the NXNS fallback; shared with this query and its subqueries, count-referenced by the reference counter in target_count. More...
 
int ratelimit_ok
 if true, already tested for ratelimiting and passed the test
 
struct delegptstore_parent_NS
 The query must store NS records from referrals as parentside RRs Enabled once it hits resolution problems, to throttle retries. More...
 
int query_for_pside_glue
 The query is for parent-side glue(A or AAAA) for a nameserver. More...
 
struct ub_packed_rrset_keypside_glue
 the parent-side-glue element (NULL if none, its first match)
 
uint8_t * dsns_point
 If nonNULL we are walking upwards from DS query to find NS.
 
size_t dsns_point_len
 length of the dname in dsns_point
 
int dnssec_expected
 expected dnssec information for this iteration step. More...
 
int dnssec_lame_query
 We are expecting dnssec information, but we also know the server is DNSSEC lame. More...
 
int wait_priming_stub
 This is flag that, if true, means that this event is waiting for a stub priming query.
 
int refetch_glue
 This is a flag that, if true, means that this query is for (re)fetching glue from a zone. More...
 
int empty_nodata_found
 This flag detects that a completely empty nodata was received, already so that it is accepted later.
 
struct outbound_list outlist
 list of pending queries to authoritative servers.
 
enum minimisation_state minimisation_state
 QNAME minimisation state, RFC9156.
 
enum minimisation_state caps_minimisation_state
 State for capsfail: QNAME minimisation state for comparisons.
 
struct query_info qinfo_out
 The query info that is sent upstream. More...
 
int minimise_count
 Count number of QNAME minimisation iterations. More...
 
int timeout_count
 Count number of time-outs. More...
 
int auth_zone_response
 True if the current response is from auth_zone.
 
int auth_zone_avoid
 True if the auth_zones should not be consulted for the query.
 
int scrub_failures
 true if there have been scrubbing failures of reply packets
 
int parse_failures
 true if there have been parse failures of reply packets
 
union {
   struct in_addr   in
 
fail_addr
 a failure printout address for last received answer
 
int fail_addr_type
 which fail_addr, 0 is nothing, 4 or 6
 

Detailed Description

Per query state for the iterator module.

Field Documentation

◆ state

enum iter_state iter_qstate::state

State of the iterator module.

This is the state that event is in or should sent to – all requests should start with the INIT_REQUEST_STATE. All responses should start with QUERY_RESP_STATE. Subsequent processing of the event will change this state.

Referenced by generate_sub_request(), iter_handle(), iter_new(), next_state(), process_request(), and process_response().

◆ final_state

enum iter_state iter_qstate::final_state

Final state for the iterator module.

This is the state that responses should be routed to once the response is final. For externally initiated queries, this will be FINISHED_STATE, locally initiated queries will have different final states.

Referenced by final_state(), generate_sub_request(), iter_new(), and process_request().

◆ depth

int iter_qstate::depth

The depth of this query, this means the depth of recursion.

This address is needed for another query, which is an address needed for another query, etc. Original client query has depth 0.

Referenced by generate_a_aaaa_check(), generate_ns_check(), generate_sub_request(), iter_new(), and query_for_targets().

◆ qchase

struct query_info iter_qstate::qchase

◆ chase_flags

uint16_t iter_qstate::chase_flags

query flags to use when chasing the answer (i.e.

RD flag)

Referenced by forward_request(), generate_sub_request(), iter_new(), processInitRequest3(), processPrimeResponse(), and processQueryResponse().

◆ dp

struct delegpt* iter_qstate::dp

This is the current delegation point for an in-progress query.

This object retains state as to which delegation targets need to be (sub)queried for vs which ones have already been visited.

Referenced by auth_zone_delegpt(), errinf_reply(), forward_request(), generate_a_aaaa_check(), generate_dnskey_prefetch(), generate_ns_check(), generate_parentside_target_query(), iter_new(), prime_root(), prime_stub(), prime_supers(), process_response(), processDSNSFind(), processInitRequest2(), processInitRequest3(), processLastResort(), processPrimeResponse(), processQueryResponse(), and query_for_targets().

◆ caps_reply

struct reply_info* iter_qstate::caps_reply

state for capsfail: stored query for comparisons.

Can be NULL if no response had been seen prior to starting the fallback.

Referenced by process_response().

◆ target_count

int* iter_qstate::target_count

malloced-array shared with this query and its subqueries.

It keeps track of the defined enum target_count_variables counters.

Referenced by generate_sub_request(), iter_clear(), iter_new(), query_for_targets(), and target_count_create().

◆ dp_target_count

int iter_qstate::dp_target_count

number of target lookups per delegation point.

Reset to 0 after receiving referral answer. Not shared with subqueries.

Referenced by generate_sub_request(), iter_new(), and query_for_targets().

◆ nxns_dp

uint8_t** iter_qstate::nxns_dp

Delegation point that triggered the NXNS fallback; shared with this query and its subqueries, count-referenced by the reference counter in target_count.

This also marks the fallback activation.

Referenced by generate_sub_request(), iter_clear(), and target_count_create().

◆ store_parent_NS

struct delegpt* iter_qstate::store_parent_NS

The query must store NS records from referrals as parentside RRs Enabled once it hits resolution problems, to throttle retries.

If enabled it is the pointer to the old delegation point with the old retry counts for bad-nameserver-addresses.

◆ query_for_pside_glue

int iter_qstate::query_for_pside_glue

The query is for parent-side glue(A or AAAA) for a nameserver.

If the item is seen as glue in a referral, and pside_glue is NULL, then it is stored in pside_glue for later. If it was never seen, at the end, then a negative caching element must be created.
The (data or negative) RR cache element then throttles retries.

Referenced by generate_parentside_target_query(), and processFinished().

◆ dnssec_expected

int iter_qstate::dnssec_expected

expected dnssec information for this iteration step.

If dnssec rrsigs are expected and not given, the server is marked lame (dnssec-lame).

Referenced by generate_parentside_target_query(), iter_new(), prime_root(), processInitRequest3(), and processQueryResponse().

◆ dnssec_lame_query

int iter_qstate::dnssec_lame_query

We are expecting dnssec information, but we also know the server is DNSSEC lame.

The response need not be marked dnssec-lame again.

Referenced by iter_new(), and processQueryResponse().

◆ refetch_glue

int iter_qstate::refetch_glue

This is a flag that, if true, means that this query is for (re)fetching glue from a zone.

Since the address should have been glue, query again to the servers that should have been returning it as glue. The delegation point must be set to the one that should not be used when creating the state. A higher one will be attempted.

Referenced by forward_request(), generate_ns_check(), generate_parentside_target_query(), generate_sub_request(), iter_new(), and processInitRequest2().

◆ qinfo_out

struct query_info iter_qstate::qinfo_out

The query info that is sent upstream.

Will be a subset of qchase when qname minimisation is enabled.

Referenced by generate_sub_request(), iter_new(), and processQueryResponse().

◆ minimise_count

int iter_qstate::minimise_count

Count number of QNAME minimisation iterations.

Used to limit number of outgoing queries when QNAME minimisation is enabled.

Referenced by iter_new().

◆ timeout_count

int iter_qstate::timeout_count

Count number of time-outs.

Used to prevent resolving failures when the QNAME minimisation QTYPE is blocked. Used to determine if capsforid fallback should be started.

Referenced by errinf_reply(), iter_new(), process_response(), and processQueryResponse().


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