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/chain.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'include/libnftables/chain.h') diff --git a/include/libnftables/chain.h b/include/libnftables/chain.h index 5de7318..c26b348 100644 --- a/include/libnftables/chain.h +++ b/include/libnftables/chain.h @@ -6,6 +6,8 @@ #include #include +#include + #ifdef __cplusplus extern "C" { #endif @@ -47,20 +49,7 @@ struct nlmsghdr; void nft_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nft_chain *t); -enum { - NFT_CHAIN_O_DEFAULT = 0, - NFT_CHAIN_O_XML, - NFT_CHAIN_O_JSON, -}; - -enum nft_chain_parse_type { - NFT_CHAIN_PARSE_NONE = 0, - NFT_CHAIN_PARSE_XML, - NFT_CHAIN_PARSE_JSON, - NFT_CHAIN_PARSE_MAX -}; - -int nft_chain_parse(struct nft_chain *c, enum nft_chain_parse_type type, const char *data); +int nft_chain_parse(struct nft_chain *c, enum nft_parse_type type, const char *data); int nft_chain_snprintf(char *buf, size_t size, struct nft_chain *t, uint32_t type, uint32_t flags); int nft_chain_fprintf(FILE *fp, struct nft_chain *c, uint32_t type, uint32_t flags); -- cgit v1.2.3