]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Implemented `show route count' which is `show route stats' with
authorMartin Mares <mj@ucw.cz>
Mon, 8 May 2000 14:58:00 +0000 (14:58 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 8 May 2000 14:58:00 +0000 (14:58 +0000)
exception that it doesn't print the routes themselves.

TODO
nest/config.Y
nest/rt-table.c

diff --git a/TODO b/TODO
index 22e7efe024cde8cf468e3fe3f3aa55d68e6c7fce..a5816d91d5ddd4040e8dc09dc7d690feac3c922e 100644 (file)
--- 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
index 65142f76b46360d2dd9d5b3b843899e72e464c6f..e5249ea472e3a68b017ae44be81d81691cadc47a 100644 (file)
@@ -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:
index 975874a07b313590c45e8768e690d9b99ae9e555..cf87a707281dce387dac6c7e33d28e01a6266cb4 100644 (file)
@@ -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)