Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
xt_hashlimit.c File Reference
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/random.h>
#include <linux/jhash.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/list.h>
#include <linux/skbuff.h>
#include <linux/mm.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <linux/netfilter/xt_hashlimit.h>
#include <linux/mutex.h>

Go to the source code of this file.

Data Structures

struct  hashlimit_net
 
struct  dsthash_dst
 
struct  dsthash_ent
 
struct  xt_hashlimit_htable
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define MAX_CPJ   (0xFFFFFFFF / (HZ*60*60*24))
 
#define _POW2_BELOW2(x)   ((x)|((x)>>1))
 
#define _POW2_BELOW4(x)   (_POW2_BELOW2(x)|_POW2_BELOW2((x)>>2))
 
#define _POW2_BELOW8(x)   (_POW2_BELOW4(x)|_POW2_BELOW4((x)>>4))
 
#define _POW2_BELOW16(x)   (_POW2_BELOW8(x)|_POW2_BELOW8((x)>>8))
 
#define _POW2_BELOW32(x)   (_POW2_BELOW16(x)|_POW2_BELOW16((x)>>16))
 
#define POW2_BELOW32(x)   ((_POW2_BELOW32(x)>>1) + 1)
 
#define CREDITS_PER_JIFFY   POW2_BELOW32(MAX_CPJ)
 
#define MAX_CPJ_BYTES   (0xFFFFFFFF / HZ)
 
#define CREDITS_PER_JIFFY_BYTES   POW2_BELOW32(MAX_CPJ_BYTES)
 

Functions

 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Harald Welte <[email protected]>")
 
 MODULE_AUTHOR ("Jan Engelhardt <[email protected]>")
 
 MODULE_DESCRIPTION ("Xtables: per hash-bucket rate-limit match")
 
 MODULE_ALIAS ("ipt_hashlimit")
 
 MODULE_ALIAS ("ip6t_hashlimit")
 
 module_init (hashlimit_mt_init)
 
 module_exit (hashlimit_mt_exit)
 

Macro Definition Documentation

#define _POW2_BELOW16 (   x)    (_POW2_BELOW8(x)|_POW2_BELOW8((x)>>8))

Definition at line 384 of file xt_hashlimit.c.

#define _POW2_BELOW2 (   x)    ((x)|((x)>>1))

Definition at line 381 of file xt_hashlimit.c.

#define _POW2_BELOW32 (   x)    (_POW2_BELOW16(x)|_POW2_BELOW16((x)>>16))

Definition at line 385 of file xt_hashlimit.c.

#define _POW2_BELOW4 (   x)    (_POW2_BELOW2(x)|_POW2_BELOW2((x)>>2))

Definition at line 382 of file xt_hashlimit.c.

#define _POW2_BELOW8 (   x)    (_POW2_BELOW4(x)|_POW2_BELOW4((x)>>4))

Definition at line 383 of file xt_hashlimit.c.

#define CREDITS_PER_JIFFY   POW2_BELOW32(MAX_CPJ)

Definition at line 388 of file xt_hashlimit.c.

#define CREDITS_PER_JIFFY_BYTES   POW2_BELOW32(MAX_CPJ_BYTES)

Definition at line 395 of file xt_hashlimit.c.

#define MAX_CPJ   (0xFFFFFFFF / (HZ*60*60*24))

Definition at line 376 of file xt_hashlimit.c.

#define MAX_CPJ_BYTES   (0xFFFFFFFF / HZ)

Definition at line 394 of file xt_hashlimit.c.

#define POW2_BELOW32 (   x)    ((_POW2_BELOW32(x)>>1) + 1)

Definition at line 386 of file xt_hashlimit.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 10 of file xt_hashlimit.c.

Function Documentation

MODULE_ALIAS ( "ipt_hashlimit"  )
MODULE_ALIAS ( "ip6t_hashlimit"  )
MODULE_AUTHOR ( "Harald Welte <[email protected]>"  )
MODULE_AUTHOR ( "Jan Engelhardt <[email protected]>"  )
MODULE_DESCRIPTION ( "Xtables: per hash-bucket rate-limit match )
module_exit ( hashlimit_mt_exit  )
module_init ( hashlimit_mt_init  )
MODULE_LICENSE ( "GPL"  )