]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: show bgp vrfs formatting 4517/head
authorChirag Shah <chirag@cumulusnetworks.com>
Tue, 11 Jun 2019 22:06:57 +0000 (15:06 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Fri, 14 Jun 2019 15:47:26 +0000 (08:47 -0700)
show bgp vrfs command is formatted with couple
of things.

show bgp vrfs to inclue bgp vrf instance's
SVI interface.
Move L3vni, RMAC and SVI value in next line.

Ticket:CM-25317
Reviewed By:CCR-8816
Testing Done:

New Output:
TORS1# show bgp vrfs
Type  Id     routerId          #PeersVfg  #PeersEstb  Name
             L3-VNI            RouterMAC              Interface
DFLT  0      27.0.0.15         2          2           default
             0                 00:00:00:00:00:00      unknown
 VRF  31     45.0.8.2          0          0           vrf3
             4003              00:02:00:00:00:4e      vlan4003
 VRF  35     45.0.2.2          0          0           vrf1
             4001              00:02:00:00:00:4e      vlan4001
 VRF  25     45.0.6.2          0          0           vrf2
             4002              00:02:00:00:00:4e      vlan4002

Total number of VRFs (including default): 4

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
bgpd/bgp_vty.c

index 43d0d9352049d96a8e2ac178f24e4f7427d1c3d1..ed2af6d1dd80f9916376000cbafa13e210bf505f 100644 (file)
@@ -7463,11 +7463,14 @@ DEFUN (show_bgp_vrfs,
                        continue;
 
                count++;
-               if (!uj && count == 1)
+               if (!uj && count == 1) {
                        vty_out(vty,
-                               "%4s  %-5s  %-16s  %9s  %10s  %-37s %-10s %-15s\n",
+                               "%4s  %-5s  %-16s  %9s  %10s  %-37s\n",
                                "Type", "Id", "routerId", "#PeersVfg",
-                               "#PeersEstb", "Name", "L3-VNI", "Rmac");
+                               "#PeersEstb", "Name");
+                       vty_out(vty, "%11s  %-16s  %-21s  %-6s\n", " ",
+                               "L3-VNI", "RouterMAC", "Interface");
+               }
 
                peers_cfg = peers_estb = 0;
                if (uj)
@@ -7508,16 +7511,24 @@ DEFUN (show_bgp_vrfs,
                        json_object_string_add(
                                json_vrf, "rmac",
                                prefix_mac2str(&bgp->rmac, buf, sizeof(buf)));
+                       json_object_string_add(json_vrf, "interface",
+                               ifindex2ifname(bgp->l3vni_svi_ifindex,
+                                              bgp->vrf_id));
                        json_object_object_add(json_vrfs, name, json_vrf);
-               } else
+               } else {
                        vty_out(vty,
-                               "%4s  %-5d  %-16s  %9u  %10u  %-37s %-10u %-15s\n",
+                               "%4s  %-5d  %-16s  %-9u  %-10u  %-37s\n",
                                type,
                                bgp->vrf_id == VRF_UNKNOWN ? -1
                                                           : (int)bgp->vrf_id,
                                inet_ntoa(bgp->router_id), peers_cfg,
-                               peers_estb, name, bgp->l3vni,
-                               prefix_mac2str(&bgp->rmac, buf, sizeof(buf)));
+                               peers_estb, name);
+                       vty_out(vty,"%11s  %-16u  %-21s  %-20s\n", " ",
+                               bgp->l3vni,
+                               prefix_mac2str(&bgp->rmac, buf, sizeof(buf)),
+                               ifindex2ifname(bgp->l3vni_svi_ifindex,
+                                              bgp->vrf_id));
+               }
        }
 
        if (uj) {