46 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 52 #define vl_api_version(n,v) static u32 api_version=(v); 56 #define REPLY_MSG_ID_BASE cm->msg_id_base 60 #define foreach_ioam_cache_plugin_api_msg \ 61 _(IOAM_CACHE_IP6_ENABLE_DISABLE, ioam_cache_ip6_enable_disable) 66 ioam_e2e_id_option_t *e2e = (ioam_e2e_id_option_t *) opt;
82 ioam_e2e_cache_option_t *e2e = (ioam_e2e_cache_option_t *) opt;
87 format (s,
"IP6_HOP_BY_HOP E2E CACHE = pool:%d idx:%d\n",
88 e2e->pool_id, e2e->pool_index);
173 vl_api_ioam_cache_ip6_enable_disable_reply_t *rmp;
178 sr_localsid.
as_u64[0] = 0;
179 sr_localsid.
as_u64[1] = 0;
182 REPLY_MACRO (VL_API_IOAM_CACHE_IP6_ENABLE_DISABLE_REPLY);
191 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 193 vl_api_##n##_t_handler, \ 195 vl_api_##n##_t_endian, \ 196 vl_api_##n##_t_print, \ 197 sizeof(vl_api_##n##_t), 1); 204 #define vl_msg_name_crc_list 206 #undef vl_msg_name_crc_list 211 #define _(id,n,crc) \ 212 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 213 foreach_vl_msg_name_crc_ioam_cache;
230 else if (!address_set
238 if (is_disable == 0 && !address_set)
249 .path =
"set ioam ip6 cache",.short_help =
250 "set ioam ip6 cache sr_localsid <ip6 address> [disable]",.function =
254 #define IOAM_TS_WAIT_FOR_RESPONSES 3 273 else if (
unformat (input,
"oneway"))
275 else if (
unformat (input,
"wait_for_responses %d", &no_of_responses))
277 else if (!address_set
284 if (is_disable == 0 && !address_set)
286 "Error: SRv6 LocalSID address is mandatory to receive response.");
289 &sr_localsid, is_disable);
297 .path =
"set ioam ip6 sr-tunnel-select",.short_help =
298 "set ioam ip6 sr-tunnel-select [disable] [oneway|rtt] [wait_for_responses <n|default 3>] \ 313 vlib_cli_output (vm,
"%U",
314 format_ioam_cache_entry,
319 for (i = 0; i < no_of_threads; i++)
321 vlib_cli_output (vm,
"Number of entries in thread-%d selection pool: %lu\n \ 322 (pool found to be full: %lu times)", i,
331 format_ioam_cache_ts_entry,
363 .path =
"show ioam ip6 cache",.short_help =
378 name =
format (0,
"ioam_cache_%08x%c", api_version, 0);
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)
u16 vl_msg_api_get_msg_ids(const char *name, int n)
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
sll srl srl sll sra u16x4 i
static int ioam_cache_ts_table_init(vlib_main_t *vm)
void ip6_hbh_set_next_override(uword next)
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)
static void setup_message_id_table(ioam_cache_main_t *sm, api_main_t *am)
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...)
#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
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)
#define vec_free(V)
Free vector's memory (no header).
void vlib_worker_thread_barrier_sync(vlib_main_t *vm)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
#define VLIB_CLI_COMMAND(x,...)
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)
#define foreach_ioam_cache_plugin_api_msg
static int ioam_cache_ts_table_destroy(vlib_main_t *vm)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
static void ioam_cache_table_print(vlib_main_t *vm, u8 verbose)
ioam_cache_main_t ioam_cache_main
#define HBH_OPTION_TYPE_IOAM_E2E_CACHE_ID
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_error_t * ioam_cache_plugin_api_hookup(vlib_main_t *vm)