mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-20 11:34:57 +02:00
Update for Linux 2.6.28
This commit is contained in:
@@ -26,103 +26,29 @@
|
||||
#include <linux/netfilter/x_tables.h>
|
||||
#endif
|
||||
#include "ipt_set.h"
|
||||
#include "../compat_xtables.h"
|
||||
|
||||
static unsigned int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
target(struct sk_buff **pskb,
|
||||
unsigned int hooknum,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const void *targinfo,
|
||||
void *userinfo)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
target(struct sk_buff **pskb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
unsigned int hooknum,
|
||||
const void *targinfo,
|
||||
void *userinfo)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
target(struct sk_buff **pskb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
unsigned int hooknum,
|
||||
const struct xt_target *target,
|
||||
const void *targinfo,
|
||||
void *userinfo)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
|
||||
target(struct sk_buff **pskb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
unsigned int hooknum,
|
||||
const struct xt_target *target,
|
||||
const void *targinfo)
|
||||
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) */
|
||||
target(struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
unsigned int hooknum,
|
||||
const struct xt_target *target,
|
||||
const void *targinfo)
|
||||
#endif
|
||||
target(struct sk_buff **pskb, const struct xt_target_param *par)
|
||||
{
|
||||
const struct ipt_set_info_target *info = targinfo;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
|
||||
struct sk_buff *skb = *pskb;
|
||||
#endif
|
||||
const struct ipt_set_info_target *info = par->targinfo;
|
||||
|
||||
|
||||
if (info->add_set.index != IP_SET_INVALID_ID)
|
||||
ip_set_addip_kernel(info->add_set.index,
|
||||
skb,
|
||||
*pskb,
|
||||
info->add_set.flags);
|
||||
if (info->del_set.index != IP_SET_INVALID_ID)
|
||||
ip_set_delip_kernel(info->del_set.index,
|
||||
skb,
|
||||
*pskb,
|
||||
info->del_set.flags);
|
||||
|
||||
return XT_CONTINUE;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const struct ipt_entry *e,
|
||||
void *targinfo,
|
||||
unsigned int targinfosize,
|
||||
unsigned int hook_mask)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const void *e,
|
||||
void *targinfo,
|
||||
unsigned int targinfosize,
|
||||
unsigned int hook_mask)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const void *e,
|
||||
const struct xt_target *target,
|
||||
void *targinfo,
|
||||
unsigned int targinfosize,
|
||||
unsigned int hook_mask)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const void *e,
|
||||
const struct xt_target *target,
|
||||
void *targinfo,
|
||||
unsigned int hook_mask)
|
||||
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) */
|
||||
static bool
|
||||
checkentry(const char *tablename,
|
||||
const void *e,
|
||||
const struct xt_target *target,
|
||||
void *targinfo,
|
||||
unsigned int hook_mask)
|
||||
#endif
|
||||
checkentry(const struct xt_tgchk_param *par)
|
||||
{
|
||||
struct ipt_set_info_target *info = targinfo;
|
||||
struct ipt_set_info_target *info = par->targinfo;
|
||||
ip_set_id_t index;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
@@ -158,19 +84,9 @@ checkentry(const char *tablename,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
static void destroy(void *targetinfo,
|
||||
unsigned int targetsize)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
static void destroy(const struct xt_target *target,
|
||||
void *targetinfo,
|
||||
unsigned int targetsize)
|
||||
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) */
|
||||
static void destroy(const struct xt_target *target,
|
||||
void *targetinfo)
|
||||
#endif
|
||||
static void destroy(const struct xt_tgdtor_param *par)
|
||||
{
|
||||
struct ipt_set_info_target *info = targetinfo;
|
||||
struct ipt_set_info_target *info = par->targinfo;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
if (targetsize != IPT_ALIGN(sizeof(struct ipt_set_info_target))) {
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#endif
|
||||
#include "ip_set.h"
|
||||
#include "ipt_set.h"
|
||||
#include "../compat_xtables.h"
|
||||
|
||||
static inline int
|
||||
match_set(const struct ipt_set_info *info,
|
||||
@@ -36,101 +37,20 @@ match_set(const struct ipt_set_info *info,
|
||||
return inv;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
static int
|
||||
match(const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const void *matchinfo,
|
||||
int offset,
|
||||
const void *hdr,
|
||||
u_int16_t datalen,
|
||||
int *hotdrop)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
|
||||
static int
|
||||
match(const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const void *matchinfo,
|
||||
int offset,
|
||||
int *hotdrop)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
static int
|
||||
match(const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
const struct net_device *out,
|
||||
const void *matchinfo,
|
||||
int offset,
|
||||
unsigned int protoff,
|
||||
int *hotdrop)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
|
||||
static int
|
||||
match(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,
|
||||
int *hotdrop)
|
||||
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) */
|
||||
static bool
|
||||
match(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)
|
||||
#endif
|
||||
match(const struct sk_buff *skb, const struct xt_match_param *par)
|
||||
{
|
||||
const struct ipt_set_info_match *info = matchinfo;
|
||||
const struct ipt_set_info_match *info = par->matchinfo;
|
||||
|
||||
return match_set(&info->match_set,
|
||||
skb,
|
||||
info->match_set.flags[0] & IPSET_MATCH_INV);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const struct ipt_ip *ip,
|
||||
void *matchinfo,
|
||||
unsigned int matchsize,
|
||||
unsigned int hook_mask)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const void *inf,
|
||||
void *matchinfo,
|
||||
unsigned int matchsize,
|
||||
unsigned int hook_mask)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const void *inf,
|
||||
const struct xt_match *match,
|
||||
void *matchinfo,
|
||||
unsigned int matchsize,
|
||||
unsigned int hook_mask)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
|
||||
static int
|
||||
checkentry(const char *tablename,
|
||||
const void *inf,
|
||||
const struct xt_match *match,
|
||||
void *matchinfo,
|
||||
unsigned int hook_mask)
|
||||
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) */
|
||||
static bool
|
||||
checkentry(const char *tablename,
|
||||
const void *inf,
|
||||
const struct xt_match *match,
|
||||
void *matchinfo,
|
||||
unsigned int hook_mask)
|
||||
#endif
|
||||
checkentry(const struct xt_mtchk_param *par)
|
||||
{
|
||||
struct ipt_set_info_match *info = matchinfo;
|
||||
struct ipt_set_info_match *info = par->matchinfo;
|
||||
ip_set_id_t index;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
@@ -155,19 +75,9 @@ checkentry(const char *tablename,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
static void destroy(void *matchinfo,
|
||||
unsigned int matchsize)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
static void destroy(const struct xt_match *match,
|
||||
void *matchinfo,
|
||||
unsigned int matchsize)
|
||||
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) */
|
||||
static void destroy(const struct xt_match *match,
|
||||
void *matchinfo)
|
||||
#endif
|
||||
static void destroy(const struct xt_mtdtor_param *par)
|
||||
{
|
||||
struct ipt_set_info_match *info = matchinfo;
|
||||
struct ipt_set_info_match *info = par->matchinfo;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
|
||||
if (matchsize != IPT_ALIGN(sizeof(struct ipt_set_info_match))) {
|
||||
|
Reference in New Issue
Block a user