Lines Matching +full:in +full:- +full:tree
2 * edns-subnet/addrtree.h -- radix tree for edns subnet cache.
8 * Redistribution and use in source and binary forms, with or without
15 * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * The addrtree is a radix tree designed for edns subnet. Most notable
44 * (sourcemask). While traversing the tree the first matching node is
54 * tree the scope of all visited nodes is updated. This ensures we are
67 /** Number of elements in the tree (not always equal to number of
73 /** Size of tree in bytes */
78 * delfunc(addrnode->elem, addrtree->env) */
83 * sizefunc(addrnode->elem) */
85 /** first node in LRU list, first candidate to go */
87 /** last node in LRU list, last candidate to go */
94 /** Abs time in seconds in which elem is meaningful */
96 /** Number of significant bits in address. */
102 /** A node can have 0-2 edges, set to NULL for unused */
106 /** previous node in LRU list */
108 /** next node in LRU list */
115 /** length in bits of str */
121 /** Index of this edge in parent_node */
126 * Size of tree in bytes.
127 * @param tree: Tree.
128 * @return size of tree in bytes.
130 size_t addrtree_size(const struct addrtree *tree);
133 * Create a new tree.
134 * @param max_depth: Tree will cap keys to this length.
138 * @param max_node_count: Maximum size of this data structure in nodes.
147 * Free tree and all nodes below.
148 * @param tree: Tree to be freed.
150 void addrtree_delete(struct addrtree *tree);
153 * Insert an element in the tree. Failures are silent. Sourcemask and
158 * @param tree: Tree insert elem in.
160 * @param sourcemask: Length of addr in bits.
161 * @param scope: Number of significant bits in addr.
162 * @param elem: data to store in the tree.
165 * @param now: Current time in seconds.
167 void addrtree_insert(struct addrtree *tree, const addrkey_t *addr,
172 * Find a node containing an element in the tree.
174 * @param tree: Tree to search.
176 * @param sourcemask: Length of addr in bits.
177 * @param now: Current time in seconds.
180 struct addrnode * addrtree_find(struct addrtree *tree,