Changeset 15201 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Dec 9, 2008 8:35:15 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r15194 r15201 85 85 return 1; 86 86 } 87 insque(pData, &pData->icmp_socket, &udb);88 87 #else /* RT_OS_WINDOWS */ 89 88 pData->hmIcmpLibrary = LoadLibrary("Iphlpapi.dll"); … … 92 91 pData->pfIcmpParseReplies = (long (WINAPI *)(void *, long)) 93 92 GetProcAddress(pData->hmIcmpLibrary, "IcmpParseReplies"); 94 pData->pfIcmpCloseHandle = (BOOL (WINAPI *)(HANDLE)) 93 pData->pfIcmpCloseHandle = (BOOL (WINAPI *)(HANDLE)) 95 94 GetProcAddress(pData->hmIcmpLibrary, "IcmpCloseHandle"); 96 95 } … … 106 105 pData->pfIcmpParseReplies = (long (WINAPI *)(void *, long)) 107 106 GetProcAddress(pData->hmIcmpLibrary, "IcmpParseReplies"); 108 pData->pfIcmpCloseHandle = (BOOL (WINAPI *)(HANDLE)) 107 pData->pfIcmpCloseHandle = (BOOL (WINAPI *)(HANDLE)) 109 108 GetProcAddress(pData->hmIcmpLibrary, "IcmpCloseHandle"); 110 109 } … … 114 113 FreeLibrary(pData->hmIcmpLibrary); 115 114 return 1; 116 } 115 } 117 116 if (pData->pfIcmpCloseHandle == NULL) 118 117 { … … 301 300 } 302 301 #else /* VBOX_WITH_SLIRP_ICMP */ 303 # ifdef RT_OS_WINDOWS 302 # ifdef RT_OS_WINDOWS 304 303 IP_OPTION_INFORMATION ipopt; 305 304 int error; … … 345 344 ipopt.Ttl = ip->ip_ttl; 346 345 status = IcmpSendEcho2(pData->icmp_socket.sh, pData->phEvents[VBOX_ICMP_EVENT_INDEX], 347 NULL, NULL, addr.sin_addr.s_addr, icp->icmp_data, 346 NULL, NULL, addr.sin_addr.s_addr, icp->icmp_data, 348 347 icmplen - offsetof(struct icmp, icmp_data) , &ipopt, 349 348 pData->pvIcmpBuffer, pData->szIcmpBuffer, 0); 350 349 if (status == 0 && (error = GetLastError()) != ERROR_IO_PENDING) 351 350 { 352 error = GetLastError(); 351 error = GetLastError(); 353 352 LogRel(("NAT: Error (%d) occurred while sending ICMP (", error)); 354 switch (error) 353 switch (error) 355 354 { 356 355 case ERROR_INVALID_PARAMETER: -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r15194 r15201 12 12 13 13 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 14 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 */ 19 #endif /* !VBOX_WITH_SLIRP_ICMP */ 20 14 21 # define DO_ENGAGE_EVENT1(so, fdset, label) \ 15 22 do { \ … … 26 33 } while(0) 27 34 #else /* defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */ 35 # define DO_ENGAGE_EVENT0(so, fdset, label) /* ignore */ 36 28 37 # define DO_ENGAGE_EVENT1(so, fdset0, label) \ 29 38 do { \ … … 49 58 #define UDP_ENGAGE_EVENT(so, fdset) \ 50 59 DO_ENGAGE_EVENT1((so), (fdset), UDP) 60 61 #define ICMP_ENGAGE_EVENT(so, fdset) \ 62 DO_ENGAGE_EVENT0((so), (fdset), UDP) 51 63 52 64 static const uint8_t special_ethaddr[6] = { … … 583 595 } 584 596 } 597 ICMP_ENGAGE_EVENT(&pData->icmp_socket, readfds); 598 ICMP_ENGAGE_EVENT(&pData->icmp_socket, writefds); 585 599 } 586 600 … … 867 881 } 868 882 } 869 #if defined(VBOX_WITH_SLIRP_ICMP) && defined(RT_OS_WINDOWS) 883 #if defined(VBOX_WITH_SLIRP_ICMP) 884 # if defined(RT_OS_WINDOWS) 870 885 sorecvfrom(pData, &pData->icmp_socket); 871 #endif 886 # else 887 if (so->s != -1 && FD_ISSET(so->s, readfds)) 888 { 889 sorecvfrom(pData, &pData->icmp_socket); 890 } 891 # endif 892 #endif 872 893 } 873 894
Note:
See TracChangeset
for help on using the changeset viewer.