diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-05-07 12:06:50 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-05-07 12:06:50 +0000 |
commit | be4c79e4cd4a8f118c5577874f0c95e253359595 (patch) | |
tree | 7fd74fb0cf6921c4e35a43f2593396bb4805f154 /src/vpn | |
parent | 15ccd7a167bcce0dde4331092975a6401393610f (diff) | |
download | gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.tar.gz gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.zip |
Rename mesh->cadet
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-service-vpn.c | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 2c1463519..45da1f988 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c | |||
@@ -22,12 +22,12 @@ | |||
22 | * @file vpn/gnunet-service-vpn.c | 22 | * @file vpn/gnunet-service-vpn.c |
23 | * @brief service that opens a virtual interface and allows its clients | 23 | * @brief service that opens a virtual interface and allows its clients |
24 | * to allocate IPs on the virtual interface and to then redirect | 24 | * to allocate IPs on the virtual interface and to then redirect |
25 | * IP traffic received on those IPs via the GNUnet mesh | 25 | * IP traffic received on those IPs via the GNUnet cadet |
26 | * @author Philipp Toelke | 26 | * @author Philipp Toelke |
27 | * @author Christian Grothoff | 27 | * @author Christian Grothoff |
28 | * | 28 | * |
29 | * TODO: | 29 | * TODO: |
30 | * - keep multiple peers/mesh channels ready as alternative exits / | 30 | * - keep multiple peers/cadet channels ready as alternative exits / |
31 | * detect & recover from channel-to-exit failure gracefully | 31 | * detect & recover from channel-to-exit failure gracefully |
32 | */ | 32 | */ |
33 | #include "platform.h" | 33 | #include "platform.h" |
@@ -35,7 +35,7 @@ | |||
35 | #include "gnunet_common.h" | 35 | #include "gnunet_common.h" |
36 | #include "gnunet_protocols.h" | 36 | #include "gnunet_protocols.h" |
37 | #include "gnunet_applications.h" | 37 | #include "gnunet_applications.h" |
38 | #include "gnunet_mesh_service.h" | 38 | #include "gnunet_cadet_service.h" |
39 | #include "gnunet_statistics_service.h" | 39 | #include "gnunet_statistics_service.h" |
40 | #include "gnunet_constants.h" | 40 | #include "gnunet_constants.h" |
41 | #include "gnunet_tun_lib.h" | 41 | #include "gnunet_tun_lib.h" |
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | 46 | ||
47 | /** | 47 | /** |
48 | * Maximum number of messages we allow in the queue for mesh. | 48 | * Maximum number of messages we allow in the queue for cadet. |
49 | */ | 49 | */ |
50 | #define MAX_MESSAGE_QUEUE_SIZE 4 | 50 | #define MAX_MESSAGE_QUEUE_SIZE 4 |
51 | 51 | ||
@@ -218,7 +218,7 @@ struct ChannelState | |||
218 | * Information about the channel to use, NULL if no channel | 218 | * Information about the channel to use, NULL if no channel |
219 | * is available right now. | 219 | * is available right now. |
220 | */ | 220 | */ |
221 | struct GNUNET_MESH_Channel *channel; | 221 | struct GNUNET_CADET_Channel *channel; |
222 | 222 | ||
223 | /** | 223 | /** |
224 | * Active query with REGEX to locate exit. | 224 | * Active query with REGEX to locate exit. |
@@ -228,7 +228,7 @@ struct ChannelState | |||
228 | /** | 228 | /** |
229 | * Active transmission handle, NULL for none. | 229 | * Active transmission handle, NULL for none. |
230 | */ | 230 | */ |
231 | struct GNUNET_MESH_TransmitHandle *th; | 231 | struct GNUNET_CADET_TransmitHandle *th; |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * Entry for this entry in the channel_heap, NULL as long as this | 234 | * Entry for this entry in the channel_heap, NULL as long as this |
@@ -334,13 +334,13 @@ static int global_ret; | |||
334 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 334 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
335 | 335 | ||
336 | /** | 336 | /** |
337 | * Handle to the mesh service. | 337 | * Handle to the cadet service. |
338 | */ | 338 | */ |
339 | static struct GNUNET_MESH_Handle *mesh_handle; | 339 | static struct GNUNET_CADET_Handle *cadet_handle; |
340 | 340 | ||
341 | /** | 341 | /** |
342 | * Map from IP address to destination information (possibly with a | 342 | * Map from IP address to destination information (possibly with a |
343 | * MESH channel handle for fast setup). | 343 | * CADET channel handle for fast setup). |
344 | */ | 344 | */ |
345 | static struct GNUNET_CONTAINER_MultiHashMap *destination_map; | 345 | static struct GNUNET_CONTAINER_MultiHashMap *destination_map; |
346 | 346 | ||
@@ -351,7 +351,7 @@ static struct GNUNET_CONTAINER_Heap *destination_heap; | |||
351 | 351 | ||
352 | /** | 352 | /** |
353 | * Map from source and destination address (IP+port) to connection | 353 | * Map from source and destination address (IP+port) to connection |
354 | * information (mostly with the respective MESH channel handle). | 354 | * information (mostly with the respective CADET channel handle). |
355 | */ | 355 | */ |
356 | static struct GNUNET_CONTAINER_MultiHashMap *channel_map; | 356 | static struct GNUNET_CONTAINER_MultiHashMap *channel_map; |
357 | 357 | ||
@@ -542,7 +542,7 @@ free_channel_state (struct ChannelState *ts) | |||
542 | { | 542 | { |
543 | struct GNUNET_HashCode key; | 543 | struct GNUNET_HashCode key; |
544 | struct ChannelMessageQueueEntry *tnq; | 544 | struct ChannelMessageQueueEntry *tnq; |
545 | struct GNUNET_MESH_Channel *channel; | 545 | struct GNUNET_CADET_Channel *channel; |
546 | 546 | ||
547 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 547 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
548 | "Cleaning up channel state\n"); | 548 | "Cleaning up channel state\n"); |
@@ -560,14 +560,14 @@ free_channel_state (struct ChannelState *ts) | |||
560 | GNUNET_assert (0 == ts->tmq_length); | 560 | GNUNET_assert (0 == ts->tmq_length); |
561 | if (NULL != ts->th) | 561 | if (NULL != ts->th) |
562 | { | 562 | { |
563 | GNUNET_MESH_notify_transmit_ready_cancel (ts->th); | 563 | GNUNET_CADET_notify_transmit_ready_cancel (ts->th); |
564 | ts->th = NULL; | 564 | ts->th = NULL; |
565 | } | 565 | } |
566 | GNUNET_assert (NULL == ts->destination.heap_node); | 566 | GNUNET_assert (NULL == ts->destination.heap_node); |
567 | if (NULL != (channel = ts->channel)) | 567 | if (NULL != (channel = ts->channel)) |
568 | { | 568 | { |
569 | ts->channel = NULL; | 569 | ts->channel = NULL; |
570 | GNUNET_MESH_channel_destroy (channel); | 570 | GNUNET_CADET_channel_destroy (channel); |
571 | } | 571 | } |
572 | if (NULL != ts->search) | 572 | if (NULL != ts->search) |
573 | { | 573 | { |
@@ -601,7 +601,7 @@ free_channel_state (struct ChannelState *ts) | |||
601 | 601 | ||
602 | 602 | ||
603 | /** | 603 | /** |
604 | * Send a message from the message queue via mesh. | 604 | * Send a message from the message queue via cadet. |
605 | * | 605 | * |
606 | * @param cls the `struct ChannelState` with the message queue | 606 | * @param cls the `struct ChannelState` with the message queue |
607 | * @param size number of bytes available in @a buf | 607 | * @param size number of bytes available in @a buf |
@@ -622,7 +622,7 @@ send_to_peer_notify_callback (void *cls, size_t size, void *buf) | |||
622 | GNUNET_assert (NULL != tnq); | 622 | GNUNET_assert (NULL != tnq); |
623 | GNUNET_assert (size >= tnq->len); | 623 | GNUNET_assert (size >= tnq->len); |
624 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 624 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
625 | "Sending %u bytes via mesh channel\n", | 625 | "Sending %u bytes via cadet channel\n", |
626 | tnq->len); | 626 | tnq->len); |
627 | GNUNET_CONTAINER_DLL_remove (ts->tmq_head, | 627 | GNUNET_CONTAINER_DLL_remove (ts->tmq_head, |
628 | ts->tmq_tail, | 628 | ts->tmq_tail, |
@@ -632,14 +632,14 @@ send_to_peer_notify_callback (void *cls, size_t size, void *buf) | |||
632 | ret = tnq->len; | 632 | ret = tnq->len; |
633 | GNUNET_free (tnq); | 633 | GNUNET_free (tnq); |
634 | if (NULL != (tnq = ts->tmq_head)) | 634 | if (NULL != (tnq = ts->tmq_head)) |
635 | ts->th = GNUNET_MESH_notify_transmit_ready (ts->channel, | 635 | ts->th = GNUNET_CADET_notify_transmit_ready (ts->channel, |
636 | GNUNET_NO /* cork */, | 636 | GNUNET_NO /* cork */, |
637 | GNUNET_TIME_UNIT_FOREVER_REL, | 637 | GNUNET_TIME_UNIT_FOREVER_REL, |
638 | tnq->len, | 638 | tnq->len, |
639 | &send_to_peer_notify_callback, | 639 | &send_to_peer_notify_callback, |
640 | ts); | 640 | ts); |
641 | GNUNET_STATISTICS_update (stats, | 641 | GNUNET_STATISTICS_update (stats, |
642 | gettext_noop ("# Bytes given to mesh for transmission"), | 642 | gettext_noop ("# Bytes given to cadet for transmission"), |
643 | ret, GNUNET_NO); | 643 | ret, GNUNET_NO); |
644 | return ret; | 644 | return ret; |
645 | } | 645 | } |
@@ -657,7 +657,7 @@ send_to_channel (struct ChannelMessageQueueEntry *tnq, | |||
657 | struct ChannelState *ts) | 657 | struct ChannelState *ts) |
658 | { | 658 | { |
659 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 659 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
660 | "Queueing %u bytes for transmission via mesh channel\n", | 660 | "Queueing %u bytes for transmission via cadet channel\n", |
661 | tnq->len); | 661 | tnq->len); |
662 | GNUNET_assert (NULL != ts->channel); | 662 | GNUNET_assert (NULL != ts->channel); |
663 | GNUNET_CONTAINER_DLL_insert_tail (ts->tmq_head, | 663 | GNUNET_CONTAINER_DLL_insert_tail (ts->tmq_head, |
@@ -674,16 +674,16 @@ send_to_channel (struct ChannelMessageQueueEntry *tnq, | |||
674 | ts->tmq_tail, | 674 | ts->tmq_tail, |
675 | dq); | 675 | dq); |
676 | ts->tmq_length--; | 676 | ts->tmq_length--; |
677 | GNUNET_MESH_notify_transmit_ready_cancel (ts->th); | 677 | GNUNET_CADET_notify_transmit_ready_cancel (ts->th); |
678 | ts->th = NULL; | 678 | ts->th = NULL; |
679 | GNUNET_STATISTICS_update (stats, | 679 | GNUNET_STATISTICS_update (stats, |
680 | gettext_noop ("# Bytes dropped in mesh queue (overflow)"), | 680 | gettext_noop ("# Bytes dropped in cadet queue (overflow)"), |
681 | dq->len, | 681 | dq->len, |
682 | GNUNET_NO); | 682 | GNUNET_NO); |
683 | GNUNET_free (dq); | 683 | GNUNET_free (dq); |
684 | } | 684 | } |
685 | if (NULL == ts->th) | 685 | if (NULL == ts->th) |
686 | ts->th = GNUNET_MESH_notify_transmit_ready (ts->channel, | 686 | ts->th = GNUNET_CADET_notify_transmit_ready (ts->channel, |
687 | GNUNET_NO /* cork */, | 687 | GNUNET_NO /* cork */, |
688 | GNUNET_TIME_UNIT_FOREVER_REL, | 688 | GNUNET_TIME_UNIT_FOREVER_REL, |
689 | tnq->len, | 689 | tnq->len, |
@@ -727,16 +727,16 @@ handle_regex_result (void *cls, | |||
727 | GNUNET_break (0); | 727 | GNUNET_break (0); |
728 | return; | 728 | return; |
729 | } | 729 | } |
730 | ts->channel = GNUNET_MESH_channel_create (mesh_handle, | 730 | ts->channel = GNUNET_CADET_channel_create (cadet_handle, |
731 | ts, | 731 | ts, |
732 | id, | 732 | id, |
733 | apptype, | 733 | apptype, |
734 | GNUNET_MESH_OPTION_DEFAULT); | 734 | GNUNET_CADET_OPTION_DEFAULT); |
735 | } | 735 | } |
736 | 736 | ||
737 | 737 | ||
738 | /** | 738 | /** |
739 | * Initialize the given destination entry's mesh channel. | 739 | * Initialize the given destination entry's cadet channel. |
740 | * | 740 | * |
741 | * @param dt destination channel for which we need to setup a channel | 741 | * @param dt destination channel for which we need to setup a channel |
742 | * @param client_af address family of the address returned to the client | 742 | * @param client_af address family of the address returned to the client |
@@ -750,7 +750,7 @@ create_channel_to_destination (struct DestinationChannel *dt, | |||
750 | unsigned int apptype; | 750 | unsigned int apptype; |
751 | 751 | ||
752 | GNUNET_STATISTICS_update (stats, | 752 | GNUNET_STATISTICS_update (stats, |
753 | gettext_noop ("# Mesh channels created"), | 753 | gettext_noop ("# Cadet channels created"), |
754 | 1, GNUNET_NO); | 754 | 1, GNUNET_NO); |
755 | GNUNET_assert (NULL == dt->ts); | 755 | GNUNET_assert (NULL == dt->ts); |
756 | switch (client_af) | 756 | switch (client_af) |
@@ -773,15 +773,15 @@ create_channel_to_destination (struct DestinationChannel *dt, | |||
773 | ts->destination_container = dt; /* we are referenced from dt */ | 773 | ts->destination_container = dt; /* we are referenced from dt */ |
774 | if (dt->destination->is_service) | 774 | if (dt->destination->is_service) |
775 | { | 775 | { |
776 | ts->channel = GNUNET_MESH_channel_create (mesh_handle, | 776 | ts->channel = GNUNET_CADET_channel_create (cadet_handle, |
777 | ts, | 777 | ts, |
778 | &dt->destination->details.service_destination.target, | 778 | &dt->destination->details.service_destination.target, |
779 | apptype, | 779 | apptype, |
780 | GNUNET_MESH_OPTION_DEFAULT); | 780 | GNUNET_CADET_OPTION_DEFAULT); |
781 | if (NULL == ts->channel) | 781 | if (NULL == ts->channel) |
782 | { | 782 | { |
783 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 783 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
784 | _("Failed to setup mesh channel!\n")); | 784 | _("Failed to setup cadet channel!\n")); |
785 | GNUNET_free (ts); | 785 | GNUNET_free (ts); |
786 | return NULL; | 786 | return NULL; |
787 | } | 787 | } |
@@ -857,7 +857,7 @@ expire_channel (struct ChannelState *except) | |||
857 | 857 | ||
858 | 858 | ||
859 | /** | 859 | /** |
860 | * Route a packet via mesh to the given destination. | 860 | * Route a packet via cadet to the given destination. |
861 | * | 861 | * |
862 | * @param destination description of the destination | 862 | * @param destination description of the destination |
863 | * @param af address family on this end (AF_INET or AF_INET6) | 863 | * @param af address family on this end (AF_INET or AF_INET6) |
@@ -1510,7 +1510,7 @@ route_packet (struct DestinationEntry *destination, | |||
1510 | /** | 1510 | /** |
1511 | * Receive packets from the helper-process (someone send to the local | 1511 | * Receive packets from the helper-process (someone send to the local |
1512 | * virtual channel interface). Find the destination mapping, and if it | 1512 | * virtual channel interface). Find the destination mapping, and if it |
1513 | * exists, identify the correct MESH channel (or possibly create it) | 1513 | * exists, identify the correct CADET channel (or possibly create it) |
1514 | * and forward the packet. | 1514 | * and forward the packet. |
1515 | * | 1515 | * |
1516 | * @param cls closure, NULL | 1516 | * @param cls closure, NULL |
@@ -1682,7 +1682,7 @@ make_up_icmpv6_payload (struct ChannelState *ts, | |||
1682 | 1682 | ||
1683 | 1683 | ||
1684 | /** | 1684 | /** |
1685 | * We got an ICMP packet back from the MESH channel. Pass it on to the | 1685 | * We got an ICMP packet back from the CADET channel. Pass it on to the |
1686 | * local virtual interface via the helper. | 1686 | * local virtual interface via the helper. |
1687 | * | 1687 | * |
1688 | * @param cls closure, NULL | 1688 | * @param cls closure, NULL |
@@ -1694,7 +1694,7 @@ make_up_icmpv6_payload (struct ChannelState *ts, | |||
1694 | */ | 1694 | */ |
1695 | static int | 1695 | static int |
1696 | receive_icmp_back (void *cls, | 1696 | receive_icmp_back (void *cls, |
1697 | struct GNUNET_MESH_Channel *channel, | 1697 | struct GNUNET_CADET_Channel *channel, |
1698 | void **channel_ctx, | 1698 | void **channel_ctx, |
1699 | const struct GNUNET_MessageHeader *message) | 1699 | const struct GNUNET_MessageHeader *message) |
1700 | { | 1700 | { |
@@ -1703,7 +1703,7 @@ receive_icmp_back (void *cls, | |||
1703 | size_t mlen; | 1703 | size_t mlen; |
1704 | 1704 | ||
1705 | GNUNET_STATISTICS_update (stats, | 1705 | GNUNET_STATISTICS_update (stats, |
1706 | gettext_noop ("# ICMP packets received from mesh"), | 1706 | gettext_noop ("# ICMP packets received from cadet"), |
1707 | 1, GNUNET_NO); | 1707 | 1, GNUNET_NO); |
1708 | mlen = ntohs (message->size); | 1708 | mlen = ntohs (message->size); |
1709 | if (mlen < sizeof (struct GNUNET_EXIT_IcmpToVPNMessage)) | 1709 | if (mlen < sizeof (struct GNUNET_EXIT_IcmpToVPNMessage)) |
@@ -1728,7 +1728,7 @@ receive_icmp_back (void *cls, | |||
1728 | char dbuf[INET6_ADDRSTRLEN]; | 1728 | char dbuf[INET6_ADDRSTRLEN]; |
1729 | 1729 | ||
1730 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1730 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1731 | "Received ICMP packet from mesh, sending %u bytes from %s -> %s via TUN\n", | 1731 | "Received ICMP packet from cadet, sending %u bytes from %s -> %s via TUN\n", |
1732 | (unsigned int) mlen, | 1732 | (unsigned int) mlen, |
1733 | inet_ntop (ts->af, &ts->destination_ip, sbuf, sizeof (sbuf)), | 1733 | inet_ntop (ts->af, &ts->destination_ip, sbuf, sizeof (sbuf)), |
1734 | inet_ntop (ts->af, &ts->source_ip, dbuf, sizeof (dbuf))); | 1734 | inet_ntop (ts->af, &ts->source_ip, dbuf, sizeof (dbuf))); |
@@ -2021,7 +2021,7 @@ receive_icmp_back (void *cls, | |||
2021 | 2021 | ||
2022 | 2022 | ||
2023 | /** | 2023 | /** |
2024 | * We got a UDP packet back from the MESH channel. Pass it on to the | 2024 | * We got a UDP packet back from the CADET channel. Pass it on to the |
2025 | * local virtual interface via the helper. | 2025 | * local virtual interface via the helper. |
2026 | * | 2026 | * |
2027 | * @param cls closure, NULL | 2027 | * @param cls closure, NULL |
@@ -2033,7 +2033,7 @@ receive_icmp_back (void *cls, | |||
2033 | */ | 2033 | */ |
2034 | static int | 2034 | static int |
2035 | receive_udp_back (void *cls, | 2035 | receive_udp_back (void *cls, |
2036 | struct GNUNET_MESH_Channel *channel, | 2036 | struct GNUNET_CADET_Channel *channel, |
2037 | void **channel_ctx, | 2037 | void **channel_ctx, |
2038 | const struct GNUNET_MessageHeader *message) | 2038 | const struct GNUNET_MessageHeader *message) |
2039 | { | 2039 | { |
@@ -2042,7 +2042,7 @@ receive_udp_back (void *cls, | |||
2042 | size_t mlen; | 2042 | size_t mlen; |
2043 | 2043 | ||
2044 | GNUNET_STATISTICS_update (stats, | 2044 | GNUNET_STATISTICS_update (stats, |
2045 | gettext_noop ("# UDP packets received from mesh"), | 2045 | gettext_noop ("# UDP packets received from cadet"), |
2046 | 1, GNUNET_NO); | 2046 | 1, GNUNET_NO); |
2047 | mlen = ntohs (message->size); | 2047 | mlen = ntohs (message->size); |
2048 | if (mlen < sizeof (struct GNUNET_EXIT_UdpReplyMessage)) | 2048 | if (mlen < sizeof (struct GNUNET_EXIT_UdpReplyMessage)) |
@@ -2067,7 +2067,7 @@ receive_udp_back (void *cls, | |||
2067 | char dbuf[INET6_ADDRSTRLEN]; | 2067 | char dbuf[INET6_ADDRSTRLEN]; |
2068 | 2068 | ||
2069 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2069 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2070 | "Received UDP reply from mesh, sending %u bytes from %s:%u -> %s:%u via TUN\n", | 2070 | "Received UDP reply from cadet, sending %u bytes from %s:%u -> %s:%u via TUN\n", |
2071 | (unsigned int) mlen, | 2071 | (unsigned int) mlen, |
2072 | inet_ntop (ts->af, &ts->destination_ip, sbuf, sizeof (sbuf)), | 2072 | inet_ntop (ts->af, &ts->destination_ip, sbuf, sizeof (sbuf)), |
2073 | ts->destination_port, | 2073 | ts->destination_port, |
@@ -2176,7 +2176,7 @@ receive_udp_back (void *cls, | |||
2176 | 2176 | ||
2177 | 2177 | ||
2178 | /** | 2178 | /** |
2179 | * We got a TCP packet back from the MESH channel. Pass it on to the | 2179 | * We got a TCP packet back from the CADET channel. Pass it on to the |
2180 | * local virtual interface via the helper. | 2180 | * local virtual interface via the helper. |
2181 | * | 2181 | * |
2182 | * @param cls closure, NULL | 2182 | * @param cls closure, NULL |
@@ -2188,7 +2188,7 @@ receive_udp_back (void *cls, | |||
2188 | */ | 2188 | */ |
2189 | static int | 2189 | static int |
2190 | receive_tcp_back (void *cls, | 2190 | receive_tcp_back (void *cls, |
2191 | struct GNUNET_MESH_Channel *channel, | 2191 | struct GNUNET_CADET_Channel *channel, |
2192 | void **channel_ctx, | 2192 | void **channel_ctx, |
2193 | const struct GNUNET_MessageHeader *message) | 2193 | const struct GNUNET_MessageHeader *message) |
2194 | { | 2194 | { |
@@ -2197,7 +2197,7 @@ receive_tcp_back (void *cls, | |||
2197 | size_t mlen; | 2197 | size_t mlen; |
2198 | 2198 | ||
2199 | GNUNET_STATISTICS_update (stats, | 2199 | GNUNET_STATISTICS_update (stats, |
2200 | gettext_noop ("# TCP packets received from mesh"), | 2200 | gettext_noop ("# TCP packets received from cadet"), |
2201 | 1, GNUNET_NO); | 2201 | 1, GNUNET_NO); |
2202 | mlen = ntohs (message->size); | 2202 | mlen = ntohs (message->size); |
2203 | if (mlen < sizeof (struct GNUNET_EXIT_TcpDataMessage)) | 2203 | if (mlen < sizeof (struct GNUNET_EXIT_TcpDataMessage)) |
@@ -2217,7 +2217,7 @@ receive_tcp_back (void *cls, | |||
2217 | char dbuf[INET6_ADDRSTRLEN]; | 2217 | char dbuf[INET6_ADDRSTRLEN]; |
2218 | 2218 | ||
2219 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2219 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2220 | "Received TCP reply from mesh, sending %u bytes from %s:%u -> %s:%u via TUN\n", | 2220 | "Received TCP reply from cadet, sending %u bytes from %s:%u -> %s:%u via TUN\n", |
2221 | (unsigned int) mlen, | 2221 | (unsigned int) mlen, |
2222 | inet_ntop (ts->af, &ts->destination_ip, sbuf, sizeof (sbuf)), | 2222 | inet_ntop (ts->af, &ts->destination_ip, sbuf, sizeof (sbuf)), |
2223 | ts->destination_port, | 2223 | ts->destination_port, |
@@ -2774,19 +2774,19 @@ service_redirect_to_service (void *cls, | |||
2774 | * Function called whenever a channel is destroyed. Should clean up | 2774 | * Function called whenever a channel is destroyed. Should clean up |
2775 | * any associated state. | 2775 | * any associated state. |
2776 | * | 2776 | * |
2777 | * @param cls closure (set from #GNUNET_MESH_connect) | 2777 | * @param cls closure (set from #GNUNET_CADET_connect) |
2778 | * @param channel connection to the other end (henceforth invalid) | 2778 | * @param channel connection to the other end (henceforth invalid) |
2779 | * @param channel_ctx place where local state associated | 2779 | * @param channel_ctx place where local state associated |
2780 | * with the channel is stored (our `struct ChannelState`) | 2780 | * with the channel is stored (our `struct ChannelState`) |
2781 | */ | 2781 | */ |
2782 | static void | 2782 | static void |
2783 | channel_cleaner (void *cls, | 2783 | channel_cleaner (void *cls, |
2784 | const struct GNUNET_MESH_Channel *channel, | 2784 | const struct GNUNET_CADET_Channel *channel, |
2785 | void *channel_ctx) | 2785 | void *channel_ctx) |
2786 | { | 2786 | { |
2787 | struct ChannelState *ts = channel_ctx; | 2787 | struct ChannelState *ts = channel_ctx; |
2788 | 2788 | ||
2789 | ts->channel = NULL; /* we must not call GNUNET_MESH_channel_destroy() anymore */ | 2789 | ts->channel = NULL; /* we must not call GNUNET_CADET_channel_destroy() anymore */ |
2790 | free_channel_state (ts); | 2790 | free_channel_state (ts); |
2791 | } | 2791 | } |
2792 | 2792 | ||
@@ -2871,10 +2871,10 @@ cleanup (void *cls, | |||
2871 | GNUNET_CONTAINER_heap_destroy (channel_heap); | 2871 | GNUNET_CONTAINER_heap_destroy (channel_heap); |
2872 | channel_heap = NULL; | 2872 | channel_heap = NULL; |
2873 | } | 2873 | } |
2874 | if (NULL != mesh_handle) | 2874 | if (NULL != cadet_handle) |
2875 | { | 2875 | { |
2876 | GNUNET_MESH_disconnect (mesh_handle); | 2876 | GNUNET_CADET_disconnect (cadet_handle); |
2877 | mesh_handle = NULL; | 2877 | cadet_handle = NULL; |
2878 | } | 2878 | } |
2879 | if (NULL != helper_handle) | 2879 | if (NULL != helper_handle) |
2880 | { | 2880 | { |
@@ -2916,7 +2916,7 @@ run (void *cls, | |||
2916 | sizeof (struct RedirectToServiceRequestMessage) }, | 2916 | sizeof (struct RedirectToServiceRequestMessage) }, |
2917 | {NULL, NULL, 0, 0} | 2917 | {NULL, NULL, 0, 0} |
2918 | }; | 2918 | }; |
2919 | static const struct GNUNET_MESH_MessageHandler mesh_handlers[] = { | 2919 | static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = { |
2920 | { &receive_udp_back, GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY, 0}, | 2920 | { &receive_udp_back, GNUNET_MESSAGE_TYPE_VPN_UDP_REPLY, 0}, |
2921 | { &receive_tcp_back, GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_VPN, 0}, | 2921 | { &receive_tcp_back, GNUNET_MESSAGE_TYPE_VPN_TCP_DATA_TO_VPN, 0}, |
2922 | { &receive_icmp_back, GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_VPN, 0}, | 2922 | { &receive_icmp_back, GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_VPN, 0}, |
@@ -3053,11 +3053,11 @@ run (void *cls, | |||
3053 | } | 3053 | } |
3054 | vpn_argv[6] = NULL; | 3054 | vpn_argv[6] = NULL; |
3055 | 3055 | ||
3056 | mesh_handle = | 3056 | cadet_handle = |
3057 | GNUNET_MESH_connect (cfg_, NULL, | 3057 | GNUNET_CADET_connect (cfg_, NULL, |
3058 | NULL, | 3058 | NULL, |
3059 | &channel_cleaner, | 3059 | &channel_cleaner, |
3060 | mesh_handlers, | 3060 | cadet_handlers, |
3061 | NULL); | 3061 | NULL); |
3062 | helper_handle = GNUNET_HELPER_start (GNUNET_NO, | 3062 | helper_handle = GNUNET_HELPER_start (GNUNET_NO, |
3063 | "gnunet-helper-vpn", vpn_argv, | 3063 | "gnunet-helper-vpn", vpn_argv, |