summaryrefslogtreecommitdiffstats
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-07 13:28:59 +0200
committerMartin Mares <mj@ucw.cz>2000-05-07 13:28:59 +0200
commit23693958aa95edf5baaeaa5baa55725dc4895681 (patch)
treea1b9778ba0cb83636ec25b9e00812fbb8a556485 /nest/rt-table.c
parent6998bb9ee345a0e8b558fc87133f1c2a442b7096 (diff)
downloadbird-23693958aa95edf5baaeaa5baa55725dc4895681.tar
bird-23693958aa95edf5baaeaa5baa55725dc4895681.zip
Implemented `show route <...> stats'.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 1261aae..3825303 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -720,11 +720,13 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
int ok;
bsprintf(ia, "%I/%d", n->n.prefix, n->n.pxlen);
+ d->net_counter++;
for(e=n->routes; e; e=e->next)
{
struct ea_list *tmpa, *old_tmpa;
struct proto *p0 = e->attrs->proto;
struct proto *p1 = d->import_protocol;
+ d->rt_counter++;
ee = e;
rte_update_lock(); /* We use the update buffer for filtering */
old_tmpa = tmpa = p0->make_tmp_attrs ? p0->make_tmp_attrs(e, rte_update_pool) : NULL;
@@ -743,6 +745,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
}
if (ok)
{
+ d->show_counter++;
rt_show_rte(c, ia, e, d, tmpa);
ia[0] = 0;
}
@@ -789,7 +792,10 @@ rt_show_cont(struct cli *c)
rt_show_net(c, n, d);
}
FIB_ITERATE_END(f);
- cli_printf(c, 0, "");
+ if (d->stats)
+ cli_printf(c, 14, "%d of %d routes for %d networks", d->show_counter, d->rt_counter, d->net_counter);
+ else
+ cli_printf(c, 0, "");
done:
c->cont = c->cleanup = NULL;
}