42 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define foreach_tapv2_api_msg \ 51 _(TAP_CREATE_V2, tap_create_v2) \ 52 _(TAP_DELETE_V2, tap_delete_v2) \ 53 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump) 71 ap->
id = ntohl (mp->
id);
130 "tap gso api flag mismatch");
132 (
int) TAP_FLAG_CSUM_OFFLOAD),
133 "tap checksum offload api flag mismatch");
135 "tap persist api flag mismatch");
137 "tap attach api flag mismatch");
139 "tap tun api flag mismatch");
141 (
int) TAP_FLAG_GRO_COALESCE),
142 "tap gro coalesce api flag mismatch");
144 "tap packed api flag mismatch");
146 (
int) TAP_FLAG_IN_ORDER),
"tap in-order api flag mismatch");
161 rmp->_vl_msg_id =
ntohs (VL_API_TAP_CREATE_V2_REPLY);
185 vl_api_tap_delete_v2_reply_t *rmp;
192 rmp->_vl_msg_id =
ntohs (VL_API_TAP_DELETE_V2_REPLY);
194 rmp->retval = ntohl (rv);
210 mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_TAP_V2_DETAILS);
211 mp->
id = htonl (tap_if->
id);
216 strlen ((
const char *) tap_if->
dev_name)));
252 u32 filter_sw_if_index;
268 if ((filter_sw_if_index == ~0)
276 #define vl_msg_name_crc_list 278 #undef vl_msg_name_crc_list 283 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 284 foreach_vl_msg_name_crc_tapv2;
294 vl_msg_api_set_handlers(VL_API_##N, #n, \ 295 vl_api_##n##_t_handler, \ 297 vl_api_##n##_t_endian, \ 298 vl_api_##n##_t_print, \ 299 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)
vl_api_ip4_address_with_prefix_t host_ip4_prefix
ip4_address_t host_ip4_addr
vnet_main_t * vnet_get_main(void)
static void tap_setup_message_id_table(api_main_t *am)
void mac_address_encode(const mac_address_t *in, u8 *out)
Reply for tap dump request.
u32 id[default=0xffffffff]
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
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)
vl_api_mac_address_t mac_address
#define clib_memcpy(d, s, n)
Dump tap interfaces request.
vl_api_interface_index_t sw_if_index[default=0xffffffff]
description fragment has unexpected format
int tap_delete_if(vlib_main_t *vm, u32 sw_if_index)
vl_api_ip6_address_t host_ip6_gw
u16 tx_ring_sz[default=256]
u16 rx_ring_sz[default=256]
vl_api_interface_index_t sw_if_index
mac_address_t host_mac_addr
vl_api_tap_flags_t tap_flags
ip4_address_t host_ip4_gw
ip6_address_t host_ip6_addr
u32 vl_api_string_len(vl_api_string_t *astr)
vl_api_ip4_address_with_prefix_t host_ip4_prefix
API main structure, used by both vpp and binary API clients.
ip4_address_t host_ip4_addr
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
#define vec_free(V)
Free vector's memory (no header).
vl_api_tap_flags_t tap_flags
static void vl_api_tap_delete_v2_t_handler(vl_api_tap_delete_v2_t *mp)
vl_api_ip4_address_t host_ip4_gw
VLIB_API_INIT_FUNCTION(tapv2_api_hookup)
Initialize a new tap interface with the given parameters.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_interface_index_t sw_if_index
ip6_address_t host_ip6_gw
static void vnet_set_sw_interface_tag(vnet_main_t *vnm, u8 *tag, u32 sw_if_index)
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
string host_namespace[64]
static vlib_main_t * vlib_get_main(void)
void tap_create_if(vlib_main_t *vm, tap_create_if_args_t *args)
u8 num_rx_queues[default=1]
vl_api_mac_address_t host_mac_addr
string host_namespace[64]
#define STATIC_ASSERT(truth,...)
#define foreach_tapv2_api_msg
void ip4_address_decode(const vl_api_ip4_address_t in, ip4_address_t *out)
mac_address_t host_mac_addr
ip6_address_t host_ip6_addr
static api_main_t * vlibapi_get_main(void)
TAP interface details struct.
void ip4_address_encode(const ip4_address_t *in, vl_api_ip4_address_t out)
#define vec_foreach(var, vec)
Vector iterator.
vpe_api_main_t vpe_api_main
Reply for tap create reply.
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
u8 * vl_api_from_api_to_new_vec(void *mp, vl_api_string_t *astr)
vl_api_mac_address_t host_mac_addr
vl_api_interface_index_t sw_if_index
vl_api_ip6_address_with_prefix_t host_ip6_prefix
bool use_random_mac[default=true]
#define VALIDATE_SW_IF_INDEX(mp)
static void vl_api_tap_create_v2_t_handler(vl_api_tap_create_v2_t *mp)
vl_api_ip6_address_with_prefix_t host_ip6_prefix