Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/in6_fib.c
Show All 32 Lines | |||||
#include "opt_inet.h" | #include "opt_inet.h" | ||||
#include "opt_inet6.h" | #include "opt_inet6.h" | ||||
#include "opt_route.h" | #include "opt_route.h" | ||||
#include "opt_mpath.h" | #include "opt_mpath.h" | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/rwlock.h> | #include <sys/rmlock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <net/if_var.h> | #include <net/if_var.h> | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | |||||
* of "lo0") | * of "lo0") | ||||
* - howewer mtu from "transmit" interface will be returned. | * - howewer mtu from "transmit" interface will be returned. | ||||
* - scope will be embedded in nh_addr | * - scope will be embedded in nh_addr | ||||
*/ | */ | ||||
int | int | ||||
fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scopeid, | fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scopeid, | ||||
uint32_t flags, uint32_t flowid, struct nhop6_basic *pnh6) | uint32_t flags, uint32_t flowid, struct nhop6_basic *pnh6) | ||||
{ | { | ||||
RIB_RLOCK_TRACKER; | |||||
struct rib_head *rh; | struct rib_head *rh; | ||||
struct radix_node *rn; | struct radix_node *rn; | ||||
struct sockaddr_in6 sin6; | struct sockaddr_in6 sin6; | ||||
struct rtentry *rte; | struct rtentry *rte; | ||||
KASSERT((fibnum < rt_numfibs), ("fib6_lookup_nh_basic: bad fibnum")); | KASSERT((fibnum < rt_numfibs), ("fib6_lookup_nh_basic: bad fibnum")); | ||||
rh = rt_tables_get_rnh(fibnum, AF_INET6); | rh = rt_tables_get_rnh(fibnum, AF_INET6); | ||||
if (rh == NULL) | if (rh == NULL) | ||||
Show All 33 Lines | |||||
* - nh_ifp represents "address" interface if NHR_IFAIF flag is passed | * - nh_ifp represents "address" interface if NHR_IFAIF flag is passed | ||||
* - mtu from logical transmit interface will be returned. | * - mtu from logical transmit interface will be returned. | ||||
* - scope will be embedded in nh_addr | * - scope will be embedded in nh_addr | ||||
*/ | */ | ||||
int | int | ||||
fib6_lookup_nh_ext(uint32_t fibnum, const struct in6_addr *dst,uint32_t scopeid, | fib6_lookup_nh_ext(uint32_t fibnum, const struct in6_addr *dst,uint32_t scopeid, | ||||
uint32_t flags, uint32_t flowid, struct nhop6_extended *pnh6) | uint32_t flags, uint32_t flowid, struct nhop6_extended *pnh6) | ||||
{ | { | ||||
RIB_RLOCK_TRACKER; | |||||
struct rib_head *rh; | struct rib_head *rh; | ||||
struct radix_node *rn; | struct radix_node *rn; | ||||
struct sockaddr_in6 sin6; | struct sockaddr_in6 sin6; | ||||
struct rtentry *rte; | struct rtentry *rte; | ||||
KASSERT((fibnum < rt_numfibs), ("fib6_lookup_nh_ext: bad fibnum")); | KASSERT((fibnum < rt_numfibs), ("fib6_lookup_nh_ext: bad fibnum")); | ||||
rh = rt_tables_get_rnh(fibnum, AF_INET6); | rh = rt_tables_get_rnh(fibnum, AF_INET6); | ||||
if (rh == NULL) | if (rh == NULL) | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |