32
32
#include "toolboxCmdInt.h"
33
33
#include "toolboxcmd_version.h"
34
34
#include "system.h"
35
#include "vmware/tools/guestrpc.h"
35
36
#include "vmware/tools/i18n.h"
36
37
#include "vmware/tools/utils.h"
101
103
{ "disk", Disk_Command, TRUE, TRUE, Disk_Help},
102
104
{ "stat", Stat_Command, TRUE, FALSE, Stat_Help},
103
105
{ "device", Device_Command, TRUE, FALSE, Device_Help},
106
#if (defined(_WIN32) || defined(linux)) && !defined(OPEN_VM_TOOLS)
107
{ "upgrade", Upgrade_Command, TRUE, FALSE, Upgrade_Help},
104
109
{ "help", HelpCommand, FALSE, FALSE, ToolboxCmdHelp},
133
138
*-----------------------------------------------------------------------------
142
* Prints a message to stdout unless quiet output was requested.
150
*-----------------------------------------------------------------------------
154
ToolsCmd_Print(const char *fmt,
162
g_vasprintf(&str, fmt, args);
172
*-----------------------------------------------------------------------------
174
* ToolsCmd_PrintErr --
176
* Prints a message to stderr unless quiet output was requested.
184
*-----------------------------------------------------------------------------
188
ToolsCmd_PrintErr(const char *fmt,
196
g_vasprintf(&str, fmt, args);
199
g_printerr("%s", str);
206
*-----------------------------------------------------------------------------
208
* ToolsCmd_SendRPC --
210
* Sends an RPC message to the host.
213
* The return value from the RPC.
218
*-----------------------------------------------------------------------------
222
ToolsCmd_SendRPC(const char *rpc, // IN
224
char **result, // OUT
225
size_t *resultLen) // OUT
227
char *lrpc = (char *) rpc;
228
RpcChannel *chan = BackdoorChannel_New();
229
gboolean ret = RpcChannel_Start(chan);
232
g_warning("Error starting RPC channel.");
236
ret = RpcChannel_Send(chan, lrpc, rpcLen, result, resultLen);
239
RpcChannel_Destroy(chan);
245
*-----------------------------------------------------------------------------
135
247
* ToolsCmd_UnknownEntityError --
137
249
* Print out error message regarding unknown argument.
300
" upgrade (not available on all operating systems)\n"
188
302
"For additional information please visit http://www.vmware.com/support/\n\n"),
189
303
progName, progName, cmd, progName);
380
493
ToolsCmd_MissingEntityError(argv[0], SU_(arg.subcommand, "subcommand"));
381
494
retval = EX_USAGE;
383
retval = cmd->func(argv, argc, quiet);
496
retval = cmd->func(argv, argc, gQuiet);
386
499
if (retval == EX_USAGE && (cmd == NULL || strcmp(cmd->command, "help"))) {