NetworkServiceRunner.cpp revision 0d49a2fbc9857ad8dd29542de7fb37202f1a283f
/* $Id$ */
/** @file
* VirtualBox Main - interface for VBox DHCP server
*/
/*
* Copyright (C) 2009-2012 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.
*/
#include <map>
#include <string>
#include "NetworkServiceRunner.h"
struct NetworkServiceRunner::Data
{
const char *mProcName;
};
{
}
{
stop();
delete m;
m = NULL;
}
{
return VINF_SUCCESS;
}
void NetworkServiceRunner::detachFromServer()
{
m->mProcess = NIL_RTPROCESS;
}
int NetworkServiceRunner::start()
{
if (isRunning())
return VINF_ALREADY_INITIALIZED;
/* get the path to the executable */
char exePathBuf[RTPATH_MAX];
if (suffix)
{
suffix++;
}
int index = 0;
{
}
if (RT_FAILURE(rc))
m->mProcess = NIL_RTPROCESS;
return rc;
}
int NetworkServiceRunner::stop()
{
if (!isRunning())
return VINF_OBJECT_DESTROYED;
m->mProcess = NIL_RTPROCESS;
return rc;
}
bool NetworkServiceRunner::isRunning()
{
if (m->mProcess == NIL_RTPROCESS)
return false;
if (rc == VERR_PROCESS_RUNNING)
return true;
m->mProcess = NIL_RTPROCESS;
return false;
}