[NETFILTER]: xt_hashlimit match, revision 1
[linux-2.6/libata-dev.git] / include / linux / netfilter / xt_hashlimit.h
blob58b818ee41caa25f9d18a9c265fb2f7325f80826
1 #ifndef _XT_HASHLIMIT_H
2 #define _XT_HASHLIMIT_H
4 /* timings are in milliseconds. */
5 #define XT_HASHLIMIT_SCALE 10000
6 /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
7 seconds, or one every 59 hours. */
9 /* details of this structure hidden by the implementation */
10 struct xt_hashlimit_htable;
12 enum {
13 XT_HASHLIMIT_HASH_DIP = 1 << 0,
14 XT_HASHLIMIT_HASH_DPT = 1 << 1,
15 XT_HASHLIMIT_HASH_SIP = 1 << 2,
16 XT_HASHLIMIT_HASH_SPT = 1 << 3,
17 XT_HASHLIMIT_INVERT = 1 << 4,
20 struct hashlimit_cfg {
21 u_int32_t mode; /* bitmask of XT_HASHLIMIT_HASH_* */
22 u_int32_t avg; /* Average secs between packets * scale */
23 u_int32_t burst; /* Period multiplier for upper limit. */
25 /* user specified */
26 u_int32_t size; /* how many buckets */
27 u_int32_t max; /* max number of entries */
28 u_int32_t gc_interval; /* gc interval */
29 u_int32_t expire; /* when do entries expire? */
32 struct xt_hashlimit_info {
33 char name [IFNAMSIZ]; /* name */
34 struct hashlimit_cfg cfg;
36 /* Used internally by the kernel */
37 struct xt_hashlimit_htable *hinfo;
38 union {
39 void *ptr;
40 struct xt_hashlimit_info *master;
41 } u;
44 struct hashlimit_cfg1 {
45 u_int32_t mode; /* bitmask of XT_HASHLIMIT_HASH_* */
46 u_int32_t avg; /* Average secs between packets * scale */
47 u_int32_t burst; /* Period multiplier for upper limit. */
49 /* user specified */
50 u_int32_t size; /* how many buckets */
51 u_int32_t max; /* max number of entries */
52 u_int32_t gc_interval; /* gc interval */
53 u_int32_t expire; /* when do entries expire? */
55 u_int8_t srcmask, dstmask;
58 struct xt_hashlimit_mtinfo1 {
59 char name[IFNAMSIZ];
60 struct hashlimit_cfg1 cfg;
62 /* Used internally by the kernel */
63 struct xt_hashlimit_htable *hinfo __attribute__((aligned(8)));
64 struct xt_hashlimit_mtinfo1 *master __attribute__((aligned(8)));
67 #endif /*_XT_HASHLIMIT_H*/