gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 02/20: -also add serialization from/to block


From: gnunet
Subject: [gnunet] 02/20: -also add serialization from/to block
Date: Sat, 19 Feb 2022 16:20:42 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit cd84bf32e23b4396583a8fa1bfe4a00c1fba3715
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Jan 12 12:57:13 2022 +0100

    -also add serialization from/to block
---
 src/include/gnunet_hello_uri_lib.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/include/gnunet_hello_uri_lib.h 
b/src/include/gnunet_hello_uri_lib.h
index 0f61384d1..00b84e0e4 100644
--- a/src/include/gnunet_hello_uri_lib.h
+++ b/src/include/gnunet_hello_uri_lib.h
@@ -77,6 +77,18 @@ struct GNUNET_HELLO_Builder *
 GNUNET_HELLO_builder_from_msg (const struct GNUNET_MessageHeader *msg);
 
 
+/**
+ * Parse @a block into builder.
+ *
+ * @param block DHT block to parse
+ * @param block_size number of bytes in @a block
+ * @return builder, NULL on failure
+ */
+struct GNUNET_HELLO_Builder *
+GNUNET_HELLO_builder_from_block (const void *block,
+                                 size_t block_size);
+
+
 /**
  * Parse GNUnet HELLO @a url into builder.
  *
@@ -107,6 +119,21 @@ char *
 GNUNET_HELLO_builder_to_url (struct GNUNET_HELLO_Builder *builder);
 
 
+/**
+ * Generate DHT block from a @a builder
+ *
+ * @param builder the builder to serialize
+ * @param[out] block where to write the block, NULL to only calculate @a 
block_size
+ * @param[in,out] block_size input is number of bytes available in @a block,
+ *                           output is number of bytes needed in @a block
+ * @return #GNUNET_OK on success, #GNUNET_NO if @a block_size was too small
+ */
+enum GNUNET_GenericReturnValue
+GNUNET_HELLO_builder_to_block (struct GNUNET_HELLO_Builder *builder,
+                               void *block,
+                               size_t *block_size);
+
+
 /**
  * Add individual @a address to the @a builder
  *

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]