From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [RFC iproute2-next 00/16] iproute printing enhancements Date: Thu, 1 Feb 2018 17:19:30 -0800 Message-ID: <20180202011946.21929-1-sthemmin@microsoft.com> Cc: netdev@vger.kernel.org, Stephen Hemminger To: dsahern@gmail.com Return-path: Received: from mail-pf0-f176.google.com ([209.85.192.176]:36731 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbeBBBUF (ORCPT ); Thu, 1 Feb 2018 20:20:05 -0500 Received: by mail-pf0-f176.google.com with SMTP id k5so415597pff.3 for ; Thu, 01 Feb 2018 17:20:05 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: The first group of patches refactor the printout to breakup excessively long print_route function and the last few implement JSON and color output format for routes. The one thing that maybe controversial is changing the default json output format to be compact. The value of JSON is for programattic output therefore pretty-printing should be an option. One change I didn't make (but considered) is not calling fflush after every single entry. When dumping millions of routes, letting stdio buffer output would be a performance win. Stephen Hemminger (16): iproute: refactor printing flags iproute: make printing icmpv6 a function iproute: make printing IPv4 cache flags a function iproute: refactor cacheinfo printing iproute: refactor metrics print iproute: refactor printing flow info iproute2: refactor newdst, gateway and via printing iproute: refactor multipath print iproute: refactor printing of interface iproute: whitespace fixes iproute: don't do assignment in condition iproute: make flush a separate function iproute: implement JSON and color output json: make pretty printing optional man: add documentation for json and pretty flags json: fix newline at end of array include/json_print.h | 2 + include/utils.h | 4 + ip/ip.c | 7 +- ip/iproute.c | 943 ++++++++++++++++++++++++++++++--------------------- lib/json_print.c | 5 +- lib/json_writer.c | 5 + man/man8/ip.8 | 18 +- man/man8/tc.8 | 3 +- tc/tc.c | 3 + 9 files changed, 598 insertions(+), 392 deletions(-) -- 2.15.1