aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r--src/transport/plugin_transport_unix.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index c6ac0e508..359cf575d 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -137,7 +137,7 @@ struct UNIXMessageWrapper
137 /** 137 /**
138 * Session this message belongs to. 138 * Session this message belongs to.
139 */ 139 */
140 struct Session *session; 140 struct GNUNET_ATS_Session *session;
141 141
142 /** 142 /**
143 * Function to call upon transmission. 143 * Function to call upon transmission.
@@ -174,18 +174,18 @@ struct UNIXMessageWrapper
174/** 174/**
175 * Handle for a session. 175 * Handle for a session.
176 */ 176 */
177struct Session 177struct GNUNET_ATS_Session
178{ 178{
179 179
180 /** 180 /**
181 * Sessions with pending messages (!) are kept in a DLL. 181 * Sessions with pending messages (!) are kept in a DLL.
182 */ 182 */
183 struct Session *next; 183 struct GNUNET_ATS_Session *next;
184 184
185 /** 185 /**
186 * Sessions with pending messages (!) are kept in a DLL. 186 * Sessions with pending messages (!) are kept in a DLL.
187 */ 187 */
188 struct Session *prev; 188 struct GNUNET_ATS_Session *prev;
189 189
190 /** 190 /**
191 * To whom are we talking to (set to our identity 191 * To whom are we talking to (set to our identity
@@ -278,7 +278,7 @@ struct Plugin
278 struct GNUNET_TRANSPORT_PluginEnvironment *env; 278 struct GNUNET_TRANSPORT_PluginEnvironment *env;
279 279
280 /** 280 /**
281 * Sessions (map from peer identity to `struct Session`) 281 * Sessions (map from peer identity to `struct GNUNET_ATS_Session`)
282 */ 282 */
283 struct GNUNET_CONTAINER_MultiPeerMap *session_map; 283 struct GNUNET_CONTAINER_MultiPeerMap *session_map;
284 284
@@ -335,7 +335,7 @@ struct Plugin
335 */ 335 */
336static void 336static void
337notify_session_monitor (struct Plugin *plugin, 337notify_session_monitor (struct Plugin *plugin,
338 struct Session *session, 338 struct GNUNET_ATS_Session *session,
339 enum GNUNET_TRANSPORT_SessionState state) 339 enum GNUNET_TRANSPORT_SessionState state)
340{ 340{
341 struct GNUNET_TRANSPORT_SessionInfo info; 341 struct GNUNET_TRANSPORT_SessionInfo info;
@@ -431,7 +431,7 @@ unix_plugin_address_to_string (void *cls,
431 */ 431 */
432static int 432static int
433unix_plugin_session_disconnect (void *cls, 433unix_plugin_session_disconnect (void *cls,
434 struct Session *session) 434 struct GNUNET_ATS_Session *session)
435{ 435{
436 struct Plugin *plugin = cls; 436 struct Plugin *plugin = cls;
437 struct UNIXMessageWrapper *msgw; 437 struct UNIXMessageWrapper *msgw;
@@ -497,14 +497,14 @@ unix_plugin_session_disconnect (void *cls,
497/** 497/**
498 * Session was idle for too long, so disconnect it 498 * Session was idle for too long, so disconnect it
499 * 499 *
500 * @param cls the `struct Session *` to disconnect 500 * @param cls the `struct GNUNET_ATS_Session *` to disconnect
501 * @param tc scheduler context 501 * @param tc scheduler context
502 */ 502 */
503static void 503static void
504session_timeout (void *cls, 504session_timeout (void *cls,
505 const struct GNUNET_SCHEDULER_TaskContext *tc) 505 const struct GNUNET_SCHEDULER_TaskContext *tc)
506{ 506{
507 struct Session *session = cls; 507 struct GNUNET_ATS_Session *session = cls;
508 struct GNUNET_TIME_Relative left; 508 struct GNUNET_TIME_Relative left;
509 509
510 session->timeout_task = NULL; 510 session->timeout_task = NULL;
@@ -538,7 +538,7 @@ session_timeout (void *cls,
538 * @param session session for which the timeout should be rescheduled 538 * @param session session for which the timeout should be rescheduled
539 */ 539 */
540static void 540static void
541reschedule_session_timeout (struct Session *session) 541reschedule_session_timeout (struct GNUNET_ATS_Session *session)
542{ 542{
543 GNUNET_assert (NULL != session->timeout_task); 543 GNUNET_assert (NULL != session->timeout_task);
544 session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); 544 session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
@@ -584,7 +584,7 @@ struct LookupCtx
584 /** 584 /**
585 * Location to store the session, if found. 585 * Location to store the session, if found.
586 */ 586 */
587 struct Session *res; 587 struct GNUNET_ATS_Session *res;
588 588
589 /** 589 /**
590 * Address we are looking for. 590 * Address we are looking for.
@@ -607,7 +607,7 @@ lookup_session_it (void *cls,
607 void *value) 607 void *value)
608{ 608{
609 struct LookupCtx *lctx = cls; 609 struct LookupCtx *lctx = cls;
610 struct Session *session = value; 610 struct GNUNET_ATS_Session *session = value;
611 611
612 if (0 == GNUNET_HELLO_address_cmp (lctx->address, 612 if (0 == GNUNET_HELLO_address_cmp (lctx->address,
613 session->address)) 613 session->address))
@@ -626,7 +626,7 @@ lookup_session_it (void *cls,
626 * @param address the address to find 626 * @param address the address to find
627 * @return NULL if session was not found 627 * @return NULL if session was not found
628 */ 628 */
629static struct Session * 629static struct GNUNET_ATS_Session *
630lookup_session (struct Plugin *plugin, 630lookup_session (struct Plugin *plugin,
631 const struct GNUNET_HELLO_Address *address) 631 const struct GNUNET_HELLO_Address *address)
632{ 632{
@@ -797,7 +797,7 @@ resend:
797 */ 797 */
798static enum GNUNET_ATS_Network_Type 798static enum GNUNET_ATS_Network_Type
799unix_plugin_get_network (void *cls, 799unix_plugin_get_network (void *cls,
800 struct Session *session) 800 struct GNUNET_ATS_Session *session)
801{ 801{
802 GNUNET_assert (NULL != session); 802 GNUNET_assert (NULL != session);
803 return GNUNET_ATS_NET_LOOPBACK; 803 return GNUNET_ATS_NET_LOOPBACK;
@@ -828,12 +828,12 @@ unix_plugin_get_network_for_address (void *cls,
828 * @param address the address 828 * @param address the address
829 * @return the session or NULL of max connections exceeded 829 * @return the session or NULL of max connections exceeded
830 */ 830 */
831static struct Session * 831static struct GNUNET_ATS_Session *
832unix_plugin_get_session (void *cls, 832unix_plugin_get_session (void *cls,
833 const struct GNUNET_HELLO_Address *address) 833 const struct GNUNET_HELLO_Address *address)
834{ 834{
835 struct Plugin *plugin = cls; 835 struct Plugin *plugin = cls;
836 struct Session *session; 836 struct GNUNET_ATS_Session *session;
837 struct UnixAddress *ua; 837 struct UnixAddress *ua;
838 char * addrstr; 838 char * addrstr;
839 uint32_t addr_str_len; 839 uint32_t addr_str_len;
@@ -886,7 +886,7 @@ unix_plugin_get_session (void *cls,
886 } 886 }
887 887
888 /* create a new session */ 888 /* create a new session */
889 session = GNUNET_new (struct Session); 889 session = GNUNET_new (struct GNUNET_ATS_Session);
890 session->target = address->peer; 890 session->target = address->peer;
891 session->address = GNUNET_HELLO_address_copy (address); 891 session->address = GNUNET_HELLO_address_copy (address);
892 session->plugin = plugin; 892 session->plugin = plugin;
@@ -929,7 +929,7 @@ unix_plugin_get_session (void *cls,
929static void 929static void
930unix_plugin_update_session_timeout (void *cls, 930unix_plugin_update_session_timeout (void *cls,
931 const struct GNUNET_PeerIdentity *peer, 931 const struct GNUNET_PeerIdentity *peer,
932 struct Session *session) 932 struct GNUNET_ATS_Session *session)
933{ 933{
934 struct Plugin *plugin = cls; 934 struct Plugin *plugin = cls;
935 935
@@ -961,7 +961,7 @@ unix_demultiplexer (struct Plugin *plugin,
961 const struct UnixAddress *ua, 961 const struct UnixAddress *ua,
962 size_t ua_len) 962 size_t ua_len)
963{ 963{
964 struct Session *session; 964 struct GNUNET_ATS_Session *session;
965 struct GNUNET_HELLO_Address *address; 965 struct GNUNET_HELLO_Address *address;
966 966
967 GNUNET_assert (ua_len >= sizeof (struct UnixAddress)); 967 GNUNET_assert (ua_len >= sizeof (struct UnixAddress));
@@ -1103,7 +1103,7 @@ unix_plugin_do_write (struct Plugin *plugin)
1103{ 1103{
1104 ssize_t sent = 0; 1104 ssize_t sent = 0;
1105 struct UNIXMessageWrapper *msgw; 1105 struct UNIXMessageWrapper *msgw;
1106 struct Session *session; 1106 struct GNUNET_ATS_Session *session;
1107 int did_delete; 1107 int did_delete;
1108 1108
1109 session = NULL; 1109 session = NULL;
@@ -1301,7 +1301,7 @@ unix_plugin_select_write (void *cls,
1301 */ 1301 */
1302static ssize_t 1302static ssize_t
1303unix_plugin_send (void *cls, 1303unix_plugin_send (void *cls,
1304 struct Session *session, 1304 struct GNUNET_ATS_Session *session,
1305 const char *msgbuf, 1305 const char *msgbuf,
1306 size_t msgbuf_size, 1306 size_t msgbuf_size,
1307 unsigned int priority, 1307 unsigned int priority,
@@ -1655,7 +1655,7 @@ address_notification (void *cls,
1655 * 1655 *
1656 * @param cls the plugin 1656 * @param cls the plugin
1657 * @param key peer identity (unused) 1657 * @param key peer identity (unused)
1658 * @param value the `struct Session *` to disconnect 1658 * @param value the `struct GNUNET_ATS_Session *` to disconnect
1659 * @return #GNUNET_YES (always, continue to iterate) 1659 * @return #GNUNET_YES (always, continue to iterate)
1660 */ 1660 */
1661static int 1661static int
@@ -1664,7 +1664,7 @@ get_session_delete_it (void *cls,
1664 void *value) 1664 void *value)
1665{ 1665{
1666 struct Plugin *plugin = cls; 1666 struct Plugin *plugin = cls;
1667 struct Session *session = value; 1667 struct GNUNET_ATS_Session *session = value;
1668 1668
1669 unix_plugin_session_disconnect (plugin, session); 1669 unix_plugin_session_disconnect (plugin, session);
1670 return GNUNET_YES; 1670 return GNUNET_YES;
@@ -1696,7 +1696,7 @@ unix_plugin_peer_disconnect (void *cls,
1696 * 1696 *
1697 * @param cls the `struct Plugin` with the monitor callback (`sic`) 1697 * @param cls the `struct Plugin` with the monitor callback (`sic`)
1698 * @param peer peer we send information about 1698 * @param peer peer we send information about
1699 * @param value our `struct Session` to send information about 1699 * @param value our `struct GNUNET_ATS_Session` to send information about
1700 * @return #GNUNET_OK (continue to iterate) 1700 * @return #GNUNET_OK (continue to iterate)
1701 */ 1701 */
1702static int 1702static int
@@ -1705,7 +1705,7 @@ send_session_info_iter (void *cls,
1705 void *value) 1705 void *value)
1706{ 1706{
1707 struct Plugin *plugin = cls; 1707 struct Plugin *plugin = cls;
1708 struct Session *session = value; 1708 struct GNUNET_ATS_Session *session = value;
1709 1709
1710 notify_session_monitor (plugin, 1710 notify_session_monitor (plugin,
1711 session, 1711 session,
@@ -1849,7 +1849,7 @@ libgnunet_plugin_transport_unix_done (void *cls)
1849 struct UNIXMessageWrapper * msgw; 1849 struct UNIXMessageWrapper * msgw;
1850 struct UnixAddress *ua; 1850 struct UnixAddress *ua;
1851 size_t len; 1851 size_t len;
1852 struct Session *session; 1852 struct GNUNET_ATS_Session *session;
1853 1853
1854 if (NULL == plugin) 1854 if (NULL == plugin)
1855 { 1855 {