M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,130 @@
diff -ruN iptables-1.4.7-old/extensions/libipt_NATTYPE.c iptables-1.4.7-new/extensions/libipt_NATTYPE.c
--- iptables-1.4.7-old/extensions/libipt_NATTYPE.c 1970-01-01 02:00:00.000000000 +0200
+++ iptables-1.4.7-new/extensions/libipt_NATTYPE.c 2010-04-22 11:14:47.000000000 +0300
@@ -0,0 +1,126 @@
+/* Shared library add-on to iptables to add masquerade support. */
+#include <stdio.h>
+#include <netdb.h>
+#include <string.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <xtables.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+//#include <linux/netfilter_ipv4/ip_nat_rule.h>
+#include <ipt_NATTYPE.h>
+
+/* Function which prints out usage message. */
+static void
+help(void)
+{
+ printf(
+ "NATTYPE target options:\n"
+ " --mode \n"
+ " dnat (PREROUTING)\n"
+ " forward_in (FORWARD)\n"
+ " forward_out (FORWARD)\n"
+ " --type \n"
+ " %d -- Endpoint Independent\n"
+ " %d -- Address Restricted\n",
+ TYPE_ENDPOINT_INDEPENDENT, TYPE_ADDRESS_RESTRICTED);
+}
+
+static struct option opts[] = {
+ {"mode", 1, 0, '1'},
+ { "type", 1, 0, '2' },
+ { 0 }
+};
+
+/* Initialize the target. */
+static void
+init(struct xt_entry_target *t)
+{
+}
+
+
+/* Function which parses command options; returns true if it
+ ate an option */
+static int
+parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry,
+ struct xt_entry_target **target)
+{
+ struct ipt_nattype_info *info = (struct ipt_nattype_info *)(*target)->data;
+
+ switch (c) {
+
+ case '1':
+ if (!strcasecmp(optarg, "dnat")) {
+ printf("dnat\n");
+ info->mode= MODE_DNAT;
+ } else if (!strcasecmp(optarg, "forward_in")){
+ printf("forward in\n");
+ info->mode= MODE_FORWARD_IN;
+ } else if (!strcasecmp(optarg, "forward_out")){
+ printf("forward out\n");
+ info->mode= MODE_FORWARD_OUT;
+ }
+ return 1;
+
+ case '2':
+ info->type = atoi(optarg);
+ printf("nat type: %d\n", info->type);
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+void print_mode(u_int16_t mode)
+{
+
+ printf("--mode:");
+ if( mode == MODE_DNAT)
+ printf("dnat ");
+ else if( mode == MODE_FORWARD_IN)
+ printf("forward_in ");
+ else if( mode == MODE_FORWARD_OUT)
+ printf("forward_out ");
+}
+
+/* Prints out the targinfo. */
+static void
+print(const void *ip,
+ const struct xt_entry_target *target,
+ int numeric)
+{
+ struct ipt_nattype_info *info = (struct ipt_nattype_info *)(target)->data;
+ print_mode(info->mode);
+ if( info->type !=0)
+ printf("--type: %d", info->type);
+}
+
+/* Saves the union ipt_targinfo in parsable form to stdout. */
+static void
+save(const void *ip, const struct xt_entry_target *target)
+{
+ struct ipt_nattype_info *info = (struct ipt_nattype_info *)(target)->data;
+ print_mode(info->mode);
+ if( info->type !=0)
+ printf("--type: %d", info->type);
+}
+
+static struct xtables_target nattype = { NULL,
+ .name = "NATTYPE",
+ .version = XTABLES_VERSION,
+ .family = NFPROTO_IPV4,
+ .size = XT_ALIGN(sizeof(struct ipt_nattype_info)),
+ .userspacesize = XT_ALIGN(sizeof(struct ipt_nattype_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts
+};
+
+void _init(void)
+{
+ xtables_register_target(&nattype);
+}
+45
View File
@@ -0,0 +1,45 @@
SUMMARY = "Tools for managing kernel packet filtering capabilities"
DESCRIPTION = "iptables is the userspace command line program used to configure \
and control network packet filtering code in Linux."
HOMEPAGE = "http://www.netfilter.org/"
BUGTRACKER = "http://bugzilla.netfilter.org/"
DEPENDS = "virtual/kernel"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
file://iptables/iptables.c;firstline=13;endline=25;md5=f1028f2401da1c120df27594b2be50ef"
PR = "r2"
RRECOMMENDS_${PN} = "kernel-module-x-tables \
kernel-module-ip-tables \
kernel-module-iptable-filter \
kernel-module-iptable-nat \
kernel-module-nf-defrag-ipv4 \
kernel-module-nf-conntrack \
kernel-module-nf-conntrack-ipv4 \
kernel-module-nf-nat \
kernel-module-ipt-masquerade"
FILES_${PN} =+ "${libdir}/xtables/"
FILES_${PN}-dbg =+ "${libdir}/xtables/.debug"
SRC_URI = " \
http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
file://103-ubicom32-nattype_lib.patch \
"
SRC_URI[md5sum] = "b08a1195ec2c1ebeaf072db3c55fdf43"
SRC_URI[sha256sum] = "77e6581f21f15946a814fa311236e5f3f7c6593180f9d695cea06aa95e464aba"
CFLAGS += "-I${STAGING_KERNEL_DIR}/source/include/linux/netfilter_ipv4"
inherit autotools
EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \
${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}"
do_configure_prepend() {
# Remove some libtool m4 files
# Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
}