diff options
| author | Renato Westphal <renato@openbsd.org> | 2019-01-14 10:56:07 -0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-14 10:56:07 -0200 |
| commit | ca88bbed50dfb3390e54791765794f626afcaf4b (patch) | |
| tree | 206387e6a1f0f7336e03ca7084cf3971e9eb579b /zebra/zebra_router.c | |
| parent | c5991ff3e433d47c6ab9667483ad7d127f6b6666 (diff) | |
| parent | ac5aa23f9362f8fd77a3c8ef66de92c125c7051a (diff) | |
Merge pull request #3567 from donaldsharp/cleanup_route_table_creation
Route Table Handling and shows
Diffstat (limited to 'zebra/zebra_router.c')
| -rw-r--r-- | zebra/zebra_router.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index ae18a0d290..f0cc8d4fd7 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -106,7 +106,7 @@ struct route_table *zebra_router_get_table(struct zebra_vrf *zvrf, info = XCALLOC(MTYPE_RIB_TABLE_INFO, sizeof(*info)); info->zvrf = zvrf; info->afi = afi; - info->safi = SAFI_UNICAST; + info->safi = safi; route_table_set_info(zrt->table, info); zrt->table->cleanup = zebra_rtable_node_cleanup; @@ -127,6 +127,25 @@ unsigned long zebra_router_score_proto(uint8_t proto, unsigned short instance) return cnt; } +void zebra_router_show_table_summary(struct vty *vty) +{ + struct zebra_router_table *zrt; + + vty_out(vty, + "VRF NS ID VRF ID AFI SAFI Table Count\n"); + vty_out(vty, + "---------------------------------------------------------------------------\n"); + RB_FOREACH (zrt, zebra_router_table_head, &zrouter.tables) { + rib_table_info_t *info = route_table_get_info(zrt->table); + + vty_out(vty, "%-16s%5d %9d %7s %15s %8d %10lu\n", info->zvrf->vrf->name, + zrt->ns_id, info->zvrf->vrf->vrf_id, + afi2str(zrt->afi), safi2str(zrt->safi), + zrt->tableid, + zrt->table->count); + } +} + void zebra_router_sweep_route(void) { struct zebra_router_table *zrt; |
