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;
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. */
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;
40 struct xt_hashlimit_info *master;
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. */
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 {
60 struct hashlimit_cfg1 cfg;
62 /* Used internally by the kernel */
63 struct xt_hashlimit_htable *hinfo __attribute__((aligned(8)));
66 #endif /*_XT_HASHLIMIT_H*/