diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-08-23 07:04:25 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-08-23 07:04:25 +0000 |
commit | 5a5839a733897f3d9f7ae693843bc8b606a4ac13 (patch) | |
tree | 63a39232f480c41608a543ff3de443daef2786df /src/transport/plugin_transport_template.c | |
parent | 2293523b6627b8c0b04799371683ebb6894383ee (diff) | |
download | gnunet-5a5839a733897f3d9f7ae693843bc8b606a4ac13.tar.gz gnunet-5a5839a733897f3d9f7ae693843bc8b606a4ac13.zip |
update template with latest api changes
Diffstat (limited to 'src/transport/plugin_transport_template.c')
-rw-r--r-- | src/transport/plugin_transport_template.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_template.c b/src/transport/plugin_transport_template.c index 10ce0da48..1f0cc5fbb 100644 --- a/src/transport/plugin_transport_template.c +++ b/src/transport/plugin_transport_template.c | |||
@@ -256,7 +256,43 @@ template_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) | |||
256 | } | 256 | } |
257 | 257 | ||
258 | 258 | ||
259 | /** | ||
260 | * Function called to convert a string address to | ||
261 | * a binary address. | ||
262 | * | ||
263 | * @param cls closure ('struct Plugin*') | ||
264 | * @param addr string address | ||
265 | * @param addrlen length of the address | ||
266 | * @param buf location to store the buffer | ||
267 | * @param added location to store the number of bytes in the buffer. | ||
268 | * If the function returns GNUNET_SYSERR, its contents are undefined. | ||
269 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | ||
270 | */ | ||
271 | static int | ||
272 | template_plugin_string_to_address (void *cls, const char *addr, uint16_t addrlen, | ||
273 | void **buf, size_t *added) | ||
274 | { | ||
275 | GNUNET_break (0); | ||
276 | return GNUNET_SYSERR; | ||
277 | } | ||
278 | |||
259 | 279 | ||
280 | /** | ||
281 | * Create a new session to transmit data to the target | ||
282 | * This session will used to send data to this peer and the plugin will | ||
283 | * notify us by calling the env->session_end function | ||
284 | * | ||
285 | * @param cls closure | ||
286 | * @param address pointer to the GNUNET_HELLO_Address | ||
287 | * @return the session if the address is valid, NULL otherwise | ||
288 | */ | ||
289 | static struct Session * | ||
290 | template_plugin_get_session (void *cls, | ||
291 | const struct GNUNET_HELLO_Address *address) | ||
292 | { | ||
293 | GNUNET_break (0); | ||
294 | return NULL; | ||
295 | } | ||
260 | 296 | ||
261 | /** | 297 | /** |
262 | * Entry point for the plugin. | 298 | * Entry point for the plugin. |
@@ -277,6 +313,9 @@ gnunet_plugin_transport_template_init (void *cls) | |||
277 | api->address_pretty_printer = &template_plugin_address_pretty_printer; | 313 | api->address_pretty_printer = &template_plugin_address_pretty_printer; |
278 | api->check_address = &template_plugin_address_suggested; | 314 | api->check_address = &template_plugin_address_suggested; |
279 | api->address_to_string = &template_plugin_address_to_string; | 315 | api->address_to_string = &template_plugin_address_to_string; |
316 | api->string_to_address = &template_plugin_string_to_address; | ||
317 | api->get_session = &template_plugin_get_session; | ||
318 | |||
280 | return api; | 319 | return api; |
281 | } | 320 | } |
282 | 321 | ||