return GNUNET_YES;
}
+
+/**
+ * Closure for 'set_bw_connections'.
+ */
struct SetBandwidthContext
{
+ /**
+ * ATS handle.
+ */
struct GNUNET_ATS_Handle *atc;
+
+ /**
+ * Bandwidth to assign.
+ */
struct GNUNET_BANDWIDTH_Value32NBO bw;
};
+
/**
* Set bandwidth based on record.
*
*/
struct GNUNET_ATS_SuggestionContext *
GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc,
- const struct GNUNET_PeerIdentity *peer,
- GNUNET_ATS_AddressSuggestionCallback cb,
- void *cb_cls)
+ const struct GNUNET_PeerIdentity *peer,
+ GNUNET_ATS_AddressSuggestionCallback cb,
+ void *cb_cls)
{
struct GNUNET_ATS_SuggestionContext *asc;
*/
struct GNUNET_ATS_Handle *
GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
- void *alloc_cb_cls)
+ GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
+ void *alloc_cb_cls)
{
struct GNUNET_ATS_Handle *atc;
*/
void
GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc,
- const struct GNUNET_PeerIdentity *peer,
- const struct Session *session)
+ const struct GNUNET_PeerIdentity *peer,
+ const struct Session *session)
{
struct SessionDestroyContext sdc;
* @param atc handle
* @param public_key public key of the peer
* @param peer identity of the peer
+ * @param valid_until how long is the address valid?
* @param plugin_name name of the transport plugin
* @param session session handle (if available)
* @param plugin_addr address (if available)
GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_TIME_Absolute valid_until,
const char *plugin_name,
struct Session *session,
const void *plugin_addr,
* @param atc handle
* @param public_key public key of the peer
* @param peer identity of the new peer
+ * @param valid_until how long is the address valid?
* @param plugin_name name of the transport plugin
* @param session session handle (if available)
* @param plugin_addr address (if available)
GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key,
const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_TIME_Absolute valid_until,
const char *plugin_name,
struct Session *session,
const void *plugin_addr,
ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until,
expiration);
GNUNET_ATS_address_update (GST_ats,
- &public_key,
- &pid,
- tname,
- NULL,
- addr,
- addrlen,
- NULL, 0);
+ &public_key,
+ &pid,
+ ve->valid_until,
+ tname,
+ NULL,
+ addr,
+ addrlen,
+ NULL, 0);
return GNUNET_OK;
}
/* validity achieved, remember it! */
ve->valid_until = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION);
GNUNET_ATS_address_update (GST_ats,
- &ve->public_key,
- &ve->pid,
- ve->transport_name,
- NULL,
- ve->addr,
- ve->addrlen,
- NULL, 0); /* FIXME: compute and add latency here... */
+ &ve->public_key,
+ &ve->pid,
+ ve->valid_until,
+ ve->transport_name,
+ NULL,
+ ve->addr,
+ ve->addrlen,
+ NULL, 0); /* FIXME: compute and add latency here... */
/* build HELLO to store in PEERINFO */
hello = GNUNET_HELLO_create (&ve->public_key,