aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netfilter_ipv4/ip_tables.h
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-10-13 10:28:00 -0400
committerJan Engelhardt <jengelh@medozas.de>2010-10-13 12:00:46 -0400
commit243bf6e29eef642de0ff62f1ebf58bc2396d6d6e (patch)
tree79f4eb37b594d320d4750e04ce6e16a7d62177f0 /include/linux/netfilter_ipv4/ip_tables.h
parent87a2e70db62fec7348c6e5545eb7b7650c33d81b (diff)
netfilter: xtables: resolve indirect macros 3/3
Diffstat (limited to 'include/linux/netfilter_ipv4/ip_tables.h')
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h69
1 files changed, 32 insertions, 37 deletions
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index ec506918a9b..ee54b3b7e23 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -38,6 +38,36 @@
38#define ipt_entry_target xt_entry_target 38#define ipt_entry_target xt_entry_target
39#define ipt_standard_target xt_standard_target 39#define ipt_standard_target xt_standard_target
40#define ipt_counters xt_counters 40#define ipt_counters xt_counters
41#define IPT_CONTINUE XT_CONTINUE
42#define IPT_RETURN XT_RETURN
43
44/* This group is older than old (iptables < v1.4.0-rc1~89) */
45#include <linux/netfilter/xt_tcpudp.h>
46#define ipt_udp xt_udp
47#define ipt_tcp xt_tcp
48#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
49#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
50#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
51#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
52#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
53#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
54#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
55#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
56
57/* The argument to IPT_SO_ADD_COUNTERS. */
58#define ipt_counters_info xt_counters_info
59/* Standard return verdict, or do jump. */
60#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
61/* Error verdict. */
62#define IPT_ERROR_TARGET XT_ERROR_TARGET
63
64/* fn returns 0 to continue iteration */
65#define IPT_MATCH_ITERATE(e, fn, args...) \
66 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
67
68/* fn returns 0 to continue iteration */
69#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
70 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
41#endif 71#endif
42 72
43/* Yes, Virginia, you have to zero the padding. */ 73/* Yes, Virginia, you have to zero the padding. */
@@ -116,23 +146,6 @@ struct ipt_entry {
116#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) 146#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
117#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET 147#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
118 148
119#define IPT_CONTINUE XT_CONTINUE
120#define IPT_RETURN XT_RETURN
121
122#include <linux/netfilter/xt_tcpudp.h>
123#define ipt_udp xt_udp
124#define ipt_tcp xt_tcp
125
126#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
127#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
128#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
129#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
130#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
131
132#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
133#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
134#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
135
136/* ICMP matching stuff */ 149/* ICMP matching stuff */
137struct ipt_icmp { 150struct ipt_icmp {
138 u_int8_t type; /* type to match */ 151 u_int8_t type; /* type to match */
@@ -196,9 +209,6 @@ struct ipt_replace {
196 struct ipt_entry entries[0]; 209 struct ipt_entry entries[0];
197}; 210};
198 211
199/* The argument to IPT_SO_ADD_COUNTERS. */
200#define ipt_counters_info xt_counters_info
201
202/* The argument to IPT_SO_GET_ENTRIES. */ 212/* The argument to IPT_SO_GET_ENTRIES. */
203struct ipt_get_entries { 213struct ipt_get_entries {
204 /* Which table: user fills this in. */ 214 /* Which table: user fills this in. */
@@ -211,11 +221,6 @@ struct ipt_get_entries {
211 struct ipt_entry entrytable[0]; 221 struct ipt_entry entrytable[0];
212}; 222};
213 223
214/* Standard return verdict, or do jump. */
215#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
216/* Error verdict. */
217#define IPT_ERROR_TARGET XT_ERROR_TARGET
218
219/* Helper functions */ 224/* Helper functions */
220static __inline__ struct xt_entry_target * 225static __inline__ struct xt_entry_target *
221ipt_get_target(struct ipt_entry *e) 226ipt_get_target(struct ipt_entry *e)
@@ -223,16 +228,6 @@ ipt_get_target(struct ipt_entry *e)
223 return (void *)e + e->target_offset; 228 return (void *)e + e->target_offset;
224} 229}
225 230
226#ifndef __KERNEL__
227/* fn returns 0 to continue iteration */
228#define IPT_MATCH_ITERATE(e, fn, args...) \
229 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
230
231/* fn returns 0 to continue iteration */
232#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
233 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
234#endif
235
236/* 231/*
237 * Main firewall chains definitions and global var's definitions. 232 * Main firewall chains definitions and global var's definitions.
238 */ 233 */
@@ -271,7 +266,7 @@ struct ipt_error {
271#define IPT_STANDARD_INIT(__verdict) \ 266#define IPT_STANDARD_INIT(__verdict) \
272{ \ 267{ \
273 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \ 268 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \
274 .target = XT_TARGET_INIT(IPT_STANDARD_TARGET, \ 269 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
275 sizeof(struct xt_standard_target)), \ 270 sizeof(struct xt_standard_target)), \
276 .target.verdict = -(__verdict) - 1, \ 271 .target.verdict = -(__verdict) - 1, \
277} 272}
@@ -279,7 +274,7 @@ struct ipt_error {
279#define IPT_ERROR_INIT \ 274#define IPT_ERROR_INIT \
280{ \ 275{ \
281 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \ 276 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \
282 .target = XT_TARGET_INIT(IPT_ERROR_TARGET, \ 277 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
283 sizeof(struct ipt_error_target)), \ 278 sizeof(struct ipt_error_target)), \
284 .target.errorname = "ERROR", \ 279 .target.errorname = "ERROR", \
285} 280}