aboutgitcodebugslistschat
path: root/pif.h
diff options
context:
space:
mode:
Diffstat (limited to 'pif.h')
-rw-r--r--pif.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/pif.h b/pif.h
index a705f2c..ca85b34 100644
--- a/pif.h
+++ b/pif.h
@@ -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 */