Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
xt_limit.c File Reference
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_limit.h>

Go to the source code of this file.

Data Structures

struct  xt_limit_priv
 

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)
 

Functions

 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Herve Eychenne <[email protected]>")
 
 MODULE_DESCRIPTION ("Xtables: rate-limit match")
 
 MODULE_ALIAS ("ipt_limit")
 
 MODULE_ALIAS ("ip6t_limit")
 
 module_init (limit_mt_init)
 
 module_exit (limit_mt_exit)
 

Macro Definition Documentation

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

Definition at line 61 of file xt_limit.c.

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

Definition at line 58 of file xt_limit.c.

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

Definition at line 62 of file xt_limit.c.

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

Definition at line 59 of file xt_limit.c.

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

Definition at line 60 of file xt_limit.c.

#define CREDITS_PER_JIFFY   POW2_BELOW32(MAX_CPJ)

Definition at line 65 of file xt_limit.c.

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

Definition at line 53 of file xt_limit.c.

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

Definition at line 63 of file xt_limit.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 8 of file xt_limit.c.

Function Documentation

MODULE_ALIAS ( "ipt_limit"  )
MODULE_ALIAS ( "ip6t_limit"  )
MODULE_AUTHOR ( "Herve Eychenne <[email protected]>"  )
MODULE_DESCRIPTION ( "Xtables: rate-limit match )
module_exit ( limit_mt_exit  )
module_init ( limit_mt_init  )
MODULE_LICENSE ( "GPL"  )