Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/route_var.h
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | union { | ||||
struct sockaddr_in6 rt_dst6; | struct sockaddr_in6 rt_dst6; | ||||
struct sockaddr rt_dst; | struct sockaddr rt_dst; | ||||
char rt_dstb[28]; | char rt_dstb[28]; | ||||
}; | }; | ||||
int rte_flags; /* up/down?, host/net */ | int rte_flags; /* up/down?, host/net */ | ||||
u_long rt_weight; /* absolute weight */ | u_long rt_weight; /* absolute weight */ | ||||
u_long rt_expire; /* lifetime for route, e.g. redirect */ | u_long rt_expire; /* lifetime for route, e.g. redirect */ | ||||
#define rt_endzero rt_mtx | |||||
struct mtx rt_mtx; /* mutex for routing entry */ | |||||
struct rtentry *rt_chain; /* pointer to next rtentry to delete */ | struct rtentry *rt_chain; /* pointer to next rtentry to delete */ | ||||
struct epoch_context rt_epoch_ctx; /* net epoch tracker */ | struct epoch_context rt_epoch_ctx; /* net epoch tracker */ | ||||
}; | }; | ||||
#define RT_LOCK_INIT(_rt) \ | |||||
mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW) | |||||
#define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx) | |||||
#define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) | |||||
#define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) | |||||
#define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) | |||||
#define RT_UNLOCK_COND(_rt) do { \ | |||||
if (mtx_owned(&(_rt)->rt_mtx)) \ | |||||
mtx_unlock(&(_rt)->rt_mtx); \ | |||||
} while (0) | |||||
/* | /* | ||||
* With the split between the routing entry and the nexthop, | * With the split between the routing entry and the nexthop, | ||||
* rt_flags has to be split between these 2 entries. As rtentry | * rt_flags has to be split between these 2 entries. As rtentry | ||||
* mostly contains prefix data and is thought to be generic enough | * mostly contains prefix data and is thought to be generic enough | ||||
* so one can transparently change the nexthop pointer w/o requiring | * so one can transparently change the nexthop pointer w/o requiring | ||||
* any other rtentry changes, most of rt_flags shifts to the particular nexthop. | * any other rtentry changes, most of rt_flags shifts to the particular nexthop. | ||||
* / | * / | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |