Changeset 40652 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Mar 26, 2012 4:36:16 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r40633 r40652 1020 1020 InsertConfigNode(pAc, "File", &pAcFile); 1021 1021 InsertConfigNode(pAcFile, "BwGroups", &pAcFileBwGroups); 1022 #ifdef VBOX_WITH_NETSHAPER 1023 PCFGMNODE pNetworkShaper; 1024 PCFGMNODE pNetworkBwGroups; 1025 1026 InsertConfigNode(pPDM, "NetworkShaper", &pNetworkShaper); 1027 InsertConfigNode(pNetworkShaper, "BwGroups", &pNetworkBwGroups); 1028 #endif /* VBOX_WITH_NETSHAPER */ 1022 1029 1023 1030 for (size_t i = 0; i < bwGroups.size(); i++) … … 1039 1046 InsertConfigInteger(pBwGroup, "Step", 0); 1040 1047 } 1048 #ifdef VBOX_WITH_NETSHAPER 1049 else if (enmType == BandwidthGroupType_Network) 1050 { 1051 /* Network bandwidth groups. */ 1052 PCFGMNODE pBwGroup; 1053 InsertConfigNode(pNetworkBwGroups, Utf8Str(strName).c_str(), &pBwGroup); 1054 InsertConfigInteger(pBwGroup, "Max", cMaxMbPerSec * 1000); // @todo: _1M); 1055 } 1056 #endif /* VBOX_WITH_NETSHAPER */ 1041 1057 } 1042 1058 … … 3678 3694 } 3679 3695 3680 Utf8Str strNetDriver; 3681 if (fAttachDetach && fSniffer) 3682 { 3683 const char *pszNetDriver = "IntNet"; 3684 if (meAttachmentType[uInstance] == NetworkAttachmentType_NAT) 3685 pszNetDriver = "NAT"; 3686 #if !defined(VBOX_WITH_NETFLT) && defined(RT_OS_LINUX) 3687 if (meAttachmentType[uInstance] == NetworkAttachmentType_Bridged) 3688 pszNetDriver = "HostInterface"; 3689 #endif 3690 if (meAttachmentType[uInstance] == NetworkAttachmentType_Generic) 3691 { 3692 hrc = aNetworkAdapter->COMGETTER(GenericDriver)(bstr.asOutParam()); H(); 3693 strNetDriver = bstr; 3694 pszNetDriver = strNetDriver.c_str(); 3695 } 3696 3697 rc = PDMR3DriverDetach(pVM, pszDevice, uInstance, uLun, pszNetDriver, 0, 0 /*fFlags*/); 3698 if (rc == VINF_PDM_NO_DRIVER_ATTACHED_TO_LUN) 3699 rc = VINF_SUCCESS; 3700 AssertLogRelRCReturn(rc, rc); 3701 3702 pLunL0 = CFGMR3GetChildF(pInst, "LUN#%u", uLun); 3703 PCFGMNODE pLunAD = CFGMR3GetChildF(pLunL0, "AttachedDriver"); 3704 if (pLunAD) 3705 { 3706 CFGMR3RemoveNode(pLunAD); 3707 } 3708 else 3709 { 3710 CFGMR3RemoveNode(pLunL0); 3711 InsertConfigNode(pInst, "LUN#0", &pLunL0); 3712 InsertConfigString(pLunL0, "Driver", "NetSniffer"); 3713 InsertConfigNode(pLunL0, "Config", &pCfg); 3714 hrc = aNetworkAdapter->COMGETTER(TraceFile)(bstr.asOutParam()); H(); 3715 if (!bstr.isEmpty()) /* check convention for indicating default file. */ 3716 InsertConfigString(pCfg, "File", bstr); 3717 } 3718 } 3719 else if (fAttachDetach && !fSniffer) 3696 if (fAttachDetach) 3720 3697 { 3721 3698 rc = PDMR3DeviceDetach(pVM, pszDevice, uInstance, uLun, 0 /*fFlags*/); … … 3727 3704 CFGMR3RemoveNode(CFGMR3GetChildF(pInst, "LUN#%u", uLun)); 3728 3705 } 3729 else if (!fAttachDetach && fSniffer) 3706 3707 #ifdef VBOX_WITH_NETSHAPER 3708 ComObjPtr<IBandwidthGroup> pBwGroup; 3709 Bstr strBwGroup; 3710 PNETSHAPER pShaper = NULL; 3711 PNETSHAPERFILTER pFilter = NULL; 3712 hrc = aNetworkAdapter->COMGETTER(BandwidthGroup)(pBwGroup.asOutParam()); H(); 3713 3714 if (!pBwGroup.isNull()) 3730 3715 { 3731 /* insert the sniffer filter driver. */ 3732 InsertConfigNode(pInst, "LUN#0", &pLunL0); 3716 hrc = pBwGroup->COMGETTER(Name)(strBwGroup.asOutParam()); H(); 3717 } 3718 #endif /* VBOX_WITH_NETSHAPER */ 3719 3720 Utf8Str strNetDriver; 3721 3722 3723 InsertConfigNode(pInst, "LUN#0", &pLunL0); 3724 3725 #ifdef VBOX_WITH_NETSHAPER 3726 if (!strBwGroup.isEmpty()) 3727 { 3728 InsertConfigString(pLunL0, "Driver", "NetShaper"); 3729 InsertConfigNode(pLunL0, "Config", &pCfg); 3730 InsertConfigString(pCfg, "BwGroup", strBwGroup); 3731 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL0); 3732 } 3733 #endif /* VBOX_WITH_NETSHAPER */ 3734 3735 if (fSniffer) 3736 { 3733 3737 InsertConfigString(pLunL0, "Driver", "NetSniffer"); 3734 3738 InsertConfigNode(pLunL0, "Config", &pCfg); 3735 hrc = aNetworkAdapter->COMGETTER(TraceFile)(bstr.asOutParam()); 3739 hrc = aNetworkAdapter->COMGETTER(TraceFile)(bstr.asOutParam()); H(); 3736 3740 if (!bstr.isEmpty()) /* check convention for indicating default file. */ 3737 3741 InsertConfigString(pCfg, "File", bstr); 3742 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL0); 3738 3743 } 3744 3739 3745 3740 3746 Bstr networkName, trunkName, trunkType; … … 3750 3756 ComPtr<INATEngine> natDriver; 3751 3757 hrc = aNetworkAdapter->COMGETTER(NatDriver)(natDriver.asOutParam()); H(); 3752 if (fSniffer)3753 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL0);3754 else3755 InsertConfigNode(pInst, "LUN#0", &pLunL0);3756 3758 InsertConfigString(pLunL0, "Driver", "NAT"); 3757 3759 InsertConfigNode(pLunL0, "Config", &pCfg); … … 3918 3920 if ((int)maTapFD[uInstance] >= 0) 3919 3921 { 3920 if (fSniffer)3921 {3922 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL0);3923 }3924 else3925 {3926 InsertConfigNode(pInst, "LUN#0", &pLunL0);3927 }3928 3922 InsertConfigString(pLunL0, "Driver", "HostInterface"); 3929 3923 InsertConfigNode(pLunL0, "Config", &pCfg); … … 3935 3929 * This is the new VBoxNetFlt+IntNet stuff. 3936 3930 */ 3937 if (fSniffer)3938 {3939 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL0);3940 }3941 else3942 {3943 InsertConfigNode(pInst, "LUN#0", &pLunL0);3944 }3945 3946 3931 Bstr BridgedIfName; 3947 3932 hrc = aNetworkAdapter->COMGETTER(BridgedInterface)(BridgedIfName.asOutParam()); … … 4345 4330 if (!bstr.isEmpty()) 4346 4331 { 4347 if (fSniffer)4348 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL0);4349 else4350 InsertConfigNode(pInst, "LUN#0", &pLunL0);4351 4332 InsertConfigString(pLunL0, "Driver", "IntNet"); 4352 4333 InsertConfigNode(pLunL0, "Config", &pCfg); … … 4362 4343 case NetworkAttachmentType_HostOnly: 4363 4344 { 4364 if (fSniffer)4365 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL0);4366 else4367 InsertConfigNode(pInst, "LUN#0", &pLunL0);4368 4369 4345 InsertConfigString(pLunL0, "Driver", "IntNet"); 4370 4346 InsertConfigNode(pLunL0, "Config", &pCfg); … … 4573 4549 ComSafeArrayAsOutParam(values)); H(); 4574 4550 4575 if (fSniffer)4576 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL0);4577 else4578 InsertConfigNode(pInst, "LUN#0", &pLunL0);4579 4551 InsertConfigString(pLunL0, "Driver", bstr); 4580 4552 InsertConfigNode(pLunL0, "Config", &pCfg);
Note:
See TracChangeset
for help on using the changeset viewer.