aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tests/gnunet-ats-sim.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-21 15:22:09 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-21 15:22:09 +0000
commit1f3f45c08b82899a5350633dc6f1030216a1e150 (patch)
tree1536f4ed581eed1139eb8a81663038c548dea038 /src/ats-tests/gnunet-ats-sim.c
parent42d205bed7f300dbc9fa4e97bb88b35321552a89 (diff)
downloadgnunet-1f3f45c08b82899a5350633dc6f1030216a1e150.tar.gz
gnunet-1f3f45c08b82899a5350633dc6f1030216a1e150.zip
initial preliminary commit for ats testing lib and simulator tool
Diffstat (limited to 'src/ats-tests/gnunet-ats-sim.c')
-rw-r--r--src/ats-tests/gnunet-ats-sim.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/ats-tests/gnunet-ats-sim.c b/src/ats-tests/gnunet-ats-sim.c
new file mode 100644
index 000000000..0bd970a8f
--- /dev/null
+++ b/src/ats-tests/gnunet-ats-sim.c
@@ -0,0 +1,73 @@
1/*
2 This file is part of GNUnet.
3 (C) 2010-2013 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 */
20/**
21 * @file ats/perf_ats.c
22 * @brief ats benchmark: start peers and modify preferences, monitor change over time
23 * @author Christian Grothoff
24 * @author Matthias Wachs
25 */
26#include "platform.h"
27#include "gnunet_util_lib.h"
28#include "gnunet_testbed_service.h"
29#include "gnunet_ats_service.h"
30#include "gnunet_core_service.h"
31#include "ats-testing.h"
32
33#define DEFAULT_NUM_SLAVES 5
34#define DEFAULT_NUM_MASTERS 1
35
36#define TEST_MESSAGE_TYPE_PING 12345
37#define TEST_MESSAGE_TYPE_PONG 12346
38
39static int
40comm_handle_pong (void *cls, const struct GNUNET_PeerIdentity *other,
41 const struct GNUNET_MessageHeader *message)
42{
43 return 0;
44}
45
46static int
47comm_handle_ping (void *cls, const struct GNUNET_PeerIdentity *other,
48 const struct GNUNET_MessageHeader *message)
49{
50 return 0;
51}
52
53static void
54transport_recv_cb (void *cls,
55 const struct GNUNET_PeerIdentity * peer,
56 const struct GNUNET_MessageHeader * message)
57{
58
59}
60
61int
62main (int argc, char *argv[])
63{
64 static struct GNUNET_CORE_MessageHandler handlers[] = { {
65 &comm_handle_ping, TEST_MESSAGE_TYPE_PING, 0 }, { &comm_handle_pong,
66 TEST_MESSAGE_TYPE_PONG, 0 }, { NULL, 0, 0 } };
67
68
69 GNUNET_ATS_TEST_create_topology ("gnunet-ats-sim", "perf_ats_proportional_none.conf",
70 DEFAULT_NUM_SLAVES, DEFAULT_NUM_MASTERS, handlers, &transport_recv_cb);
71 return 0;
72}
73/* end of file perf_ats_topogy.c */