VirtualBox

source: vbox/trunk/include/VBox/HostServices/GuestControlSvc.h@ 28231

Last change on this file since 28231 was 28231, checked in by vboxsync, 15 years ago

OSE header fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.3 KB
Line 
1/** @file
2 * Guest control service:
3 * Common header for host service and guest clients.
4 */
5
6/*
7 * Copyright (C) 2010 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31#ifndef ___VBox_HostService_GuestControlService_h
32#define ___VBox_HostService_GuestControlService_h
33
34#include <VBox/types.h>
35#include <VBox/VMMDev.h>
36#include <VBox/VBoxGuest2.h>
37#include <VBox/hgcmsvc.h>
38#include <VBox/log.h>
39#include <iprt/assert.h>
40#include <iprt/string.h>
41
42/** Everything defined in this file lives in this namespace. */
43namespace guestControl {
44
45/******************************************************************************
46* Typedefs, constants and inlines *
47******************************************************************************/
48
49/**
50 * Data structure to pass to the service extension callback. We use this to
51 * notify the host of changes to properties.
52 */
53typedef struct _HOSTCALLBACKDATA
54{
55 /** Magic number to identify the structure */
56 uint32_t u32Magic;
57
58} HOSTCALLBACKDATA, *PHOSTCALLBACKDATA;
59
60enum
61{
62 /** Magic number for sanity checking the HOSTCALLBACKDATA structure */
63 HOSTCALLBACKMAGIC = 0x26011982
64};
65
66/**
67 * Process status when executed in the guest.
68 */
69enum eProcessStatus
70{
71 PROC_STATUS_STARTED = 1,
72
73 PROC_STATUS_TERMINATED = 2
74};
75
76/**
77 * The service functions which are callable by host.
78 */
79enum eHostFn
80{
81 /**
82 * The host wants to execute something in the guest. This can be a command line
83 * or starting a program.
84 */
85 HOST_EXEC_CMD = 1,
86 /**
87 * Sends input data for stdin to a running process executed by HOST_EXEC_CMD.
88 */
89 HOST_EXEC_SEND_STDIN = 2,
90 /**
91 * Gets the current status of a running process, e.g.
92 * new data on stdout/stderr, process terminated etc.
93 */
94 HOST_EXEC_GET_STATUS = 3
95};
96
97/**
98 * The service functions which are called by guest. The numbers may not change,
99 * so we hardcode them.
100 */
101enum eGuestFn
102{
103 /**
104 * TODO
105 */
106 GUEST_GET_HOST_MSG = 1,
107 /**
108 * TODO
109 */
110 GUEST_EXEC_SEND_STDOUT = 3,
111 /**
112 * TODO
113 */
114 GUEST_EXEC_SEND_STDERR = 4,
115 /**
116 * TODO
117 */
118 GUEST_EXEC_SEND_STATUS = 5
119};
120
121/**
122 * Sub host commands. These commands are stored as first (=0) parameter in a GUEST_GET_HOST_MSG
123 * so that the guest can react dynamically to requests from the host.
124 */
125enum eGetHostMsgFn
126{
127 /**
128 * The host wants to execute something in the guest. This can be a command line
129 * or starting a program.
130 */
131 GETHOSTMSG_EXEC_CMD = 1,
132 /**
133 * Sends input data for stdin to a running process executed by HOST_EXEC_CMD.
134 */
135 GETHOSTMSG_EXEC_STDIN = 2
136};
137
138/*
139 * HGCM parameter structures.
140 */
141#pragma pack (1)
142typedef struct _VBoxGuestCtrlHGCMMsgType
143{
144 VBoxGuestHGCMCallInfo hdr;
145
146 /**
147 * The returned command the host wants to
148 * execute on the guest.
149 */
150 HGCMFunctionParameter msg; /* OUT uint32_t */
151
152 HGCMFunctionParameter num_parms; /* OUT uint32_t */
153
154} VBoxGuestCtrlHGCMMsgType;
155
156typedef struct _VBoxGuestCtrlHGCMMsgExecCmd
157{
158 VBoxGuestHGCMCallInfo hdr;
159
160 HGCMFunctionParameter cmd;
161
162 HGCMFunctionParameter flags;
163
164 HGCMFunctionParameter num_args;
165
166 HGCMFunctionParameter args;
167
168 HGCMFunctionParameter num_env;
169 /** Size (in bytes) of environment block, including terminating zeros. */
170 HGCMFunctionParameter cb_env;
171
172 HGCMFunctionParameter env;
173
174 HGCMFunctionParameter std_in;
175
176 HGCMFunctionParameter std_out;
177
178 HGCMFunctionParameter std_err;
179
180 HGCMFunctionParameter username;
181
182 HGCMFunctionParameter password;
183
184 HGCMFunctionParameter timeout;
185
186} VBoxGuestCtrlHGCMMsgExecCmd;
187
188typedef struct _VBoxGuestCtrlHGCMMsgExecStatus
189{
190 VBoxGuestHGCMCallInfo hdr;
191
192 HGCMFunctionParameter pid;
193
194 HGCMFunctionParameter status;
195
196 HGCMFunctionParameter flags;
197
198 HGCMFunctionParameter data;
199
200} VBoxGuestCtrlHGCMMsgExecStatus;
201#pragma pack ()
202
203/* Structure for buffering execution requests in the host service. */
204typedef struct _VBoxGuestCtrlParamBuffer
205{
206 uint32_t uParmCount;
207 VBOXHGCMSVCPARM *pParms;
208} VBOXGUESTCTRPARAMBUFFER, *PVBOXGUESTCTRPARAMBUFFER;
209
210} /* namespace guestControl */
211
212#endif /* ___VBox_HostService_GuestControlService_h defined */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette