diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2012-01-14 10:26:20 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-03-07 11:40:31 -0500 |
commit | ae8ded1cb88b9c24f3c9552ca9eefd894b069716 (patch) | |
tree | 583d9510f88cb41e971391c9c3b2eedf09dad7d0 | |
parent | c15f1c83251049182b1771da004d14f29683ab97 (diff) |
netfilter: ipset: expose userspace-relevant parts in ip_set.h
iptables's libxt_SET.c depends on these.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | include/linux/netfilter/ipset/ip_set.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h index e7b06f52be84..e921766d3aff 100644 --- a/include/linux/netfilter/ipset/ip_set.h +++ b/include/linux/netfilter/ipset/ip_set.h | |||
@@ -11,6 +11,8 @@ | |||
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/types.h> | ||
15 | |||
14 | /* The protocol version */ | 16 | /* The protocol version */ |
15 | #define IPSET_PROTOCOL 6 | 17 | #define IPSET_PROTOCOL 6 |
16 | 18 | ||
@@ -168,19 +170,10 @@ enum ipset_adt { | |||
168 | IPSET_CADT_MAX, | 170 | IPSET_CADT_MAX, |
169 | }; | 171 | }; |
170 | 172 | ||
171 | #ifdef __KERNEL__ | ||
172 | #include <linux/ip.h> | ||
173 | #include <linux/ipv6.h> | ||
174 | #include <linux/netlink.h> | ||
175 | #include <linux/netfilter.h> | ||
176 | #include <linux/netfilter/x_tables.h> | ||
177 | #include <linux/vmalloc.h> | ||
178 | #include <net/netlink.h> | ||
179 | |||
180 | /* Sets are identified by an index in kernel space. Tweak with ip_set_id_t | 173 | /* Sets are identified by an index in kernel space. Tweak with ip_set_id_t |
181 | * and IPSET_INVALID_ID if you want to increase the max number of sets. | 174 | * and IPSET_INVALID_ID if you want to increase the max number of sets. |
182 | */ | 175 | */ |
183 | typedef u16 ip_set_id_t; | 176 | typedef __u16 ip_set_id_t; |
184 | 177 | ||
185 | #define IPSET_INVALID_ID 65535 | 178 | #define IPSET_INVALID_ID 65535 |
186 | 179 | ||
@@ -203,6 +196,15 @@ enum ip_set_kopt { | |||
203 | IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE), | 196 | IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE), |
204 | }; | 197 | }; |
205 | 198 | ||
199 | #ifdef __KERNEL__ | ||
200 | #include <linux/ip.h> | ||
201 | #include <linux/ipv6.h> | ||
202 | #include <linux/netlink.h> | ||
203 | #include <linux/netfilter.h> | ||
204 | #include <linux/netfilter/x_tables.h> | ||
205 | #include <linux/vmalloc.h> | ||
206 | #include <net/netlink.h> | ||
207 | |||
206 | /* Set features */ | 208 | /* Set features */ |
207 | enum ip_set_feature { | 209 | enum ip_set_feature { |
208 | IPSET_TYPE_IP_FLAG = 0, | 210 | IPSET_TYPE_IP_FLAG = 0, |
@@ -453,6 +455,8 @@ bitmap_bytes(u32 a, u32 b) | |||
453 | return 4 * ((((b - a + 8) / 8) + 3) / 4); | 455 | return 4 * ((((b - a + 8) / 8) + 3) / 4); |
454 | } | 456 | } |
455 | 457 | ||
458 | #endif /* __KERNEL__ */ | ||
459 | |||
456 | /* Interface to iptables/ip6tables */ | 460 | /* Interface to iptables/ip6tables */ |
457 | 461 | ||
458 | #define SO_IP_SET 83 | 462 | #define SO_IP_SET 83 |
@@ -478,6 +482,4 @@ struct ip_set_req_version { | |||
478 | unsigned version; | 482 | unsigned version; |
479 | }; | 483 | }; |
480 | 484 | ||
481 | #endif /* __KERNEL__ */ | ||
482 | |||
483 | #endif /*_IP_SET_H */ | 485 | #endif /*_IP_SET_H */ |