aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_ats_transport_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-29 20:50:38 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-29 20:52:11 +0100
commit333ed5b94540b68b9967885c215b57818f22fb79 (patch)
tree2a15a47d8b7a6c60ad4ddc0de7cbe3e1c1bc7426 /src/include/gnunet_ats_transport_service.h
parent94771c8ff4a7dc75b7f26b2795b5ed1f0c1f791b (diff)
downloadgnunet-333ed5b94540b68b9967885c215b57818f22fb79.tar.gz
gnunet-333ed5b94540b68b9967885c215b57818f22fb79.zip
draft ATS API for TNG
Diffstat (limited to 'src/include/gnunet_ats_transport_service.h')
-rw-r--r--src/include/gnunet_ats_transport_service.h62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/include/gnunet_ats_transport_service.h b/src/include/gnunet_ats_transport_service.h
index b069f8b24..b55c6a374 100644
--- a/src/include/gnunet_ats_transport_service.h
+++ b/src/include/gnunet_ats_transport_service.h
@@ -108,12 +108,12 @@ struct GNUNET_ATS_Properties
108}; 108};
109 109
110 110
111/* ******************************** Scheduling API ***************************** */ 111/* ******************************** Transport API ***************************** */
112 112
113/** 113/**
114 * Handle to the ATS subsystem for bandwidth/transport scheduling information. 114 * Handle to the ATS subsystem for bandwidth/transport transport information.
115 */ 115 */
116struct GNUNET_ATS_SchedulingHandle; 116struct GNUNET_ATS_TransportHandle;
117 117
118/** 118/**
119 * Opaque session handle, to be defined by transport. Contents not known to ATS. 119 * Opaque session handle, to be defined by transport. Contents not known to ATS.
@@ -154,7 +154,7 @@ typedef void
154 154
155 155
156/** 156/**
157 * Initialize the ATS scheduling subsystem. 157 * Initialize the ATS transport subsystem.
158 * 158 *
159 * @param cfg configuration to use 159 * @param cfg configuration to use
160 * @param alloc_cb notification to call whenever the allocation changed 160 * @param alloc_cb notification to call whenever the allocation changed
@@ -163,45 +163,45 @@ typedef void
163 * @param suggest_cb_cls closure for @a suggest_cb 163 * @param suggest_cb_cls closure for @a suggest_cb
164 * @return ats context 164 * @return ats context
165 */ 165 */
166struct GNUNET_ATS_SchedulingHandle * 166struct GNUNET_ATS_TransportHandle *
167GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, 167GNUNET_ATS_transport_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
168 GNUNET_ATS_AllocationCallback alloc_cb, 168 GNUNET_ATS_AllocationCallback alloc_cb,
169 void *alloc_cb_cls); 169 void *alloc_cb_cls,
170 GNUNET_ATS_SuggestionCallback suggest_cb, 170 GNUNET_ATS_SuggestionCallback suggest_cb,
171 void *suggest_cb_cls); 171 void *suggest_cb_cls);
172 172
173 173
174/** 174/**
175 * Client is done with ATS scheduling, release resources. 175 * Client is done with ATS transport, release resources.
176 * 176 *
177 * @param sh handle to release 177 * @param ath handle to release
178 */ 178 */
179void 179void
180GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh); 180GNUNET_ATS_transport_done (struct GNUNET_ATS_TransportHandle *ath);
181 181
182 182
183/** 183/**
184 * Handle used within ATS to track an address. 184 * Handle used within ATS to track an session.
185 */ 185 */
186struct GNUNET_ATS_AddressRecord; 186struct GNUNET_ATS_SessionRecord;
187 187
188 188
189/** 189/**
190 * We have a new address ATS should know. Addresses have to be added with this 190 * We have a new session ATS should know. Sessiones have to be added with this
191 * function before they can be: updated, set in use and destroyed 191 * function before they can be: updated, set in use and destroyed
192 * 192 *
193 * @param sh handle 193 * @param ath handle
194 * @param pid peer we connected to 194 * @param pid peer we connected to
195 * @param address the address (human readable version), NULL if 195 * @param address the address (human readable version),
196 * @param session transport-internal handle for the session/queue, NULL if
196 * the session is inbound-only 197 * the session is inbound-only
197 * @param session transport-internal handle for the address/queue 198 * @param prop performance data for the session
198 * @param prop performance data for the address 199 * @return handle to the session representation inside ATS, NULL
199 * @return handle to the address representation inside ATS, NULL 200 * on error (i.e. ATS knows this exact session already, or
200 * on error (i.e. ATS knows this exact address already, or 201 * session is invalid)
201 * address is invalid)
202 */ 202 */
203struct GNUNET_ATS_AddressRecord * 203struct GNUNET_ATS_SessionRecord *
204GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, 204GNUNET_ATS_session_add (struct GNUNET_ATS_TransportHandle *ath,
205 const struct GNUNET_PeerIdentity *pid, 205 const struct GNUNET_PeerIdentity *pid,
206 const char *address, 206 const char *address,
207 struct GNUNET_ATS_Session *session, 207 struct GNUNET_ATS_Session *session,
@@ -209,14 +209,14 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
209 209
210 210
211/** 211/**
212 * We have updated performance statistics for a given address. Based 212 * We have updated performance statistics for a given session. Based
213 * on the information provided, ATS may update bandwidth assignments. 213 * on the information provided, ATS may update bandwidth assignments.
214 * 214 *
215 * @param ar address record to update information for 215 * @param ar session record to update information for
216 * @param prop performance data for the address 216 * @param prop performance data for the session
217 */ 217 */
218void 218void
219GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar, 219GNUNET_ATS_session_update (struct GNUNET_ATS_SessionRecord *ar,
220 const struct GNUNET_ATS_Properties *prop); 220 const struct GNUNET_ATS_Properties *prop);
221 221
222 222
@@ -225,10 +225,10 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar,
225 * allocate under the assumption that this @a ar is no 225 * allocate under the assumption that this @a ar is no
226 * longer in use. 226 * longer in use.
227 * 227 *
228 * @param ar address record to drop 228 * @param ar session record to drop
229 */ 229 */
230void 230void
231GNUNET_ATS_address_del (struct GNUNET_ATS_AddressRecord *ar); 231GNUNET_ATS_session_del (struct GNUNET_ATS_SessionRecord *ar);
232 232
233 233
234#endif 234#endif