]> git.puffer.fish Git - mirror/frr.git/commitdiff
Zebra: Improve output of show ip route vrf all
authorDon Slice <dslice@cumulusnetworks.com>
Wed, 24 Feb 2016 15:48:32 +0000 (15:48 +0000)
committerDon Slice <dslice@cumulusnetworks.com>
Wed, 24 Feb 2016 15:48:32 +0000 (15:48 +0000)
Changed output to use the name and table id rather than the vrf_id, since the vrf_id
isn't really meaningful to customers reading the output.

Ticket: CM-9464
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
zebra/zebra_vty.c

index 24fb7e8b667ed8838223461bc763aaab53b6c767..a08424aca7276e243cffccd24a864f502b750aed 100644 (file)
@@ -1885,6 +1885,7 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
   int recursing;
   int len = 0;
   char buf[BUFSIZ];
+  struct zebra_vrf *zvrf;
 
   /* Nexthop information. */
   for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
@@ -1910,7 +1911,10 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
                            rib->metric);
 
           if (rib->vrf_id != VRF_DEFAULT)
-            len += vty_out (vty, " [vrf %u]", rib->vrf_id);
+            {
+              zvrf = vrf_info_lookup(rib->vrf_id);
+              len += vty_out (vty, " [vrf %s/table %u]", zvrf->name, zvrf->table_id);
+            }
        }
       else
        vty_out (vty, "  %c%*c",
@@ -2544,9 +2548,9 @@ vty_show_ip_route_summary (struct vty *vty, struct route_table *table)
            }
        }
 
-  vty_out (vty, "%-20s %-20s %s  (vrf %u)%s",
+  vty_out (vty, "%-20s %-20s %s  (vrf %s)%s",
            "Route Source", "Routes", "FIB",
-           ((rib_table_info_t *)table->info)->zvrf->vrf_id,
+           ((rib_table_info_t *)table->info)->zvrf->name,
            VTY_NEWLINE);
 
   for (i = 0; i < ZEBRA_ROUTE_MAX; i++)