Add abstract fw3_xt_reset() implementation
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 27 May 2013 13:46:15 +0000 (15:46 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 27 May 2013 13:47:47 +0000 (15:47 +0200)
iptables.c
iptables.h
xtables-10.h
xtables-5.h

index a1897454d3bda39b3e1b9a51c6da72f88db21ce3..9565f8d1746dc2138600d8000ff4221bcccf7c74 100644 (file)
@@ -101,12 +101,7 @@ fw3_ipt_open(enum fw3_family family, enum fw3_table table)
                return NULL;
        }
 
-       xtables_pending_matches = NULL;
-       xtables_pending_targets = NULL;
-
-       xtables_matches = NULL;
-       xtables_targets = NULL;
-
+       fw3_xt_reset();
        fw3_init_extensions();
 
        return h;
index 05a1c7288be9eac3a66e35858d8786fe2c660f69..51c63d0f6210bf3e19d9aa3ee886754d3b66c82b 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "options.h"
 
-
+/* xtables interface */
 #if (XTABLES_VERSION_CODE == 10)
 # include "xtables-10.h"
 #elif (XTABLES_VERSION_CODE == 5)
@@ -38,9 +38,6 @@
 # error "Unsupported xtables version"
 #endif
 
-extern struct xtables_match *xtables_pending_matches;
-extern struct xtables_target *xtables_pending_targets;
-
 /* libext.a interface */
 #define FW3_IPT_MODULES                        \
        __ipt_module(comment)           \
index 6b52fff21265706dcdbe9af541fd2403bd6a86e1..2372b8c402178ed78c3d680e8c9f0d81d9c3e25c 100644 (file)
 #ifndef __FW3_XTABLES_10_H
 #define __FW3_XTABLES_10_H
 
+extern struct xtables_match *xtables_pending_matches;
+extern struct xtables_target *xtables_pending_targets;
+
+static inline void
+fw3_xt_reset(void)
+{
+       xtables_matches = NULL;
+       xtables_targets = NULL;
+
+       xtables_pending_matches = NULL;
+       xtables_pending_targets = NULL;
+}
+
+
 static inline const char *
 fw3_xt_get_match_name(struct xtables_match *m)
 {
index 263d0122c2f6586caaad6da8554ada8dd5aeec10..1ae833453d50ced889d9ce800f0811a26a9f84b4 100644 (file)
 #ifndef __FW3_XTABLES_5_H
 #define __FW3_XTABLES_5_H
 
+static inline void
+fw3_xt_reset(void)
+{
+       xtables_matches = NULL;
+       xtables_targets = NULL;
+}
+
+
 static inline const char *
 fw3_xt_get_match_name(struct xtables_match *m)
 {