Changeset 15372 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Dec 12, 2008 2:51:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r15235 r15372 49 49 case HostNetworkInterfaceType_PPP: return "PPP"; 50 50 case HostNetworkInterfaceType_SLIP: return "SLIP"; 51 } 52 return "Unknown"; 53 } 54 55 static const char *getHostIfStatusText(HostNetworkInterfaceStatus_T enmStatus) 56 { 57 switch (enmStatus) 58 { 59 case HostNetworkInterfaceStatus_Up: return "Up"; 60 case HostNetworkInterfaceStatus_Down: return "Down"; 51 61 } 52 62 return "Unknown"; … … 204 214 ComPtr<IHostNetworkInterface> networkInterface; 205 215 CHECK_RC_BREAK(enumerator->GetNext(networkInterface.asOutParam())); 216 #ifndef VBOX_WITH_HOSTNETIF_API 206 217 Bstr interfaceName; 207 218 networkInterface->COMGETTER(Name)(interfaceName.asOutParam()); … … 210 221 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 211 222 RTPrintf("GUID: %lS\n\n", Bstr(interfaceGuid.toString()).raw()); 212 #ifdef VBOX_WITH_HOSTNETIF_API 213 ULONG IPAddress; 214 networkInterface->COMGETTER(IPAddress)(&IPAddress); 215 RTPrintf("IPAddress: %d.%d.%d.%d\n", 216 ((uint8_t*)&IPAddress)[0], 217 ((uint8_t*)&IPAddress)[1], 218 ((uint8_t*)&IPAddress)[2], 219 ((uint8_t*)&IPAddress)[3]); 220 ULONG NetworkMask; 221 networkInterface->COMGETTER(NetworkMask)(&NetworkMask); 222 RTPrintf("NetworkMask: %d.%d.%d.%d\n", 223 ((uint8_t*)&NetworkMask)[0], 224 ((uint8_t*)&NetworkMask)[1], 225 ((uint8_t*)&NetworkMask)[2], 226 ((uint8_t*)&NetworkMask)[3]); 227 Bstr IPV6Address; 228 networkInterface->COMGETTER(IPV6Address)(IPV6Address.asOutParam()); 229 RTPrintf("IPV6Address: %lS\n", IPV6Address.raw()); 230 Bstr HardwareAddress; 231 networkInterface->COMGETTER(HardwareAddress)(HardwareAddress.asOutParam()); 232 RTPrintf("HardwareAddress: %lS\n", HardwareAddress.raw()); 233 HostNetworkInterfaceType_T Type; 234 networkInterface->COMGETTER(Type)(&Type); 235 RTPrintf("Type: %s\n", getHostIfTypeText(Type)); 236 HostNetworkInterfaceStatus_T Status; 237 networkInterface->COMGETTER(Status)(&Status); 238 RTPrintf("Status: %s\n\n", Status ? "Down":"Up"); 223 #else /* VBOX_WITH_HOSTNETIF_API */ 224 Bstr interfaceName; 225 networkInterface->COMGETTER(Name)(interfaceName.asOutParam()); 226 RTPrintf("Name: %lS\n", interfaceName.raw()); 227 Guid interfaceGuid; 228 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 229 RTPrintf("GUID: %lS\n", Bstr(interfaceGuid.toString()).raw()); 230 ULONG IPAddress; 231 networkInterface->COMGETTER(IPAddress)(&IPAddress); 232 RTPrintf("IPAddress: %d.%d.%d.%d\n", 233 ((uint8_t*)&IPAddress)[0], 234 ((uint8_t*)&IPAddress)[1], 235 ((uint8_t*)&IPAddress)[2], 236 ((uint8_t*)&IPAddress)[3]); 237 ULONG NetworkMask; 238 networkInterface->COMGETTER(NetworkMask)(&NetworkMask); 239 RTPrintf("NetworkMask: %d.%d.%d.%d\n", 240 ((uint8_t*)&NetworkMask)[0], 241 ((uint8_t*)&NetworkMask)[1], 242 ((uint8_t*)&NetworkMask)[2], 243 ((uint8_t*)&NetworkMask)[3]); 244 Bstr IPV6Address; 245 networkInterface->COMGETTER(IPV6Address)(IPV6Address.asOutParam()); 246 RTPrintf("IPV6Address: %lS\n", IPV6Address.raw()); 247 Bstr IPV6NetworkMask; 248 networkInterface->COMGETTER(IPV6NetworkMask)(IPV6NetworkMask.asOutParam()); 249 RTPrintf("IPV6NetworkMask: %lS\n", IPV6NetworkMask.raw()); 250 Bstr HardwareAddress; 251 networkInterface->COMGETTER(HardwareAddress)(HardwareAddress.asOutParam()); 252 RTPrintf("HardwareAddress: %lS\n", HardwareAddress.raw()); 253 HostNetworkInterfaceType_T Type; 254 networkInterface->COMGETTER(Type)(&Type); 255 RTPrintf("Type: %s\n", getHostIfTypeText(Type)); 256 HostNetworkInterfaceStatus_T Status; 257 networkInterface->COMGETTER(Status)(&Status); 258 RTPrintf("Status: %s\n\n", getHostIfStatusText(Status)); 239 259 #endif 240 260 }
Note:
See TracChangeset
for help on using the changeset viewer.