12 #include <linux/module.h>
13 #include <linux/types.h>
14 #include <linux/kernel.h>
15 #include <linux/string.h>
18 #include <linux/ipv6.h>
23 struct tcf_ematch *
em)
28 if (data_len !=
sizeof(*
set))
35 em->datalen =
sizeof(*set);
44 static void em_ipset_destroy(
struct tcf_proto *
p,
struct tcf_ematch *em)
46 const struct xt_set_info *
set = (
const void *) em->data;
49 kfree((
void *) em->data);
53 static int em_ipset_match(
struct sk_buff *
skb,
struct tcf_ematch *em,
58 const struct xt_set_info *
set = (
const void *) em->data;
60 int ret, network_offset;
65 if (!pskb_network_may_pull(skb,
sizeof(
struct iphdr)))
67 acpar.thoff = ip_hdrlen(skb);
71 if (!pskb_network_may_pull(skb,
sizeof(
struct ipv6hdr)))
74 acpar.thoff =
sizeof(
struct ipv6hdr);
82 opt.family = acpar.family;
84 opt.flags =
set->flags;
88 network_offset = skb_network_offset(skb);
98 acpar.in = indev ? indev :
dev;
109 static struct tcf_ematch_ops em_ipset_ops = {
111 .change = em_ipset_change,
112 .destroy = em_ipset_destroy,
113 .match = em_ipset_match,
118 static int __init init_em_ipset(
void)
123 static void __exit exit_em_ipset(
void)