summaryrefslogtreecommitdiff
path: root/src/libstrongswan/enum.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/enum.h')
-rw-r--r--src/libstrongswan/enum.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libstrongswan/enum.h b/src/libstrongswan/enum.h
index 691f9f2bc..d5f169772 100644
--- a/src/libstrongswan/enum.h
+++ b/src/libstrongswan/enum.h
@@ -107,6 +107,24 @@ struct enum_name_t {
#define ENUM(name, first, last, ...) ENUM_BEGIN(name, first, last, __VA_ARGS__); ENUM_END(name, last)
/**
+ * Convert a enum value to its string representation.
+ *
+ * @param e enum names for this enum value
+ * @param val enum value to get string for
+ * @return string for enum, NULL if not found
+ */
+char *enum_to_name(enum_name_t *e, int val);
+
+/**
+ * Convert a enum string back to its enum value.
+ *
+ * @param e enum names for this enum value
+ * @param name name to get enum value for
+ * @return enum value, -1 if not found
+ */
+int enum_from_name(enum_name_t *e, char *name);
+
+/**
* printf hook function for enum_names_t.
*
* Arguments are: