projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cancel existing last_control_qe handle before scheduling a new one, always
[oweals/gnunet.git]
/
src
/
cadet
/
gnunet-service-cadet_channel.c
diff --git
a/src/cadet/gnunet-service-cadet_channel.c
b/src/cadet/gnunet-service-cadet_channel.c
index eff6af40bd92dc0ecc475b3905f65e242c5e1e51..7b7c6e57ce4351c3028f9e0a0deecbe5b5410914 100644
(file)
--- a/
src/cadet/gnunet-service-cadet_channel.c
+++ b/
src/cadet/gnunet-service-cadet_channel.c
@@
-125,7
+125,7
@@
struct CadetReliableMessage
*/
struct GNUNET_TIME_Absolute timestamp;
*/
struct GNUNET_TIME_Absolute timestamp;
- /* struct GNUNET_CADET_ChannelDataMessage with payload */
+ /* struct GNUNET_CADET_Channel
App
DataMessage with payload */
};
};
@@
-216,7
+216,7
@@
struct CadetChannel
/**
* Global channel number ( < GNUNET_CADET_LOCAL_CHANNEL_ID_CLI)
*/
/**
* Global channel number ( < GNUNET_CADET_LOCAL_CHANNEL_ID_CLI)
*/
- struct GNUNET_CADET_ChannelNumber gid;
+ struct GNUNET_CADET_Channel
Tunnel
Number gid;
/**
* Local tunnel number for root (owner) client.
/**
* Local tunnel number for root (owner) client.
@@
-368,7
+368,7
@@
is_loopback (const struct CadetChannel *ch)
* @param rel Reliability data for retransmission.
*/
static struct CadetReliableMessage *
* @param rel Reliability data for retransmission.
*/
static struct CadetReliableMessage *
-copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid,
+copy_message (const struct GNUNET_CADET_Channel
App
DataMessage *msg, uint32_t mid,
struct CadetChannelReliability *rel)
{
struct CadetReliableMessage *copy;
struct CadetChannelReliability *rel)
{
struct CadetReliableMessage *copy;
@@
-378,7
+378,7
@@
copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid,
copy = GNUNET_malloc (sizeof (*copy) + size);
copy->mid = mid;
copy->rel = rel;
copy = GNUNET_malloc (sizeof (*copy) + size);
copy->mid = mid;
copy->rel = rel;
- copy->type = GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA;
+ copy->type = GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA;
GNUNET_memcpy (©[1], msg, size);
return copy;
GNUNET_memcpy (©[1], msg, size);
return copy;
@@
-393,7
+393,7
@@
copy_message (const struct GNUNET_CADET_ChannelDataMessage *msg, uint32_t mid,
* @param rel Reliability data to the corresponding direction.
*/
static void
* @param rel Reliability data to the corresponding direction.
*/
static void
-add_buffered_data (const struct GNUNET_CADET_ChannelDataMessage *msg,
+add_buffered_data (const struct GNUNET_CADET_Channel
App
DataMessage *msg,
struct CadetChannelReliability *rel)
{
struct CadetReliableMessage *copy;
struct CadetChannelReliability *rel)
{
struct CadetReliableMessage *copy;
@@
-451,7
+451,7
@@
add_destination (struct CadetChannel *ch, struct CadetClient *c)
}
/* Assign local id as destination */
}
/* Assign local id as destination */
- ch->lid_dest = GML_get_next_c
hid
(c);
+ ch->lid_dest = GML_get_next_c
cn
(c);
/* Store in client's hashmap */
GML_channel_add (c, ch->lid_dest, ch);
/* Store in client's hashmap */
GML_channel_add (c, ch->lid_dest, ch);
@@
-517,7
+517,7
@@
send_destroy (struct CadetChannel *ch, int local_only)
msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY);
msg.header.size = htons (sizeof (msg));
msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY);
msg.header.size = htons (sizeof (msg));
- msg.c
hid
= ch->gid;
+ msg.c
tn
= ch->gid;
/* If root is not NULL, notify.
* If it's NULL, check lid_root. When a local destroy comes in, root
/* If root is not NULL, notify.
* If it's NULL, check lid_root. When a local destroy comes in, root
@@
-573,7
+573,7
@@
send_client_create (struct CadetChannel *ch)
*/
static void
send_client_data (struct CadetChannel *ch,
*/
static void
send_client_data (struct CadetChannel *ch,
- const struct GNUNET_CADET_ChannelDataMessage *msg,
+ const struct GNUNET_CADET_Channel
App
DataMessage *msg,
int fwd)
{
if (fwd)
int fwd)
{
if (fwd)
@@
-631,7
+631,7
@@
send_client_buffered_data (struct CadetChannel *ch,
{
if (copy->mid == rel->mid_recv || GNUNET_NO == ch->reliable)
{
{
if (copy->mid == rel->mid_recv || GNUNET_NO == ch->reliable)
{
- struct GNUNET_CADET_Channel
DataMessage *msg = (struct GNUNET_CADET_Channel
DataMessage *) ©[1];
+ struct GNUNET_CADET_Channel
AppDataMessage *msg = (struct GNUNET_CADET_ChannelApp
DataMessage *) ©[1];
LOG (GNUNET_ERROR_TYPE_DEBUG, " have %u! now expecting %u\n",
copy->mid, rel->mid_recv + 1);
LOG (GNUNET_ERROR_TYPE_DEBUG, " have %u! now expecting %u\n",
copy->mid, rel->mid_recv + 1);
@@
-731,7
+731,7
@@
channel_retransmit_message (void *cls)
struct CadetChannelReliability *rel = cls;
struct CadetReliableMessage *copy;
struct CadetChannel *ch;
struct CadetChannelReliability *rel = cls;
struct CadetReliableMessage *copy;
struct CadetChannel *ch;
- struct GNUNET_CADET_ChannelDataMessage *payload;
+ struct GNUNET_CADET_Channel
App
DataMessage *payload;
int fwd;
rel->retry_task = NULL;
int fwd;
rel->retry_task = NULL;
@@
-743,7
+743,7
@@
channel_retransmit_message (void *cls)
return;
}
return;
}
- payload = (struct GNUNET_CADET_ChannelDataMessage *) ©[1];
+ payload = (struct GNUNET_CADET_Channel
App
DataMessage *) ©[1];
fwd = (rel == ch->root_rel);
/* Message not found in the queue that we are going to use. */
fwd = (rel == ch->root_rel);
/* Message not found in the queue that we are going to use. */
@@
-808,7
+808,7
@@
ch_message_sent (void *cls,
switch (chq->type)
{
switch (chq->type)
{
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA:
LOG (GNUNET_ERROR_TYPE_DEBUG, "data MID %u sent\n", copy->mid);
GNUNET_assert (chq == copy->chq);
copy->timestamp = GNUNET_TIME_absolute_get ();
LOG (GNUNET_ERROR_TYPE_DEBUG, "data MID %u sent\n", copy->mid);
GNUNET_assert (chq == copy->chq);
copy->timestamp = GNUNET_TIME_absolute_get ();
@@
-844,16
+844,16
@@
ch_message_sent (void *cls,
break;
break;
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK:
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
:
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_ACK:
LOG (GNUNET_ERROR_TYPE_DEBUG, "sent %s\n", GC_m2s (chq->type));
rel = chq->rel;
GNUNET_assert (rel->uniq == chq);
rel->uniq = NULL;
if (CADET_CHANNEL_READY != rel->ch->state
LOG (GNUNET_ERROR_TYPE_DEBUG, "sent %s\n", GC_m2s (chq->type));
rel = chq->rel;
GNUNET_assert (rel->uniq == chq);
rel->uniq = NULL;
if (CADET_CHANNEL_READY != rel->ch->state
- && GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK != type
+ && GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA_ACK != type
&& GNUNET_NO == rel->ch->destroy)
{
GNUNET_assert (NULL == rel->retry_task);
&& GNUNET_NO == rel->ch->destroy)
{
GNUNET_assert (NULL == rel->retry_task);
@@
-882,11
+882,11
@@
ch_message_sent (void *cls,
static void
send_create (struct CadetChannel *ch)
{
static void
send_create (struct CadetChannel *ch)
{
- struct GNUNET_CADET_Channel
Create
Message msgcc;
+ struct GNUNET_CADET_Channel
Open
Message msgcc;
msgcc.header.size = htons (sizeof (msgcc));
msgcc.header.size = htons (sizeof (msgcc));
- msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
);
- msgcc.c
hid
= ch->gid;
+ msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
);
+ msgcc.c
tn
= ch->gid;
msgcc.port = ch->port;
msgcc.opt = htonl (channel_get_options (ch));
msgcc.port = ch->port;
msgcc.opt = htonl (channel_get_options (ch));
@@
-906,12
+906,12
@@
send_ack (struct CadetChannel *ch, int fwd)
struct GNUNET_CADET_ChannelManageMessage msg;
msg.header.size = htons (sizeof (msg));
struct GNUNET_CADET_ChannelManageMessage msg;
msg.header.size = htons (sizeof (msg));
- msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_ACK);
+ msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_ACK);
LOG (GNUNET_ERROR_TYPE_DEBUG,
" sending channel %s ack for channel %s\n",
GC_f2s (fwd), GCCH_2s (ch));
LOG (GNUNET_ERROR_TYPE_DEBUG,
" sending channel %s ack for channel %s\n",
GC_f2s (fwd), GCCH_2s (ch));
- msg.c
hid
=ch->gid;
+ msg.c
tn
=ch->gid;
GCCH_send_prebuilt_message (&msg.header, ch, !fwd, NULL);
}
GCCH_send_prebuilt_message (&msg.header, ch, !fwd, NULL);
}
@@
-946,12
+946,12
@@
send_nack (struct CadetChannel *ch)
struct GNUNET_CADET_ChannelManageMessage msg;
msg.header.size = htons (sizeof (msg));
struct GNUNET_CADET_ChannelManageMessage msg;
msg.header.size = htons (sizeof (msg));
- msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_NACK_DEPRECATED);
+ msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_NACK_DEPRECATED);
LOG (GNUNET_ERROR_TYPE_DEBUG,
" sending channel NACK for channel %s\n",
GCCH_2s (ch));
LOG (GNUNET_ERROR_TYPE_DEBUG,
" sending channel NACK for channel %s\n",
GCCH_2s (ch));
- msg.c
hid
= ch->gid;
+ msg.c
tn
= ch->gid;
GCCH_send_prebuilt_message (&msg.header, ch, GNUNET_NO, NULL);
}
GCCH_send_prebuilt_message (&msg.header, ch, GNUNET_NO, NULL);
}
@@
-1270,7
+1270,7
@@
channel_new (struct CadetTunnel *t,
if (NULL != owner)
{
if (NULL != owner)
{
- ch->gid = GCT_get_next_c
hid
(t);
+ ch->gid = GCT_get_next_c
tn
(t);
GML_channel_add (owner, lid_root, ch);
}
GCT_add_channel (t, ch);
GML_channel_add (owner, lid_root, ch);
}
GCT_add_channel (t, ch);
@@
-1300,35
+1300,36
@@
handle_loopback (struct CadetChannel *ch,
switch (type)
{
switch (type)
{
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA:
/* Don't send hop ACK, wait for client to ACK */
LOG (GNUNET_ERROR_TYPE_DEBUG, "SEND loopback %u (%u)\n",
/* Don't send hop ACK, wait for client to ACK */
LOG (GNUNET_ERROR_TYPE_DEBUG, "SEND loopback %u (%u)\n",
- ntohl (((struct GNUNET_CADET_ChannelDataMessage *) msgh)->mid), ntohs (msgh->size));
- GCCH_handle_data (ch, (struct GNUNET_CADET_ChannelDataMessage *) msgh, fwd);
+ ntohl (((struct GNUNET_CADET_Channel
App
DataMessage *) msgh)->mid), ntohs (msgh->size));
+ GCCH_handle_data (ch, (struct GNUNET_CADET_Channel
App
DataMessage *) msgh, fwd);
break;
break;
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK:
- GCCH_handle_data_ack (ch, (struct GNUNET_CADET_ChannelDataAckMessage *) msgh, fwd);
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK:
+ GCCH_handle_data_ack (ch,
+ (const struct GNUNET_CADET_ChannelDataAckMessage *) msgh, fwd);
break;
break;
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
:
GCCH_handle_create (ch->t,
GCCH_handle_create (ch->t,
- (
struct GNUNET_CADET_ChannelCreate
Message *) msgh);
+ (
const struct GNUNET_CADET_ChannelOpen
Message *) msgh);
break;
break;
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_ACK:
GCCH_handle_ack (ch,
GCCH_handle_ack (ch,
- (struct GNUNET_CADET_ChannelManageMessage *) msgh,
+ (
const
struct GNUNET_CADET_ChannelManageMessage *) msgh,
fwd);
break;
fwd);
break;
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_NACK_DEPRECATED:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_NACK_DEPRECATED:
GCCH_handle_nack (ch);
break;
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
GCCH_handle_destroy (ch,
GCCH_handle_nack (ch);
break;
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
GCCH_handle_destroy (ch,
- (struct GNUNET_CADET_ChannelManageMessage *) msgh,
+ (
const
struct GNUNET_CADET_ChannelManageMessage *) msgh,
fwd);
break;
fwd);
break;
@@
-1398,7
+1399,7
@@
GCCH_destroy (struct CadetChannel *ch)
*
* @return ID used to identify the channel with the remote peer.
*/
*
* @return ID used to identify the channel with the remote peer.
*/
-struct GNUNET_CADET_ChannelNumber
+struct GNUNET_CADET_Channel
Tunnel
Number
GCCH_get_id (const struct CadetChannel *ch)
{
return ch->gid;
GCCH_get_id (const struct CadetChannel *ch)
{
return ch->gid;
@@
-1536,15
+1537,15
@@
GCCH_send_data_ack (struct CadetChannel *ch, int fwd)
rel = fwd ? ch->dest_rel : ch->root_rel;
ack = rel->mid_recv - 1;
rel = fwd ? ch->dest_rel : ch->root_rel;
ack = rel->mid_recv - 1;
- msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK);
+ msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA_ACK);
msg.header.size = htons (sizeof (msg));
msg.header.size = htons (sizeof (msg));
- msg.c
hid
= ch->gid;
+ msg.c
tn
= ch->gid;
msg.mid = htonl (ack);
msg.futures = 0LL;
for (copy = rel->head_recv; NULL != copy; copy = copy->next)
{
msg.mid = htonl (ack);
msg.futures = 0LL;
for (copy = rel->head_recv; NULL != copy; copy = copy->next)
{
- if (copy->type != GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA)
+ if (copy->type != GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " Type %s, expected DATA\n",
GC_m2s (copy->type));
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " Type %s, expected DATA\n",
GC_m2s (copy->type));
@@
-1748,8
+1749,8
@@
GCCH_handle_local_data (struct CadetChannel *ch,
size_t size)
{
struct CadetChannelReliability *rel;
size_t size)
{
struct CadetChannelReliability *rel;
- struct GNUNET_CADET_ChannelDataMessage *payload;
- uint16_t p2p_size = sizeof(struct GNUNET_CADET_ChannelDataMessage) + size;
+ struct GNUNET_CADET_Channel
App
DataMessage *payload;
+ uint16_t p2p_size = sizeof(struct GNUNET_CADET_Channel
App
DataMessage) + size;
unsigned char cbuf[p2p_size];
unsigned char buffer;
unsigned char cbuf[p2p_size];
unsigned char buffer;
@@
-1775,13
+1776,13
@@
GCCH_handle_local_data (struct CadetChannel *ch,
rel->client_allowed = GNUNET_NO;
/* Ok, everything is correct, send the message. */
rel->client_allowed = GNUNET_NO;
/* Ok, everything is correct, send the message. */
- payload = (struct GNUNET_CADET_ChannelDataMessage *) cbuf;
+ payload = (struct GNUNET_CADET_Channel
App
DataMessage *) cbuf;
payload->mid = htonl (rel->mid_send);
rel->mid_send++;
GNUNET_memcpy (&payload[1], message, size);
payload->header.size = htons (p2p_size);
payload->mid = htonl (rel->mid_send);
rel->mid_send++;
GNUNET_memcpy (&payload[1], message, size);
payload->header.size = htons (p2p_size);
- payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA);
- payload->c
hid
= ch->gid;
+ payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA);
+ payload->c
tn
= ch->gid;
LOG (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n");
GCCH_send_prebuilt_message (&payload->header, ch, fwd, NULL);
LOG (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n");
GCCH_send_prebuilt_message (&payload->header, ch, fwd, NULL);
@@
-1842,23
+1843,23
@@
GCCH_handle_local_destroy (struct CadetChannel *ch,
* @param c Client that requested the creation (will be the root).
* @param msg Create Channel message.
*
* @param c Client that requested the creation (will be the root).
* @param msg Create Channel message.
*
- * @return
GNUNET_OK if everything went fine,
GNUNET_SYSERR otherwise.
+ * @return
#GNUNET_OK if everything went fine, #
GNUNET_SYSERR otherwise.
*/
int
GCCH_handle_local_create (struct CadetClient *c,
*/
int
GCCH_handle_local_create (struct CadetClient *c,
- struct GNUNET_CADET_
ChannelCreateMessag
eMessage *msg)
+ struct GNUNET_CADET_
LocalChannelCreat
eMessage *msg)
{
struct CadetChannel *ch;
struct CadetTunnel *t;
struct CadetPeer *peer;
{
struct CadetChannel *ch;
struct CadetTunnel *t;
struct CadetPeer *peer;
- struct GNUNET_CADET_ClientChannelNumber c
hid
;
+ struct GNUNET_CADET_ClientChannelNumber c
cn
;
LOG (GNUNET_ERROR_TYPE_DEBUG, " towards %s:%u\n",
GNUNET_i2s (&msg->peer), GNUNET_h2s (&msg->port));
LOG (GNUNET_ERROR_TYPE_DEBUG, " towards %s:%u\n",
GNUNET_i2s (&msg->peer), GNUNET_h2s (&msg->port));
- c
hid = msg->channel_id
;
+ c
cn = msg->ccn
;
/* Sanity check for duplicate channel IDs */
/* Sanity check for duplicate channel IDs */
- if (NULL != GML_channel_get (c, c
hid
))
+ if (NULL != GML_channel_get (c, c
cn
))
{
GNUNET_break (0);
return GNUNET_SYSERR;
{
GNUNET_break (0);
return GNUNET_SYSERR;
@@
-1879,7
+1880,7
@@
GCCH_handle_local_create (struct CadetClient *c,
}
/* Create channel */
}
/* Create channel */
- ch = channel_new (t, c, c
hid
);
+ ch = channel_new (t, c, c
cn
);
if (NULL == ch)
{
GNUNET_break (0);
if (NULL == ch)
{
GNUNET_break (0);
@@
-1914,7
+1915,7
@@
GCCH_handle_local_create (struct CadetClient *c,
*/
void
GCCH_handle_data (struct CadetChannel *ch,
*/
void
GCCH_handle_data (struct CadetChannel *ch,
- const struct GNUNET_CADET_ChannelDataMessage *msg,
+ const struct GNUNET_CADET_Channel
App
DataMessage *msg,
int fwd)
{
struct CadetChannelReliability *rel;
int fwd)
{
struct CadetChannelReliability *rel;
@@
-1972,7
+1973,7
@@
GCCH_handle_data (struct CadetChannel *ch,
mid = ntohl (msg->mid);
LOG (GNUNET_ERROR_TYPE_INFO, "<== %s (%s %4u) on chan %s (%p) %s [%5u]\n",
mid = ntohl (msg->mid);
LOG (GNUNET_ERROR_TYPE_INFO, "<== %s (%s %4u) on chan %s (%p) %s [%5u]\n",
- GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA), GC_m2s (payload_type), mid,
+ GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA), GC_m2s (payload_type), mid,
GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
if ( (GNUNET_NO == ch->reliable) ||
GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
if ( (GNUNET_NO == ch->reliable) ||
@@
-2069,7
+2070,7
@@
GCCH_handle_data_ack (struct CadetChannel *ch,
ack = ntohl (msg->mid);
LOG (GNUNET_ERROR_TYPE_INFO,
"<== %s (0x%010lX %4u) on chan %s (%p) %s [%5u]\n",
ack = ntohl (msg->mid);
LOG (GNUNET_ERROR_TYPE_INFO,
"<== %s (0x%010lX %4u) on chan %s (%p) %s [%5u]\n",
- GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK), msg->futures, ack,
+ GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA_ACK), msg->futures, ack,
GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
if (GNUNET_YES == fwd)
GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
if (GNUNET_YES == fwd)
@@
-2151,22
+2152,22
@@
GCCH_handle_data_ack (struct CadetChannel *ch,
*/
struct CadetChannel *
GCCH_handle_create (struct CadetTunnel *t,
*/
struct CadetChannel *
GCCH_handle_create (struct CadetTunnel *t,
- const struct GNUNET_CADET_Channel
Create
Message *msg)
+ const struct GNUNET_CADET_Channel
Open
Message *msg)
{
{
- struct GNUNET_CADET_ClientChannelNumber c
hid
;
- struct GNUNET_CADET_ChannelNumber gid;
+ struct GNUNET_CADET_ClientChannelNumber c
cn
;
+ struct GNUNET_CADET_Channel
Tunnel
Number gid;
struct CadetChannel *ch;
struct CadetClient *c;
int new_channel;
const struct GNUNET_HashCode *port;
struct CadetChannel *ch;
struct CadetClient *c;
int new_channel;
const struct GNUNET_HashCode *port;
- gid = msg->c
hid
;
+ gid = msg->c
tn
;
ch = GCT_get_channel (t, gid);
if (NULL == ch)
{
/* Create channel */
ch = GCT_get_channel (t, gid);
if (NULL == ch)
{
/* Create channel */
- c
hid
.channel_of_client = htonl (0);
- ch = channel_new (t, NULL, c
hid
);
+ c
cn
.channel_of_client = htonl (0);
+ ch = channel_new (t, NULL, c
cn
);
ch->gid = gid;
channel_set_options (ch, ntohl (msg->opt));
new_channel = GNUNET_YES;
ch->gid = gid;
channel_set_options (ch, ntohl (msg->opt));
new_channel = GNUNET_YES;
@@
-2179,7
+2180,7
@@
GCCH_handle_create (struct CadetTunnel *t,
LOG (GNUNET_ERROR_TYPE_INFO,
"<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n",
LOG (GNUNET_ERROR_TYPE_INFO,
"<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n",
- GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE), chid
, port,
+ GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN), ccn
, port,
GCCH_2s (ch), ch, GC_f2s (GNUNET_YES), ntohs (msg->header.size));
if (GNUNET_YES == new_channel || GCT_is_loopback (t))
GCCH_2s (ch), ch, GC_f2s (GNUNET_YES), ntohs (msg->header.size));
if (GNUNET_YES == new_channel || GCT_is_loopback (t))
@@
-2252,7
+2253,7
@@
GCCH_handle_nack (struct CadetChannel *ch)
{
LOG (GNUNET_ERROR_TYPE_INFO,
"<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n",
{
LOG (GNUNET_ERROR_TYPE_INFO,
"<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n",
- GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_NACK_DEPRECATED), ch->gid, 0,
+ GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_NACK_DEPRECATED), ch->gid, 0,
GCCH_2s (ch), ch, "---", 0);
send_client_nack (ch);
GCCH_2s (ch), ch, "---", 0);
send_client_nack (ch);
@@
-2277,7
+2278,7
@@
GCCH_handle_ack (struct CadetChannel *ch,
{
LOG (GNUNET_ERROR_TYPE_INFO,
"<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n",
{
LOG (GNUNET_ERROR_TYPE_INFO,
"<== %s ( 0x%08X %4u) on chan %s (%p) %s [%5u]\n",
- GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_ACK), ch->gid, 0,
+ GC_m2s (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_ACK), ch->gid, 0,
GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
/* If this is a remote (non-loopback) channel, find 'fwd'. */
GCCH_2s (ch), ch, GC_f2s (fwd), ntohs (msg->header.size));
/* If this is a remote (non-loopback) channel, find 'fwd'. */
@@
-2383,13
+2384,13
@@
GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
data_id = 0;
switch (type)
{
data_id = 0;
switch (type)
{
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA:
{
{
- struct GNUNET_CADET_ChannelDataMessage *data_msg;
+ struct GNUNET_CADET_Channel
App
DataMessage *data_msg;
struct GNUNET_MessageHeader *payload_msg;
uint16_t payload_type;
struct GNUNET_MessageHeader *payload_msg;
uint16_t payload_type;
- data_msg = (struct GNUNET_CADET_ChannelDataMessage *) message;
+ data_msg = (struct GNUNET_CADET_Channel
App
DataMessage *) message;
data_id = ntohl (data_msg->mid);
payload_msg = (struct GNUNET_MessageHeader *) &data_msg[1];
payload_type = ntohs (payload_msg->type);
data_id = ntohl (data_msg->mid);
payload_msg = (struct GNUNET_MessageHeader *) &data_msg[1];
payload_type = ntohs (payload_msg->type);
@@
-2397,7
+2398,7
@@
GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
info[31] = '\0';
break;
}
info[31] = '\0';
break;
}
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA_ACK:
{
struct GNUNET_CADET_ChannelDataAckMessage *ack_msg;
ack_msg = (struct GNUNET_CADET_ChannelDataAckMessage *) message;
{
struct GNUNET_CADET_ChannelDataAckMessage *ack_msg;
ack_msg = (struct GNUNET_CADET_ChannelDataAckMessage *) message;
@@
-2406,20
+2407,20
@@
GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
(unsigned long int) ack_msg->futures);
break;
}
(unsigned long int) ack_msg->futures);
break;
}
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
:
{
{
- struct GNUNET_CADET_Channel
Create
Message *cc_msg;
- cc_msg = (struct GNUNET_CADET_Channel
Create
Message *) message;
- SPRINTF (info, " 0x%08X", ntohl (cc_msg->c
hid
.cn));
+ struct GNUNET_CADET_Channel
Open
Message *cc_msg;
+ cc_msg = (struct GNUNET_CADET_Channel
Open
Message *) message;
+ SPRINTF (info, " 0x%08X", ntohl (cc_msg->c
tn
.cn));
break;
}
break;
}
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_ACK:
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_NACK_DEPRECATED:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_NACK_DEPRECATED:
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
{
struct GNUNET_CADET_ChannelManageMessage *m_msg;
m_msg = (struct GNUNET_CADET_ChannelManageMessage *) message;
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
{
struct GNUNET_CADET_ChannelManageMessage *m_msg;
m_msg = (struct GNUNET_CADET_ChannelManageMessage *) message;
- SPRINTF (info, " 0x%08X", ntohl (m_msg->c
hid
.cn));
+ SPRINTF (info, " 0x%08X", ntohl (m_msg->c
tn
.cn));
break;
}
default:
break;
}
default:
@@
-2438,7
+2439,7
@@
GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
switch (type)
{
switch (type)
{
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA:
if (GNUNET_YES == ch->reliable)
{
chq = GNUNET_new (struct CadetChannelQueue);
if (GNUNET_YES == ch->reliable)
{
chq = GNUNET_new (struct CadetChannelQueue);
@@
-2484,9
+2485,9
@@
GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
break;
break;
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK:
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
:
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
APP_
DATA_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_ACK:
chq = GNUNET_new (struct CadetChannelQueue);
chq->type = type;
chq->rel = fwd ? ch->root_rel : ch->dest_rel;
chq = GNUNET_new (struct CadetChannelQueue);
chq->type = type;
chq->rel = fwd ? ch->root_rel : ch->dest_rel;
@@
-2521,7
+2522,7
@@
GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
- case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
CREATE
_NACK_DEPRECATED:
+ case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_
OPEN
_NACK_DEPRECATED:
fire_and_forget (message, ch, GNUNET_YES);
break;
fire_and_forget (message, ch, GNUNET_YES);
break;