0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-17 08:38:42 +00:00

Filter: instruction names

This commit is contained in:
Jan Maria Matejka 2018-04-30 12:49:22 +02:00
parent 31d6939cde
commit cff9e937fd
2 changed files with 17 additions and 0 deletions

View File

@ -77,6 +77,22 @@ f_generate_roa_check(struct rtable_config *table, struct f_inst *prefix, struct
return &ret->i; return &ret->i;
} }
static const char * const f_instruction_name_str[] = {
#define F(c,a,b) \
[c] = #c,
FI__LIST
#undef F
};
const char *
f_instruction_name(enum f_instruction_code fi)
{
if (fi < FI__MAX)
return f_instruction_name_str[fi];
else
bug("Got unknown instruction code: %d", fi);
}
char * char *
filter_name(struct filter *filter) filter_name(struct filter *filter)
{ {

View File

@ -78,6 +78,7 @@ enum f_instruction_code {
c, c,
FI__LIST FI__LIST
#undef F #undef F
FI__MAX,
} PACKED; } PACKED;
struct f_inst { /* Instruction */ struct f_inst { /* Instruction */