Changeset 18826 in vbox for trunk/src/VBox
- Timestamp:
- Apr 7, 2009 2:55:12 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r18774 r18826 694 694 { 695 695 Bstr strBridgeAdp; 696 nic->COMGETTER( HostInterface)(strBridgeAdp.asOutParam());696 nic->COMGETTER(BridgedInterface)(strBridgeAdp.asOutParam()); 697 697 if (details == VMINFO_MACHINEREADABLE) 698 698 { … … 721 721 { 722 722 Bstr strHostonlyAdp; 723 nic->COMGETTER(Host Interface)(strHostonlyAdp.asOutParam());723 nic->COMGETTER(HostOnlyInterface)(strHostonlyAdp.asOutParam()); 724 724 if (details == VMINFO_MACHINEREADABLE) 725 725 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r18780 r18826 130 130 std::vector <char *> nictracefile (NetworkAdapterCount, 0); 131 131 std::vector <char *> nicspeed (NetworkAdapterCount, 0); 132 std::vector <char *> hostifdev (NetworkAdapterCount, 0); 132 std::vector <char *> bridgedifdev (NetworkAdapterCount, 0); 133 std::vector <char *> hostonlyifdev (NetworkAdapterCount, 0); 133 134 std::vector <const char *> intnet (NetworkAdapterCount, 0); 134 135 std::vector <const char *> natnet (NetworkAdapterCount, 0); … … 488 489 if (a->argc <= i + 1) 489 490 return errorArgument("Missing argument to '%s'", a->argv[i]); 490 hostifdev[n - 1] = a->argv[i + 1];491 bridgedifdev[n - 1] = a->argv[i + 1]; 491 492 i++; 492 493 } … … 499 500 if (a->argc <= i + 1) 500 501 return errorArgument("Missing argument to '%s'", a->argv[i]); 501 hostifdev[n - 1] = a->argv[i + 1];502 bridgedifdev[n - 1] = a->argv[i + 1]; 502 503 i++; 503 504 } … … 511 512 if (a->argc <= i + 1) 512 513 return errorArgument("Missing argument to '%s'", a->argv[i]); 513 host ifdev[n - 1] = a->argv[i + 1];514 hostonlyifdev[n - 1] = a->argv[i + 1]; 514 515 i++; 515 516 } … … 1643 1644 1644 1645 /* the host interface device? */ 1645 if (host ifdev[n])1646 if (hostonlyifdev[n]) 1646 1647 { 1647 1648 /* remove it? */ 1648 if (!strcmp(host ifdev[n], "none"))1649 { 1650 CHECK_ERROR_RET(nic, COMSETTER(Host Interface)(NULL), 1);1649 if (!strcmp(hostonlyifdev[n], "none")) 1650 { 1651 CHECK_ERROR_RET(nic, COMSETTER(HostOnlyInterface)(NULL), 1); 1651 1652 } 1652 1653 else 1653 1654 { 1654 CHECK_ERROR_RET(nic, COMSETTER(HostInterface)(Bstr(hostifdev[n])), 1); 1655 CHECK_ERROR_RET(nic, COMSETTER(HostOnlyInterface)(Bstr(hostonlyifdev[n])), 1); 1656 } 1657 } 1658 1659 if (bridgedifdev[n]) 1660 { 1661 /* remove it? */ 1662 if (!strcmp(bridgedifdev[n], "none")) 1663 { 1664 CHECK_ERROR_RET(nic, COMSETTER(BridgedInterface)(NULL), 1); 1665 } 1666 else 1667 { 1668 CHECK_ERROR_RET(nic, COMSETTER(BridgedInterface)(Bstr(bridgedifdev[n])), 1); 1655 1669 } 1656 1670 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r18745 r18826 1898 1898 if (type == KNetworkAttachmentType_Bridged) 1899 1899 attType = attType.arg (tr ("Bridged network, %1", 1900 "details report (network)").arg (adapter.Get HostInterface()));1900 "details report (network)").arg (adapter.GetBridgedInterface())); 1901 1901 else if (type == KNetworkAttachmentType_Internal) 1902 1902 attType = attType.arg (tr ("Internal network, '%1'", … … 1904 1904 else if (type == KNetworkAttachmentType_HostOnly) 1905 1905 attType = attType.arg (tr ("Host-only network, '%1'", 1906 "details report (network)").arg (adapter.GetHost Interface()));1906 "details report (network)").arg (adapter.GetHostOnlyInterface())); 1907 1907 else 1908 1908 attType = attType.arg (vboxGlobal().toString (type)); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetworkDetails.cpp
r18733 r18826 76 76 if (!intName.isEmpty()) 77 77 setProperty ("INT_Name", QVariant (intName)); 78 QString ifsName (mAdapter.GetHostInterface()); 79 CHostNetworkInterface ifs = 80 vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (ifsName); 81 if (!ifs.isNull() && ifs.GetInterfaceType() == KHostNetworkInterfaceType_Bridged) 82 setProperty ("BRG_Name", QVariant (ifsName)); 83 else if (!ifs.isNull() && ifs.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly) 84 setProperty ("HOI_Name", QVariant (ifsName)); 78 QString bridgedIfName (mAdapter.GetBridgedInterface()); 79 CHostNetworkInterface bridgedIf = 80 vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (bridgedIfName); 81 if (!bridgedIf.isNull() && bridgedIf.GetInterfaceType() == KHostNetworkInterfaceType_Bridged) 82 setProperty ("BRG_Name", QVariant (bridgedIfName)); 83 84 QString hostonlyIfName (mAdapter.GetHostOnlyInterface()); 85 CHostNetworkInterface hostonlyIf = 86 vboxGlobal().virtualBox().GetHost().FindHostNetworkInterfaceByName (hostonlyIfName); 87 if (!hostonlyIf.isNull() && hostonlyIf.GetInterfaceType() == KHostNetworkInterfaceType_HostOnly) 88 setProperty ("HOI_Name", QVariant (hostonlyIfName)); 85 89 86 90 /* Load common settings */ … … 96 100 { 97 101 case KNetworkAttachmentType_Bridged: 98 mAdapter.Set HostInterface (name);102 mAdapter.SetBridgedInterface (name); 99 103 break; 100 104 case KNetworkAttachmentType_Internal: … … 102 106 break; 103 107 case KNetworkAttachmentType_HostOnly: 104 mAdapter.SetHost Interface (name);108 mAdapter.SetHostOnlyInterface (name); 105 109 break; 106 110 default: -
trunk/src/VBox/Main/ApplianceImpl.cpp
r18817 r18826 2036 2036 if (FAILED(rc)) throw rc; 2037 2037 /* Set the interface name to attach to */ 2038 pNetworkAdapter->COMSETTER( HostInterface)(name);2038 pNetworkAdapter->COMSETTER(BridgedInterface)(name); 2039 2039 if (FAILED(rc)) throw rc; 2040 2040 break; … … 2067 2067 if (FAILED(rc)) throw rc; 2068 2068 /* Set the interface name to attach to */ 2069 pNetworkAdapter->COMSETTER(Host Interface)(name);2069 pNetworkAdapter->COMSETTER(HostOnlyInterface)(name); 2070 2070 if (FAILED(rc)) throw rc; 2071 2071 break; -
trunk/src/VBox/Main/ConsoleImpl.cpp
r18758 r18826 4335 4335 /* a valid host interface must have been set */ 4336 4336 Bstr hostif; 4337 adapter->COMGETTER( HostInterface)(hostif.asOutParam());4337 adapter->COMGETTER(BridgedInterface)(hostif.asOutParam()); 4338 4338 if (!hostif) 4339 4339 { … … 5735 5735 /* The name of the TAP interface we are using */ 5736 5736 Bstr tapDeviceName; 5737 rc = networkAdapter->COMGETTER( HostInterface)(tapDeviceName.asOutParam());5737 rc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam()); 5738 5738 if (FAILED(rc)) 5739 5739 tapDeviceName.setNull(); /* Is this necessary? */ … … 5856 5856 Bstr tapDeviceName, tapTerminateApplication; 5857 5857 bool isStatic = true; 5858 rc = networkAdapter->COMGETTER( HostInterface)(tapDeviceName.asOutParam());5858 rc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam()); 5859 5859 if (FAILED(rc) || tapDeviceName.isEmpty()) 5860 5860 { -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r18710 r18826 1238 1238 } 1239 1239 #ifdef VMWARE_NET_IN_SLOT_11 1240 /* 1240 /* 1241 1241 * Dirty hack for PCI slot compatibility with VMWare, 1242 1242 * it assigns slot 11 to the first network controller. … … 1446 1446 1447 1447 Bstr HifName; 1448 hrc = networkAdapter->COMGETTER( HostInterface)(HifName.asOutParam());1448 hrc = networkAdapter->COMGETTER(BridgedInterface)(HifName.asOutParam()); 1449 1449 if(FAILED(hrc)) 1450 1450 { … … 1808 1808 # else 1809 1809 Bstr HifName; 1810 hrc = networkAdapter->COMGETTER(Host Interface)(HifName.asOutParam());1810 hrc = networkAdapter->COMGETTER(HostOnlyInterface)(HifName.asOutParam()); 1811 1811 if(FAILED(hrc)) 1812 1812 { … … 1958 1958 #if !defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT) 1959 1959 Bstr HifName; 1960 hrc = networkAdapter->COMGETTER(Host Interface)(HifName.asOutParam());1960 hrc = networkAdapter->COMGETTER(HostOnlyInterface)(HifName.asOutParam()); 1961 1961 if(FAILED(hrc)) 1962 1962 { -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r18591 r18826 396 396 } 397 397 398 STDMETHODIMP NetworkAdapter::COMGETTER(Host Interface)(BSTR *aHostInterface)398 STDMETHODIMP NetworkAdapter::COMGETTER(HostOnlyInterface)(BSTR *aHostInterface) 399 399 { 400 400 CheckComArgOutPointerValid(aHostInterface); … … 405 405 AutoReadLock alock (this); 406 406 407 mData->mHost Interface.cloneTo (aHostInterface);408 409 return S_OK; 410 } 411 412 STDMETHODIMP NetworkAdapter::COMSETTER(Host Interface)(IN_BSTR aHostInterface)407 mData->mHostOnlyInterface.cloneTo (aHostInterface); 408 409 return S_OK; 410 } 411 412 STDMETHODIMP NetworkAdapter::COMSETTER(HostOnlyInterface)(IN_BSTR aHostInterface) 413 413 { 414 414 /** @todo Validate input string length. r=dmik: do it in XML schema?*/ … … 427 427 AutoWriteLock alock (this); 428 428 429 if (mData->mHostInterface != aHostInterface) 430 { 431 mData.backup(); 432 mData->mHostInterface = aHostInterface; 429 if (mData->mHostOnlyInterface != aHostInterface) 430 { 431 mData.backup(); 432 mData->mHostOnlyInterface = aHostInterface; 433 434 /* leave the lock before informing callbacks */ 435 alock.unlock(); 436 437 mParent->onNetworkAdapterChange (this); 438 } 439 440 return S_OK; 441 } 442 443 STDMETHODIMP NetworkAdapter::COMGETTER(BridgedInterface)(BSTR *aHostInterface) 444 { 445 CheckComArgOutPointerValid(aHostInterface); 446 447 AutoCaller autoCaller (this); 448 CheckComRCReturnRC (autoCaller.rc()); 449 450 AutoReadLock alock (this); 451 452 mData->mBridgedInterface.cloneTo (aHostInterface); 453 454 return S_OK; 455 } 456 457 STDMETHODIMP NetworkAdapter::COMSETTER(BridgedInterface)(IN_BSTR aHostInterface) 458 { 459 /** @todo Validate input string length. r=dmik: do it in XML schema?*/ 460 461 /* we don't allow null strings for the host interface (because the @name 462 * attribute of <HostInterface> must be always present but can be empty). */ 463 CheckComArgNotNull (aHostInterface); 464 465 AutoCaller autoCaller (this); 466 CheckComRCReturnRC (autoCaller.rc()); 467 468 /* the machine needs to be mutable */ 469 Machine::AutoMutableStateDependency adep (mParent); 470 CheckComRCReturnRC (adep.rc()); 471 472 AutoWriteLock alock (this); 473 474 if (mData->mBridgedInterface != aHostInterface) 475 { 476 mData.backup(); 477 mData->mBridgedInterface = aHostInterface; 433 478 434 479 /* leave the lock before informing callbacks */ … … 926 971 ComAssertRet (!name.isNull(), E_FAIL); 927 972 928 rc = COMSETTER( HostInterface) (name);973 rc = COMSETTER(BridgedInterface) (name); 929 974 CheckComRCReturnRC (rc); 930 975 … … 952 997 ComAssertRet (!name.isNull(), E_FAIL); 953 998 954 rc = COMSETTER(Host Interface) (name);999 rc = COMSETTER(HostOnlyInterface) (name); 955 1000 CheckComRCReturnRC (rc); 956 1001 #endif … … 1044 1089 { 1045 1090 Key attachmentNode = aAdapterNode.createKey ("BridgedInterface"); 1046 Assert (!mData->m HostInterface.isNull());1047 attachmentNode.setValue <Bstr> ("name", mData->m HostInterface);1091 Assert (!mData->mBridgedInterface.isNull()); 1092 attachmentNode.setValue <Bstr> ("name", mData->mBridgedInterface); 1048 1093 break; 1049 1094 } … … 1059 1104 Key attachmentNode = aAdapterNode.createKey ("HostOnlyInterface"); 1060 1105 #if defined(VBOX_WITH_NETFLT) 1061 Assert (!mData->mHost Interface.isNull());1062 attachmentNode.setValue <Bstr> ("name", mData->mHost Interface);1106 Assert (!mData->mHostOnlyInterface.isNull()); 1107 attachmentNode.setValue <Bstr> ("name", mData->mHostOnlyInterface); 1063 1108 #endif 1064 1109 break; … … 1211 1256 { 1212 1257 /* reset handle and device name */ 1213 mData->m HostInterface = "";1258 mData->mBridgedInterface = ""; 1214 1259 break; 1215 1260 } … … 1223 1268 #if defined(VBOX_WITH_NETFLT) 1224 1269 /* reset handle and device name */ 1225 mData->mHost Interface = "";1270 mData->mHostOnlyInterface = ""; 1226 1271 #endif 1227 1272 break; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r18804 r18826 10933 10933 <interface 10934 10934 name="INetworkAdapter" extends="$unknown" 10935 uuid=" 65607a27-2b73-4d43-b4cc-0ba2c817fbde"10935 uuid="50F03B9E-FF02-4e07-9DA8-86FBF884D62E" 10936 10936 wsmap="managed" 10937 10937 > … … 10982 10982 <attribute name="attachmentType" type="NetworkAttachmentType" readonly="yes"/> 10983 10983 10984 <attribute name="hostInterface" type="wstring"> 10985 <desc> 10986 Name of the host network interface the VM is attached to. 10987 </desc> 10988 </attribute> 10989 10984 <attribute name="bridgedInterface" type="wstring"> 10985 <desc> 10986 Name of the bridged network interface the VM is attached to. 10987 </desc> 10988 </attribute> 10989 10990 <attribute name="hostOnlyInterface" type="wstring"> 10991 <desc> 10992 Name of the host only network interface the VM is attached to. 10993 </desc> 10994 </attribute> 10995 10990 10996 <attribute name="internalNetwork" type="wstring"> 10991 10997 <desc> -
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r17684 r18826 44 44 , mAttachmentType (NetworkAttachmentType_Null) 45 45 , mCableConnected (TRUE), mLineSpeed (0), mTraceEnabled (FALSE) 46 , mHostInterface ("") /* cannot be null */ 46 , mHostOnlyInterface ("") /* cannot be null */ 47 , mBridgedInterface ("") /* cannot be null */ 47 48 {} 48 49 … … 57 58 mLineSpeed == that.mLineSpeed && 58 59 mTraceEnabled == that.mTraceEnabled && 59 mHostInterface == that.mHostInterface && 60 mHostOnlyInterface == that.mHostOnlyInterface && 61 mBridgedInterface == that.mBridgedInterface && 60 62 mInternalNetwork == that.mInternalNetwork && 61 63 mNATNetwork == that.mNATNetwork); … … 71 73 BOOL mTraceEnabled; 72 74 Bstr mTraceFile; 73 Bstr mHostInterface; 75 Bstr mHostOnlyInterface; 76 Bstr mBridgedInterface; 74 77 Bstr mInternalNetwork; 75 78 Bstr mNATNetwork; … … 109 112 STDMETHOD(COMSETTER(MACAddress)) (IN_BSTR aMACAddress); 110 113 STDMETHOD(COMGETTER(AttachmentType)) (NetworkAttachmentType_T *aAttachmentType); 111 STDMETHOD(COMGETTER(HostInterface)) (BSTR *aHostInterface); 112 STDMETHOD(COMSETTER(HostInterface)) (IN_BSTR aHostInterface); 114 STDMETHOD(COMGETTER(HostOnlyInterface)) (BSTR *aHostInterface); 115 STDMETHOD(COMSETTER(HostOnlyInterface)) (IN_BSTR aHostInterface); 116 STDMETHOD(COMGETTER(BridgedInterface)) (BSTR *aHostInterface); 117 STDMETHOD(COMSETTER(BridgedInterface)) (IN_BSTR aHostInterface); 113 118 STDMETHOD(COMGETTER(InternalNetwork)) (BSTR *aInternalNetwork); 114 119 STDMETHOD(COMSETTER(InternalNetwork)) (IN_BSTR aInternalNetwork);
Note:
See TracChangeset
for help on using the changeset viewer.