1
/*********************************************************
2
* Copyright (C) 2008 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
* open files, applications or URLs in either guest or host.
28
* Enumerates the different versions of the messages.
30
enum GHIShellActionVersion {
31
GHI_SHELL_ACTION_V1 = 1
35
* The Windows MAX_PATH define specifies that paths may be up to 260 character
36
* units in length. To allow for expansion when going to UTF8 we multiply that
39
const GHI_SHELL_ACTION_URI_MAX_SIZE = 1040;
42
* Maximum size of a location URI - although RFC2397 doesn't define a max size
43
* for a URI some browsers may limit the URI size so we define a hard limit
44
* for URI's at 8K in length (this matches a limit in IE8 for example)
46
const GHI_SHELL_ACTION_LOCATION_MAX_SIZE = 8192;
49
* Maximum number of locations that may be encoded in a single
52
const GHI_SHELL_ACTION_MAX_NUM_LOCATIONS = 32;
54
struct GHIShellActionLocation {
55
string location<GHI_SHELL_ACTION_LOCATION_MAX_SIZE>;
58
struct GHIShellActionV1 {
60
* The actionURI - typically something like x-vmware-action:///run or
61
* x-vmware-action:///browse.
63
string actionURI<GHI_SHELL_ACTION_URI_MAX_SIZE>;
66
* The target of the action - may be a URI encoded path to an executable.
68
string targetURI<GHI_SHELL_ACTION_URI_MAX_SIZE>;
71
* A list of locations to be operated on using the actionURI and targetURI.
73
struct GHIShellActionLocation locations<GHI_SHELL_ACTION_MAX_NUM_LOCATIONS>;
77
* This defines the protocol for a 'shellAction' messages. The union allows
78
* us to create new versions of the protocol later by creating new values
79
* in the GHIShellActionVersion enumeration, without having to change much of
80
* the code calling the (de)serialization functions.
82
* Since the union doesn't have a default case, de-serialization will fail
83
* if an unknown version is provided on the wire.
85
union GHIShellAction switch (GHIShellActionVersion ver) {
86
case GHI_SHELL_ACTION_V1:
87
struct GHIShellActionV1 *actionV1;