Home | History | Annotate | Download | only in netfilter_ipv4
      1 #ifndef _IPT_DSTLIMIT_H
      2 #define _IPT_DSTLIMIT_H
      3 
      4 /* timings are in milliseconds. */
      5 #define IPT_DSTLIMIT_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. */
      8 
      9 /* details of this structure hidden by the implementation */
     10 struct ipt_dstlimit_htable;
     11 
     12 #define IPT_DSTLIMIT_HASH_DIP	0x0001
     13 #define IPT_DSTLIMIT_HASH_DPT	0x0002
     14 #define IPT_DSTLIMIT_HASH_SIP	0x0004
     15 
     16 struct dstlimit_cfg {
     17 	u_int32_t mode;	  /* bitmask of IPT_DSTLIMIT_HASH_* */
     18 	u_int32_t avg;    /* Average secs between packets * scale */
     19 	u_int32_t burst;  /* Period multiplier for upper limit. */
     20 
     21 	/* user specified */
     22 	u_int32_t size;		/* how many buckets */
     23 	u_int32_t max;		/* max number of entries */
     24 	u_int32_t gc_interval;	/* gc interval */
     25 	u_int32_t expire;	/* when do entries expire? */
     26 };
     27 
     28 struct ipt_dstlimit_info {
     29 	char name [IFNAMSIZ];		/* name */
     30 	struct dstlimit_cfg cfg;
     31 	struct ipt_dstlimit_htable *hinfo;
     32 
     33 	/* Used internally by the kernel */
     34 	union {
     35 		void *ptr;
     36 		struct ipt_dstlimit_info *master;
     37 	} u;
     38 };
     39 #endif /*_IPT_DSTLIMIT_H*/
     40