int parse_show_symbols_arg(struct argument *argument)
{
- char *params[] = {"table", "filter", "function", "protocol", "template"};
- int param_vals[] = {SYM_TABLE, SYM_FILTER, SYM_FUNCTION, SYM_PROTO, SYM_TEMPLATE}; // defined in conf.h
+ char *params[] = {"table", "filter", "function", "protocol", "template", "constant", "variable"};
+ int param_vals[] = {SYM_TABLE, SYM_FILTER, SYM_FUNCTION, SYM_PROTO, SYM_TEMPLATE, SYM_CONSTANT, SYM_VARIABLE}; // defined in conf.h
for (size_t j = 0; j < sizeof(params)/sizeof(char*); j++)
{
if (compare_str(argument->arg, argument->len, params[j]))
cbor_string_string(w, "type", "symbol not known");
return w->pt;
}
-
else
{
cbor_add_string(w, "table");
{
if (!sym->scope->active)
continue;
-
- if (show_type != SYM_VOID && (sym->class != show_type))
+ if (show_type == SYM_VARIABLE || show_type == SYM_CONSTANT)
+ {
+ if (!(show_type == (int)(sym->class & 0xffffff00)))
+ continue;
+ }
+ else if (show_type != SYM_VOID && (sym->class != show_type))
continue;
cbor_open_block_with_length(w, 2);
void
cmd_show_symbols(struct sym_show_data *sd)
{
+ cli_msg(-1010, "%i %x", sd->type, sd->type);
if (sd->sym)
cli_msg(1010, "%-8s\t%s", sd->sym->name, cf_symbol_class_name(sd->sym));
else
if (!sym->scope->active)
continue;
- if (sd->type && (sym->class != sd->type))
+ if (sd->type == SYM_VARIABLE || sd->type == SYM_CONSTANT)
+ {
+ if (!(sd->type == (int)(sym->class & 0xffffff00)))
+ continue;
+ }
+ else if (sd->type && (sym->class != sd->type))
continue;
- cli_msg(-1010, "%-8s\t%s", sym->name, cf_symbol_class_name(sym));
+ cli_msg(-1010, "%-8s\t%s %x %i", sym->name, cf_symbol_class_name(sym), sym->class, sym->class);
}
HASH_WALK_END;
CF_DECLS
CF_KEYWORDS(ROUTER, ID, HOSTNAME, PROTOCOL, TEMPLATE, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
-CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, VRF, DEFAULT, TABLE, STATES, ROUTES, FILTERS)
+CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, VRF, DEFAULT, TABLE, STATES, ROUTES, FILTERS, CONSTANT, VARIABLE)
CF_KEYWORDS(IPV4, IPV6, VPN4, VPN6, ROA4, ROA6, FLOW4, FLOW6, SADR, MPLS)
CF_KEYWORDS(RECEIVE, LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE, KEEP, FILTERED, RPKI)
CF_KEYWORDS(PASSWORD, KEY, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, CHANNELS, INTERFACES)
;
CF_CLI_HELP(SHOW SYMBOLS, ..., [[Show all known symbolic names]])
-CF_CLI(SHOW SYMBOLS, sym_args, [table|filter|function|protocol|template|<symbol>], [[Show all known symbolic names]])
+CF_CLI(SHOW SYMBOLS, sym_args, [table|filter|function|protocol|template|constant|variable|<symbol>], [[Show all known symbolic names]])
{ cmd_show_symbols($3); } ;
sym_args:
| sym_args FILTER { $$ = $1; $$->type = SYM_FILTER; }
| sym_args PROTOCOL { $$ = $1; $$->type = SYM_PROTO; }
| sym_args TEMPLATE { $$ = $1; $$->type = SYM_TEMPLATE; }
+ | sym_args CONSTANT { $$ = $1; $$->type = SYM_CONSTANT; }
+ | sym_args VARIABLE { $$ = $1; $$->type = SYM_VARIABLE; }
| sym_args CF_SYM_KNOWN { $$ = $1; $$->sym = $2; }
;