FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
tapv2_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * tap_api.c - vnet tap device driver API support
4  *
5  * Copyright (c) 2017 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #include <vnet/vnet.h>
21 #include <vlibmemory/api.h>
22 
23 #include <vnet/interface.h>
24 #include <vnet/api_errno.h>
25 #include <vnet/ethernet/ethernet.h>
26 #include <vnet/ip/ip.h>
28 #include <vnet/ip/ip_types_api.h>
29 #include <vnet/devices/tap/tap.h>
30 
31 #include <vnet/format_fns.h>
32 #include <vnet/devices/tap/tapv2.api_enum.h>
33 #include <vnet/devices/tap/tapv2.api_types.h>
34 
35 #define REPLY_MSG_ID_BASE msg_id_base
37 
39 
40 static void
42 {
45  if (!reg)
46  return;
47 
48  vnet_main_t *vnm = vnet_get_main ();
51 
52  tap_create_if_args_t _a, *ap = &_a;
53 
54  clib_memset (ap, 0, sizeof (*ap));
55 
56  ap->id = ntohl (mp->id);
57  if (!mp->use_random_mac)
58  {
60  ap->mac_addr_set = 1;
61  }
62  ap->rx_ring_sz = ntohs (mp->rx_ring_sz);
63  ap->tx_ring_sz = ntohs (mp->tx_ring_sz);
64  ap->sw_if_index = (u32) ~ 0;
65  ap->num_rx_queues = 1;
66 
67  if (mp->num_rx_queues > 1)
68  ap->num_rx_queues = mp->num_rx_queues;
69 
70  if (mp->host_if_name_set)
71  ap->host_if_name = format (0, "%s%c", mp->host_if_name, 0);
72 
73  if (mp->host_mac_addr_set)
74  {
76  }
77 
78  if (mp->host_namespace_set)
79  ap->host_namespace = format (0, "%s%c", mp->host_namespace, 0);
80 
81  if (mp->host_bridge_set)
82  ap->host_bridge = format (0, "%s%c", mp->host_bridge, 0);
83 
84  if (mp->host_ip4_prefix_set)
85  {
88  }
89 
90  if (mp->host_ip6_prefix_set)
91  {
94  }
95 
96  if (mp->host_ip4_gw_set)
97  {
99  ap->host_ip4_gw_set = 1;
100  }
101 
102  if (mp->host_ip6_gw_set)
103  {
105  ap->host_ip6_gw_set = 1;
106  }
107 
108  if (mp->host_mtu_set)
109  {
110  ap->host_mtu_size = ntohl (mp->host_mtu_size);
111  ap->host_mtu_set = 1;
112  }
113 
114  STATIC_ASSERT (((int) TAP_API_FLAG_GSO == (int) TAP_FLAG_GSO),
115  "tap gso api flag mismatch");
117  (int) TAP_FLAG_CSUM_OFFLOAD),
118  "tap checksum offload api flag mismatch");
119  STATIC_ASSERT (((int) TAP_API_FLAG_PERSIST == (int) TAP_FLAG_PERSIST),
120  "tap persist api flag mismatch");
121  STATIC_ASSERT (((int) TAP_API_FLAG_ATTACH == (int) TAP_FLAG_ATTACH),
122  "tap attach api flag mismatch");
123  STATIC_ASSERT (((int) TAP_API_FLAG_TUN == (int) TAP_FLAG_TUN),
124  "tap tun api flag mismatch");
126  (int) TAP_FLAG_GRO_COALESCE),
127  "tap gro coalesce api flag mismatch");
128  STATIC_ASSERT (((int) TAP_API_FLAG_PACKED == (int) TAP_FLAG_PACKED),
129  "tap packed api flag mismatch");
131  (int) TAP_FLAG_IN_ORDER), "tap in-order api flag mismatch");
132 
133  ap->tap_flags = ntohl (mp->tap_flags);
134 
135  tap_create_if (vm, ap);
136 
137 
138  /* If a tag was supplied... */
139  if (vl_api_string_len (&mp->tag))
140  {
141  u8 *tag = vl_api_from_api_to_new_vec (mp, &mp->tag);
142  vnet_set_sw_interface_tag (vnm, tag, ap->sw_if_index);
143  }
144 
145  rmp = vl_msg_api_alloc (sizeof (*rmp));
146  rmp->_vl_msg_id = ntohs (REPLY_MSG_ID_BASE + VL_API_TAP_CREATE_V2_REPLY);
147  rmp->context = mp->context;
148  rmp->retval = ntohl (ap->rv);
149  rmp->sw_if_index = ntohl (ap->sw_if_index);
150 
151  vl_api_send_msg (reg, (u8 *) rmp);
152 
153  vec_free (ap->host_if_name);
154  vec_free (ap->host_namespace);
155  vec_free (ap->host_bridge);
156 
157 }
158 
159 static void
161 {
164  if (!reg)
165  return;
166 
167  vnet_main_t *vnm = vnet_get_main ();
169  int rv;
170  vl_api_tap_delete_v2_reply_t *rmp;
171 
172  u32 sw_if_index = ntohl (mp->sw_if_index);
173 
175 
176  rmp = vl_msg_api_alloc (sizeof (*rmp));
177  rmp->_vl_msg_id = ntohs (REPLY_MSG_ID_BASE + VL_API_TAP_DELETE_V2_REPLY);
178  rmp->context = mp->context;
179  rmp->retval = ntohl (rv);
180 
181  vl_api_send_msg (reg, (u8 *) rmp);
182 
183  if (!rv)
185 }
186 
187 static void
189  vl_api_registration_t * reg,
191 {
193  mp = vl_msg_api_alloc (sizeof (*mp));
194  clib_memset (mp, 0, sizeof (*mp));
195  mp->_vl_msg_id =
196  htons (REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_TAP_V2_DETAILS);
197  mp->id = htonl (tap_if->id);
198  mp->sw_if_index = htonl (tap_if->sw_if_index);
199  mp->tap_flags = htonl (tap_if->tap_flags);
200  clib_memcpy (mp->dev_name, tap_if->dev_name,
201  MIN (ARRAY_LEN (mp->dev_name) - 1,
202  strlen ((const char *) tap_if->dev_name)));
203  mp->rx_ring_sz = htons (tap_if->rx_ring_sz);
204  mp->tx_ring_sz = htons (tap_if->tx_ring_sz);
206  clib_memcpy (mp->host_if_name, tap_if->host_if_name,
207  MIN (ARRAY_LEN (mp->host_if_name) - 1,
208  strlen ((const char *) tap_if->host_if_name)));
210  MIN (ARRAY_LEN (mp->host_namespace) - 1,
211  strlen ((const char *) tap_if->host_namespace)));
212  clib_memcpy (mp->host_bridge, tap_if->host_bridge,
213  MIN (ARRAY_LEN (mp->host_bridge) - 1,
214  strlen ((const char *) tap_if->host_bridge)));
215  mp->host_mtu_size = htonl (tap_if->host_mtu_size);
217 
218  if (tap_if->host_ip4_prefix_len)
219  ip4_address_encode (&tap_if->host_ip4_addr, mp->host_ip4_prefix.address);
220  mp->host_ip4_prefix.len = tap_if->host_ip4_prefix_len;
221  if (tap_if->host_ip6_prefix_len)
222  ip6_address_encode (&tap_if->host_ip6_addr, mp->host_ip6_prefix.address);
223  mp->host_ip6_prefix.len = tap_if->host_ip6_prefix_len;
224 
225  mp->context = context;
226  vl_api_send_msg (reg, (u8 *) mp);
227 }
228 
229 static void
231  mp)
232 {
233  int rv;
236  tap_interface_details_t *tapifs = NULL;
237  tap_interface_details_t *tap_if = NULL;
238  u32 filter_sw_if_index;
239 
241  if (!reg)
242  return;
243 
244  filter_sw_if_index = htonl (mp->sw_if_index);
245  if (mp->sw_if_index != ~0)
247 
248  rv = tap_dump_ifs (&tapifs);
249  if (rv)
250  return;
251 
252  vec_foreach (tap_if, tapifs)
253  {
254  if ((filter_sw_if_index == ~0)
255  || (tap_if->sw_if_index == filter_sw_if_index))
256  tap_send_sw_interface_details (am, reg, tap_if, mp->context);
257  }
259  vec_free (tapifs);
260 }
261 
262 #include <vnet/devices/tap/tapv2.api.c>
263 static clib_error_t *
265 {
266  /*
267  * Set up the (msg_name, crc, message-id) table
268  */
270 
271  return 0;
272 }
273 
275 
276 /*
277  * fd.io coding-style-patch-verification: ON
278  *
279  * Local Variables:
280  * eval: (c-set-style "gnu")
281  * End:
282  */
vl_api_tap_create_v2_t::id
u32 id[default=0xffffffff]
Definition: tapv2.api:73
tap_interface_details_t::host_ip6_prefix_len
u8 host_ip6_prefix_len
Definition: tap.h:87
tap_interface_details_t::host_ip6_addr
ip6_address_t host_ip6_addr
Definition: tap.h:86
vl_api_tap_create_v2_t::host_if_name_set
bool host_if_name_set
Definition: tapv2.api:94
tap_create_if_args_t::host_ip4_gw
ip4_address_t host_ip4_gw
Definition: tap.h:57
VALIDATE_SW_IF_INDEX
#define VALIDATE_SW_IF_INDEX(mp)
Definition: api_helper_macros.h:281
vl_api_client_index_to_registration
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
Definition: api.h:79
api.h
ntohs
#define ntohs(x)
Definition: af_xdp.bpf.c:29
tap_create_if_args_t::host_ip4_addr
ip4_address_t host_ip4_addr
Definition: tap.h:55
ip4_address_decode
void ip4_address_decode(const vl_api_ip4_address_t in, ip4_address_t *out)
Definition: ip_types_api.c:141
clib_memcpy
#define clib_memcpy(d, s, n)
Definition: string.h:197
vl_api_sw_interface_tap_v2_details_t::host_ip6_prefix
vl_api_ip6_address_with_prefix_t host_ip6_prefix
Definition: tapv2.api:160
vl_api_tap_create_v2_t::mac_address
vl_api_mac_address_t mac_address
Definition: tapv2.api:75
vl_api_send_msg
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Definition: api.h:35
tap_create_if
void tap_create_if(vlib_main_t *vm, tap_create_if_args_t *args)
Definition: tap.c:123
msg_id_base
static u16 msg_id_base
Definition: tapv2_api.c:38
tap_create_if_args_t::num_rx_queues
u8 num_rx_queues
Definition: tap.h:47
vl_api_tap_create_v2_t::host_ip4_prefix_set
bool host_ip4_prefix_set
Definition: tapv2.api:83
vpe_api_main_t
Definition: api_helper_macros.h:414
VLIB_API_INIT_FUNCTION
VLIB_API_INIT_FUNCTION(tapv2_api_hookup)
vl_api_sw_interface_tap_v2_details_t::context
u32 context
Definition: tapv2.api:152
tap_create_if_args_t::mac_addr
mac_address_t mac_addr
Definition: tap.h:46
tap_create_if_args_t::tx_ring_sz
u16 tx_ring_sz
Definition: tap.h:49
vl_api_tap_delete_v2_t::client_index
u32 client_index
Definition: tapv2.api:120
vl_api_tap_create_v2_reply_t::retval
i32 retval
Definition: tapv2.api:109
u16
unsigned short u16
Definition: types.h:57
tap_interface_details_t::sw_if_index
u32 sw_if_index
Definition: tap.h:75
am
app_main_t * am
Definition: application.c:489
ip6_address_decode
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
Definition: ip_types_api.c:129
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
tap_create_if_args_t
Definition: tap.h:42
vl_api_tap_create_v2_t::host_mtu_size
u32 host_mtu_size
Definition: tapv2.api:80
vl_api_sw_interface_tap_v2_dump_t
Dump tap interfaces request.
Definition: tapv2.api:128
vl_api_tap_create_v2_t::host_mtu_set
bool host_mtu_set
Definition: tapv2.api:79
tapv2_api_hookup
static clib_error_t * tapv2_api_hookup(vlib_main_t *vm)
Definition: tapv2_api.c:264
tap_send_sw_interface_details
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)
Definition: tapv2_api.c:188
vl_api_tap_create_v2_t::host_ip6_prefix_set
bool host_ip6_prefix_set
Definition: tapv2.api:85
tap_create_if_args_t::host_ip6_gw
ip6_address_t host_ip6_gw
Definition: tap.h:61
ethernet.h
tap_interface_details_t::host_mac_addr
mac_address_t host_mac_addr
Definition: tap.h:80
tap_create_if_args_t::host_mtu_size
u32 host_mtu_size
Definition: tap.h:64
vl_api_tap_create_v2_t::context
u32 context
Definition: tapv2.api:72
tap_create_if_args_t::host_ip4_prefix_len
u8 host_ip4_prefix_len
Definition: tap.h:56
vl_api_tap_create_v2_t::tap_flags
vl_api_tap_flags_t tap_flags
Definition: tapv2.api:91
tap_create_if_args_t::host_ip6_addr
ip6_address_t host_ip6_addr
Definition: tap.h:59
vl_api_tap_create_v2_t::host_ip6_prefix
vl_api_ip6_address_with_prefix_t host_ip6_prefix
Definition: tapv2.api:86
tap_interface_details_t::host_namespace
u8 host_namespace[64]
Definition: tap.h:82
vl_api_sw_interface_tap_v2_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Definition: tapv2.api:132
tap_create_if_args_t::host_namespace
u8 * host_namespace
Definition: tap.h:51
vl_api_tap_create_v2_t::host_ip6_gw
vl_api_ip6_address_t host_ip6_gw
Definition: tapv2.api:90
tap_interface_details_t::id
u32 id
Definition: tap.h:74
TAP_API_FLAG_IN_ORDER
@ TAP_API_FLAG_IN_ORDER
Definition: tapv2.api:36
tap_interface_details_t::dev_name
u8 dev_name[64]
Definition: tap.h:77
vl_api_tap_create_v2_t::tag
string tag[]
Definition: tapv2.api:98
tap_create_if_args_t::host_ip4_gw_set
u8 host_ip4_gw_set
Definition: tap.h:58
ip6_address_encode
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
Definition: ip_types_api.c:123
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
vl_api_tap_create_v2_t::rx_ring_sz
u16 rx_ring_sz[default=256]
Definition: tapv2.api:78
vl_api_tap_create_v2_t::host_ip6_gw_set
bool host_ip6_gw_set
Definition: tapv2.api:89
vl_api_registration_
An API client registration, only in vpp/vlib.
Definition: api_common.h:47
setup_message_id_table
static void setup_message_id_table(api_main_t *am)
Definition: sr_mpls_api.c:174
MIN
#define MIN(x, y)
Definition: node.h:31
vl_api_tap_create_v2_reply_t::context
u32 context
Definition: tapv2.api:108
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
tap_interface_details_t::host_bridge
u8 host_bridge[64]
Definition: tap.h:83
vl_api_tap_delete_v2_t::context
u32 context
Definition: tapv2.api:121
vl_api_tap_create_v2_reply_t
Reply for tap create reply.
Definition: tapv2.api:106
vl_api_sw_interface_tap_v2_details_t::host_if_name
string host_if_name[64]
Definition: tapv2.api:163
vl_api_tap_create_v2_t::host_namespace
string host_namespace[64]
Definition: tapv2.api:93
tap_create_if_args_t::mac_addr_set
u8 mac_addr_set
Definition: tap.h:45
tap_interface_details_t::host_ip4_prefix_len
u8 host_ip4_prefix_len
Definition: tap.h:85
vl_api_tap_create_v2_t::host_ip4_gw
vl_api_ip4_address_t host_ip4_gw
Definition: tapv2.api:88
tap_interface_details_t::host_ip4_addr
ip4_address_t host_ip4_addr
Definition: tap.h:84
tap_delete_if
int tap_delete_if(vlib_main_t *vm, u32 sw_if_index)
Definition: tap.c:766
vnet_set_sw_interface_tag
static void vnet_set_sw_interface_tag(vnet_main_t *vnm, u8 *tag, u32 sw_if_index)
Definition: interface_funcs.h:141
interface.h
tap_create_if_args_t::id
u32 id
Definition: tap.h:44
vl_api_tap_create_v2_reply_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: tapv2.api:110
tap.h
vl_api_sw_interface_tap_v2_details_t::host_bridge
string host_bridge[64]
Definition: tapv2.api:165
vl_api_sw_interface_tap_v2_details_t::tx_ring_sz
u16 tx_ring_sz
Definition: tapv2.api:155
vl_api_sw_interface_tap_v2_details_t::tap_flags
vl_api_tap_flags_t tap_flags
Definition: tapv2.api:161
STATIC_ASSERT
#define STATIC_ASSERT(truth,...)
Definition: error_bootstrap.h:111
vl_api_string_len
u32 vl_api_string_len(vl_api_string_t *astr)
Definition: api_shared.c:1184
vl_api_sw_interface_tap_v2_dump_t::client_index
u32 client_index
Definition: tapv2.api:130
tap_create_if_args_t::host_ip6_prefix_len
u8 host_ip6_prefix_len
Definition: tap.h:60
BAD_SW_IF_INDEX_LABEL
#define BAD_SW_IF_INDEX_LABEL
Definition: api_helper_macros.h:289
vl_api_sw_interface_tap_v2_details_t::host_mtu_size
u32 host_mtu_size
Definition: tapv2.api:157
tap_create_if_args_t::rx_ring_sz
u16 rx_ring_sz
Definition: tap.h:48
TAP_API_FLAG_PACKED
@ TAP_API_FLAG_PACKED
Definition: tapv2.api:35
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
TAP_API_FLAG_ATTACH
@ TAP_API_FLAG_ATTACH
Definition: tapv2.api:32
vl_api_tap_create_v2_t::tx_ring_sz
u16 tx_ring_sz[default=256]
Definition: tapv2.api:77
mac_address_encode
void mac_address_encode(const mac_address_t *in, u8 *out)
Definition: ethernet_types_api.c:26
format_fns.h
vl_api_tap_create_v2_t::host_ip4_gw_set
bool host_ip4_gw_set
Definition: tapv2.api:87
vl_api_sw_interface_tap_v2_dump_t::context
u32 context
Definition: tapv2.api:131
format
description fragment has unexpected format
Definition: map.api:433
vl_api_tap_create_v2_t::host_bridge_set
bool host_bridge_set
Definition: tapv2.api:96
ip.h
u32
unsigned int u32
Definition: types.h:88
tap_interface_details_t
TAP interface details struct.
Definition: tap.h:72
vnet_clear_sw_interface_tag
static void vnet_clear_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
Definition: interface_funcs.h:156
ethernet_types_api.h
vl_api_tap_create_v2_t::host_namespace_set
bool host_namespace_set
Definition: tapv2.api:92
TAP_API_FLAG_GRO_COALESCE
@ TAP_API_FLAG_GRO_COALESCE
Definition: tapv2.api:34
api_helper_macros.h
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
tap_create_if_args_t::host_bridge
u8 * host_bridge
Definition: tap.h:54
ip4_address_encode
void ip4_address_encode(const ip4_address_t *in, vl_api_ip4_address_t out)
Definition: ip_types_api.c:135
vl_api_tap_create_v2_t_handler
static void vl_api_tap_create_v2_t_handler(vl_api_tap_create_v2_t *mp)
Definition: tapv2_api.c:41
mac_address_decode
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
Definition: ethernet_types_api.c:20
tap_interface_details_t::tx_ring_sz
u16 tx_ring_sz
Definition: tap.h:78
TAP_API_FLAG_GSO
@ TAP_API_FLAG_GSO
Definition: tapv2.api:29
vl_api_tap_create_v2_t::host_mac_addr
vl_api_mac_address_t host_mac_addr
Definition: tapv2.api:82
vl_api_tap_delete_v2_t_handler
static void vl_api_tap_delete_v2_t_handler(vl_api_tap_delete_v2_t *mp)
Definition: tapv2_api.c:160
TAP_API_FLAG_TUN
@ TAP_API_FLAG_TUN
Definition: tapv2.api:33
vl_api_tap_create_v2_t::host_ip4_prefix
vl_api_ip4_address_with_prefix_t host_ip4_prefix
Definition: tapv2.api:84
vl_api_from_api_to_new_vec
u8 * vl_api_from_api_to_new_vec(void *mp, vl_api_string_t *astr)
Definition: api_shared.c:1202
vl_api_tap_create_v2_t::client_index
u32 client_index
Definition: tapv2.api:71
vl_api_sw_interface_tap_v2_details_t::id
u32 id
Definition: tapv2.api:154
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
tap_create_if_args_t::host_ip6_gw_set
u8 host_ip6_gw_set
Definition: tap.h:62
vlib_get_main
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:38
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
tap_create_if_args_t::host_if_name
u8 * host_if_name
Definition: tap.h:52
REPLY_MSG_ID_BASE
#define REPLY_MSG_ID_BASE
Definition: tapv2_api.c:35
vl_api_tap_delete_v2_t
Delete tap interface.
Definition: tapv2.api:118
vl_api_tap_create_v2_t::host_bridge
string host_bridge[64]
Definition: tapv2.api:97
vl_api_tap_create_v2_t
Initialize a new tap interface with the given parameters.
Definition: tapv2.api:69
context
u32 context
Definition: ip.api:852
tap_create_if_args_t::tap_flags
u32 tap_flags
Definition: tap.h:50
tap_interface_details_t::host_mtu_size
u32 host_mtu_size
Definition: tap.h:88
vl_api_sw_interface_tap_v2_details_t::host_namespace
string host_namespace[64]
Definition: tapv2.api:164
vl_api_sw_interface_tap_v2_dump_t_handler
static void vl_api_sw_interface_tap_v2_dump_t_handler(vl_api_sw_interface_tap_v2_dump_t *mp)
Definition: tapv2_api.c:230
rv
int __clib_unused rv
Definition: application.c:491
vl_api_sw_interface_tap_v2_details_t::host_ip4_prefix
vl_api_ip4_address_with_prefix_t host_ip4_prefix
Definition: tapv2.api:159
vl_api_sw_interface_tap_v2_details_t::sw_if_index
u32 sw_if_index
Definition: tapv2.api:153
tap_interface_details_t::tap_flags
u32 tap_flags
Definition: tap.h:76
vl_api_sw_interface_tap_v2_details_t
Reply for tap dump request.
Definition: tapv2.api:150
TAP_API_FLAG_PERSIST
@ TAP_API_FLAG_PERSIST
Definition: tapv2.api:31
vnet.h
api_errno.h
TAP_API_FLAG_CSUM_OFFLOAD
@ TAP_API_FLAG_CSUM_OFFLOAD
Definition: tapv2.api:30
tap_dump_ifs
int tap_dump_ifs(tap_interface_details_t **out_tapids)
Definition: tap.c:906
tap_create_if_args_t::host_mtu_set
u8 host_mtu_set
Definition: tap.h:63
vl_api_tap_delete_v2_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: tapv2.api:122
tap_create_if_args_t::sw_if_index
u32 sw_if_index
Definition: tap.h:66
vl_api_sw_interface_tap_v2_details_t::rx_ring_sz
u16 rx_ring_sz
Definition: tapv2.api:156
vl_api_sw_interface_tap_v2_details_t::host_mac_addr
vl_api_mac_address_t host_mac_addr
Definition: tapv2.api:158
vl_api_tap_create_v2_t::num_rx_queues
u8 num_rx_queues[default=1]
Definition: tapv2.api:76
tap_interface_details_t::host_if_name
u8 host_if_name[64]
Definition: tap.h:81
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
ip_types_api.h
vl_api_tap_create_v2_t::use_random_mac
bool use_random_mac[default=true]
Definition: tapv2.api:74
tap_interface_details_t::rx_ring_sz
u16 rx_ring_sz
Definition: tap.h:79
vl_api_tap_create_v2_t::host_if_name
string host_if_name[64]
Definition: tapv2.api:95
vl_api_tap_create_v2_t::host_mac_addr_set
bool host_mac_addr_set
Definition: tapv2.api:81
tap_create_if_args_t::host_mac_addr
mac_address_t host_mac_addr
Definition: tap.h:53
tap_create_if_args_t::rv
int rv
Definition: tap.h:67
vpe_api_main
vpe_api_main_t vpe_api_main
Definition: interface_api.c:47
vl_msg_api_alloc
void * vl_msg_api_alloc(int nbytes)
Definition: memory_shared.c:199
vl_api_sw_interface_tap_v2_details_t::dev_name
string dev_name[64]
Definition: tapv2.api:162