-fix
[oweals/gnunet.git] / src / fs / gnunet-service-fs_pr.h
index f435cf8d677a9a6c2c59d02f04125e628fe8331c..10bc5c1f3d9eb26c8e8b8f8bf005902ed2c554fa 100644 (file)
@@ -84,12 +84,12 @@ struct GSF_PendingRequestData
   /**
    * Primary query hash for this request.
    */
-  GNUNET_HashCode query;
+  struct GNUNET_HashCode query;
 
   /**
    * Namespace to query, only set if the type is SBLOCK.
    */
-  GNUNET_HashCode namespace;
+  struct GNUNET_HashCode namespace;
 
   /**
    * Identity of a peer hosting the content, only set if
@@ -132,6 +132,22 @@ struct GSF_PendingRequestData
    */
   uint32_t original_priority;
 
+  /**
+   * Counter for how often this request has been transmitted (estimate,
+   * because we might have the same request pending for multiple clients,
+   * and of course because a transmission may have failed at a lower
+   * layer).
+   */
+  uint32_t num_transmissions;
+
+  /**
+   * How much respect did we (in total) offer for this request so far (estimate,
+   * because we might have the same request pending for multiple clients,
+   * and of course because a transmission may have failed at a lower
+   * layer).
+   */
+  uint32_t respect_offered;
+
   /**
    * Options for the request.
    */
@@ -174,6 +190,7 @@ struct GSF_PendingRequestData
  * @param pr handle to the original pending request
  * @param reply_anonymity_level anonymity level for the reply, UINT32_MAX for "unknown"
  * @param expiration when does 'data' expire?
+ * @param last_transmission the last time we've tried to get this block (FOREVER if unknown)
  * @param type type of the block
  * @param data response data, NULL on request expiration
  * @param data_len number of bytes in data
@@ -186,6 +203,8 @@ typedef void (*GSF_PendingRequestReplyHandler) (void *cls,
                                                 uint32_t reply_anonymity_level,
                                                 struct GNUNET_TIME_Absolute
                                                 expiration,
+                                                struct GNUNET_TIME_Absolute
+                                                last_transmission,
                                                 enum GNUNET_BLOCK_Type type,
                                                 const void *data,
                                                 size_t data_len);
@@ -217,15 +236,15 @@ typedef void (*GSF_PendingRequestReplyHandler) (void *cls,
 struct GSF_PendingRequest *
 GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
                              enum GNUNET_BLOCK_Type type,
-                             const GNUNET_HashCode * query,
-                             const GNUNET_HashCode * namespace,
+                             const struct GNUNET_HashCode * query,
+                             const struct GNUNET_HashCode * namespace,
                              const struct GNUNET_PeerIdentity *target,
                              const char *bf_data, size_t bf_size,
                              uint32_t mingle, uint32_t anonymity_level,
                              uint32_t priority, int32_t ttl,
                              GNUNET_PEER_Id sender_pid,
                              GNUNET_PEER_Id origin_pid,
-                             const GNUNET_HashCode * replies_seen,
+                             const struct GNUNET_HashCode * replies_seen,
                              unsigned int replies_seen_count,
                              GSF_PendingRequestReplyHandler rh, void *rh_cls);
 
@@ -240,7 +259,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
  */
 void
 GSF_pending_request_update_ (struct GSF_PendingRequest *pr,
-                             const GNUNET_HashCode * replies_seen,
+                             const struct GNUNET_HashCode * replies_seen,
                              unsigned int replies_seen_count);
 
 
@@ -302,7 +321,7 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup);
  * @return GNUNET_YES to continue to iterate
  */
 typedef int (*GSF_PendingRequestIterator) (void *cls,
-                                           const GNUNET_HashCode * key,
+                                           const struct GNUNET_HashCode * key,
                                            struct GSF_PendingRequest * pr);