Changeset 22173 in vbox for trunk/src/VBox/Main/DHCPServerImpl.cpp
- Timestamp:
- Aug 11, 2009 3:38:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DHCPServerImpl.cpp
r21878 r22173 86 86 } 87 87 88 HRESULT DHCPServer::init(VirtualBox *aVirtualBox, const settings::Key &aNode) 89 { 90 using namespace settings; 91 88 HRESULT DHCPServer::init(VirtualBox *aVirtualBox, 89 const settings::DHCPServer &data) 90 { 92 91 /* Enclose the state transition NotReady->InInit->Ready */ 93 92 AutoInitSpan autoInitSpan(this); … … 99 98 aVirtualBox->addDependentChild (this); 100 99 101 unconst(mName) = aNode.stringValue ("networkName");102 m.IPAddress = aNode.stringValue ("IPAddress");103 m.networkMask = aNode.stringValue ("networkMask");104 m.enabled = aNode.value <bool> ("enabled");105 m.lowerIP = aNode.stringValue ("lowerIP");106 m.upperIP = aNode.stringValue ("upperIP");100 unconst(mName) = data.strNetworkName; 101 m.IPAddress = data.strIPAddress; 102 m.networkMask = data.strIPNetworkMask; 103 m.enabled = data.fEnabled; 104 m.lowerIP = data.strIPLower; 105 m.upperIP = data.strIPUpper; 107 106 108 107 autoInitSpan.setSucceeded(); … … 111 110 } 112 111 113 HRESULT DHCPServer::saveSettings (settings::Key &aParentNode) 114 { 115 using namespace settings; 116 117 AssertReturn(!aParentNode.isNull(), E_FAIL); 118 112 HRESULT DHCPServer::saveSettings(settings::DHCPServer &data) 113 { 119 114 AutoCaller autoCaller(this); 120 115 CheckComRCReturnRC(autoCaller.rc()); … … 122 117 AutoReadLock alock(this); 123 118 124 Key aNode = aParentNode.appendKey ("DHCPServer"); 125 /* required */ 126 aNode.setValue <Bstr> ("networkName", mName); 127 aNode.setValue <Bstr> ("IPAddress", m.IPAddress); 128 aNode.setValue <Bstr> ("networkMask", m.networkMask); 129 aNode.setValue <Bstr> ("lowerIP", m.lowerIP); 130 aNode.setValue <Bstr> ("upperIP", m.upperIP); 131 /* To force it back to a numeric value; will otherwise break for 2.2.x. */ 132 aNode.setValue <ULONG> ("enabled", m.enabled); 119 data.strNetworkName = mName; 120 data.strIPAddress = m.IPAddress; 121 data.strIPNetworkMask = m.networkMask; 122 data.fEnabled = m.enabled; 123 data.strIPLower = m.lowerIP; 124 data.strIPUpper = m.upperIP; 133 125 134 126 return S_OK; … … 243 235 } 244 236 245 STDMETHODIMP DHCPServer::Start 237 STDMETHODIMP DHCPServer::Start(IN_BSTR aNetworkName, IN_BSTR aTrunkName, IN_BSTR aTrunkType) 246 238 { 247 239 /* Silently ignore attepmts to run disabled servers. */
Note:
See TracChangeset
for help on using the changeset viewer.