From: Álvaro Neira Ayuso Date: Thu, 27 Jun 2013 19:56:26 +0000 (+0200) Subject: examples: add JSON support X-Git-Tag: libnftnl-1.0.0~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2be50c8b8be610ecf0b7217fb2e471face7cf74d;p=thirdparty%2Flibnftnl.git examples: add JSON support By specifying 'json' as first parameter. Signed-off-by: Alvaro Neira Ayuso Signed-off-by: Pablo Neira Ayuso --- diff --git a/examples/nft-rule-get.c b/examples/nft-rule-get.c index 5bf41f56..2404f277 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 */