32 #include <ioam/ip6/ioam_cache.api_enum.h> 33 #include <ioam/ip6/ioam_cache.api_types.h> 35 #define REPLY_MSG_ID_BASE cm->msg_id_base 43 ioam_e2e_id_option_t *e2e = (ioam_e2e_id_option_t *) opt;
59 ioam_e2e_cache_option_t *e2e = (ioam_e2e_cache_option_t *) opt;
64 format (s,
"IP6_HOP_BY_HOP E2E CACHE = pool:%d idx:%d\n",
65 e2e->pool_id, e2e->pool_index);
75 ip6_address_t * sr_localsid,
u8 is_disable)
109 ip6_address_t * sr_localsid,
150 vl_api_ioam_cache_ip6_enable_disable_reply_t *rmp;
152 ip6_address_t sr_localsid;
155 sr_localsid.as_u64[0] = 0;
156 sr_localsid.as_u64[1] = 0;
159 REPLY_MACRO (VL_API_IOAM_CACHE_IP6_ENABLE_DISABLE_REPLY);
168 ip6_address_t sr_localsid;
175 else if (!address_set
183 if (is_disable == 0 && !address_set)
194 .path =
"set ioam ip6 cache",.short_help =
195 "set ioam ip6 cache sr_localsid <ip6 address> [disable]",.function =
199 #define IOAM_TS_WAIT_FOR_RESPONSES 3 208 ip6_address_t sr_localsid;
218 else if (
unformat (input,
"oneway"))
220 else if (
unformat (input,
"wait_for_responses %d", &no_of_responses))
222 else if (!address_set
229 if (is_disable == 0 && !address_set)
231 "Error: SRv6 LocalSID address is mandatory to receive response.");
234 &sr_localsid, is_disable);
242 .path =
"set ioam ip6 sr-tunnel-select",.short_help =
243 "set ioam ip6 sr-tunnel-select [disable] [oneway|rtt] [wait_for_responses <n|default 3>] \ 258 vlib_cli_output (vm,
"%U",
259 format_ioam_cache_entry,
264 for (i = 0; i < no_of_threads; i++)
266 vlib_cli_output (vm,
"Number of entries in thread-%d selection pool: %lu\n \ 267 (pool found to be full: %lu times)", i,
276 format_ioam_cache_ts_entry,
311 .path =
"show ioam ip6 cache",.short_help =
315 #include <ioam/ip6/ioam_cache.api.c> 323 vlib_node_t *ip6_hbyh_node = NULL, *ip6_hbh_pop_node = NULL, *error_node =
326 clib_memset (&ioam_cache_main, 0,
sizeof (ioam_cache_main));
ip6_address_t sr_localsid_ts
int ioam_tunnel_select_ip6_enable_disable(ioam_cache_main_t *em, u8 criteria, u8 no_of_responses, ip6_address_t *sr_localsid, u8 is_disable)
static clib_error_t * set_ioam_cache_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
ioam_cache_entry_t * ioam_rewrite_pool
static int ioam_cache_ts_table_init(vlib_main_t *vm)
void ip6_hbh_set_next_override(uword next)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
int ip6_hbh_register_option(u8 option, int options(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt), u8 *trace(u8 *s, ip6_hop_by_hop_option_t *opt))
#define IOAM_TS_WAIT_FOR_RESPONSES
static int ioam_cache_table_init(vlib_main_t *vm)
static int ioam_cache_table_destroy(vlib_main_t *vm)
static clib_error_t * show_ioam_cache_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
static clib_error_t * set_ioam_tunnel_select_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vlib_worker_thread_barrier_sync(X)
int ioam_cache_ip6_enable_disable(ioam_cache_main_t *em, ip6_address_t *sr_localsid, u8 is_disable)
ip6_address_t sr_localsid_cache
static int ip6_ioam_ts_cache_set_rewrite(void)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
static void vl_api_ioam_cache_ip6_enable_disable_t_handler(vl_api_ioam_cache_ip6_enable_disable_t *mp)
#define clib_error_return(e, args...)
u32 ip6_reset_ts_hbh_node_index
#define HBH_OPTION_TYPE_IOAM_EDGE_TO_EDGE_ID
static u8 * ioam_e2e_cache_trace_handler(u8 *s, ip6_hop_by_hop_option_t *opt)
vlib_node_registration_t ioam_cache_ts_node
(constructor) VLIB_REGISTER_NODE (ioam_cache_ts_node)
ioam_cache_ts_pool_stats_t * ts_stats
int ip6_hbh_unregister_option(u8 option)
vlib_worker_thread_t * vlib_worker_threads
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
ioam_cache_ts_entry_t ** ioam_ts_pool
vlib_node_registration_t ioam_cache_node
(constructor) VLIB_REGISTER_NODE (ioam_cache_node)
static int ip6_ioam_ts_cache_cleanup_rewrite(void)
u32 ip6_hbh_pop_node_index
static clib_error_t * ioam_cache_init(vlib_main_t *vm)
sll srl srl sll sra u16x4 i
vlib_main_t vlib_node_runtime_t * node
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
void ioam_cache_ts_timer_node_enable(vlib_main_t *vm, u8 enable)
static u8 * ioam_e2e_id_trace_handler(u8 *s, ip6_hop_by_hop_option_t *opt)
static int ioam_cache_ts_table_destroy(vlib_main_t *vm)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ioam_cache_main_t ioam_cache_main
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
static void ioam_cache_table_print(vlib_main_t *vm, u8 verbose)
u32 ip6_add_from_cache_hbh_node_index
#define HBH_OPTION_TYPE_IOAM_E2E_CACHE_ID