aboutsummaryrefslogtreecommitdiff
path: root/src/ats/ats_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-12 11:09:57 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-12 11:09:57 +0000
commit3117f4738bd6c23ac8af5893ba26ac1c86736608 (patch)
tree8b9358aeaa04f06eb7a7e6894d0e6bdcd6731823 /src/ats/ats_api.c
parent55e8339431dbd7e0d426662376f9a65ea518955b (diff)
downloadgnunet-3117f4738bd6c23ac8af5893ba26ac1c86736608.tar.gz
gnunet-3117f4738bd6c23ac8af5893ba26ac1c86736608.zip
add address timeout
Diffstat (limited to 'src/ats/ats_api.c')
-rw-r--r--src/ats/ats_api.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/ats/ats_api.c b/src/ats/ats_api.c
index 8609ac5a5..36b215e5b 100644
--- a/src/ats/ats_api.c
+++ b/src/ats/ats_api.c
@@ -179,12 +179,24 @@ count_connections (void *cls,
179 return GNUNET_YES; 179 return GNUNET_YES;
180} 180}
181 181
182
183/**
184 * Closure for 'set_bw_connections'.
185 */
182struct SetBandwidthContext 186struct SetBandwidthContext
183{ 187{
188 /**
189 * ATS handle.
190 */
184 struct GNUNET_ATS_Handle *atc; 191 struct GNUNET_ATS_Handle *atc;
192
193 /**
194 * Bandwidth to assign.
195 */
185 struct GNUNET_BANDWIDTH_Value32NBO bw; 196 struct GNUNET_BANDWIDTH_Value32NBO bw;
186}; 197};
187 198
199
188/** 200/**
189 * Set bandwidth based on record. 201 * Set bandwidth based on record.
190 * 202 *
@@ -303,9 +315,9 @@ suggest_address (void *cls,
303 */ 315 */
304struct GNUNET_ATS_SuggestionContext * 316struct GNUNET_ATS_SuggestionContext *
305GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc, 317GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc,
306 const struct GNUNET_PeerIdentity *peer, 318 const struct GNUNET_PeerIdentity *peer,
307 GNUNET_ATS_AddressSuggestionCallback cb, 319 GNUNET_ATS_AddressSuggestionCallback cb,
308 void *cb_cls) 320 void *cb_cls)
309{ 321{
310 struct GNUNET_ATS_SuggestionContext *asc; 322 struct GNUNET_ATS_SuggestionContext *asc;
311 323
@@ -357,8 +369,8 @@ GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc)
357 */ 369 */
358struct GNUNET_ATS_Handle * 370struct GNUNET_ATS_Handle *
359GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg, 371GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
360 GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb, 372 GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
361 void *alloc_cb_cls) 373 void *alloc_cb_cls)
362{ 374{
363 struct GNUNET_ATS_Handle *atc; 375 struct GNUNET_ATS_Handle *atc;
364 376
@@ -690,8 +702,8 @@ destroy_session (void *cls,
690 */ 702 */
691void 703void
692GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, 704GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc,
693 const struct GNUNET_PeerIdentity *peer, 705 const struct GNUNET_PeerIdentity *peer,
694 const struct Session *session) 706 const struct Session *session)
695{ 707{
696 struct SessionDestroyContext sdc; 708 struct SessionDestroyContext sdc;
697 709
@@ -741,6 +753,7 @@ notify_valid (void *cls,
741 * @param atc handle 753 * @param atc handle
742 * @param public_key public key of the peer 754 * @param public_key public key of the peer
743 * @param peer identity of the peer 755 * @param peer identity of the peer
756 * @param valid_until how long is the address valid?
744 * @param plugin_name name of the transport plugin 757 * @param plugin_name name of the transport plugin
745 * @param session session handle (if available) 758 * @param session session handle (if available)
746 * @param plugin_addr address (if available) 759 * @param plugin_addr address (if available)
@@ -752,6 +765,7 @@ void
752GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, 765GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
753 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key, 766 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
754 const struct GNUNET_PeerIdentity *peer, 767 const struct GNUNET_PeerIdentity *peer,
768 struct GNUNET_TIME_Absolute valid_until,
755 const char *plugin_name, 769 const char *plugin_name,
756 struct Session *session, 770 struct Session *session,
757 const void *plugin_addr, 771 const void *plugin_addr,