MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rn_inithead_internal

Function rn_inithead_internal

freebsd/net/radix.c:1090–1106  ·  view source on GitHub ↗

* Initialize an empty tree. This has 3 nodes, which are passed * via base_nodes (in the order ) and are * marked RNF_ROOT so they cannot be freed. * The leaves have all-zero and all-one keys, with significant * bits starting at 'off'. */

Source from the content-addressed store, hash-verified

1088 * bits starting at 'off'.
1089 */
1090void
1091rn_inithead_internal(struct radix_head *rh, struct radix_node *base_nodes, int off)
1092{
1093 struct radix_node *t, *tt, *ttt;
1094
1095 t = rn_newpair(rn_zeros, off, base_nodes);
1096 ttt = base_nodes + 2;
1097 t->rn_right = ttt;
1098 t->rn_parent = t;
1099 tt = t->rn_left; /* ... which in turn is base_nodes */
1100 tt->rn_flags = t->rn_flags = RNF_ROOT | RNF_ACTIVE;
1101 tt->rn_bit = -1 - off;
1102 *ttt = *tt;
1103 ttt->rn_key = rn_ones;
1104
1105 rh->rnh_treetop = t;
1106}
1107
1108static void
1109rn_detachhead_internal(struct radix_head *head)

Callers 2

rt_table_initFunction · 0.85
rn_initheadFunction · 0.85

Calls 1

rn_newpairFunction · 0.85

Tested by

no test coverage detected