-more debug messages
[oweals/gnunet.git] / src / namestore / namestore.h
index 5b4c02385b986ee552fd84ad8c9e6ac1f5de3842..5a42c14d70abec23f68ff76bc537aac37cf21cc1 100644 (file)
@@ -29,6 +29,7 @@
 /*
  * Collect message types here, move to protocols later
  */
+#define GNUNET_MESSAGE_TYPE_NAMESTORE_START 430
 #define GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME 431
 #define GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE 432
 #define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT 433
 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE 446
 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT 447
 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP 448
-#define GNUNET_MESSAGE_TYPE_NAMESTORE_DISCONNECT 449
+
 
 /**
- * Create a signature based on name and records
+ * Convert a short hash to a string (for printing debug messages).
+ * This is one of the very few calls in the entire API that is
+ * NOT reentrant!
+ *
+ * @param hc the short hash code
+ * @return string form; will be overwritten by next call to GNUNET_h2s.
+ */
+const char *
+GNUNET_short_h2s (const struct GNUNET_CRYPTO_ShortHashCode * hc);
+
+
+/**
+ * Sign name and records
  *
  * @param key the private key
+ * @param expire block expiration
  * @param name the name
  * @param rd record data
  * @param rd_count number of records
  */
 struct GNUNET_CRYPTO_RsaSignature *
 GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
-                                   const char *name,
-                                   const struct GNUNET_NAMESTORE_RecordData *rd,
-                                   unsigned int rd_count);
+    struct GNUNET_TIME_Absolute expire,
+    const char *name,
+    const struct GNUNET_NAMESTORE_RecordData *rd,
+    unsigned int rd_count);
+
 
 /**
  * Compares if two records are equal
@@ -148,7 +164,7 @@ struct LookupNameMessage
   /**
    * The zone 
    */
-  GNUNET_HashCode zone;
+  struct GNUNET_CRYPTO_ShortHashCode zone;
 
   /**
    * Requested record type 
@@ -277,7 +293,9 @@ struct RecordPutResponseMessage
   struct GNUNET_NAMESTORE_Header gns_header;
 
   /**
-   * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
+   * result:
+   * GNUNET_SYSERR on failure
+   * GNUNET_OK on success
    */
   int32_t op_result;
 };
@@ -286,7 +304,6 @@ struct RecordPutResponseMessage
 /**
  * Create a record and put it to the namestore
  * Memory layout:
- * [struct RecordCreateMessage][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
  */
 struct RecordCreateMessage
 {
@@ -416,12 +433,12 @@ struct ZoneToNameMessage
   /**
    * The hash of public key of the zone to look up in 
    */
-  GNUNET_HashCode zone;
+  struct GNUNET_CRYPTO_ShortHashCode zone;
 
   /**
    * The  hash of the public key of the target zone  
    */
-  GNUNET_HashCode value_zone;
+  struct GNUNET_CRYPTO_ShortHashCode value_zone;
 };
 
 /**
@@ -484,7 +501,7 @@ struct ZoneIterationStartMessage
   /**
    * Zone hash
    */
-  GNUNET_HashCode zone;
+  struct GNUNET_CRYPTO_ShortHashCode zone;
 
   /**
    * Which flags must be included