summaryrefslogtreecommitdiff
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.h55
1 files changed, 34 insertions, 21 deletions
diff --git a/src/include/gnunet_cadet_service.h b/src/include/gnunet_cadet_service.h
index c32311643..7090d4410 100644
--- a/src/include/gnunet_cadet_service.h
+++ b/src/include/gnunet_cadet_service.h
@@ -67,15 +67,6 @@ struct GNUNET_CADET_Channel;
67 */ 67 */
68struct GNUNET_CADET_Port; 68struct GNUNET_CADET_Port;
69 69
70/**
71 * Hash to be used in Cadet communication. Only 256 bits needed,
72 * instead of the 512 from `struct GNUNET_HashCode`.
73 */
74struct GNUNET_CADET_Hash
75{
76 unsigned char bits[256 / 8];
77};
78
79 70
80/** 71/**
81 * Channel options. Second line indicates filed in the 72 * Channel options. Second line indicates filed in the
@@ -102,9 +93,9 @@ enum GNUNET_CADET_ChannelOption
102 93
103 /** 94 /**
104 * Enable out of order delivery of messages. 95 * Enable out of order delivery of messages.
105 * Yes/No. 96 * Set bit for out-of-order delivery.
106 */ 97 */
107 GNUNET_CADET_OPTION_OOORDER = 0x4, 98 GNUNET_CADET_OPTION_OUT_OF_ORDER = 0x4,
108 99
109 /** 100 /**
110 * Who is the peer at the other end of the channel. 101 * Who is the peer at the other end of the channel.
@@ -255,8 +246,7 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle);
255struct GNUNET_CADET_Port * 246struct GNUNET_CADET_Port *
256GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h, 247GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h,
257 const struct GNUNET_HashCode *port, 248 const struct GNUNET_HashCode *port,
258 GNUNET_CADET_InboundChannelNotificationHandler 249 GNUNET_CADET_InboundChannelNotificationHandler new_channel,
259 new_channel,
260 void *new_channel_cls); 250 void *new_channel_cls);
261 251
262/** 252/**
@@ -332,7 +322,8 @@ union GNUNET_CADET_ChannelInfo
332 */ 322 */
333const union GNUNET_CADET_ChannelInfo * 323const union GNUNET_CADET_ChannelInfo *
334GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel, 324GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel,
335 enum GNUNET_CADET_ChannelOption option, ...); 325 enum GNUNET_CADET_ChannelOption option,
326 ...);
336 327
337 328
338/** 329/**
@@ -421,10 +412,10 @@ typedef void
421(*GNUNET_CADET_ChannelCB) (void *cls, 412(*GNUNET_CADET_ChannelCB) (void *cls,
422 const struct GNUNET_PeerIdentity *root, 413 const struct GNUNET_PeerIdentity *root,
423 const struct GNUNET_PeerIdentity *dest, 414 const struct GNUNET_PeerIdentity *dest,
424 uint32_t port, 415 uint32_t /* UGH */ port,
425 uint32_t root_channel_number, 416 uint32_t /* ugh */ root_channel_number,
426 uint32_t dest_channel_number, 417 uint32_t /* ugh */ dest_channel_number,
427 uint32_t public_channel_number); 418 uint32_t /* ugh */ public_channel_number);
428 419
429/** 420/**
430 * Method called to retrieve information about all peers in CADET, called 421 * Method called to retrieve information about all peers in CADET, called
@@ -491,6 +482,28 @@ typedef void
491 482
492 483
493/** 484/**
485 * Hash uniquely identifying a connection below a tunnel.
486 */
487struct GNUNET_CADET_ConnectionTunnelIdentifier
488{
489 struct GNUNET_ShortHashCode connection_of_tunnel;
490};
491
492
493/**
494 * Number identifying a CADET channel within a tunnel.
495 */
496struct GNUNET_CADET_ChannelTunnelNumber
497{
498 /**
499 * Which number does this channel have that uniquely identfies
500 * it within its tunnel?
501 */
502 uint32_t cn GNUNET_PACKED;
503};
504
505
506/**
494 * Method called to retrieve information about a specific tunnel the cadet peer 507 * Method called to retrieve information about a specific tunnel the cadet peer
495 * has established, o`r is trying to establish. 508 * has established, o`r is trying to establish.
496 * 509 *
@@ -508,8 +521,8 @@ typedef void
508 const struct GNUNET_PeerIdentity *peer, 521 const struct GNUNET_PeerIdentity *peer,
509 unsigned int n_channels, 522 unsigned int n_channels,
510 unsigned int n_connections, 523 unsigned int n_connections,
511 uint32_t *channels, 524 const struct GNUNET_CADET_ChannelTunnelNumber *channels,
512 struct GNUNET_CADET_Hash *connections, 525 const struct GNUNET_CADET_ConnectionTunnelIdentifier *connections,
513 unsigned int estate, 526 unsigned int estate,
514 unsigned int cstate); 527 unsigned int cstate);
515 528
@@ -528,7 +541,7 @@ typedef void
528void 541void
529GNUNET_CADET_get_channel (struct GNUNET_CADET_Handle *h, 542GNUNET_CADET_get_channel (struct GNUNET_CADET_Handle *h,
530 struct GNUNET_PeerIdentity *peer, 543 struct GNUNET_PeerIdentity *peer,
531 uint32_t channel_number, 544 uint32_t /* UGH */ channel_number,
532 GNUNET_CADET_ChannelCB callback, 545 GNUNET_CADET_ChannelCB callback,
533 void *callback_cls); 546 void *callback_cls);
534 547