summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-08 14:58:00 +0000
committerMartin Mares <mj@ucw.cz>2000-05-08 14:58:00 +0000
commit33a368ad594822239bfbaa2eab50c76171e09b9e (patch)
treee148b7bb0af78a0473520f1672e54721c3b80a4c
parent0c3588bf5e43936ea0f1e630dea500912b598c60 (diff)
Implemented `show route count' which is `show route stats' with
exception that it doesn't print the routes themselves.
-rw-r--r--TODO1
-rw-r--r--nest/config.Y6
-rw-r--r--nest/rt-table.c3
3 files changed, 7 insertions, 3 deletions
diff --git a/TODO b/TODO
index 22e7efe0..a5816d91 100644
--- a/TODO
+++ b/TODO
@@ -15,7 +15,6 @@ Core
- filters: user defined attributes?
- cli: show tables?
-- cli: show route count (like stats, but doesn't print the routes)
- cli: show where is routed given IP address?
- client: Ctrl-R eats one more enter
diff --git a/nest/config.Y b/nest/config.Y
index 65142f76..e5249ea4 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -22,7 +22,7 @@ CF_DECLS
CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
-CF_KEYWORDS(PRIMARY, STATS)
+CF_KEYWORDS(PRIMARY, STATS, COUNT)
CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
RIP, OSPF, OSPF_EXT, OSPF_IA, OSPF_BOUNDARY, BGP, PIPE)
@@ -294,6 +294,10 @@ r_args:
$$ = $1;
$$->stats = 1;
}
+ | r_args COUNT {
+ $$ = $1;
+ $$->stats = 2;
+ }
;
import_or_proto:
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 975874a0..cf87a707 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -749,7 +749,8 @@ 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);
+ if (d->stats < 2)
+ rt_show_rte(c, ia, e, d, tmpa);
ia[0] = 0;
}
if (e != ee)