diff options
Diffstat (limited to 'src/include/gnunet_cadet_service.h')
-rw-r--r-- | src/include/gnunet_cadet_service.h | 108 |
1 files changed, 58 insertions, 50 deletions
diff --git a/src/include/gnunet_cadet_service.h b/src/include/gnunet_cadet_service.h index dccc51464..93c8aabb8 100644 --- a/src/include/gnunet_cadet_service.h +++ b/src/include/gnunet_cadet_service.h | |||
@@ -70,7 +70,8 @@ struct GNUNET_CADET_Port; | |||
70 | /** | 70 | /** |
71 | * Hash uniquely identifying a connection below a tunnel. | 71 | * Hash uniquely identifying a connection below a tunnel. |
72 | */ | 72 | */ |
73 | struct GNUNET_CADET_ConnectionTunnelIdentifier { | 73 | struct GNUNET_CADET_ConnectionTunnelIdentifier |
74 | { | ||
74 | struct GNUNET_ShortHashCode connection_of_tunnel; | 75 | struct GNUNET_ShortHashCode connection_of_tunnel; |
75 | }; | 76 | }; |
76 | 77 | ||
@@ -78,7 +79,8 @@ struct GNUNET_CADET_ConnectionTunnelIdentifier { | |||
78 | /** | 79 | /** |
79 | * Number identifying a CADET channel within a tunnel. | 80 | * Number identifying a CADET channel within a tunnel. |
80 | */ | 81 | */ |
81 | struct GNUNET_CADET_ChannelTunnelNumber { | 82 | struct GNUNET_CADET_ChannelTunnelNumber |
83 | { | ||
82 | /** | 84 | /** |
83 | * Which number does this channel have that uniquely identfies | 85 | * Which number does this channel have that uniquely identfies |
84 | * it within its tunnel, in network byte order. | 86 | * it within its tunnel, in network byte order. |
@@ -152,7 +154,7 @@ typedef void (*GNUNET_CADET_WindowSizeEventHandler) ( | |||
152 | * @return Handle to the cadet service NULL on error. | 154 | * @return Handle to the cadet service NULL on error. |
153 | */ | 155 | */ |
154 | struct GNUNET_CADET_Handle * | 156 | struct GNUNET_CADET_Handle * |
155 | GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); | 157 | GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
156 | 158 | ||
157 | 159 | ||
158 | /** | 160 | /** |
@@ -164,7 +166,7 @@ GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
164 | * @param handle connection to cadet to disconnect | 166 | * @param handle connection to cadet to disconnect |
165 | */ | 167 | */ |
166 | void | 168 | void |
167 | GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle); | 169 | GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle); |
168 | 170 | ||
169 | 171 | ||
170 | /** | 172 | /** |
@@ -181,13 +183,13 @@ GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle); | |||
181 | * @return Port handle, NULL if port is in use | 183 | * @return Port handle, NULL if port is in use |
182 | */ | 184 | */ |
183 | struct GNUNET_CADET_Port * | 185 | struct GNUNET_CADET_Port * |
184 | GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, | 186 | GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h, |
185 | const struct GNUNET_HashCode *port, | 187 | const struct GNUNET_HashCode *port, |
186 | GNUNET_CADET_ConnectEventHandler connects, | 188 | GNUNET_CADET_ConnectEventHandler connects, |
187 | void *connects_cls, | 189 | void *connects_cls, |
188 | GNUNET_CADET_WindowSizeEventHandler window_changes, | 190 | GNUNET_CADET_WindowSizeEventHandler window_changes, |
189 | GNUNET_CADET_DisconnectEventHandler disconnects, | 191 | GNUNET_CADET_DisconnectEventHandler disconnects, |
190 | const struct GNUNET_MQ_MessageHandler *handlers); | 192 | const struct GNUNET_MQ_MessageHandler *handlers); |
191 | 193 | ||
192 | 194 | ||
193 | /** | 195 | /** |
@@ -197,7 +199,7 @@ GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, | |||
197 | * @param p Port handle. | 199 | * @param p Port handle. |
198 | */ | 200 | */ |
199 | void | 201 | void |
200 | GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p); | 202 | GNUNET_CADET_close_port (struct GNUNET_CADET_Port *p); |
201 | 203 | ||
202 | 204 | ||
203 | /** | 205 | /** |
@@ -221,13 +223,13 @@ GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p); | |||
221 | * @return Handle to the channel. | 223 | * @return Handle to the channel. |
222 | */ | 224 | */ |
223 | struct GNUNET_CADET_Channel * | 225 | struct GNUNET_CADET_Channel * |
224 | GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h, | 226 | GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h, |
225 | void *channel_cls, | 227 | void *channel_cls, |
226 | const struct GNUNET_PeerIdentity *destination, | 228 | const struct GNUNET_PeerIdentity *destination, |
227 | const struct GNUNET_HashCode *port, | 229 | const struct GNUNET_HashCode *port, |
228 | GNUNET_CADET_WindowSizeEventHandler window_changes, | 230 | GNUNET_CADET_WindowSizeEventHandler window_changes, |
229 | GNUNET_CADET_DisconnectEventHandler disconnects, | 231 | GNUNET_CADET_DisconnectEventHandler disconnects, |
230 | const struct GNUNET_MQ_MessageHandler *handlers); | 232 | const struct GNUNET_MQ_MessageHandler *handlers); |
231 | 233 | ||
232 | 234 | ||
233 | /** | 235 | /** |
@@ -240,7 +242,7 @@ GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h, | |||
240 | * @param channel Channel handle, becomes invalid after this call. | 242 | * @param channel Channel handle, becomes invalid after this call. |
241 | */ | 243 | */ |
242 | void | 244 | void |
243 | GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel); | 245 | GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel); |
244 | 246 | ||
245 | 247 | ||
246 | /** | 248 | /** |
@@ -250,7 +252,7 @@ GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel); | |||
250 | * @return The message queue of the channel. | 252 | * @return The message queue of the channel. |
251 | */ | 253 | */ |
252 | struct GNUNET_MQ_Handle * | 254 | struct GNUNET_MQ_Handle * |
253 | GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel); | 255 | GNUNET_CADET_get_mq (const struct GNUNET_CADET_Channel *channel); |
254 | 256 | ||
255 | 257 | ||
256 | /** | 258 | /** |
@@ -261,7 +263,7 @@ GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel); | |||
261 | * @param channel Channel that will be allowed to call another handler. | 263 | * @param channel Channel that will be allowed to call another handler. |
262 | */ | 264 | */ |
263 | void | 265 | void |
264 | GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel); | 266 | GNUNET_CADET_receive_done (struct GNUNET_CADET_Channel *channel); |
265 | 267 | ||
266 | 268 | ||
267 | /** | 269 | /** |
@@ -274,9 +276,10 @@ GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel); | |||
274 | * @return A GNUNET_HashCode usable for the new CADET API. | 276 | * @return A GNUNET_HashCode usable for the new CADET API. |
275 | */ | 277 | */ |
276 | const struct GNUNET_HashCode * | 278 | const struct GNUNET_HashCode * |
277 | GC_u2h(uint32_t port); | 279 | GC_u2h (uint32_t port); |
278 | 280 | ||
279 | enum GNUNET_CADET_ChannelInfoOption { | 281 | enum GNUNET_CADET_ChannelInfoOption |
282 | { | ||
280 | /** | 283 | /** |
281 | * Who is the peer at the other end of the channel. | 284 | * Who is the peer at the other end of the channel. |
282 | * Only for use in @c GNUNET_CADET_channel_get_info | 285 | * Only for use in @c GNUNET_CADET_channel_get_info |
@@ -288,7 +291,8 @@ enum GNUNET_CADET_ChannelInfoOption { | |||
288 | /** | 291 | /** |
289 | * Union to retrieve info about a channel. | 292 | * Union to retrieve info about a channel. |
290 | */ | 293 | */ |
291 | union GNUNET_CADET_ChannelInfo { | 294 | union GNUNET_CADET_ChannelInfo |
295 | { | ||
292 | /** | 296 | /** |
293 | * #GNUNET_YES / #GNUNET_NO, for binary flags. | 297 | * #GNUNET_YES / #GNUNET_NO, for binary flags. |
294 | */ | 298 | */ |
@@ -309,9 +313,9 @@ union GNUNET_CADET_ChannelInfo { | |||
309 | * @return Union with an answer to the query. | 313 | * @return Union with an answer to the query. |
310 | */ | 314 | */ |
311 | const union GNUNET_CADET_ChannelInfo * | 315 | const union GNUNET_CADET_ChannelInfo * |
312 | GNUNET_CADET_channel_get_info(struct GNUNET_CADET_Channel *channel, | 316 | GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, |
313 | enum GNUNET_CADET_ChannelInfoOption option, | 317 | enum GNUNET_CADET_ChannelInfoOption option, |
314 | ...); | 318 | ...); |
315 | 319 | ||
316 | 320 | ||
317 | /******************************************************************************/ | 321 | /******************************************************************************/ |
@@ -328,7 +332,8 @@ GNUNET_CADET_channel_get_info(struct GNUNET_CADET_Channel *channel, | |||
328 | /** | 332 | /** |
329 | * Internal details about a channel. | 333 | * Internal details about a channel. |
330 | */ | 334 | */ |
331 | struct GNUNET_CADET_ChannelInternals { | 335 | struct GNUNET_CADET_ChannelInternals |
336 | { | ||
332 | /** | 337 | /** |
333 | * Root of the channel | 338 | * Root of the channel |
334 | */ | 339 | */ |
@@ -370,10 +375,10 @@ struct GNUNET_CADET_ChannelMonitor; | |||
370 | * @param callback_cls Closure for @c callback. | 375 | * @param callback_cls Closure for @c callback. |
371 | */ | 376 | */ |
372 | struct GNUNET_CADET_ChannelMonitor * | 377 | struct GNUNET_CADET_ChannelMonitor * |
373 | GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, | 378 | GNUNET_CADET_get_channel (const struct GNUNET_CONFIGURATION_Handle *cfg, |
374 | struct GNUNET_PeerIdentity *peer, | 379 | struct GNUNET_PeerIdentity *peer, |
375 | GNUNET_CADET_ChannelCB callback, | 380 | GNUNET_CADET_ChannelCB callback, |
376 | void *callback_cls); | 381 | void *callback_cls); |
377 | 382 | ||
378 | 383 | ||
379 | /** | 384 | /** |
@@ -383,13 +388,14 @@ GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
383 | * @return Closure that was given to #GNUNET_CADET_get_channel(). | 388 | * @return Closure that was given to #GNUNET_CADET_get_channel(). |
384 | */ | 389 | */ |
385 | void * | 390 | void * |
386 | GNUNET_CADET_get_channel_cancel(struct GNUNET_CADET_ChannelMonitor *cm); | 391 | GNUNET_CADET_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm); |
387 | 392 | ||
388 | 393 | ||
389 | /** | 394 | /** |
390 | * Information we return per peer. | 395 | * Information we return per peer. |
391 | */ | 396 | */ |
392 | struct GNUNET_CADET_PeerListEntry { | 397 | struct GNUNET_CADET_PeerListEntry |
398 | { | ||
393 | /** | 399 | /** |
394 | * Which peer is the information about? | 400 | * Which peer is the information about? |
395 | */ | 401 | */ |
@@ -443,9 +449,9 @@ struct GNUNET_CADET_PeersLister; | |||
443 | * @return NULL on error | 449 | * @return NULL on error |
444 | */ | 450 | */ |
445 | struct GNUNET_CADET_PeersLister * | 451 | struct GNUNET_CADET_PeersLister * |
446 | GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg, | 452 | GNUNET_CADET_list_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, |
447 | GNUNET_CADET_PeersCB callback, | 453 | GNUNET_CADET_PeersCB callback, |
448 | void *callback_cls); | 454 | void *callback_cls); |
449 | 455 | ||
450 | 456 | ||
451 | /** | 457 | /** |
@@ -455,13 +461,14 @@ GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
455 | * @return Closure that was given to #GNUNET_CADET_list_peers(). | 461 | * @return Closure that was given to #GNUNET_CADET_list_peers(). |
456 | */ | 462 | */ |
457 | void * | 463 | void * |
458 | GNUNET_CADET_list_peers_cancel(struct GNUNET_CADET_PeersLister *pl); | 464 | GNUNET_CADET_list_peers_cancel (struct GNUNET_CADET_PeersLister *pl); |
459 | 465 | ||
460 | 466 | ||
461 | /** | 467 | /** |
462 | * Detailed information we return per peer. | 468 | * Detailed information we return per peer. |
463 | */ | 469 | */ |
464 | struct GNUNET_CADET_PeerPathDetail { | 470 | struct GNUNET_CADET_PeerPathDetail |
471 | { | ||
465 | /** | 472 | /** |
466 | * Peer this is about. | 473 | * Peer this is about. |
467 | */ | 474 | */ |
@@ -514,10 +521,10 @@ struct GNUNET_CADET_GetPath; | |||
514 | * @return NULL on error | 521 | * @return NULL on error |
515 | */ | 522 | */ |
516 | struct GNUNET_CADET_GetPath * | 523 | struct GNUNET_CADET_GetPath * |
517 | GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg, | 524 | GNUNET_CADET_get_path (const struct GNUNET_CONFIGURATION_Handle *cfg, |
518 | const struct GNUNET_PeerIdentity *id, | 525 | const struct GNUNET_PeerIdentity *id, |
519 | GNUNET_CADET_PathCB callback, | 526 | GNUNET_CADET_PathCB callback, |
520 | void *callback_cls); | 527 | void *callback_cls); |
521 | 528 | ||
522 | 529 | ||
523 | /** | 530 | /** |
@@ -527,13 +534,14 @@ GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
527 | * @return closure from #GNUNET_CADET_get_path(). | 534 | * @return closure from #GNUNET_CADET_get_path(). |
528 | */ | 535 | */ |
529 | void * | 536 | void * |
530 | GNUNET_CADET_get_path_cancel(struct GNUNET_CADET_GetPath *gp); | 537 | GNUNET_CADET_get_path_cancel (struct GNUNET_CADET_GetPath *gp); |
531 | 538 | ||
532 | 539 | ||
533 | /** | 540 | /** |
534 | * Details about a tunnel managed by CADET. | 541 | * Details about a tunnel managed by CADET. |
535 | */ | 542 | */ |
536 | struct GNUNET_CADET_TunnelDetails { | 543 | struct GNUNET_CADET_TunnelDetails |
544 | { | ||
537 | /** | 545 | /** |
538 | * Target of the tunnel. | 546 | * Target of the tunnel. |
539 | */ | 547 | */ |
@@ -592,9 +600,9 @@ struct GNUNET_CADET_ListTunnels; | |||
592 | * @return NULL on error | 600 | * @return NULL on error |
593 | */ | 601 | */ |
594 | struct GNUNET_CADET_ListTunnels * | 602 | struct GNUNET_CADET_ListTunnels * |
595 | GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg, | 603 | GNUNET_CADET_list_tunnels (const struct GNUNET_CONFIGURATION_Handle *cfg, |
596 | GNUNET_CADET_TunnelsCB callback, | 604 | GNUNET_CADET_TunnelsCB callback, |
597 | void *callback_cls); | 605 | void *callback_cls); |
598 | 606 | ||
599 | 607 | ||
600 | /** | 608 | /** |
@@ -604,7 +612,7 @@ GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
604 | * @return Closure given to #GNUNET_CADET_list_tunnels(), if any. | 612 | * @return Closure given to #GNUNET_CADET_list_tunnels(), if any. |
605 | */ | 613 | */ |
606 | void * | 614 | void * |
607 | GNUNET_CADET_list_tunnels_cancel(struct GNUNET_CADET_ListTunnels *lt); | 615 | GNUNET_CADET_list_tunnels_cancel (struct GNUNET_CADET_ListTunnels *lt); |
608 | 616 | ||
609 | 617 | ||
610 | #if 0 /* keep Emacsens' auto-indent happy */ | 618 | #if 0 /* keep Emacsens' auto-indent happy */ |