Changeset 14391 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Nov 20, 2008 10:20:10 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r14282 r14391 582 582 Drivers_SOURCES += $(VBOX_SLIRP_SOURCES) 583 583 define def_vbox_slirp_cflags 584 ifeq ($(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC),1) 585 $(file)_DEFS = VBOX_WITH_SIMPLEFIED_SLIRP_SYNC 586 endif 584 $(file)_DEFS = VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 587 585 ifeq ($(KBUILD_TARGET),win) 588 586 $(file)_CFLAGS = -wd4018 -
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r14330 r14391 39 39 #include "Builtins.h" 40 40 41 #ifdef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC41 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 42 42 # ifndef RT_OS_WINDOWS 43 43 # include <unistd.h> … … 65 65 /** Pointer to the driver instance. */ 66 66 PPDMDRVINS pDrvIns; 67 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC67 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 68 68 /** Slirp critical section. */ 69 69 RTCRITSECT CritSect; … … 77 77 /** Boot file name to provide in the DHCP server response. */ 78 78 char *pszBootFile; 79 #ifdef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC79 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 80 80 /* polling thread */ 81 81 PPDMTHREAD pThread; … … 125 125 Log2(("drvNATSend: pvBuf=%p cb=%#x\n%.*Rhxd\n", pvBuf, cb, cb, pvBuf)); 126 126 127 #ifdef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC127 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 128 128 129 129 PRTREQ pReq = NULL; … … 159 159 RTReqFree(pReq); 160 160 161 #else /* !VBOX_WITH_SIMPL EFIED_SLIRP_SYNC */161 #else /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 162 162 163 163 int rc = RTCritSectEnter(&pThis->CritSect); … … 168 168 RTCritSectLeave(&pThis->CritSect); 169 169 170 #endif /* !VBOX_WITH_SIMPL EFIED_SLIRP_SYNC */170 #endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 171 171 172 172 LogFlow(("drvNATSend: end\n")); … … 230 230 LogFlow(("drvNATNotifyLinkChanged: enmLinkState=%d\n", enmLinkState)); 231 231 232 #ifdef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC232 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 233 233 234 234 PRTREQ pReq = NULL; … … 262 262 RTReqFree(pReq); 263 263 264 #else /* !VBOX_WITH_SIMPL EFIED_SLIRP_SYNC */264 #else /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 265 265 266 266 int rc = RTCritSectEnter(&pThis->CritSect); … … 269 269 RTCritSectLeave(&pThis->CritSect); 270 270 271 #endif /* VBOX_WITH_SIMPL EFIED_SLIRP_SYNC */272 } 273 274 275 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC271 #endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 272 } 273 274 275 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 276 276 277 277 /** … … 302 302 } 303 303 304 #else /* VBOX_WITH_SIMPL EFIED_SLIRP_SYNC */304 #else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 305 305 306 306 static DECLCALLBACK(int) drvNATAsyncIoThread(PPDMDRVINS pDrvIns, PPDMTHREAD pThread) … … 409 409 } 410 410 411 #endif /* VBOX_WITH_SIMPL EFIED_SLIRP_SYNC */411 #endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 412 412 413 413 … … 423 423 Assert(pThis); 424 424 425 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC425 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 426 426 /** Happens during termination */ 427 427 if (!RTCritSectIsOwner(&pThis->CritSect)) … … 446 446 Assert(pThis); 447 447 448 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC448 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 449 449 /** Happens during termination */ 450 450 if (!RTCritSectIsOwner(&pThis->CritSect)) … … 496 496 LogFlow(("drvNATDestruct:\n")); 497 497 498 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC498 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 499 499 int rc = RTCritSectEnter(&pThis->CritSect); 500 500 AssertReleaseRC(rc); … … 502 502 slirp_term(pThis->pNATState); 503 503 pThis->pNATState = NULL; 504 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC504 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 505 505 RTCritSectLeave(&pThis->CritSect); 506 506 RTCritSectDelete(&pThis->CritSect); … … 711 711 * The slirp lock.. 712 712 */ 713 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC713 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 714 714 rc = RTCritSectInit(&pThis->CritSect); 715 715 if (RT_FAILURE(rc)) … … 734 734 NULL, NULL, NULL, NULL, NULL, drvNATLoadDone); 735 735 AssertRC(rc2); 736 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC736 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 737 737 pDrvIns->pDrvHlp->pfnPDMPollerRegister(pDrvIns, drvNATPoller); 738 738 #else … … 779 779 } 780 780 781 #ifndef VBOX_WITH_SIMPL EFIED_SLIRP_SYNC781 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 782 782 RTCritSectDelete(&pThis->CritSect); 783 783 #endif -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r14329 r14391 50 50 int guest_port); 51 51 52 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)52 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 53 53 /** 54 54 * This event is for -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r14329 r14391 226 226 WSAStartup(MAKEWORD(2,0), &Data); 227 227 } 228 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)228 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 229 229 pData->phEvents[VBOX_SOCKET_EVENT_INDEX] = CreateEvent(NULL, FALSE, FALSE, NULL); 230 230 #endif … … 339 339 "\n")); 340 340 #endif 341 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)341 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 342 342 free(pData->phEvents); 343 343 #endif … … 382 382 int nfds; 383 383 int tmp_time; 384 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)384 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 385 385 int rc; 386 386 int error; … … 444 444 if (so->so_state & SS_FACCEPTCONN) { 445 445 STAM_REL_COUNTER_INC(&pData->StatTCPHot); 446 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)446 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 447 447 FD_SET(so->s, readfds); 448 448 UPD_NFDS(so->s); … … 464 464 if (so->so_state & SS_ISFCONNECTING) { 465 465 STAM_REL_COUNTER_INC(&pData->StatTCPHot); 466 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)466 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 467 467 FD_SET(so->s, writefds); 468 468 UPD_NFDS(so->s); … … 481 481 if (CONN_CANFSEND(so) && so->so_rcv.sb_cc) { 482 482 STAM_REL_COUNTER_INC(&pData->StatTCPHot); 483 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)483 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 484 484 FD_SET(so->s, writefds); 485 485 UPD_NFDS(so->s); … … 498 498 if (CONN_CANFRCV(so) && (so->so_snd.sb_cc < (so->so_snd.sb_datalen/2))) { 499 499 STAM_REL_COUNTER_INC(&pData->StatTCPHot); 500 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)500 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 501 501 FD_SET(so->s, readfds); 502 502 FD_SET(so->s, xfds); … … 509 509 #endif 510 510 } 511 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)511 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 512 512 rc = WSAEventSelect(so->s, NULL, 0); 513 513 if (rc == SOCKET_ERROR) … … 550 550 if ((so->so_state & SS_ISFCONNECTED) && so->so_queued <= 4) { 551 551 STAM_REL_COUNTER_INC(&pData->StatUDPHot); 552 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)552 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 553 553 FD_SET(so->s, readfds); 554 554 UPD_NFDS(so->s); … … 560 560 #endif 561 561 } 562 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)562 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 563 563 else 564 564 { … … 604 604 } 605 605 } 606 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)606 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 607 607 *pnfds = nfds; 608 608 #else … … 617 617 struct socket *so, *so_next; 618 618 int ret; 619 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)619 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 620 620 WSANETWORKEVENTS NetworkEvents; 621 621 int rc; … … 646 646 } 647 647 } 648 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)648 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 649 649 if (timer_update) return; 650 650 #endif … … 666 666 if (so->so_state & SS_NOFDREF || so->s == -1) 667 667 continue; 668 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)668 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 669 669 rc = WSAEnumNetworkEvents(so->s, VBOX_SOCKET_EVENT, &NetworkEvents); 670 670 if (rc == SOCKET_ERROR) … … 681 681 * test for readfds below if this succeeds 682 682 */ 683 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)683 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 684 684 if (FD_ISSET(so->s, xfds)) 685 685 #else … … 691 691 * Check sockets for reading 692 692 */ 693 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)693 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 694 694 else if (FD_ISSET(so->s, readfds)) { 695 695 #else … … 713 713 * Check sockets for writing 714 714 */ 715 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)715 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 716 716 if (FD_ISSET(so->s, writefds)) { 717 717 #else … … 807 807 so_next = so->so_next; 808 808 809 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)809 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 810 810 rc = WSAEnumNetworkEvents(so->s, VBOX_SOCKET_EVENT, &NetworkEvents); 811 811 if (rc == SOCKET_ERROR) … … 816 816 } 817 817 #endif 818 #if !defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)818 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 819 819 if (so->s != -1 && FD_ISSET(so->s, readfds)) { 820 820 #else … … 1002 1002 } 1003 1003 1004 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)1004 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 1005 1005 HANDLE *slirp_get_events(PNATState pData) 1006 1006 { -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r14285 r14391 130 130 struct socket udb; 131 131 struct socket *udp_last_so; 132 #if defined(VBOX_WITH_SIMPL EFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)132 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 133 133 # define VBOX_SOCKET_EVENT (pData->phEvents[VBOX_SOCKET_EVENT_INDEX]) 134 134 HANDLE phEvents[VBOX_EVENT_COUNT];
Note:
See TracChangeset
for help on using the changeset viewer.