This file contains functions to assist the iterator module. More...
#include "util/storage/dnstree.h"
Data Structures | |
struct | iter_hints |
Iterator hints structure. More... | |
struct | iter_hints_stub |
Iterator hints for a particular stub. More... | |
Functions | |
struct iter_hints * | hints_create () |
Create hints. | |
void | hints_delete (struct iter_hints *hints) |
Delete hints. | |
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. | |
int | hints_next_root (struct iter_hints *hints, uint16_t *qclass) |
Find next root hints (to cycle through all root hints). | |
struct iter_hints_stub * | hints_lookup_stub (struct iter_hints *hints, uint8_t *qname, uint16_t qclass, struct delegpt *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. |
This file contains functions to assist the iterator module.
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, and regional_destroy().
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(), name_tree_init(), name_tree_init_parents(), read_root_hints_list(), read_stubs(), iter_hints::region, regional_free_all(), 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, name_tree_find(), and iter_hints::tree.
Referenced by hints_apply_cfg(), prime_root(), and processInitRequest().
int hints_next_root | ( | struct iter_hints * | hints, | |
uint16_t * | qclass | |||
) |
Find next root hints (to cycle through all root hints).
hints,: | hint storage | |
qclass,: | class for which root hints are sought. 0 means give the first available root hints class. x means, give class x or a higher class if any. returns the found class in this variable. |
References name_tree_next_root(), and iter_hints::tree.
Referenced by iter_get_next_root().
struct iter_hints_stub* 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_strict_subdomain(), iter_hints_stub::dp, delegpt::name, name_tree_lookup(), delegpt::namelabs, iter_hints_stub::noprime, query_dname_compare(), and iter_hints::tree.
Referenced by prime_stub(), and print_deleg_lookup().
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().