Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/route_ctl.h
Show All 29 Lines | |||||
/* | /* | ||||
* This header file contains public functions and structures used for | * This header file contains public functions and structures used for | ||||
* routing table manipulations. | * routing table manipulations. | ||||
*/ | */ | ||||
#ifndef _NET_ROUTE_ROUTE_CTL_H_ | #ifndef _NET_ROUTE_ROUTE_CTL_H_ | ||||
#define _NET_ROUTE_ROUTE_CTL_H_ | #define _NET_ROUTE_ROUTE_CTL_H_ | ||||
#include <sys/ck.h> | |||||
struct rib_cmd_info { | struct rib_cmd_info { | ||||
uint8_t rc_cmd; /* RTM_ADD|RTM_DEL|RTM_CHANGE */ | uint8_t rc_cmd; /* RTM_ADD|RTM_DEL|RTM_CHANGE */ | ||||
uint8_t spare[3]; | uint8_t spare[3]; | ||||
uint32_t rc_nh_weight; /* new nhop weight */ | uint32_t rc_nh_weight; /* new nhop weight */ | ||||
struct rtentry *rc_rt; /* Target entry */ | struct rtentry *rc_rt; /* Target entry */ | ||||
struct nhop_object *rc_nh_old; /* Target nhop OR mpath */ | struct nhop_object *rc_nh_old; /* Target nhop OR mpath */ | ||||
struct nhop_object *rc_nh_new; /* Target nhop OR mpath */ | struct nhop_object *rc_nh_new; /* Target nhop OR mpath */ | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | struct rib_subscription *rib_subscribe_internal(struct rib_head *rnh, | ||||
rib_subscription_cb_t *f, void *arg, enum rib_subscription_type type, | rib_subscription_cb_t *f, void *arg, enum rib_subscription_type type, | ||||
bool waitok); | bool waitok); | ||||
struct rib_subscription *rib_subscribe_locked(struct rib_head *rnh, | struct rib_subscription *rib_subscribe_locked(struct rib_head *rnh, | ||||
rib_subscription_cb_t *f, void *arg, enum rib_subscription_type type); | rib_subscription_cb_t *f, void *arg, enum rib_subscription_type type); | ||||
void rib_unsubscribe(struct rib_subscription *rs); | void rib_unsubscribe(struct rib_subscription *rs); | ||||
void rib_unsubscribe_locked(struct rib_subscription *rs); | void rib_unsubscribe_locked(struct rib_subscription *rs); | ||||
void rib_notify(struct rib_head *rnh, enum rib_subscription_type type, | void rib_notify(struct rib_head *rnh, enum rib_subscription_type type, | ||||
struct rib_cmd_info *rc); | struct rib_cmd_info *rc); | ||||
/* Event bridge */ | |||||
/* Types of events */ | |||||
#define NLBR_EVENT_ROUTE 1 | |||||
/* Event providers */ | |||||
#define NLBR_PROVIDER_KERNEL 1 | |||||
#define NLBR_PROVIDER_RTSOCK 2 | |||||
#define NLBR_PROVIDER_NETLINK 3 | |||||
struct rib_event_bridge; | |||||
typedef void rib_event_bridge_cb_t(uint32_t event_type, uint32_t fibnum, | |||||
const struct rt_addrinfo *info, const struct rib_cmd_info *rc, void *arg); | |||||
struct rib_event_bridge { | |||||
rib_event_bridge_cb_t *reb_cb; | |||||
void *reb_cb_arg; | |||||
int reb_provider_id; | |||||
CK_STAILQ_ENTRY(rib_event_bridge) reb_link; | |||||
}; | |||||
void rib_bridge_generic_event(int provider_id, uint32_t event_type, uint32_t val1, | |||||
void *ptr1, void *ptr2); | |||||
void rib_bridge_rt_event(int provider_id, uint32_t fibnum, struct rt_addrinfo *info, | |||||
struct rib_cmd_info *rc); | |||||
void rib_bridge_link(struct rib_event_bridge *reb); | |||||
void rib_bridge_unlink(struct rib_event_bridge *reb); | |||||
#endif | #endif |