guix-env: some update.
[oweals/gnunet.git] / src / ats / gnunet-service-ats_addresses.h
index 31d3ac8acced25ae3c8d07d8e0f551c2923d7093..61de1cd31f38a6fd1d0182e59722d094115dd0f8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  This file is part of GNUnet.
- (C) 2011-2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2011-2014 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
@@ -14,8 +14,8 @@
 
  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.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
  */
 
 /**
@@ -30,7 +30,6 @@
 #include "gnunet_util_lib.h"
 #include "gnunet_ats_service.h"
 #include "gnunet-service-ats.h"
-#include "gnunet_statistics_service.h"
 #include "ats.h"
 
 /**
@@ -237,12 +236,12 @@ struct GAS_NormalizationInfo
   /**
    * Averaging queue
    */
-  uint32_t atsi_abs[GAS_normalization_queue_length];
+  uint64_t atsi_abs[GAS_normalization_queue_length];
 
   /**
    * Averaged ATSI values from queue
    */
-  uint32_t avg;
+  uint64_t avg;
 
   /**
    * Normalized values from queue to a range of values [1.0...2.0]
@@ -272,14 +271,14 @@ struct ATS_Address
   char *plugin;
 
   /**
-   * Solver specific information for this address
+   * Solver-specific information for this address
    */
   void *solver_information;
 
   /**
    * ATS performance information for this address
    */
-  struct GNUNET_ATS_Information *atsi;
+  struct GNUNET_ATS_Properties properties;
 
   /**
    * Time when address had last activity (update, in uses)
@@ -302,9 +301,9 @@ struct ATS_Address
   uint32_t session_id;
 
   /**
-   * Field to store local flags
+   * Field to store local flags.
    */
-  uint32_t local_address_info;
+  enum GNUNET_HELLO_AddressInfo local_address_info;
 
   /**
    * ATS performance information for this address, size of the @e atsi array.
@@ -337,15 +336,25 @@ struct ATS_Address
   int active;
 
   /**
-   * Is this the address for this peer in use?
+   * Normalized delay information for this address.
    */
-  int used;
+  struct GAS_NormalizationInfo norm_delay;
 
   /**
-   * Normalized ATS performance information for this address
-   * Each entry can be accessed using the GNUNET_ATS_QualityProperties avg_queue_index
+   * Normalized distance information for this address.
    */
-  struct GAS_NormalizationInfo atsin[GNUNET_ATS_QualityPropertiesCount];
+  struct GAS_NormalizationInfo norm_distance;
+
+  /**
+   * Normalized utilization inbound for this address.
+   */
+  struct GAS_NormalizationInfo norm_utilization_in;
+
+    /**
+   * Normalized utilization outbound for this address.
+   */
+  struct GAS_NormalizationInfo norm_utilization_out;
+
 };
 
 
@@ -355,15 +364,12 @@ struct ATS_Address
 extern struct GNUNET_CONTAINER_MultiPeerMap *GSA_addresses;
 
 
-
 /**
  * Initialize address subsystem. The addresses subsystem manages the addresses
  * known and current performance information.
- *
- * @param server handle to our server
  */
 void
-GAS_addresses_init (struct GNUNET_SERVER_Handle *server);
+GAS_addresses_init (void);
 
 
 /**
@@ -379,11 +385,10 @@ GAS_addresses_done (void);
  * @param peer peer
  * @param plugin_name transport plugin name
  * @param plugin_addr plugin address
- * @param plugin_addr_len length of the plugin address
+ * @param plugin_addr_len length of the @a plugin_addr
  * @param local_address_info the local address for the address
  * @param session_id session id, can never be 0.
- * @param atsi performance information for this address
- * @param atsi_count number of performance information contained in @a atsi
+ * @param prop performance information for this address
  */
 void
 GAS_addresses_add (const struct GNUNET_PeerIdentity *peer,
@@ -392,8 +397,7 @@ GAS_addresses_add (const struct GNUNET_PeerIdentity *peer,
                    size_t plugin_addr_len,
                    uint32_t local_address_info,
                    uint32_t session_id,
-                   const struct GNUNET_ATS_Information *atsi,
-                   uint32_t atsi_count);
+                   const struct GNUNET_ATS_Properties *prop);
 
 
 /**
@@ -401,18 +405,16 @@ GAS_addresses_add (const struct GNUNET_PeerIdentity *peer,
  *
  * @param peer peer
  * @param session_id session id, can never be 0
- * @param atsi performance information for this address
- * @param atsi_count number of performance information contained in @a atsi
+ * @param prop performance information for this address
  */
 void
 GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
                       uint32_t session_id,
-                      const struct GNUNET_ATS_Information *atsi,
-                      uint32_t atsi_count);
+                      const struct GNUNET_ATS_Properties *prop);
 
 
 /**
- * Remove an address or just a session for a peer.
+ * Remove an address for a peer.
  *
  * @param peer peer
  * @param session_id session id, can never be 0
@@ -432,26 +434,26 @@ GAS_addresses_destroy_all (void);
 /**
  * Iterator for #GAS_addresses_get_peer_info()
  *
- * @param p_it_cls closure closure
+ * @param cls closure
  * @param id the peer id
  * @param plugin_name plugin name
  * @param plugin_addr address
  * @param plugin_addr_len length of @a plugin_addr
  * @param address_active is address actively used
  * @param atsi ats performance information
- * @param atsi_count number of ats performance elements in @a atsi
+ * @param local_address_info flags for the address
  * @param bandwidth_out current outbound bandwidth assigned to address
  * @param bandwidth_in current inbound bandwidth assigned to address
  */
 typedef void
-(*GNUNET_ATS_PeerInfo_Iterator) (void *p_it_cls,
+(*GNUNET_ATS_PeerInfo_Iterator) (void *cls,
                                  const struct GNUNET_PeerIdentity *id,
                                  const char *plugin_name,
                                  const void *plugin_addr,
                                  size_t plugin_addr_len,
                                  const int address_active,
-                                 const struct GNUNET_ATS_Information *atsi,
-                                 uint32_t atsi_count,
+                                 const struct GNUNET_ATS_Properties *prop,
+                                 enum GNUNET_HELLO_AddressInfo local_address_info,
                                  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
                                  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in);
 
@@ -472,14 +474,12 @@ GAS_addresses_get_peer_info (const struct GNUNET_PeerIdentity *peer,
 /**
  * Handle 'address list request' messages from clients.
  *
- * @param cls unused, NULL
  * @param client client that sent the request
- * @param message the request message
+ * @param alrm the request message
  */
 void
-GAS_handle_request_address_list (void *cls,
-                                 struct GNUNET_SERVER_Client *client,
-                                 const struct GNUNET_MessageHeader *message);
+GAS_handle_request_address_list (struct GNUNET_SERVICE_Client *client,
+                                 const struct AddressListRequestMessage *alrm);
 
 
 #endif