aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
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") \