34 #include <nsh/nsh.api.h> 39 #include <nsh/nsh.api.h> 53 "nsh-md2-ioam-encap-transit",
69 nsh_md2_ioam_set_clear_output_feature_on_intf
70 (vm, si->sw_if_index, 0);
81 ip46_address_t dst_addr,
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);
310 nsh_md2_ioam_enable_disable_for_dest
314 (t->fp_proto == FIB_PROTOCOL_IP4), 1
328 u32 sw_if_index0 = 0;
329 for (sw_if_index0 = 0;
377 dst_addr, outer_fib_index,
387 nsh_md2_ioam_enable_disable_for_dest
392 FIB_PROTOCOL_IP4), 1 );
404 ip46_address_t dst_addr;
410 u32 outer_fib_index = 0;
425 else if (
unformat (input,
"outer-fib-index %d", &outer_fib_index))
429 else if (
unformat (input,
"disable"))
435 if (dst_addr_set == 0)
437 "LISP-GPE Tunnel destination address not specified");
438 if (ipv4_set && ipv6_set)
443 dst_addr, outer_fib_index,
449 (vm, dst_addr, outer_fib_index, ipv4_set);
456 .path =
"set nsh-md2-ioam-transit",
457 .short_help =
"set nsh-ioam-lisp-gpe-transit dst-ip <dst_ip> [outer-fib-index <outer_fib_index>] [disable]",
u16 lb_n_buckets
number of buckets in the load-balance.
fib_protocol_t fp_proto
protocol type
fib_forward_chain_type_t fib_entry_get_default_chain_type(const fib_entry_t *fib_entry)
u8 * bool_ref_by_sw_if_index
per sw_if_index, to maintain bitmap
Recursive resolution source.
vnet_main_t * vnet_get_main(void)
vnet_interface_main_t interface_main
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
static int dpo_id_is_valid(const dpo_id_t *dpoi)
Return true if the DPO object is valid, i.e.
fib_node_t node
Linkage into the FIB object graph.
#define clib_memcpy_fast(a, b, c)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define hash_set_mem(h, key, value)
ip_lookup_main_t lookup_main
void nsh_md2_ioam_refresh_output_feature_on_all_dest(void)
int nsh_md2_ioam_trace_profile_cleanup(void)
fib_node_type_t fib_entry_type
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 clib_error_t * nsh_md2_ioam_set_transit_rewrite_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void nsh_md2_ioam_clear_output_feature_on_select_intfs(void)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static void nsh_md2_ioam_set_clear_output_feature_on_intf(vlib_main_t *vm, u32 sw_if_index0, u8 is_add)
Aggregate type for a prefix.
#define clib_error_return(e, args...)
fib_node_index_t fib_entry_index
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.
#define hash_get_pair(h, key)
u16 fp_len
The mask length.
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.
int nsh_md2_ioam_disable_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 ipv4_set)
clib_error_t * nsh_md2_ioam_enable_disable(int has_trace_option, int has_pot_option, int has_ppc_option)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#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.
#define hash_unset_mem(h, key)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
nsh_md2_ioam_main_t nsh_md2_ioam_main
dpo_type_t dpoi_type
the type
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
load-balancing over a choice of [un]equal cost paths
#define pool_put(P, E)
Free an object E in pool P.
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.
An node in the FIB graph.
void nsh_md2_ioam_clear_output_feature_on_all_intfs(vlib_main_t *vm)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
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.
#define vec_free(V)
Free vector's memory (no header).
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.
u32 fib_node_index_t
A typedef of a node index.
fib_entry_t * fib_entry_get(fib_node_index_t index)
Context passed between object during a back walk.
#define VLIB_CLI_COMMAND(x,...)
static load_balance_t * load_balance_get(index_t lbi)
void nsh_md2_ioam_interface_init(void)
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)
static void clib_mem_free(void *p)
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
static void * clib_mem_alloc(uword size)
dpo_id_t fe_lb
The load-balance used for forwarding.
u32 fib_path_get_resolving_interface(fib_node_index_t path_index)
index_t dpoi_index
the index of objects of that type
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vnet_sw_interface_t * sw_interfaces
#define hash_get_mem(h, key)
A FIB graph nodes virtual function table.
ip4_main_t ip4_main
Global ip4 main structure.
#define vec_foreach(var, vec)
Vector iterator.
int nsh_md2_ioam_trace_profile_setup(void)
nsh_md2_ioam_dest_tunnels_t * dst_tunnels
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
#define CLIB_CACHE_LINE_BYTES
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)
static uword pool_elts(void *v)
Number of active elements in a pool.