added test_stream_big to make check tests
[oweals/gnunet.git] / src / stream / stream_protocol.h
index 9c7964e336c1a6b82964ada7a7d3e1cd967ceeba..d1c43b778ea93a41986f8f6d0a78bdcaf8cc2296 100644 (file)
@@ -42,8 +42,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
  * The stream message header
- *
- * The message can be of Data, Acknowledgement or both
+ * All messages of STREAM should commonly have this as header
  */
 struct GNUNET_STREAM_MessageHeader
 {
@@ -53,7 +52,7 @@ struct GNUNET_STREAM_MessageHeader
   struct GNUNET_MessageHeader header;
 
   /**
-   * A number which identifies a session between the two peers.
+   * A number which identifies a session between the two peers. FIXME: not needed
    */
   uint32_t session_id GNUNET_PACKED;
 
@@ -98,6 +97,12 @@ struct GNUNET_STREAM_DataMessage
    */
 };
 
+
+/**
+ * Number of bits in GNUNET_STREAM_AckBitmap
+ */
+#define GNUNET_STREAM_ACK_BITMAP_BIT_LENGTH 64
+
 /**
  * The Selective Acknowledgement Bitmap
  */
@@ -122,8 +127,8 @@ struct GNUNET_STREAM_AckMessage
   GNUNET_STREAM_AckBitmap bitmap GNUNET_PACKED;
 
   /**
-   * The sequence number of the Data Message upto which the receiver has filled
-   * its buffer without any missing packets
+   * The sequence number of the next Data Message receiver is
+   * anticipating. Data messages less than this number are received by receiver
    */
   uint32_t base_sequence_number GNUNET_PACKED;
 
@@ -134,6 +139,49 @@ struct GNUNET_STREAM_AckMessage
   uint32_t receive_window_remaining GNUNET_PACKED;
 };
 
+
+/**
+ * Message for Acknowledging HELLO
+ */
+struct GNUNET_STREAM_HelloAckMessage
+{
+  /**
+   * The stream message header
+   */
+  struct GNUNET_STREAM_MessageHeader header;
+
+  /**
+   * The selected sequence number. Following data tranmissions from the sender
+   * start with this sequence
+   */
+  uint32_t sequence_number GNUNET_PACKED;
+
+  /**
+   * The size(in bytes) of the receive window on the peer sending this message
+   *
+   * FIXME: Remove if not needed
+   */
+  uint32_t receiver_window_size GNUNET_PACKED;
+};
+
+
+/**
+ * The Transmit close message(used to signal transmission is closed)
+ */
+struct GNUNET_STREAM_TransmitCloseMessage
+{
+  /**
+   * The stream message header
+   */
+  struct GNUNET_STREAM_MessageHeader header;
+
+  /**
+   * The last sequence number of the packet after which the transmission has
+   * ended 
+   */
+  uint32_t final_sequence_number GNUNET_PACKED;
+};
+
 GNUNET_NETWORK_STRUCT_END