aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
authorJerome Tollet <jtollet@cisco.com>2017-09-14 12:53:56 +0100
committerJohn Lo <loj@cisco.com>2017-09-15 10:46:31 +0000
commit50570ecef6d37b0c9d8c002f6dadb4ed0e138aa3 (patch)
treed121b4da2c03f8852ec3c059aa27958bd3e23452 /src/vat
parentb467b2a02be6ea7bab1a4773523afe8a8e3cfd83 (diff)
Update of free text tag patch for BD
Change-Id: Ia886ff2bfa2cf33ffbaa35ec89494d4300ec2769 Signed-off-by: Jerome Tollet <jtollet@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/api_format.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 43d1eb3d3b4..ff3354c9664 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -6356,6 +6356,7 @@ api_bridge_domain_add_del (vat_main_t * vam)
u32 bd_id = ~0;
u8 is_add = 1;
u32 flood = 1, forward = 1, learn = 1, uu_flood = 1, arp_term = 0;
+ u8 *bd_tag = NULL;
u32 mac_age = 0;
int ret;
@@ -6376,6 +6377,8 @@ api_bridge_domain_add_del (vat_main_t * vam)
;
else if (unformat (i, "mac-age %d", &mac_age))
;
+ else if (unformat (i, "bd-tag %s", &bd_tag))
+ ;
else if (unformat (i, "del"))
{
is_add = 0;
@@ -6388,13 +6391,22 @@ api_bridge_domain_add_del (vat_main_t * vam)
if (bd_id == ~0)
{
errmsg ("missing bridge domain");
- return -99;
+ ret = -99;
+ goto done;
}
if (mac_age > 255)
{
errmsg ("mac age must be less than 256 ");
- return -99;
+ ret = -99;
+ goto done;
+ }
+
+ if ((bd_tag) && (strlen ((char *) bd_tag) > 63))
+ {
+ errmsg ("bd-tag cannot be longer than 63");
+ ret = -99;
+ goto done;
}
M (BRIDGE_DOMAIN_ADD_DEL, mp);
@@ -6407,9 +6419,14 @@ api_bridge_domain_add_del (vat_main_t * vam)
mp->arp_term = arp_term;
mp->is_add = is_add;
mp->mac_age = (u8) mac_age;
+ if (bd_tag)
+ strcpy ((char *) mp->bd_tag, (char *) bd_tag);
S (mp);
W (ret);
+
+done:
+ vec_free (bd_tag);
return ret;
}
@@ -20152,7 +20169,7 @@ _(sw_interface_set_l2_bridge, \
"enable | disable") \
_(bridge_domain_set_mac_age, "bd_id <bridge-domain-id> mac-age 0-255") \
_(bridge_domain_add_del, \
- "bd_id <bridge-domain-id> [flood 1|0] [uu-flood 1|0] [forward 1|0] [learn 1|0] [arp-term 1|0] [mac-age 0-255] [del]\n") \
+ "bd_id <bridge-domain-id> [flood 1|0] [uu-flood 1|0] [forward 1|0] [learn 1|0] [arp-term 1|0] [mac-age 0-255] [bd-tag <tag>] [del]\n") \
_(bridge_domain_dump, "[bd_id <bridge-domain-id>]\n") \
_(l2fib_add_del, \
"mac <mac-addr> bd_id <bridge-domain-id> [del] | sw_if <intfc> | sw_if_index <id> [static] [filter] [bvi] [count <nn>]\n") \