format-util: introduce format_ifname_full()

This commit is contained in:
Yu Watanabe
2019-10-24 14:20:48 +09:00
parent 99b8517ca7
commit 882e21c72f
2 changed files with 24 additions and 3 deletions
+9 -1
View File
@@ -68,7 +68,15 @@
# error Unknown ino_t size
#endif
char *format_ifname(int ifindex, char buf[static IF_NAMESIZE + 1]);
typedef enum {
FORMAT_IFNAME_IFINDEX = 1 << 0,
FORMAT_IFNAME_IFINDEX_WITH_PERCENT = (1 << 1) | FORMAT_IFNAME_IFINDEX,
} FormatIfnameFlag;
char *format_ifname_full(int ifindex, char buf[static IF_NAMESIZE + 1], FormatIfnameFlag flag);
static inline char *format_ifname(int ifindex, char buf[static IF_NAMESIZE + 1]) {
return format_ifname_full(ifindex, buf, 0);
}
typedef enum {
FORMAT_BYTES_USE_IEC = 1 << 0,