summaryrefslogtreecommitdiffstats
path: root/examples/nft-set-elem-get.c
diff options
context:
space:
mode:
authorArturo Borrero <arturo.borrero.glez@gmail.com>2013-07-06 02:39:52 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-07-06 15:29:52 +0200
commitffb16b9416d5a77520388fc5c12ccd0570726e57 (patch)
tree7ac546f7b15a3140e71f007071d0b5fa31e96ff8 /examples/nft-set-elem-get.c
parent1e8e5d4b55efe4f11334a5b55483b802cb704071 (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/nft-set-elem-get.c')
-rw-r--r--examples/nft-set-elem-get.c5
1 files changed, 4 insertions, 1 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);