aboutsummaryrefslogtreecommitdiff
path: root/src/ats/ats_api_performance.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-08-30 11:41:26 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-08-30 11:41:26 +0000
commit3df2832fdf4bd38c1c766fe1b3f2a97c9fe1fe4d (patch)
treeb34ba8ceabb3b0b709148daf634eb94e8123db4f /src/ats/ats_api_performance.c
parent75bb2cabda18a4105f518fcebf7fe95dde3132d6 (diff)
downloadgnunet-3df2832fdf4bd38c1c766fe1b3f2a97c9fe1fe4d.tar.gz
gnunet-3df2832fdf4bd38c1c766fe1b3f2a97c9fe1fe4d.zip
updated experimentation tests
added scope time for feedback api
Diffstat (limited to 'src/ats/ats_api_performance.c')
-rw-r--r--src/ats/ats_api_performance.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index b7c24aa53..8d8df6474 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -943,12 +943,14 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p
943 * preference is satisfied by ATS 943 * preference is satisfied by ATS
944 * 944 *
945 * @param ph performance handle 945 * @param ph performance handle
946 * @param scope the time interval this valid for: [now - scope .. now]
946 * @param peer identifies the peer 947 * @param peer identifies the peer
947 * @param ... 0-terminated specification of the desired changes 948 * @param ... 0-terminated specification of the desired changes
948 */ 949 */
949void 950void
950GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph, 951GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
951 const struct GNUNET_PeerIdentity *peer, ...) 952 const struct GNUNET_PeerIdentity *peer,
953 const struct GNUNET_TIME_Relative scope, ...)
952{ 954{
953 struct PendingMessage *p; 955 struct PendingMessage *p;
954 struct FeedbackPreferenceMessage *m; 956 struct FeedbackPreferenceMessage *m;
@@ -959,7 +961,7 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
959 enum GNUNET_ATS_PreferenceKind kind; 961 enum GNUNET_ATS_PreferenceKind kind;
960 962
961 count = 0; 963 count = 0;
962 va_start (ap, peer); 964 va_start (ap, scope);
963 while (GNUNET_ATS_PREFERENCE_END != 965 while (GNUNET_ATS_PREFERENCE_END !=
964 (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind))) 966 (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind)))
965 { 967 {
@@ -989,11 +991,12 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
989 m = (struct FeedbackPreferenceMessage *) &p[1]; 991 m = (struct FeedbackPreferenceMessage *) &p[1];
990 m->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_FEEDBACK); 992 m->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_FEEDBACK);
991 m->header.size = htons (msize); 993 m->header.size = htons (msize);
992 m->num_preferences = htonl (count); 994 m->scope = GNUNET_TIME_relative_hton (scope);
995 m->num_feedback = htonl (count);
993 m->peer = *peer; 996 m->peer = *peer;
994 pi = (struct PreferenceInformation *) &m[1]; 997 pi = (struct PreferenceInformation *) &m[1];
995 count = 0; 998 count = 0;
996 va_start (ap, peer); 999 va_start (ap, scope);
997 while (GNUNET_ATS_PREFERENCE_END != 1000 while (GNUNET_ATS_PREFERENCE_END !=
998 (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind))) 1001 (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind)))
999 { 1002 {