#include <linux/gfp.h>
#include <linux/kernel.h>
#include <linux/net.h>
#include <linux/poll.h>
#include <linux/sched/signal.h>
#include <net/sock.h>
#include <net/tcp_states.h>
#include <linux/phonet.h>
#include <linux/export.h>
#include <net/phonet/phonet.h>
#include <net/phonet/pep.h>
#include <net/phonet/pn_dev.h>
static int pn_socket_release(struct socket *sock)
{ … }
#define PN_HASHSIZE …
#define PN_HASHMASK …
static struct { … } pnsocks;
void __init pn_sock_init(void)
{ … }
static struct hlist_head *pn_hash_list(u16 obj)
{ … }
struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *spn)
{ … }
void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb)
{ … }
int pn_sock_hash(struct sock *sk)
{ … }
EXPORT_SYMBOL(…);
void pn_sock_unhash(struct sock *sk)
{ … }
EXPORT_SYMBOL(…);
static DEFINE_MUTEX(port_mutex);
static int pn_socket_bind(struct socket *sock, struct sockaddr *addr, int len)
{ … }
static int pn_socket_autobind(struct socket *sock)
{ … }
static int pn_socket_connect(struct socket *sock, struct sockaddr *addr,
int len, int flags)
{ … }
static int pn_socket_accept(struct socket *sock, struct socket *newsock,
struct proto_accept_arg *arg)
{ … }
static int pn_socket_getname(struct socket *sock, struct sockaddr *addr,
int peer)
{ … }
static __poll_t pn_socket_poll(struct file *file, struct socket *sock,
poll_table *wait)
{ … }
static int pn_socket_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg)
{ … }
static int pn_socket_listen(struct socket *sock, int backlog)
{ … }
static int pn_socket_sendmsg(struct socket *sock, struct msghdr *m,
size_t total_len)
{ … }
const struct proto_ops phonet_dgram_ops = …;
const struct proto_ops phonet_stream_ops = …;
EXPORT_SYMBOL(…);
int pn_sock_get_port(struct sock *sk, unsigned short sport)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_PROC_FS
static struct sock *pn_sock_get_idx(struct seq_file *seq, loff_t pos)
{ … }
static struct sock *pn_sock_get_next(struct seq_file *seq, struct sock *sk)
{ … }
static void *pn_sock_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(rcu)
{ … }
static void *pn_sock_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ … }
static void pn_sock_seq_stop(struct seq_file *seq, void *v)
__releases(rcu)
{ … }
static int pn_sock_seq_show(struct seq_file *seq, void *v)
{ … }
const struct seq_operations pn_sock_seq_ops = …;
#endif
static struct { … } pnres;
struct sock *pn_find_sock_by_res(struct net *net, u8 res)
{ … }
static DEFINE_MUTEX(resource_mutex);
int pn_sock_bind_res(struct sock *sk, u8 res)
{ … }
int pn_sock_unbind_res(struct sock *sk, u8 res)
{ … }
void pn_sock_unbind_all_res(struct sock *sk)
{ … }
#ifdef CONFIG_PROC_FS
static struct sock **pn_res_get_idx(struct seq_file *seq, loff_t pos)
{ … }
static struct sock **pn_res_get_next(struct seq_file *seq, struct sock **sk)
{ … }
static void *pn_res_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(resource_mutex)
{ … }
static void *pn_res_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ … }
static void pn_res_seq_stop(struct seq_file *seq, void *v)
__releases(resource_mutex)
{ … }
static int pn_res_seq_show(struct seq_file *seq, void *v)
{ … }
const struct seq_operations pn_res_seq_ops = …;
#endif