Changeset 17333 in vbox
- Timestamp:
- Mar 4, 2009 9:14:29 AM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r17322 r17333 327 327 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); 328 328 RTPrintf("GUID: %lS\n", Bstr(interfaceGuid.toString()).raw()); 329 ComPtr<IHostNetworkInterfaceIpConfig> ipConfig;330 networkInterface->COMGETTER(IpConfig)(ipConfig.asOutParam());331 329 ULONG IPAddress; 332 ipConfig->COMGETTER(IPAddress)(&IPAddress);330 networkInterface->COMGETTER(IPAddress)(&IPAddress); 333 331 RTPrintf("IPAddress: %d.%d.%d.%d\n", 334 332 ((uint8_t*)&IPAddress)[0], … … 337 335 ((uint8_t*)&IPAddress)[3]); 338 336 ULONG NetworkMask; 339 ipConfig->COMGETTER(NetworkMask)(&NetworkMask);337 networkInterface->COMGETTER(NetworkMask)(&NetworkMask); 340 338 RTPrintf("NetworkMask: %d.%d.%d.%d\n", 341 339 ((uint8_t*)&NetworkMask)[0], … … 344 342 ((uint8_t*)&NetworkMask)[3]); 345 343 Bstr IPV6Address; 346 ipConfig->COMGETTER(IPV6Address)(IPV6Address.asOutParam());344 networkInterface->COMGETTER(IPV6Address)(IPV6Address.asOutParam()); 347 345 RTPrintf("IPV6Address: %lS\n", IPV6Address.raw()); 348 346 Bstr IPV6NetworkMask; 349 ipConfig->COMGETTER(IPV6NetworkMask)(IPV6NetworkMask.asOutParam());347 networkInterface->COMGETTER(IPV6NetworkMask)(IPV6NetworkMask.asOutParam()); 350 348 RTPrintf("IPV6NetworkMask: %lS\n", IPV6NetworkMask.raw()); 351 349 Bstr HardwareAddress; -
trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
r17309 r17333 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();86 74 } 87 75 … … 141 129 mIfType = ifType; 142 130 143 m.ipConfig.createObject(); 144 145 HRESULT hr = m.ipConfig->init (pIf); 146 if(FAILED(hr)) 147 return hr; 148 131 m.IPAddress = pIf->IPAddress.u; 132 m.networkMask = pIf->IPNetMask.u; 133 m.defaultGateway = pIf->IPDefaultGateway.u; 134 m.IPV6Address = composeIPv6Address(&pIf->IPv6Address); 135 m.IPV6NetworkMask = composeIPv6Address(&pIf->IPv6NetMask); 149 136 m.hardwareAddress = composeHardwareAddress(&pIf->MACAddress); 150 137 #ifdef RT_OS_WINDOWS … … 202 189 } 203 190 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); 191 192 /** 193 * Returns the IP address of the host network interface. 194 * 195 * @returns COM status code 196 * @param aIPAddress address of result pointer 197 */ 198 STDMETHODIMP HostNetworkInterface::COMGETTER(IPAddress) (ULONG *aIPAddress) 199 { 200 CheckComArgOutPointerValid(aIPAddress); 201 202 AutoCaller autoCaller (this); 203 CheckComRCReturnRC (autoCaller.rc()); 204 205 *aIPAddress = m.IPAddress; 206 207 return S_OK; 208 } 209 210 /** 211 * Returns the netwok mask of the host network interface. 212 * 213 * @returns COM status code 214 * @param aNetworkMask address of result pointer 215 */ 216 STDMETHODIMP HostNetworkInterface::COMGETTER(NetworkMask) (ULONG *aNetworkMask) 217 { 218 CheckComArgOutPointerValid(aNetworkMask); 219 220 AutoCaller autoCaller (this); 221 CheckComRCReturnRC (autoCaller.rc()); 222 223 *aNetworkMask = m.networkMask; 224 225 return S_OK; 226 } 227 228 /** 229 * Returns the default gateway of the host network interface. 230 * 231 * @returns COM status code 232 * @param aNetworkMask address of result pointer 233 */ 234 STDMETHODIMP HostNetworkInterface::COMGETTER(DefaultGateway) (ULONG *aDefaultGateway) 235 { 236 CheckComArgOutPointerValid(aDefaultGateway); 237 238 AutoCaller autoCaller (this); 239 CheckComRCReturnRC (autoCaller.rc()); 240 241 *aDefaultGateway = m.defaultGateway; 242 243 return S_OK; 244 } 245 246 /** 247 * Returns the IP V6 address of the host network interface. 248 * 249 * @returns COM status code 250 * @param aIPV6Address address of result pointer 251 */ 252 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6Address) (BSTR *aIPV6Address) 253 { 254 CheckComArgOutPointerValid(aIPV6Address); 255 256 AutoCaller autoCaller (this); 257 CheckComRCReturnRC (autoCaller.rc()); 258 259 m.IPV6Address.cloneTo (aIPV6Address); 260 261 return S_OK; 262 } 263 264 /** 265 * Returns the IP V6 network mask of the host network interface. 266 * 267 * @returns COM status code 268 * @param aIPV6Mask address of result pointer 269 */ 270 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6NetworkMask) (BSTR *aIPV6Mask) 271 { 272 CheckComArgOutPointerValid(aIPV6Mask); 273 274 AutoCaller autoCaller (this); 275 CheckComRCReturnRC (autoCaller.rc()); 276 277 m.IPV6NetworkMask.cloneTo (aIPV6Mask); 213 278 214 279 return S_OK; … … 288 353 } 289 354 355 STDMETHODIMP HostNetworkInterface::EnableStaticIpConfig (ULONG aIPAddress, ULONG aNetworkMask, ULONG aDefaultGateway) 356 { 357 return E_NOTIMPL; 358 } 359 360 STDMETHODIMP HostNetworkInterface::EnableStaticIpConfigV6 (BSTR aIPV6Address, BSTR aIPV6Mask) 361 { 362 return E_NOTIMPL; 363 } 364 365 STDMETHODIMP HostNetworkInterface::EnableDynamicIpConfig () 366 { 367 return E_NOTIMPL; 368 } 369 290 370 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/Makefile.kmk
r17309 r17333 281 281 HostFloppyDriveImpl.cpp \ 282 282 HostNetworkInterfaceImpl.cpp \ 283 HostNetworkInterfaceIpConfigImpl.cpp \284 283 GuestOSTypeImpl.cpp \ 285 284 NetworkAdapterImpl.cpp \ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r17314 r17333 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 network6456 mask are strings of 32 hexdecimal digits grouped by four. Groups are6457 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 <interface6483 6450 name="IHostNetworkInterface" extends="$unknown" 6484 uuid=" 3fd5d8d9-c503-4c1a-b88c-e78fb78f8559"6451 uuid="b4467af7-9b16-479a-a812-c132cbd886a3" 6485 6452 wsmap="managed" 6486 6453 > … … 6499 6466 </attribute> 6500 6467 6501 <attribute name="ipConfig" type="IHostNetworkInterfaceIpConfig" readonly="yes"> 6502 <desc>Returns the adapter ip config information </desc> 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="defaultGateway" type="unsigned long" readonly="yes"> 6477 <desc>Returns the network mask of the interface.</desc> 6478 </attribute> 6479 6480 <attribute name="IPV6Address" type="wstring" readonly="yes"> 6481 <desc>Returns the IP V6 address of the interface.</desc> 6482 </attribute> 6483 6484 <attribute name="IPV6NetworkMask" type="wstring" readonly="yes"> 6485 <desc>Returns the IP V6 network mask of the interface.</desc> 6503 6486 </attribute> 6504 6487 … … 6518 6501 <desc>specifies the host interface type.</desc> 6519 6502 </attribute> 6503 6504 <method name="enableStaticIpConfig"> 6505 <desc>sets and enables the static IP V4 configuration for the given interface.</desc> 6506 <param name="IPAddress" type="unsigned long" dir="in"> 6507 <desc> 6508 IP address. 6509 </desc> 6510 </param> 6511 <param name="networkMask" type="unsigned long" dir="in"> 6512 <desc> 6513 network mask. 6514 </desc> 6515 </param> 6516 <param name="defaultGateway" type="unsigned long" dir="in"> 6517 <desc> 6518 default gateway. 6519 </desc> 6520 </param> 6521 </method> 6522 6523 <method name="enableStaticIpConfigV6"> 6524 <desc>sets and enables the static IP V6 configuration for the given interface.</desc> 6525 <param name="IPV6Address" type="wstring" dir="in"> 6526 <desc> 6527 IP address. 6528 </desc> 6529 </param> 6530 <param name="IPV6NetworkMask" type="wstring" dir="in"> 6531 <desc> 6532 network mask. 6533 </desc> 6534 </param> 6535 </method> 6536 6537 <method name="enableDynamicIpConfig"> 6538 <desc>enables the dynamic IP configuration.</desc> 6539 </method> 6540 6520 6541 </interface> 6521 6542 -
trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h
r17309 r17333 27 27 #include "VirtualBoxBase.h" 28 28 #include "Collection.h" 29 #include "HostNetworkInterfaceIpConfigImpl.h"30 31 29 #ifdef VBOX_WITH_HOSTNETIF_API 32 30 /* class HostNetworkInterface; */ … … 66 64 HRESULT init (Bstr aInterfaceName, HostNetworkInterfaceType_T ifType, struct NETIFINFO *pIfs); 67 65 #endif 68 void uninit();69 66 70 67 // IHostNetworkInterface properties 71 68 STDMETHOD(COMGETTER(Name)) (BSTR *aInterfaceName); 72 69 STDMETHOD(COMGETTER(Id)) (OUT_GUID aGuid); 73 STDMETHOD(COMGETTER(IpConfig)) (IHostNetworkInterfaceIpConfig **aIpConfig); 70 STDMETHOD(COMGETTER(IPAddress)) (ULONG *aIPAddress); 71 STDMETHOD(COMGETTER(NetworkMask)) (ULONG *aNetworkMask); 72 STDMETHOD(COMGETTER(DefaultGateway)) (ULONG *aDefaultGateway); 73 STDMETHOD(COMGETTER(IPV6Address)) (BSTR *aIPV6Address); 74 STDMETHOD(COMGETTER(IPV6NetworkMask)) (BSTR *aIPV6Mask); 74 75 STDMETHOD(COMGETTER(HardwareAddress)) (BSTR *aHardwareAddress); 75 76 STDMETHOD(COMGETTER(MediumType)) (HostNetworkInterfaceMediumType_T *aType); 76 77 STDMETHOD(COMGETTER(Status)) (HostNetworkInterfaceStatus_T *aStatus); 77 78 STDMETHOD(COMGETTER(InterfaceType)) (HostNetworkInterfaceType_T *aType); 79 80 STDMETHOD(EnableStaticIpConfig) (ULONG aIPAddress, ULONG aNetworkMask, ULONG aDefaultGateway); 81 STDMETHOD(EnableStaticIpConfigV6) (BSTR aIPV6Address, BSTR aIPV6Mask); 82 STDMETHOD(EnableDynamicIpConfig) (); 78 83 79 84 // for VirtualBoxSupportErrorInfoImpl … … 87 92 struct Data 88 93 { 89 Data() : mediumType (HostNetworkInterfaceMediumType_Unknown), 94 Data() : IPAddress (0), networkMask (0), defaultGateway(0), 95 mediumType (HostNetworkInterfaceMediumType_Unknown), 90 96 status(HostNetworkInterfaceStatus_Down){} 91 97 92 ComObjPtr <HostNetworkInterfaceIpConfig> ipConfig; 98 ULONG IPAddress; 99 ULONG networkMask; 100 ULONG defaultGateway; 101 Bstr IPV6Address; 102 Bstr IPV6NetworkMask; 93 103 Bstr hardwareAddress; 94 104 HostNetworkInterfaceMediumType_T mediumType; -
trunk/src/VBox/Main/xpcom/server.cpp
r17310 r17333 195 195 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostNetworkInterface, IHostNetworkInterface) 196 196 197 NS_DECL_CLASSINFO(HostNetworkInterfaceIpConfig)198 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostNetworkInterfaceIpConfig, IHostNetworkInterfaceIpConfig)199 200 197 NS_DECL_CLASSINFO(GuestOSType) 201 198 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(GuestOSType, IGuestOSType)
Note:
See TracChangeset
for help on using the changeset viewer.