From patchwork Thu Aug 17 17:36:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Fortin X-Patchwork-Id: 802803 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="K1xhD54r"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xYD6V6MfKz9t4X for ; Fri, 18 Aug 2017 03:41:38 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753586AbdHQRlf (ORCPT ); Thu, 17 Aug 2017 13:41:35 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:34030 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753577AbdHQRlb (ORCPT ); Thu, 17 Aug 2017 13:41:31 -0400 Received: by mail-wr0-f181.google.com with SMTP id y96so47241782wrc.1 for ; Thu, 17 Aug 2017 10:41:31 -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=xWn9/vo8T7PIzl4b5soxpi7Wh4/EBTRfGNqROPWQ3tI=; b=K1xhD54rQmhCPb+73lTqdLsS7NoZTRTjO+t3eJ5R31bRbD/D5v8Hn9crMESBXoYQmU mQqAJeWSVJVNKfR71Q4H/Etz7khx7CbjAqpi0QN9pKCZjzDxY03Z2X22+m9eZf+iV2jX GCqiMlUWiMqJwdu5ewd0tiSjM/7gev2oiD97c= 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=xWn9/vo8T7PIzl4b5soxpi7Wh4/EBTRfGNqROPWQ3tI=; b=TIVTrnuv+IyvybTFppWcoAazQlS3oDQobcIP5gCJCgXpAiTxLd7OwfmgZUXA919Odh yb08kuUXRNPZ6chw4ysrk4bdZuuIUtTakYSehR+fX0JiefbLOxFHLVDx2rfMIGQW17A2 5A9Xas19kinwxTc8RRt53vYEJgzg4LkvB7dpChKmn9uDF3Ik4BfELdDPBp/hEa7DEfTR /Da09v1IsVh6uWBaCcIaI7ivOUtWIhrIkmjZ+vY/OvlVBBzgzUG3N7q1N77zYa+Sfyku Cqui4Wx2j7umllwuyb5iAZ63w2kOJimiORTcshAZKLa5iPFHOBYnZVM9W4oDkJRVfigx GNJg== X-Gm-Message-State: AHYfb5hVDvAuuDAn/T9ho1quZMxB2wchGzoRcDGccsgX9FVRo0ARON+k EgGmU6roUhZguyAVjP2e8tIb X-Received: by 10.28.127.135 with SMTP id a129mr1926999wmd.91.1502991690478; Thu, 17 Aug 2017 10:41:30 -0700 (PDT) Received: from localhost.localdomain ([37.169.21.172]) by smtp.googlemail.com with ESMTPSA id k13sm3902040wrd.4.2017.08.17.10.41.27 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 17 Aug 2017 10:41:29 -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 iproute2 json v2 16/27] ip: iplink_vrf.c: add json output support Date: Thu, 17 Aug 2017 10:36:03 -0700 Message-Id: <20170817173614.54987-17-julien@cumulusnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170817173614.54987-1-julien@cumulusnetworks.com> References: <20170817173614.54987-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); }