multicast, psyc, psycstore, client_manager fixes
[oweals/gnunet.git] / src / include / gnunet_ats_plugin.h
index 36a49d25251fff5082c357afd2e97f532014f807..71572d64e3abe28ce42bc770116a709790f4ba35 100644 (file)
@@ -1,6 +1,6 @@
 /*
  This file is part of GNUnet
- (C) 2009-2015 Christian Grothoff (and other contributing authors)
Copyright (C) 2009-2015 Christian Grothoff (and other contributing authors)
 
  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.
  */
 
 /**
 #include "gnunet_ats_service.h"
 #include "gnunet_statistics_service.h"
 
-struct ATS_Address;
-
-/*
- * Solver API
- * ----------
+/**
+ * Representation of an address the plugin can choose from.
  */
+struct ATS_Address;
 
 /**
  * Change the preference for a peer
@@ -114,12 +112,10 @@ typedef void
  *
  * @param solver the solver Handle
  * @param address the address to delete
- * @param session_only remove address or just session
  */
 typedef void
 (*GAS_solver_address_delete) (void *solver,
-                              struct ATS_Address *address,
-                              int session_only);
+                              struct ATS_Address *address);
 
 
 /**
@@ -127,16 +123,10 @@ typedef void
  *
  * @param solver solver handle
  * @param address the address
- * @param type the ATSI type in HBO
- * @param abs_value the absolute value of the property
- * @param rel_value the normalized value
  */
 typedef void
 (*GAS_solver_address_property_changed) (void *solver,
-                                        struct ATS_Address *address,
-                                        uint32_t type,
-                                        uint32_t abs_value,
-                                        double rel_value);
+                                        struct ATS_Address *address);
 
 
 /**
@@ -145,7 +135,7 @@ typedef void
  * @param solver the solver to use
  * @param peer the peer
  */
-typedef const struct ATS_Address *
+typedef void
 (*GAS_solver_get_preferred_address) (void *solver,
                                      const struct GNUNET_PeerIdentity *peer);
 
@@ -388,8 +378,8 @@ typedef void
 
 
 /**
- * Callback to call from solver to obtain application preference values for a
- * peer
+ * Callback to call from solver to obtain application preference
+ * values for a peer.
  *
  * @param cls the cls
  * @param id the peer id
@@ -402,17 +392,17 @@ typedef const double *
 
 
 /**
- * Callback to call from solver to obtain transport properties for an
- * address
+ * Callback to call from solver to obtain application connectivity
+ * preferences for a peer.
  *
  * @param cls the cls
- * @param address the address
- * @return carry of double values containing the preferences with
- *      GNUNET_ATS_PreferenceCount elements
+ * @param id the peer id
+ * @return 0 if connectivity is not desired, non-null if address
+ *      suggestions are requested
  */
-typedef const double *
-(*GAS_get_properties) (void *cls,
-                       const struct ATS_Address *address);
+typedef unsigned int
+(*GAS_get_connectivity) (void *cls,
+                         const struct GNUNET_PeerIdentity *id);
 
 
 /**
@@ -453,9 +443,9 @@ struct GNUNET_ATS_PluginEnvironment
   GAS_get_preferences get_preferences;
 
   /**
-   * ATS addresses function to obtain property values
+   * ATS addresses function to obtain preference values
    */
-  GAS_get_properties get_property;
+  GAS_get_connectivity get_connectivity;
 
   /**
    * Callback for solver to call with status information,
@@ -464,14 +454,10 @@ struct GNUNET_ATS_PluginEnvironment
   GAS_solver_information_callback info_cb;
 
   /**
-   *  Available networks
-   */
-  int networks[GNUNET_ATS_NetworkTypeCount];
-
-  /**
-   * Number of networks available
+   * Number of networks available, size of the @e out_quota
+   * and @e in_quota arrays.
    */
-  int network_count;
+  unsigned int network_count;
 
   /**
    * Array of configured outbound quotas