diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-02-02 17:51:46 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-02-02 17:51:46 +0000 |
commit | fe56554d28b2e277cde55f6146a54ce158340405 (patch) | |
tree | c0d1adcb3bf3487c1aaa18591864524011dfaaef /src/include/gnunet_transport_service.h | |
parent | 769c3e9561ea577ca167c74286a5cd092510a5cb (diff) | |
download | gnunet-fe56554d28b2e277cde55f6146a54ce158340405.tar.gz gnunet-fe56554d28b2e277cde55f6146a54ce158340405.zip |
add API for #3296
Diffstat (limited to 'src/include/gnunet_transport_service.h')
-rw-r--r-- | src/include/gnunet_transport_service.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index d4948e5ba..b7da1ba03 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -366,7 +366,6 @@ typedef void | |||
366 | * NULL for disconnect notification in monitor mode | 366 | * NULL for disconnect notification in monitor mode |
367 | * @param valid_until when does this address expire | 367 | * @param valid_until when does this address expire |
368 | * @param next_validation time of the next validation operation | 368 | * @param next_validation time of the next validation operation |
369 | * | ||
370 | */ | 369 | */ |
371 | typedef void | 370 | typedef void |
372 | (*GNUNET_TRANSPORT_ValidationIterateCallback) (void *cls, | 371 | (*GNUNET_TRANSPORT_ValidationIterateCallback) (void *cls, |
@@ -401,6 +400,49 @@ GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
401 | 400 | ||
402 | 401 | ||
403 | /** | 402 | /** |
403 | * Function called if we have "excess" bandwidth to a peer. | ||
404 | * The notification will happen the first time we have excess | ||
405 | * bandwidth, and then only again after the client has performed | ||
406 | * some transmission to the peer. | ||
407 | * | ||
408 | * Excess bandwidth is defined as being allowed (by ATS) to send | ||
409 | * more data, and us reaching the limit of the capacity build-up | ||
410 | * (which, if we go past it, means we don't use available bandwidth). | ||
411 | * See also the "max carry" in `struct GNUNET_BANDWIDTH_Tracker`. | ||
412 | * | ||
413 | * @param cls the closure | ||
414 | * @param peer peer that we have excess bandwidth to | ||
415 | */ | ||
416 | typedef void | ||
417 | (*GNUNET_TRANSPORT_NotifyExcessBandwidth)(void *cls, | ||
418 | const struct GNUNET_PeerIdentity *neighbour); | ||
419 | |||
420 | |||
421 | /** | ||
422 | * Connect to the transport service. Note that the connection may | ||
423 | * complete (or fail) asynchronously. | ||
424 | * | ||
425 | * @param cfg configuration to use | ||
426 | * @param self our own identity (API should check that it matches | ||
427 | * the identity found by transport), or NULL (no check) | ||
428 | * @param cls closure for the callbacks | ||
429 | * @param rec receive function to call, or NULL | ||
430 | * @param nc function to call on connect events, or NULL | ||
431 | * @param nd function to call on disconnect events, or NULL | ||
432 | * @param neb function to call if we have excess bandwidth to a peer | ||
433 | * @return NULL on error | ||
434 | */ | ||
435 | struct GNUNET_TRANSPORT_Handle * | ||
436 | GNUNET_TRANSPORT_connect2 (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
437 | const struct GNUNET_PeerIdentity *self, | ||
438 | void *cls, | ||
439 | GNUNET_TRANSPORT_ReceiveCallback rec, | ||
440 | GNUNET_TRANSPORT_NotifyConnect nc, | ||
441 | GNUNET_TRANSPORT_NotifyDisconnect nd, | ||
442 | GNUNET_TRANSPORT_NotifyExcessBandwidth neb); | ||
443 | |||
444 | |||
445 | /** | ||
404 | * Disconnect from the transport service. | 446 | * Disconnect from the transport service. |
405 | * | 447 | * |
406 | * @param handle handle returned from connect | 448 | * @param handle handle returned from connect |