iphlpapi: Add missing header to configure test.

This lets GetIcmpStatistics() work again on FreeBSD.

Signed-off-by: Charles Davis <cdavis5x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Charles Davis 2017-02-12 02:01:51 -08:00 committed by Alexandre Julliard
parent 9b90266cfb
commit 99d247ad5a
3 changed files with 9 additions and 1 deletions

3
configure vendored
View File

@ -16768,6 +16768,9 @@ fi
ac_fn_c_check_member "$LINENO" "struct icmpstat" "icps_inhist" "ac_cv_member_struct_icmpstat_icps_inhist" "#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif

View File

@ -2380,6 +2380,9 @@ AC_CHECK_MEMBERS([struct icmpstat.icps_inhist],,,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif

View File

@ -510,7 +510,7 @@ DWORD WINAPI GetIcmpStatistics(PMIB_ICMP stats)
}
if (kc) kstat_close( kc );
}
#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS) && defined(HAVE_STRUCT_ICMPSTAT_ICPS_INHIST)
#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS) && (defined(HAVE_STRUCT_ICMPSTAT_ICPS_INHIST) || defined(HAVE_STRUCT_ICMPSTAT_ICPS_OUTHIST))
{
int mib[] = {CTL_NET, PF_INET, IPPROTO_ICMP, ICMPCTL_STATS};
#define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
@ -520,6 +520,7 @@ DWORD WINAPI GetIcmpStatistics(PMIB_ICMP stats)
if(sysctl(mib, MIB_LEN, &icmp_stat, &needed, NULL, 0) != -1)
{
#ifdef HAVE_STRUCT_ICMPSTAT_ICPS_INHIST
/*in stats */
stats->stats.icmpInStats.dwMsgs = icmp_stat.icps_badcode + icmp_stat.icps_checksum + icmp_stat.icps_tooshort + icmp_stat.icps_badlen;
for(i = 0; i <= ICMP_MAXTYPE; i++)
@ -538,6 +539,7 @@ DWORD WINAPI GetIcmpStatistics(PMIB_ICMP stats)
stats->stats.icmpInStats.dwTimestampReps = icmp_stat.icps_inhist[ICMP_TSTAMPREPLY];
stats->stats.icmpInStats.dwAddrMasks = icmp_stat.icps_inhist[ICMP_MASKREQ];
stats->stats.icmpInStats.dwAddrMaskReps = icmp_stat.icps_inhist[ICMP_MASKREPLY];
#endif
#ifdef HAVE_STRUCT_ICMPSTAT_ICPS_OUTHIST
/* out stats */