ip_set.h revision 82d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0f
1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_IP_SET_H
20#define _UAPI_IP_SET_H
21#include <linux/types.h>
22#define IPSET_PROTOCOL 6
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define IPSET_MAX_COMMENT_SIZE 255
25#define IPSET_MAXNAMELEN 32
26enum ipset_cmd {
27 IPSET_CMD_NONE,
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 IPSET_CMD_PROTOCOL,
30 IPSET_CMD_CREATE,
31 IPSET_CMD_DESTROY,
32 IPSET_CMD_FLUSH,
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 IPSET_CMD_RENAME,
35 IPSET_CMD_SWAP,
36 IPSET_CMD_LIST,
37 IPSET_CMD_SAVE,
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 IPSET_CMD_ADD,
40 IPSET_CMD_DEL,
41 IPSET_CMD_TEST,
42 IPSET_CMD_HEADER,
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 IPSET_CMD_TYPE,
45 IPSET_MSG_MAX,
46 IPSET_CMD_RESTORE = IPSET_MSG_MAX,
47 IPSET_CMD_HELP,
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 IPSET_CMD_VERSION,
50 IPSET_CMD_QUIT,
51 IPSET_CMD_MAX,
52 IPSET_CMD_COMMIT = IPSET_CMD_MAX,
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54};
55enum {
56 IPSET_ATTR_UNSPEC,
57 IPSET_ATTR_PROTOCOL,
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 IPSET_ATTR_SETNAME,
60 IPSET_ATTR_TYPENAME,
61 IPSET_ATTR_SETNAME2 = IPSET_ATTR_TYPENAME,
62 IPSET_ATTR_REVISION,
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 IPSET_ATTR_FAMILY,
65 IPSET_ATTR_FLAGS,
66 IPSET_ATTR_DATA,
67 IPSET_ATTR_ADT,
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 IPSET_ATTR_LINENO,
70 IPSET_ATTR_PROTOCOL_MIN,
71 IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN,
72 __IPSET_ATTR_CMD_MAX,
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74};
75#define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)
76enum {
77 IPSET_ATTR_IP = IPSET_ATTR_UNSPEC + 1,
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 IPSET_ATTR_IP_FROM = IPSET_ATTR_IP,
80 IPSET_ATTR_IP_TO,
81 IPSET_ATTR_CIDR,
82 IPSET_ATTR_PORT,
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 IPSET_ATTR_PORT_FROM = IPSET_ATTR_PORT,
85 IPSET_ATTR_PORT_TO,
86 IPSET_ATTR_TIMEOUT,
87 IPSET_ATTR_PROTO,
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 IPSET_ATTR_CADT_FLAGS,
90 IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO,
91 IPSET_ATTR_MARK,
92 IPSET_ATTR_MARKMASK,
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 IPSET_ATTR_CADT_MAX = 16,
95 IPSET_ATTR_GC,
96 IPSET_ATTR_HASHSIZE,
97 IPSET_ATTR_MAXELEM,
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 IPSET_ATTR_NETMASK,
100 IPSET_ATTR_PROBES,
101 IPSET_ATTR_RESIZE,
102 IPSET_ATTR_SIZE,
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 IPSET_ATTR_ELEMENTS,
105 IPSET_ATTR_REFERENCES,
106 IPSET_ATTR_MEMSIZE,
107 __IPSET_ATTR_CREATE_MAX,
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109};
110#define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1)
111enum {
112 IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + 1,
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 IPSET_ATTR_NAME,
115 IPSET_ATTR_NAMEREF,
116 IPSET_ATTR_IP2,
117 IPSET_ATTR_CIDR2,
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 IPSET_ATTR_IP2_TO,
120 IPSET_ATTR_IFACE,
121 IPSET_ATTR_BYTES,
122 IPSET_ATTR_PACKETS,
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 IPSET_ATTR_COMMENT,
125 IPSET_ATTR_SKBMARK,
126 IPSET_ATTR_SKBPRIO,
127 IPSET_ATTR_SKBQUEUE,
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 __IPSET_ATTR_ADT_MAX,
130};
131#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
132enum {
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 IPSET_ATTR_IPADDR_IPV4 = IPSET_ATTR_UNSPEC + 1,
135 IPSET_ATTR_IPADDR_IPV6,
136 __IPSET_ATTR_IPADDR_MAX,
137};
138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139#define IPSET_ATTR_IPADDR_MAX (__IPSET_ATTR_IPADDR_MAX - 1)
140enum ipset_errno {
141 IPSET_ERR_PRIVATE = 4096,
142 IPSET_ERR_PROTOCOL,
143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 IPSET_ERR_FIND_TYPE,
145 IPSET_ERR_MAX_SETS,
146 IPSET_ERR_BUSY,
147 IPSET_ERR_EXIST_SETNAME2,
148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 IPSET_ERR_TYPE_MISMATCH,
150 IPSET_ERR_EXIST,
151 IPSET_ERR_INVALID_CIDR,
152 IPSET_ERR_INVALID_NETMASK,
153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154 IPSET_ERR_INVALID_FAMILY,
155 IPSET_ERR_TIMEOUT,
156 IPSET_ERR_REFERENCED,
157 IPSET_ERR_IPADDR_IPV4,
158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 IPSET_ERR_IPADDR_IPV6,
160 IPSET_ERR_COUNTER,
161 IPSET_ERR_COMMENT,
162 IPSET_ERR_INVALID_MARKMASK,
163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 IPSET_ERR_SKBINFO,
165 IPSET_ERR_TYPE_SPECIFIC = 4352,
166};
167enum ipset_cmd_flags {
168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169 IPSET_FLAG_BIT_EXIST = 0,
170 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
171 IPSET_FLAG_BIT_LIST_SETNAME = 1,
172 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174 IPSET_FLAG_BIT_LIST_HEADER = 2,
175 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
176 IPSET_FLAG_BIT_SKIP_COUNTER_UPDATE = 3,
177 IPSET_FLAG_SKIP_COUNTER_UPDATE =
178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179 (1 << IPSET_FLAG_BIT_SKIP_COUNTER_UPDATE),
180 IPSET_FLAG_BIT_SKIP_SUBCOUNTER_UPDATE = 4,
181 IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE =
182 (1 << IPSET_FLAG_BIT_SKIP_SUBCOUNTER_UPDATE),
183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184 IPSET_FLAG_BIT_MATCH_COUNTERS = 5,
185 IPSET_FLAG_MATCH_COUNTERS = (1 << IPSET_FLAG_BIT_MATCH_COUNTERS),
186 IPSET_FLAG_BIT_RETURN_NOMATCH = 7,
187 IPSET_FLAG_RETURN_NOMATCH = (1 << IPSET_FLAG_BIT_RETURN_NOMATCH),
188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189 IPSET_FLAG_BIT_MAP_SKBMARK = 8,
190 IPSET_FLAG_MAP_SKBMARK = (1 << IPSET_FLAG_BIT_MAP_SKBMARK),
191 IPSET_FLAG_BIT_MAP_SKBPRIO = 9,
192 IPSET_FLAG_MAP_SKBPRIO = (1 << IPSET_FLAG_BIT_MAP_SKBPRIO),
193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194 IPSET_FLAG_BIT_MAP_SKBQUEUE = 10,
195 IPSET_FLAG_MAP_SKBQUEUE = (1 << IPSET_FLAG_BIT_MAP_SKBQUEUE),
196 IPSET_FLAG_CMD_MAX = 15,
197};
198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199enum ipset_cadt_flags {
200 IPSET_FLAG_BIT_BEFORE = 0,
201 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
202 IPSET_FLAG_BIT_PHYSDEV = 1,
203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
205 IPSET_FLAG_BIT_NOMATCH = 2,
206 IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
207 IPSET_FLAG_BIT_WITH_COUNTERS = 3,
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209 IPSET_FLAG_WITH_COUNTERS = (1 << IPSET_FLAG_BIT_WITH_COUNTERS),
210 IPSET_FLAG_BIT_WITH_COMMENT = 4,
211 IPSET_FLAG_WITH_COMMENT = (1 << IPSET_FLAG_BIT_WITH_COMMENT),
212 IPSET_FLAG_BIT_WITH_FORCEADD = 5,
213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214 IPSET_FLAG_WITH_FORCEADD = (1 << IPSET_FLAG_BIT_WITH_FORCEADD),
215 IPSET_FLAG_BIT_WITH_SKBINFO = 6,
216 IPSET_FLAG_WITH_SKBINFO = (1 << IPSET_FLAG_BIT_WITH_SKBINFO),
217 IPSET_FLAG_CADT_MAX = 15,
218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219};
220enum ipset_create_flags {
221 IPSET_CREATE_FLAG_BIT_FORCEADD = 0,
222 IPSET_CREATE_FLAG_FORCEADD = (1 << IPSET_CREATE_FLAG_BIT_FORCEADD),
223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224 IPSET_CREATE_FLAG_BIT_MAX = 7,
225};
226enum ipset_adt {
227 IPSET_ADD,
228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 IPSET_DEL,
230 IPSET_TEST,
231 IPSET_ADT_MAX,
232 IPSET_CREATE = IPSET_ADT_MAX,
233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 IPSET_CADT_MAX,
235};
236typedef __u16 ip_set_id_t;
237#define IPSET_INVALID_ID 65535
238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239enum ip_set_dim {
240 IPSET_DIM_ZERO = 0,
241 IPSET_DIM_ONE,
242 IPSET_DIM_TWO,
243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 IPSET_DIM_THREE,
245 IPSET_DIM_MAX = 6,
246 IPSET_BIT_RETURN_NOMATCH = 7,
247};
248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249enum ip_set_kopt {
250 IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
251 IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
252 IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
255 IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
256};
257enum {
258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259 IPSET_COUNTER_NONE = 0,
260 IPSET_COUNTER_EQ,
261 IPSET_COUNTER_NE,
262 IPSET_COUNTER_LT,
263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264 IPSET_COUNTER_GT,
265};
266struct ip_set_counter_match {
267 __u8 op;
268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269 __u64 value;
270};
271#define SO_IP_SET 83
272union ip_set_name_index {
273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274 char name[IPSET_MAXNAMELEN];
275 ip_set_id_t index;
276};
277#define IP_SET_OP_GET_BYNAME 0x00000006
278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279struct ip_set_req_get_set {
280 unsigned int op;
281 unsigned int version;
282 union ip_set_name_index set;
283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284};
285#define IP_SET_OP_GET_BYINDEX 0x00000007
286#define IP_SET_OP_GET_FNAME 0x00000008
287struct ip_set_req_get_set_family {
288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289 unsigned int op;
290 unsigned int version;
291 unsigned int family;
292 union ip_set_name_index set;
293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294};
295#define IP_SET_OP_VERSION 0x00000100
296struct ip_set_req_version {
297 unsigned int op;
298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299 unsigned int version;
300};
301#endif
302