~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to services/plugins/unity/unity.x

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********************************************************
 
2
 * Copyright (C) 2009 VMware, Inc. All rights reserved.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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.
 
16
 *
 
17
 *********************************************************/
 
18
 
 
19
/*
 
20
 * unity.x --
 
21
 *
 
22
 *    Definition of the data structures used in the GuestRpc commands to
 
23
 *    enable/disable and manipulate unity.
 
24
 *
 
25
 *    XXX: We should move unityActive.x into this file to avoid a 'plethora' of XDR
 
26
 *    sources for Unity.
 
27
 */
 
28
 
 
29
/*
 
30
 * Include unityCommon for the definitions of the types of operations.
 
31
 */
 
32
%#include "unityCommon.h"
 
33
 
 
34
/*
 
35
 * Enumerates the different versions of the messages.
 
36
 */
 
37
enum UnityOptionsVersion {
 
38
  UNITY_OPTIONS_V1 = 1
 
39
};
 
40
 
 
41
/*
 
42
 * The structure used for version 1 of the message.
 
43
 */
 
44
struct UnityOptionsV1 {
 
45
  int featureMask;
 
46
};
 
47
 
 
48
/*
 
49
 * This defines the protocol for a 'unityOptions' message.
 
50
 *
 
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.
 
54
 *
 
55
 * Since the union doesn't have a default case, de-serialization will fail if
 
56
 * an unknown version is provided on the wire.
 
57
 */
 
58
union UnityOptions switch (UnityOptionsVersion ver) {
 
59
case UNITY_OPTIONS_V1:
 
60
   struct UnityOptionsV1 *unityOptionsV1;
 
61
};
 
62
 
 
63
 
 
64
/*
 
65
 * Unity Request, Confirm and Acknowledge XDR structures.
 
66
 *
 
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.
 
72
 */
 
73
 
 
74
/*
 
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.
 
78
 */
 
79
enum UnityOperationVersion {
 
80
  UNITY_OP_V1 = 1
 
81
};
 
82
 
 
83
/*
 
84
 * The structure used to distinguish the operations of the message.
 
85
 */
 
86
union UnityOperationDetails switch (int op) {
 
87
case MINIMIZE:
 
88
   int dummy;        /* Dummy value to avoid empty union */
 
89
};
 
90
 
 
91
struct UnityRequestOperationV1 {
 
92
  /*
 
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
 
96
   * back correctly.).
 
97
   */
 
98
   int sequence;
 
99
   int windowId;
 
100
   UnityOperationDetails details;
 
101
};
 
102
 
 
103
struct UnityConfirmOperationV1 {
 
104
   int sequence;
 
105
   int windowId;
 
106
   UnityOperationDetails details;
 
107
   bool allow;
 
108
};
 
109
 
 
110
/*
 
111
 * This defines the protocol for a 'unityRequestOperation' message.
 
112
 *
 
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.
 
116
 *
 
117
 * Since the union doesn't have a default case, de-serialization will fail if
 
118
 * an unknown version is provided on the wire.
 
119
 */
 
120
union UnityRequestOperation switch (UnityOperationVersion ver) {
 
121
case UNITY_OP_V1:
 
122
   struct UnityRequestOperationV1 *unityRequestOpV1;
 
123
};
 
124
 
 
125
union UnityConfirmOperation switch (UnityOperationVersion ver) {
 
126
case UNITY_OP_V1:
 
127
   struct UnityConfirmOperationV1 *unityConfirmOpV1;
 
128
};
 
129
 
 
130
/*
 
131
 * Protocol to send the scraped/grabbed contents of a window to the host.
 
132
 */
 
133
enum UnityWindowContentsVersion {
 
134
   UNITY_WINDOW_CONTENTS_V1 = 1
 
135
};
 
136
 
 
137
 
 
138
/*
 
139
 * Message used to begin the transfer of the scraped window contents to the
 
140
 * host.
 
141
 */
 
142
struct UnityWindowContentsStartV1
 
143
{
 
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. */
 
148
};
 
149
 
 
150
 
 
151
/*
 
152
 * Message used to signal the end of the transfer of the scraped window contents
 
153
 * to the host.
 
154
 */
 
155
struct UnityWindowContentsEndV1
 
156
{
 
157
   uint32 windowID;       /* The UnityWindowId of the window. */
 
158
};
 
159
 
 
160
 
 
161
/*
 
162
 * The maximum size of the image data in a UnityWindowContentsChunk.
 
163
 */
 
164
const UNITY_WINDOW_CONTENTS_MAX_CHUNK_SIZE = 49152;
 
165
 
 
166
/*
 
167
 * Message used to transfer a portion of the scraped window contents to the
 
168
 * host.
 
169
 */
 
170
struct UnityWindowContentsChunkV1
 
171
{
 
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>;
 
175
};
 
176
 
 
177
 
 
178
union UnityWindowContentsChunk switch (UnityWindowContentsVersion ver) {
 
179
case UNITY_WINDOW_CONTENTS_V1:
 
180
   struct UnityWindowContentsChunkV1 *chunkV1;
 
181
};
 
182
 
 
183
 
 
184
union UnityWindowContentsStart switch (UnityWindowContentsVersion ver) {
 
185
case UNITY_WINDOW_CONTENTS_V1:
 
186
   struct UnityWindowContentsStartV1 *startV1;
 
187
};
 
188
 
 
189
 
 
190
union UnityWindowContentsEnd switch (UnityWindowContentsVersion ver) {
 
191
case UNITY_WINDOW_CONTENTS_V1:
 
192
   struct UnityWindowContentsEndV1 *endV1;
 
193
};
 
194
 
 
195
 
 
196
/*
 
197
 * Protocol to request the contents for a list of Unity windows.
 
198
 */
 
199
const UNITY_MAX_NUM_WINDOWS_PER_REQUEST = 256;
 
200
 
 
201
struct UnityWindowContentsRequestV1 {
 
202
   uint32 windowID<UNITY_MAX_NUM_WINDOWS_PER_REQUEST>;
 
203
};
 
204
 
 
205
union UnityWindowContentsRequest switch (UnityWindowContentsVersion ver) {
 
206
case UNITY_WINDOW_CONTENTS_V1:
 
207
   struct UnityWindowContentsRequestV1 *requestV1;
 
208
};
 
209
 
 
210
/*
 
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
 
214
 * and host.
 
215
 */
 
216
 
 
217
const UNITY_REGISTER_PBRPCSERVER_ADDRESS_LEN = 256;
 
218
 
 
219
enum UnityRegisterPbrpcServerVersion {
 
220
   UNITY_REGISTER_PBRPCSERVER_V1 = 1
 
221
};
 
222
 
 
223
struct UnityRegisterPbrpcServerV1 {
 
224
   uint32 addressFamily;
 
225
   string address<UNITY_REGISTER_PBRPCSERVER_ADDRESS_LEN>;
 
226
   uint32 port;
 
227
};
 
228
 
 
229
union UnityRegisterPbrpcServer switch (UnityRegisterPbrpcServerVersion ver) {
 
230
case UNITY_REGISTER_PBRPCSERVER_V1:
 
231
   struct UnityRegisterPbrpcServerV1* registerV1;
 
232
};
 
233
 
 
234
 
 
235
/*
 
236
 * Mouse wheel.
 
237
 */
 
238
 
 
239
enum UnityMouseWheelVersion {
 
240
   UNITY_MOUSE_WHEEL_V1 = 1
 
241
};
 
242
 
 
243
struct UnityMouseWheelV1
 
244
{
 
245
   int32 deltaX;
 
246
   int32 deltaY;
 
247
   int32 deltaZ;
 
248
   uint32 modifierFlags;
 
249
};
 
250
 
 
251
union UnityMouseWheel switch (UnityMouseWheelVersion ver) {
 
252
case UNITY_MOUSE_WHEEL_V1:
 
253
   struct UnityMouseWheelV1 *mouseWheelV1;
 
254
};