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__LINUX_FILTER_H__
20#define _UAPI__LINUX_FILTER_H__
21#include <linux/compiler.h>
22#include <linux/types.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define BPF_MAJOR_VERSION 1
25#define BPF_MINOR_VERSION 1
26struct sock_filter {
27 __u16 code;
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 __u8 jt;
30 __u8 jf;
31 __u32 k;
32};
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34struct sock_fprog {
35 unsigned short len;
36 struct sock_filter __user *filter;
37};
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define BPF_CLASS(code) ((code) & 0x07)
40#define BPF_LD 0x00
41#define BPF_LDX 0x01
42#define BPF_ST 0x02
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define BPF_STX 0x03
45#define BPF_ALU 0x04
46#define BPF_JMP 0x05
47#define BPF_RET 0x06
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define BPF_MISC 0x07
50#define BPF_SIZE(code) ((code) & 0x18)
51#define BPF_W 0x00
52#define BPF_H 0x08
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define BPF_B 0x10
55#define BPF_MODE(code) ((code) & 0xe0)
56#define BPF_IMM 0x00
57#define BPF_ABS 0x20
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define BPF_IND 0x40
60#define BPF_MEM 0x60
61#define BPF_LEN 0x80
62#define BPF_MSH 0xa0
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define BPF_OP(code) ((code) & 0xf0)
65#define BPF_ADD 0x00
66#define BPF_SUB 0x10
67#define BPF_MUL 0x20
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define BPF_DIV 0x30
70#define BPF_OR 0x40
71#define BPF_AND 0x50
72#define BPF_LSH 0x60
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74#define BPF_RSH 0x70
75#define BPF_NEG 0x80
76#define BPF_MOD 0x90
77#define BPF_XOR 0xa0
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79#define BPF_JA 0x00
80#define BPF_JEQ 0x10
81#define BPF_JGT 0x20
82#define BPF_JGE 0x30
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84#define BPF_JSET 0x40
85#define BPF_SRC(code) ((code) & 0x08)
86#define BPF_K 0x00
87#define BPF_X 0x08
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89#define BPF_RVAL(code) ((code) & 0x18)
90#define BPF_A 0x10
91#define BPF_MISCOP(code) ((code) & 0xf8)
92#define BPF_TAX 0x00
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94#define BPF_TXA 0x80
95#ifndef BPF_MAXINSNS
96#define BPF_MAXINSNS 4096
97#endif
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99#ifndef BPF_STMT
100#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
101#endif
102#ifndef BPF_JUMP
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
105#endif
106#define BPF_MEMWORDS 16
107#define SKF_AD_OFF (-0x1000)
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109#define SKF_AD_PROTOCOL 0
110#define SKF_AD_PKTTYPE 4
111#define SKF_AD_IFINDEX 8
112#define SKF_AD_NLATTR 12
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114#define SKF_AD_NLATTR_NEST 16
115#define SKF_AD_MARK 20
116#define SKF_AD_QUEUE 24
117#define SKF_AD_HATYPE 28
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119#define SKF_AD_RXHASH 32
120#define SKF_AD_CPU 36
121#define SKF_AD_ALU_XOR_X 40
122#define SKF_AD_VLAN_TAG 44
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124#define SKF_AD_VLAN_TAG_PRESENT 48
125#define SKF_AD_PAY_OFFSET 52
126#define SKF_AD_MAX 56
127#define SKF_NET_OFF (-0x100000)
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129#define SKF_LL_OFF (-0x200000)
130#endif
131