1
/*********************************************************
2
* Copyright (C) 2009 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
22
* Definition of the data structures used in the GuestRpc commands to
23
* enable/disable and manipulate unity.
25
* XXX: We should move unityActive.x into this file to avoid a 'plethora' of XDR
30
* Include unityCommon for the definitions of the types of operations.
32
%#include "unityCommon.h"
35
* Enumerates the different versions of the messages.
37
enum UnityOptionsVersion {
42
* The structure used for version 1 of the message.
44
struct UnityOptionsV1 {
49
* This defines the protocol for a 'unityOptions' message.
51
* The union allows us to introduce new versions of the protocol later by
52
* creating new values in the enumeration, without having to change much of
53
* the code calling the (de)serialization functions.
55
* Since the union doesn't have a default case, de-serialization will fail if
56
* an unknown version is provided on the wire.
58
union UnityOptions switch (UnityOptionsVersion ver) {
59
case UNITY_OPTIONS_V1:
60
struct UnityOptionsV1 *unityOptionsV1;
65
* Unity Request, Confirm and Acknowledge XDR structures.
67
* The guest will request (from the host) that it be allowed to perform certain types
68
* of window operations - for example minimize, the host will later confirm that the
69
* guest can (or cannot) go ahead with the operation. Once the guest has performed
70
* the requested operation it will acknowledge its completion back to the host.
71
* In many ways this is analagous to the three way handshaking used by TCP.
75
* Enumerates the different versions of the messages. Note that all three types of
76
* messages (request, confirm, acknowledge) share the same version value. They must
77
* be managed together when updating versions.
79
enum UnityOperationVersion {
84
* The structure used to distinguish the operations of the message.
86
union UnityOperationDetails switch (int op) {
88
int dummy; /* Dummy value to avoid empty union */
91
struct UnityRequestOperationV1 {
93
* sequence should be used to associate a request with a later confirmation so that
94
* state can be maintained within the guest as to oustanding requests (or to set
95
* an error for requests that must maintain order and do not reflect the order
100
UnityOperationDetails details;
103
struct UnityConfirmOperationV1 {
106
UnityOperationDetails details;
111
* This defines the protocol for a 'unityRequestOperation' message.
113
* The union allows us to introduce new versions of the protocol later by
114
* creating new values in the enumeration, without having to change much of
115
* the code calling the (de)serialization functions.
117
* Since the union doesn't have a default case, de-serialization will fail if
118
* an unknown version is provided on the wire.
120
union UnityRequestOperation switch (UnityOperationVersion ver) {
122
struct UnityRequestOperationV1 *unityRequestOpV1;
125
union UnityConfirmOperation switch (UnityOperationVersion ver) {
127
struct UnityConfirmOperationV1 *unityConfirmOpV1;
131
* Protocol to send the scraped/grabbed contents of a window to the host.
133
enum UnityWindowContentsVersion {
134
UNITY_WINDOW_CONTENTS_V1 = 1
139
* Message used to begin the transfer of the scraped window contents to the
142
struct UnityWindowContentsStartV1
144
uint32 windowID; /* The UnityWindowId of the window. */
145
uint32 imageWidth; /* The width of the image. */
146
uint32 imageHeight; /* The height of the image. */
147
uint32 imageLength; /* The total length of the data for the image. */
152
* Message used to signal the end of the transfer of the scraped window contents
155
struct UnityWindowContentsEndV1
157
uint32 windowID; /* The UnityWindowId of the window. */
162
* The maximum size of the image data in a UnityWindowContentsChunk.
164
const UNITY_WINDOW_CONTENTS_MAX_CHUNK_SIZE = 49152;
167
* Message used to transfer a portion of the scraped window contents to the
170
struct UnityWindowContentsChunkV1
172
uint32 windowID; /* The UnityWindowId of the window. */
173
uint32 chunkID; /* The sequence number of this chunk. */
174
opaque data<UNITY_WINDOW_CONTENTS_MAX_CHUNK_SIZE>;
178
union UnityWindowContentsChunk switch (UnityWindowContentsVersion ver) {
179
case UNITY_WINDOW_CONTENTS_V1:
180
struct UnityWindowContentsChunkV1 *chunkV1;
184
union UnityWindowContentsStart switch (UnityWindowContentsVersion ver) {
185
case UNITY_WINDOW_CONTENTS_V1:
186
struct UnityWindowContentsStartV1 *startV1;
190
union UnityWindowContentsEnd switch (UnityWindowContentsVersion ver) {
191
case UNITY_WINDOW_CONTENTS_V1:
192
struct UnityWindowContentsEndV1 *endV1;
197
* Protocol to request the contents for a list of Unity windows.
199
const UNITY_MAX_NUM_WINDOWS_PER_REQUEST = 256;
201
struct UnityWindowContentsRequestV1 {
202
uint32 windowID<UNITY_MAX_NUM_WINDOWS_PER_REQUEST>;
205
union UnityWindowContentsRequest switch (UnityWindowContentsVersion ver) {
206
case UNITY_WINDOW_CONTENTS_V1:
207
struct UnityWindowContentsRequestV1 *requestV1;
211
* Message used to register the presence of a PBRPC server in the guest for
212
* handling Unity & GHI operations. This message is sent by the guest to
213
* bootstrap the process of talking via a 'non-backdoor' channel between guest
217
const UNITY_REGISTER_PBRPCSERVER_ADDRESS_LEN = 256;
219
enum UnityRegisterPbrpcServerVersion {
220
UNITY_REGISTER_PBRPCSERVER_V1 = 1
223
struct UnityRegisterPbrpcServerV1 {
224
uint32 addressFamily;
225
string address<UNITY_REGISTER_PBRPCSERVER_ADDRESS_LEN>;
229
union UnityRegisterPbrpcServer switch (UnityRegisterPbrpcServerVersion ver) {
230
case UNITY_REGISTER_PBRPCSERVER_V1:
231
struct UnityRegisterPbrpcServerV1* registerV1;
239
enum UnityMouseWheelVersion {
240
UNITY_MOUSE_WHEEL_V1 = 1
243
struct UnityMouseWheelV1
248
uint32 modifierFlags;
251
union UnityMouseWheel switch (UnityMouseWheelVersion ver) {
252
case UNITY_MOUSE_WHEEL_V1:
253
struct UnityMouseWheelV1 *mouseWheelV1;