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
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CastMessage {
#[prost(enumeration = "cast_message::ProtocolVersion", required, tag = "1")]
pub protocol_version: i32,
/// source and destination ids identify the origin and destination of the
/// message. They are used to route messages between endpoints that share a
/// device-to-device channel.
///
/// For messages between applications:
/// - The sender application id is a unique identifier generated on behalf of
/// the sender application.
/// - The receiver id is always the the session id for the application.
///
/// For messages to or from the sender or receiver platform, the special ids
/// 'sender-0' and 'receiver-0' can be used.
///
/// For messages intended for all endpoints using a given channel, the
/// wildcard destination_id '*' can be used.
#[prost(string, required, tag = "2")]
pub source_id: ::prost::alloc::string::String,
#[prost(string, required, tag = "3")]
pub destination_id: ::prost::alloc::string::String,
/// This is the core multiplexing key. All messages are sent on a namespace
/// and endpoints sharing a channel listen on one or more namespaces. The
/// namespace defines the protocol and semantics of the message.
#[prost(string, required, tag = "4")]
pub namespace: ::prost::alloc::string::String,
#[prost(enumeration = "cast_message::PayloadType", required, tag = "5")]
pub payload_type: i32,
/// Depending on payload_type, exactly one of the following optional fields
/// will always be set.
#[prost(string, optional, tag = "6")]
pub payload_utf8: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "vec", optional, tag = "7")]
pub payload_binary: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
/// Flag indicating whether there are more chunks to follow for this message.
/// If the flag is false or is not present, then this is the last (or only)
/// chunk of the message.
#[prost(bool, optional, tag = "8")]
pub continued: ::core::option::Option<bool>,
/// If this is a chunk of a larger message, and the remaining length of the
/// message payload (the sum of the lengths of the payloads of the remaining
/// chunks) is known, this field will indicate that length. For a given
/// chunked message, this field should either be present in all of the chunks,
/// or in none of them.
#[prost(uint32, optional, tag = "9")]
pub remaining_length: ::core::option::Option<u32>,
}
/// Nested message and enum types in `CastMessage`.
pub mod cast_message {
/// Always pass a version of the protocol for future compatibility
/// requirements.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ProtocolVersion {
Castv210 = 0,
/// message chunking support (deprecated).
Castv211 = 1,
/// reworked message chunking.
Castv212 = 2,
/// binary payload over utf8.
Castv213 = 3,
}
impl ProtocolVersion {
/// 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 {
Self::Castv210 => "CASTV2_1_0",
Self::Castv211 => "CASTV2_1_1",
Self::Castv212 => "CASTV2_1_2",
Self::Castv213 => "CASTV2_1_3",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CASTV2_1_0" => Some(Self::Castv210),
"CASTV2_1_1" => Some(Self::Castv211),
"CASTV2_1_2" => Some(Self::Castv212),
"CASTV2_1_3" => Some(Self::Castv213),
_ => None,
}
}
}
/// What type of data do we have in this message.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum PayloadType {
String = 0,
Binary = 1,
}
impl PayloadType {
/// 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 {
Self::String => "STRING",
Self::Binary => "BINARY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STRING" => Some(Self::String),
"BINARY" => Some(Self::Binary),
_ => None,
}
}
}
}
/// Messages for authentication protocol between a sender and a receiver.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthChallenge {
#[prost(
enumeration = "SignatureAlgorithm",
optional,
tag = "1",
default = "RsassaPkcs1v15"
)]
pub signature_algorithm: ::core::option::Option<i32>,
#[prost(bytes = "vec", optional, tag = "2")]
pub sender_nonce: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(enumeration = "HashAlgorithm", optional, tag = "3", default = "Sha1")]
pub hash_algorithm: ::core::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthResponse {
#[prost(bytes = "vec", required, tag = "1")]
pub signature: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", required, tag = "2")]
pub client_auth_certificate: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", repeated, tag = "3")]
pub intermediate_certificate: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(
enumeration = "SignatureAlgorithm",
optional,
tag = "4",
default = "RsassaPkcs1v15"
)]
pub signature_algorithm: ::core::option::Option<i32>,
#[prost(bytes = "vec", optional, tag = "5")]
pub sender_nonce: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(enumeration = "HashAlgorithm", optional, tag = "6", default = "Sha1")]
pub hash_algorithm: ::core::option::Option<i32>,
#[prost(bytes = "vec", optional, tag = "7")]
pub crl: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AuthError {
#[prost(enumeration = "auth_error::ErrorType", required, tag = "1")]
pub error_type: i32,
}
/// Nested message and enum types in `AuthError`.
pub mod auth_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ErrorType {
InternalError = 0,
/// The underlying connection is not TLS
NoTls = 1,
SignatureAlgorithmUnavailable = 2,
}
impl ErrorType {
/// 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 {
Self::InternalError => "INTERNAL_ERROR",
Self::NoTls => "NO_TLS",
Self::SignatureAlgorithmUnavailable => "SIGNATURE_ALGORITHM_UNAVAILABLE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INTERNAL_ERROR" => Some(Self::InternalError),
"NO_TLS" => Some(Self::NoTls),
"SIGNATURE_ALGORITHM_UNAVAILABLE" => {
Some(Self::SignatureAlgorithmUnavailable)
}
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceAuthMessage {
/// Request fields
#[prost(message, optional, tag = "1")]
pub challenge: ::core::option::Option<AuthChallenge>,
/// Response fields
#[prost(message, optional, tag = "2")]
pub response: ::core::option::Option<AuthResponse>,
#[prost(message, optional, tag = "3")]
pub error: ::core::option::Option<AuthError>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SignatureAlgorithm {
Unspecified = 0,
RsassaPkcs1v15 = 1,
RsassaPss = 2,
}
impl SignatureAlgorithm {
/// 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 {
Self::Unspecified => "UNSPECIFIED",
Self::RsassaPkcs1v15 => "RSASSA_PKCS1v15",
Self::RsassaPss => "RSASSA_PSS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSPECIFIED" => Some(Self::Unspecified),
"RSASSA_PKCS1v15" => Some(Self::RsassaPkcs1v15),
"RSASSA_PSS" => Some(Self::RsassaPss),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HashAlgorithm {
Sha1 = 0,
Sha256 = 1,
}
impl HashAlgorithm {
/// 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 {
Self::Sha1 => "SHA1",
Self::Sha256 => "SHA256",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SHA1" => Some(Self::Sha1),
"SHA256" => Some(Self::Sha256),
_ => None,
}
}
}