2 This file is part of GNUnet.
3 (C) 2010,2011 Christian Grothoff (and other contributing authors)
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.
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.
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.
22 * @brief automatic transport selection API
23 * @author Christian Grothoff
24 * @author Matthias Wachs
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 (!)
34 #include "gnunet_ats_service.h"
36 #define VERBOSE GNUNET_EXTRA_LOGGING
38 #define VERBOSE_ARM GNUNET_EXTRA_LOGGING
40 #define START_ARM GNUNET_YES
43 static struct GNUNET_CONFIGURATION_Handle *cfg;
45 static struct GNUNET_ATS_Handle *ats;
48 alloc_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)
61 cfg = GNUNET_CONFIGURATION_create ();
62 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, "test_ats_api.conf"))
64 GNUNET_CONFIGURATION_destroy (cfg);
68 ats = GNUNET_ATS_init (cfg, alloc_cb, NULL);
69 GNUNET_assert (ats != NULL);
70 GNUNET_ATS_shutdown (ats);
72 GNUNET_CONFIGURATION_destroy (cfg);
77 main (int argc, char *argv[])
81 GNUNET_log_setup ("test-ats-api",