0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Implemented show route count' which is show route stats' with

exception that it doesn't print the routes themselves.
This commit is contained in:
Martin Mares 2000-05-08 14:58:00 +00:00
parent 0c3588bf5e
commit 33a368ad59
3 changed files with 7 additions and 3 deletions

1
TODO
View File

@ -15,7 +15,6 @@ Core
- filters: user defined attributes? - filters: user defined attributes?
- cli: show tables? - cli: show tables?
- cli: show route count (like stats, but doesn't print the routes)
- cli: show where is routed given IP address? - cli: show where is routed given IP address?
- client: Ctrl-R eats one more enter - client: Ctrl-R eats one more enter

View File

@ -22,7 +22,7 @@ CF_DECLS
CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT) CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS) CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES) 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, CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
RIP, OSPF, OSPF_EXT, OSPF_IA, OSPF_BOUNDARY, BGP, PIPE) RIP, OSPF, OSPF_EXT, OSPF_IA, OSPF_BOUNDARY, BGP, PIPE)
@ -294,6 +294,10 @@ r_args:
$$ = $1; $$ = $1;
$$->stats = 1; $$->stats = 1;
} }
| r_args COUNT {
$$ = $1;
$$->stats = 2;
}
; ;
import_or_proto: import_or_proto:

View File

@ -749,6 +749,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
if (ok) if (ok)
{ {
d->show_counter++; d->show_counter++;
if (d->stats < 2)
rt_show_rte(c, ia, e, d, tmpa); rt_show_rte(c, ia, e, d, tmpa);
ia[0] = 0; ia[0] = 0;
} }