2005-04-16 16:20:36 -06:00
|
|
|
/*
|
|
|
|
* Implements a dummy match to allow attaching comments to rules
|
|
|
|
*
|
|
|
|
* 2003-05-13 Brad Fisher (brad@info-link.net)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/skbuff.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 14:30:04 -07:00
|
|
|
#include <linux/netfilter/x_tables.h>
|
|
|
|
#include <linux/netfilter/xt_comment.h>
|
2005-04-16 16:20:36 -06:00
|
|
|
|
|
|
|
MODULE_AUTHOR("Brad Fisher <brad@info-link.net>");
|
|
|
|
MODULE_DESCRIPTION("iptables comment match module");
|
|
|
|
MODULE_LICENSE("GPL");
|
[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 14:30:04 -07:00
|
|
|
MODULE_ALIAS("ipt_comment");
|
|
|
|
MODULE_ALIAS("ip6t_comment");
|
2005-04-16 16:20:36 -06:00
|
|
|
|
|
|
|
static int
|
|
|
|
match(const struct sk_buff *skb,
|
|
|
|
const struct net_device *in,
|
|
|
|
const struct net_device *out,
|
2006-03-20 19:02:56 -07:00
|
|
|
const struct xt_match *match,
|
2005-04-16 16:20:36 -06:00
|
|
|
const void *matchinfo,
|
|
|
|
int offset,
|
[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 14:30:04 -07:00
|
|
|
unsigned int protooff,
|
2007-07-07 23:15:12 -06:00
|
|
|
bool *hotdrop)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
|
|
|
/* We always match */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2006-08-22 01:34:04 -06:00
|
|
|
static struct xt_match xt_comment_match[] = {
|
|
|
|
{
|
|
|
|
.name = "comment",
|
|
|
|
.family = AF_INET,
|
|
|
|
.match = match,
|
|
|
|
.matchsize = sizeof(struct xt_comment_info),
|
|
|
|
.me = THIS_MODULE
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "comment",
|
|
|
|
.family = AF_INET6,
|
|
|
|
.match = match,
|
|
|
|
.matchsize = sizeof(struct xt_comment_info),
|
|
|
|
.me = THIS_MODULE
|
|
|
|
},
|
2005-04-16 16:20:36 -06:00
|
|
|
};
|
|
|
|
|
2006-03-28 17:37:06 -07:00
|
|
|
static int __init xt_comment_init(void)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
2006-08-22 01:34:04 -06:00
|
|
|
return xt_register_matches(xt_comment_match,
|
|
|
|
ARRAY_SIZE(xt_comment_match));
|
2005-04-16 16:20:36 -06:00
|
|
|
}
|
|
|
|
|
2006-03-28 17:37:06 -07:00
|
|
|
static void __exit xt_comment_fini(void)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
2006-08-22 01:34:04 -06:00
|
|
|
xt_unregister_matches(xt_comment_match, ARRAY_SIZE(xt_comment_match));
|
2005-04-16 16:20:36 -06:00
|
|
|
}
|
|
|
|
|
2006-03-28 17:37:06 -07:00
|
|
|
module_init(xt_comment_init);
|
|
|
|
module_exit(xt_comment_fini);
|