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);
92 memset (rmp, 0,
sizeof (*rmp));
93 rmp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_SPAN_DETAILS);
116 #define vl_msg_name_crc_list 118 #undef vl_msg_name_crc_list 123 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 124 foreach_vl_msg_name_crc_span;
134 vl_msg_api_set_handlers(VL_API_##N, #n, \ 135 vl_api_##n##_t_handler, \ 137 vl_api_##n##_t_endian, \ 138 vl_api_##n##_t_print, \ 139 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)
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)
static void vl_api_sw_interface_span_dump_t_handler(vl_api_sw_interface_span_dump_t *mp)
clib_bitmap_t * mirror_ports
void * vl_msg_api_alloc(int nbytes)
#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.
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.
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
#define clib_bitmap_free(v)
Free a bitmap.
static vlib_main_t * vlib_get_main(void)
#define vec_foreach(var, vec)
Vector iterator.
struct _unix_shared_memory_queue unix_shared_memory_queue_t
Reply to SPAN dump request.