]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Gerd Knorr's fixes to iplimit match
authorGerd Knorr <kraxel@bytesex.org>
Thu, 12 Apr 2001 15:40:05 +0000 (15:40 +0000)
committerHarald Welte <laforge@gnumonks.org>
Thu, 12 Apr 2001 15:40:05 +0000 (15:40 +0000)
extensions/libipt_connlimit.c

index 1600dea0b872453c739263930764995b7ba6ef44..19928ac2e77d5b9e221b26e40306e519af722377 100644 (file)
@@ -3,6 +3,7 @@
 #include <netdb.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stddef.h>
 #include <getopt.h>
 #include <iptables.h>
 #include <linux/netfilter_ipv4/ip_conntrack.h>
@@ -99,7 +100,7 @@ print(const struct ipt_ip *ip,
 {
        struct ipt_iplimit_info *info = (struct ipt_iplimit_info*)match->data;
 
-       printf("#conn/%d %s %d", count_bits(info->mask),
+       printf("#conn/%d %s %d ", count_bits(info->mask),
               info->inverse ? "<" : ">", info->limit);
 }
 
@@ -108,23 +109,22 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
 {
        struct ipt_iplimit_info *info = (struct ipt_iplimit_info*)match->data;
 
-       printf("%s--iplimit-above %d",info->inverse ? "! " : "",info->limit);
-       printf(" --iplimit-mask %d",count_bits(info->mask));
+       printf("%s--iplimit-above %d ",info->inverse ? "! " : "",info->limit);
+       printf("--iplimit-mask %d ",count_bits(info->mask));
 }
 
-struct iptables_match iplimit
-= { NULL,
-    "iplimit",
-    NETFILTER_VERSION,
-    IPT_ALIGN(sizeof(struct ipt_iplimit_info)),
-    IPT_ALIGN(sizeof(struct ipt_iplimit_info)),
-    &help,
-    &init,
-    &parse,
-    &final_check,
-    &print,
-    &save,
-    opts
+static struct iptables_match iplimit = {
+       name:           "iplimit",
+       version:        NETFILTER_VERSION,
+       size:           IPT_ALIGN(sizeof(struct ipt_iplimit_info)),
+       userspacesize:  offsetof(struct ipt_iplimit_info,data),
+       help:           help,
+       init:           init,
+       parse:          parse,
+       final_check:    final_check,
+       print:          print,
+       save:           save,
+       extra_opts:     opts
 };
 
 void _init(void)