|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
34 #include <nsh/nsh.api.h>
39 #include <nsh/nsh.api.h>
53 "nsh-md2-ioam-encap-transit",
83 u8 is_ipv4,
u8 is_add)
89 u32 *sw_if_index0 = NULL;
98 u32 *intf_list = NULL;
106 #define TRANSIT_UNIT_TEST_HACK 1
107 #ifdef TRANSIT_UNIT_TEST_HACK
109 dst_addr.ip4.as_u32 = clib_net_to_host_u32(0x14020102);
147 for (j = 0; j < k; j++)
169 sw_if_index0 = adj0->rewrite_header.sw_if_index;
171 if (~0 == sw_if_index0)
180 "nsh-md2-ioam-encap-transit",
181 sw_if_index0, is_add, 0,
206 "nsh-md2-ioam-encap-transit",
207 *sw_if_index0, is_add, 0,
257 .fp_addr = {.ip4 = t1->
dst_addr.ip4,}
279 key4_copy = (
void *) (hp->
key);
327 u32 sw_if_index0 = 0;
328 for (sw_if_index0 = 0;
334 (
gm->vlib_main, sw_if_index0, 0);
408 u32 outer_fib_index = 0;
423 else if (
unformat (input,
"outer-fib-index %d", &outer_fib_index))
427 else if (
unformat (input,
"disable"))
433 if (dst_addr_set == 0)
435 "LISP-GPE Tunnel destination address not specified");
436 if (ipv4_set && ipv6_set)
454 .path =
"set nsh-md2-ioam-transit",
455 .short_help =
"set nsh-ioam-lisp-gpe-transit dst-ip <dst_ip> [outer-fib-index <outer_fib_index>] [disable]",
int nsh_md2_ioam_trace_profile_cleanup(void)
vnet_interface_main_t * im
u16 lb_n_buckets
number of buckets in the load-balance.
index_t dpoi_index
the index of objects of that type
fib_node_t node
Linkage into the FIB object graph.
int nsh_md2_ioam_enable_disable_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 is_ipv4, u8 is_add)
ip_lookup_main_t lookup_main
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
int nsh_md2_ioam_trace_profile_setup(void)
fib_node_type_t fib_entry_type
ip4_main_t ip4_main
Global ip4 main structure.
dpo_type_t dpoi_type
the type
#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.
clib_error_t * nsh_md2_ioam_enable_disable(int has_trace_option, int has_pot_option, int has_ppc_option)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
static void clib_mem_free(void *p)
vlib_main_t vlib_node_runtime_t * node
A FIB graph nodes virtual function table.
#define clib_error_return(e, args...)
fib_forward_chain_type_t fib_entry_get_default_chain_type(const fib_entry_t *fib_entry)
#define hash_get_pair(h, key)
u16 fp_len
The mask length.
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
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.
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define pool_foreach(VAR, POOL)
Iterate through pool.
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
nsh_md2_ioam_main_t nsh_md2_ioam_main
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
fib_node_index_t fib_entry_index
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
vnet_main_t * vnet_get_main(void)
void nsh_md2_ioam_clear_output_feature_on_select_intfs(void)
u32 fib_node_index_t
A typedef of a node index.
void nsh_md2_ioam_clear_output_feature_on_all_intfs(vlib_main_t *vm)
int nsh_md2_ioam_disable_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 ipv4_set)
#define hash_set_mem(h, key, value)
static int dpo_id_is_valid(const dpo_id_t *dpoi)
Return true if the DPO object is valid, i.e.
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
vl_api_mac_address_t dst_addr
void nsh_md2_ioam_interface_init(void)
sll srl srl sll sra u16x4 i
#define VLIB_CLI_COMMAND(x,...)
u32 fib_path_get_resolving_interface(fib_node_index_t path_index)
#define CLIB_CACHE_LINE_BYTES
@ FIB_NODE_BACK_WALK_CONTINUE
vnet_sw_interface_t * sw_interfaces
static fib_node_back_walk_rc_t nsh_md2_ioam_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Function definition to backwalk a FIB node.
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
void nsh_md2_ioam_refresh_output_feature_on_all_dest(void)
@ DPO_LOAD_BALANCE
load-balancing over a choice of [un]equal cost paths
#define vec_free(V)
Free vector's memory (no header).
#define hash_get_mem(h, key)
fib_entry_t * fib_entry_get(fib_node_index_t index)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
dpo_id_t fe_lb
The load-balance used for forwarding.
static vlib_cli_command_t nsh_md2_ioam_set_transit_rewrite_cmd
(constructor) VLIB_CLI_COMMAND (nsh_md2_ioam_set_transit_rewrite_cmd)
#define vec_foreach(var, vec)
Vector iterator.
static load_balance_t * load_balance_get(index_t lbi)
static uword pool_elts(void *v)
Number of active elements in a pool.
fib_protocol_t fp_proto
protocol type
static clib_error_t * nsh_md2_ioam_set_transit_rewrite_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
An node in the FIB graph.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define hash_unset_mem(h, key)
Context passed between object during a back walk.
@ FIB_SOURCE_RR
Recursive resolution source.
static void nsh_md2_ioam_set_clear_output_feature_on_intf(vlib_main_t *vm, u32 sw_if_index0, u8 is_add)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static void nsh_md2_ioam_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
const static fib_node_vft_t nsh_md2_ioam_vft
nsh_md2_ioam_dest_tunnels_t * dst_tunnels
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)
Add a 'special' entry to the FIB.
static fib_node_t * nsh_md2_ioam_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
fib_node_type_t fib_node_register_new_type(const fib_node_vft_t *vft)
Create a new FIB node type and Register the function table for it.
static void * clib_mem_alloc(uword size)
Aggregate type for a prefix.
vnet_interface_main_t interface_main
u8 * bool_ref_by_sw_if_index
per sw_if_index, to maintain bitmap