include/net/netkit.h

Source file repositories/reference/linux-study-clean/include/net/netkit.h

File Facts

System
Linux kernel
Corpus path
include/net/netkit.h
Extension
.h
Size
1192 bytes
Lines
45
Domain
Networking Core
Bucket
Sockets, Protocols, Packet Path, And Network Policy
Inferred role
Networking Core: implementation source
Status
source implementation candidate

Why This File Exists

Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __NET_NETKIT_H
#define __NET_NETKIT_H

#include <linux/bpf.h>

#ifdef CONFIG_NETKIT
int netkit_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog);
int netkit_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
int netkit_prog_detach(const union bpf_attr *attr, struct bpf_prog *prog);
int netkit_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr);
INDIRECT_CALLABLE_DECLARE(struct net_device *netkit_peer_dev(struct net_device *dev));
#else
static inline int netkit_prog_attach(const union bpf_attr *attr,
				     struct bpf_prog *prog)
{
	return -EINVAL;
}

static inline int netkit_link_attach(const union bpf_attr *attr,
				     struct bpf_prog *prog)
{
	return -EINVAL;
}

static inline int netkit_prog_detach(const union bpf_attr *attr,
				     struct bpf_prog *prog)
{
	return -EINVAL;
}

static inline int netkit_prog_query(const union bpf_attr *attr,
				    union bpf_attr __user *uattr)
{
	return -EINVAL;
}

static inline struct net_device *netkit_peer_dev(struct net_device *dev)
{
	return NULL;
}
#endif /* CONFIG_NETKIT */
#endif /* __NET_NETKIT_H */

Annotation

Implementation Notes