DhcpServerImpl.cpp revision cf9a7159379fc741e85867a23371f98c886683c5
/* $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 "DhcpServerImpl.h"
#include "Logging.h"
#include <VBox/settings.h>
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
void DhcpServer::FinalRelease()
{
uninit ();
}
void DhcpServer::uninit()
{
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan (this);
if (autoUninitSpan.uninitDone())
return;
// /* we uninit children and reset mParent
// * and VirtualBox::removeDependentChild() needs a write lock */
// AutoMultiWriteLock2 alock (mVirtualBox->lockHandle(), this->treeLock());
mVirtualBox->removeDependentChild (this);
}
{
AutoInitSpan autoInitSpan (this);
/* share VirtualBox weakly (parent remains NULL so far) */
m.IPAddress = "0.0.0.0";
m.networkMask = "0.0.0.0";
m.lowerIP = "0.0.0.0";
m.upperIP = "0.0.0.0";
/* register with VirtualBox early, since uninit() will
* unconditionally unregister on failure */
aVirtualBox->addDependentChild (this);
/* Confirm a successful initialization */
return S_OK;
}
{
using namespace settings;
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan (this);
/* share VirtualBox weakly (parent remains NULL so far) */
aVirtualBox->addDependentChild (this);
return S_OK;
}
{
using namespace settings;
AutoCaller autoCaller (this);
AutoReadLock alock (this);
/* required */
return S_OK;
}
{
AutoCaller autoCaller (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
return rc;
}
{
AutoCaller autoCaller (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
return S_OK;
}
{
AutoCaller autoCaller (this);
return S_OK;
}
STDMETHODIMP DhcpServer::SetConfiguration (IN_BSTR aIPAddress, IN_BSTR aNetworkMask, IN_BSTR aLowerIP, IN_BSTR aUpperIP)
{
AutoCaller autoCaller (this);
/* VirtualBox::saveSettings() needs a write lock */
m.IPAddress = aIPAddress;
m.networkMask = aNetworkMask;
return mVirtualBox->saveSettings();
}