Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/route/route_var.h
Show All 29 Lines | |||||
*/ | */ | ||||
#ifndef _NET_ROUTE_VAR_H_ | #ifndef _NET_ROUTE_VAR_H_ | ||||
#define _NET_ROUTE_VAR_H_ | #define _NET_ROUTE_VAR_H_ | ||||
#ifndef RNF_NORMAL | #ifndef RNF_NORMAL | ||||
#include <net/radix.h> | #include <net/radix.h> | ||||
#endif | #endif | ||||
#include <sys/ck.h> | |||||
#include <sys/epoch.h> | #include <sys/epoch.h> | ||||
#include <netinet/in.h> /* struct sockaddr_in */ | #include <netinet/in.h> /* struct sockaddr_in */ | ||||
#include <sys/counter.h> | #include <sys/counter.h> | ||||
struct nh_control; | struct nh_control; | ||||
typedef int rnh_preadd_entry_f_t(u_int fibnum, const struct sockaddr *addr, | typedef int rnh_preadd_entry_f_t(u_int fibnum, const struct sockaddr *addr, | ||||
const struct sockaddr *mask, struct nhop_object *nh); | const struct sockaddr *mask, struct nhop_object *nh); | ||||
Show All 12 Lines | struct rib_head { | ||||
struct rmlock rib_lock; /* config/data path lock */ | struct rmlock rib_lock; /* config/data path lock */ | ||||
struct radix_mask_head rmhead; /* masks radix head */ | struct radix_mask_head rmhead; /* masks radix head */ | ||||
struct vnet *rib_vnet; /* vnet pointer */ | struct vnet *rib_vnet; /* vnet pointer */ | ||||
int rib_family; /* AF of the rtable */ | int rib_family; /* AF of the rtable */ | ||||
u_int rib_fibnum; /* fib number */ | u_int rib_fibnum; /* fib number */ | ||||
struct callout expire_callout; /* Callout for expiring dynamic routes */ | struct callout expire_callout; /* Callout for expiring dynamic routes */ | ||||
time_t next_expire; /* Next expire run ts */ | time_t next_expire; /* Next expire run ts */ | ||||
struct nh_control *nh_control; /* nexthop subsystem data */ | struct nh_control *nh_control; /* nexthop subsystem data */ | ||||
CK_STAILQ_HEAD(, rib_subscription) rnh_subscribers;/* notification subscribers */ | |||||
}; | }; | ||||
#define RIB_RLOCK_TRACKER struct rm_priotracker _rib_tracker | #define RIB_RLOCK_TRACKER struct rm_priotracker _rib_tracker | ||||
#define RIB_LOCK_INIT(rh) rm_init(&(rh)->rib_lock, "rib head lock") | #define RIB_LOCK_INIT(rh) rm_init(&(rh)->rib_lock, "rib head lock") | ||||
#define RIB_LOCK_DESTROY(rh) rm_destroy(&(rh)->rib_lock) | #define RIB_LOCK_DESTROY(rh) rm_destroy(&(rh)->rib_lock) | ||||
#define RIB_RLOCK(rh) rm_rlock(&(rh)->rib_lock, &_rib_tracker) | #define RIB_RLOCK(rh) rm_rlock(&(rh)->rib_lock, &_rib_tracker) | ||||
#define RIB_RUNLOCK(rh) rm_runlock(&(rh)->rib_lock, &_rib_tracker) | #define RIB_RUNLOCK(rh) rm_runlock(&(rh)->rib_lock, &_rib_tracker) | ||||
#define RIB_WLOCK(rh) rm_wlock(&(rh)->rib_lock) | #define RIB_WLOCK(rh) rm_wlock(&(rh)->rib_lock) | ||||
Show All 31 Lines | |||||
struct rib_head *rt_tables_get_rnh(int fib, int family); | struct rib_head *rt_tables_get_rnh(int fib, int family); | ||||
void rt_mpath_init_rnh(struct rib_head *rnh); | void rt_mpath_init_rnh(struct rib_head *rnh); | ||||
int rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum); | int rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum); | ||||
void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt); | void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt); | ||||
#ifdef RADIX_MPATH | #ifdef RADIX_MPATH | ||||
struct radix_node *rt_mpath_unlink(struct rib_head *rnh, | struct radix_node *rt_mpath_unlink(struct rib_head *rnh, | ||||
struct rt_addrinfo *info, struct rtentry *rto, int *perror); | struct rt_addrinfo *info, struct rtentry *rto, int *perror); | ||||
#endif | #endif | ||||
struct rib_cmd_info; | |||||
int add_route(struct rib_head *rnh, struct rt_addrinfo *info, | int add_route(struct rib_head *rnh, struct rt_addrinfo *info, | ||||
struct rtentry **ret_nrt); | struct rib_cmd_info *rc); | ||||
int del_route(struct rib_head *rnh, struct rt_addrinfo *info, | int del_route(struct rib_head *rnh, struct rt_addrinfo *info, | ||||
struct rtentry **ret_nrt); | struct rib_cmd_info *rc); | ||||
int change_route(struct rib_head *, struct rt_addrinfo *, | int change_route(struct rib_head *, struct rt_addrinfo *, | ||||
struct rtentry **); | struct rib_cmd_info *rc); | ||||
VNET_PCPUSTAT_DECLARE(struct rtstat, rtstat); | VNET_PCPUSTAT_DECLARE(struct rtstat, rtstat); | ||||
#define RTSTAT_ADD(name, val) \ | #define RTSTAT_ADD(name, val) \ | ||||
VNET_PCPUSTAT_ADD(struct rtstat, rtstat, name, (val)) | VNET_PCPUSTAT_ADD(struct rtstat, rtstat, name, (val)) | ||||
#define RTSTAT_INC(name) RTSTAT_ADD(name, 1) | #define RTSTAT_INC(name) RTSTAT_ADD(name, 1) | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |