- moved timeout handling responsibility from for nat tests from caller to the library
[oweals/gnunet.git] / src / peerstore / peerstore.h
index 29e2ed8665d60aec83e1c8351f166aca54655eac..5757f784ec084ba3722f9bb121fd3eef5ffcaede 100644 (file)
  * @author Omar Tarabai
  */
 
+#ifndef PEERSTORE_H_
+#define PEERSTORE_H_
+
 #include "gnunet_peerstore_service.h"
 
 
 GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
- * Message carrying a PEERSTORE store request
+ * Message carrying a PEERSTORE record message
  */
-struct StoreRequestMessage
+struct StoreRecordMessage
 {
 
   /**
@@ -40,16 +43,21 @@ struct StoreRequestMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * Size of the sub_system string
-   * Allocated at position 0 after this struct
+   * #GNUNET_YES if peer id value set, #GNUNET_NO otherwise
    */
-  size_t sub_system_size;
+  uint16_t peer_set;
 
   /**
    * Peer Identity
    */
   struct GNUNET_PeerIdentity peer;
 
+  /**
+   * Size of the sub_system string
+   * Allocated at position 0 after this struct
+   */
+  size_t sub_system_size;
+
   /**
    * Size of the key string
    * Allocated at position 1 after this struct
@@ -63,10 +71,36 @@ struct StoreRequestMessage
   size_t value_size;
 
   /**
-   * Lifetime of entry
+   * Expiry time of entry
+   */
+  struct GNUNET_TIME_Absolute expiry;
+
+  /**
+   * Options, needed only in case of a
+   * store operation
+   */
+  enum GNUNET_PEERSTORE_StoreOption options;
+
+};
+
+/**
+ * Message carrying record key hash
+ */
+struct StoreKeyHashMessage
+{
+
+  /**
+   * GNUnet message header
    */
-  struct GNUNET_TIME_Relative lifetime;
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Hash of a record key
+   */
+  struct GNUNET_HashCode keyhash;
 
 };
 
 GNUNET_NETWORK_STRUCT_END
+
+#endif