diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-10-05 08:11:00 +0200 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-10-05 08:11:00 +0200 |
commit | 614ed461b8a4c4fbf8cbdfb6b7f1a3f28a1ab8a9 (patch) | |
tree | fd8bdd03b672f0184b6bdf7100284cde00ff44d5 /src/include/gnunet_ats_transport_service.h | |
parent | 53e3a0e32e24629b25a64d7572bc350f69608fac (diff) | |
download | gnunet-614ed461b8a4c4fbf8cbdfb6b7f1a3f28a1ab8a9.tar.gz gnunet-614ed461b8a4c4fbf8cbdfb6b7f1a3f28a1ab8a9.zip |
Remove more traces of ATS
Diffstat (limited to 'src/include/gnunet_ats_transport_service.h')
-rw-r--r-- | src/include/gnunet_ats_transport_service.h | 247 |
1 files changed, 0 insertions, 247 deletions
diff --git a/src/include/gnunet_ats_transport_service.h b/src/include/gnunet_ats_transport_service.h deleted file mode 100644 index 24594f44b..000000000 --- a/src/include/gnunet_ats_transport_service.h +++ /dev/null | |||
@@ -1,247 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2010-2015, 2018 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your 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 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | /** | ||
21 | * @file | ||
22 | * Bandwidth allocation API for the transport service | ||
23 | * | ||
24 | * @author Christian Grothoff | ||
25 | * @author Matthias Wachs | ||
26 | * | ||
27 | * @defgroup ats ATS service | ||
28 | * Bandwidth allocation for transport service | ||
29 | * | ||
30 | * @see [Documentation](https://gnunet.org/ats-subsystem) | ||
31 | * | ||
32 | * @{ | ||
33 | */ | ||
34 | #ifndef GNUNET_ATS_TRANSPORT_SERVICE_H | ||
35 | #define GNUNET_ATS_TRANSPORT_SERVICE_H | ||
36 | |||
37 | |||
38 | #include "gnunet_constants.h" | ||
39 | #include "gnunet_util_lib.h" | ||
40 | #include "gnunet_nt_lib.h" | ||
41 | #include "gnunet_transport_communication_service.h" | ||
42 | |||
43 | |||
44 | /** | ||
45 | * ATS performance characteristics for a session. | ||
46 | */ | ||
47 | struct GNUNET_ATS_Properties | ||
48 | { | ||
49 | /** | ||
50 | * Delay. Time between when the time packet is sent and the packet | ||
51 | * arrives. FOREVER if we did not (successfully) measure yet. | ||
52 | */ | ||
53 | struct GNUNET_TIME_Relative delay; | ||
54 | |||
55 | /** | ||
56 | * Confirmed successful payload on this connection from this peer to | ||
57 | * the other peer. | ||
58 | * | ||
59 | * Unit: [bytes/second] | ||
60 | */ | ||
61 | uint32_t goodput_out; | ||
62 | |||
63 | /** | ||
64 | * Confirmed useful payload on this connection to this peer from | ||
65 | * the other peer. | ||
66 | * | ||
67 | * Unit: [bytes/second] | ||
68 | */ | ||
69 | uint32_t goodput_in; | ||
70 | |||
71 | /** | ||
72 | * Actual traffic on this connection from this peer to the other peer. | ||
73 | * Includes transport overhead. | ||
74 | * | ||
75 | * Unit: [bytes/second] | ||
76 | */ | ||
77 | uint32_t utilization_out; | ||
78 | |||
79 | /** | ||
80 | * Actual traffic on this connection from the other peer to this peer. | ||
81 | * Includes transport overhead. | ||
82 | * | ||
83 | * Unit: [bytes/second] | ||
84 | */ | ||
85 | uint32_t utilization_in; | ||
86 | |||
87 | /** | ||
88 | * Distance on network layer (required for distance-vector routing) | ||
89 | * in hops. Zero for direct connections (e.g. plain TCP/UDP). | ||
90 | */ | ||
91 | uint32_t distance; | ||
92 | |||
93 | /** | ||
94 | * MTU of the network layer, UINT32_MAX for no MTU (stream). | ||
95 | * | ||
96 | * Unit: [bytes] | ||
97 | */ | ||
98 | uint32_t mtu; | ||
99 | |||
100 | /** | ||
101 | * Which network scope does the respective address belong to? | ||
102 | */ | ||
103 | enum GNUNET_NetworkType nt; | ||
104 | |||
105 | /** | ||
106 | * What characteristics does this communicator have? | ||
107 | */ | ||
108 | enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc; | ||
109 | }; | ||
110 | |||
111 | |||
112 | /* ******************************** Transport API ***************************** */ | ||
113 | |||
114 | /** | ||
115 | * Handle to the ATS subsystem for bandwidth/transport transport information. | ||
116 | */ | ||
117 | struct GNUNET_ATS_TransportHandle; | ||
118 | |||
119 | /** | ||
120 | * Opaque session handle, to be defined by transport. Contents not known to ATS. | ||
121 | */ | ||
122 | struct GNUNET_ATS_Session; | ||
123 | |||
124 | |||
125 | /** | ||
126 | * Signature of a function called by ATS with the current bandwidth | ||
127 | * allocation to be used as determined by ATS. | ||
128 | * | ||
129 | * @param cls closure | ||
130 | * @param session session this is about | ||
131 | * @param bandwidth_out assigned outbound bandwidth for the connection, | ||
132 | * 0 to signal disconnect | ||
133 | * @param bandwidth_in assigned inbound bandwidth for the connection, | ||
134 | * 0 to signal disconnect | ||
135 | */ | ||
136 | typedef void | ||
137 | (*GNUNET_ATS_AllocationCallback) (void *cls, | ||
138 | struct GNUNET_ATS_Session *session, | ||
139 | struct GNUNET_BANDWIDTH_Value32NBO | ||
140 | bandwidth_out, | ||
141 | struct GNUNET_BANDWIDTH_Value32NBO | ||
142 | bandwidth_in); | ||
143 | |||
144 | |||
145 | /** | ||
146 | * Signature of a function called by ATS suggesting transport to | ||
147 | * try connecting with a particular address. | ||
148 | * | ||
149 | * @param cls closure | ||
150 | * @param pid target peer | ||
151 | * @param address the address to try | ||
152 | */ | ||
153 | typedef void | ||
154 | (*GNUNET_ATS_SuggestionCallback) (void *cls, | ||
155 | const struct GNUNET_PeerIdentity *pid, | ||
156 | const char *address); | ||
157 | |||
158 | |||
159 | /** | ||
160 | * Initialize the ATS transport subsystem. | ||
161 | * | ||
162 | * @param cfg configuration to use | ||
163 | * @param alloc_cb notification to call whenever the allocation changed | ||
164 | * @param alloc_cb_cls closure for @a alloc_cb | ||
165 | * @param suggest_cb notification to call whenever the suggestation is made | ||
166 | * @param suggest_cb_cls closure for @a suggest_cb | ||
167 | * @return ats context | ||
168 | */ | ||
169 | struct GNUNET_ATS_TransportHandle * | ||
170 | GNUNET_ATS_transport_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
171 | GNUNET_ATS_AllocationCallback alloc_cb, | ||
172 | void *alloc_cb_cls, | ||
173 | GNUNET_ATS_SuggestionCallback suggest_cb, | ||
174 | void *suggest_cb_cls) __attribute__((deprecated)); | ||
175 | |||
176 | |||
177 | /** | ||
178 | * Client is done with ATS transport, release resources. | ||
179 | * | ||
180 | * @param ath handle to release | ||
181 | */ | ||
182 | void | ||
183 | GNUNET_ATS_transport_done (struct | ||
184 | GNUNET_ATS_TransportHandle *ath) __attribute__( | ||
185 | (deprecated)); | ||
186 | |||
187 | |||
188 | /** | ||
189 | * Handle used within ATS to track an session. | ||
190 | */ | ||
191 | struct GNUNET_ATS_SessionRecord; | ||
192 | |||
193 | |||
194 | /** | ||
195 | * We have a new session ATS should know. Sessiones have to be added with this | ||
196 | * function before they can be: updated, set in use and destroyed | ||
197 | * | ||
198 | * @param ath handle | ||
199 | * @param pid peer we connected to | ||
200 | * @param address the address (human readable version), | ||
201 | * @param session transport-internal handle for the session/queue, NULL if | ||
202 | * the session is inbound-only | ||
203 | * @param prop performance data for the session | ||
204 | * @return handle to the session representation inside ATS, NULL | ||
205 | * on error (i.e. ATS knows this exact session already, or | ||
206 | * session is invalid) | ||
207 | */ | ||
208 | struct GNUNET_ATS_SessionRecord * | ||
209 | GNUNET_ATS_session_add (struct GNUNET_ATS_TransportHandle *ath, | ||
210 | const struct GNUNET_PeerIdentity *pid, | ||
211 | const char *address, | ||
212 | struct GNUNET_ATS_Session *session, | ||
213 | const struct GNUNET_ATS_Properties *prop) __attribute__( | ||
214 | (deprecated)); | ||
215 | |||
216 | |||
217 | /** | ||
218 | * We have updated performance statistics for a given session. Based | ||
219 | * on the information provided, ATS may update bandwidth assignments. | ||
220 | * | ||
221 | * @param ar session record to update information for | ||
222 | * @param prop performance data for the session | ||
223 | */ | ||
224 | void | ||
225 | GNUNET_ATS_session_update (struct GNUNET_ATS_SessionRecord *ar, | ||
226 | const struct | ||
227 | GNUNET_ATS_Properties *prop) __attribute__( | ||
228 | (deprecated)); | ||
229 | |||
230 | |||
231 | /** | ||
232 | * A session was destroyed, ATS should now schedule and | ||
233 | * allocate under the assumption that this @a ar is no | ||
234 | * longer in use. | ||
235 | * | ||
236 | * @param ar session record to drop | ||
237 | */ | ||
238 | void | ||
239 | GNUNET_ATS_session_del (struct GNUNET_ATS_SessionRecord *ar) __attribute__( | ||
240 | (deprecated)); | ||
241 | |||
242 | |||
243 | #endif | ||
244 | |||
245 | /** @} */ /* end of group */ | ||
246 | |||
247 | /* end of file gnunet-service-transport_ats.h */ | ||