Changeset 4644 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 10, 2007 2:35:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
r4553 r4644 196 196 const char *pszSniff; /**< Output file for the network sniffer. */ 197 197 PDMMAC Mac; /**< The mac address for the device. */ 198 const char *pszName; /**< The device name of a HIF device. The name of the internal network. */ 199 #if 1//defined(RT_OS_LINUX) 198 const char *pszName; /**< The device name of a HIF device. The name of the internal network. */ 199 #ifdef RT_OS_OS2 200 bool fHaveConnectTo; /**< Whether fConnectTo is set. */ 201 int32_t iConnectTo; /**< The lanX to connect to (bridge with). */ 202 #elif 1//defined(RT_OS_LINUX) 200 203 bool fHaveFd; /**< Set if fd is valid. */ 201 204 int32_t fd; /**< The file descriptor of a HIF device.*/ … … 335 338 #if 0 336 339 " -netsniff<1-N> Enable packet sniffer\n" 340 #endif 341 #ifdef RT_OS_OS2 342 " -brdev<1-N> lan<X> Bridge network adaptor <N> with the 'lanX' device.\n" 337 343 #endif 338 344 #ifdef RT_OS_LINUX … … 606 612 else if (strncmp(pszArg, "-netsniff", 9) == 0) 607 613 { 608 int i = networkArg2Index(pszArg, 7);609 if ( rc< 0)614 int i = networkArg2Index(pszArg, 9); 615 if (i < 0) 610 616 return 1; 611 617 g_aNetDevs[i].fSniff = true; 612 618 /** @todo filename */ 613 619 } 620 #ifdef RT_OS_OS2 621 else if (strncmp(pszArg, "-brdev", 6) == 0) 622 { 623 int i = networkArg2Index(pszArg, 6); 624 if (i < 0) 625 return 1; 626 if (g_aNetDevs[i].enmType != BFENETDEV::HIF) 627 return SyntaxError("%d is not a hif device! Make sure you put the -hifdev argument first.\n", i); 628 if (++curArg >= argc) 629 return SyntaxError("missing argument for %s!\n", pszArg); 630 rc = RTStrToInt32Ex(argv[curArg], NULL, 0, &g_aNetDevs[i].iConnectTo); 631 if (VBOX_FAILURE(rc)) 632 return SyntaxError("bad tap file descriptor: %s (error %VRc)\n", argv[curArg], rc); 633 g_aNetDevs[i].fHaveConnectTo = true; 634 } 635 #endif 614 636 #ifdef RT_OS_LINUX 615 637 else if (strncmp(pszArg, "-tapfd", 6) == 0) 616 638 { 617 int i = networkArg2Index(pszArg, 7); 639 int i = networkArg2Index(pszArg, 6); 640 if (i < 0) 641 return 1; 618 642 if (++curArg >= argc) 619 643 return SyntaxError("missing argument for %s!\n", pszArg); … … 1553 1577 if (g_aNetDevs[ulInstance].fHaveFd) 1554 1578 { 1555 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); 1556 UPDATE_RC(); 1557 rc = CFGMR3InsertInteger(pCfg, "FileHandle", g_aNetDevs[ulInstance].fd); 1558 UPDATE_RC(); 1579 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); UPDATE_RC(); 1580 rc = CFGMR3InsertInteger(pCfg, "FileHandle", g_aNetDevs[ulInstance].fd); UPDATE_RC(); 1559 1581 } 1560 1582 else 1561 1583 #endif 1562 1584 { 1563 #if defined (RT_OS_LINUX) || defined(RT_OS_L4)1585 #if defined(RT_OS_LINUX) || defined(RT_OS_L4) 1564 1586 /* 1565 1587 * Create/Open the TAP the device. … … 1612 1634 rc = CFGMR3InsertInteger(pCfg, "FileHandle", (RTFILE)tapFD); UPDATE_RC(); 1613 1635 1636 #elif defined(RT_OS_OS2) 1637 /* 1638 * The TAP driver does all the opening and setting up, 1639 * as it was originally was ment to be (stupid fork() problems). 1640 */ 1641 rc = CFGMR3InsertString(pCfg, "Device", g_aNetDevs[ulInstance].pszName); UPDATE_RC(); 1642 if (g_aNetDevs[ulInstance].fHaveConnectTo) 1643 { 1644 rc = CFGMR3InsertInteger(pCfg, "ConnectTo", g_aNetDevs[ulInstance].iConnectTo); 1645 UPDATE_RC(); 1646 } 1614 1647 #elif defined(RT_OS_WINDOWS) 1615 1648 /*
Note:
See TracChangeset
for help on using the changeset viewer.