Changeset 15533 in vbox for trunk/src/VBox
- Timestamp:
- Dec 15, 2008 7:02:36 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r15051 r15533 671 671 " -termacpi Send an ACPI power button event when closing the window\n" 672 672 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) /** @todo UNIXISH_TAP stuff out of main and up to Config.kmk! */ 673 " -tapdev<1-N> <dev> Use existing persistent TAP device with the given name\n"674 " -tapfd<1-N> <fd> Use existing TAP device, don't allocate\n"675 673 " -evdevkeymap Use evdev keycode map\n" 676 674 #endif … … 1197 1195 sysInfo->COMGETTER (NetworkAdapterCount) (&NetworkAdapterCount); 1198 1196 1199 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)1200 std::vector <Bstr> tapdev (NetworkAdapterCount);1201 std::vector <int> tapfd (NetworkAdapterCount, 0);1202 #endif1203 1204 1197 ConvertSettings fConvertSettings = ConvertSettings_No; 1205 1198 … … 1426 1419 } 1427 1420 #endif /* RT_OS_LINUX */ 1428 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)1429 else if (strncmp(argv[curArg], "-tapdev", 7) == 0)1430 {1431 ULONG n = 0;1432 if (!argv[curArg][7] || ((n = strtoul(&argv[curArg][7], NULL, 10)) < 1) ||1433 (n > NetworkAdapterCount) || (argc <= (curArg + 1)))1434 {1435 RTPrintf("Error: invalid TAP device option!\n");1436 rc = E_FAIL;1437 break;1438 }1439 tapdev[n - 1] = argv[curArg + 1];1440 curArg++;1441 }1442 else if (strncmp(argv[curArg], "-tapfd", 6) == 0)1443 {1444 ULONG n = 0;1445 if (!argv[curArg][6] || ((n = strtoul(&argv[curArg][6], NULL, 10)) < 1) ||1446 (n > NetworkAdapterCount) || (argc <= (curArg + 1)))1447 {1448 RTPrintf("Error: invalid TAP file descriptor option!\n");1449 rc = E_FAIL;1450 break;1451 }1452 tapfd[n - 1] = atoi(argv[curArg + 1]);1453 curArg++;1454 }1455 #endif /* RT_OS_LINUX || RT_OS_DARWIN */1456 1421 #ifdef VBOX_WITH_VRDP 1457 1422 else if (strcmp(argv[curArg], "-vrdp") == 0) … … 2020 1985 // until we've tried to to start the VM, ignore power off events 2021 1986 consoleCallback->ignorePowerOffEvents(true); 2022 2023 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)2024 /*2025 * Do we have a TAP device name or file descriptor? If so, communicate2026 * it to the network adapter so that it doesn't allocate a new one2027 * in case TAP is already configured.2028 */2029 {2030 ComPtr<INetworkAdapter> networkAdapter;2031 for (ULONG i = 0; i < NetworkAdapterCount; i++)2032 {2033 if (tapdev[i] || tapfd[i])2034 {2035 gMachine->GetNetworkAdapter(i, networkAdapter.asOutParam());2036 if (networkAdapter)2037 {2038 NetworkAttachmentType_T attachmentType;2039 networkAdapter->COMGETTER(AttachmentType)(&attachmentType);2040 if (attachmentType == NetworkAttachmentType_HostInterface)2041 {2042 if (tapdev[i])2043 networkAdapter->COMSETTER(HostInterface)(tapdev[i]);2044 else2045 networkAdapter->COMSETTER(TAPFileDescriptor)(tapfd[i]);2046 }2047 else2048 {2049 RTPrintf("Warning: network adapter %d is not configured for TAP. Command ignored!\n", i + 1);2050 }2051 }2052 else2053 {2054 /* warning */2055 RTPrintf("Warning: network adapter %d not defined. Command ignored!\n", i + 1);2056 }2057 }2058 }2059 }2060 #endif /* RT_OS_LINUX || RT_OS_DARWIN */2061 1987 2062 1988 #ifdef VBOX_WITH_VRDP -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r15530 r15533 9733 9733 </attribute> 9734 9734 9735 <if target="xpidl">9736 <attribute name="TAPFileDescriptor" type="long">9737 <desc>9738 File descriptor of the TAP device. It can either be setup by the caller9739 which has to supply an existing valid file handle allocated in the parent9740 process of the VM process or allocated by VirtualBox. The value is -1 if it9741 has not been defined. This property is non persistent, i.e. it will not be9742 stored in the VM's configuration data and thus has to be set at each startup.9743 </desc>9744 </attribute>9745 <attribute name="TAPSetupApplication" type="wstring">9746 <desc>9747 Application to start to configure the TAP device.9748 It is being passed two parameters, 1) the file handle (as ASCII),9749 2) the TAP device name if it is available.9750 </desc>9751 </attribute>9752 <attribute name="TAPTerminateApplication" type="wstring">9753 <desc>9754 Application to start before closing a TAP device.9755 It is being passed two parameters, 1) the file handle (as ASCII),9756 2) the TAP device name if it is available.9757 </desc>9758 </attribute>9759 </if>9760 9761 9735 <attribute name="internalNetwork" type="wstring"> 9762 9736 <desc>
Note:
See TracChangeset
for help on using the changeset viewer.