aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-10-13 09:56:56 -0400
committerJan Engelhardt <jengelh@medozas.de>2010-10-13 12:00:36 -0400
commit12b00c2c025b8af697d9a022ea2e928cad889ef1 (patch)
tree9de3f3a1ed8d79052fdd9abe7d72bed594de6140 /include/linux
parenteecc545856c8a0f27783a440d25f4ceaa1f95ce8 (diff)
netfilter: xtables: resolve indirect macros 1/3
Many of the used macros are just there for userspace compatibility. Substitute the in-kernel code to directly use the terminal macro and stuff the defines into #ifndef __KERNEL__ sections. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netfilter_arp/arp_tables.h10
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h10
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h11
3 files changed, 18 insertions, 13 deletions
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index e9948c0560f6..81938600470d 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -21,8 +21,10 @@
21 21
22#include <linux/netfilter/x_tables.h> 22#include <linux/netfilter/x_tables.h>
23 23
24#ifndef __KERNEL__
24#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 25#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
25#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 26#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
27#endif
26 28
27#define ARPT_DEV_ADDR_LEN_MAX 16 29#define ARPT_DEV_ADDR_LEN_MAX 16
28 30
@@ -134,7 +136,7 @@ struct arpt_entry
134/* The argument to ARPT_SO_GET_INFO */ 136/* The argument to ARPT_SO_GET_INFO */
135struct arpt_getinfo { 137struct arpt_getinfo {
136 /* Which table: caller fills this in. */ 138 /* Which table: caller fills this in. */
137 char name[ARPT_TABLE_MAXNAMELEN]; 139 char name[XT_TABLE_MAXNAMELEN];
138 140
139 /* Kernel fills these in. */ 141 /* Kernel fills these in. */
140 /* Which hook entry points are valid: bitmask */ 142 /* Which hook entry points are valid: bitmask */
@@ -156,7 +158,7 @@ struct arpt_getinfo {
156/* The argument to ARPT_SO_SET_REPLACE. */ 158/* The argument to ARPT_SO_SET_REPLACE. */
157struct arpt_replace { 159struct arpt_replace {
158 /* Which table. */ 160 /* Which table. */
159 char name[ARPT_TABLE_MAXNAMELEN]; 161 char name[XT_TABLE_MAXNAMELEN];
160 162
161 /* Which hook entry points are valid: bitmask. You can't 163 /* Which hook entry points are valid: bitmask. You can't
162 change this. */ 164 change this. */
@@ -191,7 +193,7 @@ struct arpt_replace {
191/* The argument to ARPT_SO_GET_ENTRIES. */ 193/* The argument to ARPT_SO_GET_ENTRIES. */
192struct arpt_get_entries { 194struct arpt_get_entries {
193 /* Which table: user fills this in. */ 195 /* Which table: user fills this in. */
194 char name[ARPT_TABLE_MAXNAMELEN]; 196 char name[XT_TABLE_MAXNAMELEN];
195 197
196 /* User fills this in: total entry size. */ 198 /* User fills this in: total entry size. */
197 unsigned int size; 199 unsigned int size;
@@ -230,7 +232,7 @@ struct arpt_standard {
230 232
231struct arpt_error_target { 233struct arpt_error_target {
232 struct arpt_entry_target target; 234 struct arpt_entry_target target;
233 char errorname[ARPT_FUNCTION_MAXNAMELEN]; 235 char errorname[XT_FUNCTION_MAXNAMELEN];
234}; 236};
235 237
236struct arpt_error { 238struct arpt_error {
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 704a7b6e8169..1b7cdf1137e3 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -27,12 +27,14 @@
27 27
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#ifndef __KERNEL__
30#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 32#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32#define ipt_match xt_match 33#define ipt_match xt_match
33#define ipt_target xt_target 34#define ipt_target xt_target
34#define ipt_table xt_table 35#define ipt_table xt_table
35#define ipt_get_revision xt_get_revision 36#define ipt_get_revision xt_get_revision
37#endif
36 38
37/* Yes, Virginia, you have to zero the padding. */ 39/* Yes, Virginia, you have to zero the padding. */
38struct ipt_ip { 40struct ipt_ip {
@@ -146,7 +148,7 @@ struct ipt_icmp {
146/* The argument to IPT_SO_GET_INFO */ 148/* The argument to IPT_SO_GET_INFO */
147struct ipt_getinfo { 149struct ipt_getinfo {
148 /* Which table: caller fills this in. */ 150 /* Which table: caller fills this in. */
149 char name[IPT_TABLE_MAXNAMELEN]; 151 char name[XT_TABLE_MAXNAMELEN];
150 152
151 /* Kernel fills these in. */ 153 /* Kernel fills these in. */
152 /* Which hook entry points are valid: bitmask */ 154 /* Which hook entry points are valid: bitmask */
@@ -168,7 +170,7 @@ struct ipt_getinfo {
168/* The argument to IPT_SO_SET_REPLACE. */ 170/* The argument to IPT_SO_SET_REPLACE. */
169struct ipt_replace { 171struct ipt_replace {
170 /* Which table. */ 172 /* Which table. */
171 char name[IPT_TABLE_MAXNAMELEN]; 173 char name[XT_TABLE_MAXNAMELEN];
172 174
173 /* Which hook entry points are valid: bitmask. You can't 175 /* Which hook entry points are valid: bitmask. You can't
174 change this. */ 176 change this. */
@@ -202,7 +204,7 @@ struct ipt_replace {
202/* The argument to IPT_SO_GET_ENTRIES. */ 204/* The argument to IPT_SO_GET_ENTRIES. */
203struct ipt_get_entries { 205struct ipt_get_entries {
204 /* Which table: user fills this in. */ 206 /* Which table: user fills this in. */
205 char name[IPT_TABLE_MAXNAMELEN]; 207 char name[XT_TABLE_MAXNAMELEN];
206 208
207 /* User fills this in: total entry size. */ 209 /* User fills this in: total entry size. */
208 unsigned int size; 210 unsigned int size;
@@ -254,7 +256,7 @@ struct ipt_standard {
254 256
255struct ipt_error_target { 257struct ipt_error_target {
256 struct ipt_entry_target target; 258 struct ipt_entry_target target;
257 char errorname[IPT_FUNCTION_MAXNAMELEN]; 259 char errorname[XT_FUNCTION_MAXNAMELEN];
258}; 260};
259 261
260struct ipt_error { 262struct ipt_error {
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 18442ff19c07..abe31d020e3c 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -27,13 +27,14 @@
27 27
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#ifndef __KERNEL__
30#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 32#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32
33#define ip6t_match xt_match 33#define ip6t_match xt_match
34#define ip6t_target xt_target 34#define ip6t_target xt_target
35#define ip6t_table xt_table 35#define ip6t_table xt_table
36#define ip6t_get_revision xt_get_revision 36#define ip6t_get_revision xt_get_revision
37#endif
37 38
38/* Yes, Virginia, you have to zero the padding. */ 39/* Yes, Virginia, you have to zero the padding. */
39struct ip6t_ip6 { 40struct ip6t_ip6 {
@@ -117,7 +118,7 @@ struct ip6t_standard {
117 118
118struct ip6t_error_target { 119struct ip6t_error_target {
119 struct ip6t_entry_target target; 120 struct ip6t_entry_target target;
120 char errorname[IP6T_FUNCTION_MAXNAMELEN]; 121 char errorname[XT_FUNCTION_MAXNAMELEN];
121}; 122};
122 123
123struct ip6t_error { 124struct ip6t_error {
@@ -203,7 +204,7 @@ struct ip6t_icmp {
203/* The argument to IP6T_SO_GET_INFO */ 204/* The argument to IP6T_SO_GET_INFO */
204struct ip6t_getinfo { 205struct ip6t_getinfo {
205 /* Which table: caller fills this in. */ 206 /* Which table: caller fills this in. */
206 char name[IP6T_TABLE_MAXNAMELEN]; 207 char name[XT_TABLE_MAXNAMELEN];
207 208
208 /* Kernel fills these in. */ 209 /* Kernel fills these in. */
209 /* Which hook entry points are valid: bitmask */ 210 /* Which hook entry points are valid: bitmask */
@@ -225,7 +226,7 @@ struct ip6t_getinfo {
225/* The argument to IP6T_SO_SET_REPLACE. */ 226/* The argument to IP6T_SO_SET_REPLACE. */
226struct ip6t_replace { 227struct ip6t_replace {
227 /* Which table. */ 228 /* Which table. */
228 char name[IP6T_TABLE_MAXNAMELEN]; 229 char name[XT_TABLE_MAXNAMELEN];
229 230
230 /* Which hook entry points are valid: bitmask. You can't 231 /* Which hook entry points are valid: bitmask. You can't
231 change this. */ 232 change this. */
@@ -259,7 +260,7 @@ struct ip6t_replace {
259/* The argument to IP6T_SO_GET_ENTRIES. */ 260/* The argument to IP6T_SO_GET_ENTRIES. */
260struct ip6t_get_entries { 261struct ip6t_get_entries {
261 /* Which table: user fills this in. */ 262 /* Which table: user fills this in. */
262 char name[IP6T_TABLE_MAXNAMELEN]; 263 char name[XT_TABLE_MAXNAMELEN];
263 264
264 /* User fills this in: total entry size. */ 265 /* User fills this in: total entry size. */
265 unsigned int size; 266 unsigned int size;