diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-10 07:59:58 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-10 07:59:58 +0000 |
commit | e050077cbe2bbd54e53cbfbe81eef7c16d758c7e (patch) | |
tree | b7aa397ddf89f3ffc6642ee4bffbc65502fe81c1 /src/transport/gnunet-service-transport_plugins.c | |
parent | f3ddecf43857f42021779f826a2973e6ca7c289e (diff) | |
download | gnunet-e050077cbe2bbd54e53cbfbe81eef7c16d758c7e.tar.gz gnunet-e050077cbe2bbd54e53cbfbe81eef7c16d758c7e.zip |
check implementation of api while loading plugn
Diffstat (limited to 'src/transport/gnunet-service-transport_plugins.c')
-rw-r--r-- | src/transport/gnunet-service-transport_plugins.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_plugins.c b/src/transport/gnunet-service-transport_plugins.c index 688f701ad..4f2a8ff94 100644 --- a/src/transport/gnunet-service-transport_plugins.c +++ b/src/transport/gnunet-service-transport_plugins.c | |||
@@ -106,6 +106,7 @@ GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, | |||
106 | char *libname; | 106 | char *libname; |
107 | char *plugs; | 107 | char *plugs; |
108 | char *pos; | 108 | char *pos; |
109 | int fail; | ||
109 | 110 | ||
110 | if (GNUNET_OK != | 111 | if (GNUNET_OK != |
111 | GNUNET_CONFIGURATION_get_value_number (GST_cfg, "TRANSPORT", | 112 | GNUNET_CONFIGURATION_get_value_number (GST_cfg, "TRANSPORT", |
@@ -160,6 +161,81 @@ GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, | |||
160 | GNUNET_free (plug->lib_name); | 161 | GNUNET_free (plug->lib_name); |
161 | GNUNET_free (plug); | 162 | GNUNET_free (plug); |
162 | } | 163 | } |
164 | fail = GNUNET_NO; | ||
165 | if (NULL == plug->api->address_pretty_printer) | ||
166 | { | ||
167 | fail = GNUNET_YES; | ||
168 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
169 | _("Missing function `%s' in transport plugin for `%s'\n"), | ||
170 | "address_pretty_printer", | ||
171 | plug->lib_name); | ||
172 | } | ||
173 | if (NULL == plug->api->address_to_string) | ||
174 | { | ||
175 | fail = GNUNET_YES; | ||
176 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
177 | _("Missing function `%s' in transport plugin for `%s'\n"), | ||
178 | "address_to_string", | ||
179 | plug->lib_name); | ||
180 | } | ||
181 | if (NULL == plug->api->string_to_address) | ||
182 | { | ||
183 | fail = GNUNET_YES; | ||
184 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
185 | _("Missing function `%s' in transport plugin for `%s'\n"), | ||
186 | "string_to_address", | ||
187 | plug->lib_name); | ||
188 | } | ||
189 | if (NULL == plug->api->check_address) | ||
190 | { | ||
191 | fail = GNUNET_YES; | ||
192 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
193 | _("Missing function `%s' in transport plugin for `%s'\n"), | ||
194 | "check_address", | ||
195 | plug->lib_name); | ||
196 | } | ||
197 | if (NULL == plug->api->get_session) | ||
198 | { | ||
199 | fail = GNUNET_YES; | ||
200 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
201 | _("Missing function `%s' in transport plugin for `%s'\n"), | ||
202 | "get_session", | ||
203 | plug->lib_name); | ||
204 | } | ||
205 | if (NULL == plug->api->get_network) | ||
206 | { | ||
207 | fail = GNUNET_YES; | ||
208 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
209 | _("Missing function `%s' in transport plugin for `%s'\n"), | ||
210 | "get_network", | ||
211 | plug->lib_name); | ||
212 | } | ||
213 | if (NULL == plug->api->send) | ||
214 | { | ||
215 | fail = GNUNET_YES; | ||
216 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
217 | _("Missing function `%s' in transport plugin for `%s'\n"), | ||
218 | "send", | ||
219 | plug->lib_name); | ||
220 | } | ||
221 | if (NULL == plug->api->disconnect) | ||
222 | { | ||
223 | fail = GNUNET_YES; | ||
224 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
225 | _("Missing function `%s' in transport plugin for `%s'\n"), | ||
226 | "disconnect", | ||
227 | plug->lib_name); | ||
228 | } | ||
229 | if (GNUNET_YES == fail) | ||
230 | { | ||
231 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
232 | _("Did not load plugin `%s' due to missing functions\n"), | ||
233 | plug->lib_name); | ||
234 | GNUNET_CONTAINER_DLL_remove (plugins_head, plugins_tail, plug); | ||
235 | GNUNET_free (plug->short_name); | ||
236 | GNUNET_free (plug->lib_name); | ||
237 | GNUNET_free (plug); | ||
238 | } | ||
163 | } | 239 | } |
164 | } | 240 | } |
165 | 241 | ||