aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2006-05-29 07:03:34 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2006-05-29 07:03:34 +0000
commit3c3595adfd251cbef1aa7edb6984ed63cd32d205 (patch)
tree963f89ec795f1e17a00620ce3696c2ce9de95197
parentc2e7442fc16eec3d174a58a276d3af2feab06d0e (diff)
downloadstrongswan-3c3595adfd251cbef1aa7edb6984ed63cd32d205.tar.bz2
strongswan-3c3595adfd251cbef1aa7edb6984ed63cd32d205.tar.xz
added memeq() macro
-rw-r--r--src/libstrongswan/definitions.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libstrongswan/definitions.h b/src/libstrongswan/definitions.h
index f3e0cc690..4df651037 100644
--- a/src/libstrongswan/definitions.h
+++ b/src/libstrongswan/definitions.h
@@ -24,8 +24,6 @@
#ifndef DEFINITIONS_H_
#define DEFINITIONS_H_
-
-
/* stolen from strongswan */
#if linux
# if defined(i386) && !defined(__i386__)
@@ -65,11 +63,16 @@
#define BUF_LEN 512
/**
- * Macro compares to strings for equality
+ * Macro compares two strings for equality
*/
#define streq(x,y) (strcmp(x, y) == 0)
/**
+ * Macro compares two binary blobs for equality
+ */
+#define memeq(x,y,len) (memcmp(x, y, len) == 0)
+
+/**
* Macro gives back larger of two values.
*/
#define max(x,y) ((x) > (y) ? (x):(y))