HostNetworkInterfaceImpl.cpp revision 489f4d37cd50cc6dd8846b7e628b9a6aee7188a5
/* $Id$ */
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2008 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include "HostNetworkInterfaceImpl.h"
#include "Logging.h"
#include "netif.h"
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
void HostNetworkInterface::FinalRelease()
{
uninit ();
}
// public initializer/uninitializer for internal purposes only
/////////////////////////////////////////////////////////////////////////////
/**
* Initializes the host object.
*
* @returns COM result indicator
* @param aInterfaceName name of the network interface
* @param aGuid GUID of the host network interface
*/
HRESULT HostNetworkInterface::init (Bstr aInterfaceName, Guid aGuid, HostNetworkInterfaceType_T ifType)
{
LogFlowThisFunc (("aInterfaceName={%ls}, aGuid={%s}\n",
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan (this);
/* Confirm a successful initialization */
return S_OK;
}
#ifdef VBOX_WITH_HOSTNETIF_API
{
"%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
"%02x%02x:%02x%02x:%02x%02x:%02x%02x",
}
{
"%02x:%02x:%02x:%02x:%02x:%02x",
}
/**
* Initializes the host object.
*
* @returns COM result indicator
* @param aInterfaceName name of the network interface
* @param aGuid GUID of the host network interface
*/
HRESULT HostNetworkInterface::init (Bstr aInterfaceName, HostNetworkInterfaceType_T ifType, PNETIFINFO pIf)
{
// LogFlowThisFunc (("aInterfaceName={%ls}, aGuid={%s}\n",
// aInterfaceName.raw(), aGuid.toString().raw()));
// ComAssertRet (aInterfaceName, E_INVALIDARG);
// ComAssertRet (!aGuid.isEmpty(), E_INVALIDARG);
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan (this);
#ifdef RT_OS_WINDOWS
#else /* !RT_OS_WINDOWS */
#endif /* !RT_OS_WINDOWS */
/* Confirm a successful initialization */
return S_OK;
}
#endif
// IHostNetworkInterface properties
/////////////////////////////////////////////////////////////////////////////
/**
* Returns the name of the host network interface.
*
* @returns COM status code
* @param aInterfaceName address of result pointer
*/
{
AutoCaller autoCaller (this);
return S_OK;
}
/**
* Returns the GUID of the host network interface.
*
* @returns COM status code
* @param aGuid address of result pointer
*/
{
AutoCaller autoCaller (this);
return S_OK;
}
/**
* Returns the IP address of the host network interface.
*
* @returns COM status code
* @param aIPAddress address of result pointer
*/
{
AutoCaller autoCaller (this);
*aIPAddress = m.IPAddress;
return S_OK;
}
/**
* Returns the netwok mask of the host network interface.
*
* @returns COM status code
* @param aNetworkMask address of result pointer
*/
{
AutoCaller autoCaller (this);
*aNetworkMask = m.networkMask;
return S_OK;
}
/**
* Returns the default gateway of the host network interface.
*
* @returns COM status code
* @param aNetworkMask address of result pointer
*/
{
AutoCaller autoCaller (this);
return S_OK;
}
/**
* Returns the IP V6 address of the host network interface.
*
* @returns COM status code
* @param aIPV6Address address of result pointer
*/
{
AutoCaller autoCaller (this);
return S_OK;
}
/**
* Returns the IP V6 network mask of the host network interface.
*
* @returns COM status code
* @param aIPV6Mask address of result pointer
*/
{
AutoCaller autoCaller (this);
return S_OK;
}
/**
* Returns the hardware address of the host network interface.
*
* @returns COM status code
* @param aHardwareAddress address of result pointer
*/
{
AutoCaller autoCaller (this);
return S_OK;
}
/**
* Returns the encapsulation protocol type of the host network interface.
*
* @returns COM status code
* @param aType address of result pointer
*/
{
AutoCaller autoCaller (this);
*aType = m.mediumType;
return S_OK;
}
/**
* Returns the current state of the host network interface.
*
* @returns COM status code
* @param aStatus address of result pointer
*/
{
AutoCaller autoCaller (this);
return S_OK;
}
/**
* Returns network interface type
*
* @returns COM status code
* @param aType address of result pointer
*/
{
AutoCaller autoCaller (this);
return S_OK;
}
STDMETHODIMP HostNetworkInterface::EnableStaticIpConfig (ULONG aIPAddress, ULONG aNetworkMask, ULONG aDefaultGateway)
{
return E_NOTIMPL;
}
{
return E_NOTIMPL;
}
{
return E_NOTIMPL;
}
/* vi: set tabstop=4 shiftwidth=4 expandtab: */