netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Leroy <fredo@starox.org>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Bart De Schuymer <bdschuym@pandora.be>,
	Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org
Subject: Re: [arptables] rfc: add classify target
Date: Tue, 9 Nov 2010 21:51:26 +0100	[thread overview]
Message-ID: <20101109215126.502a155e@caresse> (raw)
In-Reply-To: <alpine.LNX.2.01.1011092121210.10710@obet.zrqbmnf.qr>

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

Le Tue, 9 Nov 2010 21:28:09 +0100 (CET),
Jan Engelhardt <jengelh@medozas.de> a écrit :

> Alas, when I originally coded NFPROTO_UNSPEC wildcard support,
> I allowed for same-rev overloading, as in:
> 
> static struct xt_target classify_tg_reg[] __read_mostly = {
> 	{
> [...]
> };
> 

Here is a patch against my previous patch with your insights.
I had time to test it. 

-- 
Frédéric Leroy

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: xt_CLASSIFY.arp_table.patch --]
[-- Type: text/x-patch, Size: 2196 bytes --]

commit fdf76e03e17b7d4cd5a160ee3a5b005859eff2fd
Author: Frédéric Leroy <fredo@starox.org>
Date:   Tue Nov 9 21:46:29 2010 +0100

    netfilter: xtables: allow xt_CLASSIFY for arp tables

diff --git a/net/netfilter/xt_CLASSIFY.c b/net/netfilter/xt_CLASSIFY.c
index eb7057a..add7435 100644
--- a/net/netfilter/xt_CLASSIFY.c
+++ b/net/netfilter/xt_CLASSIFY.c
@@ -19,6 +19,7 @@
 #include <linux/netfilter_ipv6.h>
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter/xt_CLASSIFY.h>
+#include <linux/netfilter_arp.h>
 
 MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
 MODULE_LICENSE("GPL");
@@ -35,25 +36,37 @@ classify_tg(struct sk_buff *skb, const struct xt_action_param *par)
 	return XT_CONTINUE;
 }
 
-static struct xt_target classify_tg_reg __read_mostly = {
-	.name       = "CLASSIFY",
-	.revision   = 0,
-	.family     = NFPROTO_UNSPEC,
-	.hooks      = (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_FORWARD) |
-		      (1 << NF_INET_POST_ROUTING),
-	.target     = classify_tg,
-	.targetsize = sizeof(struct xt_classify_target_info),
-	.me         = THIS_MODULE,
+static struct xt_target classify_tg_reg[] __read_mostly = {
+	{
+		.name       = "CLASSIFY",
+		.revision   = 0,
+		.family     = NFPROTO_UNSPEC,
+		.table      = "mangle",
+		.hooks      = (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_FORWARD) |
+		              (1 << NF_INET_POST_ROUTING),
+		.target     = classify_tg,
+		.targetsize = sizeof(struct xt_classify_target_info),
+		.me         = THIS_MODULE,
+	},
+	{
+		.name       = "CLASSIFY",
+		.revision   = 0,
+		.family     = NFPROTO_ARP,
+		.hooks      = (1 << NF_ARP_OUT) | (1 << NF_ARP_FORWARD),
+		.target     = classify_tg,
+		.targetsize = sizeof(struct xt_classify_target_info),
+		.me         = THIS_MODULE,
+	},
 };
 
 static int __init classify_tg_init(void)
 {
-	return xt_register_target(&classify_tg_reg);
+	return xt_register_targets(classify_tg_reg, ARRAY_SIZE(classify_tg_reg));
 }
 
 static void __exit classify_tg_exit(void)
 {
-	xt_unregister_target(&classify_tg_reg);
+	xt_unregister_targets(classify_tg_reg, ARRAY_SIZE(classify_tg_reg));
 }
 
 module_init(classify_tg_init);

  parent reply	other threads:[~2010-11-09 20:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-07 14:26 [arptables] rfc: add classify target Frederic Leroy
2010-11-07 15:18 ` Jan Engelhardt
2010-11-09 14:25   ` Patrick McHardy
2010-11-09 16:10     ` Frederic Leroy
2010-11-09 16:48       ` Patrick McHardy
2010-11-09 17:39       ` Bart De Schuymer
2010-11-09 20:18         ` Frederic Leroy
2010-11-09 20:28           ` Jan Engelhardt
2010-11-09 20:34             ` Frederic Leroy
2010-11-09 21:27               ` Jan Engelhardt
2010-11-09 21:38                 ` Frederic Leroy
2010-11-09 20:51             ` Frederic Leroy [this message]
2010-11-11 10:38               ` Patrick McHardy
2010-11-11 11:45                 ` Frederic Leroy
2010-11-12  7:49                   ` Patrick McHardy
2010-11-13 15:29                     ` Frederic Leroy
2010-11-14 15:36                       ` Bart De Schuymer
2010-11-15 12:32                         ` Frederic Leroy
2010-11-15 19:31                           ` Bart De Schuymer
2010-11-15 10:44                       ` Patrick McHardy
2010-11-15 12:28                         ` [PATCH] netfilter: xtables: add arp support, allow CLASSIFY target on any table Frederic Leroy
2010-11-15 12:59                           ` Patrick McHardy

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=20101109215126.502a155e@caresse \
    --to=fredo@starox.org \
    --cc=bdschuym@pandora.be \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --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).