netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: pablo@netfilter.org
Cc: eric@regit.org, arturo.borrero.glez@gmail.com,
	netfilter-devel@vger.kernel.org
Subject: [PATCH 3/3] parser: rearrange monitor/export rules
Date: Wed, 24 Sep 2014 14:20:32 +0200	[thread overview]
Message-ID: <1411561232-20204-4-git-send-email-kaber@trash.net> (raw)
In-Reply-To: <1411561232-20204-1-git-send-email-kaber@trash.net>

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 | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/parser.y b/src/parser.y
index cf1f42b..32d5455 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -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; }
-			;
 %%
-- 
1.9.3


      parent reply	other threads:[~2014-09-24 12:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 12:20 [PATCH 0/3]: parser cleanups Patrick McHardy
2014-09-24 12:20 ` [PATCH 1/3] expr: make range_low()/range_high() usable outside of segtree Patrick McHardy
2014-09-24 12:20 ` [PATCH 2/3] queue: clean up queue statement Patrick McHardy
2014-09-24 12:20 ` Patrick McHardy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411561232-20204-4-git-send-email-kaber@trash.net \
    --to=kaber@trash.net \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=eric@regit.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).