diff options
Diffstat (limited to 'src/include/gnunet_mesh_service_new.h')
-rw-r--r-- | src/include/gnunet_mesh_service_new.h | 90 |
1 files changed, 36 insertions, 54 deletions
diff --git a/src/include/gnunet_mesh_service_new.h b/src/include/gnunet_mesh_service_new.h index 89b1c881e..83addfce5 100644 --- a/src/include/gnunet_mesh_service_new.h +++ b/src/include/gnunet_mesh_service_new.h | |||
@@ -140,17 +140,11 @@ typedef uint32_t GNUNET_MESH_ApplicationType; | |||
140 | * @return handle to the mesh service NULL on error | 140 | * @return handle to the mesh service NULL on error |
141 | * (in this case, init is never called) | 141 | * (in this case, init is never called) |
142 | */ | 142 | */ |
143 | struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | 143 | struct GNUNET_MESH_Handle * |
144 | GNUNET_CONFIGURATION_Handle | 144 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, |
145 | *cfg, void *cls, | 145 | GNUNET_MESH_TunnelEndHandler cleaner, |
146 | GNUNET_MESH_TunnelEndHandler | 146 | const struct GNUNET_MESH_MessageHandler *handlers, |
147 | cleaner, | 147 | const GNUNET_MESH_ApplicationType *stypes); |
148 | const struct | ||
149 | GNUNET_MESH_MessageHandler | ||
150 | *handlers, | ||
151 | const | ||
152 | GNUNET_MESH_ApplicationType | ||
153 | *stypes); | ||
154 | 148 | ||
155 | 149 | ||
156 | /** | 150 | /** |
@@ -158,7 +152,8 @@ struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | |||
158 | * | 152 | * |
159 | * @param handle connection to mesh to disconnect | 153 | * @param handle connection to mesh to disconnect |
160 | */ | 154 | */ |
161 | void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | 155 | void |
156 | GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | ||
162 | 157 | ||
163 | 158 | ||
164 | /** | 159 | /** |
@@ -198,20 +193,19 @@ typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls, | |||
198 | * @param disconnect_handler function to call when peers are disconnected | 193 | * @param disconnect_handler function to call when peers are disconnected |
199 | * @param handler_cls closure for connect/disconnect handlers | 194 | * @param handler_cls closure for connect/disconnect handlers |
200 | */ | 195 | */ |
201 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle | 196 | struct GNUNET_MESH_Tunnel * |
202 | *h, | 197 | GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, |
203 | GNUNET_MESH_TunnelConnectHandler | 198 | GNUNET_MESH_TunnelConnectHandler connect_handler, |
204 | connect_handler, | 199 | GNUNET_MESH_TunnelDisconnectHandler |
205 | GNUNET_MESH_TunnelDisconnectHandler | 200 | disconnect_handler, void *handler_cls); |
206 | disconnect_handler, | ||
207 | void *handler_cls); | ||
208 | 201 | ||
209 | /** | 202 | /** |
210 | * Destroy an existing tunnel. | 203 | * Destroy an existing tunnel. |
211 | * | 204 | * |
212 | * @param tun tunnel handle | 205 | * @param tun tunnel handle |
213 | */ | 206 | */ |
214 | void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | 207 | void |
208 | GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | ||
215 | 209 | ||
216 | 210 | ||
217 | /** | 211 | /** |
@@ -222,10 +216,10 @@ void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | |||
222 | * @param timeout how long to try to establish a connection | 216 | * @param timeout how long to try to establish a connection |
223 | * @param peer peer to add | 217 | * @param peer peer to add |
224 | */ | 218 | */ |
225 | void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | 219 | void |
226 | struct GNUNET_TIME_Relative timeout, | 220 | GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, |
227 | const struct GNUNET_PeerIdentity | 221 | struct GNUNET_TIME_Relative timeout, |
228 | *peer); | 222 | const struct GNUNET_PeerIdentity *peer); |
229 | 223 | ||
230 | 224 | ||
231 | /** | 225 | /** |
@@ -235,9 +229,9 @@ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | |||
235 | * @param tunnel handle to existing tunnel | 229 | * @param tunnel handle to existing tunnel |
236 | * @param peer peer to remove | 230 | * @param peer peer to remove |
237 | */ | 231 | */ |
238 | void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | 232 | void |
239 | const struct GNUNET_PeerIdentity | 233 | GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, |
240 | *peer); | 234 | const struct GNUNET_PeerIdentity *peer); |
241 | 235 | ||
242 | 236 | ||
243 | /** | 237 | /** |
@@ -249,12 +243,10 @@ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | |||
249 | * @param app_type application type that must be supported by the peer | 243 | * @param app_type application type that must be supported by the peer |
250 | * (MESH should discover peer in proximity handling this type) | 244 | * (MESH should discover peer in proximity handling this type) |
251 | */ | 245 | */ |
252 | void GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel | 246 | void |
253 | *tunnel, | 247 | GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel, |
254 | struct GNUNET_TIME_Relative | 248 | struct GNUNET_TIME_Relative timeout, |
255 | timeout, | 249 | GNUNET_MESH_ApplicationType app_type); |
256 | GNUNET_MESH_ApplicationType | ||
257 | app_type); | ||
258 | 250 | ||
259 | 251 | ||
260 | /** | 252 | /** |
@@ -283,25 +275,14 @@ struct GNUNET_MESH_TransmitHandle; | |||
283 | * NULL if we can not even queue the request (insufficient | 275 | * NULL if we can not even queue the request (insufficient |
284 | * memory); if NULL is returned, "notify" will NOT be called. | 276 | * memory); if NULL is returned, "notify" will NOT be called. |
285 | */ | 277 | */ |
286 | struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | 278 | struct GNUNET_MESH_TransmitHandle * |
287 | GNUNET_MESH_Tunnel | 279 | GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork, |
288 | *tunnel, | 280 | uint32_t priority, |
289 | int cork, | 281 | struct GNUNET_TIME_Relative maxdelay, |
290 | uint32_t | 282 | const struct GNUNET_PeerIdentity *target, |
291 | priority, | 283 | size_t notify_size, |
292 | struct | 284 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
293 | GNUNET_TIME_Relative | 285 | void *notify_cls); |
294 | maxdelay, | ||
295 | const | ||
296 | struct | ||
297 | GNUNET_PeerIdentity | ||
298 | *target, | ||
299 | size_t | ||
300 | notify_size, | ||
301 | GNUNET_CONNECTION_TransmitReadyNotify | ||
302 | notify, | ||
303 | void | ||
304 | *notify_cls); | ||
305 | 286 | ||
306 | 287 | ||
307 | /** | 288 | /** |
@@ -309,8 +290,9 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | |||
309 | * | 290 | * |
310 | * @param th handle that was returned by "notify_transmit_ready". | 291 | * @param th handle that was returned by "notify_transmit_ready". |
311 | */ | 292 | */ |
312 | void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | 293 | void |
313 | *th); | 294 | GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle |
295 | *th); | ||
314 | 296 | ||
315 | 297 | ||
316 | #if 0 /* keep Emacsens' auto-indent happy */ | 298 | #if 0 /* keep Emacsens' auto-indent happy */ |