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 /src/table.c | |
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 'src/table.c')
-rw-r--r-- | src/table.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/table.c b/src/table.c index d1acc7c..fe37f90 100644 --- a/src/table.c +++ b/src/table.c @@ -324,16 +324,16 @@ static int nft_table_json_parse(struct nft_table *t, const char *json) #endif } -int nft_table_parse(struct nft_table *t, enum nft_table_parse_type type, +int nft_table_parse(struct nft_table *t, enum nft_parse_type type, const char *data) { int ret; switch (type) { - case NFT_TABLE_PARSE_XML: + case NFT_PARSE_XML: ret = nft_table_xml_parse(t, data); break; - case NFT_TABLE_PARSE_JSON: + case NFT_PARSE_JSON: ret = nft_table_json_parse(t, data); break; default: @@ -375,11 +375,11 @@ int nft_table_snprintf(char *buf, size_t size, struct nft_table *t, uint32_t type, uint32_t flags) { switch(type) { - case NFT_TABLE_O_DEFAULT: + case NFT_OUTPUT_DEFAULT: return nft_table_snprintf_default(buf, size, t); - case NFT_TABLE_O_XML: + case NFT_OUTPUT_XML: return nft_table_snprintf_xml(buf, size, t); - case NFT_TABLE_O_JSON: + case NFT_OUTPUT_JSON: return nft_table_snprintf_json(buf, size, t); default: break; |