39 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_bond_api_msg \ 48 _(BOND_CREATE, bond_create) \ 49 _(BOND_CREATE2, bond_create2) \ 50 _(BOND_DELETE, bond_delete) \ 51 _(BOND_ENSLAVE, bond_enslave) \ 52 _(BOND_ADD_MEMBER, bond_add_member) \ 53 _(SW_INTERFACE_SET_BOND_WEIGHT, sw_interface_set_bond_weight) \ 54 _(BOND_DETACH_SLAVE, bond_detach_slave) \ 55 _(BOND_DETACH_MEMBER, bond_detach_member) \ 56 _(SW_INTERFACE_BOND_DUMP, sw_interface_bond_dump) \ 57 _(SW_BOND_INTERFACE_DUMP, sw_bond_interface_dump) \ 58 _(SW_INTERFACE_SLAVE_DUMP, sw_interface_slave_dump) \ 59 _(SW_MEMBER_INTERFACE_DUMP, sw_member_interface_dump) 66 vl_api_bond_delete_reply_t *rmp;
83 ap->
id = ntohl (mp->
id);
92 ap->
lb = ntohl (mp->
lb);
115 ap->
id = ntohl (mp->
id);
124 ap->
lb = ntohl (mp->
lb);
191 vl_api_sw_interface_set_bond_weight_reply_t *rmp;
202 REPLY_MACRO (VL_API_SW_INTERFACE_SET_BOND_WEIGHT_REPLY);
209 vl_api_bond_detach_slave_reply_t *rmp;
226 vl_api_bond_detach_member_reply_t *rmp;
249 mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_BOND_DETAILS);
251 mp->
id = htonl (bond_if->
id);
256 mp->
lb = htonl (bond_if->
lb);
300 mp->_vl_msg_id = htons (VL_API_SW_BOND_INTERFACE_DETAILS);
302 mp->
id = htonl (bond_if->
id);
307 mp->
lb = htonl (bond_if->
lb);
324 u32 filter_sw_if_index;
331 if (filter_sw_if_index != ~0)
340 if ((filter_sw_if_index == ~0) ||
359 mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_SLAVE_DETAILS);
409 mp->_vl_msg_id = htons (VL_API_SW_MEMBER_INTERFACE_DETAILS);
449 #define vl_msg_name_crc_list 451 #undef vl_msg_name_crc_list 456 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 457 foreach_vl_msg_name_crc_bond;
467 vl_msg_api_set_handlers(VL_API_##N, #n, \ 468 vl_api_##n##_t_handler, \ 470 vl_api_##n##_t_endian, \ 471 vl_api_##n##_t_print, \ 472 sizeof(vl_api_##n##_t), 1); 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)
static clib_error_t * bond_api_hookup(vlib_main_t *vm)
vl_api_interface_index_t sw_if_index
void bond_create_if(vlib_main_t *vm, bond_create_if_args_t *args)
void bond_detach_member(vlib_main_t *vm, bond_detach_member_args_t *args)
static void vl_api_bond_detach_member_t_handler(vl_api_bond_detach_member_t *mp)
vl_api_mac_address_t mac_address
Reply for member dump request.
vl_api_interface_index_t sw_if_index
member interface details struct
Interface set bond weight.
static void vl_api_bond_detach_slave_t_handler(vl_api_bond_detach_slave_t *mp)
#define foreach_bond_api_msg
Reply for bond create reply.
#define REPLY_MACRO2(t, body)
vl_api_interface_index_t sw_if_index
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vl_api_bond_create_t_handler(vl_api_bond_create_t *mp)
Reply for bond add_member reply.
static void vl_api_bond_delete_t_handler(vl_api_bond_delete_t *mp)
Initialize a new bond interface with the given paramters.
string interface_name[64]
void * vl_msg_api_alloc(int nbytes)
Initialize a new bond interface with the given paramters.
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
Dump bond interfaces request.
#define clib_memcpy(d, s, n)
static void vl_api_sw_interface_slave_dump_t_handler(vl_api_sw_interface_slave_dump_t *mp)
static void vl_api_sw_interface_bond_dump_t_handler(vl_api_sw_interface_bond_dump_t *mp)
Reply for bond enslave reply.
void bond_add_member(vlib_main_t *vm, bond_add_member_args_t *args)
static void vl_api_bond_create2_t_handler(vl_api_bond_create2_t *mp)
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
static void vl_api_bond_add_member_t_handler(vl_api_bond_add_member_t *mp)
u32 id[default=0xFFFFFFFF]
VLIB_API_INIT_FUNCTION(bond_api_hookup)
static void vl_api_sw_bond_interface_dump_t_handler(vl_api_sw_bond_interface_dump_t *mp)
static void vl_api_sw_interface_set_bond_weight_t_handler(vl_api_sw_interface_set_bond_weight_t *mp)
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)
Dump bond interfaces request.
API main structure, used by both vpp and binary API clients.
Initialize a new bond interface with the given paramters.
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_interface_index_t sw_if_index
Initialize a new bond interface with the given paramters.
int bond_dump_member_ifs(member_interface_details_t **out_memberifs, u32 bond_sw_if_index)
Reply for bond create2 reply.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_interface_index_t sw_if_index
Reply for bond dump request.
BOND interface details struct.
Reply for bond dump request.
static void bond_setup_message_id_table(api_main_t *am)
vl_api_interface_index_t bond_sw_if_index
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)
string interface_name[64]
static void vl_api_bond_enslave_t_handler(vl_api_bond_enslave_t *mp)
vl_api_interface_index_t sw_if_index
static vlib_main_t * vlib_get_main(void)
vl_api_interface_index_t bond_sw_if_index
u32 id[default=0xFFFFFFFF]
void bond_set_intf_weight(vlib_main_t *vm, bond_set_intf_weight_args_t *args)
int bond_delete_if(vlib_main_t *vm, u32 sw_if_index)
Reply for slave dump request.
static api_main_t * vlibapi_get_main(void)
vl_api_interface_index_t sw_if_index
#define vec_foreach(var, vec)
Vector iterator.
int bond_dump_ifs(bond_interface_details_t **out_bondifs)
vpe_api_main_t vpe_api_main
string interface_name[64]
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
vl_api_mac_address_t mac_address
string interface_name[64]
#define VALIDATE_SW_IF_INDEX(mp)
static void vl_api_sw_member_interface_dump_t_handler(vl_api_sw_member_interface_dump_t *mp)