mirror_iproute2/rdma
Ido Kalir b0a688a542 rdma: Rewrite custom JSON and prints logic to use common API
Instead of doing open-coded solution to generate JSON and prints, let's
reuse existing infrastructure and APIs to do the same as ip/*.

Before this change:
 if (rd->json_output)
     jsonw_uint_field(rd->jw, "sm_lid", sm_lid);
 else
     pr_out("sm_lid %u ", sm_lid);

After this change:
 print_uint(PRINT_ANY, "sm_lid", "sm_lid %u ", sm_lid);

All the print functions are converted to support color but for now the
type of color is COLOR_NONE. This is done as a preparation to addition
of color enable option. Such change will require rewrite of command line
arguments parser which is out-of-scope for this patch.

Signed-off-by: Ido Kalir <idok@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
2019-11-20 02:27:36 +00:00
..
include/uapi/rdma uapi: rdma netlink.h update 2019-07-16 11:58:44 -07:00
.gitignore rdma: Add basic infrastructure for RDMA tool 2017-08-21 17:07:44 -07:00
dev.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
link.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
Makefile rdma: Add "stat show mr" support 2019-10-27 10:28:30 -07:00
rdma.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
rdma.h rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
res-cmid.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
res-cq.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
res-mr.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
res-pd.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
res-qp.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
res.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
res.h rdma: add helper rd_sendrecv_msg() 2019-04-03 12:04:25 -07:00
stat-mr.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
stat.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
stat.h rdma: Add "stat show mr" support 2019-10-27 10:28:30 -07:00
sys.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00
utils.c rdma: Rewrite custom JSON and prints logic to use common API 2019-11-20 02:27:36 +00:00