aboutsummaryrefslogtreecommitdiff
path: root/src/exit
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-05-07 12:06:50 +0000
committerBart Polot <bart@net.in.tum.de>2014-05-07 12:06:50 +0000
commitbe4c79e4cd4a8f118c5577874f0c95e253359595 (patch)
tree7fd74fb0cf6921c4e35a43f2593396bb4805f154 /src/exit
parent15ccd7a167bcce0dde4331092975a6401393610f (diff)
downloadgnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.tar.gz
gnunet-be4c79e4cd4a8f118c5577874f0c95e253359595.zip
Rename mesh->cadet
Diffstat (limited to 'src/exit')
-rw-r--r--src/exit/exit.h18
-rw-r--r--src/exit/gnunet-daemon-exit.c146
2 files changed, 82 insertions, 82 deletions
diff --git a/src/exit/exit.h b/src/exit/exit.h
index b4cea4c23..b243204a3 100644
--- a/src/exit/exit.h
+++ b/src/exit/exit.h
@@ -20,7 +20,7 @@
20 20
21/** 21/**
22 * @file exit/exit.h 22 * @file exit/exit.h
23 * @brief format for mesh messages exchanged between VPN service and exit daemon 23 * @brief format for cadet messages exchanged between VPN service and exit daemon
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#ifndef EXIT_H 26#ifndef EXIT_H
@@ -31,7 +31,7 @@
31GNUNET_NETWORK_STRUCT_BEGIN 31GNUNET_NETWORK_STRUCT_BEGIN
32 32
33/** 33/**
34 * Message send via mesh to an exit daemon to initiate forwarding of 34 * Message send via cadet to an exit daemon to initiate forwarding of
35 * TCP data to a local service. 35 * TCP data to a local service.
36 */ 36 */
37struct GNUNET_EXIT_TcpServiceStartMessage 37struct GNUNET_EXIT_TcpServiceStartMessage
@@ -62,7 +62,7 @@ struct GNUNET_EXIT_TcpServiceStartMessage
62 62
63 63
64/** 64/**
65 * Message send via mesh to an exit daemon to initiate forwarding of 65 * Message send via cadet to an exit daemon to initiate forwarding of
66 * TCP data to the Internet. 66 * TCP data to the Internet.
67 */ 67 */
68struct GNUNET_EXIT_TcpInternetStartMessage 68struct GNUNET_EXIT_TcpInternetStartMessage
@@ -91,7 +91,7 @@ struct GNUNET_EXIT_TcpInternetStartMessage
91 91
92 92
93/** 93/**
94 * Message send via mesh between VPN and entry and an exit daemon to 94 * Message send via cadet between VPN and entry and an exit daemon to
95 * transmit TCP data between the VPN entry and an exit session. This 95 * transmit TCP data between the VPN entry and an exit session. This
96 * format is used for both Internet-exits and service-exits and 96 * format is used for both Internet-exits and service-exits and
97 * in both directions (VPN to exit and exit to VPN). 97 * in both directions (VPN to exit and exit to VPN).
@@ -119,7 +119,7 @@ struct GNUNET_EXIT_TcpDataMessage
119 119
120 120
121/** 121/**
122 * Message send via mesh to an exit daemon to send 122 * Message send via cadet to an exit daemon to send
123 * UDP data to a local service. 123 * UDP data to a local service.
124 */ 124 */
125struct GNUNET_EXIT_UdpServiceMessage 125struct GNUNET_EXIT_UdpServiceMessage
@@ -149,7 +149,7 @@ struct GNUNET_EXIT_UdpServiceMessage
149 149
150 150
151/** 151/**
152 * Message send via mesh to an exit daemon to forward 152 * Message send via cadet to an exit daemon to forward
153 * UDP data to the Internet. 153 * UDP data to the Internet.
154 */ 154 */
155struct GNUNET_EXIT_UdpInternetMessage 155struct GNUNET_EXIT_UdpInternetMessage
@@ -209,7 +209,7 @@ struct GNUNET_EXIT_UdpReplyMessage
209 209
210 210
211/** 211/**
212 * Message send via mesh to an exit daemon to send 212 * Message send via cadet to an exit daemon to send
213 * ICMP data to a local service. 213 * ICMP data to a local service.
214 */ 214 */
215struct GNUNET_EXIT_IcmpServiceMessage 215struct GNUNET_EXIT_IcmpServiceMessage
@@ -245,7 +245,7 @@ struct GNUNET_EXIT_IcmpServiceMessage
245 245
246 246
247/** 247/**
248 * Message send via mesh to an exit daemon to forward 248 * Message send via cadet to an exit daemon to forward
249 * ICMP data to the Internet. 249 * ICMP data to the Internet.
250 */ 250 */
251struct GNUNET_EXIT_IcmpInternetMessage 251struct GNUNET_EXIT_IcmpInternetMessage
@@ -280,7 +280,7 @@ struct GNUNET_EXIT_IcmpInternetMessage
280 280
281 281
282/** 282/**
283 * Message send via mesh to the vpn service to send 283 * Message send via cadet to the vpn service to send
284 * ICMP data to the VPN's TUN interface. 284 * ICMP data to the VPN's TUN interface.
285 */ 285 */
286struct GNUNET_EXIT_IcmpToVPNMessage 286struct GNUNET_EXIT_IcmpToVPNMessage
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index c29638559..882c6a373 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -20,7 +20,7 @@
20 20
21/** 21/**
22 * @file exit/gnunet-daemon-exit.c 22 * @file exit/gnunet-daemon-exit.c
23 * @brief tool to allow IP traffic exit from the GNUnet mesh to the Internet 23 * @brief tool to allow IP traffic exit from the GNUnet cadet to the Internet
24 * @author Philipp Toelke 24 * @author Philipp Toelke
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 * 26 *
@@ -39,7 +39,7 @@
39#include "gnunet_protocols.h" 39#include "gnunet_protocols.h"
40#include "gnunet_applications.h" 40#include "gnunet_applications.h"
41#include "gnunet_dht_service.h" 41#include "gnunet_dht_service.h"
42#include "gnunet_mesh_service.h" 42#include "gnunet_cadet_service.h"
43#include "gnunet_dnsparser_lib.h" 43#include "gnunet_dnsparser_lib.h"
44#include "gnunet_dnsstub_lib.h" 44#include "gnunet_dnsstub_lib.h"
45#include "gnunet_statistics_service.h" 45#include "gnunet_statistics_service.h"
@@ -52,13 +52,13 @@
52 52
53 53
54/** 54/**
55 * Maximum path compression length for mesh regex announcing for IPv4 address 55 * Maximum path compression length for cadet regex announcing for IPv4 address
56 * based regex. 56 * based regex.
57 */ 57 */
58#define REGEX_MAX_PATH_LEN_IPV4 4 58#define REGEX_MAX_PATH_LEN_IPV4 4
59 59
60/** 60/**
61 * Maximum path compression length for mesh regex announcing for IPv6 address 61 * Maximum path compression length for cadet regex announcing for IPv6 address
62 * based regex. 62 * based regex.
63 */ 63 */
64#define REGEX_MAX_PATH_LEN_IPV6 8 64#define REGEX_MAX_PATH_LEN_IPV6 8
@@ -219,9 +219,9 @@ struct ChannelMessageQueue
219struct ChannelState 219struct ChannelState
220{ 220{
221 /** 221 /**
222 * Mesh channel that is used for this connection. 222 * Cadet channel that is used for this connection.
223 */ 223 */
224 struct GNUNET_MESH_Channel *channel; 224 struct GNUNET_CADET_Channel *channel;
225 225
226 /** 226 /**
227 * Who is the other end of this channel. 227 * Who is the other end of this channel.
@@ -232,7 +232,7 @@ struct ChannelState
232 /** 232 /**
233 * Active channel transmission request (or NULL). 233 * Active channel transmission request (or NULL).
234 */ 234 */
235 struct GNUNET_MESH_TransmitHandle *th; 235 struct GNUNET_CADET_TransmitHandle *th;
236 236
237 /** 237 /**
238 * #GNUNET_NO if this is a channel for TCP/UDP, 238 * #GNUNET_NO if this is a channel for TCP/UDP,
@@ -369,9 +369,9 @@ static struct in_addr exit_ipv4mask;
369static struct GNUNET_STATISTICS_Handle *stats; 369static struct GNUNET_STATISTICS_Handle *stats;
370 370
371/** 371/**
372 * The handle to mesh 372 * The handle to cadet
373 */ 373 */
374static struct GNUNET_MESH_Handle *mesh_handle; 374static struct GNUNET_CADET_Handle *cadet_handle;
375 375
376/** 376/**
377 * This hashmaps contains the mapping from peer, service-descriptor, 377 * This hashmaps contains the mapping from peer, service-descriptor,
@@ -462,7 +462,7 @@ static int ipv6_enabled;
462 462
463 463
464/** 464/**
465 * We got a reply from DNS for a request of a MESH channel. Send it 465 * We got a reply from DNS for a request of a CADET channel. Send it
466 * via the channel (after changing the request ID back). 466 * via the channel (after changing the request ID back).
467 * 467 *
468 * @param cls the 'struct ChannelState' 468 * @param cls the 'struct ChannelState'
@@ -471,7 +471,7 @@ static int ipv6_enabled;
471 * @return number of bytes written to buf 471 * @return number of bytes written to buf
472 */ 472 */
473static size_t 473static size_t
474transmit_reply_to_mesh (void *cls, 474transmit_reply_to_cadet (void *cls,
475 size_t size, 475 size_t size,
476 void *buf) 476 void *buf)
477{ 477{
@@ -528,31 +528,31 @@ process_dns_result (void *cls,
528 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 528 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
529 "Processing DNS result from stub resolver\n"); 529 "Processing DNS result from stub resolver\n");
530 GNUNET_assert (NULL == cls); 530 GNUNET_assert (NULL == cls);
531 /* Handle case that this is a reply to a request from a MESH DNS channel */ 531 /* Handle case that this is a reply to a request from a CADET DNS channel */
532 ts = channels[dns->id]; 532 ts = channels[dns->id];
533 if ( (NULL == ts) || 533 if ( (NULL == ts) ||
534 (ts->specifics.dns.rs != rs) ) 534 (ts->specifics.dns.rs != rs) )
535 return; 535 return;
536 LOG (GNUNET_ERROR_TYPE_DEBUG, 536 LOG (GNUNET_ERROR_TYPE_DEBUG,
537 "Got a response from the stub resolver for DNS request received via MESH!\n"); 537 "Got a response from the stub resolver for DNS request received via CADET!\n");
538 channels[dns->id] = NULL; 538 channels[dns->id] = NULL;
539 GNUNET_free_non_null (ts->specifics.dns.reply); 539 GNUNET_free_non_null (ts->specifics.dns.reply);
540 ts->specifics.dns.reply = GNUNET_malloc (r); 540 ts->specifics.dns.reply = GNUNET_malloc (r);
541 ts->specifics.dns.reply_length = r; 541 ts->specifics.dns.reply_length = r;
542 memcpy (ts->specifics.dns.reply, dns, r); 542 memcpy (ts->specifics.dns.reply, dns, r);
543 if (NULL != ts->th) 543 if (NULL != ts->th)
544 GNUNET_MESH_notify_transmit_ready_cancel (ts->th); 544 GNUNET_CADET_notify_transmit_ready_cancel (ts->th);
545 ts->th = GNUNET_MESH_notify_transmit_ready (ts->channel, 545 ts->th = GNUNET_CADET_notify_transmit_ready (ts->channel,
546 GNUNET_NO, 546 GNUNET_NO,
547 GNUNET_TIME_UNIT_FOREVER_REL, 547 GNUNET_TIME_UNIT_FOREVER_REL,
548 sizeof (struct GNUNET_MessageHeader) + r, 548 sizeof (struct GNUNET_MessageHeader) + r,
549 &transmit_reply_to_mesh, 549 &transmit_reply_to_cadet,
550 ts); 550 ts);
551} 551}
552 552
553 553
554/** 554/**
555 * Process a request via mesh to perform a DNS query. 555 * Process a request via cadet to perform a DNS query.
556 * 556 *
557 * @param cls closure, NULL 557 * @param cls closure, NULL
558 * @param channel connection to the other end 558 * @param channel connection to the other end
@@ -563,7 +563,7 @@ process_dns_result (void *cls,
563 * #GNUNET_SYSERR to close it (signal serious error) 563 * #GNUNET_SYSERR to close it (signal serious error)
564 */ 564 */
565static int 565static int
566receive_dns_request (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Channel *channel, 566receive_dns_request (void *cls GNUNET_UNUSED, struct GNUNET_CADET_Channel *channel,
567 void **channel_ctx, 567 void **channel_ctx,
568 const struct GNUNET_MessageHeader *message) 568 const struct GNUNET_MessageHeader *message)
569{ 569{
@@ -807,7 +807,7 @@ store_service (struct GNUNET_CONTAINER_MultiHashMap *service_map,
807 807
808 808
809/** 809/**
810 * MESH is ready to receive a message for the channel. Transmit it. 810 * CADET is ready to receive a message for the channel. Transmit it.
811 * 811 *
812 * @param cls the 'struct ChannelState'. 812 * @param cls the 'struct ChannelState'.
813 * @param size number of bytes available in buf 813 * @param size number of bytes available in buf
@@ -818,7 +818,7 @@ static size_t
818send_to_peer_notify_callback (void *cls, size_t size, void *buf) 818send_to_peer_notify_callback (void *cls, size_t size, void *buf)
819{ 819{
820 struct ChannelState *s = cls; 820 struct ChannelState *s = cls;
821 struct GNUNET_MESH_Channel *channel = s->channel; 821 struct GNUNET_CADET_Channel *channel = s->channel;
822 struct ChannelMessageQueue *tnq; 822 struct ChannelMessageQueue *tnq;
823 823
824 s->th = NULL; 824 s->th = NULL;
@@ -827,7 +827,7 @@ send_to_peer_notify_callback (void *cls, size_t size, void *buf)
827 return 0; 827 return 0;
828 if (0 == size) 828 if (0 == size)
829 { 829 {
830 s->th = GNUNET_MESH_notify_transmit_ready (channel, 830 s->th = GNUNET_CADET_notify_transmit_ready (channel,
831 GNUNET_NO /* corking */, 831 GNUNET_NO /* corking */,
832 GNUNET_TIME_UNIT_FOREVER_REL, 832 GNUNET_TIME_UNIT_FOREVER_REL,
833 tnq->len, 833 tnq->len,
@@ -843,36 +843,36 @@ send_to_peer_notify_callback (void *cls, size_t size, void *buf)
843 tnq); 843 tnq);
844 GNUNET_free (tnq); 844 GNUNET_free (tnq);
845 if (NULL != (tnq = s->specifics.tcp_udp.head)) 845 if (NULL != (tnq = s->specifics.tcp_udp.head))
846 s->th = GNUNET_MESH_notify_transmit_ready (channel, 846 s->th = GNUNET_CADET_notify_transmit_ready (channel,
847 GNUNET_NO /* corking */, 847 GNUNET_NO /* corking */,
848 GNUNET_TIME_UNIT_FOREVER_REL, 848 GNUNET_TIME_UNIT_FOREVER_REL,
849 tnq->len, 849 tnq->len,
850 &send_to_peer_notify_callback, 850 &send_to_peer_notify_callback,
851 s); 851 s);
852 GNUNET_STATISTICS_update (stats, 852 GNUNET_STATISTICS_update (stats,
853 gettext_noop ("# Bytes transmitted via mesh channels"), 853 gettext_noop ("# Bytes transmitted via cadet channels"),
854 size, GNUNET_NO); 854 size, GNUNET_NO);
855 return size; 855 return size;
856} 856}
857 857
858 858
859/** 859/**
860 * Send the given packet via the mesh channel. 860 * Send the given packet via the cadet channel.
861 * 861 *
862 * @param s channel destination 862 * @param s channel destination
863 * @param tnq message to queue 863 * @param tnq message to queue
864 */ 864 */
865static void 865static void
866send_packet_to_mesh_channel (struct ChannelState *s, 866send_packet_to_cadet_channel (struct ChannelState *s,
867 struct ChannelMessageQueue *tnq) 867 struct ChannelMessageQueue *tnq)
868{ 868{
869 struct GNUNET_MESH_Channel *mesh_channel; 869 struct GNUNET_CADET_Channel *cadet_channel;
870 870
871 mesh_channel = s->channel; 871 cadet_channel = s->channel;
872 GNUNET_assert (NULL != s); 872 GNUNET_assert (NULL != s);
873 GNUNET_CONTAINER_DLL_insert_tail (s->specifics.tcp_udp.head, s->specifics.tcp_udp.tail, tnq); 873 GNUNET_CONTAINER_DLL_insert_tail (s->specifics.tcp_udp.head, s->specifics.tcp_udp.tail, tnq);
874 if (NULL == s->th) 874 if (NULL == s->th)
875 s->th = GNUNET_MESH_notify_transmit_ready (mesh_channel, 875 s->th = GNUNET_CADET_notify_transmit_ready (cadet_channel,
876 GNUNET_NO /* cork */, 876 GNUNET_NO /* cork */,
877 GNUNET_TIME_UNIT_FOREVER_REL, 877 GNUNET_TIME_UNIT_FOREVER_REL,
878 tnq->len, 878 tnq->len,
@@ -1065,7 +1065,7 @@ icmp_from_helper (const struct GNUNET_TUN_IcmpHeader *icmp,
1065 memcpy (&i2v->icmp_header, 1065 memcpy (&i2v->icmp_header,
1066 icmp, 1066 icmp,
1067 pktlen); 1067 pktlen);
1068 send_packet_to_mesh_channel (state, tnq); 1068 send_packet_to_cadet_channel (state, tnq);
1069} 1069}
1070 1070
1071 1071
@@ -1142,7 +1142,7 @@ udp_from_helper (const struct GNUNET_TUN_UdpHeader *udp,
1142 memcpy (&urm[1], 1142 memcpy (&urm[1],
1143 &udp[1], 1143 &udp[1],
1144 pktlen - sizeof (struct GNUNET_TUN_UdpHeader)); 1144 pktlen - sizeof (struct GNUNET_TUN_UdpHeader));
1145 send_packet_to_mesh_channel (state, tnq); 1145 send_packet_to_cadet_channel (state, tnq);
1146} 1146}
1147 1147
1148 1148
@@ -1230,7 +1230,7 @@ tcp_from_helper (const struct GNUNET_TUN_TcpHeader *tcp,
1230 memcpy (&tdm->tcp_header, 1230 memcpy (&tdm->tcp_header,
1231 buf, 1231 buf,
1232 pktlen); 1232 pktlen);
1233 send_packet_to_mesh_channel (state, tnq); 1233 send_packet_to_cadet_channel (state, tnq);
1234} 1234}
1235 1235
1236 1236
@@ -1486,7 +1486,7 @@ setup_fresh_address (int af,
1486 * We are starting a fresh connection (TCP or UDP) and need 1486 * We are starting a fresh connection (TCP or UDP) and need
1487 * to pick a source port and IP address (within the correct 1487 * to pick a source port and IP address (within the correct
1488 * range and address family) to associate replies with the 1488 * range and address family) to associate replies with the
1489 * connection / correct mesh channel. This function generates 1489 * connection / correct cadet channel. This function generates
1490 * a "fresh" source IP and source port number for a connection 1490 * a "fresh" source IP and source port number for a connection
1491 * After picking a good source address, this function sets up 1491 * After picking a good source address, this function sets up
1492 * the state in the 'connections_map' and 'connections_heap' 1492 * the state in the 'connections_map' and 'connections_heap'
@@ -1549,7 +1549,7 @@ setup_state_record (struct ChannelState *state)
1549 s = GNUNET_CONTAINER_heap_remove_root (connections_heap); 1549 s = GNUNET_CONTAINER_heap_remove_root (connections_heap);
1550 GNUNET_assert (state != s); 1550 GNUNET_assert (state != s);
1551 s->specifics.tcp_udp.heap_node = NULL; 1551 s->specifics.tcp_udp.heap_node = NULL;
1552 GNUNET_MESH_channel_destroy (s->channel); 1552 GNUNET_CADET_channel_destroy (s->channel);
1553 GNUNET_assert (GNUNET_OK == 1553 GNUNET_assert (GNUNET_OK ==
1554 GNUNET_CONTAINER_multihashmap_remove (connections_map, 1554 GNUNET_CONTAINER_multihashmap_remove (connections_map,
1555 &s->specifics.tcp_udp.state_key, 1555 &s->specifics.tcp_udp.state_key,
@@ -1833,7 +1833,7 @@ send_tcp_packet_via_tun (const struct SocketAddress *destination_address,
1833 1833
1834 1834
1835/** 1835/**
1836 * Process a request via mesh to send a request to a TCP service 1836 * Process a request via cadet to send a request to a TCP service
1837 * offered by this system. 1837 * offered by this system.
1838 * 1838 *
1839 * @param cls closure, NULL 1839 * @param cls closure, NULL
@@ -1845,7 +1845,7 @@ send_tcp_packet_via_tun (const struct SocketAddress *destination_address,
1845 */ 1845 */
1846static int 1846static int
1847receive_tcp_service (void *cls, 1847receive_tcp_service (void *cls,
1848 struct GNUNET_MESH_Channel *channel, 1848 struct GNUNET_CADET_Channel *channel,
1849 void **channel_ctx, 1849 void **channel_ctx,
1850 const struct GNUNET_MessageHeader *message) 1850 const struct GNUNET_MessageHeader *message)
1851{ 1851{
@@ -1869,10 +1869,10 @@ receive_tcp_service (void *cls,
1869 state->is_dns = GNUNET_NO; 1869 state->is_dns = GNUNET_NO;
1870 } 1870 }
1871 GNUNET_STATISTICS_update (stats, 1871 GNUNET_STATISTICS_update (stats,
1872 gettext_noop ("# TCP service creation requests received via mesh"), 1872 gettext_noop ("# TCP service creation requests received via cadet"),
1873 1, GNUNET_NO); 1873 1, GNUNET_NO);
1874 GNUNET_STATISTICS_update (stats, 1874 GNUNET_STATISTICS_update (stats,
1875 gettext_noop ("# Bytes received from MESH"), 1875 gettext_noop ("# Bytes received from CADET"),
1876 pkt_len, GNUNET_NO); 1876 pkt_len, GNUNET_NO);
1877 /* check that we got at least a valid header */ 1877 /* check that we got at least a valid header */
1878 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpServiceStartMessage)) 1878 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpServiceStartMessage))
@@ -1937,7 +1937,7 @@ receive_tcp_service (void *cls,
1937 * GNUNET_SYSERR to close it (signal serious error) 1937 * GNUNET_SYSERR to close it (signal serious error)
1938 */ 1938 */
1939static int 1939static int
1940receive_tcp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Channel *channel, 1940receive_tcp_remote (void *cls GNUNET_UNUSED, struct GNUNET_CADET_Channel *channel,
1941 void **channel_ctx GNUNET_UNUSED, 1941 void **channel_ctx GNUNET_UNUSED,
1942 const struct GNUNET_MessageHeader *message) 1942 const struct GNUNET_MessageHeader *message)
1943{ 1943{
@@ -1965,10 +1965,10 @@ receive_tcp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Channel *channel
1965 state->is_dns = GNUNET_NO; 1965 state->is_dns = GNUNET_NO;
1966 } 1966 }
1967 GNUNET_STATISTICS_update (stats, 1967 GNUNET_STATISTICS_update (stats,
1968 gettext_noop ("# Bytes received from MESH"), 1968 gettext_noop ("# Bytes received from CADET"),
1969 pkt_len, GNUNET_NO); 1969 pkt_len, GNUNET_NO);
1970 GNUNET_STATISTICS_update (stats, 1970 GNUNET_STATISTICS_update (stats,
1971 gettext_noop ("# TCP IP-exit creation requests received via mesh"), 1971 gettext_noop ("# TCP IP-exit creation requests received via cadet"),
1972 1, GNUNET_NO); 1972 1, GNUNET_NO);
1973 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpInternetStartMessage)) 1973 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpInternetStartMessage))
1974 { 1974 {
@@ -2061,7 +2061,7 @@ receive_tcp_remote (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Channel *channel
2061 * #GNUNET_SYSERR to close it (signal serious error) 2061 * #GNUNET_SYSERR to close it (signal serious error)
2062 */ 2062 */
2063static int 2063static int
2064receive_tcp_data (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Channel *channel, 2064receive_tcp_data (void *cls GNUNET_UNUSED, struct GNUNET_CADET_Channel *channel,
2065 void **channel_ctx GNUNET_UNUSED, 2065 void **channel_ctx GNUNET_UNUSED,
2066 const struct GNUNET_MessageHeader *message) 2066 const struct GNUNET_MessageHeader *message)
2067{ 2067{
@@ -2070,10 +2070,10 @@ receive_tcp_data (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Channel *channel,
2070 uint16_t pkt_len = ntohs (message->size); 2070 uint16_t pkt_len = ntohs (message->size);
2071 2071
2072 GNUNET_STATISTICS_update (stats, 2072 GNUNET_STATISTICS_update (stats,
2073 gettext_noop ("# Bytes received from MESH"), 2073 gettext_noop ("# Bytes received from CADET"),
2074 pkt_len, GNUNET_NO); 2074 pkt_len, GNUNET_NO);
2075 GNUNET_STATISTICS_update (stats, 2075 GNUNET_STATISTICS_update (stats,
2076 gettext_noop ("# TCP data requests received via mesh"), 2076 gettext_noop ("# TCP data requests received via cadet"),
2077 1, GNUNET_NO); 2077 1, GNUNET_NO);
2078 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpDataMessage)) 2078 if (pkt_len < sizeof (struct GNUNET_EXIT_TcpDataMessage))
2079 { 2079 {
@@ -2294,7 +2294,7 @@ make_up_icmpv6_payload (struct ChannelState *state,
2294 */ 2294 */
2295static int 2295static int
2296receive_icmp_remote (void *cls, 2296receive_icmp_remote (void *cls,
2297 struct GNUNET_MESH_Channel *channel, 2297 struct GNUNET_CADET_Channel *channel,
2298 void **channel_ctx, 2298 void **channel_ctx,
2299 const struct GNUNET_MessageHeader *message) 2299 const struct GNUNET_MessageHeader *message)
2300{ 2300{
@@ -2318,10 +2318,10 @@ receive_icmp_remote (void *cls,
2318 state->is_dns = GNUNET_NO; 2318 state->is_dns = GNUNET_NO;
2319 } 2319 }
2320 GNUNET_STATISTICS_update (stats, 2320 GNUNET_STATISTICS_update (stats,
2321 gettext_noop ("# Bytes received from MESH"), 2321 gettext_noop ("# Bytes received from CADET"),
2322 pkt_len, GNUNET_NO); 2322 pkt_len, GNUNET_NO);
2323 GNUNET_STATISTICS_update (stats, 2323 GNUNET_STATISTICS_update (stats,
2324 gettext_noop ("# ICMP IP-exit requests received via mesh"), 2324 gettext_noop ("# ICMP IP-exit requests received via cadet"),
2325 1, GNUNET_NO); 2325 1, GNUNET_NO);
2326 if (pkt_len < sizeof (struct GNUNET_EXIT_IcmpInternetMessage)) 2326 if (pkt_len < sizeof (struct GNUNET_EXIT_IcmpInternetMessage))
2327 { 2327 {
@@ -2533,7 +2533,7 @@ make_up_icmp_service_payload (struct ChannelState *state,
2533 2533
2534 2534
2535/** 2535/**
2536 * Process a request via mesh to send ICMP data to a service 2536 * Process a request via cadet to send ICMP data to a service
2537 * offered by this system. 2537 * offered by this system.
2538 * 2538 *
2539 * @param cls closure, NULL 2539 * @param cls closure, NULL
@@ -2545,7 +2545,7 @@ make_up_icmp_service_payload (struct ChannelState *state,
2545 */ 2545 */
2546static int 2546static int
2547receive_icmp_service (void *cls, 2547receive_icmp_service (void *cls,
2548 struct GNUNET_MESH_Channel *channel, 2548 struct GNUNET_CADET_Channel *channel,
2549 void **channel_ctx, 2549 void **channel_ctx,
2550 const struct GNUNET_MessageHeader *message) 2550 const struct GNUNET_MessageHeader *message)
2551{ 2551{
@@ -2567,10 +2567,10 @@ receive_icmp_service (void *cls,
2567 state->is_dns = GNUNET_NO; 2567 state->is_dns = GNUNET_NO;
2568 } 2568 }
2569 GNUNET_STATISTICS_update (stats, 2569 GNUNET_STATISTICS_update (stats,
2570 gettext_noop ("# Bytes received from MESH"), 2570 gettext_noop ("# Bytes received from CADET"),
2571 pkt_len, GNUNET_NO); 2571 pkt_len, GNUNET_NO);
2572 GNUNET_STATISTICS_update (stats, 2572 GNUNET_STATISTICS_update (stats,
2573 gettext_noop ("# ICMP service requests received via mesh"), 2573 gettext_noop ("# ICMP service requests received via cadet"),
2574 1, GNUNET_NO); 2574 1, GNUNET_NO);
2575 /* check that we got at least a valid header */ 2575 /* check that we got at least a valid header */
2576 if (pkt_len < sizeof (struct GNUNET_EXIT_IcmpServiceMessage)) 2576 if (pkt_len < sizeof (struct GNUNET_EXIT_IcmpServiceMessage))
@@ -2833,7 +2833,7 @@ send_udp_packet_via_tun (const struct SocketAddress *destination_address,
2833 */ 2833 */
2834static int 2834static int
2835receive_udp_remote (void *cls, 2835receive_udp_remote (void *cls,
2836 struct GNUNET_MESH_Channel *channel, 2836 struct GNUNET_CADET_Channel *channel,
2837 void **channel_ctx, 2837 void **channel_ctx,
2838 const struct GNUNET_MessageHeader *message) 2838 const struct GNUNET_MessageHeader *message)
2839{ 2839{
@@ -2856,10 +2856,10 @@ receive_udp_remote (void *cls,
2856 state->is_dns = GNUNET_NO; 2856 state->is_dns = GNUNET_NO;
2857 } 2857 }
2858 GNUNET_STATISTICS_update (stats, 2858 GNUNET_STATISTICS_update (stats,
2859 gettext_noop ("# Bytes received from MESH"), 2859 gettext_noop ("# Bytes received from CADET"),
2860 pkt_len, GNUNET_NO); 2860 pkt_len, GNUNET_NO);
2861 GNUNET_STATISTICS_update (stats, 2861 GNUNET_STATISTICS_update (stats,
2862 gettext_noop ("# UDP IP-exit requests received via mesh"), 2862 gettext_noop ("# UDP IP-exit requests received via cadet"),
2863 1, GNUNET_NO); 2863 1, GNUNET_NO);
2864 if (pkt_len < sizeof (struct GNUNET_EXIT_UdpInternetMessage)) 2864 if (pkt_len < sizeof (struct GNUNET_EXIT_UdpInternetMessage))
2865 { 2865 {
@@ -2932,7 +2932,7 @@ receive_udp_remote (void *cls,
2932 2932
2933 2933
2934/** 2934/**
2935 * Process a request via mesh to send a request to a UDP service 2935 * Process a request via cadet to send a request to a UDP service
2936 * offered by this system. 2936 * offered by this system.
2937 * 2937 *
2938 * @param cls closure, NULL 2938 * @param cls closure, NULL
@@ -2944,7 +2944,7 @@ receive_udp_remote (void *cls,
2944 */ 2944 */
2945static int 2945static int
2946receive_udp_service (void *cls, 2946receive_udp_service (void *cls,
2947 struct GNUNET_MESH_Channel *channel, 2947 struct GNUNET_CADET_Channel *channel,
2948 void **channel_ctx, 2948 void **channel_ctx,
2949 const struct GNUNET_MessageHeader *message) 2949 const struct GNUNET_MessageHeader *message)
2950{ 2950{
@@ -2963,10 +2963,10 @@ receive_udp_service (void *cls,
2963 state->is_dns = GNUNET_NO; 2963 state->is_dns = GNUNET_NO;
2964 } 2964 }
2965 GNUNET_STATISTICS_update (stats, 2965 GNUNET_STATISTICS_update (stats,
2966 gettext_noop ("# Bytes received from MESH"), 2966 gettext_noop ("# Bytes received from CADET"),
2967 pkt_len, GNUNET_NO); 2967 pkt_len, GNUNET_NO);
2968 GNUNET_STATISTICS_update (stats, 2968 GNUNET_STATISTICS_update (stats,
2969 gettext_noop ("# UDP service requests received via mesh"), 2969 gettext_noop ("# UDP service requests received via cadet"),
2970 1, GNUNET_NO); 2970 1, GNUNET_NO);
2971 /* check that we got at least a valid header */ 2971 /* check that we got at least a valid header */
2972 if (pkt_len < sizeof (struct GNUNET_EXIT_UdpServiceMessage)) 2972 if (pkt_len < sizeof (struct GNUNET_EXIT_UdpServiceMessage))
@@ -3008,7 +3008,7 @@ receive_udp_service (void *cls,
3008 3008
3009 3009
3010/** 3010/**
3011 * Callback from GNUNET_MESH for new channels. 3011 * Callback from GNUNET_CADET for new channels.
3012 * 3012 *
3013 * @param cls closure 3013 * @param cls closure
3014 * @param channel new handle to the channel 3014 * @param channel new handle to the channel
@@ -3019,16 +3019,16 @@ receive_udp_service (void *cls,
3019 */ 3019 */
3020static void * 3020static void *
3021new_channel (void *cls, 3021new_channel (void *cls,
3022 struct GNUNET_MESH_Channel *channel, 3022 struct GNUNET_CADET_Channel *channel,
3023 const struct GNUNET_PeerIdentity *initiator, 3023 const struct GNUNET_PeerIdentity *initiator,
3024 uint32_t port, enum GNUNET_MESH_ChannelOption options) 3024 uint32_t port, enum GNUNET_CADET_ChannelOption options)
3025{ 3025{
3026 struct ChannelState *s = GNUNET_new (struct ChannelState); 3026 struct ChannelState *s = GNUNET_new (struct ChannelState);
3027 3027
3028 s->is_dns = GNUNET_SYSERR; 3028 s->is_dns = GNUNET_SYSERR;
3029 s->peer = *initiator; 3029 s->peer = *initiator;
3030 GNUNET_STATISTICS_update (stats, 3030 GNUNET_STATISTICS_update (stats,
3031 gettext_noop ("# Inbound MESH channels created"), 3031 gettext_noop ("# Inbound CADET channels created"),
3032 1, GNUNET_NO); 3032 1, GNUNET_NO);
3033 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3033 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3034 "Received inbound channel from `%s'\n", 3034 "Received inbound channel from `%s'\n",
@@ -3039,17 +3039,17 @@ new_channel (void *cls,
3039 3039
3040 3040
3041/** 3041/**
3042 * Function called by mesh whenever an inbound channel is destroyed. 3042 * Function called by cadet whenever an inbound channel is destroyed.
3043 * Should clean up any associated state. 3043 * Should clean up any associated state.
3044 * 3044 *
3045 * @param cls closure (set from #GNUNET_MESH_connect) 3045 * @param cls closure (set from #GNUNET_CADET_connect)
3046 * @param channel connection to the other end (henceforth invalid) 3046 * @param channel connection to the other end (henceforth invalid)
3047 * @param channel_ctx place where local state associated 3047 * @param channel_ctx place where local state associated
3048 * with the channel is stored 3048 * with the channel is stored
3049 */ 3049 */
3050static void 3050static void
3051clean_channel (void *cls, 3051clean_channel (void *cls,
3052 const struct GNUNET_MESH_Channel *channel, 3052 const struct GNUNET_CADET_Channel *channel,
3053 void *channel_ctx) 3053 void *channel_ctx)
3054{ 3054{
3055 struct ChannelState *s = channel_ctx; 3055 struct ChannelState *s = channel_ctx;
@@ -3089,7 +3089,7 @@ clean_channel (void *cls,
3089 } 3089 }
3090 if (NULL != s->th) 3090 if (NULL != s->th)
3091 { 3091 {
3092 GNUNET_MESH_notify_transmit_ready_cancel (s->th); 3092 GNUNET_CADET_notify_transmit_ready_cancel (s->th);
3093 s->th = NULL; 3093 s->th = NULL;
3094 } 3094 }
3095 GNUNET_free (s); 3095 GNUNET_free (s);
@@ -3140,10 +3140,10 @@ cleanup (void *cls,
3140 GNUNET_REGEX_announce_cancel (regex6); 3140 GNUNET_REGEX_announce_cancel (regex6);
3141 regex6 = NULL; 3141 regex6 = NULL;
3142 } 3142 }
3143 if (NULL != mesh_handle) 3143 if (NULL != cadet_handle)
3144 { 3144 {
3145 GNUNET_MESH_disconnect (mesh_handle); 3145 GNUNET_CADET_disconnect (cadet_handle);
3146 mesh_handle = NULL; 3146 cadet_handle = NULL;
3147 } 3147 }
3148 if (NULL != connections_map) 3148 if (NULL != connections_map)
3149 { 3149 {
@@ -3465,7 +3465,7 @@ run (void *cls,
3465 const char *cfgfile, 3465 const char *cfgfile,
3466 const struct GNUNET_CONFIGURATION_Handle *cfg_) 3466 const struct GNUNET_CONFIGURATION_Handle *cfg_)
3467{ 3467{
3468 static struct GNUNET_MESH_MessageHandler handlers[] = { 3468 static struct GNUNET_CADET_MessageHandler handlers[] = {
3469 {&receive_icmp_service, GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_SERVICE, 0}, 3469 {&receive_icmp_service, GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_SERVICE, 0},
3470 {&receive_icmp_remote, GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_INTERNET, 0}, 3470 {&receive_icmp_remote, GNUNET_MESSAGE_TYPE_VPN_ICMP_TO_INTERNET, 0},
3471 {&receive_udp_service, GNUNET_MESSAGE_TYPE_VPN_UDP_TO_SERVICE, 0}, 3471 {&receive_udp_service, GNUNET_MESSAGE_TYPE_VPN_UDP_TO_SERVICE, 0},
@@ -3718,18 +3718,18 @@ run (void *cls,
3718 GNUNET_SCHEDULER_shutdown (); 3718 GNUNET_SCHEDULER_shutdown ();
3719 return; 3719 return;
3720 } 3720 }
3721 mesh_handle 3721 cadet_handle
3722 = GNUNET_MESH_connect (cfg, NULL, 3722 = GNUNET_CADET_connect (cfg, NULL,
3723 &new_channel, 3723 &new_channel,
3724 &clean_channel, handlers, 3724 &clean_channel, handlers,
3725 apptypes); 3725 apptypes);
3726 if (NULL == mesh_handle) 3726 if (NULL == cadet_handle)
3727 { 3727 {
3728 GNUNET_SCHEDULER_shutdown (); 3728 GNUNET_SCHEDULER_shutdown ();
3729 return; 3729 return;
3730 } 3730 }
3731 3731
3732 /* Mesh handle acquired, now announce regular expressions matching our exit */ 3732 /* Cadet handle acquired, now announce regular expressions matching our exit */
3733 if ( (GNUNET_YES == ipv4_enabled) && (GNUNET_YES == ipv4_exit) ) 3733 if ( (GNUNET_YES == ipv4_enabled) && (GNUNET_YES == ipv4_exit) )
3734 { 3734 {
3735 policy = NULL; 3735 policy = NULL;