path: root/iptables/xshared.h
diff options
authorLorenzo Colitti <>2017-03-16 16:55:01 +0900
committerPablo Neira Ayuso <>2017-03-17 14:20:46 +0100
commit6e2e169eb66b63d2991e1c7ada931e3cdb0ced32 (patch)
tree2d30c42e08c94f7681a88d316fdbba9a1ed24dbc /iptables/xshared.h
parent836846f0d747e1be8e37d2d43b215a68b30ea1a9 (diff)
iptables: remove duplicated argument parsing code
1. Factor out repeated code to a new xs_has_arg function. 2. Add a new parse_wait_time option to parse the value of -w. 3. Make parse_wait_interval take argc and argv so its callers can be simpler. Signed-off-by: Lorenzo Colitti <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'iptables/xshared.h')
1 files changed, 3 insertions, 1 deletions
diff --git a/iptables/xshared.h b/iptables/xshared.h
index 18b1cf37..d8a697ae 100644
--- a/iptables/xshared.h
+++ b/iptables/xshared.h
@@ -88,7 +88,9 @@ extern void xs_init_target(struct xtables_target *);
extern void xs_init_match(struct xtables_match *);
bool xtables_lock(int wait, struct timeval *wait_interval);
-void parse_wait_interval(const char *str, struct timeval *wait_interval);
+int parse_wait_time(int argc, char *argv[]);
+void parse_wait_interval(int argc, char *argv[], struct timeval *wait_interval);
+bool xs_has_arg(int argc, char *argv[]);
extern const struct xtables_afinfo *afinfo;