diff options
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses.h')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.h | 261 |
1 files changed, 95 insertions, 166 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h index 4f17fd912..b5ae248e4 100644 --- a/src/ats/gnunet-service-ats_addresses.h +++ b/src/ats/gnunet-service-ats_addresses.h | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2011 Christian Grothoff (and other contributing authors) | 3 | (C) 2011 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with GNUnet; see the file COPYING. If not, write to the |
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file ats/gnunet-service-ats_addresses.h | 22 | * @file ats/gnunet-service-ats_addresses.h |
@@ -225,39 +225,36 @@ | |||
225 | 225 | ||
226 | */ | 226 | */ |
227 | 227 | ||
228 | |||
229 | /* | 228 | /* |
230 | * How long will address suggestions blocked after a suggestion | 229 | * How long will address suggestions blocked after a suggestion |
231 | */ | 230 | */ |
232 | #define ATS_BLOCKING_DELTA GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 100) | 231 | #define ATS_BLOCKING_DELTA GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 100) |
233 | 232 | ||
234 | |||
235 | /** | 233 | /** |
236 | * Information provided by ATS normalization | 234 | * Information provided by ATS normalization |
237 | */ | 235 | */ |
238 | struct GAS_NormalizationInfo | 236 | struct GAS_NormalizationInfo |
239 | { | 237 | { |
240 | /** | 238 | /** |
241 | * Next index to use in averaging queue | 239 | * Next index to use in averaging queue |
242 | */ | 240 | */ |
243 | unsigned int avg_queue_index; | 241 | unsigned int avg_queue_index; |
244 | |||
245 | /** | ||
246 | * Averaging queue | ||
247 | */ | ||
248 | uint32_t atsi_abs[GAS_normalization_queue_length]; | ||
249 | |||
250 | /** | ||
251 | * Averaged ATSI values from queue | ||
252 | */ | ||
253 | uint32_t avg; | ||
254 | |||
255 | /** | ||
256 | * Normalized values from queue to a range of values [1.0...2.0] | ||
257 | */ | ||
258 | double norm; | ||
259 | }; | ||
260 | 242 | ||
243 | /** | ||
244 | * Averaging queue | ||
245 | */ | ||
246 | uint32_t atsi_abs[GAS_normalization_queue_length]; | ||
247 | |||
248 | /** | ||
249 | * Averaged ATSI values from queue | ||
250 | */ | ||
251 | uint32_t avg; | ||
252 | |||
253 | /** | ||
254 | * Normalized values from queue to a range of values [1.0...2.0] | ||
255 | */ | ||
256 | double norm; | ||
257 | }; | ||
261 | 258 | ||
262 | /** | 259 | /** |
263 | * Address with additional information | 260 | * Address with additional information |
@@ -351,15 +348,13 @@ struct ATS_Address | |||
351 | struct GAS_NormalizationInfo atsin[GNUNET_ATS_QualityPropertiesCount]; | 348 | struct GAS_NormalizationInfo atsin[GNUNET_ATS_QualityPropertiesCount]; |
352 | }; | 349 | }; |
353 | 350 | ||
354 | |||
355 | /** | 351 | /** |
356 | * Callback to call from solver when bandwidth for address has changed | 352 | * Callback to call from solver when bandwidth for address has changed |
357 | * | 353 | * |
358 | * @param address the with changed bandwidth assigned | 354 | * @param address the with changed bandwidth assigned |
359 | */ | 355 | */ |
360 | typedef void | 356 | typedef void |
361 | (*GAS_bandwidth_changed_cb) (void *cls, struct ATS_Address *address); | 357 | (*GAS_bandwidth_changed_cb) (void *cls, struct ATS_Address *address); |
362 | |||
363 | 358 | ||
364 | /** | 359 | /** |
365 | * Callback to call from solver to obtain application preference values for a | 360 | * Callback to call from solver to obtain application preference values for a |
@@ -371,8 +366,7 @@ typedef void | |||
371 | * GNUNET_ATS_PreferenceCount elements | 366 | * GNUNET_ATS_PreferenceCount elements |
372 | */ | 367 | */ |
373 | typedef const double * | 368 | typedef const double * |
374 | (*GAS_get_preferences) (void *cls, const struct GNUNET_PeerIdentity *id); | 369 | (*GAS_get_preferences) (void *cls, const struct GNUNET_PeerIdentity *id); |
375 | |||
376 | 370 | ||
377 | /** | 371 | /** |
378 | * Callback to call from solver to obtain transport properties for an | 372 | * Callback to call from solver to obtain transport properties for an |
@@ -384,9 +378,7 @@ typedef const double * | |||
384 | * GNUNET_ATS_PreferenceCount elements | 378 | * GNUNET_ATS_PreferenceCount elements |
385 | */ | 379 | */ |
386 | typedef const double * | 380 | typedef const double * |
387 | (*GAS_get_properties) (void *cls, const struct ATS_Address *address); | 381 | (*GAS_get_properties) (void *cls, const struct ATS_Address *address); |
388 | |||
389 | |||
390 | 382 | ||
391 | /* | 383 | /* |
392 | * Solver API | 384 | * Solver API |
@@ -417,20 +409,14 @@ typedef const double * | |||
417 | * @return handle for the solver on success, NULL on fail | 409 | * @return handle for the solver on success, NULL on fail |
418 | */ | 410 | */ |
419 | typedef void * | 411 | typedef void * |
420 | (*GAS_solver_init) (const struct GNUNET_CONFIGURATION_Handle *cfg, | 412 | (*GAS_solver_init) (const struct GNUNET_CONFIGURATION_Handle *cfg, |
421 | const struct GNUNET_STATISTICS_Handle *stats, | 413 | const struct GNUNET_STATISTICS_Handle *stats, |
422 | const struct GNUNET_CONTAINER_MultiHashMap *addresses, | 414 | const struct GNUNET_CONTAINER_MultiHashMap *addresses, int *network, |
423 | int *network, | 415 | unsigned long long *out_quota, unsigned long long *in_quota, |
424 | unsigned long long *out_quota, | 416 | int dest_length, GAS_bandwidth_changed_cb bw_changed_cb, |
425 | unsigned long long *in_quota, | 417 | void *bw_changed_cb_cls, GAS_get_preferences get_preference, |
426 | int dest_length, | 418 | void *get_preference_cls, GAS_get_properties get_properties, |
427 | GAS_bandwidth_changed_cb bw_changed_cb, | 419 | void *get_properties_cls); |
428 | void *bw_changed_cb_cls, | ||
429 | GAS_get_preferences get_preference, | ||
430 | void *get_preference_cls, | ||
431 | GAS_get_properties get_properties, | ||
432 | void *get_properties_cls); | ||
433 | |||
434 | 420 | ||
435 | /** | 421 | /** |
436 | * Change the preference for a peer | 422 | * Change the preference for a peer |
@@ -444,10 +430,8 @@ typedef void * | |||
444 | */ | 430 | */ |
445 | typedef void | 431 | typedef void |
446 | (*GAS_solver_address_change_preference) (void *solver, | 432 | (*GAS_solver_address_change_preference) (void *solver, |
447 | const struct GNUNET_PeerIdentity *peer, | 433 | const struct GNUNET_PeerIdentity *peer, enum GNUNET_ATS_PreferenceKind kind, |
448 | enum GNUNET_ATS_PreferenceKind kind, | 434 | double pref_rel); |
449 | double pref_rel); | ||
450 | |||
451 | 435 | ||
452 | /** | 436 | /** |
453 | * Give feedback about the current assignment | 437 | * Give feedback about the current assignment |
@@ -460,12 +444,10 @@ typedef void | |||
460 | * @param score the feedback score | 444 | * @param score the feedback score |
461 | */ | 445 | */ |
462 | typedef void | 446 | typedef void |
463 | (*GAS_solver_address_feedback_preference) (void *solver, | 447 | (*GAS_solver_address_feedback_preference) (void *solver, void *application, |
464 | void *application, | 448 | const struct GNUNET_PeerIdentity *peer, |
465 | const struct GNUNET_PeerIdentity *peer, | 449 | const struct GNUNET_TIME_Relative scope, |
466 | const struct GNUNET_TIME_Relative scope, | 450 | enum GNUNET_ATS_PreferenceKind kind, double score); |
467 | enum GNUNET_ATS_PreferenceKind kind, | ||
468 | double score); | ||
469 | 451 | ||
470 | /** | 452 | /** |
471 | * Notify the solver about a bulk operation changing possibly a lot of values | 453 | * Notify the solver about a bulk operation changing possibly a lot of values |
@@ -476,7 +458,6 @@ typedef void | |||
476 | typedef void | 458 | typedef void |
477 | (*GAS_solver_bulk_start) (void *solver); | 459 | (*GAS_solver_bulk_start) (void *solver); |
478 | 460 | ||
479 | |||
480 | /** | 461 | /** |
481 | * Mark a bulk operation as done | 462 | * Mark a bulk operation as done |
482 | * Solver will resolve if values have changed | 463 | * Solver will resolve if values have changed |
@@ -486,7 +467,6 @@ typedef void | |||
486 | typedef void | 467 | typedef void |
487 | (*GAS_solver_bulk_stop) (void *solver); | 468 | (*GAS_solver_bulk_stop) (void *solver); |
488 | 469 | ||
489 | |||
490 | /** | 470 | /** |
491 | * Add a single address within a network to the solver | 471 | * Add a single address within a network to the solver |
492 | * | 472 | * |
@@ -496,10 +476,8 @@ typedef void | |||
496 | * @param network network type of this address | 476 | * @param network network type of this address |
497 | */ | 477 | */ |
498 | typedef void | 478 | typedef void |
499 | (*GAS_solver_address_add) (void *solver, | 479 | (*GAS_solver_address_add) (void *solver, struct ATS_Address *address, |
500 | struct ATS_Address *address, | 480 | uint32_t network); |
501 | uint32_t network); | ||
502 | |||
503 | 481 | ||
504 | /** | 482 | /** |
505 | * Delete an address or just the session from the solver | 483 | * Delete an address or just the session from the solver |
@@ -510,10 +488,8 @@ typedef void | |||
510 | * @param session_only remove address or just session | 488 | * @param session_only remove address or just session |
511 | */ | 489 | */ |
512 | typedef void | 490 | typedef void |
513 | (*GAS_solver_address_delete) (void *solver, | 491 | (*GAS_solver_address_delete) (void *solver, struct ATS_Address *address, |
514 | struct ATS_Address *address, | 492 | int session_only); |
515 | int session_only); | ||
516 | |||
517 | 493 | ||
518 | /** | 494 | /** |
519 | * Transport properties for this address have changed | 495 | * Transport properties for this address have changed |
@@ -526,11 +502,8 @@ typedef void | |||
526 | */ | 502 | */ |
527 | typedef void | 503 | typedef void |
528 | (*GAS_solver_address_property_changed) (void *solver, | 504 | (*GAS_solver_address_property_changed) (void *solver, |
529 | struct ATS_Address *address, | 505 | struct ATS_Address *address, uint32_t type, uint32_t abs_value, |
530 | uint32_t type, | 506 | double rel_value); |
531 | uint32_t abs_value, | ||
532 | double rel_value); | ||
533 | |||
534 | 507 | ||
535 | /** | 508 | /** |
536 | * Transport session for this address has changed | 509 | * Transport session for this address has changed |
@@ -544,9 +517,7 @@ typedef void | |||
544 | */ | 517 | */ |
545 | typedef void | 518 | typedef void |
546 | (*GAS_solver_address_session_changed) (void *solver, | 519 | (*GAS_solver_address_session_changed) (void *solver, |
547 | struct ATS_Address *address, | 520 | struct ATS_Address *address, uint32_t cur_session, uint32_t new_session); |
548 | uint32_t cur_session, | ||
549 | uint32_t new_session); | ||
550 | 521 | ||
551 | /** | 522 | /** |
552 | * Transport session for this address has changed | 523 | * Transport session for this address has changed |
@@ -558,9 +529,8 @@ typedef void | |||
558 | * @param in_use usage state | 529 | * @param in_use usage state |
559 | */ | 530 | */ |
560 | typedef void | 531 | typedef void |
561 | (*GAS_solver_address_inuse_changed) (void *solver, | 532 | (*GAS_solver_address_inuse_changed) (void *solver, struct ATS_Address *address, |
562 | struct ATS_Address *address, | 533 | int in_use); |
563 | int in_use); | ||
564 | 534 | ||
565 | /** | 535 | /** |
566 | * Network scope for this address has changed | 536 | * Network scope for this address has changed |
@@ -574,10 +544,7 @@ typedef void | |||
574 | */ | 544 | */ |
575 | typedef void | 545 | typedef void |
576 | (*GAS_solver_address_network_changed) (void *solver, | 546 | (*GAS_solver_address_network_changed) (void *solver, |
577 | struct ATS_Address *address, | 547 | struct ATS_Address *address, uint32_t current_network, uint32_t new_network); |
578 | uint32_t current_network, | ||
579 | uint32_t new_network); | ||
580 | |||
581 | 548 | ||
582 | /** | 549 | /** |
583 | * Get the prefered address for a peer from solver | 550 | * Get the prefered address for a peer from solver |
@@ -588,8 +555,7 @@ typedef void | |||
588 | */ | 555 | */ |
589 | typedef const struct ATS_Address * | 556 | typedef const struct ATS_Address * |
590 | (*GAS_solver_get_preferred_address) (void *solver, | 557 | (*GAS_solver_get_preferred_address) (void *solver, |
591 | const struct GNUNET_PeerIdentity *peer); | 558 | const struct GNUNET_PeerIdentity *peer); |
592 | |||
593 | 559 | ||
594 | /** | 560 | /** |
595 | * Stop getting the prefered address for a peer from solver | 561 | * Stop getting the prefered address for a peer from solver |
@@ -600,7 +566,7 @@ typedef const struct ATS_Address * | |||
600 | */ | 566 | */ |
601 | typedef void | 567 | typedef void |
602 | (*GAS_solver_stop_get_preferred_address) (void *solver, | 568 | (*GAS_solver_stop_get_preferred_address) (void *solver, |
603 | const struct GNUNET_PeerIdentity *peer); | 569 | const struct GNUNET_PeerIdentity *peer); |
604 | 570 | ||
605 | /** | 571 | /** |
606 | * Shutdown solver | 572 | * Shutdown solver |
@@ -609,8 +575,7 @@ typedef void | |||
609 | */ | 575 | */ |
610 | 576 | ||
611 | typedef void | 577 | typedef void |
612 | (*GAS_solver_done) (void *solver); | 578 | (*GAS_solver_done) (void *solver); |
613 | |||
614 | 579 | ||
615 | /** | 580 | /** |
616 | * Initialize address subsystem. The addresses subsystem manages the addresses | 581 | * Initialize address subsystem. The addresses subsystem manages the addresses |
@@ -624,8 +589,7 @@ typedef void | |||
624 | */ | 589 | */ |
625 | struct GAS_Addresses_Handle * | 590 | struct GAS_Addresses_Handle * |
626 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 591 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
627 | const struct GNUNET_STATISTICS_Handle *stats); | 592 | const struct GNUNET_STATISTICS_Handle *stats); |
628 | |||
629 | 593 | ||
630 | /** | 594 | /** |
631 | * Shutdown address subsystem. | 595 | * Shutdown address subsystem. |
@@ -635,7 +599,6 @@ GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
635 | void | 599 | void |
636 | GAS_addresses_done (struct GAS_Addresses_Handle *handle); | 600 | GAS_addresses_done (struct GAS_Addresses_Handle *handle); |
637 | 601 | ||
638 | |||
639 | /** | 602 | /** |
640 | * Add a new address for a peer. | 603 | * Add a new address for a peer. |
641 | * | 604 | * |
@@ -650,14 +613,9 @@ GAS_addresses_done (struct GAS_Addresses_Handle *handle); | |||
650 | */ | 613 | */ |
651 | void | 614 | void |
652 | GAS_addresses_add (struct GAS_Addresses_Handle *handle, | 615 | GAS_addresses_add (struct GAS_Addresses_Handle *handle, |
653 | const struct GNUNET_PeerIdentity *peer, | 616 | const struct GNUNET_PeerIdentity *peer, const char *plugin_name, |
654 | const char *plugin_name, | 617 | const void *plugin_addr, size_t plugin_addr_len, uint32_t session_id, |
655 | const void *plugin_addr, | 618 | const struct GNUNET_ATS_Information *atsi, uint32_t atsi_count); |
656 | size_t plugin_addr_len, | ||
657 | uint32_t session_id, | ||
658 | const struct GNUNET_ATS_Information *atsi, | ||
659 | uint32_t atsi_count); | ||
660 | |||
661 | 619 | ||
662 | /** | 620 | /** |
663 | * Notification about active use of an address. | 621 | * Notification about active use of an address. |
@@ -680,13 +638,9 @@ GAS_addresses_add (struct GAS_Addresses_Handle *handle, | |||
680 | */ | 638 | */ |
681 | int | 639 | int |
682 | GAS_addresses_in_use (struct GAS_Addresses_Handle *handle, | 640 | GAS_addresses_in_use (struct GAS_Addresses_Handle *handle, |
683 | const struct GNUNET_PeerIdentity *peer, | 641 | const struct GNUNET_PeerIdentity *peer, const char *plugin_name, |
684 | const char *plugin_name, | 642 | const void *plugin_addr, size_t plugin_addr_len, uint32_t session_id, |
685 | const void *plugin_addr, | 643 | int in_use); |
686 | size_t plugin_addr_len, | ||
687 | uint32_t session_id, | ||
688 | int in_use); | ||
689 | |||
690 | 644 | ||
691 | /** | 645 | /** |
692 | * Update an address with a session or performance information for a peer. | 646 | * Update an address with a session or performance information for a peer. |
@@ -705,14 +659,9 @@ GAS_addresses_in_use (struct GAS_Addresses_Handle *handle, | |||
705 | */ | 659 | */ |
706 | void | 660 | void |
707 | GAS_addresses_update (struct GAS_Addresses_Handle *handle, | 661 | GAS_addresses_update (struct GAS_Addresses_Handle *handle, |
708 | const struct GNUNET_PeerIdentity *peer, | 662 | const struct GNUNET_PeerIdentity *peer, const char *plugin_name, |
709 | const char *plugin_name, | 663 | const void *plugin_addr, size_t plugin_addr_len, uint32_t session_id, |
710 | const void *plugin_addr, | 664 | const struct GNUNET_ATS_Information *atsi, uint32_t atsi_count); |
711 | size_t plugin_addr_len, | ||
712 | uint32_t session_id, | ||
713 | const struct GNUNET_ATS_Information *atsi, | ||
714 | uint32_t atsi_count); | ||
715 | |||
716 | 665 | ||
717 | /** | 666 | /** |
718 | * Remove an address or just a session for a peer. | 667 | * Remove an address or just a session for a peer. |
@@ -726,12 +675,8 @@ GAS_addresses_update (struct GAS_Addresses_Handle *handle, | |||
726 | */ | 675 | */ |
727 | void | 676 | void |
728 | GAS_addresses_destroy (struct GAS_Addresses_Handle *handle, | 677 | GAS_addresses_destroy (struct GAS_Addresses_Handle *handle, |
729 | const struct GNUNET_PeerIdentity *peer, | 678 | const struct GNUNET_PeerIdentity *peer, const char *plugin_name, |
730 | const char *plugin_name, | 679 | const void *plugin_addr, size_t plugin_addr_len, uint32_t session_id); |
731 | const void *plugin_addr, | ||
732 | size_t plugin_addr_len, | ||
733 | uint32_t session_id); | ||
734 | |||
735 | 680 | ||
736 | /** | 681 | /** |
737 | * Remove all addresses | 682 | * Remove all addresses |
@@ -741,7 +686,6 @@ GAS_addresses_destroy (struct GAS_Addresses_Handle *handle, | |||
741 | void | 686 | void |
742 | GAS_addresses_destroy_all (struct GAS_Addresses_Handle *handle); | 687 | GAS_addresses_destroy_all (struct GAS_Addresses_Handle *handle); |
743 | 688 | ||
744 | |||
745 | /** | 689 | /** |
746 | * Request address suggestions for a peer | 690 | * Request address suggestions for a peer |
747 | * | 691 | * |
@@ -750,7 +694,7 @@ GAS_addresses_destroy_all (struct GAS_Addresses_Handle *handle); | |||
750 | */ | 694 | */ |
751 | void | 695 | void |
752 | GAS_addresses_request_address (struct GAS_Addresses_Handle *handle, | 696 | GAS_addresses_request_address (struct GAS_Addresses_Handle *handle, |
753 | const struct GNUNET_PeerIdentity *peer); | 697 | const struct GNUNET_PeerIdentity *peer); |
754 | 698 | ||
755 | /** | 699 | /** |
756 | * Cancel address suggestions for a peer | 700 | * Cancel address suggestions for a peer |
@@ -760,8 +704,7 @@ GAS_addresses_request_address (struct GAS_Addresses_Handle *handle, | |||
760 | */ | 704 | */ |
761 | void | 705 | void |
762 | GAS_addresses_request_address_cancel (struct GAS_Addresses_Handle *handle, | 706 | GAS_addresses_request_address_cancel (struct GAS_Addresses_Handle *handle, |
763 | const struct GNUNET_PeerIdentity *peer); | 707 | const struct GNUNET_PeerIdentity *peer); |
764 | |||
765 | 708 | ||
766 | /** | 709 | /** |
767 | * Reset suggestion backoff for a peer | 710 | * Reset suggestion backoff for a peer |
@@ -774,8 +717,7 @@ GAS_addresses_request_address_cancel (struct GAS_Addresses_Handle *handle, | |||
774 | */ | 717 | */ |
775 | void | 718 | void |
776 | GAS_addresses_handle_backoff_reset (struct GAS_Addresses_Handle *handle, | 719 | GAS_addresses_handle_backoff_reset (struct GAS_Addresses_Handle *handle, |
777 | const struct GNUNET_PeerIdentity *peer); | 720 | const struct GNUNET_PeerIdentity *peer); |
778 | |||
779 | 721 | ||
780 | /** | 722 | /** |
781 | * Change the preference for a peer | 723 | * Change the preference for a peer |
@@ -788,11 +730,8 @@ GAS_addresses_handle_backoff_reset (struct GAS_Addresses_Handle *handle, | |||
788 | */ | 730 | */ |
789 | void | 731 | void |
790 | GAS_addresses_change_preference (struct GAS_Addresses_Handle *handle, | 732 | GAS_addresses_change_preference (struct GAS_Addresses_Handle *handle, |
791 | void *client, | 733 | void *client, const struct GNUNET_PeerIdentity *peer, |
792 | const struct GNUNET_PeerIdentity *peer, | 734 | enum GNUNET_ATS_PreferenceKind kind, float score_abs); |
793 | enum GNUNET_ATS_PreferenceKind kind, | ||
794 | float score_abs); | ||
795 | |||
796 | 735 | ||
797 | /** | 736 | /** |
798 | * Change the preference for a peer | 737 | * Change the preference for a peer |
@@ -806,12 +745,9 @@ GAS_addresses_change_preference (struct GAS_Addresses_Handle *handle, | |||
806 | */ | 745 | */ |
807 | void | 746 | void |
808 | GAS_addresses_preference_feedback (struct GAS_Addresses_Handle *handle, | 747 | GAS_addresses_preference_feedback (struct GAS_Addresses_Handle *handle, |
809 | void *application, | 748 | void *application, const struct GNUNET_PeerIdentity *peer, |
810 | const struct GNUNET_PeerIdentity *peer, | 749 | const struct GNUNET_TIME_Relative scope, |
811 | const struct GNUNET_TIME_Relative scope, | 750 | enum GNUNET_ATS_PreferenceKind kind, float score_abs); |
812 | enum GNUNET_ATS_PreferenceKind kind, | ||
813 | float score_abs); | ||
814 | |||
815 | 751 | ||
816 | /** | 752 | /** |
817 | * Iterator for GAS_addresses_iterate_peers | 753 | * Iterator for GAS_addresses_iterate_peers |
@@ -819,9 +755,9 @@ GAS_addresses_preference_feedback (struct GAS_Addresses_Handle *handle, | |||
819 | * @param p_it_cls closure | 755 | * @param p_it_cls closure |
820 | * @param id the peer id | 756 | * @param id the peer id |
821 | */ | 757 | */ |
822 | typedef void (*GNUNET_ATS_Peer_Iterator) (void *p_it_cls, | 758 | typedef void |
823 | const struct GNUNET_PeerIdentity *id); | 759 | (*GNUNET_ATS_Peer_Iterator) (void *p_it_cls, |
824 | 760 | const struct GNUNET_PeerIdentity *id); | |
825 | 761 | ||
826 | /** | 762 | /** |
827 | * Return all peers currently known to ATS | 763 | * Return all peers currently known to ATS |
@@ -832,9 +768,7 @@ typedef void (*GNUNET_ATS_Peer_Iterator) (void *p_it_cls, | |||
832 | */ | 768 | */ |
833 | void | 769 | void |
834 | GAS_addresses_iterate_peers (struct GAS_Addresses_Handle *handle, | 770 | GAS_addresses_iterate_peers (struct GAS_Addresses_Handle *handle, |
835 | GNUNET_ATS_Peer_Iterator p_it, | 771 | GNUNET_ATS_Peer_Iterator p_it, void *p_it_cls); |
836 | void *p_it_cls); | ||
837 | |||
838 | 772 | ||
839 | /** | 773 | /** |
840 | * Iterator for GAS_addresses_get_peer_info | 774 | * Iterator for GAS_addresses_get_peer_info |
@@ -850,18 +784,14 @@ GAS_addresses_iterate_peers (struct GAS_Addresses_Handle *handle, | |||
850 | * @param bandwidth_out current outbound bandwidth assigned to address | 784 | * @param bandwidth_out current outbound bandwidth assigned to address |
851 | * @param bandwidth_in current inbound bandwidth assigned to address | 785 | * @param bandwidth_in current inbound bandwidth assigned to address |
852 | */ | 786 | */ |
853 | typedef void (*GNUNET_ATS_PeerInfo_Iterator) (void *p_it_cls, | 787 | typedef void |
854 | const struct GNUNET_PeerIdentity *id, | 788 | (*GNUNET_ATS_PeerInfo_Iterator) (void *p_it_cls, |
855 | const char *plugin_name, | 789 | const struct GNUNET_PeerIdentity *id, const char *plugin_name, |
856 | const void *plugin_addr, | 790 | const void *plugin_addr, size_t plugin_addr_len, const int address_active, |
857 | size_t plugin_addr_len, | 791 | const struct GNUNET_ATS_Information *atsi, uint32_t atsi_count, |
858 | const int address_active, | ||
859 | const struct GNUNET_ATS_Information *atsi, | ||
860 | uint32_t atsi_count, | ||
861 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 792 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
862 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); | 793 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); |
863 | 794 | ||
864 | |||
865 | /** | 795 | /** |
866 | * Return information all peers currently known to ATS | 796 | * Return information all peers currently known to ATS |
867 | * | 797 | * |
@@ -872,9 +802,8 @@ typedef void (*GNUNET_ATS_PeerInfo_Iterator) (void *p_it_cls, | |||
872 | */ | 802 | */ |
873 | void | 803 | void |
874 | GAS_addresses_get_peer_info (struct GAS_Addresses_Handle *handle, | 804 | GAS_addresses_get_peer_info (struct GAS_Addresses_Handle *handle, |
875 | const struct GNUNET_PeerIdentity *peer, | 805 | const struct GNUNET_PeerIdentity *peer, GNUNET_ATS_PeerInfo_Iterator pi_it, |
876 | GNUNET_ATS_PeerInfo_Iterator pi_it, | 806 | void *pi_it_cls); |
877 | void *pi_it_cls); | ||
878 | 807 | ||
879 | #endif | 808 | #endif |
880 | 809 | ||