38 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 45 #define foreach_vpe_api_msg \ 46 _(SW_INTERFACE_SPAN_ENABLE_DISABLE, sw_interface_span_enable_disable) \ 47 _(SW_INTERFACE_SPAN_DUMP, sw_interface_span_dump) \ 53 vl_api_sw_interface_span_enable_disable_reply_t *rmp;
62 REPLY_MACRO (VL_API_SW_INTERFACE_SPAN_ENABLE_DISABLE_REPLY);
93 rmp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_SPAN_DETAILS);
117 #define vl_msg_name_crc_list 119 #undef vl_msg_name_crc_list 124 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 125 foreach_vl_msg_name_crc_span;
135 vl_msg_api_set_handlers(VL_API_##N, #n, \ 136 vl_api_##n##_t_handler, \ 138 vl_api_##n##_t_endian, \ 139 vl_api_##n##_t_print, \ 140 sizeof(vl_api_##n##_t), 1);
static void setup_message_id_table(api_main_t *am)
VLIB_API_INIT_FUNCTION(span_api_hookup)
span_mirror_t mirror_rxtx[SPAN_FEAT_N][VLIB_N_RX_TX]
#define foreach_vpe_api_msg
static clib_error_t * span_api_hookup(vlib_main_t *vm)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vl_api_sw_interface_span_dump_t_handler(vl_api_sw_interface_span_dump_t *mp)
void * vl_msg_api_alloc(int nbytes)
clib_bitmap_t * mirror_ports
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
Enable/Disable span to mirror traffic from one interface to another.
span_interface_t * interfaces
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
static void vl_api_sw_interface_span_enable_disable_t_handler(vl_api_sw_interface_span_enable_disable_t *mp)
int span_add_delete_entry(vlib_main_t *vm, u32 src_sw_if_index, u32 dst_sw_if_index, u8 state, span_feat_t sf)
static uword * clib_bitmap_dup_or(uword *ai, uword *bi)
Logical operator across two bitmaps which duplicates the first bitmap.
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
#define clib_bitmap_free(v)
Free a bitmap.
static vlib_main_t * vlib_get_main(void)
static api_main_t * vlibapi_get_main(void)
#define vec_foreach(var, vec)
Vector iterator.
Reply to SPAN dump request.