summaryrefslogtreecommitdiffstats
path: root/include/libnftables/set.h
diff options
context:
space:
mode:
authorÁlvaro Neira Ayuso <alvaroneay@gmail.com>2013-11-11 21:09:35 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2013-11-14 00:38:38 +0100
commit989b793a3bf689757b2b8f08a1c264743d75fa0f (patch)
tree8a932779feb9b906282cc929ad0cab30799c8176 /include/libnftables/set.h
parent838ae8f60f43061778ce1b7f08cb08fc60fd21f9 (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/set.h')
-rw-r--r--include/libnftables/set.h19
1 files changed, 4 insertions, 15 deletions
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 <stdbool.h>
#include <sys/types.h>
+#include <libnftables/common.h>
+
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);