netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
To: netfilter-devel@vger.kernel.org
Cc: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Subject: [nftables tool v2 PATCH 3/4] src: Add priority keyword on base chain description
Date: Wed,  4 Sep 2013 12:50:21 +0300	[thread overview]
Message-ID: <1378288222-13182-4-git-send-email-tomasz.bursztyka@linux.intel.com> (raw)
In-Reply-To: <1378288222-13182-1-git-send-email-tomasz.bursztyka@linux.intel.com>

Instead of:
add chain foo bar { type route hook input 0; }

it should be now:
add chain foo bar { type route hook input priority 0; }

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
---
 src/parser.y | 8 ++++----
 src/rule.c   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/parser.y b/src/parser.y
index 73a52d4..25da452 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -767,7 +767,7 @@ map_block		:	/* empty */	{ $$ = $<set>-1; }
 			}
 			;
 
-hook_spec		:	TYPE		STRING		HOOK		STRING		NUM
+hook_spec		:	TYPE		STRING		HOOK		STRING		PRIORITY	NUM
 			{
 				$<chain>0->type		= chain_type_name_lookup($2);
 				if ($<chain>0->type == NULL) {
@@ -781,10 +781,10 @@ hook_spec		:	TYPE		STRING		HOOK		STRING		NUM
 						   state->msgs);
 					YYERROR;
 				}
-				$<chain>0->priority	= $5;
+				$<chain>0->priority	= $6;
 				$<chain>0->flags	|= CHAIN_F_BASECHAIN;
 			}
-			|	TYPE		STRING		HOOK		STRING		DASH	NUM
+			|	TYPE		STRING		HOOK		STRING		PRIORITY	DASH	NUM
 			{
 				$<chain>0->type		= chain_type_name_lookup($2);
 				if ($<chain>0->type == NULL) {
@@ -798,7 +798,7 @@ hook_spec		:	TYPE		STRING		HOOK		STRING		NUM
 						   state->msgs);
 					YYERROR;
 				}
-				$<chain>0->priority	= -$6;
+				$<chain>0->priority	= -$7;
 				$<chain>0->flags	|= CHAIN_F_BASECHAIN;
 			}
 			;
diff --git a/src/rule.c b/src/rule.c
index 37dcc8c..56592e8 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -314,7 +314,7 @@ static void chain_print(const struct chain *chain)
 
 	printf("\tchain %s {\n", chain->handle.chain);
 	if (chain->flags & CHAIN_F_BASECHAIN) {
-		printf("\t\t type %s hook %s %u;\n", chain->type,
+		printf("\t\t type %s hook %s priority %u;\n", chain->type,
 		       hooknum2str(chain->handle.family, chain->hooknum),
 		       chain->priority);
 	}
-- 
1.8.3.2


  parent reply	other threads:[~2013-09-04  9:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04  9:50 [nftables tool v2 PATCH 0/4] Easier base chain declaration Tomasz Bursztyka
2013-09-04  9:50 ` [nftables tool v2 PATCH 1/4] src: Wrap netfilter hooks around human readable strings Tomasz Bursztyka
2013-09-04 10:44   ` Pablo Neira Ayuso
2013-09-04  9:50 ` [nftables tool v2 PATCH 2/4] src: Ensure given base chain type is a valid one Tomasz Bursztyka
2013-09-04 10:45   ` Pablo Neira Ayuso
2013-09-04 11:29     ` Tomasz Bursztyka
2013-09-05  9:03       ` Pablo Neira Ayuso
2013-09-04  9:50 ` Tomasz Bursztyka [this message]
2013-09-04 10:46   ` [nftables tool v2 PATCH 3/4] src: Add priority keyword on base chain description Pablo Neira Ayuso
2013-09-04  9:50 ` [nftables tool v2 PATCH 4/4] tests: Update bate chain creation according to latest syntax changes Tomasz Bursztyka
2013-09-04 10:46   ` Pablo Neira Ayuso

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=1378288222-13182-4-git-send-email-tomasz.bursztyka@linux.intel.com \
    --to=tomasz.bursztyka@linux.intel.com \
    --cc=netfilter-devel@vger.kernel.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).