Changeset 18012 in vbox
- Timestamp:
- Mar 17, 2009 10:36:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r18007 r18012 2025 2025 if (!pvsys->strExtraConfig.compare("type=Bridged", Utf8Str::CaseInsensitive)) 2026 2026 { 2027 /* Attach to the right interface */ 2027 2028 rc = pNetworkAdapter->AttachToBridgedInterface(); 2028 2029 if (FAILED(rc)) throw rc; … … 2034 2035 if (FAILED(rc)) throw rc; 2035 2036 /* We search for the first host network interface which 2036 * is usable for thebridged networking */2037 * is usable for bridged networking */ 2037 2038 for (size_t i=0; i < nwInterfaces.size(); ++i) 2038 2039 { … … 2041 2042 if (FAILED(rc)) throw rc; 2042 2043 if (itype == HostNetworkInterfaceType_Bridged) 2044 { 2045 Bstr name; 2046 rc = nwInterfaces[i]->COMGETTER(Name)(name.asOutParam()); 2047 if (FAILED(rc)) throw rc; 2048 /* Set the interface name to attach to */ 2049 pNetworkAdapter->COMSETTER(HostInterface)(name); 2050 if (FAILED(rc)) throw rc; 2051 break; 2052 } 2053 } 2054 } 2055 /* Next test for host only interfaces */ 2056 else if (!pvsys->strExtraConfig.compare("type=HostOnly", Utf8Str::CaseInsensitive)) 2057 { 2058 /* Attach to the right interface */ 2059 rc = pNetworkAdapter->AttachToHostOnlyInterface(); 2060 if (FAILED(rc)) throw rc; 2061 ComPtr<IHost> host; 2062 rc = pVirtualBox->COMGETTER(Host)(host.asOutParam()); 2063 if (FAILED(rc)) throw rc; 2064 com::SafeIfaceArray<IHostNetworkInterface> nwInterfaces; 2065 rc = host->COMGETTER(NetworkInterfaces)(ComSafeArrayAsOutParam(nwInterfaces)); 2066 if (FAILED(rc)) throw rc; 2067 /* We search for the first host network interface which 2068 * is usable for host only networking */ 2069 for (size_t i=0; i < nwInterfaces.size(); ++i) 2070 { 2071 HostNetworkInterfaceType_T itype; 2072 rc = nwInterfaces[i]->COMGETTER(InterfaceType)(&itype); 2073 if (FAILED(rc)) throw rc; 2074 if (itype == HostNetworkInterfaceType_HostOnly) 2043 2075 { 2044 2076 Bstr name;
Note:
See TracChangeset
for help on using the changeset viewer.