1
2#ifndef __COLOR_H__
3#define __COLOR_H__ 1
4
5#include <stdbool.h>
6
7enum color_attr {
8 COLOR_IFNAME,
9 COLOR_MAC,
10 COLOR_INET,
11 COLOR_INET6,
12 COLOR_OPERSTATE_UP,
13 COLOR_OPERSTATE_DOWN,
14 COLOR_NONE
15};
16
17enum color_opt {
18 COLOR_OPT_NEVER = 0,
19 COLOR_OPT_AUTO = 1,
20 COLOR_OPT_ALWAYS = 2
21};
22
23bool check_enable_color(int color, int json);
24bool matches_color(const char *arg, int *val);
25int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...);
26enum color_attr ifa_family_color(__u8 ifa_family);
27enum color_attr oper_state_color(__u8 state);
28
29#endif
30