diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-11-08 23:20:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-11-08 23:20:42 +0000 |
commit | a983a0267109b1b6a8e16e476e2f2956a8771b94 (patch) | |
tree | 79bcae73cdb7b87b4f55d4396e79baea76ef53a6 /src/include/gnunet_ats_service.h | |
parent | a3f8ef5b89dc44fc3acfb8f081a502f3409e4224 (diff) | |
download | gnunet-a983a0267109b1b6a8e16e476e2f2956a8771b94.tar.gz gnunet-a983a0267109b1b6a8e16e476e2f2956a8771b94.zip |
refactoring how we handle peer addresses in peerinfo/ats/transport/hello subsystems -- use a struct instead of 3--4 arguments
Diffstat (limited to 'src/include/gnunet_ats_service.h')
-rw-r--r-- | src/include/gnunet_ats_service.h | 54 |
1 files changed, 14 insertions, 40 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index ac963ce1d..a6edc786c 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include "gnunet_constants.h" | 29 | #include "gnunet_constants.h" |
30 | #include "gnunet_util_lib.h" | 30 | #include "gnunet_util_lib.h" |
31 | #include "gnunet_hello_lib.h" | ||
31 | 32 | ||
32 | 33 | ||
33 | /** | 34 | /** |
@@ -439,10 +440,7 @@ struct Session; | |||
439 | * and address preferences as determined by ATS. | 440 | * and address preferences as determined by ATS. |
440 | * | 441 | * |
441 | * @param cls closure | 442 | * @param cls closure |
442 | * @param peer identity of the new peer | 443 | * @param address suggested address (including peer identity of the peer) |
443 | * @param plugin_name name of the plugin, NULL if we have no suggestion | ||
444 | * @param plugin_addr suggested address, NULL if we have no suggestion | ||
445 | * @param plugin_addr_len number of bytes in plugin_addr | ||
446 | * @param session session to use | 444 | * @param session session to use |
447 | * @param bandwidth_out assigned outbound bandwidth for the connection | 445 | * @param bandwidth_out assigned outbound bandwidth for the connection |
448 | * @param bandwidth_in assigned inbound bandwidth for the connection | 446 | * @param bandwidth_in assigned inbound bandwidth for the connection |
@@ -450,12 +448,7 @@ struct Session; | |||
450 | * @param ats_count number of performance records in 'ats' | 448 | * @param ats_count number of performance records in 'ats' |
451 | */ | 449 | */ |
452 | typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls, | 450 | typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls, |
453 | const struct | 451 | const struct GNUNET_HELLO_Address *address, |
454 | GNUNET_PeerIdentity * | ||
455 | peer, | ||
456 | const char *plugin_name, | ||
457 | const void *plugin_addr, | ||
458 | size_t plugin_addr_len, | ||
459 | struct Session * session, | 452 | struct Session * session, |
460 | struct | 453 | struct |
461 | GNUNET_BANDWIDTH_Value32NBO | 454 | GNUNET_BANDWIDTH_Value32NBO |
@@ -512,19 +505,15 @@ GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh, | |||
512 | * for later use). Update bandwidth assignments. | 505 | * for later use). Update bandwidth assignments. |
513 | * | 506 | * |
514 | * @param sh handle | 507 | * @param sh handle |
515 | * @param peer identity of the new peer | 508 | * @param address updated address |
516 | * @param plugin_name name of the transport plugin | ||
517 | * @param plugin_addr address (if available) | ||
518 | * @param plugin_addr_len number of bytes in plugin_addr | ||
519 | * @param session session handle (if available) | 509 | * @param session session handle (if available) |
520 | * @param ats performance data for the address | 510 | * @param ats performance data for the address |
521 | * @param ats_count number of performance records in 'ats' | 511 | * @param ats_count number of performance records in 'ats' |
522 | */ | 512 | */ |
523 | void | 513 | void |
524 | GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh, | 514 | GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh, |
525 | const struct GNUNET_PeerIdentity *peer, | 515 | const struct GNUNET_HELLO_Address *address, |
526 | const char *plugin_name, const void *plugin_addr, | 516 | struct Session *session, |
527 | size_t plugin_addr_len, struct Session *session, | ||
528 | const struct GNUNET_ATS_Information *ats, | 517 | const struct GNUNET_ATS_Information *ats, |
529 | uint32_t ats_count); | 518 | uint32_t ats_count); |
530 | 519 | ||
@@ -533,36 +522,28 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh, | |||
533 | * An address is now in use or not used any more. | 522 | * An address is now in use or not used any more. |
534 | * | 523 | * |
535 | * @param sh handle | 524 | * @param sh handle |
536 | * @param peer identity of the peer | 525 | * @param address the address |
537 | * @param plugin_name name of the transport plugin | ||
538 | * @param plugin_addr address (if available) | ||
539 | * @param plugin_addr_len number of bytes in plugin_addr | ||
540 | * @param session session handle | 526 | * @param session session handle |
541 | * @param in_use GNUNET_YES if this address is now used, GNUNET_NO | 527 | * @param in_use GNUNET_YES if this address is now used, GNUNET_NO |
542 | * if address is not used any more | 528 | * if address is not used any more |
543 | */ | 529 | */ |
544 | void | 530 | void |
545 | GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh, | 531 | GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh, |
546 | const struct GNUNET_PeerIdentity *peer, | 532 | const struct GNUNET_HELLO_Address *address, |
547 | const char *plugin_name, const void *plugin_addr, | 533 | struct Session *session, |
548 | size_t plugin_addr_len, struct Session *session, | ||
549 | int in_use); | 534 | int in_use); |
550 | 535 | ||
551 | /** | 536 | /** |
552 | * A session got destroyed, stop including it as a valid address. | 537 | * A session got destroyed, stop including it as a valid address. |
553 | * | 538 | * |
554 | * @param sh handle | 539 | * @param sh handle |
555 | * @param peer identity of the peer | 540 | * @param address the address |
556 | * @param plugin_name name of the transport plugin | ||
557 | * @param plugin_addr address (if available) | ||
558 | * @param plugin_addr_len number of bytes in plugin_addr | ||
559 | * @param session session handle that is no longer valid (if available) | 541 | * @param session session handle that is no longer valid (if available) |
560 | */ | 542 | */ |
561 | void | 543 | void |
562 | GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh, | 544 | GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh, |
563 | const struct GNUNET_PeerIdentity *peer, | 545 | const struct GNUNET_HELLO_Address *address, |
564 | const char *plugin_name, const void *plugin_addr, | 546 | struct Session *session); |
565 | size_t plugin_addr_len, struct Session *session); | ||
566 | 547 | ||
567 | 548 | ||
568 | /* ******************************** Performance API ***************************** */ | 549 | /* ******************************** Performance API ***************************** */ |
@@ -577,21 +558,14 @@ struct GNUNET_ATS_PerformanceHandle; | |||
577 | * Signature of a function that is called with QoS information about a peer. | 558 | * Signature of a function that is called with QoS information about a peer. |
578 | * | 559 | * |
579 | * @param cls closure | 560 | * @param cls closure |
580 | * @param peer identity of the new peer | 561 | * @param address the address |
581 | * @param plugin_name name of the plugin, NULL if we have no suggestion | ||
582 | * @param plugin_addr suggested address, NULL if we have no suggestion | ||
583 | * @param plugin_addr_len number of bytes in plugin_addr | ||
584 | * @param bandwidth_out assigned outbound bandwidth for the connection | 562 | * @param bandwidth_out assigned outbound bandwidth for the connection |
585 | * @param bandwidth_in assigned inbound bandwidth for the connection | 563 | * @param bandwidth_in assigned inbound bandwidth for the connection |
586 | * @param ats performance data for the address (as far as known) | 564 | * @param ats performance data for the address (as far as known) |
587 | * @param ats_count number of performance records in 'ats' | 565 | * @param ats_count number of performance records in 'ats' |
588 | */ | 566 | */ |
589 | typedef void (*GNUNET_ATS_PeerInformationCallback) (void *cls, | 567 | typedef void (*GNUNET_ATS_PeerInformationCallback) (void *cls, |
590 | const struct | 568 | const struct GNUNET_HELLO_Address *address, |
591 | GNUNET_PeerIdentity * peer, | ||
592 | const char *plugin_name, | ||
593 | const void *plugin_addr, | ||
594 | size_t plugin_addr_len, | ||
595 | struct | 569 | struct |
596 | GNUNET_BANDWIDTH_Value32NBO | 570 | GNUNET_BANDWIDTH_Value32NBO |
597 | bandwidth_out, | 571 | bandwidth_out, |