diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-18 14:49:17 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-18 14:49:17 +0100 |
commit | e02d76e46cd00724d32f81375e8981524ee6f3e2 (patch) | |
tree | 91a6aea89bfda7865f04244e2fb2a6ebb019bc3a /src/cadet/gnunet-service-cadet_channel.c | |
parent | 9f1d39a86ddb227f91ad75f740d59adeb9b6ee31 (diff) | |
download | gnunet-e02d76e46cd00724d32f81375e8981524ee6f3e2.tar.gz gnunet-e02d76e46cd00724d32f81375e8981524ee6f3e2.zip |
more rename festivities
Diffstat (limited to 'src/cadet/gnunet-service-cadet_channel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet_channel.c | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index eff6af40b..20ed582bd 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_ChannelDataMessage with payload */ | 128 | /* struct GNUNET_CADET_ChannelAppDataMessage 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 | */ |
370 | static struct CadetReliableMessage * | 370 | static struct CadetReliableMessage * |
371 | copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid, | 371 | copy_message (const struct GNUNET_CADET_ChannelAppDataMessage *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_ChannelDataMessage *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_CHANNEL_DATA; | 381 | copy->type = GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA; |
382 | GNUNET_memcpy (©[1], msg, size); | 382 | GNUNET_memcpy (©[1], msg, size); |
383 | 383 | ||
384 | return copy; | 384 | return copy; |
@@ -393,7 +393,7 @@ copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid, | |||
393 | * @param rel Reliability data to the corresponding direction. | 393 | * @param rel Reliability data to the corresponding direction. |
394 | */ | 394 | */ |
395 | static void | 395 | static void |
396 | add_buffered_data (const struct GNUNET_CADET_ChannelDataMessage *msg, | 396 | add_buffered_data (const struct GNUNET_CADET_ChannelAppDataMessage *msg, |
397 | struct CadetChannelReliability *rel) | 397 | struct CadetChannelReliability *rel) |
398 | { | 398 | { |
399 | struct CadetReliableMessage *copy; | 399 | struct CadetReliableMessage *copy; |
@@ -573,7 +573,7 @@ send_client_create (struct CadetChannel *ch) | |||
573 | */ | 573 | */ |
574 | static void | 574 | static void |
575 | send_client_data (struct CadetChannel *ch, | 575 | send_client_data (struct CadetChannel *ch, |
576 | const struct GNUNET_CADET_ChannelDataMessage *msg, | 576 | const struct GNUNET_CADET_ChannelAppDataMessage *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_ChannelDataMessage *msg = (struct GNUNET_CADET_ChannelDataMessage *) ©[1]; | 634 | struct GNUNET_CADET_ChannelAppDataMessage *msg = (struct GNUNET_CADET_ChannelAppDataMessage *) ©[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_ChannelDataMessage *payload; | 734 | struct GNUNET_CADET_ChannelAppDataMessage *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_ChannelDataMessage *) ©[1]; | 746 | payload = (struct GNUNET_CADET_ChannelAppDataMessage *) ©[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_CHANNEL_DATA: | 811 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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_CHANNEL_DATA_ACK: | 847 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
848 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 848 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
849 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 849 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_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_CHANNEL_DATA_ACK != type | 856 | && GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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,10 +882,10 @@ ch_message_sent (void *cls, | |||
882 | static void | 882 | static void |
883 | send_create (struct CadetChannel *ch) | 883 | send_create (struct CadetChannel *ch) |
884 | { | 884 | { |
885 | struct GNUNET_CADET_ChannelCreateMessage msgcc; | 885 | struct GNUNET_CADET_ChannelOpenMessage 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_OPEN); |
889 | msgcc.chid = ch->gid; | 889 | msgcc.chid = ch->gid; |
890 | msgcc.port = ch->port; | 890 | msgcc.port = ch->port; |
891 | msgcc.opt = htonl (channel_get_options (ch)); | 891 | msgcc.opt = htonl (channel_get_options (ch)); |
@@ -906,7 +906,7 @@ send_ack (struct CadetChannel *ch, int fwd) | |||
906 | struct GNUNET_CADET_ChannelManageMessage 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_CREATE_ACK); | 909 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_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)); |
@@ -946,7 +946,7 @@ send_nack (struct CadetChannel *ch) | |||
946 | struct GNUNET_CADET_ChannelManageMessage 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_CREATE_NACK_DEPRECATED); | 949 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_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)); |
@@ -1300,29 +1300,29 @@ handle_loopback (struct CadetChannel *ch, | |||
1300 | 1300 | ||
1301 | switch (type) | 1301 | switch (type) |
1302 | { | 1302 | { |
1303 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA: | 1303 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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_ChannelDataMessage *) msgh)->mid), ntohs (msgh->size)); | 1306 | ntohl (((struct GNUNET_CADET_ChannelAppDataMessage *) msgh)->mid), ntohs (msgh->size)); |
1307 | GCCH_handle_data (ch, (struct GNUNET_CADET_ChannelDataMessage *) msgh, fwd); | 1307 | GCCH_handle_data (ch, (struct GNUNET_CADET_ChannelAppDataMessage *) msgh, fwd); |
1308 | break; | 1308 | break; |
1309 | 1309 | ||
1310 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK: | 1310 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
1311 | GCCH_handle_data_ack (ch, (struct GNUNET_CADET_ChannelDataAckMessage *) 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_OPEN: |
1315 | GCCH_handle_create (ch->t, | 1315 | GCCH_handle_create (ch->t, |
1316 | (struct GNUNET_CADET_ChannelCreateMessage *) msgh); | 1316 | (struct GNUNET_CADET_ChannelOpenMessage *) msgh); |
1317 | break; | 1317 | break; |
1318 | 1318 | ||
1319 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 1319 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK: |
1320 | GCCH_handle_ack (ch, | 1320 | GCCH_handle_ack (ch, |
1321 | (struct GNUNET_CADET_ChannelManageMessage *) msgh, | 1321 | (struct GNUNET_CADET_ChannelManageMessage *) msgh, |
1322 | fwd); | 1322 | fwd); |
1323 | break; | 1323 | break; |
1324 | 1324 | ||
1325 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: | 1325 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED: |
1326 | GCCH_handle_nack (ch); | 1326 | GCCH_handle_nack (ch); |
1327 | break; | 1327 | break; |
1328 | 1328 | ||
@@ -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_CHANNEL_DATA_ACK); | 1539 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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_CHANNEL_DATA) | 1547 | if (copy->type != GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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_ChannelDataMessage *payload; | 1751 | struct GNUNET_CADET_ChannelAppDataMessage *payload; |
1752 | uint16_t p2p_size = sizeof(struct GNUNET_CADET_ChannelDataMessage) + size; | 1752 | uint16_t p2p_size = sizeof(struct GNUNET_CADET_ChannelAppDataMessage) + 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_ChannelDataMessage *) cbuf; | 1778 | payload = (struct GNUNET_CADET_ChannelAppDataMessage *) 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_CHANNEL_DATA); | 1783 | payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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 | */ |
1847 | int | 1847 | int |
1848 | GCCH_handle_local_create (struct CadetClient *c, | 1848 | GCCH_handle_local_create (struct CadetClient *c, |
1849 | struct GNUNET_CADET_ChannelCreateMessageMessage *msg) | 1849 | struct GNUNET_CADET_ChannelOpenMessageMessage *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 | */ |
1915 | void | 1915 | void |
1916 | GCCH_handle_data (struct CadetChannel *ch, | 1916 | GCCH_handle_data (struct CadetChannel *ch, |
1917 | const struct GNUNET_CADET_ChannelDataMessage *msg, | 1917 | const struct GNUNET_CADET_ChannelAppDataMessage *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_CHANNEL_DATA), GC_m2s (payload_type), mid, | 1975 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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) || |
@@ -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_CHANNEL_DATA_ACK), msg->futures, ack, | 2072 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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 | */ |
2152 | struct CadetChannel * | 2152 | struct CadetChannel * |
2153 | GCCH_handle_create (struct CadetTunnel *t, | 2153 | GCCH_handle_create (struct CadetTunnel *t, |
2154 | const struct GNUNET_CADET_ChannelCreateMessage *msg) | 2154 | const struct GNUNET_CADET_ChannelOpenMessage *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; |
@@ -2179,7 +2179,7 @@ GCCH_handle_create (struct CadetTunnel *t, | |||
2179 | 2179 | ||
2180 | LOG (GNUNET_ERROR_TYPE_INFO, | 2180 | LOG (GNUNET_ERROR_TYPE_INFO, |
2181 | "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", | 2181 | "<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n", |
2182 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE), chid, port, | 2182 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN), chid, port, |
2183 | GCCH_2s (ch), ch, GC_f2s (GNUNET_YES), ntohs (msg->header.size)); | 2183 | GCCH_2s (ch), ch, GC_f2s (GNUNET_YES), ntohs (msg->header.size)); |
2184 | 2184 | ||
2185 | if (GNUNET_YES == new_channel || GCT_is_loopback (t)) | 2185 | if (GNUNET_YES == new_channel || GCT_is_loopback (t)) |
@@ -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_CREATE_NACK_DEPRECATED), ch->gid, 0, | 2255 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_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); |
@@ -2277,7 +2277,7 @@ GCCH_handle_ack (struct CadetChannel *ch, | |||
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_CREATE_ACK), ch->gid, 0, | 2280 | GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_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'. */ |
@@ -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_CHANNEL_DATA: | 2386 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA: |
2387 | { | 2387 | { |
2388 | struct GNUNET_CADET_ChannelDataMessage *data_msg; | 2388 | struct GNUNET_CADET_ChannelAppDataMessage *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_ChannelDataMessage *) message; | 2392 | data_msg = (struct GNUNET_CADET_ChannelAppDataMessage *) 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,7 +2397,7 @@ 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_CHANNEL_DATA_ACK: | 2400 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
2401 | { | 2401 | { |
2402 | struct GNUNET_CADET_ChannelDataAckMessage *ack_msg; | 2402 | struct GNUNET_CADET_ChannelDataAckMessage *ack_msg; |
2403 | ack_msg = (struct GNUNET_CADET_ChannelDataAckMessage *) message; | 2403 | ack_msg = (struct GNUNET_CADET_ChannelDataAckMessage *) message; |
@@ -2406,15 +2406,15 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2406 | (unsigned long int) ack_msg->futures); | 2406 | (unsigned long int) ack_msg->futures); |
2407 | break; | 2407 | break; |
2408 | } | 2408 | } |
2409 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 2409 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
2410 | { | 2410 | { |
2411 | struct GNUNET_CADET_ChannelCreateMessage *cc_msg; | 2411 | struct GNUNET_CADET_ChannelOpenMessage *cc_msg; |
2412 | cc_msg = (struct GNUNET_CADET_ChannelCreateMessage *) message; | 2412 | cc_msg = (struct GNUNET_CADET_ChannelOpenMessage *) 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_CREATE_ACK: | 2416 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK: |
2417 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_NACK_DEPRECATED: | 2417 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED: |
2418 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: | 2418 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY: |
2419 | { | 2419 | { |
2420 | struct GNUNET_CADET_ChannelManageMessage *m_msg; | 2420 | struct GNUNET_CADET_ChannelManageMessage *m_msg; |
@@ -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_CHANNEL_DATA: | 2441 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_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_CHANNEL_DATA_ACK: | 2487 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK: |
2488 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE: | 2488 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN: |
2489 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE_ACK: | 2489 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_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_CREATE_NACK_DEPRECATED: | 2524 | case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_NACK_DEPRECATED: |
2525 | fire_and_forget (message, ch, GNUNET_YES); | 2525 | fire_and_forget (message, ch, GNUNET_YES); |
2526 | break; | 2526 | break; |
2527 | 2527 | ||