}
}
-static unsigned int ipt_acc_target(struct sk_buff **pskb, const struct xt_target_param *par)
+static unsigned int ipt_acc_target(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct ipt_acc_info *info =
par->targinfo;
/*
* API compat layer
- * written by Jan Engelhardt <jengelh [at] medozas de>, 2008
+ * written by Jan Engelhardt <jengelh [at] medozas de>, 2008 - 2010
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License, either
{
struct xtnu_match *nm = xtcompat_numatch(cm);
bool lo_drop = false, lo_ret;
- struct xt_match_param local_par = {
- .in = in,
- .out = out,
- .match = cm,
- .matchinfo = matchinfo,
- .fragoff = offset,
- .thoff = protoff,
- .hotdrop = &lo_drop,
- .family = NFPROTO_UNSPEC, /* don't have that info */
- };
+ struct xt_action_param local_par;
+ local_par.in = in;
+ local_par.out = out;
+ local_par.match = cm;
+ local_par.matchinfo = matchinfo;
+ local_par.fragoff = offset;
+ local_par.thoff = protoff;
+ local_par.hotdrop = &lo_drop;
+ local_par.family = NFPROTO_UNSPEC; /* don't have that info */
if (nm == NULL || nm->match == NULL)
return false;
return lo_ret;
}
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
+ LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
+static bool xtnu_match_run(const struct sk_buff *skb,
+ const struct xt_match_param *par)
+{
+ struct xtnu_match *nm = xtcompat_numatch(par->match);
+ struct xt_action_param local_par;
+
+ local_par.in = par->in;
+ local_par.out = par->out;
+ local_par.match = par->match;
+ local_par.matchinfo = par->matchinfo;
+ local_par.fragoff = par->fragoff;
+ local_par.thoff = par->thoff;
+ local_par.hotdrop = par->hotdrop;
+ local_par.family = par->family;
+
+ if (nm == NULL || nm->match == NULL)
+ return false;
+ return nm->match(skb, &local_par);
+}
+#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
static int xtnu_match_check(const char *table, const void *entry,
ct->match = xtnu_match_run;
ct->checkentry = xtnu_match_check;
ct->destroy = xtnu_match_destroy;
+#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
+ ct->match = xtnu_match_run;
+ ct->checkentry = xtnu_match_check;
+ ct->destroy = nt->destroy;
#else
ct->match = nt->match;
ct->checkentry = xtnu_match_check;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
{
struct xtnu_target *nt = xtcompat_nutarget(ct);
- struct xt_target_param local_par = {
- .in = in,
- .out = out,
- .hooknum = hooknum,
- .target = ct,
- .targinfo = targinfo,
- .family = NFPROTO_UNSPEC,
- };
+ struct xt_action_param local_par;
+
+ local_par.in = in;
+ local_par.out = out;
+ local_par.hooknum = hooknum;
+ local_par.target = ct;
+ local_par.targinfo = targinfo;
+ local_par.family = NFPROTO_UNSPEC;
if (nt != NULL && nt->target != NULL)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
xtnu_target_run(struct sk_buff *skb, const struct xt_target_param *par)
{
struct xtnu_target *nt = xtcompat_nutarget(par->target);
- return nt->target(&skb, par);
+ struct xt_action_param local_par;
+
+ local_par.in = par->in;
+ local_par.out = par->out;
+ local_par.hooknum = par->hooknum;
+ local_par.target = par->target;
+ local_par.targinfo = par->targinfo;
+ local_par.family = par->family;
+
+ return nt->target(&skb, &local_par);
}
#endif
NFPROTO_NUMPROTO,
};
-struct xt_match_param {
- const struct net_device *in, *out;
- const struct xt_match *match;
- const void *matchinfo;
- int fragoff;
- unsigned int thoff;
- bool *hotdrop;
- u_int8_t family;
-};
-
struct xt_mtchk_param {
const char *table;
const void *entryinfo;
};
#endif
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
+struct xt_action_param {
+ union {
+ const struct xt_match *match;
+ const struct xt_target *target;
+ };
+ union {
+ const void *matchinfo, *targinfo;
+ };
+ const struct net_device *in, *out;
+ int fragoff;
+ unsigned int thoff, hooknum;
+ u_int8_t family;
+ bool *hotdrop;
+};
+#endif
+
struct xtnu_match {
/*
* Making it smaller by sizeof(void *) on purpose to catch
*/
char name[sizeof(((struct xt_match *)NULL)->name) - 1 - sizeof(void *)];
uint8_t revision;
- bool (*match)(const struct sk_buff *, const struct xt_match_param *);
+ bool (*match)(const struct sk_buff *, const struct xt_action_param *);
int (*checkentry)(const struct xt_mtchk_param *);
void (*destroy)(const struct xt_mtdtor_param *);
struct module *me;
char name[sizeof(((struct xt_target *)NULL)->name) - 1 - sizeof(void *)];
uint8_t revision;
unsigned int (*target)(struct sk_buff **,
- const struct xt_target_param *);
+ const struct xt_action_param *);
int (*checkentry)(const struct xt_tgchk_param *);
void (*destroy)(const struct xt_tgdtor_param *);
struct module *me;
#include "../compat_xtables.h"
static unsigned int
-target(struct sk_buff **pskb, const struct xt_target_param *par)
+target(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct ipt_set_info_target *info = par->targinfo;
}
static bool
-match(const struct sk_buff *skb, const struct xt_match_param *par)
+match(const struct sk_buff *skb, const struct xt_action_param *par)
{
const struct ipt_set_info_match *info = par->matchinfo;
}
static bool pknock_mt(const struct sk_buff *skb,
- const struct xt_match_param *par)
+ const struct xt_action_param *par)
{
const struct xt_pknock_mtinfo *info = par->matchinfo;
struct xt_pknock_rule *rule;
/* CHAOS functions */
static void
-xt_chaos_total(struct sk_buff *skb, const struct xt_target_param *par)
+xt_chaos_total(struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_chaos_tginfo *info = par->targinfo;
const struct iphdr *iph = ip_hdr(skb);
destiny->target(skb, par->in, par->out, par->hooknum, destiny, NULL);
#else
{
- struct xt_target_param local_par = *par;
- local_par.target = destiny;
+ struct xt_target_param local_par = {
+ .in = par->in,
+ .out = par->out,
+ .hooknum = par->hooknum,
+ .target = destiny,
+ .targinfo = par->targinfo,
+ .family = par->family,
+ };
destiny->target(skb, &local_par);
}
#endif
}
static unsigned int
-chaos_tg(struct sk_buff **pskb, const struct xt_target_param *par)
+chaos_tg(struct sk_buff **pskb, const struct xt_action_param *par)
{
/*
* Equivalent to:
}
static unsigned int
-delude_tg(struct sk_buff **pskb, const struct xt_target_param *par)
+delude_tg(struct sk_buff **pskb, const struct xt_action_param *par)
{
/* WARNING: This code causes reentry within iptables.
This means that the iptables jump stack is now crap. We
}
static bool
-dhcpmac_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+dhcpmac_mt(const struct sk_buff *skb, const struct xt_action_param *par)
{
const struct dhcpmac_info *info = par->matchinfo;
const struct dhcp_message *dh;
}
static unsigned int
-dhcpmac_tg(struct sk_buff **pskb, const struct xt_target_param *par)
+dhcpmac_tg(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct dhcpmac_info *info = par->targinfo;
struct dhcp_message dhcpbuf, *dh;
#include "compat_xtables.h"
static unsigned int
-echo_tg4(struct sk_buff **poldskb, const struct xt_target_param *par)
+echo_tg4(struct sk_buff **poldskb, const struct xt_action_param *par)
{
const struct sk_buff *oldskb = *poldskb;
const struct udphdr *oldudp;
MODULE_ALIAS("ip6t_IPMARK");
static unsigned int
-ipmark_tg4(struct sk_buff **pskb, const struct xt_target_param *par)
+ipmark_tg4(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct xt_ipmark_tginfo *ipmarkinfo = par->targinfo;
const struct sk_buff *skb = *pskb;
}
static unsigned int
-ipmark_tg6(struct sk_buff **pskb, const struct xt_target_param *par)
+ipmark_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct xt_ipmark_tginfo *info = par->targinfo;
const struct sk_buff *skb = *pskb;
};
static unsigned int
-logmark_tg(struct sk_buff **pskb, const struct xt_target_param *par)
+logmark_tg(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct sk_buff *skb = *pskb;
const struct xt_logmark_tginfo *info = par->targinfo;
}
static unsigned int
-rawsnat_tg4(struct sk_buff **pskb, const struct xt_target_param *par)
+rawsnat_tg4(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct xt_rawnat_tginfo *info = par->targinfo;
struct iphdr *iph;
}
static unsigned int
-rawdnat_tg4(struct sk_buff **pskb, const struct xt_target_param *par)
+rawdnat_tg4(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct xt_rawnat_tginfo *info = par->targinfo;
struct iphdr *iph;
}
static unsigned int
-rawsnat_tg6(struct sk_buff **pskb, const struct xt_target_param *par)
+rawsnat_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct xt_rawnat_tginfo *info = par->targinfo;
unsigned int l4offset, l4proto;
}
static unsigned int
-rawdnat_tg6(struct sk_buff **pskb, const struct xt_target_param *par)
+rawdnat_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct xt_rawnat_tginfo *info = par->targinfo;
unsigned int l4offset, l4proto;
#include "compat_xtables.h"
static unsigned int
-steal_tg(struct sk_buff **pskb, const struct xt_target_param *par)
+steal_tg(struct sk_buff **pskb, const struct xt_action_param *par)
{
kfree_skb(*pskb);
return NF_STOLEN;
#endif
static unsigned int
-sysrq_tg4(struct sk_buff **pskb, const struct xt_target_param *par)
+sysrq_tg4(struct sk_buff **pskb, const struct xt_action_param *par)
{
struct sk_buff *skb = *pskb;
const struct iphdr *iph;
#ifdef WITH_IPV6
static unsigned int
-sysrq_tg6(struct sk_buff **pskb, const struct xt_target_param *par)
+sysrq_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
{
struct sk_buff *skb = *pskb;
const struct ipv6hdr *iph;
}
static unsigned int
-tarpit_tg(struct sk_buff **pskb, const struct xt_target_param *par)
+tarpit_tg(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct sk_buff *skb = *pskb;
const struct iphdr *iph = ip_hdr(skb);
}
static unsigned int
-tee_tg4(struct sk_buff **pskb, const struct xt_target_param *par)
+tee_tg4(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct xt_tee_tginfo *info = par->targinfo;
struct sk_buff *skb = *pskb;
}
static unsigned int
-tee_tg6(struct sk_buff **pskb, const struct xt_target_param *par)
+tee_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
{
const struct xt_tee_tginfo *info = par->targinfo;
struct sk_buff *skb = *pskb;
}
static bool
-condition_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+condition_mt(const struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_condition_mtinfo *info = par->matchinfo;
const struct condition_variable *var = info->condvar;
}
static bool
-fuzzy_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+fuzzy_mt(const struct sk_buff *skb, const struct xt_action_param *par)
{
struct xt_fuzzy_mtinfo *info = (void *)par->matchinfo;
unsigned long amount;
}
static bool
-xt_geoip_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+xt_geoip_mt(const struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_geoip_match_info *info = par->matchinfo;
const struct geoip_country_kernel *node;
};
static bool xt_iface_mt(const struct sk_buff *skb,
- const struct xt_match_param *par)
+ const struct xt_action_param *par)
{
const struct xt_iface_mtinfo *info = par->matchinfo;
struct net_device *dev;
};
static bool
-ipp2p_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+ipp2p_mt(const struct sk_buff *skb, const struct xt_action_param *par)
{
const struct ipt_p2p_info *info = par->matchinfo;
const unsigned char *haystack;
}
static bool ipv4options_mt(const struct sk_buff *skb,
- const struct xt_match_param *par)
+ const struct xt_action_param *par)
{
const struct xt_ipv4options_mtinfo1 *info = par->matchinfo;
const struct iphdr *iph = ip_hdr(skb);
}
static bool
-length2_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+length2_mt(const struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_length_mtinfo2 *info = par->matchinfo;
const struct iphdr *iph = ip_hdr(skb);
}
static bool
-length2_mt6(const struct sk_buff *skb, const struct xt_match_param *par)
+length2_mt6(const struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_length_mtinfo2 *info = par->matchinfo;
const struct ipv6hdr *iph = ipv6_hdr(skb);
}
static bool
-lscan_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+lscan_mt(const struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_lscan_mtinfo *info = par->matchinfo;
enum ip_conntrack_info ctstate;
}
static bool
-xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
+xt_psd_match(const struct sk_buff *pskb, const struct xt_action_param *match)
{
const struct iphdr *iph;
const struct tcphdr *tcph;
}
static bool
-quota_mt2(const struct sk_buff *skb, const struct xt_match_param *par)
+quota_mt2(const struct sk_buff *skb, const struct xt_action_param *par)
{
struct xt_quota_mtinfo2 *q = (void *)par->matchinfo;
struct xt_quota_counter *e = q->master;