works in the direction from the routing table to the protocol.
Default: <cf/none/.
- <tag>import keep rejected <m/bool/</tag>
+ <tag>import keep filtered <m/bool/</tag>
Usually, if an import filter rejects a route, the route is
- forgotten. When this option is active, rejected routes are
+ forgotten. When this option is active, these routes are
kept in the routing table, but they are hidden and not
propagated to other protocols. But it is possible to show them
- using <cf/show route rejected/. Note that this option does not
+ using <cf/show route filtered/. Note that this option does not
work for the pipe protocol. Default: off.
<tag>import limit <m/number/ [action warn | block | restart | disable]</tag>
like appropriate commands. Disable is the default action if an
action is not explicitly specified. Note that limits are reset
during protocol reconfigure, reload or restart. Also note that
- if <cf/import keep rejected/ is active, rejected routes are
+ if <cf/import keep filtered/ is active, filtered routes are
counted towards the limit and blocked routes are forgotten, as
the main purpose of the import limit is to protect routing
tables from overflow. Default: <cf/none/.
<p>You can also select just routes added by a specific protocol.
<cf>protocol <m/p/</cf>.
- <p>If BIRD is configured to keep rejected routes (see </cf/import keep rejected/
- option), you can show them instead of routes by using </cf/rejected/ switch.
+ <p>If BIRD is configured to keep filtered routes (see </cf/import keep filtered/
+ option), you can show them instead of routes by using </cf/filtered/ switch.
<p>The <cf/stats/ switch requests showing of route statistics (the
number of networks, number of routes before and after filtering). If
CF_KEYWORDS(ROUTER, ID, PROTOCOL, TEMPLATE, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
-CF_KEYWORDS(LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE, KEEP, REJECTED)
+CF_KEYWORDS(LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE, KEEP, FILTERED)
CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE, ROA, MAX, FLUSH)
CF_KEYWORDS(LISTEN, BGP, V6ONLY, DUAL, ADDRESS, PORT, PASSWORDS, DESCRIPTION, SORTED)
| EXPORT imexport { this_proto->out_filter = $2; }
| IMPORT LIMIT limit_spec { this_proto->in_limit = $3; }
| EXPORT LIMIT limit_spec { this_proto->out_limit = $3; }
- | IMPORT KEEP REJECTED bool { this_proto->in_keep_rejected = $4; }
+ | IMPORT KEEP FILTERED bool { this_proto->in_keep_filtered = $4; }
| TABLE rtable { this_proto->table = $2; }
| ROUTER ID idval { this_proto->router_id = $3; }
| DESCRIPTION TEXT { this_proto->dsc = $2; }
{ if_show_summary(); } ;
CF_CLI_HELP(SHOW ROUTE, ..., [[Show routing table]])
-CF_CLI(SHOW ROUTE, r_args, [[[<prefix>|for <prefix>|for <ip>] [table <t>] [filter <f>|where <cond>] [all] [primary] [rejected] [(export|preexport) <p>] [protocol <p>] [stats|count]]], [[Show routing table]])
+CF_CLI(SHOW ROUTE, r_args, [[[<prefix>|for <prefix>|for <ip>] [table <t>] [filter <f>|where <cond>] [all] [primary] [filtered] [(export|preexport) <p>] [protocol <p>] [stats|count]]], [[Show routing table]])
{ rt_show($3); } ;
r_args:
$$ = $1;
$$->primary_only = 1;
}
- | r_args REJECTED {
+ | r_args FILTERED {
$$ = $1;
- $$->rejected = 1;
+ $$->filtered = 1;
}
| r_args export_or_preexport SYM {
struct proto_config *c = (struct proto_config *) $3->def;
p->main_ahook->out_filter = nc->out_filter;
p->main_ahook->in_limit = nc->in_limit;
p->main_ahook->out_limit = nc->out_limit;
- p->main_ahook->in_keep_rejected = nc->in_keep_rejected;
+ p->main_ahook->in_keep_filtered = nc->in_keep_filtered;
}
/* Update routes when filters changed. If the protocol in not UP,
{
DBG("Protocol %s down\n", p->name);
- u32 all_routes = p->stats.imp_routes + p->stats.rej_routes;
+ u32 all_routes = p->stats.imp_routes + p->stats.filt_routes;
if (all_routes != 0)
log(L_ERR "Protocol %s is down but still has %d routes", p->name, all_routes);
p->main_ahook->out_filter = p->cf->out_filter;
p->main_ahook->in_limit = p->cf->in_limit;
p->main_ahook->out_limit = p->cf->out_limit;
- p->main_ahook->in_keep_rejected = p->cf->in_keep_rejected;
+ p->main_ahook->in_keep_filtered = p->cf->in_keep_filtered;
proto_reset_limit(p->main_ahook->in_limit);
proto_reset_limit(p->main_ahook->out_limit);
}
}
static void
-proto_show_stats(struct proto_stats *s, int in_keep_rejected)
+proto_show_stats(struct proto_stats *s, int in_keep_filtered)
{
- if (in_keep_rejected)
- cli_msg(-1006, " Routes: %u imported, %u rejected, %u exported, %u preferred",
- s->imp_routes, s->rej_routes, s->exp_routes, s->pref_routes);
+ if (in_keep_filtered)
+ cli_msg(-1006, " Routes: %u imported, %u filtered, %u exported, %u preferred",
+ s->imp_routes, s->filt_routes, s->exp_routes, s->pref_routes);
else
cli_msg(-1006, " Routes: %u imported, %u exported, %u preferred",
s->imp_routes, s->exp_routes, s->pref_routes);
proto_show_limit(p->cf->out_limit, "Export limit:");
if (p->proto_state != PS_DOWN)
- proto_show_stats(&p->stats, p->cf->in_keep_rejected);
+ proto_show_stats(&p->stats, p->cf->in_keep_filtered);
}
void
int class; /* SYM_PROTO or SYM_TEMPLATE */
u32 debug, mrtdump; /* Debugging bitfields, both use D_* constants */
unsigned preference, disabled; /* Generic parameters */
- int in_keep_rejected; /* Routes rejected in import filter are kept */
+ int in_keep_filtered; /* Routes rejected in import filter are kept */
u32 router_id; /* Protocol specific router ID */
struct rtable_config *table; /* Table we're attached to */
struct filter *in_filter, *out_filter; /* Attached filters */
struct proto_stats {
/* Import - from protocol to core */
u32 imp_routes; /* Number of routes successfully imported to the (adjacent) routing table */
- u32 rej_routes; /* Number of routes rejected in import filter but kept in the routing table */
+ u32 filt_routes; /* Number of routes rejected in import filter but kept in the routing table */
u32 pref_routes; /* Number of routes that are preferred, sum over all routing tables */
u32 imp_updates_received; /* Number of route updates received */
u32 imp_updates_invalid; /* Number of route updates rejected as invalid */
struct proto_limit *out_limit; /* Output limit */
struct proto_stats *stats; /* Per-table protocol statistics */
struct announce_hook *next; /* Next hook for the same protocol */
- int in_keep_rejected; /* Routes rejected in import filter are kept */
+ int in_keep_filtered; /* Routes rejected in import filter are kept */
};
struct announce_hook *proto_add_announce_hook(struct proto *p, struct rtable *t, struct proto_stats *stats);
} rte;
#define REF_COW 1 /* Copy this rte on write */
-#define REF_REJECTED 2 /* Route is rejected by import filter */
+#define REF_FILTERED 2 /* Route is rejected by import filter */
/* Route is valid for propagation (may depend on other flags in the future), accepts NULL */
-static inline int rte_is_valid(rte *r) { return r && !(r->flags & REF_REJECTED); }
+static inline int rte_is_valid(rte *r) { return r && !(r->flags & REF_FILTERED); }
-/* Route just has REF_REJECTED flag */
-static inline int rte_is_rejected(rte *r) { return !!(r->flags & REF_REJECTED); }
+/* Route just has REF_FILTERED flag */
+static inline int rte_is_filtered(rte *r) { return !!(r->flags & REF_FILTERED); }
/* Types of route announcement, also used as flags */
struct fib_iterator fit;
struct proto *show_protocol;
struct proto *export_protocol;
- int export_mode, primary_only, rejected;
+ int export_mode, primary_only, filtered;
struct config *running_on_config;
int net_counter, rt_counter, show_counter;
int stats, show_for;
{
/* No changes, ignore the new route */
- if (!rte_is_rejected(new))
+ if (!rte_is_filtered(new))
{
stats->imp_updates_ignored++;
rte_trace_in(D_ROUTES, p, new, "ignored");
struct proto_limit *l = ah->in_limit;
if (l && !old && new)
{
- u32 all_routes = stats->imp_routes + stats->rej_routes;
+ u32 all_routes = stats->imp_routes + stats->filt_routes;
if (all_routes >= l->limit)
proto_notify_limit(ah, l, all_routes);
}
}
- if (new && !rte_is_rejected(new))
+ if (new && !rte_is_filtered(new))
stats->imp_updates_accepted++;
else
stats->imp_withdraws_accepted++;
if (new)
- rte_is_rejected(new) ? stats->rej_routes++ : stats->imp_routes++;
+ rte_is_filtered(new) ? stats->filt_routes++ : stats->imp_routes++;
if (old)
- rte_is_rejected(old) ? stats->rej_routes-- : stats->imp_routes--;
+ rte_is_filtered(old) ? stats->filt_routes-- : stats->imp_routes--;
if (table->config->sorted)
{
stats->imp_updates_filtered++;
rte_trace_in(D_FILTERS, p, new, "filtered out");
- if (! ah->in_keep_rejected)
+ if (! ah->in_keep_filtered)
goto drop;
/* new is a private copy, i could modify it */
- new->flags |= REF_REJECTED;
+ new->flags |= REF_FILTERED;
}
else
{
stats->imp_updates_filtered++;
rte_trace_in(D_FILTERS, p, new, "filtered out");
- if (! ah->in_keep_rejected)
+ if (! ah->in_keep_filtered)
goto drop;
- new->flags |= REF_REJECTED;
+ new->flags |= REF_FILTERED;
}
if (tmpa != old_tmpa && src->store_tmp_attrs)
src->store_tmp_attrs(new, tmpa);
for(e=n->routes; e; e=e->next)
{
- if (rte_is_rejected(e) != d->rejected)
+ if (rte_is_filtered(e) != d->filtered)
continue;
struct ea_list *tmpa;
cli_msg(-1006, " Source address: %I", p->source_addr);
if (P->cf->in_limit)
cli_msg(-1006, " Route limit: %d/%d",
- p->p.stats.imp_routes + p->p.stats.rej_routes, P->cf->in_limit->limit);
+ p->p.stats.imp_routes + p->p.stats.filt_routes, P->cf->in_limit->limit);
cli_msg(-1006, " Hold timer: %d/%d",
tm_remains(c->hold_timer), c->hold_time);
cli_msg(-1006, " Keepalive timer: %d/%d",