44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define vl_api_version(n,v) static u32 api_version=(v); 54 #define REPLY_MSG_ID_BASE sm->msg_id_base 58 #define foreach_ioam_export_plugin_api_msg \ 59 _(IOAM_EXPORT_IP6_ENABLE_DISABLE, ioam_export_ip6_enable_disable) 107 vl_api_ioam_export_ip6_enable_disable_reply_t *rmp;
116 REPLY_MACRO (VL_API_IOAM_EXPORT_IP6_ENABLE_DISABLE_REPLY);
125 vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \ 127 vl_api_##n##_t_handler, \ 129 vl_api_##n##_t_endian, \ 130 vl_api_##n##_t_print, \ 131 sizeof(vl_api_##n##_t), 1); 138 #define vl_msg_name_crc_list 140 #undef vl_msg_name_crc_list 145 #define _(id,n,crc) \ 146 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base); 147 foreach_vl_msg_name_crc_ioam_export;
169 else if (
unformat (input,
"disable"))
175 if (collector.
as_u32 == 0)
199 .path =
"set ioam export ipfix",.short_help =
200 "set ioam export ipfix collector <ip4-address> src <ip4-address>",.
211 u32 node_index = export_node.index;
219 name =
format (0,
"ioam_export_%08x%c", api_version, 0);
void ip6_hbh_set_next_override(uword next)
vnet_main_t * vnet_get_main(void)
static void ioam_export_reset_next_node(ioam_export_main_t *em)
u32 export_process_node_index
static f64 vlib_time_now(vlib_main_t *vm)
static int ioam_export_header_create(ioam_export_main_t *em, ip4_address_t *collector_address, ip4_address_t *src_address)
ip4_address_t ipfix_collector
int ioam_export_ip6_enable_disable(ioam_export_main_t *em, u8 is_disable, ip4_address_t *collector_address, ip4_address_t *src_address)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
static clib_error_t * set_ioam_export_ipfix_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
ioam_export_main_t ioam_export_main
#define VLIB_INIT_FUNCTION(x)
#define foreach_ioam_export_plugin_api_msg
#define clib_error_return(e, args...)
#define IPFIX_IOAM_EXPORT_ID
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static clib_error_t * ioam_export_init(vlib_main_t *vm)
vl_api_address_union_t src_address
static void ioam_export_header_cleanup(ioam_export_main_t *em, ip4_address_t *collector_address, ip4_address_t *src_address)
static void ioam_export_thread_buffer_free(ioam_export_main_t *em)
API main structure, used by both vpp and binary API clients.
static clib_error_t * ioam_export_plugin_api_hookup(vlib_main_t *vm)
#define vec_free(V)
Free vector's memory (no header).
ip4_address_t src_address
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
vlib_node_registration_t export_node
(constructor) VLIB_REGISTER_NODE (export_node)
#define VLIB_CLI_COMMAND(x,...)
struct _vlib_node_registration vlib_node_registration_t
static void vl_api_ioam_export_ip6_enable_disable_t_handler(vl_api_ioam_export_ip6_enable_disable_t *mp)
static int ioam_export_thread_buffer_init(ioam_export_main_t *em, vlib_main_t *vm)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void setup_message_id_table(ioam_export_main_t *sm, api_main_t *am)
u16 vl_msg_api_get_msg_ids(const char *name, int n)