aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_addresses.h
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-07-05 12:12:28 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-07-05 12:12:28 +0000
commit5df01bf127e8f641c3ae75445c4822ad4ca09774 (patch)
tree7e817f41c447ea1ae37167a12038d352bf861c22 /src/ats/gnunet-service-ats_addresses.h
parent90761a0a5a0826133a2dd2469ed65cf86928309d (diff)
downloadgnunet-5df01bf127e8f641c3ae75445c4822ad4ca09774.tar.gz
gnunet-5df01bf127e8f641c3ae75445c4822ad4ca09774.zip
documentation for new solver api in header
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses.h')
-rw-r--r--src/ats/gnunet-service-ats_addresses.h79
1 files changed, 75 insertions, 4 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h
index f5e42193b..fa9a2663f 100644
--- a/src/ats/gnunet-service-ats_addresses.h
+++ b/src/ats/gnunet-service-ats_addresses.h
@@ -231,7 +231,6 @@
231 */ 231 */
232#define ATS_BLOCKING_DELTA GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 100) 232#define ATS_BLOCKING_DELTA GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 100)
233 233
234struct GAS_Addresses_Handle;
235 234
236/** 235/**
237 * Information provided by ATS normalization 236 * Information provided by ATS normalization
@@ -259,6 +258,7 @@ struct GAS_NormalizationInfo
259 double norm; 258 double norm;
260}; 259};
261 260
261
262/** 262/**
263 * Address with additional information 263 * Address with additional information
264 */ 264 */
@@ -357,14 +357,32 @@ struct ATS_Address
357 * 357 *
358 * @param address the with changed bandwidth assigned 358 * @param address the with changed bandwidth assigned
359 */ 359 */
360
361typedef void 360typedef void
362 (*GAS_bandwidth_changed_cb) (void *cls, struct ATS_Address *address); 361 (*GAS_bandwidth_changed_cb) (void *cls, struct ATS_Address *address);
363 362
363
364/**
365 * Callback to call from solver to obtain application preference values for a
366 * peer
367 *
368 * @param cls the cls
369 * @param id the peer id
370 * @return carry of double values containing the preferences with
371 * GNUNET_ATS_PreferenceCount elements
372 */
364typedef const double * 373typedef const double *
365 (*GAS_get_preferences) (void *cls, const struct GNUNET_PeerIdentity *id); 374 (*GAS_get_preferences) (void *cls, const struct GNUNET_PeerIdentity *id);
366 375
367 376
377/**
378 * Callback to call from solver to obtain transport properties for an
379 * address
380 *
381 * @param cls the cls
382 * @param address the address
383 * @return carry of double values containing the preferences with
384 * GNUNET_ATS_PreferenceCount elements
385 */
368typedef const double * 386typedef const double *
369 (*GAS_get_properties) (void *cls, const struct ATS_Address *address); 387 (*GAS_get_properties) (void *cls, const struct ATS_Address *address);
370 388
@@ -376,8 +394,7 @@ typedef const double *
376 */ 394 */
377 395
378/** 396/**
379 * Init the simplistic problem solving component 397 * Init the problem solving component
380 *==32673== by 0x40571F: GAS_addresses_request_address (gnunet-service-ats_addresses.c:1261)
381 * 398 *
382 * Quotas: 399 * Quotas:
383 * network[i] contains the network type as type GNUNET_ATS_NetworkType[i] 400 * network[i] contains the network type as type GNUNET_ATS_NetworkType[i]
@@ -431,12 +448,26 @@ typedef void
431 enum GNUNET_ATS_PreferenceKind kind, 448 enum GNUNET_ATS_PreferenceKind kind,
432 double pref_rel); 449 double pref_rel);
433 450
451/**
452 * Notify the solver about a bulk operation changing possibly a lot of values
453 * Solver will not resolve until all bulk operations are marked as done
454 *
455 * @param solver the solver
456 */
434typedef void 457typedef void
435(*GAS_solver_bulk_start) (void *solver); 458(*GAS_solver_bulk_start) (void *solver);
436 459
460
461/**
462 * Mark a bulk operation as done
463 * Solver will resolve if values have changed
464 *
465 * @param solver the solver
466 */
437typedef void 467typedef void
438(*GAS_solver_bulk_stop) (void *solver); 468(*GAS_solver_bulk_stop) (void *solver);
439 469
470
440/** 471/**
441 * Add a single address within a network to the solver 472 * Add a single address within a network to the solver
442 * 473 *
@@ -465,6 +496,15 @@ typedef void
465 int session_only); 496 int session_only);
466 497
467 498
499/**
500 * Transport properties for this address have changed
501 *
502 * @param solver solver handle
503 * @param address the address
504 * @param type the ATSI type in HBO
505 * @param abs_value the absolute value of the property
506 * @param rel_value the normalized value
507 */
468typedef void 508typedef void
469(*GAS_solver_address_property_changed) (void *solver, 509(*GAS_solver_address_property_changed) (void *solver,
470 struct ATS_Address *address, 510 struct ATS_Address *address,
@@ -472,18 +512,49 @@ typedef void
472 uint32_t abs_value, 512 uint32_t abs_value,
473 double rel_value); 513 double rel_value);
474 514
515
516/**
517 * Transport session for this address has changed
518 *
519 * NOTE: values in addresses are already updated
520 *
521 * @param solver solver handle
522 * @param address the address
523 * @param cur_session the current session
524 * @param new_session the new session
525 */
475typedef void 526typedef void
476(*GAS_solver_address_session_changed) (void *solver, 527(*GAS_solver_address_session_changed) (void *solver,
477 struct ATS_Address *address, 528 struct ATS_Address *address,
478 uint32_t cur_session, 529 uint32_t cur_session,
479 uint32_t new_session); 530 uint32_t new_session);
480 531
532/**
533 * Transport session for this address has changed
534 *
535 * NOTE: values in addresses are already updated
536 *
537 * @param solver solver handle
538 * @param address the address
539 * @param cur_session the current session
540 * @param new_session the new session
541 */
481typedef void 542typedef void
482(*GAS_solver_address_inuse_changed) (void *solver, 543(*GAS_solver_address_inuse_changed) (void *solver,
483 struct ATS_Address *address, 544 struct ATS_Address *address,
484 uint32_t session, 545 uint32_t session,
485 int in_use); 546 int in_use);
486 547
548/**
549 * Network scope for this address has changed
550 *
551 * NOTE: values in addresses are already updated
552 *
553 * @param solver solver handle
554 * @param address the address
555 * @param current_network the current network
556 * @param new_network the new network
557 */
487typedef void 558typedef void
488(*GAS_solver_address_network_changed) (void *solver, 559(*GAS_solver_address_network_changed) (void *solver,
489 struct ATS_Address *address, 560 struct ATS_Address *address,