#include <linux/filter.h>
#include <linux/mutex.h>
#include <linux/socket.h>
#include <linux/skbuff.h>
#include <net/netlink.h>
#include <net/net_namespace.h>
#include <linux/module.h>
#include <net/sock.h>
#include <linux/kernel.h>
#include <linux/tcp.h>
#include <linux/workqueue.h>
#include <linux/nospec.h>
#include <linux/cookie.h>
#include <linux/inet_diag.h>
#include <linux/sock_diag.h>
static const struct sock_diag_handler __rcu *sock_diag_handlers[AF_MAX];
static const struct sock_diag_inet_compat __rcu *inet_rcv_compat;
static struct workqueue_struct *broadcast_wq;
DEFINE_COOKIE(…);
u64 __sock_gen_cookie(struct sock *sk)
{ … }
int sock_diag_check_cookie(struct sock *sk, const __u32 *cookie)
{ … }
EXPORT_SYMBOL_GPL(…);
void sock_diag_save_cookie(struct sock *sk, __u32 *cookie)
{ … }
EXPORT_SYMBOL_GPL(…);
int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attrtype)
{ … }
EXPORT_SYMBOL_GPL(…);
int sock_diag_put_filterinfo(bool may_report_filterinfo, struct sock *sk,
struct sk_buff *skb, int attrtype)
{ … }
EXPORT_SYMBOL(…);
struct broadcast_sk { … };
static size_t sock_diag_nlmsg_size(void)
{ … }
static const struct sock_diag_handler *sock_diag_lock_handler(int family)
{ … }
static void sock_diag_unlock_handler(const struct sock_diag_handler *handler)
{ … }
static void sock_diag_broadcast_destroy_work(struct work_struct *work)
{ … }
void sock_diag_broadcast_destroy(struct sock *sk)
{ … }
void sock_diag_register_inet_compat(const struct sock_diag_inet_compat *ptr)
{ … }
EXPORT_SYMBOL_GPL(…);
void sock_diag_unregister_inet_compat(const struct sock_diag_inet_compat *ptr)
{ … }
EXPORT_SYMBOL_GPL(…);
int sock_diag_register(const struct sock_diag_handler *hndl)
{ … }
EXPORT_SYMBOL_GPL(…);
void sock_diag_unregister(const struct sock_diag_handler *hndl)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __sock_diag_cmd(struct sk_buff *skb, struct nlmsghdr *nlh)
{ … }
static int sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{ … }
static void sock_diag_rcv(struct sk_buff *skb)
{ … }
static int sock_diag_bind(struct net *net, int group)
{ … }
int sock_diag_destroy(struct sock *sk, int err)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __net_init diag_net_init(struct net *net)
{ … }
static void __net_exit diag_net_exit(struct net *net)
{ … }
static struct pernet_operations diag_net_ops = …;
static int __init sock_diag_init(void)
{ … }
device_initcall(sock_diag_init);