39 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_tapv2_api_msg \ 48 _(TAP_CREATE_V2, tap_create_v2) \ 49 _(TAP_DELETE_V2, tap_delete_v2) \ 50 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) 61 memset (ap, 0,
sizeof (*ap));
63 ap->
id = ntohl (mp->
id);
129 rmp->_vl_msg_id = ntohs (VL_API_TAP_CREATE_V2_REPLY);
145 memset (mp, 0,
sizeof (*mp));
146 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_EVENT);
162 vl_api_tap_delete_v2_reply_t *rmp;
173 rmp->_vl_msg_id = ntohs (VL_API_TAP_DELETE_V2_REPLY);
175 rmp->retval = ntohl (rv);
193 memset (mp, 0,
sizeof (*mp));
194 mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_TAP_V2_DETAILS);
195 mp->
id = htonl (tap_if->
id);
199 strlen ((
const char *) tap_if->
dev_name)));
249 #define vl_msg_name_crc_list 251 #undef vl_msg_name_crc_list 256 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 257 foreach_vl_msg_name_crc_tapv2;
267 vl_msg_api_set_handlers(VL_API_##N, #n, \ 268 vl_api_##n##_t_handler, \ 270 vl_api_##n##_t_endian, \ 271 vl_api_##n##_t_print, \ 272 sizeof(vl_api_##n##_t), 1);
static void vl_api_sw_interface_tap_v2_dump_t_handler(vl_api_sw_interface_tap_v2_dump_t *mp)
ip4_address_t host_ip4_addr
vnet_main_t * vnet_get_main(void)
static void tap_setup_message_id_table(api_main_t *am)
Reply for tap dump request.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vnet_clear_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
static void tap_send_sw_interface_details(vpe_api_main_t *am, vl_api_registration_t *reg, tap_interface_details_t *tap_if, u32 context)
static clib_error_t * tapv2_api_hookup(vlib_main_t *vm)
void * vl_msg_api_alloc(int nbytes)
int tap_dump_ifs(tap_interface_details_t **out_tapids)
static void tap_send_sw_interface_event_deleted(vpe_api_main_t *am, vl_api_registration_t *reg, u32 sw_if_index)
Dump tap interfaces request.
int tap_delete_if(vlib_main_t *vm, u32 sw_if_index)
ip4_address_t host_ip4_gw
ip6_address_t host_ip6_addr
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
#define vec_free(V)
Free vector's memory (no header).
static void vl_api_tap_delete_v2_t_handler(vl_api_tap_delete_v2_t *mp)
#define clib_memcpy(a, b, c)
VLIB_API_INIT_FUNCTION(tapv2_api_hookup)
Initialize a new tap interface with the given paramters.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
ip6_address_t host_ip6_gw
static void vnet_set_sw_interface_tag(vnet_main_t *vnm, u8 *tag, u32 sw_if_index)
static vlib_main_t * vlib_get_main(void)
Interface Event generated by want_interface_events.
void tap_create_if(vlib_main_t *vm, tap_create_if_args_t *args)
#define foreach_tapv2_api_msg
TAP interface details struct.
#define vec_foreach(var, vec)
Vector iterator.
vpe_api_main_t vpe_api_main
Reply for tap create reply.
static void vl_api_tap_create_v2_t_handler(vl_api_tap_create_v2_t *mp)