aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/block_gns.h11
-rw-r--r--src/include/gnunet_namestore_service.h35
2 files changed, 40 insertions, 6 deletions
diff --git a/src/include/block_gns.h b/src/include/block_gns.h
index 4514acf6b..04dcac3bc 100644
--- a/src/include/block_gns.h
+++ b/src/include/block_gns.h
@@ -65,6 +65,11 @@ struct GNSNameRecordBlock
65{ 65{
66 66
67 /** 67 /**
68 * The public key of the authority
69 */
70 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key;
71
72 /**
68 * GNUNET_RSA_Signature using RSA-key generated from the records. 73 * GNUNET_RSA_Signature using RSA-key generated from the records.
69 */ 74 */
70 struct GNUNET_CRYPTO_RsaSignature signature; 75 struct GNUNET_CRYPTO_RsaSignature signature;
@@ -74,11 +79,6 @@ struct GNSNameRecordBlock
74 */ 79 */
75 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose; 80 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose;
76 81
77 /**
78 * The public key of the authority
79 */
80 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key;
81
82 /* number of records that follow */ 82 /* number of records that follow */
83 uint32_t rd_count GNUNET_PACKED; 83 uint32_t rd_count GNUNET_PACKED;
84 84
@@ -86,7 +86,6 @@ struct GNSNameRecordBlock
86 86
87 /* variable-size GNSRecordBlocks follows here */ 87 /* variable-size GNSRecordBlocks follows here */
88 88
89
90}; 89};
91 90
92GNUNET_NETWORK_STRUCT_END 91GNUNET_NETWORK_STRUCT_END
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h
index 130264418..5616225df 100644
--- a/src/include/gnunet_namestore_service.h
+++ b/src/include/gnunet_namestore_service.h
@@ -357,6 +357,41 @@ void
357GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe); 357GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe);
358 358
359 359
360
361/* convenience APIs for serializing / deserializing GNS records */
362
363/**
364 * Calculate how many bytes we will need to serialize the given
365 * records.
366 */
367size_t
368GNUNET_NAMESTORE_records_get_size (unsigned int rd_count,
369 const struct GNUNET_NAMESTORE_RecordData *rd);
370
371/**
372 * Serialize the given records to the given destination buffer.
373 */
374ssize_t
375GNUNET_NAMESTORE_records_serialize (unsigned int rd_count,
376 const struct GNUNET_NAMESTORE_RecordData *rd,
377 size_t dest_size,
378 char *dest);
379
380
381/**
382 * @param rd_count expected number of records in 'src'
383 * @param dest array of 'rd_count' entries for storing record data;
384 * 'data' values in 'dest' will point into 'src' and will thus
385 * become invalid if 'src' is modified
386 * @return GNUNET_OK on success, GNUNET_SYSERR on error
387 */
388int
389GNUNET_NAMESTORE_records_deserialize (size_t len,
390 const char *src,
391 unsigned int rd_count,
392 struct GNUNET_NAMESTORE_RecordData *dest);
393
394
360#if 0 /* keep Emacsens' auto-indent happy */ 395#if 0 /* keep Emacsens' auto-indent happy */
361{ 396{
362#endif 397#endif