Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/route.h
Show First 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | |||||
#define RO_RTFREE(_ro) do { \ | #define RO_RTFREE(_ro) do { \ | ||||
if ((_ro)->ro_rt) { \ | if ((_ro)->ro_rt) { \ | ||||
RT_LOCK((_ro)->ro_rt); \ | RT_LOCK((_ro)->ro_rt); \ | ||||
RTFREE_LOCKED((_ro)->ro_rt); \ | RTFREE_LOCKED((_ro)->ro_rt); \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
#define RO_INVALIDATE_CACHE(ro) do { \ | |||||
RO_RTFREE(ro); \ | |||||
if ((ro)->ro_lle != NULL) { \ | |||||
LLE_FREE((ro)->ro_lle); \ | |||||
(ro)->ro_lle = NULL; \ | |||||
} \ | |||||
} while (0) | |||||
/* | /* | ||||
* Validate a cached route based on a supplied cookie. If there is an | * Validate a cached route based on a supplied cookie. If there is an | ||||
* out-of-date cache, simply free it. Update the generation number | * out-of-date cache, simply free it. Update the generation number | ||||
* for the new allocation | * for the new allocation | ||||
*/ | */ | ||||
#define RT_VALIDATE(ro, cookiep, fibnum) do { \ | #define RT_VALIDATE(ro, cookiep, fibnum) do { \ | ||||
rt_gen_t cookie = RT_GEN(fibnum, (ro)->ro_dst.sa_family); \ | rt_gen_t cookie = RT_GEN(fibnum, (ro)->ro_dst.sa_family); \ | ||||
if (*(cookiep) != cookie) { \ | if (*(cookiep) != cookie) { \ | ||||
if ((ro)->ro_rt != NULL) { \ | RO_INVALIDATE_CACHE(ro); \ | ||||
RTFREE((ro)->ro_rt); \ | |||||
(ro)->ro_rt = NULL; \ | |||||
} \ | |||||
if ((ro)->ro_lle != NULL) { \ | |||||
LLE_FREE((ro)->ro_lle); \ | |||||
(ro)->ro_lle = NULL; \ | |||||
} \ | |||||
*(cookiep) = cookie; \ | *(cookiep) = cookie; \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
struct ifmultiaddr; | struct ifmultiaddr; | ||||
struct rib_head; | struct rib_head; | ||||
void rt_ieee80211msg(struct ifnet *, int, void *, size_t); | void rt_ieee80211msg(struct ifnet *, int, void *, size_t); | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |