From 2298d22222e000529c668e16d239ea24076b251a Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 28 Sep 2010 15:53:26 +0000 Subject: [PATCH] Added cost_report to plugin environment for ATS --- src/transport/plugin_transport.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/transport/plugin_transport.h b/src/transport/plugin_transport.h index 546b2ad7f..57e446193 100644 --- a/src/transport/plugin_transport.h +++ b/src/transport/plugin_transport.h @@ -35,6 +35,8 @@ #include "gnunet_scheduler_lib.h" #include "gnunet_statistics_service.h" #include "gnunet_transport_service.h" +#include "transport_selection.h" + /** * Opaque pointer that plugins can use to distinguish specific @@ -158,6 +160,23 @@ typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_TrafficReport) (void *cls size_t amount_recved); +/** + * Function called whenever the plugin has to notify ATS about costs for using this transport + * + * The cost will be passed as struct GNUNET_ATS_Cost_Information[] + * This array is 0-terminated, so the last element will be a pair: + * ((cost->cost_type==GNUNET_ATS_ARRAY_TERMINATOR) && cost->cost_value==0)) + * + * @param cls closure + * @param peer peer + * @param cost pointer to the first element of struct GNUNET_ATS_Cost_Information[] + */ +typedef void (*GNUNET_TRANSPORT_CostReport) (void *cls, + const struct GNUNET_PeerIdentity *peer, + const void *addr, + uint16_t addrlen, + struct GNUNET_ATS_Cost_Information * cost); + /** * The transport service will pass a pointer to a struct * of this type as the first and only argument to the @@ -221,6 +240,11 @@ struct GNUNET_TRANSPORT_PluginEnvironment */ GNUNET_TRANSPORT_SessionEnd session_end; + /** + * Inform service about costs for using this transport plugin + */ + GNUNET_TRANSPORT_CostReport cost_report; + /** * What is the maximum number of connections that this transport * should allow? Transports that do not have sessions (such as -- 2.25.1