191 if (fib_entry_cover_index != fib_entry_index)
323 return (fib_entry_index);
365 return (fib_entry_index);
395 return (fib_entry_index);
492 const ip46_address_t *next_hop,
493 u32 next_hop_sw_if_index,
494 u32 next_hop_fib_index,
502 .frp_sw_if_index = next_hop_sw_if_index,
503 .frp_fib_index = next_hop_fib_index,
504 .frp_weight = next_hop_weight,
505 .frp_flags = path_flags,
506 .frp_label = next_hop_label,
515 source, flags, paths);
518 return (fib_entry_index);
556 return (fib_entry_index);
628 const ip46_address_t *next_hop,
629 u32 next_hop_sw_if_index,
630 u32 next_hop_fib_index,
643 .frp_sw_if_index = next_hop_sw_if_index,
644 .frp_fib_index = next_hop_fib_index,
645 .frp_weight = next_hop_weight,
646 .frp_flags = path_flags,
707 return (fib_entry_index);
716 const ip46_address_t *next_hop,
717 u32 next_hop_sw_if_index,
718 u32 next_hop_fib_index,
727 .frp_sw_if_index = next_hop_sw_if_index,
728 .frp_fib_index = next_hop_fib_index,
729 .frp_weight = next_hop_weight,
730 .frp_flags = path_flags,
731 .frp_label = next_hop_label,
743 return (fib_entry_index);
824 fib_entry_index, &prefix, source);
851 return (fib_entry_index);
981 const char *
const fmt,
void dpo_unlock(dpo_id_t *dpo)
Release a reference counting lock on the DPO.
u32 fib_table_create_and_lock(fib_protocol_t proto, const char *const fmt,...)
Create a new table with no table ID.
fib_protocol_t fp_proto
protocol type
u32 fib_entry_get_fib_index(fib_node_index_t fib_entry_index)
fib_protocol_t frp_proto
The protocol of the address below.
void mpls_fib_table_entry_remove(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
ip46_address_t frp_addr
The next-hop address.
void fib_entry_unlock(fib_node_index_t fib_entry_index)
fib_protocol_t ft_proto
Which protocol this table serves.
fib_node_index_t fib_table_lookup_exact_match(u32 fib_index, const fib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
A representation of a path as described by a route producer.
int fib_route_path_cmp(const fib_route_path_t *rpath1, const fib_route_path_t *rpath2)
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.
fib_entry_src_flag_t fib_entry_path_remove(fib_node_index_t fib_entry_index, fib_source_t source, const fib_route_path_t *rpath)
void fib_entry_path_add(fib_node_index_t fib_entry_index, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *rpath)
void fib_entry_get_prefix(fib_node_index_t fib_entry_index, fib_prefix_t *pfx)
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
u32 mpls_label_t
A label value only, i.e.
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
fib_node_index_t fib_table_entry_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *paths)
Update an entry to have a new set of paths.
u32 mpls_fib_table_find_or_create_and_lock(u32 table_id)
static fib_node_index_t fib_table_get_less_specific_i(fib_table_t *fib_table, const fib_prefix_t *prefix)
void fib_table_entry_path_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_protocol_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_route_path_flags_t path_flags)
remove one path to an entry (aka route) in the FIB.
void fib_table_fwding_dpo_remove(u32 fib_index, const fib_prefix_t *prefix, const dpo_id_t *dpo)
remove an entry in the FIB's forwarding table
void mpls_fib_table_destroy(mpls_fib_t *mf)
void fib_table_entry_local_label_remove(u32 fib_index, const fib_prefix_t *prefix, mpls_label_t label)
remove a MPLS local label for the prefix/route.
int fib_prefix_is_host(const fib_prefix_t *prefix)
Return true is the prefix is a host prefix.
static void vlib_smp_unsafe_warning(void)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
void mpls_fib_table_entry_insert(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos, fib_node_index_t lfei)
flow_hash_config_t fib_table_get_flow_hash_config(u32 fib_index, fib_protocol_t proto)
Get the flow hash configured used by the table.
fib_node_index_t fib_table_entry_path_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_protocol_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, mpls_label_t next_hop_label, fib_route_path_flags_t path_flags)
Add one path to an entry (aka route) in the FIB.
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
fib_node_index_t ip6_fib_table_lookup_exact_match(u32 fib_index, const ip6_address_t *addr, u32 len)
static void fib_table_post_insert_actions(fib_table_t *fib_table, const fib_prefix_t *prefix, fib_node_index_t fib_entry_index)
void fib_entry_special_update(fib_node_index_t fib_entry_index, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
u32 frp_sw_if_index
The interface.
static fib_node_index_t fib_table_lookup_exact_match_i(const fib_table_t *fib_table, const fib_prefix_t *prefix)
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
flow_hash_config_t ip6_fib_table_get_flow_hash_config(u32 fib_index)
u8 * format_fib_prefix(u8 *s, va_list *args)
void fib_table_flush(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Flush all entries from a table for the source.
Aggregrate type for a prefix.
#define clib_warning(format, args...)
enum fib_route_path_flags_t_ fib_route_path_flags_t
Path flags from the control plane.
u32 ip4_fib_table_find_or_create_and_lock(u32 table_id)
Get or create an IPv4 fib.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
u16 fp_len
The mask length.
void fib_table_entry_path_remove2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, const fib_route_path_t *rpath)
Remove n paths to an entry (aka route) in the FIB.
void ip4_fib_table_destroy(ip4_fib_t *fib)
void ip4_fib_table_entry_remove(ip4_fib_t *fib, const ip4_address_t *addr, u32 len)
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
u32 ip6_fib_table_get_index_for_sw_if_index(u32 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...
void fib_table_unlock(u32 fib_index, fib_protocol_t proto)
Take a reference counting lock on the table.
static void fib_table_entry_insert(fib_table_t *fib_table, const fib_prefix_t *prefix, fib_node_index_t fib_entry_index)
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, adj_index_t adj_index)
Add a 'special' entry to the FIB that links to the adj passed A special entry is an entry that the FI...
enum fib_source_t_ fib_source_t
The different sources that can create a route.
void ip6_fib_table_fwding_dpo_update(u32 fib_index, const ip6_address_t *addr, u32 len, const dpo_id_t *dpo)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
static u32 ip6_fib_index_from_table_id(u32 table_id)
flow_hash_config_t ip4_fib_table_get_flow_hash_config(u32 fib_index)
void ip6_fib_table_fwding_dpo_remove(u32 fib_index, const ip6_address_t *addr, u32 len, const dpo_id_t *dpo)
u32 ft_total_route_counts
Total route counters.
u32 fib_table_get_num_entries(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Return the number of entries in the FIB added by a given source.
u16 ft_locks
number of locks on the table
fib_entry_src_flag_t fib_entry_delete(fib_node_index_t fib_entry_index, fib_source_t source)
fib_entry_delete
fib_node_index_t fib_entry_create_special(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
void ip4_fib_table_fwding_dpo_update(ip4_fib_t *fib, const ip4_address_t *addr, u32 len, const dpo_id_t *dpo)
struct fib_table_t_ * fibs
A pool of all the MPLS FIBs.
void ip6_fib_table_entry_remove(u32 fib_index, const ip6_address_t *addr, u32 len)
fib_node_index_t ip4_fib_table_lookup(const ip4_fib_t *fib, const ip4_address_t *addr, u32 len)
The IPv4 FIB.
static void fib_table_entry_delete_i(u32 fib_index, fib_node_index_t fib_entry_index, const fib_prefix_t *prefix, fib_source_t source)
void ip4_fib_table_entry_insert(ip4_fib_t *fib, const ip4_address_t *addr, u32 len, fib_node_index_t fib_entry_index)
u32 mpls_fib_table_create_and_lock(void)
fib_node_index_t ft_index
Index into FIB vector.
static fib_node_index_t fib_table_lookup_i(fib_table_t *fib_table, const fib_prefix_t *prefix)
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
u32 ip6_fib_table_create_and_lock(void)
fib_node_index_t fib_table_entry_special_dpo_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Update a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the...
void ip6_fib_table_destroy(u32 fib_index)
fib_node_index_t fib_table_entry_local_label_add(u32 fib_index, const fib_prefix_t *prefix, mpls_label_t label)
Add a MPLS local label for the prefix/route.
void fib_table_fwding_dpo_update(u32 fib_index, const fib_prefix_t *prefix, const dpo_id_t *dpo)
Add or update an entry in the FIB's forwarding table.
u32 ft_table_id
Table ID (hash key) for this FIB.
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
static void fib_table_destroy(fib_table_t *fib_table)
#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 ip4_fib_t * ip4_fib_get(u32 index)
Get the FIB at the given index.
static void fib_table_route_path_fixup(const fib_prefix_t *prefix, fib_route_path_t *path)
fib_table_route_path_fixup
u8 * ft_desc
Table description.
static void fib_table_entry_remove(fib_table_t *fib_table, const fib_prefix_t *prefix, fib_node_index_t fib_entry_index)
void fib_entry_cover_change_notify(fib_node_index_t cover_index, fib_node_index_t covered)
u32 fib_node_index_t
A typedef of a node index.
static int fib_route_path_cmp_for_sort(void *v1, void *v2)
static u32 ip4_fib_index_from_table_id(u32 table_id)
u32 adj_index_t
An index for adjacencies.
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
u32 mpls_fib_index_from_table_id(u32 table_id)
void fib_entry_lock(fib_node_index_t fib_entry_index)
enum fib_entry_flag_t_ fib_entry_flag_t
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...
u32 fib_table_get_table_id_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the Table-ID of the FIB bound to the interface.
const void * fib_entry_get_source_data(fib_node_index_t fib_entry_index, fib_source_t source)
void mpls_fib_forwarding_table_reset(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos)
fib_node_index_t fib_table_entry_path_add2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *rpath)
Add n paths to an entry (aka route) in the FIB.
static mpls_fib_t * mpls_fib_get(fib_node_index_t index)
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
u32 ft_src_route_counts[FIB_SOURCE_MAX]
Per-source route counters.
void mpls_fib_forwarding_table_update(mpls_fib_t *mf, mpls_label_t label, mpls_eos_bit_t eos, const dpo_id_t *dpo)
enum fib_entry_src_flag_t_ fib_entry_src_flag_t
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
u8 * format_fib_protocol(u8 *s, va_list ap)
fib_node_index_t fib_table_entry_update_one_path(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_protocol_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, mpls_label_t next_hop_label, fib_route_path_flags_t path_flags)
Update the entry to have just one path.
u8 * format_fib_table_name(u8 *s, va_list ap)
Format the description/name of the table.
fib_node_index_t fib_entry_create(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *paths)
#define FIB_NODE_INDEX_INVALID
u32 ip6_fib_table_find_or_create_and_lock(u32 table_id)
Get or create an IPv6 fib.
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
void ip6_fib_table_entry_insert(u32 fib_index, const ip6_address_t *addr, u32 len, fib_node_index_t fib_entry_index)
#define DPO_INVALID
An initialiser for DPos declared on the stack.
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
#define FIB_PROTOCOL_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements...
void fib_entry_update(fib_node_index_t fib_entry_index, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *paths)
fib_entry_update
ip4_main_t ip4_main
Global ip4 main structure.
struct fib_table_t_ * fibs
Vector of FIBs.
fib_node_index_t ip6_fib_table_lookup(u32 fib_index, const ip6_address_t *addr, u32 len)
void ip4_fib_table_fwding_dpo_remove(ip4_fib_t *fib, const ip4_address_t *addr, u32 len, const dpo_id_t *dpo)
u32 ip4_fib_table_create_and_lock(void)
fib_node_index_t ip4_fib_table_lookup_exact_match(const ip4_fib_t *fib, const ip4_address_t *addr, u32 len)
#define ip46_address_is_zero(ip46)
struct fib_table_t_ * fibs
void fib_entry_set_source_data(fib_node_index_t fib_entry_index, fib_source_t source, const void *data)
void fib_entry_special_add(fib_node_index_t fib_entry_index, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
const ip46_address_t zero_addr
fib_entry_src_flag_t fib_entry_special_remove(fib_node_index_t fib_entry_index, fib_source_t source)
flow_hash_config_t mpls_fib_table_get_flow_hash_config(u32 fib_index)
A protocol Independent FIB table.
fib_node_index_t fib_table_get_less_specific(u32 fib_index, const fib_prefix_t *prefix)
Get the less specific (covering) prefix.