66 #define MPLS_FLOW_HASH_DEFAULT 0 73 return (label << 1 | eos);
99 memset(fib_table, 0,
sizeof(*fib_table));
124 mf = &fib_table->
mpls;
257 for (ii = 0; ii <
ARRAY_LEN(special_labels); ii++)
261 prefix.
fp_label = special_labels[ii];
354 vec_add1(lfeis, lfei);
408 else if (
unformat (input,
"table %d", &table_id))
416 if (table_id >= 0 && table_id != fib_table->ft_table_id)
419 vlib_cli_output (vm,
"%v, fib_index %d",
420 fib_table->ft_desc, mpls_main.fibs - fib_table);
422 if (MPLS_LABEL_INVALID == label)
424 mpls_fib_table_show_all(&(fib_table->mpls), vm);
428 mpls_fib_table_show_one(&(fib_table->mpls), label, vm);
436 .path =
"show mpls fib",
437 .short_help =
"show mpls fib [summary] [table <n>]",
static void mpls_fib_table_show_all(const mpls_fib_t *mpls_fib, vlib_main_t *vm)
fib_protocol_t fp_proto
protocol type
u8 * format_fib_entry(u8 *s, va_list *args)
void mpls_fib_table_entry_remove(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
#define hash_set(h, key, value)
sll srl srl sll sra u16x4 i
fib_protocol_t ft_proto
Which protocol this table serves.
#define hash_unset(h, key)
fib_node_index_t mpls_fib_table_lookup(const mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
void fib_table_lock(u32 fib_index, fib_protocol_t proto)
Release a reference counting lock on the table.
#define FIB_ENTRY_FORMAT_DETAIL
static clib_error_t * mpls_fib_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static index_t mpls_fib_drop_dpo_index
An MPLS_FIB table;.
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 lookup_dpo_add_or_lock_w_fib_index(fib_node_index_t fib_index, dpo_proto_t proto, lookup_input_t input, lookup_table_t table_config, dpo_id_t *dpo)
u32 mpls_fib_table_find_or_create_and_lock(u32 table_id)
#define MPLS_IETF_ROUTER_ALERT_LABEL
void mpls_fib_table_destroy(mpls_fib_t *mf)
void mpls_fib_table_entry_insert(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos, fib_node_index_t lfei)
index_t load_balance_create(u32 n_buckets, dpo_proto_t lb_proto, flow_hash_config_t fhc)
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
u32 fwd_classify_table_index
dpo_proto_t fp_payload_proto
This protocol determines the payload protocol of packets that will be forwarded by this entry once th...
static u32 mpls_fib_entry_mk_key(mpls_label_t label, mpls_eos_bit_t eos)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define hash_foreach(key_var, value_var, h, body)
Aggregrate type for a prefix.
const dpo_id_t * punt_dpo_get(dpo_proto_t proto)
u32 rev_classify_table_index
int fib_entry_cmp_for_sort(void *i1, void *i2)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static void hash_delete(void *bob)
dpo_type_t dpoi_type
the type
load-balancing over a choice of [un]equal cost paths
#define pool_put(P, E)
Free an object E in pool P.
static void mpls_fib_table_show_one(const mpls_fib_t *mpls_fib, mpls_label_t label, vlib_main_t *vm)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
struct fib_table_t_ * fibs
A pool of all the MPLS FIBs.
#define MPLS_FLOW_HASH_DEFAULT
FIXME.
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
u32 mpls_fib_table_create_and_lock(void)
fib_node_index_t ft_index
Index into FIB vector.
u32 ft_table_id
Table ID (hash key) for this FIB.
u32 ft_flow_hash_config
flow hash configuration
#define MPLS_LABEL_INVALID
#define vec_free(V)
Free vector's memory (no header).
void fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
static u32 mpls_fib_create_with_table_id(u32 table_id)
#define MPLS_IETF_IPV4_EXPLICIT_NULL_LABEL
u32 fib_node_index_t
A typedef of a node index.
u32 mpls_fib_index_from_table_id(u32 table_id)
#define VLIB_CLI_COMMAND(x,...)
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
#define FOR_EACH_MPLS_EOS_BIT(_eos)
#define hash_create(elts, value_bytes)
void mpls_fib_forwarding_table_reset(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
uword * mf_entries
A hash table of entries.
void mpls_fib_forwarding_table_update(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos, const dpo_id_t *dpo)
void load_balance_set_bucket(index_t lbi, u32 bucket, const dpo_id_t *next)
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
index_t dpoi_index
the index of objects of that type
#define FIB_NODE_INDEX_INVALID
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
#define MPLS_IETF_IPV6_EXPLICIT_NULL_LABEL
#define vec_foreach(var, vec)
Vector iterator.
#define CLIB_CACHE_LINE_BYTES
index_t mf_lbs[MPLS_FIB_DB_SIZE]
The load-balance indeices keyed by 21 bit label+eos bit.
uword * fib_index_by_table_id
A hash table to lookup the mpls_fib by table ID.
flow_hash_config_t mpls_fib_table_get_flow_hash_config(u32 fib_index)
A protocol Independent FIB table.
enum mpls_eos_bit_t_ mpls_eos_bit_t