儲存庫 vbox 的更動 17309
- 時間撮記:
- 2009-3-3 下午06:54:23 (16 年 以前)
- 位置:
- trunk/src/VBox
- 檔案:
-
- 修改 6 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r17275 r17309 303 303 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 304 304 RTPrintf("GUID: %lS\n", Bstr(interfaceGuid.toString()).raw()); 305 ComPtr<IHostNetworkInterfaceIpConfig> ipConfig; 306 networkInterface->COMGETTER(IpConfig)(ipConfig.asOutParam()); 305 307 ULONG IPAddress; 306 networkInterface->COMGETTER(IPAddress)(&IPAddress);308 ipConfig->COMGETTER(IPAddress)(&IPAddress); 307 309 RTPrintf("IPAddress: %d.%d.%d.%d\n", 308 310 ((uint8_t*)&IPAddress)[0], … … 311 313 ((uint8_t*)&IPAddress)[3]); 312 314 ULONG NetworkMask; 313 networkInterface->COMGETTER(NetworkMask)(&NetworkMask);315 ipConfig->COMGETTER(NetworkMask)(&NetworkMask); 314 316 RTPrintf("NetworkMask: %d.%d.%d.%d\n", 315 317 ((uint8_t*)&NetworkMask)[0], … … 318 320 ((uint8_t*)&NetworkMask)[3]); 319 321 Bstr IPV6Address; 320 networkInterface->COMGETTER(IPV6Address)(IPV6Address.asOutParam());322 ipConfig->COMGETTER(IPV6Address)(IPV6Address.asOutParam()); 321 323 RTPrintf("IPV6Address: %lS\n", IPV6Address.raw()); 322 324 Bstr IPV6NetworkMask; 323 networkInterface->COMGETTER(IPV6NetworkMask)(IPV6NetworkMask.asOutParam());325 ipConfig->COMGETTER(IPV6NetworkMask)(IPV6NetworkMask.asOutParam()); 324 326 RTPrintf("IPV6NetworkMask: %lS\n", IPV6NetworkMask.raw()); 325 327 Bstr HardwareAddress; -
trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
r17277 r17309 72 72 73 73 return S_OK; 74 } 75 76 void HostNetworkInterface::uninit() 77 { 78 LogFlowThisFunc (("\n")); 79 80 /* Enclose the state transition Ready->InUninit->NotReady */ 81 AutoUninitSpan autoUninitSpan (this); 82 if (autoUninitSpan.uninitDone()) 83 return; 84 85 m.ipConfig.setNull(); 74 86 } 75 87 … … 129 141 mIfType = ifType; 130 142 131 m.IPAddress = pIf->IPAddress.u; 132 m.networkMask = pIf->IPNetMask.u; 133 m.IPV6Address = composeIPv6Address(&pIf->IPv6Address); 134 m.IPV6NetworkMask = composeIPv6Address(&pIf->IPv6NetMask); 143 m.ipConfig.createObject(); 144 145 HRESULT hr = m.ipConfig->init (pIf); 146 if(FAILED(hr)) 147 return hr; 148 135 149 m.hardwareAddress = composeHardwareAddress(&pIf->MACAddress); 136 150 #ifdef RT_OS_WINDOWS … … 188 202 } 189 203 190 191 /** 192 * Returns the IP address of the host network interface. 193 * 194 * @returns COM status code 195 * @param aIPAddress address of result pointer 196 */ 197 STDMETHODIMP HostNetworkInterface::COMGETTER(IPAddress) (ULONG *aIPAddress) 198 { 199 CheckComArgOutPointerValid(aIPAddress); 200 201 AutoCaller autoCaller (this); 202 CheckComRCReturnRC (autoCaller.rc()); 203 204 *aIPAddress = m.IPAddress; 205 206 return S_OK; 207 } 208 209 /** 210 * Returns the netwok mask of the host network interface. 211 * 212 * @returns COM status code 213 * @param aNetworkMask address of result pointer 214 */ 215 STDMETHODIMP HostNetworkInterface::COMGETTER(NetworkMask) (ULONG *aNetworkMask) 216 { 217 CheckComArgOutPointerValid(aNetworkMask); 218 219 AutoCaller autoCaller (this); 220 CheckComRCReturnRC (autoCaller.rc()); 221 222 *aNetworkMask = m.networkMask; 223 224 return S_OK; 225 } 226 227 /** 228 * Returns the IP V6 address of the host network interface. 229 * 230 * @returns COM status code 231 * @param aIPV6Address address of result pointer 232 */ 233 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6Address) (BSTR *aIPV6Address) 234 { 235 CheckComArgOutPointerValid(aIPV6Address); 236 237 AutoCaller autoCaller (this); 238 CheckComRCReturnRC (autoCaller.rc()); 239 240 m.IPV6Address.cloneTo (aIPV6Address); 241 242 return S_OK; 243 } 244 245 /** 246 * Returns the IP V6 network mask of the host network interface. 247 * 248 * @returns COM status code 249 * @param aIPV6Mask address of result pointer 250 */ 251 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6NetworkMask) (BSTR *aIPV6Mask) 252 { 253 CheckComArgOutPointerValid(aIPV6Mask); 254 255 AutoCaller autoCaller (this); 256 CheckComRCReturnRC (autoCaller.rc()); 257 258 m.IPV6NetworkMask.cloneTo (aIPV6Mask); 204 STDMETHODIMP HostNetworkInterface::COMGETTER(IpConfig) (IHostNetworkInterfaceIpConfig **aIpConfig) 205 { 206 if (!aIpConfig) 207 return E_POINTER; 208 209 AutoCaller autoCaller (this); 210 CheckComRCReturnRC (autoCaller.rc()); 211 212 m.ipConfig.queryInterfaceTo (aIpConfig); 259 213 260 214 return S_OK; -
trunk/src/VBox/Main/Makefile.kmk
r17208 r17309 281 281 HostFloppyDriveImpl.cpp \ 282 282 HostNetworkInterfaceImpl.cpp \ 283 HostNetworkInterfaceIpConfigImpl.cpp \ 283 284 GuestOSTypeImpl.cpp \ 284 285 NetworkAdapterImpl.cpp \ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r17291 r17309 6448 6448 6449 6449 <interface 6450 name="IHostNetworkInterfaceIpConfig" extends="$unknown" 6451 uuid="38f31587-1ad2-4593-ab0c-d16f6e36c0ee" 6452 wsmap="managed" 6453 > 6454 <desc> 6455 Reprents IP settings for one of host's network interfaces. IP V6 address and network 6456 mask are strings of 32 hexdecimal digits grouped by four. Groups are 6457 separated by colons. 6458 For example, fe80:0000:0000:0000:021e:c2ff:fed2:b030. 6459 </desc> 6460 6461 <attribute name="IPAddress" type="unsigned long" readonly="yes"> 6462 <desc>Returns the IP V4 address of the interface.</desc> 6463 </attribute> 6464 6465 <attribute name="networkMask" type="unsigned long" readonly="yes"> 6466 <desc>Returns the network mask of the interface.</desc> 6467 </attribute> 6468 6469 <attribute name="defaultGateway" type="unsigned long" readonly="yes"> 6470 <desc>Returns the network mask of the interface.</desc> 6471 </attribute> 6472 6473 <attribute name="IPV6Address" type="wstring" readonly="yes"> 6474 <desc>Returns the IP V6 address of the interface.</desc> 6475 </attribute> 6476 6477 <attribute name="IPV6NetworkMask" type="wstring" readonly="yes"> 6478 <desc>Returns the IP V6 network mask of the interface.</desc> 6479 </attribute> 6480 </interface> 6481 6482 <interface 6450 6483 name="IHostNetworkInterface" extends="$unknown" 6451 uuid=" c312bf73-b353-4add-9db7-481b891ec08c"6484 uuid="3fd5d8d9-c503-4c1a-b88c-e78fb78f8559" 6452 6485 wsmap="managed" 6453 6486 > … … 6466 6499 </attribute> 6467 6500 6468 <attribute name="IPAddress" type="unsigned long" readonly="yes"> 6469 <desc>Returns the IP V4 address of the interface.</desc> 6470 </attribute> 6471 6472 <attribute name="networkMask" type="unsigned long" readonly="yes"> 6473 <desc>Returns the network mask of the interface.</desc> 6474 </attribute> 6475 6476 <attribute name="IPV6Address" type="wstring" readonly="yes"> 6477 <desc>Returns the IP V6 address of the interface.</desc> 6478 </attribute> 6479 6480 <attribute name="IPV6NetworkMask" type="wstring" readonly="yes"> 6481 <desc>Returns the IP V6 network mask of the interface.</desc> 6501 <attribute name="ipConfig" type="IHostNetworkInterfaceIpConfig" readonly="yes"> 6502 <desc>Returns the adapter ip config information </desc> 6482 6503 </attribute> 6483 6504 -
trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h
r17275 r17309 27 27 #include "VirtualBoxBase.h" 28 28 #include "Collection.h" 29 #include "HostNetworkInterfaceIpConfigImpl.h" 30 29 31 #ifdef VBOX_WITH_HOSTNETIF_API 30 32 /* class HostNetworkInterface; */ … … 64 66 HRESULT init (Bstr aInterfaceName, HostNetworkInterfaceType_T ifType, struct NETIFINFO *pIfs); 65 67 #endif 68 void uninit(); 66 69 67 70 // IHostNetworkInterface properties 68 71 STDMETHOD(COMGETTER(Name)) (BSTR *aInterfaceName); 69 72 STDMETHOD(COMGETTER(Id)) (OUT_GUID aGuid); 70 STDMETHOD(COMGETTER(IPAddress)) (ULONG *aIPAddress); 71 STDMETHOD(COMGETTER(NetworkMask)) (ULONG *aNetworkMask); 72 STDMETHOD(COMGETTER(IPV6Address)) (BSTR *aIPV6Address); 73 STDMETHOD(COMGETTER(IPV6NetworkMask)) (BSTR *aIPV6Mask); 73 STDMETHOD(COMGETTER(IpConfig)) (IHostNetworkInterfaceIpConfig **aIpConfig); 74 74 STDMETHOD(COMGETTER(HardwareAddress)) (BSTR *aHardwareAddress); 75 75 STDMETHOD(COMGETTER(MediumType)) (HostNetworkInterfaceMediumType_T *aType); … … 87 87 struct Data 88 88 { 89 Data() : IPAddress (0), networkMask (0), 90 mediumType (HostNetworkInterfaceMediumType_Unknown), 89 Data() : mediumType (HostNetworkInterfaceMediumType_Unknown), 91 90 status(HostNetworkInterfaceStatus_Down){} 92 91 93 ULONG IPAddress; 94 ULONG networkMask; 95 Bstr IPV6Address; 96 Bstr IPV6NetworkMask; 92 ComObjPtr <HostNetworkInterfaceIpConfig> ipConfig; 97 93 Bstr hardwareAddress; 98 94 HostNetworkInterfaceMediumType_T mediumType; -
trunk/src/VBox/Main/include/netif.h
r17275 r17309 59 59 RTNETADDRIPV4 IPAddress; 60 60 RTNETADDRIPV4 IPNetMask; 61 RTNETADDRIPV4 IPDefaultGateway; 61 62 RTNETADDRIPV6 IPv6Address; 62 63 RTNETADDRIPV6 IPv6NetMask;
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器