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
26 enum 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 };
55 enum {
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)
76 enum {
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_CADT_MAX = 16,
92  IPSET_ATTR_GC,
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94  IPSET_ATTR_HASHSIZE,
95  IPSET_ATTR_MAXELEM,
96  IPSET_ATTR_NETMASK,
97  IPSET_ATTR_PROBES,
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99  IPSET_ATTR_RESIZE,
100  IPSET_ATTR_SIZE,
101  IPSET_ATTR_ELEMENTS,
102  IPSET_ATTR_REFERENCES,
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104  IPSET_ATTR_MEMSIZE,
105  __IPSET_ATTR_CREATE_MAX,
106 };
107 #define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1)
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 enum {
110  IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + 1,
111  IPSET_ATTR_NAME,
112  IPSET_ATTR_NAMEREF,
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114  IPSET_ATTR_IP2,
115  IPSET_ATTR_CIDR2,
116  IPSET_ATTR_IP2_TO,
117  IPSET_ATTR_IFACE,
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119  IPSET_ATTR_BYTES,
120  IPSET_ATTR_PACKETS,
121  IPSET_ATTR_COMMENT,
122  __IPSET_ATTR_ADT_MAX,
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 };
125 #define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
126 enum {
127  IPSET_ATTR_IPADDR_IPV4 = IPSET_ATTR_UNSPEC + 1,
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129  IPSET_ATTR_IPADDR_IPV6,
130  __IPSET_ATTR_IPADDR_MAX,
131 };
132 #define IPSET_ATTR_IPADDR_MAX (__IPSET_ATTR_IPADDR_MAX - 1)
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 enum ipset_errno {
135  IPSET_ERR_PRIVATE = 4096,
136  IPSET_ERR_PROTOCOL,
137  IPSET_ERR_FIND_TYPE,
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139  IPSET_ERR_MAX_SETS,
140  IPSET_ERR_BUSY,
141  IPSET_ERR_EXIST_SETNAME2,
142  IPSET_ERR_TYPE_MISMATCH,
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144  IPSET_ERR_EXIST,
145  IPSET_ERR_INVALID_CIDR,
146  IPSET_ERR_INVALID_NETMASK,
147  IPSET_ERR_INVALID_FAMILY,
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149  IPSET_ERR_TIMEOUT,
150  IPSET_ERR_REFERENCED,
151  IPSET_ERR_IPADDR_IPV4,
152  IPSET_ERR_IPADDR_IPV6,
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  IPSET_ERR_COUNTER,
155  IPSET_ERR_COMMENT,
156  IPSET_ERR_TYPE_SPECIFIC = 4352,
157 };
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 enum ipset_cmd_flags {
160  IPSET_FLAG_BIT_EXIST = 0,
161  IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
162  IPSET_FLAG_BIT_LIST_SETNAME = 1,
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164  IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
165  IPSET_FLAG_BIT_LIST_HEADER = 2,
166  IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
167  IPSET_FLAG_BIT_SKIP_COUNTER_UPDATE = 3,
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169  IPSET_FLAG_SKIP_COUNTER_UPDATE =
170  (1 << IPSET_FLAG_BIT_SKIP_COUNTER_UPDATE),
171  IPSET_FLAG_BIT_SKIP_SUBCOUNTER_UPDATE = 4,
172  IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE =
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174  (1 << IPSET_FLAG_BIT_SKIP_SUBCOUNTER_UPDATE),
175  IPSET_FLAG_BIT_MATCH_COUNTERS = 5,
176  IPSET_FLAG_MATCH_COUNTERS = (1 << IPSET_FLAG_BIT_MATCH_COUNTERS),
177  IPSET_FLAG_BIT_RETURN_NOMATCH = 7,
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179  IPSET_FLAG_RETURN_NOMATCH = (1 << IPSET_FLAG_BIT_RETURN_NOMATCH),
180  IPSET_FLAG_CMD_MAX = 15,
181 };
182 enum ipset_cadt_flags {
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  IPSET_FLAG_BIT_BEFORE = 0,
185  IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
186  IPSET_FLAG_BIT_PHYSDEV = 1,
187  IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189  IPSET_FLAG_BIT_NOMATCH = 2,
190  IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
191  IPSET_FLAG_BIT_WITH_COUNTERS = 3,
192  IPSET_FLAG_WITH_COUNTERS = (1 << IPSET_FLAG_BIT_WITH_COUNTERS),
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194  IPSET_FLAG_BIT_WITH_COMMENT = 4,
195  IPSET_FLAG_WITH_COMMENT = (1 << IPSET_FLAG_BIT_WITH_COMMENT),
196  IPSET_FLAG_CADT_MAX = 15,
197 };
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 enum ipset_adt {
200  IPSET_ADD,
201  IPSET_DEL,
202  IPSET_TEST,
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204  IPSET_ADT_MAX,
205  IPSET_CREATE = IPSET_ADT_MAX,
206  IPSET_CADT_MAX,
207 };
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209 typedef __u16 ip_set_id_t;
210 #define IPSET_INVALID_ID 65535
211 enum ip_set_dim {
212  IPSET_DIM_ZERO = 0,
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214  IPSET_DIM_ONE,
215  IPSET_DIM_TWO,
216  IPSET_DIM_THREE,
217  IPSET_DIM_MAX = 6,
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219  IPSET_BIT_RETURN_NOMATCH = 7,
220 };
221 enum ip_set_kopt {
222  IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224  IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
225  IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
226  IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
227  IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 };
230 enum {
231  IPSET_COUNTER_NONE = 0,
232  IPSET_COUNTER_EQ,
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234  IPSET_COUNTER_NE,
235  IPSET_COUNTER_LT,
236  IPSET_COUNTER_GT,
237 };
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 struct ip_set_counter_match {
240  __u8 op;
241  __u64 value;
242 };
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 #define SO_IP_SET 83
245 union ip_set_name_index {
246  char name[IPSET_MAXNAMELEN];
247  ip_set_id_t index;
248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249 };
250 #define IP_SET_OP_GET_BYNAME 0x00000006
251 struct ip_set_req_get_set {
252  unsigned int op;
253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254  unsigned int version;
255  union ip_set_name_index set;
256 };
257 #define IP_SET_OP_GET_BYINDEX 0x00000007
258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259 #define IP_SET_OP_GET_FNAME 0x00000008
260 struct ip_set_req_get_set_family {
261  unsigned int op;
262  unsigned int version;
263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264  unsigned int family;
265  union ip_set_name_index set;
266 };
267 #define IP_SET_OP_VERSION 0x00000100
268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269 struct ip_set_req_version {
270  unsigned int op;
271  unsigned int version;
272 };
273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274 #endif
275