unbound: iter_qstate Struct Reference

unbound 0.1

Data Fields
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.
enum iter_state | final_state
| Final state for the iterator module.
int | depth
| The depth of this query, this means the depth of recursion.
struct dns_msg * | response
| The response.
struct iter_prep_list * | an_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_list * | an_prepend_last
| Last element of the prepend list.
struct iter_prep_list * | ns_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_list * | ns_prepend_last
| Last element of the authority prepend list.
struct query_info | qchase
| query name used for chasing the results.
uint16_t | chase_flags
| query flags to use when chasing the answer (i.e.
int | chase_to_rd
| true if we set RD bit because of last resort recursion lame query
struct delegpt * | dp
| This is the current delegation point for an in-progress query.
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_info * | caps_reply
| state for capsfail: stored query for comparisons.
struct dns_msg * | caps_response
struct dns_msg * | deleg_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.
int | dp_target_count
| number of target lookups per delegation point.
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.
int | ratelimit_ok
| if true, already tested for ratelimiting and passed the test
struct delegpt * | store_parent_NS
| The query must store NS records from referrals as parentside RRs Enabled once it hits resolution problems, to throttle retries.
int | query_for_pside_glue
| The query is for parent-side glue(A or AAAA) for a nameserver.
struct ub_packed_rrset_key * | pside_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.
int | dnssec_lame_query
| We are expecting dnssec information, but we also know the server is DNSSEC lame.
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.
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.
int | minimise_count
| Count number of QNAME minimisation iterations.
int | timeout_count
| Count number of time-outs.
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 error_supers(), generate_sub_request(), iter_handle(), iter_new(), next_state(), prime_supers(), process_request(), process_response(), processClassResponse(), processDSNSFind(), processDSNSResponse(), processQueryTargets(), and processTargetResponse().

## ◆ 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(), processInitRequest(), processLastResort(), processQueryTargets(), and query_for_targets().

## ◆ qchase

struct query_info iter_qstate::qchase

query name used for chasing the results.

Initially the same as the state qinfo, but after CNAMEs this will be different. The query info used to elicit the results needed.

Referenced by auth_zone_delegpt(), error_supers(), forward_request(), generate_dnskey_prefetch(), generate_ns_check(), generate_sub_request(), handle_cname_response(), is_caps_whitelisted(), iter_new(), iter_operate(), processCollectClass(), processDSNSFind(), processInitRequest(), processInitRequest2(), processInitRequest3(), processLastResort(), processPrimeResponse(), processQueryResponse(), processQueryTargets(), processTargetResponse(), query_for_targets(), rpz_callback_from_iterator_cname(), and rpz_callback_from_iterator_module().

## ◆ 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(), processLastResort(), processPrimeResponse(), processQueryResponse(), and processQueryTargets().

## ◆ 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(), error_supers(), 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(), processDSNSResponse(), processFinished(), processInitRequest(), processInitRequest2(), processInitRequest3(), processLastResort(), processPrimeResponse(), processQueryResponse(), processQueryTargets(), processTargetResponse(), query_for_targets(), and rpz_callback_from_iterator_module().

## ◆ 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(), and processQueryTargets().

## ◆ 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(), processLastResort(), processQueryTargets(), 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(), processInitRequest(), processLastResort(), processQueryResponse(), processQueryTargets(), 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(), processQueryTargets(), 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.

Referenced by processLastResort(), and processQueryResponse().

## ◆ 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(), processFinished(), processLastResort(), and processQueryResponse().

## ◆ 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(), prime_stub(), processInitRequest3(), processQueryResponse(), and processQueryTargets().

## ◆ 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(), processQueryResponse(), and processQueryTargets().

## ◆ 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(), processInitRequest(), processInitRequest2(), processLastResort(), and processQueryTargets().

## ◆ 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(), process_response(), processQueryResponse(), and processQueryTargets().

## ◆ 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(), and processQueryTargets().

## ◆ 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(), processQueryResponse(), and processQueryTargets().

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

- iterator/iterator.h