Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


xt_hashlimit.h
01: #ifndef _XT_HASHLIMIT_H
02: #define _XT_HASHLIMIT_H
03: 
04: #include <linux/types.h>
05: 
06: /* timings are in milliseconds. */
07: #define XT_HASHLIMIT_SCALE 10000
08: /* 1/10,000 sec period => max of 10,000/sec.  Min rate is then 429490
09:    seconds, or one every 59 hours. */
10: 
11: /* details of this structure hidden by the implementation */
12: struct xt_hashlimit_htable;
13: 
14: enum {
15:         XT_HASHLIMIT_HASH_DIP = 1 << 0,
16:         XT_HASHLIMIT_HASH_DPT = 1 << 1,
17:         XT_HASHLIMIT_HASH_SIP = 1 << 2,
18:         XT_HASHLIMIT_HASH_SPT = 1 << 3,
19:         XT_HASHLIMIT_INVERT   = 1 << 4,
20: };
21: 
22: struct hashlimit_cfg {
23:         __u32 mode;       /* bitmask of XT_HASHLIMIT_HASH_* */
24:         __u32 avg;    /* Average secs between packets * scale */
25:         __u32 burst;  /* Period multiplier for upper limit. */
26: 
27:         /* user specified */
28:         __u32 size;             /* how many buckets */
29:         __u32 max;              /* max number of entries */
30:         __u32 gc_interval;      /* gc interval */
31:         __u32 expire;   /* when do entries expire? */
32: };
33: 
34: struct xt_hashlimit_info {
35:         char name [IFNAMSIZ];           /* name */
36:         struct hashlimit_cfg cfg;
37: 
38:         /* Used internally by the kernel */
39:         struct xt_hashlimit_htable *hinfo;
40:         union {
41:                 void *ptr;
42:                 struct xt_hashlimit_info *master;
43:         } u;
44: };
45: 
46: struct hashlimit_cfg1 {
47:         __u32 mode;       /* bitmask of XT_HASHLIMIT_HASH_* */
48:         __u32 avg;    /* Average secs between packets * scale */
49:         __u32 burst;  /* Period multiplier for upper limit. */
50: 
51:         /* user specified */
52:         __u32 size;             /* how many buckets */
53:         __u32 max;              /* max number of entries */
54:         __u32 gc_interval;      /* gc interval */
55:         __u32 expire;   /* when do entries expire? */
56: 
57:         __u8 srcmask, dstmask;
58: };
59: 
60: struct xt_hashlimit_mtinfo1 {
61:         char name[IFNAMSIZ];
62:         struct hashlimit_cfg1 cfg;
63: 
64:         /* Used internally by the kernel */
65:         struct xt_hashlimit_htable *hinfo __attribute__((aligned(8)));
66: };
67: 
68: #endif /*_XT_HASHLIMIT_H*/
69: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/