diff options
author | Arturo Borrero <arturo.borrero.glez@gmail.com> | 2013-07-06 02:39:52 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-07-06 15:29:52 +0200 |
commit | ffb16b9416d5a77520388fc5c12ccd0570726e57 (patch) | |
tree | 7ac546f7b15a3140e71f007071d0b5fa31e96ff8 /examples | |
parent | 1e8e5d4b55efe4f11334a5b55483b802cb704071 (diff) |
set: add xml output
This patch adds XML output for sets.
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/nft-set-elem-get.c | 5 | ||||
-rw-r--r-- | examples/nft-set-get.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/examples/nft-set-elem-get.c b/examples/nft-set-elem-get.c index 353a752..591dd45 100644 --- a/examples/nft-set-elem-get.c +++ b/examples/nft-set-elem-get.c @@ -56,7 +56,8 @@ int main(int argc, char *argv[]) int ret; if (argc < 4 || argc > 5) { - fprintf(stderr, "%s <family> <table> <set> [default|json]\n", argv[0]); + fprintf(stderr, "%s <family> <table> <set> [<json|xml>]\n", + argv[0]); return EXIT_FAILURE; } t = nft_set_alloc(); @@ -78,6 +79,8 @@ int main(int argc, char *argv[]) if (argc == 5 && strcmp(argv[4], "json") == 0 ) type = NFT_SET_O_JSON; + else if (argc == 5 && strcmp(argv[4], "xml") == 0) + type = NFT_SET_O_XML; nlh = nft_set_nlmsg_build_hdr(buf, NFT_MSG_GETSETELEM, family, NLM_F_DUMP|NLM_F_ACK, seq); diff --git a/examples/nft-set-get.c b/examples/nft-set-get.c index 5ef654c..45f74ff 100644 --- a/examples/nft-set-get.c +++ b/examples/nft-set-get.c @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) int ret; if (argc < 3 || argc > 4) { - fprintf(stderr, "%s <family> <table> [default|json]\n", argv[0]); + fprintf(stderr, "%s <family> <table> [<json|xml>]\n", argv[0]); return EXIT_FAILURE; } t = nft_set_alloc(); @@ -78,6 +78,8 @@ int main(int argc, char *argv[]) if (argc == 4 && strcmp(argv[3], "json") == 0) type = NFT_SET_O_JSON; + else if (argc == 4 && strcmp(argv[3], "xml") == 0) + type = NFT_SET_O_XML; nlh = nft_set_nlmsg_build_hdr(buf, NFT_MSG_GETSET, family, NLM_F_DUMP|NLM_F_ACK, seq); |