@@ -203,7 +203,7 @@ static int dev_parse_cb(const struct nlmsghdr *nlh, void *data)
idx = mnl_attr_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]);
name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_DEV_NAME]);
print_color_uint(PRINT_ANY, COLOR_NONE, "ifindex", "%u: ", idx);
- print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "%s: ", name);
+ print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s: ", name);
dev_print_node_type(rd, tb);
dev_print_fw(rd, tb);
@@ -244,7 +244,7 @@ static int link_parse_cb(const struct nlmsghdr *nlh, void *data)
open_json_object(NULL);
print_color_uint(PRINT_JSON, COLOR_NONE, "ifindex", NULL, idx);
- print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "link %s/", name);
+ print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "link %s/", name);
print_color_uint(PRINT_ANY, COLOR_NONE, "port", "%u ", port);
link_print_subnet_prefix(rd, tb);
link_print_lid(rd, tb);
@@ -76,7 +76,7 @@ static int res_no_args_parse_cb(const struct nlmsghdr *nlh, void *data)
name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_DEV_NAME]);
open_json_object(NULL);
print_color_uint(PRINT_ANY, COLOR_NONE, "ifindex", "%u: ", idx);
- print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "%s: ", name);
+ print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "%s: ", name);
res_print_summary(rd, tb);
newline(rd);
return MNL_CB_OK;
@@ -167,7 +167,7 @@ void print_comm(struct rd *rd, const char *str, struct nlattr **nla_line)
void print_dev(struct rd *rd, uint32_t idx, const char *name)
{
print_color_int(PRINT_ANY, COLOR_NONE, "ifindex", NULL, idx);
- print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "dev %s ", name);
+ print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "dev %s ", name);
}
void print_link(struct rd *rd, uint32_t idx, const char *name, uint32_t port,
@@ -176,7 +176,7 @@ void print_link(struct rd *rd, uint32_t idx, const char *name, uint32_t port,
char tmp[64] = {};
print_color_uint(PRINT_JSON, COLOR_NONE, "ifindex", NULL, idx);
- print_color_string(PRINT_ANY, COLOR_NONE, "ifname", NULL, name);
+ print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", NULL, name);
if (nla_line[RDMA_NLDEV_ATTR_PORT_INDEX]) {
print_color_uint(PRINT_ANY, COLOR_NONE, "port", NULL, port);
snprintf(tmp, sizeof(tmp), "%s/%d", name, port);
@@ -711,7 +711,7 @@ static int stat_show_parse_cb(const struct nlmsghdr *nlh, void *data)
name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_DEV_NAME]);
port = mnl_attr_get_u32(tb[RDMA_NLDEV_ATTR_PORT_INDEX]);
open_json_object(NULL);
- print_color_string(PRINT_ANY, COLOR_NONE, "ifname", "link %s/", name);
+ print_color_string(PRINT_ANY, COLOR_IFNAME, "ifname", "link %s/", name);
print_color_uint(PRINT_ANY, COLOR_NONE, "port", "%u ", port);
ret = res_get_hwcounters(rd, tb[RDMA_NLDEV_ATTR_STAT_HWCOUNTERS], true);
Use the standard color outputs for interface names Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> --- rdma/dev.c | 2 +- rdma/link.c | 2 +- rdma/res.c | 6 +++--- rdma/stat.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)