linux/net/ax25/af_ax25.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 * Copyright (C) Alan Cox GW4PTS ([email protected])
 * Copyright (C) Jonathan Naylor G4KLX ([email protected])
 * Copyright (C) Darryl Miles G7LED ([email protected])
 * Copyright (C) Steven Whitehouse GW7RRM ([email protected])
 * Copyright (C) Joerg Reuter DL1BKE ([email protected])
 * Copyright (C) Hans-Joachim Hetscher DD8NE ([email protected])
 * Copyright (C) Hans Alblas PE1AYX ([email protected])
 * Copyright (C) Frederic Rible F1OAT ([email protected])
 */
#include <linux/capability.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/in.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/slab.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>	/* For TIOCINQ/OUTQ */
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/sysctl.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <net/net_namespace.h>
#include <net/tcp_states.h>
#include <net/ip.h>
#include <net/arp.h>



HLIST_HEAD(ax25_list);
DEFINE_SPINLOCK();

static const struct proto_ops ax25_proto_ops;

static void ax25_free_sock(struct sock *sk)
{}

/*
 *	Socket removal during an interrupt is now safe.
 */
static void ax25_cb_del(ax25_cb *ax25)
{}

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

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

/*
 *	Add a socket to the bound sockets list.
 */
void ax25_cb_add(ax25_cb *ax25)
{}

/*
 *	Find a socket that wants to accept the SABM we have just
 *	received.
 */
struct sock *ax25_find_listener(ax25_address *addr, int digi,
	struct net_device *dev, int type)
{}

/*
 *	Find an AX.25 socket given both ends.
 */
struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
	int type)
{}

/*
 *	Find an AX.25 control block given both ends. It will only pick up
 *	floating AX.25 control blocks or non Raw socket bound control blocks.
 */
ax25_cb *ax25_find_cb(const ax25_address *src_addr, ax25_address *dest_addr,
	ax25_digi *digi, struct net_device *dev)
{}

EXPORT_SYMBOL();

void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
{}

/*
 *	Deferred destroy.
 */
void ax25_destroy_socket(ax25_cb *);

/*
 *	Handler for deferred kills.
 */
static void ax25_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 ax25_destroy_socket(ax25_cb *ax25)
{}

/*
 * dl1bke 960311: set parameters for existing AX.25 connections,
 *		  includes a KILL command to abort any connection.
 *		  VERY useful for debugging ;-)
 */
static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
{}

static void ax25_fillin_cb_from_dev(ax25_cb *ax25, ax25_dev *ax25_dev)
{}

/*
 *	Fill in a created AX.25 created control block with the default
 *	values for a particular device.
 */
void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev)
{}

/*
 * Create an empty AX.25 control block.
 */
ax25_cb *ax25_create_cb(void)
{}

/*
 *	Handling for system calls applied via the various interfaces to an
 *	AX25 socket object
 */

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

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

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

/*
 * XXX: when creating ax25_sock we should update the .obj_size setting
 * below.
 */
static struct proto ax25_proto =;

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

struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev)
{}

static int ax25_release(struct socket *sock)
{}

/*
 *	We support a funny extension here so you can (as root) give any callsign
 *	digipeated via a local address as source. This hack is obsolete now
 *	that we've implemented support for SO_BINDTODEVICE. It is however small
 *	and trivially backward compatible.
 */
static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{}

/*
 *	FIXME: nonblock behaviour looks like it may have a bug.
 */
static int __must_check ax25_connect(struct socket *sock,
	struct sockaddr *uaddr, int addr_len, int flags)
{}

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

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

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

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

static int ax25_shutdown(struct socket *sk, int how)
{}

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

#ifdef CONFIG_PROC_FS

static void *ax25_info_start(struct seq_file *seq, loff_t *pos)
	__acquires(ax25_list_lock)
{}

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

static void ax25_info_stop(struct seq_file *seq, void *v)
	__releases(ax25_list_lock)
{}

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

static const struct seq_operations ax25_info_seqops =;
#endif

static const struct net_proto_family ax25_family_ops =;

static const struct proto_ops ax25_proto_ops =;

/*
 *	Called by socket.c on kernel start up
 */
static struct packet_type ax25_packet_type __read_mostly =;

static struct notifier_block ax25_dev_notifier =;

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


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

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