VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h@ 35951

Last change on this file since 35951 was 35907, checked in by vboxsync, 14 years ago

Main/Frontends: Also use facilities for guest features (seamless, graphics), added facility-state-to-name to VBoxManage, some renaming.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.7 KB
Line 
1/* $Id: VBoxManage.h 35907 2011-02-09 11:20:31Z vboxsync $ */
2/** @file
3 * VBoxManage - VirtualBox command-line interface, internal header file.
4 */
5
6/*
7 * Copyright (C) 2006-2010 Oracle Corporation
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
18#ifndef ___H_VBOXMANAGE
19#define ___H_VBOXMANAGE
20
21#ifndef VBOX_ONLY_DOCS
22#include <VBox/com/com.h>
23#include <VBox/com/ptr.h>
24#include <VBox/com/VirtualBox.h>
25#include <VBox/com/string.h>
26#endif /* !VBOX_ONLY_DOCS */
27
28#include <iprt/types.h>
29#include <iprt/message.h>
30#include <iprt/stream.h>
31
32////////////////////////////////////////////////////////////////////////////////
33//
34// definitions
35//
36////////////////////////////////////////////////////////////////////////////////
37
38/** @name Syntax diagram category.
39 * @{ */
40#define USAGE_DUMPOPTS 0
41#define USAGE_LIST RT_BIT_64(0)
42#define USAGE_SHOWVMINFO RT_BIT_64(1)
43#define USAGE_REGISTERVM RT_BIT_64(2)
44#define USAGE_UNREGISTERVM RT_BIT_64(3)
45#define USAGE_CREATEVM RT_BIT_64(4)
46#define USAGE_MODIFYVM RT_BIT_64(5)
47#define USAGE_STARTVM RT_BIT_64(6)
48#define USAGE_CONTROLVM RT_BIT_64(7)
49#define USAGE_DISCARDSTATE RT_BIT_64(8)
50#define USAGE_SNAPSHOT RT_BIT_64(9)
51#define USAGE_CLOSEMEDIUM RT_BIT_64(11)
52#define USAGE_SHOWHDINFO RT_BIT_64(12)
53#define USAGE_CREATEHD RT_BIT_64(13)
54#define USAGE_MODIFYHD RT_BIT_64(14)
55#define USAGE_CLONEHD RT_BIT_64(15)
56#define USAGE_CREATEHOSTIF RT_BIT_64(17)
57#define USAGE_REMOVEHOSTIF RT_BIT_64(18)
58#define USAGE_GETEXTRADATA RT_BIT_64(19)
59#define USAGE_SETEXTRADATA RT_BIT_64(20)
60#define USAGE_SETPROPERTY RT_BIT_64(21)
61#define USAGE_USBFILTER (RT_BIT_64(22) | RT_BIT_64(23) | RT_BIT_64(24))
62#define USAGE_USBFILTER_ADD RT_BIT_64(22)
63#define USAGE_USBFILTER_MODIFY RT_BIT_64(23)
64#define USAGE_USBFILTER_REMOVE RT_BIT_64(24)
65#define USAGE_SHAREDFOLDER (RT_BIT_64(25) | RT_BIT_64(26))
66#define USAGE_SHAREDFOLDER_ADD RT_BIT_64(25)
67#define USAGE_SHAREDFOLDER_REMOVE RT_BIT_64(26)
68#define USAGE_LOADSYMS RT_BIT_64(29)
69#define USAGE_UNLOADSYMS RT_BIT_64(30)
70#define USAGE_SETHDUUID RT_BIT_64(31)
71#define USAGE_CONVERTFROMRAW RT_BIT_64(32)
72#define USAGE_LISTPARTITIONS RT_BIT_64(33)
73#define USAGE_CREATERAWVMDK RT_BIT_64(34)
74#define USAGE_DEBUGVM RT_BIT_64(35)
75#define USAGE_ADOPTSTATE RT_BIT_64(36)
76#define USAGE_MODINSTALL RT_BIT_64(37)
77#define USAGE_MODUNINSTALL RT_BIT_64(38)
78#define USAGE_RENAMEVMDK RT_BIT_64(39)
79#ifdef VBOX_WITH_GUEST_PROPS
80# define USAGE_GUESTPROPERTY RT_BIT_64(40)
81#endif /* VBOX_WITH_GUEST_PROPS defined */
82#define USAGE_CONVERTTORAW RT_BIT_64(41)
83#define USAGE_METRICS RT_BIT_64(42)
84#define USAGE_CONVERTHD RT_BIT_64(43)
85#define USAGE_IMPORTAPPLIANCE RT_BIT_64(44)
86#define USAGE_EXPORTAPPLIANCE RT_BIT_64(45)
87#define USAGE_HOSTONLYIFS RT_BIT_64(46)
88#define USAGE_DHCPSERVER RT_BIT_64(47)
89#define USAGE_DUMPHDINFO RT_BIT_64(48)
90#define USAGE_STORAGEATTACH RT_BIT_64(49)
91#define USAGE_STORAGECONTROLLER RT_BIT_64(50)
92#ifdef VBOX_WITH_GUEST_CONTROL
93# define USAGE_GUESTCONTROL RT_BIT_64(51)
94#endif /* VBOX_WITH_GUEST_CONTROL defined */
95#define USAGE_DEBUGLOG RT_BIT_64(52)
96#define USAGE_SETHDPARENTUUID RT_BIT_64(53)
97#define USAGE_PASSWORDHASH RT_BIT_64(54)
98#define USAGE_EXTPACK RT_BIT_64(55)
99#define USAGE_BANDWIDTHCONTROL RT_BIT_64(56)
100#define USAGE_ALL (~(uint64_t)0)
101/** @} */
102
103typedef uint64_t USAGECATEGORY;
104
105/** command handler argument */
106struct HandlerArg
107{
108 int argc;
109 char **argv;
110
111#ifndef VBOX_ONLY_DOCS
112 ComPtr<IVirtualBox> virtualBox;
113 ComPtr<ISession> session;
114#endif
115};
116
117/** flag whether we're in internal mode */
118extern bool g_fInternalMode;
119
120/** showVMInfo details */
121typedef enum
122{
123 VMINFO_NONE = 0,
124 VMINFO_STANDARD = 1, /**< standard details */
125 VMINFO_FULL = 2, /**< both */
126 VMINFO_MACHINEREADABLE = 3, /**< both, and make it machine readable */
127 VMINFO_COMPACT = 4
128} VMINFO_DETAILS;
129
130////////////////////////////////////////////////////////////////////////////////
131//
132// global variables
133//
134////////////////////////////////////////////////////////////////////////////////
135
136extern bool g_fDetailedProgress; // in VBoxManage.cpp
137
138////////////////////////////////////////////////////////////////////////////////
139//
140// prototypes
141//
142////////////////////////////////////////////////////////////////////////////////
143
144/* VBoxManageHelp.cpp */
145void printUsage(USAGECATEGORY u64Cmd, PRTSTREAM pStrm);
146RTEXITCODE errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...);
147RTEXITCODE errorGetOpt(USAGECATEGORY u64Cmd, int rc, union RTGETOPTUNION const *pValueUnion);
148RTEXITCODE errorArgument(const char *pszFormat, ...);
149
150void printUsageInternal(USAGECATEGORY u64Cmd, PRTSTREAM pStrm);
151
152#ifndef VBOX_ONLY_DOCS
153HRESULT showProgress(ComPtr<IProgress> progress);
154#endif
155
156/* VBoxManage.cpp */
157void showLogo(PRTSTREAM pStrm);
158
159#ifndef VBOX_ONLY_DOCS
160int handleInternalCommands(HandlerArg *a);
161#endif /* !VBOX_ONLY_DOCS */
162
163/* VBoxManageControlVM.cpp */
164int handleControlVM(HandlerArg *a);
165#ifndef VBOX_ONLY_DOCS
166unsigned int getMaxNics(IVirtualBox* vbox, IMachine* mach);
167#endif
168
169/* VBoxManageModifyVM.cpp */
170int handleModifyVM(HandlerArg *a);
171
172/* VBoxManageDebugVM.cpp */
173int handleDebugVM(HandlerArg *a);
174
175/* VBoxManageGuestProp.cpp */
176extern void usageGuestProperty(PRTSTREAM pStrm);
177
178/* VBoxManageGuestCtrl.cpp */
179extern void usageGuestControl(PRTSTREAM pStrm);
180
181#ifndef VBOX_ONLY_DOCS
182/* VBoxManageGuestProp.cpp */
183extern int handleGuestProperty(HandlerArg *a);
184
185/* VBoxManageGuestCtrl.cpp */
186extern int handleGuestControl(HandlerArg *a);
187
188/* VBoxManageVMInfo.cpp */
189void showSnapshots(ComPtr<ISnapshot> &rootSnapshot,
190 ComPtr<ISnapshot> &currentSnapshot,
191 VMINFO_DETAILS details,
192 const com::Bstr &prefix = "",
193 int level = 0);
194int handleShowVMInfo(HandlerArg *a);
195HRESULT showVMInfo(ComPtr<IVirtualBox> virtualBox,
196 ComPtr<IMachine> machine,
197 VMINFO_DETAILS details = VMINFO_NONE,
198 ComPtr <IConsole> console = ComPtr<IConsole>());
199const char *machineStateToName(MachineState_T machineState, bool fShort);
200
201/* VBoxManageList.cpp */
202int handleList(HandlerArg *a);
203
204/* VBoxManageMetrics.cpp */
205int handleMetrics(HandlerArg *a);
206
207/* VBoxManageMisc.cpp */
208int handleRegisterVM(HandlerArg *a);
209int handleUnregisterVM(HandlerArg *a);
210int handleCreateVM(HandlerArg *a);
211int handleStartVM(HandlerArg *a);
212int handleDiscardState(HandlerArg *a);
213int handleAdoptState(HandlerArg *a);
214int handleGetExtraData(HandlerArg *a);
215int handleSetExtraData(HandlerArg *a);
216int handleSetProperty(HandlerArg *a);
217int handleSharedFolder(HandlerArg *a);
218int handleExtPack(HandlerArg *a);
219
220/* VBoxManageDisk.cpp */
221HRESULT findMedium(HandlerArg *a, const char *pszFilenameOrUuid,
222 DeviceType_T enmDevType, bool fSilent,
223 ComPtr<IMedium> &pMedium);
224HRESULT findOrOpenMedium(HandlerArg *a, const char *pszFilenameOrUuid,
225 DeviceType_T enmDevType, ComPtr<IMedium> &pMedium,
226 bool *pfWasUnknown);
227int handleCreateHardDisk(HandlerArg *a);
228int handleModifyHardDisk(HandlerArg *a);
229int handleCloneHardDisk(HandlerArg *a);
230RTEXITCODE handleConvertFromRaw(int argc, char *argv[]);
231int handleShowHardDiskInfo(HandlerArg *a);
232int handleCloseMedium(HandlerArg *a);
233int parseDiskType(const char *psz, MediumType_T *pDiskType);
234
235/* VBoxManageStorageController.cpp */
236int handleStorageAttach(HandlerArg *a);
237int handleStorageController(HandlerArg *a);
238
239// VBoxManageImport.cpp
240int handleImportAppliance(HandlerArg *a);
241int handleExportAppliance(HandlerArg *a);
242
243// VBoxManageSnapshot.cpp
244int handleSnapshot(HandlerArg *a);
245
246/* VBoxManageUSB.cpp */
247int handleUSBFilter(HandlerArg *a);
248
249/* VBoxManageHostonly.cpp */
250int handleHostonlyIf(HandlerArg *a);
251
252/* VBoxManageHostonly.cpp */
253int handleDHCPServer(HandlerArg *a);
254
255/* VBoxManageBandwidthControl.cpp */
256int handleBandwidthControl(HandlerArg *a);
257
258#endif /* !VBOX_ONLY_DOCS */
259
260#endif /* !___H_VBOXMANAGE */
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