* Signature of a function called by ATS with the current bandwidth
* and address preferences as determined by ATS.
*
+ * If an address is available immediately the address will be included. If no
+ * address can be suggested, address, session, bandwidth and ATS information will
+ * be NULL/0. ATS will suggest an address as soon as it can provide such an
+ * address
+ *
* @param cls closure
* @param address suggested address (including peer identity of the peer)
* @param session session to use
*/
typedef void
(*GNUNET_ATS_AddressSuggestionCallback) (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_HELLO_Address *address, struct Session *session,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
const struct GNUNET_ATS_Information *ats, uint32_t ats_count);
+
/**
* Initialize the ATS subsystem.
*
*
* @param sh handle
* @param peer identity of the peer we need an address for
+ * @param cont the continuation to indicate success to call with the address
+ * @param cont_cls the cls for the continuation
* @return suggestion handle
*/
struct GNUNET_ATS_SuggestHandle *
GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh,
- const struct GNUNET_PeerIdentity *peer);
+ const struct GNUNET_PeerIdentity *peer,
+ GNUNET_ATS_AddressSuggestionCallback cont,
+ void *cont_cls);
/**
/**
- * A session got destroyed, stop including it as a valid address.
+ * An address got destroyed, stop including it as a valid address.
+ *
+ * If a session is given, only the session will be removed, if no session is
+ * given the full address will be deleted.
*
* @param sh handle
* @param address the address