Changeset 15672 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Dec 18, 2008 10:22:45 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r15636 r15672 42 42 #endif 43 43 44 #ifdef RT_OS_WINDOWS 45 # ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 46 # define ICMP_SEND_ECHO(event, routine, addr, data, datasize, ipopt) \ 47 IcmpSendEcho2(pData->icmp_socket.sh, (event), NULL, NULL, (addr), (data), (datasize), \ 48 (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.s, 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 #endif /* RT_OS_WINDOWS */ 44 56 45 57 /* The message sent when emulating PING */ … … 124 136 } 125 137 pData->icmp_socket.sh = IcmpCreateFile(); 138 # ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 126 139 pData->phEvents[VBOX_ICMP_EVENT_INDEX] = CreateEvent(NULL, FALSE, FALSE, NULL); 140 # endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 127 141 pData->szIcmpBuffer = sizeof(ICMP_ECHO_REPLY) * 10; 128 142 pData->pvIcmpBuffer = malloc(pData->szIcmpBuffer); … … 389 403 memset(&ipopt, 0, sizeof(IP_OPTION_INFORMATION)); 390 404 ipopt.Ttl = ip->ip_ttl; 391 status = IcmpSendEcho2(pData->icmp_socket.sh, pData->phEvents[VBOX_ICMP_EVENT_INDEX], 392 NULL, NULL, addr.sin_addr.s_addr, icp->icmp_data, 393 icmplen - offsetof(struct icmp, icmp_data) , &ipopt, 394 pData->pvIcmpBuffer, pData->szIcmpBuffer, 1); 405 status = ICMP_SEND_ECHO(pData->phEvents[VBOX_ICMP_EVENT_INDEX], notify_slirp, addr.sin_addr.s_addr, 406 icp->icmp_data, icmplen - ICMP_MINLEN, &ipopt); 395 407 if (status == 0 && (error = GetLastError()) != ERROR_IO_PENDING) 396 408 { … … 615 627 icmpstat.icps_reflect++; 616 628 } 629 #if defined(RT_OS_WINDOWS) && !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) 630 static void WINAPI 631 notify_slirp(void *ctx) 632 { 633 /* pData name is important see slirp_state.h */ 634 PNATState pData = (PNATState)ctx; 635 fIcmp = 1; 636 } 637 #endif -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r15636 r15672 706 706 { 707 707 #if defined(RT_OS_WINDOWS) 708 /*XXX: before renaming please make see define 709 * fIcmp in slirp_state.h 710 */ 708 711 if (fIcmp) 709 712 sorecvfrom(pData, &pData->icmp_socket); -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r15638 r15672 134 134 HANDLE phEvents[VBOX_EVENT_COUNT]; 135 135 #endif 136 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 137 int fIcmp; 138 #endif 136 139 STAMPROFILE StatFill; 137 140 STAMPROFILE StatPoll; … … 247 250 #define tcp_reass_overflows pData->tcp_reass_overflows 248 251 252 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 253 # define fIcmp pData->fIcmp 254 #endif 255 249 256 #endif /* !_slirp_state_h_ */ -
trunk/src/VBox/Devices/Network/slirp/socket.c
r15636 r15672 914 914 915 915 len = pData->pfIcmpParseReplies(pData->pvIcmpBuffer, pData->szIcmpBuffer); 916 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 917 fIcmp = 0; /* reply processed */ 918 #endif 916 919 if (len < 0) 917 920 {
Note:
See TracChangeset
for help on using the changeset viewer.