Changeset 12866 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 1, 2008 1:50:12 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HostImpl.cpp
r12785 r12866 52 52 # include <limits.h> 53 53 # include <stdio.h> 54 # ifdef VBOX_SOLARIS_ USE_DEVINFO54 # ifdef VBOX_SOLARIS_NSL_RESOLVED 55 55 # include <libdevinfo.h> 56 56 # else … … 71 71 extern "C" char *getfullrawname(char *); 72 72 # endif 73 # include "solaris/DynLoadLibSolaris.h" 73 74 #endif /* RT_OS_SOLARIS */ 74 75 … … 531 532 532 533 #ifdef RT_OS_SOLARIS 533 static void vboxSolarisAddHostIface(char *pszIface, int Instance, PCRTMAC pMac, void *pvArg) 534 { 535 std::list <ComObjPtr <HostNetworkInterface> > *pList = (std::list <ComObjPtr <HostNetworkInterface> > *)pvArg; 534 static void vboxSolarisAddHostIface(char *pszIface, int Instance, PCRTMAC pMac, void *pvHostNetworkInterfaceList) 535 { 536 std::list<ComObjPtr <HostNetworkInterface> > *pList = (std::list<ComObjPtr <HostNetworkInterface> > *)pvHostNetworkInterfaceList; 537 Assert(pList); 536 538 537 539 typedef std::map <std::string, std::string> NICMap; … … 606 608 } 607 609 608 # ifdef VBOX_SOLARIS_USE_DEVINFO 609 static int vboxSolarisAddPhysHostIface(di_node_t Node, di_minor_t Minor, void *pvArg) 610 static boolean_t vboxSolarisAddLinkHostIface(const char *pszIface, void *pvHostNetworkInterfaceList) 611 { 612 /* 613 * Clip off the instance number from the interface name. 614 */ 615 int cbInstance = 0; 616 int cbIface = strlen(pszIface); 617 const char *pszEnd = pszIface + cbIface - 1; 618 for (int i = 0; i < cbIface - 1; i++) 619 { 620 if (!RT_C_IS_DIGIT(*pszEnd)) 621 break; 622 cbInstance++; 623 pszEnd--; 624 } 625 626 /* 627 * Add the interface. 628 */ 629 char szIfaceName[128]; 630 strncpy(szIfaceName, pszIface, cbIface - cbInstance); 631 szIfaceName[cbIface - cbInstance] = '\0'; 632 int Instance = atoi(pszEnd + 1); 633 vboxSolarisAddHostIface(szIfaceName, Instance, NULL, pvHostNetworkInterfaceList); 634 635 /* 636 * Continue walking... 637 */ 638 return _B_FALSE; 639 } 640 641 # ifdef VBOX_SOLARIS_NSL_RESOLVED 642 static int vboxSolarisAddPhysHostIface(di_node_t Node, di_minor_t Minor, void *pvHostNetworkInterfaceList) 610 643 { 611 644 /* … … 621 654 return DI_WALK_CONTINUE; 622 655 623 vboxSolarisAddHostIface(di_driver_name(Node), di_instance(Node), NULL, pv Arg);656 vboxSolarisAddHostIface(di_driver_name(Node), di_instance(Node), NULL, pvHostNetworkInterfaceList); 624 657 return DI_WALK_CONTINUE; 625 658 } … … 661 694 # elif defined(RT_OS_SOLARIS) 662 695 663 #ifdef VBOX_SOLARIS_USE_DEVINFO 696 #ifdef VBOX_SOLARIS_NSL_RESOLVED 697 664 698 /* 665 699 * Use libdevinfo for determining all physical interfaces. 666 * @todo Try using libdlpi instead and using links rather than physical interfaces.667 700 */ 668 701 di_node_t Root; … … 673 706 di_fini(Root); 674 707 } 708 709 /* 710 * Use libdlpi for determining all DLPI interfaces. 711 */ 712 if (VBoxSolarisLibDlpiFound()) 713 g_pfnLibDlpiWalk(vboxSolarisAddLinkHostIface, &list, 0); 714 675 715 #else 676 716 /* … … 728 768 char *pszIface = Ifaces[i].lifr_name; 729 769 strcpy(szNICDesc, pszIface); 730 731 /* 732 * Clip off the instance number from the interface name. 733 */ 734 int cbInstance = 0; 735 int cbIface = strlen(pszIface); 736 char *pszEnd = pszIface + cbIface - 1; 737 for (int i = 0; i < cbIface - 1; i++) 738 { 739 if (!RT_C_IS_DIGIT(*pszEnd)) 740 break; 741 cbInstance++; 742 pszEnd--; 743 } 744 745 /* 746 * Add the interface. 747 */ 748 char szIfaceName[LIFNAMSIZ + 1]; 749 strncpy(szIfaceName, pszIface, cbIface - cbInstance); 750 szIfaceName[cbIface - cbInstance] = '\0'; 751 752 int Instance = atoi(pszEnd + 1); 753 vboxSolarisAddHostIface(szIfaceName, Instance, &Mac, &list); 770 771 vboxSolarisAddLinkHostIface(pszIface, &list); 754 772 } 755 773 } -
trunk/src/VBox/Main/Makefile.kmk
r12783 r12866 211 211 VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL 212 212 VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL 213 ifdef VBOX_SOLARIS_ USE_DEVINFO214 VBoxSVC_DEFS.solaris += VBOX_SOLARIS_ USE_DEVINFO213 ifdef VBOX_SOLARIS_NSL_RESOLVED 214 VBoxSVC_DEFS.solaris += VBOX_SOLARIS_NSL_RESOLVED 215 215 endif 216 216 … … 236 236 adm 237 237 ifdef VBOX_WITH_NETFLT 238 ifdef VBOX_SOLARIS_ USE_DEVINFO238 ifdef VBOX_SOLARIS_NSL_RESOLVED 239 239 VBoxSVC_LIBS.solaris += devinfo 240 240 else … … 300 300 301 301 VBoxSVC_SOURCES.solaris = \ 302 linux/vbox-libhal.cpp 302 linux/vbox-libhal.cpp \ 303 solaris/DynLoadLibSolaris.cpp 303 304 304 305 ifdef VBOX_WITH_USB
Note:
See TracChangeset
for help on using the changeset viewer.