- Makefile: install target?
-- forgetting device routes???
-- filter-defined internal attributes
- netlink: realms
- filters: deletion of mandatory attributes?
+- filters: user defined attributes?
+
+- cli: show tables?
Documentation
~~~~~~~~~~~~~
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)
+CF_KEYWORDS(PRIMARY, STATS)
CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
RIP, OSPF, OSPF_EXT, OSPF_IA, OSPF_BOUNDARY, BGP, PIPE)
CF_CLI(SHOW INTERFACES SUMMARY,,, [[Show summary of network interfaces]])
{ if_show_summary(); } ;
-CF_CLI(SHOW ROUTE, r_args, [<prefix>] [table <t>] [filter <f>] [all] [primary] [(import|protocol) <p>], [[Show routing table]])
+CF_CLI(SHOW ROUTE, r_args, [<prefix>] [table <t>] [filter <f>] [all] [primary] [(import|protocol) <p>] [stats], [[Show routing table]])
{ rt_show($3); } ;
r_args:
$$->import_protocol = c->proto;
$$->running_on_config = c->proto->cf->global;
}
+ | r_args STATS {
+ $$ = $1;
+ $$->stats = 1;
+ }
;
import_or_proto:
struct proto *import_protocol;
int import_mode, primary_only;
struct config *running_on_config;
+ int net_counter, rt_counter, show_counter;
+ int stats;
};
void rt_show(struct rt_show_data *);
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;
}
if (ok)
{
+ d->show_counter++;
rt_show_rte(c, ia, e, d, tmpa);
ia[0] = 0;
}
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;
}