NetIf-generic.cpp revision 1c19381e9455f78f30a14a20d19f1dab7da19334
/* $Id$ */
/** @file
* VirtualBox Main - Generic NetIf implementation.
*/
/*
* Copyright (C) 2009-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.
*/
#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
# include <cstdio>
#endif
#include "HostNetworkInterfaceImpl.h"
#include "ProgressImpl.h"
#include "VirtualBoxImpl.h"
#include "netif.h"
#define VBOXNETADPCTL_NAME "VBoxNetAdpCtl"
static int NetIfAdpCtl(const char * pcszIfName, const char *pszAddr, const char *pszOption, const char *pszMask)
{
char szAdpCtl[RTPATH_MAX];
if (RT_FAILURE(rc))
{
return rc;
}
if (!RTPathExists(szAdpCtl))
{
szAdpCtl));
return VERR_FILE_NOT_FOUND;
}
if (RT_SUCCESS(rc))
{
if ( RT_SUCCESS(rc)
return VINF_SUCCESS;
}
else
LogRel(("NetIfAdpCtl: failed to create process for %.\n",
szAdpCtl));
return rc;
}
static int NetIfAdpCtl(HostNetworkInterface * pIf, const char *pszAddr, const char *pszOption, const char *pszMask)
{
}
int NetIfEnableStaticIpConfig(VirtualBox * /* vBox */, HostNetworkInterface * pIf, ULONG aOldIp, ULONG aNewIp, ULONG aMask)
{
if (aNewIp == 0)
{
pszOption = "remove";
}
else
{
pszOption = "netmask";
}
}
int NetIfEnableStaticIpConfigV6(VirtualBox * /* vBox */, HostNetworkInterface * pIf, IN_BSTR aOldIPV6Address, IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength)
{
{
}
else
{
}
}
{
return VERR_NOT_IMPLEMENTED;
}
const char *pcszName)
{
/* create a progress object */
{
FALSE /* aCancelable */);
{
char szAdpCtl[RTPATH_MAX];
if (RT_FAILURE(rc))
{
"Failed to get program path, rc=%Rrc\n", rc);
return rc;
}
{
}
else
if (fp)
{
char szBuf[VBOXNET_MAX_SHORT_NAME];
{
*pLast = 0;
if (!pInfo)
rc = VERR_NO_MEMORY;
else
{
if (RT_FAILURE(rc))
{
}
else
{
/* create a new uninitialized host interface object */
}
}
}
{
}
}
if (RT_SUCCESS(rc))
}
}
return hrc;
#else
return VERR_NOT_IMPLEMENTED;
#endif
}
{
/* create a progress object */
int rc = VINF_SUCCESS;
{
return VERR_INVALID_PARAMETER;
return VERR_INTERNAL_ERROR;
FALSE /* aCancelable */);
{
if (RT_FAILURE(rc))
else
}
}
else
{
}
return rc;
#else
return VERR_NOT_IMPLEMENTED;
#endif
}
{
return VERR_NOT_IMPLEMENTED;
}
{
return VERR_NOT_IMPLEMENTED;
}