Changeset 18829 in vbox for trunk/src/VBox
- Timestamp:
- Apr 7, 2009 3:42:32 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r18826 r18829 694 694 { 695 695 Bstr strBridgeAdp; 696 nic->COMGETTER( BridgedInterface)(strBridgeAdp.asOutParam());696 nic->COMGETTER(HostInterface)(strBridgeAdp.asOutParam()); 697 697 if (details == VMINFO_MACHINEREADABLE) 698 698 { … … 721 721 { 722 722 Bstr strHostonlyAdp; 723 nic->COMGETTER(Host OnlyInterface)(strHostonlyAdp.asOutParam());723 nic->COMGETTER(HostInterface)(strHostonlyAdp.asOutParam()); 724 724 if (details == VMINFO_MACHINEREADABLE) 725 725 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r18826 r18829 130 130 std::vector <char *> nictracefile (NetworkAdapterCount, 0); 131 131 std::vector <char *> nicspeed (NetworkAdapterCount, 0); 132 std::vector <char *> bridgedifdev (NetworkAdapterCount, 0); 133 std::vector <char *> hostonlyifdev (NetworkAdapterCount, 0); 132 std::vector <char *> hostifdev (NetworkAdapterCount, 0); 134 133 std::vector <const char *> intnet (NetworkAdapterCount, 0); 135 134 std::vector <const char *> natnet (NetworkAdapterCount, 0); … … 489 488 if (a->argc <= i + 1) 490 489 return errorArgument("Missing argument to '%s'", a->argv[i]); 491 bridgedifdev[n - 1] = a->argv[i + 1];490 hostifdev[n - 1] = a->argv[i + 1]; 492 491 i++; 493 492 } … … 500 499 if (a->argc <= i + 1) 501 500 return errorArgument("Missing argument to '%s'", a->argv[i]); 502 bridgedifdev[n - 1] = a->argv[i + 1];501 hostifdev[n - 1] = a->argv[i + 1]; 503 502 i++; 504 503 } … … 512 511 if (a->argc <= i + 1) 513 512 return errorArgument("Missing argument to '%s'", a->argv[i]); 514 host onlyifdev[n - 1] = a->argv[i + 1];513 hostifdev[n - 1] = a->argv[i + 1]; 515 514 i++; 516 515 } … … 1644 1643 1645 1644 /* the host interface device? */ 1646 if (host onlyifdev[n])1645 if (hostifdev[n]) 1647 1646 { 1648 1647 /* remove it? */ 1649 if (!strcmp(host onlyifdev[n], "none"))1650 { 1651 CHECK_ERROR_RET(nic, COMSETTER(Host OnlyInterface)(NULL), 1);1648 if (!strcmp(hostifdev[n], "none")) 1649 { 1650 CHECK_ERROR_RET(nic, COMSETTER(HostInterface)(NULL), 1); 1652 1651 } 1653 1652 else 1654 1653 { 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); 1654 CHECK_ERROR_RET(nic, COMSETTER(HostInterface)(Bstr(hostifdev[n])), 1); 1669 1655 } 1670 1656 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r18826 r18829 1898 1898 if (type == KNetworkAttachmentType_Bridged) 1899 1899 attType = attType.arg (tr ("Bridged network, %1", 1900 "details report (network)").arg (adapter.Get BridgedInterface()));1900 "details report (network)").arg (adapter.GetHostInterface())); 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 OnlyInterface()));1906 "details report (network)").arg (adapter.GetHostInterface())); 1907 1907 else 1908 1908 attType = attType.arg (vboxGlobal().toString (type)); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetworkDetails.cpp
r18826 r18829 76 76 if (!intName.isEmpty()) 77 77 setProperty ("INT_Name", QVariant (intName)); 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)); 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)); 89 85 90 86 /* Load common settings */ … … 100 96 { 101 97 case KNetworkAttachmentType_Bridged: 102 mAdapter.Set BridgedInterface (name);98 mAdapter.SetHostInterface (name); 103 99 break; 104 100 case KNetworkAttachmentType_Internal: … … 106 102 break; 107 103 case KNetworkAttachmentType_HostOnly: 108 mAdapter.SetHost OnlyInterface (name);104 mAdapter.SetHostInterface (name); 109 105 break; 110 106 default: -
trunk/src/VBox/Main/ApplianceImpl.cpp
r18826 r18829 2036 2036 if (FAILED(rc)) throw rc; 2037 2037 /* Set the interface name to attach to */ 2038 pNetworkAdapter->COMSETTER( BridgedInterface)(name);2038 pNetworkAdapter->COMSETTER(HostInterface)(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 OnlyInterface)(name);2069 pNetworkAdapter->COMSETTER(HostInterface)(name); 2070 2070 if (FAILED(rc)) throw rc; 2071 2071 break; -
trunk/src/VBox/Main/ConsoleImpl.cpp
r18826 r18829 4335 4335 /* a valid host interface must have been set */ 4336 4336 Bstr hostif; 4337 adapter->COMGETTER( BridgedInterface)(hostif.asOutParam());4337 adapter->COMGETTER(HostInterface)(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( BridgedInterface)(tapDeviceName.asOutParam());5737 rc = networkAdapter->COMGETTER(HostInterface)(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( BridgedInterface)(tapDeviceName.asOutParam());5858 rc = networkAdapter->COMGETTER(HostInterface)(tapDeviceName.asOutParam()); 5859 5859 if (FAILED(rc) || tapDeviceName.isEmpty()) 5860 5860 { -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r18826 r18829 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( BridgedInterface)(HifName.asOutParam());1448 hrc = networkAdapter->COMGETTER(HostInterface)(HifName.asOutParam()); 1449 1449 if(FAILED(hrc)) 1450 1450 { … … 1808 1808 # else 1809 1809 Bstr HifName; 1810 hrc = networkAdapter->COMGETTER(Host OnlyInterface)(HifName.asOutParam());1810 hrc = networkAdapter->COMGETTER(HostInterface)(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 OnlyInterface)(HifName.asOutParam());1960 hrc = networkAdapter->COMGETTER(HostInterface)(HifName.asOutParam()); 1961 1961 if(FAILED(hrc)) 1962 1962 { -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r18826 r18829 396 396 } 397 397 398 STDMETHODIMP NetworkAdapter::COMGETTER(Host OnlyInterface)(BSTR *aHostInterface)398 STDMETHODIMP NetworkAdapter::COMGETTER(HostInterface)(BSTR *aHostInterface) 399 399 { 400 400 CheckComArgOutPointerValid(aHostInterface); … … 405 405 AutoReadLock alock (this); 406 406 407 mData->mHost OnlyInterface.cloneTo (aHostInterface);408 409 return S_OK; 410 } 411 412 STDMETHODIMP NetworkAdapter::COMSETTER(Host OnlyInterface)(IN_BSTR aHostInterface)407 mData->mHostInterface.cloneTo (aHostInterface); 408 409 return S_OK; 410 } 411 412 STDMETHODIMP NetworkAdapter::COMSETTER(HostInterface)(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->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; 429 if (mData->mHostInterface != aHostInterface) 430 { 431 mData.backup(); 432 mData->mHostInterface = aHostInterface; 478 433 479 434 /* leave the lock before informing callbacks */ … … 971 926 ComAssertRet (!name.isNull(), E_FAIL); 972 927 973 rc = COMSETTER( BridgedInterface) (name);928 rc = COMSETTER(HostInterface) (name); 974 929 CheckComRCReturnRC (rc); 975 930 … … 997 952 ComAssertRet (!name.isNull(), E_FAIL); 998 953 999 rc = COMSETTER(Host OnlyInterface) (name);954 rc = COMSETTER(HostInterface) (name); 1000 955 CheckComRCReturnRC (rc); 1001 956 #endif … … 1089 1044 { 1090 1045 Key attachmentNode = aAdapterNode.createKey ("BridgedInterface"); 1091 Assert (!mData->m BridgedInterface.isNull());1092 attachmentNode.setValue <Bstr> ("name", mData->m BridgedInterface);1046 Assert (!mData->mHostInterface.isNull()); 1047 attachmentNode.setValue <Bstr> ("name", mData->mHostInterface); 1093 1048 break; 1094 1049 } … … 1104 1059 Key attachmentNode = aAdapterNode.createKey ("HostOnlyInterface"); 1105 1060 #if defined(VBOX_WITH_NETFLT) 1106 Assert (!mData->mHost OnlyInterface.isNull());1107 attachmentNode.setValue <Bstr> ("name", mData->mHost OnlyInterface);1061 Assert (!mData->mHostInterface.isNull()); 1062 attachmentNode.setValue <Bstr> ("name", mData->mHostInterface); 1108 1063 #endif 1109 1064 break; … … 1256 1211 { 1257 1212 /* reset handle and device name */ 1258 mData->m BridgedInterface = "";1213 mData->mHostInterface = ""; 1259 1214 break; 1260 1215 } … … 1268 1223 #if defined(VBOX_WITH_NETFLT) 1269 1224 /* reset handle and device name */ 1270 mData->mHost OnlyInterface = "";1225 mData->mHostInterface = ""; 1271 1226 #endif 1272 1227 break; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r18826 r18829 10933 10933 <interface 10934 10934 name="INetworkAdapter" extends="$unknown" 10935 uuid=" 50F03B9E-FF02-4e07-9DA8-86FBF884D62E"10935 uuid="65607a27-2b73-4d43-b4cc-0ba2c817fbde" 10936 10936 wsmap="managed" 10937 10937 > … … 10982 10982 <attribute name="attachmentType" type="NetworkAttachmentType" readonly="yes"/> 10983 10983 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 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 10996 10990 <attribute name="internalNetwork" type="wstring"> 10997 10991 <desc> -
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r18826 r18829 44 44 , mAttachmentType (NetworkAttachmentType_Null) 45 45 , mCableConnected (TRUE), mLineSpeed (0), mTraceEnabled (FALSE) 46 , mHostOnlyInterface ("") /* cannot be null */ 47 , mBridgedInterface ("") /* cannot be null */ 46 , mHostInterface ("") /* cannot be null */ 48 47 {} 49 48 … … 58 57 mLineSpeed == that.mLineSpeed && 59 58 mTraceEnabled == that.mTraceEnabled && 60 mHostOnlyInterface == that.mHostOnlyInterface && 61 mBridgedInterface == that.mBridgedInterface && 59 mHostInterface == that.mHostInterface && 62 60 mInternalNetwork == that.mInternalNetwork && 63 61 mNATNetwork == that.mNATNetwork); … … 73 71 BOOL mTraceEnabled; 74 72 Bstr mTraceFile; 75 Bstr mHostOnlyInterface; 76 Bstr mBridgedInterface; 73 Bstr mHostInterface; 77 74 Bstr mInternalNetwork; 78 75 Bstr mNATNetwork; … … 112 109 STDMETHOD(COMSETTER(MACAddress)) (IN_BSTR aMACAddress); 113 110 STDMETHOD(COMGETTER(AttachmentType)) (NetworkAttachmentType_T *aAttachmentType); 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); 111 STDMETHOD(COMGETTER(HostInterface)) (BSTR *aHostInterface); 112 STDMETHOD(COMSETTER(HostInterface)) (IN_BSTR aHostInterface); 118 113 STDMETHOD(COMGETTER(InternalNetwork)) (BSTR *aInternalNetwork); 119 114 STDMETHOD(COMSETTER(InternalNetwork)) (IN_BSTR aInternalNetwork);
Note:
See TracChangeset
for help on using the changeset viewer.