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/set.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'include/libnftables/set.h') diff --git a/include/libnftables/set.h b/include/libnftables/set.h index cf63b9b..d378049 100644 --- a/include/libnftables/set.h +++ b/include/libnftables/set.h @@ -6,6 +6,8 @@ #include #include +#include + enum { NFT_SET_ATTR_TABLE, NFT_SET_ATTR_NAME, @@ -58,14 +60,7 @@ struct nft_set *nft_set_list_iter_cur(struct nft_set_list_iter *iter); struct nft_set *nft_set_list_iter_next(struct nft_set_list_iter *iter); void nft_set_list_iter_destroy(struct nft_set_list_iter *iter); -enum nft_set_parse_type { - NFT_SET_PARSE_NONE = 0, - NFT_SET_PARSE_XML, - NFT_SET_PARSE_JSON, - NFT_SET_PARSE_MAX, -}; - -int nft_set_parse(struct nft_set *s, enum nft_set_parse_type type, const char *data); +int nft_set_parse(struct nft_set *s, enum nft_parse_type type, const char *data); /* * Set elements @@ -79,12 +74,6 @@ enum { NFT_SET_ELEM_ATTR_DATA, }; -enum { - NFT_SET_O_DEFAULT = 0, - NFT_SET_O_XML, - NFT_SET_O_JSON, -}; - struct nft_set_elem; struct nft_set_elem *nft_set_elem_alloc(void); @@ -109,7 +98,7 @@ void nft_set_elem_nlmsg_build_payload(struct nlmsghdr *nlh, struct nft_set_elem int nft_set_elem_nlmsg_parse(const struct nlmsghdr *nlh, struct nft_set_elem *s); -int nft_set_elem_parse(struct nft_set_elem *e, enum nft_set_parse_type type, const char *data); +int nft_set_elem_parse(struct nft_set_elem *e, enum nft_parse_type type, const char *data); int nft_set_elem_snprintf(char *buf, size_t size, struct nft_set_elem *s, uint32_t type, uint32_t flags); int nft_set_elem_fprintf(FILE *fp, struct nft_set_elem *se, uint32_t type, uint32_t flags); -- cgit v1.2.3