Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
L2 BD: introduce a BD interface on which to send UU packets
[vpp.git]
/
src
/
vat
/
api_format.c
diff --git
a/src/vat/api_format.c
b/src/vat/api_format.c
index
0dde721
..
88d4c01
100644
(file)
--- a/
src/vat/api_format.c
+++ b/
src/vat/api_format.c
@@
-7115,15
+7115,17
@@
api_sw_interface_set_l2_bridge (vat_main_t * vam)
{
unformat_input_t *i = vam->input;
vl_api_sw_interface_set_l2_bridge_t *mp;
{
unformat_input_t *i = vam->input;
vl_api_sw_interface_set_l2_bridge_t *mp;
+ vl_api_l2_port_type_t port_type;
u32 rx_sw_if_index;
u8 rx_sw_if_index_set = 0;
u32 bd_id;
u8 bd_id_set = 0;
u32 rx_sw_if_index;
u8 rx_sw_if_index_set = 0;
u32 bd_id;
u8 bd_id_set = 0;
- u8 bvi = 0;
u32 shg = 0;
u8 enable = 1;
int ret;
u32 shg = 0;
u8 enable = 1;
int ret;
+ port_type = L2_API_PORT_TYPE_NORMAL;
+
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
@@
-7138,7
+7140,9
@@
api_sw_interface_set_l2_bridge (vat_main_t * vam)
else if (unformat (i, "shg %d", &shg))
;
else if (unformat (i, "bvi"))
else if (unformat (i, "shg %d", &shg))
;
else if (unformat (i, "bvi"))
- bvi = 1;
+ port_type = L2_API_PORT_TYPE_BVI;
+ else if (unformat (i, "uu-fwd"))
+ port_type = L2_API_PORT_TYPE_UU_FWD;
else if (unformat (i, "enable"))
enable = 1;
else if (unformat (i, "disable"))
else if (unformat (i, "enable"))
enable = 1;
else if (unformat (i, "disable"))
@@
-7164,7
+7168,7
@@
api_sw_interface_set_l2_bridge (vat_main_t * vam)
mp->rx_sw_if_index = ntohl (rx_sw_if_index);
mp->bd_id = ntohl (bd_id);
mp->shg = (u8) shg;
mp->rx_sw_if_index = ntohl (rx_sw_if_index);
mp->bd_id = ntohl (bd_id);
mp->shg = (u8) shg;
- mp->
bvi = bvi
;
+ mp->
port_type = ntohl (port_type)
;
mp->enable = enable;
S (mp);
mp->enable = enable;
S (mp);
@@
-7610,7
+7614,7
@@
api_bridge_flags (vat_main_t * vam)
u32 bd_id;
u8 bd_id_set = 0;
u8 is_set = 1;
u32 bd_id;
u8 bd_id_set = 0;
u8 is_set = 1;
-
u32
flags = 0;
+
bd_flags_t
flags = 0;
int ret;
/* Parse args required to build the message */
int ret;
/* Parse args required to build the message */
@@
-7619,15
+7623,15
@@
api_bridge_flags (vat_main_t * vam)
if (unformat (i, "bd_id %d", &bd_id))
bd_id_set = 1;
else if (unformat (i, "learn"))
if (unformat (i, "bd_id %d", &bd_id))
bd_id_set = 1;
else if (unformat (i, "learn"))
- flags |=
L2
_LEARN;
+ flags |=
BRIDGE_API_FLAG
_LEARN;
else if (unformat (i, "forward"))
else if (unformat (i, "forward"))
- flags |=
L2
_FWD;
+ flags |=
BRIDGE_API_FLAG
_FWD;
else if (unformat (i, "flood"))
else if (unformat (i, "flood"))
- flags |=
L2
_FLOOD;
+ flags |=
BRIDGE_API_FLAG
_FLOOD;
else if (unformat (i, "uu-flood"))
else if (unformat (i, "uu-flood"))
- flags |=
L2
_UU_FLOOD;
+ flags |=
BRIDGE_API_FLAG
_UU_FLOOD;
else if (unformat (i, "arp-term"))
else if (unformat (i, "arp-term"))
- flags |=
L2
_ARP_TERM;
+ flags |=
BRIDGE_API_FLAG
_ARP_TERM;
else if (unformat (i, "off"))
is_set = 0;
else if (unformat (i, "disable"))
else if (unformat (i, "off"))
is_set = 0;
else if (unformat (i, "disable"))
@@
-7645,7
+7649,7
@@
api_bridge_flags (vat_main_t * vam)
M (BRIDGE_FLAGS, mp);
mp->bd_id = ntohl (bd_id);
M (BRIDGE_FLAGS, mp);
mp->bd_id = ntohl (bd_id);
- mp->f
eature_bitmap
= ntohl (flags);
+ mp->f
lags
= ntohl (flags);
mp->is_set = is_set;
S (mp);
mp->is_set = is_set;
S (mp);
@@
-8486,6
+8490,8
@@
api_ip_add_del_route (vat_main_t * vam)
mpls_label_t next_hop_out_label = MPLS_LABEL_INVALID;
mpls_label_t next_hop_via_label = MPLS_LABEL_INVALID;
mpls_label_t next_hop_out_label = MPLS_LABEL_INVALID;
mpls_label_t next_hop_via_label = MPLS_LABEL_INVALID;
+ memset (&v4_next_hop_address, 0, sizeof (ip4_address_t));
+ memset (&v6_next_hop_address, 0, sizeof (ip6_address_t));
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
@@
-8518,6
+8524,16
@@
api_ip_add_del_route (vat_main_t * vam)
{
next_hop_set = 1;
}
{
next_hop_set = 1;
}
+ else
+ if (unformat
+ (i, "via %U", api_unformat_sw_if_index, vam, &sw_if_index))
+ {
+ next_hop_set = 1;
+ }
+ else if (unformat (i, "via sw_if_index %d", &sw_if_index))
+ {
+ next_hop_set = 1;
+ }
else if (unformat (i, "resolve-attempts %d", &resolve_attempts))
;
else if (unformat (i, "weight %d", &next_hop_weight))
else if (unformat (i, "resolve-attempts %d", &resolve_attempts))
;
else if (unformat (i, "weight %d", &next_hop_weight))
@@
-14053,6
+14069,8
@@
api_create_vhost_user_if (vat_main_t * vam)
u32 custom_dev_instance = ~0;
u8 hwaddr[6];
u8 use_custom_mac = 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;
int ret;
u8 *tag = 0;
int ret;
@@
-14071,6
+14089,10
@@
api_create_vhost_user_if (vat_main_t * vam)
use_custom_mac = 1;
else if (unformat (i, "server"))
is_server = 1;
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, "tag %s", &tag))
;
else
else if (unformat (i, "tag %s", &tag))
;
else
@@
-14093,6
+14115,8
@@
api_create_vhost_user_if (vat_main_t * vam)
M (CREATE_VHOST_USER_IF, mp);
mp->is_server = is_server;
M (CREATE_VHOST_USER_IF, mp);
mp->is_server = is_server;
+ mp->disable_mrg_rxbuf = disable_mrg_rxbuf;
+ mp->disable_indirect_desc = disable_indirect_desc;
clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
vec_free (file_name);
if (custom_dev_instance != ~0)
clib_memcpy (mp->sock_filename, file_name, vec_len (file_name));
vec_free (file_name);
if (custom_dev_instance != ~0)
@@
-14100,6
+14124,7
@@
api_create_vhost_user_if (vat_main_t * vam)
mp->renumber = 1;
mp->custom_dev_instance = ntohl (custom_dev_instance);
}
mp->renumber = 1;
mp->custom_dev_instance = ntohl (custom_dev_instance);
}
+
mp->use_custom_mac = use_custom_mac;
clib_memcpy (mp->mac_address, hwaddr, 6);
if (tag)
mp->use_custom_mac = use_custom_mac;
clib_memcpy (mp->mac_address, hwaddr, 6);
if (tag)
@@
-20431,9
+20456,9
@@
vl_api_ip_fib_details_t_handler (vl_api_ip_fib_details_t * mp)
int i;
print (vam->ofp,
int i;
print (vam->ofp,
- "table-id %d, prefix %U/%d",
+ "table-id %d, prefix %U/%d
stats-index %d
",
ntohl (mp->table_id), format_ip4_address, mp->address,
ntohl (mp->table_id), format_ip4_address, mp->address,
- mp->address_length);
+ mp->address_length
, ntohl (mp->stats_index)
);
fp = mp->path;
for (i = 0; i < count; i++)
{
fp = mp->path;
for (i = 0; i < count; i++)
{
@@
-20643,9
+20668,9
@@
vl_api_ip6_fib_details_t_handler (vl_api_ip6_fib_details_t * mp)
int i;
print (vam->ofp,
int i;
print (vam->ofp,
- "table-id %d, prefix %U/%d",
+ "table-id %d, prefix %U/%d
stats-index %d
",
ntohl (mp->table_id), format_ip6_address, mp->address,
ntohl (mp->table_id), format_ip6_address, mp->address,
- mp->address_length);
+ mp->address_length
, ntohl (mp->stats_index)
);
fp = mp->path;
for (i = 0; i < count; i++)
{
fp = mp->path;
for (i = 0; i < count; i++)
{
@@
-23500,8
+23525,8
@@
_(sw_interface_slave_dump, \
_(ip_table_add_del, \
"table <n> [ipv6] [add | del]\n") \
_(ip_add_del_route, \
_(ip_table_add_del, \
"table <n> [ipv6] [add | del]\n") \
_(ip_add_del_route, \
- "<addr>/<mask> via <
addr | via-label <n>> [table-id <n>]\n"
\
- "[
<intfc> | sw_if_index <id>] [resolve-attempts <n>]\n"
\
+ "<addr>/<mask> via <
<addr>|<intfc>|sw_if_index <id>|via-label <n>>\n"
\
+ "[
table-id <n>] [<intfc> | sw_if_index <id>] [resolve-attempts <n>]\n"
\
"[weight <n>] [drop] [local] [classify <n>] [del]\n" \
"[multipath] [count <n>]") \
_(ip_mroute_add_del, \
"[weight <n>] [drop] [local] [classify <n>] [del]\n" \
"[multipath] [count <n>]") \
_(ip_mroute_add_del, \
@@
-23632,6
+23657,7
@@
_(l2_interface_vlan_tag_rewrite, \
"[translate-2-[1|2]] [push_dot1q 0] tag1 <nn> tag2 <nn>") \
_(create_vhost_user_if, \
"socket <filename> [server] [renumber <dev_instance>] " \
"[translate-2-[1|2]] [push_dot1q 0] tag1 <nn> tag2 <nn>") \
_(create_vhost_user_if, \
"socket <filename> [server] [renumber <dev_instance>] " \
+ "[disable_mrg_rxbuf] [disable_indirect_desc] " \
"[mac <mac_address>]") \
_(modify_vhost_user_if, \
"<intfc> | sw_if_index <nn> socket <filename>\n" \
"[mac <mac_address>]") \
_(modify_vhost_user_if, \
"<intfc> | sw_if_index <nn> socket <filename>\n" \