*/
typedef void
(*GNUNET_TRANSPORT_SessionEnd) (void *cls,
- const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_HELLO_Address *address,
struct Session *session);
/**
- * Function that will be called whenever the plugin internally
- * creates a new session and hence transport need to tell ATS.
- * This happens when we have a inbound connection we did not
- * initiate.
+ * Plugin tells transport service about a new inbound session
*
- * @param cls closure
- * @param peer peer
- * @param plugin plugin
- * @param address address
- * @param address_len length of the @a address
- * @param session session
- * @param ats ATS information
- * @param ats_count number of entries in @a ats array
+ * @param cls unused
+ * @param address the address
+ * @param session the new session
+ * @param ats ats information
+ * @param ats_count number of @a ats information
*/
typedef void
(*GNUNET_TRANSPORT_SessionStart) (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- const char *plugin,
- const void *address,
- uint16_t address_len,
+ struct GNUNET_HELLO_Address *address,
struct Session *session,
const struct GNUNET_ATS_Information *ats,
uint32_t ats_count);
*/
typedef struct GNUNET_TIME_Relative
(*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- struct Session *session,
- const char *sender_address,
- uint16_t sender_address_len);
+ const struct GNUNET_HELLO_Address *address,
+ struct Session *session,
+ const struct GNUNET_MessageHeader *message);
/**
*/
typedef void
(*GNUNET_TRANSPORT_UpdateAddressMetrics) (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- const void *address,
- uint16_t address_len,
+ const struct GNUNET_HELLO_Address *address,
struct Session *session,
const struct GNUNET_ATS_Information *ats,
uint32_t ats_count);
* @param cls closure
* @param add_remove should the address added (#GNUNET_YES) or removed (#GNUNET_NO) from the
* set of valid addresses?
- * @param addr one of the addresses of the host
- * the specific address format depends on the transport
- * @param addrlen length of the @a addr
- * @param dest_plugin plugin to use this address with
+ * @param address the address to add or remove
*/
typedef void
-(*GNUNET_TRANSPORT_AddressNotification) (void *cls,
- int add_remove,
- const void *addr,
- size_t addrlen,
- const char *dest_plugin);
+(*GNUNET_TRANSPORT_AddressNotification) (void *cls, int add_remove,
+ const struct GNUNET_HELLO_Address *address);
/**
const struct GNUNET_PeerIdentity *peer,
size_t amount_recved);
+typedef void
+(*GNUNET_TRANSPORT_RegisterQuotaNotification) (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ const char *plugin,
+ struct Session *session);
+
+typedef void
+(*GNUNET_TRANSPORT_UnregisterQuotaNotification) (void *cls,
+ const struct GNUNET_PeerIdentity *peer, const char *plugin, struct Session *session);
/**
* Function that returns a HELLO message.
*/
GNUNET_TRANSPORT_UpdateAddressMetrics update_address_metrics;
+ GNUNET_TRANSPORT_RegisterQuotaNotification register_quota_notification;
+
+ GNUNET_TRANSPORT_UnregisterQuotaNotification unregister_quota_notification;
/**
* What is the maximum number of connections that this transport
* each human-readable address obtained.
*
* @param cls closure
- * @param address one of the names for the host, NULL
- * on the last call to the callback
+ * @param address one of the names for the host, NULL on last callback
+ * @param res GNUNET_OK if conversion was successful, GNUNET_SYSERR on failure,
+ * GNUNET_OK on last callback
*/
typedef void
(*GNUNET_TRANSPORT_AddressStringCallback) (void *cls,
- const char *address);
+ const char *address,
+ int res);
/**
const struct GNUNET_PeerIdentity *peer,
struct Session *session);
+
+
+typedef void
+(*GNUNET_TRANSPORT_UpdateInboundDelay) (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ struct Session *session,
+ struct GNUNET_TIME_Relative delay);
+
/**
* Function called for a quick conversion of the binary address to
* a numeric address. Note that the caller must not free the
*/
GNUNET_TRANSPORT_UpdateSessionTimeout update_session_timeout;
+ GNUNET_TRANSPORT_UpdateInboundDelay update_inbound_delay;
+
+ /**
+ * Function that will be called whenever the transport service wants to
+ * notify the plugin that the inbound quota changed and that the plugin
+ * should update it's delay for the next receive value
+ */
+ //GNUNET_TRANSPORT_UpdateNextReceiveTimeout update_next_receive_timeout;
+
/**
* Function that is used to query keepalive factor.
* GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to
GNUNET_TRANSPORT_QueryKeepaliveFactorFunction query_keepalive_factor;
/**
- * Function to pretty-print addresses. NOTE: this function is not
- * yet used by transport-service, but will be used in the future
- * once the transport-API has been completed.
+ * Function to pretty-print addresses.
*/
GNUNET_TRANSPORT_AddressPrettyPrinter address_pretty_printer;
};
+/*#ifndef PLUGIN_TRANSPORT_H*/
#endif
+/* end of gnunet_transport_plugin.h */