#include "config.h"
#include "iterator/iter_hints.h"
#include "iterator/iter_delegpt.h"
#include "util/regional.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/net_help.h"
#include "util/data/dname.h"
Functions | |
| int | stub_cmp (const void *k1, const void *k2) |
| compare two hint entries | |
| struct iter_hints * | hints_create () |
| Create hints. | |
| void | hints_delete (struct iter_hints *hints) |
| Delete hints. | |
| static int | ah (struct delegpt *dp, struct regional *r, const char *sv, const char *ip) |
| add hint to delegation hints | |
| static struct delegpt * | compile_time_root_prime (struct regional *r, int do_ip4, int do_ip6) |
| obtain compiletime provided root hints | |
| static int | hints_insert (struct iter_hints *hints, uint16_t c, struct delegpt *dp) |
| insert new hint info into hint structure | |
| static void | init_parents (struct iter_hints *hints) |
| initialise parent pointers in the tree | |
| static int | read_stubs_name (struct iter_hints *hints, struct config_stub *s, struct delegpt *dp) |
| set stub name | |
| static int | read_stubs_host (struct iter_hints *hints, struct config_stub *s, struct delegpt *dp) |
| set stub host names | |
| static int | read_stubs_addr (struct iter_hints *hints, struct config_stub *s, struct delegpt *dp) |
| set stub server addresses | |
| static int | read_stubs (struct iter_hints *hints, struct config_file *cfg) |
| read stubs config | |
| static int | read_root_hints (struct iter_hints *hints, char *fname) |
| read root hints from file | |
| static int | read_root_hints_list (struct iter_hints *hints, struct config_file *cfg) |
| read root hints list | |
| int | hints_apply_cfg (struct iter_hints *hints, struct config_file *cfg) |
| Process hints config. | |
| struct delegpt * | hints_lookup_root (struct iter_hints *hints, uint16_t qclass) |
| Find root hints for the given class. | |
| struct delegpt * | hints_lookup_stub (struct iter_hints *hints, uint8_t *qname, uint16_t qclass, struct delegpt *cache_dp) |
| Given a qname/qclass combination, and the delegation point from the cache for this qname/qclass, determine if this combination indicates that a stub hint exists and must be primed. | |
| size_t | hints_get_mem (struct iter_hints *hints) |
| Get memory in use by hints. | |
Keep track of stub and root hints, and read those from config.
| struct iter_hints* hints_create | ( | ) | [read] |
Create hints.
References hints_delete(), iter_hints::region, and regional_create().
Referenced by iter_apply_cfg().
| void hints_delete | ( | struct iter_hints * | hints | ) |
Delete hints.
| hints,: | to delete. |
References iter_hints::region, regional_destroy(), and iter_hints::tree.
Referenced by hints_create(), and iter_deinit().
| int hints_apply_cfg | ( | struct iter_hints * | hints, | |
| struct config_file * | cfg | |||
| ) |
Process hints config.
Sets default values for root hints if no config.
| hints,: | where to store. | |
| cfg,: | config options. |
References compile_time_root_prime(), config_file::do_ip4, config_file::do_ip6, hints_insert(), hints_lookup_root(), init_parents(), rbtree_create(), read_root_hints_list(), read_stubs(), iter_hints::region, stub_cmp(), iter_hints::tree, VERB_ALGO, and verbose().
Referenced by iter_apply_cfg().
| struct delegpt* hints_lookup_root | ( | struct iter_hints * | hints, | |
| uint16_t | qclass | |||
| ) | [read] |
Find root hints for the given class.
| hints,: | hint storage. | |
| qclass,: | class for which root hints are requested. host order. |
References iter_hints_stub::dp, iter_hints_stub::hint_class, rbnode_t::key, iter_hints_stub::name, iter_hints_stub::namelabs, iter_hints_stub::namelen, iter_hints_stub::node, rbtree_search(), and iter_hints::tree.
Referenced by hints_apply_cfg(), prime_root(), and processInitRequest().
| struct delegpt* hints_lookup_stub | ( | struct iter_hints * | hints, | |
| uint8_t * | qname, | |||
| uint16_t | qclass, | |||
| struct delegpt * | dp | |||
| ) | [read] |
Given a qname/qclass combination, and the delegation point from the cache for this qname/qclass, determine if this combination indicates that a stub hint exists and must be primed.
| hints,: | hint storage. | |
| qname,: | The qname that generated the delegation point. | |
| qclass,: | The qclass that generated the delegation point. | |
| dp,: | The cache generated delegation point. |
References dname_count_size_labels(), dname_lab_cmp(), dname_strict_subdomain(), iter_hints_stub::dp, iter_hints_stub::hint_class, rbnode_t::key, delegpt::name, iter_hints_stub::name, delegpt::namelabs, iter_hints_stub::namelabs, iter_hints_stub::namelen, iter_hints_stub::node, iter_hints_stub::parent, rbtree_find_less_equal(), and iter_hints::tree.
Referenced by prime_stub().
| size_t hints_get_mem | ( | struct iter_hints * | hints | ) |
Get memory in use by hints.
| hints,: | hint storage. |
References iter_hints::region, and regional_get_mem().
Referenced by iter_get_mem().
1.5.6