compress_tree_node Struct Reference

Data structure to help domain name compression in outgoing messages. More...


Data Fields

struct compress_tree_nodeleft
 left node in tree, all smaller to this
struct compress_tree_noderight
 right node in tree, all larger than this
struct compress_tree_nodeparent
 the parent node - not for tree, but zone parent.
uint8_t * dname
 the domain name for this node.
int labs
 number of labels in domain name, kept to help compare func.
size_t offset
 offset in packet that points to this dname


Detailed Description

Data structure to help domain name compression in outgoing messages.

A tree of dnames and their offsets in the packet is kept. It is kept sorted, not canonical, but by label at least, so that after a lookup of a name you know its closest match, and the parent from that closest match. These are possible compression targets.

It is a binary tree, not a rbtree or balanced tree, as the effort of keeping it balanced probably outweighs usefulness (given typical DNS packet size).


Field Documentation

the parent node - not for tree, but zone parent.

One less label

Referenced by compress_tree_lookup(), compress_tree_newnode(), and compress_tree_store().

the domain name for this node.

Pointer to uncompressed memory.

Referenced by compress_tree_newnode(), and compress_tree_search().


The documentation for this struct was generated from the following file:

Generated on Thu Mar 26 10:03:55 2009 for unbound by  doxygen 1.5.8