Changeset 36082 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Feb 25, 2011 12:21:57 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r35858 r36082 207 207 " [--nicspeed<1-N> <kbps>]\n" 208 208 " [--nicbootprio<1-N> <priority>]\n" 209 " [--nicpromisc<1-N> deny|allow-vms|allow-all]\n" 209 210 " [--bridgeadapter<1-N> none|<devicename>]\n" 210 211 #if defined(VBOX_WITH_NETFLT) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r35967 r36082 849 849 strAttachment = "none"; 850 850 break; 851 851 852 case NetworkAttachmentType_NAT: 852 853 { … … 946 947 break; 947 948 } 949 948 950 case NetworkAttachmentType_Bridged: 949 951 { … … 959 961 break; 960 962 } 963 961 964 case NetworkAttachmentType_Internal: 962 965 { … … 972 975 break; 973 976 } 977 974 978 #if defined(VBOX_WITH_NETFLT) 975 979 case NetworkAttachmentType_HostOnly: … … 1011 1015 nic->COMGETTER(CableConnected)(&fConnected); 1012 1016 1017 /* promisc policy */ 1018 NetworkAdapterPromiscModePolicy_T enmPromiscModePolicy; 1019 CHECK_ERROR2_RET(nic, COMGETTER(PromiscModePolicy)(&enmPromiscModePolicy), hrcCheck); 1020 const char *pszPromiscuousGuestPolicy; 1021 switch (enmPromiscModePolicy) 1022 { 1023 case NetworkAdapterPromiscModePolicy_Deny: pszPromiscuousGuestPolicy = "deny"; break; 1024 case NetworkAdapterPromiscModePolicy_AllowNetwork: pszPromiscuousGuestPolicy = "allow-vms"; break; 1025 case NetworkAdapterPromiscModePolicy_AllowAll: pszPromiscuousGuestPolicy = "allow-all"; break; 1026 default: AssertFailedReturn(VERR_INTERNAL_ERROR_4); 1027 } 1028 1013 1029 /* trace stuff */ 1014 1030 BOOL fTraceEnabled; … … 1018 1034 1019 1035 /* NIC type */ 1020 Utf8Str strNICType;1021 1036 NetworkAdapterType_T NICType; 1022 1037 nic->COMGETTER(AdapterType)(&NICType); 1023 switch (NICType) { 1024 case NetworkAdapterType_Am79C970A: 1025 strNICType = "Am79C970A"; 1026 break; 1027 case NetworkAdapterType_Am79C973: 1028 strNICType = "Am79C973"; 1029 break; 1038 const char *pszNICType; 1039 switch (NICType) 1040 { 1041 case NetworkAdapterType_Am79C970A: pszNICType = "Am79C970A"; break; 1042 case NetworkAdapterType_Am79C973: pszNICType = "Am79C973"; break; 1030 1043 #ifdef VBOX_WITH_E1000 1031 case NetworkAdapterType_I82540EM: 1032 strNICType = "82540EM"; 1033 break; 1034 case NetworkAdapterType_I82543GC: 1035 strNICType = "82543GC"; 1036 break; 1037 case NetworkAdapterType_I82545EM: 1038 strNICType = "82545EM"; 1039 break; 1044 case NetworkAdapterType_I82540EM: pszNICType = "82540EM"; break; 1045 case NetworkAdapterType_I82543GC: pszNICType = "82543GC"; break; 1046 case NetworkAdapterType_I82545EM: pszNICType = "82545EM"; break; 1040 1047 #endif 1041 1048 #ifdef VBOX_WITH_VIRTIO 1042 case NetworkAdapterType_Virtio: 1043 strNICType = "virtio"; 1044 break; 1045 #endif /* VBOX_WITH_VIRTIO */ 1046 default: 1047 strNICType = "unknown"; 1048 break; 1049 case NetworkAdapterType_Virtio: pszNICType = "virtio"; break; 1050 #endif 1051 default: AssertFailed(); pszNICType = "unknown"; break; 1049 1052 } 1050 1053 … … 1064 1067 } 1065 1068 else 1066 RTPrintf("NIC % d: MAC: %lS, Attachment: %s, Cable connected: %s, Trace: %s (file: %lS), Type: %s, Reported speed: %d Mbps, Boot priority: %d\n",1069 RTPrintf("NIC %u: MAC: %lS, Attachment: %s, Cable connected: %s, Trace: %s (file: %lS), Type: %s, Reported speed: %d Mbps, Boot priority: %d, Promisc Policy: %s\n", 1067 1070 currentNIC + 1, strMACAddress.raw(), strAttachment.c_str(), 1068 1071 fConnected ? "on" : "off", 1069 1072 fTraceEnabled ? "on" : "off", 1070 1073 traceFile.isEmpty() ? Bstr("none").raw() : traceFile.raw(), 1071 strNICType.c_str(),1074 pszNICType, 1072 1075 ulLineSpeed / 1000, 1073 (int)ulBootPriority); 1076 (int)ulBootPriority, 1077 pszPromiscuousGuestPolicy); 1074 1078 if (strNatSettings.length()) 1075 1079 RTPrintf(strNatSettings.c_str()); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r35761 r36082 104 104 MODIFYVM_NICSPEED, 105 105 MODIFYVM_NICBOOTPRIO, 106 MODIFYVM_NICPROMISC, 106 107 MODIFYVM_NIC, 107 108 MODIFYVM_CABLECONNECTED, … … 230 231 { "--nicspeed", MODIFYVM_NICSPEED, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX }, 231 232 { "--nicbootprio", MODIFYVM_NICBOOTPRIO, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX }, 233 { "--nicpromisc", MODIFYVM_NICPROMISC, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 232 234 { "--nic", MODIFYVM_NIC, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 233 235 { "--cableconnected", MODIFYVM_CABLECONNECTED, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX }, … … 1082 1084 } 1083 1085 1086 case MODIFYVM_NICPROMISC: 1087 { 1088 NetworkAdapterPromiscModePolicy_T enmPromiscModePolicy; 1089 if (!strcmp(ValueUnion.psz, "deny")) 1090 enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_Deny; 1091 else if ( !strcmp(ValueUnion.psz, "allow-vms") 1092 || !strcmp(ValueUnion.psz, "allow-network")) 1093 enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_AllowNetwork; 1094 else if (!strcmp(ValueUnion.psz, "allow-all")) 1095 enmPromiscModePolicy = NetworkAdapterPromiscModePolicy_AllowAll; 1096 else 1097 { 1098 errorArgument("Unknown promiscuous mode policy '%s'", ValueUnion.psz); 1099 rc = E_INVALIDARG; 1100 break; 1101 } 1102 1103 ComPtr<INetworkAdapter> nic; 1104 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1105 ASSERT(nic); 1106 1107 CHECK_ERROR(nic, COMSETTER(PromiscModePolicy)(enmPromiscModePolicy)); 1108 break; 1109 } 1110 1084 1111 case MODIFYVM_NIC: 1085 1112 {
Note:
See TracChangeset
for help on using the changeset viewer.