aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-10-09 04:48:59 -0400
committerDavid Howells <dhowells@redhat.com>2012-10-09 04:48:59 -0400
commit17c075923da59c217155d0758ee0715641ebc152 (patch)
tree25c7c5c9a38e4be68ea7d3d8859bb55474199143 /include/linux
parent55c5cd3cc179eb87faa9cc2d9741047dd1642aaf (diff)
UAPI: (Scripted) Disintegrate include/linux/netfilter_ipv4
Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Michael Kerrisk <mtk.manpages@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netfilter_ipv4/Kbuild10
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h218
-rw-r--r--include/linux/netfilter_ipv4/ipt_CLUSTERIP.h36
-rw-r--r--include/linux/netfilter_ipv4/ipt_ECN.h33
-rw-r--r--include/linux/netfilter_ipv4/ipt_LOG.h21
-rw-r--r--include/linux/netfilter_ipv4/ipt_REJECT.h20
-rw-r--r--include/linux/netfilter_ipv4/ipt_TTL.h23
-rw-r--r--include/linux/netfilter_ipv4/ipt_ULOG.h49
-rw-r--r--include/linux/netfilter_ipv4/ipt_ah.h17
-rw-r--r--include/linux/netfilter_ipv4/ipt_ecn.h15
-rw-r--r--include/linux/netfilter_ipv4/ipt_ttl.h23
11 files changed, 2 insertions, 463 deletions
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index 8ba0c5b72ea9..e69de29bb2d1 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -1,10 +0,0 @@
1header-y += ip_tables.h
2header-y += ipt_CLUSTERIP.h
3header-y += ipt_ECN.h
4header-y += ipt_LOG.h
5header-y += ipt_REJECT.h
6header-y += ipt_TTL.h
7header-y += ipt_ULOG.h
8header-y += ipt_ah.h
9header-y += ipt_ecn.h
10header-y += ipt_ttl.h
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index db79231914ce..901e84db847d 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -11,230 +11,17 @@
11 * flags are stored in host byte order (of course). 11 * flags are stored in host byte order (of course).
12 * Port numbers are stored in HOST byte order. 12 * Port numbers are stored in HOST byte order.
13 */ 13 */
14
15#ifndef _IPTABLES_H 14#ifndef _IPTABLES_H
16#define _IPTABLES_H 15#define _IPTABLES_H
17 16
18#ifdef __KERNEL__
19#include <linux/if.h> 17#include <linux/if.h>
20#include <linux/in.h> 18#include <linux/in.h>
21#include <linux/ip.h> 19#include <linux/ip.h>
22#include <linux/skbuff.h> 20#include <linux/skbuff.h>
23#endif
24#include <linux/types.h>
25#include <linux/compiler.h>
26#include <linux/netfilter_ipv4.h>
27
28#include <linux/netfilter/x_tables.h>
29
30#ifndef __KERNEL__
31#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
32#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
33#define ipt_match xt_match
34#define ipt_target xt_target
35#define ipt_table xt_table
36#define ipt_get_revision xt_get_revision
37#define ipt_entry_match xt_entry_match
38#define ipt_entry_target xt_entry_target
39#define ipt_standard_target xt_standard_target
40#define ipt_error_target xt_error_target
41#define ipt_counters xt_counters
42#define IPT_CONTINUE XT_CONTINUE
43#define IPT_RETURN XT_RETURN
44
45/* This group is older than old (iptables < v1.4.0-rc1~89) */
46#include <linux/netfilter/xt_tcpudp.h>
47#define ipt_udp xt_udp
48#define ipt_tcp xt_tcp
49#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
50#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
51#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
52#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
53#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
54#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
55#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
56#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
57
58/* The argument to IPT_SO_ADD_COUNTERS. */
59#define ipt_counters_info xt_counters_info
60/* Standard return verdict, or do jump. */
61#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
62/* Error verdict. */
63#define IPT_ERROR_TARGET XT_ERROR_TARGET
64
65/* fn returns 0 to continue iteration */
66#define IPT_MATCH_ITERATE(e, fn, args...) \
67 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
68
69/* fn returns 0 to continue iteration */
70#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
71 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
72#endif
73
74/* Yes, Virginia, you have to zero the padding. */
75struct ipt_ip {
76 /* Source and destination IP addr */
77 struct in_addr src, dst;
78 /* Mask for src and dest IP addr */
79 struct in_addr smsk, dmsk;
80 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
81 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
82
83 /* Protocol, 0 = ANY */
84 __u16 proto;
85
86 /* Flags word */
87 __u8 flags;
88 /* Inverse flags */
89 __u8 invflags;
90};
91
92/* Values for "flag" field in struct ipt_ip (general ip structure). */
93#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */
94#define IPT_F_GOTO 0x02 /* Set if jump is a goto */
95#define IPT_F_MASK 0x03 /* All possible flag bits mask. */
96
97/* Values for "inv" field in struct ipt_ip. */
98#define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
99#define IPT_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
100#define IPT_INV_TOS 0x04 /* Invert the sense of TOS. */
101#define IPT_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
102#define IPT_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
103#define IPT_INV_FRAG 0x20 /* Invert the sense of FRAG. */
104#define IPT_INV_PROTO XT_INV_PROTO
105#define IPT_INV_MASK 0x7F /* All possible flag bits mask. */
106
107/* This structure defines each of the firewall rules. Consists of 3
108 parts which are 1) general IP header stuff 2) match specific
109 stuff 3) the target to perform if the rule matches */
110struct ipt_entry {
111 struct ipt_ip ip;
112
113 /* Mark with fields that we care about. */
114 unsigned int nfcache;
115
116 /* Size of ipt_entry + matches */
117 __u16 target_offset;
118 /* Size of ipt_entry + matches + target */
119 __u16 next_offset;
120
121 /* Back pointer */
122 unsigned int comefrom;
123
124 /* Packet and byte counters. */
125 struct xt_counters counters;
126
127 /* The matches (if any), then the target. */
128 unsigned char elems[0];
129};
130
131/*
132 * New IP firewall options for [gs]etsockopt at the RAW IP level.
133 * Unlike BSD Linux inherits IP options so you don't have to use a raw
134 * socket for this. Instead we check rights in the calls.
135 *
136 * ATTENTION: check linux/in.h before adding new number here.
137 */
138#define IPT_BASE_CTL 64
139
140#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
141#define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
142#define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
143
144#define IPT_SO_GET_INFO (IPT_BASE_CTL)
145#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
146#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
147#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
148#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
149
150/* ICMP matching stuff */
151struct ipt_icmp {
152 __u8 type; /* type to match */
153 __u8 code[2]; /* range of code */
154 __u8 invflags; /* Inverse flags */
155};
156
157/* Values for "inv" field for struct ipt_icmp. */
158#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */
159
160/* The argument to IPT_SO_GET_INFO */
161struct ipt_getinfo {
162 /* Which table: caller fills this in. */
163 char name[XT_TABLE_MAXNAMELEN];
164
165 /* Kernel fills these in. */
166 /* Which hook entry points are valid: bitmask */
167 unsigned int valid_hooks;
168
169 /* Hook entry points: one per netfilter hook. */
170 unsigned int hook_entry[NF_INET_NUMHOOKS];
171
172 /* Underflow points. */
173 unsigned int underflow[NF_INET_NUMHOOKS];
174
175 /* Number of entries */
176 unsigned int num_entries;
177
178 /* Size of entries. */
179 unsigned int size;
180};
181
182/* The argument to IPT_SO_SET_REPLACE. */
183struct ipt_replace {
184 /* Which table. */
185 char name[XT_TABLE_MAXNAMELEN];
186
187 /* Which hook entry points are valid: bitmask. You can't
188 change this. */
189 unsigned int valid_hooks;
190
191 /* Number of entries */
192 unsigned int num_entries;
193
194 /* Total size of new entries */
195 unsigned int size;
196
197 /* Hook entry points. */
198 unsigned int hook_entry[NF_INET_NUMHOOKS];
199
200 /* Underflow points. */
201 unsigned int underflow[NF_INET_NUMHOOKS];
202
203 /* Information about old entries: */
204 /* Number of counters (must be equal to current number of entries). */
205 unsigned int num_counters;
206 /* The old entries' counters. */
207 struct xt_counters __user *counters;
208
209 /* The entries (hang off end: not really an array). */
210 struct ipt_entry entries[0];
211};
212
213/* The argument to IPT_SO_GET_ENTRIES. */
214struct ipt_get_entries {
215 /* Which table: user fills this in. */
216 char name[XT_TABLE_MAXNAMELEN];
217
218 /* User fills this in: total entry size. */
219 unsigned int size;
220
221 /* The entries. */
222 struct ipt_entry entrytable[0];
223};
224
225/* Helper functions */
226static __inline__ struct xt_entry_target *
227ipt_get_target(struct ipt_entry *e)
228{
229 return (void *)e + e->target_offset;
230}
231
232/*
233 * Main firewall chains definitions and global var's definitions.
234 */
235#ifdef __KERNEL__
236 21
237#include <linux/init.h> 22#include <linux/init.h>
23#include <uapi/linux/netfilter_ipv4/ip_tables.h>
24
238extern void ipt_init(void) __init; 25extern void ipt_init(void) __init;
239 26
240extern struct xt_table *ipt_register_table(struct net *net, 27extern struct xt_table *ipt_register_table(struct net *net,
@@ -303,5 +90,4 @@ compat_ipt_get_target(struct compat_ipt_entry *e)
303} 90}
304 91
305#endif /* CONFIG_COMPAT */ 92#endif /* CONFIG_COMPAT */
306#endif /*__KERNEL__*/
307#endif /* _IPTABLES_H */ 93#endif /* _IPTABLES_H */
diff --git a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
deleted file mode 100644
index c6a204c97047..000000000000
--- a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef _IPT_CLUSTERIP_H_target
2#define _IPT_CLUSTERIP_H_target
3
4#include <linux/types.h>
5
6enum clusterip_hashmode {
7 CLUSTERIP_HASHMODE_SIP = 0,
8 CLUSTERIP_HASHMODE_SIP_SPT,
9 CLUSTERIP_HASHMODE_SIP_SPT_DPT,
10};
11
12#define CLUSTERIP_HASHMODE_MAX CLUSTERIP_HASHMODE_SIP_SPT_DPT
13
14#define CLUSTERIP_MAX_NODES 16
15
16#define CLUSTERIP_FLAG_NEW 0x00000001
17
18struct clusterip_config;
19
20struct ipt_clusterip_tgt_info {
21
22 __u32 flags;
23
24 /* only relevant for new ones */
25 __u8 clustermac[6];
26 __u16 num_total_nodes;
27 __u16 num_local_nodes;
28 __u16 local_nodes[CLUSTERIP_MAX_NODES];
29 __u32 hash_mode;
30 __u32 hash_initval;
31
32 /* Used internally by the kernel */
33 struct clusterip_config *config;
34};
35
36#endif /*_IPT_CLUSTERIP_H_target*/
diff --git a/include/linux/netfilter_ipv4/ipt_ECN.h b/include/linux/netfilter_ipv4/ipt_ECN.h
deleted file mode 100644
index bb88d5315a4d..000000000000
--- a/include/linux/netfilter_ipv4/ipt_ECN.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/* Header file for iptables ipt_ECN target
2 *
3 * (C) 2002 by Harald Welte <laforge@gnumonks.org>
4 *
5 * This software is distributed under GNU GPL v2, 1991
6 *
7 * ipt_ECN.h,v 1.3 2002/05/29 12:17:40 laforge Exp
8*/
9#ifndef _IPT_ECN_TARGET_H
10#define _IPT_ECN_TARGET_H
11
12#include <linux/types.h>
13#include <linux/netfilter/xt_DSCP.h>
14
15#define IPT_ECN_IP_MASK (~XT_DSCP_MASK)
16
17#define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */
18#define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */
19#define IPT_ECN_OP_SET_CWR 0x20 /* set CWR bit of TCP header */
20
21#define IPT_ECN_OP_MASK 0xce
22
23struct ipt_ECN_info {
24 __u8 operation; /* bitset of operations */
25 __u8 ip_ect; /* ECT codepoint of IPv4 header, pre-shifted */
26 union {
27 struct {
28 __u8 ece:1, cwr:1; /* TCP ECT bits */
29 } tcp;
30 } proto;
31};
32
33#endif /* _IPT_ECN_TARGET_H */
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h
deleted file mode 100644
index 5d8152077d71..000000000000
--- a/include/linux/netfilter_ipv4/ipt_LOG.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef _IPT_LOG_H
2#define _IPT_LOG_H
3
4#warning "Please update iptables, this file will be removed soon!"
5
6/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
7#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
8#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
9#define IPT_LOG_IPOPT 0x04 /* Log IP options */
10#define IPT_LOG_UID 0x08 /* Log UID owning local socket */
11#define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */
12#define IPT_LOG_MACDECODE 0x20 /* Decode MAC header */
13#define IPT_LOG_MASK 0x2f
14
15struct ipt_log_info {
16 unsigned char level;
17 unsigned char logflags;
18 char prefix[30];
19};
20
21#endif /*_IPT_LOG_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_REJECT.h b/include/linux/netfilter_ipv4/ipt_REJECT.h
deleted file mode 100644
index 4293a1ad1b01..000000000000
--- a/include/linux/netfilter_ipv4/ipt_REJECT.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _IPT_REJECT_H
2#define _IPT_REJECT_H
3
4enum ipt_reject_with {
5 IPT_ICMP_NET_UNREACHABLE,
6 IPT_ICMP_HOST_UNREACHABLE,
7 IPT_ICMP_PROT_UNREACHABLE,
8 IPT_ICMP_PORT_UNREACHABLE,
9 IPT_ICMP_ECHOREPLY,
10 IPT_ICMP_NET_PROHIBITED,
11 IPT_ICMP_HOST_PROHIBITED,
12 IPT_TCP_RESET,
13 IPT_ICMP_ADMIN_PROHIBITED
14};
15
16struct ipt_reject_info {
17 enum ipt_reject_with with; /* reject type */
18};
19
20#endif /*_IPT_REJECT_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_TTL.h b/include/linux/netfilter_ipv4/ipt_TTL.h
deleted file mode 100644
index f6ac169d92f9..000000000000
--- a/include/linux/netfilter_ipv4/ipt_TTL.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/* TTL modification module for IP tables
2 * (C) 2000 by Harald Welte <laforge@netfilter.org> */
3
4#ifndef _IPT_TTL_H
5#define _IPT_TTL_H
6
7#include <linux/types.h>
8
9enum {
10 IPT_TTL_SET = 0,
11 IPT_TTL_INC,
12 IPT_TTL_DEC
13};
14
15#define IPT_TTL_MAXMODE IPT_TTL_DEC
16
17struct ipt_TTL_info {
18 __u8 mode;
19 __u8 ttl;
20};
21
22
23#endif
diff --git a/include/linux/netfilter_ipv4/ipt_ULOG.h b/include/linux/netfilter_ipv4/ipt_ULOG.h
deleted file mode 100644
index 417aad280bcc..000000000000
--- a/include/linux/netfilter_ipv4/ipt_ULOG.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/* Header file for IP tables userspace logging, Version 1.8
2 *
3 * (C) 2000-2002 by Harald Welte <laforge@gnumonks.org>
4 *
5 * Distributed under the terms of GNU GPL */
6
7#ifndef _IPT_ULOG_H
8#define _IPT_ULOG_H
9
10#ifndef NETLINK_NFLOG
11#define NETLINK_NFLOG 5
12#endif
13
14#define ULOG_DEFAULT_NLGROUP 1
15#define ULOG_DEFAULT_QTHRESHOLD 1
16
17#define ULOG_MAC_LEN 80
18#define ULOG_PREFIX_LEN 32
19
20#define ULOG_MAX_QLEN 50
21/* Why 50? Well... there is a limit imposed by the slab cache 131000
22 * bytes. So the multipart netlink-message has to be < 131000 bytes.
23 * Assuming a standard ethernet-mtu of 1500, we could define this up
24 * to 80... but even 50 seems to be big enough. */
25
26/* private data structure for each rule with a ULOG target */
27struct ipt_ulog_info {
28 unsigned int nl_group;
29 size_t copy_range;
30 size_t qthreshold;
31 char prefix[ULOG_PREFIX_LEN];
32};
33
34/* Format of the ULOG packets passed through netlink */
35typedef struct ulog_packet_msg {
36 unsigned long mark;
37 long timestamp_sec;
38 long timestamp_usec;
39 unsigned int hook;
40 char indev_name[IFNAMSIZ];
41 char outdev_name[IFNAMSIZ];
42 size_t data_len;
43 char prefix[ULOG_PREFIX_LEN];
44 unsigned char mac_len;
45 unsigned char mac[ULOG_MAC_LEN];
46 unsigned char payload[0];
47} ulog_packet_msg_t;
48
49#endif /*_IPT_ULOG_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_ah.h b/include/linux/netfilter_ipv4/ipt_ah.h
deleted file mode 100644
index 4e02bb0119e3..000000000000
--- a/include/linux/netfilter_ipv4/ipt_ah.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _IPT_AH_H
2#define _IPT_AH_H
3
4#include <linux/types.h>
5
6struct ipt_ah {
7 __u32 spis[2]; /* Security Parameter Index */
8 __u8 invflags; /* Inverse flags */
9};
10
11
12
13/* Values for "invflags" field in struct ipt_ah. */
14#define IPT_AH_INV_SPI 0x01 /* Invert the sense of spi. */
15#define IPT_AH_INV_MASK 0x01 /* All possible flags. */
16
17#endif /*_IPT_AH_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_ecn.h b/include/linux/netfilter_ipv4/ipt_ecn.h
deleted file mode 100644
index 0e0c063dbf60..000000000000
--- a/include/linux/netfilter_ipv4/ipt_ecn.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef _IPT_ECN_H
2#define _IPT_ECN_H
3
4#include <linux/netfilter/xt_ecn.h>
5#define ipt_ecn_info xt_ecn_info
6
7enum {
8 IPT_ECN_IP_MASK = XT_ECN_IP_MASK,
9 IPT_ECN_OP_MATCH_IP = XT_ECN_OP_MATCH_IP,
10 IPT_ECN_OP_MATCH_ECE = XT_ECN_OP_MATCH_ECE,
11 IPT_ECN_OP_MATCH_CWR = XT_ECN_OP_MATCH_CWR,
12 IPT_ECN_OP_MATCH_MASK = XT_ECN_OP_MATCH_MASK,
13};
14
15#endif /* IPT_ECN_H */
diff --git a/include/linux/netfilter_ipv4/ipt_ttl.h b/include/linux/netfilter_ipv4/ipt_ttl.h
deleted file mode 100644
index 37bee4442486..000000000000
--- a/include/linux/netfilter_ipv4/ipt_ttl.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/* IP tables module for matching the value of the TTL
2 * (C) 2000 by Harald Welte <laforge@gnumonks.org> */
3
4#ifndef _IPT_TTL_H
5#define _IPT_TTL_H
6
7#include <linux/types.h>
8
9enum {
10 IPT_TTL_EQ = 0, /* equals */
11 IPT_TTL_NE, /* not equals */
12 IPT_TTL_LT, /* less than */
13 IPT_TTL_GT, /* greater than */
14};
15
16
17struct ipt_ttl_info {
18 __u8 mode;
19 __u8 ttl;
20};
21
22
23#endif