From patchwork Thu Aug 3 15:55:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Fortin X-Patchwork-Id: 797286 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b="VXj+t6eG"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xNZSj6Mx2z9s7C for ; Fri, 4 Aug 2017 01:57:25 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751237AbdHCPzy (ORCPT ); Thu, 3 Aug 2017 11:55:54 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:38022 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910AbdHCPzw (ORCPT ); Thu, 3 Aug 2017 11:55:52 -0400 Received: by mail-wr0-f181.google.com with SMTP id f21so7358120wrf.5 for ; Thu, 03 Aug 2017 08:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=25NpDi7SjD9APy7r0+JkFS9lS5lBQvF1dLDgQeHg1YQ=; b=VXj+t6eGK94TtxdWYRpI8sVWGuyMKl2t8i4BhZ3ND1rPFsoB98Vw3ZlUp9e8sBw6mt vQQec9tFau4gFCnInE5S6F6vRkeIiOdhgAM+K/pQbiZgKVg9kX+JDBfcWq3BRfA1vsMe G56jpcVjCojLEITZWmfc62oEHf3weX8W7A+14= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=25NpDi7SjD9APy7r0+JkFS9lS5lBQvF1dLDgQeHg1YQ=; b=kFqjK7cdy6bZKipm+q7QkTVKhPYM2TvUlVvgDftpjYiKc/8BgwBi714Jq+z/kjS62J nqzlHecuNCOcI7ggnixfQ0NotAM2Pg5Gc+dcpGpfKLlxg5uBEL2l/QEZ9IBpopV3Dp4l ekdSDnpUlxkiNNH7XYaXz/x6cGy3u5oOjr1cZxRqBPSxAIZzj13r/Sm2uMXm3kKDGdh1 cCDuFFupfKS9PctGkkCTphMPmjTmQr6Cm1UVbq+FaUcx9aSCa39d7OVyd8fV7b7rG6FG oa5sUxKTa5GYkeMJQNx/vgclmzLSTkNEw2knTilEEM+6+8TK5F+dEpKoCO5NHT0WHHuw hQyA== X-Gm-Message-State: AIVw113UXG6ydjsuNhVE6YN7t2CfFs824cMQ+7X6WmZIQrjuRo9fs/7m 3cUoQTgRLl/bd8Vc5fY= X-Received: by 10.223.172.86 with SMTP id v80mr1900953wrc.112.1501775751423; Thu, 03 Aug 2017 08:55:51 -0700 (PDT) Received: from localhost.localdomain (91-160-18-219.subs.proxad.net. [91.160.18.219]) by smtp.googlemail.com with ESMTPSA id d91sm2213309wma.23.2017.08.03.08.55.50 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 03 Aug 2017 08:55:50 -0700 (PDT) From: Julien Fortin X-Google-Original-From: Julien Fortin To: netdev@vger.kernel.org Cc: roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com, dsa@cumulusnetworks.com, Julien Fortin Subject: [PATCH 16/27] ip: iplink_vrf.c: add json output support Date: Thu, 3 Aug 2017 17:55:04 +0200 Message-Id: <20170803155515.99226-17-julien@cumulusnetworks.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170803155515.99226-1-julien@cumulusnetworks.com> References: <20170803155515.99226-1-julien@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Julien Fortin Schema: { "table": { "type": "uint", "attr": "IFLA_VRF_TABLE" } } Signed-off-by: Julien Fortin --- ip/iplink_vrf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ip/iplink_vrf.c b/ip/iplink_vrf.c index 917630e8..f13b1d24 100644 --- a/ip/iplink_vrf.c +++ b/ip/iplink_vrf.c @@ -62,7 +62,10 @@ static void vrf_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) return; if (tb[IFLA_VRF_TABLE]) - fprintf(f, "table %u ", rta_getattr_u32(tb[IFLA_VRF_TABLE])); + print_uint(PRINT_ANY, + "table", + "table %u ", + rta_getattr_u32(tb[IFLA_VRF_TABLE])); } static void vrf_slave_print_opt(struct link_util *lu, FILE *f, @@ -72,13 +75,15 @@ static void vrf_slave_print_opt(struct link_util *lu, FILE *f, return; if (tb[IFLA_VRF_PORT_TABLE]) { - fprintf(f, "table %u ", - rta_getattr_u32(tb[IFLA_VRF_PORT_TABLE])); + print_uint(PRINT_ANY, + "table", + "table %u ", + rta_getattr_u32(tb[IFLA_VRF_PORT_TABLE])); } } static void vrf_print_help(struct link_util *lu, int argc, char **argv, - FILE *f) + FILE *f) { vrf_explain(f); }