Deleted Added
full compact
iter_delegpt.h (256281) iter_delegpt.h (269257)
1/*
2 * iterator/iter_delegpt.h - delegation point with NS and address information.
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

--- 7 unchanged lines hidden (view full) ---

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
1/*
2 * iterator/iter_delegpt.h - delegation point with NS and address information.
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

--- 7 unchanged lines hidden (view full) ---

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 LIMITED
25 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
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
36/**
37 * \file
38 *
39 * This file implements the Delegation Point. It contains a list of name servers
40 * and their addresses if known.
41 */

--- 93 unchanged lines hidden (view full) ---

135 /** length of addr */
136 socklen_t addrlen;
137 /** number of attempts for this addr */
138 int attempts;
139 /** rtt stored here in the selection algorithm */
140 int sel_rtt;
141 /** if true, the A or AAAA RR was bogus, so this address is bad.
142 * Also check the dp->bogus to see if everything is bogus. */
34 */
35
36/**
37 * \file
38 *
39 * This file implements the Delegation Point. It contains a list of name servers
40 * and their addresses if known.
41 */

--- 93 unchanged lines hidden (view full) ---

135 /** length of addr */
136 socklen_t addrlen;
137 /** number of attempts for this addr */
138 int attempts;
139 /** rtt stored here in the selection algorithm */
140 int sel_rtt;
141 /** if true, the A or AAAA RR was bogus, so this address is bad.
142 * Also check the dp->bogus to see if everything is bogus. */
143 int bogus;
143 uint8_t bogus;
144 /** if true, this address is dispreferred: it is a lame IP address */
144 /** if true, this address is dispreferred: it is a lame IP address */
145 int lame;
145 uint8_t lame;
146 /** if the address is dnsseclame, but this cannot be cached, this
147 * option is useful to mark the address dnsseclame.
148 * This value is not copied in addr-copy and dp-copy. */
149 uint8_t dnsseclame;
146};
147
148/**
149 * Create new delegation point.
150 * @param regional: where to allocate it.
151 * @return new delegation point or NULL on error.
152 */
153struct delegpt* delegpt_create(struct regional* regional);

--- 20 unchanged lines hidden (view full) ---

174 * Add a name to the delegation point.
175 * @param dp: delegation point.
176 * @param regional: where to allocate the info.
177 * @param name: domain name in wire format.
178 * @param lame: name is lame, disprefer it.
179 * @return false on error.
180 */
181int delegpt_add_ns(struct delegpt* dp, struct regional* regional,
150};
151
152/**
153 * Create new delegation point.
154 * @param regional: where to allocate it.
155 * @return new delegation point or NULL on error.
156 */
157struct delegpt* delegpt_create(struct regional* regional);

--- 20 unchanged lines hidden (view full) ---

178 * Add a name to the delegation point.
179 * @param dp: delegation point.
180 * @param regional: where to allocate the info.
181 * @param name: domain name in wire format.
182 * @param lame: name is lame, disprefer it.
183 * @return false on error.
184 */
185int delegpt_add_ns(struct delegpt* dp, struct regional* regional,
182 uint8_t* name, int lame);
186 uint8_t* name, uint8_t lame);
183
184/**
185 * Add NS rrset; calls add_ns repeatedly.
186 * @param dp: delegation point.
187 * @param regional: where to allocate the info.
188 * @param ns_rrset: NS rrset.
189 * @param lame: rrset is lame, disprefer it.
190 * @return 0 on alloc error.
191 */
192int delegpt_rrset_add_ns(struct delegpt* dp, struct regional* regional,
187
188/**
189 * Add NS rrset; calls add_ns repeatedly.
190 * @param dp: delegation point.
191 * @param regional: where to allocate the info.
192 * @param ns_rrset: NS rrset.
193 * @param lame: rrset is lame, disprefer it.
194 * @return 0 on alloc error.
195 */
196int delegpt_rrset_add_ns(struct delegpt* dp, struct regional* regional,
193 struct ub_packed_rrset_key* ns_rrset, int lame);
197 struct ub_packed_rrset_key* ns_rrset, uint8_t lame);
194
195/**
196 * Add target address to the delegation point.
197 * @param dp: delegation point.
198 * @param regional: where to allocate the info.
199 * @param name: name for which target was found (must be in nslist).
200 * This name is marked resolved.
201 * @param namelen: length of name.
202 * @param addr: the address.
203 * @param addrlen: the length of addr.
204 * @param bogus: security status for the address, pass true if bogus.
205 * @param lame: address is lame.
206 * @return false on error.
207 */
208int delegpt_add_target(struct delegpt* dp, struct regional* regional,
209 uint8_t* name, size_t namelen, struct sockaddr_storage* addr,
198
199/**
200 * Add target address to the delegation point.
201 * @param dp: delegation point.
202 * @param regional: where to allocate the info.
203 * @param name: name for which target was found (must be in nslist).
204 * This name is marked resolved.
205 * @param namelen: length of name.
206 * @param addr: the address.
207 * @param addrlen: the length of addr.
208 * @param bogus: security status for the address, pass true if bogus.
209 * @param lame: address is lame.
210 * @return false on error.
211 */
212int delegpt_add_target(struct delegpt* dp, struct regional* regional,
213 uint8_t* name, size_t namelen, struct sockaddr_storage* addr,
210 socklen_t addrlen, int bogus, int lame);
214 socklen_t addrlen, uint8_t bogus, uint8_t lame);
211
212/**
213 * Add A RRset to delegpt.
214 * @param dp: delegation point.
215 * @param regional: where to allocate the info.
216 * @param rrset: RRset A to add.
217 * @param lame: rrset is lame, disprefer it.
218 * @return 0 on alloc error.
219 */
220int delegpt_add_rrset_A(struct delegpt* dp, struct regional* regional,
215
216/**
217 * Add A RRset to delegpt.
218 * @param dp: delegation point.
219 * @param regional: where to allocate the info.
220 * @param rrset: RRset A to add.
221 * @param lame: rrset is lame, disprefer it.
222 * @return 0 on alloc error.
223 */
224int delegpt_add_rrset_A(struct delegpt* dp, struct regional* regional,
221 struct ub_packed_rrset_key* rrset, int lame);
225 struct ub_packed_rrset_key* rrset, uint8_t lame);
222
223/**
224 * Add AAAA RRset to delegpt.
225 * @param dp: delegation point.
226 * @param regional: where to allocate the info.
227 * @param rrset: RRset AAAA to add.
228 * @param lame: rrset is lame, disprefer it.
229 * @return 0 on alloc error.
230 */
231int delegpt_add_rrset_AAAA(struct delegpt* dp, struct regional* regional,
226
227/**
228 * Add AAAA RRset to delegpt.
229 * @param dp: delegation point.
230 * @param regional: where to allocate the info.
231 * @param rrset: RRset AAAA to add.
232 * @param lame: rrset is lame, disprefer it.
233 * @return 0 on alloc error.
234 */
235int delegpt_add_rrset_AAAA(struct delegpt* dp, struct regional* regional,
232 struct ub_packed_rrset_key* rrset, int lame);
236 struct ub_packed_rrset_key* rrset, uint8_t lame);
233
234/**
235 * Add any RRset to delegpt.
236 * Does not check for duplicates added.
237 * @param dp: delegation point.
238 * @param regional: where to allocate the info.
239 * @param rrset: RRset to add, NS, A, AAAA.
240 * @param lame: rrset is lame, disprefer it.
241 * @return 0 on alloc error.
242 */
243int delegpt_add_rrset(struct delegpt* dp, struct regional* regional,
237
238/**
239 * Add any RRset to delegpt.
240 * Does not check for duplicates added.
241 * @param dp: delegation point.
242 * @param regional: where to allocate the info.
243 * @param rrset: RRset to add, NS, A, AAAA.
244 * @param lame: rrset is lame, disprefer it.
245 * @return 0 on alloc error.
246 */
247int delegpt_add_rrset(struct delegpt* dp, struct regional* regional,
244 struct ub_packed_rrset_key* rrset, int lame);
248 struct ub_packed_rrset_key* rrset, uint8_t lame);
245
246/**
247 * Add address to the delegation point. No servername is associated or checked.
248 * @param dp: delegation point.
249 * @param regional: where to allocate the info.
250 * @param addr: the address.
251 * @param addrlen: the length of addr.
252 * @param bogus: if address is bogus.
253 * @param lame: if address is lame.
254 * @return false on error.
255 */
256int delegpt_add_addr(struct delegpt* dp, struct regional* regional,
249
250/**
251 * Add address to the delegation point. No servername is associated or checked.
252 * @param dp: delegation point.
253 * @param regional: where to allocate the info.
254 * @param addr: the address.
255 * @param addrlen: the length of addr.
256 * @param bogus: if address is bogus.
257 * @param lame: if address is lame.
258 * @return false on error.
259 */
260int delegpt_add_addr(struct delegpt* dp, struct regional* regional,
257 struct sockaddr_storage* addr, socklen_t addrlen, int bogus, int lame);
261 struct sockaddr_storage* addr, socklen_t addrlen,
262 uint8_t bogus, uint8_t lame);
258
259/**
260 * Find NS record in name list of delegation point.
261 * @param dp: delegation point.
262 * @param name: name of nameserver to look for, uncompressed wireformat.
263 * @param namelen: length of name.
264 * @return the ns structure or NULL if not found.
265 */

--- 105 unchanged lines hidden (view full) ---

371
372/**
373 * add a name to malloced delegation point.
374 * @param dp: must have been created with delegpt_create_mlc.
375 * @param name: the name to add.
376 * @param lame: the name is lame, disprefer.
377 * @return false on error.
378 */
263
264/**
265 * Find NS record in name list of delegation point.
266 * @param dp: delegation point.
267 * @param name: name of nameserver to look for, uncompressed wireformat.
268 * @param namelen: length of name.
269 * @return the ns structure or NULL if not found.
270 */

--- 105 unchanged lines hidden (view full) ---

376
377/**
378 * add a name to malloced delegation point.
379 * @param dp: must have been created with delegpt_create_mlc.
380 * @param name: the name to add.
381 * @param lame: the name is lame, disprefer.
382 * @return false on error.
383 */
379int delegpt_add_ns_mlc(struct delegpt* dp, uint8_t* name, int lame);
384int delegpt_add_ns_mlc(struct delegpt* dp, uint8_t* name, uint8_t lame);
380
381/**
382 * add an address to a malloced delegation point.
383 * @param dp: must have been created with delegpt_create_mlc.
384 * @param addr: the address.
385 * @param addrlen: the length of addr.
386 * @param bogus: if address is bogus.
387 * @param lame: if address is lame.
388 * @return false on error.
389 */
390int delegpt_add_addr_mlc(struct delegpt* dp, struct sockaddr_storage* addr,
385
386/**
387 * add an address to a malloced delegation point.
388 * @param dp: must have been created with delegpt_create_mlc.
389 * @param addr: the address.
390 * @param addrlen: the length of addr.
391 * @param bogus: if address is bogus.
392 * @param lame: if address is lame.
393 * @return false on error.
394 */
395int delegpt_add_addr_mlc(struct delegpt* dp, struct sockaddr_storage* addr,
391 socklen_t addrlen, int bogus, int lame);
396 socklen_t addrlen, uint8_t bogus, uint8_t lame);
392
393/**
394 * Add target address to the delegation point.
395 * @param dp: must have been created with delegpt_create_mlc.
396 * @param name: name for which target was found (must be in nslist).
397 * This name is marked resolved.
398 * @param namelen: length of name.
399 * @param addr: the address.
400 * @param addrlen: the length of addr.
401 * @param bogus: security status for the address, pass true if bogus.
402 * @param lame: address is lame.
403 * @return false on error.
404 */
405int delegpt_add_target_mlc(struct delegpt* dp, uint8_t* name, size_t namelen,
397
398/**
399 * Add target address to the delegation point.
400 * @param dp: must have been created with delegpt_create_mlc.
401 * @param name: name for which target was found (must be in nslist).
402 * This name is marked resolved.
403 * @param namelen: length of name.
404 * @param addr: the address.
405 * @param addrlen: the length of addr.
406 * @param bogus: security status for the address, pass true if bogus.
407 * @param lame: address is lame.
408 * @return false on error.
409 */
410int delegpt_add_target_mlc(struct delegpt* dp, uint8_t* name, size_t namelen,
406 struct sockaddr_storage* addr, socklen_t addrlen, int bogus, int lame);
411 struct sockaddr_storage* addr, socklen_t addrlen, uint8_t bogus,
412 uint8_t lame);
407
408/** get memory in use by dp */
409size_t delegpt_get_mem(struct delegpt* dp);
410
411#endif /* ITERATOR_ITER_DELEGPT_H */
413
414/** get memory in use by dp */
415size_t delegpt_get_mem(struct delegpt* dp);
416
417#endif /* ITERATOR_ITER_DELEGPT_H */