Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route.h
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | |||||
#define NHR_NONE 0x00 /* empty flags field */ | #define NHR_NONE 0x00 /* empty flags field */ | ||||
#define NHR_REF 0x01 /* reference nexhop */ | #define NHR_REF 0x01 /* reference nexhop */ | ||||
#define NHR_NODEFAULT 0x02 /* uRPF: do not consider default route */ | #define NHR_NODEFAULT 0x02 /* uRPF: do not consider default route */ | ||||
/* Control plane route request flags */ | /* Control plane route request flags */ | ||||
#define NHR_COPY 0x100 /* Copy rte data */ | #define NHR_COPY 0x100 /* Copy rte data */ | ||||
#define NHR_UNLOCKED 0x200 /* Do not lock table */ | #define NHR_UNLOCKED 0x200 /* Do not lock table */ | ||||
/* nd6 / arpresolve gateway type */ | |||||
/* FIXME need proper place */ | |||||
typedef enum { | |||||
GW_NONE = 0, | |||||
#ifdef INET | |||||
GW_IPV4_SRC, | |||||
#endif | |||||
#ifdef INET6 | |||||
GW_IPV6_SRC | |||||
#endif | |||||
} gw_type_t; | |||||
/* FIXME need proper place */ | |||||
static __inline gw_type_t | |||||
ro_get_gw_type(struct route *ro) | |||||
{ | |||||
if (ro == NULL || (ro->ro_flags & RT_HAS_GW) == 0) | |||||
return GW_NONE; | |||||
switch(ro->ro_dst.sa_family) { | |||||
#ifdef INET | |||||
case AF_INET: | |||||
return GW_IPV4_SRC; | |||||
#endif | |||||
#ifdef INET6 | |||||
case AF_INET6: | |||||
return GW_IPV6_SRC; | |||||
#endif | |||||
default: | |||||
return GW_NONE; | |||||
} | |||||
} | |||||
/* | /* | ||||
* Routing statistics. | * Routing statistics. | ||||
*/ | */ | ||||
struct rtstat { | struct rtstat { | ||||
uint64_t rts_badredirect; /* bogus redirect calls */ | uint64_t rts_badredirect; /* bogus redirect calls */ | ||||
uint64_t rts_dynamic; /* routes created by redirects */ | uint64_t rts_dynamic; /* routes created by redirects */ | ||||
uint64_t rts_newgateway; /* routes modified by redirects */ | uint64_t rts_newgateway; /* routes modified by redirects */ | ||||
uint64_t rts_unreach; /* lookups which failed */ | uint64_t rts_unreach; /* lookups which failed */ | ||||
▲ Show 20 Lines • Show All 213 Lines • Show Last 20 Lines |