netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Leblond <eric@regit.org>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, Eric Leblond <eric@regit.org>
Subject: [nftables PATCH 3/4] Update chain creation format.
Date: Mon, 16 Sep 2013 18:27:37 +0200	[thread overview]
Message-ID: <1379348858-29187-4-git-send-email-eric@regit.org> (raw)
In-Reply-To: <1379348858-29187-1-git-send-email-eric@regit.org>

type keyword is now mandatory when creating a new chain. This
patc halso implement the change required following the usage of human
notation in hook.

It also suppressed non currently supported mangle chains.

Signed-off-by: Eric Leblond <eric@regit.org>
---
 files/nftables/bridge-filter | 6 +++---
 files/nftables/ipv4-filter   | 6 +++---
 files/nftables/ipv4-mangle   | 6 +-----
 files/nftables/ipv4-nat      | 6 ++++++
 files/nftables/ipv6-filter   | 6 +++---
 files/nftables/ipv6-mangle   | 6 +-----
 files/nftables/ipv6-nat      | 6 ++++++
 7 files changed, 23 insertions(+), 19 deletions(-)
 create mode 100644 files/nftables/ipv4-nat
 create mode 100644 files/nftables/ipv6-nat

diff --git a/files/nftables/bridge-filter b/files/nftables/bridge-filter
index ca306d4..6ed303e 100644
--- a/files/nftables/bridge-filter
+++ b/files/nftables/bridge-filter
@@ -1,7 +1,7 @@
 #! nft -f
 
 table bridge filter {
-	chain input		{ hook NF_INET_LOCAL_IN		-200; }
-	chain forward		{ hook NF_INET_FORWARD		-200; }
-	chain output		{ hook NF_INET_LOCAL_OUT	200; }
+	chain input		{ table filter hook input priority -200; }
+	chain forward		{ table filter hook forward priority -200; }
+	chain output		{ table filter hook output priority 200; }
 }
diff --git a/files/nftables/ipv4-filter b/files/nftables/ipv4-filter
index 3f96214..3174e7a 100644
--- a/files/nftables/ipv4-filter
+++ b/files/nftables/ipv4-filter
@@ -1,7 +1,7 @@
 #! nft -f
 
 table filter {
-	chain input		{ hook NF_INET_LOCAL_IN		0; }
-	chain forward		{ hook NF_INET_FORWARD		0; }
-	chain output		{ hook NF_INET_LOCAL_OUT	0; }
+	chain input		{ type filter hook input priority 0; }
+	chain forward		{ type filter hook forward priority 0; }
+	chain output		{ type filter hook output priority 0; }
 }
diff --git a/files/nftables/ipv4-mangle b/files/nftables/ipv4-mangle
index 339cace..27327d3 100644
--- a/files/nftables/ipv4-mangle
+++ b/files/nftables/ipv4-mangle
@@ -1,9 +1,5 @@
 #! nft -f
 
 table mangle {
-	chain prerouting	{ hook NF_INET_PRE_ROUTING	-150; }
-	chain input		{ hook NF_INET_LOCAL_IN		-150; }
-	chain forward		{ hook NF_INET_FORWARD		-150; }
-	chain output		{ hook NF_INET_LOCAL_OUT	-150; }
-	chain postrouting	{ hook NF_INET_POST_ROUTING	-150; }
+	chain output		{ type route hook output priority -150; }
 }
diff --git a/files/nftables/ipv4-nat b/files/nftables/ipv4-nat
new file mode 100644
index 0000000..99d6951
--- /dev/null
+++ b/files/nftables/ipv4-nat
@@ -0,0 +1,6 @@
+#! nft -f
+
+table nat {
+	chain prerouting	{ type nat hook prerouting priority -150; }
+	chain postrouting	{ type nat hook postrouting priority -150; }
+}
diff --git a/files/nftables/ipv6-filter b/files/nftables/ipv6-filter
index 9e41278..98fce02 100644
--- a/files/nftables/ipv6-filter
+++ b/files/nftables/ipv6-filter
@@ -1,7 +1,7 @@
 #! nft -f
 
 table ip6 filter {
-	chain input		{ hook NF_INET_LOCAL_IN		0; }
-	chain forward		{ hook NF_INET_FORWARD		0; }
-	chain output		{ hook NF_INET_LOCAL_OUT	0; }
+	chain input		{ type filter hook input priority 0; }
+	chain forward		{ type filter hook forward priority 0; }
+	chain output		{ type filter hook output priority 0; }
 }
diff --git a/files/nftables/ipv6-mangle b/files/nftables/ipv6-mangle
index dc18c7a..7274353 100644
--- a/files/nftables/ipv6-mangle
+++ b/files/nftables/ipv6-mangle
@@ -1,9 +1,5 @@
 #! nft -f
 
 table ip6 mangle {
-	chain prerouting	{ hook NF_INET_PRE_ROUTING	-150; }
-	chain input		{ hook NF_INET_LOCAL_IN		-150; }
-	chain forward		{ hook NF_INET_FORWARD		-150; }
-	chain output		{ hook NF_INET_LOCAL_OUT	-150; }
-	chain postrouting	{ hook NF_INET_POST_ROUTING	-150; }
+	chain output		{ type route hook output priority -150; }
 }
diff --git a/files/nftables/ipv6-nat b/files/nftables/ipv6-nat
new file mode 100644
index 0000000..33ecf9b
--- /dev/null
+++ b/files/nftables/ipv6-nat
@@ -0,0 +1,6 @@
+#! nft -f
+
+table ip6 nat {
+	chain prerouting	{ type nat hook prerouting priority -150; }
+	chain postrouting	{ type nat hook postrouting priority -150; }
+}
-- 
1.8.4.rc3


  parent reply	other threads:[~2013-09-16 17:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 16:27 [nftables 0/4] misc improvements and cleaning Eric Leblond
2013-09-16 16:27 ` [nftables PATCH 1/4] nat: add mandatory family attribute Eric Leblond
2013-09-16 16:27 ` [nftables PATCH 2/4] Suppress non working examples Eric Leblond
2013-09-16 16:27 ` Eric Leblond [this message]
2013-09-16 20:21   ` [nftables PATCH 3/4] Update chain creation format Florian Westphal
2013-09-16 21:04     ` Eric Leblond
2013-09-16 16:27 ` [nftables PATCH 4/4] display family in table listing Eric Leblond
2013-09-17 11:14 ` [nftables 0/4] misc improvements and cleaning 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=1379348858-29187-4-git-send-email-eric@regit.org \
    --to=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).