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);
13INDIRECT_CALLABLE_DECLARE(struct net_device *netkit_peer_dev(struct net_device *dev));
14#else
15static inline int netkit_prog_attach(const union bpf_attr *attr,
16 struct bpf_prog *prog)
17{
18 return -EINVAL;
19}
20
21static inline int netkit_link_attach(const union bpf_attr *attr,
22 struct bpf_prog *prog)
23{
24 return -EINVAL;
25}
26
27static inline int netkit_prog_detach(const union bpf_attr *attr,
28 struct bpf_prog *prog)
29{
30 return -EINVAL;
31}
32
33static inline int netkit_prog_query(const union bpf_attr *attr,
34 union bpf_attr __user *uattr)
35{
36 return -EINVAL;
37}
38
39static inline struct net_device *netkit_peer_dev(struct net_device *dev)
40{
41 return NULL;
42}
43#endif /* CONFIG_NETKIT */
44#endif /* __NET_NETKIT_H */
45

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