#include <linux/module.h>
#include <linux/random.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/vmalloc.h>
#include <linux/memblock.h>
#include <net/addrconf.h>
#include <net/inet_connection_sock.h>
#include <net/inet_hashtables.h>
#if IS_ENABLED(CONFIG_IPV6)
#include <net/inet6_hashtables.h>
#endif
#include <net/secure_seq.h>
#include <net/hotdata.h>
#include <net/ip.h>
#include <net/tcp.h>
#include <net/sock_reuseport.h>
u32 inet_ehashfn(const struct net *net, const __be32 laddr,
const __u16 lport, const __be32 faddr,
const __be16 fport)
{ … }
EXPORT_SYMBOL_GPL(…);
static u32 sk_ehashfn(const struct sock *sk)
{ … }
struct inet_bind_bucket *inet_bind_bucket_create(struct kmem_cache *cachep,
struct net *net,
struct inet_bind_hashbucket *head,
const unsigned short snum,
int l3mdev)
{ … }
void inet_bind_bucket_destroy(struct kmem_cache *cachep, struct inet_bind_bucket *tb)
{ … }
bool inet_bind_bucket_match(const struct inet_bind_bucket *tb, const struct net *net,
unsigned short port, int l3mdev)
{ … }
static void inet_bind2_bucket_init(struct inet_bind2_bucket *tb2,
struct net *net,
struct inet_bind_hashbucket *head,
struct inet_bind_bucket *tb,
const struct sock *sk)
{ … }
struct inet_bind2_bucket *inet_bind2_bucket_create(struct kmem_cache *cachep,
struct net *net,
struct inet_bind_hashbucket *head,
struct inet_bind_bucket *tb,
const struct sock *sk)
{ … }
void inet_bind2_bucket_destroy(struct kmem_cache *cachep, struct inet_bind2_bucket *tb)
{ … }
static bool inet_bind2_bucket_addr_match(const struct inet_bind2_bucket *tb2,
const struct sock *sk)
{ … }
void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
struct inet_bind2_bucket *tb2, unsigned short port)
{ … }
static void __inet_put_port(struct sock *sk)
{ … }
void inet_put_port(struct sock *sk)
{ … }
EXPORT_SYMBOL(…);
int __inet_inherit_port(const struct sock *sk, struct sock *child)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct inet_listen_hashbucket *
inet_lhash2_bucket_sk(struct inet_hashinfo *h, struct sock *sk)
{ … }
static inline int compute_score(struct sock *sk, struct net *net,
const unsigned short hnum, const __be32 daddr,
const int dif, const int sdif)
{ … }
struct sock *inet_lookup_reuseport(struct net *net, struct sock *sk,
struct sk_buff *skb, int doff,
__be32 saddr, __be16 sport,
__be32 daddr, unsigned short hnum,
inet_ehashfn_t *ehashfn)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct sock *inet_lhash2_lookup(struct net *net,
struct inet_listen_hashbucket *ilb2,
struct sk_buff *skb, int doff,
const __be32 saddr, __be16 sport,
const __be32 daddr, const unsigned short hnum,
const int dif, const int sdif)
{ … }
struct sock *inet_lookup_run_sk_lookup(struct net *net,
int protocol,
struct sk_buff *skb, int doff,
__be32 saddr, __be16 sport,
__be32 daddr, u16 hnum, const int dif,
inet_ehashfn_t *ehashfn)
{ … }
struct sock *__inet_lookup_listener(struct net *net,
struct inet_hashinfo *hashinfo,
struct sk_buff *skb, int doff,
const __be32 saddr, __be16 sport,
const __be32 daddr, const unsigned short hnum,
const int dif, const int sdif)
{ … }
EXPORT_SYMBOL_GPL(…);
void sock_gen_put(struct sock *sk)
{ … }
EXPORT_SYMBOL_GPL(…);
void sock_edemux(struct sk_buff *skb)
{ … }
EXPORT_SYMBOL(…);
struct sock *__inet_lookup_established(struct net *net,
struct inet_hashinfo *hashinfo,
const __be32 saddr, const __be16 sport,
const __be32 daddr, const u16 hnum,
const int dif, const int sdif)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __inet_check_established(struct inet_timewait_death_row *death_row,
struct sock *sk, __u16 lport,
struct inet_timewait_sock **twp)
{ … }
static u64 inet_sk_port_offset(const struct sock *sk)
{ … }
static bool inet_ehash_lookup_by_sk(struct sock *sk,
struct hlist_nulls_head *list)
{ … }
bool inet_ehash_insert(struct sock *sk, struct sock *osk, bool *found_dup_sk)
{ … }
bool inet_ehash_nolisten(struct sock *sk, struct sock *osk, bool *found_dup_sk)
{ … }
EXPORT_SYMBOL_GPL(…);
static int inet_reuseport_add_sock(struct sock *sk,
struct inet_listen_hashbucket *ilb)
{ … }
int __inet_hash(struct sock *sk, struct sock *osk)
{ … }
EXPORT_SYMBOL(…);
int inet_hash(struct sock *sk)
{ … }
EXPORT_SYMBOL_GPL(…);
void inet_unhash(struct sock *sk)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool inet_bind2_bucket_match(const struct inet_bind2_bucket *tb,
const struct net *net, unsigned short port,
int l3mdev, const struct sock *sk)
{ … }
bool inet_bind2_bucket_match_addr_any(const struct inet_bind2_bucket *tb, const struct net *net,
unsigned short port, int l3mdev, const struct sock *sk)
{ … }
struct inet_bind2_bucket *
inet_bind2_bucket_find(const struct inet_bind_hashbucket *head, const struct net *net,
unsigned short port, int l3mdev, const struct sock *sk)
{ … }
struct inet_bind_hashbucket *
inet_bhash2_addr_any_hashbucket(const struct sock *sk, const struct net *net, int port)
{ … }
static void inet_update_saddr(struct sock *sk, void *saddr, int family)
{ … }
static int __inet_bhash2_update_saddr(struct sock *sk, void *saddr, int family, bool reset)
{ … }
int inet_bhash2_update_saddr(struct sock *sk, void *saddr, int family)
{ … }
EXPORT_SYMBOL_GPL(…);
void inet_bhash2_reset_saddr(struct sock *sk)
{ … }
EXPORT_SYMBOL_GPL(…);
#define INET_TABLE_PERTURB_SIZE …
static u32 *table_perturb;
int __inet_hash_connect(struct inet_timewait_death_row *death_row,
struct sock *sk, u64 port_offset,
int (*check_established)(struct inet_timewait_death_row *,
struct sock *, __u16, struct inet_timewait_sock **))
{ … }
int inet_hash_connect(struct inet_timewait_death_row *death_row,
struct sock *sk)
{ … }
EXPORT_SYMBOL_GPL(…);
static void init_hashinfo_lhash2(struct inet_hashinfo *h)
{ … }
void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
unsigned long numentries, int scale,
unsigned long low_limit,
unsigned long high_limit)
{ … }
int inet_hashinfo2_init_mod(struct inet_hashinfo *h)
{ … }
EXPORT_SYMBOL_GPL(…);
int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)
{ … }
EXPORT_SYMBOL_GPL(…);
struct inet_hashinfo *inet_pernet_hashinfo_alloc(struct inet_hashinfo *hashinfo,
unsigned int ehash_entries)
{ … }
EXPORT_SYMBOL_GPL(…);
void inet_pernet_hashinfo_free(struct inet_hashinfo *hashinfo)
{ … }
EXPORT_SYMBOL_GPL(…);