Changeset 15372 in vbox for trunk/src/VBox/Main
- Timestamp:
- Dec 12, 2008 2:51:29 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HostImpl.cpp
r15235 r15372 117 117 #endif 118 118 #ifdef VBOX_WITH_HOSTNETIF_API 119 #include <iprt/netif.h>119 #include "netif.h" 120 120 #endif 121 121 … … 762 762 763 763 #ifdef VBOX_WITH_HOSTNETIF_API 764 P RTNETIFINFO pIfs = RTNetIfList();764 PNETIFINFO pIfs = NetIfList(); 765 765 while (pIfs) 766 766 { -
trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
r15235 r15372 72 72 73 73 #ifdef VBOX_WITH_HOSTNETIF_API 74 static Bstr composeIPv6Address(PRTNETADDRIPV6 aAddrPtr) 75 { 76 char szTmp[8*5]; 77 78 RTStrPrintf(szTmp, sizeof(szTmp), 79 "%02x%02x:%02x%02x:%02x%02x:%02x%02x:" 80 "%02x%02x:%02x%02x:%02x%02x:%02x%02x", 81 aAddrPtr->au8[0], aAddrPtr->au8[1], 82 aAddrPtr->au8[2], aAddrPtr->au8[3], 83 aAddrPtr->au8[4], aAddrPtr->au8[5], 84 aAddrPtr->au8[6], aAddrPtr->au8[7], 85 aAddrPtr->au8[8], aAddrPtr->au8[9], 86 aAddrPtr->au8[10], aAddrPtr->au8[11], 87 aAddrPtr->au8[12], aAddrPtr->au8[13], 88 aAddrPtr->au8[14], aAddrPtr->au8[15]); 89 return Bstr(szTmp); 90 } 91 92 static Bstr composeHardwareAddress(PRTMAC aMacPtr) 93 { 94 char szTmp[6*3]; 95 96 RTStrPrintf(szTmp, sizeof(szTmp), 97 "%02x:%02x:%02x:%02x:%02x:%02x", 98 aMacPtr->au8[0], aMacPtr->au8[1], 99 aMacPtr->au8[2], aMacPtr->au8[3], 100 aMacPtr->au8[4], aMacPtr->au8[5]); 101 return Bstr(szTmp); 102 } 103 74 104 /** 75 105 * Initializes the host object. … … 79 109 * @param aGuid GUID of the host network interface 80 110 */ 81 HRESULT HostNetworkInterface::init (P RTNETIFINFO pIf)111 HRESULT HostNetworkInterface::init (PNETIFINFO pIf) 82 112 { 83 113 // LogFlowThisFunc (("aInterfaceName={%ls}, aGuid={%s}\n", … … 86 116 // ComAssertRet (aInterfaceName, E_INVALIDARG); 87 117 // ComAssertRet (!aGuid.isEmpty(), E_INVALIDARG); 88 ComAssertRet ( !pIf, E_INVALIDARG);118 ComAssertRet (pIf, E_INVALIDARG); 89 119 90 120 /* Enclose the state transition NotReady->InInit->Ready */ … … 94 124 unconst (mInterfaceName) = Bstr(pIf->szName); 95 125 unconst (mGuid) = pIf->Uuid; 96 // m.IPAddress = pIf->IPAddress; 97 // m.networkMask = pIf->IPNetMask; 98 // m.IPv6Address = composeIPv6Address(pIf->IPv6Address, pIf->IPv6NetMask); 126 m.IPAddress = pIf->IPAddress.u; 127 m.networkMask = pIf->IPNetMask.u; 128 m.IPV6Address = composeIPv6Address(&pIf->IPv6Address); 129 m.IPV6NetworkMask = composeIPv6Address(&pIf->IPv6NetMask); 130 m.hardwareAddress = composeHardwareAddress(&pIf->MACAddress); 131 m.type = pIf->enmType; 132 m.status = pIf->enmStatus; 99 133 100 134 /* Confirm a successful initialization */ … … 200 234 201 235 /** 236 * Returns the IP V6 network mask of the host network interface. 237 * 238 * @returns COM status code 239 * @param aIPV6Mask address of result pointer 240 */ 241 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6NetworkMask) (BSTR *aIPV6Mask) 242 { 243 CheckComArgOutPointerValid(aIPV6Mask); 244 245 AutoCaller autoCaller (this); 246 CheckComRCReturnRC (autoCaller.rc()); 247 248 m.IPV6NetworkMask.cloneTo (aIPV6Mask); 249 250 return S_OK; 251 } 252 253 /** 202 254 * Returns the hardware address of the host network interface. 203 255 * -
trunk/src/VBox/Main/Makefile.kmk
r15235 r15372 341 341 endif 342 342 343 ifdef VBOX_WITH_HOSTNETIF_API 344 VBoxSVC_SOURCES.win += win/NetIfList-win.cpp 345 VBoxSVC_SOURCES.linux += linux/NetIfList-linux.cpp 346 VBoxSVC_SOURCES.os2 += os2/NetIfList-os2.cpp 347 VBoxSVC_SOURCES.darwin += darwin/NetIfList-darwin.cpp 348 VBoxSVC_SOURCES.solaris += solaris/NetIfList-solaris.cpp 349 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API 350 endif 351 343 352 win/VBoxSVC.rc_INCS = $(PATH_VBoxSVC) 344 353 win/VBoxSVC.rc_DEPS = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r15335 r15372 5902 5902 </desc> 5903 5903 5904 <const name="Up" value="0"> 5904 <const name="Unknown" value="0"> 5905 <desc> 5906 The state of interface cannot be determined. 5907 </desc> 5908 </const> 5909 <const name="Up" value="1"> 5905 5910 <desc> 5906 5911 The interface is fully operational. 5907 5912 </desc> 5908 5913 </const> 5909 <const name="Down" value=" 1">5914 <const name="Down" value="2"> 5910 5915 <desc> 5911 5916 The interface is not functioning. … … 5937 5942 <attribute name="IPV6Address" type="wstring" readonly="yes"> 5938 5943 <desc>Returns the IP V6 address of the interface.</desc> 5944 </attribute> 5945 5946 <attribute name="IPV6NetworkMask" type="wstring" readonly="yes"> 5947 <desc>Returns the IP V6 network mask of the interface.</desc> 5939 5948 </attribute> 5940 5949 -
trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h
r15235 r15372 28 28 #include "Collection.h" 29 29 #ifdef VBOX_WITH_HOSTNETIF_API 30 #include " iprt/netif.h"30 #include "netif.h" 31 31 #endif 32 32 … … 60 60 HRESULT init (Bstr interfaceName, Guid guid); 61 61 #ifdef VBOX_WITH_HOSTNETIF_API 62 HRESULT init (P RTNETIFINFO pIfs);62 HRESULT init (PNETIFINFO pIfs); 63 63 #endif 64 64 … … 69 69 STDMETHOD(COMGETTER(NetworkMask)) (ULONG *aNetworkMask); 70 70 STDMETHOD(COMGETTER(IPV6Address)) (BSTR *aIPV6Address); 71 STDMETHOD(COMGETTER(IPV6NetworkMask)) (BSTR *aIPV6Mask); 71 72 STDMETHOD(COMGETTER(HardwareAddress)) (BSTR *aHardwareAddress); 72 73 STDMETHOD(COMGETTER(Type)) (HostNetworkInterfaceType_T *aType); … … 88 89 ULONG networkMask; 89 90 Bstr IPV6Address; 91 Bstr IPV6NetworkMask; 90 92 Bstr hardwareAddress; 91 93 HostNetworkInterfaceType_T type;
Note:
See TracChangeset
for help on using the changeset viewer.