diff options
author | Phil Sutter <phil@nwl.cc> | 2018-08-02 17:05:17 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-08-04 14:29:21 +0200 |
commit | a2ed880a19d0861342b3515721804b18d698bf44 (patch) | |
tree | 22fc03a1b1db3e30f594f292b166a86a92de7e19 /iptables/xshared.h | |
parent | 1cc09188079a64dc8b733f198c959cfb441e6e20 (diff) |
xshared: Consolidate argv construction routines
Implementations were equal in {ip,ip6,x}tables-restore.c. The one in
iptables-xml.c differed slightly. For now, collect all features
together. Maybe it would make sense to migrate iptables-xml.c to using
add_param_to_argv() at some point and therefore extend the latter to
store whether a given parameter was quoted or not.
While being at it, a few improvements were done:
* free_argv() now also resets 'newargc' variable, so users don't have to
do that anymore.
* Indenting level in add_param_to_argv() was reduced a bit.
* That long error message is put into a single line to aid in grepping
for it.
* Explicit call to exit() after xtables_error() is removed since the
latter does not return anyway.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/xshared.h')
-rw-r--r-- | iptables/xshared.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/iptables/xshared.h b/iptables/xshared.h index 55249341..801d0f75 100644 --- a/iptables/xshared.h +++ b/iptables/xshared.h @@ -155,4 +155,17 @@ bool xs_has_arg(int argc, char *argv[]); extern const struct xtables_afinfo *afinfo; +extern char *newargv[]; +extern int newargc; + +extern char *oldargv[]; +extern int oldargc; + +extern int newargvattr[]; + +int add_argv(const char *what, int quoted); +void free_argv(void); +void save_argv(void); +void add_param_to_argv(char *parsestart, int line); + #endif /* IPTABLES_XSHARED_H */ |