45 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 51 #define vl_api_version(n,v) static u32 api_version=(v); 55 #define REPLY_MSG_ID_BASE cm->msg_id_base 61 #define foreach_ioam_cache_plugin_api_msg \ 62 _(IOAM_CACHE_IP6_ENABLE_DISABLE, ioam_cache_ip6_enable_disable) 67 ioam_e2e_id_option_t *e2e = (ioam_e2e_id_option_t *) opt;
83 ioam_e2e_cache_option_t *e2e = (ioam_e2e_cache_option_t *) opt;
88 format (s,
"IP6_HOP_BY_HOP E2E CACHE = pool:%d idx:%d\n",
89 e2e->pool_id, e2e->pool_index);
174 vl_api_ioam_cache_ip6_enable_disable_reply_t *rmp;
179 sr_localsid.
as_u64[0] = 0;
180 sr_localsid.
as_u64[1] = 0;
183 REPLY_MACRO (VL_API_IOAM_CACHE_IP6_ENABLE_DISABLE_REPLY);
192 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 194 vl_api_##n##_t_handler, \ 196 vl_api_##n##_t_endian, \ 197 vl_api_##n##_t_print, \ 198 sizeof(vl_api_##n##_t), 1); 205 #define vl_msg_name_crc_list 207 #undef vl_msg_name_crc_list 212 #define _(id,n,crc) \ 213 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 214 foreach_vl_msg_name_crc_ioam_cache;
231 else if (!address_set
239 if (is_disable == 0 && !address_set)
250 .path =
"set ioam ip6 cache",.short_help =
251 "set ioam ip6 cache sr_localsid <ip6 address> [disable]",.function =
255 #define IOAM_TS_WAIT_FOR_RESPONSES 3 274 else if (
unformat (input,
"oneway"))
276 else if (
unformat (input,
"wait_for_responses %d", &no_of_responses))
278 else if (!address_set
285 if (is_disable == 0 && !address_set)
287 "Error: SRv6 LocalSID address is mandatory to receive response.");
290 &sr_localsid, is_disable);
298 .path =
"set ioam ip6 sr-tunnel-select",.short_help =
299 "set ioam ip6 sr-tunnel-select [disable] [oneway|rtt] [wait_for_responses <n|default 3>] \ 314 vlib_cli_output (vm,
"%U",
315 format_ioam_cache_entry,
320 for (i = 0; i < no_of_threads; i++)
322 vlib_cli_output (vm,
"Number of entries in thread-%d selection pool: %lu\n \ 323 (pool found to be full: %lu times)", i,
332 format_ioam_cache_ts_entry,
367 .path =
"show ioam ip6 cache",.short_help =
382 name =
format (0,
"ioam_cache_%08x%c", api_version, 0);
384 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)
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)
#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...)
#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
API main structure, used by both vpp and binary API clients.
static clib_error_t * ioam_cache_init(vlib_main_t *vm)
#define vec_free(V)
Free vector's memory (no header).
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)
ioam_cache_main_t ioam_cache_main
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
static void ioam_cache_table_print(vlib_main_t *vm, u8 verbose)
#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)