Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 1 | #ifndef _XT_RATE_H |
| 2 | #define _XT_RATE_H |
| 3 | |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 4 | #include <linux/types.h> |
| 5 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 6 | /* timings are in milliseconds. */ |
| 7 | #define XT_LIMIT_SCALE 10000 |
| 8 | |
Jan Engelhardt | acc738f | 2009-03-16 15:35:29 +0100 | [diff] [blame] | 9 | struct xt_limit_priv; |
| 10 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 11 | /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 |
| 12 | seconds, or one every 59 hours. */ |
| 13 | struct xt_rateinfo { |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 14 | __u32 avg; /* Average secs between packets * scale */ |
| 15 | __u32 burst; /* Period multiplier for upper limit. */ |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 16 | |
| 17 | /* Used internally by the kernel */ |
Jan Engelhardt | acc738f | 2009-03-16 15:35:29 +0100 | [diff] [blame] | 18 | unsigned long prev; /* moved to xt_limit_priv */ |
Linus Torvalds | ba1eb95 | 2009-03-26 16:11:41 -0700 | [diff] [blame] | 19 | __u32 credit; /* moved to xt_limit_priv */ |
Arnd Bergmann | 60c195c | 2009-02-26 00:51:43 +0100 | [diff] [blame] | 20 | __u32 credit_cap, cost; |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 21 | |
Jan Engelhardt | acc738f | 2009-03-16 15:35:29 +0100 | [diff] [blame] | 22 | struct xt_limit_priv *master; |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 23 | }; |
| 24 | #endif /*_XT_RATE_H*/ |