Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
inet_hashtables.h File Reference
#include <linux/interrupt.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/socket.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/wait.h>
#include <linux/vmalloc.h>
#include <net/inet_connection_sock.h>
#include <net/inet_sock.h>
#include <net/sock.h>
#include <net/route.h>
#include <net/tcp_states.h>
#include <net/netns/hash.h>
#include <linux/atomic.h>
#include <asm/byteorder.h>

Go to the source code of this file.

Data Structures

struct  inet_ehash_bucket
 
struct  inet_bind_bucket
 
struct  inet_bind_hashbucket
 
struct  inet_listen_hashbucket
 
struct  inet_hashinfo
 

Macros

#define inet_bind_bucket_for_each(tb, pos, head)   hlist_for_each_entry(tb, pos, head, node)
 
#define LISTENING_NULLS_BASE   (1U << 29)
 
#define INET_LHTABLE_SIZE   32 /* Yes, really, this is all you need. */
 
#define INET_COMBINED_PORTS(__sport, __dport)   ((__force __portpair)(((__u32)(__dport) << 16) | (__force __u32)(__be16)(__sport)))
 
#define INET_ADDR_COOKIE(__name, __saddr, __daddr)
 
#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)
 
#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)
 

Typedefs

typedef __u32 __bitwise __portpair
 

Functions

struct inet_bind_bucketinet_bind_bucket_create (struct kmem_cache *cachep, struct net *net, struct inet_bind_hashbucket *head, const unsigned short snum)
 
void inet_bind_bucket_destroy (struct kmem_cache *cachep, struct inet_bind_bucket *tb)
 
void inet_bind_hash (struct sock *sk, struct inet_bind_bucket *tb, const unsigned short snum)
 
int __inet_inherit_port (struct sock *sk, struct sock *child)
 
void inet_put_port (struct sock *sk)
 
void inet_hashinfo_init (struct inet_hashinfo *h)
 
int __inet_hash_nolisten (struct sock *sk, struct inet_timewait_sock *tw)
 
void inet_hash (struct sock *sk)
 
void inet_unhash (struct sock *sk)
 
struct sock__inet_lookup_listener (struct net *net, struct inet_hashinfo *hashinfo, const __be32 daddr, const unsigned short hnum, const int dif)
 
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)
 
int __inet_hash_connect (struct inet_timewait_death_row *death_row, struct sock *sk, u32 port_offset, int(*check_established)(struct inet_timewait_death_row *, struct sock *, __u16, struct inet_timewait_sock **), int(*hash)(struct sock *sk, struct inet_timewait_sock *twp))
 
int inet_hash_connect (struct inet_timewait_death_row *death_row, struct sock *sk)
 

Macro Definition Documentation

#define INET_ADDR_COOKIE (   __name,
  __saddr,
  __daddr 
)

Definition at line 313 of file inet_hashtables.h.

#define inet_bind_bucket_for_each (   tb,
  pos,
  head 
)    hlist_for_each_entry(tb, pos, head, node)

Definition at line 95 of file inet_hashtables.h.

#define INET_COMBINED_PORTS (   __sport,
  __dport 
)    ((__force __portpair)(((__u32)(__dport) << 16) | (__force __u32)(__be16)(__sport)))

Definition at line 285 of file inet_hashtables.h.

#define INET_LHTABLE_SIZE   32 /* Yes, really, this is all you need. */

Definition at line 116 of file inet_hashtables.h.

#define INET_MATCH (   __sk,
  __net,
  __hash,
  __cookie,
  __saddr,
  __daddr,
  __ports,
  __dif 
)
Value:
(((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
(inet_sk(__sk)->inet_daddr == (__saddr)) && \
(inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \
((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \
(!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))

Definition at line 314 of file inet_hashtables.h.

#define INET_TW_MATCH (   __sk,
  __net,
  __hash,
  __cookie,
  __saddr,
  __daddr,
  __ports,
  __dif 
)
Value:
(((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \
(inet_twsk(__sk)->tw_daddr == (__saddr)) && \
(inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \
((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \
(!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))

Definition at line 320 of file inet_hashtables.h.

#define LISTENING_NULLS_BASE   (1U << 29)

Definition at line 109 of file inet_hashtables.h.

Typedef Documentation

Definition at line 280 of file inet_hashtables.h.

Function Documentation

int __inet_hash_connect ( struct inet_timewait_death_row death_row,
struct sock sk,
u32  port_offset,
int(*)(struct inet_timewait_death_row *, struct sock *, __u16, struct inet_timewait_sock **)  check_established,
int(*)(struct sock *sk, struct inet_timewait_sock *twp)  hash 
)

Definition at line 454 of file inet_hashtables.c.

int __inet_hash_nolisten ( struct sock sk,
struct inet_timewait_sock tw 
)

Definition at line 376 of file inet_hashtables.c.

int __inet_inherit_port ( struct sock sk,
struct sock child 
)

Definition at line 105 of file inet_hashtables.c.

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 
)
read

Definition at line 220 of file inet_hashtables.c.

struct sock* __inet_lookup_listener ( struct net net,
struct inet_hashinfo hashinfo,
const __be32  daddr,
const unsigned short  hnum,
const int  dif 
)
read

Definition at line 177 of file inet_hashtables.c.

struct inet_bind_bucket* inet_bind_bucket_create ( struct kmem_cache cachep,
struct net net,
struct inet_bind_hashbucket head,
const unsigned short  snum 
)
read

Definition at line 31 of file inet_hashtables.c.

void inet_bind_bucket_destroy ( struct kmem_cache cachep,
struct inet_bind_bucket tb 
)

Definition at line 52 of file inet_hashtables.c.

void inet_bind_hash ( struct sock sk,
struct inet_bind_bucket tb,
const unsigned short  snum 
)

Definition at line 61 of file inet_hashtables.c.

void inet_hash ( struct sock sk)

Definition at line 422 of file inet_hashtables.c.

int inet_hash_connect ( struct inet_timewait_death_row death_row,
struct sock sk 
)

Definition at line 565 of file inet_hashtables.c.

void inet_hashinfo_init ( struct inet_hashinfo h)

Definition at line 573 of file inet_hashtables.c.

void inet_put_port ( struct sock sk)

Definition at line 97 of file inet_hashtables.c.

void inet_unhash ( struct sock sk)

Definition at line 432 of file inet_hashtables.c.