From: Don Slice Date: Wed, 24 Feb 2016 15:48:32 +0000 (+0000) Subject: Zebra: Improve output of show ip route vrf all X-Git-Tag: frr-2.0-rc1~1101^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5fe7477040266277e371f473af2cbfb0a75f4088;p=mirror%2Ffrr.git Zebra: Improve output of show ip route vrf all 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 --- diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 24fb7e8b66..a08424aca7 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -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++)