Commit | Line | Data |
---|---|---|
35dfaad7 DB |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* Copyright (c) 2023 Isovalent */ | |
3 | #ifndef __NET_NETKIT_H | |
4 | #define __NET_NETKIT_H | |
5 | ||
6 | #include <linux/bpf.h> | |
7 | ||
8 | #ifdef CONFIG_NETKIT | |
9 | int netkit_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog); | |
10 | int netkit_link_attach(const union bpf_attr *attr, struct bpf_prog *prog); | |
11 | int netkit_prog_detach(const union bpf_attr *attr, struct bpf_prog *prog); | |
12 | int netkit_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr); | |
13 | #else | |
14 | static inline int netkit_prog_attach(const union bpf_attr *attr, | |
15 | struct bpf_prog *prog) | |
16 | { | |
17 | return -EINVAL; | |
18 | } | |
19 | ||
20 | static inline int netkit_link_attach(const union bpf_attr *attr, | |
21 | struct bpf_prog *prog) | |
22 | { | |
23 | return -EINVAL; | |
24 | } | |
25 | ||
26 | static inline int netkit_prog_detach(const union bpf_attr *attr, | |
27 | struct bpf_prog *prog) | |
28 | { | |
29 | return -EINVAL; | |
30 | } | |
31 | ||
32 | static inline int netkit_prog_query(const union bpf_attr *attr, | |
33 | union bpf_attr __user *uattr) | |
34 | { | |
35 | return -EINVAL; | |
36 | } | |
37 | #endif /* CONFIG_NETKIT */ | |
38 | #endif /* __NET_NETKIT_H */ |