Electroneum
Loading...
Searching...
No Matches
iter_utils.h
Go to the documentation of this file.
1/*
2 * iterator/iter_utils.h - iterative resolver module utility functions.
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_ITER_UTILS_H
44#define ITERATOR_ITER_UTILS_H
46struct sldns_buffer;
47struct iter_env;
48struct iter_hints;
49struct iter_forwards;
50struct config_file;
51struct module_env;
52struct delegpt_addr;
53struct delegpt;
54struct regional;
55struct msg_parse;
56struct ub_randstate;
57struct query_info;
58struct reply_info;
59struct module_qstate;
60struct sock_list;
62
70int iter_apply_cfg(struct iter_env* iter_env, struct config_file* cfg);
71
98 struct module_env* env, struct delegpt* dp, uint8_t* name,
99 size_t namelen, uint16_t qtype, int* dnssec_lame,
100 int* chase_to_rd, int open_target, struct sock_list* blacklist,
101 time_t prefetch);
102
110struct dns_msg* dns_alloc_msg(struct sldns_buffer* pkt, struct msg_parse* msg,
111 struct regional* regional);
112
119struct dns_msg* dns_copy_msg(struct dns_msg* from, struct regional* regional);
120
139void iter_dns_store(struct module_env* env, struct query_info* qinf,
140 struct reply_info* rep, int is_referral, time_t leeway, int pside,
141 struct regional* region, uint16_t flags);
142
151int iter_ns_probability(struct ub_randstate* rnd, int n, int m);
152
159void iter_mark_cycle_targets(struct module_qstate* qstate, struct delegpt* dp);
160
168 struct delegpt* dp);
169
179 struct delegpt* dp);
180
190 struct query_info *qinfo);
191
202int iter_indicates_dnssec(struct module_env* env, struct delegpt* dp,
203 struct dns_msg* msg, uint16_t dclass);
204
214
227int iter_msg_from_zone(struct dns_msg* msg, struct delegpt* dp,
228 enum response_type type, uint16_t dclass);
229
239int reply_equal(struct reply_info* p, struct reply_info* q, struct regional* region);
240
249
257
267 struct ub_packed_rrset_key* rrset);
268
276
286 struct query_info* qinfo, struct reply_info* rep);
287
301 struct delegpt* dp, struct regional* region, struct query_info* qinfo);
302
315 struct delegpt* dp, struct regional* region, struct query_info* qinfo);
316
324int iter_get_next_root(struct iter_hints* hints, struct iter_forwards* fwd,
325 uint16_t* c);
326
334void iter_scrub_ds(struct dns_msg* msg, struct ub_packed_rrset_key* ns,
335 uint8_t* z);
336
342void iter_dec_attempts(struct delegpt* dp, int d);
343
350void iter_merge_retry_counts(struct delegpt* dp, struct delegpt* old);
351
361int iter_ds_toolow(struct dns_msg* msg, struct delegpt* dp);
362
370int iter_dp_cangodown(struct query_info* qinfo, struct delegpt* dp);
371
372#endif /* ITERATOR_ITER_UTILS_H */
response_type
int iter_dp_is_useless(struct query_info *qinfo, uint16_t qflags, struct delegpt *dp)
int reply_equal(struct reply_info *p, struct reply_info *q, struct regional *region)
int caps_failed_rcode(struct reply_info *rep)
void iter_scrub_ds(struct dns_msg *msg, struct ub_packed_rrset_key *ns, uint8_t *z)
void iter_mark_cycle_targets(struct module_qstate *qstate, struct delegpt *dp)
void iter_store_parentside_rrset(struct module_env *env, struct ub_packed_rrset_key *rrset)
int iter_qname_indicates_dnssec(struct module_env *env, struct query_info *qinfo)
void iter_dec_attempts(struct delegpt *dp, int d)
int iter_msg_from_zone(struct dns_msg *msg, struct delegpt *dp, enum response_type type, uint16_t dclass)
int iter_dp_cangodown(struct query_info *qinfo, struct delegpt *dp)
int iter_lookup_parent_NS_from_cache(struct module_env *env, struct delegpt *dp, struct regional *region, struct query_info *qinfo)
struct dns_msg * dns_alloc_msg(struct sldns_buffer *pkt, struct msg_parse *msg, struct regional *regional)
int iter_get_next_root(struct iter_hints *hints, struct iter_forwards *fwd, uint16_t *c)
void iter_store_parentside_neg(struct module_env *env, struct query_info *qinfo, struct reply_info *rep)
int iter_lookup_parent_glue_from_cache(struct module_env *env, struct delegpt *dp, struct regional *region, struct query_info *qinfo)
void iter_dns_store(struct module_env *env, struct query_info *qinf, struct reply_info *rep, int is_referral, time_t leeway, int pside, struct regional *region, uint16_t flags)
int iter_ns_probability(struct ub_randstate *rnd, int n, int m)
int iter_apply_cfg(struct iter_env *iter_env, struct config_file *cfg)
int iter_msg_has_dnssec(struct dns_msg *msg)
struct dns_msg * dns_copy_msg(struct dns_msg *from, struct regional *regional)
void caps_strip_reply(struct reply_info *rep)
void iter_store_parentside_NS(struct module_env *env, struct reply_info *rep)
int iter_indicates_dnssec(struct module_env *env, struct delegpt *dp, struct dns_msg *msg, uint16_t dclass)
void iter_merge_retry_counts(struct delegpt *dp, struct delegpt *old)
int iter_ds_toolow(struct dns_msg *msg, struct delegpt *dp)
void iter_mark_pside_cycle_targets(struct module_qstate *qstate, struct delegpt *dp)
struct delegpt_addr * iter_server_selection(struct iter_env *iter_env, struct module_env *env, struct delegpt *dp, uint8_t *name, size_t namelen, uint16_t qtype, int *dnssec_lame, int *chase_to_rd, int open_target, struct sock_list *blacklist, time_t prefetch)
unsigned short uint16_t
Definition stdint.h:125
unsigned char uint8_t
Definition stdint.h:124
Definition dns.h:61
struct reply_info * rep
Definition dns.h:65
struct query_info qinfo
Definition dns.h:63