This prepares for the separate 'reload bgp' command triggering BGP Route Refresh
Enable, disable or restart a given protocol instance, instances matching
the <cf><m/pattern/</cf> or <cf/all/ instances.
- <tag><label id="cli-reload">reload [in|out] (<m/name/|"<m/pattern/"|all) [partial prefix] </tag>
+ <tag><label id="cli-reload">reload filters [in|out] (<m/name/|"<m/pattern/"|all) [partial prefix] </tag>
Reload a given protocol instance, that means re-import routes from the
protocol instance and re-export preferred routes to the instance. If
<cf/in/ or <cf/out/ options are used, the command is restricted to one
Export supports also `export in` form, allowing to export only subprefixes of
the given prefix. Experimental.
+Reload of filters is now done by `reload filters` command, contrary to just `reload` in BIRD 2.
+
## Route attributes
All protocol attributes have been renamed in CLI to align with the filter language tokens.
{ proto_apply_cmd($2, proto_cmd_enable, 1, (uintptr_t) $3); } ;
CF_CLI(RESTART, proto_patt opttext, (<protocol> | \"<pattern>\" | all) [message], [[Restart protocol]])
{ proto_apply_cmd($2, proto_cmd_restart, 1, (uintptr_t) $3); } ;
-CF_CLI(RELOAD, proto_patt partial_opt, (<protocol> | \"<pattern>\" | all) [partial <prefix set>], [[Reload protocol]])
-{ proto_call_cmd_reload($2, CMD_RELOAD, $3); } ;
-CF_CLI(RELOAD IN, proto_patt partial_opt, <protocol> | \"<pattern>\" | all, [[Reload protocol (just imported routes)]])
-{ proto_call_cmd_reload($3, CMD_RELOAD_IN, $4); } ;
-CF_CLI(RELOAD OUT, proto_patt partial_opt, <protocol> | \"<pattern>\" | all, [[Reload protocol (just exported routes)]])
-{ proto_call_cmd_reload($3, CMD_RELOAD_OUT, $4); } ;
+CF_CLI(RELOAD FILTERS, proto_patt partial_opt, (<protocol> | \"<pattern>\" | all) [partial <prefix set>], [[Reload protocol filters]])
+{ proto_call_cmd_reload($3, CMD_RELOAD, $4); } ;
+CF_CLI(RELOAD FILTERS IN, proto_patt partial_opt, <protocol> | \"<pattern>\" | all, [[Reload protocol filters (just imported routes)]])
+{ proto_call_cmd_reload($4, CMD_RELOAD_IN, $5); } ;
+CF_CLI(RELOAD FILTERS OUT, proto_patt partial_opt, <protocol> | \"<pattern>\" | all, [[Reload protocol filters (just exported routes)]])
+{ proto_call_cmd_reload($4, CMD_RELOAD_OUT, $5); } ;
CF_CLI_HELP(DEBUG, ..., [[Control protocol debugging via BIRD logs]])
CF_CLI(DEBUG, debug_args, (<protocol> | <channel> | \"<pattern>\" | all) (all | off | { states|routes|filters|interfaces|events|packets [, ...] }), [[Control protocol debugging via BIRD logs]])
{ return (c->channel_state != CS_DOWN); }
static inline int channel_reloadable(struct channel *c)
-{ return c->proto->reload_routes && c->reloadable; }
+{
+ return c->reloadable && c->proto->reload_routes
+ || ((c->in_keep & RIK_PREFILTER) == RIK_PREFILTER);
+}
static inline void
channel_log_state_change(struct channel *c)
if (dir && !channel_reloadable(c))
valid = 0;
-#ifdef CONFIG_BGP
- /* No automatic reload for BGP channels without in_table / out_table */
- if (c->class == &channel_bgp)
- valid = dir ? ((c->in_keep & RIK_PREFILTER) == RIK_PREFILTER) : !!c->out_table;
-#endif
-
struct filter_iterator fit;
FILTER_ITERATE_INIT(&fit, f->root, c->proto->pool);
return;
/* All channels must support reload */
- if (prr->dir != CMD_RELOAD_OUT)
+ if (prr->dir & CMD_RELOAD_IN)
WALK_LIST(c, p->channels)
if ((c->channel_state == CS_UP) && !channel_reloadable(c))
{
struct proto_reload_request {
const struct f_trie *trie; /* Trie to apply */
_Atomic uint counter; /* How many channels remaining */
- uint dir; /* Direction of reload */
+ enum cmd_reload {
+ CMD_RELOAD_IN = 1,
+ CMD_RELOAD_OUT = 2,
+ CMD_RELOAD = (CMD_RELOAD_IN | CMD_RELOAD_OUT),
+ } dir; /* Direction of reload */
event ev; /* Event to run when finished */
};
static inline struct domain_generic *proto_domain(struct proto *p)
{ return birdloop_domain(p->loop); }
-#define CMD_RELOAD 0
-#define CMD_RELOAD_IN 1
-#define CMD_RELOAD_OUT 2
-
static inline u32
proto_get_router_id(struct proto_config *pc)
{