41 fib_entry_src_vft[source] = *vft;
50 return (esrc1->
fes_src - esrc2->fes_src);
64 if (
NULL != fib_entry_src_vft[source].fesv_init)
66 fib_entry_src_vft[source].
fesv_init(&esrc);
143 if (
NULL != fib_entry_src_vft[source].fesv_deinit)
156 if (
NULL != fib_entry_src_vft[source].fesv_cover_change)
158 return (fib_entry_src_vft[source].fesv_cover_change(
174 if (
NULL != fib_entry_src_vft[source].fesv_cover_update)
176 return (fib_entry_src_vft[source].fesv_cover_update(
294 if (
NULL != path_ext &&
523 fib_entry->fe_adj_index);
551 int houston_we_are_go_for_install;
561 if (
NULL != fib_entry_src_vft[source].fesv_activate)
563 houston_we_are_go_for_install =
572 houston_we_are_go_for_install = !0;
590 if (0 != houston_we_are_go_for_install)
612 if (
NULL != fib_entry_src_vft[source].fesv_deactivate)
716 if (
NULL != fib_entry_src_vft[source].fesv_installed)
761 if (
NULL != fib_entry_src_vft[source].fesv_add)
763 fib_entry_src_vft[source].
fesv_add(esrc,
806 old_path_list_index = esrc->
fes_pl;
814 if (
NULL != fib_entry_src_vft[source].fesv_add)
816 fib_entry_src_vft[source].
fesv_add(esrc,
864 old_path_list = esrc->
fes_pl;
866 if (
NULL != fib_entry_src_vft[source].fesv_remove)
1105 old_path_list = esrc->
fes_pl;
1107 ASSERT(
NULL != fib_entry_src_vft[source].fesv_path_add);
1112 fib_entry_src_vft[source].
fesv_path_add(esrc, fib_entry, pl_flags, rpath);
1177 old_path_list = esrc->
fes_pl;
1179 ASSERT(
NULL != fib_entry_src_vft[source].fesv_path_swap);
1195 vec_free(path_ext->fpe_label_stack);
1233 old_path_list = esrc->
fes_pl;
1235 ASSERT(
NULL != fib_entry_src_vft[source].fesv_path_remove);
1252 vec_free(path_ext->fpe_label_stack);
1293 if (
NULL != fib_entry_src_vft[source].fesv_format)
1295 return (fib_entry_src_vft[source].fesv_format(esrc, s));
1429 NULL != fib_entry_src_vft[source].fesv_set_data)
1431 fib_entry_src_vft[source].
fesv_set_data(esrc, fib_entry, data);
1446 NULL != fib_entry_src_vft[source].fesv_get_data)
1448 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
fib_entry_src_init_t fesv_init
#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
void fib_entry_unlock(fib_node_index_t fib_entry_index)
Contribute an object that is to be used to forward IP6 packets.
sll srl srl sll sra u16x4 i
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)
void fib_path_ext_resolve(fib_path_ext_t *path_ext, fib_node_index_t path_list_index)
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.
int fib_path_ext_cmp(fib_path_ext_t *path_ext, const fib_route_path_t *rpath)
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)
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.
#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)
#define ip46_address_cmp(ip46_1, ip46_2)
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)
void fib_path_ext_init(fib_path_ext_t *path_ext, fib_node_index_t path_list_index, const fib_route_path_t *rpath)
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.
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.
mpls_label_t * frp_label_stack
The outgoing MPLS label Stack.
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 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)
void fib_urpf_list_append(index_t ui, u32 sw_if_index)
Append another interface to the list.
static void fib_entry_src_path_ext_insert(fib_entry_src_t *esrc, const fib_route_path_t *rpath)
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_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)
struct fib_path_ext_t_ * fes_path_exts
A vector of path extensions.
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.
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
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
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.
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)
int fib_path_is_recursive(fib_node_index_t path_index)
void fib_entry_src_action_installed(const fib_entry_t *fib_entry, fib_source_t source)
#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)
fib_entry_t * fib_entry_get(fib_node_index_t index)
void fib_entry_src_interface_register(void)
void fib_entry_lock(fib_node_index_t fib_entry_index)
enum fib_entry_flag_t_ fib_entry_flag_t
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.
static fib_protocol_t fib_entry_get_proto(const fib_entry_t *fib_entry)
static void fib_entry_src_path_ext_append(fib_entry_src_t *esrc, const fib_route_path_t *rpath)
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)
#define vec_delete(V, N, M)
Delete N elements starting at element M.
#define vec_insert_elts(V, E, N, M)
Insert N vector elements starting at element M, insert given elements (no header, unspecified alignme...
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_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)
static int fib_entry_src_collect_forwarding(fib_node_index_t pl_index, fib_node_index_t path_index, void *arg)
void fib_path_list_contribute_forwarding(fib_node_index_t path_list_index, fib_forward_chain_type_t type, dpo_id_t *dpo)
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
From the control plane API.
enum fib_entry_src_flag_t_ fib_entry_src_flag_t
int fib_path_get_weight(fib_node_index_t path_index)
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.
load_balance_path_t * fib_path_ext_stack(fib_path_ext_t *path_ext, const fib_entry_t *entry, fib_forward_chain_type_t child_fct, load_balance_path_t *nhs)
fib_node_index_t fes_pl
The path-list created by the source.
const fib_entry_src_t * esrc
index_t dpoi_index
the index of objects of that type
#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.
fib_node_index_t fpe_path_index
The index of the path.
#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_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 int fib_route_recurses_via_self(const fib_prefix_t *prefix, const fib_route_path_t *rpath)
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.
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)
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)