FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
bond_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * bond_api.c - vnet bonding 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>
27 #include <vnet/bonding/node.h>
28 
29 #include <vnet/format_fns.h>
30 #include <vnet/bonding/bond.api_enum.h>
31 #include <vnet/bonding/bond.api_types.h>
32 
33 #define REPLY_MSG_ID_BASE msg_id_base
35 
37 
38 static void
40 {
42  int rv;
43  vl_api_bond_delete_reply_t *rmp;
44  u32 sw_if_index = ntohl (mp->sw_if_index);
45 
47 
48  REPLY_MACRO (VL_API_BOND_DELETE_REPLY);
49 }
50 
51 static void
53 {
56  bond_create_if_args_t _a, *ap = &_a;
57 
58  clib_memset (ap, 0, sizeof (*ap));
59 
60  ap->id = ntohl (mp->id);
61 
62  if (mp->use_custom_mac)
63  {
65  ap->hw_addr_set = 1;
66  }
67 
68  ap->mode = ntohl (mp->mode);
69  ap->lb = ntohl (mp->lb);
70  ap->numa_only = mp->numa_only;
71  bond_create_if (vm, ap);
72 
73  int rv = ap->rv;
74 
75  /* *INDENT-OFF* */
76  REPLY_MACRO2(VL_API_BOND_CREATE_REPLY,
77  ({
78  rmp->sw_if_index = ntohl (ap->sw_if_index);
79  }));
80  /* *INDENT-ON* */
81 }
82 
83 static void
85 {
88  bond_create_if_args_t _a, *ap = &_a;
89 
90  clib_memset (ap, 0, sizeof (*ap));
91 
92  ap->id = ntohl (mp->id);
93 
94  if (mp->use_custom_mac)
95  {
97  ap->hw_addr_set = 1;
98  }
99 
100  ap->mode = ntohl (mp->mode);
101  ap->lb = ntohl (mp->lb);
102  ap->numa_only = mp->numa_only;
103  ap->gso = mp->enable_gso;
104  bond_create_if (vm, ap);
105 
106  int rv = ap->rv;
107 
108  /* *INDENT-OFF* */
109  REPLY_MACRO2(VL_API_BOND_CREATE2_REPLY,
110  ({
111  rmp->sw_if_index = ntohl (ap->sw_if_index);
112  }));
113  /* *INDENT-ON* */
114 }
115 
116 static void
118 {
121  bond_add_member_args_t _a, *ap = &_a;
122  int rv = 0;
123 
124  clib_memset (ap, 0, sizeof (*ap));
125 
126  ap->group = ntohl (mp->bond_sw_if_index);
128  ap->member = ntohl (mp->sw_if_index);
129  ap->is_passive = mp->is_passive;
131 
132  bond_add_member (vm, ap);
133  rv = ap->rv;
134 
136  REPLY_MACRO (VL_API_BOND_ADD_MEMBER_REPLY);
137 }
138 
139 static void
141 {
144  bond_add_member_args_t _a, *ap = &_a;
145  int rv = 0;
146 
147  clib_memset (ap, 0, sizeof (*ap));
148 
149  ap->group = ntohl (mp->bond_sw_if_index);
151  ap->member = ntohl (mp->sw_if_index);
152  ap->is_passive = mp->is_passive;
154 
155  bond_add_member (vm, ap);
156  rv = ap->rv;
157 
159  REPLY_MACRO (VL_API_BOND_ENSLAVE_REPLY);
160 }
161 
162 static void
165 {
167  bond_set_intf_weight_args_t _a, *ap = &_a;
168  vl_api_sw_interface_set_bond_weight_reply_t *rmp;
169  int rv = 0;
170 
171  clib_memset (ap, 0, sizeof (*ap));
172 
173  ap->sw_if_index = ntohl (mp->sw_if_index);
174  ap->weight = ntohl (mp->weight);
175 
176  bond_set_intf_weight (vm, ap);
177  rv = ap->rv;
178 
179  REPLY_MACRO (VL_API_SW_INTERFACE_SET_BOND_WEIGHT_REPLY);
180 }
181 
182 static void
184 {
186  vl_api_bond_detach_slave_reply_t *rmp;
187  bond_detach_member_args_t _a, *ap = &_a;
188  int rv = 0;
189 
190  clib_memset (ap, 0, sizeof (*ap));
191 
192  ap->member = ntohl (mp->sw_if_index);
193  bond_detach_member (vm, ap);
194  rv = ap->rv;
195 
196  REPLY_MACRO (VL_API_BOND_DETACH_SLAVE_REPLY);
197 }
198 
199 static void
201 {
203  vl_api_bond_detach_member_reply_t *rmp;
204  bond_detach_member_args_t _a, *ap = &_a;
205  int rv = 0;
206 
207  clib_memset (ap, 0, sizeof (*ap));
208 
209  ap->member = ntohl (mp->sw_if_index);
210  bond_detach_member (vm, ap);
211  rv = ap->rv;
212 
213  REPLY_MACRO (VL_API_BOND_DETACH_MEMBER_REPLY);
214 }
215 
216 static void
218  vl_api_registration_t * reg,
219  bond_interface_details_t * bond_if,
220  u32 context)
221 {
223 
224  mp = vl_msg_api_alloc (sizeof (*mp));
225  clib_memset (mp, 0, sizeof (*mp));
226  mp->_vl_msg_id =
227  htons (REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_BOND_DETAILS);
228  mp->sw_if_index = htonl (bond_if->sw_if_index);
229  mp->id = htonl (bond_if->id);
231  MIN (ARRAY_LEN (mp->interface_name) - 1,
232  strlen ((const char *) bond_if->interface_name)));
233  mp->mode = htonl (bond_if->mode);
234  mp->lb = htonl (bond_if->lb);
235  mp->numa_only = bond_if->numa_only;
236  mp->active_slaves = htonl (bond_if->active_members);
237  mp->slaves = htonl (bond_if->members);
238 
239  mp->context = context;
240  vl_api_send_msg (reg, (u8 *) mp);
241 }
242 
243 static void
245 {
246  int rv;
249  bond_interface_details_t *bondifs = NULL;
250  bond_interface_details_t *bond_if = NULL;
251 
253  if (!reg)
254  return;
255 
256  rv = bond_dump_ifs (&bondifs);
257  if (rv)
258  return;
259 
260  vec_foreach (bond_if, bondifs)
261  {
262  bond_send_sw_interface_details (am, reg, bond_if, mp->context);
263  }
264 
265  vec_free (bondifs);
266 }
267 
268 static void
270  vl_api_registration_t * reg,
271  bond_interface_details_t * bond_if,
272  u32 context)
273 {
275 
276  mp = vl_msg_api_alloc (sizeof (*mp));
277  clib_memset (mp, 0, sizeof (*mp));
278  mp->_vl_msg_id =
279  htons (REPLY_MSG_ID_BASE + VL_API_SW_BOND_INTERFACE_DETAILS);
280  mp->sw_if_index = htonl (bond_if->sw_if_index);
281  mp->id = htonl (bond_if->id);
283  MIN (ARRAY_LEN (mp->interface_name) - 1,
284  strlen ((const char *) bond_if->interface_name)));
285  mp->mode = htonl (bond_if->mode);
286  mp->lb = htonl (bond_if->lb);
287  mp->numa_only = bond_if->numa_only;
288  mp->active_members = htonl (bond_if->active_members);
289  mp->members = htonl (bond_if->members);
290 
291  mp->context = context;
292  vl_api_send_msg (reg, (u8 *) mp);
293 }
294 
295 static void
297 {
298  int rv;
301  bond_interface_details_t *bondifs = NULL;
302  bond_interface_details_t *bond_if = NULL;
303  u32 filter_sw_if_index;
304 
306  if (!reg)
307  return;
308 
309  filter_sw_if_index = htonl (mp->sw_if_index);
310  if (filter_sw_if_index != ~0)
312 
313  rv = bond_dump_ifs (&bondifs);
314  if (rv)
315  return;
316 
317  vec_foreach (bond_if, bondifs)
318  {
319  if ((filter_sw_if_index == ~0) ||
320  (bond_if->sw_if_index == filter_sw_if_index))
321  bond_send_sw_bond_interface_details (am, reg, bond_if, mp->context);
322  }
323 
325  vec_free (bondifs);
326 }
327 
328 static void
330  vl_api_registration_t * reg,
331  member_interface_details_t * member_if,
332  u32 context)
333 {
335 
336  mp = vl_msg_api_alloc (sizeof (*mp));
337  clib_memset (mp, 0, sizeof (*mp));
338  mp->_vl_msg_id =
339  htons (REPLY_MSG_ID_BASE + VL_API_SW_INTERFACE_SLAVE_DETAILS);
340  mp->sw_if_index = htonl (member_if->sw_if_index);
341  clib_memcpy (mp->interface_name, member_if->interface_name,
342  MIN (ARRAY_LEN (mp->interface_name) - 1,
343  strlen ((const char *) member_if->interface_name)));
344  mp->is_passive = member_if->is_passive;
345  mp->is_long_timeout = member_if->is_long_timeout;
346  mp->is_local_numa = member_if->is_local_numa;
347  mp->weight = htonl (member_if->weight);
348 
349  mp->context = context;
350  vl_api_send_msg (reg, (u8 *) mp);
351 }
352 
353 static void
355  mp)
356 {
357  int rv;
360  member_interface_details_t *memberifs = NULL;
361  member_interface_details_t *member_if = NULL;
362 
364  if (!reg)
365  return;
366 
367  rv = bond_dump_member_ifs (&memberifs, ntohl (mp->sw_if_index));
368  if (rv)
369  return;
370 
371  vec_foreach (member_if, memberifs)
372  {
373  bond_send_sw_member_interface_details (am, reg, member_if, mp->context);
374  }
375 
376  vec_free (memberifs);
377 }
378 
379 static void
381  vl_api_registration_t * reg,
382  member_interface_details_t * member_if,
383  u32 context)
384 {
386 
387  mp = vl_msg_api_alloc (sizeof (*mp));
388  clib_memset (mp, 0, sizeof (*mp));
389  mp->_vl_msg_id =
390  htons (REPLY_MSG_ID_BASE + VL_API_SW_MEMBER_INTERFACE_DETAILS);
391  mp->sw_if_index = htonl (member_if->sw_if_index);
392  clib_memcpy (mp->interface_name, member_if->interface_name,
393  MIN (ARRAY_LEN (mp->interface_name) - 1,
394  strlen ((const char *) member_if->interface_name)));
395  mp->is_passive = member_if->is_passive;
396  mp->is_long_timeout = member_if->is_long_timeout;
397  mp->is_local_numa = member_if->is_local_numa;
398  mp->weight = htonl (member_if->weight);
399 
400  mp->context = context;
401  vl_api_send_msg (reg, (u8 *) mp);
402 }
403 
404 static void
406  mp)
407 {
408  int rv;
411  member_interface_details_t *memberifs = NULL;
412  member_interface_details_t *member_if = NULL;
413 
415  if (!reg)
416  return;
417 
418  rv = bond_dump_member_ifs (&memberifs, ntohl (mp->sw_if_index));
419  if (rv)
420  return;
421 
422  vec_foreach (member_if, memberifs)
423  {
424  bond_send_member_interface_details (am, reg, member_if, mp->context);
425  }
426 
427  vec_free (memberifs);
428 }
429 
430 #include <vnet/bonding/bond.api.c>
431 static clib_error_t *
433 {
434  /*
435  * Set up the (msg_name, crc, message-id) table
436  */
438 
439  return 0;
440 }
441 
443 
444 /*
445  * fd.io coding-style-patch-verification: ON
446  *
447  * Local Variables:
448  * eval: (c-set-style "gnu")
449  * End:
450  */
member_interface_details_t::is_local_numa
u8 is_local_numa
Definition: node.h:143
vl_api_bond_create_t::numa_only
bool numa_only
Definition: bond.api:66
vl_api_sw_bond_interface_dump_t_handler
static void vl_api_sw_bond_interface_dump_t_handler(vl_api_sw_bond_interface_dump_t *mp)
Definition: bond_api.c:296
vl_api_bond_add_member_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:170
vl_api_bond_create2_reply_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:114
bond_create_if
void bond_create_if(vlib_main_t *vm, bond_create_if_args_t *args)
Definition: cli.c:377
vl_api_sw_interface_slave_details_t
Reply for slave dump request.
Definition: bond.api:294
vl_api_sw_interface_bond_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:232
vl_api_bond_create_t::mode
vl_api_bond_mode_t mode
Definition: bond.api:64
vl_api_sw_member_interface_details_t::weight
u32 weight
Definition: bond.api:333
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
vl_api_bond_detach_slave_t
bond detach slave
Definition: bond.api:191
member_interface_details_t::is_long_timeout
u8 is_long_timeout
Definition: node.h:142
vl_api_sw_interface_bond_details_t::interface_name
string interface_name[64]
Definition: bond.api:239
api.h
vl_api_sw_member_interface_dump_t_handler
static void vl_api_sw_member_interface_dump_t_handler(vl_api_sw_member_interface_dump_t *mp)
Definition: bond_api.c:405
vl_api_sw_interface_set_bond_weight_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:346
vl_api_bond_detach_slave_t_handler
static void vl_api_bond_detach_slave_t_handler(vl_api_bond_detach_slave_t *mp)
Definition: bond_api.c:183
vl_api_sw_interface_bond_details_t::active_slaves
u32 active_slaves
Definition: bond.api:237
vl_api_sw_bond_interface_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Definition: bond.api:247
bond_set_intf_weight_args_t::weight
u32 weight
Definition: node.h:117
vl_api_sw_interface_bond_dump_t_handler
static void vl_api_sw_interface_bond_dump_t_handler(vl_api_sw_interface_bond_dump_t *mp)
Definition: bond_api.c:244
vl_api_bond_create2_t::enable_gso
bool enable_gso
Definition: bond.api:99
vl_api_bond_enslave_t
Initialize a new bond interface with the given paramters.
Definition: bond.api:137
REPLY_MACRO2
#define REPLY_MACRO2(t, body)
Definition: api_helper_macros.h:65
vl_api_bond_create_t::mac_address
vl_api_mac_address_t mac_address
Definition: bond.api:63
clib_memcpy
#define clib_memcpy(d, s, n)
Definition: string.h:197
vl_api_sw_member_interface_details_t::context
u32 context
Definition: bond.api:327
bond_add_member_args_t::group
u32 group
Definition: node.h:98
vl_api_send_msg
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Definition: api.h:35
vl_api_bond_delete_t
Delete bond interface.
Definition: bond.api:122
vl_api_sw_interface_slave_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:297
vl_api_sw_bond_interface_details_t::interface_name
string interface_name[64]
Definition: bond.api:270
bond_add_member_args_t::member
u32 member
Definition: node.h:96
bond_create_if_args_t::sw_if_index
u32 sw_if_index
Definition: node.h:88
vl_api_bond_add_member_t_handler
static void vl_api_bond_add_member_t_handler(vl_api_bond_add_member_t *mp)
Definition: bond_api.c:117
bond_interface_details_t::members
u32 members
Definition: node.h:133
vpe_api_main_t
Definition: api_helper_macros.h:414
vl_api_sw_bond_interface_dump_t::context
u32 context
Definition: bond.api:246
vl_api_bond_create2_t
Initialize a new bond interface with the given paramters.
Definition: bond.api:92
vl_api_sw_bond_interface_dump_t::client_index
u32 client_index
Definition: bond.api:245
vl_api_sw_member_interface_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:314
bond_delete_if
int bond_delete_if(vlib_main_t *vm, u32 sw_if_index)
Definition: cli.c:336
bond_api_hookup
static clib_error_t * bond_api_hookup(vlib_main_t *vm)
Definition: bond_api.c:432
vl_api_bond_delete_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:126
u16
unsigned short u16
Definition: types.h:57
bond_interface_details_t::sw_if_index
u32 sw_if_index
Definition: node.h:126
vl_api_bond_create_t::id
u32 id[default=0xFFFFFFFF]
Definition: bond.api:61
am
app_main_t * am
Definition: application.c:489
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
bond_create_if_args_t
Definition: node.h:78
vl_api_sw_interface_bond_details_t::lb
vl_api_bond_lb_algo_t lb
Definition: bond.api:235
vl_api_bond_enslave_t::is_passive
bool is_passive
Definition: bond.api:144
member_interface_details_t
member interface details struct
Definition: node.h:137
vl_api_sw_interface_slave_dump_t::client_index
u32 client_index
Definition: bond.api:281
vl_api_sw_interface_slave_details_t::weight
u32 weight
Definition: bond.api:302
vl_api_sw_member_interface_dump_t::client_index
u32 client_index
Definition: bond.api:312
vl_api_sw_interface_slave_details_t::is_local_numa
bool is_local_numa
Definition: bond.api:301
vl_api_sw_interface_bond_details_t::context
u32 context
Definition: bond.api:231
vl_api_sw_interface_slave_details_t::interface_name
string interface_name[64]
Definition: bond.api:298
bond_add_member_args_t::is_passive
u8 is_passive
Definition: node.h:99
ethernet.h
vl_api_sw_bond_interface_details_t::mode
vl_api_bond_mode_t mode
Definition: bond.api:265
vl_api_bond_create_reply_t
Reply for bond create reply.
Definition: bond.api:74
vl_api_sw_bond_interface_details_t::members
u32 members
Definition: bond.api:269
vl_api_sw_interface_bond_dump_t::context
u32 context
Definition: bond.api:216
msg_id_base
static u16 msg_id_base
Definition: bond_api.c:36
vl_api_bond_create_reply_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:78
vl_api_bond_create_t::use_custom_mac
bool use_custom_mac
Definition: bond.api:62
vl_api_sw_bond_interface_dump_t
Dump bond interfaces request.
Definition: bond.api:243
bond_interface_details_t::interface_name
u8 interface_name[64]
Definition: node.h:128
vl_api_bond_create2_t::mode
vl_api_bond_mode_t mode
Definition: bond.api:96
vl_api_sw_member_interface_dump_t
bond member dump
Definition: bond.api:310
bond_set_intf_weight
void bond_set_intf_weight(vlib_main_t *vm, bond_set_intf_weight_args_t *args)
Definition: cli.c:997
bond_add_member_args_t
Definition: node.h:93
bond_send_sw_bond_interface_details
static void bond_send_sw_bond_interface_details(vpe_api_main_t *am, vl_api_registration_t *reg, bond_interface_details_t *bond_if, u32 context)
Definition: bond_api.c:269
bond_send_member_interface_details
static void bond_send_member_interface_details(vpe_api_main_t *am, vl_api_registration_t *reg, member_interface_details_t *member_if, u32 context)
Definition: bond_api.c:380
vl_api_sw_member_interface_details_t::is_local_numa
bool is_local_numa
Definition: bond.api:332
vl_api_bond_create2_t::numa_only
bool numa_only
Definition: bond.api:98
vl_api_sw_interface_bond_dump_t::client_index
u32 client_index
Definition: bond.api:215
vl_api_sw_interface_bond_details_t::id
u32 id
Definition: bond.api:233
vl_api_sw_interface_set_bond_weight_t::weight
u32 weight
Definition: bond.api:347
vl_api_registration_
An API client registration, only in vpp/vlib.
Definition: api_common.h:47
REPLY_MACRO
#define REPLY_MACRO(t)
Definition: api_helper_macros.h:30
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
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
vl_api_bond_enslave_t_handler
static void vl_api_bond_enslave_t_handler(vl_api_bond_enslave_t *mp)
Definition: bond_api.c:140
bond_interface_details_t::numa_only
u8 numa_only
Definition: node.h:131
bond_send_sw_interface_details
static void bond_send_sw_interface_details(vpe_api_main_t *am, vl_api_registration_t *reg, bond_interface_details_t *bond_if, u32 context)
Definition: bond_api.c:217
bond_detach_member
void bond_detach_member(vlib_main_t *vm, bond_detach_member_args_t *args)
Definition: cli.c:830
bond_add_member_args_t::rv
int rv
Definition: node.h:102
bond_create_if_args_t::gso
u8 gso
Definition: node.h:86
vl_api_sw_bond_interface_details_t::numa_only
bool numa_only
Definition: bond.api:267
bond_detach_member_args_t::rv
int rv
Definition: node.h:110
vl_api_bond_create2_t::use_custom_mac
bool use_custom_mac
Definition: bond.api:100
vl_api_sw_interface_slave_details_t::context
u32 context
Definition: bond.api:296
vl_api_sw_interface_slave_details_t::is_long_timeout
bool is_long_timeout
Definition: bond.api:300
vl_api_sw_bond_interface_details_t::id
u32 id
Definition: bond.api:264
interface.h
node.h
bond_create_if_args_t::hw_addr_set
u8 hw_addr_set
Definition: node.h:81
bond_create_if_args_t::rv
int rv
Definition: node.h:89
vl_api_sw_interface_bond_dump_t
Dump bond interfaces request.
Definition: bond.api:212
vl_api_sw_bond_interface_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:263
VLIB_API_INIT_FUNCTION
VLIB_API_INIT_FUNCTION(bond_api_hookup)
member_interface_details_t::weight
u32 weight
Definition: node.h:144
vl_api_bond_add_member_t::bond_sw_if_index
vl_api_interface_index_t bond_sw_if_index
Definition: bond.api:171
vl_api_bond_delete_t_handler
static void vl_api_bond_delete_t_handler(vl_api_bond_delete_t *mp)
Definition: bond_api.c:39
BAD_SW_IF_INDEX_LABEL
#define BAD_SW_IF_INDEX_LABEL
Definition: api_helper_macros.h:289
vl_api_bond_detach_member_t
bond detach member
Definition: bond.api:204
bond_interface_details_t::mode
u32 mode
Definition: node.h:129
vl_api_bond_detach_member_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:208
vl_api_bond_enslave_t::bond_sw_if_index
vl_api_interface_index_t bond_sw_if_index
Definition: bond.api:143
vl_api_bond_create2_t::mac_address
vl_api_mac_address_t mac_address
Definition: bond.api:101
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
bond_create_if_args_t::id
u32 id
Definition: node.h:80
vl_api_sw_interface_slave_details_t::is_passive
bool is_passive
Definition: bond.api:299
vl_api_sw_interface_set_bond_weight_t_handler
static void vl_api_sw_interface_set_bond_weight_t_handler(vl_api_sw_interface_set_bond_weight_t *mp)
Definition: bond_api.c:164
vl_api_bond_add_member_t::is_passive
bool is_passive
Definition: bond.api:172
format_fns.h
vl_api_sw_bond_interface_details_t
Reply for bond dump request.
Definition: bond.api:260
member_interface_details_t::interface_name
u8 interface_name[64]
Definition: node.h:140
vl_api_bond_create2_reply_t
Reply for bond create2 reply.
Definition: bond.api:110
vl_api_sw_member_interface_details_t::interface_name
string interface_name[64]
Definition: bond.api:329
u32
unsigned int u32
Definition: types.h:88
bond_interface_details_t::active_members
u32 active_members
Definition: node.h:132
vl_api_sw_interface_bond_details_t::numa_only
bool numa_only
Definition: bond.api:236
vl_api_bond_create_t::lb
vl_api_bond_lb_algo_t lb
Definition: bond.api:65
vl_api_sw_interface_slave_dump_t::context
u32 context
Definition: bond.api:282
vl_api_sw_member_interface_details_t
Reply for member dump request.
Definition: bond.api:325
ethernet_types_api.h
bond_dump_member_ifs
int bond_dump_member_ifs(member_interface_details_t **out_memberifs, u32 bond_sw_if_index)
Definition: cli.c:212
bond_interface_details_t::lb
u32 lb
Definition: node.h:130
vl_api_bond_detach_member_t_handler
static void vl_api_bond_detach_member_t_handler(vl_api_bond_detach_member_t *mp)
Definition: bond_api.c:200
api_helper_macros.h
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
vl_api_bond_create2_t::id
u32 id[default=0xFFFFFFFF]
Definition: bond.api:102
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
vl_api_sw_interface_bond_details_t::mode
vl_api_bond_mode_t mode
Definition: bond.api:234
bond_dump_ifs
int bond_dump_ifs(bond_interface_details_t **out_bondifs)
Definition: cli.c:177
vl_api_sw_interface_slave_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:283
bond_create_if_args_t::lb
u8 lb
Definition: node.h:84
REPLY_MSG_ID_BASE
#define REPLY_MSG_ID_BASE
Definition: bond_api.c:33
mac_address_t_
Definition: mac_address.h:21
vl_api_bond_create2_t::lb
vl_api_bond_lb_algo_t lb
Definition: bond.api:97
bond_set_intf_weight_args_t
Definition: node.h:114
bond_interface_details_t::id
u32 id
Definition: node.h:127
member_interface_details_t::is_passive
u8 is_passive
Definition: node.h:141
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
bond_set_intf_weight_args_t::sw_if_index
u32 sw_if_index
Definition: node.h:116
vl_api_sw_interface_slave_dump_t_handler
static void vl_api_sw_interface_slave_dump_t_handler(vl_api_sw_interface_slave_dump_t *mp)
Definition: bond_api.c:354
bond_create_if_args_t::mode
u8 mode
Definition: node.h:83
vl_api_sw_bond_interface_details_t::active_members
u32 active_members
Definition: bond.api:268
vlib_get_main
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:38
vl_api_sw_bond_interface_details_t::lb
vl_api_bond_lb_algo_t lb
Definition: bond.api:266
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vl_api_bond_create_t
Initialize a new bond interface with the given paramters.
Definition: bond.api:56
vl_api_bond_create_t_handler
static void vl_api_bond_create_t_handler(vl_api_bond_create_t *mp)
Definition: bond_api.c:52
bond_set_intf_weight_args_t::rv
int rv
Definition: node.h:119
vl_api_sw_interface_slave_dump_t
bond slave dump
Definition: bond.api:278
bond_interface_details_t
BOND interface details struct.
Definition: node.h:124
bond_send_sw_member_interface_details
static void bond_send_sw_member_interface_details(vpe_api_main_t *am, vl_api_registration_t *reg, member_interface_details_t *member_if, u32 context)
Definition: bond_api.c:329
context
u32 context
Definition: ip.api:852
vl_api_sw_member_interface_details_t::is_long_timeout
bool is_long_timeout
Definition: bond.api:331
vl_api_sw_interface_set_bond_weight_t
Interface set bond weight.
Definition: bond.api:342
rv
int __clib_unused rv
Definition: application.c:491
bond_detach_member_args_t::member
u32 member
Definition: node.h:108
vl_api_sw_member_interface_dump_t::context
u32 context
Definition: bond.api:313
vl_api_sw_member_interface_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:328
vl_api_bond_enslave_t::is_long_timeout
bool is_long_timeout
Definition: bond.api:145
vl_api_sw_member_interface_details_t::is_passive
bool is_passive
Definition: bond.api:330
vnet.h
vl_api_bond_add_member_reply_t
Reply for bond add_member reply.
Definition: bond.api:180
api_errno.h
bond_add_member
void bond_add_member(vlib_main_t *vm, bond_add_member_args_t *args)
Definition: cli.c:600
vl_api_bond_add_member_t
Initialize a new bond interface with the given paramters.
Definition: bond.api:166
bond_create_if_args_t::numa_only
u8 numa_only
Definition: node.h:85
member_interface_details_t::sw_if_index
u32 sw_if_index
Definition: node.h:139
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vl_api_bond_create2_t_handler
static void vl_api_bond_create2_t_handler(vl_api_bond_create2_t *mp)
Definition: bond_api.c:84
vl_api_bond_detach_slave_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:196
vl_api_sw_interface_bond_details_t::slaves
u32 slaves
Definition: bond.api:238
vl_api_sw_interface_bond_details_t
Reply for bond dump request.
Definition: bond.api:229
bond_detach_member_args_t
Definition: node.h:106
bond_create_if_args_t::hw_addr
u8 hw_addr[6]
Definition: node.h:82
vl_api_bond_enslave_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:142
vl_api_bond_add_member_t::is_long_timeout
bool is_long_timeout
Definition: bond.api:173
vpe_api_main
vpe_api_main_t vpe_api_main
Definition: interface_api.c:47
bond_add_member_args_t::is_long_timeout
u8 is_long_timeout
Definition: node.h:100
vl_msg_api_alloc
void * vl_msg_api_alloc(int nbytes)
Definition: memory_shared.c:199
vl_api_bond_enslave_reply_t
Reply for bond enslave reply.
Definition: bond.api:152
vl_api_sw_bond_interface_details_t::context
u32 context
Definition: bond.api:262