summaryrefslogtreecommitdiffstats
path: root/iptables/xshared.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-09-24 19:25:24 +0200
committerFlorian Westphal <fw@strlen.de>2018-09-25 16:26:28 +0200
commit9f075031a1973fc967cd90de96dc2e87696a2181 (patch)
tree74552de05b1cffb6989af70ac46b141385e6a62b /iptables/xshared.h
parent7373297262eef6754570a5cb05c18332c801370f (diff)
Combine parse_target() and command_jump() implementations
Merge these two functions from xtables, iptables, ip6tables and arptables. Both functions were basically identical in the first three, only the last one required a bit more attention. To eliminate access to 'invflags' in variant-specific location, move the call to set_option() into callers. This is actually consistent with parsing of other options in them. As with command_match(), use xt_params instead of the different *_globals objects to refer to 'opts' and 'orig_opts'. It was necessary to rename parse_target() as it otherwise clashes with a static function of same name in libxt_SET. In arptables, the maximum allowed target name is a bit larger, so introduce xtables_globals.target_maxnamelen defining the value. It is used in the shared xt_parse_target() implementation. Implementation of command_jump() in arptables diverted from the others for no obvious reason. The call to parse_target() was done outside of it and a pointer to cs->arp was passed but not used inside. 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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/iptables/xshared.h b/iptables/xshared.h
index 9039a24b..db499f29 100644
--- a/iptables/xshared.h
+++ b/iptables/xshared.h
@@ -175,5 +175,7 @@ void print_ifaces(const char *iniface, const char *outiface, uint8_t invflags,
unsigned int format);
void command_match(struct iptables_command_state *cs);
+const char *xt_parse_target(const char *targetname);
+void command_jump(struct iptables_command_state *cs);
#endif /* IPTABLES_XSHARED_H */