aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_ats_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-19 01:08:03 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-19 01:08:03 +0000
commitf735158d94616b75ade351a3cce226483b8af55e (patch)
tree1cd9732b99cc6437fec7751b8f3c9ef28f0371c9 /src/include/gnunet_ats_service.h
parentd769049a7db56037ea4aff3d9d8a8d42a373ec9c (diff)
downloadgnunet-f735158d94616b75ade351a3cce226483b8af55e.tar.gz
gnunet-f735158d94616b75ade351a3cce226483b8af55e.zip
-towards improved ATS API, adding return value with address record when adding address, adding new subsystem with peer-to-address map to transport; causes various new assertions to fail, but no major regression -- not finished
Diffstat (limited to 'src/include/gnunet_ats_service.h')
-rw-r--r--src/include/gnunet_ats_service.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h
index b0ffc1271..271d6009e 100644
--- a/src/include/gnunet_ats_service.h
+++ b/src/include/gnunet_ats_service.h
@@ -421,7 +421,7 @@ GNUNET_ATS_print_network_type (enum GNUNET_ATS_Network_Type net);
421 421
422 422
423/** 423/**
424 * Returns where the address is located: LAN or WAN or ... 424 * Returns where the address is located: loopback, LAN or WAN.
425 * 425 *
426 * @param sh the `struct GNUNET_ATS_SchedulingHandle` handle 426 * @param sh the `struct GNUNET_ATS_SchedulingHandle` handle
427 * @param addr address 427 * @param addr address
@@ -449,6 +449,12 @@ GNUNET_ATS_session_known (struct GNUNET_ATS_SchedulingHandle *sh,
449 449
450 450
451/** 451/**
452 * Handle used within ATS to track an address.
453 */
454struct GNUNET_ATS_AddressRecord;
455
456
457/**
452 * We have a new address ATS should know. Addresses have to be added with this 458 * We have a new address ATS should know. Addresses have to be added with this
453 * function before they can be: updated, set in use and destroyed 459 * function before they can be: updated, set in use and destroyed
454 * 460 *
@@ -457,8 +463,11 @@ GNUNET_ATS_session_known (struct GNUNET_ATS_SchedulingHandle *sh,
457 * @param session session handle (if available) 463 * @param session session handle (if available)
458 * @param ats performance data for the address 464 * @param ats performance data for the address
459 * @param ats_count number of performance records in @a ats 465 * @param ats_count number of performance records in @a ats
466 * @return handle to the address representation inside ATS, NULL
467 * on error (i.e. ATS knows this exact address already, or
468 * address is invalid)
460 */ 469 */
461int 470struct GNUNET_ATS_AddressRecord *
462GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, 471GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
463 const struct GNUNET_HELLO_Address *address, 472 const struct GNUNET_HELLO_Address *address,
464 struct Session *session, 473 struct Session *session,
@@ -470,20 +479,19 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
470 * We have updated performance statistics for a given address. Note 479 * We have updated performance statistics for a given address. Note
471 * that this function can be called for addresses that are currently 480 * that this function can be called for addresses that are currently
472 * in use as well as addresses that are valid but not actively in use. 481 * in use as well as addresses that are valid but not actively in use.
473 * Furthermore, the peer may not even be connected to us right now (in 482 * Furthermore, the peer may not even be connected to us right now (@a
474 * which case the call may be ignored or the information may be stored 483 * session value of NULL used to signal disconnect, or somehow we
475 * for later use). Update bandwidth assignments. 484 * otherwise got updated on @a ats information). Based on the
485 * information provided, ATS may update bandwidth assignments and
486 * suggest to switch addresses.
476 * 487 *
477 * @param sh handle 488 * @param ar address record to update information for
478 * @param address updated address
479 * @param session session handle (if available) 489 * @param session session handle (if available)
480 * @param ats performance data for the address 490 * @param ats performance data for the address
481 * @param ats_count number of performance records in @a ats 491 * @param ats_count number of performance records in @a ats
482 * @return #GNUNET_OK or #GNUNET_SYSERR
483 */ 492 */
484int 493void
485GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh, 494GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar,
486 const struct GNUNET_HELLO_Address *address,
487 struct Session *session, 495 struct Session *session,
488 const struct GNUNET_ATS_Information *ats, 496 const struct GNUNET_ATS_Information *ats,
489 uint32_t ats_count); 497 uint32_t ats_count);