aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_ats_application_service.h27
-rw-r--r--src/include/gnunet_ats_transport_service.h62
-rw-r--r--src/include/gnunet_crypto_lib.h2
-rw-r--r--src/include/gnunet_protocols.h50
-rw-r--r--src/include/gnunet_transport_communication_service.h1
5 files changed, 95 insertions, 47 deletions
diff --git a/src/include/gnunet_ats_application_service.h b/src/include/gnunet_ats_application_service.h
index af92d5639..60560790a 100644
--- a/src/include/gnunet_ats_application_service.h
+++ b/src/include/gnunet_ats_application_service.h
@@ -39,32 +39,32 @@
39 * Handle to the ATS subsystem for making suggestions about 39 * Handle to the ATS subsystem for making suggestions about
40 * connections the peer would like to have. 40 * connections the peer would like to have.
41 */ 41 */
42struct GNUNET_ATS_ConnectivityHandle; 42struct GNUNET_ATS_ApplicationHandle;
43 43
44 44
45/** 45/**
46 * Initialize the ATS connectivity suggestion client handle. 46 * Initialize the ATS application client handle.
47 * 47 *
48 * @param cfg configuration to use 48 * @param cfg configuration to use
49 * @return ats connectivity handle, NULL on error 49 * @return ats application handle, NULL on error
50 */ 50 */
51struct GNUNET_ATS_ConnectivityHandle * 51struct GNUNET_ATS_ApplicationHandle *
52GNUNET_ATS_connectivity_init (const struct GNUNET_CONFIGURATION_Handle *cfg); 52GNUNET_ATS_application_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
53 53
54 54
55/** 55/**
56 * Shutdown ATS connectivity suggestion client. 56 * Shutdown ATS application client.
57 * 57 *
58 * @param ch handle to destroy 58 * @param ch handle to destroy
59 */ 59 */
60void 60void
61GNUNET_ATS_connectivity_done (struct GNUNET_ATS_ConnectivityHandle *ch); 61GNUNET_ATS_application_done (struct GNUNET_ATS_ApplicationHandle *ch);
62 62
63 63
64/** 64/**
65 * Handle for address suggestion requests. 65 * Handle for suggestion requests.
66 */ 66 */
67struct GNUNET_ATS_ConnectivitySuggestHandle; 67struct GNUNET_ATS_ApplicationSuggestHandle;
68 68
69 69
70/** 70/**
@@ -74,13 +74,13 @@ struct GNUNET_ATS_ConnectivitySuggestHandle;
74 * 74 *
75 * @param ch handle 75 * @param ch handle
76 * @param peer identity of the peer we need an address for 76 * @param peer identity of the peer we need an address for
77 * @param pk what kind of connectivity will the application require (can be 77 * @param pk what kind of application will the application require (can be
78 * #GNUNET_MQ_PREFERENCE_NONE, we will still try to connect) 78 * #GNUNET_MQ_PREFERENCE_NONE, we will still try to connect)
79 * @param bw desired bandwith, can be zero (we will still try to connect) 79 * @param bw desired bandwith, can be zero (we will still try to connect)
80 * @return suggestion handle, NULL if request is already pending 80 * @return suggestion handle, NULL if request is already pending
81 */ 81 */
82struct GNUNET_ATS_ConnectivitySuggestHandle * 82struct GNUNET_ATS_ApplicationSuggestHandle *
83GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch, 83GNUNET_ATS_application_suggest (struct GNUNET_ATS_ApplicationHandle *ch,
84 const struct GNUNET_PeerIdentity *peer, 84 const struct GNUNET_PeerIdentity *peer,
85 enum GNUNET_MQ_PreferenceKind pk, 85 enum GNUNET_MQ_PreferenceKind pk,
86 struct GNUNET_BANDWIDTH_Value32NBO bw); 86 struct GNUNET_BANDWIDTH_Value32NBO bw);
@@ -92,8 +92,9 @@ GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch,
92 * @param sh handle 92 * @param sh handle
93 */ 93 */
94void 94void
95GNUNET_ATS_connectivity_suggest_cancel (struct GNUNET_ATS_ConnectivitySuggestHandle *sh); 95GNUNET_ATS_application_suggest_cancel (struct GNUNET_ATS_ApplicationSuggestHandle *sh);
96 96
97/** @} */ /* end of group */ 97/** @} */ /* end of group */
98 98
99#endif
99/* end of file gnunet_ats_application_service.h */ 100/* end of file gnunet_ats_application_service.h */
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
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 8a591fa09..1c69646f3 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 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/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 6f3b886d8..c82b11762 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -3095,9 +3095,57 @@ extern "C"
3095#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_END 1252 3095#define GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_END 1252
3096 3096
3097 3097
3098/* ************** NEW (NG) ATS Messages ************* */
3099
3100/**
3101 * Type of the 'struct ExpressPreferenceMessage' send by clients to ATS
3102 * to establish bandwidth preference.
3103 */
3104#define GNUNET_MESSAGE_TYPE_ATS_SUGGEST 1400
3105
3098/** 3106/**
3099 * Next available: 1400 3107 * Type of the 'struct ExpressPreferenceMessage' send by clients to ATS
3108 * to abandon bandwidth preference.
3100 */ 3109 */
3110#define GNUNET_MESSAGE_TYPE_ATS_SUGGEST_CANCEL 1401
3111
3112
3113/**
3114 * Type of the 'struct SessionAddMessage' send by transport clients to ATS
3115 * to ask ATS to allocate resources to a session.
3116 */
3117#define GNUNET_MESSAGE_TYPE_ATS_SESSION_ADD 1402
3118
3119/**
3120 * Type of the 'struct SessionAddMessage' send by transport clients to ATS
3121 * to inform ATS about a session where resources are consumed but allocation
3122 * is impossible (unidirectional).
3123 */
3124#define GNUNET_MESSAGE_TYPE_ATS_SESSION_ADD_INBOUND_ONLY 1403
3125
3126/**
3127 * Type of the 'struct SessionUpdateMessage' send by transport clients to ATS
3128 * to inform ATS about property changes of a session.
3129 */
3130#define GNUNET_MESSAGE_TYPE_ATS_SESSION_UPDATE 1404
3131
3132/**
3133 * Type of the 'struct SessionDelMessage' send by transport clients to ATS
3134 * to tell ATS that a session is no longer available.
3135 */
3136#define GNUNET_MESSAGE_TYPE_ATS_SESSION_DEL 1405
3137
3138/**
3139 * Type of the 'struct SessionAllocationMessage' send by ATS to the
3140 * transport to tell it about resources to allocate to the session.
3141 */
3142#define GNUNET_MESSAGE_TYPE_ATS_SESSION_ALLOCATION 1406
3143
3144
3145/**
3146 * Next available: 1450
3147 */
3148
3101 3149
3102 3150
3103/** 3151/**
diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h
index 1d0add99f..8a0f0fcd5 100644
--- a/src/include/gnunet_transport_communication_service.h
+++ b/src/include/gnunet_transport_communication_service.h
@@ -42,7 +42,6 @@ extern "C"
42#endif 42#endif
43 43
44#include "gnunet_util_lib.h" 44#include "gnunet_util_lib.h"
45#include "gnunet_ats_service.h"
46 45
47/** 46/**
48 * Version number of the transport communication API. 47 * Version number of the transport communication API.