+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+#define STRCMP(a,b,c) (strcmp(a,c) b 0)
+#define ZERO_STRUCT(a) memset(&(a), 0, sizeof(a))
+#define ZERO_STRUCTP(a) memset((a), 0, sizeof(a))
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define hton64(x) (x)
+#define ntoh64(x) (x)
+#else /* BYTE_ORDER == BIG_ENDIAN */
+#define hton64(x) ((uint64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
+ (uint64_t) ((htonl(x) & 0xffffffffLL) << 32))
+#define ntoh64(x) (hton64(x))
+#endif /* BYTE_ORDER == BIG_ENDIAN */
+