aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_channel.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-18 10:51:16 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-18 10:51:16 +0100
commita1bd2dcc29c126023dbd1ddf83d7514859d1775b (patch)
tree9e23f546f72f800c6451a9ab717bed6fa87e2ead /src/cadet/gnunet-service-cadet_channel.c
parent4ed4bcba53601d97793663017efcda877c3c490a (diff)
downloadgnunet-a1bd2dcc29c126023dbd1ddf83d7514859d1775b.tar.gz
gnunet-a1bd2dcc29c126023dbd1ddf83d7514859d1775b.zip
cadet message struct and type rename-fest
Diffstat (limited to 'src/cadet/gnunet-service-cadet_channel.c')
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c124
1 files changed, 62 insertions, 62 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 6bc3dc590..eff6af40b 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -125,7 +125,7 @@ struct CadetReliableMessage
125 */ 125 */
126 struct GNUNET_TIME_Absolute timestamp; 126 struct GNUNET_TIME_Absolute timestamp;
127 127
128 /* struct GNUNET_CADET_Data with payload */ 128 /* struct GNUNET_CADET_ChannelDataMessage with payload */
129}; 129};
130 130
131 131
@@ -368,7 +368,7 @@ is_loopback (const struct CadetChannel *ch)
368 * @param rel Reliability data for retransmission. 368 * @param rel Reliability data for retransmission.
369 */ 369 */
370static struct CadetReliableMessage * 370static struct CadetReliableMessage *
371copy_message (const struct GNUNET_CADET_Data *msg, uint32_t mid, 371copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid,
372 struct CadetChannelReliability *rel) 372 struct CadetChannelReliability *rel)
373{ 373{
374 struct CadetReliableMessage *copy; 374 struct CadetReliableMessage *copy;
@@ -378,7 +378,7 @@ copy_message (const struct GNUNET_CADET_Data *msg, uint32_t mid,
378 copy = GNUNET_malloc (sizeof (*copy) + size); 378 copy = GNUNET_malloc (sizeof (*copy) + size);
379 copy->mid = mid; 379 copy->mid = mid;
380 copy->rel = rel; 380 copy->rel = rel;
381 copy->type = GNUNET_MESSAGE_TYPE_CADET_DATA; 381 copy->type = GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA;
382 GNUNET_memcpy (&copy[1], msg, size); 382 GNUNET_memcpy (&copy[1], msg, size);
383 383
384 return copy; 384 return copy;
@@ -393,7 +393,7 @@ copy_message (const struct GNUNET_CADET_Data *msg, uint32_t mid,
393 * @param rel Reliability data to the corresponding direction. 393 * @param rel Reliability data to the corresponding direction.
394 */ 394 */
395static void 395static void
396add_buffered_data (const struct GNUNET_CADET_Data *msg, 396add_buffered_data (const struct GNUNET_CADET_ChannelDataMessage *msg,
397 struct CadetChannelReliability *rel) 397 struct CadetChannelReliability *rel)
398{ 398{
399 struct CadetReliableMessage *copy; 399 struct CadetReliableMessage *copy;
@@ -513,7 +513,7 @@ channel_get_options (struct CadetChannel *ch)
513static void 513static void
514send_destroy (struct CadetChannel *ch, int local_only) 514send_destroy (struct CadetChannel *ch, int local_only)
515{ 515{
516 struct GNUNET_CADET_ChannelManage msg; 516 struct GNUNET_CADET_ChannelManageMessage msg;
517 517
518 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY); 518 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY);
519 msg.header.size = htons (sizeof (msg)); 519 msg.header.size = htons (sizeof (msg));
@@ -573,7 +573,7 @@ send_client_create (struct CadetChannel *ch)
573 */ 573 */
574static void 574static void
575send_client_data (struct CadetChannel *ch, 575send_client_data (struct CadetChannel *ch,
576 const struct GNUNET_CADET_Data *msg, 576 const struct GNUNET_CADET_ChannelDataMessage *msg,
577 int fwd) 577 int fwd)
578{ 578{
579 if (fwd) 579 if (fwd)
@@ -631,7 +631,7 @@ send_client_buffered_data (struct CadetChannel *ch,
631 { 631 {
632 if (copy->mid == rel->mid_recv || GNUNET_NO == ch->reliable) 632 if (copy->mid == rel->mid_recv || GNUNET_NO == ch->reliable)
633 { 633 {
634 struct GNUNET_CADET_Data *msg = (struct GNUNET_CADET_Data *) &copy[1]; 634 struct GNUNET_CADET_ChannelDataMessage *msg = (struct GNUNET_CADET_ChannelDataMessage *) &copy[1];
635 635
636 LOG (GNUNET_ERROR_TYPE_DEBUG, " have %u! now expecting %u\n", 636 LOG (GNUNET_ERROR_TYPE_DEBUG, " have %u! now expecting %u\n",
637 copy->mid, rel->mid_recv + 1); 637 copy->mid, rel->mid_recv + 1);
@@ -731,7 +731,7 @@ channel_retransmit_message (void *cls)
731 struct CadetChannelReliability *rel = cls; 731 struct CadetChannelReliability *rel = cls;
732 struct CadetReliableMessage *copy; 732 struct CadetReliableMessage *copy;
733 struct CadetChannel *ch; 733 struct CadetChannel *ch;
734 struct GNUNET_CADET_Data *payload; 734 struct GNUNET_CADET_ChannelDataMessage *payload;
735 int fwd; 735 int fwd;
736 736
737 rel->retry_task = NULL; 737 rel->retry_task = NULL;
@@ -743,7 +743,7 @@ channel_retransmit_message (void *cls)
743 return; 743 return;
744 } 744 }
745 745
746 payload = (struct GNUNET_CADET_Data *) &copy[1]; 746 payload = (struct GNUNET_CADET_ChannelDataMessage *) &copy[1];
747 fwd = (rel == ch->root_rel); 747 fwd = (rel == ch->root_rel);
748 748
749 /* Message not found in the queue that we are going to use. */ 749 /* Message not found in the queue that we are going to use. */
@@ -808,7 +808,7 @@ ch_message_sent (void *cls,
808 808
809 switch (chq->type) 809 switch (chq->type)
810 { 810 {
811 case GNUNET_MESSAGE_TYPE_CADET_DATA: 811 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA:
812 LOG (GNUNET_ERROR_TYPE_DEBUG, "data MID %u sent\n", copy->mid); 812 LOG (GNUNET_ERROR_TYPE_DEBUG, "data MID %u sent\n", copy->mid);
813 GNUNET_assert (chq == copy->chq); 813 GNUNET_assert (chq == copy->chq);
814 copy->timestamp = GNUNET_TIME_absolute_get (); 814 copy->timestamp = GNUNET_TIME_absolute_get ();
@@ -844,16 +844,16 @@ ch_message_sent (void *cls,
844 break; 844 break;
845 845
846 846
847 case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK: 847 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK:
848 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: 848 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE:
849 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: 849 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK:
850 LOG (GNUNET_ERROR_TYPE_DEBUG, "sent %s\n", GC_m2s (chq->type)); 850 LOG (GNUNET_ERROR_TYPE_DEBUG, "sent %s\n", GC_m2s (chq->type));
851 rel = chq->rel; 851 rel = chq->rel;
852 GNUNET_assert (rel->uniq == chq); 852 GNUNET_assert (rel->uniq == chq);
853 rel->uniq = NULL; 853 rel->uniq = NULL;
854 854
855 if (CADET_CHANNEL_READY != rel->ch->state 855 if (CADET_CHANNEL_READY != rel->ch->state
856 && GNUNET_MESSAGE_TYPE_CADET_DATA_ACK != type 856 && GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK != type
857 && GNUNET_NO == rel->ch->destroy) 857 && GNUNET_NO == rel->ch->destroy)
858 { 858 {
859 GNUNET_assert (NULL == rel->retry_task); 859 GNUNET_assert (NULL == rel->retry_task);
@@ -882,7 +882,7 @@ ch_message_sent (void *cls,
882static void 882static void
883send_create (struct CadetChannel *ch) 883send_create (struct CadetChannel *ch)
884{ 884{
885 struct GNUNET_CADET_ChannelCreate msgcc; 885 struct GNUNET_CADET_ChannelCreateMessage msgcc;
886 886
887 msgcc.header.size = htons (sizeof (msgcc)); 887 msgcc.header.size = htons (sizeof (msgcc));
888 msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE); 888 msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE);
@@ -903,10 +903,10 @@ send_create (struct CadetChannel *ch)
903static void 903static void
904send_ack (struct CadetChannel *ch, int fwd) 904send_ack (struct CadetChannel *ch, int fwd)
905{ 905{
906 struct GNUNET_CADET_ChannelManage msg; 906 struct GNUNET_CADET_ChannelManageMessage msg;
907 907
908 msg.header.size = htons (sizeof (msg)); 908 msg.header.size = htons (sizeof (msg));
909 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK); 909 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK);
910 LOG (GNUNET_ERROR_TYPE_DEBUG, 910 LOG (GNUNET_ERROR_TYPE_DEBUG,
911 " sending channel %s ack for channel %s\n", 911 " sending channel %s ack for channel %s\n",
912 GC_f2s (fwd), GCCH_2s (ch)); 912 GC_f2s (fwd), GCCH_2s (ch));
@@ -943,10 +943,10 @@ fire_and_forget (const struct GNUNET_MessageHeader *msg,
943static void 943static void
944send_nack (struct CadetChannel *ch) 944send_nack (struct CadetChannel *ch)
945{ 945{
946 struct GNUNET_CADET_ChannelManage msg; 946 struct GNUNET_CADET_ChannelManageMessage msg;
947 947
948 msg.header.size = htons (sizeof (msg)); 948 msg.header.size = htons (sizeof (msg));
949 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK); 949 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED);
950 LOG (GNUNET_ERROR_TYPE_DEBUG, 950 LOG (GNUNET_ERROR_TYPE_DEBUG,
951 " sending channel NACK for channel %s\n", 951 " sending channel NACK for channel %s\n",
952 GCCH_2s (ch)); 952 GCCH_2s (ch));
@@ -1024,7 +1024,7 @@ channel_rel_free_all (struct CadetChannelReliability *rel)
1024 */ 1024 */
1025static unsigned int 1025static unsigned int
1026channel_rel_free_sent (struct CadetChannelReliability *rel, 1026channel_rel_free_sent (struct CadetChannelReliability *rel,
1027 const struct GNUNET_CADET_DataACK *msg) 1027 const struct GNUNET_CADET_ChannelDataAckMessage *msg)
1028{ 1028{
1029 struct CadetReliableMessage *copy; 1029 struct CadetReliableMessage *copy;
1030 struct CadetReliableMessage *next; 1030 struct CadetReliableMessage *next;
@@ -1300,35 +1300,35 @@ handle_loopback (struct CadetChannel *ch,
1300 1300
1301 switch (type) 1301 switch (type)
1302 { 1302 {
1303 case GNUNET_MESSAGE_TYPE_CADET_DATA: 1303 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA:
1304 /* Don't send hop ACK, wait for client to ACK */ 1304 /* Don't send hop ACK, wait for client to ACK */
1305 LOG (GNUNET_ERROR_TYPE_DEBUG, "SEND loopback %u (%u)\n", 1305 LOG (GNUNET_ERROR_TYPE_DEBUG, "SEND loopback %u (%u)\n",
1306 ntohl (((struct GNUNET_CADET_Data *) msgh)->mid), ntohs (msgh->size)); 1306 ntohl (((struct GNUNET_CADET_ChannelDataMessage *) msgh)->mid), ntohs (msgh->size));
1307 GCCH_handle_data (ch, (struct GNUNET_CADET_Data *) msgh, fwd); 1307 GCCH_handle_data (ch, (struct GNUNET_CADET_ChannelDataMessage *) msgh, fwd);
1308 break; 1308 break;
1309 1309
1310 case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK: 1310 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK:
1311 GCCH_handle_data_ack (ch, (struct GNUNET_CADET_DataACK *) msgh, fwd); 1311 GCCH_handle_data_ack (ch, (struct GNUNET_CADET_ChannelDataAckMessage *) msgh, fwd);
1312 break; 1312 break;
1313 1313
1314 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: 1314 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE:
1315 GCCH_handle_create (ch->t, 1315 GCCH_handle_create (ch->t,
1316 (struct GNUNET_CADET_ChannelCreate *) msgh); 1316 (struct GNUNET_CADET_ChannelCreateMessage *) msgh);
1317 break; 1317 break;
1318 1318
1319 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: 1319 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK:
1320 GCCH_handle_ack (ch, 1320 GCCH_handle_ack (ch,
1321 (struct GNUNET_CADET_ChannelManage *) msgh, 1321 (struct GNUNET_CADET_ChannelManageMessage *) msgh,
1322 fwd); 1322 fwd);
1323 break; 1323 break;
1324 1324
1325 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK: 1325 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED:
1326 GCCH_handle_nack (ch); 1326 GCCH_handle_nack (ch);
1327 break; 1327 break;
1328 1328
1329 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: 1329 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
1330 GCCH_handle_destroy (ch, 1330 GCCH_handle_destroy (ch,
1331 (struct GNUNET_CADET_ChannelManage *) msgh, 1331 (struct GNUNET_CADET_ChannelManageMessage *) msgh,
1332 fwd); 1332 fwd);
1333 break; 1333 break;
1334 1334
@@ -1523,7 +1523,7 @@ GCCH_is_terminal (struct CadetChannel *ch, int fwd)
1523void 1523void
1524GCCH_send_data_ack (struct CadetChannel *ch, int fwd) 1524GCCH_send_data_ack (struct CadetChannel *ch, int fwd)
1525{ 1525{
1526 struct GNUNET_CADET_DataACK msg; 1526 struct GNUNET_CADET_ChannelDataAckMessage msg;
1527 struct CadetChannelReliability *rel; 1527 struct CadetChannelReliability *rel;
1528 struct CadetReliableMessage *copy; 1528 struct CadetReliableMessage *copy;
1529 unsigned int delta; 1529 unsigned int delta;
@@ -1536,7 +1536,7 @@ GCCH_send_data_ack (struct CadetChannel *ch, int fwd)
1536 rel = fwd ? ch->dest_rel : ch->root_rel; 1536 rel = fwd ? ch->dest_rel : ch->root_rel;
1537 ack = rel->mid_recv - 1; 1537 ack = rel->mid_recv - 1;
1538 1538
1539 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_DATA_ACK); 1539 msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK);
1540 msg.header.size = htons (sizeof (msg)); 1540 msg.header.size = htons (sizeof (msg));
1541 msg.chid = ch->gid; 1541 msg.chid = ch->gid;
1542 msg.mid = htonl (ack); 1542 msg.mid = htonl (ack);
@@ -1544,7 +1544,7 @@ GCCH_send_data_ack (struct CadetChannel *ch, int fwd)
1544 msg.futures = 0LL; 1544 msg.futures = 0LL;
1545 for (copy = rel->head_recv; NULL != copy; copy = copy->next) 1545 for (copy = rel->head_recv; NULL != copy; copy = copy->next)
1546 { 1546 {
1547 if (copy->type != GNUNET_MESSAGE_TYPE_CADET_DATA) 1547 if (copy->type != GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA)
1548 { 1548 {
1549 LOG (GNUNET_ERROR_TYPE_DEBUG, " Type %s, expected DATA\n", 1549 LOG (GNUNET_ERROR_TYPE_DEBUG, " Type %s, expected DATA\n",
1550 GC_m2s (copy->type)); 1550 GC_m2s (copy->type));
@@ -1748,8 +1748,8 @@ GCCH_handle_local_data (struct CadetChannel *ch,
1748 size_t size) 1748 size_t size)
1749{ 1749{
1750 struct CadetChannelReliability *rel; 1750 struct CadetChannelReliability *rel;
1751 struct GNUNET_CADET_Data *payload; 1751 struct GNUNET_CADET_ChannelDataMessage *payload;
1752 uint16_t p2p_size = sizeof(struct GNUNET_CADET_Data) + size; 1752 uint16_t p2p_size = sizeof(struct GNUNET_CADET_ChannelDataMessage) + size;
1753 unsigned char cbuf[p2p_size]; 1753 unsigned char cbuf[p2p_size];
1754 unsigned char buffer; 1754 unsigned char buffer;
1755 1755
@@ -1775,12 +1775,12 @@ GCCH_handle_local_data (struct CadetChannel *ch,
1775 rel->client_allowed = GNUNET_NO; 1775 rel->client_allowed = GNUNET_NO;
1776 1776
1777 /* Ok, everything is correct, send the message. */ 1777 /* Ok, everything is correct, send the message. */
1778 payload = (struct GNUNET_CADET_Data *) cbuf; 1778 payload = (struct GNUNET_CADET_ChannelDataMessage *) cbuf;
1779 payload->mid = htonl (rel->mid_send); 1779 payload->mid = htonl (rel->mid_send);
1780 rel->mid_send++; 1780 rel->mid_send++;
1781 GNUNET_memcpy (&payload[1], message, size); 1781 GNUNET_memcpy (&payload[1], message, size);
1782 payload->header.size = htons (p2p_size); 1782 payload->header.size = htons (p2p_size);
1783 payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_DATA); 1783 payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA);
1784 payload->chid = ch->gid; 1784 payload->chid = ch->gid;
1785 LOG (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n"); 1785 LOG (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n");
1786 GCCH_send_prebuilt_message (&payload->header, ch, fwd, NULL); 1786 GCCH_send_prebuilt_message (&payload->header, ch, fwd, NULL);
@@ -1846,7 +1846,7 @@ GCCH_handle_local_destroy (struct CadetChannel *ch,
1846 */ 1846 */
1847int 1847int
1848GCCH_handle_local_create (struct CadetClient *c, 1848GCCH_handle_local_create (struct CadetClient *c,
1849 struct GNUNET_CADET_ChannelCreateMessage *msg) 1849 struct GNUNET_CADET_ChannelCreateMessageMessage *msg)
1850{ 1850{
1851 struct CadetChannel *ch; 1851 struct CadetChannel *ch;
1852 struct CadetTunnel *t; 1852 struct CadetTunnel *t;
@@ -1914,7 +1914,7 @@ GCCH_handle_local_create (struct CadetClient *c,
1914 */ 1914 */
1915void 1915void
1916GCCH_handle_data (struct CadetChannel *ch, 1916GCCH_handle_data (struct CadetChannel *ch,
1917 const struct GNUNET_CADET_Data *msg, 1917 const struct GNUNET_CADET_ChannelDataMessage *msg,
1918 int fwd) 1918 int fwd)
1919{ 1919{
1920 struct CadetChannelReliability *rel; 1920 struct CadetChannelReliability *rel;
@@ -1972,7 +1972,7 @@ GCCH_handle_data (struct CadetChannel *ch,
1972 1972
1973 mid = ntohl (msg->mid); 1973 mid = ntohl (msg->mid);
1974 LOG (GNUNET_ERROR_TYPE_INFO, "<== %s (%s %4u) on chan %s (%p) %s [%5u]\n", 1974 LOG (GNUNET_ERROR_TYPE_INFO, "<== %s (%s %4u) on chan %s (%p) %s [%5u]\n",
1975 GC_m2s (GNUNET_MESSAGE_TYPE_CADET_DATA), GC_m2s (payload_type), mid, 1975 GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA), GC_m2s (payload_type), mid,
1976 GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); 1976 GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
1977 1977
1978 if ( (GNUNET_NO == ch->reliable) || 1978 if ( (GNUNET_NO == ch->reliable) ||
@@ -2044,7 +2044,7 @@ GCCH_handle_data (struct CadetChannel *ch,
2044 */ 2044 */
2045void 2045void
2046GCCH_handle_data_ack (struct CadetChannel *ch, 2046GCCH_handle_data_ack (struct CadetChannel *ch,
2047 const struct GNUNET_CADET_DataACK *msg, 2047 const struct GNUNET_CADET_ChannelDataAckMessage *msg,
2048 int fwd) 2048 int fwd)
2049{ 2049{
2050 struct CadetChannelReliability *rel; 2050 struct CadetChannelReliability *rel;
@@ -2069,7 +2069,7 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
2069 ack = ntohl (msg->mid); 2069 ack = ntohl (msg->mid);
2070 LOG (GNUNET_ERROR_TYPE_INFO, 2070 LOG (GNUNET_ERROR_TYPE_INFO,
2071 "<== %s (0x%010lX %4u) on chan %s (%p) %s [%5u]\n", 2071 "<== %s (0x%010lX %4u) on chan %s (%p) %s [%5u]\n",
2072 GC_m2s (GNUNET_MESSAGE_TYPE_CADET_DATA_ACK), msg->futures, ack, 2072 GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK), msg->futures, ack,
2073 GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); 2073 GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
2074 2074
2075 if (GNUNET_YES == fwd) 2075 if (GNUNET_YES == fwd)
@@ -2151,7 +2151,7 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
2151 */ 2151 */
2152struct CadetChannel * 2152struct CadetChannel *
2153GCCH_handle_create (struct CadetTunnel *t, 2153GCCH_handle_create (struct CadetTunnel *t,
2154 const struct GNUNET_CADET_ChannelCreate *msg) 2154 const struct GNUNET_CADET_ChannelCreateMessage *msg)
2155{ 2155{
2156 struct GNUNET_CADET_ClientChannelNumber chid; 2156 struct GNUNET_CADET_ClientChannelNumber chid;
2157 struct GNUNET_CADET_ChannelNumber gid; 2157 struct GNUNET_CADET_ChannelNumber gid;
@@ -2252,7 +2252,7 @@ GCCH_handle_nack (struct CadetChannel *ch)
2252{ 2252{
2253 LOG (GNUNET_ERROR_TYPE_INFO, 2253 LOG (GNUNET_ERROR_TYPE_INFO,
2254 "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", 2254 "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n",
2255 GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK), ch->gid, 0, 2255 GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED), ch->gid, 0,
2256 GCCH_2s (ch), ch, "---", 0); 2256 GCCH_2s (ch), ch, "---", 0);
2257 2257
2258 send_client_nack (ch); 2258 send_client_nack (ch);
@@ -2272,12 +2272,12 @@ GCCH_handle_nack (struct CadetChannel *ch)
2272 */ 2272 */
2273void 2273void
2274GCCH_handle_ack (struct CadetChannel *ch, 2274GCCH_handle_ack (struct CadetChannel *ch,
2275 const struct GNUNET_CADET_ChannelManage *msg, 2275 const struct GNUNET_CADET_ChannelManageMessage *msg,
2276 int fwd) 2276 int fwd)
2277{ 2277{
2278 LOG (GNUNET_ERROR_TYPE_INFO, 2278 LOG (GNUNET_ERROR_TYPE_INFO,
2279 "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", 2279 "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n",
2280 GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK), ch->gid, 0, 2280 GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK), ch->gid, 0,
2281 GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size)); 2281 GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
2282 2282
2283 /* If this is a remote (non-loopback) channel, find 'fwd'. */ 2283 /* If this is a remote (non-loopback) channel, find 'fwd'. */
@@ -2308,7 +2308,7 @@ GCCH_handle_ack (struct CadetChannel *ch,
2308 */ 2308 */
2309void 2309void
2310GCCH_handle_destroy (struct CadetChannel *ch, 2310GCCH_handle_destroy (struct CadetChannel *ch,
2311 const struct GNUNET_CADET_ChannelManage *msg, 2311 const struct GNUNET_CADET_ChannelManageMessage *msg,
2312 int fwd) 2312 int fwd)
2313{ 2313{
2314 struct CadetChannelReliability *rel; 2314 struct CadetChannelReliability *rel;
@@ -2383,13 +2383,13 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
2383 data_id = 0; 2383 data_id = 0;
2384 switch (type) 2384 switch (type)
2385 { 2385 {
2386 case GNUNET_MESSAGE_TYPE_CADET_DATA: 2386 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA:
2387 { 2387 {
2388 struct GNUNET_CADET_Data *data_msg; 2388 struct GNUNET_CADET_ChannelDataMessage *data_msg;
2389 struct GNUNET_MessageHeader *payload_msg; 2389 struct GNUNET_MessageHeader *payload_msg;
2390 uint16_t payload_type; 2390 uint16_t payload_type;
2391 2391
2392 data_msg = (struct GNUNET_CADET_Data *) message; 2392 data_msg = (struct GNUNET_CADET_ChannelDataMessage *) message;
2393 data_id = ntohl (data_msg->mid); 2393 data_id = ntohl (data_msg->mid);
2394 payload_msg = (struct GNUNET_MessageHeader *) &data_msg[1]; 2394 payload_msg = (struct GNUNET_MessageHeader *) &data_msg[1];
2395 payload_type = ntohs (payload_msg->type); 2395 payload_type = ntohs (payload_msg->type);
@@ -2397,10 +2397,10 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
2397 info[31] = '\0'; 2397 info[31] = '\0';
2398 break; 2398 break;
2399 } 2399 }
2400 case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK: 2400 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK:
2401 { 2401 {
2402 struct GNUNET_CADET_DataACK *ack_msg; 2402 struct GNUNET_CADET_ChannelDataAckMessage *ack_msg;
2403 ack_msg = (struct GNUNET_CADET_DataACK *) message; 2403 ack_msg = (struct GNUNET_CADET_ChannelDataAckMessage *) message;
2404 data_id = ntohl (ack_msg->mid); 2404 data_id = ntohl (ack_msg->mid);
2405 SPRINTF (info, "0x%010lX", 2405 SPRINTF (info, "0x%010lX",
2406 (unsigned long int) ack_msg->futures); 2406 (unsigned long int) ack_msg->futures);
@@ -2408,17 +2408,17 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
2408 } 2408 }
2409 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: 2409 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE:
2410 { 2410 {
2411 struct GNUNET_CADET_ChannelCreate *cc_msg; 2411 struct GNUNET_CADET_ChannelCreateMessage *cc_msg;
2412 cc_msg = (struct GNUNET_CADET_ChannelCreate *) message; 2412 cc_msg = (struct GNUNET_CADET_ChannelCreateMessage *) message;
2413 SPRINTF (info, " 0x%08X", ntohl (cc_msg->chid.cn)); 2413 SPRINTF (info, " 0x%08X", ntohl (cc_msg->chid.cn));
2414 break; 2414 break;
2415 } 2415 }
2416 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: 2416 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK:
2417 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK: 2417 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED:
2418 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: 2418 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
2419 { 2419 {
2420 struct GNUNET_CADET_ChannelManage *m_msg; 2420 struct GNUNET_CADET_ChannelManageMessage *m_msg;
2421 m_msg = (struct GNUNET_CADET_ChannelManage *) message; 2421 m_msg = (struct GNUNET_CADET_ChannelManageMessage *) message;
2422 SPRINTF (info, " 0x%08X", ntohl (m_msg->chid.cn)); 2422 SPRINTF (info, " 0x%08X", ntohl (m_msg->chid.cn));
2423 break; 2423 break;
2424 } 2424 }
@@ -2438,7 +2438,7 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
2438 2438
2439 switch (type) 2439 switch (type)
2440 { 2440 {
2441 case GNUNET_MESSAGE_TYPE_CADET_DATA: 2441 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA:
2442 if (GNUNET_YES == ch->reliable) 2442 if (GNUNET_YES == ch->reliable)
2443 { 2443 {
2444 chq = GNUNET_new (struct CadetChannelQueue); 2444 chq = GNUNET_new (struct CadetChannelQueue);
@@ -2484,9 +2484,9 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
2484 break; 2484 break;
2485 2485
2486 2486
2487 case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK: 2487 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK:
2488 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: 2488 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE:
2489 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK: 2489 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK:
2490 chq = GNUNET_new (struct CadetChannelQueue); 2490 chq = GNUNET_new (struct CadetChannelQueue);
2491 chq->type = type; 2491 chq->type = type;
2492 chq->rel = fwd ? ch->root_rel : ch->dest_rel; 2492 chq->rel = fwd ? ch->root_rel : ch->dest_rel;
@@ -2521,7 +2521,7 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
2521 2521
2522 2522
2523 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: 2523 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
2524 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK: 2524 case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED:
2525 fire_and_forget (message, ch, GNUNET_YES); 2525 fire_and_forget (message, ch, GNUNET_YES);
2526 break; 2526 break;
2527 2527