diff options
author | Álvaro Neira Ayuso <alvaroneay@gmail.com> | 2013-11-11 21:09:35 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-11-14 00:38:38 +0100 |
commit | 989b793a3bf689757b2b8f08a1c264743d75fa0f (patch) | |
tree | 8a932779feb9b906282cc929ad0cab30799c8176 /include/libnftables/rule.h | |
parent | 838ae8f60f43061778ce1b7f08cb08fc60fd21f9 (diff) |
src: unify parse and output types
Unify parse and output types that are redundant to all
existing nftables objects. Thus, all NFT_*_O_[XML|JSON|DEFAULT]
are merged into NFT_OUTPUT_[JSON|XML] and NFT_PARSE_[JSON|XML].
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/libnftables/rule.h')
-rw-r--r-- | include/libnftables/rule.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/include/libnftables/rule.h b/include/libnftables/rule.h index b61afb0..4957a2a 100644 --- a/include/libnftables/rule.h +++ b/include/libnftables/rule.h @@ -6,6 +6,8 @@ #include <stdbool.h> #include <sys/types.h> +#include <libnftables/common.h> + #ifdef __cplusplus extern "C" { #endif @@ -45,20 +47,7 @@ struct nlmsghdr; void nft_rule_nlmsg_build_payload(struct nlmsghdr *nlh, struct nft_rule *t); -enum { - NFT_RULE_O_DEFAULT = 0, - NFT_RULE_O_XML, - NFT_RULE_O_JSON, -}; - -enum nft_rule_parse_type { - NFT_RULE_PARSE_NONE = 0, - NFT_RULE_PARSE_XML, - NFT_RULE_PARSE_JSON, - NFT_RULE_PARSE_MAX, -}; - -int nft_rule_parse(struct nft_rule *r, enum nft_rule_parse_type type, const char *data); +int nft_rule_parse(struct nft_rule *r, enum nft_parse_type type, const char *data); int nft_rule_snprintf(char *buf, size_t size, struct nft_rule *t, uint32_t type, uint32_t flags); int nft_rule_fprintf(FILE *fp, struct nft_rule *r, uint32_t type, uint32_t flags); |