diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-10-30 14:14:40 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-10-30 14:14:40 +0000 |
commit | 36c0c77784da93f5bb5b5787cdbfcc71506fb39e (patch) | |
tree | 5fec44a1219a3c9be8b3c58ddd5b541fc3bebad3 /src/include/gnunet_ats_plugin.h | |
parent | 2d9a0e6fda15a70eb87ca3a1e5b8088f440b8adb (diff) | |
download | gnunet-36c0c77784da93f5bb5b5787cdbfcc71506fb39e.tar.gz gnunet-36c0c77784da93f5bb5b5787cdbfcc71506fb39e.zip |
implemented solver information callbacks for benchmarking
Diffstat (limited to 'src/include/gnunet_ats_plugin.h')
-rw-r--r-- | src/include/gnunet_ats_plugin.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/include/gnunet_ats_plugin.h b/src/include/gnunet_ats_plugin.h index 29e169285..4e4a7e2b3 100644 --- a/src/include/gnunet_ats_plugin.h +++ b/src/include/gnunet_ats_plugin.h | |||
@@ -296,6 +296,47 @@ struct GNUNET_ATS_SolverFunctions | |||
296 | 296 | ||
297 | 297 | ||
298 | /** | 298 | /** |
299 | * Operation codes for solver information callback | ||
300 | */ | ||
301 | enum GAS_Solver_Operation | ||
302 | { | ||
303 | GAS_OP_SOLVE_START, | ||
304 | GAS_OP_SOLVE_STOP, | ||
305 | GAS_OP_SOLVE_SETUP_START, | ||
306 | GAS_OP_SOLVE_SETUP_STOP, | ||
307 | GAS_OP_SOLVE_LP_START, | ||
308 | GAS_OP_SOLVE_LP_STOP, | ||
309 | GAS_OP_SOLVE_MLP_START, | ||
310 | GAS_OP_SOLVE_MLP_STOP | ||
311 | }; | ||
312 | |||
313 | |||
314 | /** | ||
315 | * Status of the operation | ||
316 | */ | ||
317 | enum GAS_Solver_Status | ||
318 | { | ||
319 | GAS_STAT_SUCCESS, | ||
320 | GAS_STAT_FAIL | ||
321 | }; | ||
322 | |||
323 | /** | ||
324 | * Callback to call with additional information | ||
325 | * Used for measurement | ||
326 | * | ||
327 | * @param cls the closure | ||
328 | * @param op the operation | ||
329 | * @param peer the peer id | ||
330 | * @param kind the preference kind to change | ||
331 | * @param score the new preference score | ||
332 | * @param pref_rel the normalized preference value for this kind over all clients | ||
333 | */ | ||
334 | typedef void | ||
335 | (*GAS_solver_information_callback) (void *cls, | ||
336 | enum GAS_Solver_Operation op, enum GAS_Solver_Status stat); | ||
337 | |||
338 | |||
339 | /** | ||
299 | * Callback to call from solver when bandwidth for address has changed | 340 | * Callback to call from solver when bandwidth for address has changed |
300 | * | 341 | * |
301 | * @param address the with changed bandwidth assigned | 342 | * @param address the with changed bandwidth assigned |
@@ -390,6 +431,18 @@ struct GNUNET_ATS_PluginEnvironment | |||
390 | 431 | ||
391 | 432 | ||
392 | /** | 433 | /** |
434 | * Callback for solver to call with status information, | ||
435 | * can be NULL | ||
436 | */ | ||
437 | GAS_solver_information_callback info_cb; | ||
438 | |||
439 | /** | ||
440 | * Closure for information callback, | ||
441 | * can be NULL | ||
442 | */ | ||
443 | void *info_cb_cls; | ||
444 | |||
445 | /** | ||
393 | * The ATS solver plugin functions to call | 446 | * The ATS solver plugin functions to call |
394 | */ | 447 | */ |
395 | struct GNUNET_ATS_SolverFunctions sf; | 448 | struct GNUNET_ATS_SolverFunctions sf; |