aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_plugins.c
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.c
parent58cc7545c068d1deb7f7085822646313d5271b0f (diff)
downloadgnunet-3ba21d7f05658f4c9a090a41ffbe04c6729d0916.tar.gz
gnunet-3ba21d7f05658f4c9a090a41ffbe04c6729d0916.zip
implementing new HELLO api
Diffstat (limited to 'src/transport/gnunet-service-transport_plugins.c')
-rw-r--r--src/transport/gnunet-service-transport_plugins.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_plugins.c b/src/transport/gnunet-service-transport_plugins.c
new file mode 100644
index 000000000..0db7120fd
--- /dev/null
+++ b/src/transport/gnunet-service-transport_plugins.c
@@ -0,0 +1,94 @@
1/*
2 This file is part of GNUnet.
3 (C) 2010,2011 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/**
22 * @file transport/gnunet-service-transport_plugins.c
23 * @brief plugin management
24 * @author Christian Grothoff
25 */
26#include "platform.h"
27#include "gnunet-service-transport_plugins.h"
28
29
30/**
31 * Load and initialize all plugins. The respective functions will be
32 * invoked by the plugins when the respective events happen. The
33 * closure will be set to a 'const char*' containing the name of the
34 * plugin that caused the call.
35 *
36 * @param recv_cb function to call when data is received
37 * @param address_cb function to call when our public addresses changed
38 * @param traffic_cb function to call for flow control
39 * @param session_end_cb function to call when a session was terminated
40 * @param cost_cb function to call about ATS cost changes
41 * @return GNUNET_OK on success
42 */
43int
44GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
45 GNUNET_TRANSPORT_AddressNotification address_cb,
46 GNUNET_TRANSPORT_TrafficReport traffic_cb,
47 GNUNET_TRANSPORT_SessionEnd session_end_cb,
48 GNUNET_TRANSPORT_CostReport cost_cb)
49{
50 return GNUNET_SYSERR;
51}
52
53
54/**
55 * Unload all plugins
56 */
57void
58GST_plugins_unload ()
59{
60}
61
62
63/**
64 * Obtain the plugin API based on a plugin name.
65 *
66 * @param name name of the plugin
67 * @return the plugin's API, NULL if the plugin is not loaded
68 */
69struct GNUNET_TRANSPORT_PluginFunctions *
70GST_plugins_find (const char *name)
71{
72 return NULL;
73}
74
75
76/**
77 * Convert a given address to a human-readable format. Note that the
78 * return value will be overwritten on the next call to this function.
79 *
80 * @param name plugin name
81 * @param addr binary address in plugin-specific format
82 * @param addrlen number of bytes in 'addr'
83 * @return statically allocated (!) human-readable address
84 */
85const char *
86GST_plugins_a2s (const char *name,
87 const void *addr,
88 size_t addrlen)
89{
90 return "FIXME";
91}
92
93
94/* end of file gnunet-service-transport_plugins.c */