benchmark with updates
[oweals/gnunet.git] / src / include / gnunet_ats_plugin.h
index 29e169285fae8b1a15333bf0e730137516ff9cae..ed081f39a60b1c4b47cf3b2e36caea33eb6951f9 100644 (file)
@@ -295,6 +295,62 @@ struct GNUNET_ATS_SolverFunctions
 };
 
 
+/**
+ * Operation codes for solver information callback
+ */
+enum GAS_Solver_Operation
+{
+  GAS_OP_SOLVE_START,
+  GAS_OP_SOLVE_STOP,
+  GAS_OP_SOLVE_SETUP_START,
+  GAS_OP_SOLVE_SETUP_STOP,
+  GAS_OP_SOLVE_LP_START,
+  GAS_OP_SOLVE_LP_STOP,
+  GAS_OP_SOLVE_MLP_START,
+  GAS_OP_SOLVE_MLP_STOP
+};
+
+
+/**
+ * Status of the operation
+ */
+enum GAS_Solver_Status
+{
+  GAS_STAT_SUCCESS,
+  GAS_STAT_FAIL
+};
+
+/**
+ * Status of the operation
+ */
+enum GAS_Solver_Additional_Information
+{
+  GAS_INFO_NONE,
+  GAS_INFO_FULL,
+  GAS_INFO_UPDATED,
+  GAS_INFO_PROP_ALL,
+  GAS_INFO_PROP_SINGLE
+};
+
+
+/**
+ * Callback to call with additional information
+ * Used for measurement
+ *
+ * @param cls the closure
+ * @param op the operation
+ * @param peer the peer id
+ * @param kind the preference kind to change
+ * @param score the new preference score
+ * @param pref_rel the normalized preference value for this kind over all clients
+ */
+typedef void
+(*GAS_solver_information_callback) (void *cls,
+    enum GAS_Solver_Operation op,
+    enum GAS_Solver_Status stat,
+    enum GAS_Solver_Additional_Information);
+
+
 /**
  * Callback to call from solver when bandwidth for address has changed
  *
@@ -389,6 +445,18 @@ struct GNUNET_ATS_PluginEnvironment
   void *get_property_cls;
 
 
+  /**
+   * Callback for solver to call with status information,
+   * can be NULL
+   */
+  GAS_solver_information_callback info_cb;
+
+  /**
+   * Closure for information callback,
+   * can be NULL
+   */
+  void *info_cb_cls;
+
   /**
    * The ATS solver plugin functions to call
    */