gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20158 - gnunet/src/include


From: gnunet
Subject: [GNUnet-SVN] r20158 - gnunet/src/include
Date: Thu, 1 Mar 2012 11:08:51 +0100

Author: grothoff
Date: 2012-03-01 11:08:51 +0100 (Thu, 01 Mar 2012)
New Revision: 20158

Modified:
   gnunet/src/include/block_gns.h
   gnunet/src/include/gnunet_namestore_service.h
Log:
-new api

Modified: gnunet/src/include/block_gns.h
===================================================================
--- gnunet/src/include/block_gns.h      2012-03-01 09:11:58 UTC (rev 20157)
+++ gnunet/src/include/block_gns.h      2012-03-01 10:08:51 UTC (rev 20158)
@@ -65,6 +65,11 @@
 {
 
   /**
+   * The public key of the authority
+   */
+  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key;
+
+  /**
    * GNUNET_RSA_Signature using RSA-key generated from the records.
    */
   struct GNUNET_CRYPTO_RsaSignature signature;
@@ -74,11 +79,6 @@
    */
   struct GNUNET_CRYPTO_RsaSignaturePurpose purpose;
 
-  /**
-   * The public key of the authority
-   */
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key;
-
   /* number of records that follow */
   uint32_t rd_count GNUNET_PACKED;
 
@@ -86,7 +86,6 @@
 
   /* variable-size GNSRecordBlocks follows here */
 
-
 };
 
 GNUNET_NETWORK_STRUCT_END

Modified: gnunet/src/include/gnunet_namestore_service.h
===================================================================
--- gnunet/src/include/gnunet_namestore_service.h       2012-03-01 09:11:58 UTC 
(rev 20157)
+++ gnunet/src/include/gnunet_namestore_service.h       2012-03-01 10:08:51 UTC 
(rev 20158)
@@ -357,6 +357,41 @@
 GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe);
 
 
+
+/* convenience APIs for serializing / deserializing GNS records */
+
+/**
+ * Calculate how many bytes we will need to serialize the given
+ * records.
+ */
+size_t
+GNUNET_NAMESTORE_records_get_size (unsigned int rd_count,
+                                  const struct GNUNET_NAMESTORE_RecordData 
*rd);
+
+/**
+ * Serialize the given records to the given destination buffer.
+ */
+ssize_t
+GNUNET_NAMESTORE_records_serialize (unsigned int rd_count,
+                                   const struct GNUNET_NAMESTORE_RecordData 
*rd,
+                                   size_t dest_size,
+                                   char *dest);
+
+
+/**
+ * @param rd_count expected number of records in 'src'
+ * @param dest array of 'rd_count' entries for storing record data;
+ *         'data' values in 'dest' will point into 'src' and will thus
+ *         become invalid if 'src' is modified
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ */
+int
+GNUNET_NAMESTORE_records_deserialize (size_t len,
+                                     const char *src,
+                                     unsigned int rd_count,
+                                     struct GNUNET_NAMESTORE_RecordData *dest);
+
+
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif




reply via email to

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