1 /****************************************************************************
2 ****************************************************************************
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.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef __LINUX_FILTER_H__
13 #define __LINUX_FILTER_H__
15 #include <linux/compiler.h>
16 #include <linux/types.h>
18 #define BPF_MAJOR_VERSION 1
19 #define BPF_MINOR_VERSION 1
32 struct sock_filter __user *filter;
35 #define BPF_CLASS(code) ((code) & 0x07)
45 #define BPF_SIZE(code) ((code) & 0x18)
49 #define BPF_MODE(code) ((code) & 0xe0)
57 #define BPF_OP(code) ((code) & 0xf0)
72 #define BPF_SRC(code) ((code) & 0x08)
76 #define BPF_RVAL(code) ((code) & 0x18)
79 #define BPF_MISCOP(code) ((code) & 0xf8)
84 #define BPF_MAXINSNS 4096
88 #define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
91 #define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
94 #define BPF_MEMWORDS 16
96 #define SKF_AD_OFF (-0x1000)
97 #define SKF_AD_PROTOCOL 0
98 #define SKF_AD_PKTTYPE 4
99 #define SKF_AD_IFINDEX 8
100 #define SKF_AD_MAX 12
101 #define SKF_NET_OFF (-0x100000)
102 #define SKF_LL_OFF (-0x200000)