Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
nf_conntrack_core.c File Reference
#include <linux/types.h>
#include <linux/netfilter.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/skbuff.h>
#include <linux/proc_fs.h>
#include <linux/vmalloc.h>
#include <linux/stddef.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/jhash.h>
#include <linux/err.h>
#include <linux/percpu.h>
#include <linux/moduleparam.h>
#include <linux/notifier.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/socket.h>
#include <linux/mm.h>
#include <linux/nsproxy.h>
#include <linux/rculist_nulls.h>
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_l3proto.h>
#include <net/netfilter/nf_conntrack_l4proto.h>
#include <net/netfilter/nf_conntrack_expect.h>
#include <net/netfilter/nf_conntrack_helper.h>
#include <net/netfilter/nf_conntrack_core.h>
#include <net/netfilter/nf_conntrack_extend.h>
#include <net/netfilter/nf_conntrack_acct.h>
#include <net/netfilter/nf_conntrack_ecache.h>
#include <net/netfilter/nf_conntrack_zones.h>
#include <net/netfilter/nf_conntrack_timestamp.h>
#include <net/netfilter/nf_conntrack_timeout.h>
#include <net/netfilter/nf_nat.h>
#include <net/netfilter/nf_nat_core.h>

Go to the source code of this file.

Data Structures

struct  __nf_ct_flush_report
 

Macros

#define NF_CONNTRACK_VERSION   "0.5.0"
 
#define NF_CT_EVICTION_RANGE   8
 
#define UNCONFIRMED_NULLS_VAL   ((1<<30)+0)
 
#define DYING_NULLS_VAL   ((1<<30)+1)
 

Functions

 EXPORT_SYMBOL_GPL (nfnetlink_parse_nat_setup_hook)
 
 EXPORT_SYMBOL_GPL (nf_nat_seq_adjust_hook)
 
 DEFINE_SPINLOCK (nf_conntrack_lock)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_lock)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_htable_size)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_max)
 
 DEFINE_PER_CPU (struct nf_conn, nf_conntrack_untracked)
 
 EXPORT_PER_CPU_SYMBOL (nf_conntrack_untracked)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_hash_rnd)
 
bool nf_ct_get_tuple (const struct sk_buff *skb, unsigned int nhoff, unsigned int dataoff, u_int16_t l3num, u_int8_t protonum, struct nf_conntrack_tuple *tuple, const struct nf_conntrack_l3proto *l3proto, const struct nf_conntrack_l4proto *l4proto)
 
 EXPORT_SYMBOL_GPL (nf_ct_get_tuple)
 
bool nf_ct_get_tuplepr (const struct sk_buff *skb, unsigned int nhoff, u_int16_t l3num, struct nf_conntrack_tuple *tuple)
 
 EXPORT_SYMBOL_GPL (nf_ct_get_tuplepr)
 
bool nf_ct_invert_tuple (struct nf_conntrack_tuple *inverse, const struct nf_conntrack_tuple *orig, const struct nf_conntrack_l3proto *l3proto, const struct nf_conntrack_l4proto *l4proto)
 
 EXPORT_SYMBOL_GPL (nf_ct_invert_tuple)
 
void nf_ct_delete_from_lists (struct nf_conn *ct)
 
 EXPORT_SYMBOL_GPL (nf_ct_delete_from_lists)
 
void nf_ct_insert_dying_list (struct nf_conn *ct)
 
 EXPORT_SYMBOL_GPL (nf_ct_insert_dying_list)
 
struct nf_conntrack_tuple_hash__nf_conntrack_find (struct net *net, u16 zone, const struct nf_conntrack_tuple *tuple)
 
 EXPORT_SYMBOL_GPL (__nf_conntrack_find)
 
struct nf_conntrack_tuple_hashnf_conntrack_find_get (struct net *net, u16 zone, const struct nf_conntrack_tuple *tuple)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_find_get)
 
int nf_conntrack_hash_check_insert (struct nf_conn *ct)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_hash_check_insert)
 
int __nf_conntrack_confirm (struct sk_buff *skb)
 
 EXPORT_SYMBOL_GPL (__nf_conntrack_confirm)
 
int nf_conntrack_tuple_taken (const struct nf_conntrack_tuple *tuple, const struct nf_conn *ignored_conntrack)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_tuple_taken)
 
void init_nf_conntrack_hash_rnd (void)
 
struct nf_connnf_conntrack_alloc (struct net *net, u16 zone, const struct nf_conntrack_tuple *orig, const struct nf_conntrack_tuple *repl, gfp_t gfp)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_alloc)
 
void nf_conntrack_free (struct nf_conn *ct)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_free)
 
unsigned int nf_conntrack_in (struct net *net, u_int8_t pf, unsigned int hooknum, struct sk_buff *skb)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_in)
 
bool nf_ct_invert_tuplepr (struct nf_conntrack_tuple *inverse, const struct nf_conntrack_tuple *orig)
 
 EXPORT_SYMBOL_GPL (nf_ct_invert_tuplepr)
 
void nf_conntrack_alter_reply (struct nf_conn *ct, const struct nf_conntrack_tuple *newreply)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_alter_reply)
 
void __nf_ct_refresh_acct (struct nf_conn *ct, enum ip_conntrack_info ctinfo, const struct sk_buff *skb, unsigned long extra_jiffies, int do_acct)
 
 EXPORT_SYMBOL_GPL (__nf_ct_refresh_acct)
 
bool __nf_ct_kill_acct (struct nf_conn *ct, enum ip_conntrack_info ctinfo, const struct sk_buff *skb, int do_acct)
 
 EXPORT_SYMBOL_GPL (__nf_ct_kill_acct)
 
void nf_ct_iterate_cleanup (struct net *net, int(*iter)(struct nf_conn *i, void *data), void *data)
 
 EXPORT_SYMBOL_GPL (nf_ct_iterate_cleanup)
 
void nf_ct_free_hashtable (void *hash, unsigned int size)
 
 EXPORT_SYMBOL_GPL (nf_ct_free_hashtable)
 
void nf_conntrack_flush_report (struct net *net, u32 pid, int report)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_flush_report)
 
void nf_conntrack_cleanup (struct net *net)
 
voidnf_ct_alloc_hashtable (unsigned int *sizep, int nulls)
 
 EXPORT_SYMBOL_GPL (nf_ct_alloc_hashtable)
 
int nf_conntrack_set_hashsize (const char *val, struct kernel_param *kp)
 
 EXPORT_SYMBOL_GPL (nf_conntrack_set_hashsize)
 
 module_param_call (hashsize, nf_conntrack_set_hashsize, param_get_uint,&nf_conntrack_htable_size, 0600)
 
void nf_ct_untracked_status_or (unsigned long bits)
 
 EXPORT_SYMBOL_GPL (nf_ct_untracked_status_or)
 
 EXPORT_SYMBOL_GPL (nf_ct_nat_offset)
 
int nf_conntrack_init (struct net *net)
 

Variables

int(* nfnetlink_parse_nat_setup_hook )(struct nf_conn *ct, enum nf_nat_manip_type manip, const struct nlattr *attr) __read_mostly
 
int(* nf_nat_seq_adjust_hook )(struct sk_buff *skb, struct nf_conn *ct, enum ip_conntrack_info ctinfo, unsigned int protoff)
 
unsigned int
nf_conntrack_htable_size 
__read_mostly
 
s16(* nf_ct_nat_offset )(const struct nf_conn *ct, enum ip_conntrack_dir dir, u32 seq)
 

Macro Definition Documentation

#define DYING_NULLS_VAL   ((1<<30)+1)

Definition at line 1533 of file nf_conntrack_core.c.

#define NF_CONNTRACK_VERSION   "0.5.0"

Definition at line 51 of file nf_conntrack_core.c.

#define NF_CT_EVICTION_RANGE   8

Definition at line 608 of file nf_conntrack_core.c.

#define UNCONFIRMED_NULLS_VAL   ((1<<30)+0)

Definition at line 1532 of file nf_conntrack_core.c.

Function Documentation

int __nf_conntrack_confirm ( struct sk_buff skb)

Definition at line 466 of file nf_conntrack_core.c.

struct nf_conntrack_tuple_hash* __nf_conntrack_find ( struct net net,
u16  zone,
const struct nf_conntrack_tuple tuple 
)
read

Definition at line 362 of file nf_conntrack_core.c.

bool __nf_ct_kill_acct ( struct nf_conn ct,
enum ip_conntrack_info  ctinfo,
const struct sk_buff skb,
int  do_acct 
)

Definition at line 1116 of file nf_conntrack_core.c.

void __nf_ct_refresh_acct ( struct nf_conn ct,
enum ip_conntrack_info  ctinfo,
const struct sk_buff skb,
unsigned long  extra_jiffies,
int  do_acct 
)

Definition at line 1077 of file nf_conntrack_core.c.

DEFINE_PER_CPU ( struct nf_conn  ,
nf_conntrack_untracked   
)
DEFINE_SPINLOCK ( nf_conntrack_lock  )
EXPORT_PER_CPU_SYMBOL ( nf_conntrack_untracked  )
EXPORT_SYMBOL_GPL ( nfnetlink_parse_nat_setup_hook  )
EXPORT_SYMBOL_GPL ( nf_nat_seq_adjust_hook  )
EXPORT_SYMBOL_GPL ( nf_conntrack_lock  )
EXPORT_SYMBOL_GPL ( nf_conntrack_htable_size  )
EXPORT_SYMBOL_GPL ( nf_conntrack_max  )
EXPORT_SYMBOL_GPL ( nf_conntrack_hash_rnd  )
EXPORT_SYMBOL_GPL ( nf_ct_get_tuple  )
EXPORT_SYMBOL_GPL ( nf_ct_get_tuplepr  )
EXPORT_SYMBOL_GPL ( nf_ct_invert_tuple  )
EXPORT_SYMBOL_GPL ( nf_ct_delete_from_lists  )
EXPORT_SYMBOL_GPL ( nf_ct_insert_dying_list  )
EXPORT_SYMBOL_GPL ( __nf_conntrack_find  )
EXPORT_SYMBOL_GPL ( nf_conntrack_find_get  )
EXPORT_SYMBOL_GPL ( nf_conntrack_hash_check_insert  )
EXPORT_SYMBOL_GPL ( __nf_conntrack_confirm  )
EXPORT_SYMBOL_GPL ( nf_conntrack_tuple_taken  )
EXPORT_SYMBOL_GPL ( nf_conntrack_alloc  )
EXPORT_SYMBOL_GPL ( nf_conntrack_free  )
EXPORT_SYMBOL_GPL ( nf_conntrack_in  )
EXPORT_SYMBOL_GPL ( nf_ct_invert_tuplepr  )
EXPORT_SYMBOL_GPL ( nf_conntrack_alter_reply  )
EXPORT_SYMBOL_GPL ( __nf_ct_refresh_acct  )
EXPORT_SYMBOL_GPL ( __nf_ct_kill_acct  )
EXPORT_SYMBOL_GPL ( nf_ct_iterate_cleanup  )
EXPORT_SYMBOL_GPL ( nf_ct_free_hashtable  )
EXPORT_SYMBOL_GPL ( nf_conntrack_flush_report  )
EXPORT_SYMBOL_GPL ( nf_ct_alloc_hashtable  )
EXPORT_SYMBOL_GPL ( nf_conntrack_set_hashsize  )
EXPORT_SYMBOL_GPL ( nf_ct_untracked_status_or  )
EXPORT_SYMBOL_GPL ( nf_ct_nat_offset  )
void init_nf_conntrack_hash_rnd ( void  )

Definition at line 662 of file nf_conntrack_core.c.

module_param_call ( hashsize  ,
nf_conntrack_set_hashsize  ,
param_get_uint  ,
nf_conntrack_htable_size,
0600   
)
struct nf_conn* nf_conntrack_alloc ( struct net net,
u16  zone,
const struct nf_conntrack_tuple orig,
const struct nf_conntrack_tuple repl,
gfp_t  gfp 
)
read

Definition at line 753 of file nf_conntrack_core.c.

void nf_conntrack_alter_reply ( struct nf_conn ct,
const struct nf_conntrack_tuple newreply 
)

Definition at line 1055 of file nf_conntrack_core.c.

void nf_conntrack_cleanup ( struct net net)

Definition at line 1375 of file nf_conntrack_core.c.

struct nf_conntrack_tuple_hash* nf_conntrack_find_get ( struct net net,
u16  zone,
const struct nf_conntrack_tuple tuple 
)
read

Definition at line 400 of file nf_conntrack_core.c.

void nf_conntrack_flush_report ( struct net net,
u32  pid,
int  report 
)

Definition at line 1304 of file nf_conntrack_core.c.

void nf_conntrack_free ( struct nf_conn ct)

Definition at line 762 of file nf_conntrack_core.c.

int nf_conntrack_hash_check_insert ( struct nf_conn ct)

Definition at line 421 of file nf_conntrack_core.c.

unsigned int nf_conntrack_in ( struct net net,
u_int8_t  pf,
unsigned int  hooknum,
struct sk_buff skb 
)

Definition at line 932 of file nf_conntrack_core.c.

int nf_conntrack_init ( struct net net)

Definition at line 1616 of file nf_conntrack_core.c.

int nf_conntrack_set_hashsize ( const char val,
struct kernel_param kp 
)

Definition at line 1417 of file nf_conntrack_core.c.

int nf_conntrack_tuple_taken ( const struct nf_conntrack_tuple tuple,
const struct nf_conn ignored_conntrack 
)

Definition at line 577 of file nf_conntrack_core.c.

void* nf_ct_alloc_hashtable ( unsigned int sizep,
int  nulls 
)

Definition at line 1393 of file nf_conntrack_core.c.

void nf_ct_delete_from_lists ( struct nf_conn ct)

Definition at line 240 of file nf_conntrack_core.c.

void nf_ct_free_hashtable ( void hash,
unsigned int  size 
)

Definition at line 1294 of file nf_conntrack_core.c.

bool nf_ct_get_tuple ( const struct sk_buff skb,
unsigned int  nhoff,
unsigned int  dataoff,
u_int16_t  l3num,
u_int8_t  protonum,
struct nf_conntrack_tuple tuple,
const struct nf_conntrack_l3proto l3proto,
const struct nf_conntrack_l4proto l4proto 
)

Definition at line 116 of file nf_conntrack_core.c.

bool nf_ct_get_tuplepr ( const struct sk_buff skb,
unsigned int  nhoff,
u_int16_t  l3num,
struct nf_conntrack_tuple tuple 
)

Definition at line 138 of file nf_conntrack_core.c.

void nf_ct_insert_dying_list ( struct nf_conn ct)

Definition at line 277 of file nf_conntrack_core.c.

bool nf_ct_invert_tuple ( struct nf_conntrack_tuple inverse,
const struct nf_conntrack_tuple orig,
const struct nf_conntrack_l3proto l3proto,
const struct nf_conntrack_l4proto l4proto 
)

Definition at line 167 of file nf_conntrack_core.c.

bool nf_ct_invert_tuplepr ( struct nf_conntrack_tuple inverse,
const struct nf_conntrack_tuple orig 
)

Definition at line 1038 of file nf_conntrack_core.c.

void nf_ct_iterate_cleanup ( struct net net,
int(*)(struct nf_conn *i, void *data iter,
void data 
)

Definition at line 1247 of file nf_conntrack_core.c.

void nf_ct_untracked_status_or ( unsigned long  bits)

Definition at line 1472 of file nf_conntrack_core.c.

Variable Documentation

unsigned int nf_conntrack_hash_rnd __read_mostly

Definition at line 67 of file nf_conntrack_core.c.

s16(* nf_ct_nat_offset)(const struct nf_conn *ct, enum ip_conntrack_dir dir, u32 seq)

Definition at line 1611 of file nf_conntrack_core.c.

int(* nf_nat_seq_adjust_hook)(struct sk_buff *skb, struct nf_conn *ct, enum ip_conntrack_info ctinfo, unsigned int protoff)

Definition at line 58 of file nf_conntrack_core.c.

int(* nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, enum nf_nat_manip_type manip, const struct nlattr *attr) __read_mostly

Definition at line 53 of file nf_conntrack_core.c.