- update fs
[oweals/gnunet.git] / src / fs / gnunet-service-fs.h
index 5a275c5ff870a88fbd7924be3f0c16b6368f977b..c5fb47ef3099ced4918cb2fa1f25903545977a1f 100644 (file)
 #include "gnunet_transport_service.h"
 #include "gnunet_core_service.h"
 #include "gnunet_block_lib.h"
+#include "gnunet_ats_service.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_YES
-
-#define DEBUG_FS_CLIENT GNUNET_EXTRA_LOGGING
 
 /**
  * By which amount do we decrement the TTL for simple forwarding /
  */
 #define GET_MESSAGE_BIT_RETURN_TO 1
 
-/**
- * The hash of the public key of the target
- * namespace is included (for SKS queries).
- */
-#define GET_MESSAGE_BIT_SKS_NAMESPACE 2
-
 /**
  * The peer identity of a peer that had claimed to have the content
  * previously is included (can be used if responder-anonymity is not
@@ -82,6 +74,8 @@
 #define GET_MESSAGE_BIT_TRANSMIT_TO 4
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
 /**
  * Message sent between peers asking for FS-content.
  */
@@ -89,7 +83,7 @@ struct GetMessage
 {
 
   /**
-   * Message type will be GNUNET_MESSAGE_TYPE_FS_GET.
+   * Message type will be #GNUNET_MESSAGE_TYPE_FS_GET.
    */
   struct GNUNET_MessageHeader header;
 
@@ -120,7 +114,7 @@ struct GetMessage
   /**
    * Which of the optional hash codes are present at the end of the
    * message?  See GET_MESSAGE_BIT_xx constants.  For each bit that is
-   * set, an additional GNUNET_HashCode with the respective content
+   * set, an additional `struct GNUNET_HashCode` with the respective content
    * (in order of the bits) will be appended to the end of the GET
    * message.
    */
@@ -130,9 +124,9 @@ struct GetMessage
    * Hashcodes of the file(s) we're looking for.
    * Details depend on the query type.
    */
-  GNUNET_HashCode query GNUNET_PACKED;
+  struct GNUNET_HashCode query;
 
-  /* this is followed by hash codes as specified in the "hash_bitmap";
+  /* this is followed by PeerIdentities as specified in the "hash_bitmap";
    * after that, an optional bloomfilter (with bits set for replies
    * that should be suppressed) can be present */
 };
@@ -161,7 +155,7 @@ struct MigrationStopMessage
   struct GNUNET_TIME_RelativeNBO duration;
 
 };
-
+GNUNET_NETWORK_STRUCT_END
 
 /**
  * A connected peer.
@@ -184,10 +178,9 @@ struct GSF_LocalClient;
 struct GSF_RequestPlan;
 
 /**
- * DLL of request plans a particular pending request is
- * involved with.
+ * Bijection between request plans and pending requests.
  */
-struct GSF_RequestPlanReference;
+struct GSF_PendingRequestPlanBijection;
 
 /**
  * Our connection to the datastore.
@@ -225,6 +218,12 @@ extern struct GNUNET_LOAD_Value *GSF_rt_entry_lifetime;
  */
 extern struct GNUNET_TIME_Relative GSF_avg_latency;
 
+/**
+ * Handle to ATS service.
+ */
+extern struct GNUNET_ATS_PerformanceHandle *GSF_ats;
+
+
 /**
  * Typical priorities we're seeing from other peers right now.  Since
  * most priorities will be zero, this value is the weighted average of
@@ -259,6 +258,12 @@ extern struct GNUNET_BLOCK_Context *GSF_block_ctx;
  */
 extern int GSF_enable_randomized_delays;
 
+/**
+ * Size of the datastore queue we assume for common requests.
+ */
+extern unsigned int GSF_datastore_queue_size;
+
+
 /**
  * Test if the DATABASE (GET) load on this peer is too high
  * to even consider processing the query at