VirtualBox

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

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

Automated rebranding to Oracle copyright/license strings via filemuncher

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 KB
Line 
1/* $Id: VBoxManage.h 28800 2010-04-27 08:22:32Z 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
30////////////////////////////////////////////////////////////////////////////////
31//
32// definitions
33//
34////////////////////////////////////////////////////////////////////////////////
35
36/** @name Syntax diagram category.
37 * @{ */
38#define USAGE_DUMPOPTS 0
39#define USAGE_LIST RT_BIT_64(0)
40#define USAGE_SHOWVMINFO RT_BIT_64(1)
41#define USAGE_REGISTERVM RT_BIT_64(2)
42#define USAGE_UNREGISTERVM RT_BIT_64(3)
43#define USAGE_CREATEVM RT_BIT_64(4)
44#define USAGE_MODIFYVM RT_BIT_64(5)
45#define USAGE_STARTVM RT_BIT_64(6)
46#define USAGE_CONTROLVM RT_BIT_64(7)
47#define USAGE_DISCARDSTATE RT_BIT_64(8)
48#define USAGE_SNAPSHOT RT_BIT_64(9)
49#define USAGE_OPENMEDIUM RT_BIT_64(10)
50#define USAGE_CLOSEMEDIUM RT_BIT_64(11)
51#define USAGE_SHOWHDINFO RT_BIT_64(12)
52#define USAGE_CREATEHD RT_BIT_64(13)
53#define USAGE_MODIFYHD RT_BIT_64(14)
54#define USAGE_CLONEHD RT_BIT_64(15)
55#define USAGE_ADDISCSIDISK RT_BIT_64(16)
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_VM_STATISTICS 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_ALL (~(uint64_t)0)
96/** @} */
97
98typedef uint64_t USAGECATEGORY;
99
100/** command handler argument */
101struct HandlerArg
102{
103 int argc;
104 char **argv;
105
106#ifndef VBOX_ONLY_DOCS
107 ComPtr<IVirtualBox> virtualBox;
108 ComPtr<ISession> session;
109#endif
110};
111
112/** flag whether we're in internal mode */
113extern bool g_fInternalMode;
114
115/** showVMInfo details */
116typedef enum
117{
118 VMINFO_NONE = 0,
119 VMINFO_STANDARD = 1, /**< standard details */
120 VMINFO_FULL = 2, /**< both */
121 VMINFO_MACHINEREADABLE = 3, /**< both, and make it machine readable */
122 VMINFO_COMPACT = 4
123} VMINFO_DETAILS;
124
125////////////////////////////////////////////////////////////////////////////////
126//
127// global variables
128//
129////////////////////////////////////////////////////////////////////////////////
130
131extern bool g_fDetailedProgress; // in VBoxManage.cpp
132
133////////////////////////////////////////////////////////////////////////////////
134//
135// prototypes
136//
137////////////////////////////////////////////////////////////////////////////////
138
139/* VBoxManageHelp.cpp */
140void printUsage(USAGECATEGORY u64Cmd);
141int errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...);
142int errorGetOpt(USAGECATEGORY u64Cmd, int rc, union RTGETOPTUNION const *pValueUnion);
143int errorArgument(const char *pszFormat, ...);
144
145void printUsageInternal(USAGECATEGORY u64Cmd);
146
147#ifndef VBOX_ONLY_DOCS
148HRESULT showProgress(ComPtr<IProgress> progress);
149#endif
150
151/* VBoxManage.cpp */
152void showLogo(void);
153
154#ifndef VBOX_ONLY_DOCS
155int handleInternalCommands(HandlerArg *a);
156#endif /* !VBOX_ONLY_DOCS */
157
158/* VBoxManageControlVM.cpp */
159int handleControlVM(HandlerArg *a);
160
161/* VBoxManageModifyVM.cpp */
162int handleModifyVM(HandlerArg *a);
163
164/* VBoxManageGuestProp.cpp */
165extern void usageGuestProperty(void);
166#ifndef VBOX_ONLY_DOCS
167extern int handleGuestProperty(HandlerArg *a);
168
169/* VBoxManageGuestCtrl.cpp */
170extern int handleGuestControl(HandlerArg *a);
171extern void usageGuestControl(void);
172
173/* VBoxManageVMInfo.cpp */
174void showSnapshots(ComPtr<ISnapshot> &rootSnapshot,
175 ComPtr<ISnapshot> &currentSnapshot,
176 VMINFO_DETAILS details,
177 const com::Bstr &prefix = "",
178 int level = 0);
179int handleShowVMInfo(HandlerArg *a);
180HRESULT showVMInfo(ComPtr<IVirtualBox> virtualBox,
181 ComPtr<IMachine> machine,
182 VMINFO_DETAILS details = VMINFO_NONE,
183 ComPtr <IConsole> console = ComPtr<IConsole>());
184
185/* VBoxManageList.cpp */
186int handleList(HandlerArg *a);
187
188/* VBoxManageMetrics.cpp */
189int handleMetrics(HandlerArg *a);
190
191/* VBoxManageMisc.cpp */
192int handleRegisterVM(HandlerArg *a);
193int handleUnregisterVM(HandlerArg *a);
194int handleCreateVM(HandlerArg *a);
195int handleStartVM(HandlerArg *a);
196int handleDiscardState(HandlerArg *a);
197int handleAdoptState(HandlerArg *a);
198int handleGetExtraData(HandlerArg *a);
199int handleSetExtraData(HandlerArg *a);
200int handleSetProperty(HandlerArg *a);
201int handleSharedFolder(HandlerArg *a);
202int handleVMStatistics(HandlerArg *a);
203
204/* VBoxManageDisk.cpp */
205int handleCreateHardDisk(HandlerArg *a);
206int handleModifyHardDisk(HandlerArg *a);
207int handleCloneHardDisk(HandlerArg *a);
208int handleConvertFromRaw(int argc, char *argv[]);
209int handleAddiSCSIDisk(HandlerArg *a);
210int handleShowHardDiskInfo(HandlerArg *a);
211int handleOpenMedium(HandlerArg *a);
212int handleCloseMedium(HandlerArg *a);
213
214/* VBoxManageStorageController.cpp */
215int handleStorageAttach(HandlerArg *a);
216int handleStorageController(HandlerArg *a);
217
218// VBoxManageImport.cpp
219int handleImportAppliance(HandlerArg *a);
220int handleExportAppliance(HandlerArg *a);
221
222// VBoxManageSnapshot.cpp
223int handleSnapshot(HandlerArg *a);
224
225/* VBoxManageUSB.cpp */
226int handleUSBFilter(HandlerArg *a);
227
228/* VBoxManageHostonly.cpp */
229int handleHostonlyIf(HandlerArg *a);
230
231/* VBoxManageHostonly.cpp */
232int handleDHCPServer(HandlerArg *a);
233
234#endif /* !VBOX_ONLY_DOCS */
235
236#endif /* !___H_VBOXMANAGE */
237
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