Data structure to help domain name compression in outgoing messages. More...
|struct compress_tree_node *||left|
|left node in tree, all smaller to this |
|struct compress_tree_node *||right|
|right node in tree, all larger than this |
|struct compress_tree_node *||parent|
|the parent node - not for tree, but zone parent. More...|
|the domain name for this node. More...|
|number of labels in domain name, kept to help compare func. |
|offset in packet that points to this dname |
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).
|struct compress_tree_node* compress_tree_node::parent|