#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)
{ … }
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)
{ … }