Changeset 18902 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Apr 15, 2009 12:14:23 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bootp.c
r18874 r18902 180 180 rbp = mtod(m, struct bootp_t *); 181 181 memset(rbp, 0, sizeof(struct bootp_t)); 182 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC183 m->m_data += sizeof(struct udpiphdr);184 #endif185 182 186 183 if (dhcp_msg_type == DHCPDISCOVER) … … 341 338 - sizeof(struct ip) 342 339 - sizeof(struct udphdr); 343 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC344 340 m->m_data += sizeof(struct udphdr) 345 + sizeof(struct ip); 346 #endif 341 + sizeof(struct ip); 347 342 /* Reply to the broadcast address, as some clients perform paranoid checks. */ 348 343 daddr.sin_addr.s_addr = INADDR_BROADCAST; -
trunk/src/VBox/Devices/Network/slirp/if.c
r16653 r18902 28 28 if_init(PNATState pData) 29 29 { 30 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC31 30 /* 14 for ethernet */ 32 if_maxlinkhdr = 14; 33 #else 34 /* 2 for alignment, 14 for ethernet, 40 for TCP/IP */ 35 if_maxlinkhdr = 2 + 14 + 40; 36 #endif 31 if_maxlinkhdr = 14; 37 32 if_queued = 0; 38 33 if_thresh = 10; … … 229 224 } 230 225 231 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC232 226 if_encap(pData, ETH_P_IP, ifm); 233 #else234 if_encap(pData, mtod(ifm, uint8_t *), ifm->m_len);235 m_free(pData, ifm);236 #endif237 227 238 228 if (!if_queued) -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r17222 r18902 43 43 44 44 #ifdef RT_OS_WINDOWS 45 # ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC46 45 # define ICMP_SEND_ECHO(event, routine, addr, data, datasize, ipopt) \ 47 46 IcmpSendEcho2(pData->icmp_socket.sh, (event), NULL, NULL, (addr), (data), (datasize), \ 48 47 (ipopt), pData->pvIcmpBuffer, pData->szIcmpBuffer, 1) 49 # else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */50 # define ICMP_SEND_ECHO(event, routine, addr, data, datasize, ipopt) \51 IcmpSendEcho2(pData->icmp_socket.sh, NULL, (FARPROC)(routine), (void *)pData, (addr), (data), (datasize), \52 (ipopt), pData->pvIcmpBuffer, pData->szIcmpBuffer, 1)53 static void WINAPI notify_slirp(void *);54 # endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */55 48 #endif /* RT_OS_WINDOWS */ 56 49 … … 152 145 } 153 146 pData->icmp_socket.sh = IcmpCreateFile(); 154 # ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC155 147 pData->phEvents[VBOX_ICMP_EVENT_INDEX] = CreateEvent(NULL, FALSE, FALSE, NULL); 156 # endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */157 148 pData->szIcmpBuffer = sizeof(ICMP_ECHO_REPLY) * 10; 158 149 pData->pvIcmpBuffer = RTMemAlloc(pData->szIcmpBuffer); … … 657 648 icmpstat.icps_reflect++; 658 649 } 659 #if defined(RT_OS_WINDOWS) && !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC)660 static void WINAPI661 notify_slirp(void *ctx)662 {663 /* pData name is important see slirp_state.h */664 PNATState pData = (PNATState)ctx;665 fIcmp = 1;666 }667 #endif -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r17436 r18902 34 34 void slirp_link_down(PNATState); 35 35 36 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) 37 # if defined(RT_OS_WINDOWS) 36 #if defined(RT_OS_WINDOWS) 38 37 void slirp_select_fill(PNATState pData, int *pndfs); 39 38 40 39 void slirp_select_poll(PNATState pData, int fTimeout, int fIcmp); 41 # 40 #else /* RT_OS_WINDOWS */ 42 41 void slirp_select_fill(PNATState pData, int *pnfds, struct pollfd *polls); 43 42 void slirp_select_poll(PNATState pData, struct pollfd *polls, int ndfs); 44 # endif /* !RT_OS_WINDOWS */ 45 #else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 46 void slirp_select_fill(PNATState pData, int *pnfds, 47 fd_set *readfds, fd_set *writefds, fd_set *xfds); 48 49 void slirp_select_poll(PNATState pData, int *pnfds, 50 fd_set *readfds, fd_set *writefds, fd_set *xfds); 51 #endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 43 #endif /* !RT_OS_WINDOWS */ 52 44 53 45 void slirp_input(PNATState pData, const uint8_t *pkt, int pkt_len); … … 56 48 /* you must provide the following functions: */ 57 49 int slirp_can_output(void * pvUser); 58 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC59 50 void slirp_output(void * pvUser, void *pvArg, const uint8_t *pkt, int pkt_len); 60 51 void slirp_post_sent(PNATState pData, void *pvArg); 61 #else62 void slirp_output(void * pvUser, const uint8_t *pkt, int pkt_len);63 #endif64 52 65 53 int slirp_redir(PNATState pData, int is_udp, int host_port, … … 74 62 void slirp_set_dhcp_dns_proxy(PNATState pData, bool fDNSProxy); 75 63 #endif 76 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 64 65 #if defined(RT_OS_WINDOWS) 77 66 78 67 … … 103 92 HANDLE *slirp_get_events(PNATState pData); 104 93 void slirp_register_external_event(PNATState pData, HANDLE hEvent, int index); 105 #endif 94 #endif /* RT_OS_WINDOWS */ 95 106 96 #ifdef VBOX_WITH_SLIRP_MT 107 97 void slirp_process_queue(PNATState pData); -
trunk/src/VBox/Devices/Network/slirp/main.h
r15890 r18902 10 10 #endif 11 11 12 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC13 12 void if_encap(PNATState pData, uint16_t eth_proto, struct mbuf *m); 14 #else15 void if_encap(PNATState pData, const uint8_t *ip_data, int ip_data_len);16 #endif -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r18874 r18902 19 19 #endif 20 20 21 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 22 23 # ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 24 # define DO_ENGAGE_EVENT1(so, fdset, label) \ 25 do { \ 26 FD_SET((so)->s, (fdset)); \ 27 UPD_NFDS((so)->s); \ 28 } while(0) 29 30 31 # define DO_ENGAGE_EVENT2(so, fdset1, fdset2, label) \ 32 do { \ 33 FD_SET((so)->s, (fdset1)); \ 34 FD_SET((so)->s, (fdset2)); \ 35 UPD_NFDS((so)->s); \ 36 } while(0) 37 38 # define DO_POLL_EVENTS(rc, error, so, events, label) do {} while (0) 39 40 # define DO_CHECK_FD_SET(so, events, fdset) (FD_ISSET((so)->s, fdset)) 41 # define DO_UNIX_CHECK_FD_SET(so, events, fdset ) 0 /*specific for Unix API */ 42 # else /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 21 #if !defined(RT_OS_WINDOWS) 22 43 23 # define DO_ENGAGE_EVENT1(so, fdset, label) \ 44 24 do { \ … … 82 62 # define DO_UNIX_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset) /*specific for Unix API */ 83 63 # define DO_WIN_CHECK_FD_SET(so, events, fdset ) 0 /* specific for Windows Winsock API */ 84 # endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */85 64 86 65 # ifndef RT_OS_WINDOWS … … 105 84 } while (0) 106 85 # else /* !RT_OS_WINDOWS */ 107 # ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 108 # define DO_WIN_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset) 109 # else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 110 # define DO_WIN_CHECK_FD_SET(so, events, fdset ) 0 111 # endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 86 # define DO_WIN_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset) 112 87 # define ICMP_ENGAGE_EVENT(so, fdset) do {} while(0) 113 88 #endif /* RT_OS_WINDOWS */ 114 89 115 #else /* defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */90 #else /* defined(RT_OS_WINDOWS) */ 116 91 117 92 /* … … 164 139 # define DO_UNIX_CHECK_FD_SET(so, events, fdset ) 1 /*specific for Unix API */ 165 140 166 #endif /* defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */141 #endif /* defined(RT_OS_WINDOWS) */ 167 142 168 143 #define TCP_ENGAGE_EVENT1(so, fdset) \ … … 193 168 */ 194 169 #if VBOX_WITH_DEBUG_NAT_SOCKETS 195 # if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) 196 # if defined(RT_OS_WINDOWS) 197 # define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) \ 198 do { \ 199 LogRel((" " #proto " %R[natsock] %R[natwinnetevents]\n", (so), (winevent))); \ 200 } while (0) 201 # else /* RT_OS_WINDOWS */ 202 # define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) \ 203 do { \ 204 LogRel((" " #proto " %R[natsock] %s %s %s er: %s, %s, %s\n", (so), \ 205 CHECK_FD_SET(so, ign ,r_fdset) ? "READ":"", \ 206 CHECK_FD_SET(so, ign, w_fdset) ? "WRITE":"", \ 207 CHECK_FD_SET(so, ign, x_fdset) ? "OOB":"", \ 208 CHECK_FD_SET(so, ign, rderr) ? "RDERR":"", \ 209 CHECK_FD_SET(so, ign, rdhup) ? "RDHUP":"", \ 210 CHECK_FD_SET(so, ign, nval) ? "RDNVAL":"")); \ 211 } while (0) 212 # endif /* !RT_OS_WINDOWS */ 213 # else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 214 # define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) \ 215 do { \ 216 LogRel((" " #proto " %R[natsock] %s %s %s\n", (so), \ 217 FD_ISSET((so)->s, (r_fdset))?"READ":"", \ 218 FD_ISSET((so)->s, (w_fdset))?"WRITE":"", \ 219 FD_ISSET((so)->s, (x_fdset))?"OOB":"")); \ 220 } while (0) 221 # endif 170 # if defined(RT_OS_WINDOWS) 171 # define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) \ 172 do { \ 173 LogRel((" " #proto " %R[natsock] %R[natwinnetevents]\n", (so), (winevent))); \ 174 } while (0) 175 # else /* RT_OS_WINDOWS */ 176 # define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) \ 177 do { \ 178 LogRel((" " #proto " %R[natsock] %s %s %s er: %s, %s, %s\n", (so), \ 179 CHECK_FD_SET(so, ign ,r_fdset) ? "READ":"", \ 180 CHECK_FD_SET(so, ign, w_fdset) ? "WRITE":"", \ 181 CHECK_FD_SET(so, ign, x_fdset) ? "OOB":"", \ 182 CHECK_FD_SET(so, ign, rderr) ? "RDERR":"", \ 183 CHECK_FD_SET(so, ign, rdhup) ? "RDHUP":"", \ 184 CHECK_FD_SET(so, ign, nval) ? "RDNVAL":"")); \ 185 } while (0) 186 # endif /* !RT_OS_WINDOWS */ 222 187 #else /* VBOX_WITH_DEBUG_NAT_SOCKETS */ 223 188 # define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) do {} while (0) … … 643 608 WSAStartup(MAKEWORD(2, 0), &Data); 644 609 } 645 # if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC)646 610 pData->phEvents[VBOX_SOCKET_EVENT_INDEX] = CreateEvent(NULL, FALSE, FALSE, NULL); 647 # endif648 611 #endif 649 612 #ifdef VBOX_WITH_SLIRP_MT … … 810 773 } 811 774 812 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 813 void slirp_select_fill(PNATState pData, int *pnfds, 814 fd_set *readfds, fd_set *writefds, fd_set *xfds) 815 #else /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 816 # ifdef RT_OS_WINDOWS 775 #ifdef RT_OS_WINDOWS 817 776 void slirp_select_fill(PNATState pData, int *pnfds) 818 # 777 #else /* RT_OS_WINDOWS */ 819 778 void slirp_select_fill(PNATState pData, int *pnfds, struct pollfd *polls) 820 # endif /* !RT_OS_WINDOWS */ 821 #endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 779 #endif /* !RT_OS_WINDOWS */ 822 780 { 823 781 struct socket *so, *so_next; 824 782 int nfds; 825 #if defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)783 #if defined(RT_OS_WINDOWS) 826 784 int rc; 827 785 int error; 828 #endif 829 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && !defined(RT_OS_WINDOWS) 786 #else 830 787 int poll_index = 0; 831 788 #endif … … 868 825 QSOCKET_FOREACH(so, so_next, tcp) 869 826 /* { */ 870 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) &&!defined(RT_OS_WINDOWS)827 #if !defined(RT_OS_WINDOWS) 871 828 so->so_poll_index = -1; 872 829 #endif … … 940 897 941 898 STAM_COUNTER_INC(&pData->StatUDP); 942 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) &&!defined(RT_OS_WINDOWS)899 #if !defined(RT_OS_WINDOWS) 943 900 so->so_poll_index = -1; 944 901 #endif … … 989 946 } 990 947 991 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) 992 # if defined(RT_OS_WINDOWS) 948 #if defined(RT_OS_WINDOWS) 993 949 *pnfds = VBOX_EVENT_COUNT; 994 # 950 #else /* RT_OS_WINDOWS */ 995 951 AssertRelease(poll_index <= *pnfds); 996 952 *pnfds = poll_index; 997 # endif /* !RT_OS_WINDOWS */ 998 #else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 999 *pnfds = nfds; 1000 #endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 953 #endif /* !RT_OS_WINDOWS */ 1001 954 1002 955 STAM_PROFILE_STOP(&pData->StatFill, a); 1003 956 } 1004 957 1005 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) 1006 # if defined(RT_OS_WINDOWS) 958 #if defined(RT_OS_WINDOWS) 1007 959 void slirp_select_poll(PNATState pData, int fTimeout, int fIcmp) 1008 # 960 #else /* RT_OS_WINDOWS */ 1009 961 void slirp_select_poll(PNATState pData, struct pollfd *polls, int ndfs) 1010 # endif /* !RT_OS_WINDOWS */ 1011 #else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 1012 void slirp_select_poll(PNATState pData, fd_set *readfds, fd_set *writefds, fd_set *xfds) 1013 #endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 962 #endif /* !RT_OS_WINDOWS */ 1014 963 { 1015 964 struct socket *so, *so_next; 1016 965 int ret; 1017 #if defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)966 #if defined(RT_OS_WINDOWS) 1018 967 WSANETWORKEVENTS NetworkEvents; 1019 968 int rc; 1020 969 int error; 1021 #endif 1022 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && !defined(RT_OS_WINDOWS) 970 #else 1023 971 int poll_index = 0; 1024 972 #endif … … 1050 998 } 1051 999 } 1052 #if defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)1000 #if defined(RT_OS_WINDOWS) 1053 1001 if (fTimeout) 1054 1002 return; /* only timer update */ … … 1143 1091 { 1144 1092 TCP_CONNECT(pData, so); 1145 #if defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)1093 #if defined(RT_OS_WINDOWS) 1146 1094 if (!(NetworkEvents.lNetworkEvents & FD_CLOSE)) 1147 1095 #endif … … 1155 1103 } 1156 1104 1157 #if defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)1105 #if defined(RT_OS_WINDOWS) 1158 1106 /* 1159 1107 * Check for FD_CLOSE events. … … 1450 1398 AssertCompileSize(struct arphdr, 28); 1451 1399 1452 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1453 1400 static void arp_input(PNATState pData, struct mbuf *m) 1454 #else1455 static void arp_input(PNATState pData, const uint8_t *pkt, int pkt_len)1456 #endif1457 1401 { 1458 1402 struct ethhdr *eh; … … 1463 1407 struct ex_list *ex_ptr; 1464 1408 uint32_t htip; 1465 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1466 uint8_t arp_reply[sizeof(struct arphdr) + ETH_HLEN];1467 eh = (struct ethhdr *)pkt;1468 #else1469 1409 struct mbuf *mr; 1470 1410 eh = mtod(m, struct ethhdr *); 1471 #endif1472 1411 ah = (struct arphdr *)&eh[1]; 1473 1412 htip = ntohl(*(uint32_t*)ah->ar_tip); 1474 1413 1475 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1476 1414 mr = m_get(pData); 1477 1415 mr->m_data += if_maxlinkhdr; 1478 1416 mr->m_len = sizeof(struct arphdr); 1479 1417 rah = mtod(mr, struct arphdr *); 1480 #else1481 reh = (struct ethhdr *)arp_reply;1482 rah = (struct arphdr *)&reh[1];1483 #endif1484 1418 1485 1419 ar_op = ntohs(ah->ar_op); … … 1500 1434 return; 1501 1435 arp_ok: 1502 1503 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1504 memcpy(reh->h_dest, eh->h_source, ETH_ALEN);1505 memcpy(reh->h_source, &special_addr, ETH_ALEN);1506 reh->h_source[5] = ah->ar_tip[3];1507 reh->h_proto = htons(ETH_P_ARP);1508 #endif1509 1436 rah->ar_hrd = htons(1); 1510 1437 rah->ar_pro = htons(ETH_P_IP); … … 1526 1453 memcpy(rah->ar_tha, ah->ar_sha, ETH_ALEN); 1527 1454 memcpy(rah->ar_tip, ah->ar_sip, 4); 1528 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1529 1455 if_encap(pData, ETH_P_ARP, mr); 1530 1456 m_free(pData, m); 1531 #else1532 slirp_output(pData->pvUser, arp_reply, sizeof(arp_reply));1533 #endif1534 1457 } 1535 1458 break; … … 1570 1493 { 1571 1494 case ETH_P_ARP: 1572 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1573 1495 arp_input(pData, m); 1574 #else1575 arp_input(pData, pkt, pkt_len);1576 m_free(pData, m);1577 #endif1578 1496 break; 1579 1497 case ETH_P_IP: … … 1602 1520 1603 1521 /* output the IP packet to the ethernet device */ 1604 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1605 1522 void if_encap(PNATState pData, uint16_t eth_proto, struct mbuf *m) 1606 #else 1607 void if_encap(PNATState pData, uint8_t *ip_data, int ip_data_len) 1608 #endif 1609 { 1610 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 1523 { 1611 1524 struct ethhdr *eh; 1612 1525 uint8_t *buf = RTMemAlloc(1600); 1526 1613 1527 m->m_data -= if_maxlinkhdr; 1614 1528 m->m_len += ETH_HLEN; 1615 1529 eh = mtod(m, struct ethhdr *); 1616 #else1617 uint8_t buf[1600];1618 struct ethhdr *eh = (struct ethhdr *)buf;1619 1620 if (ip_data_len + ETH_HLEN > sizeof(buf))1621 return;1622 1623 memcpy(buf + sizeof(struct ethhdr), ip_data, ip_data_len);1624 #endif1625 1626 1530 1627 1531 memcpy(eh->h_dest, client_ethaddr, ETH_ALEN); … … 1629 1533 /* XXX: not correct */ 1630 1534 eh->h_source[5] = CTL_ALIAS; 1631 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1632 1535 eh->h_proto = htons(eth_proto); 1633 1536 #if 0 … … 1638 1541 m_free(pData, m); 1639 1542 #endif 1640 #else1641 eh->h_proto = htons(ETH_P_IP);1642 slirp_output(pData->pvUser, buf, ip_data_len + ETH_HLEN);1643 #endif1644 1543 } 1645 1544 … … 1675 1574 } 1676 1575 1677 #if defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)1576 #if defined(RT_OS_WINDOWS) 1678 1577 HANDLE *slirp_get_events(PNATState pData) 1679 1578 { -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r18584 r18902 183 183 HMODULE hmIcmpLibrary; 184 184 # endif 185 #if defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)185 #if defined(RT_OS_WINDOWS) 186 186 # define VBOX_SOCKET_EVENT (pData->phEvents[VBOX_SOCKET_EVENT_INDEX]) 187 187 HANDLE phEvents[VBOX_EVENT_COUNT]; 188 #endif189 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)190 int fIcmp;191 188 #endif 192 189 #ifdef VBOX_WITH_SLIRP_DNS_PROXY … … 334 331 #define tcp_reass_maxseg pData->tcp_reass_maxseg 335 332 #define tcp_reass_overflows pData->tcp_reass_overflows 336 337 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)338 # define fIcmp pData->fIcmp339 #endif340 333 341 334 #define queue_tcp_label tcb -
trunk/src/VBox/Devices/Network/slirp/socket.c
r17363 r18902 65 65 so->so_state = SS_NOFDREF; 66 66 so->s = -1; 67 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) &&!defined(RT_OS_WINDOWS)67 #if !defined(RT_OS_WINDOWS) 68 68 so->so_poll_index = -1; 69 69 #endif … … 198 198 if (nn <= 0) 199 199 { 200 #if defined( VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)200 #if defined(RT_OS_WINDOWS) 201 201 /* 202 202 * Special case for WSAEnumNetworkEvents: If we receive 0 bytes that … … 513 513 } 514 514 m->m_data += if_maxlinkhdr; 515 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC516 515 m->m_data += sizeof(struct udphdr) 517 + sizeof(struct ip); /*XXX: no options atm*/ 518 #endif 516 + sizeof(struct ip); /*XXX: no options atm*/ 519 517 520 518 /* … … 1002 1000 1003 1001 len = pData->pfIcmpParseReplies(pData->pvIcmpBuffer, pData->szIcmpBuffer); 1004 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC1005 fIcmp = 0; /* reply processed */1006 #endif1007 1002 if (len < 0) 1008 1003 { -
trunk/src/VBox/Devices/Network/slirp/socket.h
r17363 r18902 71 71 int so_deleted; 72 72 #endif 73 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 74 # ifndef RT_OS_WINDOWS 73 #ifndef RT_OS_WINDOWS 75 74 int so_poll_index; 76 # 75 #else /* !RT_OS_WINDOWS */ 77 76 /* 78 77 * FD_CLOSE event has been occured on socket 79 78 */ 80 79 int so_close; 81 # endif /* RT_OS_WINDOWS */ 82 #endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 80 #endif /* RT_OS_WINDOWS */ 83 81 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 84 82 void (* so_timeout)(PNATState pData, struct socket *so, void *arg); -
trunk/src/VBox/Devices/Network/slirp/tcp_output.c
r15890 r18902 428 428 } 429 429 m->m_data += if_maxlinkhdr; 430 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC431 430 m->m_data += sizeof(struct ip) 432 + sizeof(struct tcphdr); 433 #endif 431 + sizeof(struct tcphdr); 434 432 m->m_len = hdrlen; 435 433 }
Note:
See TracChangeset
for help on using the changeset viewer.