iter_hints.h File Reference

This file contains functions to assist the iterator module. More...

#include "util/rbtree.h"

Data Structures

struct  iter_hints
 Iterator hints structure. More...
struct  iter_hints_stub
 Iterator hints for a particular stub. More...

Functions

struct iter_hintshints_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 delegpthints_lookup_root (struct iter_hints *hints, uint16_t qclass)
 Find root hints for the given class.
struct delegpthints_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.
int stub_cmp (const void *k1, const void *k2)
 compare two hint entries


Detailed Description

This file contains functions to assist the iterator module.

Keep track of stub and root hints, and read those from config.


Function Documentation

struct iter_hints* hints_create (  )  [read]

Create hints.

Returns:
new hints or NULL on error.

References hints_delete(), iter_hints::region, and regional_create().

Referenced by iter_apply_cfg().

void hints_delete ( struct iter_hints hints  ) 

Delete hints.

Parameters:
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.

Parameters:
hints,: where to store.
cfg,: config options.
Returns:
0 on error.

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.

Parameters:
hints,: hint storage.
qclass,: class for which root hints are requested. host order.
Returns:
: NULL if no hints, or a ptr to stored hints.

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.

Parameters:
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.
Returns:
: A priming delegation point if there is a stub hint that must be primed, otherwise null.

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.

Parameters:
hints,: hint storage.
Returns:
bytes in use

References iter_hints::region, and regional_get_mem().

Referenced by iter_get_mem().


Generated on Sun Sep 21 16:23:29 2008 for unbound by  doxygen 1.5.6