NATNetworkServiceRunner.cpp revision 20fc4a350a4a8e56ffaac6cf57dcd677a7ac36c5
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * VirtualBox Main - interface for VBox NAT Network service
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * Copyright (C) 2009-2012 Oracle Corporation
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * This file is part of VirtualBox Open Source Edition (OSE), as
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * available from http://www.virtualbox.org. This file is free software;
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * you can redistribute it and/or modify it under the terms of the GNU
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * General Public License (GPL) as published by the Free Software
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * Foundation, in version 2 as it comes in the "COPYING" file of the
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
ee735086f8670be1591fa9593e80dd60163a7a2fLennart Poettering# define NATSR_EXECUTABLE_NAME "VBoxNetNAT.exe"
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering# define NATSR_EXECUTABLE_NAME "VBoxNetNAT"
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineaustatic const ARGDEF * getArgDef(NATSCCFG type)
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau for (unsigned i = 0; i < RT_ELEMENTS(g_aArgDefs); i++)
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael MarineauNATNetworkServiceRunner::NATNetworkServiceRunner()
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau for (unsigned i = 0; i < NATSCCFG_NOTOPT_MAXVAL; i++)
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineauvoid NATNetworkServiceRunner::detachFromServer()
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau const char * args[NATSCCFG_NOTOPT_MAXVAL * 2];
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau /* get the path to the executable */
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau const char *exePath = RTProcGetExecutablePath(exePathBuf, RTPATH_MAX);
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau char *substrBs = strrchr(exePathBuf, '\\');
09e00c524fd4d21a3508c27d01d265b8a6c9ae30Michael Marineau char *suffix = substrSl ? substrSl : substrBs;
int index = 0;
for (unsigned i = 0; i < NATSCCFG_NOTOPT_MAXVAL; i++)
if (mOptionEnabled[i])
if (!pArgDef)
return rc;
if (!isRunning())
return VINF_OBJECT_DESTROYED;
return rc;