41 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define foreach_tap_api_msg \ 49 _(TAP_CONNECT, tap_connect) \ 50 _(TAP_MODIFY, tap_modify) \ 51 _(TAP_DELETE, tap_delete) \ 52 _(SW_INTERFACE_TAP_DUMP, sw_interface_tap_dump) 54 #define vl_msg_name_crc_list 55 #include <vnet/unix/tap.api.h> 56 #undef vl_msg_name_crc_list 69 memset (mp, 0,
sizeof (*mp));
70 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_SET_FLAGS);
87 u32 sw_if_index = (
u32) ~ 0;
91 memset (ap, 0,
sizeof (*ap));
115 if (rv == 0 && mp->
tag[0])
127 rmp->_vl_msg_id = ntohs (VL_API_TAP_CONNECT_REPLY);
141 u32 sw_if_index = (
u32) ~ 0;
145 memset (ap, 0,
sizeof (*ap));
162 rmp->_vl_msg_id = ntohs (VL_API_TAP_MODIFY_REPLY);
192 rmp->_vl_msg_id = ntohs (VL_API_TAP_DELETE_REPLY);
210 memset (mp, 0,
sizeof (*mp));
211 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_TAP_DETAILS);
248 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 249 foreach_vl_msg_name_crc_tap;
259 vl_msg_api_set_handlers(VL_API_##N, #n, \ 260 vl_api_##n##_t_handler, \ 262 vl_api_##n##_t_endian, \ 263 vl_api_##n##_t_print, \ 264 sizeof(vl_api_##n##_t), 1);
static void send_sw_interface_tap_details(vpe_api_main_t *am, unix_shared_memory_queue_t *q, tapcli_interface_details_t *tap_if, u32 context)
u8 * intfc_name
Interface name.
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
vnet_main_t * vnet_get_main(void)
int vnet_tap_connect_renumber(vlib_main_t *vm, vnet_tap_connect_args_t *ap)
Renumber a TAP interface.
Set flags on the interface.
u32 * sw_if_indexp
Output parameter: result sw_if_index.
static void vnet_clear_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
u32 custom_dev_instance
Custom device instance.
Dump tap interfaces request.
static void setup_message_id_table(api_main_t *am)
Reply for tap delete request.
static void send_sw_interface_flags_deleted(vpe_api_main_t *am, unix_shared_memory_queue_t *q, u32 sw_if_index)
arguments structure for vnet_tap_connect, vnet_tap_connect_renumber, etc.
TAP CLI interface details struct.
int vnet_tap_modify(vlib_main_t *vm, vnet_tap_connect_args_t *ap)
Modifies tap interface - can result in new interface being created.
static clib_error_t * tap_api_hookup(vlib_main_t *vm)
u8 ip6_address_set
Please set the indicated ip4 address/mask on the interface.
#define foreach_tap_api_msg
u32 ip4_mask_width
(optional) ip4 mask width to set
Initialize a new tap interface with the given paramters.
Reply for tap connect request.
Call from VLIB_INIT_FUNCTION to set the Linux kernel inject node name.
void * vl_msg_api_alloc(int nbytes)
u8 renumber
Renumber the (existing) interface.
#define vec_free(V)
Free vector's memory (no header).
Reply for tap dump request.
u8 ip4_address_set
Please set the indicated ip4 address/mask on the interface.
Reply for tap modify request.
static void vnet_set_sw_interface_tag(vnet_main_t *vnm, u8 *tag, u32 sw_if_index)
int vnet_tap_delete(vlib_main_t *vm, u32 sw_if_index)
Delete TAP interface.
ip4_address_t * ip4_address
(optional) ip4 address to set
static vlib_main_t * vlib_get_main(void)
VLIB_API_INIT_FUNCTION(tap_api_hookup)
u8 * hwaddr_arg
Mac address.
Modify a tap interface with the given paramters.
static void vl_api_sw_interface_tap_dump_t_handler(vl_api_sw_interface_tap_dump_t *mp)
#define vec_foreach(var, vec)
Vector iterator.
static void vl_api_tap_connect_t_handler(vl_api_tap_connect_t *mp)
vpe_api_main_t vpe_api_main
int vnet_tap_dump_ifs(tapcli_interface_details_t **out_tapids)
Dump TAP interfaces.
u32 ip6_mask_width
(optional) ip6 mask width to set
u32 orig_sw_if_index
original sw_if_index (renumber)
ip6_address_t * ip6_address
(optional) ip6 address to set
static void vl_api_tap_delete_t_handler(vl_api_tap_delete_t *mp)
static void vl_api_tap_modify_t_handler(vl_api_tap_modify_t *mp)
struct _unix_shared_memory_queue unix_shared_memory_queue_t