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.
21 * @file include/gnunet_ats_service.h
22 * @brief automatic transport selection and outbound bandwidth determination
23 * @author Christian Grothoff
24 * @author Matthias Wachs
27 #include "gnunet_ats_service.h"
31 * Handle to the ATS subsystem for bandwidth/transport scheduling information.
33 struct GNUNET_ATS_SchedulingHandle
39 * Initialize the ATS subsystem.
41 * @param cfg configuration to use
42 * @param alloc_cb notification to call whenever the allocation changed
43 * @param alloc_cb_cls closure for 'alloc_cb'
46 struct GNUNET_ATS_SchedulingHandle *
47 GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
48 GNUNET_ATS_AddressSuggestionCallback alloc_cb,
56 * Client is done with ATS scheduling, release resources.
58 * @param atc handle to release
61 GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *atc)
67 * We would like to establish a new connection with a peer. ATS
68 * should suggest a good address to begin with.
71 * @param peer identity of the peer we need an address for
74 GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *atc,
75 const struct GNUNET_PeerIdentity *peer)
81 * We have updated performance statistics for a given address. Note
82 * that this function can be called for addresses that are currently
83 * in use as well as addresses that are valid but not actively in use.
84 * Furthermore, the peer may not even be connected to us right now (in
85 * which case the call may be ignored or the information may be stored
86 * for later use). Update bandwidth assignments.
89 * @param peer identity of the new peer
90 * @param plugin_name name of the transport plugin
91 * @param plugin_addr address (if available)
92 * @param plugin_addr_len number of bytes in plugin_addr
93 * @param session session handle (if available)
94 * @param ats performance data for the address
95 * @param ats_count number of performance records in 'ats'
98 GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *atc,
99 const struct GNUNET_PeerIdentity *peer,
100 const char *plugin_name,
101 const void *plugin_addr, size_t plugin_addr_len,
102 struct Session *session,
103 const struct GNUNET_TRANSPORT_ATS_Information *ats,
110 * A session got destroyed, stop including it as a valid address.
113 * @param peer identity of the peer
114 * @param plugin_name name of the transport plugin
115 * @param plugin_addr address (if available)
116 * @param plugin_addr_len number of bytes in plugin_addr
117 * @param session session handle that is no longer valid
120 GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *atc,
121 const struct GNUNET_PeerIdentity *peer,
122 const char *plugin_name,
123 const void *plugin_addr,
124 size_t plugin_addr_len,
125 const struct Session *session)
129 /* end of ats_api_new.c */