* achieve reliable message delivery.
*/
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_hello_lib.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_os_lib.h"
-#include "gnunet_program_lib.h"
-#include "gnunet_scheduler_lib.h"
-#include "gnunet_server_lib.h"
#include "gnunet_transport_service.h"
#include "gauger.h"
-#include "transport.h"
#include "transport-testing.h"
-#define VERBOSE GNUNET_NO
-
-#define VERBOSE_ARM GNUNET_NO
-
-#define START_ARM GNUNET_YES
-
/**
* Testcase timeout
*/
end ()
{
unsigned long long delta;
-
char *value_name;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
- FPRINTF (stderr, "\nThroughput was %llu kb/s\n",
- total_bytes * 1000 / 1024 / delta);
+ delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us / (1000 * 1000);
+ FPRINTF (stderr, "\nThroughput was %llu kb/s total_bytes\n",
+ (total_bytes / 1024) / delta);
GNUNET_asprintf (&value_name, "unreliable_%s", test_plugin);
- GAUGER ("TRANSPORT", value_name, (int) (total_bytes * 1000 / 1024 / delta),
+ GAUGER ("TRANSPORT", value_name, (int) (total_bytes / 1024 / delta),
"kb/s");
GNUNET_free (value_name);
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+ const struct GNUNET_MessageHeader *message)
{
static int n;
while (size - ret >= s);
if (n < TOTAL_MSGS)
{
- th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, s, 0,
+ th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, s,
TIMEOUT_TRANSMIT,
¬ify_ready, NULL);
msg_scheduled = n;
static void
-notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' connected to us (%p)!\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Peer `%4s' connected to us (%p)!\n",
GNUNET_i2s (peer), cls);
}
static void
notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%4s' disconnected (%p)!\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Peer `%4s' disconnected (%p)!\n",
GNUNET_i2s (peer), cls);
if (th != NULL)
GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
sendtask ()
{
start_time = GNUNET_TIME_absolute_get ();
- th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, get_size (0), 0,
+ th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, get_size (0),
TIMEOUT_TRANSMIT, ¬ify_ready,
NULL);
}
{
char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id));
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected: %s <-> %s\n", p1_c,
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Peers connected: %s <-> %s\n", p1_c,
GNUNET_i2s (&p2->id));
GNUNET_free (p1_c);
started++;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%s') started\n", p->no,
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Peer %u (`%s') started\n", p->no,
GNUNET_i2s (&p->id));
if (started != 2)
static char *const argv[] = { "test-transport-api-unreliability-constant",
"-c",
"test_transport_api_data.conf",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
NULL
};
static struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
-#if WRITECONFIG
- setTransportOptions ("test_transport_api_data.conf");
-#endif
ok = GNUNET_SYSERR;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name);
GNUNET_log_setup (test_name,
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, &test_source);