1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // MCS protocol for communication between Chrome client and Mobile Connection
10 option optimize_for = LITE_RUNTIME;
11 option retain_unknown_fields = true;
16 Common fields/comments:
18 stream_id: no longer sent by server, each side keeps a counter
19 last_stream_id_received: sent only if a packet was received since last time
20 a last_stream was sent
21 status: new bitmask including the 'idle' as bit 0.
28 message HeartbeatPing {
29 optional int32 stream_id = 1;
30 optional int32 last_stream_id_received = 2;
31 optional int64 status = 3;
37 message HeartbeatAck {
38 optional int32 stream_id = 1;
39 optional int32 last_stream_id_received = 2;
40 optional int64 status = 3;
44 required int32 code = 1;
45 optional string message = 2;
46 optional string type = 3;
47 optional Extension extension = 4;
50 // MobileSettings class.
51 // "u:f", "u:b", "u:s" - multi user devices reporting foreground, background
53 // hbping: heatbeat ping interval
54 // rmq2v: include explicit stream IDs
57 required string name = 1;
58 required string value = 2;
61 message HeartbeatStat {
62 required string ip = 1;
63 required bool timeout = 2;
64 required int32 interval_ms = 3;
67 message HeartbeatConfig {
68 optional bool upload_stat = 1;
69 optional string ip = 2;
70 optional int32 interval_ms = 3;
76 message LoginRequest {
80 required string id = 1; // Must be present ( proto required ), may be empty
83 required string domain = 2;
85 required string user = 3;
87 required string resource = 4;
90 required string auth_token = 5;
92 // Format is: android-HEX_DEVICE_ID
93 // The user is the decimal value.
94 optional string device_id = 6;
96 // RMQ1 - no longer used
97 optional int64 last_rmq_id = 7;
99 repeated Setting setting = 8;
100 //optional int32 compress = 9;
101 repeated string received_persistent_id = 10;
103 // Replaced by "rmq2v" setting
104 // optional bool include_stream_ids = 11;
106 optional bool adaptive_heartbeat = 12;
107 optional HeartbeatStat heartbeat_stat = 13;
109 optional bool use_rmq2 = 14;
110 optional int64 account_id = 15;
113 optional AuthService auth_service = 16;
115 optional int32 network_type = 17;
116 optional int64 status = 18;
122 message LoginResponse {
123 required string id = 1;
125 optional string jid = 2;
126 // Null if login was ok.
127 optional ErrorInfo error = 3;
128 repeated Setting setting = 4;
129 optional int32 stream_id = 5;
131 optional int32 last_stream_id_received = 6;
132 optional HeartbeatConfig heartbeat_config = 7;
133 // used by the client to synchronize with the server timestamp.
134 optional int64 server_timestamp = 8;
137 message StreamErrorStanza {
138 required string type = 1;
139 optional string text = 2;
151 required int32 id = 1;
152 required bytes data = 2;
157 * IqRequest must contain a single extension. IqResponse may contain 0 or 1
168 optional int64 rmq_id = 1;
169 required IqType type = 2;
170 required string id = 3;
171 optional string from = 4;
172 optional string to = 5;
173 optional ErrorInfo error = 6;
175 // Only field used in the 38+ protocol (besides common last_stream_id_received, status, rmq_id)
176 optional Extension extension = 7;
178 optional string persistent_id = 8;
179 optional int32 stream_id = 9;
180 optional int32 last_stream_id_received = 10;
181 optional int64 account_id = 11;
182 optional int64 status = 12;
186 required string key = 1;
187 required string value = 2;
193 message DataMessageStanza {
195 // optional int64 rmq_id = 1;
197 // This is the message ID, set by client, DMP.9 (message_id)
198 optional string id = 2;
200 // Project ID of the sender, DMP.1
201 required string from = 3;
203 // Part of DMRequest - also the key in DataMessageProto.
204 optional string to = 4;
206 // Package name. DMP.2
207 required string category = 5;
209 // The collapsed key, DMP.3
210 optional string token = 6;
212 // User data + GOOGLE. prefixed special entries, DMP.4
213 repeated AppData app_data = 7;
216 optional bool from_trusted_server = 8;
218 // Part of the ACK protocol, returned in DataMessageResponse on server side.
219 // It's part of the key of DMP.
220 optional string persistent_id = 9;
222 // In-stream ack. Increments on each message sent - a bit redundant
223 // Not used in DMP/DMR.
224 optional int32 stream_id = 10;
225 optional int32 last_stream_id_received = 11;
228 // optional string permission = 12;
230 // Sent by the device shortly after registration.
231 optional string reg_id = 13;
234 // optional string pkg_signature = 14;
236 // optional string client_id = 15;
238 // serial number of the target user, DMP.8
239 // It is the 'serial number' according to user manager.
240 optional int64 device_user_id = 16;
242 // Time to live, in seconds.
243 optional int32 ttl = 17;
244 // Timestamp ( according to client ) when message was sent by app, in seconds
245 optional int64 sent = 18;
247 // How long has the message been queued before the flush, in seconds.
248 // This is needed to account for the time difference between server and
249 // client: server should adjust 'sent' based on his 'receive' time.
250 optional int32 queued = 19;
252 optional int64 status = 20;
254 // Optional field containing the binary payload of the message.
255 optional bytes raw_data = 21;
259 Included in IQ with ID 13, sent from client or server after 10 unconfirmed
263 // No last_streamid_received required. This is included within an IqStanza,
264 // which includes the last_stream_id_received.
268 Included in IQ sent after LoginResponse from server with ID 12.
270 message SelectiveAck {
271 repeated string id = 1;