#include <stdio.h>
#include "platform.h"
#include "mesh_test_lib.h"
-#include "gnunet_mesh_service_enc.h"
+#include "gnunet_mesh_service.h"
#include <gauger.h>
/**
* Shut down peergroup, clean up.
- *
+ *
* @param cls Closure (unused).
* @param tc Task Context.
*/
/**
* Disconnect from mesh services af all peers, call shutdown.
- *
+ *
* @param cls Closure (unused).
* @param tc Task Context.
*/
/**
* Abort test: schedule disconnect and shutdown immediately
- *
+ *
* @param line Line in the code the abort is requested from (__LINE__).
*/
static void
/**
* Transmit ready callback.
- *
+ *
* @param cls Closure (message type).
* @param size Size of the tranmist buffer.
* @param buf Pointer to the beginning of the buffer.
- *
+ *
* @return Number of bytes written to buf.
*/
static size_t
/**
* Task to schedule a new data transmission.
- *
+ *
* @param cls Closure (peer #).
* @param tc Task Context.
*/
uint32_t *data;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- " tmt_rdy called\n");
+ "tmt_rdy called, filling buffer\n");
if (size < size_payload || NULL == buf)
{
GNUNET_break (0);
msg->type = htons ((long) cls);
data = (uint32_t *) &msg[1];
*data = htonl (data_sent);
- if (SPEED == test && GNUNET_YES == initialized)
+ if (GNUNET_NO == initialized)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "sending initializer\n");
+ }
+ else if (SPEED == test)
{
data_sent++;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
" Scheduling packet %d\n", data_sent + 1);
- GNUNET_SCHEDULER_add_now(&data_task, NULL);
+ GNUNET_SCHEDULER_add_now (&data_task, NULL);
}
}
+
return size_payload;
}
/**
* START THE TESTCASE ITSELF, AS WE ARE CONNECTED TO THE MESH SERVICES.
- *
+ *
* Testcase continues when the root receives confirmation of connected peers,
* on callback funtion ch.
- *
+ *
* @param cls Closure (unsued).
* @param tc Task Context.
*/
data_received = 0;
data_sent = 0;
GNUNET_MESH_notify_transmit_ready (ch, GNUNET_NO,
- GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_TIME_UNIT_FOREVER_REL,
size_payload, &tmt_rdy, (void *) 1L);
}