aboutsummaryrefslogtreecommitdiff
path: root/src/dv
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-28 09:50:23 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-28 09:50:23 +0000
commit10985e9e7214f7458b0fdd6d6eceaf7930d90520 (patch)
tree42f8758eece6338e5d31ef686cdb2cdf5ba7cdfd /src/dv
parentf47172b3668a738228d7e5171d64fd01567a4a08 (diff)
downloadgnunet-10985e9e7214f7458b0fdd6d6eceaf7930d90520.tar.gz
gnunet-10985e9e7214f7458b0fdd6d6eceaf7930d90520.zip
-fix
Diffstat (limited to 'src/dv')
-rw-r--r--src/dv/plugin_transport_dv.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c
index 78200e634..8ee49c519 100644
--- a/src/dv/plugin_transport_dv.c
+++ b/src/dv/plugin_transport_dv.c
@@ -197,18 +197,11 @@ handle_dv_message_received (void *cls, struct GNUNET_PeerIdentity *sender,
197 * a message using the plugin. 197 * a message using the plugin.
198 * 198 *
199 * @param cls closure 199 * @param cls closure
200 * @param target who should receive this message 200 * @param session the session used
201 * @param priority how important is the message 201 * @param priority how important is the message
202 * @param msgbuf the message to transmit 202 * @param msgbuf the message to transmit
203 * @param msgbuf_size number of bytes in 'msgbuf' 203 * @param msgbuf_size number of bytes in 'msgbuf'
204 * @param timeout when should we time out 204 * @param timeout when should we time out
205 * @param session the session used
206 * @param addr the address to use (can be NULL if the plugin
207 * is "on its own" (i.e. re-use existing TCP connection))
208 * @param addrlen length of the address in bytes
209 * @param force_address GNUNET_YES if the plugin MUST use the given address,
210 * otherwise the plugin may use other addresses or
211 * existing connections (if available)
212 * @param cont continuation to call once the message has 205 * @param cont continuation to call once the message has
213 * been transmitted (or if the transport is ready 206 * been transmitted (or if the transport is ready
214 * for the next transmission call; or if the 207 * for the next transmission call; or if the
@@ -219,18 +212,21 @@ handle_dv_message_received (void *cls, struct GNUNET_PeerIdentity *sender,
219 * and does NOT mean that the message was not transmitted (DV) 212 * and does NOT mean that the message was not transmitted (DV)
220 */ 213 */
221static ssize_t 214static ssize_t
222dv_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, 215dv_plugin_send (void *cls,
216 struct Session *session,
223 const char *msgbuf, size_t msgbuf_size, unsigned int priority, 217 const char *msgbuf, size_t msgbuf_size, unsigned int priority,
224 struct GNUNET_TIME_Relative timeout, struct Session *session, 218 struct GNUNET_TIME_Relative timeout,
225 const void *addr, size_t addrlen, int force_address,
226 GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls) 219 GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls)
227{ 220{
228 int ret = 0; 221 int ret = -1;
222#if 0
229 struct Plugin *plugin = cls; 223 struct Plugin *plugin = cls;
230 224
231 ret = 225 ret =
232 GNUNET_DV_send (plugin->dv_handle, target, msgbuf, msgbuf_size, priority, 226 GNUNET_DV_send (plugin->dv_handle, &session->sender,
227 msgbuf, msgbuf_size, priority,
233 timeout, addr, addrlen, cont, cont_cls); 228 timeout, addr, addrlen, cont, cont_cls);
229#endif
234 return ret; 230 return ret;
235} 231}
236 232
@@ -382,6 +378,26 @@ dv_plugin_check_address (void *cls, const void *addr, size_t addrlen)
382} 378}
383 379
384 380
381
382/**
383 * Create a new session to transmit data to the target
384 * This session will used to send data to this peer and the plugin will
385 * notify us by calling the env->session_end function
386 *
387 * @param cls the plugin
388 * @param target the neighbour id
389 * @param addr pointer to the address
390 * @param addrlen length of addr
391 * @return the session if the address is valid, NULL otherwise
392 */
393static struct Session *
394dv_get_session (void *cls,
395 const struct GNUNET_HELLO_Address *address)
396{
397 return NULL;
398}
399
400
385/** 401/**
386 * Entry point for the plugin. 402 * Entry point for the plugin.
387 */ 403 */
@@ -411,6 +427,7 @@ libgnunet_plugin_transport_dv_init (void *cls)
411 api->address_pretty_printer = &dv_plugin_address_pretty_printer; 427 api->address_pretty_printer = &dv_plugin_address_pretty_printer;
412 api->check_address = &dv_plugin_check_address; 428 api->check_address = &dv_plugin_check_address;
413 api->address_to_string = &address_to_string; 429 api->address_to_string = &address_to_string;
430 api->get_session = dv_get_session;
414 return api; 431 return api;
415} 432}
416 433
@@ -432,4 +449,4 @@ libgnunet_plugin_transport_dv_done (void *cls)
432 return NULL; 449 return NULL;
433} 450}
434 451
435/* end of plugin_transport_template.c */ 452/* end of plugin_transport_dv.c */