diff options
Diffstat (limited to 'src/transport/test_communicator_basic.c')
-rw-r--r-- | src/transport/test_communicator_basic.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/transport/test_communicator_basic.c b/src/transport/test_communicator_basic.c index 8251a5169..7ea04afdb 100644 --- a/src/transport/test_communicator_basic.c +++ b/src/transport/test_communicator_basic.c | |||
@@ -26,11 +26,12 @@ | |||
26 | */ | 26 | */ |
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "transport-testing2.h" | 29 | #include "transport-testing-communicator.h" |
30 | #include "gnunet_ats_transport_service.h" | 30 | #include "gnunet_ats_transport_service.h" |
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 | ||
55 | static struct GNUNET_CONFIGURATION_Handle *cfg_peers[NUM_PEERS]; | 56 | static struct GNUNET_CONFIGURATION_Handle *cfg_peers[NUM_PEERS]; |
56 | 57 | ||
58 | static struct GNUNET_STATISTICS_Handle *stats[NUM_PEERS]; | ||
59 | |||
57 | static char *cfg_peers_name[NUM_PEERS]; | 60 | static char *cfg_peers_name[NUM_PEERS]; |
58 | 61 | ||
59 | static int ret; | 62 | static int ret; |
@@ -68,6 +71,8 @@ static struct GNUNET_TIME_Absolute timeout; | |||
68 | 71 | ||
69 | static struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *my_tc; | 72 | static struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *my_tc; |
70 | 73 | ||
74 | static 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 | ||
517 | static int | ||
518 | process_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; |