diff options
Diffstat (limited to 'src/parser.y')
-rw-r--r-- | src/parser.y | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/parser.y b/src/parser.y index fc724588..87602d9f 100644 --- a/src/parser.y +++ b/src/parser.y @@ -157,6 +157,7 @@ static void location_update(struct location *loc, struct location *rhs, int n) %token HOOK "hook" %token <val> HOOKNUM "hooknum" %token TABLE "table" +%token TABLES "tables" %token CHAIN "chain" %token RULE "rule" %token SETS "sets" @@ -332,8 +333,8 @@ static void location_update(struct location *loc, struct location *rhs, int n) %type <cmd> base_cmd add_cmd insert_cmd delete_cmd list_cmd flush_cmd rename_cmd %destructor { cmd_free($$); } base_cmd add_cmd insert_cmd delete_cmd list_cmd flush_cmd rename_cmd -%type <handle> table_spec chain_spec chain_identifier ruleid_spec -%destructor { handle_free(&$$); } table_spec chain_spec chain_identifier ruleid_spec +%type <handle> table_spec tables_spec chain_spec chain_identifier ruleid_spec +%destructor { handle_free(&$$); } table_spec tables_spec chain_spec chain_identifier ruleid_spec %type <handle> set_spec set_identifier %destructor { handle_free(&$$); } set_spec set_identifier %type <val> handle_spec family_spec @@ -605,6 +606,10 @@ list_cmd : TABLE table_spec { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_TABLE, &$2, NULL); } + | TABLES tables_spec + { + $$ = cmd_alloc(CMD_LIST, CMD_OBJ_TABLE, &$2, NULL); + } | CHAIN chain_spec { $$ = cmd_alloc(CMD_LIST, CMD_OBJ_CHAIN, &$2, NULL); @@ -789,6 +794,14 @@ table_spec : family_spec identifier } ; +tables_spec : family_spec + { + memset(&$$, 0, sizeof($$)); + $$.family = $1; + $$.table = NULL; + } + ; + chain_spec : table_spec identifier { $$ = $1; |