cli_msg(1010, "%-8s\t%s", sd->sym->name, cf_symbol_class_name(sd->sym));
else
{
- for (const struct sym_scope *scope = config->root_scope; scope; scope = scope->next)
+ for (const struct sym_scope *scope = sd->config->root_scope; scope; scope = scope->next)
HASH_WALK(scope->hash, next, sym)
{
if (sd->type && (sym->class != sd->type))
*/
struct sym_show_data {
- int type; /* Symbols type to show */
- struct symbol *sym;
+ int type; /* Symbols type to show */
+ struct symbol *sym;
+ struct config *config; /* The actual configuration to dump */
};
struct f_inst;
$$ = cfg_allocz(sizeof(struct rt_show_data));
init_list(&($$->tables));
$$->filter = FILTER_ACCEPT;
- $$->running_on_config = config;
+ $$->running_on_config = this_cli->main_config;
$$->cli = this_cli;
+ $$->tf_route = this_cli->main_config->tf_route;
}
| r_args net_any {
$$ = $1;
| r_args TABLE ALL {
struct rtable_config *t;
$$ = $1;
- WALK_LIST(t, config->tables)
+ WALK_LIST(t, this_cli->main_config->tables)
rt_show_add_table($$, t->table);
$$->tables_defined_by = RSD_TDB_ALL;
}
sym_args:
/* empty */ {
$$ = cfg_allocz(sizeof(struct sym_show_data));
+ $$->config = this_cli->main_config;
}
| sym_args TABLE { $$ = $1; $$->type = SYM_TABLE; }
| sym_args FILTER { $$ = $1; $$->type = SYM_FILTER; }
show_mpls_ranges_args:
/* empty */
{
- if (EMPTY_LIST(config->mpls_domains))
+ if (EMPTY_LIST(this_cli->main_config->mpls_domains))
cf_error("No MPLS domain defined");
$$ = cfg_allocz(sizeof(struct mpls_show_ranges_cmd));
if ($$->range)
cf_error("Only one MPLS label range expected");
- $$->domain = $$->domain ?: cf_default_mpls_domain(config);
+ $$->domain = $$->domain ?: cf_default_mpls_domain(this_cli->main_config);
$$->range = $$->domain->static_range;
}
| show_mpls_ranges_args DYNAMIC
if ($$->range)
cf_error("Only one MPLS label range expected");
- $$->domain = $$->domain ?: cf_default_mpls_domain(config);
+ $$->domain = $$->domain ?: cf_default_mpls_domain(this_cli->main_config);
$$->range = $$->domain->dynamic_range;
}
;
struct rt_show_data_rtable *tab; /* Iterator over table list */
struct rt_show_data_rtable *last_table; /* Last table in output */
int verbose, tables_defined_by;
+ struct timeformat tf_route;
const struct filter *filter;
struct proto *show_protocol;
struct proto *export_protocol;
int dest = nhad ? (NEXTHOP_IS_REACHABLE(nhad) ? RTD_UNICAST : nhad->dest) : RTD_NONE;
int flowspec_valid = net_is_flow(e->net) ? rt_get_flowspec_valid(e) : FLOWSPEC_UNKNOWN;
- tm_format_time(tm, &config->tf_route, e->lastmod);
+ tm_format_time(tm, &d->tf_route, e->lastmod);
ip_addr a_from = ea_get_ip(a, &ea_gen_from, IPA_NONE);
if (ipa_nonzero(a_from) && (!nhad || !ipa_equal(a_from, nhad->nh.gw)))
bsprintf(from, " from %I", a_from);
{
struct rt_show_data *d = c->rover;
- if (d->running_on_config && (d->running_on_config != config))
+ if (OBSREF_GET(d->running_on_config) != OBSREF_GET(config))
{
cli_printf(c, 8004, "Stopped due to reconfiguration");
return rt_show_done(d);
return;
}
+ struct symbol **def_tables = d->cli->main_config->def_tables;
for (int i=1; i<NET_MAX; i++)
- if (config->def_tables[i] && config->def_tables[i]->table && config->def_tables[i]->table->table)
- rt_show_add_table(d, config->def_tables[i]->table->table);
+ if (def_tables[i] && def_tables[i]->table && def_tables[i]->table->table)
+ rt_show_add_table(d, def_tables[i]->table->table);
}
static inline void
.addr = d->addr,
.mode = d->addr_mode,
},
- .trace_routes = config->show_route_debug,
+ .trace_routes = d->cli->main_config->show_route_debug,
};
rt_feeder_subscribe(ex, &tab->req);