Commit cff9e937 authored by Jan Maria Matejka's avatar Jan Maria Matejka
Browse files

Filter: instruction names

parent 31d6939c
...@@ -77,6 +77,22 @@ f_generate_roa_check(struct rtable_config *table, struct f_inst *prefix, struct ...@@ -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)
{ {
......
...@@ -78,6 +78,7 @@ enum f_instruction_code { ...@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment