]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser: rearrange monitor/export rules
authorPatrick McHardy <kaber@trash.net>
Thu, 18 Sep 2014 13:58:22 +0000 (15:58 +0200)
committerPatrick McHardy <kaber@trash.net>
Wed, 24 Sep 2014 12:12:28 +0000 (14:12 +0200)
Move the output format rules next to the monitor and export command rules,
format them similar to other simple value mappings and unify their naming.

Signed-off-by: Patrick McHardy <kaber@trash.net>
src/parser.y

index cf1f42b5f4161580d98c33e41500d87f3ceae4a2..32d5455d1ef62966dc2260e8d43827462b7ff274 100644 (file)
@@ -513,7 +513,8 @@ static void location_update(struct location *loc, struct location *rhs, int n)
 %destructor { expr_free($$); } ct_expr
 %type <val>                    ct_key
 
-%type <val>                    export_format   output_format   monitor_event monitor_object
+%type <val>                    export_format
+%type <val>                    monitor_event   monitor_object          monitor_format
 
 %%
 
@@ -780,7 +781,7 @@ export_cmd          :       export_format
                        }
                        ;
 
-monitor_cmd            :       monitor_event   monitor_object  output_format
+monitor_cmd            :       monitor_event   monitor_object  monitor_format
                        {
                                struct handle h = { .family = NFPROTO_UNSPEC };
                                $$ = cmd_alloc(CMD_MONITOR, CMD_OBJ_RULESET, &h, &@$, NULL);
@@ -860,6 +861,14 @@ monitor_object             :       /* empty */
                        }
                        ;
 
+monitor_format         :       /* empty */     { $$ = NFT_OUTPUT_DEFAULT; }
+                       |       export_format
+                       ;
+
+export_format          :       XML             { $$ = NFT_OUTPUT_XML; }
+                       |       JSON            { $$ = NFT_OUTPUT_JSON; }
+                       ;
+
 describe_cmd           :       primary_expr
                        {
                                struct handle h = { .family = NFPROTO_UNSPEC };
@@ -868,13 +877,6 @@ describe_cmd               :       primary_expr
                        }
                        ;
 
-output_format          :       /* empty */
-                       {
-                               $$ = NFT_OUTPUT_DEFAULT;
-                       }
-                       |       export_format
-                       ;
-
 table_block_alloc      :       /* empty */
                        {
                                $$ = table_alloc();
@@ -2168,7 +2170,4 @@ mh_hdr_field              :       NEXTHDR         { $$ = MHHDR_NEXTHDR; }
                        |       CHECKSUM        { $$ = MHHDR_CHECKSUM; }
                        ;
 
-export_format          :       XML             { $$ = NFT_OUTPUT_XML; }
-                       |       JSON            { $$ = NFT_OUTPUT_JSON; }
-                       ;
 %%