Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route.c
Show First 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | vnet_route_uninit(const void *unused __unused) | ||||
free(V_rt_tables, M_RTABLE); | free(V_rt_tables, M_RTABLE); | ||||
uma_zdestroy(V_rtzone); | uma_zdestroy(V_rtzone); | ||||
} | } | ||||
VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, | VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, | ||||
vnet_route_uninit, 0); | vnet_route_uninit, 0); | ||||
#endif | #endif | ||||
struct rib_head * | struct rib_head * | ||||
rt_table_init(int offset) | rt_table_init(int offset, int salen, int family, u_int fibnum) | ||||
{ | { | ||||
struct rib_head *rh; | struct rib_head *rh; | ||||
rh = malloc(sizeof(struct rib_head), M_RTABLE, M_WAITOK | M_ZERO); | rh = malloc(sizeof(struct rib_head), M_RTABLE, M_WAITOK | M_ZERO); | ||||
/* TODO: These details should be hidded inside radix.c */ | /* TODO: These details should be hidded inside radix.c */ | ||||
/* Init masks tree */ | /* Init masks tree */ | ||||
rn_inithead_internal(&rh->head, rh->rnh_nodes, offset); | rn_inithead_internal(&rh->head, rh->rnh_nodes, offset, salen); | ||||
rn_inithead_internal(&rh->rmhead.head, rh->rmhead.mask_nodes, 0); | rn_inithead_internal(&rh->rmhead.head, rh->rmhead.mask_nodes, 0, 0); | ||||
rh->head.rnh_masks = &rh->rmhead; | rh->head.rnh_masks = &rh->rmhead; | ||||
/* Init locks */ | /* Init locks */ | ||||
RIB_LOCK_INIT(rh); | RIB_LOCK_INIT(rh); | ||||
/* Finally, set base callbacks */ | /* Finally, set base callbacks */ | ||||
rh->rnh_addaddr = rn_addroute; | rh->rnh_addaddr = rn_addroute; | ||||
rh->rnh_deladdr = rn_delete; | rh->rnh_deladdr = rn_delete; | ||||
▲ Show 20 Lines • Show All 1,927 Lines • Show Last 20 Lines |