Lines Matching defs:rh
102 struct rib_head *rh;
104 rh = malloc(sizeof(struct rib_head), M_RTABLE, M_WAITOK | M_ZERO);
108 rn_inithead_internal(&rh->head, rh->rnh_nodes, offset);
109 rn_inithead_internal(&rh->rmhead.head, rh->rmhead.mask_nodes, 0);
110 rh->head.rnh_masks = &rh->rmhead;
113 rh->rib_family = family;
114 rh->rib_fibnum = fibnum;
116 rh->rib_vnet = curvnet;
119 tmproutes_init(rh);
122 RIB_LOCK_INIT(rh);
124 nhops_init_rib(rh);
127 rib_init_subscriptions(rh);
130 rh->rnh_addaddr = rn_addroute;
131 rh->rnh_deladdr = rn_delete;
132 rh->rnh_matchaddr = rn_match;
133 rh->rnh_lookup = rn_lookup;
134 rh->rnh_walktree = rn_walktree;
135 rh->rnh_walktree_from = rn_walktree_from;
137 return (rh);
153 rt_table_destroy(struct rib_head *rh)
156 RIB_WLOCK(rh);
157 rh->rib_dying = true;
158 RIB_WUNLOCK(rh);
161 fib_destroy_rib(rh);
164 tmproutes_destroy(rh);
166 rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head);
168 nhops_destroy_rib(rh);
170 rib_destroy_subscriptions(rh);
173 RIB_LOCK_DESTROY(rh);
174 free(rh, M_RTABLE);