|
unbound 0.1
|
This file contains a module that performs recursive iterative DNS query processing. More...
Data Structures | |
| struct | iter_nat64 |
| Iterator global state for nat64. More... | |
| struct | iter_env |
| Global state for the iterator. More... | |
| struct | iter_qstate |
| Per query state for the iterator module. More... | |
| struct | iter_prep_list |
| List of prepend items. More... | |
Macros | |
| #define | MAX_TARGET_COUNT 64 |
| max number of targets spawned for a query and its subqueries | |
| #define | MAX_DP_TARGET_COUNT 16 |
| max number of target lookups per qstate, per delegation point | |
| #define | MAX_TARGET_NX 5 |
| max number of nxdomains allowed for target lookups for a query and its subqueries | |
| #define | MAX_TARGET_NX_FALLBACK (MAX_TARGET_NX*2) |
| max number of nxdomains allowed for target lookups for a query and its subqueries when fallback has kicked in | |
| #define | MAX_REFERRAL_COUNT 130 |
| max number of referrals. | |
| #define | DNSSEC_LAME_DETECT_COUNT 4 |
| max number of queries for which to perform dnsseclameness detection, (rrsigs missing detection) after that, just pick up that response | |
| #define | MAX_MINIMISE_COUNT 10 |
| max number of QNAME minimisation iterations. | |
| #define | MAX_MINIMISE_TIMEOUT_COUNT 3 |
| #define | MINIMISE_ONE_LAB 4 |
| number of labels from QNAME that are always send individually when using QNAME minimisation, even when the number of labels of the QNAME is bigger than MAX_MINIMISE_COUNT | |
| #define | MINIMISE_MULTIPLE_LABS (MAX_MINIMISE_COUNT - MINIMISE_ONE_LAB) |
| #define | TARGET_FETCH_STOP 3 |
| at what query-sent-count to stop target fetch policy | |
| #define | RTT_BAND 400 |
| RTT band, within this amount from the best, servers are chosen randomly. | |
| #define | EMPTY_NODATA_RETRY_COUNT 2 |
| Number of retries for empty nodata packets before it is accepted. | |
| #define | MAX_DSNS_FIND_COUNT 20 |
| max label-strip iterations in DSNS_FIND_STATE (RFC 4035 4.2 parent-NS search) before giving up; bounds upstream NS sends per client DS. | |
Enumerations | |
| enum | minimisation_state { INIT_MINIMISE_STATE = 0 , MINIMISE_STATE , SKIP_MINIMISE_STATE , DONOT_MINIMISE_STATE } |
| QNAME minimisation state. More... | |
| enum | iter_state { INIT_REQUEST_STATE = 0 , INIT_REQUEST_2_STATE , INIT_REQUEST_3_STATE , QUERYTARGETS_STATE , QUERY_RESP_STATE , PRIME_RESP_STATE , COLLECT_CLASS_STATE , DSNS_FIND_STATE , FINISHED_STATE } |
| State of the iterator for a query. More... | |
| enum | target_count_variables { TARGET_COUNT_REF = 0 , TARGET_COUNT_QUERIES , TARGET_COUNT_NX , TARGET_COUNT_GLOBAL_QUOTA , TARGET_COUNT_MAX } |
| Shared counters for queries. More... | |
Functions | |
| struct module_func_block * | iter_get_funcblock (void) |
| Get the iterator function block. | |
| const char * | iter_state_to_string (enum iter_state state) |
| Get iterator state as a string. | |
| int | iter_state_is_responsestate (enum iter_state s) |
| See if iterator state is a response state. | |
| int | iter_init (struct module_env *env, int id) |
| iterator init | |
| void | iter_deinit (struct module_env *env, int id) |
| iterator deinit | |
| void | iter_operate (struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound) |
| iterator operate on a query | |
| void | iter_inform_super (struct module_qstate *qstate, int id, struct module_qstate *super) |
| Return priming query results to interested super querystates. | |
| void | iter_clear (struct module_qstate *qstate, int id) |
| iterator cleanup query state | |
| size_t | iter_get_mem (struct module_env *env, int id) |
| iterator alloc size routine | |
Variables | |
| int | MAX_GLOBAL_QUOTA |
| max number of upstream queries for a query and its subqueries, it is never reset. | |
| int | UNKNOWN_SERVER_NICENESS |
| how nice is a server without further information, in msec Equals rtt initial timeout value. | |
| int | USEFUL_SERVER_TOP_TIMEOUT |
| maximum timeout before a host is deemed unsuitable, in msec. | |
| int | BLACKLIST_PENALTY |
| penalty to validation failed blacklisted IPs Equals USEFUL_SERVER_TOP_TIMEOUT*4, and thus when RTT_MAX_TIMEOUT is overwritten by config infra_cache_max_rtt, it will be overwritten as well. | |
This file contains a module that performs recursive iterative DNS query processing.
| #define MAX_TARGET_COUNT 64 |
max number of targets spawned for a query and its subqueries
Referenced by processLastResort(), and query_for_targets().
| #define MAX_DP_TARGET_COUNT 16 |
max number of target lookups per qstate, per delegation point
Referenced by query_for_targets().
| #define MAX_TARGET_NX 5 |
max number of nxdomains allowed for target lookups for a query and its subqueries
Referenced by processQueryTargets().
| #define MAX_TARGET_NX_FALLBACK (MAX_TARGET_NX*2) |
max number of nxdomains allowed for target lookups for a query and its subqueries when fallback has kicked in
Referenced by processQueryTargets().
| #define MAX_REFERRAL_COUNT 130 |
| #define DNSSEC_LAME_DETECT_COUNT 4 |
max number of queries for which to perform dnsseclameness detection, (rrsigs missing detection) after that, just pick up that response
Referenced by processQueryResponse().
| #define MAX_MINIMISE_COUNT 10 |
max number of QNAME minimisation iterations.
Limits number of queries for QNAMEs with a lot of labels.
Referenced by processQueryTargets().
| #define MINIMISE_ONE_LAB 4 |
number of labels from QNAME that are always send individually when using QNAME minimisation, even when the number of labels of the QNAME is bigger than MAX_MINIMISE_COUNT
Referenced by processQueryTargets().
| #define TARGET_FETCH_STOP 3 |
at what query-sent-count to stop target fetch policy
Referenced by processQueryTargets().
| #define RTT_BAND 400 |
RTT band, within this amount from the best, servers are chosen randomly.
Chosen so that the UNKNOWN_SERVER_NICENESS falls within the band of a fast server, this causes server exploration as a side benefit. msec.
Referenced by iter_filter_order(), and still_useful_timeout().
| #define EMPTY_NODATA_RETRY_COUNT 2 |
Number of retries for empty nodata packets before it is accepted.
Referenced by processQueryResponse(), and response_type_from_server().
| #define MAX_DSNS_FIND_COUNT 20 |
max label-strip iterations in DSNS_FIND_STATE (RFC 4035 4.2 parent-NS search) before giving up; bounds upstream NS sends per client DS.
Means the max number of labels in grandchild to the grandparent zone that are co-hosted.
Referenced by processDSNSFind().
| enum minimisation_state |
QNAME minimisation state.
| enum iter_state |
State of the iterator for a query.
Shared counters for queries.
| struct module_func_block * iter_get_funcblock | ( | void | ) |
Get the iterator function block.
References iter_block, and iter_get_funcblock().
Referenced by checkconf(), iter_get_funcblock(), and module_funcs_avail().
| const char * iter_state_to_string | ( | enum iter_state | state | ) |
Get iterator state as a string.
| state | to convert |
References COLLECT_CLASS_STATE, DSNS_FIND_STATE, FINISHED_STATE, INIT_REQUEST_2_STATE, INIT_REQUEST_3_STATE, INIT_REQUEST_STATE, iter_state_to_string(), PRIME_RESP_STATE, QUERY_RESP_STATE, and QUERYTARGETS_STATE.
Referenced by iter_handle(), and iter_state_to_string().
| int iter_state_is_responsestate | ( | enum iter_state | s | ) |
See if iterator state is a response state.
| s | to inspect |
References COLLECT_CLASS_STATE, INIT_REQUEST_2_STATE, INIT_REQUEST_3_STATE, INIT_REQUEST_STATE, iter_state_is_responsestate(), and QUERYTARGETS_STATE.
Referenced by iter_state_is_responsestate(), and next_state().
| int iter_init | ( | struct module_env * | env, |
| int | id ) |
iterator init
References module_env::cfg, iter_apply_cfg(), iter_init(), log_err(), module_env::modinfo, iter_env::num_queries_ratelimited, and iter_env::queries_ratelimit_lock.
Referenced by fptr_whitelist_mod_init(), and iter_init().
| void iter_deinit | ( | struct module_env * | env, |
| int | id ) |
iterator deinit
References iter_env::caps_white, caps_white_delete(), iter_env::donotq, donotq_delete(), iter_deinit(), module_env::modinfo, iter_env::priv, priv_delete(), iter_env::queries_ratelimit_lock, and iter_env::target_fetch_policy.
Referenced by fptr_whitelist_mod_deinit(), and iter_deinit().
| void iter_operate | ( | struct module_qstate * | qstate, |
| enum module_ev | event, | ||
| int | id, | ||
| struct outbound_entry * | outbound ) |
iterator operate on a query
References module_qstate::env, errinf(), error_response(), module_qstate::ext_state, iter_handle(), iter_new(), iter_operate(), log_err(), log_query_info(), module_qstate::minfo, module_env::modinfo, module_event_error, module_event_new, module_event_pass, process_request(), process_response(), iter_qstate::qchase, module_qstate::qinfo, query_info::qname, strextstate(), strmodulevent(), VERB_ALGO, VERB_QUERY, and verbose().
Referenced by fptr_whitelist_mod_operate(), and iter_operate().
| void iter_inform_super | ( | struct module_qstate * | qstate, |
| int | id, | ||
| struct module_qstate * | super ) |
Return priming query results to interested super querystates.
Sets the delegation point and delegation message (not nonRD queries). This is a callback from walk_supers.
| qstate | query state that finished. |
| id | module id. |
| super | the qstate to inform. |
References DSNS_FIND_STATE, error_supers(), module_qstate::is_priming, iter_inform_super(), LDNS_RR_CLASS_ANY, LDNS_RR_TYPE_DS, module_qstate::minfo, prime_supers(), processClassResponse(), processDSNSResponse(), processTargetResponse(), query_info::qclass, module_qstate::qinfo, query_info::qtype, and module_qstate::return_rcode.
Referenced by fptr_whitelist_mod_inform_super(), and iter_inform_super().
| void iter_clear | ( | struct module_qstate * | qstate, |
| int | id ) |
iterator cleanup query state
References iter_clear(), module_qstate::minfo, iter_qstate::num_current_queries, iter_qstate::nxns_dp, outbound_list_clear(), iter_qstate::outlist, iter_qstate::target_count, and TARGET_COUNT_REF.
Referenced by fptr_whitelist_mod_clear(), and iter_clear().
| size_t iter_get_mem | ( | struct module_env * | env, |
| int | id ) |
iterator alloc size routine
References iter_env::donotq, donotq_get_mem(), iter_get_mem(), iter_env::max_dependency_depth, module_env::modinfo, iter_env::priv, and priv_get_mem().
Referenced by fptr_whitelist_mod_get_mem(), and iter_get_mem().
|
extern |
max number of upstream queries for a query and its subqueries, it is never reset.
Referenced by config_apply(), and processQueryTargets().
|
extern |
how nice is a server without further information, in msec Equals rtt initial timeout value.
Referenced by config_apply(), infra_test(), iter_filter_unsuitable(), rtt_init(), rtt_test(), and serviced_tcp_send().
|
extern |
maximum timeout before a host is deemed unsuitable, in msec.
After host_ttl this will be timed out and the host will be tried again. Equals RTT_MAX_TIMEOUT, and thus when RTT_MAX_TIMEOUT is overwritten by config infra_cache_max_rtt, it will be overwritten as well.
Referenced by config_apply_max_rtt(), dump_infra_host(), infra_get_lame_rtt(), infra_host(), infra_rtt_update(), infra_test(), iter_filter_order(), iter_filter_unsuitable(), iter_server_selection(), print_dp_details(), and still_useful_timeout().
|
extern |
penalty to validation failed blacklisted IPs Equals USEFUL_SERVER_TOP_TIMEOUT*4, and thus when RTT_MAX_TIMEOUT is overwritten by config infra_cache_max_rtt, it will be overwritten as well.
Referenced by config_apply_max_rtt(), iter_fill_rtt(), and iter_server_selection().