/**
* Test ats info
*/
-struct GNUNET_ATS_Information test_ats_info[2];
+struct GNUNET_ATS_Information test_ats_info[3];
/**
* Test ats count
}
static void
-address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address,
- struct Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
- const struct GNUNET_ATS_Information *atsi, uint32_t ats_count)
+address_suggest_cb (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_HELLO_Address *address,
+ struct Session *session,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
+ const struct GNUNET_ATS_Information *atsi,
+ uint32_t ats_count)
{
int c;
double pref_val;
- int prefs[GNUNET_ATS_PreferenceCount] = GNUNET_ATS_PreferenceType;
-
if (NULL == perf_ats)
return;
for (c = 1; c < GNUNET_ATS_PreferenceCount; c++)
{
pref_val = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 10);
GNUNET_ATS_performance_change_preference (perf_ats,
- &test_hello_address.peer, prefs[c], pref_val,
+ &test_hello_address.peer, GNUNET_ATS_PREFERENCE_LATENCY, pref_val,
GNUNET_ATS_PREFERENCE_END);
}
}
test_ats_info[0].value = htonl (GNUNET_ATS_NET_WAN);
test_ats_info[1].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
test_ats_info[1].value = htonl (1);
- test_ats_count = 2;
+ test_ats_info[2].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
+ test_ats_info[2].value = htonl (100);
+ test_ats_count = 3;
/* Adding address without session */
test_session = NULL;
/* Adding address */
GNUNET_ATS_address_add (sched_ats, &test_hello_address, test_session,
test_ats_info, test_ats_count);
- GNUNET_ATS_suggest_address(sched_ats, &test_hello_address.peer);
+ GNUNET_ATS_suggest_address(sched_ats, &test_hello_address.peer, NULL, NULL);
}
int