/**
 * Stream management messages.
 * @author Krzysztof Trzepla
 * @copyright (C) 2015 ACK CYFRONET AGH
 * @copyright This software is released under the MIT license cited in
 * 'LICENSE.txt'
 */

syntax = "proto2";
package one.clproto;

// Identifies message as part of the stream
message MessageStream {
    required uint64 stream_id       = 1; // stream ID
    required uint64 sequence_number = 2; // sequence number of the message in
                                         // the stream
}

// Requests retransmission of stream messages
message MessageRequest {
    required uint64 stream_id             = 1; // ID of stream requested
                                               // messages belong to
    required uint64 lower_sequence_number = 2; // lower bound (inclusive) of
                                               // sequence numbers of requested
                                               // messages
    required uint64 upper_sequence_number = 3; // upper bound (inclusive) of
                                               // sequence numbers of requested
                                               // messages
}

// Informs about sequence number of last successfully processed stream message
message MessageAcknowledgement {
    required uint64 stream_id       = 1; // ID of stream acknowledged messages
                                         // belong to
    required uint64 sequence_number = 2; // sequence number of last successfully
                                         // processed message from the stream
}

// Reinitializes message stream
message MessageStreamReset {
    optional uint64 stream_id = 1; // ID of stream to be reinitialized, if not
                                   // provided all streams should be reinitialized
}

// Marks the end of message stream
message EndOfMessageStream {
}
