This source file includes following definitions.
- ipt_get_target
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #ifndef _UAPI_IPTABLES_H
17 #define _UAPI_IPTABLES_H
18
19 #include <linux/types.h>
20 #include <linux/compiler.h>
21 #include <linux/if.h>
22 #include <linux/netfilter_ipv4.h>
23
24 #include <linux/netfilter/x_tables.h>
25
26 #ifndef __KERNEL__
27 #define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
28 #define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
29 #define ipt_match xt_match
30 #define ipt_target xt_target
31 #define ipt_table xt_table
32 #define ipt_get_revision xt_get_revision
33 #define ipt_entry_match xt_entry_match
34 #define ipt_entry_target xt_entry_target
35 #define ipt_standard_target xt_standard_target
36 #define ipt_error_target xt_error_target
37 #define ipt_counters xt_counters
38 #define IPT_CONTINUE XT_CONTINUE
39 #define IPT_RETURN XT_RETURN
40
41
42 #include <linux/netfilter/xt_tcpudp.h>
43 #define ipt_udp xt_udp
44 #define ipt_tcp xt_tcp
45 #define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
46 #define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
47 #define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
48 #define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
49 #define IPT_TCP_INV_MASK XT_TCP_INV_MASK
50 #define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
51 #define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
52 #define IPT_UDP_INV_MASK XT_UDP_INV_MASK
53
54
55 #define ipt_counters_info xt_counters_info
56
57 #define IPT_STANDARD_TARGET XT_STANDARD_TARGET
58
59 #define IPT_ERROR_TARGET XT_ERROR_TARGET
60
61
62 #define IPT_MATCH_ITERATE(e, fn, args...) \
63 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
64
65
66 #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
67 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
68 #endif
69
70
71 struct ipt_ip {
72
73 struct in_addr src, dst;
74
75 struct in_addr smsk, dmsk;
76 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
77 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
78
79
80 __u16 proto;
81
82
83 __u8 flags;
84
85 __u8 invflags;
86 };
87
88
89 #define IPT_F_FRAG 0x01
90 #define IPT_F_GOTO 0x02
91 #define IPT_F_MASK 0x03
92
93
94 #define IPT_INV_VIA_IN 0x01
95 #define IPT_INV_VIA_OUT 0x02
96 #define IPT_INV_TOS 0x04
97 #define IPT_INV_SRCIP 0x08
98 #define IPT_INV_DSTIP 0x10
99 #define IPT_INV_FRAG 0x20
100 #define IPT_INV_PROTO XT_INV_PROTO
101 #define IPT_INV_MASK 0x7F
102
103
104
105
106 struct ipt_entry {
107 struct ipt_ip ip;
108
109
110 unsigned int nfcache;
111
112
113 __u16 target_offset;
114
115 __u16 next_offset;
116
117
118 unsigned int comefrom;
119
120
121 struct xt_counters counters;
122
123
124 unsigned char elems[0];
125 };
126
127
128
129
130
131
132
133
134 #define IPT_BASE_CTL 64
135
136 #define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
137 #define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
138 #define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
139
140 #define IPT_SO_GET_INFO (IPT_BASE_CTL)
141 #define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
142 #define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
143 #define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
144 #define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
145
146
147 struct ipt_icmp {
148 __u8 type;
149 __u8 code[2];
150 __u8 invflags;
151 };
152
153
154 #define IPT_ICMP_INV 0x01
155
156
157 struct ipt_getinfo {
158
159 char name[XT_TABLE_MAXNAMELEN];
160
161
162
163 unsigned int valid_hooks;
164
165
166 unsigned int hook_entry[NF_INET_NUMHOOKS];
167
168
169 unsigned int underflow[NF_INET_NUMHOOKS];
170
171
172 unsigned int num_entries;
173
174
175 unsigned int size;
176 };
177
178
179 struct ipt_replace {
180
181 char name[XT_TABLE_MAXNAMELEN];
182
183
184
185 unsigned int valid_hooks;
186
187
188 unsigned int num_entries;
189
190
191 unsigned int size;
192
193
194 unsigned int hook_entry[NF_INET_NUMHOOKS];
195
196
197 unsigned int underflow[NF_INET_NUMHOOKS];
198
199
200
201 unsigned int num_counters;
202
203 struct xt_counters __user *counters;
204
205
206 struct ipt_entry entries[0];
207 };
208
209
210 struct ipt_get_entries {
211
212 char name[XT_TABLE_MAXNAMELEN];
213
214
215 unsigned int size;
216
217
218 struct ipt_entry entrytable[0];
219 };
220
221
222 static __inline__ struct xt_entry_target *
223 ipt_get_target(struct ipt_entry *e)
224 {
225 return (void *)e + e->target_offset;
226 }
227
228
229
230
231 #endif