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
9int netkit_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog);
10int netkit_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
11int netkit_prog_detach(const union bpf_attr *attr, struct bpf_prog *prog);
12int netkit_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr);
13#else
14static inline int netkit_prog_attach(const union bpf_attr *attr,
15 struct bpf_prog *prog)
16{
17 return -EINVAL;
18}
19
20static inline int netkit_link_attach(const union bpf_attr *attr,
21 struct bpf_prog *prog)
22{
23 return -EINVAL;
24}
25
26static inline int netkit_prog_detach(const union bpf_attr *attr,
27 struct bpf_prog *prog)
28{
29 return -EINVAL;
30}
31
32static 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 */
39

source code of linux/include/net/netkit.h