VirtualBox

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

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

*: scm --fix-header-guard-endif

  • 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 76585 2019-01-01 06:31:29Z 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-2019 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_INCLUDED_GuestHost_GuestControl_h
30#define VBOX_INCLUDED_GuestHost_GuestControl_h
31#ifndef RT_WITHOUT_PRAGMA_ONCE
32# pragma once
33#endif
34
35#include <iprt/types.h>
36
37/* Everything defined in this file lives in this namespace. */
38namespace guestControl {
39
40/**
41 * Process status when executed in the guest.
42 */
43enum eProcessStatus
44{
45 /** Process is in an undefined state. */
46 PROC_STS_UNDEFINED = 0,
47 /** Process has been started. */
48 PROC_STS_STARTED = 1,
49 /** Process terminated normally. */
50 PROC_STS_TEN = 2,
51 /** Process terminated via signal. */
52 PROC_STS_TES = 3,
53 /** Process terminated abnormally. */
54 PROC_STS_TEA = 4,
55 /** Process timed out and was killed. */
56 PROC_STS_TOK = 5,
57 /** Process timed out and was not killed successfully. */
58 PROC_STS_TOA = 6,
59 /** Service/OS is stopping, process was killed. */
60 PROC_STS_DWN = 7,
61 /** Something went wrong (error code in flags). */
62 PROC_STS_ERROR = 8
63};
64
65/** @todo r=bird: Most defines in this file needs to be scoped a little
66 * better! For instance INPUT_FLAG_NONE is very generic. */
67
68/**
69 * Input flags, set by the host. This is needed for
70 * handling flags on the guest side.
71 * Note: Has to match Main's ProcessInputFlag_* flags!
72 */
73#define INPUT_FLAG_NONE 0x0
74#define INPUT_FLAG_EOF RT_BIT(0)
75
76/**
77 * Guest session creation flags.
78 * Only handled internally at the moment.
79 */
80#define SESSIONCREATIONFLAG_NONE 0x0
81
82/** @name DIRREMOVE_FLAG_XXX - Guest directory removement flags.
83 * Essentially using what IPRT's RTDIRRMREC_F_
84 * defines have to offer.
85 * @{
86 */
87#define DIRREMOVE_FLAG_RECURSIVE RT_BIT(0)
88/** Delete the content of the directory and the directory itself. */
89#define DIRREMOVE_FLAG_CONTENT_AND_DIR RT_BIT(1)
90/** Only delete the content of the directory, omit the directory it self. */
91#define DIRREMOVE_FLAG_CONTENT_ONLY RT_BIT(2)
92/** Mask of valid flags. */
93#define DIRREMOVE_FLAG_VALID_MASK UINT32_C(0x00000003)
94/** @} */
95
96/** @name EXECUTEPROCESSFLAG_XXX - Guest process creation flags.
97 * @note Has to match Main's ProcessCreateFlag_* flags!
98 * @{
99 */
100#define EXECUTEPROCESSFLAG_NONE UINT32_C(0x0)
101#define EXECUTEPROCESSFLAG_WAIT_START RT_BIT(0)
102#define EXECUTEPROCESSFLAG_IGNORE_ORPHANED RT_BIT(1)
103#define EXECUTEPROCESSFLAG_HIDDEN RT_BIT(2)
104#define EXECUTEPROCESSFLAG_PROFILE RT_BIT(3)
105#define EXECUTEPROCESSFLAG_WAIT_STDOUT RT_BIT(4)
106#define EXECUTEPROCESSFLAG_WAIT_STDERR RT_BIT(5)
107#define EXECUTEPROCESSFLAG_EXPAND_ARGUMENTS RT_BIT(6)
108#define EXECUTEPROCESSFLAG_UNQUOTED_ARGS RT_BIT(7)
109/** @} */
110
111/** @name OUTPUT_HANDLE_ID_XXX - Pipe handle IDs used internally for referencing
112 * to a certain pipe buffer.
113 * @{
114 */
115#define OUTPUT_HANDLE_ID_STDOUT_DEPRECATED 0 /**< Needed for VBox hosts < 4.1.0. */
116#define OUTPUT_HANDLE_ID_STDOUT 1
117#define OUTPUT_HANDLE_ID_STDERR 2
118/** @} */
119
120/** @name PATHRENAME_FLAG_XXX - Guest path rename flags.
121 * Essentially using what IPRT's RTPATHRENAME_FLAGS_XXX have to offer.
122 * @{
123 */
124/** Do not replace anything. */
125#define PATHRENAME_FLAG_NO_REPLACE UINT32_C(0)
126/** This will replace attempt any target which isn't a directory. */
127#define PATHRENAME_FLAG_REPLACE RT_BIT(0)
128/** Don't allow symbolic links as part of the path. */
129#define PATHRENAME_FLAG_NO_SYMLINKS RT_BIT(1)
130/** Mask of valid flags. */
131#define PATHRENAME_FLAG_VALID_MASK UINT32_C(0x00000003)
132/** @} */
133
134/** @name Defines for guest process array lengths.
135 * @{
136 */
137#define GUESTPROCESS_MAX_CMD_LEN _1K
138#define GUESTPROCESS_MAX_ARGS_LEN _1K
139#define GUESTPROCESS_MAX_ENV_LEN _64K
140#define GUESTPROCESS_MAX_USER_LEN 128
141#define GUESTPROCESS_MAX_PASSWORD_LEN 128
142#define GUESTPROCESS_MAX_DOMAIN_LEN 256
143/** @} */
144
145/** @name Internal tools built into VBoxService which are used in order
146 * to accomplish tasks host<->guest.
147 * @{
148 */
149#define VBOXSERVICE_TOOL_CAT "vbox_cat"
150#define VBOXSERVICE_TOOL_LS "vbox_ls"
151#define VBOXSERVICE_TOOL_RM "vbox_rm"
152#define VBOXSERVICE_TOOL_MKDIR "vbox_mkdir"
153#define VBOXSERVICE_TOOL_MKTEMP "vbox_mktemp"
154#define VBOXSERVICE_TOOL_STAT "vbox_stat"
155/** @} */
156
157/** Special process exit codes for "vbox_cat". */
158typedef enum VBOXSERVICETOOLBOX_CAT_EXITCODE
159{
160 VBOXSERVICETOOLBOX_CAT_EXITCODE_ACCESS_DENIED = RTEXITCODE_END,
161 VBOXSERVICETOOLBOX_CAT_EXITCODE_FILE_NOT_FOUND,
162 VBOXSERVICETOOLBOX_CAT_EXITCODE_PATH_NOT_FOUND,
163 VBOXSERVICETOOLBOX_CAT_EXITCODE_SHARING_VIOLATION,
164 VBOXSERVICETOOLBOX_CAT_EXITCODE_IS_A_DIRECTORY,
165 /** The usual 32-bit type hack. */
166 VBOXSERVICETOOLBOX_CAT_32BIT_HACK = 0x7fffffff
167} VBOXSERVICETOOLBOX_CAT_EXITCODE;
168
169/** Special process exit codes for "vbox_stat". */
170typedef enum VBOXSERVICETOOLBOX_STAT_EXITCODE
171{
172 VBOXSERVICETOOLBOX_STAT_EXITCODE_ACCESS_DENIED = RTEXITCODE_END,
173 VBOXSERVICETOOLBOX_STAT_EXITCODE_FILE_NOT_FOUND,
174 VBOXSERVICETOOLBOX_STAT_EXITCODE_PATH_NOT_FOUND,
175 VBOXSERVICETOOLBOX_STAT_EXITCODE_NET_PATH_NOT_FOUND,
176 /** The usual 32-bit type hack. */
177 VBOXSERVICETOOLBOX_STAT_32BIT_HACK = 0x7fffffff
178} VBOXSERVICETOOLBOX_STAT_EXITCODE;
179
180/**
181 * Input status, reported by the client.
182 */
183enum eInputStatus
184{
185 /** Input is in an undefined state. */
186 INPUT_STS_UNDEFINED = 0,
187 /** Input was written (partially, see cbProcessed). */
188 INPUT_STS_WRITTEN = 1,
189 /** Input failed with an error (see flags for rc). */
190 INPUT_STS_ERROR = 20,
191 /** Process has abandoned / terminated input handling. */
192 INPUT_STS_TERMINATED = 21,
193 /** Too much input data. */
194 INPUT_STS_OVERFLOW = 30
195};
196
197
198
199} /* namespace guestControl */
200
201#endif /* !VBOX_INCLUDED_GuestHost_GuestControl_h */
202
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