From: Jo-Philipp Wich Date: Mon, 27 May 2013 13:46:15 +0000 (+0200) Subject: Add abstract fw3_xt_reset() implementation X-Git-Url: https://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=commitdiff_plain;h=7b63363c22a62e14d05f41c418b98fe4b45db9c3 Add abstract fw3_xt_reset() implementation --- diff --git a/iptables.c b/iptables.c index a189745..9565f8d 100644 --- a/iptables.c +++ b/iptables.c @@ -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; diff --git a/iptables.h b/iptables.h index 05a1c72..51c63d0 100644 --- a/iptables.h +++ b/iptables.h @@ -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) \ diff --git a/xtables-10.h b/xtables-10.h index 6b52fff..2372b8c 100644 --- a/xtables-10.h +++ b/xtables-10.h @@ -19,6 +19,20 @@ #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) { diff --git a/xtables-5.h b/xtables-5.h index 263d012..1ae8334 100644 --- a/xtables-5.h +++ b/xtables-5.h @@ -19,6 +19,14 @@ #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) {