summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÁlvaro Neira Ayuso <alvaroneay@gmail.com>2013-06-27 21:56:26 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-06-29 11:59:23 +0200
commit2be50c8b8be610ecf0b7217fb2e471face7cf74d (patch)
tree64e8de86371246d3a1c3360dbb51e2deba4ac4a5
parent4a684c2ee4cdff2c5c6bfa06d93b58cb4e868bf6 (diff)
examples: add JSON support
By specifying 'json' as first parameter. Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--examples/nft-rule-get.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/nft-rule-get.c b/examples/nft-rule-get.c
index 5bf41f5..2404f27 100644
--- a/examples/nft-rule-get.c
+++ b/examples/nft-rule-get.c
@@ -54,8 +54,11 @@ int main(int argc, char *argv[])
struct nft_rule *t = NULL;
int ret;
- if (argc == 2 && strcmp(argv[1], "xml") == 0 )
+ if (argc == 2 && strcmp(argv[1], "xml") == 0 ){
type = NFT_RULE_O_XML;
+ }else if (argc == 2 && strcmp(argv[1], "json") == 0 ){
+ type = NFT_RULE_O_JSON;
+ }
/* XXX requires table, chain and handle attributes for selective get */