tolerate additional IPv4 address now available for gnunet.org
[oweals/gnunet.git] / src / fs / gnunet-service-fs.h
index d198d864dec04234a6e6999229460c241a3272b7..661126f08851164814769998096ccf011b9f5023 100644 (file)
@@ -1,21 +1,21 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2010 GNUnet e.V.
 
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 3, or (at your
-     option) any later version.
+     GNUnet is free software: you can redistribute it and/or modify it
+     under the terms of the GNU Affero General Public License as published
+     by the Free Software Foundation, either version 3 of the License,
+     or (at your option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     General Public License for more details.
+     Affero General Public License for more details.
+    
+     You should have received a copy of the GNU Affero General Public License
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     SPDX-License-Identifier: AGPL3.0-or-later
 */
 
 /**
@@ -31,6 +31,7 @@
 #include "gnunet_transport_service.h"
 #include "gnunet_core_service.h"
 #include "gnunet_block_lib.h"
+#include "gnunet_ats_service.h"
 #include "fs.h"
 
 
  */
 #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
@@ -88,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;
 
@@ -119,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 struct 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.
    */
@@ -131,7 +126,7 @@ struct GetMessage
    */
   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 */
 };
@@ -223,6 +218,16 @@ 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;
+
+/**
+ * Identity of this peer.
+ */
+extern struct GNUNET_PeerIdentity GSF_my_id;
+
 /**
  * Typical priorities we're seeing from other peers right now.  Since
  * most priorities will be zero, this value is the weighted average of
@@ -257,14 +262,36 @@ 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;
+
+
+/**
+ * Function to be called after we're done processing
+ * replies from the local lookup.  If the result status
+ * code indicates that there may be more replies, plan
+ * forwarding the request.
+ *
+ * @param cls closure (NULL)
+ * @param pr the pending request we were processing
+ * @param result final datastore lookup result
+ */
+void
+GSF_consider_forwarding (void *cls,
+                        struct GSF_PendingRequest *pr,
+                        enum GNUNET_BLOCK_EvaluationResult result);
+
+
 /**
  * Test if the DATABASE (GET) load on this peer is too high
  * to even consider processing the query at
  * all.
  *
- * @return GNUNET_YES if the load is too high to do anything (load high)
- *         GNUNET_NO to process normally (load normal)
- *         GNUNET_SYSERR to process for free (load low)
+ * @return #GNUNET_YES if the load is too high to do anything (load high)
+ *         #GNUNET_NO to process normally (load normal)
+ *         #GNUNET_SYSERR to process for free (load low)
  */
 int
 GSF_test_get_load_too_high_ (uint32_t priority);
@@ -280,6 +307,5 @@ void
 GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start);
 
 
-
 #endif
 /* end of gnunet-service-fs.h */