static unsigned int
xtnu_target_run(struct sk_buff *skb, const struct xt_target_param *par)
#endif
{
#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,
	};
#else
	struct xtnu_target *nt = xtcompat_nutarget(par->target);
#endif

	if (nt != NULL && nt->target != NULL)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
		return nt->target(pskb, &local_par);
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
		return nt->target(&skb, &local_par);
#else
		return nt->target(&skb, par);
#endif
	return XT_CONTINUE;
}
Example #2
0
static unsigned int
xtnu_target_run(struct sk_buff *skb, const struct xt_action_param *par)
{
	struct xtnu_target *nt = xtcompat_nutarget(par->target);

	return nt->target(&skb, par);
}
Example #3
0
static bool xtnu_target_check(const struct xt_tgchk_param *par)
{
	struct xtnu_target *nt = xtcompat_nutarget(par->target);

	if (nt == NULL)
		return false;
	if (nt->checkentry == NULL)
		return true;
	return nt->checkentry(par) == 0 ? true : false;
}
static void xtnu_target_destroy(const struct xt_target *ct, void *targinfo)
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
{
	struct xtnu_target *nt = xtcompat_nutarget(ct);
	struct xt_tgdtor_param local_par = {
		.target   = ct,
		.targinfo = targinfo,
		.family   = NFPROTO_UNSPEC,
	};

	if (nt != NULL && nt->destroy != NULL)
		nt->destroy(&local_par);
}
Example #5
0
static unsigned int
xtnu_target_run(struct sk_buff *skb, const struct xt_target_param *par)
{
	struct xtnu_target *nt = xtcompat_nutarget(par->target);
	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);
}
static bool xtnu_target_check(const char *table, const void *entry,
    const struct xt_target *ct, void *targinfo, unsigned int hook_mask)
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
{
	struct xtnu_target *nt = xtcompat_nutarget(ct);
	struct xt_tgchk_param local_par = {
		.table     = table,
		.entryinfo = entry,
		.target    = ct,
		.targinfo  = targinfo,
		.hook_mask = hook_mask,
		.family    = NFPROTO_UNSPEC,
	};

	if (nt == NULL)
		return false;
	if (nt->checkentry == NULL)
		/* this is valid, just like if there was no function */
		return true;
	return nt->checkentry(&local_par);
}
Example #7
0
static unsigned int xtnu_target_run(struct sk_buff *skb,
    const struct net_device *in, const struct net_device *out,
    unsigned int hooknum, const struct xt_target *ct, const void *targinfo)
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
{
	struct xtnu_target *nt = xtcompat_nutarget(ct);
	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)
		return nt->target(pskb, &local_par);
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
		return nt->target(&skb, &local_par);
#endif
	return XT_CONTINUE;
}