From 7b63363c22a62e14d05f41c418b98fe4b45db9c3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 27 May 2013 15:46:15 +0200 Subject: [PATCH] Add abstract fw3_xt_reset() implementation --- iptables.c | 7 +------ iptables.h | 5 +---- xtables-10.h | 14 ++++++++++++++ xtables-5.h | 8 ++++++++ 4 files changed, 24 insertions(+), 10 deletions(-) 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) { -- 2.25.1