/* Build ACK message and send on conn */
msg.header.size = htons (sizeof (msg));
- msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK);
- msg.cemi = ack_cemi;
+ msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK);
+ msg.cemi_max = ack_cemi;
msg.cid = c->id;
prev_fc->ack_msg = GCC_send_prebuilt_message (&msg.header,
}
else /* CONN_CREATE or CONN_ACK */
{
- GNUNET_assert (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED != type);
+ GNUNET_assert (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED != type);
forced = GNUNET_YES;
}
schedule_next_keepalive (c, fwd);
break;
- case GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED:
+ case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED:
if (GNUNET_YES == sent)
{
fc->last_pid_sent = pid;
connection_reset_timeout (c, fwd);
break;
- case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL:
+ case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL:
fc->poll_msg = NULL;
if (2 == c->destroy)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " task %u\n", fc->poll_task);
break;
- case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK:
fc->ack_msg = NULL;
break;
send_connection_ack (struct CadetConnection *c, int fwd)
{
static struct CadetEncryptedMessageIdentifier zero;
- struct GNUNET_CADET_ConnectionCreateMessageAckMessage msg;
+ struct GNUNET_CADET_ConnectionCreateAckMessage msg;
struct CadetTunnel *t;
- const uint16_t size = sizeof (struct GNUNET_CADET_ConnectionCreateMessageAckMessage);
+ const uint16_t size = sizeof (struct GNUNET_CADET_ConnectionCreateAckMessage);
const uint16_t type = GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK;
GCC_check_connections ();
LOG (GNUNET_ERROR_TYPE_DEBUG, "Polling connection %s %s\n",
GCC_2s (c), GC_f2s (fwd));
- msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL);
+ msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL);
msg.header.size = htons (sizeof (msg));
msg.cid = c->id;
msg.cemi = fc->last_pid_sent;
*/
void
GCC_handle_confirm (struct CadetPeer *peer,
- const struct GNUNET_CADET_ConnectionCreateMessageAckMessage *msg)
+ const struct GNUNET_CADET_ConnectionCreateAckMessage *msg)
{
static struct CadetEncryptedMessageIdentifier zero;
struct CadetConnection *c;
return;
}
- ack = msg->cemi;
+ ack = msg->cemi_max;
LOG (GNUNET_ERROR_TYPE_DEBUG, " %s ACK %u (was %u)\n",
GC_f2s (fwd),
ntohl (ack.pid),
/* Check PID for payload messages */
type = ntohs (message->type);
- if (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED == type)
+ if (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED == type)
{
fc = fwd ? &c->bck_fc : &c->fwd_fc;
LOG (GNUNET_ERROR_TYPE_DEBUG, " PID %u (expected in interval [%u,%u])\n",
*/
void
GCC_handle_encrypted (struct CadetPeer *peer,
- const struct GNUNET_CADET_ConnectionEncryptedMessage *msg)
+ const struct GNUNET_CADET_TunnelEncryptedMessage *msg)
{
static struct CadetEncryptedMessageIdentifier zero;
const struct GNUNET_CADET_ConnectionTunnelIdentifier* cid;
GC_f2s(fwd), size);
switch (type)
{
- case GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED:
+ case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED:
LOG (GNUNET_ERROR_TYPE_DEBUG, " Q_N+ %p %u, PIDsnt: %u, ACKrcv: %u\n",
fc,
fc->queue_n,
GNUNET_break (0 == payload_type);
break;
- case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK:
- case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL:
+ case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_ENCRYPTED_ACK:
+ case GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED_POLL:
case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY:
case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN:
GNUNET_assert (GNUNET_YES == force);
GNUNET_break (0);
LOG (GNUNET_ERROR_TYPE_DEBUG, "queue full: %u/%u\n",
fc->queue_n, fc->queue_max);
- if (GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED == type)
+ if (GNUNET_MESSAGE_TYPE_CADET_TUNNEL_ENCRYPTED == type)
{
fc->queue_n--;
}