From: Chip Davis cdavis5x@gmail.com
NetBSD no longer has statistics structures. Instead, it stores them as arrays of integer counters. It's backwards compatible with the old statistics structures, but the struct definitions are missing. This has likely been broken on NetBSD for quite some time as a result. --- configure | 26 ++++++++++++++++++++++++++ configure.ac | 19 +++++++++++++++++++ dlls/nsiproxy.sys/ip.c | 2 +- include/config.h.in | 3 +++ 4 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/configure b/configure index f507d5fe6f0..90bdbb7e5c8 100755 --- a/configure +++ b/configure @@ -20619,6 +20619,32 @@ printf "%s\n" "#define HAVE_STRUCT_IP_STATS_IPS_TOTAL 1" >>confdefs.h fi
+ac_fn_c_check_member "$LINENO" "struct icmpstat" "icps_error" "ac_cv_member_struct_icmpstat_icps_error" "#include <sys/types.h> +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET_IP_H +#include <netinet/ip.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 +" +if test "x$ac_cv_member_struct_icmpstat_icps_error" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_ICMPSTAT_ICPS_ERROR 1" >>confdefs.h + + +fi + + ac_fn_c_check_member "$LINENO" "struct tcpstat" "tcps_connattempt" "ac_cv_member_struct_tcpstat_tcps_connattempt" "#include <sys/types.h> #ifdef HAVE_SYS_SOCKETVAR_H #include <sys/socketvar.h> diff --git a/configure.ac b/configure.ac index a405bf1773f..782994e5ec7 100644 --- a/configure.ac +++ b/configure.ac @@ -2218,6 +2218,25 @@ AC_CHECK_MEMBERS([struct ip_stats.ips_total],,, #include <netinet/ip_var.h> #endif])
+dnl Check for struct icmpstat +AC_CHECK_MEMBERS([struct icmpstat.icps_error],,, +[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET_IP_H +#include <netinet/ip.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]) + dnl Check for struct tcpstat AC_CHECK_MEMBERS([struct tcpstat.tcps_connattempt],,, [#include <sys/types.h> diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index b8fff704f38..69f286a41a0 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -299,7 +299,7 @@ static NTSTATUS ipv4_icmpstats_get_all_parameters( const void *key, UINT key_siz fclose( fp ); return status; } -#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS) +#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS) && defined(HAVE_STRUCT_ICMPSTAT_ICPS_ERROR) { int mib[] = { CTL_NET, PF_INET, IPPROTO_ICMP, ICMPCTL_STATS }; struct icmpstat icmp_stat; diff --git a/include/config.h.in b/include/config.h.in index 45a0bd07abb..bc5ecdebc91 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -443,6 +443,9 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H
+/* Define to 1 if `icps_error' is a member of `struct icmpstat'. */ +#undef HAVE_STRUCT_ICMPSTAT_ICPS_ERROR + /* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_HWADDR
From: Chip Davis cdavis5x@gmail.com
--- configure | 52 +++++++++++++++++++++++++++++ configure.ac | 15 ++++++++- dlls/nsiproxy.sys/ip.c | 75 ++++++++++++++++++++++++++++++++++++++++++ include/config.h.in | 6 ++++ 4 files changed, 147 insertions(+), 1 deletion(-)
diff --git a/configure b/configure index 90bdbb7e5c8..0364a190e57 100755 --- a/configure +++ b/configure @@ -8879,6 +8879,38 @@ if test "x$ac_cv_header_netinet_icmp_var_h" = xyes then : printf "%s\n" "#define HAVE_NETINET_ICMP_VAR_H 1" >>confdefs.h
+fi +ac_fn_c_check_header_compile "$LINENO" "netinet/icmp6.h" "ac_cv_header_netinet_icmp6_h" "#include <sys/types.h> + #include <sys/socket.h> + #ifdef HAVE_SYS_SOCKETVAR_H + # include <sys/socketvar.h> + #endif + #ifdef HAVE_NETINET_IN_H + # include <netinet/in.h> + #endif + #ifdef HAVE_NETINET_IN_SYSTM_H + # include <netinet/in_systm.h> + #endif + #ifdef HAVE_NETINET_IP_H + # include <netinet/ip.h> + #endif + #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 + #ifdef HAVE_NETINET_TCP_H + # include <netinet/tcp.h> + #endif +" +if test "x$ac_cv_header_netinet_icmp6_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_ICMP6_H 1" >>confdefs.h + fi ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_var.h" "ac_cv_header_netinet_tcp_var_h" "#include <sys/types.h> #include <sys/socket.h> @@ -20645,6 +20677,26 @@ printf "%s\n" "#define HAVE_STRUCT_ICMPSTAT_ICPS_ERROR 1" >>confdefs.h fi
+ac_fn_c_check_member "$LINENO" "struct icmp6stat" "icp6s_error" "ac_cv_member_struct_icmp6stat_icp6s_error" "#include <sys/types.h> +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET_ICMP6_H +#include <netinet/icmp6.h> +#endif +" +if test "x$ac_cv_member_struct_icmp6stat_icp6s_error" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_ICMP6STAT_ICP6S_ERROR 1" >>confdefs.h + + +fi + + ac_fn_c_check_member "$LINENO" "struct tcpstat" "tcps_connattempt" "ac_cv_member_struct_tcpstat_tcps_connattempt" "#include <sys/types.h> #ifdef HAVE_SYS_SOCKETVAR_H #include <sys/socketvar.h> diff --git a/configure.ac b/configure.ac index 782994e5ec7..3d4a32b52b7 100644 --- a/configure.ac +++ b/configure.ac @@ -555,7 +555,7 @@ AC_CHECK_HEADERS(\ # include <netinet/ip.h> #endif])
-AC_CHECK_HEADERS([netinet/udp_var.h netinet/icmp_var.h netinet/tcp_var.h ],,, +AC_CHECK_HEADERS([netinet/udp_var.h netinet/icmp_var.h netinet/icmp6.h netinet/tcp_var.h ],,, [#include <sys/types.h> #include <sys/socket.h> #ifdef HAVE_SYS_SOCKETVAR_H @@ -2237,6 +2237,19 @@ AC_CHECK_MEMBERS([struct icmpstat.icps_error],,, #include <netinet/icmp_var.h> #endif])
+dnl Check for struct icmp6stat +AC_CHECK_MEMBERS([struct icmp6stat.icp6s_error],,, +[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET_ICMP6_H +#include <netinet/icmp6.h> +#endif]) + dnl Check for struct tcpstat AC_CHECK_MEMBERS([struct tcpstat.tcps_connattempt],,, [#include <sys/types.h> diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index 69f286a41a0..18e88f493bb 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -59,6 +59,24 @@ #include <netinet/icmp_var.h> #endif
+#ifdef HAVE_NETINET_ICMP6_H +#include <netinet/icmp6.h> +#undef ICMP6_DST_UNREACH +#undef ICMP6_PACKET_TOO_BIG +#undef ICMP6_TIME_EXCEEDED +#undef ICMP6_PARAM_PROB +#undef ICMP6_ECHO_REQUEST +#undef ICMP6_ECHO_REPLY +#undef ICMP6_MEMBERSHIP_QUERY +#undef ICMP6_MEMBERSHIP_REPORT +#undef ICMP6_MEMBERSHIP_REDUCTION +#undef ND_ROUTER_SOLICIT +#undef ND_ROUTER_ADVERT +#undef ND_NEIGHBOR_SOLICIT +#undef ND_NEIGHBOR_ADVERT +#undef ND_REDIRECT +#endif + #ifdef HAVE_NETINET_IF_ETHER_H #include <netinet/if_ether.h> #endif @@ -472,6 +490,63 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, UINT key_siz if (dynamic_data) *(struct nsi_ip_icmpstats_dynamic *)dynamic_data = dyn; return STATUS_SUCCESS; } +#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPV6CTL_STATS) && defined(HAVE_STRUCT_ICMP6STAT_ICP6S_ERROR) + { + int mib[] = { CTL_NET, PF_INET6, IPPROTO_ICMPV6, ICMPV6CTL_STATS }; + struct icmp6stat icmp_stat; + size_t needed = sizeof(icmp_stat); + int i; + + if (sysctl( mib, ARRAY_SIZE(mib), &icmp_stat, &needed, NULL, 0 ) == -1) return STATUS_NOT_SUPPORTED; + + dyn.in_msgs = icmp_stat.icp6s_badcode + icmp_stat.icp6s_checksum + icmp_stat.icp6s_tooshort + + icmp_stat.icp6s_badlen + icmp_stat.icp6s_nd_toomanyopt; + for (i = 0; i <= ICMP6_MAXTYPE; i++) + dyn.in_msgs += icmp_stat.icp6s_inhist[i]; + + dyn.in_errors = icmp_stat.icp6s_badcode + icmp_stat.icp6s_checksum + icmp_stat.icp6s_tooshort + + icmp_stat.icp6s_badlen + icmp_stat.icp6s_nd_toomanyopt; + + dyn.in_type_counts[ICMP6_DST_UNREACH] = icmp_stat.icp6s_inhist[ICMP6_DST_UNREACH]; + dyn.in_type_counts[ICMP6_PACKET_TOO_BIG] = icmp_stat.icp6s_inhist[ICMP6_PACKET_TOO_BIG]; + dyn.in_type_counts[ICMP6_TIME_EXCEEDED] = icmp_stat.icp6s_inhist[ICMP6_TIME_EXCEEDED]; + dyn.in_type_counts[ICMP6_PARAM_PROB] = icmp_stat.icp6s_inhist[ICMP6_PARAM_PROB]; + dyn.in_type_counts[ICMP6_ECHO_REQUEST] = icmp_stat.icp6s_inhist[ICMP6_ECHO_REQUEST]; + dyn.in_type_counts[ICMP6_ECHO_REPLY] = icmp_stat.icp6s_inhist[ICMP6_ECHO_REPLY]; + dyn.in_type_counts[ICMP6_MEMBERSHIP_QUERY] = icmp_stat.icp6s_inhist[ICMP6_MEMBERSHIP_QUERY]; + dyn.in_type_counts[ICMP6_MEMBERSHIP_REPORT] = icmp_stat.icp6s_inhist[ICMP6_MEMBERSHIP_REPORT]; + dyn.in_type_counts[ICMP6_MEMBERSHIP_REDUCTION] = icmp_stat.icp6s_inhist[ICMP6_MEMBERSHIP_REDUCTION]; + dyn.in_type_counts[ND_ROUTER_SOLICIT] = icmp_stat.icp6s_inhist[ND_ROUTER_SOLICIT]; + dyn.in_type_counts[ND_ROUTER_ADVERT] = icmp_stat.icp6s_inhist[ND_ROUTER_ADVERT]; + dyn.in_type_counts[ND_NEIGHBOR_SOLICIT] = icmp_stat.icp6s_inhist[ND_NEIGHBOR_SOLICIT]; + dyn.in_type_counts[ND_NEIGHBOR_ADVERT] = icmp_stat.icp6s_inhist[ND_NEIGHBOR_ADVERT]; + dyn.in_type_counts[ND_REDIRECT] = icmp_stat.icp6s_inhist[ND_REDIRECT]; + dyn.in_type_counts[ICMP6_V2_MEMBERSHIP_REPORT] = icmp_stat.icp6s_inhist[MLDV2_LISTENER_REPORT]; + + dyn.out_msgs = icmp_stat.icp6s_canterror + icmp_stat.icp6s_toofreq; + for (i = 0; i <= ICMP6_MAXTYPE; i++) + dyn.out_msgs += icmp_stat.icp6s_outhist[i]; + + dyn.out_errors = icmp_stat.icp6s_canterror + icmp_stat.icp6s_toofreq; + + dyn.out_type_counts[ICMP6_DST_UNREACH] = icmp_stat.icp6s_outhist[ICMP6_DST_UNREACH]; + dyn.out_type_counts[ICMP6_PACKET_TOO_BIG] = icmp_stat.icp6s_outhist[ICMP6_PACKET_TOO_BIG]; + dyn.out_type_counts[ICMP6_TIME_EXCEEDED] = icmp_stat.icp6s_outhist[ICMP6_TIME_EXCEEDED]; + dyn.out_type_counts[ICMP6_PARAM_PROB] = icmp_stat.icp6s_outhist[ICMP6_PARAM_PROB]; + dyn.out_type_counts[ICMP6_ECHO_REQUEST] = icmp_stat.icp6s_outhist[ICMP6_ECHO_REQUEST]; + dyn.out_type_counts[ICMP6_ECHO_REPLY] = icmp_stat.icp6s_outhist[ICMP6_ECHO_REPLY]; + dyn.out_type_counts[ICMP6_MEMBERSHIP_QUERY] = icmp_stat.icp6s_outhist[ICMP6_MEMBERSHIP_QUERY]; + dyn.out_type_counts[ICMP6_MEMBERSHIP_REPORT] = icmp_stat.icp6s_outhist[ICMP6_MEMBERSHIP_REPORT]; + dyn.out_type_counts[ICMP6_MEMBERSHIP_REDUCTION] = icmp_stat.icp6s_outhist[ICMP6_MEMBERSHIP_REDUCTION]; + dyn.out_type_counts[ND_ROUTER_SOLICIT] = icmp_stat.icp6s_outhist[ND_ROUTER_SOLICIT]; + dyn.out_type_counts[ND_ROUTER_ADVERT] = icmp_stat.icp6s_outhist[ND_ROUTER_ADVERT]; + dyn.out_type_counts[ND_NEIGHBOR_SOLICIT] = icmp_stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT]; + dyn.out_type_counts[ND_NEIGHBOR_ADVERT] = icmp_stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]; + dyn.out_type_counts[ND_REDIRECT] = icmp_stat.icp6s_outhist[ND_REDIRECT]; + dyn.out_type_counts[ICMP6_V2_MEMBERSHIP_REPORT] = icmp_stat.icp6s_outhist[MLDV2_LISTENER_REPORT]; + if (dynamic_data) *(struct nsi_ip_icmpstats_dynamic *)dynamic_data = dyn; + return STATUS_SUCCESS; + } #else FIXME( "not implemented\n" ); return STATUS_NOT_IMPLEMENTED; diff --git a/include/config.h.in b/include/config.h.in index bc5ecdebc91..8cbf23d417e 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -257,6 +257,9 @@ /* Define to 1 if you have the <netdb.h> header file. */ #undef HAVE_NETDB_H
+/* Define to 1 if you have the <netinet/icmp6.h> header file. */ +#undef HAVE_NETINET_ICMP6_H + /* Define to 1 if you have the <netinet/icmp_var.h> header file. */ #undef HAVE_NETINET_ICMP_VAR_H
@@ -443,6 +446,9 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H
+/* Define to 1 if `icp6s_error' is a member of `struct icmp6stat'. */ +#undef HAVE_STRUCT_ICMP6STAT_ICP6S_ERROR + /* Define to 1 if `icps_error' is a member of `struct icmpstat'. */ #undef HAVE_STRUCT_ICMPSTAT_ICPS_ERROR
From: Chip Davis cdavis5x@gmail.com
--- configure | 46 ++++++++++++++++++++++++++ configure.ac | 14 ++++++++ dlls/nsiproxy.sys/ip.c | 75 ++++++++++++++++++++++++++++++++++++++++++ include/config.h.in | 6 ++++ 4 files changed, 141 insertions(+)
diff --git a/configure b/configure index 0364a190e57..c2a74458dac 100755 --- a/configure +++ b/configure @@ -8761,6 +8761,32 @@ if test "x$ac_cv_header_netinet_udp_h" = xyes then : printf "%s\n" "#define HAVE_NETINET_UDP_H 1" >>confdefs.h
+fi +ac_fn_c_check_header_compile "$LINENO" "netinet6/ip6_var.h" "ac_cv_header_netinet6_ip6_var_h" "#include <sys/types.h> + #include <sys/socket.h> + #ifdef HAVE_SYS_SOCKETVAR_H + # include <sys/socketvar.h> + #endif + #ifdef HAVE_NET_ROUTE_H + # include <net/route.h> + #endif + #ifdef HAVE_NETINET_IN_H + # include <netinet/in.h> + #endif + #ifdef HAVE_NETINET_IN_SYSTM_H + # include <netinet/in_systm.h> + #endif + #ifdef HAVE_NET_IF_H + # include <net/if.h> + #endif + #ifdef HAVE_NETINET_IP_H + # include <netinet/ip.h> + #endif +" +if test "x$ac_cv_header_netinet6_ip6_var_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET6_IP6_VAR_H 1" >>confdefs.h + fi ac_fn_c_check_header_compile "$LINENO" "netipx/ipx.h" "ac_cv_header_netipx_ipx_h" "#include <sys/types.h> #include <sys/socket.h> @@ -20651,6 +20677,26 @@ printf "%s\n" "#define HAVE_STRUCT_IP_STATS_IPS_TOTAL 1" >>confdefs.h fi
+ac_fn_c_check_member "$LINENO" "struct ip6stat" "ip6s_total" "ac_cv_member_struct_ip6stat_ip6s_total" "#include <sys/types.h> +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET6_IP6_VAR_H +#include <netinet6/ip6_var.h> +#endif +" +if test "x$ac_cv_member_struct_ip6stat_ip6s_total" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_IP6STAT_IP6S_TOTAL 1" >>confdefs.h + + +fi + + ac_fn_c_check_member "$LINENO" "struct icmpstat" "icps_error" "ac_cv_member_struct_icmpstat_icps_error" "#include <sys/types.h> #ifdef HAVE_SYS_SOCKETVAR_H #include <sys/socketvar.h> diff --git a/configure.ac b/configure.ac index 3d4a32b52b7..26b1a353fea 100644 --- a/configure.ac +++ b/configure.ac @@ -532,6 +532,7 @@ AC_CHECK_HEADERS(\ netinet/ip_icmp.h \ netinet/ip_var.h \ netinet/udp.h \ + netinet6/ip6_var.h \ netipx/ipx.h \ sys/un.h \ ,,,[#include <sys/types.h> @@ -2218,6 +2219,19 @@ AC_CHECK_MEMBERS([struct ip_stats.ips_total],,, #include <netinet/ip_var.h> #endif])
+dnl Check for struct ip6stat +AC_CHECK_MEMBERS([struct ip6stat.ip6s_total],,, +[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKETVAR_H +#include <sys/socketvar.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_NETINET6_IP6_VAR_H +#include <netinet6/ip6_var.h> +#endif]) + dnl Check for struct icmpstat AC_CHECK_MEMBERS([struct icmpstat.icps_error],,, [#include <sys/types.h> diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index 18e88f493bb..27344756580 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -55,6 +55,50 @@ #include <netinet/ip_var.h> #endif
+#ifdef HAVE_NETINET6_IP6_VAR_H +#include <netinet6/ip6_var.h> +#endif + +#ifdef __APPLE__ +/* For reasons unknown, Mac OS doesn't export <netinet6/ip6_var.h> to user- + * space. We'll have to define the needed struct ourselves. + */ +struct ip6stat { + u_quad_t ip6s_total; + u_quad_t ip6s_tooshort; + u_quad_t ip6s_toosmall; + u_quad_t ip6s_fragments; + u_quad_t ip6s_fragdropped; + u_quad_t ip6s_fragtimeout; + u_quad_t ip6s_fragoverflow; + u_quad_t ip6s_forward; + u_quad_t ip6s_cantforward; + u_quad_t ip6s_redirectsent; + u_quad_t ip6s_delivered; + u_quad_t ip6s_localout; + u_quad_t ip6s_odropped; + u_quad_t ip6s_reassembled; + u_quad_t ip6s_atmfrag_rcvd; + u_quad_t ip6s_fragmented; + u_quad_t ip6s_ofragments; + u_quad_t ip6s_cantfrag; + u_quad_t ip6s_badoptions; + u_quad_t ip6s_noroute; + u_quad_t ip6s_badvers; + u_quad_t ip6s_rawout; + u_quad_t ip6s_badscope; + u_quad_t ip6s_notmember; + u_quad_t ip6s_nxthist[256]; + u_quad_t ip6s_m1; + u_quad_t ip6s_m2m[32]; + u_quad_t ip6s_mext1; + u_quad_t ip6s_mext2m; + u_quad_t ip6s_exthdrtoolong; + u_quad_t ip6s_nogif; + u_quad_t ip6s_toomanyhdr; +}; +#endif + #ifdef HAVE_NETINET_ICMP_VAR_H #include <netinet/icmp_var.h> #endif @@ -729,6 +773,37 @@ static NTSTATUS ipv6_ipstats_get_all_parameters( const void *key, UINT key_size, if (static_data) *(struct nsi_ip_ipstats_static *)static_data = stat; return status; } +#elif defined(HAVE_SYS_SYSCTL_H) && defined(IPV6CTL_STATS) && (defined(HAVE_STRUCT_IP6STAT_IP6S_TOTAL) || defined(__APPLE__)) + { + int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_STATS }; + struct ip6stat ip_stat; + size_t needed; + + needed = sizeof(ip_stat); + if (sysctl( mib, ARRAY_SIZE(mib), &ip_stat, &needed, NULL, 0 ) == -1) return STATUS_NOT_SUPPORTED; + + dyn.in_recv = ip_stat.ip6s_total; + dyn.in_hdr_errs = ip_stat.ip6s_tooshort + ip_stat.ip6s_toosmall + ip_stat.ip6s_badvers + + ip_stat.ip6s_badoptions + ip_stat.ip6s_exthdrtoolong + ip_stat.ip6s_toomanyhdr; + dyn.in_addr_errs = ip_stat.ip6s_cantforward + ip_stat.ip6s_badscope + ip_stat.ip6s_notmember; + dyn.fwd_dgrams = ip_stat.ip6s_forward; + dyn.in_discards = ip_stat.ip6s_fragdropped; + dyn.in_delivers = ip_stat.ip6s_delivered; + dyn.out_reqs = ip_stat.ip6s_localout; + dyn.out_discards = ip_stat.ip6s_odropped; + dyn.out_no_routes = ip_stat.ip6s_noroute; + stat.reasm_timeout = ip_stat.ip6s_fragtimeout; + dyn.reasm_reqds = ip_stat.ip6s_fragments; + dyn.reasm_oks = ip_stat.ip6s_reassembled; + dyn.reasm_fails = ip_stat.ip6s_fragments - ip_stat.ip6s_reassembled; + dyn.frag_oks = ip_stat.ip6s_fragmented; + dyn.frag_fails = ip_stat.ip6s_cantfrag; + dyn.frag_creates = ip_stat.ip6s_ofragments; + + if (dynamic_data) *(struct nsi_ip_ipstats_dynamic *)dynamic_data = dyn; + if (static_data) *(struct nsi_ip_ipstats_static *)static_data = stat; + return STATUS_SUCCESS; + } #else FIXME( "not implemented\n" ); return STATUS_NOT_IMPLEMENTED; diff --git a/include/config.h.in b/include/config.h.in index 8cbf23d417e..de1bf6c61eb 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -257,6 +257,9 @@ /* Define to 1 if you have the <netdb.h> header file. */ #undef HAVE_NETDB_H
+/* Define to 1 if you have the <netinet6/ip6_var.h> header file. */ +#undef HAVE_NETINET6_IP6_VAR_H + /* Define to 1 if you have the <netinet/icmp6.h> header file. */ #undef HAVE_NETINET_ICMP6_H
@@ -458,6 +461,9 @@ /* Define to 1 if `ipi6_addr' is a member of `struct in6_pktinfo'. */ #undef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
+/* Define to 1 if `ip6s_total' is a member of `struct ip6stat'. */ +#undef HAVE_STRUCT_IP6STAT_IP6S_TOTAL + /* Define to 1 if `ips_total' is a member of `struct ipstat'. */ #undef HAVE_STRUCT_IPSTAT_IPS_TOTAL
Since I can't assign reviewers myself, and since no one has bitten...
@huw: Tag, you're it!
On Thu May 12 06:27:39 2022 +0000, Chip Davis wrote:
Since I can't assign reviewers myself, and since no one has bitten... @huw: Tag, you're it!
FWIW, to be able to assign reviewers, you can go to https://gitlab.winehq.org/wine/wine and click "Request Access".
On Thu May 12 06:27:39 2022 +0000, Huw Davies wrote:
FWIW, to be able to assign reviewers, you can go to https://gitlab.winehq.org/wine/wine and click "Request Access".
Oh, thank you.
This merge request was approved by Huw Davies.