linux/net/netrom/af_netrom.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 * Copyright Jonathan Naylor G4KLX ([email protected])
 * Copyright Alan Cox GW4PTS ([email protected])
 * Copyright Darryl Miles G7LED ([email protected])
 */
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/sched/signal.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/sockios.h>
#include <linux/net.h>
#include <linux/stat.h>
#include <net/ax25.h>
#include <linux/inet.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/skbuff.h>
#include <net/net_namespace.h>
#include <net/sock.h>
#include <linux/uaccess.h>
#include <linux/fcntl.h>
#include <linux/termios.h>	/* For TIOCINQ/OUTQ */
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
#include <net/netrom.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <net/ip.h>
#include <net/tcp_states.h>
#include <net/arp.h>
#include <linux/init.h>

static int nr_ndevs =;

int sysctl_netrom_default_path_quality            =;
int sysctl_netrom_obsolescence_count_initialiser  =;
int sysctl_netrom_network_ttl_initialiser         =;
int sysctl_netrom_transport_timeout               =;
int sysctl_netrom_transport_maximum_tries         =;
int sysctl_netrom_transport_acknowledge_delay     =;
int sysctl_netrom_transport_busy_delay            =;
int sysctl_netrom_transport_requested_window_size =;
int sysctl_netrom_transport_no_activity_timeout   =;
int sysctl_netrom_routing_control                 =;
int sysctl_netrom_link_fails_count                =;
int sysctl_netrom_reset_circuit                   =;

static unsigned short circuit =;

static HLIST_HEAD(nr_list);
static DEFINE_SPINLOCK(nr_list_lock);

static const struct proto_ops nr_proto_ops;

/*
 * NETROM network devices are virtual network devices encapsulating NETROM
 * frames into AX.25 which will be sent through an AX.25 device, so form a
 * special "super class" of normal net devices; split their locks off into a
 * separate class since they always nest.
 */
static struct lock_class_key nr_netdev_xmit_lock_key;
static struct lock_class_key nr_netdev_addr_lock_key;

static void nr_set_lockdep_one(struct net_device *dev,
			       struct netdev_queue *txq,
			       void *_unused)
{}

static void nr_set_lockdep_key(struct net_device *dev)
{}

/*
 *	Socket removal during an interrupt is now safe.
 */
static void nr_remove_socket(struct sock *sk)
{}

/*
 *	Kill all bound sockets on a dropped device.
 */
static void nr_kill_by_device(struct net_device *dev)
{}

/*
 *	Handle device status changes.
 */
static int nr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
{}

/*
 *	Add a socket to the bound sockets list.
 */
static void nr_insert_socket(struct sock *sk)
{}

/*
 *	Find a socket that wants to accept the Connect Request we just
 *	received.
 */
static struct sock *nr_find_listener(ax25_address *addr)
{}

/*
 *	Find a connected NET/ROM socket given my circuit IDs.
 */
static struct sock *nr_find_socket(unsigned char index, unsigned char id)
{}

/*
 *	Find a connected NET/ROM socket given their circuit IDs.
 */
static struct sock *nr_find_peer(unsigned char index, unsigned char id,
	ax25_address *dest)
{}

/*
 *	Find next free circuit ID.
 */
static unsigned short nr_find_next_circuit(void)
{}

/*
 *	Deferred destroy.
 */
void nr_destroy_socket(struct sock *);

/*
 *	Handler for deferred kills.
 */
static void nr_destroy_timer(struct timer_list *t)
{}

/*
 *	This is called from user mode and the timers. Thus it protects itself
 *	against interrupt users but doesn't worry about being called during
 *	work. Once it is removed from the queue no interrupt or bottom half
 *	will touch it and we are (fairly 8-) ) safe.
 */
void nr_destroy_socket(struct sock *sk)
{}

/*
 *	Handling for system calls applied via the various interfaces to a
 *	NET/ROM socket object.
 */

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

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

static int nr_listen(struct socket *sock, int backlog)
{}

static struct proto nr_proto =;

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

static struct sock *nr_make_new(struct sock *osk)
{}

static int nr_release(struct socket *sock)
{}

static int nr_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{}

static int nr_connect(struct socket *sock, struct sockaddr *uaddr,
	int addr_len, int flags)
{}

static int nr_accept(struct socket *sock, struct socket *newsock,
		     struct proto_accept_arg *arg)
{}

static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
	int peer)
{}

int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
{}

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

static int nr_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
		      int flags)
{}


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

#ifdef CONFIG_PROC_FS

static void *nr_info_start(struct seq_file *seq, loff_t *pos)
	__acquires(&nr_list_lock)
{}

static void *nr_info_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static void nr_info_stop(struct seq_file *seq, void *v)
	__releases(&nr_list_lock)
{}

static int nr_info_show(struct seq_file *seq, void *v)
{}

static const struct seq_operations nr_info_seqops =;
#endif	/* CONFIG_PROC_FS */

static const struct net_proto_family nr_family_ops =;

static const struct proto_ops nr_proto_ops =;

static struct notifier_block nr_dev_notifier =;

static struct net_device **dev_nr;

static struct ax25_protocol nr_pid =;

static struct ax25_linkfail nr_linkfail_notifier =;

static int __init nr_proto_init(void)
{}

module_init();

module_param(nr_ndevs, int, 0);
MODULE_PARM_DESC();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS_NETPROTO();

static void __exit nr_exit(void)
{}
module_exit(nr_exit);