From patchwork Thu Jun 13 18:50:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alvaro Neira X-Patchwork-Id: 251149 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D16A82C008A for ; Fri, 14 Jun 2013 04:50:34 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759150Ab3FMSue (ORCPT ); Thu, 13 Jun 2013 14:50:34 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:43477 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759106Ab3FMSud (ORCPT ); Thu, 13 Jun 2013 14:50:33 -0400 Received: by mail-wg0-f43.google.com with SMTP id z11so893913wgg.10 for ; Thu, 13 Jun 2013 11:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:from:date:message-id:in-reply-to:references:user-agent :mime-version:content-type:content-transfer-encoding; bh=kqaYGC4zlWltPJ0pPrnD+Tt3L5zVAtPlmmdsf5HgH14=; b=hlDg5RkCDRWwvZ0XCe2d8U0JB3X+uj0dFc5M/72uEu3d2q9+xzzRZM54TR82+bfEGh FHcBsE07zspJu1wLwWz5mxilIGxnmI4f6W8rp8+KdB+Iw1XAnODsd2FcjTjCqB2fijW5 8kWvD6FHEnlbje6ckMf1ZFdDg8RJTqHAcBx9tTIVOl/viWOwcct7eAQgblUQ8Nbj11UZ XY8dTfQ0VF2QiMFFNwkbPA1XVGADRN30VuZVQNtcElrlxPAkYu3TbMYRRq4WbI6UeDJG 9aphMDSynqK8mIVluyjC0YfuaYEnXsFOq8gJ8ieK5BL6A0paXFt46TzV/0SEIy9JfBbf U0yg== X-Received: by 10.194.179.129 with SMTP id dg1mr1481930wjc.38.1371149432000; Thu, 13 Jun 2013 11:50:32 -0700 (PDT) Received: from [127.0.1.1] (85.136.70.56.dyn.user.ono.com. [85.136.70.56]) by mx.google.com with ESMTPSA id k10sm33305640wia.4.2013.06.13.11.50.31 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 11:50:31 -0700 (PDT) Subject: [libnftables PATCH 2/2] Add code for testing the new functions for exporting rules to JSON Format To: netfilter-devel@vger.kernel.org From: Alvaro Neira Date: Thu, 13 Jun 2013 20:50:30 +0200 Message-ID: <20130613185030.423.58859.stgit@Ph0enix> In-Reply-To: <20130613184810.423.11555.stgit@Ph0enix> References: <20130613184810.423.11555.stgit@Ph0enix> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Álvaro Neira Ayuso Signed-off-by: Alvaro Neira Ayuso --- examples/nft-rule-get.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */