* it as a value_number. If no configuration value is found it will assign
* GNUNET_ATS_DefaultBandwidth. The most important step is to load the
* configured solver using configuration "[ats]:MODE". Current solvers are
- * MODE_SIMPLISTIC, MODE_MLP. Interaction is done using a solver API
+ * MODE_PROPORTIONAL, MODE_MLP. Interaction is done using a solver API
*
* 1.4 Solver API
*
*/
#define ATS_BLOCKING_DELTA GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 100)
-struct GAS_Addresses_Handle;
/**
* Information provided by ATS normalization
double norm;
};
+
/**
* Address with additional information
*/
*
* @param address the with changed bandwidth assigned
*/
-
typedef void
(*GAS_bandwidth_changed_cb) (void *cls, struct ATS_Address *address);
+
+/**
+ * Callback to call from solver to obtain application preference values for a
+ * peer
+ *
+ * @param cls the cls
+ * @param id the peer id
+ * @return carry of double values containing the preferences with
+ * GNUNET_ATS_PreferenceCount elements
+ */
typedef const double *
(*GAS_get_preferences) (void *cls, const struct GNUNET_PeerIdentity *id);
+/**
+ * Callback to call from solver to obtain transport properties for an
+ * address
+ *
+ * @param cls the cls
+ * @param address the address
+ * @return carry of double values containing the preferences with
+ * GNUNET_ATS_PreferenceCount elements
+ */
typedef const double *
(*GAS_get_properties) (void *cls, const struct ATS_Address *address);
*/
/**
- * Init the simplistic problem solving component
- *==32673== by 0x40571F: GAS_addresses_request_address (gnunet-service-ats_addresses.c:1261)
+ * Init the problem solving component
*
* Quotas:
* network[i] contains the network type as type GNUNET_ATS_NetworkType[i]
enum GNUNET_ATS_PreferenceKind kind,
double pref_rel);
+
+/**
+ * Give feedback about the current assignment
+ *
+ * @param handle the solver handle
+ * @param application the application sending this request
+ * @param peer the peer id
+ * @param scope the time interval for this feedback: [now - scope .. now]
+ * @param kind the preference kind for this feedback
+ * @param score the feedback score
+ */
+typedef void
+(*GAS_solver_address_feedback_preference) (void *solver,
+ void *application,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_TIME_Relative scope,
+ enum GNUNET_ATS_PreferenceKind kind,
+ double score);
+
+/**
+ * Notify the solver about a bulk operation changing possibly a lot of values
+ * Solver will not resolve until all bulk operations are marked as done
+ *
+ * @param solver the solver
+ */
typedef void
(*GAS_solver_bulk_start) (void *solver);
+
+/**
+ * Mark a bulk operation as done
+ * Solver will resolve if values have changed
+ *
+ * @param solver the solver
+ */
typedef void
(*GAS_solver_bulk_stop) (void *solver);
+
/**
* Add a single address within a network to the solver
*
int session_only);
+/**
+ * Transport properties for this address have changed
+ *
+ * @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 abs_value,
double rel_value);
+
+/**
+ * Transport session for this address has changed
+ *
+ * NOTE: values in addresses are already updated
+ *
+ * @param solver solver handle
+ * @param address the address
+ * @param cur_session the current session
+ * @param new_session the new session
+ */
typedef void
(*GAS_solver_address_session_changed) (void *solver,
struct ATS_Address *address,
uint32_t cur_session,
uint32_t new_session);
+/**
+ * Transport session for this address has changed
+ *
+ * NOTE: values in addresses are already updated
+ *
+ * @param solver solver handle
+ * @param address the address
+ * @param in_use usage state
+ */
typedef void
(*GAS_solver_address_inuse_changed) (void *solver,
struct ATS_Address *address,
- uint32_t session,
int in_use);
+/**
+ * Network scope for this address has changed
+ *
+ * NOTE: values in addresses are already updated
+ *
+ * @param solver solver handle
+ * @param address the address
+ * @param current_network the current network
+ * @param new_network the new network
+ */
typedef void
(*GAS_solver_address_network_changed) (void *solver,
struct ATS_Address *address,
float score_abs);
+/**
+ * Change the preference for a peer
+ *
+ * @param handle the address handle
+ * @param application the client sending this request
+ * @param peer the peer id
+ * @param scope the time interval this valid for: [now - scope .. now]
+ * @param kind the preference kind to change
+ * @param score_abs the new preference score
+ */
+void
+GAS_addresses_preference_feedback (struct GAS_Addresses_Handle *handle,
+ void *application,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_TIME_Relative scope,
+ enum GNUNET_ATS_PreferenceKind kind,
+ float score_abs);
+
+
/**
* Iterator for GAS_addresses_iterate_peers
*