Changeset 48538 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Sep 19, 2013 3:17:43 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r48406 r48538 761 761 CHECK_ERROR_RET(adapter, COMSETTER(AttachmentType)(NetworkAttachmentType_Generic), 1); 762 762 } 763 else if (!strcmp(a->argv[2], "natnetwork")) 764 { 765 if (a->argc <= 3) 766 { 767 errorArgument("Missing argument to '%s'", a->argv[2]); 768 rc = E_FAIL; 769 break; 770 } 771 CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1); 772 CHECK_ERROR_RET(adapter, COMSETTER(NATNetwork)(Bstr(a->argv[3]).raw()), 1); 773 CHECK_ERROR_RET(adapter, COMSETTER(AttachmentType)(NetworkAttachmentType_NATNetwork), 1); 774 } 763 775 /** @todo obsolete, remove eventually */ 764 776 else if (!strcmp(a->argv[2], "vde")) … … 1458 1470 break; 1459 1471 } 1460 1472 1461 1473 } 1462 1474 else -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r48429 r48538 123 123 "%s list [--long|-l]%s vms|runningvms|ostypes|hostdvds|hostfloppies|\n" 124 124 #if defined(VBOX_WITH_NETFLT) 125 " bridgedifs|hostonlyifs|dhcpservers|hostinfo|\n"125 " intnets|bridgedifs|hostonlyifs|natnets|dhcpservers|\n" 126 126 #else 127 " bridgedifs|dhcpservers|hostinfo|\n"128 #endif 129 " host cpuids|hddbackends|hdds|dvds|floppies|\n"127 " intnets|bridgedifs|natnets|dhcpservers|hostinfo|\n" 128 #endif 129 " hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|\n" 130 130 " usbhost|usbfilters|systemproperties|extpacks|\n" 131 131 " groups\n" … … 217 217 #endif 218 218 "|\n" 219 " generic "219 " generic|natnetwork" 220 220 "]\n" 221 221 " [--nictype<1-N> Am79C970A|Am79C973" … … 240 240 #endif 241 241 " [--intnet<1-N> <network name>]\n" 242 " [--nat-network<1-N> <network name>]\n" 243 " [--nicgenericdrv<1-N> <driver>\n" 242 244 " [--natnet<1-N> <network>|default]\n" 243 " [--nicgenericdrv<1-N> <driver>\n"244 245 " [--natsettings<1-N> [<mtu>],[<socksnd>],\n" 245 246 " [<sockrcv>],[<tcpsnd>],\n" … … 440 441 " setlinkstate<1-N> on|off |\n" 441 442 #if defined(VBOX_WITH_NETFLT) 442 " nic<1-N> null|nat|bridged|intnet|hostonly|generic" 443 "\n" 444 " [<devicename>] |\n" 443 " nic<1-N> null|nat|bridged|intnet|hostonly|generic|\n" 444 " natnetwork [<devicename>] |\n" 445 445 #else /* !VBOX_WITH_NETFLT */ 446 " nic<1-N> null|nat|bridged|intnet|generic \n"446 " nic<1-N> null|nat|bridged|intnet|generic|natnetwork\n" 447 447 " [<devicename>] |\n" 448 448 #endif /* !VBOX_WITH_NETFLT */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r47991 r48538 1073 1073 break; 1074 1074 } 1075 1075 1076 case NetworkAttachmentType_Generic: 1076 1077 { … … 1103 1104 break; 1104 1105 } 1106 1107 case NetworkAttachmentType_NATNetwork: 1108 { 1109 Bstr strNetwork; 1110 nic->COMGETTER(NATNetwork)(strNetwork.asOutParam()); 1111 if (details == VMINFO_MACHINEREADABLE) 1112 { 1113 RTPrintf("nat-network%d=\"%ls\"\n", currentNIC + 1, strNetwork.raw()); 1114 strAttachment = "natnetwork"; 1115 } 1116 else 1117 strAttachment = Utf8StrFmt("NAT Network '%s'", Utf8Str(strNetwork).c_str()); 1118 break; 1119 } 1120 1105 1121 default: 1106 1122 strAttachment = "unknown"; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r48097 r48538 76 76 77 77 /** 78 * List internal networks. 79 * 80 * @returns See produceList. 81 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 82 */ 83 static HRESULT listInternalNetworks(const ComPtr<IVirtualBox> pVirtualBox) 84 { 85 HRESULT rc; 86 com::SafeArray<BSTR> internalNetworks; 87 CHECK_ERROR(pVirtualBox, COMGETTER(InternalNetworks)(ComSafeArrayAsOutParam(internalNetworks))); 88 for (size_t i = 0; i < internalNetworks.size(); ++i) 89 { 90 RTPrintf("Name: %ls\n", internalNetworks[i]); 91 } 92 return rc; 93 } 94 95 96 /** 78 97 * List network interfaces information (bridged/host only). 79 98 * 80 99 * @returns See produceList. 81 100 * @param pVirtualBox Reference to the IVirtualBox smart pointer. 101 * @param fIsBridged Selects between listing host interfaces (for 102 * use with bridging) or host only interfaces. 82 103 */ 83 104 static HRESULT listNetworkInterfaces(const ComPtr<IVirtualBox> pVirtualBox, … … 283 304 284 305 /* File extensions */ 285 com::SafeArray 286 com::SafeArray 306 com::SafeArray<BSTR> fileExtensions; 307 com::SafeArray<DeviceType_T> deviceTypes; 287 308 CHECK_ERROR(mediumFormats[i], 288 309 DescribeFileExtensions(ComSafeArrayAsOutParam(fileExtensions), ComSafeArrayAsOutParam(deviceTypes))); … … 296 317 297 318 /* Configuration keys */ 298 com::SafeArray 299 com::SafeArray 300 com::SafeArray 301 com::SafeArray 302 com::SafeArray 319 com::SafeArray<BSTR> propertyNames; 320 com::SafeArray<BSTR> propertyDescriptions; 321 com::SafeArray<DataType_T> propertyTypes; 322 com::SafeArray<ULONG> propertyFlags; 323 com::SafeArray<BSTR> propertyDefaults; 303 324 CHECK_ERROR(mediumFormats[i], 304 325 DescribeProperties(ComSafeArrayAsOutParam(propertyNames), … … 722 743 kListHostDvds, 723 744 kListHostFloppies, 745 kListInternalNetworks, 724 746 kListBridgedInterfaces, 725 747 #if defined(VBOX_WITH_NETFLT) … … 894 916 } 895 917 918 case kListInternalNetworks: 919 rc = listInternalNetworks(pVirtualBox); 920 break; 921 896 922 case kListBridgedInterfaces: 897 923 #if defined(VBOX_WITH_NETFLT) … … 1038 1064 net->COMGETTER(Enabled)(&fEnabled); 1039 1065 RTPrintf("Enabled: %s\n", fEnabled ? "Yes" : "No"); 1040 1066 1041 1067 #define PRINT_STRING_ARRAY(title) \ 1042 1068 if (strs.size() > 0) \ … … 1046 1072 for (;j < strs.size(); ++j) \ 1047 1073 RTPrintf(" %s\n", Utf8Str(strs[j]).c_str()); \ 1048 } 1074 } 1049 1075 1050 1076 com::SafeArray<BSTR> strs; … … 1096 1122 { "hostdvds", kListHostDvds, RTGETOPT_REQ_NOTHING }, 1097 1123 { "hostfloppies", kListHostFloppies, RTGETOPT_REQ_NOTHING }, 1124 { "intnets", kListInternalNetworks, RTGETOPT_REQ_NOTHING }, 1098 1125 { "hostifs", kListBridgedInterfaces, RTGETOPT_REQ_NOTHING }, /* backward compatibility */ 1099 1126 { "bridgedifs", kListBridgedInterfaces, RTGETOPT_REQ_NOTHING }, … … 1101 1128 { "hostonlyifs", kListHostOnlyInterfaces, RTGETOPT_REQ_NOTHING }, 1102 1129 #endif 1130 { "natnetworks", kListNatNetworks, RTGETOPT_REQ_NOTHING }, 1131 { "natnets", kListNatNetworks, RTGETOPT_REQ_NOTHING }, 1103 1132 { "hostinfo", kListHostInfo, RTGETOPT_REQ_NOTHING }, 1104 1133 { "hostcpuids", kListHostCpuIDs, RTGETOPT_REQ_NOTHING }, … … 1113 1142 { "extpacks", kListExtPacks, RTGETOPT_REQ_NOTHING }, 1114 1143 { "groups", kListGroups, RTGETOPT_REQ_NOTHING }, 1115 { "natnetworks", kListNatNetworks, RTGETOPT_REQ_NOTHING },1116 1144 }; 1117 1145 … … 1141 1169 case kListHostDvds: 1142 1170 case kListHostFloppies: 1171 case kListInternalNetworks: 1143 1172 case kListBridgedInterfaces: 1144 1173 #if defined(VBOX_WITH_NETFLT) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r48406 r48538 113 113 MODIFYVM_HOSTONLYADAPTER, 114 114 MODIFYVM_INTNET, 115 MODIFYVM_GENERICDRV, 116 MODIFYVM_NATNETWORKNAME, 115 117 MODIFYVM_NATNET, 116 MODIFYVM_GENERICDRV,117 118 MODIFYVM_NATBINDIP, 118 119 MODIFYVM_NATSETTINGS, … … 273 274 { "--hostonlyadapter", MODIFYVM_HOSTONLYADAPTER, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 274 275 { "--intnet", MODIFYVM_INTNET, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 276 { "--nicgenericdrv", MODIFYVM_GENERICDRV, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 277 { "--nat-network", MODIFYVM_NATNETWORKNAME, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 278 { "--natnetwork", MODIFYVM_NATNETWORKNAME, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 275 279 { "--natnet", MODIFYVM_NATNET, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 276 { "--nicgenericdrv", MODIFYVM_GENERICDRV, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },277 280 { "--natbindip", MODIFYVM_NATBINDIP, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 278 281 { "--natsettings", MODIFYVM_NATSETTINGS, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, … … 1409 1412 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Generic)); 1410 1413 } 1414 else if (!RTStrICmp(ValueUnion.psz, "natnetwork")) 1415 { 1416 1417 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1418 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_NATNetwork)); 1419 } 1411 1420 else 1412 1421 { … … 1493 1502 1494 1503 CHECK_ERROR(nic, COMSETTER(GenericDriver)(Bstr(ValueUnion.psz).raw())); 1504 break; 1505 } 1506 1507 case MODIFYVM_NATNETWORKNAME: 1508 { 1509 ComPtr<INetworkAdapter> nic; 1510 1511 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1512 ASSERT(nic); 1513 1514 CHECK_ERROR(nic, COMSETTER(NATNetwork)(Bstr(ValueUnion.psz).raw())); 1495 1515 break; 1496 1516 }
Note:
See TracChangeset
for help on using the changeset viewer.