Index: /trunk/src/VBox/Main/include/DHCPServerImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/DHCPServerImpl.h	(revision 49493)
+++ /trunk/src/VBox/Main/include/DHCPServerImpl.h	(revision 49494)
@@ -43,4 +43,8 @@
     DHCPServerRunner():NetworkServiceRunner(DHCP_EXECUTABLE_NAME){}
     virtual ~DHCPServerRunner(){};
+
+    static const std::string kDsrKeyGateway;
+    static const std::string kDsrKeyLowerIp;
+    static const std::string kDsrKeyUpperIp;
 };
 
Index: /trunk/src/VBox/Main/include/NATNetworkImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/NATNetworkImpl.h	(revision 49493)
+++ /trunk/src/VBox/Main/include/NATNetworkImpl.h	(revision 49494)
@@ -49,5 +49,5 @@
 public:
     NATNetworkServiceRunner(): NetworkServiceRunner(NATSR_EXECUTABLE_NAME){}
-    virtual ~NATNetworkServiceRunner(){}
+    ~NATNetworkServiceRunner(){}
 };
 
Index: /trunk/src/VBox/Main/include/NetworkServiceRunner.h
===================================================================
--- /trunk/src/VBox/Main/include/NetworkServiceRunner.h	(revision 49493)
+++ /trunk/src/VBox/Main/include/NetworkServiceRunner.h	(revision 49494)
@@ -22,17 +22,4 @@
 #include <VBox/com/string.h>
 
-typedef enum
-{
-    NETCFG_NAME = 1,
-    NETCFG_NETNAME,
-    NETCFG_TRUNKTYPE,
-    NETCFG_TRUNKNAME,
-    NETCFG_MACADDRESS,
-    NETCFG_IPADDRESS,
-    NETCFG_NETMASK,
-    NETCFG_VERBOSE,
-    NETCFG_NOTOPT_MAXVAL
-} NETCFG;
-
 #define TRUNKTYPE_WHATEVER "whatever"
 #define TRUNKTYPE_NETFLT   "netflt"
@@ -43,31 +30,8 @@
 {
 public:
-    NetworkServiceRunner(const char *aProcName)
-        : mProcName(aProcName)
-        , mProcess(NIL_RTPROCESS)
-    {
-        RT_ZERO(mOptionEnabled);
-    };
-    ~NetworkServiceRunner()
-    {
-        stop(); /* don't leave abandoned servers */
-    }
+    NetworkServiceRunner(const char *aProcName);
+    virtual ~NetworkServiceRunner();
 
-    int setOption(NETCFG opt, const char *val, bool enabled)
-    {
-        if (opt == 0 || opt >= NETCFG_NOTOPT_MAXVAL)
-            return VERR_INVALID_PARAMETER;
-        if (isRunning())
-            return VERR_INVALID_STATE;
-
-        mOptions[opt] = val;
-        mOptionEnabled[opt] = enabled;
-        return VINF_SUCCESS;
-    }
-
-    int setOption(NETCFG opt, const com::Utf8Str &val, bool enabled)
-    {
-        return setOption(opt, val.c_str(), enabled);
-    }
+    int setOption(const std::string& key, const std::string& val);
 
     int start();
@@ -76,9 +40,15 @@
 
     void detachFromServer();
+
+    static const std::string kNsrKeyName;
+    static const std::string kNsrKeyNetwork;
+    static const std::string kNsrKeyTrunkType;
+    static const std::string kNsrTrunkName;
+    static const std::string kNsrMacAddress;
+    static const std::string kNsrIpAddress;
+    static const std::string kNsrIpNetmask;
+    
 private:
-    com::Utf8Str mOptions[NETCFG_NOTOPT_MAXVAL];
-    bool mOptionEnabled[NETCFG_NOTOPT_MAXVAL];
-    const char *mProcName;
-    RTPROCESS mProcess;
+    struct Data;
+    Data *m;
 };
-
Index: /trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp	(revision 49493)
+++ /trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp	(revision 49494)
@@ -18,4 +18,5 @@
  */
 
+#include <string>
 #include "NetworkServiceRunner.h"
 #include "DHCPServerImpl.h"
@@ -32,4 +33,8 @@
 // constructor / destructor
 /////////////////////////////////////////////////////////////////////////////
+const std::string DHCPServerRunner::kDsrKeyGateway = "--gateway";
+const std::string DHCPServerRunner::kDsrKeyLowerIp = "--lower-ip";
+const std::string DHCPServerRunner::kDsrKeyUpperIp = "--upper-ip";
+
 
 DHCPServer::DHCPServer()
@@ -471,11 +476,11 @@
 
     /* Commmon Network Settings */
-    m.dhcp.setOption(NETCFG_NETNAME, Utf8Str(aNetworkName), true);
+    m.dhcp.setOption(NetworkServiceRunner::kNsrKeyNetwork, Utf8Str(aNetworkName).c_str());
 
     Bstr tmp(aTrunkName);
 
     if (!tmp.isEmpty())
-        m.dhcp.setOption(NETCFG_TRUNKNAME, Utf8Str(tmp), true);
-    m.dhcp.setOption(NETCFG_TRUNKTYPE, Utf8Str(aTrunkType), true);
+        m.dhcp.setOption(NetworkServiceRunner::kNsrTrunkName, Utf8Str(tmp).c_str());
+    m.dhcp.setOption(NetworkServiceRunner::kNsrKeyTrunkType, Utf8Str(aTrunkType).c_str());
 
     /* XXX: should this MAC default initialization moved to NetworkServiceRunner? */
@@ -487,7 +492,9 @@
                  guid.raw()->au8[1],
                  guid.raw()->au8[2]);
-    m.dhcp.setOption(NETCFG_MACADDRESS, strMAC, true);
-    m.dhcp.setOption(NETCFG_IPADDRESS,  Utf8Str(m.IPAddress), true);
-    m.dhcp.setOption(NETCFG_NETMASK, Utf8Str(m.GlobalDhcpOptions[DhcpOpt_SubnetMask]), true);
+    m.dhcp.setOption(NetworkServiceRunner::kNsrMacAddress, strMAC);
+    m.dhcp.setOption(NetworkServiceRunner::kNsrIpAddress,  Utf8Str(m.IPAddress).c_str());
+    m.dhcp.setOption(NetworkServiceRunner::kNsrIpNetmask, Utf8Str(m.GlobalDhcpOptions[DhcpOpt_SubnetMask]).c_str());
+    m.dhcp.setOption(DHCPServerRunner::kDsrKeyLowerIp, Utf8Str(m.lowerIP).c_str());
+    m.dhcp.setOption(DHCPServerRunner::kDsrKeyUpperIp, Utf8Str(m.upperIP).c_str());
 
     /* XXX: This parameters Dhcp Server will fetch via API */
Index: /trunk/src/VBox/Main/src-server/NATNetworkImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/NATNetworkImpl.cpp	(revision 49493)
+++ /trunk/src/VBox/Main/src-server/NATNetworkImpl.cpp	(revision 49494)
@@ -16,4 +16,5 @@
  */
 
+#include <string>
 #include "NetworkServiceRunner.h"
 #include "DHCPServerImpl.h"
@@ -870,8 +871,8 @@
     if (!m->fEnabled) return S_OK;
 
-    m->NATRunner.setOption(NETCFG_NETNAME, mName, true);
-    m->NATRunner.setOption(NETCFG_TRUNKTYPE, Utf8Str(aTrunkType), true);
-    m->NATRunner.setOption(NETCFG_IPADDRESS, m->IPv4Gateway, true);
-    m->NATRunner.setOption(NETCFG_NETMASK, m->IPv4NetworkMask, true);
+    m->NATRunner.setOption(NetworkServiceRunner::kNsrKeyNetwork, Utf8Str(mName).c_str());
+    m->NATRunner.setOption(NetworkServiceRunner::kNsrKeyTrunkType, Utf8Str(aTrunkType).c_str());
+    m->NATRunner.setOption(NetworkServiceRunner::kNsrIpAddress, Utf8Str(m->IPv4Gateway).c_str());
+    m->NATRunner.setOption(NetworkServiceRunner::kNsrIpNetmask, Utf8Str(m->IPv4NetworkMask).c_str());
 
     /* No portforwarding rules from command-line, all will be fetched via API */
Index: /trunk/src/VBox/Main/src-server/NetworkServiceRunner.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/NetworkServiceRunner.cpp	(revision 49493)
+++ /trunk/src/VBox/Main/src-server/NetworkServiceRunner.cpp	(revision 49494)
@@ -15,4 +15,7 @@
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
+
+#include <map>
+#include <string>
 #include "NetworkServiceRunner.h"
 #include <iprt/process.h>
@@ -20,35 +23,48 @@
 #include <iprt/env.h>
 
-struct ARGDEF
+
+const std::string NetworkServiceRunner::kNsrKeyName = "--name";
+const std::string NetworkServiceRunner::kNsrKeyNetwork = "--network";
+const std::string NetworkServiceRunner::kNsrKeyTrunkType = "--trunk-type";
+const std::string NetworkServiceRunner::kNsrTrunkName = "--trunk-name";
+const std::string NetworkServiceRunner::kNsrMacAddress = "--mac-address";
+const std::string NetworkServiceRunner::kNsrIpAddress = "--ip-address";
+const std::string NetworkServiceRunner::kNsrIpNetmask = "--netmask";
+
+struct NetworkServiceRunner::Data
 {
-    NETCFG Type;
-    const char * Name;
+    Data(const char* aProcName):mProcName(aProcName), mProcess(NIL_RTPROCESS){}
+    const char *mProcName;
+    RTPROCESS mProcess;
+    std::map<std::string, std::string> mOptions;
 };
 
-static const ARGDEF g_aArgDefs[] =
+NetworkServiceRunner::NetworkServiceRunner(const char *aProcName)
 {
-    {NETCFG_NAME, "--name"},
-    {NETCFG_NETNAME, "--network"},
-    {NETCFG_TRUNKTYPE, "--trunk-type"},
-    {NETCFG_TRUNKNAME, "--trunk-name"},
-    {NETCFG_MACADDRESS, "--mac-address"},
-    {NETCFG_IPADDRESS, "--ip-address"},
-    {NETCFG_VERBOSE, "--verbose"},
-    {NETCFG_NETMASK, "--netmask"},
-};
+    m = new NetworkServiceRunner::Data(aProcName);
+    
+}
 
-static const ARGDEF * getArgDef(NETCFG type)
+
+NetworkServiceRunner::~NetworkServiceRunner()
 {
-    for (unsigned i = 0; i < RT_ELEMENTS(g_aArgDefs); i++)
-        if (g_aArgDefs[i].Type == type)
-            return &g_aArgDefs[i];
+    stop();
+    delete m;
+    m = NULL;
+}
 
-    return NULL;
+
+int NetworkServiceRunner::setOption(const std::string& key, const std::string& val)
+{
+    m->mOptions.insert(std::map<std::string, std::string>::value_type(key, val));
+    return VINF_SUCCESS;
 }
+
 
 void NetworkServiceRunner::detachFromServer()
 {
-    mProcess = NIL_RTPROCESS;
+    m->mProcess = NIL_RTPROCESS;
 }
+
 
 int NetworkServiceRunner::start()
@@ -57,5 +73,7 @@
         return VINF_ALREADY_INITIALIZED;
 
-    const char * args[NETCFG_NOTOPT_MAXVAL * 2];
+    const char * args[10*2];
+
+    AssertReturn(m->mOptions.size() < 10, VERR_INTERNAL_ERROR);
 
     /* get the path to the executable */
@@ -69,5 +87,5 @@
     {
         suffix++;
-        strcpy(suffix, mProcName);
+        strcpy(suffix, m->mProcName);
     }
 
@@ -76,26 +94,20 @@
     args[index++] = exePath;
 
-    for (unsigned i = 0; i < NETCFG_NOTOPT_MAXVAL; i++)
+    std::map<std::string, std::string>::const_iterator it;
+    for(it = m->mOptions.begin(); it != m->mOptions.end(); ++it)
     {
-        if (mOptionEnabled[i])
-        {
-            const ARGDEF *pArgDef = getArgDef((NETCFG)i);
-            if (!pArgDef)
-                continue;
-            args[index++] = pArgDef->Name;
-
-            if (mOptions[i].length())
-                args[index++] = mOptions[i].c_str();  // value
-        }
+        args[index++] = it->first.c_str();
+        args[index++] = it->second.c_str();
     }
 
     args[index++] = NULL;
 
-    int rc = RTProcCreate(suffix ? exePath : mProcName, args, RTENV_DEFAULT, 0, &mProcess);
+    int rc = RTProcCreate(suffix ? exePath : m->mProcName, args, RTENV_DEFAULT, 0, &m->mProcess);
     if (RT_FAILURE(rc))
-        mProcess = NIL_RTPROCESS;
+        m->mProcess = NIL_RTPROCESS;
 
     return rc;
 }
+
 
 int NetworkServiceRunner::stop()
@@ -104,7 +116,7 @@
         return VINF_OBJECT_DESTROYED;
 
-    int rc = RTProcTerminate(mProcess);
-    RTProcWait(mProcess, RTPROCWAIT_FLAGS_BLOCK, NULL);
-    mProcess = NIL_RTPROCESS;
+    int rc = RTProcTerminate(m->mProcess);
+    RTProcWait(m->mProcess, RTPROCWAIT_FLAGS_BLOCK, NULL);
+    m->mProcess = NIL_RTPROCESS;
     return rc;
 }
@@ -112,14 +124,14 @@
 bool NetworkServiceRunner::isRunning()
 {
-    if (mProcess == NIL_RTPROCESS)
+    if (m->mProcess == NIL_RTPROCESS)
         return false;
 
     RTPROCSTATUS status;
-    int rc = RTProcWait(mProcess, RTPROCWAIT_FLAGS_NOBLOCK, &status);
+    int rc = RTProcWait(m->mProcess, RTPROCWAIT_FLAGS_NOBLOCK, &status);
 
     if (rc == VERR_PROCESS_RUNNING)
         return true;
 
-    mProcess = NIL_RTPROCESS;
+    m->mProcess = NIL_RTPROCESS;
     return false;
 }
