VirtualBox

source: vbox/trunk/include/VBox/GuestHost/GuestControl.h@ 75824

Last change on this file since 75824 was 75824, checked in by vboxsync, 6 years ago

VBoxGuestControl: Optimizing message handling - part 4. bugref:9313

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.8 KB
Line 
1/* $Id: GuestControl.h 75824 2018-11-29 22:12:53Z vboxsync $ */
2/** @file
3 * Guest Control - Common Guest and Host Code.
4 *
5 * @todo r=bird: Just merge this with GuestControlSvc.h!
6 */
7
8/*
9 * Copyright (C) 2016-2018 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 *
19 * The contents of this file may alternatively be used under the terms
20 * of the Common Development and Distribution License Version 1.0
21 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
22 * VirtualBox OSE distribution, in which case the provisions of the
23 * CDDL are applicable instead of those of the GPL.
24 *
25 * You may elect to license modified versions of this file under the
26 * terms and conditions of either the GPL or the CDDL or both.
27 */
28
29#ifndef ___VBox_GuestHost_GuestControl_h
30#define ___VBox_GuestHost_GuestControl_h
31
32#include <iprt/types.h>
33
34/* Everything defined in this file lives in this namespace. */
35namespace guestControl {
36
37/**
38 * Process status when executed in the guest.
39 */
40enum eProcessStatus
41{
42 /** Process is in an undefined state. */
43 PROC_STS_UNDEFINED = 0,
44 /** Process has been started. */
45 PROC_STS_STARTED = 1,
46 /** Process terminated normally. */
47 PROC_STS_TEN = 2,
48 /** Process terminated via signal. */
49 PROC_STS_TES = 3,
50 /** Process terminated abnormally. */
51 PROC_STS_TEA = 4,
52 /** Process timed out and was killed. */
53 PROC_STS_TOK = 5,
54 /** Process timed out and was not killed successfully. */
55 PROC_STS_TOA = 6,
56 /** Service/OS is stopping, process was killed. */
57 PROC_STS_DWN = 7,
58 /** Something went wrong (error code in flags). */
59 PROC_STS_ERROR = 8
60};
61
62/** @todo r=bird: Most defines in this file needs to be scoped a little
63 * better! For instance INPUT_FLAG_NONE is very generic. */
64
65/**
66 * Input flags, set by the host. This is needed for
67 * handling flags on the guest side.
68 * Note: Has to match Main's ProcessInputFlag_* flags!
69 */
70#define INPUT_FLAG_NONE 0x0
71#define INPUT_FLAG_EOF RT_BIT(0)
72
73/**
74 * Guest session creation flags.
75 * Only handled internally at the moment.
76 */
77#define SESSIONCREATIONFLAG_NONE 0x0
78
79/** @name DIRREMOVE_FLAG_XXX - Guest directory removement flags.
80 * Essentially using what IPRT's RTDIRRMREC_F_
81 * defines have to offer.
82 * @{
83 */
84#define DIRREMOVE_FLAG_RECURSIVE RT_BIT(0)
85/** Delete the content of the directory and the directory itself. */
86#define DIRREMOVE_FLAG_CONTENT_AND_DIR RT_BIT(1)
87/** Only delete the content of the directory, omit the directory it self. */
88#define DIRREMOVE_FLAG_CONTENT_ONLY RT_BIT(2)
89/** Mask of valid flags. */
90#define DIRREMOVE_FLAG_VALID_MASK UINT32_C(0x00000003)
91/** @} */
92
93/** @name EXECUTEPROCESSFLAG_XXX - Guest process creation flags.
94 * @note Has to match Main's ProcessCreateFlag_* flags!
95 * @{
96 */
97#define EXECUTEPROCESSFLAG_NONE UINT32_C(0x0)
98#define EXECUTEPROCESSFLAG_WAIT_START RT_BIT(0)
99#define EXECUTEPROCESSFLAG_IGNORE_ORPHANED RT_BIT(1)
100#define EXECUTEPROCESSFLAG_HIDDEN RT_BIT(2)
101#define EXECUTEPROCESSFLAG_PROFILE RT_BIT(3)
102#define EXECUTEPROCESSFLAG_WAIT_STDOUT RT_BIT(4)
103#define EXECUTEPROCESSFLAG_WAIT_STDERR RT_BIT(5)
104#define EXECUTEPROCESSFLAG_EXPAND_ARGUMENTS RT_BIT(6)
105#define EXECUTEPROCESSFLAG_UNQUOTED_ARGS RT_BIT(7)
106/** @} */
107
108/** @name OUTPUT_HANDLE_ID_XXX - Pipe handle IDs used internally for referencing
109 * to a certain pipe buffer.
110 * @{
111 */
112#define OUTPUT_HANDLE_ID_STDOUT_DEPRECATED 0 /**< Needed for VBox hosts < 4.1.0. */
113#define OUTPUT_HANDLE_ID_STDOUT 1
114#define OUTPUT_HANDLE_ID_STDERR 2
115/** @} */
116
117/** @name PATHRENAME_FLAG_XXX - Guest path rename flags.
118 * Essentially using what IPRT's RTPATHRENAME_FLAGS_XXX have to offer.
119 * @{
120 */
121/** Do not replace anything. */
122#define PATHRENAME_FLAG_NO_REPLACE UINT32_C(0)
123/** This will replace attempt any target which isn't a directory. */
124#define PATHRENAME_FLAG_REPLACE RT_BIT(0)
125/** Don't allow symbolic links as part of the path. */
126#define PATHRENAME_FLAG_NO_SYMLINKS RT_BIT(1)
127/** Mask of valid flags. */
128#define PATHRENAME_FLAG_VALID_MASK UINT32_C(0x00000003)
129/** @} */
130
131/** @name Defines for guest process array lengths.
132 * @{
133 */
134#define GUESTPROCESS_MAX_CMD_LEN _1K
135#define GUESTPROCESS_MAX_ARGS_LEN _1K
136#define GUESTPROCESS_MAX_ENV_LEN _64K
137#define GUESTPROCESS_MAX_USER_LEN 128
138#define GUESTPROCESS_MAX_PASSWORD_LEN 128
139#define GUESTPROCESS_MAX_DOMAIN_LEN 256
140/** @} */
141
142/** @name Internal tools built into VBoxService which are used in order
143 * to accomplish tasks host<->guest.
144 * @{
145 */
146#define VBOXSERVICE_TOOL_CAT "vbox_cat"
147#define VBOXSERVICE_TOOL_LS "vbox_ls"
148#define VBOXSERVICE_TOOL_RM "vbox_rm"
149#define VBOXSERVICE_TOOL_MKDIR "vbox_mkdir"
150#define VBOXSERVICE_TOOL_MKTEMP "vbox_mktemp"
151#define VBOXSERVICE_TOOL_STAT "vbox_stat"
152/** @} */
153
154/** Special process exit codes for "vbox_cat". */
155typedef enum VBOXSERVICETOOLBOX_CAT_EXITCODE
156{
157 VBOXSERVICETOOLBOX_CAT_EXITCODE_ACCESS_DENIED = RTEXITCODE_END,
158 VBOXSERVICETOOLBOX_CAT_EXITCODE_FILE_NOT_FOUND,
159 VBOXSERVICETOOLBOX_CAT_EXITCODE_PATH_NOT_FOUND,
160 VBOXSERVICETOOLBOX_CAT_EXITCODE_SHARING_VIOLATION,
161 VBOXSERVICETOOLBOX_CAT_EXITCODE_IS_A_DIRECTORY,
162 /** The usual 32-bit type hack. */
163 VBOXSERVICETOOLBOX_CAT_32BIT_HACK = 0x7fffffff
164} VBOXSERVICETOOLBOX_CAT_EXITCODE;
165
166/** Special process exit codes for "vbox_stat". */
167typedef enum VBOXSERVICETOOLBOX_STAT_EXITCODE
168{
169 VBOXSERVICETOOLBOX_STAT_EXITCODE_ACCESS_DENIED = RTEXITCODE_END,
170 VBOXSERVICETOOLBOX_STAT_EXITCODE_FILE_NOT_FOUND,
171 VBOXSERVICETOOLBOX_STAT_EXITCODE_PATH_NOT_FOUND,
172 VBOXSERVICETOOLBOX_STAT_EXITCODE_NET_PATH_NOT_FOUND,
173 /** The usual 32-bit type hack. */
174 VBOXSERVICETOOLBOX_STAT_32BIT_HACK = 0x7fffffff
175} VBOXSERVICETOOLBOX_STAT_EXITCODE;
176
177/**
178 * Input status, reported by the client.
179 */
180enum eInputStatus
181{
182 /** Input is in an undefined state. */
183 INPUT_STS_UNDEFINED = 0,
184 /** Input was written (partially, see cbProcessed). */
185 INPUT_STS_WRITTEN = 1,
186 /** Input failed with an error (see flags for rc). */
187 INPUT_STS_ERROR = 20,
188 /** Process has abandoned / terminated input handling. */
189 INPUT_STS_TERMINATED = 21,
190 /** Too much input data. */
191 INPUT_STS_OVERFLOW = 30
192};
193
194
195
196} /* namespace guestControl */
197
198#endif /* !___VBox_GuestHost_GuestControl_h */
199
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