diff options
| author | Sharath Ramamurthy <sramamurthy@nvidia.com> | 2021-07-27 14:28:59 +0530 |
|---|---|---|
| committer | Stephen Worley <sworley@nvidia.com> | 2023-02-13 18:12:04 -0500 |
| commit | 239b26f932e5b78828dce8f7fe628c12b7ddbd9f (patch) | |
| tree | 670abbd743f13e7daceb5ea652fcb2d0073b3cb7 /zebra/zebra_vty.c | |
| parent | 131a9a2eeddab0f528b4ad6d29f0f4081cf8d8fe (diff) | |
zebra: multiple vlan aware bridge data structure and related changes
Multiple vlan aware bridge data structure changes and its corresponding bridge
handling changes.
A new vlan-table is maintained for each bridge which records the zebra_l2_bridge_vlan
entry. zebra_l2_bridge_vlan maps vlan to access_bd associated to this bridge.
Existing zebra_evpn_access_bd structure is vlan aware which is now modified to be
(vlan, bridge) aware.
Whenever a new access_bd is instantiated, a corresponding entry is also recorded
in the zebra l2 bridge for the vlan.
When the access_bd is dereferenced or whenever a bridge is deleted, the
association is cleaned up.
Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index d96ee4890f..88feae984b 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -3016,20 +3016,36 @@ DEFPY(show_evpn_es_evi, return CMD_SUCCESS; } -DEFPY(show_evpn_access_vlan, - show_evpn_access_vlan_cmd, - "show evpn access-vlan [(1-4094)$vid | detail$detail] [json$json]", +DEFPY(show_evpn_access_vlan, show_evpn_access_vlan_cmd, + "show evpn access-vlan [IFNAME$if_name (1-4094)$vid | detail$detail] [json$json]", SHOW_STR "EVPN\n" "Access VLANs\n" "VLAN ID\n" - "Detailed information\n" - JSON_STR) + "Detailed information\n" JSON_STR) { bool uj = !!json; - if (vid) { - zebra_evpn_acc_vl_show_vid(vty, uj, vid); + if (if_name && vid) { + bool found = false; + struct vrf *vrf; + struct interface *ifp; + + RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { + if (if_name) { + ifp = if_lookup_by_name(if_name, vrf->vrf_id); + if (ifp) { + zebra_evpn_acc_vl_show_vid(vty, uj, vid, + ifp); + found = true; + break; + } + } + } + if (!found) { + vty_out(vty, "%% Can't find interface %s\n", if_name); + return CMD_WARNING; + } } else { if (detail) zebra_evpn_acc_vl_show_detail(vty, uj); |
