From 50b056ce99517939cc4c0f5e278d32a252b71ee6 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 11 Apr 2014 11:57:53 +0200 Subject: nft: xtables: add generic parsing infrastructure to interpret commands Split the code to parse arguments and to issue command so we reuse this for the iptables to nft translation infrastructure. Signed-off-by: Pablo Neira Ayuso --- iptables/nft-shared.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'iptables/nft-shared.h') diff --git a/iptables/nft-shared.h b/iptables/nft-shared.h index b3dc3c2b..03784ccc 100644 --- a/iptables/nft-shared.h +++ b/iptables/nft-shared.h @@ -217,4 +217,19 @@ struct xtables_args { #define CMD_ZERO_NUM 0x2000U #define CMD_CHECK 0x4000U +struct nft_xt_cmd_parse { + unsigned int command; + unsigned int rulenum; + char *table; + char *chain; + char *newname; + char *policy; + bool restore; + int verbose; +}; + +void do_parse(struct nft_handle *h, int argc, char *argv[], + struct nft_xt_cmd_parse *p, struct iptables_command_state *cs, + struct xtables_args *args); + #endif -- cgit v1.2.3