aboutsummaryrefslogtreecommitdiff
path: root/src/dv
diff options
context:
space:
mode:
Diffstat (limited to 'src/dv')
-rw-r--r--src/dv/plugin_transport_dv.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c
index 32b25bea0..8c4f385bf 100644
--- a/src/dv/plugin_transport_dv.c
+++ b/src/dv/plugin_transport_dv.c
@@ -80,7 +80,7 @@ struct PendingRequest
80 /** 80 /**
81 * Session of this request. 81 * Session of this request.
82 */ 82 */
83 struct Session *session; 83 struct GNUNET_ATS_Session *session;
84 84
85 /** 85 /**
86 * Number of bytes to transmit. 86 * Number of bytes to transmit.
@@ -92,7 +92,7 @@ struct PendingRequest
92/** 92/**
93 * Session handle for connections. 93 * Session handle for connections.
94 */ 94 */
95struct Session 95struct GNUNET_ATS_Session
96{ 96{
97 /** 97 /**
98 * Pointer to the global plugin struct. 98 * Pointer to the global plugin struct.
@@ -203,7 +203,7 @@ struct Plugin
203 */ 203 */
204static void 204static void
205notify_session_monitor (struct Plugin *plugin, 205notify_session_monitor (struct Plugin *plugin,
206 struct Session *session, 206 struct GNUNET_ATS_Session *session,
207 enum GNUNET_TRANSPORT_SessionState state) 207 enum GNUNET_TRANSPORT_SessionState state)
208{ 208{
209 struct GNUNET_TRANSPORT_SessionInfo info; 209 struct GNUNET_TRANSPORT_SessionInfo info;
@@ -231,7 +231,7 @@ notify_session_monitor (struct Plugin *plugin,
231 * @param session session where the distance changed 231 * @param session session where the distance changed
232 */ 232 */
233static void 233static void
234notify_distance_change (struct Session *session) 234notify_distance_change (struct GNUNET_ATS_Session *session)
235{ 235{
236 struct Plugin *plugin = session->plugin; 236 struct Plugin *plugin = session->plugin;
237 237
@@ -247,7 +247,7 @@ notify_distance_change (struct Session *session)
247 * Function called by MST on each message from the box. 247 * Function called by MST on each message from the box.
248 * 248 *
249 * @param cls closure with the `struct Plugin *` 249 * @param cls closure with the `struct Plugin *`
250 * @param client identification of the client (with the 'struct Session') 250 * @param client identification of the client (with the 'struct GNUNET_ATS_Session')
251 * @param message the actual message 251 * @param message the actual message
252 * @return #GNUNET_OK on success 252 * @return #GNUNET_OK on success
253 */ 253 */
@@ -257,7 +257,7 @@ unbox_cb (void *cls,
257 const struct GNUNET_MessageHeader *message) 257 const struct GNUNET_MessageHeader *message)
258{ 258{
259 struct Plugin *plugin = cls; 259 struct Plugin *plugin = cls;
260 struct Session *session = client; 260 struct GNUNET_ATS_Session *session = client;
261 261
262 session->active = GNUNET_YES; 262 session->active = GNUNET_YES;
263 LOG (GNUNET_ERROR_TYPE_DEBUG, 263 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -291,7 +291,7 @@ handle_dv_message_received (void *cls,
291 const struct GNUNET_MessageHeader *msg) 291 const struct GNUNET_MessageHeader *msg)
292{ 292{
293 struct Plugin *plugin = cls; 293 struct Plugin *plugin = cls;
294 struct Session *session; 294 struct GNUNET_ATS_Session *session;
295 295
296 LOG (GNUNET_ERROR_TYPE_DEBUG, 296 LOG (GNUNET_ERROR_TYPE_DEBUG,
297 "Received DV_MESSAGE_RECEIVED message for peer `%s': new distance %u\n", 297 "Received DV_MESSAGE_RECEIVED message for peer `%s': new distance %u\n",
@@ -348,7 +348,7 @@ handle_dv_connect (void *cls,
348 enum GNUNET_ATS_Network_Type network) 348 enum GNUNET_ATS_Network_Type network)
349{ 349{
350 struct Plugin *plugin = cls; 350 struct Plugin *plugin = cls;
351 struct Session *session; 351 struct GNUNET_ATS_Session *session;
352 352
353 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); 353 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network);
354 /** 354 /**
@@ -370,7 +370,7 @@ handle_dv_connect (void *cls,
370 return; /* nothing to do */ 370 return; /* nothing to do */
371 } 371 }
372 372
373 session = GNUNET_new (struct Session); 373 session = GNUNET_new (struct GNUNET_ATS_Session);
374 session->address = GNUNET_HELLO_address_allocate (peer, "dv", 374 session->address = GNUNET_HELLO_address_allocate (peer, "dv",
375 NULL, 0, 375 NULL, 0,
376 GNUNET_HELLO_ADDRESS_INFO_NONE); 376 GNUNET_HELLO_ADDRESS_INFO_NONE);
@@ -419,7 +419,7 @@ handle_dv_distance_changed (void *cls,
419 enum GNUNET_ATS_Network_Type network) 419 enum GNUNET_ATS_Network_Type network)
420{ 420{
421 struct Plugin *plugin = cls; 421 struct Plugin *plugin = cls;
422 struct Session *session; 422 struct GNUNET_ATS_Session *session;
423 423
424 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); 424 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network);
425 LOG (GNUNET_ERROR_TYPE_DEBUG, 425 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -446,7 +446,7 @@ handle_dv_distance_changed (void *cls,
446 * @param session session to clean up 446 * @param session session to clean up
447 */ 447 */
448static void 448static void
449free_session (struct Session *session) 449free_session (struct GNUNET_ATS_Session *session)
450{ 450{
451 struct Plugin *plugin = session->plugin; 451 struct Plugin *plugin = session->plugin;
452 struct PendingRequest *pr; 452 struct PendingRequest *pr;
@@ -500,7 +500,7 @@ handle_dv_disconnect (void *cls,
500 const struct GNUNET_PeerIdentity *peer) 500 const struct GNUNET_PeerIdentity *peer)
501{ 501{
502 struct Plugin *plugin = cls; 502 struct Plugin *plugin = cls;
503 struct Session *session; 503 struct GNUNET_ATS_Session *session;
504 504
505 LOG (GNUNET_ERROR_TYPE_DEBUG, 505 LOG (GNUNET_ERROR_TYPE_DEBUG,
506 "Received `%s' message for peer `%s'\n", 506 "Received `%s' message for peer `%s'\n",
@@ -526,7 +526,7 @@ send_finished (void *cls,
526 int ok) 526 int ok)
527{ 527{
528 struct PendingRequest *pr = cls; 528 struct PendingRequest *pr = cls;
529 struct Session *session = pr->session; 529 struct GNUNET_ATS_Session *session = pr->session;
530 530
531 pr->th = NULL; 531 pr->th = NULL;
532 GNUNET_CONTAINER_DLL_remove (session->pr_head, 532 GNUNET_CONTAINER_DLL_remove (session->pr_head,
@@ -562,7 +562,7 @@ send_finished (void *cls,
562 */ 562 */
563static ssize_t 563static ssize_t
564dv_plugin_send (void *cls, 564dv_plugin_send (void *cls,
565 struct Session *session, 565 struct GNUNET_ATS_Session *session,
566 const char *msgbuf, 566 const char *msgbuf,
567 size_t msgbuf_size, 567 size_t msgbuf_size,
568 unsigned int priority, 568 unsigned int priority,
@@ -619,7 +619,7 @@ dv_plugin_disconnect_peer (void *cls,
619 const struct GNUNET_PeerIdentity *target) 619 const struct GNUNET_PeerIdentity *target)
620{ 620{
621 struct Plugin *plugin = cls; 621 struct Plugin *plugin = cls;
622 struct Session *session; 622 struct GNUNET_ATS_Session *session;
623 struct PendingRequest *pr; 623 struct PendingRequest *pr;
624 624
625 session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, 625 session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions,
@@ -655,7 +655,7 @@ dv_plugin_disconnect_peer (void *cls,
655 */ 655 */
656static int 656static int
657dv_plugin_disconnect_session (void *cls, 657dv_plugin_disconnect_session (void *cls,
658 struct Session *session) 658 struct GNUNET_ATS_Session *session)
659{ 659{
660 struct PendingRequest *pr; 660 struct PendingRequest *pr;
661 661
@@ -773,12 +773,12 @@ dv_plugin_check_address (void *cls,
773 * @param address the address 773 * @param address the address
774 * @return the session if the address is valid, NULL otherwise 774 * @return the session if the address is valid, NULL otherwise
775 */ 775 */
776static struct Session * 776static struct GNUNET_ATS_Session *
777dv_get_session (void *cls, 777dv_get_session (void *cls,
778 const struct GNUNET_HELLO_Address *address) 778 const struct GNUNET_HELLO_Address *address)
779{ 779{
780 struct Plugin *plugin = cls; 780 struct Plugin *plugin = cls;
781 struct Session *session; 781 struct GNUNET_ATS_Session *session;
782 782
783 if (0 != address->address_length) 783 if (0 != address->address_length)
784 return NULL; 784 return NULL;
@@ -832,7 +832,7 @@ dv_plugin_string_to_address (void *cls,
832static void 832static void
833dv_plugin_update_session_timeout (void *cls, 833dv_plugin_update_session_timeout (void *cls,
834 const struct GNUNET_PeerIdentity *peer, 834 const struct GNUNET_PeerIdentity *peer,
835 struct Session *session) 835 struct GNUNET_ATS_Session *session)
836{ 836{
837 /* DV currently doesn't time out like "normal" plugins, 837 /* DV currently doesn't time out like "normal" plugins,
838 so it should be safe to do nothing, right? 838 so it should be safe to do nothing, right?
@@ -852,7 +852,7 @@ dv_plugin_update_session_timeout (void *cls,
852 */ 852 */
853static enum GNUNET_ATS_Network_Type 853static enum GNUNET_ATS_Network_Type
854dv_get_network (void *cls, 854dv_get_network (void *cls,
855 struct Session *session) 855 struct GNUNET_ATS_Session *session)
856{ 856{
857 GNUNET_assert (NULL != session); 857 GNUNET_assert (NULL != session);
858 return session->network; 858 return session->network;
@@ -895,7 +895,7 @@ dv_plugin_query_keepalive_factor (void *cls)
895 * 895 *
896 * @param cls the `struct Plugin` with the monitor callback (`sic`) 896 * @param cls the `struct Plugin` with the monitor callback (`sic`)
897 * @param peer peer we send information about 897 * @param peer peer we send information about
898 * @param value our `struct Session` to send information about 898 * @param value our `struct GNUNET_ATS_Session` to send information about
899 * @return #GNUNET_OK (continue to iterate) 899 * @return #GNUNET_OK (continue to iterate)
900 */ 900 */
901static int 901static int
@@ -904,7 +904,7 @@ send_session_info_iter (void *cls,
904 void *value) 904 void *value)
905{ 905{
906 struct Plugin *plugin = cls; 906 struct Plugin *plugin = cls;
907 struct Session *session = value; 907 struct GNUNET_ATS_Session *session = value;
908 908
909 if (GNUNET_YES != session->active) 909 if (GNUNET_YES != session->active)
910 return GNUNET_OK; 910 return GNUNET_OK;
@@ -1010,7 +1010,7 @@ free_session_iterator (void *cls,
1010 const struct GNUNET_PeerIdentity *key, 1010 const struct GNUNET_PeerIdentity *key,
1011 void *value) 1011 void *value)
1012{ 1012{
1013 struct Session *session = value; 1013 struct GNUNET_ATS_Session *session = value;
1014 1014
1015 free_session (session); 1015 free_session (session);
1016 return GNUNET_OK; 1016 return GNUNET_OK;