/**
* Tunnel Queue.
*/
- struct CadetTunnel3Queue *tq;
+ struct CadetTunnelQueue *tq;
/**
* Message type (DATA/DATA_ACK)
/**
* Tunnel this channel is in.
*/
- struct CadetTunnel3 *t;
+ struct CadetTunnel *t;
/**
* Destination port of the channel.
is_loopback (const struct CadetChannel *ch)
{
if (NULL != ch->t)
- return GMT_is_loopback (ch->t);
+ return GCT_is_loopback (ch->t);
return (NULL != ch->root && NULL != ch->dest);
}
LOG (GNUNET_ERROR_TYPE_DEBUG, " already there!\n");
return;
}
- else if (GM_is_pid_bigger (prev->mid, mid))
+ else if (GC_is_pid_bigger (prev->mid, mid))
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " bingo!\n");
copy = copy_message (msg, mid, rel);
if (NULL != ch->root)
GML_send_channel_destroy (ch->root, ch->lid_root);
else if (0 == ch->lid_root && GNUNET_NO == local_only)
- GMCH_send_prebuilt_message (&msg.header, ch, GNUNET_NO, NULL);
+ GCCH_send_prebuilt_message (&msg.header, ch, GNUNET_NO, NULL);
if (NULL != ch->dest)
GML_send_channel_destroy (ch->dest, ch->lid_dest);
else if (0 == ch->lid_dest && GNUNET_NO == local_only)
- GMCH_send_prebuilt_message (&msg.header, ch, GNUNET_YES, NULL);
+ GCCH_send_prebuilt_message (&msg.header, ch, GNUNET_YES, NULL);
}
opt |= GNUNET_YES == ch->reliable ? GNUNET_CADET_OPTION_RELIABLE : 0;
opt |= GNUNET_YES == ch->nobuffer ? GNUNET_CADET_OPTION_NOBUFFER : 0;
GML_send_channel_create (ch->dest, ch->lid_dest, ch->port, opt,
- GMT_get_destination (ch->t));
+ GCT_get_destination (ch->t));
}
* deliver missing messages
*/
send_destroy (ch, GNUNET_YES);
- GMCH_destroy (ch);
+ GCCH_destroy (ch);
}
}
}
}
LOG (GNUNET_ERROR_TYPE_DEBUG,
" sending %s ack to client on channel %s\n",
- GM_f2s (fwd), GMCH_2s (ch));
+ GC_f2s (fwd), GCCH_2s (ch));
if (NULL == rel)
{
/* Message not found in the queue that we are going to use. */
LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! RETRANSMIT %u\n", copy->mid);
- GMCH_send_prebuilt_message (&payload->header, ch, fwd, copy);
+ GCCH_send_prebuilt_message (&payload->header, ch, fwd, copy);
GNUNET_STATISTICS_update (stats, "# data retransmitted", 1, GNUNET_NO);
}
*/
static void
ch_message_sent (void *cls,
- struct CadetTunnel3 *t,
- struct CadetTunnel3Queue *q,
+ struct CadetTunnel *t,
+ struct CadetTunnelQueue *q,
uint16_t type, size_t size)
{
struct CadetChannelQueue *chq = cls;
struct CadetChannelReliability *rel;
LOG (GNUNET_ERROR_TYPE_DEBUG, "channel message sent callback %s\n",
- GM_m2s (chq->type));
+ GC_m2s (chq->type));
switch (chq->type)
{
case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK:
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE:
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK:
- LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! SENT %s\n", GM_m2s (chq->type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! SENT %s\n", GC_m2s (chq->type));
rel = chq->rel;
GNUNET_assert (rel->uniq == chq);
rel->uniq = NULL;
msgcc.port = htonl (ch->port);
msgcc.opt = htonl (channel_get_options (ch));
- GMCH_send_prebuilt_message (&msgcc.header, ch, GNUNET_YES, NULL);
+ GCCH_send_prebuilt_message (&msgcc.header, ch, GNUNET_YES, NULL);
}
msg.header.size = htons (sizeof (msg));
msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK);
LOG (GNUNET_ERROR_TYPE_DEBUG, " sending channel %s ack for channel %s\n",
- GM_f2s (fwd), GMCH_2s (ch));
+ GC_f2s (fwd), GCCH_2s (ch));
msg.chid = htonl (ch->gid);
- GMCH_send_prebuilt_message (&msg.header, ch, !fwd, reaction ? &msg : NULL);
+ GCCH_send_prebuilt_message (&msg.header, ch, !fwd, reaction ? &msg : NULL);
}
struct CadetChannel *ch,
int force)
{
- GNUNET_break (NULL == GMT_send_prebuilt_message (msg, ch->t, NULL,
+ GNUNET_break (NULL == GCT_send_prebuilt_message (msg, ch->t, NULL,
force, NULL, NULL));
}
msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK);
LOG (GNUNET_ERROR_TYPE_DEBUG,
" sending channel NACK for channel %s\n",
- GMCH_2s (ch));
+ GCCH_2s (ch));
msg.chid = htonl (ch->gid);
- GMCH_send_prebuilt_message (&msg.header, ch, GNUNET_NO, NULL);
+ GCCH_send_prebuilt_message (&msg.header, ch, GNUNET_NO, NULL);
}
{
if (NULL != copy->chq->tq)
{
- GMT_cancel (copy->chq->tq);
+ GCT_cancel (copy->chq->tq);
/* ch_message_sent will free copy->q */
}
else
}
if (NULL != rel->uniq && NULL != rel->uniq->tq)
{
- GMT_cancel (rel->uniq->tq);
+ GCT_cancel (rel->uniq->tq);
/* ch_message_sent is called freeing uniq */
}
if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
/* Skip copies with mid < target */
target = mid + i + 1;
LOG (GNUNET_ERROR_TYPE_DEBUG, " target %u\n", target);
- while (NULL != copy && GM_is_pid_bigger (target, copy->mid))
+ while (NULL != copy && GC_is_pid_bigger (target, copy->mid))
copy = copy->next;
/* Did we run out of copies? (previously freed, it's ok) */
}
/* Did we overshoot the target? (previously freed, it's ok) */
- if (GM_is_pid_bigger (copy->mid, target))
+ if (GC_is_pid_bigger (copy->mid, target))
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " next copy %u\n", copy->mid);
continue;
rel->ch->pending_messages--;
if (NULL != copy->chq)
{
- GMT_cancel (copy->chq->tq);
+ GCT_cancel (copy->chq->tq);
/* copy->q is set to NULL by ch_message_sent */
}
GNUNET_CONTAINER_DLL_remove (rel->head_sent, rel->tail_sent, copy);
if (GNUNET_NO != rel->ch->destroy && 0 == rel->ch->pending_messages)
{
- GMCH_destroy (rel->ch);
+ GCCH_destroy (rel->ch);
return GNUNET_YES;
}
return GNUNET_NO;
return;
}
LOG (GNUNET_ERROR_TYPE_DEBUG, " channel confirm %s %s\n",
- GM_f2s (fwd), GMCH_2s (ch));
+ GC_f2s (fwd), GCCH_2s (ch));
oldstate = ch->state;
ch->state = CADET_CHANNEL_READY;
rel->expected_delay = rel->retry_timer;
LOG (GNUNET_ERROR_TYPE_DEBUG, " !! retry timer confirm %s\n",
GNUNET_STRINGS_relative_time_to_string (rel->retry_timer, GNUNET_NO));
- if (GMT_get_connections_buffer (ch->t) > 0 || GMT_is_loopback (ch->t))
+ if (GCT_get_connections_buffer (ch->t) > 0 || GCT_is_loopback (ch->t))
send_client_ack (ch, fwd);
if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
}
else if (NULL != rel->uniq)
{
- GMT_cancel (rel->uniq->tq);
+ GCT_cancel (rel->uniq->tq);
/* ch_message_sent will free and NULL uniq */
}
else
type = ntohs (msg->type);
size = ntohs (msg->size);
- LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! SAVE %u %s\n", mid, GM_m2s (type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! SAVE %u %s\n", mid, GC_m2s (type));
copy = GNUNET_malloc (sizeof (struct CadetReliableMessage) + size);
LOG (GNUNET_ERROR_TYPE_DEBUG, " at %p\n", copy);
copy->mid = mid;
* @return A new initialized channel. NULL on error.
*/
static struct CadetChannel *
-channel_new (struct CadetTunnel3 *t,
+channel_new (struct CadetTunnel *t,
struct CadetClient *owner,
CADET_ChannelNumber lid_root)
{
if (NULL != owner)
{
- ch->gid = GMT_get_next_chid (t);
+ ch->gid = GCT_get_next_chid (t);
GML_channel_add (owner, lid_root, ch);
}
- GMT_add_channel (t, ch);
+ GCT_add_channel (t, ch);
return ch;
}
type = ntohs (msgh->type);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Loopback %s %s message!\n",
- GM_f2s (fwd), GM_m2s (type));
+ GC_f2s (fwd), GC_m2s (type));
switch (type)
{
/* Don't send hop ACK, wait for client to ACK */
LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! SEND loopback %u (%u)\n",
ntohl (((struct GNUNET_CADET_Data *) msgh)->mid), ntohs (msgh->size));
- GMCH_handle_data (ch, (struct GNUNET_CADET_Data *) msgh, fwd);
+ GCCH_handle_data (ch, (struct GNUNET_CADET_Data *) msgh, fwd);
break;
case GNUNET_MESSAGE_TYPE_CADET_DATA_ACK:
- GMCH_handle_data_ack (ch, (struct GNUNET_CADET_DataACK *) msgh, fwd);
+ GCCH_handle_data_ack (ch, (struct GNUNET_CADET_DataACK *) msgh, fwd);
break;
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE:
- GMCH_handle_create (ch->t,
+ GCCH_handle_create (ch->t,
(struct GNUNET_CADET_ChannelCreate *) msgh);
break;
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_ACK:
- GMCH_handle_ack (ch,
+ GCCH_handle_ack (ch,
(struct GNUNET_CADET_ChannelManage *) msgh,
fwd);
break;
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK:
- GMCH_handle_nack (ch);
+ GCCH_handle_nack (ch);
break;
case GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY:
- GMCH_handle_destroy (ch,
+ GCCH_handle_destroy (ch,
(struct GNUNET_CADET_ChannelManage *) msgh,
fwd);
break;
* @param ch Channel to destroy.
*/
void
-GMCH_destroy (struct CadetChannel *ch)
+GCCH_destroy (struct CadetChannel *ch)
{
struct CadetClient *c;
- struct CadetTunnel3 *t;
+ struct CadetTunnel *t;
if (NULL == ch)
return;
ch->destroy = 2;
LOG (GNUNET_ERROR_TYPE_DEBUG, "destroying channel %s:%u\n",
- GMT_2s (ch->t), ch->gid);
- GMCH_debug (ch);
+ GCT_2s (ch->t), ch->gid);
+ GCCH_debug (ch);
c = ch->root;
if (NULL != c)
channel_rel_free_all (ch->dest_rel);
t = ch->t;
- GMT_remove_channel (t, ch);
+ GCT_remove_channel (t, ch);
GNUNET_STATISTICS_update (stats, "# channels", -1, GNUNET_NO);
GNUNET_free (ch);
- GMT_destroy_if_empty (t);
+ GCT_destroy_if_empty (t);
}
* @return ID used to identify the channel with the remote peer.
*/
CADET_ChannelNumber
-GMCH_get_id (const struct CadetChannel *ch)
+GCCH_get_id (const struct CadetChannel *ch)
{
return ch->gid;
}
*
* @return tunnel of the channel.
*/
-struct CadetTunnel3 *
-GMCH_get_tunnel (const struct CadetChannel *ch)
+struct CadetTunnel *
+GCCH_get_tunnel (const struct CadetChannel *ch)
{
return ch->t;
}
* @return Free buffer space [0 - 64]
*/
unsigned int
-GMCH_get_buffer (struct CadetChannel *ch, int fwd)
+GCCH_get_buffer (struct CadetChannel *ch, int fwd)
{
struct CadetChannelReliability *rel;
* @return #GNUNET_YES if client is allowed to send us data.
*/
int
-GMCH_get_allowed (struct CadetChannel *ch, int fwd)
+GCCH_get_allowed (struct CadetChannel *ch, int fwd)
{
struct CadetChannelReliability *rel;
* @return #GNUNET_YES in case it is.
*/
int
-GMCH_is_origin (struct CadetChannel *ch, int fwd)
+GCCH_is_origin (struct CadetChannel *ch, int fwd)
{
struct CadetClient *c;
* @return #GNUNET_YES in case it is.
*/
int
-GMCH_is_terminal (struct CadetChannel *ch, int fwd)
+GCCH_is_terminal (struct CadetChannel *ch, int fwd)
{
struct CadetClient *c;
* @param fwd Is for FWD traffic? (ACK dest->owner)
*/
void
-GMCH_send_data_ack (struct CadetChannel *ch, int fwd)
+GCCH_send_data_ack (struct CadetChannel *ch, int fwd)
{
struct GNUNET_CADET_DataACK msg;
struct CadetChannelReliability *rel;
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"!! Type %s, expected DATA\n",
- GM_m2s (copy->type));
+ GC_m2s (copy->type));
continue;
}
if (copy->mid == ack + 1)
"!!! ACK for %u, futures %llX\n",
ack, msg.futures);
- GMCH_send_prebuilt_message (&msg.header, ch, !fwd, NULL);
+ GCCH_send_prebuilt_message (&msg.header, ch, !fwd, NULL);
LOG (GNUNET_ERROR_TYPE_DEBUG, "send_data_ack END\n");
}
* @param fwd Is this about FWD traffic? (Root client).
*/
void
-GMCH_allow_client (struct CadetChannel *ch, int fwd)
+GCCH_allow_client (struct CadetChannel *ch, int fwd)
{
struct CadetChannelReliability *rel;
unsigned int buffer;
}
if (is_loopback (ch))
- buffer = GMCH_get_buffer (ch, fwd);
+ buffer = GCCH_get_buffer (ch, fwd);
else
- buffer = GMT_get_connections_buffer (ch->t);
+ buffer = GCT_get_connections_buffer (ch->t);
if (0 == buffer)
{
* @param ch Channel.
*/
void
-GMCH_debug (struct CadetChannel *ch)
+GCCH_debug (struct CadetChannel *ch)
{
if (NULL == ch)
{
return;
}
LOG (GNUNET_ERROR_TYPE_DEBUG, "Channel %s:%X (%p)\n",
- GMT_2s (ch->t), ch->gid, ch);
+ GCT_2s (ch->t), ch->gid, ch);
LOG (GNUNET_ERROR_TYPE_DEBUG, " root %p/%p\n",
ch->root, ch->root_rel);
if (NULL != ch->root)
* @param fwd Is this a "FWD ACK"? (FWD ACKs are sent by dest and go BCK)
*/
void
-GMCH_handle_local_ack (struct CadetChannel *ch, int fwd)
+GCCH_handle_local_ack (struct CadetChannel *ch, int fwd)
{
struct CadetChannelReliability *rel;
struct CadetClient *c;
if (GNUNET_YES == ch->destroy && 0 == rel->n_recv)
{
send_destroy (ch, GNUNET_YES);
- GMCH_destroy (ch);
+ GCCH_destroy (ch);
}
/* if loopback is marked for destruction, no need to ACK to the other peer,
* it requested the destruction and is already gone, therefore, else if.
{
unsigned int buffer;
- buffer = GMCH_get_buffer (ch, fwd);
+ buffer = GCCH_get_buffer (ch, fwd);
if (0 < buffer)
- GMCH_allow_client (ch, fwd);
+ GCCH_allow_client (ch, fwd);
return;
}
- GMT_send_connection_acks (ch->t);
+ GCT_send_connection_acks (ch->t);
}
* @return GNUNET_OK if everything goes well, GNUNET_SYSERR in case of en error.
*/
int
-GMCH_handle_local_data (struct CadetChannel *ch,
+GCCH_handle_local_data (struct CadetChannel *ch,
struct CadetClient *c,
struct GNUNET_MessageHeader *message,
int fwd)
payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_DATA);
payload->chid = htonl (ch->gid);
LOG (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n");
- GMCH_send_prebuilt_message (&payload->header, ch, fwd, NULL);
+ GCCH_send_prebuilt_message (&payload->header, ch, fwd, NULL);
if (is_loopback (ch))
{
- if (GMCH_get_buffer (ch, fwd) > 0)
- GMCH_allow_client (ch, fwd);
+ if (GCCH_get_buffer (ch, fwd) > 0)
+ GCCH_allow_client (ch, fwd);
return GNUNET_OK;
}
- if (GMT_get_connections_buffer (ch->t) > 0)
+ if (GCT_get_connections_buffer (ch->t) > 0)
{
- GMCH_allow_client (ch, fwd);
+ GCCH_allow_client (ch, fwd);
}
return GNUNET_OK;
* @param is_root Is the request coming from root?
*/
void
-GMCH_handle_local_destroy (struct CadetChannel *ch,
+GCCH_handle_local_destroy (struct CadetChannel *ch,
struct CadetClient *c,
int is_root)
{
send_destroy (ch, GNUNET_NO);
if (0 == ch->pending_messages)
- GMCH_destroy (ch);
+ GCCH_destroy (ch);
}
* @return GNUNET_OK if everything went fine, GNUNET_SYSERR otherwise.
*/
int
-GMCH_handle_local_create (struct CadetClient *c,
+GCCH_handle_local_create (struct CadetClient *c,
struct GNUNET_CADET_ChannelMessage *msg)
{
struct CadetChannel *ch;
- struct CadetTunnel3 *t;
+ struct CadetTunnel *t;
struct CadetPeer *peer;
CADET_ChannelNumber chid;
return GNUNET_SYSERR;
}
- peer = GMP_get (&msg->peer);
- GMP_add_tunnel (peer);
- t = GMP_get_tunnel (peer);
+ peer = GCP_get (&msg->peer);
+ GCP_add_tunnel (peer);
+ t = GCP_get_tunnel (peer);
- if (GMP_get_short_id (peer) == myid)
+ if (GCP_get_short_id (peer) == myid)
{
- GMT_change_cstate (t, CADET_TUNNEL3_READY);
+ GCT_change_cstate (t, CADET_TUNNEL3_READY);
}
else
{
/* FIXME change to a tunnel API, eliminate ch <-> peer connection */
- GMP_connect (peer);
+ GCP_connect (peer);
}
/* Create channel */
ch->root_rel->retry_timer = CADET_RETRANSMIT_TIME;
ch->root_rel->expected_delay.rel_value_us = 0;
- LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s\n", GMCH_2s (ch));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s\n", GCCH_2s (ch));
send_create (ch);
* #GNUNET_SYSERR if message on a one-ended channel (remote)
*/
void
-GMCH_handle_data (struct CadetChannel *ch,
+GCCH_handle_data (struct CadetChannel *ch,
const struct GNUNET_CADET_Data *msg,
int fwd)
{
mid = ntohl (msg->mid);
LOG (GNUNET_ERROR_TYPE_INFO, "<=== DATA %u %s on channel %s\n",
- mid, GM_f2s (fwd), GMCH_2s (ch));
+ mid, GC_f2s (fwd), GCCH_2s (ch));
if (GNUNET_NO == ch->reliable ||
- ( !GM_is_pid_bigger (rel->mid_recv, mid) &&
- GM_is_pid_bigger (rel->mid_recv + 64, mid) ) )
+ ( !GC_is_pid_bigger (rel->mid_recv, mid) &&
+ GC_is_pid_bigger (rel->mid_recv + 64, mid) ) )
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "RECV %u (%u)\n",
mid, ntohs (msg->header.size));
}
else
{
- GNUNET_break_op (GM_is_pid_bigger (rel->mid_recv, mid));
+ GNUNET_break_op (GC_is_pid_bigger (rel->mid_recv, mid));
LOG (GNUNET_ERROR_TYPE_WARNING,
"MID %u not expected (%u - %u), dropping!\n",
mid, rel->mid_recv, rel->mid_recv + 63);
}
- GMCH_send_data_ack (ch, fwd);
+ GCCH_send_data_ack (ch, fwd);
}
* #GNUNET_SYSERR if message on a one-ended channel (remote)
*/
void
-GMCH_handle_data_ack (struct CadetChannel *ch,
+GCCH_handle_data_ack (struct CadetChannel *ch,
const struct GNUNET_CADET_DataACK *msg,
int fwd)
{
}
ack = ntohl (msg->mid);
- LOG (GNUNET_ERROR_TYPE_INFO, "<=== %s ACK %u\n", GM_f2s (fwd), ack);
+ LOG (GNUNET_ERROR_TYPE_INFO, "<=== %s ACK %u\n", GC_f2s (fwd), ack);
if (GNUNET_YES == fwd)
{
/* Free ACK'd copies: no need to retransmit those anymore FIXME refactor */
for (work = GNUNET_NO, copy = rel->head_sent; copy != NULL; copy = next)
{
- if (GM_is_pid_bigger (copy->mid, ack))
+ if (GC_is_pid_bigger (copy->mid, ack))
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " head %u, out!\n", copy->mid);
channel_rel_free_sent (rel, msg);
}
/* ACK client if needed and possible */
- GMCH_allow_client (ch, fwd);
+ GCCH_allow_client (ch, fwd);
/* If some message was free'd, update the retransmission delay */
if (GNUNET_YES == work)
* @param msg Channel crate message.
*/
struct CadetChannel *
-GMCH_handle_create (struct CadetTunnel3 *t,
+GCCH_handle_create (struct CadetTunnel *t,
const struct GNUNET_CADET_ChannelCreate *msg)
{
CADET_ChannelNumber chid;
reaction = GNUNET_NO;
chid = ntohl (msg->chid);
- ch = GMT_get_channel (t, chid);
+ ch = GCT_get_channel (t, chid);
if (NULL == ch)
{
/* Create channel */
new_channel = GNUNET_NO;
}
- if (GNUNET_YES == new_channel || GMT_is_loopback (t))
+ if (GNUNET_YES == new_channel || GCT_is_loopback (t))
{
/* Find a destination client */
ch->port = ntohl (msg->port);
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " not loopback: destroy now\n");
send_nack (ch);
- GMCH_destroy (ch);
+ GCCH_destroy (ch);
}
return NULL;
}
* @param ch Channel.
*/
void
-GMCH_handle_nack (struct CadetChannel *ch)
+GCCH_handle_nack (struct CadetChannel *ch)
{
send_client_nack (ch);
- GMCH_destroy (ch);
+ GCCH_destroy (ch);
}
* #GNUNET_SYSERR if message on a one-ended channel (remote)
*/
void
-GMCH_handle_ack (struct CadetChannel *ch,
+GCCH_handle_ack (struct CadetChannel *ch,
const struct GNUNET_CADET_ChannelManage *msg,
int fwd)
{
* #GNUNET_SYSERR if message on a one-ended channel (remote)
*/
void
-GMCH_handle_destroy (struct CadetChannel *ch,
+GCCH_handle_destroy (struct CadetChannel *ch,
const struct GNUNET_CADET_ChannelManage *msg,
int fwd)
{
fwd = (NULL != ch->dest) ? GNUNET_YES : GNUNET_NO;
}
- GMCH_debug (ch);
+ GCCH_debug (ch);
if ( (fwd && NULL == ch->dest) || (!fwd && NULL == ch->root) )
{
/* Not for us (don't destroy twice a half-open loopback channel) */
if (0 == rel->n_recv)
{
send_destroy (ch, GNUNET_YES);
- GMCH_destroy (ch);
+ GCCH_destroy (ch);
}
else
{
* @param existing_copy This is a retransmission, don't save a copy.
*/
void
-GMCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
+GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
struct CadetChannel *ch, int fwd,
void *existing_copy)
{
type = ntohs (message->type);
LOG (GNUNET_ERROR_TYPE_INFO, "===> %s %s on channel %s\n",
- GM_m2s (type), GM_f2s (fwd), GMCH_2s (ch));
+ GC_m2s (type), GC_f2s (fwd), GCCH_2s (ch));
- if (GMT_is_loopback (ch->t))
+ if (GCT_is_loopback (ch->t))
{
handle_loopback (ch, message, fwd);
return;
payload = (struct GNUNET_CADET_Data *) message;
LOG (GNUNET_ERROR_TYPE_INFO, "===> %s %u\n",
- GM_m2s (type), ntohl (payload->mid));
+ GC_m2s (type), ntohl (payload->mid));
if (GNUNET_YES == ch->reliable)
{
chq = GNUNET_new (struct CadetChannelQueue);
}
LOG (GNUNET_ERROR_TYPE_DEBUG, " new chq: %p\n", chq);
chq->copy->chq = chq;
- chq->tq = GMT_send_prebuilt_message (message, ch->t, NULL,
+ chq->tq = GCT_send_prebuilt_message (message, ch->t, NULL,
NULL != existing_copy,
&ch_message_sent, chq);
/* q itself is stored in copy */
{
if (NULL != chq->rel->uniq->tq)
{
- GMT_cancel (chq->rel->uniq->tq);
+ GCT_cancel (chq->rel->uniq->tq);
/* ch_message_sent is called, freeing and NULLing uniq */
}
else
GNUNET_free (chq->rel->uniq);
}
}
- chq->tq = GMT_send_prebuilt_message (message, ch->t, NULL, GNUNET_YES,
+ chq->tq = GCT_send_prebuilt_message (message, ch->t, NULL, GNUNET_YES,
&ch_message_sent, chq);
if (NULL == chq->tq)
{
default:
GNUNET_break (0);
- LOG (GNUNET_ERROR_TYPE_DEBUG, "type %s unknown!\n", GM_m2s (type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "type %s unknown!\n", GC_m2s (type));
fire_and_forget (message, ch, GNUNET_YES);
}
}
* @return Static string with the channel IDs.
*/
const char *
-GMCH_2s (const struct CadetChannel *ch)
+GCCH_2s (const struct CadetChannel *ch)
{
static char buf[64];
return "(NULL Channel)";
sprintf (buf, "%s:%u gid:%X (%X / %X)",
- GMT_2s (ch->t), ch->port, ch->gid, ch->lid_root, ch->lid_dest);
+ GCT_2s (ch->t), ch->port, ch->gid, ch->lid_root, ch->lid_dest);
return buf;
}