VirtualBox

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

Last change on this file since 18227 was 18023, checked in by vboxsync, 16 years ago

Dhcp->DHCP

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.5 KB
Line 
1/* $Id: VBoxManage.h 18023 2009-03-17 13:48:59Z vboxsync $ */
2/** @file
3 * VBoxManage - VirtualBox command-line interface, internal header file.
4 */
5
6/*
7 * Copyright (C) 2006-2007 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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef ___H_VBOXMANAGE
23#define ___H_VBOXMANAGE
24
25#ifndef VBOX_ONLY_DOCS
26#include <VBox/com/com.h>
27#include <VBox/com/ptr.h>
28#include <VBox/com/VirtualBox.h>
29#include <VBox/com/EventQueue.h>
30#include <VBox/com/string.h>
31#endif /* !VBOX_ONLY_DOCS */
32
33#include <iprt/types.h>
34
35#if defined(VBOX_WITH_XPCOM) && !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2)
36# define USE_XPCOM_QUEUE
37#endif
38
39/** @name Syntax diagram category.
40 * @{ */
41#define USAGE_DUMPOPTS 0
42#define USAGE_LIST RT_BIT_64(0)
43#define USAGE_SHOWVMINFO RT_BIT_64(1)
44#define USAGE_REGISTERVM RT_BIT_64(2)
45#define USAGE_UNREGISTERVM RT_BIT_64(3)
46#define USAGE_CREATEVM RT_BIT_64(4)
47#define USAGE_MODIFYVM RT_BIT_64(5)
48#define USAGE_STARTVM RT_BIT_64(6)
49#define USAGE_CONTROLVM RT_BIT_64(7)
50#define USAGE_DISCARDSTATE RT_BIT_64(8)
51#define USAGE_SNAPSHOT RT_BIT_64(9)
52#define USAGE_REGISTERIMAGE RT_BIT_64(10)
53#define USAGE_UNREGISTERIMAGE RT_BIT_64(11)
54#define USAGE_SHOWHDINFO RT_BIT_64(12)
55#define USAGE_CREATEHD RT_BIT_64(13)
56#define USAGE_MODIFYHD RT_BIT_64(14)
57#define USAGE_CLONEHD RT_BIT_64(15)
58#define USAGE_ADDISCSIDISK RT_BIT_64(16)
59#define USAGE_CREATEHOSTIF RT_BIT_64(17)
60#define USAGE_REMOVEHOSTIF RT_BIT_64(18)
61#define USAGE_GETEXTRADATA RT_BIT_64(19)
62#define USAGE_SETEXTRADATA RT_BIT_64(20)
63#define USAGE_SETPROPERTY RT_BIT_64(21)
64#define USAGE_USBFILTER (RT_BIT_64(22) | RT_BIT_64(23) | RT_BIT_64(24))
65#define USAGE_USBFILTER_ADD RT_BIT_64(22)
66#define USAGE_USBFILTER_MODIFY RT_BIT_64(23)
67#define USAGE_USBFILTER_REMOVE RT_BIT_64(24)
68#define USAGE_SHAREDFOLDER (RT_BIT_64(25) | RT_BIT_64(26))
69#define USAGE_SHAREDFOLDER_ADD RT_BIT_64(25)
70#define USAGE_SHAREDFOLDER_REMOVE RT_BIT_64(26)
71#define USAGE_LOADSYMS RT_BIT_64(29)
72#define USAGE_UNLOADSYMS RT_BIT_64(30)
73#define USAGE_SETHDUUID RT_BIT_64(31)
74#define USAGE_CONVERTFROMRAW RT_BIT_64(32)
75#define USAGE_LISTPARTITIONS RT_BIT_64(33)
76#define USAGE_CREATERAWVMDK RT_BIT_64(34)
77#define USAGE_VM_STATISTICS RT_BIT_64(35)
78#define USAGE_ADOPTSTATE RT_BIT_64(36)
79#define USAGE_MODINSTALL RT_BIT_64(37)
80#define USAGE_MODUNINSTALL RT_BIT_64(38)
81#define USAGE_RENAMEVMDK RT_BIT_64(39)
82#ifdef VBOX_WITH_GUEST_PROPS
83#define USAGE_GUESTPROPERTY RT_BIT_64(40)
84#endif /* VBOX_WITH_GUEST_PROPS defined */
85#define USAGE_CONVERTTORAW RT_BIT_64(41)
86#define USAGE_METRICS RT_BIT_64(42)
87#define USAGE_CONVERTHD RT_BIT_64(43)
88#define USAGE_IMPORTAPPLIANCE RT_BIT_64(44)
89#define USAGE_EXPORTAPPLIANCE RT_BIT_64(45)
90#define USAGE_HOSTONLYIFS RT_BIT_64(46)
91#define USAGE_DHCPSERVER RT_BIT_64(47)
92#define USAGE_ALL (~(uint64_t)0)
93/** @} */
94
95typedef uint64_t USAGECATEGORY;
96
97/** command handler argument */
98struct HandlerArg
99{
100 int argc;
101 char **argv;
102
103#ifdef USE_XPCOM_QUEUE
104 nsCOMPtr<nsIEventQueue> eventQ;
105#endif
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_STATISTICS = 2, /**< guest statistics */
121 VMINFO_FULL = 3, /**< both */
122 VMINFO_MACHINEREADABLE = 4, /**< both, and make it machine readable */
123 VMINFO_COMPACT = 5
124} VMINFO_DETAILS;
125
126/*
127 * Prototypes
128 */
129
130/* VBoxManageHelp.cpp */
131void printUsage(USAGECATEGORY u64Cmd);
132int errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...);
133int errorArgument(const char *pszFormat, ...);
134
135void printUsageInternal(USAGECATEGORY u64Cmd);
136
137#ifndef VBOX_ONLY_DOCS
138void showProgress(ComPtr<IProgress> progress);
139#endif
140
141/* VBoxManage.cpp */
142void showLogo(void);
143
144#ifndef VBOX_ONLY_DOCS
145int handleInternalCommands(HandlerArg *a);
146
147unsigned parseNum(const char *psz, unsigned cMaxNum, const char *name);
148#endif /* !VBOX_ONLY_DOCS */
149
150/* VBoxManageModifyVM.cpp */
151int handleModifyVM(HandlerArg *a);
152
153/* VBoxManageGuestProp.cpp */
154extern void usageGuestProperty(void);
155#ifndef VBOX_ONLY_DOCS
156extern int handleGuestProperty(HandlerArg *a);
157
158/* VBoxManageVMInfo.cpp */
159void showSnapshots(ComPtr<ISnapshot> rootSnapshot, VMINFO_DETAILS details, const com::Bstr &prefix = "", int level = 0);
160int handleShowVMInfo(HandlerArg *a);
161HRESULT showVMInfo(ComPtr<IVirtualBox> virtualBox,
162 ComPtr<IMachine> machine,
163 VMINFO_DETAILS details = VMINFO_NONE,
164 ComPtr <IConsole> console = ComPtr<IConsole>());
165
166/* VBoxManageList.cpp */
167int handleList(HandlerArg *a);
168
169/* VBoxManageMetrics.cpp */
170int handleMetrics(HandlerArg *a);
171
172/* VBoxManageDisk.cpp */
173int handleCreateHardDisk(HandlerArg *a);
174int handleModifyHardDisk(HandlerArg *a);
175int handleCloneHardDisk(HandlerArg *a);
176int handleConvertFromRaw(int argc, char *argv[]);
177int handleAddiSCSIDisk(HandlerArg *a);
178int handleShowHardDiskInfo(HandlerArg *a);
179int handleOpenMedium(HandlerArg *a);
180int handleCloseMedium(HandlerArg *a);
181
182// VBoxManageImport.cpp
183int handleImportAppliance(HandlerArg *a);
184int handleExportAppliance(HandlerArg *a);
185
186// VBoxManageSnapshot.cpp
187int handleSnapshot(HandlerArg *a);
188
189/* VBoxManageUSB.cpp */
190int handleUSBFilter(HandlerArg *a);
191
192/* VBoxManageHostonly.cpp */
193int handleHostonlyIf(HandlerArg *a);
194
195/* VBoxManageHostonly.cpp */
196int handleDHCPServer(HandlerArg *a);
197
198#endif /* !VBOX_ONLY_DOCS */
199unsigned long VBoxSVNRev();
200
201#endif /* !___H_VBOXMANAGE */
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