Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/nhop.h
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* Currently we verify whether link is up or not on every packet, which can be | * Currently we verify whether link is up or not on every packet, which can be | ||||
* quite costy. | * quite costy. | ||||
* TODO: subscribe for the interface notifications and update the nexthops | * TODO: subscribe for the interface notifications and update the nexthops | ||||
* with NHF_INVALID flag. | * with NHF_INVALID flag. | ||||
*/ | */ | ||||
#define NH_IS_VALID(_nh) RT_LINK_IS_UP((_nh)->nh_ifp) | #define NH_IS_VALID(_nh) RT_LINK_IS_UP((_nh)->nh_ifp) | ||||
#define NH_IS_MULTIPATH(_nh) ((_nh)->nh_flags & NHF_MULTIPATH) | #define NH_IS_NHGRP(_nh) ((_nh)->nh_flags & NHF_MULTIPATH) | ||||
#define RT_GATEWAY(_rt) ((struct sockaddr *)&(_rt)->rt_nhop->gw4_sa) | #define RT_GATEWAY(_rt) ((struct sockaddr *)&(_rt)->rt_nhop->gw4_sa) | ||||
#define RT_GATEWAY_CONST(_rt) ((const struct sockaddr *)&(_rt)->rt_nhop->gw4_sa) | #define RT_GATEWAY_CONST(_rt) ((const struct sockaddr *)&(_rt)->rt_nhop->gw4_sa) | ||||
#define NH_FREE(_nh) do { \ | #define NH_FREE(_nh) do { \ | ||||
nhop_free(_nh); \ | nhop_free(_nh); \ | ||||
/* guard against invalid refs */ \ | /* guard against invalid refs */ \ | ||||
_nh = NULL; \ | _nh = NULL; \ | ||||
} while (0) | } while (0) | ||||
struct weightened_nhop { | |||||
struct nhop_object *nh; | |||||
uint32_t weight; | |||||
}; | |||||
void nhop_free(struct nhop_object *nh); | void nhop_free(struct nhop_object *nh); | ||||
struct sysctl_req; | struct sysctl_req; | ||||
struct sockaddr_dl; | struct sockaddr_dl; | ||||
struct rib_head; | struct rib_head; | ||||
uint32_t nhop_get_idx(const struct nhop_object *nh); | uint32_t nhop_get_idx(const struct nhop_object *nh); | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |