types[ntypes] = htons (h->message_handlers[ntypes].type);
msg->applications = htons (napps);
msg->types = htons (ntypes);
-#if MESH_API_DEBUG
LOG (GNUNET_ERROR_TYPE_DEBUG,
"mesh: Sending %lu bytes long message %d types and %d apps\n",
ntohs (msg->header.size), ntypes, napps);
-#endif
send_packet (h, &msg->header, NULL);
}
}
struct GNUNET_MESH_Tunnel *t;
unsigned int i;
-#if MESH_API_DEBUG
LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: *****************************\n");
LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: ******* RECONNECT *******\n");
LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: *****************************\n");
-#endif
+
h->in_receive = GNUNET_NO;
/* disconnect */
if (NULL != h->th)
atsi.value = 0;
t->ctx = h->new_tunnel (h->cls, t, &msg->peer, &atsi);
}
-#if MESH_API_DEBUG
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: new incoming tunnel %X\n",
- t->tid);
-#endif
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: new incoming tunnel %X\n", t->tid);
return;
}
{
GNUNET_break (0);
}
-#if MESH_API_DEBUG
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: tunnel %u destroyed\n", t->tid);
-#endif
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: tunnel %u destroyed\n", t->tid);
destroy_tunnel (t, GNUNET_YES);
return;
}
unsigned int i;
uint16_t type;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: Got a data message!\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: Got a data message!\n");
type = ntohs (message->type);
switch (type)
{
t = retrieve_tunnel (h, ntohl (ucast->tid));
payload = (struct GNUNET_MessageHeader *) &ucast[1];
peer = &ucast->oid;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: ucast on tunnel %s [%x]\n",
- GNUNET_i2s (peer), ntohl (ucast->tid));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: ucast on tunnel %s [%x]\n",
+ GNUNET_i2s (peer), ntohl (ucast->tid));
break;
case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
mcast = (struct GNUNET_MESH_Multicast *) message;
t = retrieve_tunnel (h, ntohl (mcast->tid));
payload = (struct GNUNET_MessageHeader *) &mcast[1];
peer = &mcast->oid;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: mcast on tunnel %s [%x]\n",
- GNUNET_i2s (peer), ntohl (mcast->tid));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: mcast on tunnel %s [%x]\n",
+ GNUNET_i2s (peer), ntohl (mcast->tid));
break;
case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
to_orig = (struct GNUNET_MESH_ToOrigin *) message;
t = retrieve_tunnel (h, ntohl (to_orig->tid));
payload = (struct GNUNET_MessageHeader *) &to_orig[1];
peer = &to_orig->sender;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: torig on tunnel %s [%x]\n",
- GNUNET_i2s (peer), ntohl (to_orig->tid));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: torig on tunnel %s [%x]\n",
+ GNUNET_i2s (peer), ntohl (to_orig->tid));
break;
default:
GNUNET_break (0);
GNUNET_MESH_disconnect (h);
return GNUNET_NO;
}
-#if MESH_API_DEBUG
else
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"MESH: callback completed successfully\n");
}
-#endif
}
}
return GNUNET_YES;
GNUNET_assert (size >= th->size);
mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (to)];
psize = th->notify (th->notify_cls, size - sizeof (to), mh);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: to origin, type %u\n",
- ntohs (mh->type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: to origin, type %u\n",
+ ntohs (mh->type));
if (psize > 0)
{
psize += sizeof (to);
GNUNET_assert (size >= th->size);
mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (mc)];
psize = th->notify (th->notify_cls, size - sizeof (mc), mh);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: multicast, type %u\n",
- ntohs (mh->type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: multicast, type %u\n",
+ ntohs (mh->type));
if (psize > 0)
{
psize += sizeof (mc);
GNUNET_assert (size >= th->size);
mh = (struct GNUNET_MessageHeader *) &cbuf[sizeof (uc)];
psize = th->notify (th->notify_cls, size - sizeof (uc), mh);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: unicast, type %u\n",
- ntohs (mh->type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: unicast, type %u\n",
+ ntohs (mh->type));
if (psize > 0)
{
psize += sizeof (uc);
if (t->tid < GNUNET_MESH_LOCAL_TUNNEL_ID_SERV)
{
GNUNET_break (0);
-#if MESH_API_DEBUG
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: tunnel %X not destroyed\n",
- t->tid);
-#endif
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: tunnel %X not destroyed\n", t->tid);
}
destroy_tunnel (t, GNUNET_YES);
t = aux;
break;
default:
GNUNET_break (0);
-#if MESH_API_DEBUG
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: unexpected msg %u\n",
- ntohs(msg->type));
-#endif
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: unexpected msg %u\n",
+ ntohs(msg->type));
}
GNUNET_CONTAINER_DLL_remove (handle->th_head, handle->th_tail, th);
size_t overhead;
GNUNET_assert (NULL != tunnel);
-#if MESH_API_DEBUG
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "mesh: mesh notify transmit ready called\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: mesh notify transmit ready called\n");
if (NULL != target)
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: target %s\n",
- GNUNET_i2s (target));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: target %s\n", GNUNET_i2s (target));
else
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: target multicast\n");
-#endif
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: target multicast\n");
GNUNET_assert (NULL != notify);
if (tunnel->mesh->npackets >= tunnel->mesh->max_queue_size &&
tunnel->npackets > 0)