iter_fwd.c File Reference

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

#include "config.h"
#include "iterator/iter_fwd.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 fwd_cmp (const void *k1, const void *k2)
 compare two fwd entries
struct iter_forwardsforwards_create ()
 Create forwards.
void forwards_delete (struct iter_forwards *fwd)
 Delete forwards.
static int forwards_insert (struct iter_forwards *fwd, uint16_t c, struct delegpt *dp)
 insert new info into forward structure
static void fwd_init_parents (struct iter_forwards *fwd)
 initialise parent pointers in the tree
static int read_fwds_name (struct iter_forwards *fwd, struct config_stub *s, struct delegpt *dp)
 set zone name
static int read_fwds_host (struct iter_forwards *fwd, struct config_stub *s, struct delegpt *dp)
 set fwd host names
static int read_fwds_addr (struct iter_forwards *fwd, struct config_stub *s, struct delegpt *dp)
 set fwd server addresses
static int read_forwards (struct iter_forwards *fwd, struct config_file *cfg)
 read forwards config
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.


Detailed Description

This file contains functions to assist the iterator module.

Keep track of forward zones and config settings.


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