diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-21 16:27:55 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-21 16:27:55 +0000 |
commit | f15624031417464fa72c659be7e0be8db55a909b (patch) | |
tree | 431a51f38b9516f56dc6d38e347fef0abade1b51 /src/ats-tests/gnunet-ats-sim.c | |
parent | 1f3f45c08b82899a5350633dc6f1030216a1e150 (diff) | |
download | gnunet-f15624031417464fa72c659be7e0be8db55a909b.tar.gz gnunet-f15624031417464fa72c659be7e0be8db55a909b.zip |
not yet finished: moving perf_ats to testing
Diffstat (limited to 'src/ats-tests/gnunet-ats-sim.c')
-rw-r--r-- | src/ats-tests/gnunet-ats-sim.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/ats-tests/gnunet-ats-sim.c b/src/ats-tests/gnunet-ats-sim.c index 0bd970a8f..7a7508503 100644 --- a/src/ats-tests/gnunet-ats-sim.c +++ b/src/ats-tests/gnunet-ats-sim.c | |||
@@ -36,15 +36,19 @@ | |||
36 | #define TEST_MESSAGE_TYPE_PING 12345 | 36 | #define TEST_MESSAGE_TYPE_PING 12345 |
37 | #define TEST_MESSAGE_TYPE_PONG 12346 | 37 | #define TEST_MESSAGE_TYPE_PONG 12346 |
38 | 38 | ||
39 | static int c_masters; | ||
40 | |||
41 | static int c_slaves; | ||
42 | |||
39 | static int | 43 | static int |
40 | comm_handle_pong (void *cls, const struct GNUNET_PeerIdentity *other, | 44 | core_handle_pong (void *cls, const struct GNUNET_PeerIdentity *other, |
41 | const struct GNUNET_MessageHeader *message) | 45 | const struct GNUNET_MessageHeader *message) |
42 | { | 46 | { |
43 | return 0; | 47 | return 0; |
44 | } | 48 | } |
45 | 49 | ||
46 | static int | 50 | static int |
47 | comm_handle_ping (void *cls, const struct GNUNET_PeerIdentity *other, | 51 | core_handle_ping (void *cls, const struct GNUNET_PeerIdentity *other, |
48 | const struct GNUNET_MessageHeader *message) | 52 | const struct GNUNET_MessageHeader *message) |
49 | { | 53 | { |
50 | return 0; | 54 | return 0; |
@@ -58,16 +62,33 @@ transport_recv_cb (void *cls, | |||
58 | 62 | ||
59 | } | 63 | } |
60 | 64 | ||
65 | static void topology_setup_done (void *cls, | ||
66 | struct BenchmarkPeer *masters, | ||
67 | struct BenchmarkPeer *slaves) | ||
68 | { | ||
69 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Topology setup complete!\n"); | ||
70 | GNUNET_ATS_TEST_shutdown_topology (); | ||
71 | } | ||
72 | |||
61 | int | 73 | int |
62 | main (int argc, char *argv[]) | 74 | main (int argc, char *argv[]) |
63 | { | 75 | { |
64 | static struct GNUNET_CORE_MessageHandler handlers[] = { { | 76 | static struct GNUNET_CORE_MessageHandler handlers[] = { |
65 | &comm_handle_ping, TEST_MESSAGE_TYPE_PING, 0 }, { &comm_handle_pong, | 77 | {&core_handle_ping, TEST_MESSAGE_TYPE_PING, 0 }, |
66 | TEST_MESSAGE_TYPE_PONG, 0 }, { NULL, 0, 0 } }; | 78 | {&core_handle_pong, TEST_MESSAGE_TYPE_PONG, 0 }, |
79 | { NULL, 0, 0 } }; | ||
67 | 80 | ||
81 | c_slaves = DEFAULT_NUM_SLAVES; | ||
82 | c_masters = DEFAULT_NUM_MASTERS; | ||
68 | 83 | ||
69 | GNUNET_ATS_TEST_create_topology ("gnunet-ats-sim", "perf_ats_proportional_none.conf", | 84 | GNUNET_ATS_TEST_create_topology ("gnunet-ats-sim", "perf_ats_proportional_none.conf", |
70 | DEFAULT_NUM_SLAVES, DEFAULT_NUM_MASTERS, handlers, &transport_recv_cb); | 85 | c_slaves, |
86 | c_masters, | ||
87 | GNUNET_YES, | ||
88 | &topology_setup_done, | ||
89 | NULL, | ||
90 | handlers, | ||
91 | &transport_recv_cb); | ||
71 | return 0; | 92 | return 0; |
72 | } | 93 | } |
73 | /* end of file perf_ats_topogy.c */ | 94 | /* end of file perf_ats_topogy.c */ |