1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
/// qaul network messaging service
///
/// is responsible to distribute messages to users
/// the container contains the entire message with signature
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Container {
    /// signed by sending user
    #[prost(bytes="vec", tag="1")]
    pub signature: ::prost::alloc::vec::Vec<u8>,
    /// Message envelope
    #[prost(message, optional, tag="2")]
    pub envelope: ::core::option::Option<Envelope>,
}
/// message envelop with sender and receiver
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Envelope {
    /// the qaul ID of the sender
    #[prost(bytes="vec", tag="1")]
    pub sender_id: ::prost::alloc::vec::Vec<u8>,
    /// the qaul ID of the receiver
    #[prost(bytes="vec", tag="2")]
    pub receiver_id: ::prost::alloc::vec::Vec<u8>,
    /// payload
    #[prost(bytes="vec", tag="3")]
    pub payload: ::prost::alloc::vec::Vec<u8>,
}
/// envelop payload
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnvelopPayload {
    #[prost(oneof="envelop_payload::Payload", tags="1, 2")]
    pub payload: ::core::option::Option<envelop_payload::Payload>,
}
/// Nested message and enum types in `EnvelopPayload`.
pub mod envelop_payload {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Payload {
        /// encrypted message data
        #[prost(message, tag="1")]
        Encrypted(super::Encrypted),
        /// DTN message
        #[prost(bytes, tag="2")]
        Dtn(::prost::alloc::vec::Vec<u8>),
    }
}
/// encrypted message data
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Encrypted {
    /// state of the crypto session
    #[prost(enumeration="CryptoState", tag="1")]
    pub state: i32,
    /// crypto session id
    #[prost(uint32, tag="2")]
    pub session_id: u32,
    /// one or several Data messages
    /// of maximally 64KB each.
    #[prost(message, repeated, tag="3")]
    pub data: ::prost::alloc::vec::Vec<Data>,
}
/// encrypted message data
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Data {
    /// message nonce for encryption
    ///
    /// each nonce is only used once per key
    /// and increases by one fore each new data package.
    #[prost(uint64, tag="1")]
    pub nonce: u64,
    /// the encrypted message data slice
    /// each data package contains maximally
    /// 64KB
    #[prost(bytes="vec", tag="2")]
    pub data: ::prost::alloc::vec::Vec<u8>,
}
/// messaging unified message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Messaging {
    #[prost(oneof="messaging::Message", tags="1, 2, 3, 4, 5, 6")]
    pub message: ::core::option::Option<messaging::Message>,
}
/// Nested message and enum types in `Messaging`.
pub mod messaging {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        /// confirm chat message
        #[prost(message, tag="1")]
        ConfirmationMessage(super::Confirmation),
        /// dtn response message
        #[prost(message, tag="2")]
        DtnResponse(super::DtnResponse),
        /// crypto service
        #[prost(message, tag="3")]
        CryptoService(super::CryptoService),
        /// rtc stream
        #[prost(message, tag="4")]
        RtcStreamMessage(super::RtcStreamMessage),
        /// group invite messages
        #[prost(message, tag="5")]
        GroupInviteMessage(super::GroupInviteMessage),
        /// common message
        #[prost(message, tag="6")]
        CommonMessage(super::CommonMessage),
    }
}
/// message received confirmation
///
/// every message that was received by a user
/// sends an acknowledgment package, to the sender
/// to confirm the receive.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Confirmation {
    /// message ID
    #[prost(bytes="vec", tag="1")]
    pub signature: ::prost::alloc::vec::Vec<u8>,
    /// received at timestamp
    #[prost(uint64, tag="2")]
    pub received_at: u64,
}
/// Crypto Service Message
///
/// This message is for crypto specific tasks,
/// such as completing a handshake.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CryptoService {
}
/// rtc stream mesasge
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RtcStreamMessage {
    #[prost(bytes="vec", tag="1")]
    pub content: ::prost::alloc::vec::Vec<u8>,
}
/// group invite message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GroupInviteMessage {
    #[prost(bytes="vec", tag="1")]
    pub content: ::prost::alloc::vec::Vec<u8>,
}
/// common message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommonMessage {
    /// message ID
    #[prost(bytes="vec", tag="1")]
    pub message_id: ::prost::alloc::vec::Vec<u8>,
    /// group id
    #[prost(bytes="vec", tag="2")]
    pub group_id: ::prost::alloc::vec::Vec<u8>,
    /// sent at timestamp
    #[prost(uint64, tag="3")]
    pub sent_at: u64,
    /// payload
    #[prost(oneof="common_message::Payload", tags="4, 5, 6, 7")]
    pub payload: ::core::option::Option<common_message::Payload>,
}
/// Nested message and enum types in `CommonMessage`.
pub mod common_message {
    /// payload
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Payload {
        /// chat message
        #[prost(message, tag="4")]
        ChatMessage(super::ChatMessage),
        /// file message
        #[prost(message, tag="5")]
        FileMessage(super::FileMessage),
        /// group message
        #[prost(message, tag="6")]
        GroupMessage(super::GroupMessage),
        /// rtc message
        #[prost(message, tag="7")]
        RtcMessage(super::RtcMessage),
    }
}
/// chat content
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChatMessage {
    /// content
    #[prost(string, tag="1")]
    pub content: ::prost::alloc::string::String,
}
/// file message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileMessage {
    #[prost(bytes="vec", tag="1")]
    pub content: ::prost::alloc::vec::Vec<u8>,
}
/// group message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GroupMessage {
    #[prost(bytes="vec", tag="1")]
    pub content: ::prost::alloc::vec::Vec<u8>,
}
/// rtc message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RtcMessage {
    #[prost(bytes="vec", tag="1")]
    pub content: ::prost::alloc::vec::Vec<u8>,
}
/// DTN message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Dtn {
    #[prost(oneof="dtn::Message", tags="1, 2")]
    pub message: ::core::option::Option<dtn::Message>,
}
/// Nested message and enum types in `Dtn`.
pub mod dtn {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        /// message container
        #[prost(bytes, tag="1")]
        Container(::prost::alloc::vec::Vec<u8>),
        /// message received response
        #[prost(message, tag="2")]
        Response(super::DtnResponse),
    }
}
/// DTN response
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DtnResponse {
    /// the type of the message
    #[prost(enumeration="dtn_response::ResponseType", tag="1")]
    pub response_type: i32,
    /// message signature reference
    #[prost(bytes="vec", tag="2")]
    pub signature: ::prost::alloc::vec::Vec<u8>,
    /// reason of rejection
    #[prost(enumeration="dtn_response::Reason", tag="3")]
    pub reason: i32,
}
/// Nested message and enum types in `DtnResponse`.
pub mod dtn_response {
    /// the enum definition of the type
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum ResponseType {
        /// the message was accepted for storage
        Accepted = 0,
        /// the message was rejected
        Rejected = 1,
    }
    impl ResponseType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                ResponseType::Accepted => "ACCEPTED",
                ResponseType::Rejected => "REJECTED",
            }
        }
    }
    /// the enum definition of the rejection reason
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Reason {
        /// none
        None = 0,
        /// this user is not accepted
        UserNotAccepted = 1,
        /// overall quota reached
        OverallQuota = 2,
        /// user quota reached
        UserQuota = 3,
    }
    impl Reason {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Reason::None => "NONE",
                Reason::UserNotAccepted => "USER_NOT_ACCEPTED",
                Reason::OverallQuota => "OVERALL_QUOTA",
                Reason::UserQuota => "USER_QUOTA",
            }
        }
    }
}
/// state of the crypto session
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CryptoState {
    /// no crypto at all
    None = 0,
    /// crypto session is in handshake state
    Handshake = 1,
    /// crypto session is in transport state
    Transport = 2,
}
impl CryptoState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            CryptoState::None => "NONE",
            CryptoState::Handshake => "HANDSHAKE",
            CryptoState::Transport => "TRANSPORT",
        }
    }
}