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) \ 61 REPLY_MACRO (VL_API_SW_INTERFACE_SPAN_ENABLE_DISABLE_REPLY);
87 memset (rmp, 0,
sizeof (*rmp));
88 rmp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_SPAN_DETAILS);
110 #define vl_msg_name_crc_list 112 #undef vl_msg_name_crc_list 117 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 118 foreach_vl_msg_name_crc_span;
128 vl_msg_api_set_handlers(VL_API_##N, #n, \ 129 vl_api_##n##_t_handler, \ 131 vl_api_##n##_t_endian, \ 132 vl_api_##n##_t_print, \ 133 sizeof(vl_api_##n##_t), 1); static void setup_message_id_table(api_main_t *am)
sll srl srl sll sra u16x4 i
VLIB_API_INIT_FUNCTION(span_api_hookup)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
#define foreach_vpe_api_msg
static clib_error_t * span_api_hookup(vlib_main_t *vm)
int span_add_delete_entry(vlib_main_t *vm, u32 src_sw_if_index, u32 dst_sw_if_index, u8 state)
static void vl_api_sw_interface_span_dump_t_handler(vl_api_sw_interface_span_dump_t *mp)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
#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
Reply to SPAN enable/disable request.
clib_bitmap_t * tx_mirror_ports
static void vl_api_sw_interface_span_enable_disable_t_handler(vl_api_sw_interface_span_enable_disable_t *mp)
void * vl_msg_api_alloc(int nbytes)
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.
#define clib_bitmap_free(v)
Free a bitmap.
static vlib_main_t * vlib_get_main(void)
clib_bitmap_t * rx_mirror_ports
#define vec_foreach(var, vec)
Vector iterator.
struct _unix_shared_memory_queue unix_shared_memory_queue_t
Reply to SPAN dump request.