~ubuntu-branches/ubuntu/precise/xtables-addons/precise-updates

« back to all changes in this revision

Viewing changes to extensions/xt_psd.h

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2009-09-10 21:42:05 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090910214205-neqgwq7y5nctaty7
Tags: 1.18-1
* New Upstream Version
  This version has support for 2.6.31 (Closes: #545542)
* Bump standards version (no changes)
* Depend on quilt (Closes: #533653)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _LINUX_NETFILTER_XT_PSD_H
 
2
#define _LINUX_NETFILTER_XT_PSD_H 1
 
3
 
 
4
#include <linux/param.h>
 
5
#include <linux/types.h>
 
6
 
 
7
/*
 
8
 * High port numbers have a lower weight to reduce the frequency of false
 
9
 * positives, such as from passive mode FTP transfers.
 
10
 */
 
11
#define PORT_WEIGHT_PRIV                3
 
12
#define PORT_WEIGHT_HIGH                1
 
13
#define PSD_MAX_RATE                    10000
 
14
 
 
15
/*
 
16
 * Port scan detection thresholds: at least COUNT ports need to be scanned
 
17
 * from the same source, with no longer than DELAY ticks between ports.
 
18
 */
 
19
#define SCAN_MIN_COUNT                  7
 
20
#define SCAN_MAX_COUNT                  (SCAN_MIN_COUNT * PORT_WEIGHT_PRIV)
 
21
#define SCAN_WEIGHT_THRESHOLD           SCAN_MAX_COUNT
 
22
#define SCAN_DELAY_THRESHOLD            (300) /* old usage of HZ here was erroneously and broke under uml */
 
23
 
 
24
/*
 
25
 * Keep track of up to LIST_SIZE source addresses, using a hash table of
 
26
 * HASH_SIZE entries for faster lookups, but limiting hash collisions to
 
27
 * HASH_MAX source addresses per the same hash value.
 
28
 */
 
29
#define LIST_SIZE                       0x100
 
30
#define HASH_LOG                        9
 
31
#define HASH_SIZE                       (1 << HASH_LOG)
 
32
#define HASH_MAX                        0x10
 
33
 
 
34
struct xt_psd_info {
 
35
        __u32 weight_threshold;
 
36
        __u32 delay_threshold;
 
37
        __u16 lo_ports_weight;
 
38
        __u16 hi_ports_weight;
 
39
};
 
40
 
 
41
#endif /*_LINUX_NETFILTER_XT_PSD_H*/