diff options
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 66843ed97..af1b412c2 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -151,7 +151,7 @@ struct PrettyPrinterContext | |||
151 | /** | 151 | /** |
152 | * Session with another peer. | 152 | * Session with another peer. |
153 | */ | 153 | */ |
154 | struct Session | 154 | struct GNUNET_ATS_Session |
155 | { | 155 | { |
156 | /** | 156 | /** |
157 | * Which peer is this session for? | 157 | * Which peer is this session for? |
@@ -324,7 +324,7 @@ struct UDP_FragmentationContext | |||
324 | /** | 324 | /** |
325 | * The session this fragmentation context belongs to | 325 | * The session this fragmentation context belongs to |
326 | */ | 326 | */ |
327 | struct Session *session; | 327 | struct GNUNET_ATS_Session *session; |
328 | 328 | ||
329 | /** | 329 | /** |
330 | * Function to call upon completion of the transmission. | 330 | * Function to call upon completion of the transmission. |
@@ -390,7 +390,7 @@ struct UDP_MessageWrapper | |||
390 | /** | 390 | /** |
391 | * Session this message belongs to | 391 | * Session this message belongs to |
392 | */ | 392 | */ |
393 | struct Session *session; | 393 | struct GNUNET_ATS_Session *session; |
394 | 394 | ||
395 | /** | 395 | /** |
396 | * DLL of messages, previous element | 396 | * DLL of messages, previous element |
@@ -506,7 +506,7 @@ GNUNET_NETWORK_STRUCT_END | |||
506 | */ | 506 | */ |
507 | static void | 507 | static void |
508 | notify_session_monitor (struct Plugin *plugin, | 508 | notify_session_monitor (struct Plugin *plugin, |
509 | struct Session *session, | 509 | struct GNUNET_ATS_Session *session, |
510 | enum GNUNET_TRANSPORT_SessionState state) | 510 | enum GNUNET_TRANSPORT_SessionState state) |
511 | { | 511 | { |
512 | struct GNUNET_TRANSPORT_SessionInfo info; | 512 | struct GNUNET_TRANSPORT_SessionInfo info; |
@@ -538,7 +538,7 @@ notify_session_monitor (struct Plugin *plugin, | |||
538 | * | 538 | * |
539 | * @param cls the `struct Plugin` with the monitor callback (`sic`) | 539 | * @param cls the `struct Plugin` with the monitor callback (`sic`) |
540 | * @param peer peer we send information about | 540 | * @param peer peer we send information about |
541 | * @param value our `struct Session` to send information about | 541 | * @param value our `struct GNUNET_ATS_Session` to send information about |
542 | * @return #GNUNET_OK (continue to iterate) | 542 | * @return #GNUNET_OK (continue to iterate) |
543 | */ | 543 | */ |
544 | static int | 544 | static int |
@@ -547,7 +547,7 @@ send_session_info_iter (void *cls, | |||
547 | void *value) | 547 | void *value) |
548 | { | 548 | { |
549 | struct Plugin *plugin = cls; | 549 | struct Plugin *plugin = cls; |
550 | struct Session *session = value; | 550 | struct GNUNET_ATS_Session *session = value; |
551 | 551 | ||
552 | notify_session_monitor (plugin, | 552 | notify_session_monitor (plugin, |
553 | session, | 553 | session, |
@@ -602,7 +602,7 @@ udp_plugin_setup_monitor (void *cls, | |||
602 | * @param s session to free | 602 | * @param s session to free |
603 | */ | 603 | */ |
604 | static void | 604 | static void |
605 | free_session (struct Session *s) | 605 | free_session (struct GNUNET_ATS_Session *s) |
606 | { | 606 | { |
607 | if (NULL != s->address) | 607 | if (NULL != s->address) |
608 | { | 608 | { |
@@ -645,7 +645,7 @@ udp_query_keepalive_factor (void *cls) | |||
645 | */ | 645 | */ |
646 | static enum GNUNET_ATS_Network_Type | 646 | static enum GNUNET_ATS_Network_Type |
647 | udp_plugin_get_network (void *cls, | 647 | udp_plugin_get_network (void *cls, |
648 | struct Session *session) | 648 | struct GNUNET_ATS_Session *session) |
649 | { | 649 | { |
650 | return session->scope; | 650 | return session->scope; |
651 | } | 651 | } |
@@ -1350,12 +1350,12 @@ udp_nat_port_map_callback (void *cls, | |||
1350 | /** | 1350 | /** |
1351 | * Closure for #session_cmp_it(). | 1351 | * Closure for #session_cmp_it(). |
1352 | */ | 1352 | */ |
1353 | struct SessionCompareContext | 1353 | struct GNUNET_ATS_SessionCompareContext |
1354 | { | 1354 | { |
1355 | /** | 1355 | /** |
1356 | * Set to session matching the address. | 1356 | * Set to session matching the address. |
1357 | */ | 1357 | */ |
1358 | struct Session *res; | 1358 | struct GNUNET_ATS_Session *res; |
1359 | 1359 | ||
1360 | /** | 1360 | /** |
1361 | * Address we are looking for. | 1361 | * Address we are looking for. |
@@ -1367,9 +1367,9 @@ struct SessionCompareContext | |||
1367 | /** | 1367 | /** |
1368 | * Find a session with a matching address. | 1368 | * Find a session with a matching address. |
1369 | * | 1369 | * |
1370 | * @param cls the `struct SessionCompareContext *` | 1370 | * @param cls the `struct GNUNET_ATS_SessionCompareContext *` |
1371 | * @param key peer identity (unused) | 1371 | * @param key peer identity (unused) |
1372 | * @param value the `struct Session *` | 1372 | * @param value the `struct GNUNET_ATS_Session *` |
1373 | * @return #GNUNET_NO if we found the session, #GNUNET_OK if not | 1373 | * @return #GNUNET_NO if we found the session, #GNUNET_OK if not |
1374 | */ | 1374 | */ |
1375 | static int | 1375 | static int |
@@ -1377,8 +1377,8 @@ session_cmp_it (void *cls, | |||
1377 | const struct GNUNET_PeerIdentity *key, | 1377 | const struct GNUNET_PeerIdentity *key, |
1378 | void *value) | 1378 | void *value) |
1379 | { | 1379 | { |
1380 | struct SessionCompareContext *cctx = cls; | 1380 | struct GNUNET_ATS_SessionCompareContext *cctx = cls; |
1381 | struct Session *s = value; | 1381 | struct GNUNET_ATS_Session *s = value; |
1382 | 1382 | ||
1383 | if (0 == GNUNET_HELLO_address_cmp (s->address, | 1383 | if (0 == GNUNET_HELLO_address_cmp (s->address, |
1384 | cctx->address)) | 1384 | cctx->address)) |
@@ -1400,14 +1400,14 @@ session_cmp_it (void *cls, | |||
1400 | * @param address the address we should locate the session by | 1400 | * @param address the address we should locate the session by |
1401 | * @return the session if it exists, or NULL if it is not found | 1401 | * @return the session if it exists, or NULL if it is not found |
1402 | */ | 1402 | */ |
1403 | static struct Session * | 1403 | static struct GNUNET_ATS_Session * |
1404 | udp_plugin_lookup_session (void *cls, | 1404 | udp_plugin_lookup_session (void *cls, |
1405 | const struct GNUNET_HELLO_Address *address) | 1405 | const struct GNUNET_HELLO_Address *address) |
1406 | { | 1406 | { |
1407 | struct Plugin *plugin = cls; | 1407 | struct Plugin *plugin = cls; |
1408 | const struct IPv6UdpAddress *udp_a6; | 1408 | const struct IPv6UdpAddress *udp_a6; |
1409 | const struct IPv4UdpAddress *udp_a4; | 1409 | const struct IPv4UdpAddress *udp_a4; |
1410 | struct SessionCompareContext cctx; | 1410 | struct GNUNET_ATS_SessionCompareContext cctx; |
1411 | 1411 | ||
1412 | if (NULL == address->address) | 1412 | if (NULL == address->address) |
1413 | { | 1413 | { |
@@ -1473,7 +1473,7 @@ udp_plugin_lookup_session (void *cls, | |||
1473 | * @param s session to reschedule timeout activity for | 1473 | * @param s session to reschedule timeout activity for |
1474 | */ | 1474 | */ |
1475 | static void | 1475 | static void |
1476 | reschedule_session_timeout (struct Session *s) | 1476 | reschedule_session_timeout (struct GNUNET_ATS_Session *s) |
1477 | { | 1477 | { |
1478 | if (GNUNET_YES == s->in_destroy) | 1478 | if (GNUNET_YES == s->in_destroy) |
1479 | return; | 1479 | return; |
@@ -1495,7 +1495,7 @@ reschedule_session_timeout (struct Session *s) | |||
1495 | static void | 1495 | static void |
1496 | udp_plugin_update_session_timeout (void *cls, | 1496 | udp_plugin_update_session_timeout (void *cls, |
1497 | const struct GNUNET_PeerIdentity *peer, | 1497 | const struct GNUNET_PeerIdentity *peer, |
1498 | struct Session *session) | 1498 | struct GNUNET_ATS_Session *session) |
1499 | { | 1499 | { |
1500 | struct Plugin *plugin = cls; | 1500 | struct Plugin *plugin = cls; |
1501 | 1501 | ||
@@ -1526,7 +1526,7 @@ static void | |||
1526 | dequeue (struct Plugin *plugin, | 1526 | dequeue (struct Plugin *plugin, |
1527 | struct UDP_MessageWrapper *udpw) | 1527 | struct UDP_MessageWrapper *udpw) |
1528 | { | 1528 | { |
1529 | struct Session *session = udpw->session; | 1529 | struct GNUNET_ATS_Session *session = udpw->session; |
1530 | 1530 | ||
1531 | if (plugin->bytes_in_buffer < udpw->msg_size) | 1531 | if (plugin->bytes_in_buffer < udpw->msg_size) |
1532 | { | 1532 | { |
@@ -1578,7 +1578,7 @@ static void | |||
1578 | enqueue (struct Plugin *plugin, | 1578 | enqueue (struct Plugin *plugin, |
1579 | struct UDP_MessageWrapper *udpw) | 1579 | struct UDP_MessageWrapper *udpw) |
1580 | { | 1580 | { |
1581 | struct Session *session = udpw->session; | 1581 | struct GNUNET_ATS_Session *session = udpw->session; |
1582 | 1582 | ||
1583 | if (GNUNET_YES == session->in_destroy) | 1583 | if (GNUNET_YES == session->in_destroy) |
1584 | { | 1584 | { |
@@ -1644,7 +1644,7 @@ fragmented_message_done (struct UDP_FragmentationContext *frag_ctx, | |||
1644 | int result) | 1644 | int result) |
1645 | { | 1645 | { |
1646 | struct Plugin *plugin = frag_ctx->plugin; | 1646 | struct Plugin *plugin = frag_ctx->plugin; |
1647 | struct Session *s = frag_ctx->session; | 1647 | struct GNUNET_ATS_Session *s = frag_ctx->session; |
1648 | struct UDP_MessageWrapper *udpw; | 1648 | struct UDP_MessageWrapper *udpw; |
1649 | struct UDP_MessageWrapper *tmp; | 1649 | struct UDP_MessageWrapper *tmp; |
1650 | size_t overhead; | 1650 | size_t overhead; |
@@ -1834,7 +1834,7 @@ enqueue_fragment (void *cls, | |||
1834 | struct UDP_FragmentationContext *frag_ctx = cls; | 1834 | struct UDP_FragmentationContext *frag_ctx = cls; |
1835 | struct Plugin *plugin = frag_ctx->plugin; | 1835 | struct Plugin *plugin = frag_ctx->plugin; |
1836 | struct UDP_MessageWrapper *udpw; | 1836 | struct UDP_MessageWrapper *udpw; |
1837 | struct Session *session = frag_ctx->session; | 1837 | struct GNUNET_ATS_Session *session = frag_ctx->session; |
1838 | size_t msg_len = ntohs (msg->size); | 1838 | size_t msg_len = ntohs (msg->size); |
1839 | 1839 | ||
1840 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1840 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1981,7 +1981,7 @@ qc_message_sent (void *cls, | |||
1981 | */ | 1981 | */ |
1982 | static ssize_t | 1982 | static ssize_t |
1983 | udp_plugin_send (void *cls, | 1983 | udp_plugin_send (void *cls, |
1984 | struct Session *s, | 1984 | struct GNUNET_ATS_Session *s, |
1985 | const char *msgbuf, | 1985 | const char *msgbuf, |
1986 | size_t msgbuf_size, | 1986 | size_t msgbuf_size, |
1987 | unsigned int priority, | 1987 | unsigned int priority, |
@@ -2142,7 +2142,7 @@ read_process_ack (struct Plugin *plugin, | |||
2142 | const struct GNUNET_MessageHeader *ack; | 2142 | const struct GNUNET_MessageHeader *ack; |
2143 | const struct UDP_ACK_Message *udp_ack; | 2143 | const struct UDP_ACK_Message *udp_ack; |
2144 | struct GNUNET_HELLO_Address *address; | 2144 | struct GNUNET_HELLO_Address *address; |
2145 | struct Session *s; | 2145 | struct GNUNET_ATS_Session *s; |
2146 | struct GNUNET_TIME_Relative flow_delay; | 2146 | struct GNUNET_TIME_Relative flow_delay; |
2147 | 2147 | ||
2148 | if (ntohs (msg->size) | 2148 | if (ntohs (msg->size) |
@@ -2246,7 +2246,7 @@ struct FindReceiveContext | |||
2246 | /** | 2246 | /** |
2247 | * Session associated with this context. | 2247 | * Session associated with this context. |
2248 | */ | 2248 | */ |
2249 | struct Session *session; | 2249 | struct GNUNET_ATS_Session *session; |
2250 | 2250 | ||
2251 | /** | 2251 | /** |
2252 | * Address to find. | 2252 | * Address to find. |
@@ -2297,7 +2297,7 @@ find_receive_context (void *cls, | |||
2297 | * to the service. | 2297 | * to the service. |
2298 | * | 2298 | * |
2299 | * @param cls the `struct Plugin *` | 2299 | * @param cls the `struct Plugin *` |
2300 | * @param client the `struct Session *` | 2300 | * @param client the `struct GNUNET_ATS_Session *` |
2301 | * @param hdr the actual message | 2301 | * @param hdr the actual message |
2302 | * @return #GNUNET_OK (always) | 2302 | * @return #GNUNET_OK (always) |
2303 | */ | 2303 | */ |
@@ -2307,7 +2307,7 @@ process_inbound_tokenized_messages (void *cls, | |||
2307 | const struct GNUNET_MessageHeader *hdr) | 2307 | const struct GNUNET_MessageHeader *hdr) |
2308 | { | 2308 | { |
2309 | struct Plugin *plugin = cls; | 2309 | struct Plugin *plugin = cls; |
2310 | struct Session *session = client; | 2310 | struct GNUNET_ATS_Session *session = client; |
2311 | 2311 | ||
2312 | if (GNUNET_YES == session->in_destroy) | 2312 | if (GNUNET_YES == session->in_destroy) |
2313 | return GNUNET_OK; | 2313 | return GNUNET_OK; |
@@ -2331,7 +2331,7 @@ process_inbound_tokenized_messages (void *cls, | |||
2331 | */ | 2331 | */ |
2332 | static int | 2332 | static int |
2333 | udp_disconnect_session (void *cls, | 2333 | udp_disconnect_session (void *cls, |
2334 | struct Session *s) | 2334 | struct GNUNET_ATS_Session *s) |
2335 | { | 2335 | { |
2336 | struct Plugin *plugin = cls; | 2336 | struct Plugin *plugin = cls; |
2337 | struct UDP_MessageWrapper *udpw; | 2337 | struct UDP_MessageWrapper *udpw; |
@@ -2486,14 +2486,14 @@ udp_disconnect (void *cls, | |||
2486 | /** | 2486 | /** |
2487 | * Session was idle, so disconnect it. | 2487 | * Session was idle, so disconnect it. |
2488 | * | 2488 | * |
2489 | * @param cls the `struct Session` to time out | 2489 | * @param cls the `struct GNUNET_ATS_Session` to time out |
2490 | * @param tc scheduler context | 2490 | * @param tc scheduler context |
2491 | */ | 2491 | */ |
2492 | static void | 2492 | static void |
2493 | session_timeout (void *cls, | 2493 | session_timeout (void *cls, |
2494 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 2494 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
2495 | { | 2495 | { |
2496 | struct Session *s = cls; | 2496 | struct GNUNET_ATS_Session *s = cls; |
2497 | struct Plugin *plugin = s->plugin; | 2497 | struct Plugin *plugin = s->plugin; |
2498 | struct GNUNET_TIME_Relative left; | 2498 | struct GNUNET_TIME_Relative left; |
2499 | 2499 | ||
@@ -2533,15 +2533,15 @@ session_timeout (void *cls, | |||
2533 | * @param network_type network type the address belongs to | 2533 | * @param network_type network type the address belongs to |
2534 | * @return NULL on error, otherwise session handle | 2534 | * @return NULL on error, otherwise session handle |
2535 | */ | 2535 | */ |
2536 | static struct Session * | 2536 | static struct GNUNET_ATS_Session * |
2537 | udp_plugin_create_session (void *cls, | 2537 | udp_plugin_create_session (void *cls, |
2538 | const struct GNUNET_HELLO_Address *address, | 2538 | const struct GNUNET_HELLO_Address *address, |
2539 | enum GNUNET_ATS_Network_Type network_type) | 2539 | enum GNUNET_ATS_Network_Type network_type) |
2540 | { | 2540 | { |
2541 | struct Plugin *plugin = cls; | 2541 | struct Plugin *plugin = cls; |
2542 | struct Session *s; | 2542 | struct GNUNET_ATS_Session *s; |
2543 | 2543 | ||
2544 | s = GNUNET_new (struct Session); | 2544 | s = GNUNET_new (struct GNUNET_ATS_Session); |
2545 | s->plugin = plugin; | 2545 | s->plugin = plugin; |
2546 | s->address = GNUNET_HELLO_address_copy (address); | 2546 | s->address = GNUNET_HELLO_address_copy (address); |
2547 | s->target = address->peer; | 2547 | s->target = address->peer; |
@@ -2588,12 +2588,12 @@ udp_plugin_create_session (void *cls, | |||
2588 | * @param address the address | 2588 | * @param address the address |
2589 | * @return the session or NULL of max connections exceeded | 2589 | * @return the session or NULL of max connections exceeded |
2590 | */ | 2590 | */ |
2591 | static struct Session * | 2591 | static struct GNUNET_ATS_Session * |
2592 | udp_plugin_get_session (void *cls, | 2592 | udp_plugin_get_session (void *cls, |
2593 | const struct GNUNET_HELLO_Address *address) | 2593 | const struct GNUNET_HELLO_Address *address) |
2594 | { | 2594 | { |
2595 | struct Plugin *plugin = cls; | 2595 | struct Plugin *plugin = cls; |
2596 | struct Session *s; | 2596 | struct GNUNET_ATS_Session *s; |
2597 | enum GNUNET_ATS_Network_Type network_type = GNUNET_ATS_NET_UNSPECIFIED; | 2597 | enum GNUNET_ATS_Network_Type network_type = GNUNET_ATS_NET_UNSPECIFIED; |
2598 | const struct IPv4UdpAddress *udp_v4; | 2598 | const struct IPv4UdpAddress *udp_v4; |
2599 | const struct IPv6UdpAddress *udp_v6; | 2599 | const struct IPv6UdpAddress *udp_v6; |
@@ -2669,7 +2669,7 @@ process_udp_message (struct Plugin *plugin, | |||
2669 | size_t udp_addr_len, | 2669 | size_t udp_addr_len, |
2670 | enum GNUNET_ATS_Network_Type network_type) | 2670 | enum GNUNET_ATS_Network_Type network_type) |
2671 | { | 2671 | { |
2672 | struct Session *s; | 2672 | struct GNUNET_ATS_Session *s; |
2673 | struct GNUNET_HELLO_Address *address; | 2673 | struct GNUNET_HELLO_Address *address; |
2674 | 2674 | ||
2675 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); | 2675 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); |
@@ -2806,7 +2806,7 @@ ack_proc (void *cls, | |||
2806 | struct UDP_ACK_Message *udp_ack; | 2806 | struct UDP_ACK_Message *udp_ack; |
2807 | uint32_t delay; | 2807 | uint32_t delay; |
2808 | struct UDP_MessageWrapper *udpw; | 2808 | struct UDP_MessageWrapper *udpw; |
2809 | struct Session *s; | 2809 | struct GNUNET_ATS_Session *s; |
2810 | struct GNUNET_HELLO_Address *address; | 2810 | struct GNUNET_HELLO_Address *address; |
2811 | 2811 | ||
2812 | if (GNUNET_NO == rc->have_sender) | 2812 | if (GNUNET_NO == rc->have_sender) |
@@ -3161,7 +3161,7 @@ remove_timeout_messages_and_select (struct Plugin *plugin, | |||
3161 | { | 3161 | { |
3162 | struct UDP_MessageWrapper *udpw; | 3162 | struct UDP_MessageWrapper *udpw; |
3163 | struct GNUNET_TIME_Relative remaining; | 3163 | struct GNUNET_TIME_Relative remaining; |
3164 | struct Session *session; | 3164 | struct GNUNET_ATS_Session *session; |
3165 | int removed; | 3165 | int removed; |
3166 | 3166 | ||
3167 | removed = GNUNET_NO; | 3167 | removed = GNUNET_NO; |