コード例 #1
0
static bool test_icmp(void)
{
	struct tuple tuple6;
	struct sk_buff *skb;
	bool success = true;

	if (is_error(init_ipv6_tuple(&tuple6,
			CLIENT_ADDR, CLIENT_PORT,
			SERVER_HAIRPIN_ADDR, SERVER_PORT6,
			L4PROTO_ICMP)))
		return false;
	if (is_error(create_skb6_icmp_info(&tuple6, &skb, 100, 32)))
		return false;
	set_sent_skb(NULL);

	success &= assert_equals_int(NF_DROP, core_6to4(skb), "Request result");
	success &= assert_null(get_sent_skb(), "Sent SKB");

	return success;
}
コード例 #2
0
static bool send(struct sk_buff *skb_in)
{
	return assert_equals_int(NF_STOLEN, core_6to4(skb_in), "Function result");
}
コード例 #3
0
ファイル: nf_hook.c プロジェクト: magg/NAT64
static unsigned int hook_ipv6(HOOK_ARG_TYPE hook, struct sk_buff *skb,
		const struct net_device *in, const struct net_device *out,
		int (*okfn)(struct sk_buff *))
{
	return core_6to4(skb);
}
コード例 #4
0
static NF_CALLBACK(hook_ipv6, skb)
{
	return core_6to4(skb, skb->dev);
}