linux/net/bluetooth/l2cap_sock.c

/*
   BlueZ - Bluetooth protocol stack for Linux
   Copyright (C) 2000-2001 Qualcomm Incorporated
   Copyright (C) 2009-2010 Gustavo F. Padovan <[email protected]>
   Copyright (C) 2010 Google Inc.
   Copyright (C) 2011 ProFUSION Embedded Systems

   Written 2000,2001 by Maxim Krasnyansky <[email protected]>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 2 as
   published by the Free Software Foundation;

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
   SOFTWARE IS DISCLAIMED.
*/

/* Bluetooth L2CAP sockets. */

#include <linux/module.h>
#include <linux/export.h>
#include <linux/filter.h>
#include <linux/sched/signal.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/l2cap.h>

#include "smp.h"

static struct bt_sock_list l2cap_sk_list =;

static const struct proto_ops l2cap_sock_ops;
static void l2cap_sock_init(struct sock *sk, struct sock *parent);
static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
				     int proto, gfp_t prio, int kern);
static void l2cap_sock_cleanup_listen(struct sock *parent);

bool l2cap_is_socket(struct socket *sock)
{}
EXPORT_SYMBOL();

static int l2cap_validate_bredr_psm(u16 psm)
{}

static int l2cap_validate_le_psm(u16 psm)
{}

static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
{}

static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr,
			      int alen, int flags)
{}

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

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

static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr,
			      int peer)
{}

static int l2cap_get_mode(struct l2cap_chan *chan)
{}

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

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

static bool l2cap_valid_mtu(struct l2cap_chan *chan, u16 mtu)
{}

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

static int l2cap_set_mode(struct l2cap_chan *chan, u8 mode)
{}

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

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

static void l2cap_publish_rx_avail(struct l2cap_chan *chan)
{}

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

/* Kill socket (only if zapped and orphan)
 * Must be called on unlocked socket, with l2cap channel lock.
 */
static void l2cap_sock_kill(struct sock *sk)
{}

static int __l2cap_wait_ack(struct sock *sk, struct l2cap_chan *chan)
{}

static int l2cap_sock_shutdown(struct socket *sock, int how)
{}

static int l2cap_sock_release(struct socket *sock)
{}

static void l2cap_sock_cleanup_listen(struct sock *parent)
{}

static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
{}

static int l2cap_sock_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
{}

static void l2cap_sock_close_cb(struct l2cap_chan *chan)
{}

static void l2cap_sock_teardown_cb(struct l2cap_chan *chan, int err)
{}

static void l2cap_sock_state_change_cb(struct l2cap_chan *chan, int state,
				       int err)
{}

static struct sk_buff *l2cap_sock_alloc_skb_cb(struct l2cap_chan *chan,
					       unsigned long hdr_len,
					       unsigned long len, int nb)
{}

static void l2cap_sock_ready_cb(struct l2cap_chan *chan)
{}

static void l2cap_sock_defer_cb(struct l2cap_chan *chan)
{}

static void l2cap_sock_resume_cb(struct l2cap_chan *chan)
{}

static void l2cap_sock_set_shutdown_cb(struct l2cap_chan *chan)
{}

static long l2cap_sock_get_sndtimeo_cb(struct l2cap_chan *chan)
{}

static struct pid *l2cap_sock_get_peer_pid_cb(struct l2cap_chan *chan)
{}

static void l2cap_sock_suspend_cb(struct l2cap_chan *chan)
{}

static int l2cap_sock_filter(struct l2cap_chan *chan, struct sk_buff *skb)
{}

static const struct l2cap_ops l2cap_chan_ops =;

static void l2cap_sock_destruct(struct sock *sk)
{}

static void l2cap_skb_msg_name(struct sk_buff *skb, void *msg_name,
			       int *msg_namelen)
{}

static void l2cap_sock_init(struct sock *sk, struct sock *parent)
{}

static struct proto l2cap_proto =;

static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
				     int proto, gfp_t prio, int kern)
{}

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

static const struct proto_ops l2cap_sock_ops =;

static const struct net_proto_family l2cap_sock_family_ops =;

int __init l2cap_init_sockets(void)
{}

void l2cap_cleanup_sockets(void)
{}