• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 __LINUX_PKT_CLS_H
20 #define __LINUX_PKT_CLS_H
21 #include <linux/types.h>
22 #include <linux/pkt_sched.h>
23 #define TC_COOKIE_MAX_SIZE 16
24 enum {
25   TCA_ACT_UNSPEC,
26   TCA_ACT_KIND,
27   TCA_ACT_OPTIONS,
28   TCA_ACT_INDEX,
29   TCA_ACT_STATS,
30   TCA_ACT_PAD,
31   TCA_ACT_COOKIE,
32   __TCA_ACT_MAX
33 };
34 #define TCA_ACT_MAX __TCA_ACT_MAX
35 #define TCA_OLD_COMPAT (TCA_ACT_MAX + 1)
36 #define TCA_ACT_MAX_PRIO 32
37 #define TCA_ACT_BIND 1
38 #define TCA_ACT_NOBIND 0
39 #define TCA_ACT_UNBIND 1
40 #define TCA_ACT_NOUNBIND 0
41 #define TCA_ACT_REPLACE 1
42 #define TCA_ACT_NOREPLACE 0
43 #define TC_ACT_UNSPEC (- 1)
44 #define TC_ACT_OK 0
45 #define TC_ACT_RECLASSIFY 1
46 #define TC_ACT_SHOT 2
47 #define TC_ACT_PIPE 3
48 #define TC_ACT_STOLEN 4
49 #define TC_ACT_QUEUED 5
50 #define TC_ACT_REPEAT 6
51 #define TC_ACT_REDIRECT 7
52 #define TC_ACT_TRAP 8
53 #define TC_ACT_VALUE_MAX TC_ACT_TRAP
54 #define __TC_ACT_EXT_SHIFT 28
55 #define __TC_ACT_EXT(local) ((local) << __TC_ACT_EXT_SHIFT)
56 #define TC_ACT_EXT_VAL_MASK ((1 << __TC_ACT_EXT_SHIFT) - 1)
57 #define TC_ACT_EXT_OPCODE(combined) ((combined) & (~TC_ACT_EXT_VAL_MASK))
58 #define TC_ACT_EXT_CMP(combined,opcode) (TC_ACT_EXT_OPCODE(combined) == opcode)
59 #define TC_ACT_JUMP __TC_ACT_EXT(1)
60 #define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2)
61 #define TC_ACT_EXT_OPCODE_MAX TC_ACT_GOTO_CHAIN
62 enum {
63   TCA_ID_UNSPEC = 0,
64   TCA_ID_POLICE = 1,
65   __TCA_ID_MAX = 255
66 };
67 #define TCA_ID_MAX __TCA_ID_MAX
68 struct tc_police {
69   __u32 index;
70   int action;
71 #define TC_POLICE_UNSPEC TC_ACT_UNSPEC
72 #define TC_POLICE_OK TC_ACT_OK
73 #define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY
74 #define TC_POLICE_SHOT TC_ACT_SHOT
75 #define TC_POLICE_PIPE TC_ACT_PIPE
76   __u32 limit;
77   __u32 burst;
78   __u32 mtu;
79   struct tc_ratespec rate;
80   struct tc_ratespec peakrate;
81   int refcnt;
82   int bindcnt;
83   __u32 capab;
84 };
85 struct tcf_t {
86   __u64 install;
87   __u64 lastuse;
88   __u64 expires;
89   __u64 firstuse;
90 };
91 struct tc_cnt {
92   int refcnt;
93   int bindcnt;
94 };
95 #define tc_gen __u32 index; __u32 capab; int action; int refcnt; int bindcnt
96 enum {
97   TCA_POLICE_UNSPEC,
98   TCA_POLICE_TBF,
99   TCA_POLICE_RATE,
100   TCA_POLICE_PEAKRATE,
101   TCA_POLICE_AVRATE,
102   TCA_POLICE_RESULT,
103   TCA_POLICE_TM,
104   TCA_POLICE_PAD,
105   __TCA_POLICE_MAX
106 #define TCA_POLICE_RESULT TCA_POLICE_RESULT
107 };
108 #define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
109 #define TCA_CLS_FLAGS_SKIP_HW (1 << 0)
110 #define TCA_CLS_FLAGS_SKIP_SW (1 << 1)
111 #define TCA_CLS_FLAGS_IN_HW (1 << 2)
112 #define TCA_CLS_FLAGS_NOT_IN_HW (1 << 3)
113 #define TCA_CLS_FLAGS_VERBOSE (1 << 4)
114 #define TC_U32_HTID(h) ((h) & 0xFFF00000)
115 #define TC_U32_USERHTID(h) (TC_U32_HTID(h) >> 20)
116 #define TC_U32_HASH(h) (((h) >> 12) & 0xFF)
117 #define TC_U32_NODE(h) ((h) & 0xFFF)
118 #define TC_U32_KEY(h) ((h) & 0xFFFFF)
119 #define TC_U32_UNSPEC 0
120 #define TC_U32_ROOT (0xFFF00000)
121 enum {
122   TCA_U32_UNSPEC,
123   TCA_U32_CLASSID,
124   TCA_U32_HASH,
125   TCA_U32_LINK,
126   TCA_U32_DIVISOR,
127   TCA_U32_SEL,
128   TCA_U32_POLICE,
129   TCA_U32_ACT,
130   TCA_U32_INDEV,
131   TCA_U32_PCNT,
132   TCA_U32_MARK,
133   TCA_U32_FLAGS,
134   TCA_U32_PAD,
135   __TCA_U32_MAX
136 };
137 #define TCA_U32_MAX (__TCA_U32_MAX - 1)
138 struct tc_u32_key {
139   __be32 mask;
140   __be32 val;
141   int off;
142   int offmask;
143 };
144 struct tc_u32_sel {
145   unsigned char flags;
146   unsigned char offshift;
147   unsigned char nkeys;
148   __be16 offmask;
149   __u16 off;
150   short offoff;
151   short hoff;
152   __be32 hmask;
153   struct tc_u32_key keys[0];
154 };
155 struct tc_u32_mark {
156   __u32 val;
157   __u32 mask;
158   __u32 success;
159 };
160 struct tc_u32_pcnt {
161   __u64 rcnt;
162   __u64 rhit;
163   __u64 kcnts[0];
164 };
165 #define TC_U32_TERMINAL 1
166 #define TC_U32_OFFSET 2
167 #define TC_U32_VAROFFSET 4
168 #define TC_U32_EAT 8
169 #define TC_U32_MAXDEPTH 8
170 enum {
171   TCA_RSVP_UNSPEC,
172   TCA_RSVP_CLASSID,
173   TCA_RSVP_DST,
174   TCA_RSVP_SRC,
175   TCA_RSVP_PINFO,
176   TCA_RSVP_POLICE,
177   TCA_RSVP_ACT,
178   __TCA_RSVP_MAX
179 };
180 #define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1)
181 struct tc_rsvp_gpi {
182   __u32 key;
183   __u32 mask;
184   int offset;
185 };
186 struct tc_rsvp_pinfo {
187   struct tc_rsvp_gpi dpi;
188   struct tc_rsvp_gpi spi;
189   __u8 protocol;
190   __u8 tunnelid;
191   __u8 tunnelhdr;
192   __u8 pad;
193 };
194 enum {
195   TCA_ROUTE4_UNSPEC,
196   TCA_ROUTE4_CLASSID,
197   TCA_ROUTE4_TO,
198   TCA_ROUTE4_FROM,
199   TCA_ROUTE4_IIF,
200   TCA_ROUTE4_POLICE,
201   TCA_ROUTE4_ACT,
202   __TCA_ROUTE4_MAX
203 };
204 #define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1)
205 enum {
206   TCA_FW_UNSPEC,
207   TCA_FW_CLASSID,
208   TCA_FW_POLICE,
209   TCA_FW_INDEV,
210   TCA_FW_ACT,
211   TCA_FW_MASK,
212   __TCA_FW_MAX
213 };
214 #define TCA_FW_MAX (__TCA_FW_MAX - 1)
215 enum {
216   TCA_TCINDEX_UNSPEC,
217   TCA_TCINDEX_HASH,
218   TCA_TCINDEX_MASK,
219   TCA_TCINDEX_SHIFT,
220   TCA_TCINDEX_FALL_THROUGH,
221   TCA_TCINDEX_CLASSID,
222   TCA_TCINDEX_POLICE,
223   TCA_TCINDEX_ACT,
224   __TCA_TCINDEX_MAX
225 };
226 #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
227 enum {
228   FLOW_KEY_SRC,
229   FLOW_KEY_DST,
230   FLOW_KEY_PROTO,
231   FLOW_KEY_PROTO_SRC,
232   FLOW_KEY_PROTO_DST,
233   FLOW_KEY_IIF,
234   FLOW_KEY_PRIORITY,
235   FLOW_KEY_MARK,
236   FLOW_KEY_NFCT,
237   FLOW_KEY_NFCT_SRC,
238   FLOW_KEY_NFCT_DST,
239   FLOW_KEY_NFCT_PROTO_SRC,
240   FLOW_KEY_NFCT_PROTO_DST,
241   FLOW_KEY_RTCLASSID,
242   FLOW_KEY_SKUID,
243   FLOW_KEY_SKGID,
244   FLOW_KEY_VLAN_TAG,
245   FLOW_KEY_RXHASH,
246   __FLOW_KEY_MAX,
247 };
248 #define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1)
249 enum {
250   FLOW_MODE_MAP,
251   FLOW_MODE_HASH,
252 };
253 enum {
254   TCA_FLOW_UNSPEC,
255   TCA_FLOW_KEYS,
256   TCA_FLOW_MODE,
257   TCA_FLOW_BASECLASS,
258   TCA_FLOW_RSHIFT,
259   TCA_FLOW_ADDEND,
260   TCA_FLOW_MASK,
261   TCA_FLOW_XOR,
262   TCA_FLOW_DIVISOR,
263   TCA_FLOW_ACT,
264   TCA_FLOW_POLICE,
265   TCA_FLOW_EMATCHES,
266   TCA_FLOW_PERTURB,
267   __TCA_FLOW_MAX
268 };
269 #define TCA_FLOW_MAX (__TCA_FLOW_MAX - 1)
270 enum {
271   TCA_BASIC_UNSPEC,
272   TCA_BASIC_CLASSID,
273   TCA_BASIC_EMATCHES,
274   TCA_BASIC_ACT,
275   TCA_BASIC_POLICE,
276   __TCA_BASIC_MAX
277 };
278 #define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1)
279 enum {
280   TCA_CGROUP_UNSPEC,
281   TCA_CGROUP_ACT,
282   TCA_CGROUP_POLICE,
283   TCA_CGROUP_EMATCHES,
284   __TCA_CGROUP_MAX,
285 };
286 #define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1)
287 #define TCA_BPF_FLAG_ACT_DIRECT (1 << 0)
288 enum {
289   TCA_BPF_UNSPEC,
290   TCA_BPF_ACT,
291   TCA_BPF_POLICE,
292   TCA_BPF_CLASSID,
293   TCA_BPF_OPS_LEN,
294   TCA_BPF_OPS,
295   TCA_BPF_FD,
296   TCA_BPF_NAME,
297   TCA_BPF_FLAGS,
298   TCA_BPF_FLAGS_GEN,
299   TCA_BPF_TAG,
300   TCA_BPF_ID,
301   __TCA_BPF_MAX,
302 };
303 #define TCA_BPF_MAX (__TCA_BPF_MAX - 1)
304 enum {
305   TCA_FLOWER_UNSPEC,
306   TCA_FLOWER_CLASSID,
307   TCA_FLOWER_INDEV,
308   TCA_FLOWER_ACT,
309   TCA_FLOWER_KEY_ETH_DST,
310   TCA_FLOWER_KEY_ETH_DST_MASK,
311   TCA_FLOWER_KEY_ETH_SRC,
312   TCA_FLOWER_KEY_ETH_SRC_MASK,
313   TCA_FLOWER_KEY_ETH_TYPE,
314   TCA_FLOWER_KEY_IP_PROTO,
315   TCA_FLOWER_KEY_IPV4_SRC,
316   TCA_FLOWER_KEY_IPV4_SRC_MASK,
317   TCA_FLOWER_KEY_IPV4_DST,
318   TCA_FLOWER_KEY_IPV4_DST_MASK,
319   TCA_FLOWER_KEY_IPV6_SRC,
320   TCA_FLOWER_KEY_IPV6_SRC_MASK,
321   TCA_FLOWER_KEY_IPV6_DST,
322   TCA_FLOWER_KEY_IPV6_DST_MASK,
323   TCA_FLOWER_KEY_TCP_SRC,
324   TCA_FLOWER_KEY_TCP_DST,
325   TCA_FLOWER_KEY_UDP_SRC,
326   TCA_FLOWER_KEY_UDP_DST,
327   TCA_FLOWER_FLAGS,
328   TCA_FLOWER_KEY_VLAN_ID,
329   TCA_FLOWER_KEY_VLAN_PRIO,
330   TCA_FLOWER_KEY_VLAN_ETH_TYPE,
331   TCA_FLOWER_KEY_ENC_KEY_ID,
332   TCA_FLOWER_KEY_ENC_IPV4_SRC,
333   TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK,
334   TCA_FLOWER_KEY_ENC_IPV4_DST,
335   TCA_FLOWER_KEY_ENC_IPV4_DST_MASK,
336   TCA_FLOWER_KEY_ENC_IPV6_SRC,
337   TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK,
338   TCA_FLOWER_KEY_ENC_IPV6_DST,
339   TCA_FLOWER_KEY_ENC_IPV6_DST_MASK,
340   TCA_FLOWER_KEY_TCP_SRC_MASK,
341   TCA_FLOWER_KEY_TCP_DST_MASK,
342   TCA_FLOWER_KEY_UDP_SRC_MASK,
343   TCA_FLOWER_KEY_UDP_DST_MASK,
344   TCA_FLOWER_KEY_SCTP_SRC_MASK,
345   TCA_FLOWER_KEY_SCTP_DST_MASK,
346   TCA_FLOWER_KEY_SCTP_SRC,
347   TCA_FLOWER_KEY_SCTP_DST,
348   TCA_FLOWER_KEY_ENC_UDP_SRC_PORT,
349   TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK,
350   TCA_FLOWER_KEY_ENC_UDP_DST_PORT,
351   TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK,
352   TCA_FLOWER_KEY_FLAGS,
353   TCA_FLOWER_KEY_FLAGS_MASK,
354   TCA_FLOWER_KEY_ICMPV4_CODE,
355   TCA_FLOWER_KEY_ICMPV4_CODE_MASK,
356   TCA_FLOWER_KEY_ICMPV4_TYPE,
357   TCA_FLOWER_KEY_ICMPV4_TYPE_MASK,
358   TCA_FLOWER_KEY_ICMPV6_CODE,
359   TCA_FLOWER_KEY_ICMPV6_CODE_MASK,
360   TCA_FLOWER_KEY_ICMPV6_TYPE,
361   TCA_FLOWER_KEY_ICMPV6_TYPE_MASK,
362   TCA_FLOWER_KEY_ARP_SIP,
363   TCA_FLOWER_KEY_ARP_SIP_MASK,
364   TCA_FLOWER_KEY_ARP_TIP,
365   TCA_FLOWER_KEY_ARP_TIP_MASK,
366   TCA_FLOWER_KEY_ARP_OP,
367   TCA_FLOWER_KEY_ARP_OP_MASK,
368   TCA_FLOWER_KEY_ARP_SHA,
369   TCA_FLOWER_KEY_ARP_SHA_MASK,
370   TCA_FLOWER_KEY_ARP_THA,
371   TCA_FLOWER_KEY_ARP_THA_MASK,
372   TCA_FLOWER_KEY_MPLS_TTL,
373   TCA_FLOWER_KEY_MPLS_BOS,
374   TCA_FLOWER_KEY_MPLS_TC,
375   TCA_FLOWER_KEY_MPLS_LABEL,
376   TCA_FLOWER_KEY_TCP_FLAGS,
377   TCA_FLOWER_KEY_TCP_FLAGS_MASK,
378   TCA_FLOWER_KEY_IP_TOS,
379   TCA_FLOWER_KEY_IP_TOS_MASK,
380   TCA_FLOWER_KEY_IP_TTL,
381   TCA_FLOWER_KEY_IP_TTL_MASK,
382   TCA_FLOWER_KEY_CVLAN_ID,
383   TCA_FLOWER_KEY_CVLAN_PRIO,
384   TCA_FLOWER_KEY_CVLAN_ETH_TYPE,
385   TCA_FLOWER_KEY_ENC_IP_TOS,
386   TCA_FLOWER_KEY_ENC_IP_TOS_MASK,
387   TCA_FLOWER_KEY_ENC_IP_TTL,
388   TCA_FLOWER_KEY_ENC_IP_TTL_MASK,
389   TCA_FLOWER_KEY_ENC_OPTS,
390   TCA_FLOWER_KEY_ENC_OPTS_MASK,
391   TCA_FLOWER_IN_HW_COUNT,
392   TCA_FLOWER_KEY_PORT_SRC_MIN,
393   TCA_FLOWER_KEY_PORT_SRC_MAX,
394   TCA_FLOWER_KEY_PORT_DST_MIN,
395   TCA_FLOWER_KEY_PORT_DST_MAX,
396   __TCA_FLOWER_MAX,
397 };
398 #define TCA_FLOWER_MAX (__TCA_FLOWER_MAX - 1)
399 enum {
400   TCA_FLOWER_KEY_ENC_OPTS_UNSPEC,
401   TCA_FLOWER_KEY_ENC_OPTS_GENEVE,
402   __TCA_FLOWER_KEY_ENC_OPTS_MAX,
403 };
404 #define TCA_FLOWER_KEY_ENC_OPTS_MAX (__TCA_FLOWER_KEY_ENC_OPTS_MAX - 1)
405 enum {
406   TCA_FLOWER_KEY_ENC_OPT_GENEVE_UNSPEC,
407   TCA_FLOWER_KEY_ENC_OPT_GENEVE_CLASS,
408   TCA_FLOWER_KEY_ENC_OPT_GENEVE_TYPE,
409   TCA_FLOWER_KEY_ENC_OPT_GENEVE_DATA,
410   __TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX,
411 };
412 #define TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX (__TCA_FLOWER_KEY_ENC_OPT_GENEVE_MAX - 1)
413 enum {
414   TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),
415   TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),
416 };
417 #define TCA_FLOWER_MASK_FLAGS_RANGE (1 << 0)
418 enum {
419   TCA_MATCHALL_UNSPEC,
420   TCA_MATCHALL_CLASSID,
421   TCA_MATCHALL_ACT,
422   TCA_MATCHALL_FLAGS,
423   __TCA_MATCHALL_MAX,
424 };
425 #define TCA_MATCHALL_MAX (__TCA_MATCHALL_MAX - 1)
426 struct tcf_ematch_tree_hdr {
427   __u16 nmatches;
428   __u16 progid;
429 };
430 enum {
431   TCA_EMATCH_TREE_UNSPEC,
432   TCA_EMATCH_TREE_HDR,
433   TCA_EMATCH_TREE_LIST,
434   __TCA_EMATCH_TREE_MAX
435 };
436 #define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1)
437 struct tcf_ematch_hdr {
438   __u16 matchid;
439   __u16 kind;
440   __u16 flags;
441   __u16 pad;
442 };
443 #define TCF_EM_REL_END 0
444 #define TCF_EM_REL_AND (1 << 0)
445 #define TCF_EM_REL_OR (1 << 1)
446 #define TCF_EM_INVERT (1 << 2)
447 #define TCF_EM_SIMPLE (1 << 3)
448 #define TCF_EM_REL_MASK 3
449 #define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK)
450 enum {
451   TCF_LAYER_LINK,
452   TCF_LAYER_NETWORK,
453   TCF_LAYER_TRANSPORT,
454   __TCF_LAYER_MAX
455 };
456 #define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1)
457 #define TCF_EM_CONTAINER 0
458 #define TCF_EM_CMP 1
459 #define TCF_EM_NBYTE 2
460 #define TCF_EM_U32 3
461 #define TCF_EM_META 4
462 #define TCF_EM_TEXT 5
463 #define TCF_EM_VLAN 6
464 #define TCF_EM_CANID 7
465 #define TCF_EM_IPSET 8
466 #define TCF_EM_IPT 9
467 #define TCF_EM_MAX 9
468 enum {
469   TCF_EM_PROG_TC
470 };
471 enum {
472   TCF_EM_OPND_EQ,
473   TCF_EM_OPND_GT,
474   TCF_EM_OPND_LT
475 };
476 #endif
477