VBoxManageHostonly.cpp revision 5dc096519aecf7c7c7cec2296565dc199633e873
/* $Id$ */
/** @file
* VBoxManage - Implementation of hostonlyif command.
*/
/*
* Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#ifndef VBOX_ONLY_DOCS
#endif /* !VBOX_ONLY_DOCS */
#include "VBoxManage.h"
#ifndef VBOX_ONLY_DOCS
using namespace com;
#if defined(VBOX_WITH_NETFLT) && !defined(RT_OS_SOLARIS)
{
// if (a->argc - iStart < 1)
// return errorSyntax(USAGE_HOSTONLYIFS, "Not enough parameters");
// Bstr name(a->argv[iStart]);
// index++;
return 0;
}
{
{
*pcProcessed = 0;
}
index++;
return 0;
}
#endif
static const RTGETOPTDEF g_aHostOnlyIPOptions[]
= {
};
{
index++;
bool bDhcp = false;
bool bNetmasklengthv6 = false;
int c;
a->argc,
a->argv,
{
switch (c)
{
case 'd': // --dhcp
if (bDhcp)
else
bDhcp = true;
break;
case 'a': // --ip
if(pIp)
else
break;
case 'm': // --netmask
if(pNetmask)
else
break;
case 'b': // --ipv6
if(pIpv6)
else
break;
case 'l': // --netmasklengthv6
if(bNetmasklengthv6)
else
{
bNetmasklengthv6 = true;
}
break;
case VINF_GETOPT_NOT_OPTION:
break;
default:
if (c > 0)
{
if (RT_C_IS_GRAPH(c))
else
}
else if (c == VERR_GETOPT_UNKNOWN_OPTION)
else if (ValueUnion.pDef)
else
}
}
/* parameter sanity check */
return errorSyntax(USAGE_HOSTONLYIFS, "You can not use --dhcp with static ip configuration parameters: --ip, --netmask, --ipv6 and --netmasklengthv6.");
return errorSyntax(USAGE_HOSTONLYIFS, "You can not use ipv4 configuration (--ip and --netmask) with ipv6 (--ipv6 and --netmasklengthv6) simultaneously.");
hif.asOutParam()));
if (bDhcp)
{
}
else if (pIp)
{
if (!pNetmask)
}
else if (pIpv6)
{
if (!bIpV6Supported)
{
RTMsgError("IPv6 setting is not supported for this adapter");
return 1;
}
}
else
{
}
return 0;
}
int handleHostonlyIf(HandlerArg *a)
{
int result = 0;
if (a->argc < 1)
for (int i = 0; i < a->argc; i++)
{
{
int cProcessed;
break;
// if(!rc)
// i+= cProcessed;
// else
// break;
}
#if defined(VBOX_WITH_NETFLT) && !defined(RT_OS_SOLARIS)
{
int cProcessed;
if(!result)
i+= cProcessed;
else
break;
}
{
int cProcessed;
if(!result)
i+= cProcessed;
else
break;
}
#endif
else
{
break;
}
}
return result;
}
#endif /* !VBOX_ONLY_DOCS */