diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-16 08:31:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-16 08:31:34 +0000 |
commit | acac80b2c2b5cf432e903350a0dc6bbaa5ee877c (patch) | |
tree | 6e6aa10ab0cba744df6e886db19983d10cda6357 /src/ats | |
parent | 7c245892cbff7c1d940b3002b7fb872b21dba4bb (diff) | |
download | gnunet-acac80b2c2b5cf432e903350a0dc6bbaa5ee877c.tar.gz gnunet-acac80b2c2b5cf432e903350a0dc6bbaa5ee877c.zip |
-doxygen, indentation
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.h | 148 |
1 files changed, 92 insertions, 56 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h index aa0b919ea..7ed609eaf 100644 --- a/src/ats/gnunet-service-ats_addresses.h +++ b/src/ats/gnunet-service-ats_addresses.h | |||
@@ -1,6 +1,6 @@ | |||
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-2014 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 |
@@ -312,6 +312,9 @@ struct ATS_Address | |||
312 | */ | 312 | */ |
313 | uint32_t session_id; | 313 | uint32_t session_id; |
314 | 314 | ||
315 | /** | ||
316 | * FIXME | ||
317 | */ | ||
315 | uint32_t local_address_info; | 318 | uint32_t local_address_info; |
316 | 319 | ||
317 | /** | 320 | /** |
@@ -409,7 +412,8 @@ struct GAS_Addresses_Handle; | |||
409 | */ | 412 | */ |
410 | struct GAS_Addresses_Handle * | 413 | struct GAS_Addresses_Handle * |
411 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 414 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
412 | const struct GNUNET_STATISTICS_Handle *stats); | 415 | const struct GNUNET_STATISTICS_Handle *stats); |
416 | |||
413 | 417 | ||
414 | /** | 418 | /** |
415 | * Shutdown address subsystem. | 419 | * Shutdown address subsystem. |
@@ -419,6 +423,7 @@ GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
419 | void | 423 | void |
420 | GAS_addresses_done (struct GAS_Addresses_Handle *handle); | 424 | GAS_addresses_done (struct GAS_Addresses_Handle *handle); |
421 | 425 | ||
426 | |||
422 | /** | 427 | /** |
423 | * Add a new address for a peer. | 428 | * Add a new address for a peer. |
424 | * | 429 | * |
@@ -430,46 +435,50 @@ GAS_addresses_done (struct GAS_Addresses_Handle *handle); | |||
430 | * @param local_address_info the local address for the address | 435 | * @param local_address_info the local address for the address |
431 | * @param session_id session id, can be 0 | 436 | * @param session_id session id, can be 0 |
432 | * @param atsi performance information for this address | 437 | * @param atsi performance information for this address |
433 | * @param atsi_count number of performance information contained | 438 | * @param atsi_count number of performance information contained in @a atsi |
434 | */ | 439 | */ |
435 | void | 440 | void |
436 | GAS_addresses_add (struct GAS_Addresses_Handle *handle, | 441 | GAS_addresses_add (struct GAS_Addresses_Handle *handle, |
437 | const struct GNUNET_PeerIdentity *peer, | 442 | const struct GNUNET_PeerIdentity *peer, |
438 | const char *plugin_name, | 443 | const char *plugin_name, |
439 | const void *plugin_addr, | 444 | const void *plugin_addr, |
440 | size_t plugin_addr_len, | 445 | size_t plugin_addr_len, |
441 | uint32_t local_address_info, | 446 | uint32_t local_address_info, |
442 | uint32_t session_id, | 447 | uint32_t session_id, |
443 | const struct GNUNET_ATS_Information *atsi, | 448 | const struct GNUNET_ATS_Information *atsi, |
444 | uint32_t atsi_count); | 449 | uint32_t atsi_count); |
450 | |||
445 | 451 | ||
446 | /** | 452 | /** |
447 | * Notification about active use of an address. | 453 | * Notification about active use of an address. |
448 | * in_use == GNUNET_YES: | 454 | * in_use == #GNUNET_YES: |
449 | * This address is used to maintain an active connection with a peer. | 455 | * This address is used to maintain an active connection with a peer. |
450 | * in_use == GNUNET_NO: | 456 | * in_use == #GNUNET_NO: |
451 | * This address is no longer used to maintain an active connection with a peer. | 457 | * This address is no longer used to maintain an active connection with a peer. |
452 | * | 458 | * |
453 | * Note: can only be called with in_use == GNUNET_NO if called with GNUNET_YES | 459 | * Note: can only be called with in_use == #GNUNET_NO if called with #GNUNET_YES |
454 | * before | 460 | * before |
455 | * | 461 | * |
456 | * @param handle the address handle to use | 462 | * @param handle the address handle to use |
457 | * @param peer peer | 463 | * @param peer peer |
458 | * @param plugin_name transport plugin name | 464 | * @param plugin_name transport plugin name |
459 | * @param plugin_addr plugin address | 465 | * @param plugin_addr plugin address |
460 | * @param plugin_addr_len length of the plugin address | 466 | * @param plugin_addr_len length of the plugin address in @a plugin_addr |
461 | * @param local_address_info the local address for the address | 467 | * @param local_address_info the local address for the address |
462 | * @param session_id session id, can be 0 | 468 | * @param session_id session id, can be 0 |
463 | * @param in_use GNUNET_YES if GNUNET_NO | 469 | * @param in_use #GNUNET_YES if #GNUNET_NO FIXME |
464 | * @return GNUNET_SYSERR on failure (address unknown ...) | 470 | * @return #GNUNET_SYSERR on failure (address unknown ...) |
465 | */ | 471 | */ |
466 | int | 472 | int |
467 | GAS_addresses_in_use (struct GAS_Addresses_Handle *handle, | 473 | GAS_addresses_in_use (struct GAS_Addresses_Handle *handle, |
468 | const struct GNUNET_PeerIdentity *peer, const char *plugin_name, | 474 | const struct GNUNET_PeerIdentity *peer, |
469 | const void *plugin_addr, size_t plugin_addr_len, | 475 | const char *plugin_name, |
470 | uint32_t local_address_info, | 476 | const void *plugin_addr, |
471 | uint32_t session_id, | 477 | size_t plugin_addr_len, |
472 | int in_use); | 478 | uint32_t local_address_info, |
479 | uint32_t session_id, | ||
480 | int in_use); | ||
481 | |||
473 | 482 | ||
474 | /** | 483 | /** |
475 | * Update an address with a session or performance information for a peer. | 484 | * Update an address with a session or performance information for a peer. |
@@ -485,14 +494,19 @@ GAS_addresses_in_use (struct GAS_Addresses_Handle *handle, | |||
485 | * @param local_address_info the local address for the address | 494 | * @param local_address_info the local address for the address |
486 | * @param session_id session id, can be 0 | 495 | * @param session_id session id, can be 0 |
487 | * @param atsi performance information for this address | 496 | * @param atsi performance information for this address |
488 | * @param atsi_count number of performance information contained | 497 | * @param atsi_count number of performance information contained in @a atsi |
489 | */ | 498 | */ |
490 | void | 499 | void |
491 | GAS_addresses_update (struct GAS_Addresses_Handle *handle, | 500 | GAS_addresses_update (struct GAS_Addresses_Handle *handle, |
492 | const struct GNUNET_PeerIdentity *peer, const char *plugin_name, | 501 | const struct GNUNET_PeerIdentity *peer, |
493 | const void *plugin_addr, size_t plugin_addr_len, | 502 | const char *plugin_name, |
494 | uint32_t local_address_info, uint32_t session_id, | 503 | const void *plugin_addr, |
495 | const struct GNUNET_ATS_Information *atsi, uint32_t atsi_count); | 504 | size_t plugin_addr_len, |
505 | uint32_t local_address_info, | ||
506 | uint32_t session_id, | ||
507 | const struct GNUNET_ATS_Information *atsi, | ||
508 | uint32_t atsi_count); | ||
509 | |||
496 | 510 | ||
497 | /** | 511 | /** |
498 | * Remove an address or just a session for a peer. | 512 | * Remove an address or just a session for a peer. |
@@ -501,15 +515,19 @@ GAS_addresses_update (struct GAS_Addresses_Handle *handle, | |||
501 | * @param peer peer | 515 | * @param peer peer |
502 | * @param plugin_name transport plugin name | 516 | * @param plugin_name transport plugin name |
503 | * @param plugin_addr plugin address | 517 | * @param plugin_addr plugin address |
504 | * @param plugin_addr_len length of the plugin address | 518 | * @param plugin_addr_len length of the plugin address in @a plugin_addr |
505 | * @param session_id session id, can be 0 | 519 | * @param session_id session id, can be 0 |
506 | * @param local_address_info the local address for the address | 520 | * @param local_address_info the local address for the address |
507 | */ | 521 | */ |
508 | void | 522 | void |
509 | GAS_addresses_destroy (struct GAS_Addresses_Handle *handle, | 523 | GAS_addresses_destroy (struct GAS_Addresses_Handle *handle, |
510 | const struct GNUNET_PeerIdentity *peer, const char *plugin_name, | 524 | const struct GNUNET_PeerIdentity *peer, |
511 | const void *plugin_addr, size_t plugin_addr_len, | 525 | const char *plugin_name, |
512 | uint32_t local_address_info, uint32_t session_id); | 526 | const void *plugin_addr, |
527 | size_t plugin_addr_len, | ||
528 | uint32_t local_address_info, | ||
529 | uint32_t session_id); | ||
530 | |||
513 | 531 | ||
514 | /** | 532 | /** |
515 | * Remove all addresses | 533 | * Remove all addresses |
@@ -519,6 +537,7 @@ GAS_addresses_destroy (struct GAS_Addresses_Handle *handle, | |||
519 | void | 537 | void |
520 | GAS_addresses_destroy_all (struct GAS_Addresses_Handle *handle); | 538 | GAS_addresses_destroy_all (struct GAS_Addresses_Handle *handle); |
521 | 539 | ||
540 | |||
522 | /** | 541 | /** |
523 | * Request address suggestions for a peer | 542 | * Request address suggestions for a peer |
524 | * | 543 | * |
@@ -527,7 +546,8 @@ GAS_addresses_destroy_all (struct GAS_Addresses_Handle *handle); | |||
527 | */ | 546 | */ |
528 | void | 547 | void |
529 | GAS_addresses_request_address (struct GAS_Addresses_Handle *handle, | 548 | GAS_addresses_request_address (struct GAS_Addresses_Handle *handle, |
530 | const struct GNUNET_PeerIdentity *peer); | 549 | const struct GNUNET_PeerIdentity *peer); |
550 | |||
531 | 551 | ||
532 | /** | 552 | /** |
533 | * Cancel address suggestions for a peer | 553 | * Cancel address suggestions for a peer |
@@ -537,7 +557,8 @@ GAS_addresses_request_address (struct GAS_Addresses_Handle *handle, | |||
537 | */ | 557 | */ |
538 | void | 558 | void |
539 | GAS_addresses_request_address_cancel (struct GAS_Addresses_Handle *handle, | 559 | GAS_addresses_request_address_cancel (struct GAS_Addresses_Handle *handle, |
540 | const struct GNUNET_PeerIdentity *peer); | 560 | const struct GNUNET_PeerIdentity *peer); |
561 | |||
541 | 562 | ||
542 | /** | 563 | /** |
543 | * Reset suggestion backoff for a peer | 564 | * Reset suggestion backoff for a peer |
@@ -550,7 +571,7 @@ GAS_addresses_request_address_cancel (struct GAS_Addresses_Handle *handle, | |||
550 | */ | 571 | */ |
551 | void | 572 | void |
552 | GAS_addresses_handle_backoff_reset (struct GAS_Addresses_Handle *handle, | 573 | GAS_addresses_handle_backoff_reset (struct GAS_Addresses_Handle *handle, |
553 | const struct GNUNET_PeerIdentity *peer); | 574 | const struct GNUNET_PeerIdentity *peer); |
554 | 575 | ||
555 | 576 | ||
556 | /** | 577 | /** |
@@ -559,10 +580,10 @@ GAS_addresses_handle_backoff_reset (struct GAS_Addresses_Handle *handle, | |||
559 | * @param handle address handle | 580 | * @param handle address handle |
560 | * @param client the client | 581 | * @param client the client |
561 | */ | 582 | */ |
562 | |||
563 | void | 583 | void |
564 | GAS_addresses_preference_client_disconnect (struct GAS_Addresses_Handle *handle, | 584 | GAS_addresses_preference_client_disconnect (struct GAS_Addresses_Handle *handle, |
565 | void *client); | 585 | void *client); |
586 | |||
566 | 587 | ||
567 | /** | 588 | /** |
568 | * Change the preference for a peer | 589 | * Change the preference for a peer |
@@ -575,8 +596,11 @@ GAS_addresses_preference_client_disconnect (struct GAS_Addresses_Handle *handle, | |||
575 | */ | 596 | */ |
576 | void | 597 | void |
577 | GAS_addresses_preference_change (struct GAS_Addresses_Handle *handle, | 598 | GAS_addresses_preference_change (struct GAS_Addresses_Handle *handle, |
578 | void *client, const struct GNUNET_PeerIdentity *peer, | 599 | void *client, |
579 | enum GNUNET_ATS_PreferenceKind kind, float score_abs); | 600 | const struct GNUNET_PeerIdentity *peer, |
601 | enum GNUNET_ATS_PreferenceKind kind, | ||
602 | float score_abs); | ||
603 | |||
580 | 604 | ||
581 | /** | 605 | /** |
582 | * Application feedback on how good preference requirements are fulfilled | 606 | * Application feedback on how good preference requirements are fulfilled |
@@ -598,52 +622,63 @@ GAS_addresses_preference_change (struct GAS_Addresses_Handle *handle, | |||
598 | */ | 622 | */ |
599 | void | 623 | void |
600 | GAS_addresses_preference_feedback (struct GAS_Addresses_Handle *handle, | 624 | GAS_addresses_preference_feedback (struct GAS_Addresses_Handle *handle, |
601 | void *application, const struct GNUNET_PeerIdentity *peer, | 625 | void *application, |
602 | const struct GNUNET_TIME_Relative scope, | 626 | const struct GNUNET_PeerIdentity *peer, |
603 | enum GNUNET_ATS_PreferenceKind kind, float score_abs); | 627 | const struct GNUNET_TIME_Relative scope, |
628 | enum GNUNET_ATS_PreferenceKind kind, | ||
629 | float score_abs); | ||
630 | |||
604 | 631 | ||
605 | /** | 632 | /** |
606 | * Iterator for GAS_addresses_iterate_peers | 633 | * Iterator for #GAS_addresses_iterate_peers() |
607 | * | 634 | * |
608 | * @param p_it_cls closure | 635 | * @param p_it_cls closure |
609 | * @param id the peer id | 636 | * @param id the peer id |
610 | */ | 637 | */ |
611 | typedef void | 638 | typedef void |
612 | (*GNUNET_ATS_Peer_Iterator) (void *p_it_cls, | 639 | (*GNUNET_ATS_Peer_Iterator) (void *p_it_cls, |
613 | const struct GNUNET_PeerIdentity *id); | 640 | const struct GNUNET_PeerIdentity *id); |
641 | |||
614 | 642 | ||
615 | /** | 643 | /** |
616 | * Return all peers currently known to ATS | 644 | * Return all peers currently known to ATS |
617 | * | 645 | * |
618 | * @param handle the address handle to use | 646 | * @param handle the address handle to use |
619 | * @param p_it the iterator to call for every peer | 647 | * @param p_it the iterator to call for every peer |
620 | * @param p_it_cls the closure for the iterator | 648 | * @param p_it_cls the closure for @a p_it |
621 | */ | 649 | */ |
622 | void | 650 | void |
623 | GAS_addresses_iterate_peers (struct GAS_Addresses_Handle *handle, | 651 | GAS_addresses_iterate_peers (struct GAS_Addresses_Handle *handle, |
624 | GNUNET_ATS_Peer_Iterator p_it, void *p_it_cls); | 652 | GNUNET_ATS_Peer_Iterator p_it, |
653 | void *p_it_cls); | ||
654 | |||
625 | 655 | ||
626 | /** | 656 | /** |
627 | * Iterator for GAS_addresses_get_peer_info | 657 | * Iterator for #GAS_addresses_get_peer_info() |
628 | * | 658 | * |
629 | * @param p_it_cls closure closure | 659 | * @param p_it_cls closure closure |
630 | * @param id the peer id | 660 | * @param id the peer id |
631 | * @param plugin_name plugin name | 661 | * @param plugin_name plugin name |
632 | * @param plugin_addr address | 662 | * @param plugin_addr address |
633 | * @param plugin_addr_len address length | 663 | * @param plugin_addr_len length of @a plugin_addr |
634 | * @param address_active is address actively used | 664 | * @param address_active is address actively used |
635 | * @param atsi ats performance information | 665 | * @param atsi ats performance information |
636 | * @param atsi_count number of ats performance elements | 666 | * @param atsi_count number of ats performance elements in @a atsi |
637 | * @param bandwidth_out current outbound bandwidth assigned to address | 667 | * @param bandwidth_out current outbound bandwidth assigned to address |
638 | * @param bandwidth_in current inbound bandwidth assigned to address | 668 | * @param bandwidth_in current inbound bandwidth assigned to address |
639 | */ | 669 | */ |
640 | typedef void | 670 | typedef void |
641 | (*GNUNET_ATS_PeerInfo_Iterator) (void *p_it_cls, | 671 | (*GNUNET_ATS_PeerInfo_Iterator) (void *p_it_cls, |
642 | const struct GNUNET_PeerIdentity *id, const char *plugin_name, | 672 | const struct GNUNET_PeerIdentity *id, |
643 | const void *plugin_addr, size_t plugin_addr_len, const int address_active, | 673 | const char *plugin_name, |
644 | const struct GNUNET_ATS_Information *atsi, uint32_t atsi_count, | 674 | const void *plugin_addr, |
645 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 675 | size_t plugin_addr_len, |
646 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); | 676 | const int address_active, |
677 | const struct GNUNET_ATS_Information *atsi, | ||
678 | uint32_t atsi_count, | ||
679 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | ||
680 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); | ||
681 | |||
647 | 682 | ||
648 | /** | 683 | /** |
649 | * Return information all peers currently known to ATS | 684 | * Return information all peers currently known to ATS |
@@ -651,12 +686,13 @@ typedef void | |||
651 | * @param handle the address handle to use | 686 | * @param handle the address handle to use |
652 | * @param peer the respective peer | 687 | * @param peer the respective peer |
653 | * @param pi_it the iterator to call for every peer | 688 | * @param pi_it the iterator to call for every peer |
654 | * @param pi_it_cls the closure for the iterator | 689 | * @param pi_it_cls the closure for @a pi_it |
655 | */ | 690 | */ |
656 | void | 691 | void |
657 | GAS_addresses_get_peer_info (struct GAS_Addresses_Handle *handle, | 692 | GAS_addresses_get_peer_info (struct GAS_Addresses_Handle *handle, |
658 | const struct GNUNET_PeerIdentity *peer, GNUNET_ATS_PeerInfo_Iterator pi_it, | 693 | const struct GNUNET_PeerIdentity *peer, |
659 | void *pi_it_cls); | 694 | GNUNET_ATS_PeerInfo_Iterator pi_it, |
695 | void *pi_it_cls); | ||
660 | 696 | ||
661 | #endif | 697 | #endif |
662 | 698 | ||