From 989b793a3bf689757b2b8f08a1c264743d75fa0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Neira=20Ayuso?= Date: Mon, 11 Nov 2013 21:09:35 +0100 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- include/libnftables/ruleset.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'include/libnftables/ruleset.h') diff --git a/include/libnftables/ruleset.h b/include/libnftables/ruleset.h index 3b20bfa..71ef3b1 100644 --- a/include/libnftables/ruleset.h +++ b/include/libnftables/ruleset.h @@ -7,6 +7,8 @@ #include #include +#include + #ifdef __cplusplus extern "C" { #endif @@ -28,20 +30,7 @@ void nft_ruleset_attr_unset(struct nft_ruleset *r, uint16_t attr); void nft_ruleset_attr_set(struct nft_ruleset *r, uint16_t attr, void *data); const void *nft_ruleset_attr_get(const struct nft_ruleset *r, uint16_t attr); -enum { - NFT_RULESET_O_DEFAULT = 0, - NFT_RULESET_O_XML, - NFT_RULESET_O_JSON, -}; - -enum nft_ruleset_parse_type { - NFT_RULESET_PARSE_NONE = 0, - NFT_RULESET_PARSE_XML, - NFT_RULESET_PARSE_JSON, - NFT_RULESET_PARSE_MAX, -}; - -int nft_ruleset_parse(struct nft_ruleset *rs, enum nft_ruleset_parse_type type, const char *data); +int nft_ruleset_parse(struct nft_ruleset *rs, enum nft_parse_type type, const char *data); int nft_ruleset_snprintf(char *buf, size_t size, const struct nft_ruleset *rs, uint32_t type, uint32_t flags); int nft_ruleset_fprintf(FILE *fp, const struct nft_ruleset *rs, uint32_t type, uint32_t flags); -- cgit v1.2.3