Skip to contentSkip to conversation

modification to the nf-hipac-0.9.1 patch

PATCH Jeho-Park 1 participant 1 message May 29, 2006

Subsystems (2)
lore
Share & tools
lore

Jeho-Park

author
#0 lore raw

hi there

nf-hipac list looks dead so i post here.
recently i modified the nf-hipac-0.9.1.patch to apply it to the linux-2.6.16.16. please refer to my attached patch file

i can't sure it is useful but i hope so (^^

--
Jeho-Park <[email protected]> or <[email protected]>

linux-2.6.16.16/include/linux/netfilter_ipv4/ip_tables.h renamed from include/linux/netfilter_ipv4/ip_tables.h +2 -0
diff -uNr linux-2.6.16.16/include/linux/netfilter_ipv4/ip_tables.h ../linux-2.6.16.16/include/linux/netfilter_ipv4/ip_tables.h
@@ -336,6 +336,8 @@
 
 /* net/sched/ipt.c: Gimme access to your targets!  Gets target->me. */
 extern struct ipt_target *ipt_find_target(const char *name, u8 revision);
+/* Gimme access to your matches too! */
+extern struct ipt_match *ipt_find_match(const char *name, u8 revision);
 
 /* Standard entry. */
 struct ipt_standard
linux-2.6.16.16/include/linux/netfilter_ipv4/ipt_sctp.h renamed from include/linux/netfilter_ipv4/ipt_sctp.h +1 -1
diff -uNr linux-2.6.16.16/include/linux/netfilter_ipv4/ipt_sctp.h ../linux-2.6.16.16/include/linux/netfilter_ipv4/ipt_sctp.h
@@ -6,7 +6,7 @@
 #define IPT_SCTP_CHUNK_TYPES		0x04
 
 #define IPT_SCTP_VALID_FLAGS		0x07
-
+#define ELEMCOUNT(x) (sizeof(x)/sizeof(x[0]))
 
 struct ipt_sctp_flag_info {
 	u_int8_t chunktype;
linux-2.6.16.16/net/ipv4/netfilter/Kconfig renamed from net/ipv4/netfilter/Kconfig +36 -0
diff -uNr linux-2.6.16.16/net/ipv4/netfilter/Kconfig ../linux-2.6.16.16/net/ipv4/netfilter/Kconfig
@@ -577,6 +577,42 @@
 	  If you want to compile it as a module, say M here and read
 	  <file:Documentation/modules.txt>.  If unsure, say `N'.
 
+config IP_NF_HIPAC
+       tristate  'nf-HiPAC support (High Performance Packet Classification)'
+       depends on IP_NF_IPTABLES
+       help
+         nf-HiPAC is a high performance packet classification framework on
+         top of netfilter. It is based on a novel classification algorithm
+         that is very much superior to the linear classication algorithm
+         implemented by iptables. It provides highly efficient packet
+         matching which is especially useful when large rulesets and/or high
+         bandwidth networks are involved. Ruleset updates are submitted
+         dynamically to the kernel via netlink on a per rule basis.
+         In addition to its native matches (e.g. ip, proto, port match)
+         nf-HiPAC allows the usage of iptables matches and targets and thus
+         provides the same flexibility as iptables. Furthermore the semantics
+         and construction of a ruleset is identical to the iptables way so
+         that the internal representation is completely transparent to the
+         user.
+         Basically, you can think of nf-HiPAC as an alternative, optimized
+         iptables filter table. Note that it cannot be used for packet
+         mangling or NAT but you can still adopt iptables' mangle or nat
+         table for that purpose since nf-HiPAC and iptables can be used
+         together at the same time.
+
+config IP_NF_HIPAC_SINGLE_PATH
+       bool 'Single path optimization'
+       depends on IP_NF_HIPAC
+       help
+          This optimization will significantly improve the performance of
+          nf-HiPAC but may lead to an unacceptable memory usage. Whether memory
+          consumption becomes a problem depends on your rule set. You can
+          monitor the memory used by NF-HIPAC via /proc/net/nf-hipac/info.
+          In almost all scenarios the performance will already be more than good
+          enough without this optimization. 
+
+          If unsure, say N.
+
 # ARP tables
 config IP_NF_ARPTABLES
 	tristate "ARP tables support"
linux-2.6.16.16/net/ipv4/netfilter/Makefile renamed from net/ipv4/netfilter/Makefile +3 -0
diff -uNr linux-2.6.16.16/net/ipv4/netfilter/Makefile ../linux-2.6.16.16/net/ipv4/netfilter/Makefile
@@ -75,6 +75,9 @@
 obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
 obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o
 
+# nf-hipac/Makefile
+obj-$(CONFIG_IP_NF_HIPAC) += nf-hipac/
+
 # generic ARP tables
 obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o
 obj-$(CONFIG_IP_NF_ARP_MANGLE) += arpt_mangle.o
linux-2.6.16.16/net/ipv4/netfilter/ip_tables.c renamed from net/ipv4/netfilter/ip_tables.c +27 -0
diff -uNr linux-2.6.16.16/net/ipv4/netfilter/ip_tables.c ../linux-2.6.16.16/net/ipv4/netfilter/ip_tables.c
@@ -457,6 +457,31 @@
 	return 1;
 }
 
+struct ipt_match *ipt_find_match(const char *name, u8 revision)
+{
+	struct ipt_match *match;
+
+	match = try_then_request_module(xt_find_match(AF_INET, name, revision),
+					"ipt_%s", name);
+	if (IS_ERR(match) || !match)
+               return NULL;
+	
+	return match;
+}
+
+struct ipt_target *ipt_find_target(const char *name, u8 revision)
+{
+	struct ipt_target *target;
+
+	target = try_then_request_module(xt_find_target(AF_INET, name, revision),
+                                        "ipt_%s", name);
+	if (IS_ERR(target) || !target) {
+               return NULL;
+        }
+       
+	return target;
+}
+
 static inline int
 cleanup_match(struct ipt_entry_match *m, unsigned int *i)
 {
@@ -1386,5 +1411,7 @@
 EXPORT_SYMBOL(ipt_register_table);
 EXPORT_SYMBOL(ipt_unregister_table);
 EXPORT_SYMBOL(ipt_do_table);
+EXPORT_SYMBOL(ipt_find_match); /* nf-hipac use these two function jeho-park */
+EXPORT_SYMBOL(ipt_find_target);
 module_init(init);
 module_exit(fini);
linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/Makefile renamed from net/ipv4/netfilter/nf-hipac/Makefile +33 -0
diff -uNr linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/Makefile ../linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/Makefile
@@ -0,0 +1,33 @@
+#
+# Makefile for nf-hipac on top of IPv4.
+#
+
+obj-$(CONFIG_IP_NF_HIPAC) += nf_hipac.o
+nf_hipac-objs := ihash.o global.o rlp.o dimtree.o hipac.o nfhp_dev.o nfhp_proc.o nfhp_mod.o
+
+ifdef CONFIG_IP_NF_HIPAC
+ifeq ($(CONFIG_IP_NF_CONNTRACK),m)
+obj-m += nf_hipac_cthelp.o
+EXTRA_CFLAGS += -D CONNTRACK_MODULE
+endif
+endif
+
+ifdef CONFIG_IP_NF_HIPAC_SINGLE_PATH
+EXTRA_CFLAGS += -D SINGLE_PATH
+endif
+
+ifneq ($(ARCH), alpha)
+ifneq ($(ARCH), ia64)
+ifneq ($(ARCH), ppc64)
+ifneq ($(ARCH), s390x)
+ifneq ($(ARCH), sh64)
+ifneq ($(ARCH), sparc64)
+ifneq ($(ARCH), x86_64)
+EXTRA_CFLAGS += -D BIT32_ARCH
+endif
+endif
+endif
+endif
+endif
+endif
+endif
linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/dimtree.c renamed from net/ipv4/netfilter/nf-hipac/dimtree.c +4307 -0

2,862 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/dimtree.h renamed from net/ipv4/netfilter/nf-hipac/dimtree.h +280 -0

280 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/global.c renamed from net/ipv4/netfilter/nf-hipac/global.c +964 -0

964 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/global.h renamed from net/ipv4/netfilter/nf-hipac/global.h +387 -0

387 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/hipac.c renamed from net/ipv4/netfilter/nf-hipac/hipac.c +3750 -0

3,750 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/hipac.h renamed from net/ipv4/netfilter/nf-hipac/hipac.h +623 -0

623 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/ihash.c renamed from net/ipv4/netfilter/nf-hipac/ihash.c +463 -0

463 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/ihash.h renamed from net/ipv4/netfilter/nf-hipac/ihash.h +285 -0

285 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/mode.h renamed from net/ipv4/netfilter/nf-hipac/mode.h +240 -0

240 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nf_hipac_cthelp.c renamed from net/ipv4/netfilter/nf-hipac/nf_hipac_cthelp.c +49 -0

49 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_com.h renamed from net/ipv4/netfilter/nf-hipac/nfhp_com.h +330 -0

330 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_dev.c renamed from net/ipv4/netfilter/nf-hipac/nfhp_dev.c +308 -0

308 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_dev.h renamed from net/ipv4/netfilter/nf-hipac/nfhp_dev.h +66 -0

66 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_mod.c renamed from net/ipv4/netfilter/nf-hipac/nfhp_mod.c +1734 -0

1,734 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_mod.h renamed from net/ipv4/netfilter/nf-hipac/nfhp_mod.h +47 -0

47 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_proc.c renamed from net/ipv4/netfilter/nf-hipac/nfhp_proc.c +888 -0

888 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_proc.h renamed from net/ipv4/netfilter/nf-hipac/nfhp_proc.h +24 -0
diff -uNr linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_proc.h ../linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/nfhp_proc.h

Lines of this file are not shown. View the raw message.

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/rlp.c renamed from net/ipv4/netfilter/nf-hipac/rlp.c +537 -0

537 lines not on this page · raw message

linux-2.6.16.16/net/ipv4/netfilter/nf-hipac/rlp.h renamed from net/ipv4/netfilter/nf-hipac/rlp.h +142 -0

142 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.