Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
inetpeer.c File Reference
#include <linux/module.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/random.h>
#include <linux/timer.h>
#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/net.h>
#include <linux/workqueue.h>
#include <net/ip.h>
#include <net/inetpeer.h>
#include <net/secure_seq.h>

Go to the source code of this file.

Macros

#define node_height(x)   x->avl_height
 
#define peer_avl_empty   ((struct inet_peer *)&peer_fake_node)
 
#define peer_avl_empty_rcu   ((struct inet_peer __rcu __force *)&peer_fake_node)
 
#define PEER_MAXDEPTH   40 /* sufficient for about 2^27 nodes */
 
#define rcu_deref_locked(X, BASE)   rcu_dereference_protected(X, lockdep_is_held(&(BASE)->lock.lock))
 
#define lookup(_daddr, _stack, _base)
 
#define lookup_rightempty(start, base)
 
#define link_to_pool(n, base)
 
#define XRLIM_BURST_FACTOR   6
 

Functions

void inet_peer_base_init (struct inet_peer_base *bp)
 
 EXPORT_SYMBOL_GPL (inet_peer_base_init)
 
void inetpeer_invalidate_family (int family)
 
void __init inet_initpeers (void)
 
struct inet_peerinet_getpeer (struct inet_peer_base *base, const struct inetpeer_addr *daddr, int create)
 
 EXPORT_SYMBOL_GPL (inet_getpeer)
 
void inet_putpeer (struct inet_peer *p)
 
 EXPORT_SYMBOL_GPL (inet_putpeer)
 
bool inet_peer_xrlim_allow (struct inet_peer *peer, int timeout)
 
 EXPORT_SYMBOL (inet_peer_xrlim_allow)
 
void inetpeer_invalidate_tree (struct inet_peer_base *base)
 
 EXPORT_SYMBOL (inetpeer_invalidate_tree)
 

Macro Definition Documentation

#define link_to_pool (   n,
  base 
)
Value:
do { \
n->avl_height = 1; \
n->avl_left = peer_avl_empty_rcu; \
n->avl_right = peer_avl_empty_rcu; \
/* lockless readers can catch us now */ \
rcu_assign_pointer(**--stackptr, n); \
peer_avl_rebalance(stack, stackptr, base); \
} while (0)

Definition at line 375 of file inetpeer.c.

#define lookup (   _daddr,
  _stack,
  _base 
)
Value:
({ \
\
stackptr = _stack; \
*stackptr++ = &_base->root; \
for (u = rcu_deref_locked(_base->root, _base); \
u != peer_avl_empty; ) { \
int cmp = addr_compare(_daddr, &u->daddr); \
if (cmp == 0) \
break; \
if (cmp == -1) \
v = &u->avl_left; \
else \
v = &u->avl_right; \
*stackptr++ = v; \
u = rcu_deref_locked(*v, _base); \
} \
u; \
})

Definition at line 222 of file inetpeer.c.

#define lookup_rightempty (   start,
  base 
)
Value:
({ \
*stackptr++ = &start->avl_left; \
v = &start->avl_left; \
for (u = rcu_deref_locked(*v, base); \
u->avl_right != peer_avl_empty_rcu; ) { \
v = &u->avl_right; \
*stackptr++ = v; \
u = rcu_deref_locked(*v, base); \
} \
u; \
})

Definition at line 278 of file inetpeer.c.

#define node_height (   x)    x->avl_height

Definition at line 75 of file inetpeer.c.

#define peer_avl_empty   ((struct inet_peer *)&peer_fake_node)

Definition at line 77 of file inetpeer.c.

#define peer_avl_empty_rcu   ((struct inet_peer __rcu __force *)&peer_fake_node)

Definition at line 78 of file inetpeer.c.

#define PEER_MAXDEPTH   40 /* sufficient for about 2^27 nodes */

Definition at line 119 of file inetpeer.c.

#define rcu_deref_locked (   X,
  BASE 
)    rcu_dereference_protected(X, lockdep_is_held(&(BASE)->lock.lock))

Definition at line 216 of file inetpeer.c.

#define XRLIM_BURST_FACTOR   6

Definition at line 554 of file inetpeer.c.

Function Documentation

EXPORT_SYMBOL ( inet_peer_xrlim_allow  )
EXPORT_SYMBOL ( inetpeer_invalidate_tree  )
EXPORT_SYMBOL_GPL ( inet_peer_base_init  )
EXPORT_SYMBOL_GPL ( inet_getpeer  )
EXPORT_SYMBOL_GPL ( inet_putpeer  )
struct inet_peer* inet_getpeer ( struct inet_peer_base base,
const struct inetpeer_addr daddr,
int  create 
)
read

Definition at line 459 of file inetpeer.c.

void __init inet_initpeers ( void  )

Definition at line 175 of file inetpeer.c.

void inet_peer_base_init ( struct inet_peer_base bp)

Definition at line 85 of file inetpeer.c.

bool inet_peer_xrlim_allow ( struct inet_peer peer,
int  timeout 
)

Definition at line 555 of file inetpeer.c.

void inet_putpeer ( struct inet_peer p)

Definition at line 529 of file inetpeer.c.

void inetpeer_invalidate_family ( int  family)

Definition at line 112 of file inetpeer.c.

void inetpeer_invalidate_tree ( struct inet_peer_base base)

Definition at line 589 of file inetpeer.c.