linux/net/mctp/af_mctp.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Management Component Transport Protocol (MCTP)
 *
 * Copyright (c) 2021 Code Construct
 * Copyright (c) 2021 Google
 */

#include <linux/compat.h>
#include <linux/if_arp.h>
#include <linux/net.h>
#include <linux/mctp.h>
#include <linux/module.h>
#include <linux/socket.h>

#include <net/mctp.h>
#include <net/mctpdevice.h>
#include <net/sock.h>

#define CREATE_TRACE_POINTS
#include <trace/events/mctp.h>

/* socket implementation */

static void mctp_sk_expire_keys(struct timer_list *timer);

static int mctp_release(struct socket *sock)
{}

/* Generic sockaddr checks, padding checks only so far */
static bool mctp_sockaddr_is_ok(const struct sockaddr_mctp *addr)
{}

static bool mctp_sockaddr_ext_is_ok(const struct sockaddr_mctp_ext *addr)
{}

static int mctp_bind(struct socket *sock, struct sockaddr *addr, int addrlen)
{}

static int mctp_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
{}

static int mctp_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
			int flags)
{}

/* We're done with the key; invalidate, stop reassembly, and remove from lists.
 */
static void __mctp_key_remove(struct mctp_sk_key *key, struct net *net,
			      unsigned long flags, unsigned long reason)
__releases(&key->lock)
__must_hold(&net->mctp.keys_lock)
{}

static int mctp_setsockopt(struct socket *sock, int level, int optname,
			   sockptr_t optval, unsigned int optlen)
{}

static int mctp_getsockopt(struct socket *sock, int level, int optname,
			   char __user *optval, int __user *optlen)
{}

/* helpers for reading/writing the tag ioc, handling compatibility across the
 * two versions, and some basic API error checking
 */
static int mctp_ioctl_tag_copy_from_user(unsigned long arg,
					 struct mctp_ioc_tag_ctl2 *ctl,
					 bool tagv2)
{}

static int mctp_ioctl_tag_copy_to_user(unsigned long arg,
				       struct mctp_ioc_tag_ctl2 *ctl,
				       bool tagv2)
{}

static int mctp_ioctl_alloctag(struct mctp_sock *msk, bool tagv2,
			       unsigned long arg)
{}

static int mctp_ioctl_droptag(struct mctp_sock *msk, bool tagv2,
			      unsigned long arg)
{}

static int mctp_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{}

#ifdef CONFIG_COMPAT
static int mctp_compat_ioctl(struct socket *sock, unsigned int cmd,
			     unsigned long arg)
{}
#endif

static const struct proto_ops mctp_dgram_ops =;

static void mctp_sk_expire_keys(struct timer_list *timer)
{}

static int mctp_sk_init(struct sock *sk)
{}

static void mctp_sk_close(struct sock *sk, long timeout)
{}

static int mctp_sk_hash(struct sock *sk)
{}

static void mctp_sk_unhash(struct sock *sk)
{}

static void mctp_sk_destruct(struct sock *sk)
{}

static struct proto mctp_proto =;

static int mctp_pf_create(struct net *net, struct socket *sock,
			  int protocol, int kern)
{}

static struct net_proto_family mctp_pf =;

static __init int mctp_init(void)
{}

static __exit void mctp_exit(void)
{}

subsys_initcall(mctp_init);
module_exit(mctp_exit);

MODULE_DESCRIPTION();
MODULE_AUTHOR();

MODULE_ALIAS_NETPROTO();