diff options
author | Alvaro Neira Ayuso <alvaroneay@gmail.com> | 2013-06-08 03:36:12 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-06-08 19:30:24 +0200 |
commit | 38c7f8f62c0a0326b0f9e4dc55bdb297cce25306 (patch) | |
tree | bf35b0a37dadc3eb12961635d5a65fd1813566c2 /examples/nft-chain-get.c | |
parent | 28aece8907a66af30e3b88882c371f9fa3358371 (diff) |
examples: nft-chain-get: export in JSON format
Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples/nft-chain-get.c')
-rw-r--r-- | examples/nft-chain-get.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/nft-chain-get.c b/examples/nft-chain-get.c index b815523..459b79e 100644 --- a/examples/nft-chain-get.c +++ b/examples/nft-chain-get.c @@ -90,8 +90,11 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - if (strcmp(argv[argc-1], "xml") == 0) + if (strcmp(argv[argc-1], "xml") == 0){ type = NFT_CHAIN_O_XML; + }else if (strcmp(argv[argc-1], "json") == 0){ + type = NFT_CHAIN_O_JSON; + } nl = mnl_socket_open(NETLINK_NETFILTER); if (nl == NULL) { |