From 4abb44c978d75656f69dd59f24522eb970881ccf Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 17 Sep 2019 18:43:21 +0200 Subject: xtables-restore: Introduce rule counter tokenizer function The same piece of code appears three times, introduce a function to take care of tokenizing and error reporting. Pass buffer pointer via reference so it can be updated to point to after the counters (if found). While being at it, drop pointless casting when passing pcnt/bcnt to add_argv(). Signed-off-by: Phil Sutter Acked-by: Pablo Neira Ayuso --- iptables/xshared.h | 1 + 1 file changed, 1 insertion(+) (limited to 'iptables/xshared.h') diff --git a/iptables/xshared.h b/iptables/xshared.h index b08c700e..21f4e8fd 100644 --- a/iptables/xshared.h +++ b/iptables/xshared.h @@ -151,6 +151,7 @@ extern int xtables_lock_or_exit(int wait, struct timeval *tv); int parse_wait_time(int argc, char *argv[]); void parse_wait_interval(int argc, char *argv[], struct timeval *wait_interval); int parse_counters(const char *string, struct xt_counters *ctr); +bool tokenize_rule_counters(char **bufferp, char **pcnt, char **bcnt, int line); bool xs_has_arg(int argc, char *argv[]); extern const struct xtables_afinfo *afinfo; -- cgit v1.2.3