linux/net/rose/af_rose.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 * Copyright (C) Jonathan Naylor G4KLX ([email protected])
 * Copyright (C) Alan Cox GW4PTS ([email protected])
 * Copyright (C) Terry Dawson VK2KTJ ([email protected])
 * Copyright (C) Tomi Manninen OH2BNS ([email protected])
 */

#include <linux/capability.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.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/spinlock.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/sockios.h>
#include <linux/net.h>
#include <linux/stat.h>
#include <net/net_namespace.h>
#include <net/ax25.h>
#include <linux/inet.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/skbuff.h>
#include <net/sock.h>
#include <linux/uaccess.h>
#include <linux/fcntl.h>
#include <linux/termios.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
#include <net/rose.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <net/tcp_states.h>
#include <net/ip.h>
#include <net/arp.h>

static int rose_ndevs =;

int sysctl_rose_restart_request_timeout =;
int sysctl_rose_call_request_timeout    =;
int sysctl_rose_reset_request_timeout   =;
int sysctl_rose_clear_request_timeout   =;
int sysctl_rose_no_activity_timeout     =;
int sysctl_rose_ack_hold_back_timeout   =;
int sysctl_rose_routing_control         =;
int sysctl_rose_link_fail_timeout       =;
int sysctl_rose_maximum_vcs             =;
int sysctl_rose_window_size             =;

static HLIST_HEAD(rose_list);
static DEFINE_SPINLOCK(rose_list_lock);

static const struct proto_ops rose_proto_ops;

ax25_address rose_callsign;

/*
 * ROSE network devices are virtual network devices encapsulating ROSE
 * 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 rose_netdev_xmit_lock_key;
static struct lock_class_key rose_netdev_addr_lock_key;

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

static void rose_set_lockdep_key(struct net_device *dev)
{}

/*
 *	Convert a ROSE address into text.
 */
char *rose2asc(char *buf, const rose_address *addr)
{}

/*
 *	Compare two ROSE addresses, 0 == equal.
 */
int rosecmp(const rose_address *addr1, const rose_address *addr2)
{}

/*
 *	Compare two ROSE addresses for only mask digits, 0 == equal.
 */
int rosecmpm(const rose_address *addr1, const rose_address *addr2,
	     unsigned short mask)
{}

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

/*
 *	Kill all bound sockets on a broken link layer connection to a
 *	particular neighbour.
 */
void rose_kill_by_neigh(struct rose_neigh *neigh)
{}

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

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

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

/*
 *	Find a socket that wants to accept the Call Request we just
 *	received.
 */
static struct sock *rose_find_listener(rose_address *addr, ax25_address *call)
{}

/*
 *	Find a connected ROSE socket given my LCI and device.
 */
struct sock *rose_find_socket(unsigned int lci, struct rose_neigh *neigh)
{}

/*
 *	Find a unique LCI for a given device.
 */
unsigned int rose_new_lci(struct rose_neigh *neigh)
{}

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

/*
 *	Handler for deferred kills.
 */
static void rose_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 rose_destroy_socket(struct sock *sk)
{}

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

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

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

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

static struct proto rose_proto =;

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

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

static int rose_release(struct socket *sock)
{}

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

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

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

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

int rose_rx_call_request(struct sk_buff *skb, struct net_device *dev, struct rose_neigh *neigh, unsigned int lci)
{}

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


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


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

#ifdef CONFIG_PROC_FS
static void *rose_info_start(struct seq_file *seq, loff_t *pos)
	__acquires(rose_list_lock)
{}

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

static void rose_info_stop(struct seq_file *seq, void *v)
	__releases(rose_list_lock)
{}

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

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

static const struct net_proto_family rose_family_ops =;

static const struct proto_ops rose_proto_ops =;

static struct notifier_block rose_dev_notifier =;

static struct net_device **dev_rose;

static struct ax25_protocol rose_pid =;

static struct ax25_linkfail rose_linkfail_notifier =;

static int __init rose_proto_init(void)
{}
module_init();

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

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

static void __exit rose_exit(void)
{}

module_exit(rose_exit);