From 9ae7f13f17e3d04d3ba88862299c8e42541eab47 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 18 Jun 2019 10:30:08 +0200 Subject: Introducing GNUNET_Uuid and matching hash map for 128 bit values. TNG: reducing size of AcknowledgementUUIDPs from 256 bits to 128 bits. --- src/include/gnunet_common.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/include/gnunet_common.h') diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 0fca53b7f..6b48c81d8 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -272,6 +272,18 @@ struct GNUNET_ShortHashCode }; +/** + * A UUID, a 128 bit random value. + */ +struct GNUNET_Uuid +{ + /** + * 128 random bits. + */ + uint32_t value[4]; +}; + + /** * Header for all communications. */ @@ -653,6 +665,19 @@ const char * GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc); +/** + * @ingroup logging + * Convert a UUID to a string (for printing debug messages). + * This is one of the very few calls in the entire API that is + * NOT reentrant! + * + * @param uuid the UUID + * @return string + */ +const char * +GNUNET_uuid2s (const struct GNUNET_Uuid *uuid); + + /** * @ingroup logging * Convert a hash value to a string (for printing debug messages). -- cgit v1.2.3