Changeset 27976 in vbox for trunk/src/VBox/Main/NATEngineImpl.cpp
- Timestamp:
- Apr 4, 2010 2:16:32 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59682
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/NATEngineImpl.cpp
r27875 r27976 108 108 void NATEngine::FinalRelease() 109 109 { 110 uninit(); 110 uninit(); 111 111 } 112 112 … … 125 125 bool NATEngine::isModified() 126 126 { 127 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 127 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 128 128 bool fModified = m_fModified; 129 return fModified; 129 return fModified; 130 130 } 131 131 … … 177 177 } 178 178 179 STDMETHODIMP 179 STDMETHODIMP 180 180 NATEngine::GetNetworkSettings(ULONG *aMtu, ULONG *aSockSnd, ULONG *aSockRcv, ULONG *aTcpWndSnd, ULONG *aTcpWndRcv) 181 181 { … … 198 198 } 199 199 200 STDMETHODIMP 200 STDMETHODIMP 201 201 NATEngine::SetNetworkSettings(ULONG aMtu, ULONG aSockSnd, ULONG aSockRcv, ULONG aTcpWndSnd, ULONG aTcpWndRcv) 202 202 { … … 245 245 { 246 246 settings::NATRule r = it->second; 247 Utf8Str utf = Utf8StrFmt("%s,%d,%s,%d,%s,%d", r.strName.raw(), r.u32Proto, 247 Utf8Str utf = Utf8StrFmt("%s,%d,%s,%d,%s,%d", r.strName.raw(), r.u32Proto, 248 248 r.strHostIP.raw(), r.u16HostPort, r.strGuestIP.raw(), r.u16GuestPort); 249 249 utf.cloneTo(&sf[i]); … … 254 254 255 255 256 STDMETHODIMP 256 STDMETHODIMP 257 257 NATEngine::AddRedirect(IN_BSTR aName, NATProtocol_T aProto, IN_BSTR aBindIp, USHORT aHostPort, IN_BSTR aGuestIP, USHORT aGuestPort) 258 258 { … … 262 262 263 263 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 264 Utf8Str name = aName; 264 Utf8Str name = aName; 265 265 settings::NATRule r; 266 266 if (name.isEmpty()) … … 292 292 } 293 293 294 STDMETHODIMP 294 STDMETHODIMP 295 295 NATEngine::RemoveRedirect(IN_BSTR aName) 296 296 { … … 300 300 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 301 301 Utf8Str rule; 302 NATRuleMap::iterator it = mNATRules.find(aName); 302 NATRuleMap::iterator it = mNATRules.find(aName); 303 303 if (it == mNATRules.end()) 304 304 return E_INVALIDARG; … … 333 333 /* port forwarding */ 334 334 mNATRules.clear(); 335 for (settings::NATRuleList::const_iterator it = data.llRules.begin(); 335 for (settings::NATRuleList::const_iterator it = data.llRules.begin(); 336 336 it != data.llRules.end(); ++it) 337 337 { … … 366 366 data.fDnsUseHostResolver = mData->mDnsUseHostResolver; 367 367 368 for (NATRuleMap::iterator it = mNATRules.begin(); 368 for (NATRuleMap::iterator it = mNATRules.begin(); 369 369 it != mNATRules.end(); ++it) 370 370 data.llRules.push_back(it->second); … … 379 379 AutoCaller autoCaller(this); 380 380 AssertComRCReturnRC (autoCaller.rc()); 381 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 381 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 382 382 if (Bstr(mData->mNetwork) != aNetwork) 383 383 { … … 406 406 } 407 407 408 STDMETHODIMP 408 STDMETHODIMP 409 409 NATEngine::COMSETTER(HostIP) (IN_BSTR aBindIP) 410 410 { 411 411 AutoCaller autoCaller(this); 412 412 AssertComRCReturnRC (autoCaller.rc()); 413 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 413 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 414 414 if (Bstr(mData->mBindIP) != aBindIP) 415 415 { … … 438 438 AutoCaller autoCaller(this); 439 439 AssertComRCReturnRC (autoCaller.rc()); 440 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 440 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 441 441 if (Bstr(mData->mTftpPrefix) != aTftpPrefix) 442 442 { … … 469 469 AutoCaller autoCaller(this); 470 470 AssertComRCReturnRC (autoCaller.rc()); 471 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 471 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 472 472 if (Bstr(mData->mTftpBootFile) != aTftpBootFile) 473 473 { … … 500 500 AutoCaller autoCaller(this); 501 501 AssertComRCReturnRC (autoCaller.rc()); 502 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 502 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 503 503 if (Bstr(mData->mTftpNextServer) != aTftpNextServer) 504 504 { … … 531 531 AutoCaller autoCaller(this); 532 532 AssertComRCReturnRC (autoCaller.rc()); 533 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 534 533 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 534 535 535 if (mData->mDnsPassDomain != aDnsPassDomain) 536 536 { … … 557 557 AutoCaller autoCaller(this); 558 558 AssertComRCReturnRC (autoCaller.rc()); 559 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 559 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 560 560 561 561 if (mData->mDnsProxy != aDnsProxy) … … 583 583 AutoCaller autoCaller(this); 584 584 AssertComRCReturnRC (autoCaller.rc()); 585 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 585 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 586 586 *aDnsUseHostResolver = mData->mDnsUseHostResolver; 587 587 return S_OK;
Note:
See TracChangeset
for help on using the changeset viewer.