36 fib_entry_src_vft[source] = *vft;
45 return (esrc1->
fes_src - esrc2->fes_src);
59 if (
NULL != fib_entry_src_vft[source].fesv_init)
61 fib_entry_src_vft[source].
fesv_init(&esrc);
138 if (
NULL != fib_entry_src_vft[source].fesv_deinit)
151 if (
NULL != fib_entry_src_vft[source].fesv_cover_change)
153 return (fib_entry_src_vft[source].fesv_cover_change(
169 if (
NULL != fib_entry_src_vft[source].fesv_cover_update)
171 return (fib_entry_src_vft[source].fesv_cover_update(
390 if (
NULL != path_ext)
452 .n_recursive_constrained = 0,
454 .preference = 0xffff,
634 fib_entry->fe_adj_index);
662 int houston_we_are_go_for_install;
672 if (
NULL != fib_entry_src_vft[source].fesv_activate)
674 houston_we_are_go_for_install =
683 houston_we_are_go_for_install = !0;
701 if (0 != houston_we_are_go_for_install)
723 if (
NULL != fib_entry_src_vft[source].fesv_deactivate)
827 if (
NULL != fib_entry_src_vft[source].fesv_installed)
872 if (
NULL != fib_entry_src_vft[source].fesv_add)
874 fib_entry_src_vft[source].
fesv_add(esrc,
917 old_path_list_index = esrc->
fes_pl;
925 if (
NULL != fib_entry_src_vft[source].fesv_add)
927 fib_entry_src_vft[source].
fesv_add(esrc,
975 old_path_list = esrc->
fes_pl;
977 if (
NULL != fib_entry_src_vft[source].fesv_remove)
1136 old_path_list = esrc->
fes_pl;
1138 ASSERT(
NULL != fib_entry_src_vft[source].fesv_path_add);
1143 fib_entry_src_vft[source].
fesv_path_add(esrc, fib_entry, pl_flags, rpath);
1194 old_path_list = esrc->
fes_pl;
1196 ASSERT(
NULL != fib_entry_src_vft[source].fesv_path_swap);
1238 old_path_list = esrc->
fes_pl;
1240 ASSERT(
NULL != fib_entry_src_vft[source].fesv_path_remove);
1275 if (
NULL != fib_entry_src_vft[source].fesv_format)
1277 return (fib_entry_src_vft[source].fesv_format(esrc, s));
1412 NULL != fib_entry_src_vft[source].fesv_set_data)
1414 fib_entry_src_vft[source].
fesv_set_data(esrc, fib_entry, data);
1429 NULL != fib_entry_src_vft[source].fesv_get_data)
1431 return (fib_entry_src_vft[source].fesv_get_data(esrc, fib_entry));
static int fib_entry_src_cmp_for_sort(void *v1, void *v2)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
fib_entry_src_cover_res_t fib_entry_src_action_cover_change(fib_entry_t *fib_entry, fib_source_t source)
int fib_path_is_resolved(fib_node_index_t path_index)
fib_protocol_t fp_proto
protocol type
Contribute an object that is to be used to forward BIER packets.
fib_entry_src_init_t fesv_init
Contribute an object that is to be used to forward IP6 packets.
#define FIB_ENTRY_DBG(_e, _fmt, _args...)
Debug macro.
ip46_address_t frp_addr
The next-hop address.
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
fib_path_ext_type_t fpe_type
The type of path extension.
void fib_entry_unlock(fib_node_index_t fib_entry_index)
Contribute an object that is to be used to forward IP6 packets.
fib_node_index_t path_index
The index of the FIB path.
static int fib_entry_src_valid_out_label(mpls_label_t label)
void fib_path_contribute_forwarding(fib_node_index_t path_index, fib_forward_chain_type_t fct, dpo_id_t *dpo)
fib_entry_src_set_data_t fesv_set_data
struct fib_entry_src_collect_forwarding_ctx_t_ fib_entry_src_collect_forwarding_ctx_t
static int fib_urpf_check_size(index_t ui)
Data-Plane function to check the size of an uRPF list, (i.e.
void fib_path_list_child_remove(fib_node_index_t path_list_index, u32 si)
fib_protocol_t fib_entry_get_proto(const fib_entry_t *fib_entry)
fib_entry_flag_t fib_entry_get_flags_i(const fib_entry_t *fib_entry)
A representation of a path as described by a route producer.
dpo_id_t path_dpo
ID of the Data-path object.
fib_forward_chain_type_t fct
static void fib_entry_src_action_fwd_update(const fib_entry_t *fib_entry, fib_source_t source)
adj_index_t fib_path_list_get_adj(fib_node_index_t path_list_index, fib_forward_chain_type_t type)
Virtual function table each FIB entry source will register.
u32 fib_path_list_get_resolving_interface(fib_node_index_t path_list_index)
static int dpo_id_is_valid(const dpo_id_t *dpoi)
Return true if the DPO object is valid, i.e.
static fib_entry_src_t * fib_entry_src_find_or_create(fib_entry_t *fib_entry, fib_source_t source, u32 *index)
Information related to the source of a FIB entry.
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.
void load_balance_set_urpf(index_t lbi, index_t urpf)
An MPLS extension that maintains the path's outgoing labels,.
int fib_path_is_exclusive(fib_node_index_t path_index)
void fib_entry_src_action_deactivate(fib_entry_t *fib_entry, fib_source_t source)
load_balance_path_t * next_hops
enum fib_entry_delegate_type_t_ fib_entry_delegate_type_t
Delegate types.
u32 mpls_label_t
A label value only, i.e.
dpo_proto_t fib_forw_chain_type_to_dpo_proto(fib_forward_chain_type_t fct)
Convert from a chain type to the DPO proto it will install.
#define MPLS_IETF_IMPLICIT_NULL_LABEL
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
Result from a cover update/change.
void fib_path_list_walk(fib_node_index_t path_list_index, fib_path_list_walk_fn_t func, void *ctx)
Contribute an object that is to be used to forward IP4 packets.
u32 fe_fib_index
The index of the FIB table this entry is in.
fib_entry_src_t * fe_srcs
Vector of source infos.
static void fib_entry_recursive_loop_detect_i(fib_node_index_t path_list_index)
void fib_entry_src_action_deinit(fib_entry_t *fib_entry, fib_source_t source)
u32 fib_path_list_child_add(fib_node_index_t path_list_index, fib_node_type_t child_type, fib_node_index_t child_index)
dpo_id_t fd_dpo
Valid for the forwarding chain delegates.
fib_node_index_t fe_parent
the path-list for which this entry is a child.
void fib_entry_src_mpls_register(void)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
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.
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)
void fib_entry_src_adj_register(void)
dpo_proto_t fp_payload_proto
This protocol determines the payload protocol of packets that will be forwarded by this entry once th...
u32 fe_sibling
index of this entry in the parent's child list.
flow_hash_config_t fib_table_get_default_flow_hash_config(fib_protocol_t proto)
Get the flow hash configured used by the protocol.
fib_entry_flag_t fib_entry_get_flags_for_source(fib_node_index_t entry_index, fib_source_t source)
const int fib_entry_get_dpo_for_source(fib_node_index_t fib_entry_index, fib_source_t source, dpo_id_t *dpo)
u32 fib_entry_get_resolving_interface_for_source(fib_node_index_t entry_index, fib_source_t source)
void fib_entry_src_lisp_register(void)
u32 frp_sw_if_index
The interface.
fib_entry_src_flag_t fib_entry_src_action_path_remove(fib_entry_t *fib_entry, fib_source_t source, const fib_route_path_t *rpath)
fib_entry_t * fib_entry_src_action_path_add(fib_entry_t *fib_entry, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *rpath)
index_t fib_urpf_list_alloc_and_lock(void)
#define MPLS_IS_REPLICATE
The top bit of the index, which is the result of the MPLS lookup is used to determine if the DPO is a...
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Aggregrate type for a prefix.
fib_entry_src_path_add_t fesv_path_add
fib_node_index_t fib_entry_get_index(const fib_entry_t *fib_entry)
void load_balance_multipath_update(const dpo_id_t *dpo, const load_balance_path_t *raw_nhs, load_balance_flags_t flags)
Contribute an object that is to be used to forward Ethernet packets.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
void fib_entry_src_api_register(void)
u16 fib_path_get_weight(fib_node_index_t path_index)
void fib_urpf_list_append(index_t ui, u32 sw_if_index)
Append another interface to the list.
fib_path_ext_t * fib_path_ext_list_find_by_path_index(const fib_path_ext_list_t *list, fib_node_index_t path_index)
A adj-source extension indicating the path's refinement criteria result.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Contribute an object that is to be used to forward end-of-stack MPLS packets.
void fib_entry_src_mk_lb(fib_entry_t *fib_entry, const fib_entry_src_t *esrc, fib_forward_chain_type_t fct, dpo_id_t *dpo_lb)
void fib_path_ext_list_flush(fib_path_ext_list_t *list)
void fib_entry_src_default_route_register(void)
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
fib_entry_t * fib_entry_src_action_add(fib_entry_t *fib_entry, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
static int fib_route_attached_cross_table(const fib_entry_t *fib_entry, const fib_route_path_t *rpath)
enum fib_source_t_ fib_source_t
The different sources that can create a route.
fib_entry_src_fwd_update_t fesv_fwd_update
#define FOR_EACH_DELEGATE_CHAIN(_entry, _fdt, _fed, _body)
fib_entry_src_deinit_t fesv_deinit
dpo_type_t dpoi_type
the type
void load_balance_set_fib_entry_flags(index_t lbi, fib_entry_flag_t flags)
load-balancing over a choice of [un]equal cost paths
#define MPLS_LABEL_IS_REAL(_lbl)
#define vec_del1(v, i)
Delete the element at index I.
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.
static void fib_entry_src_get_path_forwarding(fib_node_index_t path_index, fib_entry_src_collect_forwarding_ctx_t *ctx)
void fib_path_list_lock(fib_node_index_t path_list_index)
static fib_entry_src_t * fib_entry_src_find(const fib_entry_t *fib_entry, fib_source_t source, u32 *index)
#define FIB_SOURCE_MAX
The maximum number of sources.
void fib_entry_src_action_init(fib_entry_t *fib_entry, fib_source_t source)
enum load_balance_flags_t_ load_balance_flags_t
Flags controlling load-balance creation and modification.
fib_entry_src_flag_t fib_entry_src_action_remove(fib_entry_t *fib_entry, fib_source_t source)
static void fib_entry_flags_update(const fib_entry_t *fib_entry, const fib_route_path_t *rpath, fib_path_list_flags_t *pl_flags, fib_entry_src_t *esrc)
void replicate_multipath_update(const dpo_id_t *dpo, load_balance_path_t *next_hops)
int fib_path_list_is_popular(fib_node_index_t path_list_index)
void fib_entry_src_action_installed(const fib_entry_t *fib_entry, fib_source_t source)
Contribute an object that is to be used to forward NSH packets.
#define vec_free(V)
Free vector's memory (no header).
void fib_entry_src_action_activate(fib_entry_t *fib_entry, fib_source_t source)
void fib_urpf_list_bake(index_t ui)
Convert the uRPF list from the itf set obtained during the walk to a unique list. ...
void fib_entry_src_rr_register(void)
#define MPLS_IETF_IPV4_EXPLICIT_NULL_LABEL
fib_path_list_flags_t fib_entry_src_flags_2_path_list_flags(fib_entry_flag_t eflags)
fib_entry_src_remove_t fesv_remove
fib_entry_src_deactivate_t fesv_deactivate
u32 fib_path_list_get_n_paths(fib_node_index_t path_list_index)
u32 fib_node_index_t
A typedef of a node index.
u32 adj_index_t
An index for adjacencies.
fib_forward_chain_type_t fib_entry_delegate_type_to_chain_type(fib_entry_delegate_type_t fdt)
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.
void fib_path_list_unlock(fib_node_index_t path_list_index)
index_t replicate_create(u32 n_buckets, dpo_proto_t rep_proto)
fib_entry_t * fib_entry_get(fib_node_index_t index)
enum fib_entry_flag_t_ fib_entry_flag_t
void fib_entry_src_interface_register(void)
void fib_entry_lock(fib_node_index_t fib_entry_index)
int fib_path_list_recursive_loop_detect(fib_node_index_t path_list_index, fib_node_index_t **entry_indicies)
fib_entry_flag_t fes_entry_flags
Flags the source contributes to the entry.
int n_recursive_constrained
fib_source_t fes_src
Which source this info block is for.
fib_entry_src_cover_res_t fib_entry_src_action_cover_update(fib_entry_t *fib_entry, fib_source_t source)
fib_entry_src_flag_t fes_flags
Flags on the source.
void fib_entry_src_special_register(void)
fib_entry_t * fib_entry_src_action_path_swap(fib_entry_t *fib_entry, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *rpaths)
int fib_path_is_deag(fib_node_index_t path_index)
void fib_entry_src_module_init(void)
void fib_entry_src_register(fib_source_t source, const fib_entry_src_vft_t *vft)
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
fib_route_path_flags_t frp_flags
flags on the path
fib_entry_t * fib_entry_src_action_update(fib_entry_t *fib_entry, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
From the control plane API.
enum fib_entry_src_flag_t_ fib_entry_src_flag_t
A path that resolves via another table.
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
fib_entry_src_path_remove_t fesv_path_remove
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
fib_entry_src_path_swap_t fesv_path_swap
dpo_id_t fe_lb
The load-balance used for forwarding.
fib_node_index_t fes_pl
The path-list created by the source.
static dpo_proto_t fib_prefix_get_payload_proto(const fib_prefix_t *pfx)
int fib_path_is_recursive_constrained(fib_node_index_t path_index)
fib_path_ext_adj_flags_t fpe_adj_flags
For an ADJ type extension.
const fib_entry_src_t * esrc
enum fib_path_list_walk_rc_t_ fib_path_list_walk_rc_t
return code to control pat-hlist walk
index_t dpoi_index
the index of objects of that type
void fib_path_stack_mpls_disp(fib_node_index_t path_index, dpo_proto_t payload_proto, dpo_id_t *dpo)
#define FIB_NODE_INDEX_INVALID
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 path_weight
weight for the path.
u16 fib_path_get_preference(fib_node_index_t path_index)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
fib_entry_src_activate_t fesv_activate
void fib_urpf_list_unlock(index_t ui)
#define MPLS_IETF_IPV6_EXPLICIT_NULL_LABEL
One path from an [EU]CMP set that the client wants to add to a load-balance object.
u8 * fib_entry_src_format(fib_entry_t *fib_entry, fib_source_t source, u8 *s)
void fib_path_list_contribute_forwarding(fib_node_index_t path_list_index, fib_forward_chain_type_t fct, fib_path_list_fwd_flags_t flags, dpo_id_t *dpo)
void fib_entry_set_source_data(fib_node_index_t fib_entry_index, fib_source_t source, const void *data)
fib_entry_src_add_t fesv_add
index_t fib_path_list_get_urpf(fib_node_index_t path_list_index)
Return the the child the RPF list pre-built for this path list.
fib_forward_chain_type_t fib_entry_chain_type_fixup(const fib_entry_t *entry, fib_forward_chain_type_t fct)
Turn the chain type requested by the client into the one they really wanted.
void fib_entry_src_action_reactivate(fib_entry_t *fib_entry, fib_source_t source)
load_balance_flags_t fib_entry_calc_lb_flags(fib_entry_src_collect_forwarding_ctx_t *ctx)
Determine whether this FIB entry should use a load-balance MAP to support PIC edge fast convergence...
const fib_entry_t * fib_entry
static fib_path_list_walk_rc_t fib_entry_src_collect_forwarding(fib_node_index_t pl_index, fib_node_index_t path_index, void *arg)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_foreach(var, vec)
Vector iterator.
A path extension is a per-entry addition to the forwarding information when packets are sent for that...
adj_index_t fib_entry_get_adj_for_source(fib_node_index_t fib_entry_index, fib_source_t source)
u8 fes_ref_count
1 bytes ref count.
fib_path_ext_list_t fes_path_exts
A vector of path extensions.
dpo_proto_t fib_entry_get_dpo_proto(const fib_entry_t *fib_entry)
static int fib_path_is_attached(const fib_route_path_t *rpath)
Contribute an object that is to be used to forward non-end-of-stack MPLS packets. ...
const void * fib_entry_get_source_data(fib_node_index_t fib_entry_index, fib_source_t source)
enum fib_path_list_flags_t_ fib_path_list_flags_t
A Delagate is a means to implmenet the Delagation design pattern; the extension of an objects functio...
#define ip46_address_is_zero(ip46)
Contribute an object that is to be used to forward IP4 packets.
fib_forward_chain_type_t fib_forw_chain_type_from_dpo_proto(dpo_proto_t proto)
Convert from a payload-protocol to a chain type.
fib_forward_chain_type_t fib_entry_get_default_chain_type(const fib_entry_t *fib_entry)
void fib_entry_src_action_install(fib_entry_t *fib_entry, fib_source_t source)
fib_entry_src_installed_t fesv_installed
const fib_prefix_t fe_prefix
The prefix of the route.
void fib_entry_src_action_uninstall(fib_entry_t *fib_entry)
load_balance_path_t * fib_path_ext_stack(fib_path_ext_t *path_ext, fib_forward_chain_type_t child_fct, fib_forward_chain_type_t imp_null_fct, load_balance_path_t *nhs)