diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-03-19 10:04:49 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-03-19 10:04:49 +0000 |
commit | 5e53368a783e8dbf20a3f505a27f2e5549b7cf34 (patch) | |
tree | 739fe2eac01a5530830ec859a298ab30a2ee8d95 /src/include | |
parent | 5df7f24fe0f8371c931b78a135c864af8e167c6a (diff) | |
download | gnunet-5e53368a783e8dbf20a3f505a27f2e5549b7cf34.tar.gz gnunet-5e53368a783e8dbf20a3f505a27f2e5549b7cf34.zip |
performance monitor API + rename
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_ats_service.h | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index a6da5c897..7ac9f7f4a 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -697,9 +697,23 @@ GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh, | |||
697 | */ | 697 | */ |
698 | struct GNUNET_ATS_PerformanceHandle; | 698 | struct GNUNET_ATS_PerformanceHandle; |
699 | 699 | ||
700 | /** | ||
701 | * Signature of a function that is called with QoS information about an peer. | ||
702 | * | ||
703 | * @param cls closure | ||
704 | * @param peer the peer | ||
705 | * @param ats data for the peer | ||
706 | * @param ats_count number of performance records in 'ats' | ||
707 | */ | ||
708 | typedef void | ||
709 | (*GNUNET_ATS_PerformanceMonitorCb) (void *cls, | ||
710 | struct GNUNET_PeerIdentity *peer, | ||
711 | struct GNUNET_ATS_Information *ats, | ||
712 | uint32_t ats_count); | ||
713 | |||
700 | 714 | ||
701 | /** | 715 | /** |
702 | * Signature of a function that is called with QoS information about a peer. | 716 | * Signature of a function that is called with QoS information about an address. |
703 | * | 717 | * |
704 | * @param cls closure | 718 | * @param cls closure |
705 | * @param address the address | 719 | * @param address the address |
@@ -708,7 +722,7 @@ struct GNUNET_ATS_PerformanceHandle; | |||
708 | * @param ats performance data for the address (as far as known) | 722 | * @param ats performance data for the address (as far as known) |
709 | * @param ats_count number of performance records in 'ats' | 723 | * @param ats_count number of performance records in 'ats' |
710 | */ | 724 | */ |
711 | typedef void (*GNUNET_ATS_PeerInformationCallback) (void *cls, | 725 | typedef void (*GNUNET_ATS_AddressInformationCallback) (void *cls, |
712 | const struct | 726 | const struct |
713 | GNUNET_HELLO_Address * | 727 | GNUNET_HELLO_Address * |
714 | address, | 728 | address, |
@@ -738,11 +752,38 @@ struct GNUNET_ATS_AddressListHandle; | |||
738 | */ | 752 | */ |
739 | struct GNUNET_ATS_PerformanceHandle * | 753 | struct GNUNET_ATS_PerformanceHandle * |
740 | GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 754 | GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
741 | GNUNET_ATS_PeerInformationCallback infocb, | 755 | GNUNET_ATS_AddressInformationCallback infocb, |
742 | void *infocb_cls); | 756 | void *infocb_cls); |
743 | 757 | ||
744 | 758 | ||
745 | /** | 759 | /** |
760 | * Start monitoring performance information | ||
761 | * | ||
762 | * @param ph performance handle to use | ||
763 | * @param monitor_cb function to call on performance changes | ||
764 | * @param monitor_cb_cls closure for infocb | ||
765 | * @return a performance monitor handle | ||
766 | */ | ||
767 | struct GNUNET_ATS_PerformanceMonitorHandle * | ||
768 | GNUNET_ATS_performance_monitor_start (struct GNUNET_ATS_PerformanceHandle * ph, | ||
769 | GNUNET_ATS_PerformanceMonitorCb monitor_cb, | ||
770 | void * monitor_cb_cls); | ||
771 | |||
772 | |||
773 | /** | ||
774 | * Stop monitoring performance information | ||
775 | * | ||
776 | * @param ph performance handle to use | ||
777 | * @param monitor_cb function to call on performance changes | ||
778 | * @param monitor_cb_cls closure for infocb | ||
779 | * @return a performance monitor handle | ||
780 | */ | ||
781 | void | ||
782 | GNUNET_ATS_performance_monitor_stop (struct GNUNET_ATS_PerformanceMonitorHandle * phm); | ||
783 | |||
784 | |||
785 | |||
786 | /** | ||
746 | * Get information about addresses known to the ATS subsystem. | 787 | * Get information about addresses known to the ATS subsystem. |
747 | * | 788 | * |
748 | * @param handle the performance handle to use | 789 | * @param handle the performance handle to use |
@@ -758,7 +799,7 @@ struct GNUNET_ATS_AddressListHandle * | |||
758 | GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *handle, | 799 | GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *handle, |
759 | const struct GNUNET_PeerIdentity *peer, | 800 | const struct GNUNET_PeerIdentity *peer, |
760 | int all, | 801 | int all, |
761 | GNUNET_ATS_PeerInformationCallback infocb, | 802 | GNUNET_ATS_AddressInformationCallback infocb, |
762 | void *infocb_cls); | 803 | void *infocb_cls); |
763 | 804 | ||
764 | 805 | ||