[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
/* iptables module for using new netfilter netlink queue
|
|
|
|
*
|
|
|
|
* (C) 2005 by Harald Welte <laforge@netfilter.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2007-02-12 20:15:49 +01:00
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
* published by the Free Software Foundation.
|
2007-02-12 20:15:49 +01:00
|
|
|
*
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/skbuff.h>
|
|
|
|
|
2009-06-05 13:24:24 +02:00
|
|
|
#include <linux/ip.h>
|
|
|
|
#include <linux/ipv6.h>
|
|
|
|
#include <linux/jhash.h>
|
|
|
|
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
#include <linux/netfilter.h>
|
|
|
|
#include <linux/netfilter_arp.h>
|
|
|
|
#include <linux/netfilter/x_tables.h>
|
|
|
|
#include <linux/netfilter/xt_NFQUEUE.h>
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
|
2008-01-15 08:42:28 +01:00
|
|
|
MODULE_DESCRIPTION("Xtables: packet forwarding to netlink");
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_ALIAS("ipt_NFQUEUE");
|
|
|
|
MODULE_ALIAS("ip6t_NFQUEUE");
|
|
|
|
MODULE_ALIAS("arpt_NFQUEUE");
|
|
|
|
|
2009-06-05 13:24:24 +02:00
|
|
|
static u32 jhash_initval __read_mostly;
|
2010-01-04 16:27:25 +01:00
|
|
|
static bool rnd_inited __read_mostly;
|
2009-06-05 13:24:24 +02:00
|
|
|
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
static unsigned int
|
2009-07-05 19:43:26 +02:00
|
|
|
nfqueue_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
{
|
2008-10-08 11:35:19 +02:00
|
|
|
const struct xt_NFQ_info *tinfo = par->targinfo;
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
|
|
|
|
return NF_QUEUE_NR(tinfo->queuenum);
|
|
|
|
}
|
|
|
|
|
2009-06-05 13:24:24 +02:00
|
|
|
static u32 hash_v4(const struct sk_buff *skb)
|
|
|
|
{
|
|
|
|
const struct iphdr *iph = ip_hdr(skb);
|
|
|
|
|
|
|
|
/* packets in either direction go into same queue */
|
2012-08-19 12:16:09 +02:00
|
|
|
if ((__force u32)iph->saddr < (__force u32)iph->daddr)
|
2012-06-04 04:53:54 +02:00
|
|
|
return jhash_3words((__force u32)iph->saddr,
|
|
|
|
(__force u32)iph->daddr, iph->protocol, jhash_initval);
|
2009-06-05 13:24:24 +02:00
|
|
|
|
2012-06-04 04:53:54 +02:00
|
|
|
return jhash_3words((__force u32)iph->daddr,
|
|
|
|
(__force u32)iph->saddr, iph->protocol, jhash_initval);
|
2009-06-05 13:24:24 +02:00
|
|
|
}
|
|
|
|
|
2011-12-12 03:58:24 +01:00
|
|
|
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
2009-06-05 13:24:24 +02:00
|
|
|
static u32 hash_v6(const struct sk_buff *skb)
|
|
|
|
{
|
|
|
|
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
2012-06-04 04:53:54 +02:00
|
|
|
u32 a, b, c;
|
2009-06-05 13:24:24 +02:00
|
|
|
|
2012-08-19 12:16:09 +02:00
|
|
|
if ((__force u32)ip6h->saddr.s6_addr32[3] <
|
|
|
|
(__force u32)ip6h->daddr.s6_addr32[3]) {
|
2012-06-04 04:53:54 +02:00
|
|
|
a = (__force u32) ip6h->saddr.s6_addr32[3];
|
|
|
|
b = (__force u32) ip6h->daddr.s6_addr32[3];
|
|
|
|
} else {
|
|
|
|
b = (__force u32) ip6h->saddr.s6_addr32[3];
|
|
|
|
a = (__force u32) ip6h->daddr.s6_addr32[3];
|
|
|
|
}
|
2009-06-05 13:24:24 +02:00
|
|
|
|
2012-08-19 12:16:09 +02:00
|
|
|
if ((__force u32)ip6h->saddr.s6_addr32[1] <
|
|
|
|
(__force u32)ip6h->daddr.s6_addr32[1])
|
2012-06-04 04:53:54 +02:00
|
|
|
c = (__force u32) ip6h->saddr.s6_addr32[1];
|
|
|
|
else
|
|
|
|
c = (__force u32) ip6h->daddr.s6_addr32[1];
|
|
|
|
|
|
|
|
return jhash_3words(a, b, c, jhash_initval);
|
2009-06-05 13:24:24 +02:00
|
|
|
}
|
2009-06-05 15:22:15 +02:00
|
|
|
#endif
|
2009-06-05 13:24:24 +02:00
|
|
|
|
2013-03-23 11:04:04 +01:00
|
|
|
static u32
|
|
|
|
nfqueue_hash(const struct sk_buff *skb, const struct xt_action_param *par)
|
2009-06-05 13:24:24 +02:00
|
|
|
{
|
|
|
|
const struct xt_NFQ_info_v1 *info = par->targinfo;
|
|
|
|
u32 queue = info->queuenum;
|
|
|
|
|
2013-03-23 11:04:04 +01:00
|
|
|
if (par->family == NFPROTO_IPV4)
|
|
|
|
queue += ((u64) hash_v4(skb) * info->queues_total) >> 32;
|
2011-12-12 03:58:24 +01:00
|
|
|
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
|
2013-03-23 11:04:04 +01:00
|
|
|
else if (par->family == NFPROTO_IPV6)
|
|
|
|
queue += ((u64) hash_v6(skb) * info->queues_total) >> 32;
|
2009-06-05 15:22:15 +02:00
|
|
|
#endif
|
2013-03-23 11:04:04 +01:00
|
|
|
|
|
|
|
return queue;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned int
|
|
|
|
nfqueue_tg_v1(struct sk_buff *skb, const struct xt_action_param *par)
|
|
|
|
{
|
|
|
|
const struct xt_NFQ_info_v1 *info = par->targinfo;
|
|
|
|
u32 queue = info->queuenum;
|
|
|
|
|
|
|
|
if (info->queues_total > 1)
|
|
|
|
queue = nfqueue_hash(skb, par);
|
|
|
|
|
2009-06-05 13:24:24 +02:00
|
|
|
return NF_QUEUE_NR(queue);
|
|
|
|
}
|
|
|
|
|
2011-01-18 16:08:30 +01:00
|
|
|
static unsigned int
|
|
|
|
nfqueue_tg_v2(struct sk_buff *skb, const struct xt_action_param *par)
|
2009-06-05 13:24:24 +02:00
|
|
|
{
|
2011-01-18 16:08:30 +01:00
|
|
|
const struct xt_NFQ_info_v2 *info = par->targinfo;
|
|
|
|
unsigned int ret = nfqueue_tg_v1(skb, par);
|
|
|
|
|
|
|
|
if (info->bypass)
|
|
|
|
ret |= NF_VERDICT_FLAG_QUEUE_BYPASS;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int nfqueue_tg_check(const struct xt_tgchk_param *par)
|
|
|
|
{
|
2013-03-23 11:04:03 +01:00
|
|
|
const struct xt_NFQ_info_v3 *info = par->targinfo;
|
2009-06-05 13:24:24 +02:00
|
|
|
u32 maxid;
|
|
|
|
|
2010-01-04 16:27:25 +01:00
|
|
|
if (unlikely(!rnd_inited)) {
|
|
|
|
get_random_bytes(&jhash_initval, sizeof(jhash_initval));
|
|
|
|
rnd_inited = true;
|
|
|
|
}
|
2009-06-05 13:24:24 +02:00
|
|
|
if (info->queues_total == 0) {
|
|
|
|
pr_err("NFQUEUE: number of total queues is 0\n");
|
2010-03-25 16:34:45 +01:00
|
|
|
return -EINVAL;
|
2009-06-05 13:24:24 +02:00
|
|
|
}
|
|
|
|
maxid = info->queues_total - 1 + info->queuenum;
|
|
|
|
if (maxid > 0xffff) {
|
|
|
|
pr_err("NFQUEUE: number of queues (%u) out of range (got %u)\n",
|
|
|
|
info->queues_total, maxid);
|
2010-03-19 17:32:59 +01:00
|
|
|
return -ERANGE;
|
2009-06-05 13:24:24 +02:00
|
|
|
}
|
2013-03-23 11:04:03 +01:00
|
|
|
if (par->target->revision == 2 && info->flags > 1)
|
|
|
|
return -EINVAL;
|
|
|
|
if (par->target->revision == 3 && info->flags & ~NFQ_FLAG_MASK)
|
2011-01-18 16:08:30 +01:00
|
|
|
return -EINVAL;
|
2013-03-23 11:04:03 +01:00
|
|
|
|
2010-03-25 16:34:45 +01:00
|
|
|
return 0;
|
2009-06-05 13:24:24 +02:00
|
|
|
}
|
|
|
|
|
2013-03-23 11:04:03 +01:00
|
|
|
static unsigned int
|
|
|
|
nfqueue_tg_v3(struct sk_buff *skb, const struct xt_action_param *par)
|
|
|
|
{
|
|
|
|
const struct xt_NFQ_info_v3 *info = par->targinfo;
|
|
|
|
u32 queue = info->queuenum;
|
2013-10-28 14:42:33 +01:00
|
|
|
int ret;
|
2013-03-23 11:04:03 +01:00
|
|
|
|
|
|
|
if (info->queues_total > 1) {
|
|
|
|
if (info->flags & NFQ_FLAG_CPU_FANOUT) {
|
|
|
|
int cpu = smp_processor_id();
|
|
|
|
|
|
|
|
queue = info->queuenum + cpu % info->queues_total;
|
2013-03-23 11:04:04 +01:00
|
|
|
} else
|
|
|
|
queue = nfqueue_hash(skb, par);
|
2013-03-23 11:04:03 +01:00
|
|
|
}
|
2013-03-23 11:04:04 +01:00
|
|
|
|
2013-10-28 14:42:33 +01:00
|
|
|
ret = NF_QUEUE_NR(queue);
|
|
|
|
if (info->flags & NFQ_FLAG_BYPASS)
|
|
|
|
ret |= NF_VERDICT_FLAG_QUEUE_BYPASS;
|
|
|
|
|
|
|
|
return ret;
|
2013-03-23 11:04:03 +01:00
|
|
|
}
|
|
|
|
|
2007-12-05 08:24:03 +01:00
|
|
|
static struct xt_target nfqueue_tg_reg[] __read_mostly = {
|
2006-08-22 09:34:04 +02:00
|
|
|
{
|
|
|
|
.name = "NFQUEUE",
|
2009-06-05 13:18:07 +02:00
|
|
|
.family = NFPROTO_UNSPEC,
|
2007-12-05 08:24:03 +01:00
|
|
|
.target = nfqueue_tg,
|
2006-08-22 09:34:04 +02:00
|
|
|
.targetsize = sizeof(struct xt_NFQ_info),
|
|
|
|
.me = THIS_MODULE,
|
|
|
|
},
|
2009-06-05 13:24:24 +02:00
|
|
|
{
|
|
|
|
.name = "NFQUEUE",
|
|
|
|
.revision = 1,
|
2009-06-05 15:22:15 +02:00
|
|
|
.family = NFPROTO_UNSPEC,
|
2011-01-18 16:08:30 +01:00
|
|
|
.checkentry = nfqueue_tg_check,
|
2009-06-05 15:22:15 +02:00
|
|
|
.target = nfqueue_tg_v1,
|
2009-06-05 13:24:24 +02:00
|
|
|
.targetsize = sizeof(struct xt_NFQ_info_v1),
|
|
|
|
.me = THIS_MODULE,
|
|
|
|
},
|
2011-01-18 16:08:30 +01:00
|
|
|
{
|
|
|
|
.name = "NFQUEUE",
|
|
|
|
.revision = 2,
|
|
|
|
.family = NFPROTO_UNSPEC,
|
|
|
|
.checkentry = nfqueue_tg_check,
|
|
|
|
.target = nfqueue_tg_v2,
|
|
|
|
.targetsize = sizeof(struct xt_NFQ_info_v2),
|
|
|
|
.me = THIS_MODULE,
|
|
|
|
},
|
2013-03-23 11:04:03 +01:00
|
|
|
{
|
|
|
|
.name = "NFQUEUE",
|
|
|
|
.revision = 3,
|
|
|
|
.family = NFPROTO_UNSPEC,
|
|
|
|
.checkentry = nfqueue_tg_check,
|
|
|
|
.target = nfqueue_tg_v3,
|
|
|
|
.targetsize = sizeof(struct xt_NFQ_info_v3),
|
|
|
|
.me = THIS_MODULE,
|
|
|
|
},
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
};
|
|
|
|
|
2007-12-05 08:24:03 +01:00
|
|
|
static int __init nfqueue_tg_init(void)
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
{
|
2007-12-05 08:24:03 +01:00
|
|
|
return xt_register_targets(nfqueue_tg_reg, ARRAY_SIZE(nfqueue_tg_reg));
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
}
|
|
|
|
|
2007-12-05 08:24:03 +01:00
|
|
|
static void __exit nfqueue_tg_exit(void)
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
{
|
2007-12-05 08:24:03 +01:00
|
|
|
xt_unregister_targets(nfqueue_tg_reg, ARRAY_SIZE(nfqueue_tg_reg));
|
[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables
This monster-patch tries to do the best job for unifying the data
structures and backend interfaces for the three evil clones ip_tables,
ip6_tables and arp_tables. In an ideal world we would never have
allowed this kind of copy+paste programming... but well, our world
isn't (yet?) ideal.
o introduce a new x_tables module
o {ip,arp,ip6}_tables depend on this x_tables module
o registration functions for tables, matches and targets are only
wrappers around x_tables provided functions
o all matches/targets that are used from ip_tables and ip6_tables
are now implemented as xt_FOOBAR.c files and provide module aliases
to ipt_FOOBAR and ip6t_FOOBAR
o header files for xt_matches are in include/linux/netfilter/,
include/linux/netfilter_{ipv4,ipv6} contains compatibility wrappers
around the xt_FOOBAR.h headers
Based on this patchset we're going to further unify the code,
gradually getting rid of all the layer 3 specific assumptions.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12 22:30:04 +01:00
|
|
|
}
|
|
|
|
|
2007-12-05 08:24:03 +01:00
|
|
|
module_init(nfqueue_tg_init);
|
|
|
|
module_exit(nfqueue_tg_exit);
|