Changeset 17941 in vbox
- Timestamp:
- Mar 16, 2009 2:48:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r17937 r17941 31 31 #include "ProgressImpl.h" 32 32 #include "MachineImpl.h" 33 #include "HostNetworkInterfaceImpl.h" 33 34 34 35 #include "Logging.h" … … 1971 1972 rc = pNetworkAdapter->AttachToBridgedInterface(); 1972 1973 if (FAILED(rc)) throw rc; 1974 ComPtr<IHost> host; 1975 rc = pVirtualBox->COMGETTER(Host)(host.asOutParam()); 1976 if (FAILED(rc)) throw rc; 1977 com::SafeIfaceArray<IHostNetworkInterface> nwInterfaces; 1978 rc = host->COMGETTER(NetworkInterfaces)(ComSafeArrayAsOutParam(nwInterfaces)); 1979 if (FAILED(rc)) throw rc; 1980 /* We search for the first host network interface which 1981 * is usable for the bridged networking */ 1982 for (size_t i=0; i < nwInterfaces.size(); ++i) 1983 { 1984 HostNetworkInterfaceType_T itype; 1985 rc = nwInterfaces[i]->COMGETTER(InterfaceType)(&itype); 1986 if (FAILED(rc)) throw rc; 1987 if (itype == HostNetworkInterfaceType_Bridged) 1988 { 1989 Bstr name; 1990 rc = nwInterfaces[i]->COMGETTER(Name)(name.asOutParam()); 1991 if (FAILED(rc)) throw rc; 1992 /* Set the interface name to attach to */ 1993 pNetworkAdapter->COMSETTER(HostInterface)(name); 1994 if (FAILED(rc)) throw rc; 1995 break; 1996 } 1997 } 1973 1998 } 1974 1999 }
Note:
See TracChangeset
for help on using the changeset viewer.