summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_plugins.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-04 14:17:40 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-04 14:17:40 +0000
commit3ba21d7f05658f4c9a090a41ffbe04c6729d0916 (patch)
tree2e23aa6d04a917987f393048b7d007e488d7f1a8 /src/transport/gnunet-service-transport_plugins.h
parent58cc7545c068d1deb7f7085822646313d5271b0f (diff)
implementing new HELLO api
Diffstat (limited to 'src/transport/gnunet-service-transport_plugins.h')
-rw-r--r--src/transport/gnunet-service-transport_plugins.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-transport_plugins.h b/src/transport/gnunet-service-transport_plugins.h
index 0d62bbf79..3ad09b7f6 100644
--- a/src/transport/gnunet-service-transport_plugins.h
+++ b/src/transport/gnunet-service-transport_plugins.h
@@ -33,7 +33,17 @@
/**
+ * Load and initialize all plugins. The respective functions will be
+ * invoked by the plugins when the respective events happen. The
+ * closure will be set to a 'const char*' containing the name of the
+ * plugin that caused the call.
*
+ * @param recv_cb function to call when data is received
+ * @param address_cb function to call when our public addresses changed
+ * @param traffic_cb function to call for flow control
+ * @param session_end_cb function to call when a session was terminated
+ * @param cost_cb function to call about ATS cost changes
+ * @return GNUNET_OK on success
*/
int
GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
@@ -44,19 +54,36 @@ GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
/**
- *
+ * Unload all plugins
*/
-int
+void
GST_plugins_unload (void);
/**
+ * Obtain the plugin API based on a plugin name.
*
+ * @param name name of the plugin
+ * @return the plugin's API, NULL if the plugin is not loaded
*/
struct GNUNET_TRANSPORT_PluginFunctions *
GST_plugins_find (const char *name);
+/**
+ * Convert a given address to a human-readable format. Note that the
+ * return value will be overwritten on the next call to this function.
+ *
+ * @param name plugin name
+ * @param addr binary address in plugin-specific format
+ * @param addrlen number of bytes in 'addr'
+ * @return statically allocated (!) human-readable address
+ */
+const char *
+GST_plugins_a2s (const char *name,
+ const void *addr,
+ size_t addrlen);
+
#endif
/* end of file gnunet-service-transport_plugins.h */