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_FILTER_H__
20#define __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_JA 0x00
77#define BPF_JEQ 0x10
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79#define BPF_JGT 0x20
80#define BPF_JGE 0x30
81#define BPF_JSET 0x40
82#define BPF_SRC(code) ((code) & 0x08)
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84#define BPF_K 0x00
85#define BPF_X 0x08
86#define BPF_RVAL(code) ((code) & 0x18)
87#define BPF_A 0x10
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89#define BPF_MISCOP(code) ((code) & 0xf8)
90#define BPF_TAX 0x00
91#define BPF_TXA 0x80
92#ifndef BPF_MAXINSNS
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94#define BPF_MAXINSNS 4096
95#endif
96#ifndef BPF_STMT
97#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99#endif
100#ifndef BPF_JUMP
101#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
102#endif
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104#define BPF_MEMWORDS 16
105#define SKF_AD_OFF (-0x1000)
106#define SKF_AD_PROTOCOL 0
107#define SKF_AD_PKTTYPE 4
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109#define SKF_AD_IFINDEX 8
110#define SKF_AD_NLATTR 12
111#define SKF_AD_NLATTR_NEST 16
112#define SKF_AD_MARK 20
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114#define SKF_AD_QUEUE 24
115#define SKF_AD_HATYPE 28
116#define SKF_AD_RXHASH 32
117#define SKF_AD_CPU 36
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119#define SKF_AD_ALU_XOR_X 40
120#define SKF_AD_MAX 44
121#define SKF_NET_OFF (-0x100000)
122#define SKF_LL_OFF (-0x200000)
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124#endif
125