/**
* Channel ID for the next created channel.
*/
- struct GNUNET_CADET_ChannelTunnelNumber next_chid;
+ struct GNUNET_CADET_ChannelTunnelNumber next_ctn;
/**
* Destroy flag: if true, destroy on last message.
msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY);
msg.header.size = htons (sizeof (msg));
- msg.chid = gid;
+ msg.ctn = gid;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"WARNING destroying unknown channel %u on tunnel %s\n",
/* Check channel */
- ch = GCT_get_channel (t, msg->chid);
+ ch = GCT_get_channel (t, msg->ctn);
if (NULL == ch)
{
GNUNET_STATISTICS_update (stats,
GNUNET_NO);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"channel 0x%X unknown\n",
- ntohl (msg->chid.cn));
- send_channel_destroy (t, msg->chid);
+ ntohl (msg->ctn.cn));
+ send_channel_destroy (t, msg->ctn);
return;
}
}
/* Check channel */
- ch = GCT_get_channel (t, msg->chid);
+ ch = GCT_get_channel (t, msg->ctn);
if (NULL == ch)
{
GNUNET_STATISTICS_update (stats, "# data ack on unknown channel",
1, GNUNET_NO);
LOG (GNUNET_ERROR_TYPE_DEBUG, "WARNING channel %u unknown\n",
- ntohl (msg->chid.cn));
+ ntohl (msg->ctn.cn));
return;
}
}
/* Check channel */
- ch = GCT_get_channel (t, msg->chid);
+ ch = GCT_get_channel (t, msg->ctn);
if (NULL != ch && ! GCT_is_loopback (t))
{
/* Probably a retransmission, safe to ignore */
}
/* Check channel */
- ch = GCT_get_channel (t, msg->chid);
+ ch = GCT_get_channel (t, msg->ctn);
if (NULL == ch)
{
GNUNET_STATISTICS_update (stats, "# channel NACK on unknown channel",
1, GNUNET_NO);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"WARNING channel %u unknown\n",
- ntohl (msg->chid.cn));
+ ntohl (msg->ctn.cn));
return;
}
}
/* Check channel */
- ch = GCT_get_channel (t, msg->chid);
+ ch = GCT_get_channel (t, msg->ctn);
if (NULL == ch)
{
GNUNET_STATISTICS_update (stats,
GNUNET_NO);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"WARNING channel %u unknown\n",
- ntohl (msg->chid.cn));
+ ntohl (msg->ctn.cn));
return;
}
}
/* Check channel */
- ch = GCT_get_channel (t, msg->chid);
+ ch = GCT_get_channel (t, msg->ctn);
if (NULL == ch)
{
/* Probably a retransmission, safe to ignore */
struct CadetTunnel *t;
t = GNUNET_new (struct CadetTunnel);
- t->next_chid.cn = 0;
+ t->next_ctn.cn = 0;
t->peer = destination;
if (GNUNET_OK !=
* Search for a channel by global ID.
*
* @param t Tunnel containing the channel.
- * @param chid Public channel number.
+ * @param ctn Public channel number.
*
* @return channel handler, NULL if doesn't exist
*/
struct CadetChannel *
GCT_get_channel (struct CadetTunnel *t,
- struct GNUNET_CADET_ChannelTunnelNumber chid)
+ struct GNUNET_CADET_ChannelTunnelNumber ctn)
{
struct CadetTChannel *iter;
for (iter = t->channel_head; NULL != iter; iter = iter->next)
{
- if (GCCH_get_id (iter->ch).cn == chid.cn)
+ if (GCCH_get_id (iter->ch).cn == ctn.cn)
break;
}
* @return GID of a channel free to use.
*/
struct GNUNET_CADET_ChannelTunnelNumber
-GCT_get_next_chid (struct CadetTunnel *t)
+GCT_get_next_ctn (struct CadetTunnel *t)
{
- struct GNUNET_CADET_ChannelTunnelNumber chid;
+ struct GNUNET_CADET_ChannelTunnelNumber ctn;
struct GNUNET_CADET_ChannelTunnelNumber mask;
int result;
mask.cn = htonl (0x40000000);
else
mask.cn = 0x0;
- t->next_chid.cn |= mask.cn;
+ t->next_ctn.cn |= mask.cn;
- while (NULL != GCT_get_channel (t, t->next_chid))
+ while (NULL != GCT_get_channel (t, t->next_ctn))
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Channel %u exists...\n",
- t->next_chid.cn);
- t->next_chid.cn = htonl ((ntohl (t->next_chid.cn) + 1) & ~GNUNET_CADET_LOCAL_CHANNEL_ID_CLI);
- t->next_chid.cn |= mask.cn;
+ t->next_ctn.cn);
+ t->next_ctn.cn = htonl ((ntohl (t->next_ctn.cn) + 1) & ~GNUNET_CADET_LOCAL_CHANNEL_ID_CLI);
+ t->next_ctn.cn |= mask.cn;
}
- chid = t->next_chid;
- t->next_chid.cn = (t->next_chid.cn + 1) & ~GNUNET_CADET_LOCAL_CHANNEL_ID_CLI;
- t->next_chid.cn |= mask.cn;
+ ctn = t->next_ctn;
+ t->next_ctn.cn = (t->next_ctn.cn + 1) & ~GNUNET_CADET_LOCAL_CHANNEL_ID_CLI;
+ t->next_ctn.cn |= mask.cn;
- return chid;
+ return ctn;
}