aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-05-14 16:50:31 +0000
committerBart Polot <bart@net.in.tum.de>2014-05-14 16:50:31 +0000
commit5c0ab6d4fc351e7924f609a1f3bd3ba24f9230ae (patch)
tree04f25e47ea152300815684de13489846708cb028 /src
parent9aaa554470dbff968c6cab7a2850a15318c1f15b (diff)
downloadgnunet-5c0ab6d4fc351e7924f609a1f3bd3ba24f9230ae.tar.gz
gnunet-5c0ab6d4fc351e7924f609a1f3bd3ba24f9230ae.zip
- stop using CadetTunnel3 and go back to CadetTunnel
Diffstat (limited to 'src')
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c18
-rw-r--r--src/cadet/gnunet-service-cadet_channel.h4
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c10
-rw-r--r--src/cadet/gnunet-service-cadet_connection.h4
-rw-r--r--src/cadet/gnunet-service-cadet_local.c4
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c10
-rw-r--r--src/cadet/gnunet-service-cadet_peer.h4
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c170
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.h86
9 files changed, 155 insertions, 155 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index c85900456..b5fa02868 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -69,7 +69,7 @@ struct CadetChannelQueue
69 /** 69 /**
70 * Tunnel Queue. 70 * Tunnel Queue.
71 */ 71 */
72 struct CadetTunnel3Queue *tq; 72 struct CadetTunnelQueue *tq;
73 73
74 /** 74 /**
75 * Message type (DATA/DATA_ACK) 75 * Message type (DATA/DATA_ACK)
@@ -205,7 +205,7 @@ struct CadetChannel
205 /** 205 /**
206 * Tunnel this channel is in. 206 * Tunnel this channel is in.
207 */ 207 */
208 struct CadetTunnel3 *t; 208 struct CadetTunnel *t;
209 209
210 /** 210 /**
211 * Destination port of the channel. 211 * Destination port of the channel.
@@ -789,8 +789,8 @@ channel_recreate (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
789 */ 789 */
790static void 790static void
791ch_message_sent (void *cls, 791ch_message_sent (void *cls,
792 struct CadetTunnel3 *t, 792 struct CadetTunnel *t,
793 struct CadetTunnel3Queue *q, 793 struct CadetTunnelQueue *q,
794 uint16_t type, size_t size) 794 uint16_t type, size_t size)
795{ 795{
796 struct CadetChannelQueue *chq = cls; 796 struct CadetChannelQueue *chq = cls;
@@ -1248,7 +1248,7 @@ channel_save_copy (struct CadetChannel *ch,
1248 * @return A new initialized channel. NULL on error. 1248 * @return A new initialized channel. NULL on error.
1249 */ 1249 */
1250static struct CadetChannel * 1250static struct CadetChannel *
1251channel_new (struct CadetTunnel3 *t, 1251channel_new (struct CadetTunnel *t,
1252 struct CadetClient *owner, 1252 struct CadetClient *owner,
1253 CADET_ChannelNumber lid_root) 1253 CADET_ChannelNumber lid_root)
1254{ 1254{
@@ -1348,7 +1348,7 @@ void
1348GCCH_destroy (struct CadetChannel *ch) 1348GCCH_destroy (struct CadetChannel *ch)
1349{ 1349{
1350 struct CadetClient *c; 1350 struct CadetClient *c;
1351 struct CadetTunnel3 *t; 1351 struct CadetTunnel *t;
1352 1352
1353 if (NULL == ch) 1353 if (NULL == ch)
1354 return; 1354 return;
@@ -1405,7 +1405,7 @@ GCCH_get_id (const struct CadetChannel *ch)
1405 * 1405 *
1406 * @return tunnel of the channel. 1406 * @return tunnel of the channel.
1407 */ 1407 */
1408struct CadetTunnel3 * 1408struct CadetTunnel *
1409GCCH_get_tunnel (const struct CadetChannel *ch) 1409GCCH_get_tunnel (const struct CadetChannel *ch)
1410{ 1410{
1411 return ch->t; 1411 return ch->t;
@@ -1827,7 +1827,7 @@ GCCH_handle_local_create (struct CadetClient *c,
1827 struct GNUNET_CADET_ChannelMessage *msg) 1827 struct GNUNET_CADET_ChannelMessage *msg)
1828{ 1828{
1829 struct CadetChannel *ch; 1829 struct CadetChannel *ch;
1830 struct CadetTunnel3 *t; 1830 struct CadetTunnel *t;
1831 struct CadetPeer *peer; 1831 struct CadetPeer *peer;
1832 CADET_ChannelNumber chid; 1832 CADET_ChannelNumber chid;
1833 1833
@@ -2096,7 +2096,7 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
2096 * @param msg Channel crate message. 2096 * @param msg Channel crate message.
2097 */ 2097 */
2098struct CadetChannel * 2098struct CadetChannel *
2099GCCH_handle_create (struct CadetTunnel3 *t, 2099GCCH_handle_create (struct CadetTunnel *t,
2100 const struct GNUNET_CADET_ChannelCreate *msg) 2100 const struct GNUNET_CADET_ChannelCreate *msg)
2101{ 2101{
2102 CADET_ChannelNumber chid; 2102 CADET_ChannelNumber chid;
diff --git a/src/cadet/gnunet-service-cadet_channel.h b/src/cadet/gnunet-service-cadet_channel.h
index a472669c5..c96958cf9 100644
--- a/src/cadet/gnunet-service-cadet_channel.h
+++ b/src/cadet/gnunet-service-cadet_channel.h
@@ -79,7 +79,7 @@ GCCH_get_id (const struct CadetChannel *ch);
79 * 79 *
80 * @return tunnel of the channel. 80 * @return tunnel of the channel.
81 */ 81 */
82struct CadetTunnel3 * 82struct CadetTunnel *
83GCCH_get_tunnel (const struct CadetChannel *ch); 83GCCH_get_tunnel (const struct CadetChannel *ch);
84 84
85/** 85/**
@@ -262,7 +262,7 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
262 * @param msg Channel crate message. 262 * @param msg Channel crate message.
263 */ 263 */
264struct CadetChannel * 264struct CadetChannel *
265GCCH_handle_create (struct CadetTunnel3 *t, 265GCCH_handle_create (struct CadetTunnel *t,
266 const struct GNUNET_CADET_ChannelCreate *msg); 266 const struct GNUNET_CADET_ChannelCreate *msg);
267 267
268/** 268/**
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 3552a942c..1e8aadf0a 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -146,7 +146,7 @@ struct CadetConnection
146 /** 146 /**
147 * Tunnel this connection is part of. 147 * Tunnel this connection is part of.
148 */ 148 */
149 struct CadetTunnel3 *t; 149 struct CadetTunnel *t;
150 150
151 /** 151 /**
152 * Flow control information for traffic fwd. 152 * Flow control information for traffic fwd.
@@ -799,7 +799,7 @@ is_fwd (const struct CadetConnection *c,
799static void 799static void
800send_connection_ack (struct CadetConnection *connection, int fwd) 800send_connection_ack (struct CadetConnection *connection, int fwd)
801{ 801{
802 struct CadetTunnel3 *t; 802 struct CadetTunnel *t;
803 803
804 t = connection->t; 804 t = connection->t;
805 LOG (GNUNET_ERROR_TYPE_INFO, "===> {%14s ACK} on connection %s\n", 805 LOG (GNUNET_ERROR_TYPE_INFO, "===> {%14s ACK} on connection %s\n",
@@ -2451,7 +2451,7 @@ GCC_shutdown (void)
2451 2451
2452struct CadetConnection * 2452struct CadetConnection *
2453GCC_new (const struct GNUNET_CADET_Hash *cid, 2453GCC_new (const struct GNUNET_CADET_Hash *cid,
2454 struct CadetTunnel3 *t, 2454 struct CadetTunnel *t,
2455 struct CadetPeerPath *p, 2455 struct CadetPeerPath *p,
2456 unsigned int own_pos) 2456 unsigned int own_pos)
2457{ 2457{
@@ -2625,7 +2625,7 @@ GCC_get_state (const struct CadetConnection *c)
2625 * 2625 *
2626 * @return tunnel of the connection. 2626 * @return tunnel of the connection.
2627 */ 2627 */
2628struct CadetTunnel3 * 2628struct CadetTunnel *
2629GCC_get_tunnel (const struct CadetConnection *c) 2629GCC_get_tunnel (const struct CadetConnection *c)
2630{ 2630{
2631 return c->t; 2631 return c->t;
@@ -3037,7 +3037,7 @@ GCC_cancel (struct CadetConnectionQueue *q)
3037void 3037void
3038GCC_send_create (struct CadetConnection *connection) 3038GCC_send_create (struct CadetConnection *connection)
3039{ 3039{
3040 enum CadetTunnel3CState state; 3040 enum CadetTunnelCState state;
3041 size_t size; 3041 size_t size;
3042 3042
3043 size = sizeof (struct GNUNET_CADET_ConnectionCreate); 3043 size = sizeof (struct GNUNET_CADET_ConnectionCreate);
diff --git a/src/cadet/gnunet-service-cadet_connection.h b/src/cadet/gnunet-service-cadet_connection.h
index 535488260..5d12ce7b3 100644
--- a/src/cadet/gnunet-service-cadet_connection.h
+++ b/src/cadet/gnunet-service-cadet_connection.h
@@ -267,7 +267,7 @@ GCC_shutdown (void);
267 */ 267 */
268struct CadetConnection * 268struct CadetConnection *
269GCC_new (const struct GNUNET_CADET_Hash *cid, 269GCC_new (const struct GNUNET_CADET_Hash *cid,
270 struct CadetTunnel3 *t, 270 struct CadetTunnel *t,
271 struct CadetPeerPath *p, 271 struct CadetPeerPath *p,
272 unsigned int own_pos); 272 unsigned int own_pos);
273 273
@@ -331,7 +331,7 @@ GCC_get_state (const struct CadetConnection *c);
331 * 331 *
332 * @return tunnel of the connection. 332 * @return tunnel of the connection.
333 */ 333 */
334struct CadetTunnel3 * 334struct CadetTunnel *
335GCC_get_tunnel (const struct CadetConnection *c); 335GCC_get_tunnel (const struct CadetConnection *c);
336 336
337/** 337/**
diff --git a/src/cadet/gnunet-service-cadet_local.c b/src/cadet/gnunet-service-cadet_local.c
index 9a36aae86..3f1c05bc3 100644
--- a/src/cadet/gnunet-service-cadet_local.c
+++ b/src/cadet/gnunet-service-cadet_local.c
@@ -666,7 +666,7 @@ get_all_tunnels_iterator (void *cls,
666 void *value) 666 void *value)
667{ 667{
668 struct GNUNET_SERVER_Client *client = cls; 668 struct GNUNET_SERVER_Client *client = cls;
669 struct CadetTunnel3 *t = value; 669 struct CadetTunnel *t = value;
670 struct GNUNET_CADET_LocalInfoTunnel msg; 670 struct GNUNET_CADET_LocalInfoTunnel msg;
671 671
672 msg.header.size = htons (sizeof (msg)); 672 msg.header.size = htons (sizeof (msg));
@@ -759,7 +759,7 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client,
759 const struct GNUNET_CADET_LocalInfo *msg; 759 const struct GNUNET_CADET_LocalInfo *msg;
760 struct GNUNET_CADET_LocalInfoTunnel *resp; 760 struct GNUNET_CADET_LocalInfoTunnel *resp;
761 struct CadetClient *c; 761 struct CadetClient *c;
762 struct CadetTunnel3 *t; 762 struct CadetTunnel *t;
763 unsigned int ch_n; 763 unsigned int ch_n;
764 unsigned int c_n; 764 unsigned int c_n;
765 size_t size; 765 size_t size;
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index 716165374..6d2402631 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -144,7 +144,7 @@ struct CadetPeer
144 /** 144 /**
145 * Tunnel to this peer, if any. 145 * Tunnel to this peer, if any.
146 */ 146 */
147 struct CadetTunnel3 *tunnel; 147 struct CadetTunnel *tunnel;
148 148
149 /** 149 /**
150 * Connections that go through this peer, indexed by tid; 150 * Connections that go through this peer, indexed by tid;
@@ -613,7 +613,7 @@ shutdown_tunnel (void *cls,
613 void *value) 613 void *value)
614{ 614{
615 struct CadetPeer *p = value; 615 struct CadetPeer *p = value;
616 struct CadetTunnel3 *t = p->tunnel; 616 struct CadetTunnel *t = p->tunnel;
617 617
618 if (NULL != t) 618 if (NULL != t)
619 GCT_destroy (t); 619 GCT_destroy (t);
@@ -1552,7 +1552,7 @@ try_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1552void 1552void
1553GCP_connect (struct CadetPeer *peer) 1553GCP_connect (struct CadetPeer *peer)
1554{ 1554{
1555 struct CadetTunnel3 *t; 1555 struct CadetTunnel *t;
1556 struct CadetPeerPath *p; 1556 struct CadetPeerPath *p;
1557 struct CadetConnection *c; 1557 struct CadetConnection *c;
1558 int rerun_search; 1558 int rerun_search;
@@ -2010,7 +2010,7 @@ GCP_get_short_id (const struct CadetPeer *peer)
2010 * @param t Tunnel. 2010 * @param t Tunnel.
2011 */ 2011 */
2012void 2012void
2013GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel3 *t) 2013GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel *t)
2014{ 2014{
2015 peer->tunnel = t; 2015 peer->tunnel = t;
2016 if (NULL == t && NULL != peer->search_h) 2016 if (NULL == t && NULL != peer->search_h)
@@ -2027,7 +2027,7 @@ GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel3 *t)
2027 * 2027 *
2028 * @return Tunnel towards peer. 2028 * @return Tunnel towards peer.
2029 */ 2029 */
2030struct CadetTunnel3 * 2030struct CadetTunnel *
2031GCP_get_tunnel (const struct CadetPeer *peer) 2031GCP_get_tunnel (const struct CadetPeer *peer)
2032{ 2032{
2033 return peer->tunnel; 2033 return peer->tunnel;
diff --git a/src/cadet/gnunet-service-cadet_peer.h b/src/cadet/gnunet-service-cadet_peer.h
index e9668305b..71e85d7ee 100644
--- a/src/cadet/gnunet-service-cadet_peer.h
+++ b/src/cadet/gnunet-service-cadet_peer.h
@@ -187,7 +187,7 @@ GCP_queue_unlock (struct CadetPeer *peer, struct CadetConnection *c);
187 * @param t Tunnel. 187 * @param t Tunnel.
188 */ 188 */
189void 189void
190GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel3 *t); 190GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel *t);
191 191
192/** 192/**
193 * Check whether there is a direct (core level) connection to peer. 193 * Check whether there is a direct (core level) connection to peer.
@@ -332,7 +332,7 @@ GCP_get_short_id (const struct CadetPeer *peer);
332 * 332 *
333 * @return Tunnel towards peer. 333 * @return Tunnel towards peer.
334 */ 334 */
335struct CadetTunnel3 * 335struct CadetTunnel *
336GCP_get_tunnel (const struct CadetPeer *peer); 336GCP_get_tunnel (const struct CadetPeer *peer);
337 337
338/** 338/**
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 971b186c9..f4952b870 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -101,7 +101,7 @@ struct CadetTunnelKXCtx
101/** 101/**
102 * Struct containing all information regarding a tunnel to a peer. 102 * Struct containing all information regarding a tunnel to a peer.
103 */ 103 */
104struct CadetTunnel3 104struct CadetTunnel
105{ 105{
106 /** 106 /**
107 * Endpoint of the tunnel. 107 * Endpoint of the tunnel.
@@ -111,12 +111,12 @@ struct CadetTunnel3
111 /** 111 /**
112 * State of the tunnel connectivity. 112 * State of the tunnel connectivity.
113 */ 113 */
114 enum CadetTunnel3CState cstate; 114 enum CadetTunnelCState cstate;
115 115
116 /** 116 /**
117 * State of the tunnel encryption. 117 * State of the tunnel encryption.
118 */ 118 */
119 enum CadetTunnel3EState estate; 119 enum CadetTunnelEState estate;
120 120
121 /** 121 /**
122 * Key eXchange context. 122 * Key eXchange context.
@@ -187,12 +187,12 @@ struct CadetTunnelDelayed
187 /** 187 /**
188 * Tunnel. 188 * Tunnel.
189 */ 189 */
190 struct CadetTunnel3 *t; 190 struct CadetTunnel *t;
191 191
192 /** 192 /**
193 * Tunnel queue given to the channel to cancel request. Update on send_queued. 193 * Tunnel queue given to the channel to cancel request. Update on send_queued.
194 */ 194 */
195 struct CadetTunnel3Queue *tq; 195 struct CadetTunnelQueue *tq;
196 196
197 /** 197 /**
198 * Message to send. 198 * Message to send.
@@ -204,7 +204,7 @@ struct CadetTunnelDelayed
204/** 204/**
205 * Handle for messages queued but not yet sent. 205 * Handle for messages queued but not yet sent.
206 */ 206 */
207struct CadetTunnel3Queue 207struct CadetTunnelQueue
208{ 208{
209 /** 209 /**
210 * Connection queue handle, to cancel if necessary. 210 * Connection queue handle, to cancel if necessary.
@@ -302,7 +302,7 @@ static struct GNUNET_TIME_Relative rekey_period;
302 * @return String representation. 302 * @return String representation.
303 */ 303 */
304static const char * 304static const char *
305cstate2s (enum CadetTunnel3CState cs) 305cstate2s (enum CadetTunnelCState cs)
306{ 306{
307 static char buf[128]; 307 static char buf[128];
308 308
@@ -333,7 +333,7 @@ cstate2s (enum CadetTunnel3CState cs)
333 * @return String representation. 333 * @return String representation.
334 */ 334 */
335static const char * 335static const char *
336estate2s (enum CadetTunnel3EState es) 336estate2s (enum CadetTunnelEState es)
337{ 337{
338 static char buf[128]; 338 static char buf[128];
339 339
@@ -366,7 +366,7 @@ estate2s (enum CadetTunnel3EState es)
366 * @return #GNUNET_YES if ready, #GNUNET_NO otherwise 366 * @return #GNUNET_YES if ready, #GNUNET_NO otherwise
367 */ 367 */
368static int 368static int
369is_ready (struct CadetTunnel3 *t) 369is_ready (struct CadetTunnel *t)
370{ 370{
371 int ready; 371 int ready;
372 372
@@ -490,7 +490,7 @@ get_connection_allowed (const struct CadetTConnection *tc)
490 * @return GNUNET_OK if message is fine, GNUNET_SYSERR otherwise. 490 * @return GNUNET_OK if message is fine, GNUNET_SYSERR otherwise.
491 */ 491 */
492int 492int
493check_ephemeral (struct CadetTunnel3 *t, 493check_ephemeral (struct CadetTunnel *t,
494 const struct GNUNET_CADET_KX_Ephemeral *msg) 494 const struct GNUNET_CADET_KX_Ephemeral *msg)
495{ 495{
496 /* Check message size */ 496 /* Check message size */
@@ -529,7 +529,7 @@ check_ephemeral (struct CadetTunnel3 *t,
529 * @param iv Initialization Vector to use. 529 * @param iv Initialization Vector to use.
530 */ 530 */
531static int 531static int
532t_encrypt (struct CadetTunnel3 *t, 532t_encrypt (struct CadetTunnel *t,
533 void *dst, const void *src, 533 void *dst, const void *src,
534 size_t size, uint32_t iv) 534 size_t size, uint32_t iv)
535{ 535{
@@ -556,7 +556,7 @@ t_encrypt (struct CadetTunnel3 *t,
556 * @param iv Initialization Vector to use. 556 * @param iv Initialization Vector to use.
557 */ 557 */
558static int 558static int
559t_decrypt (struct CadetTunnel3 *t, 559t_decrypt (struct CadetTunnel *t,
560 void *dst, const void *src, 560 void *dst, const void *src,
561 size_t size, uint32_t iv) 561 size_t size, uint32_t iv)
562{ 562{
@@ -645,7 +645,7 @@ derive_symmertic (struct GNUNET_CRYPTO_SymmetricSessionKey *key,
645 * @return The connection on which to send the next message. 645 * @return The connection on which to send the next message.
646 */ 646 */
647static struct CadetConnection * 647static struct CadetConnection *
648tunnel_get_connection (struct CadetTunnel3 *t) 648tunnel_get_connection (struct CadetTunnel *t)
649{ 649{
650 struct CadetTConnection *iter; 650 struct CadetTConnection *iter;
651 struct CadetConnection *best; 651 struct CadetConnection *best;
@@ -693,8 +693,8 @@ tun_message_sent (void *cls,
693 struct CadetConnectionQueue *q, 693 struct CadetConnectionQueue *q,
694 uint16_t type, int fwd, size_t size) 694 uint16_t type, int fwd, size_t size)
695{ 695{
696 struct CadetTunnel3Queue *qt = cls; 696 struct CadetTunnelQueue *qt = cls;
697 struct CadetTunnel3 *t; 697 struct CadetTunnel *t;
698 698
699 LOG (GNUNET_ERROR_TYPE_DEBUG, "tun_message_sent\n"); 699 LOG (GNUNET_ERROR_TYPE_DEBUG, "tun_message_sent\n");
700 700
@@ -726,7 +726,7 @@ unqueue_data (struct CadetTunnelDelayed *tqd)
726 * @param msg Message itself (copy will be made). 726 * @param msg Message itself (copy will be made).
727 */ 727 */
728static struct CadetTunnelDelayed * 728static struct CadetTunnelDelayed *
729queue_data (struct CadetTunnel3 *t, const struct GNUNET_MessageHeader *msg) 729queue_data (struct CadetTunnel *t, const struct GNUNET_MessageHeader *msg)
730{ 730{
731 struct CadetTunnelDelayed *tqd; 731 struct CadetTunnelDelayed *tqd;
732 uint16_t size = ntohs (msg->size); 732 uint16_t size = ntohs (msg->size);
@@ -759,7 +759,7 @@ queue_data (struct CadetTunnel3 *t, const struct GNUNET_MessageHeader *msg)
759 * @param hmac Destination to store the HMAC. 759 * @param hmac Destination to store the HMAC.
760 */ 760 */
761static void 761static void
762t_hmac (struct CadetTunnel3 *t, const void *plaintext, size_t size, uint32_t iv, 762t_hmac (struct CadetTunnel *t, const void *plaintext, size_t size, uint32_t iv,
763 int outgoing, struct GNUNET_CADET_Hash *hmac) 763 int outgoing, struct GNUNET_CADET_Hash *hmac)
764{ 764{
765 struct GNUNET_CRYPTO_AuthKey auth_key; 765 struct GNUNET_CRYPTO_AuthKey auth_key;
@@ -794,13 +794,13 @@ t_hmac (struct CadetTunnel3 *t, const void *plaintext, size_t size, uint32_t iv,
794 * 794 *
795 * @return Handle to cancel message. NULL if @c cont is NULL. 795 * @return Handle to cancel message. NULL if @c cont is NULL.
796 */ 796 */
797static struct CadetTunnel3Queue * 797static struct CadetTunnelQueue *
798send_prebuilt_message (const struct GNUNET_MessageHeader *message, 798send_prebuilt_message (const struct GNUNET_MessageHeader *message,
799 struct CadetTunnel3 *t, struct CadetConnection *c, 799 struct CadetTunnel *t, struct CadetConnection *c,
800 int force, GCT_sent cont, void *cont_cls, 800 int force, GCT_sent cont, void *cont_cls,
801 struct CadetTunnel3Queue *existing_q) 801 struct CadetTunnelQueue *existing_q)
802{ 802{
803 struct CadetTunnel3Queue *tq; 803 struct CadetTunnelQueue *tq;
804 struct GNUNET_CADET_Encrypted *msg; 804 struct GNUNET_CADET_Encrypted *msg;
805 size_t size = ntohs (message->size); 805 size_t size = ntohs (message->size);
806 char cbuf[sizeof (struct GNUNET_CADET_Encrypted) + size]; 806 char cbuf[sizeof (struct GNUNET_CADET_Encrypted) + size];
@@ -821,7 +821,7 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message,
821 tqd = queue_data (t, message); 821 tqd = queue_data (t, message);
822 if (NULL == cont) 822 if (NULL == cont)
823 return NULL; 823 return NULL;
824 tq = GNUNET_new (struct CadetTunnel3Queue); 824 tq = GNUNET_new (struct CadetTunnelQueue);
825 tq->tqd = tqd; 825 tq->tqd = tqd;
826 tqd->tq = tq; 826 tqd->tq = tq;
827 tq->cont = cont; 827 tq->cont = cont;
@@ -887,7 +887,7 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message,
887 } 887 }
888 if (NULL == existing_q) 888 if (NULL == existing_q)
889 { 889 {
890 tq = GNUNET_new (struct CadetTunnel3Queue); /* FIXME valgrind: leak*/ 890 tq = GNUNET_new (struct CadetTunnelQueue); /* FIXME valgrind: leak*/
891 } 891 }
892 else 892 else
893 { 893 {
@@ -909,7 +909,7 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message,
909 * @param t Tunnel that holds the messages. Cannot be loopback. 909 * @param t Tunnel that holds the messages. Cannot be loopback.
910 */ 910 */
911static void 911static void
912send_queued_data (struct CadetTunnel3 *t) 912send_queued_data (struct CadetTunnel *t)
913{ 913{
914 struct CadetTunnelDelayed *tqd; 914 struct CadetTunnelDelayed *tqd;
915 struct CadetTunnelDelayed *next; 915 struct CadetTunnelDelayed *next;
@@ -959,7 +959,7 @@ send_queued_data (struct CadetTunnel3 *t)
959 * @param message Message to send. Function modifies it. 959 * @param message Message to send. Function modifies it.
960 */ 960 */
961static void 961static void
962send_kx (struct CadetTunnel3 *t, 962send_kx (struct CadetTunnel *t,
963 const struct GNUNET_MessageHeader *message) 963 const struct GNUNET_MessageHeader *message)
964{ 964{
965 struct CadetConnection *c; 965 struct CadetConnection *c;
@@ -1030,7 +1030,7 @@ send_kx (struct CadetTunnel3 *t,
1030 * @param t Tunnel on which to send the key. 1030 * @param t Tunnel on which to send the key.
1031 */ 1031 */
1032static void 1032static void
1033send_ephemeral (struct CadetTunnel3 *t) 1033send_ephemeral (struct CadetTunnel *t)
1034{ 1034{
1035 LOG (GNUNET_ERROR_TYPE_INFO, "=> EPHM for %s\n", GCT_2s (t)); 1035 LOG (GNUNET_ERROR_TYPE_INFO, "=> EPHM for %s\n", GCT_2s (t));
1036 1036
@@ -1044,7 +1044,7 @@ send_ephemeral (struct CadetTunnel3 *t)
1044 * @param t Tunnel on which to send the ping. 1044 * @param t Tunnel on which to send the ping.
1045 */ 1045 */
1046static void 1046static void
1047send_ping (struct CadetTunnel3 *t) 1047send_ping (struct CadetTunnel *t)
1048{ 1048{
1049 struct GNUNET_CADET_KX_Ping msg; 1049 struct GNUNET_CADET_KX_Ping msg;
1050 1050
@@ -1072,7 +1072,7 @@ send_ping (struct CadetTunnel3 *t)
1072 * @param challenge Value sent in the ping that we have to send back. 1072 * @param challenge Value sent in the ping that we have to send back.
1073 */ 1073 */
1074static void 1074static void
1075send_pong (struct CadetTunnel3 *t, uint32_t challenge) 1075send_pong (struct CadetTunnel *t, uint32_t challenge)
1076{ 1076{
1077 struct GNUNET_CADET_KX_Pong msg; 1077 struct GNUNET_CADET_KX_Pong msg;
1078 1078
@@ -1098,7 +1098,7 @@ send_pong (struct CadetTunnel3 *t, uint32_t challenge)
1098static void 1098static void
1099rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1099rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1100{ 1100{
1101 struct CadetTunnel3 *t = cls; 1101 struct CadetTunnel *t = cls;
1102 1102
1103 t->rekey_task = GNUNET_SCHEDULER_NO_TASK; 1103 t->rekey_task = GNUNET_SCHEDULER_NO_TASK;
1104 1104
@@ -1153,7 +1153,7 @@ rekey_iterator (void *cls,
1153 const struct GNUNET_PeerIdentity *key, 1153 const struct GNUNET_PeerIdentity *key,
1154 void *value) 1154 void *value)
1155{ 1155{
1156 struct CadetTunnel3 *t = value; 1156 struct CadetTunnel *t = value;
1157 struct GNUNET_TIME_Relative delay; 1157 struct GNUNET_TIME_Relative delay;
1158 long n = (long) cls; 1158 long n = (long) cls;
1159 uint32_t r; 1159 uint32_t r;
@@ -1225,7 +1225,7 @@ destroy_iterator (void *cls,
1225 const struct GNUNET_PeerIdentity *key, 1225 const struct GNUNET_PeerIdentity *key,
1226 void *value) 1226 void *value)
1227{ 1227{
1228 struct CadetTunnel3 *t = value; 1228 struct CadetTunnel *t = value;
1229 1229
1230 LOG (GNUNET_ERROR_TYPE_DEBUG, "GCT_shutdown destroying tunnel at %p\n", t); 1230 LOG (GNUNET_ERROR_TYPE_DEBUG, "GCT_shutdown destroying tunnel at %p\n", t);
1231 GCT_destroy (t); 1231 GCT_destroy (t);
@@ -1241,7 +1241,7 @@ destroy_iterator (void *cls,
1241 * @param gid ID of the channel. 1241 * @param gid ID of the channel.
1242 */ 1242 */
1243static void 1243static void
1244send_channel_destroy (struct CadetTunnel3 *t, unsigned int gid) 1244send_channel_destroy (struct CadetTunnel *t, unsigned int gid)
1245{ 1245{
1246 struct GNUNET_CADET_ChannelManage msg; 1246 struct GNUNET_CADET_ChannelManage msg;
1247 1247
@@ -1267,7 +1267,7 @@ send_channel_destroy (struct CadetTunnel3 *t, unsigned int gid)
1267 * #GNUNET_SYSERR if message on a one-ended channel (remote) 1267 * #GNUNET_SYSERR if message on a one-ended channel (remote)
1268 */ 1268 */
1269static void 1269static void
1270handle_data (struct CadetTunnel3 *t, 1270handle_data (struct CadetTunnel *t,
1271 const struct GNUNET_CADET_Data *msg, 1271 const struct GNUNET_CADET_Data *msg,
1272 int fwd) 1272 int fwd)
1273{ 1273{
@@ -1313,7 +1313,7 @@ handle_data (struct CadetTunnel3 *t,
1313 * #GNUNET_SYSERR if message on a one-ended channel (remote) 1313 * #GNUNET_SYSERR if message on a one-ended channel (remote)
1314 */ 1314 */
1315static void 1315static void
1316handle_data_ack (struct CadetTunnel3 *t, 1316handle_data_ack (struct CadetTunnel *t,
1317 const struct GNUNET_CADET_DataACK *msg, 1317 const struct GNUNET_CADET_DataACK *msg,
1318 int fwd) 1318 int fwd)
1319{ 1319{
@@ -1350,7 +1350,7 @@ handle_data_ack (struct CadetTunnel3 *t,
1350 * @param msg Data message. 1350 * @param msg Data message.
1351 */ 1351 */
1352static void 1352static void
1353handle_ch_create (struct CadetTunnel3 *t, 1353handle_ch_create (struct CadetTunnel *t,
1354 const struct GNUNET_CADET_ChannelCreate *msg) 1354 const struct GNUNET_CADET_ChannelCreate *msg)
1355{ 1355{
1356 struct CadetChannel *ch; 1356 struct CadetChannel *ch;
@@ -1385,7 +1385,7 @@ handle_ch_create (struct CadetTunnel3 *t,
1385 * @param msg NACK message. 1385 * @param msg NACK message.
1386 */ 1386 */
1387static void 1387static void
1388handle_ch_nack (struct CadetTunnel3 *t, 1388handle_ch_nack (struct CadetTunnel *t,
1389 const struct GNUNET_CADET_ChannelManage *msg) 1389 const struct GNUNET_CADET_ChannelManage *msg)
1390{ 1390{
1391 struct CadetChannel *ch; 1391 struct CadetChannel *ch;
@@ -1425,7 +1425,7 @@ handle_ch_nack (struct CadetTunnel3 *t,
1425 * #GNUNET_SYSERR if message on a one-ended channel (remote) 1425 * #GNUNET_SYSERR if message on a one-ended channel (remote)
1426 */ 1426 */
1427static void 1427static void
1428handle_ch_ack (struct CadetTunnel3 *t, 1428handle_ch_ack (struct CadetTunnel *t,
1429 const struct GNUNET_CADET_ChannelManage *msg, 1429 const struct GNUNET_CADET_ChannelManage *msg,
1430 int fwd) 1430 int fwd)
1431{ 1431{
@@ -1467,7 +1467,7 @@ handle_ch_ack (struct CadetTunnel3 *t,
1467 * #GNUNET_SYSERR if message on a one-ended channel (remote) 1467 * #GNUNET_SYSERR if message on a one-ended channel (remote)
1468 */ 1468 */
1469static void 1469static void
1470handle_ch_destroy (struct CadetTunnel3 *t, 1470handle_ch_destroy (struct CadetTunnel *t,
1471 const struct GNUNET_CADET_ChannelManage *msg, 1471 const struct GNUNET_CADET_ChannelManage *msg,
1472 int fwd) 1472 int fwd)
1473{ 1473{
@@ -1501,7 +1501,7 @@ handle_ch_destroy (struct CadetTunnel3 *t,
1501 * @param msg Key eXchange message. 1501 * @param msg Key eXchange message.
1502 */ 1502 */
1503static void 1503static void
1504handle_ephemeral (struct CadetTunnel3 *t, 1504handle_ephemeral (struct CadetTunnel *t,
1505 const struct GNUNET_CADET_KX_Ephemeral *msg) 1505 const struct GNUNET_CADET_KX_Ephemeral *msg)
1506{ 1506{
1507 struct GNUNET_HashCode km; 1507 struct GNUNET_HashCode km;
@@ -1533,7 +1533,7 @@ handle_ephemeral (struct CadetTunnel3 *t,
1533 * @param msg Key eXchange Ping message. 1533 * @param msg Key eXchange Ping message.
1534 */ 1534 */
1535static void 1535static void
1536handle_ping (struct CadetTunnel3 *t, 1536handle_ping (struct CadetTunnel *t,
1537 const struct GNUNET_CADET_KX_Ping *msg) 1537 const struct GNUNET_CADET_KX_Ping *msg)
1538{ 1538{
1539 struct GNUNET_CADET_KX_Ping res; 1539 struct GNUNET_CADET_KX_Ping res;
@@ -1572,7 +1572,7 @@ handle_ping (struct CadetTunnel3 *t,
1572 * @param msg Key eXchange Pong message. 1572 * @param msg Key eXchange Pong message.
1573 */ 1573 */
1574static void 1574static void
1575handle_pong (struct CadetTunnel3 *t, 1575handle_pong (struct CadetTunnel *t,
1576 const struct GNUNET_CADET_KX_Pong *msg) 1576 const struct GNUNET_CADET_KX_Pong *msg)
1577{ 1577{
1578 uint32_t challenge; 1578 uint32_t challenge;
@@ -1614,7 +1614,7 @@ handle_pong (struct CadetTunnel3 *t,
1614 * #GNUNET_SYSERR if message on a one-ended channel (remote) 1614 * #GNUNET_SYSERR if message on a one-ended channel (remote)
1615 */ 1615 */
1616static void 1616static void
1617handle_decrypted (struct CadetTunnel3 *t, 1617handle_decrypted (struct CadetTunnel *t,
1618 const struct GNUNET_MessageHeader *msgh, 1618 const struct GNUNET_MessageHeader *msgh,
1619 int fwd) 1619 int fwd)
1620{ 1620{
@@ -1682,7 +1682,7 @@ handle_decrypted (struct CadetTunnel3 *t,
1682 * @param msg Encrypted message. 1682 * @param msg Encrypted message.
1683 */ 1683 */
1684void 1684void
1685GCT_handle_encrypted (struct CadetTunnel3 *t, 1685GCT_handle_encrypted (struct CadetTunnel *t,
1686 const struct GNUNET_CADET_Encrypted *msg) 1686 const struct GNUNET_CADET_Encrypted *msg)
1687{ 1687{
1688 size_t size = ntohs (msg->header.size); 1688 size_t size = ntohs (msg->header.size);
@@ -1721,7 +1721,7 @@ GCT_handle_encrypted (struct CadetTunnel3 *t,
1721 * @param message Payload of KX message. 1721 * @param message Payload of KX message.
1722 */ 1722 */
1723void 1723void
1724GCT_handle_kx (struct CadetTunnel3 *t, 1724GCT_handle_kx (struct CadetTunnel *t,
1725 const struct GNUNET_MessageHeader *message) 1725 const struct GNUNET_MessageHeader *message)
1726{ 1726{
1727 uint16_t type; 1727 uint16_t type;
@@ -1808,12 +1808,12 @@ GCT_shutdown (void)
1808 * 1808 *
1809 * @param destination Peer this tunnel is towards. 1809 * @param destination Peer this tunnel is towards.
1810 */ 1810 */
1811struct CadetTunnel3 * 1811struct CadetTunnel *
1812GCT_new (struct CadetPeer *destination) 1812GCT_new (struct CadetPeer *destination)
1813{ 1813{
1814 struct CadetTunnel3 *t; 1814 struct CadetTunnel *t;
1815 1815
1816 t = GNUNET_new (struct CadetTunnel3); 1816 t = GNUNET_new (struct CadetTunnel);
1817 t->next_chid = 0; 1817 t->next_chid = 0;
1818 t->peer = destination; 1818 t->peer = destination;
1819 1819
@@ -1836,7 +1836,7 @@ GCT_new (struct CadetPeer *destination)
1836 * @param cstate New connection state. 1836 * @param cstate New connection state.
1837 */ 1837 */
1838void 1838void
1839GCT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate) 1839GCT_change_cstate (struct CadetTunnel* t, enum CadetTunnelCState cstate)
1840{ 1840{
1841 if (NULL == t) 1841 if (NULL == t)
1842 return; 1842 return;
@@ -1875,7 +1875,7 @@ GCT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate)
1875 * @param state New encryption state. 1875 * @param state New encryption state.
1876 */ 1876 */
1877void 1877void
1878GCT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state) 1878GCT_change_estate (struct CadetTunnel* t, enum CadetTunnelEState state)
1879{ 1879{
1880 if (NULL == t) 1880 if (NULL == t)
1881 return; 1881 return;
@@ -1909,7 +1909,7 @@ GCT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state)
1909static void 1909static void
1910trim_connections (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1910trim_connections (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1911{ 1911{
1912 struct CadetTunnel3 *t = cls; 1912 struct CadetTunnel *t = cls;
1913 1913
1914 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1914 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1915 return; 1915 return;
@@ -1950,7 +1950,7 @@ trim_connections (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1950 * @param c Connection. 1950 * @param c Connection.
1951 */ 1951 */
1952void 1952void
1953GCT_add_connection (struct CadetTunnel3 *t, struct CadetConnection *c) 1953GCT_add_connection (struct CadetTunnel *t, struct CadetConnection *c)
1954{ 1954{
1955 struct CadetTConnection *aux; 1955 struct CadetTConnection *aux;
1956 1956
@@ -1979,7 +1979,7 @@ GCT_add_connection (struct CadetTunnel3 *t, struct CadetConnection *c)
1979 * @param path Invalid path to remove. Is destroyed after removal. 1979 * @param path Invalid path to remove. Is destroyed after removal.
1980 */ 1980 */
1981void 1981void
1982GCT_remove_path (struct CadetTunnel3 *t, struct CadetPeerPath *path) 1982GCT_remove_path (struct CadetTunnel *t, struct CadetPeerPath *path)
1983{ 1983{
1984 GCP_remove_path (t->peer, path); 1984 GCP_remove_path (t->peer, path);
1985} 1985}
@@ -1992,7 +1992,7 @@ GCT_remove_path (struct CadetTunnel3 *t, struct CadetPeerPath *path)
1992 * @param c Connection. 1992 * @param c Connection.
1993 */ 1993 */
1994void 1994void
1995GCT_remove_connection (struct CadetTunnel3 *t, 1995GCT_remove_connection (struct CadetTunnel *t,
1996 struct CadetConnection *c) 1996 struct CadetConnection *c)
1997{ 1997{
1998 struct CadetTConnection *aux; 1998 struct CadetTConnection *aux;
@@ -2042,7 +2042,7 @@ GCT_remove_connection (struct CadetTunnel3 *t,
2042 * @param ch Channel. 2042 * @param ch Channel.
2043 */ 2043 */
2044void 2044void
2045GCT_add_channel (struct CadetTunnel3 *t, struct CadetChannel *ch) 2045GCT_add_channel (struct CadetTunnel *t, struct CadetChannel *ch)
2046{ 2046{
2047 struct CadetTChannel *aux; 2047 struct CadetTChannel *aux;
2048 2048
@@ -2078,7 +2078,7 @@ GCT_add_channel (struct CadetTunnel3 *t, struct CadetChannel *ch)
2078 * @param ch Channel. 2078 * @param ch Channel.
2079 */ 2079 */
2080void 2080void
2081GCT_remove_channel (struct CadetTunnel3 *t, struct CadetChannel *ch) 2081GCT_remove_channel (struct CadetTunnel *t, struct CadetChannel *ch)
2082{ 2082{
2083 struct CadetTChannel *aux; 2083 struct CadetTChannel *aux;
2084 2084
@@ -2105,7 +2105,7 @@ GCT_remove_channel (struct CadetTunnel3 *t, struct CadetChannel *ch)
2105 * @return channel handler, NULL if doesn't exist 2105 * @return channel handler, NULL if doesn't exist
2106 */ 2106 */
2107struct CadetChannel * 2107struct CadetChannel *
2108GCT_get_channel (struct CadetTunnel3 *t, CADET_ChannelNumber chid) 2108GCT_get_channel (struct CadetTunnel *t, CADET_ChannelNumber chid)
2109{ 2109{
2110 struct CadetTChannel *iter; 2110 struct CadetTChannel *iter;
2111 2111
@@ -2135,7 +2135,7 @@ GCT_get_channel (struct CadetTunnel3 *t, CADET_ChannelNumber chid)
2135static void 2135static void
2136delayed_destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 2136delayed_destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
2137{ 2137{
2138 struct CadetTunnel3 *t = cls; 2138 struct CadetTunnel *t = cls;
2139 struct CadetTConnection *iter; 2139 struct CadetTConnection *iter;
2140 2140
2141 LOG (GNUNET_ERROR_TYPE_DEBUG, "delayed destroying tunnel %p\n", t); 2141 LOG (GNUNET_ERROR_TYPE_DEBUG, "delayed destroying tunnel %p\n", t);
@@ -2165,7 +2165,7 @@ delayed_destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
2165 * @param t Tunnel to destroy. 2165 * @param t Tunnel to destroy.
2166 */ 2166 */
2167void 2167void
2168GCT_destroy_empty (struct CadetTunnel3 *t) 2168GCT_destroy_empty (struct CadetTunnel *t)
2169{ 2169{
2170 if (GNUNET_YES == shutting_down) 2170 if (GNUNET_YES == shutting_down)
2171 return; /* Will be destroyed immediately anyway */ 2171 return; /* Will be destroyed immediately anyway */
@@ -2199,7 +2199,7 @@ GCT_destroy_empty (struct CadetTunnel3 *t)
2199 * @param t Tunnel to destroy if empty. 2199 * @param t Tunnel to destroy if empty.
2200 */ 2200 */
2201void 2201void
2202GCT_destroy_if_empty (struct CadetTunnel3 *t) 2202GCT_destroy_if_empty (struct CadetTunnel *t)
2203{ 2203{
2204 LOG (GNUNET_ERROR_TYPE_DEBUG, "Tunnel %s destroy if empty\n", GCT_2s (t)); 2204 LOG (GNUNET_ERROR_TYPE_DEBUG, "Tunnel %s destroy if empty\n", GCT_2s (t));
2205 if (1 < GCT_count_channels (t)) 2205 if (1 < GCT_count_channels (t))
@@ -2221,7 +2221,7 @@ GCT_destroy_if_empty (struct CadetTunnel3 *t)
2221 * @param t The tunnel to destroy. 2221 * @param t The tunnel to destroy.
2222 */ 2222 */
2223void 2223void
2224GCT_destroy (struct CadetTunnel3 *t) 2224GCT_destroy (struct CadetTunnel *t)
2225{ 2225{
2226 struct CadetTConnection *iter_c; 2226 struct CadetTConnection *iter_c;
2227 struct CadetTConnection *next_c; 2227 struct CadetTConnection *next_c;
@@ -2284,7 +2284,7 @@ GCT_destroy (struct CadetTunnel3 *t)
2284 * @return Connection created. 2284 * @return Connection created.
2285 */ 2285 */
2286struct CadetConnection * 2286struct CadetConnection *
2287GCT_use_path (struct CadetTunnel3 *t, struct CadetPeerPath *p) 2287GCT_use_path (struct CadetTunnel *t, struct CadetPeerPath *p)
2288{ 2288{
2289 struct CadetConnection *c; 2289 struct CadetConnection *c;
2290 struct GNUNET_CADET_Hash cid; 2290 struct GNUNET_CADET_Hash cid;
@@ -2333,7 +2333,7 @@ GCT_use_path (struct CadetTunnel3 *t, struct CadetPeerPath *p)
2333 * @return Number of connections. 2333 * @return Number of connections.
2334 */ 2334 */
2335unsigned int 2335unsigned int
2336GCT_count_connections (struct CadetTunnel3 *t) 2336GCT_count_connections (struct CadetTunnel *t)
2337{ 2337{
2338 struct CadetTConnection *iter; 2338 struct CadetTConnection *iter;
2339 unsigned int count; 2339 unsigned int count;
@@ -2356,7 +2356,7 @@ GCT_count_connections (struct CadetTunnel3 *t)
2356 * @return Number of channels. 2356 * @return Number of channels.
2357 */ 2357 */
2358unsigned int 2358unsigned int
2359GCT_count_channels (struct CadetTunnel3 *t) 2359GCT_count_channels (struct CadetTunnel *t)
2360{ 2360{
2361 struct CadetTChannel *iter; 2361 struct CadetTChannel *iter;
2362 unsigned int count; 2362 unsigned int count;
@@ -2376,13 +2376,13 @@ GCT_count_channels (struct CadetTunnel3 *t)
2376 * 2376 *
2377 * @return Tunnel's connectivity state. 2377 * @return Tunnel's connectivity state.
2378 */ 2378 */
2379enum CadetTunnel3CState 2379enum CadetTunnelCState
2380GCT_get_cstate (struct CadetTunnel3 *t) 2380GCT_get_cstate (struct CadetTunnel *t)
2381{ 2381{
2382 if (NULL == t) 2382 if (NULL == t)
2383 { 2383 {
2384 GNUNET_assert (0); 2384 GNUNET_assert (0);
2385 return (enum CadetTunnel3CState) -1; 2385 return (enum CadetTunnelCState) -1;
2386 } 2386 }
2387 return t->cstate; 2387 return t->cstate;
2388} 2388}
@@ -2395,13 +2395,13 @@ GCT_get_cstate (struct CadetTunnel3 *t)
2395 * 2395 *
2396 * @return Tunnel's encryption state. 2396 * @return Tunnel's encryption state.
2397 */ 2397 */
2398enum CadetTunnel3EState 2398enum CadetTunnelEState
2399GCT_get_estate (struct CadetTunnel3 *t) 2399GCT_get_estate (struct CadetTunnel *t)
2400{ 2400{
2401 if (NULL == t) 2401 if (NULL == t)
2402 { 2402 {
2403 GNUNET_assert (0); 2403 GNUNET_assert (0);
2404 return (enum CadetTunnel3EState) -1; 2404 return (enum CadetTunnelEState) -1;
2405 } 2405 }
2406 return t->estate; 2406 return t->estate;
2407} 2407}
@@ -2414,7 +2414,7 @@ GCT_get_estate (struct CadetTunnel3 *t)
2414 * @return Biggest buffer space offered by any channel in the tunnel. 2414 * @return Biggest buffer space offered by any channel in the tunnel.
2415 */ 2415 */
2416unsigned int 2416unsigned int
2417GCT_get_channels_buffer (struct CadetTunnel3 *t) 2417GCT_get_channels_buffer (struct CadetTunnel *t)
2418{ 2418{
2419 struct CadetTChannel *iter; 2419 struct CadetTChannel *iter;
2420 unsigned int buffer; 2420 unsigned int buffer;
@@ -2445,7 +2445,7 @@ GCT_get_channels_buffer (struct CadetTunnel3 *t)
2445 * @return Buffer space offered by all connections in the tunnel. 2445 * @return Buffer space offered by all connections in the tunnel.
2446 */ 2446 */
2447unsigned int 2447unsigned int
2448GCT_get_connections_buffer (struct CadetTunnel3 *t) 2448GCT_get_connections_buffer (struct CadetTunnel *t)
2449{ 2449{
2450 struct CadetTConnection *iter; 2450 struct CadetTConnection *iter;
2451 unsigned int buffer; 2451 unsigned int buffer;
@@ -2472,7 +2472,7 @@ GCT_get_connections_buffer (struct CadetTunnel3 *t)
2472 * @return ID of the destination peer. 2472 * @return ID of the destination peer.
2473 */ 2473 */
2474const struct GNUNET_PeerIdentity * 2474const struct GNUNET_PeerIdentity *
2475GCT_get_destination (struct CadetTunnel3 *t) 2475GCT_get_destination (struct CadetTunnel *t)
2476{ 2476{
2477 return GCP_get_id (t->peer); 2477 return GCP_get_id (t->peer);
2478} 2478}
@@ -2486,7 +2486,7 @@ GCT_get_destination (struct CadetTunnel3 *t)
2486 * @return GID of a channel free to use. 2486 * @return GID of a channel free to use.
2487 */ 2487 */
2488CADET_ChannelNumber 2488CADET_ChannelNumber
2489GCT_get_next_chid (struct CadetTunnel3 *t) 2489GCT_get_next_chid (struct CadetTunnel *t)
2490{ 2490{
2491 CADET_ChannelNumber chid; 2491 CADET_ChannelNumber chid;
2492 CADET_ChannelNumber mask; 2492 CADET_ChannelNumber mask;
@@ -2523,7 +2523,7 @@ GCT_get_next_chid (struct CadetTunnel3 *t)
2523 * @param t Channel which has some free buffer space. 2523 * @param t Channel which has some free buffer space.
2524 */ 2524 */
2525void 2525void
2526GCT_unchoke_channels (struct CadetTunnel3 *t) 2526GCT_unchoke_channels (struct CadetTunnel *t)
2527{ 2527{
2528 struct CadetTChannel *iter; 2528 struct CadetTChannel *iter;
2529 unsigned int buffer; 2529 unsigned int buffer;
@@ -2574,7 +2574,7 @@ GCT_unchoke_channels (struct CadetTunnel3 *t)
2574 * @param t Tunnel. 2574 * @param t Tunnel.
2575 */ 2575 */
2576void 2576void
2577GCT_send_connection_acks (struct CadetTunnel3 *t) 2577GCT_send_connection_acks (struct CadetTunnel *t)
2578{ 2578{
2579 struct CadetTConnection *iter; 2579 struct CadetTConnection *iter;
2580 uint32_t allowed; 2580 uint32_t allowed;
@@ -2641,7 +2641,7 @@ GCT_send_connection_acks (struct CadetTunnel3 *t)
2641 * @param q Handle to the queue. 2641 * @param q Handle to the queue.
2642 */ 2642 */
2643void 2643void
2644GCT_cancel (struct CadetTunnel3Queue *q) 2644GCT_cancel (struct CadetTunnelQueue *q)
2645{ 2645{
2646 if (NULL != q->cq) 2646 if (NULL != q->cq)
2647 { 2647 {
@@ -2676,9 +2676,9 @@ GCT_cancel (struct CadetTunnel3Queue *q)
2676 * 2676 *
2677 * @return Handle to cancel message. NULL if @c cont is NULL. 2677 * @return Handle to cancel message. NULL if @c cont is NULL.
2678 */ 2678 */
2679struct CadetTunnel3Queue * 2679struct CadetTunnelQueue *
2680GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message, 2680GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
2681 struct CadetTunnel3 *t, struct CadetConnection *c, 2681 struct CadetTunnel *t, struct CadetConnection *c,
2682 int force, GCT_sent cont, void *cont_cls) 2682 int force, GCT_sent cont, void *cont_cls)
2683{ 2683{
2684 return send_prebuilt_message (message, t, c, force, cont, cont_cls, NULL); 2684 return send_prebuilt_message (message, t, c, force, cont, cont_cls, NULL);
@@ -2693,7 +2693,7 @@ GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
2693 * @return #GNUNET_YES if it is loopback. 2693 * @return #GNUNET_YES if it is loopback.
2694 */ 2694 */
2695int 2695int
2696GCT_is_loopback (const struct CadetTunnel3 *t) 2696GCT_is_loopback (const struct CadetTunnel *t)
2697{ 2697{
2698 return (myid == GCP_get_short_id (t->peer)); 2698 return (myid == GCP_get_short_id (t->peer));
2699} 2699}
@@ -2708,7 +2708,7 @@ GCT_is_loopback (const struct CadetTunnel3 *t)
2708 * @return #GNUNET_YES a connection uses this path. 2708 * @return #GNUNET_YES a connection uses this path.
2709 */ 2709 */
2710int 2710int
2711GCT_is_path_used (const struct CadetTunnel3 *t, const struct CadetPeerPath *p) 2711GCT_is_path_used (const struct CadetTunnel *t, const struct CadetPeerPath *p)
2712{ 2712{
2713 struct CadetTConnection *iter; 2713 struct CadetTConnection *iter;
2714 2714
@@ -2729,7 +2729,7 @@ GCT_is_path_used (const struct CadetTunnel3 *t, const struct CadetPeerPath *p)
2729 * @return Cost of the path (path length + number of overlapping nodes) 2729 * @return Cost of the path (path length + number of overlapping nodes)
2730 */ 2730 */
2731unsigned int 2731unsigned int
2732GCT_get_path_cost (const struct CadetTunnel3 *t, 2732GCT_get_path_cost (const struct CadetTunnel *t,
2733 const struct CadetPeerPath *path) 2733 const struct CadetPeerPath *path)
2734{ 2734{
2735 struct CadetTConnection *iter; 2735 struct CadetTConnection *iter;
@@ -2774,7 +2774,7 @@ GCT_get_path_cost (const struct CadetTunnel3 *t,
2774 * @return Static string the destination peer's ID. 2774 * @return Static string the destination peer's ID.
2775 */ 2775 */
2776const char * 2776const char *
2777GCT_2s (const struct CadetTunnel3 *t) 2777GCT_2s (const struct CadetTunnel *t)
2778{ 2778{
2779 if (NULL == t) 2779 if (NULL == t)
2780 return "(NULL)"; 2780 return "(NULL)";
@@ -2794,7 +2794,7 @@ GCT_2s (const struct CadetTunnel3 *t)
2794 * @param t Tunnel to debug. 2794 * @param t Tunnel to debug.
2795 */ 2795 */
2796void 2796void
2797GCT_debug (const struct CadetTunnel3 *t) 2797GCT_debug (const struct CadetTunnel *t)
2798{ 2798{
2799 struct CadetTChannel *iterch; 2799 struct CadetTChannel *iterch;
2800 struct CadetTConnection *iterc; 2800 struct CadetTConnection *iterc;
@@ -2862,7 +2862,7 @@ GCT_count_all (void)
2862 * @param cls Closure for @c iter. 2862 * @param cls Closure for @c iter.
2863 */ 2863 */
2864void 2864void
2865GCT_iterate_connections (struct CadetTunnel3 *t, GCT_conn_iter iter, void *cls) 2865GCT_iterate_connections (struct CadetTunnel *t, GCT_conn_iter iter, void *cls)
2866{ 2866{
2867 struct CadetTConnection *ct; 2867 struct CadetTConnection *ct;
2868 2868
@@ -2879,7 +2879,7 @@ GCT_iterate_connections (struct CadetTunnel3 *t, GCT_conn_iter iter, void *cls)
2879 * @param cls Closure for @c iter. 2879 * @param cls Closure for @c iter.
2880 */ 2880 */
2881void 2881void
2882GCT_iterate_channels (struct CadetTunnel3 *t, GCT_chan_iter iter, void *cls) 2882GCT_iterate_channels (struct CadetTunnel *t, GCT_chan_iter iter, void *cls)
2883{ 2883{
2884 struct CadetTChannel *cht; 2884 struct CadetTChannel *cht;
2885 2885
diff --git a/src/cadet/gnunet-service-cadet_tunnel.h b/src/cadet/gnunet-service-cadet_tunnel.h
index 304015fa5..aa09ac683 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.h
+++ b/src/cadet/gnunet-service-cadet_tunnel.h
@@ -43,7 +43,7 @@ extern "C"
43/** 43/**
44 * All the connectivity states a tunnel can be in. 44 * All the connectivity states a tunnel can be in.
45 */ 45 */
46enum CadetTunnel3CState 46enum CadetTunnelCState
47{ 47{
48 /** 48 /**
49 * Uninitialized status, should never appear in operation. 49 * Uninitialized status, should never appear in operation.
@@ -75,7 +75,7 @@ enum CadetTunnel3CState
75/** 75/**
76 * All the encryption states a tunnel can be in. 76 * All the encryption states a tunnel can be in.
77 */ 77 */
78enum CadetTunnel3EState 78enum CadetTunnelEState
79{ 79{
80 /** 80 /**
81 * Uninitialized status, should never appear in operation. 81 * Uninitialized status, should never appear in operation.
@@ -103,7 +103,7 @@ enum CadetTunnel3EState
103/** 103/**
104 * Struct containing all information regarding a given peer 104 * Struct containing all information regarding a given peer
105 */ 105 */
106struct CadetTunnel3; 106struct CadetTunnel;
107 107
108 108
109#include "gnunet-service-cadet_channel.h" 109#include "gnunet-service-cadet_channel.h"
@@ -113,7 +113,7 @@ struct CadetTunnel3;
113/** 113/**
114 * Handle for messages queued but not yet sent. 114 * Handle for messages queued but not yet sent.
115 */ 115 */
116struct CadetTunnel3Queue; 116struct CadetTunnelQueue;
117 117
118/** 118/**
119 * Callback called when a queued message is sent. 119 * Callback called when a queued message is sent.
@@ -124,8 +124,8 @@ struct CadetTunnel3Queue;
124 * @param size Size of the message. 124 * @param size Size of the message.
125 */ 125 */
126typedef void (*GCT_sent) (void *cls, 126typedef void (*GCT_sent) (void *cls,
127 struct CadetTunnel3 *t, 127 struct CadetTunnel *t,
128 struct CadetTunnel3Queue *q, 128 struct CadetTunnelQueue *q,
129 uint16_t type, size_t size); 129 uint16_t type, size_t size);
130 130
131typedef void (*GCT_conn_iter) (void *cls, struct CadetConnection *c); 131typedef void (*GCT_conn_iter) (void *cls, struct CadetConnection *c);
@@ -157,7 +157,7 @@ GCT_shutdown (void);
157 * 157 *
158 * @param destination Peer this tunnel is towards. 158 * @param destination Peer this tunnel is towards.
159 */ 159 */
160struct CadetTunnel3 * 160struct CadetTunnel *
161GCT_new (struct CadetPeer *destination); 161GCT_new (struct CadetPeer *destination);
162 162
163/** 163/**
@@ -168,7 +168,7 @@ GCT_new (struct CadetPeer *destination);
168 * @param t Tunnel to destroy. 168 * @param t Tunnel to destroy.
169 */ 169 */
170void 170void
171GCT_destroy_empty (struct CadetTunnel3 *t); 171GCT_destroy_empty (struct CadetTunnel *t);
172 172
173/** 173/**
174 * Destroy tunnel if empty (no more channels). 174 * Destroy tunnel if empty (no more channels).
@@ -176,7 +176,7 @@ GCT_destroy_empty (struct CadetTunnel3 *t);
176 * @param t Tunnel to destroy if empty. 176 * @param t Tunnel to destroy if empty.
177 */ 177 */
178void 178void
179GCT_destroy_if_empty (struct CadetTunnel3 *t); 179GCT_destroy_if_empty (struct CadetTunnel *t);
180 180
181/** 181/**
182 * Destroy the tunnel. 182 * Destroy the tunnel.
@@ -190,7 +190,7 @@ GCT_destroy_if_empty (struct CadetTunnel3 *t);
190 * @param t The tunnel to destroy. 190 * @param t The tunnel to destroy.
191 */ 191 */
192void 192void
193GCT_destroy (struct CadetTunnel3 *t); 193GCT_destroy (struct CadetTunnel *t);
194 194
195 195
196/** 196/**
@@ -200,7 +200,7 @@ GCT_destroy (struct CadetTunnel3 *t);
200 * @param cstate New connection state. 200 * @param cstate New connection state.
201 */ 201 */
202void 202void
203GCT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate); 203GCT_change_cstate (struct CadetTunnel* t, enum CadetTunnelCState cstate);
204 204
205 205
206/** 206/**
@@ -210,7 +210,7 @@ GCT_change_cstate (struct CadetTunnel3* t, enum CadetTunnel3CState cstate);
210 * @param state New encryption state. 210 * @param state New encryption state.
211 */ 211 */
212void 212void
213GCT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state); 213GCT_change_estate (struct CadetTunnel* t, enum CadetTunnelEState state);
214 214
215/** 215/**
216 * Add a connection to a tunnel. 216 * Add a connection to a tunnel.
@@ -219,7 +219,7 @@ GCT_change_estate (struct CadetTunnel3* t, enum CadetTunnel3EState state);
219 * @param c Connection. 219 * @param c Connection.
220 */ 220 */
221void 221void
222GCT_add_connection (struct CadetTunnel3 *t, struct CadetConnection *c); 222GCT_add_connection (struct CadetTunnel *t, struct CadetConnection *c);
223 223
224/** 224/**
225 * Mark a path as no longer valid for this tunnel: has been tried and failed. 225 * Mark a path as no longer valid for this tunnel: has been tried and failed.
@@ -228,7 +228,7 @@ GCT_add_connection (struct CadetTunnel3 *t, struct CadetConnection *c);
228 * @param path Invalid path to remove. Is destroyed after removal. 228 * @param path Invalid path to remove. Is destroyed after removal.
229 */ 229 */
230void 230void
231GCT_remove_path (struct CadetTunnel3 *t, struct CadetPeerPath *path); 231GCT_remove_path (struct CadetTunnel *t, struct CadetPeerPath *path);
232 232
233/** 233/**
234 * Remove a connection from a tunnel. 234 * Remove a connection from a tunnel.
@@ -237,7 +237,7 @@ GCT_remove_path (struct CadetTunnel3 *t, struct CadetPeerPath *path);
237 * @param c Connection. 237 * @param c Connection.
238 */ 238 */
239void 239void
240GCT_remove_connection (struct CadetTunnel3 *t, struct CadetConnection *c); 240GCT_remove_connection (struct CadetTunnel *t, struct CadetConnection *c);
241 241
242/** 242/**
243 * Add a channel to a tunnel. 243 * Add a channel to a tunnel.
@@ -246,7 +246,7 @@ GCT_remove_connection (struct CadetTunnel3 *t, struct CadetConnection *c);
246 * @param ch Channel. 246 * @param ch Channel.
247 */ 247 */
248void 248void
249GCT_add_channel (struct CadetTunnel3 *t, struct CadetChannel *ch); 249GCT_add_channel (struct CadetTunnel *t, struct CadetChannel *ch);
250 250
251/** 251/**
252 * Remove a channel from a tunnel. 252 * Remove a channel from a tunnel.
@@ -255,7 +255,7 @@ GCT_add_channel (struct CadetTunnel3 *t, struct CadetChannel *ch);
255 * @param ch Channel. 255 * @param ch Channel.
256 */ 256 */
257void 257void
258GCT_remove_channel (struct CadetTunnel3 *t, struct CadetChannel *ch); 258GCT_remove_channel (struct CadetTunnel *t, struct CadetChannel *ch);
259 259
260/** 260/**
261 * Search for a channel by global ID. 261 * Search for a channel by global ID.
@@ -266,7 +266,7 @@ GCT_remove_channel (struct CadetTunnel3 *t, struct CadetChannel *ch);
266 * @return channel handler, NULL if doesn't exist 266 * @return channel handler, NULL if doesn't exist
267 */ 267 */
268struct CadetChannel * 268struct CadetChannel *
269GCT_get_channel (struct CadetTunnel3 *t, CADET_ChannelNumber chid); 269GCT_get_channel (struct CadetTunnel *t, CADET_ChannelNumber chid);
270 270
271/** 271/**
272 * Decrypt and demultiplex by message type. Call appropriate handler 272 * Decrypt and demultiplex by message type. Call appropriate handler
@@ -277,7 +277,7 @@ GCT_get_channel (struct CadetTunnel3 *t, CADET_ChannelNumber chid);
277 * @param msg Message header. 277 * @param msg Message header.
278 */ 278 */
279void 279void
280GCT_handle_encrypted (struct CadetTunnel3 *t, 280GCT_handle_encrypted (struct CadetTunnel *t,
281 const struct GNUNET_CADET_Encrypted *msg); 281 const struct GNUNET_CADET_Encrypted *msg);
282 282
283/** 283/**
@@ -287,7 +287,7 @@ GCT_handle_encrypted (struct CadetTunnel3 *t,
287 * @param message KX message itself. 287 * @param message KX message itself.
288 */ 288 */
289void 289void
290GCT_handle_kx (struct CadetTunnel3 *t, 290GCT_handle_kx (struct CadetTunnel *t,
291 const struct GNUNET_MessageHeader *message); 291 const struct GNUNET_MessageHeader *message);
292 292
293/** 293/**
@@ -301,7 +301,7 @@ GCT_handle_kx (struct CadetTunnel3 *t,
301 * @return Connection created. 301 * @return Connection created.
302 */ 302 */
303struct CadetConnection * 303struct CadetConnection *
304GCT_use_path (struct CadetTunnel3 *t, struct CadetPeerPath *p); 304GCT_use_path (struct CadetTunnel *t, struct CadetPeerPath *p);
305 305
306/** 306/**
307 * Count established (ready) connections of a tunnel. 307 * Count established (ready) connections of a tunnel.
@@ -311,7 +311,7 @@ GCT_use_path (struct CadetTunnel3 *t, struct CadetPeerPath *p);
311 * @return Number of connections. 311 * @return Number of connections.
312 */ 312 */
313unsigned int 313unsigned int
314GCT_count_connections (struct CadetTunnel3 *t); 314GCT_count_connections (struct CadetTunnel *t);
315 315
316/** 316/**
317 * Count channels of a tunnel. 317 * Count channels of a tunnel.
@@ -321,7 +321,7 @@ GCT_count_connections (struct CadetTunnel3 *t);
321 * @return Number of channels. 321 * @return Number of channels.
322 */ 322 */
323unsigned int 323unsigned int
324GCT_count_channels (struct CadetTunnel3 *t); 324GCT_count_channels (struct CadetTunnel *t);
325 325
326/** 326/**
327 * Get the connectivity state of a tunnel. 327 * Get the connectivity state of a tunnel.
@@ -330,8 +330,8 @@ GCT_count_channels (struct CadetTunnel3 *t);
330 * 330 *
331 * @return Tunnel's connectivity state. 331 * @return Tunnel's connectivity state.
332 */ 332 */
333enum CadetTunnel3CState 333enum CadetTunnelCState
334GCT_get_cstate (struct CadetTunnel3 *t); 334GCT_get_cstate (struct CadetTunnel *t);
335 335
336/** 336/**
337 * Get the encryption state of a tunnel. 337 * Get the encryption state of a tunnel.
@@ -340,8 +340,8 @@ GCT_get_cstate (struct CadetTunnel3 *t);
340 * 340 *
341 * @return Tunnel's encryption state. 341 * @return Tunnel's encryption state.
342 */ 342 */
343enum CadetTunnel3EState 343enum CadetTunnelEState
344GCT_get_estate (struct CadetTunnel3 *t); 344GCT_get_estate (struct CadetTunnel *t);
345 345
346/** 346/**
347 * Get the maximum buffer space for a tunnel towards a local client. 347 * Get the maximum buffer space for a tunnel towards a local client.
@@ -351,7 +351,7 @@ GCT_get_estate (struct CadetTunnel3 *t);
351 * @return Biggest buffer space offered by any channel in the tunnel. 351 * @return Biggest buffer space offered by any channel in the tunnel.
352 */ 352 */
353unsigned int 353unsigned int
354GCT_get_channels_buffer (struct CadetTunnel3 *t); 354GCT_get_channels_buffer (struct CadetTunnel *t);
355 355
356/** 356/**
357 * Get the total buffer space for a tunnel for P2P traffic. 357 * Get the total buffer space for a tunnel for P2P traffic.
@@ -361,7 +361,7 @@ GCT_get_channels_buffer (struct CadetTunnel3 *t);
361 * @return Buffer space offered by all connections in the tunnel. 361 * @return Buffer space offered by all connections in the tunnel.
362 */ 362 */
363unsigned int 363unsigned int
364GCT_get_connections_buffer (struct CadetTunnel3 *t); 364GCT_get_connections_buffer (struct CadetTunnel *t);
365 365
366/** 366/**
367 * Get the tunnel's destination. 367 * Get the tunnel's destination.
@@ -371,7 +371,7 @@ GCT_get_connections_buffer (struct CadetTunnel3 *t);
371 * @return ID of the destination peer. 371 * @return ID of the destination peer.
372 */ 372 */
373const struct GNUNET_PeerIdentity * 373const struct GNUNET_PeerIdentity *
374GCT_get_destination (struct CadetTunnel3 *t); 374GCT_get_destination (struct CadetTunnel *t);
375 375
376/** 376/**
377 * Get the tunnel's next free Channel ID. 377 * Get the tunnel's next free Channel ID.
@@ -381,7 +381,7 @@ GCT_get_destination (struct CadetTunnel3 *t);
381 * @return ID of a channel free to use. 381 * @return ID of a channel free to use.
382 */ 382 */
383CADET_ChannelNumber 383CADET_ChannelNumber
384GCT_get_next_chid (struct CadetTunnel3 *t); 384GCT_get_next_chid (struct CadetTunnel *t);
385 385
386/** 386/**
387 * Send ACK on one or more channels due to buffer in connections. 387 * Send ACK on one or more channels due to buffer in connections.
@@ -389,7 +389,7 @@ GCT_get_next_chid (struct CadetTunnel3 *t);
389 * @param t Channel which has some free buffer space. 389 * @param t Channel which has some free buffer space.
390 */ 390 */
391void 391void
392GCT_unchoke_channels (struct CadetTunnel3 *t); 392GCT_unchoke_channels (struct CadetTunnel *t);
393 393
394/** 394/**
395 * Send ACK on one or more connections due to buffer space to the client. 395 * Send ACK on one or more connections due to buffer space to the client.
@@ -399,7 +399,7 @@ GCT_unchoke_channels (struct CadetTunnel3 *t);
399 * @param t Tunnel which has some free buffer space. 399 * @param t Tunnel which has some free buffer space.
400 */ 400 */
401void 401void
402GCT_send_connection_acks (struct CadetTunnel3 *t); 402GCT_send_connection_acks (struct CadetTunnel *t);
403 403
404/** 404/**
405 * Cancel a previously sent message while it's in the queue. 405 * Cancel a previously sent message while it's in the queue.
@@ -411,7 +411,7 @@ GCT_send_connection_acks (struct CadetTunnel3 *t);
411 * @param q Handle to the queue. 411 * @param q Handle to the queue.
412 */ 412 */
413void 413void
414GCT_cancel (struct CadetTunnel3Queue *q); 414GCT_cancel (struct CadetTunnelQueue *q);
415 415
416/** 416/**
417 * Sends an already built message on a tunnel, encrypting it and 417 * Sends an already built message on a tunnel, encrypting it and
@@ -426,9 +426,9 @@ GCT_cancel (struct CadetTunnel3Queue *q);
426 * 426 *
427 * @return Handle to cancel message. NULL if @c cont is NULL. 427 * @return Handle to cancel message. NULL if @c cont is NULL.
428 */ 428 */
429struct CadetTunnel3Queue * 429struct CadetTunnelQueue *
430GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message, 430GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
431 struct CadetTunnel3 *t, struct CadetConnection *c, 431 struct CadetTunnel *t, struct CadetConnection *c,
432 int force, GCT_sent cont, void *cont_cls); 432 int force, GCT_sent cont, void *cont_cls);
433 433
434/** 434/**
@@ -439,7 +439,7 @@ GCT_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
439 * @return #GNUNET_YES if it is loopback. 439 * @return #GNUNET_YES if it is loopback.
440 */ 440 */
441int 441int
442GCT_is_loopback (const struct CadetTunnel3 *t); 442GCT_is_loopback (const struct CadetTunnel *t);
443 443
444/** 444/**
445 * Is the tunnel using this path already? 445 * Is the tunnel using this path already?
@@ -450,7 +450,7 @@ GCT_is_loopback (const struct CadetTunnel3 *t);
450 * @return #GNUNET_YES a connection uses this path. 450 * @return #GNUNET_YES a connection uses this path.
451 */ 451 */
452int 452int
453GCT_is_path_used (const struct CadetTunnel3 *t, const struct CadetPeerPath *p); 453GCT_is_path_used (const struct CadetTunnel *t, const struct CadetPeerPath *p);
454 454
455/** 455/**
456 * Get a cost of a path for a tunnel considering existing connections. 456 * Get a cost of a path for a tunnel considering existing connections.
@@ -461,7 +461,7 @@ GCT_is_path_used (const struct CadetTunnel3 *t, const struct CadetPeerPath *p);
461 * @return Cost of the path (path length + number of overlapping nodes) 461 * @return Cost of the path (path length + number of overlapping nodes)
462 */ 462 */
463unsigned int 463unsigned int
464GCT_get_path_cost (const struct CadetTunnel3 *t, 464GCT_get_path_cost (const struct CadetTunnel *t,
465 const struct CadetPeerPath *path); 465 const struct CadetPeerPath *path);
466 466
467/** 467/**
@@ -472,7 +472,7 @@ GCT_get_path_cost (const struct CadetTunnel3 *t,
472 * @return Static string the destination peer's ID. 472 * @return Static string the destination peer's ID.
473 */ 473 */
474const char * 474const char *
475GCT_2s (const struct CadetTunnel3 *t); 475GCT_2s (const struct CadetTunnel *t);
476 476
477/** 477/**
478 * Log all possible info about the tunnel state. 478 * Log all possible info about the tunnel state.
@@ -480,7 +480,7 @@ GCT_2s (const struct CadetTunnel3 *t);
480 * @param t Tunnel to debug. 480 * @param t Tunnel to debug.
481 */ 481 */
482void 482void
483GCT_debug (const struct CadetTunnel3 *t); 483GCT_debug (const struct CadetTunnel *t);
484 484
485/** 485/**
486 * Iterate all tunnels. 486 * Iterate all tunnels.
@@ -507,7 +507,7 @@ GCT_count_all (void);
507 * @param cls Closure for @c iter. 507 * @param cls Closure for @c iter.
508 */ 508 */
509void 509void
510GCT_iterate_connections (struct CadetTunnel3 *t, GCT_conn_iter iter, void *cls); 510GCT_iterate_connections (struct CadetTunnel *t, GCT_conn_iter iter, void *cls);
511 511
512/** 512/**
513 * Iterate all channels of a tunnel. 513 * Iterate all channels of a tunnel.
@@ -517,7 +517,7 @@ GCT_iterate_connections (struct CadetTunnel3 *t, GCT_conn_iter iter, void *cls);
517 * @param cls Closure for @c iter. 517 * @param cls Closure for @c iter.
518 */ 518 */
519void 519void
520GCT_iterate_channels (struct CadetTunnel3 *t, GCT_chan_iter iter, void *cls); 520GCT_iterate_channels (struct CadetTunnel *t, GCT_chan_iter iter, void *cls);
521 521
522#if 0 /* keep Emacsens' auto-indent happy */ 522#if 0 /* keep Emacsens' auto-indent happy */
523{ 523{