#include <vnet/ip/ip_types_api.h>
#include <vnet/l2/l2_input.h>
#include <vnet/vxlan/vxlan.h>
-#include <vnet/gre/gre.h>
#include <vnet/vxlan-gpe/vxlan_gpe.h>
+#include <vnet/udp/udp_local.h>
#include <vpp/api/vpe_msg_enum.h>
#include <vnet/l2/l2_classify.h>
vam->result_ready = 1;
}
-static void vl_api_gre_tunnel_add_del_reply_t_handler
- (vl_api_gre_tunnel_add_del_reply_t * mp)
+static void vl_api_create_vhost_user_if_reply_t_handler
+ (vl_api_create_vhost_user_if_reply_t * mp)
{
vat_main_t *vam = &vat_main;
i32 retval = ntohl (mp->retval);
vam->sw_if_index = ntohl (mp->sw_if_index);
vam->result_ready = 1;
}
+ vam->regenerate_interface_table = 1;
}
-static void vl_api_gre_tunnel_add_del_reply_t_handler_json
- (vl_api_gre_tunnel_add_del_reply_t * mp)
+static void vl_api_create_vhost_user_if_reply_t_handler_json
+ (vl_api_create_vhost_user_if_reply_t * mp)
{
vat_main_t *vam = &vat_main;
vat_json_node_t node;
vam->result_ready = 1;
}
-static void vl_api_create_vhost_user_if_reply_t_handler
- (vl_api_create_vhost_user_if_reply_t * mp)
+static void vl_api_create_vhost_user_if_v2_reply_t_handler
+ (vl_api_create_vhost_user_if_v2_reply_t * mp)
{
vat_main_t *vam = &vat_main;
i32 retval = ntohl (mp->retval);
vam->regenerate_interface_table = 1;
}
-static void vl_api_create_vhost_user_if_reply_t_handler_json
- (vl_api_create_vhost_user_if_reply_t * mp)
+static void vl_api_create_vhost_user_if_v2_reply_t_handler_json
+ (vl_api_create_vhost_user_if_v2_reply_t * mp)
{
vat_main_t *vam = &vat_main;
vat_json_node_t node;
_(l2_interface_efp_filter_reply) \
_(l2_interface_vlan_tag_rewrite_reply) \
_(modify_vhost_user_if_reply) \
+_(modify_vhost_user_if_v2_reply) \
_(delete_vhost_user_if_reply) \
_(want_l2_macs_events_reply) \
_(input_acl_set_interface_reply) \
_(ipsec_interface_add_del_spd_reply) \
_(ipsec_spd_entry_add_del_reply) \
_(ipsec_sad_entry_add_del_reply) \
-_(ipsec_tunnel_if_add_del_reply) \
-_(ipsec_tunnel_if_set_sa_reply) \
_(delete_loopback_reply) \
_(bd_ip_mac_add_del_reply) \
_(bd_ip_mac_flush_reply) \
_(VXLAN_ADD_DEL_TUNNEL_REPLY, vxlan_add_del_tunnel_reply) \
_(VXLAN_OFFLOAD_RX_REPLY, vxlan_offload_rx_reply) \
_(VXLAN_TUNNEL_DETAILS, vxlan_tunnel_details) \
-_(GRE_TUNNEL_ADD_DEL_REPLY, gre_tunnel_add_del_reply) \
-_(GRE_TUNNEL_DETAILS, gre_tunnel_details) \
_(L2_FIB_CLEAR_TABLE_REPLY, l2_fib_clear_table_reply) \
_(L2_INTERFACE_EFP_FILTER_REPLY, l2_interface_efp_filter_reply) \
_(L2_INTERFACE_VLAN_TAG_REWRITE_REPLY, l2_interface_vlan_tag_rewrite_reply) \
_(SW_INTERFACE_VHOST_USER_DETAILS, sw_interface_vhost_user_details) \
_(CREATE_VHOST_USER_IF_REPLY, create_vhost_user_if_reply) \
_(MODIFY_VHOST_USER_IF_REPLY, modify_vhost_user_if_reply) \
+_(CREATE_VHOST_USER_IF_V2_REPLY, create_vhost_user_if_v2_reply) \
+_(MODIFY_VHOST_USER_IF_V2_REPLY, modify_vhost_user_if_v2_reply) \
_(DELETE_VHOST_USER_IF_REPLY, delete_vhost_user_if_reply) \
_(SHOW_VERSION_REPLY, show_version_reply) \
_(SHOW_THREADS_REPLY, show_threads_reply) \
_(IPSEC_SPD_ENTRY_ADD_DEL_REPLY, ipsec_spd_entry_add_del_reply) \
_(IPSEC_SAD_ENTRY_ADD_DEL_REPLY, ipsec_sad_entry_add_del_reply) \
_(IPSEC_SA_DETAILS, ipsec_sa_details) \
-_(IPSEC_TUNNEL_IF_ADD_DEL_REPLY, ipsec_tunnel_if_add_del_reply) \
-_(IPSEC_TUNNEL_IF_SET_SA_REPLY, ipsec_tunnel_if_set_sa_reply) \
_(DELETE_LOOPBACK_REPLY, delete_loopback_reply) \
_(BD_IP_MAC_ADD_DEL_REPLY, bd_ip_mac_add_del_reply) \
_(BD_IP_MAC_FLUSH_REPLY, bd_ip_mac_flush_reply) \
int ret;
u8 queue_id_valid = 0;
u32 queue_id;
- vnet_hw_interface_rx_mode mode = VNET_HW_INTERFACE_RX_MODE_UNKNOWN;
+ vnet_hw_if_rx_mode mode = VNET_HW_IF_RX_MODE_UNKNOWN;
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
if (unformat (i, "queue %d", &queue_id))
queue_id_valid = 1;
else if (unformat (i, "polling"))
- mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
+ mode = VNET_HW_IF_RX_MODE_POLLING;
else if (unformat (i, "interrupt"))
- mode = VNET_HW_INTERFACE_RX_MODE_INTERRUPT;
+ mode = VNET_HW_IF_RX_MODE_INTERRUPT;
else if (unformat (i, "adaptive"))
- mode = VNET_HW_INTERFACE_RX_MODE_ADAPTIVE;
+ mode = VNET_HW_IF_RX_MODE_ADAPTIVE;
else
if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
sw_if_index_set = 1;
errmsg ("missing interface name or sw_if_index");
return -99;
}
- if (mode == VNET_HW_INTERFACE_RX_MODE_UNKNOWN)
+ if (mode == VNET_HW_IF_RX_MODE_UNKNOWN)
{
errmsg ("missing rx-mode");
return -99;
virtio_flags |= VIRTIO_API_FLAG_PACKED;
else if (unformat (i, "in-order"))
virtio_flags |= VIRTIO_API_FLAG_IN_ORDER;
+ else if (unformat (i, "buffering"))
+ virtio_flags |= VIRTIO_API_FLAG_BUFFERING;
else
break;
}
return ret;
}
-static int
-api_gre_tunnel_add_del (vat_main_t * vam)
-{
- unformat_input_t *line_input = vam->input;
- vl_api_address_t src = { }, dst =
- {
- };
- vl_api_gre_tunnel_add_del_t *mp;
- vl_api_gre_tunnel_type_t t_type;
- u8 is_add = 1;
- u8 src_set = 0;
- u8 dst_set = 0;
- u32 outer_table_id = 0;
- u32 session_id = 0;
- u32 instance = ~0;
- int ret;
-
- t_type = GRE_API_TUNNEL_TYPE_L3;
-
- while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (line_input, "del"))
- is_add = 0;
- else if (unformat (line_input, "instance %d", &instance))
- ;
- else if (unformat (line_input, "src %U", unformat_vl_api_address, &src))
- {
- src_set = 1;
- }
- else if (unformat (line_input, "dst %U", unformat_vl_api_address, &dst))
- {
- dst_set = 1;
- }
- else if (unformat (line_input, "outer-table-id %d", &outer_table_id))
- ;
- else if (unformat (line_input, "teb"))
- t_type = GRE_API_TUNNEL_TYPE_TEB;
- else if (unformat (line_input, "erspan %d", &session_id))
- t_type = GRE_API_TUNNEL_TYPE_ERSPAN;
- else
- {
- errmsg ("parse error '%U'", format_unformat_error, line_input);
- return -99;
- }
- }
-
- if (src_set == 0)
- {
- errmsg ("tunnel src address not specified");
- return -99;
- }
- if (dst_set == 0)
- {
- errmsg ("tunnel dst address not specified");
- return -99;
- }
-
- M (GRE_TUNNEL_ADD_DEL, mp);
-
- clib_memcpy (&mp->tunnel.src, &src, sizeof (mp->tunnel.src));
- clib_memcpy (&mp->tunnel.dst, &dst, sizeof (mp->tunnel.dst));
-
- mp->tunnel.instance = htonl (instance);
- mp->tunnel.outer_table_id = htonl (outer_table_id);
- mp->is_add = is_add;
- mp->tunnel.session_id = htons ((u16) session_id);
- mp->tunnel.type = htonl (t_type);
-
- S (mp);
- W (ret);
- return ret;
-}
-
-static void vl_api_gre_tunnel_details_t_handler
- (vl_api_gre_tunnel_details_t * mp)
-{
- vat_main_t *vam = &vat_main;
-
- print (vam->ofp, "%11d%11d%24U%24U%13d%14d%12d",
- ntohl (mp->tunnel.sw_if_index),
- ntohl (mp->tunnel.instance),
- format_vl_api_address, &mp->tunnel.src,
- format_vl_api_address, &mp->tunnel.dst,
- mp->tunnel.type, ntohl (mp->tunnel.outer_table_id),
- ntohl (mp->tunnel.session_id));
-}
-
-static void vl_api_gre_tunnel_details_t_handler_json
- (vl_api_gre_tunnel_details_t * mp)
-{
- vat_main_t *vam = &vat_main;
- vat_json_node_t *node = NULL;
-
- if (VAT_JSON_ARRAY != vam->json_tree.type)
- {
- ASSERT (VAT_JSON_NONE == vam->json_tree.type);
- vat_json_init_array (&vam->json_tree);
- }
- node = vat_json_array_add (&vam->json_tree);
-
- vat_json_init_object (node);
- vat_json_object_add_uint (node, "sw_if_index",
- ntohl (mp->tunnel.sw_if_index));
- vat_json_object_add_uint (node, "instance", ntohl (mp->tunnel.instance));
-
- vat_json_object_add_address (node, "src", &mp->tunnel.src);
- vat_json_object_add_address (node, "dst", &mp->tunnel.dst);
- vat_json_object_add_uint (node, "tunnel_type", mp->tunnel.type);
- vat_json_object_add_uint (node, "outer_table_id",
- ntohl (mp->tunnel.outer_table_id));
- vat_json_object_add_uint (node, "session_id", mp->tunnel.session_id);
-}
-
-static int
-api_gre_tunnel_dump (vat_main_t * vam)
-{
- unformat_input_t *i = vam->input;
- vl_api_gre_tunnel_dump_t *mp;
- vl_api_control_ping_t *mp_ping;
- u32 sw_if_index;
- u8 sw_if_index_set = 0;
- int ret;
-
- /* Parse args required to build the message */
- while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (i, "sw_if_index %d", &sw_if_index))
- sw_if_index_set = 1;
- else
- break;
- }
-
- if (sw_if_index_set == 0)
- {
- sw_if_index = ~0;
- }
-
- if (!vam->json_output)
- {
- print (vam->ofp, "%11s%11s%24s%24s%13s%14s%12s",
- "sw_if_index", "instance", "src_address", "dst_address",
- "tunnel_type", "outer_fib_id", "session_id");
- }
-
- /* Get list of gre-tunnel interfaces */
- M (GRE_TUNNEL_DUMP, mp);
-
- mp->sw_if_index = htonl (sw_if_index);
-
- S (mp);
-
- /* Use a control ping for synchronization */
- MPING (CONTROL_PING, mp_ping);
- S (mp_ping);
-
- W (ret);
- return ret;
-}
-
static int
api_l2_fib_clear_table (vat_main_t * vam)
{
mp->disable_indirect_desc = disable_indirect_desc;
mp->enable_gso = enable_gso;
mp->enable_packed = enable_packed;
+ mp->custom_dev_instance = ntohl (custom_dev_instance);
clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
vec_free (file_name);
if (custom_dev_instance != ~0)
- {
- mp->renumber = 1;
- mp->custom_dev_instance = ntohl (custom_dev_instance);
- }
+ mp->renumber = 1;
mp->use_custom_mac = use_custom_mac;
clib_memcpy (mp->mac_address, hwaddr, 6);
mp->is_server = is_server;
mp->enable_gso = enable_gso;
mp->enable_packed = enable_packed;
+ mp->custom_dev_instance = ntohl (custom_dev_instance);
+ clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
+ vec_free (file_name);
+ if (custom_dev_instance != ~0)
+ mp->renumber = 1;
+
+ S (mp);
+ W (ret);
+ return ret;
+}
+
+static int
+api_create_vhost_user_if_v2 (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_create_vhost_user_if_v2_t *mp;
+ u8 *file_name;
+ u8 is_server = 0;
+ u8 file_name_set = 0;
+ u32 custom_dev_instance = ~0;
+ u8 hwaddr[6];
+ u8 use_custom_mac = 0;
+ u8 disable_mrg_rxbuf = 0;
+ u8 disable_indirect_desc = 0;
+ u8 *tag = 0;
+ u8 enable_gso = 0;
+ u8 enable_packed = 0;
+ u8 enable_event_idx = 0;
+ int ret;
+
+ /* Shut up coverity */
+ clib_memset (hwaddr, 0, sizeof (hwaddr));
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "socket %s", &file_name))
+ {
+ file_name_set = 1;
+ }
+ else if (unformat (i, "renumber %" PRIu32, &custom_dev_instance))
+ ;
+ else if (unformat (i, "mac %U", unformat_ethernet_address, hwaddr))
+ use_custom_mac = 1;
+ else if (unformat (i, "server"))
+ is_server = 1;
+ else if (unformat (i, "disable_mrg_rxbuf"))
+ disable_mrg_rxbuf = 1;
+ else if (unformat (i, "disable_indirect_desc"))
+ disable_indirect_desc = 1;
+ else if (unformat (i, "gso"))
+ enable_gso = 1;
+ else if (unformat (i, "packed"))
+ enable_packed = 1;
+ else if (unformat (i, "event-idx"))
+ enable_event_idx = 1;
+ else if (unformat (i, "tag %s", &tag))
+ ;
+ else
+ break;
+ }
+
+ if (file_name_set == 0)
+ {
+ errmsg ("missing socket file name");
+ return -99;
+ }
+
+ if (vec_len (file_name) > 255)
+ {
+ errmsg ("socket file name too long");
+ return -99;
+ }
+ vec_add1 (file_name, 0);
+
+ M (CREATE_VHOST_USER_IF_V2, mp);
+
+ mp->is_server = is_server;
+ mp->disable_mrg_rxbuf = disable_mrg_rxbuf;
+ mp->disable_indirect_desc = disable_indirect_desc;
+ mp->enable_gso = enable_gso;
+ mp->enable_packed = enable_packed;
+ mp->enable_event_idx = enable_event_idx;
+ mp->custom_dev_instance = ntohl (custom_dev_instance);
clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
vec_free (file_name);
if (custom_dev_instance != ~0)
+ mp->renumber = 1;
+
+ mp->use_custom_mac = use_custom_mac;
+ clib_memcpy (mp->mac_address, hwaddr, 6);
+ if (tag)
+ strncpy ((char *) mp->tag, (char *) tag, ARRAY_LEN (mp->tag) - 1);
+ vec_free (tag);
+
+ S (mp);
+ W (ret);
+ return ret;
+}
+
+static int
+api_modify_vhost_user_if_v2 (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_modify_vhost_user_if_v2_t *mp;
+ u8 *file_name;
+ u8 is_server = 0;
+ u8 file_name_set = 0;
+ u32 custom_dev_instance = ~0;
+ u8 sw_if_index_set = 0;
+ u32 sw_if_index = (u32) ~ 0;
+ u8 enable_gso = 0;
+ u8 enable_packed = 0;
+ u8 enable_event_idx = 0;
+ int ret;
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
- mp->renumber = 1;
- mp->custom_dev_instance = ntohl (custom_dev_instance);
+ if (unformat (i, "%U", api_unformat_sw_if_index, vam, &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "sw_if_index %d", &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "socket %s", &file_name))
+ {
+ file_name_set = 1;
+ }
+ else if (unformat (i, "renumber %" PRIu32, &custom_dev_instance))
+ ;
+ else if (unformat (i, "server"))
+ is_server = 1;
+ else if (unformat (i, "gso"))
+ enable_gso = 1;
+ else if (unformat (i, "packed"))
+ enable_packed = 1;
+ else if (unformat (i, "event-idx"))
+ enable_event_idx = 1;
+ else
+ break;
}
+ if (sw_if_index_set == 0)
+ {
+ errmsg ("missing sw_if_index or interface name");
+ return -99;
+ }
+
+ if (file_name_set == 0)
+ {
+ errmsg ("missing socket file name");
+ return -99;
+ }
+
+ if (vec_len (file_name) > 255)
+ {
+ errmsg ("socket file name too long");
+ return -99;
+ }
+ vec_add1 (file_name, 0);
+
+ M (MODIFY_VHOST_USER_IF_V2, mp);
+
+ mp->sw_if_index = ntohl (sw_if_index);
+ mp->is_server = is_server;
+ mp->enable_gso = enable_gso;
+ mp->enable_packed = enable_packed;
+ mp->enable_event_idx = enable_event_idx;
+ mp->custom_dev_instance = ntohl (custom_dev_instance);
+ clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
+ vec_free (file_name);
+ if (custom_dev_instance != ~0)
+ mp->renumber = 1;
+
S (mp);
W (ret);
return ret;
return ret;
}
-static int
-api_ipsec_tunnel_if_add_del (vat_main_t * vam)
-{
- unformat_input_t *i = vam->input;
- vl_api_ipsec_tunnel_if_add_del_t *mp;
- u32 local_spi = 0, remote_spi = 0;
- u32 crypto_alg = 0, integ_alg = 0;
- u8 *lck = NULL, *rck = NULL;
- u8 *lik = NULL, *rik = NULL;
- vl_api_address_t local_ip = { 0 };
- vl_api_address_t remote_ip = { 0 };
- f64 before = 0;
- u8 is_add = 1;
- u8 esn = 0;
- u8 anti_replay = 0;
- u8 renumber = 0;
- u32 instance = ~0;
- u32 count = 1, jj;
- int ret = -1;
-
- while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (i, "del"))
- is_add = 0;
- else if (unformat (i, "esn"))
- esn = 1;
- else if (unformat (i, "anti-replay"))
- anti_replay = 1;
- else if (unformat (i, "count %d", &count))
- ;
- else if (unformat (i, "local_spi %d", &local_spi))
- ;
- else if (unformat (i, "remote_spi %d", &remote_spi))
- ;
- else
- if (unformat (i, "local_ip %U", unformat_vl_api_address, &local_ip))
- ;
- else
- if (unformat (i, "remote_ip %U", unformat_vl_api_address, &remote_ip))
- ;
- else if (unformat (i, "local_crypto_key %U", unformat_hex_string, &lck))
- ;
- else
- if (unformat (i, "remote_crypto_key %U", unformat_hex_string, &rck))
- ;
- else if (unformat (i, "local_integ_key %U", unformat_hex_string, &lik))
- ;
- else if (unformat (i, "remote_integ_key %U", unformat_hex_string, &rik))
- ;
- else
- if (unformat
- (i, "crypto_alg %U", unformat_ipsec_api_crypto_alg, &crypto_alg))
- {
- if (crypto_alg >= IPSEC_CRYPTO_N_ALG)
- {
- errmsg ("unsupported crypto-alg: '%U'\n",
- format_ipsec_crypto_alg, crypto_alg);
- return -99;
- }
- }
- else
- if (unformat
- (i, "integ_alg %U", unformat_ipsec_api_integ_alg, &integ_alg))
- {
- if (integ_alg >= IPSEC_INTEG_N_ALG)
- {
- errmsg ("unsupported integ-alg: '%U'\n",
- format_ipsec_integ_alg, integ_alg);
- return -99;
- }
- }
- else if (unformat (i, "instance %u", &instance))
- renumber = 1;
- else
- {
- errmsg ("parse error '%U'\n", format_unformat_error, i);
- return -99;
- }
- }
-
- if (count > 1)
- {
- /* Turn on async mode */
- vam->async_mode = 1;
- vam->async_errors = 0;
- before = vat_time_now (vam);
- }
-
- for (jj = 0; jj < count; jj++)
- {
- M (IPSEC_TUNNEL_IF_ADD_DEL, mp);
-
- mp->is_add = is_add;
- mp->esn = esn;
- mp->anti_replay = anti_replay;
-
- if (jj > 0)
- increment_address (&remote_ip);
-
- clib_memcpy (&mp->local_ip, &local_ip, sizeof (local_ip));
- clib_memcpy (&mp->remote_ip, &remote_ip, sizeof (remote_ip));
-
- mp->local_spi = htonl (local_spi + jj);
- mp->remote_spi = htonl (remote_spi + jj);
- mp->crypto_alg = (u8) crypto_alg;
-
- mp->local_crypto_key_len = 0;
- if (lck)
- {
- mp->local_crypto_key_len = vec_len (lck);
- if (mp->local_crypto_key_len > sizeof (mp->local_crypto_key))
- mp->local_crypto_key_len = sizeof (mp->local_crypto_key);
- clib_memcpy (mp->local_crypto_key, lck, mp->local_crypto_key_len);
- }
-
- mp->remote_crypto_key_len = 0;
- if (rck)
- {
- mp->remote_crypto_key_len = vec_len (rck);
- if (mp->remote_crypto_key_len > sizeof (mp->remote_crypto_key))
- mp->remote_crypto_key_len = sizeof (mp->remote_crypto_key);
- clib_memcpy (mp->remote_crypto_key, rck, mp->remote_crypto_key_len);
- }
-
- mp->integ_alg = (u8) integ_alg;
-
- mp->local_integ_key_len = 0;
- if (lik)
- {
- mp->local_integ_key_len = vec_len (lik);
- if (mp->local_integ_key_len > sizeof (mp->local_integ_key))
- mp->local_integ_key_len = sizeof (mp->local_integ_key);
- clib_memcpy (mp->local_integ_key, lik, mp->local_integ_key_len);
- }
-
- mp->remote_integ_key_len = 0;
- if (rik)
- {
- mp->remote_integ_key_len = vec_len (rik);
- if (mp->remote_integ_key_len > sizeof (mp->remote_integ_key))
- mp->remote_integ_key_len = sizeof (mp->remote_integ_key);
- clib_memcpy (mp->remote_integ_key, rik, mp->remote_integ_key_len);
- }
-
- if (renumber)
- {
- mp->renumber = renumber;
- mp->show_instance = ntohl (instance);
- }
- S (mp);
- }
-
- /* When testing multiple add/del ops, use a control-ping to sync */
- if (count > 1)
- {
- vl_api_control_ping_t *mp_ping;
- f64 after;
- f64 timeout;
-
- /* Shut off async mode */
- vam->async_mode = 0;
-
- MPING (CONTROL_PING, mp_ping);
- S (mp_ping);
-
- timeout = vat_time_now (vam) + 1.0;
- while (vat_time_now (vam) < timeout)
- if (vam->result_ready == 1)
- goto out;
- vam->retval = -99;
-
- out:
- if (vam->retval == -99)
- errmsg ("timeout");
-
- if (vam->async_errors > 0)
- {
- errmsg ("%d asynchronous errors", vam->async_errors);
- vam->retval = -98;
- }
- vam->async_errors = 0;
- after = vat_time_now (vam);
-
- /* slim chance, but we might have eaten SIGTERM on the first iteration */
- if (jj > 0)
- count = jj;
-
- print (vam->ofp, "%d tunnels in %.6f secs, %.2f tunnels/sec",
- count, after - before, count / (after - before));
- }
- else
- {
- /* Wait for a reply... */
- W (ret);
- return ret;
- }
-
- return ret;
-}
-
static void
vl_api_ipsec_sa_details_t_handler (vl_api_ipsec_sa_details_t * mp)
{
return ret;
}
-static int
-api_ipsec_tunnel_if_set_sa (vat_main_t * vam)
-{
- unformat_input_t *i = vam->input;
- vl_api_ipsec_tunnel_if_set_sa_t *mp;
- u32 sw_if_index = ~0;
- u32 sa_id = ~0;
- u8 is_outbound = (u8) ~ 0;
- int ret;
-
- 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, "sa_id %d", &sa_id))
- ;
- else if (unformat (i, "outbound"))
- is_outbound = 1;
- else if (unformat (i, "inbound"))
- is_outbound = 0;
- else
- {
- clib_warning ("parse error '%U'", format_unformat_error, i);
- return -99;
- }
- }
-
- if (sw_if_index == ~0)
- {
- errmsg ("interface must be specified");
- return -99;
- }
-
- if (sa_id == ~0)
- {
- errmsg ("SA ID must be specified");
- return -99;
- }
-
- M (IPSEC_TUNNEL_IF_SET_SA, mp);
-
- mp->sw_if_index = htonl (sw_if_index);
- mp->sa_id = htonl (sa_id);
- mp->is_outbound = is_outbound;
-
- S (mp);
- W (ret);
-
- return ret;
-}
-
static int
api_get_first_msg_id (vat_main_t * vam)
{
"<vpp-if-name> | sw_if_index <id>") \
_(sw_interface_tap_v2_dump, "") \
_(virtio_pci_create_v2, \
- "pci-addr <pci-address> [use_random_mac | hw-addr <mac-addr>] [features <hex-value>] [gso-enabled [gro-coalesce] | csum-offload-enabled] [packed] [in-order]") \
+ "pci-addr <pci-address> [use_random_mac | hw-addr <mac-addr>] [features <hex-value>] [gso-enabled [gro-coalesce] | csum-offload-enabled] [packed] [in-order] [buffering]") \
_(virtio_pci_delete, \
"<vpp-if-name> | sw_if_index <id>") \
_(sw_interface_virtio_pci_dump, "") \
"{ <intfc> | mcast_sw_if_index <nn> } [instance <id>]}\n" \
"vni <vni> [encap-vrf-id <nn>] [decap-next <l2|nn>] [del]") \
_(vxlan_tunnel_dump, "[<intfc> | sw_if_index <nn>]") \
-_(gre_tunnel_add_del, \
- "src <ip-addr> dst <ip-addr> [outer-fib-id <nn>] [instance <n>]\n" \
- "[teb | erspan <session-id>] [del]") \
-_(gre_tunnel_dump, "[<intfc> | sw_if_index <nn>]") \
_(l2_fib_clear_table, "") \
_(l2_interface_efp_filter, "sw_if_index <nn> enable | disable") \
_(l2_interface_vlan_tag_rewrite, \
_(modify_vhost_user_if, \
"<intfc> | sw_if_index <nn> socket <filename>\n" \
"[server] [renumber <dev_instance>] [gso] [packed]") \
+_(create_vhost_user_if_v2, \
+ "socket <filename> [server] [renumber <dev_instance>] " \
+ "[disable_mrg_rxbuf] [disable_indirect_desc] [gso] " \
+ "[mac <mac_address>] [packed] [event-idx]") \
+_(modify_vhost_user_if_v2, \
+ "<intfc> | sw_if_index <nn> socket <filename>\n" \
+ "[server] [renumber <dev_instance>] [gso] [packed] [event-idx]")\
_(delete_vhost_user_if, "<intfc> | sw_if_index <nn>") \
_(sw_interface_vhost_user_dump, "<intfc> | sw_if_index <nn>") \
_(show_version, "") \
" (inbound|outbound) [sa_id <n>] laddr_start <ip4|ip6>\n" \
" laddr_stop <ip4|ip6> raddr_start <ip4|ip6> raddr_stop <ip4|ip6>\n" \
" [lport_start <n> lport_stop <n>] [rport_start <n> rport_stop <n>]" ) \
-_(ipsec_tunnel_if_add_del, "local_spi <n> remote_spi <n>\n" \
- " crypto_alg <alg> local_crypto_key <hex> remote_crypto_key <hex>\n" \
- " integ_alg <alg> local_integ_key <hex> remote_integ_key <hex>\n" \
- " local_ip <addr> remote_ip <addr> [esn] [anti_replay] [del]\n" \
- " [instance <n>]") \
_(ipsec_sa_dump, "[sa_id <n>]") \
-_(ipsec_tunnel_if_set_sa, "<intfc> sa_id <n> <inbound|outbound>\n") \
_(delete_loopback,"sw_if_index <nn>") \
_(bd_ip_mac_add_del, "bd_id <bridge-domain-id> <ip4/6-addr> <mac-addr> [del]") \
_(bd_ip_mac_flush, "bd_id <bridge-domain-id>") \