]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/tc_util.c
tc: implement color output
[mirror_iproute2.git] / tc / tc_util.c
index aceb0d9449337a64b71596072b5df370f49ea97b..7f6a8e3109c41967c18311c2e62b2b5644b1fdb0 100644 (file)
@@ -444,6 +444,17 @@ int get_size_and_cell(unsigned int *size, int *cell_log, char *str)
        return 0;
 }
 
+void print_devname(enum output_type type, int ifindex)
+{
+       const char *ifname = ll_index_to_name(ifindex);
+
+       if (!is_json_context())
+               printf("dev ");
+
+       print_color_string(type, COLOR_IFNAME,
+                          "dev", "%s ", ifname);
+}
+
 void print_size(char *buf, int len, __u32 sz)
 {
        double tmp = sz;