diff options
author | Florian Westphal <fw@strlen.de> | 2023-04-21 20:02:59 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-04-21 21:34:50 +0300 |
commit | 2b99ef22e0d237e08bfc437e7d051f78f352aeb2 (patch) | |
tree | 7e32a2726021966408ded96ee08c34e29744e869 /include/linux/bpf.h | |
parent | d0fe92fb5e3df6991c640fb9205d880b68603259 (diff) | |
download | linux-2b99ef22e0d237e08bfc437e7d051f78f352aeb2.tar.xz |
bpf: add test_run support for netfilter program type
add glue code so a bpf program can be run using userspace-provided
netfilter state and packet/skb.
Default is to use ipv4:output hook point, but this can be overridden by
userspace. Userspace provided netfilter state is restricted, only hook and
protocol families can be overridden and only to ipv4/ipv6.
Signed-off-by: Florian Westphal <fw@strlen.de>
Link: https://lore.kernel.org/r/20230421170300.24115-7-fw@strlen.de
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r-- | include/linux/bpf.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 18b592fde896..e53ceee1df37 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -2264,6 +2264,9 @@ int bpf_prog_test_run_raw_tp(struct bpf_prog *prog, int bpf_prog_test_run_sk_lookup(struct bpf_prog *prog, const union bpf_attr *kattr, union bpf_attr __user *uattr); +int bpf_prog_test_run_nf(struct bpf_prog *prog, + const union bpf_attr *kattr, + union bpf_attr __user *uattr); bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info); |