*------------------------------------------------------------------
* api_format.c
*
- * Copyright (c) 2014-2016 Cisco and/or its affiliates.
+ * Copyright (c) 2014-2020 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
#include <vnet/mpls/mpls.h>
#include <vnet/ipsec/ipsec.h>
#include <inttypes.h>
-#include <vnet/cop/cop.h>
#include <vnet/ip/ip6_hop_by_hop.h>
#include <vnet/ip/ip_source_and_port_range_check.h>
#include <vnet/policer/xlate.h>
}
static void
-vl_api_bond_enslave_reply_t_handler (vl_api_bond_enslave_reply_t * mp)
+vl_api_bond_add_member_reply_t_handler (vl_api_bond_add_member_reply_t * mp)
{
vat_main_t *vam = &vat_main;
i32 retval = ntohl (mp->retval);
}
}
-static void vl_api_bond_enslave_reply_t_handler_json
- (vl_api_bond_enslave_reply_t * mp)
+static void vl_api_bond_add_member_reply_t_handler_json
+ (vl_api_bond_add_member_reply_t * mp)
{
vat_main_t *vam = &vat_main;
vat_json_node_t node;
}
static void
-vl_api_bond_detach_slave_reply_t_handler (vl_api_bond_detach_slave_reply_t *
- mp)
+vl_api_bond_detach_member_reply_t_handler (vl_api_bond_detach_member_reply_t *
+ mp)
{
vat_main_t *vam = &vat_main;
i32 retval = ntohl (mp->retval);
}
}
-static void vl_api_bond_detach_slave_reply_t_handler_json
- (vl_api_bond_detach_slave_reply_t * mp)
+static void vl_api_bond_detach_member_reply_t_handler_json
+ (vl_api_bond_detach_member_reply_t * mp)
{
vat_main_t *vam = &vat_main;
vat_json_node_t node;
return ret;
}
-static void vl_api_sw_interface_bond_details_t_handler
- (vl_api_sw_interface_bond_details_t * mp)
+static void vl_api_sw_bond_interface_details_t_handler
+ (vl_api_sw_bond_interface_details_t * mp)
{
vat_main_t *vam = &vat_main;
"%-16s %-12d %-12U %-13U %-14u %-14u",
mp->interface_name, ntohl (mp->sw_if_index),
format_bond_mode, ntohl (mp->mode), format_bond_load_balance,
- ntohl (mp->lb), ntohl (mp->active_slaves), ntohl (mp->slaves));
+ ntohl (mp->lb), ntohl (mp->active_members), ntohl (mp->members));
}
-static void vl_api_sw_interface_bond_details_t_handler_json
- (vl_api_sw_interface_bond_details_t * mp)
+static void vl_api_sw_bond_interface_details_t_handler_json
+ (vl_api_sw_bond_interface_details_t * mp)
{
vat_main_t *vam = &vat_main;
vat_json_node_t *node = NULL;
mp->interface_name);
vat_json_object_add_uint (node, "mode", ntohl (mp->mode));
vat_json_object_add_uint (node, "load_balance", ntohl (mp->lb));
- vat_json_object_add_uint (node, "active_slaves", ntohl (mp->active_slaves));
- vat_json_object_add_uint (node, "slaves", ntohl (mp->slaves));
+ vat_json_object_add_uint (node, "active_members",
+ ntohl (mp->active_members));
+ vat_json_object_add_uint (node, "members", ntohl (mp->members));
}
static int
-api_sw_interface_bond_dump (vat_main_t * vam)
+api_sw_bond_interface_dump (vat_main_t * vam)
{
- vl_api_sw_interface_bond_dump_t *mp;
+ unformat_input_t *i = vam->input;
+ vl_api_sw_bond_interface_dump_t *mp;
vl_api_control_ping_t *mp_ping;
int ret;
+ u32 sw_if_index = ~0;
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+ ;
+ else if (unformat (i, "sw_if_index %d", &sw_if_index))
+ ;
+ else
+ break;
+ }
print (vam->ofp,
"\n%-16s %-12s %-12s %-13s %-14s %-14s",
"interface name", "sw_if_index", "mode", "load balance",
- "active slaves", "slaves");
+ "active members", "members");
/* Get list of bond interfaces */
- M (SW_INTERFACE_BOND_DUMP, mp);
+ M (SW_BOND_INTERFACE_DUMP, mp);
+ mp->sw_if_index = ntohl (sw_if_index);
S (mp);
/* Use a control ping for synchronization */
return ret;
}
-static void vl_api_sw_interface_slave_details_t_handler
- (vl_api_sw_interface_slave_details_t * mp)
+static void vl_api_sw_member_interface_details_t_handler
+ (vl_api_sw_member_interface_details_t * mp)
{
vat_main_t *vam = &vat_main;
ntohl (mp->weight), mp->is_local_numa);
}
-static void vl_api_sw_interface_slave_details_t_handler_json
- (vl_api_sw_interface_slave_details_t * mp)
+static void vl_api_sw_member_interface_details_t_handler_json
+ (vl_api_sw_member_interface_details_t * mp)
{
vat_main_t *vam = &vat_main;
vat_json_node_t *node = NULL;
}
static int
-api_sw_interface_slave_dump (vat_main_t * vam)
+api_sw_member_interface_dump (vat_main_t * vam)
{
unformat_input_t *i = vam->input;
- vl_api_sw_interface_slave_dump_t *mp;
+ vl_api_sw_member_interface_dump_t *mp;
vl_api_control_ping_t *mp_ping;
u32 sw_if_index = ~0;
u8 sw_if_index_set = 0;
print (vam->ofp,
"\n%-25s %-12s %-7s %-12s %-10s %-10s",
- "slave interface name", "sw_if_index", "passive", "long_timeout",
+ "member interface name", "sw_if_index", "passive", "long_timeout",
"weight", "local numa");
/* Get list of bond interfaces */
- M (SW_INTERFACE_SLAVE_DUMP, mp);
+ M (SW_MEMBER_INTERFACE_DUMP, mp);
mp->sw_if_index = ntohl (sw_if_index);
S (mp);
_(SW_INTERFACE_VIRTIO_PCI_DETAILS, sw_interface_virtio_pci_details) \
_(BOND_CREATE_REPLY, bond_create_reply) \
_(BOND_DELETE_REPLY, bond_delete_reply) \
-_(BOND_ENSLAVE_REPLY, bond_enslave_reply) \
-_(BOND_DETACH_SLAVE_REPLY, bond_detach_slave_reply) \
+_(BOND_ADD_MEMBER_REPLY, bond_add_member_reply) \
+_(BOND_DETACH_MEMBER_REPLY, bond_detach_member_reply) \
_(SW_INTERFACE_SET_BOND_WEIGHT_REPLY, sw_interface_set_bond_weight_reply) \
-_(SW_INTERFACE_BOND_DETAILS, sw_interface_bond_details) \
-_(SW_INTERFACE_SLAVE_DETAILS, sw_interface_slave_details) \
+_(SW_BOND_INTERFACE_DETAILS, sw_bond_interface_details) \
+_(SW_MEMBER_INTERFACE_DETAILS, sw_member_interface_details) \
_(IP_ROUTE_ADD_DEL_REPLY, ip_route_add_del_reply) \
_(IP_TABLE_ADD_DEL_REPLY, ip_table_add_del_reply) \
_(IP_TABLE_REPLACE_BEGIN_REPLY, ip_table_replace_begin_reply) \
}
static int
-api_bond_enslave (vat_main_t * vam)
+api_bond_add_member (vat_main_t * vam)
{
unformat_input_t *i = vam->input;
- vl_api_bond_enslave_t *mp;
+ vl_api_bond_add_member_t *mp;
u32 bond_sw_if_index;
int ret;
u8 is_passive;
}
if (sw_if_index_is_set == 0)
{
- errmsg ("Missing slave sw_if_index. ");
+ errmsg ("Missing member sw_if_index. ");
return -99;
}
/* Construct the API message */
- M (BOND_ENSLAVE, mp);
+ M (BOND_ADD_MEMBER, mp);
mp->bond_sw_if_index = ntohl (bond_sw_if_index);
mp->sw_if_index = ntohl (sw_if_index);
}
static int
-api_bond_detach_slave (vat_main_t * vam)
+api_bond_detach_member (vat_main_t * vam)
{
unformat_input_t *i = vam->input;
- vl_api_bond_detach_slave_t *mp;
+ vl_api_bond_detach_member_t *mp;
u32 sw_if_index = ~0;
u8 sw_if_index_set = 0;
int ret;
}
/* Construct the API message */
- M (BOND_DETACH_SLAVE, mp);
+ M (BOND_DETACH_MEMBER, mp);
mp->sw_if_index = ntohl (sw_if_index);
static int
api_sw_interface_vhost_user_dump (vat_main_t * vam)
{
+ unformat_input_t *i = vam->input;
vl_api_sw_interface_vhost_user_dump_t *mp;
vl_api_control_ping_t *mp_ping;
int ret;
+ u32 sw_if_index = ~0;
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+ ;
+ else if (unformat (i, "sw_if_index %d", &sw_if_index))
+ ;
+ else
+ break;
+ }
+
print (vam->ofp,
"Interface name idx hdr_sz features server regions filename");
/* Get list of vhost-user interfaces */
M (SW_INTERFACE_VHOST_USER_DUMP, mp);
- mp->sw_if_index = ntohl (~0);
+ mp->sw_if_index = ntohl (sw_if_index);
S (mp);
/* Use a control ping for synchronization */
"[id <if-id>]") \
_(bond_delete, \
"<vpp-if-name> | sw_if_index <id>") \
-_(bond_enslave, \
+_(bond_add_member, \
"sw_if_index <n> bond <sw_if_index> [is_passive] [is_long_timeout]") \
-_(bond_detach_slave, \
+_(bond_detach_member, \
"sw_if_index <n>") \
_(sw_interface_set_bond_weight, "<intfc> | sw_if_index <nn> weight <value>") \
-_(sw_interface_bond_dump, "") \
-_(sw_interface_slave_dump, \
+ _(sw_bond_interface_dump, "<intfc> | sw_if_index <nn>") \
+ _(sw_member_interface_dump, \
"<vpp-if-name> | sw_if_index <id>") \
_(ip_table_add_del, \
"table <n> [ipv6] [add | del]\n") \
"<intfc> | sw_if_index <nn> socket <filename>\n" \
"[server] [renumber <dev_instance>] [gso] [packed]") \
_(delete_vhost_user_if, "<intfc> | sw_if_index <nn>") \
-_(sw_interface_vhost_user_dump, "") \
+_(sw_interface_vhost_user_dump, "<intfc> | sw_if_index <nn>") \
_(show_version, "") \
_(show_threads, "") \
_(vxlan_gpe_add_del_tunnel, \