netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH 4/4] psd: move defines to user/kernelspace part where possible
Date: Thu, 14 Jun 2012 22:13:34 +0200	[thread overview]
Message-ID: <1339704814-1605-5-git-send-email-fw@strlen.de> (raw)
In-Reply-To: <1339704814-1605-1-git-send-email-fw@strlen.de>

Some of these defines have no meaning in userspace, so there
is no need to make those available.
---
 extensions/libxt_psd.c |    2 ++
 extensions/xt_psd.c    |    9 +++++++++
 extensions/xt_psd.h    |   11 -----------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/extensions/libxt_psd.c b/extensions/libxt_psd.c
index 483c69a..bd03480 100644
--- a/extensions/libxt_psd.c
+++ b/extensions/libxt_psd.c
@@ -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(
diff --git a/extensions/xt_psd.c b/extensions/xt_psd.c
index 00ff1d4..f459605 100644
--- a/extensions/xt_psd.c
+++ b/extensions/xt_psd.c
@@ -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
diff --git a/extensions/xt_psd.h b/extensions/xt_psd.h
index ac65687..89b48fe 100644
--- a/extensions/xt_psd.h
+++ b/extensions/xt_psd.h
@@ -19,17 +19,6 @@
 #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;
-- 
1.7.3.4


  parent reply	other threads:[~2012-06-14 20:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 20:13 [xt-addons][PATCH 0/4] psd match cleanup patches Florian Westphal
2012-06-14 20:13 ` [PATCH 1/4] psd: rip out scanlogd leftovers Florian Westphal
2012-06-14 20:13 ` [PATCH 2/4] psd: add basic validation of userspace matchinfo data Florian Westphal
2012-06-14 20:13 ` [PATCH 3/4] psd: reduce size of struct host Florian Westphal
2012-06-14 20:13 ` Florian Westphal [this message]
2012-06-21 17:13 ` [xt-addons][PATCH 0/4] psd match cleanup patches Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339704814-1605-5-git-send-email-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).