Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/fib_algo.h
Show All 30 Lines | |||||
struct fib_data; | struct fib_data; | ||||
struct fib_dp; | struct fib_dp; | ||||
enum flm_op_result { | enum flm_op_result { | ||||
FLM_SUCCESS, /* No errors, operation successful */ | FLM_SUCCESS, /* No errors, operation successful */ | ||||
FLM_REBUILD, /* Operation cannot be completed, schedule algorithm rebuild */ | FLM_REBUILD, /* Operation cannot be completed, schedule algorithm rebuild */ | ||||
FLM_ERROR, /* Operation failed, this algo cannot be used */ | FLM_ERROR, /* Operation failed, this algo cannot be used */ | ||||
FLM_BATCH, /* Operation cannot be completed, algorithm asks to batch changes */ | |||||
}; | }; | ||||
struct rib_rtable_info { | struct rib_rtable_info { | ||||
uint32_t num_prefixes; | uint32_t num_prefixes; | ||||
uint32_t num_nhops; | uint32_t num_nhops; | ||||
uint32_t num_nhgrp; | uint32_t num_nhgrp; | ||||
}; | }; | ||||
struct flm_lookup_key { | struct flm_lookup_key { | ||||
union { | union { | ||||
const struct in6_addr *addr6; | const struct in6_addr *addr6; | ||||
struct in_addr addr4; | struct in_addr addr4; | ||||
}; | }; | ||||
}; | }; | ||||
struct fib_change_entry { | |||||
union { | |||||
struct in_addr addr4; | |||||
struct in6_addr addr6; | |||||
}; | |||||
uint32_t scopeid; | |||||
uint8_t plen; | |||||
struct nhop_object *nh_old; | |||||
struct nhop_object *nh_new; | |||||
}; | |||||
struct fib_change_queue { | |||||
uint32_t count; | |||||
uint32_t size; | |||||
struct fib_change_entry *entries; | |||||
}; | |||||
typedef struct nhop_object *flm_lookup_t(void *algo_data, | typedef struct nhop_object *flm_lookup_t(void *algo_data, | ||||
const struct flm_lookup_key key, uint32_t scopeid); | const struct flm_lookup_key key, uint32_t scopeid); | ||||
typedef enum flm_op_result flm_init_t (uint32_t fibnum, struct fib_data *fd, | typedef enum flm_op_result flm_init_t (uint32_t fibnum, struct fib_data *fd, | ||||
void *_old_data, void **new_data); | void *_old_data, void **new_data); | ||||
typedef void flm_destroy_t(void *data); | typedef void flm_destroy_t(void *data); | ||||
typedef enum flm_op_result flm_dump_t(struct rtentry *rt, void *data); | typedef enum flm_op_result flm_dump_t(struct rtentry *rt, void *data); | ||||
typedef enum flm_op_result flm_dump_end_t(void *data, struct fib_dp *dp); | typedef enum flm_op_result flm_dump_end_t(void *data, struct fib_dp *dp); | ||||
typedef enum flm_op_result flm_change_t(struct rib_head *rnh, | typedef enum flm_op_result flm_change_t(struct rib_head *rnh, | ||||
struct rib_cmd_info *rc, void *data); | struct rib_cmd_info *rc, void *data); | ||||
typedef enum flm_op_result flm_change_batch_t(struct rib_head *rnh, | |||||
struct fib_change_queue *q, void *data); | |||||
typedef uint8_t flm_get_pref_t(const struct rib_rtable_info *rinfo); | typedef uint8_t flm_get_pref_t(const struct rib_rtable_info *rinfo); | ||||
struct fib_lookup_module { | struct fib_lookup_module { | ||||
char *flm_name; /* algo name */ | char *flm_name; /* algo name */ | ||||
int flm_family; /* address family this module supports */ | int flm_family; /* address family this module supports */ | ||||
int flm_refcount; /* # of references */ | int flm_refcount; /* # of references */ | ||||
uint32_t flm_flags; /* flags */ | uint32_t flm_flags; /* flags */ | ||||
uint8_t flm_index; /* internal algo index */ | uint8_t flm_index; /* internal algo index */ | ||||
flm_init_t *flm_init_cb; /* instance init */ | flm_init_t *flm_init_cb; /* instance init */ | ||||
flm_destroy_t *flm_destroy_cb; /* destroy instance */ | flm_destroy_t *flm_destroy_cb; /* destroy instance */ | ||||
flm_change_t *flm_change_rib_item_cb;/* routing table change hook */ | flm_change_t *flm_change_rib_item_cb;/* routing table change hook */ | ||||
flm_dump_t *flm_dump_rib_item_cb; /* routing table dump cb */ | flm_dump_t *flm_dump_rib_item_cb; /* routing table dump cb */ | ||||
flm_dump_end_t *flm_dump_end_cb; /* end of dump */ | flm_dump_end_t *flm_dump_end_cb; /* end of dump */ | ||||
flm_lookup_t *flm_lookup; /* lookup function */ | flm_lookup_t *flm_lookup; /* lookup function */ | ||||
flm_get_pref_t *flm_get_pref; /* get algo preference */ | flm_get_pref_t *flm_get_pref; /* get algo preference */ | ||||
flm_change_batch_t *flm_change_rib_items_cb;/* routing table change hook */ | |||||
void *spare[8]; /* Spare callbacks */ | |||||
TAILQ_ENTRY(fib_lookup_module) entries; | TAILQ_ENTRY(fib_lookup_module) entries; | ||||
}; | }; | ||||
/* Datapath lookup data */ | /* Datapath lookup data */ | ||||
struct fib_dp { | struct fib_dp { | ||||
flm_lookup_t *f; | flm_lookup_t *f; | ||||
void *arg; | void *arg; | ||||
}; | }; | ||||
Show All 24 Lines |