peerstore: fixes in watch functionality
[oweals/gnunet.git] / src / peerstore / peerstore.h
index 33d31870c9db9449524d97b181adfe6a0ffc9e58..5adf9f363111b5f902e18884311a5b83e14834e3 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
 {
 
   /**
@@ -39,6 +42,11 @@ struct StoreRequestMessage
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * #GNUNET_YES if peer id value set, #GNUNET_NO otherwise
+   */
+  uint16_t peer_set;
+
   /**
    * Peer Identity
    */
@@ -51,37 +59,42 @@ struct StoreRequestMessage
   size_t sub_system_size;
 
   /**
-   * Size of value blob
+   * Size of the key string
    * Allocated at position 1 after this struct
    */
+  size_t key_size;
+
+  /**
+   * Size of value blob
+   * Allocated at position 2 after this struct
+   */
   size_t value_size;
 
   /**
-   * Lifetime of entry
+   * Expiry time of entry
    */
-  struct GNUNET_TIME_Relative lifetime;
+  struct GNUNET_TIME_Absolute expiry;
 
 };
 
 /**
- * Message carrying a PEERSTORE store response
+ * Message carrying record key hash
  */
-struct StoreResponseMessage
+struct StoreKeyHashMessage
 {
+
   /**
    * GNUnet message header
    */
   struct GNUNET_MessageHeader header;
 
   /**
-   * Was the store operation successful (#GNUNET_YES / #GNUNET_NO)
+   * Hash of a record key
    */
-  uint16_t success GNUNET_PACKED;
+  struct GNUNET_HashCode keyhash;
 
-  /**
-   * Size of the error message (0 if no error)
-   */
-  size_t emsg_size GNUNET_PACKED;
 };
 
 GNUNET_NETWORK_STRUCT_END
+
+#endif