aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-10 10:59:00 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-10 10:59:00 +0000
commit107b3a706cf4d2f0276fb7534a846de5d36a73a9 (patch)
tree755562cc41715e13946a09b2aad4ba2086f05981 /src/include
parent98aa0c158ee5cf82097432eff4cd15da2993198d (diff)
downloadgnunet-107b3a706cf4d2f0276fb7534a846de5d36a73a9.tar.gz
gnunet-107b3a706cf4d2f0276fb7534a846de5d36a73a9.zip
adding change preference API to ATS
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_ats_service.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h
index 5e302da5c..eb785afdd 100644
--- a/src/include/gnunet_ats_service.h
+++ b/src/include/gnunet_ats_service.h
@@ -243,5 +243,77 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
243 uint32_t ats_count); 243 uint32_t ats_count);
244 244
245 245
246
247/**
248 * Function called with perference change information about the given peer.
249 *
250 * @param cls closure
251 * @param peer identifies the peer
252 * @param amount set to the amount that was actually reserved or unreserved;
253 * either the full requested amount or zero (no partial reservations)
254 * @param res_delay if the reservation could not be satisfied (amount was 0), how
255 * long should the client wait until re-trying?
256 */
257typedef void (*GNUNET_ATS_PeerConfigurationInfoCallback) (void *cls,
258 const struct
259 GNUNET_PeerIdentity *
260 peer,
261 int32_t amount,
262 struct
263 GNUNET_TIME_Relative
264 res_delay);
265
266
267
268/**
269 * Context that can be used to cancel a peer information request.
270 */
271struct GNUNET_ATS_InformationRequestContext;
272
273
274/**
275 * Obtain statistics and/or change preferences for the given peer.
276 * You can only have one such pending request per peer.
277 *
278 * @param h core handle
279 * @param peer identifies the peer
280 * @param amount reserve N bytes for receiving, negative
281 * amounts can be used to undo a (recent) reservation;
282 * @param preference increase incoming traffic share preference by this amount;
283 * in the absence of "amount" reservations, we use this
284 * preference value to assign proportional bandwidth shares
285 * to all connected peers
286 * @param info function to call with the resulting configuration information
287 * @param info_cls closure for info
288 * @return NULL on error
289 * @deprecated will be replaced soon
290 */
291struct GNUNET_ATS_InformationRequestContext *
292GNUNET_ATS_peer_change_preference (struct GNUNET_ATS_Handle *h,
293 const struct GNUNET_PeerIdentity *peer,
294 int32_t amount, uint64_t preference,
295 GNUNET_ATS_PeerConfigurationInfoCallback
296 info, void *info_cls);
297
298
299/**
300 * Cancel request for getting information about a peer.
301 * Note that an eventual change in preference, trust or bandwidth
302 * assignment MAY have already been committed at the time,
303 * so cancelling a request is NOT sure to undo the original
304 * request. The original request may or may not still commit.
305 * The only thing cancellation ensures is that the callback
306 * from the original request will no longer be called.
307 *
308 * @param irc context returned by the original GNUNET_ATS_peer_get_info call
309 * @deprecated will be replaced soon
310 */
311void
312GNUNET_ATS_peer_change_preference_cancel (struct
313 GNUNET_ATS_InformationRequestContext
314 *irc);
315
316
317
246#endif 318#endif
247/* end of file gnunet-service-transport_ats.h */ 319/* end of file gnunet-service-transport_ats.h */