From 933084f007e0ec3d7a73e85ddd1b0b0b62da6f6e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 4 Aug 2011 21:11:17 +0000 Subject: [PATCH] improved neighbour API --- .../gnunet-service-transport_neighbours.h | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index 914134ac5..5473a80db 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h @@ -31,10 +31,7 @@ #include "gnunet_util_lib.h" // TODO: -// - have a way to access the currently 'connected' session -// (for sending and to notice disconnect of it!) -// - have a way to access/update bandwidth/quota information per peer -// (for CostReport/TrafficReport callbacks) +// - ATS and similar info is a bit lacking in the API right now... @@ -77,6 +74,42 @@ int GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); +/** + * Function called after the transmission is done. + * + * @param cls closure + * @param success GNUNET_OK on success, GNUNET_NO on failure + */ +typedef void (*GST_NeighbourSendContinuation)(void *cls, + int success); + + +/** + * Transmit a message to the given target using the active connection. + * + * @param target destination + * @param msg message to send + * @param cont function to call when done + * @param cont_cls closure for 'cont' + */ +void +GST_neighbours_send (const struct GNUNET_PeerIdentity *target, + const struct GNUNET_MessageHeader *msg, + GST_NeighbourSendContinuation cont, + void *cont_cls); + +/** + * Change the quota for the given peer. + * FIXME: inbound or outbound quota? + * + * @param neighbour identity of peer to change qutoa for + * @param quota new quota FIXME: fix type! + */ +void +GST_neighbours_set_quota (const struct GNUNET_PeerIdentity *neighbour, + const float quota); + + /** * If we have an active connection to the given target, it must be shutdown. * -- 2.25.1