From patchwork Thu Jun 27 19:56:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alvaro Neira X-Patchwork-Id: 255128 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 E78CB2C03E4 for ; Fri, 28 Jun 2013 05:56:43 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754292Ab3F0T4c (ORCPT ); Thu, 27 Jun 2013 15:56:32 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:36374 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754288Ab3F0T4a (ORCPT ); Thu, 27 Jun 2013 15:56:30 -0400 Received: by mail-wi0-f170.google.com with SMTP id ey16so998805wid.1 for ; Thu, 27 Jun 2013 12:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=kqaYGC4zlWltPJ0pPrnD+Tt3L5zVAtPlmmdsf5HgH14=; b=bpzC7ZFUYDpbd1xc+x6TFLDOeU7pUu+Mz8l0TExlmbG4UU1qjikUhtxBiIJRt+HPe+ z8VGlx0S6rtyIAQuQ/jT+12psi5CWvFTNlqsc34Ft9XossqzjuMCI7eJ7ftt8X5T1otf Fn4o37TU+Vq60pKHTIxh5Yn0ULh0Qup2lsPfVJxmeouzStadwpvLbJlgj7G3Guulz69X juhiqprR6vudaTrtLGT4yutvtPypPRYba6E3+oXPz1LNfstQ8qwqK4tI306+fc5y7SQR wiFb7rBiZUcxqPH2DIJiReCOBnXvn3CVHG2RAZq9HOG36gZoU9N6ZKIQebfknkB5uoBR u2yw== X-Received: by 10.180.77.74 with SMTP id q10mr171853wiw.28.1372362988860; Thu, 27 Jun 2013 12:56:28 -0700 (PDT) Received: from [127.0.1.1] (114.235.78.188.dynamic.jazztel.es. [188.78.235.114]) by mx.google.com with ESMTPSA id fb2sm19592289wic.4.2013.06.27.12.56.27 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Jun 2013 12:56:28 -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 Cc: eric@regit.org Date: Thu, 27 Jun 2013 21:56:26 +0200 Message-ID: <20130627195626.13980.61479.stgit@Ph0enix> In-Reply-To: <20130627194837.13980.68301.stgit@Ph0enix> References: <20130627194837.13980.68301.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 */