aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_protocol.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-18 19:24:33 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-18 19:24:33 +0100
commitdfde8ea01a08a32340a47df29ffc2571c031488b (patch)
tree81abde784965de4a4d3f32f882a39353cc96a88d /src/cadet/cadet_protocol.h
parent3edc21c27d208e45dc1af76131a480a3ebf1e8d3 (diff)
downloadgnunet-dfde8ea01a08a32340a47df29ffc2571c031488b.tar.gz
gnunet-dfde8ea01a08a32340a47df29ffc2571c031488b.zip
create matching connection objects for inbound connections
Diffstat (limited to 'src/cadet/cadet_protocol.h')
-rw-r--r--src/cadet/cadet_protocol.h85
1 files changed, 77 insertions, 8 deletions
diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h
index 7e4a6ae16..cf32e0d6d 100644
--- a/src/cadet/cadet_protocol.h
+++ b/src/cadet/cadet_protocol.h
@@ -113,7 +113,7 @@ struct GNUNET_CADET_ConnectionCreateMessageAckMessage
113struct GNUNET_CADET_ConnectionBrokenMessage 113struct GNUNET_CADET_ConnectionBrokenMessage
114{ 114{
115 /** 115 /**
116 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN 116 * Type: #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN.
117 */ 117 */
118 struct GNUNET_MessageHeader header; 118 struct GNUNET_MessageHeader header;
119 119
@@ -350,7 +350,6 @@ struct GNUNET_CADET_ConnectionEncryptedAckMessage
350/******************************* CHANNEL ***********************************/ 350/******************************* CHANNEL ***********************************/
351/******************************************************************************/ 351/******************************************************************************/
352 352
353#ifndef NEW_CADET
354 353
355/** 354/**
356 * Message to create a Channel. 355 * Message to create a Channel.
@@ -373,12 +372,11 @@ struct GNUNET_CADET_ChannelOpenMessage
373 struct GNUNET_HashCode port; 372 struct GNUNET_HashCode port;
374 373
375 /** 374 /**
376 * ID of the channel 375 * ID of the channel within the tunnel.
377 */ 376 */
378 struct GNUNET_CADET_ChannelNumber chid; 377 struct GNUNET_CADET_ChannelTunnelNumber chid;
379}; 378};
380 379
381#endif
382 380
383/** 381/**
384 * Message to manage a Channel (ACK, NACK, Destroy). 382 * Message to manage a Channel (ACK, NACK, Destroy).
@@ -400,7 +398,7 @@ struct GNUNET_CADET_ChannelManageMessage
400 /** 398 /**
401 * ID of the channel 399 * ID of the channel
402 */ 400 */
403 struct GNUNET_CADET_ChannelNumber chid; 401 struct GNUNET_CADET_ChannelTunnelNumber chid;
404}; 402};
405 403
406 404
@@ -426,7 +424,7 @@ struct GNUNET_CADET_ChannelAppDataMessage
426 /** 424 /**
427 * ID of the channel 425 * ID of the channel
428 */ 426 */
429 struct GNUNET_CADET_ChannelNumber chid; 427 struct GNUNET_CADET_ChannelTunnelNumber chid;
430 428
431 /** 429 /**
432 * Payload follows 430 * Payload follows
@@ -447,7 +445,7 @@ struct GNUNET_CADET_ChannelDataAckMessage
447 /** 445 /**
448 * ID of the channel 446 * ID of the channel
449 */ 447 */
450 struct GNUNET_CADET_ChannelNumber chid; 448 struct GNUNET_CADET_ChannelTunnelNumber chid;
451 449
452 /** 450 /**
453 * Bitfield of already-received newer messages 451 * Bitfield of already-received newer messages
@@ -463,6 +461,77 @@ struct GNUNET_CADET_ChannelDataAckMessage
463 uint32_t mid GNUNET_PACKED; 461 uint32_t mid GNUNET_PACKED;
464}; 462};
465 463
464#else
465
466
467/**
468 * Number used to uniquely identify messages in a CADET Channel.
469 */
470struct ChannelMessageIdentifier
471{
472 /**
473 * Unique ID of the message, cycles around, in NBO.
474 */
475 uint32_t mid GNUNET_PACKED;
476};
477
478
479/**
480 * Message for cadet data traffic.
481 */
482struct GNUNET_CADET_ChannelAppDataMessage
483{
484 /**
485 * Type: #GNUNET_MESSAGE_TYPE_CADET_UNICAST,
486 * #GNUNET_MESSAGE_TYPE_CADET_TO_ORIGIN
487 */
488 struct GNUNET_MessageHeader header;
489
490 /**
491 * Unique ID of the payload message.
492 */
493 struct ChannelMessageIdentifier mid;
494
495 /**
496 * ID of the channel
497 */
498 struct GNUNET_CADET_ChannelTunnelNumber gid;
499
500 /**
501 * Payload follows
502 */
503};
504
505
506/**
507 * Message to acknowledge end-to-end data.
508 */
509struct GNUNET_CADET_ChannelDataAckMessage
510{
511 /**
512 * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_APP_DATA_ACK
513 */
514 struct GNUNET_MessageHeader header;
515
516 /**
517 * ID of the channel
518 */
519 struct GNUNET_CADET_ChannelTunnelNumber gid;
520
521 /**
522 * Bitfield of already-received messages past @e mid.
523 * pid + 1 @ LSB
524 * pid + 64 @ MSB
525 */
526 uint64_t futures GNUNET_PACKED;
527
528 /**
529 * Last message ID received.
530 */
531 struct ChannelMessageIdentifier mid;
532};
533
534
466#endif 535#endif
467 536
468GNUNET_NETWORK_STRUCT_END 537GNUNET_NETWORK_STRUCT_END