Changeset 15203 in vbox
- Timestamp:
- Dec 9, 2008 9:14:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r15201 r15203 14 14 15 15 # ifdef VBOX_WITH_SLIRP_ICMP 16 # define DO_ENGAGE_EVENT0(so, fdset, label) DO_ENGAGE_EVENT1((so), (fdset), label) 17 # else /* VBOX_WITH_SLIRP_ICMP */ 18 # define DO_ENGAGE_EVENT0(so, fdset, label) /* ignore */ 16 # define ICMP_ENGAGE_EVENT(so, fdset1, fdset2) \ 17 DO_ENGAGE_EVENT2((so), (fdset1), (fdset2), ICMP) 18 # else /* !VBOX_WITH_SLIRP_ICMP */ 19 # define ICMP_ENGAGE_EVENT(so, fdset1, fdset2) \ 20 /* no ICMP socket */ 19 21 #endif /* !VBOX_WITH_SLIRP_ICMP */ 20 22 21 # define DO_ENGAGE_EVENT1(so, fdset, label) \ 22 do { \ 23 FD_SET((so)->s, (fdset)); \ 24 UPD_NFDS((so)->s); \ 25 } while(0) 26 27 28 # define DO_ENGAGE_EVENT2(so, fdset0, fdset1, label) \ 23 # define DO_ENGAGE_EVENT1(so, fdset, label) \ 29 24 do { \ 30 FD_SET((so)->s, (fdset0)); \ 31 FD_SET((so)->s, (fdset1)); \ 25 FD_SET((so)->s, (fdset)); \ 32 26 UPD_NFDS((so)->s); \ 33 27 } while(0) 28 29 30 # define DO_ENGAGE_EVENT2(so, fdset1, fdset2, label) \ 31 do { \ 32 FD_SET((so)->s, (fdset1)); \ 33 FD_SET((so)->s, (fdset2)); \ 34 UPD_NFDS((so)->s); \ 35 } while(0) 36 34 37 #else /* defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */ 35 # define DO_ENGAGE_EVENT0(so, fdset, label) /* ignore */ 36 37 # define DO_ENGAGE_EVENT1(so, fdset0, label) \ 38 39 /* 40 * On Windows, we will be notified by IcmpSendEcho2() when the response arrives. 41 * So no call to WSAEventSelect necessary. 42 */ 43 # define ICMP_ENGAGE_EVENT(so, fdset1, fdset2) \ 44 /* ignore */ 45 46 # define DO_ENGAGE_EVENT1(so, fdset1, label) \ 38 47 do { \ 39 48 rc = WSAEventSelect((so)->s, VBOX_SOCKET_EVENT, FD_ALL_EVENTS); \ … … 47 56 } while(0) 48 57 49 # define DO_ENGAGE_EVENT2(so, fdset0, fdset1, label) DO_ENGAGE_EVENT1((so), (fdset0), label) 58 # define DO_ENGAGE_EVENT2(so, fdset1, fdset2, label) \ 59 O_ENGAGE_EVENT1((so), (fdset1), label) 60 50 61 #endif /* defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */ 51 62 52 # define TCP_ENGAGE_EVENT1(so, fdset0)\53 DO_ENGAGE_EVENT1((so), (fdset 0), TCP)54 55 # define TCP_ENGAGE_EVENT2(so, fdset0, fdset1)\56 DO_ENGAGE_EVENT2((so), (fdset 0), (fdset1), TCP)57 58 #define UDP_ENGAGE_EVENT(so, fdset) 63 #define TCP_ENGAGE_EVENT1(so, fdset) \ 64 DO_ENGAGE_EVENT1((so), (fdset), TCP) 65 66 #define TCP_ENGAGE_EVENT2(so, fdset1, fdset2) \ 67 DO_ENGAGE_EVENT2((so), (fdset1), (fdset2), TCP) 68 69 #define UDP_ENGAGE_EVENT(so, fdset) \ 59 70 DO_ENGAGE_EVENT1((so), (fdset), UDP) 60 61 #define ICMP_ENGAGE_EVENT(so, fdset) \62 DO_ENGAGE_EVENT0((so), (fdset), UDP)63 71 64 72 static const uint8_t special_ethaddr[6] = { … … 595 603 } 596 604 } 597 ICMP_ENGAGE_EVENT(&pData->icmp_socket, readfds); 598 ICMP_ENGAGE_EVENT(&pData->icmp_socket, writefds); 605 ICMP_ENGAGE_EVENT(&pData->icmp_socket, readfds, writefds); 599 606 } 600 607 … … 718 725 tcp_connect(pData, so); 719 726 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 720 if (! NetworkEvents.lNetworkEvents & FD_CLOSE)727 if (!(NetworkEvents.lNetworkEvents & FD_CLOSE)) 721 728 #endif 722 729 continue; … … 881 888 } 882 889 } 890 883 891 #if defined(VBOX_WITH_SLIRP_ICMP) 884 892 # if defined(RT_OS_WINDOWS)
Note:
See TracChangeset
for help on using the changeset viewer.