/* ************************* endianess conversion ****************** */
+#ifdef htonbe64
+
+#define GNUNET_htonll(n) htobe64 (n)
+
+#else
/**
* Convert unsigned 64-bit integer to network byte order.
*
uint64_t
GNUNET_htonll (uint64_t n);
+#endif
+
+#ifdef be64toh
+
+#define GNUNET_ntohll(n) be64toh (n)
+
+#else
/**
* Convert unsigned 64-bit integer to host byte order.
*
uint64_t
GNUNET_ntohll (uint64_t n);
+#endif
+
/**
* Convert double to network byte order.
{
GNUNET_log (
GNUNET_ERROR_TYPE_WARNING,
- "Dropping message: transprot is too slow, queue length %llu exceeded\n",
+ "Dropping message: transport is too slow, queue length %llu exceeded\n",
ch->max_queue_length);
return GNUNET_NO;
}
im->expected_address_validity =
GNUNET_TIME_relative_hton (expected_addr_validity);
im->sender = *sender;
+ // FIXME: this is expensive, would be better if we would
+ // re-design the API to allow us to create the envelope first,
+ // and then have the application fill in the body so we do
+ // not have to memcpy()
memcpy (&im[1], msg, msize);
if (NULL != cb)
{
#define LOG(kind, ...) GNUNET_log_from (kind, "util-common-endian", __VA_ARGS__)
+#ifndef htonbe64
uint64_t
GNUNET_htonll (uint64_t n)
{
}
+#endif
+
+
+#ifndef be64toh
uint64_t
GNUNET_ntohll (uint64_t n)
{
}
+#endif
+
+
/**
* Convert double to network-byte-order.
* @param d the value in network byte order