Changeset 15570 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Dec 16, 2008 10:39:34 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 41079
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r15372 r15570 203 203 ComPtr<IHost> host; 204 204 CHECK_ERROR(virtualBox, COMGETTER(Host)(host.asOutParam())); 205 ComPtr<IHostNetworkInterfaceCollection> coll; 206 ComPtr<IHostNetworkInterfaceEnumerator> enumerator; 207 CHECK_ERROR(host, COMGETTER(NetworkInterfaces)(coll.asOutParam())); 208 if (SUCCEEDED(rc) && coll) 209 { 210 CHECK_ERROR(coll, Enumerate(enumerator.asOutParam())); 211 BOOL hasMore; 212 while (SUCCEEDED(enumerator->HasMore(&hasMore)) && hasMore) 213 { 214 ComPtr<IHostNetworkInterface> networkInterface; 215 CHECK_RC_BREAK(enumerator->GetNext(networkInterface.asOutParam())); 205 com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces; 206 CHECK_ERROR(host, 207 COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces))); 208 for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i) 209 { 210 ComPtr<IHostNetworkInterface> networkInterface = hostNetworkInterfaces[i]; 216 211 #ifndef VBOX_WITH_HOSTNETIF_API 217 218 219 220 221 222 212 Bstr interfaceName; 213 networkInterface->COMGETTER(Name)(interfaceName.asOutParam()); 214 RTPrintf("Name: %lS\n", interfaceName.raw()); 215 Guid interfaceGuid; 216 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 217 RTPrintf("GUID: %lS\n\n", Bstr(interfaceGuid.toString()).raw()); 223 218 #else /* VBOX_WITH_HOSTNETIF_API */ 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 219 Bstr interfaceName; 220 networkInterface->COMGETTER(Name)(interfaceName.asOutParam()); 221 RTPrintf("Name: %lS\n", interfaceName.raw()); 222 Guid interfaceGuid; 223 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 224 RTPrintf("GUID: %lS\n", Bstr(interfaceGuid.toString()).raw()); 225 ULONG IPAddress; 226 networkInterface->COMGETTER(IPAddress)(&IPAddress); 227 RTPrintf("IPAddress: %d.%d.%d.%d\n", 228 ((uint8_t*)&IPAddress)[0], 229 ((uint8_t*)&IPAddress)[1], 230 ((uint8_t*)&IPAddress)[2], 231 ((uint8_t*)&IPAddress)[3]); 232 ULONG NetworkMask; 233 networkInterface->COMGETTER(NetworkMask)(&NetworkMask); 234 RTPrintf("NetworkMask: %d.%d.%d.%d\n", 235 ((uint8_t*)&NetworkMask)[0], 236 ((uint8_t*)&NetworkMask)[1], 237 ((uint8_t*)&NetworkMask)[2], 238 ((uint8_t*)&NetworkMask)[3]); 239 Bstr IPV6Address; 240 networkInterface->COMGETTER(IPV6Address)(IPV6Address.asOutParam()); 241 RTPrintf("IPV6Address: %lS\n", IPV6Address.raw()); 242 Bstr IPV6NetworkMask; 243 networkInterface->COMGETTER(IPV6NetworkMask)(IPV6NetworkMask.asOutParam()); 244 RTPrintf("IPV6NetworkMask: %lS\n", IPV6NetworkMask.raw()); 245 Bstr HardwareAddress; 246 networkInterface->COMGETTER(HardwareAddress)(HardwareAddress.asOutParam()); 247 RTPrintf("HardwareAddress: %lS\n", HardwareAddress.raw()); 248 HostNetworkInterfaceType_T Type; 249 networkInterface->COMGETTER(Type)(&Type); 250 RTPrintf("Type: %s\n", getHostIfTypeText(Type)); 251 HostNetworkInterfaceStatus_T Status; 252 networkInterface->COMGETTER(Status)(&Status); 253 RTPrintf("Status: %s\n\n", getHostIfStatusText(Status)); 259 254 #endif 260 }261 255 } 262 256 }
Note:
See TracChangeset
for help on using the changeset viewer.