diff options
Diffstat (limited to 'pif.h')
-rw-r--r-- | pif.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -22,6 +22,25 @@ enum pif_type { PIF_TAP, /* Namespace socket interface for splicing */ PIF_SPLICE, + + PIF_NUM_TYPES, }; +#define PIF_NAMELEN 8 + +extern const char *pif_type_str[]; + +static inline const char *pif_type(enum pif_type pt) +{ + if (pt < PIF_NUM_TYPES) + return pif_type_str[pt]; + else + return "?"; +} + +static inline const char *pif_name(uint8_t pif) +{ + return pif_type(pif); +} + #endif /* PIF_H */ |