aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils.h
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-12-10 14:22:18 +0100
committerMartin Willi <martin@revosec.ch>2011-01-05 16:45:59 +0100
commit7a3e0a63211ede539e70a3cfec7d63f9fa869a74 (patch)
treed57e9b3e025e36adb7258d053b04515615cbd60e /src/libstrongswan/utils.h
parent04a1279f91a4e19051aee41742e88e988bf941c6 (diff)
downloadstrongswan-7a3e0a63211ede539e70a3cfec7d63f9fa869a74.tar.bz2
strongswan-7a3e0a63211ede539e70a3cfec7d63f9fa869a74.tar.xz
Added a strncaseeq variant to the string comparison macros
Diffstat (limited to 'src/libstrongswan/utils.h')
-rw-r--r--src/libstrongswan/utils.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstrongswan/utils.h b/src/libstrongswan/utils.h
index c41e1d6b3..8ab732205 100644
--- a/src/libstrongswan/utils.h
+++ b/src/libstrongswan/utils.h
@@ -57,7 +57,7 @@
#define streq(x,y) (strcmp(x, y) == 0)
/**
- * Macro compares two strings for equality
+ * Macro compares two strings for equality, length limited
*/
#define strneq(x,y,len) (strncmp(x, y, len) == 0)
@@ -67,6 +67,11 @@
#define strcaseeq(x,y) (strcasecmp(x, y) == 0)
/**
+ * Macro compares two strings for equality ignoring case, length limited
+ */
+#define strncaseeq(x,y,len) (strncasecmp(x, y, len) == 0)
+
+/**
* Macro compares two binary blobs for equality
*/
#define memeq(x,y,len) (memcmp(x, y, len) == 0)