Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
020b0ef6
Commit
020b0ef6
authored
16 years ago
by
EA Durbin
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
iphlpapi: Implement getICMPStats on FreeBSD.
parent
9d4c42a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+12
-1
12 additions, 1 deletion
configure
configure.ac
+9
-1
9 additions, 1 deletion
configure.ac
dlls/iphlpapi/ipstats.c
+69
-0
69 additions, 0 deletions
dlls/iphlpapi/ipstats.c
include/config.h.in
+9
-0
9 additions, 0 deletions
include/config.h.in
with
99 additions
and
2 deletions
configure
+
12
−
1
View file @
020b0ef6
...
...
@@ -7083,6 +7083,8 @@ done
...
...
@@ -7092,6 +7094,7 @@ for ac_header in \
CoreAudio/CoreAudio.h \
DiskArbitration/DiskArbitration.h \
IOKit/IOKitLib.h \
alias.h \
alsa/asoundlib.h \
arpa/inet.h \
arpa/nameser.h \
...
...
@@ -7135,6 +7138,7 @@ for ac_header in \
netdb.h \
netinet/in.h \
netinet/in_systm.h \
netinet/ip_icmp.h \
netinet/tcp.h \
netinet/tcp_fsm.h \
netinet/udp.h \
...
...
@@ -7554,7 +7558,8 @@ done
for ac_header in netinet/tcp_var.h netinet/udp_var.h
for ac_header in netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
...
...
@@ -7569,6 +7574,9 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#ifdef HAVE_ALIAS_H
# include <alias.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
...
...
@@ -7581,6 +7589,9 @@ cat >>conftest.$ac_ext <<_ACEOF
#ifdef HAVE_NETINET_IP_VAR_H
# include <netinet/ip_var.h>
#endif
#ifdef HAVE_NETINET_IP_ICMP_H
# include <netinet/ip_icmp.h>
#endif
#ifdef HAVE_NETINET_UDP_H
# include <netinet/udp.h>
#endif
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
9
−
1
View file @
020b0ef6
...
...
@@ -231,6 +231,7 @@ AC_CHECK_HEADERS(\
CoreAudio/CoreAudio.h \
DiskArbitration/DiskArbitration.h \
IOKit/IOKitLib.h \
alias.h \
alsa/asoundlib.h \
arpa/inet.h \
arpa/nameser.h \
...
...
@@ -274,6 +275,7 @@ AC_CHECK_HEADERS(\
netdb.h \
netinet/in.h \
netinet/in_systm.h \
netinet/ip_icmp.h \
netinet/tcp.h \
netinet/tcp_fsm.h \
netinet/udp.h \
...
...
@@ -360,8 +362,11 @@ AC_CHECK_HEADERS([netinet/in_pcb.h netinet/ip_var.h net/if.h net/if_arp.h net/if
# include <netinet/in.h>
#endif])
AC_CHECK_HEADERS([netinet/tcp_var.h netinet/udp_var.h],,,
AC_CHECK_HEADERS([netinet/tcp_var.h netinet/udp_var.h
netinet/icmp_var.h
],,,
[#include <sys/types.h>
#ifdef HAVE_ALIAS_H
# include <alias.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
...
...
@@ -374,6 +379,9 @@ AC_CHECK_HEADERS([netinet/tcp_var.h netinet/udp_var.h],,,
#ifdef HAVE_NETINET_IP_VAR_H
# include <netinet/ip_var.h>
#endif
#ifdef HAVE_NETINET_IP_ICMP_H
# include <netinet/ip_icmp.h>
#endif
#ifdef HAVE_NETINET_UDP_H
# include <netinet/udp.h>
#endif
...
...
This diff is collapsed.
Click to expand it.
dlls/iphlpapi/ipstats.c
+
69
−
0
View file @
020b0ef6
...
...
@@ -28,6 +28,9 @@
#include
<stdlib.h>
#include
<string.h>
#include
<sys/types.h>
#ifdef HAVE_ALIAS_H
#include
<alias.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include
<sys/socket.h>
#endif
...
...
@@ -65,6 +68,12 @@
#ifdef HAVE_NETINET_TCP_VAR_H
#include
<netinet/tcp_var.h>
#endif
#ifdef HAVE_NETINET_IP_ICMP_H
#include
<netinet/ip_icmp.h>
#endif
#ifdef HAVE_NETINET_ICMP_VAR_H
#include
<netinet/icmp_var.h>
#endif
#ifdef HAVE_NETINET_IP_VAR_H
#include
<netinet/ip_var.h>
#endif
...
...
@@ -247,6 +256,65 @@ DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)
DWORD
getICMPStats
(
MIB_ICMP
*
stats
)
{
#if defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS)
int
mib
[]
=
{
CTL_NET
,
PF_INET
,
IPPROTO_ICMP
,
ICMPCTL_STATS
};
#define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
size_t
needed
;
struct
icmpstat
icmp_stat
;
int
i
;
if
(
!
stats
)
return
ERROR_INVALID_PARAMETER
;
needed
=
sizeof
(
icmp_stat
);
if
(
sysctl
(
mib
,
MIB_LEN
,
&
icmp_stat
,
&
needed
,
NULL
,
0
)
==
-
1
)
{
ERR
(
"failed to get icmpstat
\n
"
);
return
ERROR_NOT_SUPPORTED
;
}
/*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
++
)
stats
->
stats
.
icmpInStats
.
dwMsgs
+=
icmp_stat
.
icps_inhist
[
i
];
stats
->
stats
.
icmpInStats
.
dwErrors
=
icmp_stat
.
icps_badcode
+
icmp_stat
.
icps_tooshort
+
icmp_stat
.
icps_checksum
+
icmp_stat
.
icps_badlen
;
stats
->
stats
.
icmpInStats
.
dwDestUnreachs
=
icmp_stat
.
icps_inhist
[
ICMP_UNREACH
];
stats
->
stats
.
icmpInStats
.
dwTimeExcds
=
icmp_stat
.
icps_inhist
[
ICMP_TIMXCEED
];
stats
->
stats
.
icmpInStats
.
dwParmProbs
=
icmp_stat
.
icps_inhist
[
ICMP_PARAMPROB
];
stats
->
stats
.
icmpInStats
.
dwSrcQuenchs
=
icmp_stat
.
icps_inhist
[
ICMP_SOURCEQUENCH
];
stats
->
stats
.
icmpInStats
.
dwRedirects
=
icmp_stat
.
icps_inhist
[
ICMP_REDIRECT
];
stats
->
stats
.
icmpInStats
.
dwEchos
=
icmp_stat
.
icps_inhist
[
ICMP_ECHO
];
stats
->
stats
.
icmpInStats
.
dwEchoReps
=
icmp_stat
.
icps_inhist
[
ICMP_ECHOREPLY
];
stats
->
stats
.
icmpInStats
.
dwTimestamps
=
icmp_stat
.
icps_inhist
[
ICMP_TSTAMP
];
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
];
/* out stats */
stats
->
stats
.
icmpOutStats
.
dwMsgs
=
icmp_stat
.
icps_oldshort
+
icmp_stat
.
icps_oldicmp
;
for
(
i
=
0
;
i
<=
ICMP_MAXTYPE
;
i
++
)
stats
->
stats
.
icmpOutStats
.
dwMsgs
+=
icmp_stat
.
icps_outhist
[
i
];
stats
->
stats
.
icmpOutStats
.
dwErrors
=
icmp_stat
.
icps_oldshort
+
icmp_stat
.
icps_oldicmp
;
stats
->
stats
.
icmpOutStats
.
dwDestUnreachs
=
icmp_stat
.
icps_outhist
[
ICMP_UNREACH
];
stats
->
stats
.
icmpOutStats
.
dwTimeExcds
=
icmp_stat
.
icps_outhist
[
ICMP_TIMXCEED
];
stats
->
stats
.
icmpOutStats
.
dwParmProbs
=
icmp_stat
.
icps_outhist
[
ICMP_PARAMPROB
];
stats
->
stats
.
icmpOutStats
.
dwSrcQuenchs
=
icmp_stat
.
icps_outhist
[
ICMP_SOURCEQUENCH
];
stats
->
stats
.
icmpOutStats
.
dwRedirects
=
icmp_stat
.
icps_outhist
[
ICMP_REDIRECT
];
stats
->
stats
.
icmpOutStats
.
dwEchos
=
icmp_stat
.
icps_outhist
[
ICMP_ECHO
];
stats
->
stats
.
icmpOutStats
.
dwEchoReps
=
icmp_stat
.
icps_outhist
[
ICMP_ECHOREPLY
];
stats
->
stats
.
icmpOutStats
.
dwTimestamps
=
icmp_stat
.
icps_outhist
[
ICMP_TSTAMP
];
stats
->
stats
.
icmpOutStats
.
dwTimestampReps
=
icmp_stat
.
icps_outhist
[
ICMP_TSTAMPREPLY
];
stats
->
stats
.
icmpOutStats
.
dwAddrMasks
=
icmp_stat
.
icps_outhist
[
ICMP_MASKREQ
];
stats
->
stats
.
icmpOutStats
.
dwAddrMaskReps
=
icmp_stat
.
icps_outhist
[
ICMP_MASKREPLY
];
return
NO_ERROR
;
#else
FILE
*
fp
;
if
(
!
stats
)
...
...
@@ -376,6 +444,7 @@ DWORD getICMPStats(MIB_ICMP *stats)
}
return
NO_ERROR
;
#endif
}
DWORD
getIPStats
(
PMIB_IPSTATS
stats
)
...
...
This diff is collapsed.
Click to expand it.
include/config.h.in
+
9
−
0
View file @
020b0ef6
...
...
@@ -5,6 +5,9 @@
/* Specifies the compiler flag that forces a short wchar_t */
#undef CC_FLAG_SHORT_WCHAR
/* Define to 1 if you have the <alias.h> header file. */
#undef HAVE_ALIAS_H
/* Define if you have ALSA 1.x including devel headers */
#undef HAVE_ALSA
...
...
@@ -435,6 +438,9 @@
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/icmp_var.h> header file. */
#undef HAVE_NETINET_ICMP_VAR_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
...
...
@@ -444,6 +450,9 @@
/* Define to 1 if you have the <netinet/in_systm.h> header file. */
#undef HAVE_NETINET_IN_SYSTM_H
/* Define to 1 if you have the <netinet/ip_icmp.h> header file. */
#undef HAVE_NETINET_IP_ICMP_H
/* Define to 1 if you have the <netinet/ip_var.h> header file. */
#undef HAVE_NETINET_IP_VAR_H
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment