Home | History | Annotate | Download | only in netfilter_ipv4
      1 #ifndef _IPT_HASHLIMIT_H
      2 #define _IPT_HASHLIMIT_H
      3 
      4 /* timings are in milliseconds. */
      5 #define IPT_HASHLIMIT_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_hashlimit_htable;
     11 
     12 #define IPT_HASHLIMIT_HASH_DIP	0x0001
     13 #define IPT_HASHLIMIT_HASH_DPT	0x0002
     14 #define IPT_HASHLIMIT_HASH_SIP	0x0004
     15 #define IPT_HASHLIMIT_HASH_SPT	0x0008
     16 
     17 struct hashlimit_cfg {
     18 	u_int32_t mode;	  /* bitmask of IPT_HASHLIMIT_HASH_* */
     19 	u_int32_t avg;    /* Average secs between packets * scale */
     20 	u_int32_t burst;  /* Period multiplier for upper limit. */
     21 
     22 	/* user specified */
     23 	u_int32_t size;		/* how many buckets */
     24 	u_int32_t max;		/* max number of entries */
     25 	u_int32_t gc_interval;	/* gc interval */
     26 	u_int32_t expire;	/* when do entries expire? */
     27 };
     28 
     29 struct ipt_hashlimit_info {
     30 	char name [IFNAMSIZ];		/* name */
     31 	struct hashlimit_cfg cfg;
     32 	struct ipt_hashlimit_htable *hinfo;
     33 
     34 	/* Used internally by the kernel */
     35 	union {
     36 		void *ptr;
     37 		struct ipt_hashlimit_info *master;
     38 	} u;
     39 };
     40 #endif /*_IPT_HASHLIMIT_H*/
     41