aboutsummaryrefslogtreecommitdiff
path: root/src/ats/ats_api_scheduling.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-09 14:09:29 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-09 14:09:29 +0000
commit9f0dcc2fb248ea2507832ab999739359ee1dbf60 (patch)
treea9d05435fd949a479862fb6a898dc2a57f2a6da5 /src/ats/ats_api_scheduling.c
parent2de6e2211c31d2911c7d1dc6d445a41fd9ae3429 (diff)
downloadgnunet-9f0dcc2fb248ea2507832ab999739359ee1dbf60.tar.gz
gnunet-9f0dcc2fb248ea2507832ab999739359ee1dbf60.zip
extending ATS api suggest callback with peer id
adding suggest continuation
Diffstat (limited to 'src/ats/ats_api_scheduling.c')
-rw-r--r--src/ats/ats_api_scheduling.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 7750ad1cf..d23de8940 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -656,7 +656,9 @@ process_ats_message (void *cls, const struct GNUNET_MessageHeader *msg)
656 return; 656 return;
657 } 657 }
658 658
659 sh->suggest_cb (sh->suggest_cb_cls, &address, s, m->bandwidth_out, 659 sh->suggest_cb (sh->suggest_cb_cls,
660 (const struct GNUNET_PeerIdentity *) &m->peer,
661 &address, s, m->bandwidth_out,
660 m->bandwidth_in, atsi, ats_count); 662 m->bandwidth_in, atsi, ats_count);
661 663
662 GNUNET_CLIENT_receive (sh->client, &process_ats_message, sh, 664 GNUNET_CLIENT_receive (sh->client, &process_ats_message, sh,
@@ -1055,16 +1057,23 @@ GNUNET_ATS_reset_backoff (struct GNUNET_ATS_SchedulingHandle *sh,
1055} 1057}
1056 1058
1057/** 1059/**
1058 * We would like to establish a new connection with a peer. ATS 1060 * We would like to receive address suggestions for a peer. ATS will
1059 * should suggest a good address to begin with. 1061 * respond with a call to the continuation immediately containing an address or
1062 * no address if none is available. ATS can suggest more addresses until we call
1063 * #GNUNET_ATS_suggest_address_cancel.
1064 *
1060 * 1065 *
1061 * @param sh handle 1066 * @param sh handle
1062 * @param peer identity of the peer we need an address for 1067 * @param peer identity of the peer we need an address for
1068 * @param cont the continuation to call with the address
1069 * @param cont_cls the cls for the continuation
1063 * @return suggest handle 1070 * @return suggest handle
1064 */ 1071 */
1065struct GNUNET_ATS_SuggestHandle * 1072struct GNUNET_ATS_SuggestHandle *
1066GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh, 1073GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh,
1067 const struct GNUNET_PeerIdentity *peer) 1074 const struct GNUNET_PeerIdentity *peer,
1075 GNUNET_ATS_AddressSuggestionCallback cont,
1076 void *cont_cls)
1068{ 1077{
1069 struct PendingMessage *p; 1078 struct PendingMessage *p;
1070 struct RequestAddressMessage *m; 1079 struct RequestAddressMessage *m;