aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_communicator_basic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_communicator_basic.c')
-rw-r--r--src/transport/test_communicator_basic.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/transport/test_communicator_basic.c b/src/transport/test_communicator_basic.c
index 8251a5169..df3c73b20 100644
--- a/src/transport/test_communicator_basic.c
+++ b/src/transport/test_communicator_basic.c
@@ -31,6 +31,7 @@
31#include "gnunet_signatures.h" 31#include "gnunet_signatures.h"
32#include "gnunet_testing_lib.h" 32#include "gnunet_testing_lib.h"
33#include "transport.h" 33#include "transport.h"
34#include "gnunet_statistics_service.h"
34 35
35#include <inttypes.h> 36#include <inttypes.h>
36 37
@@ -54,6 +55,8 @@ GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_hs[NUM_PEERS];
54 55
55static struct GNUNET_CONFIGURATION_Handle *cfg_peers[NUM_PEERS]; 56static struct GNUNET_CONFIGURATION_Handle *cfg_peers[NUM_PEERS];
56 57
58static struct GNUNET_STATISTICS_Handle *stats[NUM_PEERS];
59
57static char *cfg_peers_name[NUM_PEERS]; 60static char *cfg_peers_name[NUM_PEERS];
58 61
59static int ret; 62static int ret;
@@ -68,6 +71,8 @@ static struct GNUNET_TIME_Absolute timeout;
68 71
69static struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *my_tc; 72static struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *my_tc;
70 73
74static char *test_name;
75
71#define SHORT_MESSAGE_SIZE 128 76#define SHORT_MESSAGE_SIZE 128
72 77
73#define LONG_MESSAGE_SIZE 32000 /* FIXME */ 78#define LONG_MESSAGE_SIZE 32000 /* FIXME */
@@ -509,6 +514,16 @@ update_avg_latency (const char*payload)
509 514
510} 515}
511 516
517static int
518process_statistics (void *cls,
519 const char *subsystem,
520 const char *name,
521 uint64_t value,
522 int is_persistent)
523{
524 return GNUNET_OK;
525}
526
512/** 527/**
513 * @brief Handle an incoming message 528 * @brief Handle an incoming message
514 * 529 *
@@ -645,6 +660,15 @@ incoming_message_cb (void *cls,
645 short_test (NULL); 660 short_test (NULL);
646 break; 661 break;
647 } 662 }
663 /* if (("rekey" == test_name) || ("backchannel" == test_name)) */
664 /* { */
665 /* GNUNET_STATISTICS_get (stats[1], */
666 /* "C-UDP", */
667 /* "# bytes decrypted with Rekey", */
668 /* NULL, */
669 /* &process_statistics, */
670 /* NULL); */
671 /* } */
648 LOG (GNUNET_ERROR_TYPE_DEBUG, 672 LOG (GNUNET_ERROR_TYPE_DEBUG,
649 "Finished\n"); 673 "Finished\n");
650 GNUNET_SCHEDULER_shutdown (); 674 GNUNET_SCHEDULER_shutdown ();
@@ -695,6 +719,12 @@ run (void *cls)
695 &incoming_message_cb, 719 &incoming_message_cb,
696 &handle_backchannel_cb, 720 &handle_backchannel_cb,
697 cfg_peers_name[i]); /* cls */ 721 cfg_peers_name[i]); /* cls */
722
723 /* if (("rekey" == test_name) || ("backchannel" == test_name)) */
724 /* { */
725 /* stats[i] = GNUNET_STATISTICS_create ("C-UDP", */
726 /* cfg_peers[i]); */
727 /* } */
698 } 728 }
699 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, 729 GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
700 NULL); 730 NULL);
@@ -708,7 +738,6 @@ main (int argc,
708 struct GNUNET_CRYPTO_EddsaPrivateKey *private_key; 738 struct GNUNET_CRYPTO_EddsaPrivateKey *private_key;
709 char *communicator_name; 739 char *communicator_name;
710 char *test_mode; 740 char *test_mode;
711 char *test_name;
712 char *cfg_peer; 741 char *cfg_peer;
713 742
714 phase = TP_INIT; 743 phase = TP_INIT;