18 #ifndef __MPLS_FIB_TABLE_H__ 19 #define __MPLS_FIB_TABLE_H__ 28 #define MPLS_FIB_DEFAULT_TABLE_ID 0 33 #define MPLS_FIB_KEY_SIZE 21 34 #define MPLS_FIB_DB_SIZE (1 << (MPLS_FIB_KEY_SIZE-1)) 39 #define MPLS_FLOW_HASH_DEFAULT 0 enum fib_source_t_ fib_source_t
The different sources that can create a route.
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
Required for pool_get_aligned.
u8 * format_mpls_fib_table_memory(u8 *s, va_list *args)
u32 * fib_index_by_sw_if_index
u32 mpls_label_t
A label value only, i.e.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
void mpls_fib_forwarding_table_update(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos, const dpo_id_t *dpo)
u32 mpls_fib_index_from_table_id(u32 table_id)
fib_node_index_t mpls_fib_table_entry_add_from_ip_fib_entry(u32 table_id, mpls_label_t label, mpls_eos_bit_t eos, fib_node_index_t fib_entry_index)
vl_api_interface_index_t sw_if_index
static u32 mpls_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
fib_node_index_t mpls_fib_table_lookup(const mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
struct mpls_fib_t_ mpls_fib_t
static u32 vnet_mpls_uc_get_label(mpls_label_t label_exp_s_ttl)
u8 * format_mpls_fib_table_name(u8 *s, va_list *args)
u32 fib_node_index_t
A typedef of a node index.
void mpls_fib_table_entry_insert(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos, fib_node_index_t fei)
fib_table_walk_rc_t(* fib_table_walk_fn_t)(fib_node_index_t fei, void *ctx)
Call back function when walking entries in a FIB table.
uword * mf_entries
A hash table of entries.
static mpls_fib_t * mpls_fib_get(fib_node_index_t index)
u32 mpls_fib_table_create_and_lock(fib_source_t src)
void mpls_fib_table_walk(mpls_fib_t *fib, fib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
void mpls_fib_table_entry_remove(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
void mpls_fib_forwarding_table_reset(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static u32 vnet_mpls_uc_get_s(mpls_label_t label_exp_s_ttl)
u32 mpls_fib_table_find_or_create_and_lock(u32 table_id, fib_source_t src)
static index_t mpls_fib_table_forwarding_lookup(u32 mpls_fib_index, const mpls_unicast_header_t *hdr)
Lookup a label and EOS bit in the MPLS_FIB table to retrieve the load-balance index to be used for pa...
index_t mf_lbs[MPLS_FIB_DB_SIZE]
The load-balance indices keyed by 21 bit label+eos bit.
struct mpls_fib_t_ * mpls_fibs
A pool of all the MPLS FIBs.
void mpls_fib_table_destroy(u32 fib_index)
enum mpls_eos_bit_t_ mpls_eos_bit_t