#include <linux/bpf.h>
#include <linux/errno.h>
#include <linux/errqueue.h>
#include <linux/file.h>
#include <linux/filter.h>
#include <linux/in.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/poll.h>
#include <linux/rculist.h>
#include <linux/skbuff.h>
#include <linux/socket.h>
#include <linux/uaccess.h>
#include <linux/workqueue.h>
#include <linux/syscalls.h>
#include <linux/sched/signal.h>
#include <net/kcm.h>
#include <net/netns/generic.h>
#include <net/sock.h>
#include <uapi/linux/kcm.h>
#include <trace/events/sock.h>
unsigned int kcm_net_id;
static struct kmem_cache *kcm_psockp __read_mostly;
static struct kmem_cache *kcm_muxp __read_mostly;
static struct workqueue_struct *kcm_wq;
static inline struct kcm_sock *kcm_sk(const struct sock *sk)
{ … }
static inline struct kcm_tx_msg *kcm_tx_msg(struct sk_buff *skb)
{ … }
static void report_csk_error(struct sock *csk, int err)
{ … }
static void kcm_abort_tx_psock(struct kcm_psock *psock, int err,
bool wakeup_kcm)
{ … }
static void kcm_update_rx_mux_stats(struct kcm_mux *mux,
struct kcm_psock *psock)
{ … }
static void kcm_update_tx_mux_stats(struct kcm_mux *mux,
struct kcm_psock *psock)
{ … }
static int kcm_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
static void kcm_rcv_ready(struct kcm_sock *kcm)
{ … }
static void kcm_rfree(struct sk_buff *skb)
{ … }
static int kcm_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{ … }
static void requeue_rx_msgs(struct kcm_mux *mux, struct sk_buff_head *head)
{ … }
static struct kcm_sock *reserve_rx_kcm(struct kcm_psock *psock,
struct sk_buff *head)
{ … }
static void kcm_done(struct kcm_sock *kcm);
static void kcm_done_work(struct work_struct *w)
{ … }
static void unreserve_rx_kcm(struct kcm_psock *psock,
bool rcv_ready)
{ … }
static void psock_data_ready(struct sock *sk)
{ … }
static void kcm_rcv_strparser(struct strparser *strp, struct sk_buff *skb)
{ … }
static int kcm_parse_func_strparser(struct strparser *strp, struct sk_buff *skb)
{ … }
static int kcm_read_sock_done(struct strparser *strp, int err)
{ … }
static void psock_state_change(struct sock *sk)
{ … }
static void psock_write_space(struct sock *sk)
{ … }
static void unreserve_psock(struct kcm_sock *kcm);
static struct kcm_psock *reserve_psock(struct kcm_sock *kcm)
{ … }
static void psock_now_avail(struct kcm_psock *psock)
{ … }
static void unreserve_psock(struct kcm_sock *kcm)
{ … }
static void kcm_report_tx_retry(struct kcm_sock *kcm)
{ … }
static int kcm_write_msgs(struct kcm_sock *kcm)
{ … }
static void kcm_tx_work(struct work_struct *w)
{ … }
static void kcm_push(struct kcm_sock *kcm)
{ … }
static int kcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
{ … }
static void kcm_splice_eof(struct socket *sock)
{ … }
static int kcm_recvmsg(struct socket *sock, struct msghdr *msg,
size_t len, int flags)
{ … }
static ssize_t kcm_splice_read(struct socket *sock, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
{ … }
static void kcm_recv_disable(struct kcm_sock *kcm)
{ … }
static void kcm_recv_enable(struct kcm_sock *kcm)
{ … }
static int kcm_setsockopt(struct socket *sock, int level, int optname,
sockptr_t optval, unsigned int optlen)
{ … }
static int kcm_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen)
{ … }
static void init_kcm_sock(struct kcm_sock *kcm, struct kcm_mux *mux)
{ … }
static int kcm_attach(struct socket *sock, struct socket *csock,
struct bpf_prog *prog)
{ … }
static int kcm_attach_ioctl(struct socket *sock, struct kcm_attach *info)
{ … }
static void kcm_unattach(struct kcm_psock *psock)
{ … }
static int kcm_unattach_ioctl(struct socket *sock, struct kcm_unattach *info)
{ … }
static struct proto kcm_proto = …;
static struct file *kcm_clone(struct socket *osock)
{ … }
static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{ … }
static void free_mux(struct rcu_head *rcu)
{ … }
static void release_mux(struct kcm_mux *mux)
{ … }
static void kcm_done(struct kcm_sock *kcm)
{ … }
static int kcm_release(struct socket *sock)
{ … }
static const struct proto_ops kcm_dgram_ops = …;
static const struct proto_ops kcm_seqpacket_ops = …;
static int kcm_create(struct net *net, struct socket *sock,
int protocol, int kern)
{ … }
static const struct net_proto_family kcm_family_ops = …;
static __net_init int kcm_init_net(struct net *net)
{ … }
static __net_exit void kcm_exit_net(struct net *net)
{ … }
static struct pernet_operations kcm_net_ops = …;
static int __init kcm_init(void)
{ … }
static void __exit kcm_exit(void)
{ … }
module_init(…) …;
module_exit(kcm_exit);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS_NETPROTO(…);