linux/net/x25/af_x25.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	X.25 Packet Layer release 002
 *
 *	This is ALPHA test software. This code may break your machine,
 *	randomly fail to work with new releases, misbehave and/or generally
 *	screw up. It might even work.
 *
 *	This code REQUIRES 2.1.15 or higher
 *
 *	History
 *	X.25 001	Jonathan Naylor	Started coding.
 *	X.25 002	Jonathan Naylor	Centralised disconnect handling.
 *					New timer architecture.
 *	2000-03-11	Henner Eisen	MSG_EOR handling more POSIX compliant.
 *	2000-03-22	Daniela Squassoni Allowed disabling/enabling of
 *					  facilities negotiation and increased
 *					  the throughput upper limit.
 *	2000-08-27	Arnaldo C. Melo s/suser/capable/ + micro cleanups
 *	2000-09-04	Henner Eisen	Set sock->state in x25_accept().
 *					Fixed x25_output() related skb leakage.
 *	2000-10-02	Henner Eisen	Made x25_kick() single threaded per socket.
 *	2000-10-27	Henner Eisen    MSG_DONTWAIT for fragment allocation.
 *	2000-11-14	Henner Eisen    Closing datalink from NETDEV_GOING_DOWN
 *	2002-10-06	Arnaldo C. Melo Get rid of cli/sti, move proc stuff to
 *					x25_proc.c, using seq_file
 *	2005-04-02	Shaun Pereira	Selective sub address matching
 *					with call user data
 *	2005-04-15	Shaun Pereira	Fast select with no restriction on
 *					response
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched/signal.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <net/sock.h>
#include <net/tcp_states.h>
#include <linux/uaccess.h>
#include <linux/fcntl.h>
#include <linux/termios.h>	/* For TIOCINQ/OUTQ */
#include <linux/notifier.h>
#include <linux/init.h>
#include <linux/compat.h>
#include <linux/ctype.h>

#include <net/x25.h>
#include <net/compat.h>

int sysctl_x25_restart_request_timeout =;
int sysctl_x25_call_request_timeout    =;
int sysctl_x25_reset_request_timeout   =;
int sysctl_x25_clear_request_timeout   =;
int sysctl_x25_ack_holdback_timeout    =;
int sysctl_x25_forward                 =;

HLIST_HEAD(x25_list);
DEFINE_RWLOCK();

static const struct proto_ops x25_proto_ops;

static const struct x25_address null_x25_address =;

#ifdef CONFIG_COMPAT
struct compat_x25_subscrip_struct {};
#endif


int x25_parse_address_block(struct sk_buff *skb,
		struct x25_address *called_addr,
		struct x25_address *calling_addr)
{}


int x25_addr_ntoa(unsigned char *p, struct x25_address *called_addr,
		  struct x25_address *calling_addr)
{}

int x25_addr_aton(unsigned char *p, struct x25_address *called_addr,
		  struct x25_address *calling_addr)
{}

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

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

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

/*
 *	Find a socket that wants to accept the Call Request we just
 *	received. Check the full list for an address/cud match.
 *	If no cuds match return the next_best thing, an address match.
 *	Note: if a listening socket has cud set it must only get calls
 *	with matching cud.
 */
static struct sock *x25_find_listener(struct x25_address *addr,
					struct sk_buff *skb)
{}

/*
 *	Find a connected X.25 socket given my LCI and neighbour.
 */
static struct sock *__x25_find_socket(unsigned int lci, struct x25_neigh *nb)
{}

struct sock *x25_find_socket(unsigned int lci, struct x25_neigh *nb)
{}

/*
 *	Find a unique LCI for a given device.
 */
static unsigned int x25_new_lci(struct x25_neigh *nb)
{}

/*
 *	Deferred destroy.
 */
static void __x25_destroy_socket(struct sock *);

/*
 *	handler for deferred kills.
 */
static void x25_destroy_timer(struct timer_list *t)
{}

/*
 *	This is called from user mode and the timers. Thus it protects itself
 *	against interrupting 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.
 *	Not static as it's used by the timer
 */
static void __x25_destroy_socket(struct sock *sk)
{}

void x25_destroy_socket_from_timer(struct sock *sk)
{}

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

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

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

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

static struct proto x25_proto =;

static struct sock *x25_alloc_socket(struct net *net, int kern)
{}

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

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

static int x25_release(struct socket *sock)
{}

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

static int x25_wait_for_connection_establishment(struct sock *sk)
{}

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

static int x25_wait_for_data(struct sock *sk, long timeout)
{}

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

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

int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
			unsigned int lci)
{}

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


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


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

static const struct net_proto_family x25_family_ops =;

#ifdef CONFIG_COMPAT
static int compat_x25_subscr_ioctl(unsigned int cmd,
		struct compat_x25_subscrip_struct __user *x25_subscr32)
{}

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

static const struct proto_ops x25_proto_ops =;

static struct packet_type x25_packet_type __read_mostly =;

static struct notifier_block x25_dev_notifier =;

void x25_kill_by_neigh(struct x25_neigh *nb)
{}

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

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

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