size_t size;
void *data;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: sending a multicast packet...\n");
size = ntohs (msg->size);
GNUNET_assert (NULL != t->tree->me);
n = t->tree->me->children_head;
copies = GNUNET_malloc (sizeof (unsigned int));
for (*copies = 0; NULL != n; n = n->next)
(*copies)++;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: (%u copies)\n", copies);
n = t->tree->me->children_head;
data = GNUNET_malloc (size);
memcpy (data, &msg, size);
}
info->destination = n->peer;
neighbor = path_get_first_hop(t->tree, n->peer);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: sending to %s...\n",
+ GNUNET_i2s (neighbor));
info->peer = peer_info_get(neighbor);
GNUNET_assert (NULL != info->peer);
for (i = 0; NULL != info->peer->core_transmit[i]; i++)
struct MeshTunnel *t;
size_t size;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: got a multicast packet from %s\n",
+ GNUNET_i2s (peer));
size = ntohs (message->size) - sizeof (struct GNUNET_MESH_Multicast);
if (size < sizeof (struct GNUNET_MessageHeader))
{
struct GNUNET_MESH_Multicast *data_msg;
MESH_TunnelNumber tid;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: Got a multicast request from a client!\n");
+
/* Sanity check for client registration */
if (NULL == (c = client_get (client)))
{
memcpy(buf, message, ntohs(message->size));
copy->oid = my_full_id;
copy->tid = htonl(t->id.tid);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: calling generic handler...\n");
handle_mesh_data_multicast(client, &my_full_id, ©->header, NULL);
}
- /* receive done gets called when last copy is sent */
+ /* receive done gets called when last copy is sent to a neighbor */
return;
}
tsize = 0;
while ((NULL != (th = h->th_head)) && (size >= th->size))
{
-#if DEBUG
- LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: type: %u\n",
- ntohs (((struct GNUNET_MessageHeader *) &th[1])->type));
- LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh: size: %u\n",
- ntohs (((struct GNUNET_MessageHeader *) &th[1])->size));
-#endif
if (NULL != th->notify)
{
if (th->tunnel->tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV)
GNUNET_assert (size >= th->size);
psize =
th->notify (th->notify_cls, size - sizeof (mc), &cbuf[sizeof (mc)]);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "mesh: multicast, type %u\n",
+ ntohs (mh->type));
if (psize > 0)
{
mc.header.size = htons (sizeof (mc) + th->size);
uint32_t least_priority;
size_t overhead;
+#if DEBUG
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"mesh: mesh notify transmit ready called\n");
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "mesh: target %s\n",
- GNUNET_i2s (target));
-
+ if (NULL != target)
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "mesh: target %s\n",
+ GNUNET_i2s (target));
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "mesh: target multicast\n");
+#endif
GNUNET_assert (NULL != notify);
if (tunnel->mesh->npackets >= tunnel->mesh->max_queue_size &&
tunnel->npackets > 0)
void **tunnel_ctx,
const struct GNUNET_PeerIdentity *sender,
const struct GNUNET_MessageHeader *message,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
long client = (long) cls;
incoming_tunnel (void *cls,
struct GNUNET_MESH_Tunnel * tunnel,
const struct GNUNET_PeerIdentity * initiator,
- const struct GNUNET_TRANSPORT_ATS_Information * atsi)
+ const struct GNUNET_ATS_Information * atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: Incoming tunnel from %s\n",
*/
static void
ch (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+ const struct GNUNET_ATS_Information *atsi)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: peer %s connected\n",