]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
psd: move defines to user/kernelspace part where possible
authorFlorian Westphal <fw@strlen.de>
Thu, 14 Jun 2012 08:53:15 +0000 (10:53 +0200)
committerJan Engelhardt <jengelh@inai.de>
Fri, 15 Jun 2012 13:17:30 +0000 (15:17 +0200)
Some of these defines have no meaning in userspace, so there
is no need to make those available.

extensions/libxt_psd.c
extensions/xt_psd.c
extensions/xt_psd.h

index 483c69abc3f85cdf56542bf1ece50288e2992cd6..bd034805d07efbb5d93e55ee55c932caa21cc8e4 100644 (file)
@@ -30,6 +30,8 @@
 #include "xt_psd.h"
 #include "compat_user.h"
 
+#define SCAN_DELAY_THRESHOLD           300
+
 /* Function which prints out usage message. */
 static void psd_mt_help(void) {
        printf(
index f5fcca0e0c5d054829caf456de3ecd352ffb632f..b67b64ea9a40b7a565e5bd60bc53cafe6db26940 100644 (file)
@@ -40,6 +40,15 @@ MODULE_AUTHOR(" Mohd Nawawi Mohamad Jamili <nawawi@tracenetworkcorporation.com>"
 MODULE_DESCRIPTION("Xtables: PSD - portscan detection");
 MODULE_ALIAS("ipt_psd");
 
+/*
+ * Keep track of up to LIST_SIZE source addresses, using a hash table of
+ * HASH_SIZE entries for faster lookups, but limiting hash collisions to
+ * HASH_MAX source addresses per the same hash value.
+ */
+#define LIST_SIZE                      0x100
+#define HASH_LOG                       9
+#define HASH_SIZE                      (1 << HASH_LOG)
+#define HASH_MAX                       0x10
 
 /*
  * Information we keep per each target port
index ac6568763eb1148785f13d7cbbd1c40ba5a98912..89b48fe82081896e0a1a0bf8916474b8de403bef 100644 (file)
 #define SCAN_MIN_COUNT                 7
 #define SCAN_MAX_COUNT                 (SCAN_MIN_COUNT * PORT_WEIGHT_PRIV)
 #define SCAN_WEIGHT_THRESHOLD          SCAN_MAX_COUNT
-#define SCAN_DELAY_THRESHOLD           (300) /* old usage of HZ here was erroneously and broke under uml */
-
-/*
- * Keep track of up to LIST_SIZE source addresses, using a hash table of
- * HASH_SIZE entries for faster lookups, but limiting hash collisions to
- * HASH_MAX source addresses per the same hash value.
- */
-#define LIST_SIZE                      0x100
-#define HASH_LOG                       9
-#define HASH_SIZE                      (1 << HASH_LOG)
-#define HASH_MAX                       0x10
 
 struct xt_psd_info {
        __u32 weight_threshold;