Lines Matching defs:nodes
33 ipf_rdx_node_t nodes[2], int *);
90 /* nodes(O) - pair of ipf_rdx_node_t's to initialise with data */
93 /* Initialise the fields in a pair of radix tree nodes according to the */
99 buildnodes(addrfamily_t *addr, addrfamily_t *mask, ipf_rdx_node_t nodes[2])
116 bzero(&nodes[0], sizeof(ipf_rdx_node_t) * 2);
117 nodes[0].maskbitcount = maskbits;
118 nodes[0].index = -1 - (ADF_OFF_BITS + maskbits);
119 nodes[0].addrkey = (u_32_t *)addr;
120 nodes[0].maskkey = (u_32_t *)mask;
121 nodes[0].addroff = nodes[0].addrkey + masklen;
122 nodes[0].maskoff = nodes[0].maskkey + masklen;
123 nodes[0].parent = &nodes[1];
124 nodes[0].offset = masklen;
125 nodes[0].lastmask = lastmask;
126 nodes[1].offset = masklen;
127 nodes[1].left = &nodes[0];
128 nodes[1].maskbitcount = maskbits;
130 (void) strcpy(nodes[0].name, "_BUILD.0");
131 (void) strcpy(nodes[1].name, "_BUILD.1");
308 /* Paramters: head(I) - pointer to tree head to add nodes to */
309 /* nodes(I) - pointer to radix nodes to be added */
312 /* Add the new radix tree entry that owns nodes[] to the tree given by head.*/
319 ipf_rx_insert(ipf_rdx_head_t *head, ipf_rdx_node_t nodes[2], int *dup)
338 addr = nodes[0].addrkey;
361 nodes[1].index = nlen;
362 nodes[1].bitmask = htonl(0x80000000 >> (nlen & 0x1f));
363 nodes[0].offset = nlen / 32;
364 nodes[1].offset = nlen / 32;
375 key = nodes[0].addrkey;
386 prev->left = &nodes[1];
388 prev->right = &nodes[1];
390 cur->parent = &nodes[1];
391 nodes[1].parent = prev;
392 if ((key[nodes[1].offset] & nodes[1].bitmask) == 0) {
393 nodes[1].right = cur;
395 nodes[1].right = &nodes[0];
396 nodes[1].left = cur;
399 nodeoff = nodes[0].offset;
400 nodekey = nodes[0].addrkey[nodeoff];
401 nodemask = nodes[0].lastmask;
402 nodebits = nodes[0].maskbitcount;
409 for (cur = nodes[1].parent; cur->root == 0; cur = cur->parent) {
422 mask->node = &nodes[0];
424 mask->mask = nodes[0].maskkey;
425 nodes[0].mymask = mask;
437 * No higher up nodes qualify, so attach mask locally.
439 pmask = &nodes[0].masks;
448 cur = nodes[1].right;
453 ipf_rx_attach_mask(&nodes[0], mask);
459 cur = nodes[1].left;
460 if (cur->root == 0 && cur != &nodes[0]) {
464 ipf_rx_attach_mask(&nodes[0], mask);
470 return (&nodes[0]);
480 /* nodes(I) - radix tree data nodes inside allocate structure */
483 /* (addr,mask). No memory allocation for the radix nodes themselves is */
489 /* the key material (addr,mask) and the radix tree nodes[]. */
497 ipf_rdx_node_t *nodes)
504 buildnodes(addr, mask, nodes);
505 x = ipf_rx_insert(head, nodes, &dup);
510 node = &nodes[0];
532 nodes[0].dupkey = x;
533 prev->dupkey = &nodes[0];
534 nodes[0].parent = prev;
536 x->parent = &nodes[0];
538 nodes[0].dupkey = x->dupkey;
540 nodes[0].parent = prev;
541 x->parent = &nodes[0];
543 prev->left = &nodes[0];
545 prev->right = &nodes[0];
549 return &nodes[0];
605 * to other tree nodes need to be preserved and
801 node = ptr->nodes;
919 struct ipf_rdx_node nodes[2];
1135 ipf_rdx_node_t *node = &stp->nodes[0];
1137 if (stp->nodes[0].index > 0)
1138 stp = (myst_t *)&stp->nodes[-1];
1189 GNAME(&rnh->nodes[0]),
1190 rnh->nodes[0].index, GNAME(rnh->nodes[0].parent),
1191 GNAME(rnh->nodes[0].left), GNAME(rnh->nodes[0].right));
1193 GNAME(&rnh->nodes[1]),
1194 rnh->nodes[1].index, GNAME(rnh->nodes[1].parent),
1195 GNAME(rnh->nodes[1].left), GNAME(rnh->nodes[1].right));
1197 GNAME(&rnh->nodes[2]),
1198 rnh->nodes[2].index, GNAME(rnh->nodes[2].parent),
1199 GNAME(rnh->nodes[2].left), GNAME(rnh->nodes[2].right));
1372 stp->nodes[0].parent = &stp->nodes[0];
1373 stp->nodes[1].parent = &stp->nodes[1];
1398 rn = ipf_rx_addroute(rnh, &stp->dst, &stp->mask, stp->nodes);
1420 rn = &s1->nodes[1];