aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_cadet_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_cadet_service.h')
-rw-r--r--src/include/gnunet_cadet_service.h108
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 */
73struct GNUNET_CADET_ConnectionTunnelIdentifier { 73struct 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 */
81struct GNUNET_CADET_ChannelTunnelNumber { 82struct 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 */
154struct GNUNET_CADET_Handle * 156struct GNUNET_CADET_Handle *
155GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 157GNUNET_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 */
166void 168void
167GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle); 169GNUNET_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 */
183struct GNUNET_CADET_Port * 185struct GNUNET_CADET_Port *
184GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, 186GNUNET_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 */
199void 201void
200GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p); 202GNUNET_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 */
223struct GNUNET_CADET_Channel * 225struct GNUNET_CADET_Channel *
224GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h, 226GNUNET_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 */
242void 244void
243GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel); 245GNUNET_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 */
252struct GNUNET_MQ_Handle * 254struct GNUNET_MQ_Handle *
253GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel); 255GNUNET_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 */
263void 265void
264GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel); 266GNUNET_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 */
276const struct GNUNET_HashCode * 278const struct GNUNET_HashCode *
277GC_u2h(uint32_t port); 279GC_u2h (uint32_t port);
278 280
279enum GNUNET_CADET_ChannelInfoOption { 281enum 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 */
291union GNUNET_CADET_ChannelInfo { 294union 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 */
311const union GNUNET_CADET_ChannelInfo * 315const union GNUNET_CADET_ChannelInfo *
312GNUNET_CADET_channel_get_info(struct GNUNET_CADET_Channel *channel, 316GNUNET_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 */
331struct GNUNET_CADET_ChannelInternals { 335struct 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 */
372struct GNUNET_CADET_ChannelMonitor * 377struct GNUNET_CADET_ChannelMonitor *
373GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, 378GNUNET_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 */
385void * 390void *
386GNUNET_CADET_get_channel_cancel(struct GNUNET_CADET_ChannelMonitor *cm); 391GNUNET_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 */
392struct GNUNET_CADET_PeerListEntry { 397struct 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 */
445struct GNUNET_CADET_PeersLister * 451struct GNUNET_CADET_PeersLister *
446GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg, 452GNUNET_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 */
457void * 463void *
458GNUNET_CADET_list_peers_cancel(struct GNUNET_CADET_PeersLister *pl); 464GNUNET_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 */
464struct GNUNET_CADET_PeerPathDetail { 470struct 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 */
516struct GNUNET_CADET_GetPath * 523struct GNUNET_CADET_GetPath *
517GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg, 524GNUNET_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 */
529void * 536void *
530GNUNET_CADET_get_path_cancel(struct GNUNET_CADET_GetPath *gp); 537GNUNET_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 */
536struct GNUNET_CADET_TunnelDetails { 543struct 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 */
594struct GNUNET_CADET_ListTunnels * 602struct GNUNET_CADET_ListTunnels *
595GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg, 603GNUNET_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 */
606void * 614void *
607GNUNET_CADET_list_tunnels_cancel(struct GNUNET_CADET_ListTunnels *lt); 615GNUNET_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 */