X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_transport_service.h;h=24b9e90af32e0f599927c56016a45c6d882729ce;hb=fc49f1b524fce53459692ddffe05474876e4969c;hp=a72a3b4673c92d17bfb56e46f5d68661e6844634;hpb=4759a55fd2bba8b4aabef3ef361c8c6183fbe3e5;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index a72a3b467..24b9e90af 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h @@ -390,27 +390,6 @@ struct GNUNET_TRANSPORT_ATS_Information uint32_t value; }; -/* Minimum time between to calculations*/ -#define ATS_MIN_INTERVAL GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS,250) -#define ATS_EXEC_INTERVAL GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS,1) - -#define DEBUG_ATS GNUNET_NO - -struct ATS_info -{ - struct GNUNET_CONTAINER_MultiHashMap * peers; - struct GNUNET_TIME_Absolute last; - struct GNUNET_TIME_Relative min_delta; - struct GNUNET_TIME_Relative reg_delta; - - GNUNET_SCHEDULER_TaskIdentifier ats_task; -}; - -struct ATS_peer -{ - struct GNUNET_PeerIdentity peer; -}; - /** @@ -511,6 +490,18 @@ struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); +/** + * Ask the transport service to establish a connection to + * the given peer. + * + * @param handle connection to transport service + * @param target who we should try to connect to + */ +void +GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, + const struct GNUNET_PeerIdentity *target); + + /** * Set the share of incoming/outgoing bandwidth for the given * peer to the specified amount. @@ -519,19 +510,12 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); * @param target who's bandwidth quota is being changed * @param quota_in incoming bandwidth quota * @param quota_out outgoing bandwidth quota - * @param timeout how long to wait until signaling failure if - * we can not communicate the quota change - * @param cont continuation to call when done, will be called - * either with reason "TIMEOUT" or with reason "PREREQ_DONE" - * @param cont_cls closure for continuation */ void GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, const struct GNUNET_PeerIdentity *target, struct GNUNET_BANDWIDTH_Value32NBO quota_in, - struct GNUNET_BANDWIDTH_Value32NBO quota_out, - struct GNUNET_TIME_Relative timeout, - GNUNET_SCHEDULER_Task cont, void *cont_cls); + struct GNUNET_BANDWIDTH_Value32NBO quota_out); /** @@ -574,12 +558,12 @@ struct GNUNET_TRANSPORT_TransmitHandle /** * Cancel the specified transmission-ready notification. * - * @param h handle of the transmission notification request to cancel + * @param th handle of the transmission notification request to cancel */ void GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct GNUNET_TRANSPORT_TransmitHandle - *h); + *th); @@ -661,7 +645,36 @@ GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_TRANSPORT_AddressLookUpCallback aluc, void *aluc_cls); +/** + * Return all the known addresses for a peer. + * + * @param cfg configuration to use + * @param peer peer identity to look up the addresses of + * @param timeout how long is the lookup allowed to take at most + * @param peer_address_callback function to call with the results + * @param peer_address_callback_cls closure for peer_address_callback + */ +void +GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_PeerIdentity *peer, + struct GNUNET_TIME_Relative timeout, + GNUNET_TRANSPORT_AddressLookUpCallback peer_address_callback, + void *peer_address_callback_cls); + +/** + * Return all the known addresses for a peer. + * + * @param cfg configuration to use + * @param timeout how long is the lookup allowed to take at most + * @param peer_address_callback function to call with the results + * @param peer_address_callback_cls closure for peer_address_callback + */ +void +GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_TIME_Relative timeout, + GNUNET_TRANSPORT_AddressLookUpCallback peer_address_callback, + void *peer_address_callback_cls); /** * Handle for blacklisting peers.