diff options
-rw-r--r-- | src/dv/plugin_transport_dv.c | 45 | ||||
-rw-r--r-- | src/include/Makefile.am | 3 | ||||
-rw-r--r-- | src/include/gnunet_transport_plugin.h | 11 |
3 files changed, 35 insertions, 24 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 | */ |
221 | static ssize_t | 214 | static ssize_t |
222 | dv_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | 215 | dv_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 | */ | ||
393 | static struct Session * | ||
394 | dv_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 */ |
diff --git a/src/include/Makefile.am b/src/include/Makefile.am index a9b2c9116..afe4ecb3e 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am | |||
@@ -17,6 +17,7 @@ gnunetinclude_HEADERS = \ | |||
17 | plibc.h \ | 17 | plibc.h \ |
18 | $(WINPROC) \ | 18 | $(WINPROC) \ |
19 | block_dns.h \ | 19 | block_dns.h \ |
20 | block_gns.h \ | ||
20 | block_fs.h \ | 21 | block_fs.h \ |
21 | gnunet_applications.h \ | 22 | gnunet_applications.h \ |
22 | gnunet_arm_service.h \ | 23 | gnunet_arm_service.h \ |
@@ -46,6 +47,7 @@ gnunetinclude_HEADERS = \ | |||
46 | gnunet_fragmentation_lib.h \ | 47 | gnunet_fragmentation_lib.h \ |
47 | gnunet_fs_service.h \ | 48 | gnunet_fs_service.h \ |
48 | gnunet_getopt_lib.h \ | 49 | gnunet_getopt_lib.h \ |
50 | gnunet_gns_service.h \ | ||
49 | gnunet_hello_lib.h \ | 51 | gnunet_hello_lib.h \ |
50 | gnunet_helper_lib.h \ | 52 | gnunet_helper_lib.h \ |
51 | gnunet_load_lib.h \ | 53 | gnunet_load_lib.h \ |
@@ -69,6 +71,7 @@ gnunetinclude_HEADERS = \ | |||
69 | gnunet_signal_lib.h \ | 71 | gnunet_signal_lib.h \ |
70 | gnunet_signatures.h \ | 72 | gnunet_signatures.h \ |
71 | gnunet_statistics_service.h \ | 73 | gnunet_statistics_service.h \ |
74 | gnunet_stream_lib.h \ | ||
72 | gnunet_strings_lib.h \ | 75 | gnunet_strings_lib.h \ |
73 | gnunet_testing_lib.h \ | 76 | gnunet_testing_lib.h \ |
74 | gnunet_time_lib.h \ | 77 | gnunet_time_lib.h \ |
diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h index 0dbe6548e..9b39a4190 100644 --- a/src/include/gnunet_transport_plugin.h +++ b/src/include/gnunet_transport_plugin.h | |||
@@ -290,7 +290,7 @@ typedef void (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls, | |||
290 | * a fresh connection to another peer. | 290 | * a fresh connection to another peer. |
291 | * | 291 | * |
292 | * @param cls closure | 292 | * @param cls closure |
293 | * @param target who should receive this message | 293 | * @param session which session must be used |
294 | * @param msgbuf the message to transmit | 294 | * @param msgbuf the message to transmit |
295 | * @param msgbuf_size number of bytes in 'msgbuf' | 295 | * @param msgbuf_size number of bytes in 'msgbuf' |
296 | * @param priority how important is the message (most plugins will | 296 | * @param priority how important is the message (most plugins will |
@@ -299,15 +299,6 @@ typedef void (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls, | |||
299 | * require plugins to discard the message after the timeout, | 299 | * require plugins to discard the message after the timeout, |
300 | * just advisory for the desired delay; most plugins will ignore | 300 | * just advisory for the desired delay; most plugins will ignore |
301 | * this as well) | 301 | * this as well) |
302 | * @param session which session must be used (or NULL for "any") | ||
303 | * @param addr the address to use (can be NULL if the plugin | ||
304 | * is "on its own" (i.e. re-use existing TCP connection)) | ||
305 | * @param addrlen length of the address in bytes | ||
306 | * @param force_address GNUNET_YES if the plugin MUST use the given address, | ||
307 | * GNUNET_NO means the plugin may use any other address and | ||
308 | * GNUNET_SYSERR means that only reliable existing | ||
309 | * bi-directional connections should be used (regardless | ||
310 | * of address) | ||
311 | * @param cont continuation to call once the message has | 302 | * @param cont continuation to call once the message has |
312 | * been transmitted (or if the transport is ready | 303 | * been transmitted (or if the transport is ready |
313 | * for the next transmission call; or if the | 304 | * for the next transmission call; or if the |