2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/skbuff.h>
|
|
|
|
#include <net/ip.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 21:30:04 +00:00
|
|
|
#include <net/ipv6.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/sctp.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 21:30:04 +00:00
|
|
|
#include <linux/netfilter/x_tables.h>
|
|
|
|
#include <linux/netfilter/xt_sctp.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/netfilter_ipv4/ip_tables.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 21:30:04 +00:00
|
|
|
#include <linux/netfilter_ipv6/ip6_tables.h>
|
|
|
|
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_AUTHOR("Kiran Kumar Immidi");
|
|
|
|
MODULE_DESCRIPTION("Match for SCTP protocol packets");
|
|
|
|
MODULE_ALIAS("ipt_sctp");
|
2007-10-11 21:36:40 +00:00
|
|
|
MODULE_ALIAS("ip6t_sctp");
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG_SCTP
|
|
|
|
#define duprintf(format, args...) printk(format , ## args)
|
|
|
|
#else
|
|
|
|
#define duprintf(format, args...)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SCCHECK(cond, option, flag, invflag) (!((flag) & (option)) \
|
|
|
|
|| (!!((invflag) & (option)) ^ (cond)))
|
|
|
|
|
2007-07-08 05:15:35 +00:00
|
|
|
static bool
|
[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 21:30:04 +00:00
|
|
|
match_flags(const struct xt_sctp_flag_info *flag_info,
|
2005-04-16 22:20:36 +00:00
|
|
|
const int flag_count,
|
|
|
|
u_int8_t chunktype,
|
|
|
|
u_int8_t chunkflags)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2007-07-08 05:19:08 +00:00
|
|
|
for (i = 0; i < flag_count; i++)
|
|
|
|
if (flag_info[i].chunktype == chunktype)
|
2005-04-16 22:20:36 +00:00
|
|
|
return (chunkflags & flag_info[i].flag_mask) == flag_info[i].flag;
|
|
|
|
|
2007-07-08 05:15:35 +00:00
|
|
|
return true;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-07-08 05:15:35 +00:00
|
|
|
static inline bool
|
2005-04-16 22:20:36 +00:00
|
|
|
match_packet(const struct sk_buff *skb,
|
[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 21:30:04 +00:00
|
|
|
unsigned int offset,
|
2007-10-18 12:12:21 +00:00
|
|
|
const struct xt_sctp_info *info,
|
2007-07-08 05:15:12 +00:00
|
|
|
bool *hotdrop)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
u_int32_t chunkmapcopy[256 / sizeof (u_int32_t)];
|
|
|
|
sctp_chunkhdr_t _sch, *sch;
|
2007-10-18 12:12:21 +00:00
|
|
|
int chunk_match_type = info->chunk_match_type;
|
|
|
|
const struct xt_sctp_flag_info *flag_info = info->flag_info;
|
|
|
|
int flag_count = info->flag_count;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG_SCTP
|
|
|
|
int i = 0;
|
|
|
|
#endif
|
|
|
|
|
2007-07-08 05:19:08 +00:00
|
|
|
if (chunk_match_type == SCTP_CHUNK_MATCH_ALL)
|
2007-10-18 12:12:21 +00:00
|
|
|
SCTP_CHUNKMAP_COPY(chunkmapcopy, info->chunkmap);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
do {
|
|
|
|
sch = skb_header_pointer(skb, offset, sizeof(_sch), &_sch);
|
2006-06-20 06:39:45 +00:00
|
|
|
if (sch == NULL || sch->length == 0) {
|
2005-04-16 22:20:36 +00:00
|
|
|
duprintf("Dropping invalid SCTP packet.\n");
|
2007-07-08 05:15:12 +00:00
|
|
|
*hotdrop = true;
|
2007-07-08 05:15:35 +00:00
|
|
|
return false;
|
2007-02-12 19:15:49 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-02-12 19:15:49 +00:00
|
|
|
duprintf("Chunk num: %d\toffset: %d\ttype: %d\tlength: %d\tflags: %x\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
++i, offset, sch->type, htons(sch->length), sch->flags);
|
|
|
|
|
2006-11-21 01:26:08 +00:00
|
|
|
offset += (ntohs(sch->length) + 3) & ~3;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
duprintf("skb->len: %d\toffset: %d\n", skb->len, offset);
|
|
|
|
|
2007-10-18 12:12:21 +00:00
|
|
|
if (SCTP_CHUNKMAP_IS_SET(info->chunkmap, sch->type)) {
|
2005-04-16 22:20:36 +00:00
|
|
|
switch (chunk_match_type) {
|
|
|
|
case SCTP_CHUNK_MATCH_ANY:
|
2007-02-12 19:15:49 +00:00
|
|
|
if (match_flags(flag_info, flag_count,
|
2005-04-16 22:20:36 +00:00
|
|
|
sch->type, sch->flags)) {
|
2007-07-08 05:15:35 +00:00
|
|
|
return true;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SCTP_CHUNK_MATCH_ALL:
|
2007-02-12 19:15:49 +00:00
|
|
|
if (match_flags(flag_info, flag_count,
|
2007-07-08 05:19:08 +00:00
|
|
|
sch->type, sch->flags))
|
2005-04-16 22:20:36 +00:00
|
|
|
SCTP_CHUNKMAP_CLEAR(chunkmapcopy, sch->type);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SCTP_CHUNK_MATCH_ONLY:
|
2007-02-12 19:15:49 +00:00
|
|
|
if (!match_flags(flag_info, flag_count,
|
2007-07-08 05:19:08 +00:00
|
|
|
sch->type, sch->flags))
|
2007-07-08 05:15:35 +00:00
|
|
|
return false;
|
2005-04-16 22:20:36 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (chunk_match_type) {
|
|
|
|
case SCTP_CHUNK_MATCH_ONLY:
|
2007-07-08 05:15:35 +00:00
|
|
|
return false;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (offset < skb->len);
|
|
|
|
|
|
|
|
switch (chunk_match_type) {
|
|
|
|
case SCTP_CHUNK_MATCH_ALL:
|
2007-10-18 12:12:21 +00:00
|
|
|
return SCTP_CHUNKMAP_IS_CLEAR(info->chunkmap);
|
2005-04-16 22:20:36 +00:00
|
|
|
case SCTP_CHUNK_MATCH_ANY:
|
2007-07-08 05:15:35 +00:00
|
|
|
return false;
|
2005-04-16 22:20:36 +00:00
|
|
|
case SCTP_CHUNK_MATCH_ONLY:
|
2007-07-08 05:15:35 +00:00
|
|
|
return true;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This will never be reached, but required to stop compiler whine */
|
2007-07-08 05:15:35 +00:00
|
|
|
return false;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-07-08 05:15:35 +00:00
|
|
|
static bool
|
2007-12-05 07:24:03 +00:00
|
|
|
sctp_mt(const struct sk_buff *skb, const struct net_device *in,
|
|
|
|
const struct net_device *out, const struct xt_match *match,
|
|
|
|
const void *matchinfo, int offset, unsigned int protoff, bool *hotdrop)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2006-05-30 01:19:19 +00:00
|
|
|
const struct xt_sctp_info *info = matchinfo;
|
2005-04-16 22:20:36 +00:00
|
|
|
sctp_sctphdr_t _sh, *sh;
|
|
|
|
|
|
|
|
if (offset) {
|
|
|
|
duprintf("Dropping non-first fragment.. FIXME\n");
|
2007-07-08 05:15:35 +00:00
|
|
|
return false;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2007-02-12 19:15:49 +00: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 21:30:04 +00:00
|
|
|
sh = skb_header_pointer(skb, protoff, sizeof(_sh), &_sh);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (sh == NULL) {
|
|
|
|
duprintf("Dropping evil TCP offset=0 tinygram.\n");
|
2007-07-08 05:15:12 +00:00
|
|
|
*hotdrop = true;
|
2007-07-08 05:15:35 +00:00
|
|
|
return false;
|
2007-02-12 19:15:49 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
duprintf("spt: %d\tdpt: %d\n", ntohs(sh->source), ntohs(sh->dest));
|
|
|
|
|
2007-07-08 05:19:08 +00:00
|
|
|
return SCCHECK(ntohs(sh->source) >= info->spts[0]
|
|
|
|
&& ntohs(sh->source) <= info->spts[1],
|
2007-02-12 19:15:49 +00:00
|
|
|
XT_SCTP_SRC_PORTS, info->flags, info->invflags)
|
2007-07-08 05:19:08 +00:00
|
|
|
&& SCCHECK(ntohs(sh->dest) >= info->dpts[0]
|
|
|
|
&& ntohs(sh->dest) <= info->dpts[1],
|
[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 21:30:04 +00:00
|
|
|
XT_SCTP_DEST_PORTS, info->flags, info->invflags)
|
2006-06-27 10:01:25 +00:00
|
|
|
&& SCCHECK(match_packet(skb, protoff + sizeof (sctp_sctphdr_t),
|
2007-10-18 12:12:21 +00:00
|
|
|
info, hotdrop),
|
[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 21:30:04 +00:00
|
|
|
XT_SCTP_CHUNK_TYPES, info->flags, info->invflags);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-07-08 05:16:00 +00:00
|
|
|
static bool
|
2007-12-05 07:24:03 +00:00
|
|
|
sctp_mt_check(const char *tablename, const void *inf,
|
|
|
|
const struct xt_match *match, void *matchinfo,
|
|
|
|
unsigned int hook_mask)
|
[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 21:30:04 +00:00
|
|
|
{
|
2006-03-21 02:01:58 +00:00
|
|
|
const struct xt_sctp_info *info = matchinfo;
|
[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 21:30:04 +00:00
|
|
|
|
2006-03-21 02:01:58 +00:00
|
|
|
return !(info->flags & ~XT_SCTP_VALID_FLAGS)
|
[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 21:30:04 +00:00
|
|
|
&& !(info->invflags & ~XT_SCTP_VALID_FLAGS)
|
|
|
|
&& !(info->invflags & ~info->flags)
|
2007-02-12 19:15:49 +00:00
|
|
|
&& ((!(info->flags & XT_SCTP_CHUNK_TYPES)) ||
|
[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 21:30:04 +00:00
|
|
|
(info->chunk_match_type &
|
2007-02-12 19:15:49 +00:00
|
|
|
(SCTP_CHUNK_MATCH_ALL
|
[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 21:30:04 +00:00
|
|
|
| SCTP_CHUNK_MATCH_ANY
|
|
|
|
| SCTP_CHUNK_MATCH_ONLY)));
|
|
|
|
}
|
|
|
|
|
2007-12-05 07:24:03 +00:00
|
|
|
static struct xt_match sctp_mt_reg[] __read_mostly = {
|
2006-08-22 07:34:04 +00:00
|
|
|
{
|
|
|
|
.name = "sctp",
|
|
|
|
.family = AF_INET,
|
2007-12-05 07:24:03 +00:00
|
|
|
.checkentry = sctp_mt_check,
|
|
|
|
.match = sctp_mt,
|
2006-08-22 07:34:04 +00:00
|
|
|
.matchsize = sizeof(struct xt_sctp_info),
|
|
|
|
.proto = IPPROTO_SCTP,
|
|
|
|
.me = THIS_MODULE
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "sctp",
|
|
|
|
.family = AF_INET6,
|
2007-12-05 07:24:03 +00:00
|
|
|
.checkentry = sctp_mt_check,
|
|
|
|
.match = sctp_mt,
|
2006-08-22 07:34:04 +00:00
|
|
|
.matchsize = sizeof(struct xt_sctp_info),
|
|
|
|
.proto = IPPROTO_SCTP,
|
|
|
|
.me = THIS_MODULE
|
|
|
|
},
|
2006-03-21 02:01:58 +00: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 21:30:04 +00:00
|
|
|
|
2007-12-05 07:24:03 +00:00
|
|
|
static int __init sctp_mt_init(void)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2007-12-05 07:24:03 +00:00
|
|
|
return xt_register_matches(sctp_mt_reg, ARRAY_SIZE(sctp_mt_reg));
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-12-05 07:24:03 +00:00
|
|
|
static void __exit sctp_mt_exit(void)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2007-12-05 07:24:03 +00:00
|
|
|
xt_unregister_matches(sctp_mt_reg, ARRAY_SIZE(sctp_mt_reg));
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-12-05 07:24:03 +00:00
|
|
|
module_init(sctp_mt_init);
|
|
|
|
module_exit(sctp_mt_exit);
|