Skip to contentSkip to conversation

2.4.9-ipt_string.patch

PATCH Kim Yong Il 2 participants 2 messages Sep 20, 2001

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

This is "iptables --string" patch

Documentation/Configure.help +8 -0
diff -urN linux-2.4.9.orig/Documentation/Configure.help linux-2.4.9/Documentation/Configure.help
@@ -1939,6 +1939,14 @@
   If you want to compile it as a module, say M here and read
   Documentation/modules.txt.  If unsure, say `N'.
 
+String match support (EXPERIMENTAL)
+CONFIG_IP_NF_MATCH_STRING
+  String matching alows you to match packets which contain a
+  specified string of characters.
+
+  If you want to compile it as a module, say M here and read
+  Documentation/modules.txt.  If unsure, say `N'.
+
 Unclean match support (EXPERIMENTAL)
 CONFIG_IP_NF_MATCH_UNCLEAN
   Unclean packet matching matches any strange or invalid packets, by
include/linux/netfilter_ipv4/ipt_string.h +21 -0
diff -urN linux-2.4.9.orig/include/linux/netfilter_ipv4/ipt_string.h linux-2.4.9/include/linux/netfilter_ipv4/ipt_string.h
@@ -0,0 +1,21 @@
+#ifndef _IPT_STRING_H
+#define _IPT_STRING_H
+
+/* *** PERFORMANCE TWEAK ***
+ * Packet size and search string threshold,
+ * above which sublinear searches is used. */
+#define IPT_STRING_HAYSTACK_THRESH	100
+#define IPT_STRING_NEEDLE_THRESH	20
+
+#define BM_MAX_NLEN 256
+#define BM_MAX_HLEN 1024
+
+typedef char *(*proc_ipt_search) (char *, char *, int, int);
+
+struct ipt_string_info {
+    char string[BM_MAX_NLEN];
+    u_int16_t invert;
+    u_int16_t len;
+};
+
+#endif /* _IPT_STRING_H */
net/ipv4/netfilter/Config.in +1 -0
diff -urN linux-2.4.9.orig/net/ipv4/netfilter/Config.in linux-2.4.9/net/ipv4/netfilter/Config.in
@@ -26,6 +26,7 @@
   fi
   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
     dep_tristate '  Unclean match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_UNCLEAN $CONFIG_IP_NF_IPTABLES
+    dep_tristate '  String match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_STRING $CONFIG_IP_NF_IPTABLES
     dep_tristate '  Owner match support (EXPERIMENTAL)' CONFIG_IP_NF_MATCH_OWNER $CONFIG_IP_NF_IPTABLES
   fi
 # The targets
net/ipv4/netfilter/Makefile +1 -0
diff -urN linux-2.4.9.orig/net/ipv4/netfilter/Makefile linux-2.4.9/net/ipv4/netfilter/Makefile
@@ -54,6 +54,7 @@
 obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
 obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
 obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt_unclean.o
+obj-$(CONFIG_IP_NF_MATCH_STRING) += ipt_string.o
 obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
 
 # targets
net/ipv4/netfilter/ipt_string.c +156 -0

156 lines not on this page · raw message

#1 lore raw
Quoted 1 line · Kim Yong Il

This is "iptables --string" patch

excellent! this puts us one step closer to cisco-NBAR.

-Dan

Signature · 1 line
[-] Omae no subete no kichi wa ore no mono da. [-]