new ATS API -- code won't compile
[oweals/gnunet.git] / src / ats / ats_api_new.c
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 include/gnunet_ats_service.h
22  * @brief automatic transport selection and outbound bandwidth determination
23  * @author Christian Grothoff
24  * @author Matthias Wachs
25  */
26 #include "platform.h"
27 #include "gnunet_ats_service.h"
28
29
30 /**
31  * Handle to the ATS subsystem for bandwidth/transport scheduling information.
32  */
33 struct GNUNET_ATS_SchedulingHandle
34 {
35 };
36
37
38 /**
39  * Initialize the ATS subsystem.
40  *
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'
44  * @return ats context
45  */
46 struct GNUNET_ATS_SchedulingHandle *
47 GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
48                             GNUNET_ATS_AddressSuggestionCallback alloc_cb,
49                             void *alloc_cb_cls)
50 {
51   return NULL;
52 }
53
54
55 /**
56  * Client is done with ATS scheduling, release resources.
57  *
58  * @param atc handle to release
59  */
60 void
61 GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *atc)
62 {
63 }
64
65
66 /**
67  * We would like to establish a new connection with a peer.  ATS
68  * should suggest a good address to begin with.
69  *
70  * @param atc handle
71  * @param peer identity of the peer we need an address for
72  */
73 void
74 GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *atc,
75                             const struct GNUNET_PeerIdentity *peer)
76 {
77 }
78
79
80 /**
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.
87  *
88  * @param atc handle
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'
96  */
97 void
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,
104                            uint32_t ats_count)
105 {
106 }
107
108
109 /**
110  * A session got destroyed, stop including it as a valid address.
111  *
112  * @param atc handle
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
118  */
119 void
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)
126 {
127 }
128
129 /* end of ats_api_new.c */