• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _IPT_RATE_H
2 #define _IPT_RATE_H
3 
4 /* timings are in milliseconds. */
5 #define IPT_LIMIT_SCALE 10000
6 
7 /* 1/10,000 sec period => max of 10,000/sec.  Min rate is then 429490
8    seconds, or one every 59 hours. */
9 struct ipt_rateinfo {
10 	u_int32_t avg;    /* Average secs between packets * scale */
11 	u_int32_t burst;  /* Period multiplier for upper limit. */
12 
13 #ifdef KERNEL_64_USERSPACE_32
14 	u_int64_t prev;
15 	u_int64_t placeholder;
16 #else
17 	/* Used internally by the kernel */
18 	unsigned long prev;
19 	/* Ugly, ugly fucker. */
20 	struct ipt_rateinfo *master;
21 #endif
22 
23 	u_int32_t credit;
24 	u_int32_t credit_cap, cost;
25 };
26 #endif /*_IPT_RATE_H*/
27