2019-05-19 12:08:20 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2010-03-18 01:22:32 +00:00
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
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>
|
2010-06-09 12:47:40 +00:00
|
|
|
#include <net/sctp/sctp.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");
|
2008-01-15 07:42:28 +00:00
|
|
|
MODULE_DESCRIPTION("Xtables: SCTP protocol packet match");
|
[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
|
|
|
MODULE_ALIAS("ipt_sctp");
|
2007-10-11 21:36:40 +00:00
|
|
|
MODULE_ALIAS("ip6t_sctp");
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#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)];
|
2017-06-30 03:52:13 +00:00
|
|
|
const struct sctp_chunkhdr *sch;
|
|
|
|
struct sctp_chunkhdr _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
|
|
|
|
2010-03-18 01:22:32 +00:00
|
|
|
#ifdef DEBUG
|
2005-04-16 22:20:36 +00:00
|
|
|
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) {
|
2010-03-18 01:22:32 +00:00
|
|
|
pr_debug("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
|
|
|
}
|
2010-03-18 01:22:32 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
pr_debug("Chunk num: %d\toffset: %d\ttype: %d\tlength: %d"
|
|
|
|
"\tflags: %x\n",
|
|
|
|
++i, offset, sch->type, htons(sch->length),
|
|
|
|
sch->flags);
|
|
|
|
#endif
|
2016-09-21 11:45:55 +00:00
|
|
|
offset += SCTP_PAD4(ntohs(sch->length));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2010-03-18 01:22:32 +00:00
|
|
|
pr_debug("skb->len: %d\toffset: %d\n", skb->len, offset);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
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:
|
2009-02-09 22:34:56 +00:00
|
|
|
return SCTP_CHUNKMAP_IS_CLEAR(chunkmapcopy);
|
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
|
2009-07-07 18:42:08 +00:00
|
|
|
sctp_mt(const struct sk_buff *skb, struct xt_action_param *par)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2008-10-08 09:35:18 +00:00
|
|
|
const struct xt_sctp_info *info = par->matchinfo;
|
2017-06-30 03:52:12 +00:00
|
|
|
const struct sctphdr *sh;
|
|
|
|
struct sctphdr _sh;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-10-08 09:35:18 +00:00
|
|
|
if (par->fragoff != 0) {
|
2010-03-18 01:22:32 +00:00
|
|
|
pr_debug("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
|
|
|
|
2008-10-08 09:35:18 +00:00
|
|
|
sh = skb_header_pointer(skb, par->thoff, sizeof(_sh), &_sh);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (sh == NULL) {
|
2010-03-18 01:22:32 +00:00
|
|
|
pr_debug("Dropping evil TCP offset=0 tinygram.\n");
|
2009-07-07 18:54:30 +00:00
|
|
|
par->hotdrop = true;
|
2007-07-08 05:15:35 +00:00
|
|
|
return false;
|
2007-02-12 19:15:49 +00:00
|
|
|
}
|
2010-03-18 01:22:32 +00:00
|
|
|
pr_debug("spt: %d\tdpt: %d\n", ntohs(sh->source), ntohs(sh->dest));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-07-08 05:19:08 +00:00
|
|
|
return SCCHECK(ntohs(sh->source) >= info->spts[0]
|
|
|
|
&& ntohs(sh->source) <= info->spts[1],
|
2017-06-30 03:52:12 +00:00
|
|
|
XT_SCTP_SRC_PORTS, info->flags, info->invflags) &&
|
|
|
|
SCCHECK(ntohs(sh->dest) >= info->dpts[0]
|
2007-07-08 05:19:08 +00:00
|
|
|
&& ntohs(sh->dest) <= info->dpts[1],
|
2017-06-30 03:52:12 +00:00
|
|
|
XT_SCTP_DEST_PORTS, info->flags, info->invflags) &&
|
|
|
|
SCCHECK(match_packet(skb, par->thoff + sizeof(_sh),
|
|
|
|
info, &par->hotdrop),
|
|
|
|
XT_SCTP_CHUNK_TYPES, info->flags, info->invflags);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2010-03-19 16:16:42 +00:00
|
|
|
static int sctp_mt_check(const struct xt_mtchk_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 21:30:04 +00:00
|
|
|
{
|
2008-10-08 09:35:18 +00:00
|
|
|
const struct xt_sctp_info *info = par->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
|
|
|
|
2010-03-23 16:40:13 +00:00
|
|
|
if (info->flags & ~XT_SCTP_VALID_FLAGS)
|
2010-03-23 15:35:56 +00:00
|
|
|
return -EINVAL;
|
2010-03-23 16:40:13 +00:00
|
|
|
if (info->invflags & ~XT_SCTP_VALID_FLAGS)
|
2010-03-23 15:35:56 +00:00
|
|
|
return -EINVAL;
|
2010-03-23 16:40:13 +00:00
|
|
|
if (info->invflags & ~info->flags)
|
2010-03-23 15:35:56 +00:00
|
|
|
return -EINVAL;
|
2010-03-23 16:40:13 +00:00
|
|
|
if (!(info->flags & XT_SCTP_CHUNK_TYPES))
|
2010-03-23 15:35:56 +00:00
|
|
|
return 0;
|
2010-03-23 16:40:13 +00:00
|
|
|
if (info->chunk_match_type & (SCTP_CHUNK_MATCH_ALL |
|
|
|
|
SCTP_CHUNK_MATCH_ANY | SCTP_CHUNK_MATCH_ONLY))
|
2010-03-23 15:35:56 +00:00
|
|
|
return 0;
|
|
|
|
return -EINVAL;
|
[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 struct xt_match sctp_mt_reg[] __read_mostly = {
|
2006-08-22 07:34:04 +00:00
|
|
|
{
|
|
|
|
.name = "sctp",
|
2008-10-08 09:35:01 +00:00
|
|
|
.family = NFPROTO_IPV4,
|
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",
|
2008-10-08 09:35:01 +00:00
|
|
|
.family = NFPROTO_IPV6,
|
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);
|