]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - include/uapi/linux/netfilter/xt_bpf.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-focal-kernel.git] / include / uapi / linux / netfilter / xt_bpf.h
CommitLineData
e6f30c73
WB
1#ifndef _XT_BPF_H
2#define _XT_BPF_H
3
4#include <linux/filter.h>
2c16d603 5#include <linux/limits.h>
e6f30c73
WB
6#include <linux/types.h>
7
8#define XT_BPF_MAX_NUM_INSTR 64
2c16d603 9#define XT_BPF_PATH_MAX (XT_BPF_MAX_NUM_INSTR * sizeof(struct sock_filter))
e6f30c73 10
7ae457c1 11struct bpf_prog;
e10038a8 12
e6f30c73
WB
13struct 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 */
7ae457c1 18 struct bpf_prog *filter __attribute__((aligned(8)));
e6f30c73
WB
19};
20
2c16d603
WB
21enum xt_bpf_modes {
22 XT_BPF_MODE_BYTECODE,
23 XT_BPF_MODE_FD_PINNED,
24 XT_BPF_MODE_FD_ELF,
25};
98589a09 26#define XT_BPF_MODE_PATH_PINNED XT_BPF_MODE_FD_PINNED
2c16d603
WB
27
28struct 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
e6f30c73 41#endif /*_XT_BPF_H */