aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/utils/utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/utils.h b/src/libstrongswan/utils/utils.h
index 081852cd9..0e103de9c 100644
--- a/src/libstrongswan/utils/utils.h
+++ b/src/libstrongswan/utils/utils.h
@@ -89,6 +89,14 @@ static inline bool strneq(const char *x, const char *y, size_t len)
}
/**
+ * Helper function that checks if a string starts with a given prefix
+ */
+static inline bool strpfx(const char *x, const char *prefix)
+{
+ return strneq(x, prefix, strlen(prefix));
+}
+
+/**
* Helper function that compares two strings for equality ignoring case
*/
static inline bool strcaseeq(const char *x, const char *y)