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 68 memset (mp, 0,
sizeof (*mp));
69 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_EVENT);
86 u32 sw_if_index = (
u32) ~ 0;
90 memset (ap, 0,
sizeof (*ap));
114 if (rv == 0 && mp->
tag[0])
126 rmp->_vl_msg_id = ntohs (VL_API_TAP_CONNECT_REPLY);
140 u32 sw_if_index = (
u32) ~ 0;
144 memset (ap, 0,
sizeof (*ap));
161 rmp->_vl_msg_id = ntohs (VL_API_TAP_MODIFY_REPLY);
175 vl_api_tap_delete_reply_t *rmp;
191 rmp->_vl_msg_id = ntohs (VL_API_TAP_DELETE_REPLY);
193 rmp->retval = ntohl (rv);
209 memset (mp, 0,
sizeof (*mp));
210 mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_TAP_DETAILS);
247 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 248 foreach_vl_msg_name_crc_tap;
258 vl_msg_api_set_handlers(VL_API_##N, #n, \ 259 vl_api_##n##_t_handler, \ 261 vl_api_##n##_t_endian, \ 262 vl_api_##n##_t_print, \ 263 sizeof(vl_api_##n##_t), 1);
u8 * intfc_name
Interface name.
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.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
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)
u32 custom_dev_instance
Custom device instance.
Dump tap interfaces request.
static void setup_message_id_table(api_main_t *am)
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.
void * vl_msg_api_alloc(int nbytes)
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.
static void send_sw_interface_tap_details(vpe_api_main_t *am, vl_api_registration_t *reg, tapcli_interface_details_t *tap_if, u32 context)
Call from VLIB_INIT_FUNCTION to set the Linux kernel inject node name.
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
u8 renumber
Renumber the (existing) interface.
#define vec_free(V)
Free vector's memory (no header).
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void send_sw_interface_event_deleted(vpe_api_main_t *am, vl_api_registration_t *reg, u32 sw_if_index)
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)
Interface Event generated by want_interface_events.
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)