mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 03:33:25 +02:00
Irgendwie war da der falsche Patch noch drinne...
Sowas von peinlich aber auch... git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@674 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -86,7 +86,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
|||||||
cd $(DIR_SRC) && tar zxf $(DIR_DL)/netfilter-layer7-v2.9.tar.gz
|
cd $(DIR_SRC) && tar zxf $(DIR_DL)/netfilter-layer7-v2.9.tar.gz
|
||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.9/iptables-layer7-2.9.patch
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.9/iptables-layer7-2.9.patch
|
||||||
|
|
||||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/iptables-1.3.6-imq.diff
|
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/iptables-1.3.0-imq1.diff
|
||||||
chmod +x $(DIR_APP)/extensions/.IMQ-test* $(DIR_APP)/extensions/.layer7-test*
|
chmod +x $(DIR_APP)/extensions/.IMQ-test* $(DIR_APP)/extensions/.layer7-test*
|
||||||
|
|
||||||
# hack to disable IPv6 compilation as the configuration variable does not work when ip6.h is present
|
# hack to disable IPv6 compilation as the configuration variable does not work when ip6.h is present
|
||||||
|
|||||||
@@ -1,221 +1,220 @@
|
|||||||
--- iptables-1.3.6.orig/extensions.orig/.IMQ-test6 Thu Jan 1 01:00:00 1970
|
--- userspace/extensions.orig/.IMQ-test6 Thu Jan 1 01:00:00 1970
|
||||||
+++ iptables-1.3.6/extensions/.IMQ-test6 Mon Jun 16 10:12:47 2003
|
+++ userspace/extensions/.IMQ-test6 Mon Jun 16 10:12:47 2003
|
||||||
@@ -0,0 +1,3 @@
|
@@ -0,0 +1,3 @@
|
||||||
+#!/bin/sh
|
+#!/bin/sh
|
||||||
+# True if IMQ target patch is applied.
|
+# True if IMQ target patch is applied.
|
||||||
+[ -f $KERNEL_DIR/net/ipv6/netfilter/ip6t_IMQ.c ] && echo IMQ
|
+[ -f $KERNEL_DIR/net/ipv6/netfilter/ip6t_IMQ.c ] && echo IMQ
|
||||||
--- iptables-1.3.6.orig/extensions.orig/libip6t_IMQ.c Thu Jan 1 01:00:00 1970
|
--- userspace/extensions.orig/libip6t_IMQ.c Thu Jan 1 01:00:00 1970
|
||||||
+++ iptables-1.3.6/extensions/libip6t_IMQ.c Mon Jun 16 10:12:47 2003
|
+++ userspace/extensions/libip6t_IMQ.c Mon Jun 16 10:12:47 2003
|
||||||
@@ -0,0 +1,101 @@
|
@@ -0,0 +1,101 @@
|
||||||
+/* Shared library add-on to iptables to add IMQ target support. */
|
+/* Shared library add-on to iptables to add IMQ target support. */
|
||||||
+#include <stdio.h>
|
+#include <stdio.h>
|
||||||
+#include <string.h>
|
+#include <string.h>
|
||||||
+#include <stdlib.h>
|
+#include <stdlib.h>
|
||||||
+#include <getopt.h>
|
+#include <getopt.h>
|
||||||
+
|
+
|
||||||
+#include <ip6tables.h>
|
+#include <ip6tables.h>
|
||||||
+#include <linux/netfilter_ipv6/ip6_tables.h>
|
+#include <linux/netfilter_ipv6/ip6_tables.h>
|
||||||
+#include <linux/netfilter_ipv6/ip6t_IMQ.h>
|
+#include <linux/netfilter_ipv6/ip6t_IMQ.h>
|
||||||
+
|
+
|
||||||
+/* Function which prints out usage message. */
|
+/* Function which prints out usage message. */
|
||||||
+static void
|
+static void
|
||||||
+help(void)
|
+help(void)
|
||||||
+{
|
+{
|
||||||
+ printf(
|
+ printf(
|
||||||
+"IMQ target v%s options:\n"
|
+"IMQ target v%s options:\n"
|
||||||
+" --todev <N> enqueue to imq<N>, defaults to 0\n",
|
+" --todev <N> enqueue to imq<N>, defaults to 0\n",
|
||||||
+IPTABLES_VERSION);
|
+IPTABLES_VERSION);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static struct option opts[] = {
|
+static struct option opts[] = {
|
||||||
+ { "todev", 1, 0, '1' },
|
+ { "todev", 1, 0, '1' },
|
||||||
+ { 0 }
|
+ { 0 }
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+/* Initialize the target. */
|
+/* Initialize the target. */
|
||||||
+static void
|
+static void
|
||||||
+init(struct ip6t_entry_target *t, unsigned int *nfcache)
|
+init(struct ip6t_entry_target *t, unsigned int *nfcache)
|
||||||
+{
|
+{
|
||||||
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;
|
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)t->data;
|
||||||
+
|
+
|
||||||
+ mr->todev = 0;
|
+ mr->todev = 0;
|
||||||
+ *nfcache |= NFC_UNKNOWN;
|
+ *nfcache |= NFC_UNKNOWN;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/* Function which parses command options; returns true if it
|
+/* Function which parses command options; returns true if it
|
||||||
+ ate an option */
|
+ ate an option */
|
||||||
+static int
|
+static int
|
||||||
+parse(int c, char **argv, int invert, unsigned int *flags,
|
+parse(int c, char **argv, int invert, unsigned int *flags,
|
||||||
+ const struct ip6t_entry *entry,
|
+ const struct ip6t_entry *entry,
|
||||||
+ struct ip6t_entry_target **target)
|
+ struct ip6t_entry_target **target)
|
||||||
+{
|
+{
|
||||||
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;
|
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)(*target)->data;
|
||||||
+
|
+
|
||||||
+ switch(c) {
|
+ switch(c) {
|
||||||
+ case '1':
|
+ case '1':
|
||||||
+ if (check_inverse(optarg, &invert, NULL, 0))
|
+ if (check_inverse(optarg, &invert, NULL, 0))
|
||||||
+ exit_error(PARAMETER_PROBLEM,
|
+ exit_error(PARAMETER_PROBLEM,
|
||||||
+ "Unexpected `!' after --todev");
|
+ "Unexpected `!' after --todev");
|
||||||
+ mr->todev=atoi(optarg);
|
+ mr->todev=atoi(optarg);
|
||||||
+ break;
|
+ break;
|
||||||
+ default:
|
+ default:
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+ }
|
+ }
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static void
|
+static void
|
||||||
+final_check(unsigned int flags)
|
+final_check(unsigned int flags)
|
||||||
+{
|
+{
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/* Prints out the targinfo. */
|
+/* Prints out the targinfo. */
|
||||||
+static void
|
+static void
|
||||||
+print(const struct ip6t_ip6 *ip,
|
+print(const struct ip6t_ip6 *ip,
|
||||||
+ const struct ip6t_entry_target *target,
|
+ const struct ip6t_entry_target *target,
|
||||||
+ int numeric)
|
+ int numeric)
|
||||||
+{
|
+{
|
||||||
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
|
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
|
||||||
+
|
+
|
||||||
+ printf("IMQ: todev %u ", mr->todev);
|
+ printf("IMQ: todev %u ", mr->todev);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/* Saves the union ipt_targinfo in parsable form to stdout. */
|
+/* Saves the union ipt_targinfo in parsable form to stdout. */
|
||||||
+static void
|
+static void
|
||||||
+save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
|
+save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
|
||||||
+{
|
+{
|
||||||
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
|
+ struct ip6t_imq_info *mr = (struct ip6t_imq_info*)target->data;
|
||||||
+
|
+
|
||||||
+ printf("--todev %u", mr->todev);
|
+ printf("--todev %u", mr->todev);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static struct ip6tables_target imq = {
|
+static struct ip6tables_target imq = {
|
||||||
+ .next = NULL,
|
+ .next = NULL,
|
||||||
+ .name = "IMQ",
|
+ .name = "IMQ",
|
||||||
+ .version = IPTABLES_VERSION,
|
+ .version = IPTABLES_VERSION,
|
||||||
+ .size = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
|
+ .size = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
|
||||||
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
|
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_imq_info)),
|
||||||
+ .help = &help,
|
+ .help = &help,
|
||||||
+ .init = &init,
|
+ .init = &init,
|
||||||
+ .parse = &parse,
|
+ .parse = &parse,
|
||||||
+ .final_check = &final_check,
|
+ .final_check = &final_check,
|
||||||
+ .print = &print,
|
+ .print = &print,
|
||||||
+ .save = &save,
|
+ .save = &save,
|
||||||
+ .extra_opts = opts
|
+ .extra_opts = opts
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+static __attribute__((constructor)) void _init(void)
|
+void _init(void)
|
||||||
+{
|
+{
|
||||||
+ register_target6(&imq);
|
+ register_target6(&imq);
|
||||||
+}
|
+}
|
||||||
--- iptables-1.3.6.orig/extensions.orig/.IMQ-test Thu Jan 1 01:00:00 1970
|
--- userspace/extensions.orig/.IMQ-test Thu Jan 1 01:00:00 1970
|
||||||
+++ iptables-1.3.6/extensions/.IMQ-test Mon Jun 16 10:12:47 2003
|
+++ userspace/extensions/.IMQ-test Mon Jun 16 10:12:47 2003
|
||||||
@@ -0,0 +1,3 @@
|
@@ -0,0 +1,3 @@
|
||||||
+#!/bin/sh
|
+#!/bin/sh
|
||||||
+# True if IMQ target patch is applied.
|
+# True if IMQ target patch is applied.
|
||||||
+[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ
|
+[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_IMQ.c ] && echo IMQ
|
||||||
--- iptables-1.3.6.orig/extensions.orig/libipt_IMQ.c Thu Jan 1 01:00:00 1970
|
--- userspace/extensions.orig/libipt_IMQ.c Thu Jan 1 01:00:00 1970
|
||||||
+++ iptables-1.3.6/extensions/libipt_IMQ.c Mon Jun 16 10:12:47 2003
|
+++ userspace/extensions/libipt_IMQ.c Mon Jun 16 10:12:47 2003
|
||||||
@@ -0,0 +1,101 @@
|
@@ -0,0 +1,101 @@
|
||||||
+/* Shared library add-on to iptables to add IMQ target support. */
|
+/* Shared library add-on to iptables to add IMQ target support. */
|
||||||
+#include <stdio.h>
|
+#include <stdio.h>
|
||||||
+#include <string.h>
|
+#include <string.h>
|
||||||
+#include <stdlib.h>
|
+#include <stdlib.h>
|
||||||
+#include <getopt.h>
|
+#include <getopt.h>
|
||||||
+
|
+
|
||||||
+#include <iptables.h>
|
+#include <iptables.h>
|
||||||
+#include <linux/netfilter_ipv4/ip_tables.h>
|
+#include <linux/netfilter_ipv4/ip_tables.h>
|
||||||
+#include <linux/netfilter_ipv4/ipt_IMQ.h>
|
+#include <linux/netfilter_ipv4/ipt_IMQ.h>
|
||||||
+
|
+
|
||||||
+/* Function which prints out usage message. */
|
+/* Function which prints out usage message. */
|
||||||
+static void
|
+static void
|
||||||
+help(void)
|
+help(void)
|
||||||
+{
|
+{
|
||||||
+ printf(
|
+ printf(
|
||||||
+"IMQ target v%s options:\n"
|
+"IMQ target v%s options:\n"
|
||||||
+" --todev <N> enqueue to imq<N>, defaults to 0\n",
|
+" --todev <N> enqueue to imq<N>, defaults to 0\n",
|
||||||
+IPTABLES_VERSION);
|
+IPTABLES_VERSION);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static struct option opts[] = {
|
+static struct option opts[] = {
|
||||||
+ { "todev", 1, 0, '1' },
|
+ { "todev", 1, 0, '1' },
|
||||||
+ { 0 }
|
+ { 0 }
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+/* Initialize the target. */
|
+/* Initialize the target. */
|
||||||
+static void
|
+static void
|
||||||
+init(struct ipt_entry_target *t, unsigned int *nfcache)
|
+init(struct ipt_entry_target *t, unsigned int *nfcache)
|
||||||
+{
|
+{
|
||||||
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
|
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)t->data;
|
||||||
+
|
+
|
||||||
+ mr->todev = 0;
|
+ mr->todev = 0;
|
||||||
+ *nfcache |= NFC_UNKNOWN;
|
+ *nfcache |= NFC_UNKNOWN;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/* Function which parses command options; returns true if it
|
+/* Function which parses command options; returns true if it
|
||||||
+ ate an option */
|
+ ate an option */
|
||||||
+static int
|
+static int
|
||||||
+parse(int c, char **argv, int invert, unsigned int *flags,
|
+parse(int c, char **argv, int invert, unsigned int *flags,
|
||||||
+ const struct ipt_entry *entry,
|
+ const struct ipt_entry *entry,
|
||||||
+ struct ipt_entry_target **target)
|
+ struct ipt_entry_target **target)
|
||||||
+{
|
+{
|
||||||
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
|
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)(*target)->data;
|
||||||
+
|
+
|
||||||
+ switch(c) {
|
+ switch(c) {
|
||||||
+ case '1':
|
+ case '1':
|
||||||
+ if (check_inverse(optarg, &invert, NULL, 0))
|
+ if (check_inverse(optarg, &invert, NULL, 0))
|
||||||
+ exit_error(PARAMETER_PROBLEM,
|
+ exit_error(PARAMETER_PROBLEM,
|
||||||
+ "Unexpected `!' after --todev");
|
+ "Unexpected `!' after --todev");
|
||||||
+ mr->todev=atoi(optarg);
|
+ mr->todev=atoi(optarg);
|
||||||
+ break;
|
+ break;
|
||||||
+ default:
|
+ default:
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+ }
|
+ }
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static void
|
+static void
|
||||||
+final_check(unsigned int flags)
|
+final_check(unsigned int flags)
|
||||||
+{
|
+{
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/* Prints out the targinfo. */
|
+/* Prints out the targinfo. */
|
||||||
+static void
|
+static void
|
||||||
+print(const struct ipt_ip *ip,
|
+print(const struct ipt_ip *ip,
|
||||||
+ const struct ipt_entry_target *target,
|
+ const struct ipt_entry_target *target,
|
||||||
+ int numeric)
|
+ int numeric)
|
||||||
+{
|
+{
|
||||||
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
|
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
|
||||||
+
|
+
|
||||||
+ printf("IMQ: todev %u ", mr->todev);
|
+ printf("IMQ: todev %u ", mr->todev);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/* Saves the union ipt_targinfo in parsable form to stdout. */
|
+/* Saves the union ipt_targinfo in parsable form to stdout. */
|
||||||
+static void
|
+static void
|
||||||
+save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
|
+save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
|
||||||
+{
|
+{
|
||||||
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
|
+ struct ipt_imq_info *mr = (struct ipt_imq_info*)target->data;
|
||||||
+
|
+
|
||||||
+ printf("--todev %u", mr->todev);
|
+ printf("--todev %u", mr->todev);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static struct iptables_target imq = {
|
+static struct iptables_target imq = {
|
||||||
+ .next = NULL,
|
+ .next = NULL,
|
||||||
+ .name = "IMQ",
|
+ .name = "IMQ",
|
||||||
+ .version = IPTABLES_VERSION,
|
+ .version = IPTABLES_VERSION,
|
||||||
+ .size = IPT_ALIGN(sizeof(struct ipt_imq_info)),
|
+ .size = IPT_ALIGN(sizeof(struct ipt_imq_info)),
|
||||||
+ .userspacesize = IPT_ALIGN(sizeof(struct ipt_imq_info)),
|
+ .userspacesize = IPT_ALIGN(sizeof(struct ipt_imq_info)),
|
||||||
+ .help = &help,
|
+ .help = &help,
|
||||||
+ .init = &init,
|
+ .init = &init,
|
||||||
+ .parse = &parse,
|
+ .parse = &parse,
|
||||||
+ .final_check = &final_check,
|
+ .final_check = &final_check,
|
||||||
+ .print = &print,
|
+ .print = &print,
|
||||||
+ .save = &save,
|
+ .save = &save,
|
||||||
+ .extra_opts = opts
|
+ .extra_opts = opts
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+static __attribute__((constructor)) void _init(void)
|
+void _init(void)
|
||||||
+{
|
+{
|
||||||
+ register_target(&imq);
|
+ register_target(&imq);
|
||||||
+}
|
+}
|
||||||
|
|
||||||
Reference in New Issue
Block a user