Changeset 28296 in vbox
- Timestamp:
- Apr 14, 2010 12:11:07 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl2.cpp
r28290 r28296 2673 2673 hrc = natDriver->COMGETTER(Redirects)(ComSafeArrayAsOutParam(pfs)); H(); 2674 2674 PCFGMNODE pPF = NULL; /* /Devices/Dev/.../Config/PF#0/ */ 2675 for (unsigned int i = 0; i < pfs.size(); ++i)2675 for (unsigned int i = 0; i < pfs.size(); ++i) 2676 2676 { 2677 2677 uint16_t port = 0; -
trunk/src/VBox/Main/DHCPServerRunner.cpp
r26186 r28296 58 58 { 59 59 for (unsigned i = 0; i < RT_ELEMENTS(g_aArgDefs); i++) 60 if (g_aArgDefs[i].Type == type)60 if (g_aArgDefs[i].Type == type) 61 61 return &g_aArgDefs[i]; 62 62 … … 140 140 bool DHCPServerRunner::isRunning() 141 141 { 142 if (mProcess == NIL_RTPROCESS)142 if (mProcess == NIL_RTPROCESS) 143 143 return false; 144 144 … … 146 146 int rc = RTProcWait(mProcess, RTPROCWAIT_FLAGS_NOBLOCK, &status); 147 147 148 if (rc == VERR_PROCESS_RUNNING)148 if (rc == VERR_PROCESS_RUNNING) 149 149 return true; 150 150 -
trunk/src/VBox/Main/HostImpl.cpp
r28036 r28296 442 442 hr = pncc->GetDisplayName( &lpszName ); 443 443 Assert(hr == S_OK); 444 if (hr == S_OK)444 if (hr == S_OK) 445 445 { 446 446 Bstr name((CBSTR)lpszName); … … 631 631 &lpszApp ); 632 632 Assert(hr == S_OK); 633 if (hr == S_OK)633 if (hr == S_OK) 634 634 { 635 635 # ifdef VBOX_NETFLT_ONDEMAND_BIND … … 640 640 hr = pNc->FindComponent(L"sun_VBoxNetFlt", &pTcpIpNcc); 641 641 # ifndef VBOX_WITH_HARDENING 642 if (hr != S_OK)642 if (hr != S_OK) 643 643 { 644 644 /* TODO: try to install the netflt from here */ … … 648 648 # endif 649 649 650 if (hr == S_OK)650 if (hr == S_OK) 651 651 { 652 652 hr = VBoxNetCfgWinGetBindingPathEnum(pTcpIpNcc, EBP_BELOW, &pEnumBp); … … 659 659 { 660 660 /* S_OK == enabled, S_FALSE == disabled */ 661 if (pBp->IsEnabled() == S_OK)661 if (pBp->IsEnabled() == S_OK) 662 662 { 663 663 hr = VBoxNetCfgWinGetBindingInterfaceEnum(pBp, &pEnumBi); … … 671 671 hr = pBi->GetLowerComponent( &pMpNcc ); 672 672 Assert(hr == S_OK); 673 if (hr == S_OK)673 if (hr == S_OK) 674 674 { 675 675 ULONG uComponentStatus; 676 676 hr = pMpNcc->GetDeviceStatus(&uComponentStatus); 677 677 Assert(hr == S_OK); 678 if (hr == S_OK)678 if (hr == S_OK) 679 679 { 680 if (uComponentStatus == 0)680 if (uComponentStatus == 0) 681 681 { 682 682 vboxNetWinAddComponent(&list, pMpNcc); … … 1411 1411 std::list <ComObjPtr<HostNetworkInterface> > allList; 1412 1412 int rc = NetIfList(allList); 1413 if (RT_FAILURE(rc))1413 if (RT_FAILURE(rc)) 1414 1414 return E_FAIL; 1415 1415 … … 1421 1421 HostNetworkInterfaceType_T t; 1422 1422 HRESULT hr = (*it)->COMGETTER(InterfaceType)(&t); 1423 if (FAILED(hr))1423 if (FAILED(hr)) 1424 1424 return hr; 1425 1425 1426 if (t == type)1426 if (t == type) 1427 1427 { 1428 1428 (*it)->setVirtualBox(m->pParent); -
trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
r27607 r28296 92 92 NETIFINFO info; 93 93 int rc = NetIfGetConfig(this, &info); 94 if (RT_SUCCESS(rc))94 if (RT_SUCCESS(rc)) 95 95 { 96 96 m.realIPAddress = m.IPAddress = info.IPAddress.u; … … 236 236 #endif 237 237 char *addr = inet_ntoa(tmp); 238 if (addr)238 if (addr) 239 239 { 240 240 Bstr(addr).detachTo(aIPAddress); … … 271 271 #endif 272 272 char *addr = inet_ntoa(tmp); 273 if (addr)273 if (addr) 274 274 { 275 275 Bstr(addr).detachTo(aNetworkMask); … … 443 443 ULONG ip, mask; 444 444 ip = inet_addr(Utf8Str(aIPAddress).raw()); 445 if (ip != INADDR_NONE)445 if (ip != INADDR_NONE) 446 446 { 447 447 if (Bstr(aNetMask).isEmpty()) … … 449 449 else 450 450 mask = inet_addr(Utf8Str(aNetMask).raw()); 451 if (mask != INADDR_NONE)451 if (mask != INADDR_NONE) 452 452 { 453 453 if (m.realIPAddress == ip && m.realNetworkMask == mask) -
trunk/src/VBox/Main/linux/PerformanceLinux.cpp
r27950 r28296 75 75 76 76 std::vector<RTPROCESS>::iterator it; 77 for (it = processes.begin(); it != processes.end(); it++)77 for (it = processes.begin(); it != processes.end(); it++) 78 78 { 79 79 VMProcessStats vmStats; -
trunk/src/VBox/Main/xml/Settings.cpp
r28295 r28296 1834 1834 if (llNetworkModes.size() > 2) 1835 1835 { 1836 throw ConfigFileError(this, pelmAdapter, N_("Invalid number of modes '%d'attached to Adapter attribute"), llNetworkModes.size());1836 throw ConfigFileError(this, pelmAdapter, N_("Invalid number of modes ('%d') attached to Adapter attribute"), llNetworkModes.size()); 1837 1837 } 1838 1838 for (it = llNetworkModes.begin(); it != llNetworkModes.end(); ++it) … … 1845 1845 pelmNode->getChildElements(llDisabledNetworkModes); 1846 1846 /* run over disabled list and load settings */ 1847 for(itDisabled = llDisabledNetworkModes.begin(); itDisabled != llDisabledNetworkModes.end(); ++itDisabled) 1847 for (itDisabled = llDisabledNetworkModes.begin(); 1848 itDisabled != llDisabledNetworkModes.end(); ++itDisabled) 1848 1849 { 1849 1850 const xml::ElementNode *pelmDisabledNode = *itDisabled; … … 1865 1866 { 1866 1867 if (fEnabled) 1867 {1868 1868 nic.mode = NetworkAttachmentType_NAT; 1869 } 1870 nic.fHasDisabledNAT = (nic.mode != NetworkAttachmentType_NAT ) && !fEnabled;1869 1870 nic.fHasDisabledNAT = (nic.mode != NetworkAttachmentType_NAT && !fEnabled); 1871 1871 elmMode.getAttributeValue("network", nic.nat.strNetwork); // optional network name 1872 1872 elmMode.getAttributeValue("hostip", nic.nat.strBindIP); … … 1892 1892 xml::ElementNodesList plstNatPF; 1893 1893 elmMode.getChildElements(plstNatPF, "Forwarding"); 1894 for (xml::ElementNodesList::iterator pf = plstNatPF.begin(); pf != plstNatPF.end(); ++pf)1894 for (xml::ElementNodesList::iterator pf = plstNatPF.begin(); pf != plstNatPF.end(); ++pf) 1895 1895 { 1896 1896 NATRule rule; … … 1907 1907 } 1908 1908 } 1909 else if ( 1910 1911 1909 else if ( fEnabled 1910 && ( (elmMode.nameEquals("HostInterface")) 1911 || (elmMode.nameEquals("BridgedInterface"))) 1912 1912 ) 1913 1913 { … … 1922 1922 throw ConfigFileError(this, &elmMode, N_("Required InternalNetwork/@name element is missing")); 1923 1923 } 1924 else if ( 1925 1924 else if ( fEnabled 1925 && elmMode.nameEquals("HostOnlyInterface")) 1926 1926 { 1927 1927 nic.mode = NetworkAttachmentType_HostOnly; … … 3546 3546 } 3547 3547 3548 void MachineConfigFile::buildNetworkXML(NetworkAttachmentType_T mode, xml::ElementNode &elmParent, const NetworkAdapter &nic) 3548 /** 3549 * Fill a <Network> node. Only relevant for XML version >= v1_10. 3550 * @param mode 3551 * @param elmParent 3552 * @param nice 3553 */ 3554 void MachineConfigFile::buildNetworkXML(NetworkAttachmentType_T mode, 3555 xml::ElementNode &elmParent, 3556 const NetworkAdapter &nic) 3549 3557 { 3550 3558 switch (mode) … … 3584 3592 pelmTFTP->setAttribute("next-server", nic.nat.strTftpNextServer); 3585 3593 } 3586 for (NATRuleList::const_iterator rule = nic.nat.llRules.begin();3594 for (NATRuleList::const_iterator rule = nic.nat.llRules.begin(); 3587 3595 rule != nic.nat.llRules.end(); ++rule) 3588 3596 {
Note:
See TracChangeset
for help on using the changeset viewer.