Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[sfrench/cifs-2.6.git] / include / uapi / linux / netfilter / xt_bpf.h
1 #ifndef _XT_BPF_H
2 #define _XT_BPF_H
3
4 #include <linux/filter.h>
5 #include <linux/limits.h>
6 #include <linux/types.h>
7
8 #define XT_BPF_MAX_NUM_INSTR    64
9 #define XT_BPF_PATH_MAX         (XT_BPF_MAX_NUM_INSTR * sizeof(struct sock_filter))
10
11 struct bpf_prog;
12
13 struct xt_bpf_info {
14         __u16 bpf_program_num_elem;
15         struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR];
16
17         /* only used in the kernel */
18         struct bpf_prog *filter __attribute__((aligned(8)));
19 };
20
21 enum xt_bpf_modes {
22         XT_BPF_MODE_BYTECODE,
23         XT_BPF_MODE_FD_PINNED,
24         XT_BPF_MODE_FD_ELF,
25 };
26 #define XT_BPF_MODE_PATH_PINNED XT_BPF_MODE_FD_PINNED
27
28 struct xt_bpf_info_v1 {
29         __u16 mode;
30         __u16 bpf_program_num_elem;
31         __s32 fd;
32         union {
33                 struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR];
34                 char path[XT_BPF_PATH_MAX];
35         };
36
37         /* only used in the kernel */
38         struct bpf_prog *filter __attribute__((aligned(8)));
39 };
40
41 #endif /*_XT_BPF_H */