aboutsummaryrefslogtreecommitdiff
path: root/src/ats/test_ats_api.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-10-14 08:10:28 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-10-14 08:10:28 +0000
commite047b52bb409063e65abdcfcf108007fac42c95e (patch)
treed4f912cb012907e20d20fda2e67ffa8017214031 /src/ats/test_ats_api.c
parent70f9bcf894b28799df078330d204860e7ea7bae8 (diff)
downloadgnunet-e047b52bb409063e65abdcfcf108007fac42c95e.tar.gz
gnunet-e047b52bb409063e65abdcfcf108007fac42c95e.zip
test + fix
Diffstat (limited to 'src/ats/test_ats_api.c')
-rw-r--r--src/ats/test_ats_api.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/src/ats/test_ats_api.c b/src/ats/test_ats_api.c
deleted file mode 100644
index 4a4bf9772..000000000
--- a/src/ats/test_ats_api.c
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 This file is part of GNUnet.
3 (C) 2010,2011 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/ats_api.c
22 * @brief automatic transport selection API
23 * @author Christian Grothoff
24 * @author Matthias Wachs
25 *
26 * TODO:
27 * - write test case
28 * - extend API to get performance data
29 * - implement simplistic strategy based on say 'lowest latency' or strict ordering
30 * - extend API to get peer preferences, implement proportional bandwidth assignment
31 * - re-implement API against a real ATS service (!)
32 */
33#include "platform.h"
34#include "gnunet_ats_service.h"
35
36#define VERBOSE GNUNET_EXTRA_LOGGING
37
38#define VERBOSE_ARM GNUNET_EXTRA_LOGGING
39
40#define START_ARM GNUNET_YES
41
42
43static struct GNUNET_CONFIGURATION_Handle *cfg;
44
45static struct GNUNET_ATS_SchedulingHandle *ats;
46
47static void
48alloc_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
49 const char *plugin_name, struct Session *session,
50 const void *plugin_addr, size_t plugin_addr_len,
51 struct GNUNET_BANDWIDTH_Value32NBO bandwidth)
52{
53
54}
55
56static int
57check ()
58{
59 int ret = 0;
60
61 cfg = GNUNET_CONFIGURATION_create ();
62 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, "test_ats_api.conf"))
63 {
64 GNUNET_CONFIGURATION_destroy (cfg);
65 return -1;
66 }
67
68 ats = GNUNET_ATS_init (cfg, alloc_cb, NULL);
69 GNUNET_assert (ats != NULL);
70 GNUNET_ATS_shutdown (ats);
71
72 GNUNET_CONFIGURATION_destroy (cfg);
73 return ret;
74}
75
76int
77main (int argc, char *argv[])
78{
79 int ret;
80
81 GNUNET_log_setup ("test-ats-api",
82#if VERBOSE
83 "DEBUG",
84#else
85 "WARNING",
86#endif
87 NULL);
88
89 ret = check ();
90
91 return ret;
92}