Electroneum
Loading...
Searching...
No Matches
iterator.h
Go to the documentation of this file.
1/*
2 * iterator/iterator.h - iterative resolver DNS query response module
3 *
4 * Copyright (c) 2007, NLnet Labs. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * Neither the name of the NLNET LABS nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
42
43#ifndef ITERATOR_ITERATOR_H
44#define ITERATOR_ITERATOR_H
46#include "util/data/msgreply.h"
47#include "util/module.h"
48struct delegpt;
49struct iter_hints;
50struct iter_forwards;
51struct iter_donotq;
52struct iter_prep_list;
53struct iter_priv;
54struct rbtree_type;
55
57#define MAX_TARGET_COUNT 64
59#define MAX_RESTART_COUNT 8
61#define MAX_REFERRAL_COUNT 130
63#define MAX_SENT_COUNT 32
66#define DNSSEC_LAME_DETECT_COUNT 4
71#define MAX_MINIMISE_COUNT 10
72/* max number of time-outs for minimised query. Prevents resolving failures
73 * when the QNAME minimisation QTYPE is blocked. */
74#define MAX_MINIMISE_TIMEOUT_COUNT 3
79#define MINIMISE_ONE_LAB 4
80#define MINIMISE_MULTIPLE_LABS (MAX_MINIMISE_COUNT - MINIMISE_ONE_LAB)
82#define TARGET_FETCH_STOP 3
86#define UNKNOWN_SERVER_NICENESS 376
91#define USEFUL_SERVER_TOP_TIMEOUT 120000
93#define OUTBOUND_MSG_RETRY 5
97#define RTT_BAND 400
99#define INFRA_BACKOFF_INITIAL 240
100
138
161
213
396
406
412
419
426
428int iter_init(struct module_env* env, int id);
429
431void iter_deinit(struct module_env* env, int id);
432
434void iter_operate(struct module_qstate* qstate, enum module_ev event, int id,
435 struct outbound_entry* outbound);
436
447void iter_inform_super(struct module_qstate* qstate, int id,
448 struct module_qstate* super);
449
451void iter_clear(struct module_qstate* qstate, int id);
452
454size_t iter_get_mem(struct module_env* env, int id);
455
456#endif /* ITERATOR_ITERATOR_H */
const char * iter_state_to_string(enum iter_state state)
struct module_func_block * iter_get_funcblock(void)
size_t iter_get_mem(struct module_env *env, int id)
iter_state
Definition iterator.h:165
@ INIT_REQUEST_3_STATE
Definition iterator.h:182
@ DSNS_FIND_STATE
Definition iterator.h:207
@ FINISHED_STATE
Definition iterator.h:211
@ PRIME_RESP_STATE
Definition iterator.h:199
@ INIT_REQUEST_STATE
Definition iterator.h:170
@ COLLECT_CLASS_STATE
Definition iterator.h:203
@ QUERY_RESP_STATE
Definition iterator.h:196
@ INIT_REQUEST_2_STATE
Definition iterator.h:176
@ QUERYTARGETS_STATE
Definition iterator.h:190
int iter_state_is_responsestate(enum iter_state s)
int iter_init(struct module_env *env, int id)
void iter_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
void iter_clear(struct module_qstate *qstate, int id)
void iter_deinit(struct module_env *env, int id)
void iter_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
minimisation_state
Definition iterator.h:142
@ MINIMISE_STATE
Definition iterator.h:151
@ DONOT_MINIMISE_STATE
Definition iterator.h:159
@ INIT_MINIMISE_STATE
Definition iterator.h:147
@ SKIP_MINIMISE_STATE
Definition iterator.h:155
int lock_basic_type
Definition locks.h:269
module_ev
Definition module.h:536
unsigned short uint16_t
Definition stdint.h:125
unsigned char uint8_t
Definition stdint.h:124
Definition dns.h:61
int supports_ipv4
Definition iterator.h:109
int max_dependency_depth
Definition iterator.h:121
size_t num_queries_ratelimited
Definition iterator.h:136
int * target_fetch_policy
Definition iterator.h:131
struct iter_donotq * donotq
Definition iterator.h:112
lock_basic_type queries_ratelimit_lock
Definition iterator.h:134
int supports_ipv6
Definition iterator.h:106
struct rbtree_type * caps_white
Definition iterator.h:118
struct iter_priv * priv
Definition iterator.h:115
struct ub_packed_rrset_key * rrset
Definition iterator.h:404
struct iter_prep_list * next
Definition iterator.h:402
struct outbound_list outlist
Definition iterator.h:369
enum minimisation_state minimisation_state
Definition iterator.h:372
struct query_info qchase
Definition iterator.h:267
int minimise_timeout_count
Definition iterator.h:389
size_t dsns_point_len
Definition iterator.h:337
int * target_count
Definition iterator.h:309
int referral_count
Definition iterator.h:302
struct delegpt * store_parent_NS
Definition iterator.h:320
struct iter_prep_list * an_prepend_last
Definition iterator.h:254
int auth_zone_avoid
Definition iterator.h:394
int dnssec_expected
Definition iterator.h:344
int num_target_queries
Definition iterator.h:293
uint16_t chase_flags
Definition iterator.h:269
struct dns_msg * response
Definition iterator.h:246
int caps_fallback
Definition iterator.h:281
int wait_priming_stub
Definition iterator.h:356
int auth_zone_response
Definition iterator.h:392
int query_restart_count
Definition iterator.h:299
enum iter_state state
Definition iterator.h:225
int minimise_count
Definition iterator.h:384
struct iter_prep_list * ns_prepend_list
Definition iterator.h:260
int refetch_glue
Definition iterator.h:366
struct iter_prep_list * ns_prepend_last
Definition iterator.h:262
int ratelimit_ok
Definition iterator.h:312
struct reply_info * caps_reply
Definition iterator.h:286
enum iter_state final_state
Definition iterator.h:234
struct dns_msg * deleg_msg
Definition iterator.h:290
int num_current_queries
Definition iterator.h:296
struct dns_msg * caps_response
Definition iterator.h:287
struct ub_packed_rrset_key * pside_glue
Definition iterator.h:332
struct delegpt * dp
Definition iterator.h:278
int query_for_pside_glue
Definition iterator.h:330
uint8_t * dsns_point
Definition iterator.h:335
struct iter_prep_list * an_prepend_list
Definition iterator.h:252
size_t caps_server
Definition iterator.h:283
struct query_info qinfo_out
Definition iterator.h:378
int dnssec_lame_query
Definition iterator.h:350
int chase_to_rd
Definition iterator.h:271
int sent_count
Definition iterator.h:305