VirtualBox

Changeset 15533 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 15, 2008 7:02:36 PM (16 years ago)
Author:
vboxsync
Message:

Main: rip out obsolete TAPFileDescriptor, TAPSetupApplication, TAPTerminateApplication attributes; plus subsequent VBoxSDL changes

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r15051 r15533  
    671671             "  -termacpi                Send an ACPI power button event when closing the window\n"
    672672#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"
    675673             "  -evdevkeymap             Use evdev keycode map\n"
    676674#endif
     
    11971195    sysInfo->COMGETTER (NetworkAdapterCount) (&NetworkAdapterCount);
    11981196
    1199 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
    1200     std::vector <Bstr> tapdev (NetworkAdapterCount);
    1201     std::vector <int> tapfd (NetworkAdapterCount, 0);
    1202 #endif
    1203 
    12041197    ConvertSettings fConvertSettings = ConvertSettings_No;
    12051198
     
    14261419        }
    14271420#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 */
    14561421#ifdef VBOX_WITH_VRDP
    14571422        else if (strcmp(argv[curArg], "-vrdp") == 0)
     
    20201985    // until we've tried to to start the VM, ignore power off events
    20211986    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, communicate
    2026      * it to the network adapter so that it doesn't allocate a new one
    2027      * 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                         else
    2045                             networkAdapter->COMSETTER(TAPFileDescriptor)(tapfd[i]);
    2046                     }
    2047                     else
    2048                     {
    2049                         RTPrintf("Warning: network adapter %d is not configured for TAP. Command ignored!\n", i + 1);
    2050                     }
    2051                 }
    2052                 else
    2053                 {
    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 */
    20611987
    20621988#ifdef VBOX_WITH_VRDP
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r15530 r15533  
    97339733    </attribute>
    97349734
    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 caller
    9739         which has to supply an existing valid file handle allocated in the parent
    9740         process of the VM process or allocated by VirtualBox. The value is -1 if it
    9741         has not been defined. This property is non persistent, i.e. it will not be
    9742         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 
    97619735    <attribute name="internalNetwork" type="wstring">
    97629736      <desc>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette