Lines Matching refs:tt
337 struct radix_node *tt = nodes, *t = tt + 1; in rn_newpair() local
341 t->rn_l = tt; in rn_newpair()
343 tt->rn_b = -1; in rn_newpair()
344 tt->rn_key = v; in rn_newpair()
345 tt->rn_p = t; in rn_newpair()
346 tt->rn_flags = t->rn_flags = RNF_ACTIVE; in rn_newpair()
348 tt->rn_info = rn_nodenum++; in rn_newpair()
350 tt->rn_twin = t; in rn_newpair()
351 tt->rn_ybro = rn_clist; in rn_newpair()
352 rn_clist = tt; in rn_newpair()
366 struct radix_node *tt; in rn_insert() local
409 tt = t->rn_l; in rn_insert()
419 t->rn_r = tt; in rn_insert()
429 return (tt); in rn_insert()
517 rn_new_radix_mask(struct radix_node *tt, in rn_new_radix_mask() argument
532 m->rm_b = tt->rn_b; in rn_new_radix_mask()
533 m->rm_flags = tt->rn_flags; in rn_new_radix_mask()
534 if (tt->rn_flags & RNF_NORMAL) in rn_new_radix_mask()
535 m->rm_leaf = tt; in rn_new_radix_mask()
537 m->rm_mask = tt->rn_mask; in rn_new_radix_mask()
539 tt->rn_mklist = m; in rn_new_radix_mask()
548 struct radix_node *t, *x = 0, *tt; in rn_addroute() local
574 saved_tt = tt = rn_insert(v, head, &keyduplicated, treenodes); in rn_addroute()
576 for (t = tt; tt; t = tt, tt = tt->rn_dupedkey) { in rn_addroute()
577 if (tt->rn_mask == netmask) { in rn_addroute()
583 (tt->rn_mask && in rn_addroute()
584 ((b_leaf < tt->rn_b) || in rn_addroute()
585 rn_refines(netmask, tt->rn_mask) || in rn_addroute()
586 rn_lexobetter(netmask, tt->rn_mask)))) in rn_addroute()
599 if (tt == saved_tt) { in rn_addroute()
602 (tt = treenodes)->rn_dupedkey = t; in rn_addroute()
603 tt->rn_flags = t->rn_flags; in rn_addroute()
604 tt->rn_p = x = t->rn_p; in rn_addroute()
606 x->rn_l = tt; in rn_addroute()
608 x->rn_r = tt; in rn_addroute()
609 saved_tt = tt; in rn_addroute()
612 (tt = treenodes)->rn_dupedkey = t->rn_dupedkey; in rn_addroute()
613 t->rn_dupedkey = tt; in rn_addroute()
616 t = tt + 1; in rn_addroute()
617 tt->rn_info = rn_nodenum++; in rn_addroute()
619 tt->rn_twin = t; in rn_addroute()
620 tt->rn_ybro = rn_clist; in rn_addroute()
621 rn_clist = tt; in rn_addroute()
623 tt->rn_key = v; in rn_addroute()
624 tt->rn_b = -1; in rn_addroute()
625 tt->rn_flags = RNF_ACTIVE; in rn_addroute()
631 tt->rn_mask = netmask; in rn_addroute()
632 tt->rn_b = x->rn_b; in rn_addroute()
633 tt->rn_flags |= x->rn_flags & RNF_NORMAL; in rn_addroute()
664 return (tt); /* can't lift at all */ in rn_addroute()
666 b_leaf = tt->rn_b; in rn_addroute()
684 if (tt->rn_flags & RNF_NORMAL) { in rn_addroute()
692 return (tt); in rn_addroute()
698 tt->rn_mklist = m; in rn_addroute()
699 return (tt); in rn_addroute()
704 *mp = rn_new_radix_mask(tt, *mp); in rn_addroute()
705 return (tt); in rn_addroute()
711 struct radix_node *t, *p, *x, *tt; in rn_delete() local
721 tt = rn_search(v, x); in rn_delete()
724 saved_tt = tt; in rn_delete()
726 if (tt == NULL || in rn_delete()
727 memcmp(v + head_off, tt->rn_key + head_off, vlen - head_off) != 0) { in rn_delete()
740 while (tt->rn_mask != netmask) in rn_delete()
741 if ((tt = tt->rn_dupedkey) == NULL) { in rn_delete()
746 if (tt->rn_mask == NULL || (saved_m = m = tt->rn_mklist) == NULL) in rn_delete()
748 if (tt->rn_flags & RNF_NORMAL) { in rn_delete()
749 if (m->rm_leaf != tt || m->rm_refs > 0) { in rn_delete()
758 if (m->rm_mask != tt->rn_mask) { in rn_delete()
769 b = -1 - tt->rn_b; in rn_delete()
789 if (tt->rn_flags & RNF_NORMAL) in rn_delete()
796 if (tt->rn_flags & RNF_ROOT) { in rn_delete()
802 for (t = rn_clist; t && t->rn_ybro != tt; t = t->rn_ybro) {} in rn_delete()
804 t->rn_ybro = tt->rn_ybro; in rn_delete()
806 t = tt->rn_p; in rn_delete()
808 if (tt == saved_tt) { in rn_delete()
811 if (t->rn_l == tt) in rn_delete()
816 for (x = p = saved_tt; p && p->rn_dupedkey != tt; ) in rn_delete()
819 p->rn_dupedkey = tt->rn_dupedkey; in rn_delete()
828 t = tt + 1; in rn_delete()
848 if (t->rn_l == tt) in rn_delete()
894 x = tt + 1; in rn_delete()
912 tt->rn_flags &= ~RNF_ACTIVE; in rn_delete()
913 tt[1].rn_flags &= ~RNF_ACTIVE; in rn_delete()
914 return (tt); in rn_delete()
957 struct radix_node *t, *tt, *ttt; in rn_inithead() local
967 tt = t->rn_l; in rn_inithead()
968 tt->rn_flags = t->rn_flags = RNF_ROOT | RNF_ACTIVE; in rn_inithead()
969 tt->rn_b = -1 - off; in rn_inithead()
970 *ttt = *tt; in rn_inithead()