Changeset 15221 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Dec 10, 2008 3:12:28 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r15220 r15221 28 28 29 29 # define DO_POLL_EVENTS(rc, error, so, events, label) do {} while (0) 30 31 #define DO_CHECK_FD_SET(so, events, fdset) (FD_ISSET((so)->s, (fdset))) 30 32 31 33 # ifdef VBOX_WITH_SLIRP_ICMP … … 71 73 } 72 74 75 # define readfds_win FD_READ 76 # define readfds_win_bit FD_READ_BIT 77 78 # define writefds_win FD_WRITE 79 # define writefds_win_bit FD_WRITE_BIT 80 81 # define xfds_win FD_OOB 82 # define xfds_win_bit FD_OOB_BIT 83 84 # define DO_CHECK_FD_SET(so, events, fdset) \ 85 (((events).lNetworkEvents & fdset ## _win) && ((event).iErrorCode[fdset ## _win_bit] == 0)) 86 87 73 88 #endif /* defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */ 74 89 … … 87 102 #define POLL_UDP_EVENTS(rc, error, so, events) \ 88 103 DO_POLL_EVENTS((rc), (error), (so), (events), UDP) 104 105 #define CHECK_FD_SET(so, events, set) \ 106 (DO_CHECK_FD_SET((so), (events), set)) 89 107 90 108 static const uint8_t special_ethaddr[6] = … … 711 729 * test for readfds below if this succeeds 712 730 */ 713 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 714 if (FD_ISSET(so->s, xfds)) 715 #else 731 716 732 /* out-of-band data */ 717 if ((NetworkEvents.lNetworkEvents & FD_OOB) && NetworkEvents.iErrorCode[FD_OOB_BIT] == 0) 718 #endif 733 if (CHECK_FD_SET(so, NetworkEvents, xfds)) 719 734 { 720 735 sorecvoob(pData, so); … … 724 739 * Check sockets for reading 725 740 */ 726 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 727 else if (FD_ISSET(so->s, readfds)) 728 #else 729 else if ((NetworkEvents.lNetworkEvents & FD_READ) && (NetworkEvents.iErrorCode[FD_READ_BIT] == 0)) 730 #endif 741 else if (CHECK_FD_SET(so, NetworkEvents, readfds)) 731 742 { 732 743 /* … … 771 782 * Check sockets for writing 772 783 */ 773 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 774 if (FD_ISSET(so->s, writefds)) 775 #else 776 if ((NetworkEvents.lNetworkEvents & FD_WRITE) && (NetworkEvents.iErrorCode[FD_WRITE_BIT] == 0)) 777 #endif 784 if (CHECK_FD_SET(so, NetworkEvents, writefds)) 778 785 { 779 786 /* … … 884 891 POLL_UDP_EVENTS(rc, error, so, NetworkEvents); 885 892 886 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 887 if (so->s != -1 && FD_ISSET(so->s, readfds)) 888 #else 889 if (((NetworkEvents.lNetworkEvents & FD_READ) && (NetworkEvents.iErrorCode[FD_READ_BIT] == 0))) 890 #endif 893 if (so->s != -1 && CHECK_FD_SET(so, NetworkEvents, readfds)) 891 894 { 892 895 sorecvfrom(pData, so);
Note:
See TracChangeset
for help on using the changeset viewer.