blob: bb47fc4d2adea1921124d5aa7e9702f179317596 [file] [log] [blame]
Harald Welte2e4e6a12006-01-12 13:30:04 -08001#ifndef _XT_RATE_H
2#define _XT_RATE_H
3
Arnd Bergmann60c195c2009-02-26 00:51:43 +01004#include <linux/types.h>
5
Harald Welte2e4e6a12006-01-12 13:30:04 -08006/* timings are in milliseconds. */
7#define XT_LIMIT_SCALE 10000
8
Jan Engelhardtacc738f2009-03-16 15:35:29 +01009struct xt_limit_priv;
10
Harald Welte2e4e6a12006-01-12 13:30:04 -080011/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
12 seconds, or one every 59 hours. */
13struct xt_rateinfo {
Arnd Bergmann60c195c2009-02-26 00:51:43 +010014 __u32 avg; /* Average secs between packets * scale */
15 __u32 burst; /* Period multiplier for upper limit. */
Harald Welte2e4e6a12006-01-12 13:30:04 -080016
17 /* Used internally by the kernel */
Jan Engelhardtacc738f2009-03-16 15:35:29 +010018 unsigned long prev; /* moved to xt_limit_priv */
Linus Torvaldsba1eb952009-03-26 16:11:41 -070019 __u32 credit; /* moved to xt_limit_priv */
Arnd Bergmann60c195c2009-02-26 00:51:43 +010020 __u32 credit_cap, cost;
Harald Welte2e4e6a12006-01-12 13:30:04 -080021
Jan Engelhardtacc738f2009-03-16 15:35:29 +010022 struct xt_limit_priv *master;
Harald Welte2e4e6a12006-01-12 13:30:04 -080023};
24#endif /*_XT_RATE_H*/