blob: 465ff5ad6da78292ec336622fd08950b5a1ba481 [file] [log] [blame]
[email protected]c2b374402012-03-12 19:23:071// Copyright (c) 2012 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.
4
[email protected]ff72dd12012-11-27 05:18:255#ifndef REMOTING_HOST_CHROMOTING_MESSAGES_H_
6#define REMOTING_HOST_CHROMOTING_MESSAGES_H_
7
avic5960f32015-12-22 22:49:488#include <stdint.h>
9
erikchen9e1ffaa2015-12-29 23:42:1810#include "base/memory/shared_memory_handle.h"
zijiehe36763d82017-06-19 23:52:3111#include "base/time/time.h"
sammce66272fae2016-11-01 03:49:0412#include "ipc/ipc_channel_handle.h"
[email protected]ff72dd12012-11-27 05:18:2513#include "ipc/ipc_platform_file.h"
[email protected]b9ed58f2013-05-16 10:45:2414#include "remoting/host/chromoting_param_traits.h"
sergeyuc986f522016-11-28 22:51:0115#include "remoting/host/desktop_environment_options.h"
[email protected]739e2802013-03-18 01:03:4816#include "remoting/host/screen_resolution.h"
zijiehe36763d82017-06-19 23:52:3117#include "remoting/proto/process_stats.pb.h"
sergeyuec77d8542015-11-03 22:31:0018#include "remoting/protocol/errors.h"
[email protected]39a631b2013-03-04 22:19:0519#include "remoting/protocol/transport.h"
sergeyu546cbaa2016-06-17 20:39:3220#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
[email protected]b9ed58f2013-05-16 10:45:2421#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
[email protected]ff72dd12012-11-27 05:18:2522
23#endif // REMOTING_HOST_CHROMOTING_MESSAGES_H_
[email protected]c2b374402012-03-12 19:23:0724
25// Multiply-included message file, no traditional include guard.
26#include "ipc/ipc_message_macros.h"
27
28#define IPC_MESSAGE_START ChromotingMsgStart
[email protected]df338b7d2012-09-05 19:58:3629
30//-----------------------------------------------------------------------------
[email protected]e9057a6f2013-03-08 22:37:5531// Chromoting messages sent from the daemon.
[email protected]df338b7d2012-09-05 19:58:3632
[email protected]e9057a6f2013-03-08 22:37:5533// Requests the receiving process to crash producing a crash dump. The daemon
[email protected]13d9ffb2012-10-23 22:23:5034// sends this message when a fatal error has been detected indicating that
[email protected]e9057a6f2013-03-08 22:37:5535// the receiving process misbehaves. The daemon passes the location of the code
[email protected]13d9ffb2012-10-23 22:23:5036// that detected the error.
[email protected]e9057a6f2013-03-08 22:37:5537IPC_MESSAGE_CONTROL3(ChromotingDaemonMsg_Crash,
[email protected]13d9ffb2012-10-23 22:23:5038 std::string /* function_name */,
39 std::string /* file_name */,
40 int /* line_number */)
41
[email protected]e9057a6f2013-03-08 22:37:5542//-----------------------------------------------------------------------------
43// Chromoting messages sent from the daemon to the network process.
44
[email protected]df338b7d2012-09-05 19:58:3645// Delivers the host configuration (and updates) to the network process.
46IPC_MESSAGE_CONTROL1(ChromotingDaemonNetworkMsg_Configuration, std::string)
[email protected]60ccc242012-10-17 21:06:2447
[email protected]7fe3ce42014-02-11 02:27:4848// Initializes the pairing registry on Windows. The passed key handles are
49// already duplicated by the sender.
50IPC_MESSAGE_CONTROL2(ChromotingDaemonNetworkMsg_InitializePairingRegistry,
51 IPC::PlatformFileForTransit /* privileged_key */,
52 IPC::PlatformFileForTransit /* unprivileged_key */)
53
[email protected]60ccc242012-10-17 21:06:2454// Notifies the network process that the terminal |terminal_id| has been
55// disconnected from the desktop session.
56IPC_MESSAGE_CONTROL1(ChromotingDaemonNetworkMsg_TerminalDisconnected,
57 int /* terminal_id */)
58
[email protected]12066cb2012-10-25 03:25:4359// Notifies the network process that |terminal_id| is now attached to
sammcf9cd299a2016-11-02 22:13:2660// a desktop integration process. |session_id| is the id of the desktop session
61// being attached. |desktop_pipe| is the client end of the desktop-to-network
62// pipe opened.
63IPC_MESSAGE_CONTROL3(ChromotingDaemonNetworkMsg_DesktopAttached,
[email protected]12066cb2012-10-25 03:25:4364 int /* terminal_id */,
sammcf9cd299a2016-11-02 22:13:2665 int /* session_id */,
sammce66272fae2016-11-01 03:49:0466 IPC::ChannelHandle /* desktop_pipe */)
[email protected]12066cb2012-10-25 03:25:4367
[email protected]60ccc242012-10-17 21:06:2468//-----------------------------------------------------------------------------
69// Chromoting messages sent from the network to the daemon process.
70
[email protected]e36460f2013-03-08 09:29:3271// Connects the terminal |terminal_id| (i.e. a remote client) to a desktop
[email protected]60ccc242012-10-17 21:06:2472// session.
[email protected]e36460f2013-03-08 09:29:3273IPC_MESSAGE_CONTROL3(ChromotingNetworkHostMsg_ConnectTerminal,
74 int /* terminal_id */,
[email protected]739e2802013-03-18 01:03:4875 remoting::ScreenResolution /* resolution */,
[email protected]e36460f2013-03-08 09:29:3276 bool /* virtual_terminal */)
[email protected]60ccc242012-10-17 21:06:2477
78// Disconnects the terminal |terminal_id| from the desktop session it was
79// connected to.
80IPC_MESSAGE_CONTROL1(ChromotingNetworkHostMsg_DisconnectTerminal,
81 int /* terminal_id */)
[email protected]12066cb2012-10-25 03:25:4382
[email protected]6f526ce2013-03-18 04:38:5683// Changes the screen resolution in the given desktop session.
84IPC_MESSAGE_CONTROL2(ChromotingNetworkDaemonMsg_SetScreenResolution,
85 int /* terminal_id */,
86 remoting::ScreenResolution /* resolution */)
87
[email protected]39a631b2013-03-04 22:19:0588// Serialized remoting::protocol::TransportRoute structure.
89IPC_STRUCT_BEGIN(SerializedTransportRoute)
martijna46bd47a2016-04-06 18:05:4890 IPC_STRUCT_MEMBER(remoting::protocol::TransportRoute::RouteType, type)
sergeyuf684dd1922016-09-28 22:37:5791 IPC_STRUCT_MEMBER(std::vector<uint8_t>, remote_ip)
92 IPC_STRUCT_MEMBER(uint16_t, remote_port)
93 IPC_STRUCT_MEMBER(std::vector<uint8_t>, local_ip)
94 IPC_STRUCT_MEMBER(uint16_t, local_port)
[email protected]39a631b2013-03-04 22:19:0595IPC_STRUCT_END()
96
martijna46bd47a2016-04-06 18:05:4897IPC_ENUM_TRAITS_MAX_VALUE(remoting::protocol::TransportRoute::RouteType,
98 remoting::protocol::TransportRoute::ROUTE_TYPE_MAX)
99
[email protected]39a631b2013-03-04 22:19:05100// Hosts status notifications (see HostStatusObserver interface) sent by
101// IpcHostEventLogger.
102IPC_MESSAGE_CONTROL1(ChromotingNetworkDaemonMsg_AccessDenied,
103 std::string /* jid */)
104
105IPC_MESSAGE_CONTROL1(ChromotingNetworkDaemonMsg_ClientAuthenticated,
106 std::string /* jid */)
107
108IPC_MESSAGE_CONTROL1(ChromotingNetworkDaemonMsg_ClientConnected,
109 std::string /* jid */)
110
111IPC_MESSAGE_CONTROL1(ChromotingNetworkDaemonMsg_ClientDisconnected,
112 std::string /* jid */)
113
114IPC_MESSAGE_CONTROL3(ChromotingNetworkDaemonMsg_ClientRouteChange,
115 std::string /* jid */,
116 std::string /* channel_name */,
117 SerializedTransportRoute /* route */)
118
119IPC_MESSAGE_CONTROL1(ChromotingNetworkDaemonMsg_HostStarted,
120 std::string /* xmpp_login */)
121
122IPC_MESSAGE_CONTROL0(ChromotingNetworkDaemonMsg_HostShutdown)
123
[email protected]12066cb2012-10-25 03:25:43124//-----------------------------------------------------------------------------
[email protected]12066cb2012-10-25 03:25:43125// Chromoting messages sent from the desktop to the daemon process.
126
127// Notifies the daemon that a desktop integration process has been initialized.
128// |desktop_pipe| specifies the client end of the desktop pipe. It is to be
129// forwarded to the desktop environment stub.
[email protected]12066cb2012-10-25 03:25:43130IPC_MESSAGE_CONTROL1(ChromotingDesktopDaemonMsg_DesktopAttached,
sammce66272fae2016-11-01 03:49:04131 IPC::ChannelHandle /* desktop_pipe */)
[email protected]ff72dd12012-11-27 05:18:25132
[email protected]0dffd552012-12-07 01:08:09133// Asks the daemon to inject Secure Attention Sequence (SAS) in the session
134// where the desktop process is running.
135IPC_MESSAGE_CONTROL0(ChromotingDesktopDaemonMsg_InjectSas)
136
[email protected]ff72dd12012-11-27 05:18:25137//-----------------------------------------------------------------------------
138// Chromoting messages sent from the desktop to the network process.
139
[email protected]b9ed58f2013-05-16 10:45:24140// Notifies the network process that a shared buffer has been created.
[email protected]ff72dd12012-11-27 05:18:25141IPC_MESSAGE_CONTROL3(ChromotingDesktopNetworkMsg_CreateSharedBuffer,
142 int /* id */,
erikchen9e1ffaa2015-12-29 23:42:18143 base::SharedMemoryHandle /* handle */,
avic5960f32015-12-22 22:49:48144 uint32_t /* size */)
[email protected]ff72dd12012-11-27 05:18:25145
146// Request the network process to stop using a shared buffer.
147IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_ReleaseSharedBuffer,
148 int /* id */)
149
[email protected]b9ed58f2013-05-16 10:45:24150// Serialized webrtc::DesktopFrame.
151IPC_STRUCT_BEGIN(SerializedDesktopFrame)
[email protected]ff72dd12012-11-27 05:18:25152 // ID of the shared memory buffer containing the pixels.
153 IPC_STRUCT_MEMBER(int, shared_buffer_id)
154
[email protected]0d1559662012-11-27 20:23:11155 // Width of a single row of pixels in bytes.
156 IPC_STRUCT_MEMBER(int, bytes_per_row)
157
[email protected]ff72dd12012-11-27 05:18:25158 // Captured region.
[email protected]b9ed58f2013-05-16 10:45:24159 IPC_STRUCT_MEMBER(std::vector<webrtc::DesktopRect>, dirty_region)
[email protected]ff72dd12012-11-27 05:18:25160
[email protected]739e2802013-03-18 01:03:48161 // Dimensions of the buffer in pixels.
[email protected]b9ed58f2013-05-16 10:45:24162 IPC_STRUCT_MEMBER(webrtc::DesktopSize, dimensions)
[email protected]ff72dd12012-11-27 05:18:25163
[email protected]ff72dd12012-11-27 05:18:25164 // Time spent in capture. Unit is in milliseconds.
avic5960f32015-12-22 22:49:48165 IPC_STRUCT_MEMBER(int64_t, capture_time_ms)
[email protected]ff72dd12012-11-27 05:18:25166
sergeyuc258bd4b2015-01-08 20:57:50167 // Latest event timestamp supplied by the client for performance tracking.
avic5960f32015-12-22 22:49:48168 IPC_STRUCT_MEMBER(int64_t, latest_event_timestamp)
[email protected]ff72dd12012-11-27 05:18:25169
170 // DPI for this frame.
[email protected]b9ed58f2013-05-16 10:45:24171 IPC_STRUCT_MEMBER(webrtc::DesktopVector, dpi)
zijiehea1336afb2017-04-28 05:29:28172
173 // Capturer Id
174 IPC_STRUCT_MEMBER(uint32_t, capturer_id)
[email protected]ff72dd12012-11-27 05:18:25175IPC_STRUCT_END()
176
sergeyu546cbaa2016-06-17 20:39:32177IPC_ENUM_TRAITS_MAX_VALUE(webrtc::DesktopCapturer::Result,
178 webrtc::DesktopCapturer::Result::MAX_VALUE)
179
[email protected]ff72dd12012-11-27 05:18:25180// Notifies the network process that a shared buffer has been created.
sergeyu546cbaa2016-06-17 20:39:32181IPC_MESSAGE_CONTROL2(ChromotingDesktopNetworkMsg_CaptureResult,
182 webrtc::DesktopCapturer::Result /* result */,
183 SerializedDesktopFrame /* frame */)
[email protected]ff72dd12012-11-27 05:18:25184
[email protected]718daba2012-11-28 21:00:20185// Carries a cursor share update from the desktop session agent to the client.
[email protected]20013202014-08-08 06:33:50186IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_MouseCursor,
187 webrtc::MouseCursor /* cursor */ )
[email protected]ff72dd12012-11-27 05:18:25188
[email protected]31014af2012-11-30 04:04:57189// Carries a clipboard event from the desktop session agent to the client.
190// |serialized_event| is a serialized protocol::ClipboardEvent.
191IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_InjectClipboardEvent,
192 std::string /* serialized_event */ )
193
sergeyuec77d8542015-11-03 22:31:00194IPC_ENUM_TRAITS_MAX_VALUE(remoting::protocol::ErrorCode,
195 remoting::protocol::ERROR_CODE_MAX)
196
[email protected]a031c972012-12-27 20:10:40197// Requests the network process to terminate the client session.
sergeyuec77d8542015-11-03 22:31:00198IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_DisconnectSession,
199 remoting::protocol::ErrorCode /* error */)
[email protected]a031c972012-12-27 20:10:40200
[email protected]1c969e32012-12-27 22:57:49201// Carries an audio packet from the desktop session agent to the client.
202// |serialized_packet| is a serialized AudioPacket.
203IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_AudioPacket,
204 std::string /* serialized_packet */ )
205
[email protected]ff72dd12012-11-27 05:18:25206//-----------------------------------------------------------------------------
207// Chromoting messages sent from the network to the desktop process.
208
[email protected]a031c972012-12-27 20:10:40209// Passes the client session data to the desktop session agent and starts it.
210// This must be the first message received from the host.
[email protected]96361d02013-05-08 18:26:18211IPC_MESSAGE_CONTROL3(ChromotingNetworkDesktopMsg_StartSessionAgent,
[email protected]6f526ce2013-03-18 04:38:56212 std::string /* authenticated_jid */,
[email protected]96361d02013-05-08 18:26:18213 remoting::ScreenResolution /* resolution */,
sergeyuc986f522016-11-28 22:51:01214 remoting::DesktopEnvironmentOptions /* options */)
[email protected]a031c972012-12-27 20:10:40215
[email protected]ff72dd12012-11-27 05:18:25216IPC_MESSAGE_CONTROL0(ChromotingNetworkDesktopMsg_CaptureFrame)
[email protected]31014af2012-11-30 04:04:57217
218// Carries a clipboard event from the client to the desktop session agent.
219// |serialized_event| is a serialized protocol::ClipboardEvent.
220IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectClipboardEvent,
221 std::string /* serialized_event */ )
222
223// Carries a keyboard event from the client to the desktop session agent.
224// |serialized_event| is a serialized protocol::KeyEvent.
225IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectKeyEvent,
226 std::string /* serialized_event */ )
227
[email protected]529bbd12014-03-27 20:25:39228// Carries a keyboard event from the client to the desktop session agent.
229// |serialized_event| is a serialized protocol::TextEvent.
230IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectTextEvent,
231 std::string /* serialized_event */ )
232
[email protected]31014af2012-11-30 04:04:57233// Carries a mouse event from the client to the desktop session agent.
234// |serialized_event| is a serialized protocol::MouseEvent.
235IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectMouseEvent,
236 std::string /* serialized_event */ )
[email protected]6f526ce2013-03-18 04:38:56237
rkuroiwad11ebf02015-03-06 01:31:45238// Carries a touch event from the client to the desktop session agent.
239// |serialized_event| is a serialized protocol::TouchEvent.
240IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectTouchEvent,
241 std::string /* serialized_event */ )
242
[email protected]6f526ce2013-03-18 04:38:56243// Changes the screen resolution in the desktop session.
244IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_SetScreenResolution,
245 remoting::ScreenResolution /* resolution */)
joedow99d59d42016-03-14 20:12:43246
247//---------------------------------------------------------------------
248// Chromoting messages sent from the remote_security_key process to the
249// network process.
250
251// The array of bytes representing a security key request to be sent to the
252// remote client.
253IPC_MESSAGE_CONTROL1(ChromotingRemoteSecurityKeyToNetworkMsg_Request,
254 std::string /* request bytes */)
255
256//---------------------------------------------------------
257// Chromoting messages sent from the network process to the remote_security_key
sammcb90d19c2016-11-08 09:44:07258// process.
joedow99d59d42016-03-14 20:12:43259
joedowafdd0e92016-12-20 03:01:34260// The array of bytes representing the security key response from the client.
joedow99d59d42016-03-14 20:12:43261IPC_MESSAGE_CONTROL1(ChromotingNetworkToRemoteSecurityKeyMsg_Response,
martijna46bd47a2016-04-06 18:05:48262 std::string /* response bytes */)
joedowafdd0e92016-12-20 03:01:34263
264// Indicates the channel used for security key message passing is ready for use.
265IPC_MESSAGE_CONTROL0(ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionReady)
266
267// Error indicating the request originated from outside the remoted session.
268// The IPC channel will be disconnected after this message has been sent.
269IPC_MESSAGE_CONTROL0(ChromotingNetworkToRemoteSecurityKeyMsg_InvalidSession)
zijiehe36763d82017-06-19 23:52:31270
271// Starts to report process resource usage.
272IPC_MESSAGE_CONTROL1(ChromotingNetworkToAnyMsg_StartProcessStatsReport,
273 base::TimeDelta /* interval */)
274
275// Stops to report process resource usage.
276IPC_MESSAGE_CONTROL0(ChromotingNetworkToAnyMsg_StopProcessStatsReport)
277
278// Reports process resource usage to network process.
279IPC_MESSAGE_CONTROL1(ChromotingAnyToNetworkMsg_ReportProcessStats,
280 remoting::protocol::AggregatedProcessResourceUsage)