Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_fib.h
Show All 31 Lines | |||||
#ifndef _NETINET_IN_FIB_H_ | #ifndef _NETINET_IN_FIB_H_ | ||||
#define _NETINET_IN_FIB_H_ | #define _NETINET_IN_FIB_H_ | ||||
/* Basic nexthop info used for uRPF/mtu checks */ | /* Basic nexthop info used for uRPF/mtu checks */ | ||||
struct nhop4_basic { | struct nhop4_basic { | ||||
struct ifnet *nh_ifp; /* Logical egress interface */ | struct ifnet *nh_ifp; /* Logical egress interface */ | ||||
uint16_t nh_mtu; /* nexthop mtu */ | uint16_t nh_mtu; /* nexthop mtu */ | ||||
uint16_t nh_flags; /* nhop flags */ | uint16_t nh_flags; /* nhop flags */ | ||||
struct in_addr nh_addr; /* GW/DST IPv4 address */ | uint8_t spare[4]; | ||||
union { /* GW/DST IPv4 address */ | |||||
struct in_addr nh_addr; | |||||
#ifdef INET6 | |||||
struct in6_addr nh_addr6; | |||||
#else | |||||
uint8_t nh_addr6[16]; | |||||
#endif | |||||
}; | }; | ||||
}; | |||||
/* Extended nexthop info used for control protocols */ | /* Extended nexthop info used for control protocols */ | ||||
struct nhop4_extended { | struct nhop4_extended { | ||||
struct ifnet *nh_ifp; /* Logical egress interface */ | struct ifnet *nh_ifp; /* Logical egress interface */ | ||||
uint16_t nh_mtu; /* nexthop mtu */ | uint16_t nh_mtu; /* nexthop mtu */ | ||||
uint16_t nh_flags; /* nhop flags */ | uint16_t nh_flags; /* nhop flags */ | ||||
uint8_t spare[4]; | uint8_t spare[4]; | ||||
struct in_addr nh_addr; /* GW/DST IPv4 address */ | |||||
struct in_addr nh_src; /* default source IPv4 address */ | struct in_addr nh_src; /* default source IPv4 address */ | ||||
uint64_t spare2[2]; | union { /* GW/DST IPv4 address */ | ||||
struct in_addr nh_addr; | |||||
#ifdef INET6 | |||||
struct in6_addr nh_addr6; | |||||
#else | |||||
uint8_t nh_addr6[16]; | |||||
#endif | |||||
}; | |||||
}; | }; | ||||
int fib4_lookup_nh_basic(uint32_t fibnum, struct in_addr dst, uint32_t flags, | int fib4_lookup_nh_basic(uint32_t fibnum, struct in_addr dst, uint32_t flags, | ||||
uint32_t flowid, struct nhop4_basic *pnh4); | uint32_t flowid, struct nhop4_basic *pnh4); | ||||
int fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flags, | int fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flags, | ||||
uint32_t flowid, struct nhop4_extended *pnh4); | uint32_t flowid, struct nhop4_extended *pnh4); | ||||
void fib4_free_nh_ext(uint32_t fibnum, struct nhop4_extended *pnh4); | void fib4_free_nh_ext(uint32_t fibnum, struct nhop4_extended *pnh4); | ||||
#endif | #endif | ||||