From: Christian Grothoff Date: Fri, 3 Jun 2011 22:15:09 +0000 (+0000) Subject: stuff X-Git-Tag: initial-import-from-subversion-38251~18342 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2d6e9a9f1135bf0c673cb0de48c9bcad1a065993;p=oweals%2Fgnunet.git stuff --- diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 8d1eb2921..98ef8c229 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h @@ -490,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. @@ -503,9 +515,7 @@ 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); /** diff --git a/src/transport/transport.h b/src/transport/transport.h index 343679b2e..237908581 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -181,6 +181,30 @@ struct QuotaSetMessage }; +/** + * Message used to ask the transport service to create a connection. + */ +struct TryConnectMessage +{ + + /** + * Type will be GNUNET_MESSAGE_TYPE_TRANSPORT_TRY_CONNECT + */ + struct GNUNET_MessageHeader header; + + /** + * for alignment + */ + uint32_t reserved; + + /** + * About which peer are we talking here? + */ + struct GNUNET_PeerIdentity peer; + +}; + + /** * Message used to notify the transport API about a message * received from the network. The actual message follows. diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index ef846c147..d2e90d726 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c @@ -972,7 +972,8 @@ GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, sqc->quota_in = quota_in; schedule_control_transmit (handle, sizeof (struct QuotaSetMessage), - GNUNET_NO, timeout, &send_set_quota, sqc); + GNUNET_NO, + GNUNET_TIME_UNIT_FOREVER_REL, &send_set_quota, sqc); }