This source file includes following definitions.
- arpt_get_target
1
2
3
4
5
6
7
8
9
10 #ifndef _UAPI_ARPTABLES_H
11 #define _UAPI_ARPTABLES_H
12
13 #include <linux/types.h>
14 #include <linux/compiler.h>
15 #include <linux/if.h>
16 #include <linux/netfilter_arp.h>
17
18 #include <linux/netfilter/x_tables.h>
19
20 #ifndef __KERNEL__
21 #define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
22 #define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
23 #define arpt_entry_target xt_entry_target
24 #define arpt_standard_target xt_standard_target
25 #define arpt_error_target xt_error_target
26 #define ARPT_CONTINUE XT_CONTINUE
27 #define ARPT_RETURN XT_RETURN
28 #define arpt_counters_info xt_counters_info
29 #define arpt_counters xt_counters
30 #define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
31 #define ARPT_ERROR_TARGET XT_ERROR_TARGET
32 #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
33 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
34 #endif
35
36 #define ARPT_DEV_ADDR_LEN_MAX 16
37
38 struct arpt_devaddr_info {
39 char addr[ARPT_DEV_ADDR_LEN_MAX];
40 char mask[ARPT_DEV_ADDR_LEN_MAX];
41 };
42
43
44 struct arpt_arp {
45
46 struct in_addr src, tgt;
47
48 struct in_addr smsk, tmsk;
49
50
51 __u8 arhln, arhln_mask;
52 struct arpt_devaddr_info src_devaddr;
53 struct arpt_devaddr_info tgt_devaddr;
54
55
56 __be16 arpop, arpop_mask;
57
58
59 __be16 arhrd, arhrd_mask;
60 __be16 arpro, arpro_mask;
61
62
63
64
65
66 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
67 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
68
69
70 __u8 flags;
71
72 __u16 invflags;
73 };
74
75
76
77
78 #define ARPT_F_MASK 0x00
79
80
81 #define ARPT_INV_VIA_IN 0x0001
82 #define ARPT_INV_VIA_OUT 0x0002
83 #define ARPT_INV_SRCIP 0x0004
84 #define ARPT_INV_TGTIP 0x0008
85 #define ARPT_INV_SRCDEVADDR 0x0010
86 #define ARPT_INV_TGTDEVADDR 0x0020
87 #define ARPT_INV_ARPOP 0x0040
88 #define ARPT_INV_ARPHRD 0x0080
89 #define ARPT_INV_ARPPRO 0x0100
90 #define ARPT_INV_ARPHLN 0x0200
91 #define ARPT_INV_MASK 0x03FF
92
93
94
95
96 struct arpt_entry
97 {
98 struct arpt_arp arp;
99
100
101 __u16 target_offset;
102
103 __u16 next_offset;
104
105
106 unsigned int comefrom;
107
108
109 struct xt_counters counters;
110
111
112 unsigned char elems[0];
113 };
114
115
116
117
118
119
120
121
122 #define ARPT_BASE_CTL 96
123
124 #define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
125 #define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
126 #define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
127
128 #define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
129 #define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
130
131 #define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
132 #define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
133
134
135 struct arpt_getinfo {
136
137 char name[XT_TABLE_MAXNAMELEN];
138
139
140
141 unsigned int valid_hooks;
142
143
144 unsigned int hook_entry[NF_ARP_NUMHOOKS];
145
146
147 unsigned int underflow[NF_ARP_NUMHOOKS];
148
149
150 unsigned int num_entries;
151
152
153 unsigned int size;
154 };
155
156
157 struct arpt_replace {
158
159 char name[XT_TABLE_MAXNAMELEN];
160
161
162
163 unsigned int valid_hooks;
164
165
166 unsigned int num_entries;
167
168
169 unsigned int size;
170
171
172 unsigned int hook_entry[NF_ARP_NUMHOOKS];
173
174
175 unsigned int underflow[NF_ARP_NUMHOOKS];
176
177
178
179 unsigned int num_counters;
180
181 struct xt_counters __user *counters;
182
183
184 struct arpt_entry entries[0];
185 };
186
187
188 struct arpt_get_entries {
189
190 char name[XT_TABLE_MAXNAMELEN];
191
192
193 unsigned int size;
194
195
196 struct arpt_entry entrytable[0];
197 };
198
199
200 static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
201 {
202 return (void *)e + e->target_offset;
203 }
204
205
206
207
208 #endif