summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extensions/Makefile4
-rw-r--r--extensions/libxt_CLASSIFY.c (renamed from extensions/libipt_CLASSIFY.c)45
-rw-r--r--include/linux/netfilter/xt_CLASSIFY.h8
-rw-r--r--include/linux/netfilter_ipv4/ipt_CLASSIFY.h8
4 files changed, 41 insertions, 24 deletions
diff --git a/extensions/Makefile b/extensions/Makefile
index ddde77de..53e3e9eb 100644
--- a/extensions/Makefile
+++ b/extensions/Makefile
@@ -5,9 +5,9 @@
# header files are present in the include/linux directory of this iptables
# package (HW)
#
-PF_EXT_SLIB:=ah addrtype conntrack ecn helper icmp iprange owner policy realm tos ttl unclean CLASSIFY DNAT DSCP ECN LOG MASQUERADE MIRROR NETMAP REDIRECT REJECT SAME SNAT TOS TTL ULOG
+PF_EXT_SLIB:=ah addrtype conntrack ecn helper icmp iprange owner policy realm tos ttl unclean DNAT DSCP ECN LOG MASQUERADE MIRROR NETMAP REDIRECT REJECT SAME SNAT TOS TTL ULOG
PF6_EXT_SLIB:=eui64 hl icmp6 owner policy HL LOG
-PFX_EXT_SLIB:=connmark connlimit comment dscp esp hashlimit length limit mac mark multiport physdev pkttype sctp state standard tcp tcpmss udp CONNMARK MARK NFQUEUE NOTRACK TCPMSS TRACE
+PFX_EXT_SLIB:=connmark connlimit comment dscp esp hashlimit length limit mac mark multiport physdev pkttype sctp state standard tcp tcpmss udp CLASSIFY CONNMARK MARK NFQUEUE NOTRACK TCPMSS TRACE
ifeq ($(DO_SELINUX), 1)
PF_EXT_SE_SLIB:=
diff --git a/extensions/libipt_CLASSIFY.c b/extensions/libxt_CLASSIFY.c
index 3096edc8..acebd926 100644
--- a/extensions/libipt_CLASSIFY.c
+++ b/extensions/libxt_CLASSIFY.c
@@ -4,9 +4,9 @@
#include <stdlib.h>
#include <getopt.h>
-#include <iptables.h>
-#include <linux/netfilter_ipv4/ip_tables.h>
-#include <linux/netfilter_ipv4/ipt_CLASSIFY.h>
+#include <xtables.h>
+#include <linux/netfilter/x_tables.h>
+#include <linux/netfilter/xt_CLASSIFY.h>
#include <linux/types.h>
#include <linux/pkt_sched.h>
@@ -50,8 +50,8 @@ parse(int c, char **argv, int invert, unsigned int *flags,
const void *entry,
struct xt_entry_target **target)
{
- struct ipt_classify_target_info *clinfo
- = (struct ipt_classify_target_info *)(*target)->data;
+ struct xt_classify_target_info *clinfo
+ = (struct xt_classify_target_info *)(*target)->data;
switch (c) {
case '1':
@@ -91,8 +91,8 @@ print(const void *ip,
const struct xt_entry_target *target,
int numeric)
{
- const struct ipt_classify_target_info *clinfo =
- (const struct ipt_classify_target_info *)target->data;
+ const struct xt_classify_target_info *clinfo =
+ (const struct xt_classify_target_info *)target->data;
printf("CLASSIFY set ");
print_class(clinfo->priority, numeric);
}
@@ -101,28 +101,45 @@ print(const void *ip,
static void
save(const void *ip, const struct xt_entry_target *target)
{
- const struct ipt_classify_target_info *clinfo =
- (const struct ipt_classify_target_info *)target->data;
+ const struct xt_classify_target_info *clinfo =
+ (const struct xt_classify_target_info *)target->data;
printf("--set-class %.4x:%.4x ",
TC_H_MAJ(clinfo->priority)>>16, TC_H_MIN(clinfo->priority));
}
-static struct iptables_target classify = {
+static struct xtables_target classify = {
+ .family = AF_INET,
.name = "CLASSIFY",
.version = IPTABLES_VERSION,
- .size = IPT_ALIGN(sizeof(struct ipt_classify_target_info)),
- .userspacesize = IPT_ALIGN(sizeof(struct ipt_classify_target_info)),
+ .size = XT_ALIGN(sizeof(struct xt_classify_target_info)),
+ .userspacesize = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.help = &help,
.init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
.save = &save,
- .extra_opts = opts
+ .extra_opts = opts,
+};
+
+static struct xtables_target classify6 = {
+ .family = AF_INET6,
+ .name = "CLASSIFY",
+ .version = IPTABLES_VERSION,
+ .size = XT_ALIGN(sizeof(struct xt_classify_target_info)),
+ .userspacesize = XT_ALIGN(sizeof(struct xt_classify_target_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
{
- register_target(&classify);
+ xtables_register_target(&classify);
+ xtables_register_target(&classify6);
}
diff --git a/include/linux/netfilter/xt_CLASSIFY.h b/include/linux/netfilter/xt_CLASSIFY.h
new file mode 100644
index 00000000..58111355
--- /dev/null
+++ b/include/linux/netfilter/xt_CLASSIFY.h
@@ -0,0 +1,8 @@
+#ifndef _XT_CLASSIFY_H
+#define _XT_CLASSIFY_H
+
+struct xt_classify_target_info {
+ u_int32_t priority;
+};
+
+#endif /*_XT_CLASSIFY_H */
diff --git a/include/linux/netfilter_ipv4/ipt_CLASSIFY.h b/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
deleted file mode 100644
index 7596e3dd..00000000
--- a/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _IPT_CLASSIFY_H
-#define _IPT_CLASSIFY_H
-
-struct ipt_classify_target_info {
- u_int32_t priority;
-};
-
-#endif /*_IPT_CLASSIFY_H */