]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
arptables-compat: add support for the CLASSIFY target
authorArturo Borrero <arturo.borrero.glez@gmail.com>
Thu, 5 Mar 2015 18:47:38 +0000 (19:47 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 5 Mar 2015 20:55:36 +0000 (21:55 +0100)
This patch adds support to arptables-compat for the CLASSIFY target.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libxt_CLASSIFY.c

index e04657aed7ff263a9fc63119a33587c5162e865c..cd016d8f7eae2c991010cb58009eedd132c45663 100644 (file)
@@ -73,20 +73,40 @@ CLASSIFY_save(const void *ip, const struct xt_entry_target *target)
               TC_H_MAJ(clinfo->priority)>>16, TC_H_MIN(clinfo->priority));
 }
 
-static struct xtables_target classify_target = { 
-       .family         = NFPROTO_UNSPEC,
-       .name           = "CLASSIFY",
-       .version        = XTABLES_VERSION,
-       .size           = XT_ALIGN(sizeof(struct xt_classify_target_info)),
-       .userspacesize  = XT_ALIGN(sizeof(struct xt_classify_target_info)),
-       .help           = CLASSIFY_help,
-       .print          = CLASSIFY_print,
-       .save           = CLASSIFY_save,
-       .x6_parse       = CLASSIFY_parse,
-       .x6_options     = CLASSIFY_opts,
+static void
+arpCLASSIFY_print(const void *ip, const struct xt_entry_target *target,
+                 int numeric)
+{
+       CLASSIFY_save(ip, target);
+}
+
+static struct xtables_target classify_target[] = {
+       {
+               .family         = NFPROTO_UNSPEC,
+               .name           = "CLASSIFY",
+               .version        = XTABLES_VERSION,
+               .size           = XT_ALIGN(sizeof(struct xt_classify_target_info)),
+               .userspacesize  = XT_ALIGN(sizeof(struct xt_classify_target_info)),
+               .help           = CLASSIFY_help,
+               .print          = CLASSIFY_print,
+               .save           = CLASSIFY_save,
+               .x6_parse       = CLASSIFY_parse,
+               .x6_options     = CLASSIFY_opts,
+       },
+       {
+               .family         = NFPROTO_ARP,
+               .name           = "CLASSIFY",
+               .version        = XTABLES_VERSION,
+               .size           = XT_ALIGN(sizeof(struct xt_classify_target_info)),
+               .userspacesize  = XT_ALIGN(sizeof(struct xt_classify_target_info)),
+               .help           = CLASSIFY_help,
+               .print          = arpCLASSIFY_print,
+               .x6_parse       = CLASSIFY_parse,
+               .x6_options     = CLASSIFY_opts,
+       },
 };
 
 void _init(void)
 {
-       xtables_register_target(&classify_target);
+       xtables_register_targets(classify_target, ARRAY_SIZE(classify_target));
 }