iter_fwd.h File Reference

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

#include "util/rbtree.h"

Data Structures

struct  iter_forwards
 Iterator forward zones structure. More...
struct  iter_forward_zone
 Iterator forward servers for a particular zone. More...

Functions

struct iter_forwardsforwards_create ()
 Create forwards.
void forwards_delete (struct iter_forwards *fwd)
 Delete forwards.
int forwards_apply_cfg (struct iter_forwards *fwd, struct config_file *cfg)
 Process forwards config.
struct delegptforwards_lookup (struct iter_forwards *fwd, uint8_t *qname, uint16_t qclass)
 Find forward zone information For this qname/qclass find forward zone information, returns delegation point with server names and addresses, or NULL if no forwarding is needed.
size_t forwards_get_mem (struct iter_forwards *fwd)
 Get memory in use by forward storage.
int fwd_cmp (const void *k1, const void *k2)
 compare two fwd entries


Detailed Description

This file contains functions to assist the iterator module.

Keep track of forward zones, and read those from config.


Function Documentation

struct iter_forwards* forwards_create (  )  [read]

Create forwards.

Returns:
new forwards or NULL on error.

References forwards_delete(), iter_forwards::region, and regional_create().

Referenced by iter_apply_cfg().

void forwards_delete ( struct iter_forwards fwd  ) 

Delete forwards.

Parameters:
fwd,: to delete.

References iter_forwards::region, regional_destroy(), and iter_forwards::tree.

Referenced by forwards_create(), and iter_deinit().

int forwards_apply_cfg ( struct iter_forwards fwd,
struct config_file cfg 
)

Process forwards config.

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

References fwd_cmp(), fwd_init_parents(), rbtree_create(), read_forwards(), and iter_forwards::tree.

Referenced by iter_apply_cfg().

struct delegpt* forwards_lookup ( struct iter_forwards fwd,
uint8_t *  qname,
uint16_t  qclass 
) [read]

Find forward zone information For this qname/qclass find forward zone information, returns delegation point with server names and addresses, or NULL if no forwarding is needed.

Parameters:
fwd,: forward storage.
qname,: The qname of the query.
qclass,: The qclass of the query.
Returns:
: A delegation point if the query has to be forwarded to that list, otherwise null.

References iter_forward_zone::dclass, dname_count_size_labels(), dname_lab_cmp(), iter_forward_zone::dp, rbnode_t::key, iter_forward_zone::name, iter_forward_zone::namelabs, iter_forward_zone::namelen, iter_forward_zone::node, iter_forward_zone::parent, rbtree_find_less_equal(), and iter_forwards::tree.

Referenced by forward_request().

size_t forwards_get_mem ( struct iter_forwards fwd  ) 

Get memory in use by forward storage.

Parameters:
fwd,: forward storage.
Returns:
bytes in use

References iter_forwards::region, and regional_get_mem().

Referenced by iter_get_mem().


Generated on Sun Sep 21 16:24:54 2008 for unbound by  doxygen 1.5.6