Changeset 8960 in vbox for trunk/src/VBox
- Timestamp:
- May 20, 2008 2:49:14 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvTAP.cpp
r8610 r8960 277 277 #ifdef VBOX_WITH_CROSSBOW 278 278 cbRead = sizeof(achBuf); 279 rc = g LibDlpiRecv(pData->pDeviceHandle, NULL, NULL, achBuf, &cbRead, -1, NULL);279 rc = g_pfnLibDlpiRecv(pData->pDeviceHandle, NULL, NULL, achBuf, &cbRead, -1, NULL); 280 280 rc = RT_LIKELY(rc == DLPI_SUCCESS) ? VINF_SUCCESS : SolarisDLPIErr2VBoxErr(rc); 281 281 #else … … 520 520 * Open & bind the NIC using the datalink provider routine. 521 521 */ 522 int rc = g LibDlpiOpen(pData->pszDeviceName, &pData->pDeviceHandle, DLPI_RAW);522 int rc = g_pfnLibDlpiOpen(pData->pszDeviceName, &pData->pDeviceHandle, DLPI_RAW); 523 523 if (rc != DLPI_SUCCESS) 524 524 return PDMDrvHlpVMSetError(pData->pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, … … 526 526 527 527 dlpi_info_t vnicInfo; 528 rc = g LibDlpiInfo(pData->pDeviceHandle, &vnicInfo, 0);528 rc = g_pfnLibDlpiInfo(pData->pDeviceHandle, &vnicInfo, 0); 529 529 if (rc == DLPI_SUCCESS) 530 530 { 531 531 if (vnicInfo.di_mactype == DL_ETHER) 532 532 { 533 rc = g LibDlpiBind(pData->pDeviceHandle, DLPI_ANY_SAP, NULL);533 rc = g_pfnLibDlpiBind(pData->pDeviceHandle, DLPI_ANY_SAP, NULL); 534 534 if (rc == DLPI_SUCCESS) 535 535 { 536 rc = g LibDlpiSetPhysAddr(pData->pDeviceHandle, DL_CURR_PHYS_ADDR, &pData->MacAddress, ETHERADDRL);536 rc = g_pfnLibDlpiSetPhysAddr(pData->pDeviceHandle, DL_CURR_PHYS_ADDR, &pData->MacAddress, ETHERADDRL); 537 537 if (rc == DLPI_SUCCESS) 538 538 { 539 rc = g LibDlpiPromiscon(pData->pDeviceHandle, DL_PROMISC_SAP);539 rc = g_pfnLibDlpiPromiscon(pData->pDeviceHandle, DL_PROMISC_SAP); 540 540 if (rc == DLPI_SUCCESS) 541 541 { 542 542 /* Need to use DL_PROMIS_PHYS (not multicast) as we cannot be sure what the guest needs. */ 543 rc = g LibDlpiPromiscon(pData->pDeviceHandle, DL_PROMISC_PHYS);543 rc = g_pfnLibDlpiPromiscon(pData->pDeviceHandle, DL_PROMISC_PHYS); 544 544 if (rc == DLPI_SUCCESS) 545 545 { 546 pData->FileDevice = g LibDlpiFd(pData->pDeviceHandle);546 pData->FileDevice = g_pfnLibDlpiFd(pData->pDeviceHandle); 547 547 if (pData->FileDevice >= 0) 548 548 { … … 577 577 rc = PDMDrvHlpVMSetError(pData->pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, 578 578 N_("Failed to obtain VNIC info")); 579 g LibDlpiClose(pData->pDeviceHandle);579 g_pfnLibDlpiClose(pData->pDeviceHandle); 580 580 return rc; 581 581 } … … 977 977 */ 978 978 # ifdef VBOX_WITH_CROSSBOW 979 if (! gLibDlpiFound())979 if (!VBoxLibDlpiFound()) 980 980 { 981 981 return PDMDrvHlpVMSetError(pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, -
trunk/src/VBox/Devices/Network/solaris/vbox-libdlpi.cpp
r8601 r8960 39 39 40 40 /** All the symbols we need from libdlpi. 41 * @todo r=bird: rename to g_pfnLibDlpi*.42 41 * @{ 43 42 */ 44 int (*g LibDlpiOpen)(const char *, dlpi_handle_t *, uint_t);45 void (*g LibDlpiClose)(dlpi_handle_t);46 int (*g LibDlpiInfo)(dlpi_handle_t, dlpi_info_t *, uint_t);47 int (*g LibDlpiBind)(dlpi_handle_t, uint_t, uint_t *);48 int (*g LibDlpiSetPhysAddr)(dlpi_handle_t, uint_t, const void *, size_t);49 int (*g LibDlpiPromiscon)(dlpi_handle_t, uint_t);50 int (*g LibDlpiRecv)(dlpi_handle_t, void *, size_t *, void *, size_t *, int, dlpi_recvinfo_t *);51 int (*g LibDlpiFd)(dlpi_handle_t);43 int (*g_pfnLibDlpiOpen)(const char *, dlpi_handle_t *, uint_t); 44 void (*g_pfnLibDlpiClose)(dlpi_handle_t); 45 int (*g_pfnLibDlpiInfo)(dlpi_handle_t, dlpi_info_t *, uint_t); 46 int (*g_pfnLibDlpiBind)(dlpi_handle_t, uint_t, uint_t *); 47 int (*g_pfnLibDlpiSetPhysAddr)(dlpi_handle_t, uint_t, const void *, size_t); 48 int (*g_pfnLibDlpiPromiscon)(dlpi_handle_t, uint_t); 49 int (*g_pfnLibDlpiRecv)(dlpi_handle_t, void *, size_t *, void *, size_t *, int, dlpi_recvinfo_t *); 50 int (*g_pfnLibDlpiFd)(dlpi_handle_t); 52 51 /** @} */ 53 52 54 bool gLibDlpiFound(void)53 bool VBoxLibDlpiFound(void) 55 54 { 56 55 RTLDRMOD hLibDlpi; … … 62 61 if (!RT_SUCCESS(RTLdrLoad(LIB_DLPI, &hLibDlpi))) 63 62 return false; 64 if ( RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_open", (void **)&g LibDlpiOpen))65 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_close", (void **)&g LibDlpiClose))66 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_info", (void **)&g LibDlpiInfo))67 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_bind", (void **)&g LibDlpiBind))68 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_promiscon", (void **)&g LibDlpiPromiscon))69 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_set_physaddr", (void **)&g LibDlpiSetPhysAddr))70 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_recv", (void **)&g LibDlpiRecv))71 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_fd", (void **)&g LibDlpiFd))63 if ( RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_open", (void **)&g_pfnLibDlpiOpen)) 64 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_close", (void **)&g_pfnLibDlpiClose)) 65 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_info", (void **)&g_pfnLibDlpiInfo)) 66 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_bind", (void **)&g_pfnLibDlpiBind)) 67 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_promiscon", (void **)&g_pfnLibDlpiPromiscon)) 68 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_set_physaddr", (void **)&g_pfnLibDlpiSetPhysAddr)) 69 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_recv", (void **)&g_pfnLibDlpiRecv)) 70 && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_fd", (void **)&g_pfnLibDlpiFd)) 72 71 ) 73 72 { -
trunk/src/VBox/Devices/Network/solaris/vbox-libdlpi.h
r8571 r8960 26 26 #include <libdlpi.h> 27 27 28 extern int (*g LibDlpiOpen)(const char *, dlpi_handle_t *, uint_t);29 extern void (*g LibDlpiClose)(dlpi_handle_t);30 extern int (*g LibDlpiInfo)(dlpi_handle_t, dlpi_info_t *, uint_t);31 extern int (*g LibDlpiBind)(dlpi_handle_t, uint_t, uint_t *);32 extern int (*g LibDlpiSetPhysAddr)(dlpi_handle_t, uint_t, const void *, size_t);33 extern int (*g LibDlpiPromiscon)(dlpi_handle_t, uint_t);34 extern int (*g LibDlpiRecv)(dlpi_handle_t, void *, size_t *, void *, size_t *, int, dlpi_recvinfo_t *);35 extern int (*g LibDlpiFd)(dlpi_handle_t);28 extern int (*g_pfnLibDlpiOpen)(const char *, dlpi_handle_t *, uint_t); 29 extern void (*g_pfnLibDlpiClose)(dlpi_handle_t); 30 extern int (*g_pfnLibDlpiInfo)(dlpi_handle_t, dlpi_info_t *, uint_t); 31 extern int (*g_pfnLibDlpiBind)(dlpi_handle_t, uint_t, uint_t *); 32 extern int (*g_pfnLibDlpiSetPhysAddr)(dlpi_handle_t, uint_t, const void *, size_t); 33 extern int (*g_pfnLibDlpiPromiscon)(dlpi_handle_t, uint_t); 34 extern int (*g_pfnLibDlpiRecv)(dlpi_handle_t, void *, size_t *, void *, size_t *, int, dlpi_recvinfo_t *); 35 extern int (*g_pfnLibDlpiFd)(dlpi_handle_t); 36 36 37 extern bool gLibDlpiFound(void);37 extern bool VBoxLibDlpiFound(void); 38 38 39 39 #endif /* ____H_VBOX_LIBDLPI not defined */
Note:
See TracChangeset
for help on using the changeset viewer.