summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--INSTALL8
-rw-r--r--Makefile.am5
-rw-r--r--Makefile.in25
-rw-r--r--NEWS.md154
-rw-r--r--aclocal.m477
-rw-r--r--compat/Makefile.in10
-rw-r--r--compat/Thread.c8
-rw-r--r--compat/delay.c9
-rw-r--r--compat/error.c156
-rw-r--r--compat/gettcpinfo.c36
-rw-r--r--config.h.in298
-rwxr-xr-xconfigure7801
-rw-r--r--configure.ac164
-rw-r--r--doc/Makefile.in8
-rw-r--r--flows/Makefile.am1
-rw-r--r--flows/Makefile.in430
-rw-r--r--flows/Readme.txt36
-rw-r--r--flows/flows.py1300
-rwxr-xr-xflows/ssh_nodes.py499
-rw-r--r--include/Client.hpp20
-rw-r--r--include/Listener.hpp4
-rw-r--r--include/Locale.h33
-rw-r--r--include/Makefile.am2
-rw-r--r--include/Makefile.in10
-rw-r--r--include/PerfSocket.hpp2
-rw-r--r--include/Reporter.h137
-rw-r--r--include/Server.hpp4
-rw-r--r--include/Settings.hpp65
-rw-r--r--include/SocketAddr.h2
-rw-r--r--include/Timestamp.hpp12
-rw-r--r--include/active_hosts.h16
-rw-r--r--include/dscp.h16
-rw-r--r--include/gettcpinfo.h21
-rw-r--r--include/headers.h4
-rw-r--r--include/histogram.h7
-rw-r--r--include/iperf_multicast_api.h73
-rw-r--r--include/isochronous.hpp2
-rw-r--r--include/packet_ring.h36
-rw-r--r--include/payloads.h30
-rw-r--r--include/util.h38
-rw-r--r--include/version.h7
-rw-r--r--man/Makefile.in8
-rw-r--r--man/iperf.1157
-rw-r--r--src/Client.cpp798
-rw-r--r--src/Launch.cpp101
-rw-r--r--src/Listener.cpp522
-rw-r--r--src/Locale.c328
-rw-r--r--src/Makefile.am3
-rw-r--r--src/Makefile.in23
-rw-r--r--src/PerfSocket.cpp234
-rw-r--r--src/ReportOutputs.c1057
-rw-r--r--src/Reporter.c466
-rw-r--r--src/Reports.c139
-rw-r--r--src/Server.cpp321
-rw-r--r--src/Settings.cpp429
-rw-r--r--src/SocketAddr.c31
-rw-r--r--src/active_hosts.cpp198
-rw-r--r--src/dscp.c10
-rw-r--r--src/histogram.c21
-rw-r--r--src/iperf_formattime.c82
-rw-r--r--src/iperf_multicast_api.c386
-rw-r--r--src/isochronous.cpp86
-rw-r--r--src/packet_ring.c21
-rw-r--r--src/pdfs.c7
-rw-r--r--src/socket_io.c16
-rw-r--r--src/stdio.c11
-rw-r--r--t/base.sh16
-rwxr-xr-xt/t14_udp_triptimes.sh12
-rwxr-xr-xt/t15_udp_enhanced.sh12
-rwxr-xr-xt/t16_udp_histograms.sh13
70 files changed, 12246 insertions, 4828 deletions
diff --git a/INSTALL b/INSTALL
index cd2367d..244ca60 100644
--- a/INSTALL
+++ b/INSTALL
@@ -122,14 +122,16 @@ OpenWRT cross compile (example only)
---
Other configure and compile options
- ./configure --enable-thread-debug - used for tool debug
- ./configure --enable-fastsampling - sub millisecond timestamping
+ ./configure --enable-debuginfo - enable asserts
+ ./configure --enable-thread-debug - enable thread level debugging
+ ./configure --enable-summing-debug - enable summing level debugging
./configure --enable-packet-debug - show packet sequence numbers - very chatty
+ ./configure --enable-fastsampling - sub millisecond timestamping
./configure --enable-checkprograms - compile supplmentary test programs
./configure --disable-ipv6
./configure --disable-multicast
./configure --disable-threads
- ./configure --enable-debuginfo
+ ./configure --disable-write-select
./configure --enable-debug-symbols - enable debugging with symbols
./configure --enable-default-localonly - limit test traffic to the local network (off by default)
---
diff --git a/Makefile.am b/Makefile.am
index 1251caa..528c542 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = compat doc include src man
+SUBDIRS = compat doc include src man flows
AM_CPPFLAGS = @STRIP_BEGIN@ \
-I$(top_srcdir)/include \
@@ -14,5 +14,6 @@ TEST_EXTENSIONS = .sh
TESTS = t/t1_tcp.sh t/t2_tcp6.sh t/t3_udp.sh t/t4_udp6.sh \
t/t5_f.sh t/t6_filelong.sh t/t7_n.sh t/t8_num.sh \
t/t9_parallel.sh t/t10_dualtest.sh t/t11_tradeoff.sh \
- t/t12_full_duplex.sh t/t13_reverse.sh
+ t/t12_full_duplex.sh t/t13_reverse.sh t/t14_udp_triptimes.sh \
+ t/t15_udp_enhanced.sh t/t16_udp_histograms.sh
diff --git a/Makefile.in b/Makefile.in
index ca7d36d..69cfab4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -156,9 +156,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
@@ -341,6 +338,7 @@ am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
RECHECK_LOGS = $(TEST_LOGS)
TEST_SUITE_LOG = test-suite.log
am__test_logs1 = $(TESTS:=.log)
@@ -360,7 +358,7 @@ am__set_b = \
esac
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
- COPYING ChangeLog INSTALL README compile config.guess \
+ COPYING ChangeLog INSTALL NEWS.md README compile config.guess \
config.sub depcomp install-sh missing test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
@@ -400,6 +398,8 @@ am__relativize = \
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -416,6 +416,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
@@ -426,6 +428,7 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
@@ -518,7 +521,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = compat doc include src man
+SUBDIRS = compat doc include src man flows
AM_CPPFLAGS = @STRIP_BEGIN@ \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
@@ -531,7 +534,8 @@ TEST_EXTENSIONS = .sh
TESTS = t/t1_tcp.sh t/t2_tcp6.sh t/t3_udp.sh t/t4_udp6.sh \
t/t5_f.sh t/t6_filelong.sh t/t7_n.sh t/t8_num.sh \
t/t9_parallel.sh t/t10_dualtest.sh t/t11_tradeoff.sh \
- t/t12_full_duplex.sh t/t13_reverse.sh
+ t/t12_full_duplex.sh t/t13_reverse.sh t/t14_udp_triptimes.sh \
+ t/t15_udp_enhanced.sh t/t16_udp_histograms.sh
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -800,7 +804,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
@@ -848,7 +852,6 @@ recheck: all
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -995,7 +998,7 @@ distcheck: dist
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
diff --git a/NEWS.md b/NEWS.md
new file mode 100644
index 0000000..9c1b082
--- /dev/null
+++ b/NEWS.md
@@ -0,0 +1,154 @@
+**Iperf 2 - Network testing tool** *(based from 2.0.5)*
+
+This document is not done. RJM 8/24/2021
+
+Man page: https:://iperf2.sourceforge.io/iperf-manpage.html
+
+---
+Iperf 2, this program, is different from the iperf 3 found
+at https://github.com/esnet/iperf
+
+Each can be used to
+measure network performance, however, **iperf 2 and iperf 3 DO NOT interoperate.**
+They are completely different implementations with different strengths, capabilities and
+different options. Iperf 2 took its code base from the original iperf code (that stalled at 2.0.5.)
+Iperf 3 is a rewrite from scratch.
+
+Both Iperf 2 (now at 2.1.4) and iperf 3 are both under active development (as of mid-2021)
+
+Iperf 2 vs 3 table: https://iperf2.sourceforge.io/IperfCompare.html
+
+***See the end of the file for license conditions***
+
+---
+Iperf 2.1.4 has many user visible changes since 2.0.13 and even more since
+2.0.5 The below describes many of these user visible changes with
+a focus on 2.1.4 compared to 2.0.13
+
+
+---
+**Iperf 2 new metrics**
+
+**NetPwr**
+
+ Network power: The network power (NetPwr) metric originates from Kleinrock and Jaffe circa 1980.
+ It is a measure of a desirable property divided by an undesirable property.
+ It is defined as throughput/delay. For TCP transmits, the delay is the sampled RTT times.
+ For TCP receives, the delay is the write to read latency. For UDP the delay is the
+ packet end/end latency.
+
+ Note, one must use -i interval with TCP to get this as that's what sets the RTT sampling rate.
+ The metric is scaled to assist with human readability.
+
+**InP**
+
+ The InP metric is derived from Little's Law or Little's Lamma. LL in queuing theory is a
+ theorem that determines the average number of items (L) in a stationary queuing system
+ based on the average waiting time (W) of an item within a system and the average number
+ of items arriving at the system per unit of time (lambda). Mathematically,
+ it's L = lambda * W. As used here, the units are bytes. The arrival rate is
+ taken from the writes.
+
+---
+
+**Iperf 2 Enhanced Reports**
+
+Much of the new outputs require **-e** for **--enhanced-reports**. This is supported on both the client and server
+
+**Client side (TCP)**
+
+***Write:*** the number of socket write calls
+***Err:*** the number of write syscalls that returned with a non fatal error
+***Rtry:*** The sampled TCP retry value
+***RTT:*** the sampled TCP round trip time
+***CWND:*** the sampled TCP congestion window
+***NetPwr:*** the computed network power (using RTT)
+
+**Server side (TCP)**
+
+***Burst Latency:*** The avg/min/max/stdev message latencies
+***cnt:*** the number of bursts or write messages
+***size:*** the average burst or write size
+***inP:*** the computed bytes in flight per Little's law
+***NetPwr:*** the computed network power (using burst arrival rates)
+***Reads:*** histogram of read sizes
+
+
+**Client side (UDP)**
+
+***Write:*** the number of socket write calls
+***Err:*** the number of write syscalls that returned with a non fatal error
+***PPS:*** The sampled packets per second (computed as a derivative)
+
+**Server side (UDP)**
+
+***Write:*** the number of socket write calls
+***Err:*** the number of write syscalls that returned with a non fatal error
+***PPS:*** The sampled packets per second (computed as a derivative)
+
+
+
+
+ ---
+
+* configure '**--enable-fast-sampling**'
+
+ This configuration causes the iperf binary to support units
+ of microseconds. It casues iperf to use four units of precision
+ in it's timing interval output, i.e. 1e-4, as one example
+
+> iperf -c 192.168.1.64 -n 4 -C
+> ------------------------------------------------------------
+> Client connecting to 192.168.1.64, TCP port 5001
+> TCP window size: 85.0 KByte (default)
+> ------------------------------------------------------------
+> [ 1] local 192.168.1.133 port 56568 connected with 192.168.1.64 port 5001
+> [ ID] Interval Transfer Bandwidth
+> [ 1] 0.0000-0.0172 sec 4.00 Bytes 1.86 Kbits/sec
+
+* '**--trip-times**' on the client
+
+ This option indicates to iperf a few things. First, that the user
+ has syncrhonized the clients' and servers' clocks. A good way to do
+ this is using Precision Time Protocol and a GPS atomic clock as a
+ reference. This knowledge allows iperf to use many time stamps
+ to be sender based, i.e. taken from the sender's write timestamp
+ (which is carried in the payloads.)
+
+ The connect message on both the server and the client will indicate
+ that '--trip-times' has been enabled.
+
+ Both UDP an TCP support '--trip-times'
+
+> iperf -c 192.168.1.64 --trip-times
+> ------------------------------------------------------------
+> Client connecting to 192.168.1.64, TCP port 5001
+> TCP window size: 85.0 KByte (default)
+> ------------------------------------------------------------
+> [ 1] local 192.168.1.133 port 56580 connected with 192.168.1.64 port 5001 (trip-times)
+>
+> iperf -s
+> ------------------------------------------------------------
+> Server listening on TCP port 5001
+> TCP window size: 128 KByte (default)
+> ------------------------------------------------------------
+> [ 1] local 192.168.1.64%enp2s0 port 5001 connected with 192.168.1.133 port 56580 (MSS=1448) (trip-times) (sock=4) (peer 2.1.4) on 2021-08-22 11:12:08 (PDT)
+
+
+
+
+----------------------------------------------------------------------
+This file is part of iperf 2.
+
+Iperf 2 is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Iperf 2 is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iperf 2. If not, see <https://www.gnu.org/licenses/>. \ No newline at end of file
diff --git a/aclocal.m4 b/aclocal.m4
index cd1b5c1..2f51973 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,13 +14,13 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
+[m4_warning([this file was generated for autoconf 2.72.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.16.2], [],
+m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.2])dnl
+[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -400,7 +400,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -428,6 +428,10 @@ m4_defn([AC_PROG_CC])
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
+m4_ifdef([_$0_ALREADY_INIT],
+ [m4_fatal([$0 expanded multiple times
+]m4_defn([_$0_ALREADY_INIT]))],
+ [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -464,7 +468,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
@@ -516,6 +520,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+AC_SUBST([CTAGS])
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+AC_SUBST([CSCOPE])
+
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
@@ -597,7 +615,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -618,7 +636,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2020 Free Software Foundation, Inc.
+# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -640,7 +658,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -675,7 +693,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -718,7 +736,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -739,12 +757,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
@@ -757,7 +770,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -786,7 +799,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -833,7 +846,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -852,7 +865,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -933,7 +946,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -993,7 +1006,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1021,7 +1034,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2020 Free Software Foundation, Inc.
+# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1040,7 +1053,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2020 Free Software Foundation, Inc.
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/compat/Makefile.in b/compat/Makefile.in
index 5d5bbcd..bb7af61 100644
--- a/compat/Makefile.in
+++ b/compat/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -171,8 +171,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -187,6 +185,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
@@ -197,6 +197,7 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
@@ -439,7 +440,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/compat/Thread.c b/compat/Thread.c
index 307535e..4189a64 100644
--- a/compat/Thread.c
+++ b/compat/Thread.c
@@ -136,7 +136,13 @@ static int __log(const char *level, const char *format, va_list args) {
char logformat[]="%s(%ld):[%s] %s\n";
__gettimestamp(timestamp);
- #if HAVE_GETTID_SYSCALL
+
+ #if HAVE_DECL_PTHREAD_THREADID_NP
+ uint64_t tid;
+ if (pthread_threadid_np(NULL, &tid) != 0) {
+ tid = -1;
+ }
+ #elif HAVE_GETTID_SYSCALL
unsigned long tid = syscall(SYS_gettid);
#else
unsigned long tid = -1;
diff --git a/compat/delay.c b/compat/delay.c
index 95bde3e..78ca00c 100644
--- a/compat/delay.c
+++ b/compat/delay.c
@@ -140,14 +140,7 @@ int clock_usleep (struct timeval *request) {
#else
struct timeval now;
struct timeval next = *request;
-#ifdef HAVE_CLOCK_GETTIME
- struct timespec t1;
- clock_gettime(CLOCK_REALTIME, &t1);
- now.tv_sec = t1.tv_sec;
- now.tv_usec = t1.tv_nsec / 1000;
-#else
- gettimeofday(&now, NULL);
-#endif
+ TimeGetNow(now);
double delta_usecs;
if ((delta_usecs = TimeDifference(next, now)) > 0.0) {
delay_loop(delta_usecs);
diff --git a/compat/error.c b/compat/error.c
index 53d1727..da6ff4d 100644
--- a/compat/error.c
+++ b/compat/error.c
@@ -53,6 +53,147 @@
#include "headers.h"
#include "util.h"
+/*---------------------------------------------------------------
+ * Linux errors per [root@fedora iperf-2.1.9-rc2]# uname -r
+ * 5.11.12-300.fc34.x86_64
+ *
+ * [root@fedora iperf-2.1.9-rc2]# errno -l
+ * EPERM 1 Operation not permitted
+ * ENOENT 2 No such file or directory
+ * ESRCH 3 No such process
+ * EINTR 4 Interrupted system call
+ * EIO 5 Input/output error
+ * ENXIO 6 No such device or address
+ * E2BIG 7 Argument list too long
+ * ENOEXEC 8 Exec format error
+ * EBADF 9 Bad file descriptor
+ * ECHILD 10 No child processes
+ * EAGAIN 11 Resource temporarily unavailable
+ * ENOMEM 12 Cannot allocate memory
+ * EACCES 13 Permission denied
+ * EFAULT 14 Bad address
+ * ENOTBLK 15 Block device required
+ * EBUSY 16 Device or resource busy
+ * EEXIST 17 File exists
+ * EXDEV 18 Invalid cross-device link
+ * ENODEV 19 No such device
+ * ENOTDIR 20 Not a directory
+ * EISDIR 21 Is a directory
+ * EINVAL 22 Invalid argument
+ * ENFILE 23 Too many open files in system
+ * EMFILE 24 Too many open files
+ * ENOTTY 25 Inappropriate ioctl for device
+ * ETXTBSY 26 Text file busy
+ * EFBIG 27 File too large
+ * ENOSPC 28 No space left on device
+ * ESPIPE 29 Illegal seek
+ * EROFS 30 Read-only file system
+ * EMLINK 31 Too many links
+ * EPIPE 32 Broken pipe
+ * EDOM 33 Numerical argument out of domain
+ * ERANGE 34 Numerical result out of range
+ * EDEADLK 35 Resource deadlock avoided
+ * ENAMETOOLONG 36 File name too long
+ * ENOLCK 37 No locks available
+ * ENOSYS 38 Function not implemented
+ * ENOTEMPTY 39 Directory not empty
+ * ELOOP 40 Too many levels of symbolic links
+ * EWOULDBLOCK 11 Resource temporarily unavailable
+ * ENOMSG 42 No message of desired type
+ * EIDRM 43 Identifier removed
+ * ECHRNG 44 Channel number out of range
+ * EL2NSYNC 45 Level 2 not synchronized
+ * EL3HLT 46 Level 3 halted
+ * EL3RST 47 Level 3 reset
+ * ELNRNG 48 Link number out of range
+ * EUNATCH 49 Protocol driver not attached
+ * ENOCSI 50 No CSI structure available
+ * EL2HLT 51 Level 2 halted
+ * EBADE 52 Invalid exchange
+ * EBADR 53 Invalid request descriptor
+ * EXFULL 54 Exchange full
+ * ENOANO 55 No anode
+ * EBADRQC 56 Invalid request code
+ * EBADSLT 57 Invalid slot
+ * EDEADLOCK 35 Resource deadlock avoided
+ * EBFONT 59 Bad font file format
+ * ENOSTR 60 Device not a stream
+ * ENODATA 61 No data available
+ * ETIME 62 Timer expired
+ * ENOSR 63 Out of streams resources
+ * ENONET 64 Machine is not on the network
+ * ENOPKG 65 Package not installed
+ * EREMOTE 66 Object is remote
+ * ENOLINK 67 Link has been severed
+ * EADV 68 Advertise error
+ * ESRMNT 69 Srmount error
+ * ECOMM 70 Communication error on send
+ * EPROTO 71 Protocol error
+ * EMULTIHOP 72 Multihop attempted
+ * EDOTDOT 73 RFS specific error
+ * EBADMSG 74 Bad message
+ * EOVERFLOW 75 Value too large for defined data type
+ * ENOTUNIQ 76 Name not unique on network
+ * EBADFD 77 File descriptor in bad state
+ * EREMCHG 78 Remote address changed
+ * ELIBACC 79 Can not access a needed shared library
+ * ELIBBAD 80 Accessing a corrupted shared library
+ * ELIBSCN 81 .lib section in a.out corrupted
+ * ELIBMAX 82 Attempting to link in too many shared libraries
+ * ELIBEXEC 83 Cannot exec a shared library directly
+ * EILSEQ 84 Invalid or incomplete multibyte or wide character
+ * ERESTART 85 Interrupted system call should be restarted
+ * ESTRPIPE 86 Streams pipe error
+ * EUSERS 87 Too many users
+ * ENOTSOCK 88 Socket operation on non-socket
+ * EDESTADDRREQ 89 Destination address required
+ * EMSGSIZE 90 Message too long
+ * EPROTOTYPE 91 Protocol wrong type for socket
+ * ENOPROTOOPT 92 Protocol not available
+ * EPROTONOSUPPORT 93 Protocol not supported
+ * ESOCKTNOSUPPORT 94 Socket type not supported
+ * EOPNOTSUPP 95 Operation not supported
+ * EPFNOSUPPORT 96 Protocol family not supported
+ * EAFNOSUPPORT 97 Address family not supported by protocol
+ * EADDRINUSE 98 Address already in use
+ * EADDRNOTAVAIL 99 Cannot assign requested address
+ * ENETDOWN 100 Network is down
+ * ENETUNREACH 101 Network is unreachable
+ * ENETRESET 102 Network dropped connection on reset
+ * ECONNABORTED 103 Software caused connection abort
+ * ECONNRESET 104 Connection reset by peer
+ * ENOBUFS 105 No buffer space available
+ * EISCONN 106 Transport endpoint is already connected
+ * ENOTCONN 107 Transport endpoint is not connected
+ * ESHUTDOWN 108 Cannot send after transport endpoint shutdown
+ * ETOOMANYREFS 109 Too many references: cannot splice
+ * ETIMEDOUT 110 Connection timed out
+ * ECONNREFUSED 111 Connection refused
+ * EHOSTDOWN 112 Host is down
+ * EHOSTUNREACH 113 No route to host
+ * EALREADY 114 Operation already in progress
+ * EINPROGRESS 115 Operation now in progress
+ * ESTALE 116 Stale file handle
+ * EUCLEAN 117 Structure needs cleaning
+ * ENOTNAM 118 Not a XENIX named type file
+ * ENAVAIL 119 No XENIX semaphores available
+ * EISNAM 120 Is a named type file
+ * EREMOTEIO 121 Remote I/O error
+ * EDQUOT 122 Disk quota exceeded
+ * ENOMEDIUM 123 No medium found
+ * EMEDIUMTYPE 124 Wrong medium type
+ * ECANCELED 125 Operation canceled
+ * ENOKEY 126 Required key not available
+ * EKEYEXPIRED 127 Key has expired
+ * EKEYREVOKED 128 Key has been revoked
+ * EKEYREJECTED 129 Key was rejected by service
+ * EOWNERDEAD 130 Owner died
+ * ENOTRECOVERABLE 131 State not recoverable
+ * ERFKILL 132 Operation not possible due to RF-kill
+ * EHWPOISON 133 Memory page has hardware error
+ * ENOTSUP 95 Operation not supported
+ * ------------------------------------------------------------------- */
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -205,6 +346,21 @@ void warn_errno( const char *inMessage, const char *inFile, int inLine ) {
#endif
} /* end warn_errno */
+int errno_decode (char *text, size_t len) {
+ int my_err;
+ const char* my_str;
+ /* get platform's errno and error message */
+#ifdef WIN32
+ my_err = WSAGetLastError();
+ my_str = winsock_strerror( my_err );
+#else
+ my_err = errno;
+ my_str = strerror( my_err );
+#endif
+ strncpy(text, my_str, len);
+ return my_err;
+}
+
#ifdef __cplusplus
} /* end extern "C" */
#endif
diff --git a/compat/gettcpinfo.c b/compat/gettcpinfo.c
index 11f92fe..f7067e9 100644
--- a/compat/gettcpinfo.c
+++ b/compat/gettcpinfo.c
@@ -42,6 +42,16 @@
* gettcpinfo.c
* Suppport for tcp info in a portable way
*
+ * Hi Bob,
+ *
+ * I would suggest that the most interesting metrics from tcp_info would be:
+ *
+ * double ecn_mark_rate = (double)tcpi_delivered_ce / (double)tcpi_delivered
+ * double retransmit_rate = (double)(tcpi_total_retrans - tcpi_dsack_dups) / (double)tcpi_data_segs_out
+ * double smoothed_rtt = tcpi_rtt
+ *
+ * neal
+ *
* by Robert J. McMahon (rjmcmahon@rjmcmahon.com, bob.mcmahon@broadcom.com)
* -------------------------------------------------------------------
*/
@@ -59,11 +69,29 @@ inline void gettcpinfo (int sock, struct iperf_tcpstats *stats) {
struct tcp_info tcp_info_buf;
socklen_t tcp_info_length = sizeof(struct tcp_info);
if ((sock > 0) && !(getsockopt(sock, IPPROTO_TCP, TCP_INFO, &tcp_info_buf, &tcp_info_length) < 0)) {
+#if HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND
+ stats->cwnd_packets = tcp_info_buf.tcpi_snd_cwnd;
+#else
+ stats->cwnd_packets = -1;
+#endif
+#if HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND && HAVE_STRUCT_TCP_INFO_TCPI_SND_MSS
stats->cwnd = tcp_info_buf.tcpi_snd_cwnd * tcp_info_buf.tcpi_snd_mss / 1024;
+#else
+ stats->cwnd = -1;
+#endif
stats->rtt = tcp_info_buf.tcpi_rtt;
stats->rttvar = tcp_info_buf.tcpi_rttvar;
stats->retry_tot = tcp_info_buf.tcpi_total_retrans;
+#if HAVE_STRUCT_TCP_INFO_TCPI_SND_MSS
stats->mss_negotiated = tcp_info_buf.tcpi_snd_mss;
+#else
+ stats->mss_negotiated = -1;
+#endif
+#if HAVE_TCP_INFLIGHT
+ stats->packets_in_flight = (tcp_info_buf.tcpi_unacked - tcp_info_buf.tcpi_sacked - \
+ tcp_info_buf.tcpi_lost + tcp_info_buf.tcpi_retrans);
+ stats->bytes_in_flight = stats->packets_in_flight * tcp_info_buf.tcpi_snd_mss / 1024;
+#endif
stats->isValid = true;
#elif HAVE_DECL_TCP_CONNECTION_INFO
struct tcp_connection_info tcp_info_buf;
@@ -71,8 +99,10 @@ inline void gettcpinfo (int sock, struct iperf_tcpstats *stats) {
if ((sock > 0) && !(getsockopt(sock, IPPROTO_TCP, TCP_CONNECTION_INFO, &tcp_info_buf, &tcp_info_length) < 0)) {
#ifdef __APPLE__
stats->cwnd = tcp_info_buf.tcpi_snd_cwnd / 1024;
+ stats->cwnd_packets = -1;
#else
stats->cwnd = tcp_info_buf.tcpi_snd_cwnd * tcp_info_buf.tcpi_maxseg / 1024;
+ stats->cwnd_packets = tcp_info_buf.tcpi_snd_cwnd;
#endif
stats->rtt = tcp_info_buf.tcpi_rttcur * 1000; // OS X units is ms
stats->rttvar = tcp_info_buf.tcpi_rttvar;
@@ -87,12 +117,18 @@ inline void gettcpinfo (int sock, struct iperf_tcpstats *stats) {
}
inline void tcpstats_copy (struct iperf_tcpstats *stats_dst, struct iperf_tcpstats *stats_src) {
stats_dst->cwnd = stats_src->cwnd;
+ stats_dst->cwnd_packets = stats_src->cwnd_packets;
stats_dst->rtt = stats_src->rtt;
stats_dst->rttvar = stats_src->rttvar;
stats_dst->mss_negotiated = stats_src->mss_negotiated;
stats_dst->retry_tot = stats_src->retry_tot;
stats_dst->connecttime = stats_src->connecttime;
stats_dst->isValid = stats_src->isValid;
+#if HAVE_TCP_INFLIGHT
+ stats_dst->packets_in_flight = stats_src->packets_in_flight;
+ stats_dst->bytes_in_flight = stats_src->bytes_in_flight;
+#endif
+
}
#else
#if WIN32
diff --git a/config.h.in b/config.h.in
index 267e661..4d96644 100644
--- a/config.h.in
+++ b/config.h.in
@@ -16,156 +16,236 @@
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
-/* Define to 1 if you have the `atexit' function. */
+/* Define to 1 if you have the 'atexit' function. */
#undef HAVE_ATEXIT
-/* Define to 1 if you have the `clock_gettime' function. */
+/* Define to 1 if you have the 'clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
-/* Define to 1 if you have the `clock_nanosleep' function. */
+/* Define to 1 if you have the 'clock_nanosleep' function. */
#undef HAVE_CLOCK_NANOSLEEP
-/* Define to 1 if you have the declaration of `AF_INET6', and to 0 if you
+/* Define to 1 if you have the declaration of 'AF_INET6', and to 0 if you
don't. */
#undef HAVE_DECL_AF_INET6
-/* Define to 1 if you have the declaration of `CPU_SET', and to 0 if you
+/* Define to 1 if you have the declaration of 'CPU_SET', and to 0 if you
don't. */
#undef HAVE_DECL_CPU_SET
-/* Define to 1 if you have the declaration of `ENOBUFS', and to 0 if you
+/* Define to 1 if you have the declaration of 'ENOBUFS', and to 0 if you
don't. */
#undef HAVE_DECL_ENOBUFS
-/* Define to 1 if you have the declaration of `EWOULDBLOCK', and to 0 if you
+/* Define to 1 if you have the declaration of 'EWOULDBLOCK', and to 0 if you
don't. */
#undef HAVE_DECL_EWOULDBLOCK
-/* Define to 1 if you have the declaration of `IFF_TAP', and to 0 if you
+/* Define to 1 if you have the declaration of 'IFF_TAP', and to 0 if you
don't. */
#undef HAVE_DECL_IFF_TAP
-/* Define to 1 if you have the declaration of `IFF_TUN', and to 0 if you
+/* Define to 1 if you have the declaration of 'IFF_TUN', and to 0 if you
don't. */
#undef HAVE_DECL_IFF_TUN
-/* Define to 1 if you have the declaration of `IPV6_ADD_MEMBERSHIP', and to 0
+/* Define to 1 if you have the declaration of 'IPV6_ADD_MEMBERSHIP', and to 0
if you don't. */
#undef HAVE_DECL_IPV6_ADD_MEMBERSHIP
-/* Define to 1 if you have the declaration of `IPV6_JOIN_GROUP', and to 0 if
+/* Define to 1 if you have the declaration of 'IPV6_JOIN_GROUP', and to 0 if
you don't. */
#undef HAVE_DECL_IPV6_JOIN_GROUP
-/* Define to 1 if you have the declaration of `IPV6_MULTICAST_HOPS', and to 0
+/* Define to 1 if you have the declaration of 'IPV6_LEAVE_GROUP', and to 0 if
+ you don't. */
+#undef HAVE_DECL_IPV6_LEAVE_GROUP
+
+/* Define to 1 if you have the declaration of 'IPV6_MULTICAST_HOPS', and to 0
if you don't. */
#undef HAVE_DECL_IPV6_MULTICAST_HOPS
-/* Define to 1 if you have the declaration of `IPV6_TCLASS', and to 0 if you
+/* Define to 1 if you have the declaration of 'IPV6_MULTICAST_IF', and to 0 if
+ you don't. */
+#undef HAVE_DECL_IPV6_MULTICAST_IF
+
+/* Define to 1 if you have the declaration of 'IPV6_TCLASS', and to 0 if you
don't. */
#undef HAVE_DECL_IPV6_TCLASS
-/* Define to 1 if you have the declaration of `IPV6_V6ONLY', and to 0 if you
+/* Define to 1 if you have the declaration of 'IPV6_V6ONLY', and to 0 if you
don't. */
#undef HAVE_DECL_IPV6_V6ONLY
-/* Define to 1 if you have the declaration of `IP_ADD_MEMBERSHIP', and to 0 if
+/* Define to 1 if you have the declaration of 'IP_ADD_MEMBERSHIP', and to 0 if
you don't. */
#undef HAVE_DECL_IP_ADD_MEMBERSHIP
-/* Define to 1 if you have the declaration of `IP_ADD_SOURCE_MEMBERSHIP', and
+/* Define to 1 if you have the declaration of 'IP_ADD_SOURCE_MEMBERSHIP', and
to 0 if you don't. */
#undef HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP
-/* Define to 1 if you have the declaration of `IP_MULTICAST_ALL', and to 0 if
+/* Define to 1 if you have the declaration of 'IP_BLOCK_SOURCE', and to 0 if
+ you don't. */
+#undef HAVE_DECL_IP_BLOCK_SOURCE
+
+/* Define to 1 if you have the declaration of 'IP_DROP_MEMBERSHIP', and to 0
+ if you don't. */
+#undef HAVE_DECL_IP_DROP_MEMBERSHIP
+
+/* Define to 1 if you have the declaration of 'IP_DROP_SOURCE_MEMBERSHIP', and
+ to 0 if you don't. */
+#undef HAVE_DECL_IP_DROP_SOURCE_MEMBERSHIP
+
+/* Define to 1 if you have the declaration of 'IP_MULTICAST_ALL', and to 0 if
you don't. */
#undef HAVE_DECL_IP_MULTICAST_ALL
-/* Define to 1 if you have the declaration of `IP_TOS', and to 0 if you don't.
+/* Define to 1 if you have the declaration of 'IP_MULTICAST_IF', and to 0 if
+ you don't. */
+#undef HAVE_DECL_IP_MULTICAST_IF
+
+/* Define to 1 if you have the declaration of 'IP_TOS', and to 0 if you don't.
*/
#undef HAVE_DECL_IP_TOS
-/* Define to 1 if you have the declaration of `MCAST_JOIN_GROUP', and to 0 if
+/* Define to 1 if you have the declaration of 'IP_UNBLOCK_SOURCE', and to 0 if
+ you don't. */
+#undef HAVE_DECL_IP_UNBLOCK_SOURCE
+
+/* Define to 1 if you have the declaration of 'MCAST_BLOCK_SOURCE', and to 0
+ if you don't. */
+#undef HAVE_DECL_MCAST_BLOCK_SOURCE
+
+/* Define to 1 if you have the declaration of 'MCAST_JOIN_GROUP', and to 0 if
you don't. */
#undef HAVE_DECL_MCAST_JOIN_GROUP
-/* Define to 1 if you have the declaration of `MCAST_JOIN_SOURCE_GROUP', and
+/* Define to 1 if you have the declaration of 'MCAST_JOIN_SOURCE_GROUP', and
to 0 if you don't. */
#undef HAVE_DECL_MCAST_JOIN_SOURCE_GROUP
-/* Define to 1 if you have the declaration of `MSG_DONTWAIT', and to 0 if you
+/* Define to 1 if you have the declaration of 'MCAST_LEAVE_GROUP', and to 0 if
+ you don't. */
+#undef HAVE_DECL_MCAST_LEAVE_GROUP
+
+/* Define to 1 if you have the declaration of 'MCAST_LEAVE_SOURCE_GROUP', and
+ to 0 if you don't. */
+#undef HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP
+
+/* Define to 1 if you have the declaration of 'MCAST_UNBLOCK_SOURCE', and to 0
+ if you don't. */
+#undef HAVE_DECL_MCAST_UNBLOCK_SOURCE
+
+/* Define to 1 if you have the declaration of 'MSG_CTRUNC', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MSG_CTRUNC
+
+/* Define to 1 if you have the declaration of 'MSG_DONTWAIT', and to 0 if you
don't. */
#undef HAVE_DECL_MSG_DONTWAIT
-/* Define to 1 if you have the declaration of `MSG_PEEK', and to 0 if you
+/* Define to 1 if you have the declaration of 'MSG_ERRQUEUE', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MSG_ERRQUEUE
+
+/* Define to 1 if you have the declaration of 'MSG_PEEK', and to 0 if you
don't. */
#undef HAVE_DECL_MSG_PEEK
-/* Define to 1 if you have the declaration of `MSG_WAITALL', and to 0 if you
+/* Define to 1 if you have the declaration of 'MSG_TRUNC', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MSG_TRUNC
+
+/* Define to 1 if you have the declaration of 'MSG_WAITALL', and to 0 if you
don't. */
#undef HAVE_DECL_MSG_WAITALL
-/* Define to 1 if you have the declaration of `pthread_cancel', and to 0 if
+/* Define to 1 if you have the declaration of 'MSG_ZEROCOPY', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MSG_ZEROCOPY
+
+/* Define to 1 if you have the declaration of 'pthread_cancel', and to 0 if
you don't. */
#undef HAVE_DECL_PTHREAD_CANCEL
-/* Define to 1 if you have the declaration of `SIGALRM', and to 0 if you
+/* Define to 1 if you have the declaration of 'pthread_threadid_np', and to 0
+ if you don't. */
+#undef HAVE_DECL_PTHREAD_THREADID_NP
+
+/* Define to 1 if you have the declaration of 'SIGALRM', and to 0 if you
don't. */
#undef HAVE_DECL_SIGALRM
-/* Define to 1 if you have the declaration of `SIOCGIFMTU', and to 0 if you
+/* Define to 1 if you have the declaration of 'SIOCGIFMTU', and to 0 if you
don't. */
#undef HAVE_DECL_SIOCGIFMTU
-/* Define to 1 if you have the declaration of `SO_BINDTODEVICE', and to 0 if
+/* Define to 1 if you have the declaration of 'SO_BINDTODEVICE', and to 0 if
you don't. */
#undef HAVE_DECL_SO_BINDTODEVICE
-/* Define to 1 if you have the declaration of `SO_DONTROUTE', and to 0 if you
+/* Define to 1 if you have the declaration of 'SO_DONTROUTE', and to 0 if you
don't. */
#undef HAVE_DECL_SO_DONTROUTE
-/* Define to 1 if you have the declaration of `SO_MAX_PACING_RATE', and to 0
+/* Define to 1 if you have the declaration of 'SO_MAX_PACING_RATE', and to 0
if you don't. */
#undef HAVE_DECL_SO_MAX_PACING_RATE
-/* Define to 1 if you have the declaration of `SO_REUSEPORT', and to 0 if you
+/* Define to 1 if you have the declaration of 'SO_REUSEADDR', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SO_REUSEADDR
+
+/* Define to 1 if you have the declaration of 'SO_REUSEPORT', and to 0 if you
don't. */
#undef HAVE_DECL_SO_REUSEPORT
-/* Define to 1 if you have the declaration of `SO_SNDTIMEO', and to 0 if you
+/* Define to 1 if you have the declaration of 'SO_SNDTIMEO', and to 0 if you
don't. */
#undef HAVE_DECL_SO_SNDTIMEO
-/* Define to 1 if you have the declaration of `SO_TIMESTAMP', and to 0 if you
+/* Define to 1 if you have the declaration of 'SO_TIMESTAMP', and to 0 if you
don't. */
#undef HAVE_DECL_SO_TIMESTAMP
-/* Define to 1 if you have the declaration of `TCP_CONNECTION_INFO', and to 0
+/* Define to 1 if you have the declaration of 'SO_ZEROCOPY', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SO_ZEROCOPY
+
+/* Define to 1 if you have the declaration of 'TCP_CONGESTION', and to 0 if
+ you don't. */
+#undef HAVE_DECL_TCP_CONGESTION
+
+/* Define to 1 if you have the declaration of 'TCP_CONNECTION_INFO', and to 0
if you don't. */
#undef HAVE_DECL_TCP_CONNECTION_INFO
-/* Define to 1 if you have the declaration of `TCP_INFO', and to 0 if you
+/* Define to 1 if you have the declaration of 'TCP_INFO', and to 0 if you
don't. */
#undef HAVE_DECL_TCP_INFO
-/* Define to 1 if you have the declaration of `TCP_MAXSEG', and to 0 if you
+/* Define to 1 if you have the declaration of 'TCP_MAXSEG', and to 0 if you
don't. */
#undef HAVE_DECL_TCP_MAXSEG
-/* Define to 1 if you have the declaration of `TCP_NODELAY', and to 0 if you
+/* Define to 1 if you have the declaration of 'TCP_NODELAY', and to 0 if you
don't. */
#undef HAVE_DECL_TCP_NODELAY
-/* Define to 1 if you have the declaration of `TCP_NOTSENT_LOWAT', and to 0 if
+/* Define to 1 if you have the declaration of 'TCP_NOTSENT_LOWAT', and to 0 if
you don't. */
#undef HAVE_DECL_TCP_NOTSENT_LOWAT
-/* Define to 1 if you have the declaration of `TCP_QUICKACK', and to 0 if you
+/* Define to 1 if you have the declaration of 'TCP_QUICKACK', and to 0 if you
don't. */
#undef HAVE_DECL_TCP_QUICKACK
-/* Define to 1 if you have the declaration of `TCP_WINDOW_CLAMP', and to 0 if
+/* Define to 1 if you have the declaration of 'TCP_TX_DELAY', and to 0 if you
+ don't. */
+#undef HAVE_DECL_TCP_TX_DELAY
+
+/* Define to 1 if you have the declaration of 'TCP_WINDOW_CLAMP', and to 0 if
you don't. */
#undef HAVE_DECL_TCP_WINDOW_CLAMP
@@ -173,31 +253,31 @@
SO_DONTROUTE) should be the default */
#undef HAVE_DEFAULT_DONTROUTE_ON
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+/* Define to 1 if you don't have 'vprintf' but do have '_doprnt.' */
#undef HAVE_DOPRNT
/* Define if fast sampling for report intervals is desired */
#undef HAVE_FASTSAMPLING
-/* Define to 1 if you have the `freopen' function. */
+/* Define to 1 if you have the 'freopen' function. */
#undef HAVE_FREOPEN
/* Define if syscall(SYS_gettid) available. */
#undef HAVE_GETTID_SYSCALL
-/* Define to 1 if you have the `gettimeofday' function. */
+/* Define to 1 if you have the 'gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <ifaddrs.h> header file. */
#undef HAVE_IFADDRS_H
-/* Define to 1 if you have the `inet_ntop' function. */
+/* Define to 1 if you have the 'inet_ntop' function. */
#undef HAVE_INET_NTOP
-/* Define to 1 if you have the `inet_pton' function. */
+/* Define to 1 if you have the 'inet_pton' function. */
#undef HAVE_INET_PTON
-/* Define to 1 if the system has the type `int64_t'. */
+/* Define to 1 if the system has the type 'int64_t'. */
#undef HAVE_INT64_T
/* Define to 1 if you have the <inttypes.h> header file. */
@@ -218,7 +298,7 @@
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
-/* Define to 1 if you have the `rt' library (-lrt). */
+/* Define to 1 if you have the 'rt' library (-lrt). */
#undef HAVE_LIBRT
/* Define to 1 if you have the <linux/filter.h> header file. */
@@ -236,22 +316,25 @@
/* Define to 1 if you have the <linux/sockios.h> header file. */
#undef HAVE_LINUX_SOCKIOS_H
+/* Define to 1 if you have the <linux/tcp.h> header file. */
+#undef HAVE_LINUX_TCP_H
+
/* Define to 1 if you have the <linux/udp.h> header file. */
#undef HAVE_LINUX_UDP_H
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
+/* Define to 1 if you have the 'memset' function. */
#undef HAVE_MEMSET
-/* Define to 1 if you have the `mlockall' function. */
+/* Define to 1 if you have the 'mlockall' function. */
#undef HAVE_MLOCKALL
/* Define to enable multicast support */
#undef HAVE_MULTICAST
-/* Define to 1 if you have the `nanosleep' function. */
+/* Define if use of IP_MULTICAST_ALL is desired and available */
+#undef HAVE_MULTICAST_ALL_DISABLE
+
+/* Define to 1 if you have the 'nanosleep' function. */
#undef HAVE_NANOSLEEP
/* Define to 1 if you have the <netdb.h> header file. */
@@ -284,28 +367,28 @@
/* Define if role reversal ids are desired */
#undef HAVE_ROLE_REVERSAL_ID
-/* Define to 1 if you have the `sched_setscheduler' function. */
+/* Define to 1 if you have the 'sched_setscheduler' function. */
#undef HAVE_SCHED_SETSCHEDULER
-/* Define to 1 if you have the `sched_yield' function. */
+/* Define to 1 if you have the 'sched_yield' function. */
#undef HAVE_SCHED_YIELD
-/* Define to 1 if you have the `select' function. */
+/* Define to 1 if you have the 'select' function. */
#undef HAVE_SELECT
/* Define if 64 bit sequence numbers are desired and available */
#undef HAVE_SEQNO64b
-/* Define to 1 if you have the `setitimer' function. */
+/* Define to 1 if you have the 'setitimer' function. */
#undef HAVE_SETITIMER
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
-/* Define to 1 if you have the `snprintf' function. */
+/* Define to 1 if you have the 'snprintf' function. */
#undef HAVE_SNPRINTF
-/* Define to 1 if the system has the type `ssize_t'. */
+/* Define to 1 if the system has the type 'ssize_t'. */
#undef HAVE_SSIZE_T
/* Define to enable ssm multicast support */
@@ -317,16 +400,19 @@
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Define to 1 if you have the `strchr' function. */
+/* Define to 1 if you have the 'strchr' function. */
#undef HAVE_STRCHR
-/* Define to 1 if you have the `strerror' function. */
+/* Define to 1 if you have the 'strerror' function. */
#undef HAVE_STRERROR
-/* Define to 1 if you have the `strftime' function. */
+/* Define to 1 if you have the 'strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
@@ -335,43 +421,79 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define to 1 if you have the `strtod' function. */
+/* Define to 1 if you have the 'strtod' function. */
#undef HAVE_STRTOD
-/* Define to 1 if you have the `strtol' function. */
+/* Define to 1 if you have the 'strtol' function. */
#undef HAVE_STRTOL
-/* Define to 1 if you have the `strtoll' function. */
+/* Define to 1 if you have the 'strtoll' function. */
#undef HAVE_STRTOLL
-/* Define to 1 if the system has the type `struct group_source_req'. */
+/* Define to 1 if the system has the type 'struct group_source_req'. */
#undef HAVE_STRUCT_GROUP_SOURCE_REQ
-/* Define to 1 if the system has the type `struct ipv6_mreq'. */
+/* Define to 1 if the system has the type 'struct ipv6_mreq'. */
#undef HAVE_STRUCT_IPV6_MREQ
-/* Define to 1 if the system has the type `struct ip_mreq'. */
+/* Define to 1 if the system has the type 'struct ip_mreq'. */
#undef HAVE_STRUCT_IP_MREQ
-/* Define to 1 if the system has the type `struct ip_mreq_source'. */
+/* Define to 1 if the system has the type 'struct ip_mreqn'. */
+#undef HAVE_STRUCT_IP_MREQN
+
+/* Define to 1 if the system has the type 'struct ip_mreq_source'. */
#undef HAVE_STRUCT_IP_MREQ_SOURCE
-/* Define to 1 if `imr_multiaddr.s_addr' is a member of `struct
+/* Define to 1 if 'imr_multiaddr.s_addr' is a member of 'struct
ip_mreq_source'. */
#undef HAVE_STRUCT_IP_MREQ_SOURCE_IMR_MULTIADDR_S_ADDR
-/* Define to 1 if the system has the type `struct sockaddr_in6'. */
+/* Define to 1 if the system has the type 'struct sockaddr_in6'. */
#undef HAVE_STRUCT_SOCKADDR_IN6
-/* Define to 1 if `sin6_len' is a member of `struct sockaddr_in6'. */
+/* Define to 1 if 'sin6_len' is a member of 'struct sockaddr_in6'. */
#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
-/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+/* Define to 1 if the system has the type 'struct sockaddr_storage'. */
#undef HAVE_STRUCT_SOCKADDR_STORAGE
-/* Define to 1 if `tcpi_total_retrans' is a member of `struct tcp_info'. */
+/* Define to 1 if 'tcpi_data_segs_out' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_DATA_SEGS_OUT
+
+/* Define to 1 if 'tcpi_delivered' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_DELIVERED
+
+/* Define to 1 if 'tcpi_delivered_ce' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_DELIVERED_CE
+
+/* Define to 1 if 'tcpi_dsack_dups' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_DSACK_DUPS
+
+/* Define to 1 if 'tcpi_lost' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_LOST
+
+/* Define to 1 if 'tcpi_retrans' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_RETRANS
+
+/* Define to 1 if 'tcpi_sacked' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_SACKED
+
+/* Define to 1 if 'tcpi_snd_cwnd' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND
+
+/* Define to 1 if 'tcpi_snd_mss' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_SND_MSS
+
+/* Define to 1 if 'tcpi_total_retrans' is a member of 'struct tcp_info'. */
#undef HAVE_STRUCT_TCP_INFO_TCPI_TOTAL_RETRANS
+/* Define to 1 if 'tcpi_unacked' is a member of 'struct tcp_info'. */
+#undef HAVE_STRUCT_TCP_INFO_TCPI_UNACKED
+
+/* Define for interval summing debugging */
+#undef HAVE_SUMMING_DEBUG
+
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
@@ -399,7 +521,7 @@
/* Define to enable tcp stats support */
#undef HAVE_TCP_STATS
-/* Define for thread level debugging of the code */
+/* Define for thread level debugging */
#undef HAVE_THREAD_DEBUG
/* TUNTAP_TAP support is available */
@@ -411,10 +533,13 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define to 1 if you have the `usleep' function. */
+/* Define if select based writes are desired */
+#undef HAVE_USE_WRITE_SELECT
+
+/* Define to 1 if you have the 'usleep' function. */
#undef HAVE_USLEEP
-/* Define to 1 if you have the `vprintf' function. */
+/* Define to 1 if you have the 'vprintf' function. */
#undef HAVE_VPRINTF
/* Define if Web100 is desired and available */
@@ -426,7 +551,7 @@
/* Define if winsock2.h exists. */
#undef HAVE_WINSOCK2_H
-/* Define to 1 if the system has the type `_Bool'. */
+/* Define to 1 if the system has the type '_Bool'. */
#undef HAVE__BOOL
/* Define to disable asserts */
@@ -460,25 +585,28 @@
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
-/* Define to the type of arg 1 for `select'. */
+/* Define to the type of arg 1 for 'select'. */
#undef SELECT_TYPE_ARG1
-/* Define to the type of args 2, 3 and 4 for `select'. */
+/* Define to the type of args 2, 3 and 4 for 'select'. */
#undef SELECT_TYPE_ARG234
-/* Define to the type of arg 5 for `select'. */
+/* Define to the type of arg 5 for 'select'. */
#undef SELECT_TYPE_ARG5
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C89 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Define 3rd arg of accept */
#undef Socklen_t
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
+ macro is obsolete. */
#undef TIME_WITH_SYS_TIME
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
@@ -499,10 +627,10 @@
/* */
#undef _REENTRANT
-/* Define to empty if `const' does not conform to ANSI C. */
+/* Define to empty if 'const' does not conform to ANSI C. */
#undef const
-/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* Define as 'unsigned int' if <stddef.h> doesn't define. */
#undef size_t
/* Define to "int" if <sys/types.h> does not define. */
diff --git a/configure b/configure
index 693b629..9f50d72 100755
--- a/configure
+++ b/configure
@@ -1,9 +1,10 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for Iperf 2.1.9.
+# Generated by GNU Autoconf 2.72 for Iperf 2.2.0.
#
#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
+# Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -14,63 +15,65 @@
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
+else case e in #(
+ e) case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
+esac ;;
esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -79,13 +82,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -94,43 +90,27 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
+# We did not find ourselves, most probably we were run as 'sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
@@ -151,26 +131,28 @@ case $- in # ((((
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
+# out after a failed 'exec'.
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
+else case e in #(
+ e) case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
+esac ;;
esac
fi
"
@@ -185,42 +167,55 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+if ( set x; as_fn_ret_success y && test x = \"\$1\" )
+then :
-else
- exitcode=1; echo positional parameters were not saved.
+else case e in #(
+ e) exitcode=1; echo positional parameters were not saved. ;;
+esac
fi
test x\$exitcode = x0 || exit 1
+blah=\$(echo \$(echo blah))
+test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
+ if (eval "$as_required") 2>/dev/null
+then :
as_have_required=yes
-else
- as_have_required=no
+else case e in #(
+ e) as_have_required=no ;;
+esac
fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
+then :
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+else case e in #(
+ e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
+ as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
+then :
break 2
fi
fi
@@ -228,14 +223,22 @@ fi
esac
as_found=false
done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
IFS=$as_save_IFS
+if $as_found
+then :
+
+else case e in #(
+ e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi ;;
+esac
+fi
- if test "x$CONFIG_SHELL" != x; then :
+ if test "x$CONFIG_SHELL" != x
+then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
@@ -252,25 +255,27 @@ case $- in # ((((
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+# out after a failed 'exec'.
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ if test x$as_have_required = xno
+then :
+ printf "%s\n" "$0: This script requires a shell more modern than all"
+ printf "%s\n" "$0: the shells that I found on your system."
+ if test ${ZSH_VERSION+y} ; then
+ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+ printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
-fi
+fi ;;
+esac
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
@@ -291,6 +296,7 @@ as_fn_unset ()
}
as_unset=as_fn_unset
+
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
@@ -322,7 +328,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -331,7 +337,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -370,16 +376,18 @@ as_fn_executable_p ()
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
- as_fn_append ()
+else case e in #(
+ e) as_fn_append ()
{
eval $1=\$$1\$2
- }
+ } ;;
+esac
fi # as_fn_append
# as_fn_arith ARG...
@@ -387,16 +395,18 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
- as_fn_arith ()
+else case e in #(
+ e) as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
- }
+ } ;;
+esac
fi # as_fn_arith
@@ -410,9 +420,9 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -439,7 +449,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -472,6 +482,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
/[$]LINENO/=
' <$as_myself |
sed '
+ t clear
+ :clear
s/[$]LINENO.*/&-/
t lineno
b
@@ -483,7 +495,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
@@ -497,6 +509,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
exit
}
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -510,6 +526,12 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -521,9 +543,9 @@ if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
+ # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable.
+ # In both cases, we have to default to 'cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
@@ -548,10 +570,12 @@ as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed '$as_sed_sh'" # deprecated
test -n "$DJDIR" || exec 7<&0 </dev/null
@@ -577,47 +601,44 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Iperf'
PACKAGE_TARNAME='iperf'
-PACKAGE_VERSION='2.1.9'
-PACKAGE_STRING='Iperf 2.1.9'
+PACKAGE_VERSION='2.2.0'
+PACKAGE_STRING='Iperf 2.2.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
# Factoring default headers for most tests.
ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
+#include <stddef.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
#endif
-#ifdef STDC_HEADERS
+#ifdef HAVE_STDLIB_H
# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
#endif
#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
# include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
+ac_header_c_list=
+ac_func_c_list=
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
@@ -628,12 +649,12 @@ WEB100_LIBS
WEB100_CFLAGS
WEB100_CONFIG
LIBOBJS
+EGREP
+GREP
PTHREAD_CFLAGS
PTHREAD_LIBS
PTHREAD_CC
ax_pthread_config
-EGREP
-GREP
CPP
SED
host_os
@@ -679,6 +700,8 @@ ENABLE_STATIC_BIN_FALSE
ENABLE_STATIC_BIN_TRUE
CHECKPROGRAMS_FALSE
CHECKPROGRAMS_TRUE
+SUMMING_DEBUG_FALSE
+SUMMING_DEBUG_TRUE
PACKET_DEBUG_FALSE
PACKET_DEBUG_TRUE
THREAD_DEBUG_FALSE
@@ -694,6 +717,9 @@ AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
+CSCOPE
+ETAGS
+CTAGS
am__untar
am__tar
AMTAR
@@ -769,6 +795,8 @@ enable_threads
enable_debuginfo
enable_web100
enable_kalman
+enable_multicast_all
+enable_write_select
enable_role_reversal_id
enable_default_localonly
enable_seqno64b
@@ -776,6 +804,7 @@ enable_fastsampling
enable_discover_defaultlen
enable_thread_debug
enable_packet_debug
+enable_summing_debug
enable_checkprograms
enable_static_bin
enable_debug_symbols
@@ -864,8 +893,6 @@ do
*) ac_optarg=yes ;;
esac
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
@@ -906,9 +933,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: '$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -932,9 +959,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: '$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
@@ -1145,9 +1172,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: '$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1161,9 +1188,9 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: '$ac_useropt'"
ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
@@ -1191,8 +1218,8 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
+ -*) as_fn_error $? "unrecognized option: '$ac_option'
+Try '$0 --help' for more information"
;;
*=*)
@@ -1200,16 +1227,16 @@ Try \`$0 --help' for more information"
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ as_fn_error $? "invalid variable name: '$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
@@ -1225,7 +1252,7 @@ if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1250,7 +1277,7 @@ do
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
-# There might be people who depend on the old broken behavior: `$host'
+# There might be people who depend on the old broken behavior: '$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
@@ -1289,7 +1316,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
+printf "%s\n" X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -1318,7 +1345,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
@@ -1346,7 +1373,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures Iperf 2.1.9 to adapt to many kinds of systems.
+'configure' configures Iperf 2.2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1360,11 +1387,11 @@ Configuration:
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
+ -q, --quiet, --silent do not print 'checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
+ -C, --config-cache alias for '--cache-file=config.cache'
-n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
+ --srcdir=DIR find the sources in DIR [configure dir or '..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -1372,10 +1399,10 @@ Installation directories:
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
+By default, 'make install' will install all the files in
+'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than '$ac_default_prefix' using '--prefix',
+for instance '--prefix=\$HOME'.
For better control, use the options below.
@@ -1417,7 +1444,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Iperf 2.1.9:";;
+ short | recursive ) echo "Configuration of Iperf 2.2.0:";;
esac
cat <<\_ACEOF
@@ -1438,6 +1465,10 @@ Optional Features:
(default is no)
--disable-web100 disable web100 support (default is autodetect)
--disable-kalman disable kalman delay tuning (default is enable)
+ --disable-multicast-all enable the use of IP_MULITICAST_ALL (default is
+ disable)
+ --disable-write-select disable use of select before writes (default is
+ enable)
--disable-role-reversal-id
disable role reversal special characters (default is
enable)
@@ -1455,6 +1486,8 @@ Optional Features:
disable)
--enable-packet-debug enable support for packet level debugging (default
is disable)
+ --enable-summing-debug enable support for interval summing debugging
+ (default is disable)
--enable-checkprograms enable support for building support programs such as
checkdelay, checkpdfs, etc. (default is disable)
--enable-static-bin link iperf binary statically
@@ -1479,7 +1512,7 @@ Some influential environment variables:
CXXFLAGS C++ compiler flags
CPP C preprocessor
-Use these variables to override the choices made by `configure' or to help
+Use these variables to override the choices made by 'configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
@@ -1498,9 +1531,9 @@ if test "$ac_init_help" = "recursive"; then
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1528,7 +1561,8 @@ esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
+ # Check for configure.gnu first; this name is used for a wrapper for
+ # Metaconfig's "Configure" on case-insensitive file systems.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
@@ -1536,7 +1570,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1545,10 +1579,10 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Iperf configure 2.1.9
-generated by GNU Autoconf 2.69
+Iperf configure 2.2.0
+generated by GNU Autoconf 2.72
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2023 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1565,14 +1599,14 @@ fi
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
+ rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1580,42 +1614,47 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
+ } && test -s conftest.$ac_objext
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=1
+ ac_retval=1 ;;
+esac
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
-# ---------------------------------------------
+# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR
+# ------------------------------------------------------------------
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly.
-ac_fn_c_check_decl ()
+# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.
+ac_fn_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
as_decl_name=`echo $2|sed 's/ *(.*//'`
- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
-$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+printf %s "checking whether $as_decl_name is declared... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ eval ac_save_FLAGS=\$$6
+ as_fn_append $6 " $5"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
#ifndef $as_decl_name
#ifdef __cplusplus
@@ -1629,19 +1668,24 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$3=yes"
-else
- eval "$3=no"
+else case e in #(
+ e) eval "$3=no" ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ eval $6=\$ac_save_FLAGS
+ ;;
+esac
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-} # ac_fn_c_check_decl
+} # ac_fn_check_decl
# ac_fn_cxx_try_compile LINENO
# ----------------------------
@@ -1649,14 +1693,14 @@ $as_echo "$ac_res" >&6; }
ac_fn_cxx_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
+ rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1664,17 +1708,19 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
+ } && test -s conftest.$ac_objext
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=1
+ ac_retval=1 ;;
+esac
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
@@ -1687,14 +1733,14 @@ fi
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
+ rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1702,20 +1748,22 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
- }; then :
+ }
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=1
+ ac_retval=1 ;;
+esac
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
@@ -1739,7 +1787,7 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -1747,17 +1795,19 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
- }; then :
+ }
+then :
ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
+else case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=1
+ ac_retval=1 ;;
+esac
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
@@ -1771,158 +1821,33 @@ fi
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+else case e in #(
+ e) eval "$3=no" ;;
esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-} # ac_fn_c_check_header_mongrel
+} # ac_fn_c_check_header_compile
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
@@ -1931,17 +1856,18 @@ fi
ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=no"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
if (sizeof ($2))
return 0;
@@ -1949,12 +1875,13 @@ if (sizeof ($2))
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
if (sizeof (($2)))
return 0;
@@ -1962,50 +1889,91 @@ if (sizeof (($2)))
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
-else
- eval "$3=yes"
+else case e in #(
+ e) eval "$3=yes" ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that
+# executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+then :
+ ac_retval=0
+else case e in #(
+ e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5
+ printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status ;;
+esac
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+ which can conflict with char $2 (void); below. */
+#include <limits.h>
#undef $2
/* Override any GCC internal prototype to avoid an error.
@@ -2014,7 +1982,7 @@ else
#ifdef __cplusplus
extern "C"
#endif
-char $2 ();
+char $2 (void);
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
@@ -2023,24 +1991,27 @@ choke me
#endif
int
-main ()
+main (void)
{
return $2 ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
eval "$3=yes"
-else
- eval "$3=no"
+else case e in #(
+ e) eval "$3=no" ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext ;;
+esac
fi
eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
@@ -2052,16 +2023,17 @@ $as_echo "$ac_res" >&6; }
ac_fn_c_check_member ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
-$as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+printf %s "checking for $2.$3... " >&6; }
+if eval test \${$4+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
int
-main ()
+main (void)
{
static $2 ac_aggr;
if (ac_aggr.$3)
@@ -2070,14 +2042,15 @@ return 0;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$4=yes"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
int
-main ()
+main (void)
{
static $2 ac_aggr;
if (sizeof ac_aggr.$3)
@@ -2086,29 +2059,53 @@ return 0;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
eval "$4=yes"
-else
- eval "$4=no"
+else case e in #(
+ e) eval "$4=no" ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
eval ac_res=\$$4
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_member
+ac_configure_args_raw=
+for ac_arg
+do
+ case $ac_arg in
+ *\'*)
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_configure_args_raw " '$ac_arg'"
+done
+
+case $ac_configure_args_raw in
+ *$as_nl*)
+ ac_safe_unquote= ;;
+ *)
+ ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
+ ac_unsafe_a="$ac_unsafe_z#~"
+ ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
+ ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
+esac
+
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Iperf $as_me 2.1.9, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+It was created by Iperf $as_me 2.2.0, which was
+generated by GNU Autoconf 2.72. Invocation command line was
- $ $0 $@
+ $ $0$ac_configure_args_raw
_ACEOF
exec 5>>config.log
@@ -2141,8 +2138,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
@@ -2177,7 +2178,7 @@ do
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
@@ -2212,11 +2213,13 @@ done
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
+ # Sanitize IFS.
+ IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
- $as_echo "## ---------------- ##
+ printf "%s\n" "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
@@ -2227,8 +2230,8 @@ trap 'exit_status=$?
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -2252,7 +2255,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
)
echo
- $as_echo "## ----------------- ##
+ printf "%s\n" "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
@@ -2260,14 +2263,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
+ printf "%s\n" "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
@@ -2275,15 +2278,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- $as_echo "$ac_var='\''$ac_val'\''"
+ printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
- $as_echo "## ----------- ##
+ printf "%s\n" "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
@@ -2291,8 +2294,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
echo
fi
test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
+ printf "%s\n" "$as_me: caught signal $ac_signal"
+ printf "%s\n" "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -2306,65 +2309,50 @@ ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
-$as_echo "/* confdefs.h */" > confdefs.h
+printf "%s\n" "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
+printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
+printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
+printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
+printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
+ ac_site_files="$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
+ ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
+ ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+
+for ac_site_file in $ac_site_files
do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ case $ac_site_file in #(
+ */*) :
+ ;; #(
+ *) :
+ ac_site_file=./$ac_site_file ;;
+esac
+ if test -f "$ac_site_file" && test -r "$ac_site_file"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; }
fi
done
@@ -2372,19 +2360,672 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
+# Test code for whether the C compiler supports C89 (global declarations)
+ac_c_conftest_c89_globals='
+/* Does the compiler advertise C89 conformance?
+ Do not test the value of __STDC__, because some compilers set it to 0
+ while being otherwise adequately conformant. */
+#if !defined __STDC__
+# error "Compiler does not advertise C89 conformance"
+#endif
+
+#include <stddef.h>
+#include <stdarg.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
+struct buf { int x; };
+struct buf * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (char **p, int i)
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* C89 style stringification. */
+#define noexpand_stringify(a) #a
+const char *stringified = noexpand_stringify(arbitrary+token=sequence);
+
+/* C89 style token pasting. Exercises some of the corner cases that
+ e.g. old MSVC gets wrong, but not very hard. */
+#define noexpand_concat(a,b) a##b
+#define expand_concat(a,b) noexpand_concat(a,b)
+extern int vA;
+extern int vbee;
+#define aye A
+#define bee B
+int *pvA = &expand_concat(v,aye);
+int *pvbee = &noexpand_concat(v,bee);
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not \xHH hex character constants.
+ These do not provoke an error unfortunately, instead are silently treated
+ as an "x". The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously \x00 != x always comes out true, for an
+ array size at least. It is necessary to write \x00 == 0 to get something
+ that is true only with -std. */
+int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) '\''x'\''
+int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
+ int, int);'
+
+# Test code for whether the C compiler supports C89 (body of main).
+ac_c_conftest_c89_main='
+ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
+'
+
+# Test code for whether the C compiler supports C99 (global declarations)
+ac_c_conftest_c99_globals='
+/* Does the compiler advertise C99 conformance? */
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
+# error "Compiler does not advertise C99 conformance"
+#endif
+
+// See if C++-style comments work.
+
+#include <stdbool.h>
+extern int puts (const char *);
+extern int printf (const char *, ...);
+extern int dprintf (int, const char *, ...);
+extern void *malloc (size_t);
+extern void free (void *);
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+// dprintf is used instead of fprintf to avoid needing to declare
+// FILE and stderr.
+#define debug(...) dprintf (2, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ #error "your preprocessor is broken"
+#endif
+#if BIG_OK
+#else
+ #error "your preprocessor is broken"
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case '\''s'\'': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case '\''d'\'': // int
+ number = va_arg (args_copy, int);
+ break;
+ case '\''f'\'': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}
+'
+
+# Test code for whether the C compiler supports C99 (body of main).
+ac_c_conftest_c99_main='
+ // Check bool.
+ _Bool success = false;
+ success |= (argc != 0);
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+ // Work around memory leak warnings.
+ free (ia);
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[0] = argv[0][0];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
+ || dynamic_array[ni.number - 1] != 543);
+'
+
+# Test code for whether the C compiler supports C11 (global declarations)
+ac_c_conftest_c11_globals='
+/* Does the compiler advertise C11 conformance? */
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
+# error "Compiler does not advertise C11 conformance"
+#endif
+
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+ int_alignment = _Alignof (int),
+ int_array_alignment = _Alignof (int[100]),
+ char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+ int x;
+ _Static_assert (sizeof (int) <= sizeof (long int),
+ "_Static_assert does not work in struct");
+ long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+ union {
+ struct { int i; int j; };
+ struct { int k; long int l; } w;
+ };
+ int m;
+} v1;
+'
+
+# Test code for whether the C compiler supports C11 (body of main).
+ac_c_conftest_c11_main='
+ _Static_assert ((offsetof (struct anonymous, i)
+ == offsetof (struct anonymous, w.k)),
+ "Anonymous union alignment botch");
+ v1.i = 2;
+ v1.w.k = 5;
+ ok |= v1.i != 5;
+'
+
+# Test code for whether the C compiler supports C11 (complete).
+ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+${ac_c_conftest_c11_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ ${ac_c_conftest_c99_main}
+ ${ac_c_conftest_c11_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C99 (complete).
+ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ ${ac_c_conftest_c99_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C89 (complete).
+ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_c_conftest_c89_main}
+ return ok;
+}
+"
+
+# Test code for whether the C++ compiler supports C++98 (global declarations)
+ac_cxx_conftest_cxx98_globals='
+// Does the compiler advertise C++98 conformance?
+#if !defined __cplusplus || __cplusplus < 199711L
+# error "Compiler does not advertise C++98 conformance"
+#endif
+
+// These inclusions are to reject old compilers that
+// lack the unsuffixed header files.
+#include <cstdlib>
+#include <exception>
+
+// <cassert> and <cstring> are *not* freestanding headers in C++98.
+extern void assert (int);
+namespace std {
+ extern int strcmp (const char *, const char *);
+}
+
+// Namespaces, exceptions, and templates were all added after "C++ 2.0".
+using std::exception;
+using std::strcmp;
+
+namespace {
+
+void test_exception_syntax()
+{
+ try {
+ throw "test";
+ } catch (const char *s) {
+ // Extra parentheses suppress a warning when building autoconf itself,
+ // due to lint rules shared with more typical C programs.
+ assert (!(strcmp) (s, "test"));
+ }
+}
+
+template <typename T> struct test_template
+{
+ T const val;
+ explicit test_template(T t) : val(t) {}
+ template <typename U> T add(U u) { return static_cast<T>(u) + val; }
+};
+
+} // anonymous namespace
+'
+
+# Test code for whether the C++ compiler supports C++98 (body of main)
+ac_cxx_conftest_cxx98_main='
+ assert (argc);
+ assert (! argv[0]);
+{
+ test_exception_syntax ();
+ test_template<double> tt (2.0);
+ assert (tt.add (4) == 6.0);
+ assert (true && !false);
+}
+'
+
+# Test code for whether the C++ compiler supports C++11 (global declarations)
+ac_cxx_conftest_cxx11_globals='
+// Does the compiler advertise C++ 2011 conformance?
+#if !defined __cplusplus || __cplusplus < 201103L
+# error "Compiler does not advertise C++11 conformance"
+#endif
+
+namespace cxx11test
+{
+ constexpr int get_val() { return 20; }
+
+ struct testinit
+ {
+ int i;
+ double d;
+ };
+
+ class delegate
+ {
+ public:
+ delegate(int n) : n(n) {}
+ delegate(): delegate(2354) {}
+
+ virtual int getval() { return this->n; };
+ protected:
+ int n;
+ };
+
+ class overridden : public delegate
+ {
+ public:
+ overridden(int n): delegate(n) {}
+ virtual int getval() override final { return this->n * 2; }
+ };
+
+ class nocopy
+ {
+ public:
+ nocopy(int i): i(i) {}
+ nocopy() = default;
+ nocopy(const nocopy&) = delete;
+ nocopy & operator=(const nocopy&) = delete;
+ private:
+ int i;
+ };
+
+ // for testing lambda expressions
+ template <typename Ret, typename Fn> Ret eval(Fn f, Ret v)
+ {
+ return f(v);
+ }
+
+ // for testing variadic templates and trailing return types
+ template <typename V> auto sum(V first) -> V
+ {
+ return first;
+ }
+ template <typename V, typename... Args> auto sum(V first, Args... rest) -> V
+ {
+ return first + sum(rest...);
+ }
+}
+'
+
+# Test code for whether the C++ compiler supports C++11 (body of main)
+ac_cxx_conftest_cxx11_main='
+{
+ // Test auto and decltype
+ auto a1 = 6538;
+ auto a2 = 48573953.4;
+ auto a3 = "String literal";
+
+ int total = 0;
+ for (auto i = a3; *i; ++i) { total += *i; }
+
+ decltype(a2) a4 = 34895.034;
+}
+{
+ // Test constexpr
+ short sa[cxx11test::get_val()] = { 0 };
+}
+{
+ // Test initializer lists
+ cxx11test::testinit il = { 4323, 435234.23544 };
+}
+{
+ // Test range-based for
+ int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3,
+ 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ for (auto &x : array) { x += 23; }
+}
+{
+ // Test lambda expressions
+ using cxx11test::eval;
+ assert (eval ([](int x) { return x*2; }, 21) == 42);
+ double d = 2.0;
+ assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
+ assert (d == 5.0);
+ assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
+ assert (d == 5.0);
+}
+{
+ // Test use of variadic templates
+ using cxx11test::sum;
+ auto a = sum(1);
+ auto b = sum(1, 2);
+ auto c = sum(1.0, 2.0, 3.0);
+}
+{
+ // Test constructor delegation
+ cxx11test::delegate d1;
+ cxx11test::delegate d2();
+ cxx11test::delegate d3(45);
+}
+{
+ // Test override and final
+ cxx11test::overridden o1(55464);
+}
+{
+ // Test nullptr
+ char *c = nullptr;
+}
+{
+ // Test template brackets
+ test_template<::test_template<int>> v(test_template<int>(12));
+}
+{
+ // Unicode literals
+ char const *utf8 = u8"UTF-8 string \u2500";
+ char16_t const *utf16 = u"UTF-8 string \u2500";
+ char32_t const *utf32 = U"UTF-32 string \u2500";
+}
+'
+
+# Test code for whether the C compiler supports C++11 (complete).
+ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals}
+${ac_cxx_conftest_cxx11_globals}
+
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_cxx_conftest_cxx98_main}
+ ${ac_cxx_conftest_cxx11_main}
+ return ok;
+}
+"
+
+# Test code for whether the C compiler supports C++98 (complete).
+ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals}
+int
+main (int argc, char **argv)
+{
+ int ok = 0;
+ ${ac_cxx_conftest_cxx98_main}
+ return ok;
+}
+"
+
+as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"
+as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"
+as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"
+as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
+as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"
+as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
+as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
+as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
+as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
+as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
+as_fn_append ac_header_c_list " sys/select.h sys_select_h HAVE_SYS_SELECT_H"
+as_fn_append ac_header_c_list " sys/socket.h sys_socket_h HAVE_SYS_SOCKET_H"
+as_fn_append ac_func_c_list " vprintf HAVE_VPRINTF"
+
+# Auxiliary files required by this configure script.
+ac_aux_files="config.guess config.sub compile missing install-sh"
+
+# Locations in which to look for auxiliary files.
+ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.."
+
+# Search for a directory containing all of the required auxiliary files,
+# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
+# If we don't find one directory that contains all the files we need,
+# we report the set of missing files from the *first* directory in
+# $ac_aux_dir_candidates and give up.
+ac_missing_aux_files=""
+ac_first_candidate=:
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in $ac_aux_dir_candidates
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ as_found=:
+
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5
+ ac_aux_dir_found=yes
+ ac_install_sh=
+ for ac_aux in $ac_aux_files
+ do
+ # As a special case, if "install-sh" is required, that requirement
+ # can be satisfied by any of "install-sh", "install.sh", or "shtool",
+ # and $ac_install_sh is set appropriately for whichever one is found.
+ if test x"$ac_aux" = x"install-sh"
+ then
+ if test -f "${as_dir}install-sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5
+ ac_install_sh="${as_dir}install-sh -c"
+ elif test -f "${as_dir}install.sh"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5
+ ac_install_sh="${as_dir}install.sh -c"
+ elif test -f "${as_dir}shtool"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5
+ ac_install_sh="${as_dir}shtool install -c"
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} install-sh"
+ else
+ break
+ fi
+ fi
+ else
+ if test -f "${as_dir}${ac_aux}"; then
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5
+ else
+ ac_aux_dir_found=no
+ if $ac_first_candidate; then
+ ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
+ else
+ break
+ fi
+ fi
+ fi
+ done
+ if test "$ac_aux_dir_found" = yes; then
+ ac_aux_dir="$as_dir"
+ break
+ fi
+ ac_first_candidate=false
+
+ as_found=false
+done
+IFS=$as_save_IFS
+if $as_found
+then :
+
+else case e in #(
+ e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;;
+esac
+fi
+
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+if test -f "${ac_aux_dir}config.guess"; then
+ ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
+fi
+if test -f "${ac_aux_dir}config.sub"; then
+ ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
+fi
+if test -f "$ac_aux_dir/configure"; then
+ ac_configure="$SHELL ${ac_aux_dir}configure"
+fi
+
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
@@ -2395,12 +3036,12 @@ for ac_var in $ac_precious_vars; do
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5
+printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5
+printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
@@ -2409,24 +3050,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5
+printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5
+printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5
+printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5
+printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -2436,11 +3077,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi
done
if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file'
+ and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -2457,36 +3099,9 @@ ac_config_headers="$ac_config_headers config.h"
am__api_version='1.16'
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# Find a good install program. We prefer a C program (faster),
+ # Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
@@ -2500,20 +3115,25 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+printf %s "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+if test ${ac_cv_path_install+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ # Account for fact that we put trailing slashes in our PATH walk.
+case $as_dir in #((
+ ./ | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
@@ -2523,13 +3143,13 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
@@ -2537,12 +3157,12 @@ case $as_dir/ in #((
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
break 3
fi
fi
@@ -2556,9 +3176,10 @@ esac
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
-
+ ;;
+esac
fi
- if test "${ac_cv_path_install+set}" = set; then
+ if test ${ac_cv_path_install+y}; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
@@ -2568,8 +3189,8 @@ fi
INSTALL=$ac_install_sh
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+printf "%s\n" "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -2579,8 +3200,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+printf %s "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -2634,8 +3255,8 @@ else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
@@ -2652,28 +3273,25 @@ test "$program_prefix" != NONE &&
test "$program_suffix" != NONE &&
program_transform_name="s&\$&$program_suffix&;$program_transform_name"
# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
+# By default was 's,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
+
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+
+ if test x"${MISSING+set}" != xset; then
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh+set}" != xset; then
@@ -2693,38 +3311,44 @@ if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -2733,38 +3357,44 @@ if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
@@ -2772,8 +3402,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
@@ -2785,98 +3415,110 @@ fi
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5
+printf %s "checking for a race-free mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ if test ${ac_cv_path_mkdir+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
+ as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir ('*'coreutils) '* | \
+ *'BusyBox '* | \
'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
break 3;;
esac
done
done
done
IFS=$as_save_IFS
-
+ ;;
+esac
fi
test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
+ if test ${ac_cv_path_mkdir+y}; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
+ # As a last resort, use plain mkdir -p,
+ # in the hope it doesn't have the bugs of ancient mkdir.
+ MKDIR_P='mkdir -p'
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+printf "%s\n" "$MKDIR_P" >&6; }
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
test -n "$AWK" && break
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
@@ -2888,15 +3530,16 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in
*)
eval ac_cv_prog_make_${ac_make}_set=no;;
esac
-rm -f conftest.make
+rm -f conftest.make ;;
+esac
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -2910,7 +3553,8 @@ fi
rmdir .tst 2>/dev/null
# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
+if test ${enable_silent_rules+y}
+then :
enableval=$enable_silent_rules;
fi
@@ -2920,12 +3564,13 @@ case $enable_silent_rules in # (((
*) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if printf "%s\n" 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
@@ -2935,10 +3580,11 @@ am__doit:
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
+fi ;;
+esac
fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
@@ -2970,17 +3616,13 @@ fi
# Define the identity of the package.
PACKAGE='iperf'
- VERSION='2.1.9'
+ VERSION='2.2.0'
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
+printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
+printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h
# Some tools Automake needs.
@@ -3020,6 +3662,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+
+
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
@@ -3065,17 +3721,19 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
+if test ${enable_maintainer_mode+y}
+then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
+else case e in #(
+ e) USE_MAINTAINER_MODE=no ;;
+esac
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+printf "%s\n" "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
@@ -3200,10 +3858,11 @@ fi
#serial 26
-# This is what autoupdate's m4 run will expand. It fires
-# the warning (with _au_warn_XXX), outputs it into the
-# updated configure.ac (with AC_DIAGNOSE), and then outputs
-# the replacement expansion.
+# This is what autoupdate's m4 run will expand. It fires the warning
+# (with _au_warn_XXX), outputs it into the updated configure.ac (with
+# m4_warn), and then outputs the replacement expansion. We need extra
+# quotation around the m4_warn and dnl so they will be written
+# unexpanded into the updated configure.ac.
# This is an auxiliary macro that is also run when
@@ -3214,77 +3873,104 @@ fi
# Finally, this is the expansion that is picked up by
-# autoconf. It tells the user to run autoupdate, and
-# then outputs the replacement expansion. We do not care
-# about autoupdate's warning because that contains
-# information on what to do *after* running autoupdate.
+# autoconf, causing NAME to expand to NEW-CODE, plus
+# (if SILENT is not "silent") a m4_warning telling the
+# maintainer to run autoupdate. We don't issue MESSAGE
+# from autoconf, because that's instructions for what
+# to do *after* running autoupdate.
# Check whether --enable-ipv6 was given.
-if test "${enable_ipv6+set}" = set; then :
+if test ${enable_ipv6+y}
+then :
enableval=$enable_ipv6; ac_cv_have_ipv6=$enable_ipv6
fi
# Check whether --enable-multicast was given.
-if test "${enable_multicast+set}" = set; then :
+if test ${enable_multicast+y}
+then :
enableval=$enable_multicast; ac_cv_multicast=$enable_multicast
fi
# Check whether --enable-tcpstats was given.
-if test "${enable_tcpstats+set}" = set; then :
+if test ${enable_tcpstats+y}
+then :
enableval=$enable_tcpstats; ac_cv_tcpstats=$enable_tcpstats
fi
# Check whether --enable-threads was given.
-if test "${enable_threads+set}" = set; then :
+if test ${enable_threads+y}
+then :
enableval=$enable_threads;
fi
# Check whether --enable-debuginfo was given.
-if test "${enable_debuginfo+set}" = set; then :
+if test ${enable_debuginfo+y}
+then :
enableval=$enable_debuginfo; enable_debuginfo=$enableval
-else
- enable_debuginfo=no
+else case e in #(
+ e) enable_debuginfo=no ;;
+esac
fi
# Check whether --enable-web100 was given.
-if test "${enable_web100+set}" = set; then :
+if test ${enable_web100+y}
+then :
enableval=$enable_web100;
fi
# Check whether --enable-kalman was given.
-if test "${enable_kalman+set}" = set; then :
+if test ${enable_kalman+y}
+then :
enableval=$enable_kalman;
fi
+# Check whether --enable-multicast_all was given.
+if test ${enable_multicast_all+y}
+then :
+ enableval=$enable_multicast_all;
+fi
+
+
+# Check whether --enable-write_select was given.
+if test ${enable_write_select+y}
+then :
+ enableval=$enable_write_select;
+fi
+
+
# Check whether --enable-role_reversal_id was given.
-if test "${enable_role_reversal_id+set}" = set; then :
+if test ${enable_role_reversal_id+y}
+then :
enableval=$enable_role_reversal_id;
fi
# Check whether --enable-default_localonly was given.
-if test "${enable_default_localonly+set}" = set; then :
+if test ${enable_default_localonly+y}
+then :
enableval=$enable_default_localonly;
fi
# Check whether --enable-seqno64b was given.
-if test "${enable_seqno64b+set}" = set; then :
+if test ${enable_seqno64b+y}
+then :
enableval=$enable_seqno64b;
fi
# Check whether --enable-fastsampling was given.
-if test "${enable_fastsampling+set}" = set; then :
+if test ${enable_fastsampling+y}
+then :
enableval=$enable_fastsampling;
fi
@@ -3298,7 +3984,8 @@ fi
# Check whether --enable-discover_defaultlen was given.
-if test "${enable_discover_defaultlen+set}" = set; then :
+if test ${enable_discover_defaultlen+y}
+then :
enableval=$enable_discover_defaultlen;
fi
@@ -3312,7 +3999,8 @@ fi
# Check whether --enable-thread_debug was given.
-if test "${enable_thread_debug+set}" = set; then :
+if test ${enable_thread_debug+y}
+then :
enableval=$enable_thread_debug;
fi
@@ -3326,7 +4014,8 @@ fi
# Check whether --enable-packet_debug was given.
-if test "${enable_packet_debug+set}" = set; then :
+if test ${enable_packet_debug+y}
+then :
enableval=$enable_packet_debug;
fi
@@ -3339,8 +4028,24 @@ else
fi
+# Check whether --enable-summing_debug was given.
+if test ${enable_summing_debug+y}
+then :
+ enableval=$enable_summing_debug;
+fi
+
+ if test "x$enable_summing_debug" = "xyes"; then
+ SUMMING_DEBUG_TRUE=
+ SUMMING_DEBUG_FALSE='#'
+else
+ SUMMING_DEBUG_TRUE='#'
+ SUMMING_DEBUG_FALSE=
+fi
+
+
# Check whether --enable-checkprograms was given.
-if test "${enable_checkprograms+set}" = set; then :
+if test ${enable_checkprograms+y}
+then :
enableval=$enable_checkprograms;
fi
@@ -3354,10 +4059,12 @@ fi
# Check whether --enable-static-bin was given.
-if test "${enable_static_bin+set}" = set; then :
+if test ${enable_static_bin+y}
+then :
enableval=$enable_static_bin; enable_static_bin=yes
-else
- :
+else case e in #(
+ e) : ;;
+esac
fi
if test x$enable_static_bin = xno; then
@@ -3369,20 +4076,23 @@ else
fi
-if test "x$enable_static_bin" = xyes; then :
+if test "x$enable_static_bin" = xyes
+then :
CFLAGS="$CFLAGS --static"; CXXFLAGS="$CXXFLAGS --static"; LDFLAGS="$LDFLAGS --static"
fi
# Check whether --enable-debug_symbols was given.
-if test "${enable_debug_symbols+set}" = set; then :
+if test ${enable_debug_symbols+y}
+then :
enableval=$enable_debug_symbols; case "${enableval}" in
yes) debug_symbols=true ;;
no) debug_symbols=false ;;
*) as_fn_error $? "bad value ${enableval} for --enable-debug-symbols" "$LINENO" 5 ;;
esac
-else
- debug_symbols=false
+else case e in #(
+ e) debug_symbols=false ;;
+esac
fi
@@ -3396,19 +4106,30 @@ fi
# Check whether --enable-af-packet was given.
-if test "${enable_af_packet+set}" = set; then :
+if test ${enable_af_packet+y}
+then :
enableval=$enable_af_packet;
-else
- enable_af_packet=yes
+else case e in #(
+ e) enable_af_packet=yes ;;
+esac
fi
+
+
+
+
+
+
+
+
+
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
-$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; }
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target >confinc.out
@@ -3444,11 +4165,12 @@ esac
fi
done
rm -f confinc.* confmf.*
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
-$as_echo "${_am_result}" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+printf "%s\n" "${_am_result}" >&6; }
# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
+if test ${enable_dependency_tracking+y}
+then :
enableval=$enable_dependency_tracking;
fi
@@ -3474,38 +4196,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3514,38 +4242,44 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
@@ -3553,8 +4287,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -3567,38 +4301,44 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3607,12 +4347,13 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
@@ -3620,15 +4361,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -3644,18 +4389,19 @@ if test $ac_prog_rejected = yes; then
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
fi
fi
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3666,38 +4412,44 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3710,38 +4462,44 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -3753,34 +4511,140 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
+set dummy ${ac_tool_prefix}clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "clang", so it can be a program name with args.
+set dummy clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
+else
+ CC="$ac_cv_prog_CC"
fi
fi
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
+for ac_option in --version -v -V -qversion -version; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -3790,7 +4654,7 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
@@ -3798,7 +4662,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -3810,9 +4674,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+printf %s "checking whether the C compiler works... " >&6; }
+ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
@@ -3833,13 +4697,14 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'.
+# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
@@ -3854,12 +4719,12 @@ do
# certainly right.
break;;
*.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
+ # safe: cross compilers may not add the suffix if given an '-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
@@ -3870,48 +4735,52 @@ do
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
-else
- ac_file=''
+else case e in #(
+ e) ac_file='' ;;
+esac
fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+See 'config.log' for more details" "$LINENO" 5; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; } ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+printf %s "checking for C compiler default output file name... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+printf "%s\n" "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+printf %s "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
+ # If both 'conftest.exe' and 'conftest' are 'present' (well, observable)
+# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will
+# work properly (i.e., refer to 'conftest.exe'), while it won't with
+# 'rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
@@ -3921,15 +4790,16 @@ for ac_file in conftest.exe conftest conftest.*; do
* ) break;;
esac
done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else case e in #(
+ e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; } ;;
+esac
fi
rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+printf "%s\n" "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
@@ -3938,9 +4808,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
-main ()
+main (void)
{
FILE *f = fopen ("conftest.out", "w");
+ if (!f)
+ return 1;
return ferror (f) || fclose (f) != 0;
;
@@ -3950,8 +4822,8 @@ _ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+printf %s "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
@@ -3959,10 +4831,10 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
@@ -3970,39 +4842,41 @@ $as_echo "$ac_try_echo"; } >&5
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
+as_fn_error 77 "cannot run C compiled programs.
+If you meant to cross compile, use '--host'.
+See 'config.log' for more details" "$LINENO" 5; }
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+printf "%s\n" "$cross_compiling" >&6; }
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+rm -f conftest.$ac_ext conftest$ac_cv_exeext \
+ conftest.o conftest.obj conftest.out
ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+printf %s "checking for suffix of object files... " >&6; }
+if test ${ac_cv_objext+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -4016,11 +4890,12 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
@@ -4029,31 +4904,34 @@ $as_echo "$ac_try_echo"; } >&5
break;;
esac
done
-else
- $as_echo "$as_me: failed program was:" >&5
+else case e in #(
+ e) printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; } ;;
+esac
fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
+rm -f conftest.$ac_cv_objext conftest.$ac_ext ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+printf "%s\n" "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
+printf %s "checking whether the compiler supports GNU C... " >&6; }
+if test ${ac_cv_c_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -4063,30 +4941,36 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
+else case e in #(
+ e) ac_compiler_gnu=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
-ac_test_CFLAGS=${CFLAGS+set}
+ac_test_CFLAGS=${CFLAGS+y}
ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+printf %s "checking whether $CC accepts -g... " >&6; }
+if test ${ac_cv_prog_cc_g+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
@@ -4094,57 +4978,63 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
+else case e in #(
+ e) CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
+else case e in #(
+ e) ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
+if test $ac_test_CFLAGS; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
@@ -4159,94 +5049,153 @@ else
CFLAGS=
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
+ac_prog_cc_stdc=no
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+printf %s "checking for $CC option to enable C11 features... " >&6; }
+if test ${ac_cv_prog_cc_c11+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cc_c11=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+$ac_c_conftest_c11_program
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC ;;
+esac
+fi
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+if test "x$ac_cv_prog_cc_c11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
+ CC="$CC $ac_cv_prog_cc_c11" ;;
+esac
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+ ac_prog_cc_stdc=c11 ;;
+esac
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+printf %s "checking for $CC option to enable C99 features... " >&6; }
+if test ${ac_cv_prog_cc_c99+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c99_program
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC ;;
+esac
+fi
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
+if test "x$ac_cv_prog_cc_c99" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c99" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
+ CC="$CC $ac_cv_prog_cc_c99" ;;
+esac
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+ ac_prog_cc_stdc=c99 ;;
+esac
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
+printf %s "checking for $CC option to enable C89 features... " >&6; }
+if test ${ac_cv_prog_cc_c89+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c89_program
_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
+ if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_c89=$ac_arg
fi
-rm -f core conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
-CC=$ac_save_CC
+CC=$ac_save_CC ;;
+esac
+fi
+if test "x$ac_cv_prog_cc_c89" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c89" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
+ CC="$CC $ac_cv_prog_cc_c89" ;;
+esac
fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+ ac_prog_cc_stdc=c89 ;;
esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
+fi
fi
ac_ext=c
@@ -4255,21 +5204,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_ext=c
+
+ ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+printf %s "checking whether $CC understands -c and -o together... " >&6; }
+if test ${am_cv_prog_cc_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -4295,10 +5246,11 @@ _ACEOF
fi
done
rm -f core conftest*
- unset am_i
+ unset am_i ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+printf "%s\n" "$am_cv_prog_cc_c_o" >&6; }
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
@@ -4316,12 +5268,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
depcc="$CC" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CC_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
@@ -4425,10 +5378,11 @@ else
else
am_cv_CC_dependencies_compiler_type=none
fi
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
if
@@ -4443,19 +5397,104 @@ fi
-if test "x$enable_af_packet" = "xyes"; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
+printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
+if test ${ac_cv_c_undeclared_builtin_options+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_save_CFLAGS=$CFLAGS
+ ac_cv_c_undeclared_builtin_options='cannot detect'
+ for ac_arg in '' -fno-builtin; do
+ CFLAGS="$ac_save_CFLAGS $ac_arg"
+ # This test program should *not* compile successfully.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- ac_fn_c_check_decl "$LINENO" "TPACKET_V2" "ac_cv_have_decl_TPACKET_V2" "#include <sys/socket.h>
- #include <linux/if_packet.h>
-"
-if test "x$ac_cv_have_decl_TPACKET_V2" = xyes; then :
+int
+main (void)
+{
+(void) strchr;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
-$as_echo "#define HAVE_AF_PACKET 1" >>confdefs.h
+else case e in #(
+ e) # This test program should compile successfully.
+ # No library function is consistently available on
+ # freestanding implementations, so test against a dummy
+ # declaration. Include always-available headers on the
+ # off chance that they somehow elicit warnings.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <float.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+extern void ac_decl (int, char *);
-else
- enable_af_packet="no"
+int
+main (void)
+{
+(void) ac_decl (0, (char *) 0);
+ (void) ac_decl;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ if test x"$ac_arg" = x
+then :
+ ac_cv_c_undeclared_builtin_options='none needed'
+else case e in #(
+ e) ac_cv_c_undeclared_builtin_options=$ac_arg ;;
+esac
fi
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ done
+ CFLAGS=$ac_save_CFLAGS
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5
+printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; }
+ case $ac_cv_c_undeclared_builtin_options in #(
+ 'cannot detect') :
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
+as_fn_error $? "cannot make $CC report undeclared builtins
+See 'config.log' for more details" "$LINENO" 5; } ;; #(
+ 'none needed') :
+ ac_c_undeclared_builtin_options='' ;; #(
+ *) :
+ ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;;
+esac
+
+if test "x$enable_af_packet" = "xyes"
+then :
+ ac_fn_check_decl "$LINENO" "TPACKET_V2" "ac_cv_have_decl_TPACKET_V2" "#include <sys/socket.h>
+ #include <linux/if_packet.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TPACKET_V2" = xyes
+then :
+
+printf "%s\n" "#define HAVE_AF_PACKET 1" >>confdefs.h
+
+else case e in #(
+ e) enable_af_packet="no" ;;
+esac
+fi
if test "x${enable_af_packet}" = "xyes"; then
AF_PACKET_TRUE=
AF_PACKET_FALSE='#'
@@ -4468,32 +5507,36 @@ fi
fi
# Check whether --enable-tuntap-tun was given.
-if test "${enable_tuntap_tun+set}" = set; then :
+if test ${enable_tuntap_tun+y}
+then :
enableval=$enable_tuntap_tun;
-else
- enable_tuntap_tun=yes
+else case e in #(
+ e) enable_tuntap_tun=yes ;;
+esac
fi
-if test "x$enable_tuntap_tun" = "xyes"; then :
+if test "x$enable_tuntap_tun" = "xyes"
+then :
- ac_fn_c_check_decl "$LINENO" "IFF_TUN" "ac_cv_have_decl_IFF_TUN" "#include <linux/if_tun.h>
-"
-if test "x$ac_cv_have_decl_IFF_TUN" = xyes; then :
+ ac_fn_check_decl "$LINENO" "IFF_TUN" "ac_cv_have_decl_IFF_TUN" "#include <linux/if_tun.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IFF_TUN" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
+printf "%s\n" "#define HAVE_DECL_IFF_TUN $ac_have_decl" >>confdefs.h
+if test $ac_have_decl = 1
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IFF_TUN $ac_have_decl
-_ACEOF
-if test $ac_have_decl = 1; then :
-
-$as_echo "#define HAVE_TUNTAP_TUN 1" >>confdefs.h
+printf "%s\n" "#define HAVE_TUNTAP_TUN 1" >>confdefs.h
-else
- enable_tuntap_tun="no"
+else case e in #(
+ e) enable_tuntap_tun="no" ;;
+esac
fi
if test "x${enable_tuntap_tun}" = "xyes"; then
@@ -4508,32 +5551,36 @@ fi
fi
# Check whether --enable-tuntap-tap was given.
-if test "${enable_tuntap_tap+set}" = set; then :
+if test ${enable_tuntap_tap+y}
+then :
enableval=$enable_tuntap_tap;
-else
- enable_tuntap_tap=yes
+else case e in #(
+ e) enable_tuntap_tap=yes ;;
+esac
fi
-if test "x$enable_tuntap_tap" = "xyes"; then :
+if test "x$enable_tuntap_tap" = "xyes"
+then :
- ac_fn_c_check_decl "$LINENO" "IFF_TAP" "ac_cv_have_decl_IFF_TAP" "#include <linux/if_tun.h>
-"
-if test "x$ac_cv_have_decl_IFF_TAP" = xyes; then :
+ ac_fn_check_decl "$LINENO" "IFF_TAP" "ac_cv_have_decl_IFF_TAP" "#include <linux/if_tun.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IFF_TAP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
+printf "%s\n" "#define HAVE_DECL_IFF_TAP $ac_have_decl" >>confdefs.h
+if test $ac_have_decl = 1
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IFF_TAP $ac_have_decl
-_ACEOF
-if test $ac_have_decl = 1; then :
-
-$as_echo "#define HAVE_TUNTAP_TAP 1" >>confdefs.h
+printf "%s\n" "#define HAVE_TUNTAP_TAP 1" >>confdefs.h
-else
- enable_tuntap_tap="no"
+else case e in #(
+ e) enable_tuntap_tap="no" ;;
+esac
fi
if test "x${enable_tuntap_tap}" = "xyes"; then
@@ -4548,6 +5595,12 @@ fi
fi
+
+
+
+
+
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4558,42 +5611,48 @@ if test -z "$CXX"; then
CXX=$CCC
else
if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CXX"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CXX"; then
ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+printf "%s\n" "$CXX" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4602,42 +5661,48 @@ fi
fi
if test -z "$CXX"; then
ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CXX"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CXX+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_CXX"; then
ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+printf "%s\n" "$ac_ct_CXX" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4649,8 +5714,8 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CXX=$ac_ct_CXX
@@ -4660,7 +5725,7 @@ fi
fi
fi
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
@@ -4670,7 +5735,7 @@ case "(($ac_try" in
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -4680,20 +5745,21 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5
+printf %s "checking whether the compiler supports GNU C++... " >&6; }
+if test ${ac_cv_cxx_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -4703,30 +5769,36 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
+else case e in #(
+ e) ac_compiler_gnu=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
if test $ac_compiler_gnu = yes; then
GXX=yes
else
GXX=
fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_test_CXXFLAGS=${CXXFLAGS+y}
ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+printf %s "checking whether $CXX accepts -g... " >&6; }
+if test ${ac_cv_prog_cxx_g+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_cv_prog_cxx_g=no
CXXFLAGS="-g"
@@ -4734,57 +5806,63 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_prog_cxx_g=yes
-else
- CXXFLAGS=""
+else case e in #(
+ e) CXXFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
-else
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+else case e in #(
+ e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_prog_cxx_g=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+printf "%s\n" "$ac_cv_prog_cxx_g" >&6; }
+if test $ac_test_CXXFLAGS; then
CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
if test "$GXX" = yes; then
@@ -4799,6 +5877,106 @@ else
CXXFLAGS=
fi
fi
+ac_prog_cxx_stdcxx=no
+if test x$ac_prog_cxx_stdcxx = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
+printf %s "checking for $CXX option to enable C++11 features... " >&6; }
+if test ${ac_cv_prog_cxx_cxx11+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cxx_cxx11=no
+ac_save_CXX=$CXX
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_cxx_conftest_cxx11_program
+_ACEOF
+for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
+do
+ CXX="$ac_save_CXX $ac_arg"
+ if ac_fn_cxx_try_compile "$LINENO"
+then :
+ ac_cv_prog_cxx_cxx11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cxx_cxx11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CXX=$ac_save_CXX ;;
+esac
+fi
+
+if test "x$ac_cv_prog_cxx_cxx11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cxx_cxx11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5
+printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; }
+ CXX="$CXX $ac_cv_prog_cxx_cxx11" ;;
+esac
+fi
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
+ ac_prog_cxx_stdcxx=cxx11 ;;
+esac
+fi
+fi
+if test x$ac_prog_cxx_stdcxx = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
+printf %s "checking for $CXX option to enable C++98 features... " >&6; }
+if test ${ac_cv_prog_cxx_cxx98+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cxx_cxx98=no
+ac_save_CXX=$CXX
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_cxx_conftest_cxx98_program
+_ACEOF
+for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA
+do
+ CXX="$ac_save_CXX $ac_arg"
+ if ac_fn_cxx_try_compile "$LINENO"
+then :
+ ac_cv_prog_cxx_cxx98=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cxx_cxx98" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CXX=$ac_save_CXX ;;
+esac
+fi
+
+if test "x$ac_cv_prog_cxx_cxx98" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cxx_cxx98" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5
+printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; }
+ CXX="$CXX $ac_cv_prog_cxx_cxx98" ;;
+esac
+fi
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98
+ ac_prog_cxx_stdcxx=cxx98 ;;
+esac
+fi
+fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4807,12 +5985,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
depcc="$CXX" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CXX_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
@@ -4916,10 +6095,11 @@ else
else
am_cv_CXX_dependencies_compiler_type=none
fi
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; }
CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
if
@@ -4933,6 +6113,7 @@ else
fi
+CXXFLAGS=`echo " $CXXFLAGS " | sed -e "s/ -g / /"` # do not want it implicitly
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4941,38 +6122,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -4981,38 +6168,44 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
@@ -5020,8 +6213,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -5034,38 +6227,44 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5074,12 +6273,13 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
@@ -5087,15 +6287,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -5111,18 +6315,19 @@ if test $ac_prog_rejected = yes; then
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
fi
fi
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5133,38 +6338,44 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5177,38 +6388,44 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5220,34 +6437,140 @@ done
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
+set dummy ${ac_tool_prefix}clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "clang", so it can be a program name with args.
+set dummy clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="clang"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi ;;
+esac
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
+else
+ CC="$ac_cv_prog_CC"
fi
fi
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
+for ac_option in --version -v -V -qversion -version; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
@@ -5257,20 +6580,21 @@ $as_echo "$ac_try_echo"; } >&5
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
+printf %s "checking whether the compiler supports GNU C... " >&6; }
+if test ${ac_cv_c_compiler_gnu+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -5280,30 +6604,36 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
+else case e in #(
+ e) ac_compiler_gnu=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
-ac_test_CFLAGS=${CFLAGS+set}
+ac_test_CFLAGS=${CFLAGS+y}
ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+printf %s "checking whether $CC accepts -g... " >&6; }
+if test ${ac_cv_prog_cc_g+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
@@ -5311,57 +6641,63 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
+else case e in #(
+ e) CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
+else case e in #(
+ e) ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_g=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
+if test $ac_test_CFLAGS; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
@@ -5376,94 +6712,153 @@ else
CFLAGS=
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
+ac_prog_cc_stdc=no
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+printf %s "checking for $CC option to enable C11 features... " >&6; }
+if test ${ac_cv_prog_cc_c11+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cc_c11=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+$ac_c_conftest_c11_program
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC ;;
+esac
+fi
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+if test "x$ac_cv_prog_cc_c11" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c11" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
+ CC="$CC $ac_cv_prog_cc_c11" ;;
+esac
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+ ac_prog_cc_stdc=c11 ;;
+esac
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+printf %s "checking for $CC option to enable C99 features... " >&6; }
+if test ${ac_cv_prog_cc_c99+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c99_program
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC ;;
+esac
+fi
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
+if test "x$ac_cv_prog_cc_c99" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c99" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
+ CC="$CC $ac_cv_prog_cc_c99" ;;
+esac
+fi
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+ ac_prog_cc_stdc=c99 ;;
+esac
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
+printf %s "checking for $CC option to enable C89 features... " >&6; }
+if test ${ac_cv_prog_cc_c89+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_c_conftest_c89_program
_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
+ if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_prog_cc_c89=$ac_arg
fi
-rm -f core conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
-CC=$ac_save_CC
+CC=$ac_save_CC ;;
+esac
+fi
+if test "x$ac_cv_prog_cc_c89" = xno
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else case e in #(
+ e) if test "x$ac_cv_prog_cc_c89" = x
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else case e in #(
+ e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
+ CC="$CC $ac_cv_prog_cc_c89" ;;
+esac
fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+ ac_prog_cc_stdc=c89 ;;
esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
+fi
fi
ac_ext=c
@@ -5472,21 +6867,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-ac_ext=c
+
+ ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+printf %s "checking whether $CC understands -c and -o together... " >&6; }
+if test ${am_cv_prog_cc_c_o+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -5512,10 +6909,11 @@ _ACEOF
fi
done
rm -f core conftest*
- unset am_i
+ unset am_i ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+printf "%s\n" "$am_cv_prog_cc_c_o" >&6; }
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
@@ -5533,12 +6931,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
depcc="$CC" am_compiler_list=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CC_dependencies_compiler_type+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
@@ -5642,10 +7041,11 @@ else
else
am_cv_CC_dependencies_compiler_type=none
fi
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
if
@@ -5659,71 +7059,84 @@ else
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
-$as_echo_n "checking for library containing strerror... " >&6; }
-if ${ac_cv_search_strerror+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
+CFLAGS=`echo " $CFLAGS " | sed -e "s/ -g / /"` # do not want it implicitly
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
+printf %s "checking for library containing strerror... " >&6; }
+if test ${ac_cv_search_strerror+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char strerror ();
+char strerror (void);
int
-main ()
+main (void)
{
return strerror ();
;
return 0;
}
_ACEOF
-for ac_lib in '' cposix; do
+for ac_lib in '' cposix
+do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- if ac_fn_c_try_link "$LINENO"; then :
+ if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_search_strerror=$ac_res
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext
- if ${ac_cv_search_strerror+:} false; then :
+ if test ${ac_cv_search_strerror+y}
+then :
break
fi
done
-if ${ac_cv_search_strerror+:} false; then :
+if test ${ac_cv_search_strerror+y}
+then :
-else
- ac_cv_search_strerror=no
+else case e in #(
+ e) ac_cv_search_strerror=no ;;
+esac
fi
rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+LIBS=$ac_func_search_save_LIBS ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
-$as_echo "$ac_cv_search_strerror" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
+printf "%s\n" "$ac_cv_search_strerror" >&6; }
ac_res=$ac_cv_search_strerror
-if test "$ac_res" != no; then :
+if test "$ac_res" != no
+then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
@@ -5735,53 +7148,60 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in
*)
eval ac_cv_prog_make_${ac_make}_set=no;;
esac
-rm -f conftest.make
+rm -f conftest.make ;;
+esac
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
SET_MAKE=
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -5790,38 +7210,44 @@ if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_RANLIB" = x; then
@@ -5829,8 +7255,8 @@ fi
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
RANLIB=$ac_ct_RANLIB
@@ -5845,26 +7271,30 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
+
+ # Make sure we can run config.sub.
+$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+printf %s "checking build system type... " >&6; }
+if test ${ac_cv_build+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+ ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
+ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+printf "%s\n" "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
@@ -5883,21 +7313,23 @@ IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+printf %s "checking host system type... " >&6; }
+if test ${ac_cv_host+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+ ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5
fi
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+printf "%s\n" "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
@@ -5917,46 +7349,52 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
-$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if ${ac_cv_lib_rt_clock_gettime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+printf %s "checking for clock_gettime in -lrt... " >&6; }
+if test ${ac_cv_lib_rt_clock_gettime+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_check_lib_save_LIBS=$LIBS
LIBS="-lrt $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char clock_gettime ();
+char clock_gettime (void);
int
-main ()
+main (void)
{
return clock_gettime ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_rt_clock_gettime=yes
-else
- ac_cv_lib_rt_clock_gettime=no
+else case e in #(
+ e) ac_cv_lib_rt_clock_gettime=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
-$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBRT 1
-_ACEOF
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes
+then :
+ printf "%s\n" "#define HAVE_LIBRT 1" >>confdefs.h
LIBS="-lrt $LIBS"
@@ -5965,12 +7403,13 @@ fi
if test "$enable_threads" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+printf %s "checking for a sed that does not truncate output... " >&6; }
+if test ${ac_cv_path_SED+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for ac_i in 1 2 3 4 5 6 7; do
ac_script="$ac_script$as_nl$ac_script"
done
@@ -5983,25 +7422,31 @@ else
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in sed gsed; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in sed gsed
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
+case `"$ac_path_SED" --version 2>&1` in #(
*GNU*)
ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+#(
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo '' >> "conftest.nl"
+ printf "%s\n" '' >> "conftest.nl"
"$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -6027,10 +7472,11 @@ IFS=$as_save_IFS
else
ac_cv_path_SED=$SED
fi
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+printf "%s\n" "$ac_cv_path_SED" >&6; }
SED="$ac_cv_path_SED"
rm -f conftest.sed
@@ -6039,42 +7485,39 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+printf %s "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ if test ${ac_cv_prog_CPP+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) # Double quotes because $CC needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp
do
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#include <limits.h>
Syntax error
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
-else
- # Broken: fails on valid input.
-continue
+else case e in #(
+ e) # Broken: fails on valid input.
+continue ;;
+esac
fi
rm -f conftest.err conftest.i conftest.$ac_ext
@@ -6084,56 +7527,56 @@ rm -f conftest.err conftest.i conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
# Broken: success on invalid input.
continue
-else
- # Passes both tests.
+else case e in #(
+ e) # Passes both tests.
ac_preproc_ok=:
-break
+break ;;
+esac
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+if $ac_preproc_ok
+then :
break
fi
done
ac_cv_prog_CPP=$CPP
-
+ ;;
+esac
fi
CPP=$ac_cv_prog_CPP
else
ac_cv_prog_CPP=$CPP
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+printf "%s\n" "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#include <limits.h>
Syntax error
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
-else
- # Broken: fails on valid input.
-continue
+else case e in #(
+ e) # Broken: fails on valid input.
+continue ;;
+esac
fi
rm -f conftest.err conftest.i conftest.$ac_ext
@@ -6143,26 +7586,30 @@ rm -f conftest.err conftest.i conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
# Broken: success on invalid input.
continue
-else
- # Passes both tests.
+else case e in #(
+ e) # Passes both tests.
ac_preproc_ok=:
-break
+break ;;
+esac
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+if $ac_preproc_ok
+then :
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else case e in #(
+ e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; } ;;
+esac
fi
ac_ext=c
@@ -6172,44 +7619,51 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5
+printf %s "checking for egrep -e... " >&6; }
+if test ${ac_cv_path_EGREP_TRADITIONAL+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -z "$EGREP_TRADITIONAL"; then
+ ac_path_EGREP_TRADITIONAL_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in grep ggrep
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
+ ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue
+# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found.
+ # Check for GNU $ac_path_EGREP_TRADITIONAL
+case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #(
*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+ ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;;
+#(
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl"
+ "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then
# Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
+ ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL"
+ ac_path_EGREP_TRADITIONAL_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
@@ -6217,65 +7671,61 @@ case `"$ac_path_GREP" --version 2>&1` in
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
- $ac_path_GREP_found && break 3
+ $ac_path_EGREP_TRADITIONAL_found && break 3
done
done
done
IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then
+ :
fi
else
- ac_cv_path_GREP=$GREP
-fi
-
+ ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
+ if test "$ac_cv_path_EGREP_TRADITIONAL"
+then :
+ ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E"
+else case e in #(
+ e) if test -z "$EGREP_TRADITIONAL"; then
+ ac_path_EGREP_TRADITIONAL_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in egrep
+ do
for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
+ ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue
+# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found.
+ # Check for GNU $ac_path_EGREP_TRADITIONAL
+case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #(
*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+ ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;;
+#(
*)
ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
+ printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl"
+ "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then
# Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
+ ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL"
+ ac_path_EGREP_TRADITIONAL_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
@@ -6283,24 +7733,25 @@ case `"$ac_path_EGREP" --version 2>&1` in
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
- $ac_path_EGREP_found && break 3
+ $ac_path_EGREP_TRADITIONAL_found && break 3
done
done
done
IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
+ if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then
as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
- ac_cv_path_EGREP=$EGREP
+ ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL
fi
-
- fi
+ ;;
+esac
+fi ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5
+printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; }
+ EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL
@@ -6325,38 +7776,43 @@ if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CC="$CC"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
- if test "x$PTHREAD_CC" != "x"; then :
+ if test "x$PTHREAD_CC" != "x"
+then :
CC="$PTHREAD_CC"
fi
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
-$as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
+printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char pthread_join ();
+char pthread_join (void);
int
-main ()
+main (void)
{
return pthread_join ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ax_pthread_ok=yes
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
-$as_echo "$ax_pthread_ok" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+printf "%s\n" "$ax_pthread_ok" >&6; }
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
@@ -6432,11 +7888,12 @@ case $host_os in
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
-$as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
+ $EGREP_TRADITIONAL "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1
+then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
+printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
fi
-rm -f conftest*
+rm -rf conftest*
;;
@@ -6456,7 +7913,8 @@ esac
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
-if test "x$GCC" = "xyes"; then :
+if test "x$GCC" = "xyes"
+then :
ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"
fi
@@ -6477,20 +7935,23 @@ case $host_os in
ax_pthread_check_macro="--"
;;
esac
-if test "x$ax_pthread_check_macro" = "x--"; then :
+if test "x$ax_pthread_check_macro" = "x--"
+then :
ax_pthread_check_cond=0
-else
- ax_pthread_check_cond="!defined($ax_pthread_check_macro)"
+else case e in #(
+ e) ax_pthread_check_cond="!defined($ax_pthread_check_macro)" ;;
+esac
fi
# Are we compiling with Clang?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
-$as_echo_n "checking whether $CC is Clang... " >&6; }
-if ${ax_cv_PTHREAD_CLANG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ax_cv_PTHREAD_CLANG=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
+printf %s "checking whether $CC is Clang... " >&6; }
+if test ${ax_cv_PTHREAD_CLANG+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ax_cv_PTHREAD_CLANG=no
# Note that Autoconf sets GCC=yes for Clang as well as GCC
if test "x$GCC" = "xyes"; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6502,16 +7963,18 @@ else
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then :
+ $EGREP_TRADITIONAL "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1
+then :
ax_cv_PTHREAD_CLANG=yes
fi
-rm -f conftest*
+rm -rf conftest*
fi
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5
-$as_echo "$ax_cv_PTHREAD_CLANG" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5
+printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; }
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
ax_pthread_clang_warning=no
@@ -6557,12 +8020,13 @@ if test "x$ax_pthread_clang" = "xyes"; then
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
-$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
-if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
+printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
+if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
@@ -6573,7 +8037,8 @@ else
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
- if test "x$ax_pthread_try" = "xunknown"; then :
+ if test "x$ax_pthread_try" = "xunknown"
+then :
break
fi
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
@@ -6582,32 +8047,36 @@ fi
/* end confdefs.h. */
int main(void){return 0;}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_link="$ax_pthread_2step_ac_link"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(void){return 0;}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
break
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
- if test "x$ax_pthread_try" = "x"; then :
+ if test "x$ax_pthread_try" = "x"
+then :
ax_pthread_try=no
fi
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
-$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
+printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
@@ -6621,43 +8090,48 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
-$as_echo_n "checking whether pthreads work without any flags... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
+printf %s "checking whether pthreads work without any flags... " >&6; }
;;
-mt,pthread)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
-$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
+printf %s "checking whether pthreads work with -mt -lpthread... " >&6; }
PTHREAD_CFLAGS="-mt"
PTHREAD_LIBS="-lpthread"
;;
-*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5
-$as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5
+printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; }
PTHREAD_CFLAGS="$ax_pthread_try_flag"
;;
pthread-config)
# Extract the first word of "pthread-config", so it can be a program name with args.
set dummy pthread-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ax_pthread_config+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ax_pthread_config"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ax_pthread_config+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$ax_pthread_config"; then
ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ax_pthread_config="yes"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -6665,19 +8139,21 @@ done
IFS=$as_save_IFS
test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
-fi
+fi ;;
+esac
fi
ax_pthread_config=$ac_cv_prog_ax_pthread_config
if test -n "$ax_pthread_config"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
-$as_echo "$ax_pthread_config" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+printf "%s\n" "$ax_pthread_config" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
- if test "x$ax_pthread_config" = "xno"; then :
+ if test "x$ax_pthread_config" = "xno"
+then :
continue
fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
@@ -6685,8 +8161,8 @@ fi
;;
*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5
-$as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5
+printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
PTHREAD_LIBS="-l$ax_pthread_try_flag"
;;
esac
@@ -6721,7 +8197,7 @@ $as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
}
static void *start_routine(void *a) { return a; }
int
-main ()
+main (void)
{
pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
@@ -6733,18 +8209,20 @@ pthread_t th; pthread_attr_t attr;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ax_pthread_ok=yes
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
-$as_echo "$ax_pthread_ok" >&6; }
- if test "x$ax_pthread_ok" = "xyes"; then :
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+printf "%s\n" "$ax_pthread_ok" >&6; }
+ if test "x$ax_pthread_ok" = "xyes"
+then :
break
fi
@@ -6761,77 +8239,83 @@ if test "x$ax_pthread_ok" = "xyes"; then
LIBS="$PTHREAD_LIBS $LIBS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
-$as_echo_n "checking for joinable pthread attribute... " >&6; }
-if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ax_cv_PTHREAD_JOINABLE_ATTR=unknown
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+printf %s "checking for joinable pthread attribute... " >&6; }
+if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ax_cv_PTHREAD_JOINABLE_ATTR=unknown
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
int
-main ()
+main (void)
{
int attr = $ax_pthread_attr; return attr /* ; */
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
done
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
-$as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
+printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
- test "x$ax_pthread_joinable_attr_defined" != "xyes"; then :
+ test "x$ax_pthread_joinable_attr_defined" != "xyes"
+then :
-cat >>confdefs.h <<_ACEOF
-#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
-_ACEOF
+printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h
ax_pthread_joinable_attr_defined=yes
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5
-$as_echo_n "checking whether more special flags are required for pthreads... " >&6; }
-if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ax_cv_PTHREAD_SPECIAL_FLAGS=no
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5
+printf %s "checking whether more special flags are required for pthreads... " >&6; }
+if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $host_os in
solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;;
esac
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
-$as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
+printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
- test "x$ax_pthread_special_flags_added" != "xyes"; then :
+ test "x$ax_pthread_special_flags_added" != "xyes"
+then :
PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
ax_pthread_special_flags_added=yes
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
-$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
-if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
+printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; }
+if test ${ax_cv_PTHREAD_PRIO_INHERIT+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
int
-main ()
+main (void)
{
int i = PTHREAD_PRIO_INHERIT;
return i;
@@ -6839,21 +8323,25 @@ int i = PTHREAD_PRIO_INHERIT;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ax_cv_PTHREAD_PRIO_INHERIT=yes
-else
- ax_cv_PTHREAD_PRIO_INHERIT=no
+else case e in #(
+ e) ax_cv_PTHREAD_PRIO_INHERIT=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
-$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
+printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
- test "x$ax_pthread_prio_inherit_defined" != "xyes"; then :
+ test "x$ax_pthread_prio_inherit_defined" != "xyes"
+then :
-$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
+printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
ax_pthread_prio_inherit_defined=yes
@@ -6871,7 +8359,8 @@ fi
#handle absolute path differently from PATH based program lookup
case "x$CC" in #(
x/*) :
- if as_fn_executable_p ${CC}_r; then :
+ if as_fn_executable_p ${CC}_r
+then :
PTHREAD_CC="${CC}_r"
fi ;; #(
*) :
@@ -6879,38 +8368,44 @@ fi ;; #(
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_PTHREAD_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$PTHREAD_CC"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_PTHREAD_CC+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -n "$PTHREAD_CC"; then
ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_PTHREAD_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
-fi
+fi ;;
+esac
fi
PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
if test -n "$PTHREAD_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
-$as_echo "$PTHREAD_CC" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+printf "%s\n" "$PTHREAD_CC" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
@@ -6936,7 +8431,7 @@ test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then
-$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
+printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h
:
else
@@ -6951,298 +8446,511 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "$ax_pthread_ok" = yes; then
- $as_echo "#define HAVE_POSIX_THREAD 1" >>confdefs.h
+ printf "%s\n" "#define HAVE_POSIX_THREAD 1" >>confdefs.h
- $as_echo "#define _REENTRANT 1" >>confdefs.h
+ printf "%s\n" "#define _REENTRANT 1" >>confdefs.h
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
-$as_echo_n "checking for library containing gethostbyname... " >&6; }
-if ${ac_cv_search_gethostbyname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+printf %s "checking for library containing gethostbyname... " >&6; }
+if test ${ac_cv_search_gethostbyname+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char gethostbyname (void);
int
-main ()
+main (void)
{
return gethostbyname ();
;
return 0;
}
_ACEOF
-for ac_lib in '' nsl; do
+for ac_lib in '' nsl
+do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- if ac_fn_c_try_link "$LINENO"; then :
+ if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_search_gethostbyname=$ac_res
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext
- if ${ac_cv_search_gethostbyname+:} false; then :
+ if test ${ac_cv_search_gethostbyname+y}
+then :
break
fi
done
-if ${ac_cv_search_gethostbyname+:} false; then :
+if test ${ac_cv_search_gethostbyname+y}
+then :
-else
- ac_cv_search_gethostbyname=no
+else case e in #(
+ e) ac_cv_search_gethostbyname=no ;;
+esac
fi
rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+LIBS=$ac_func_search_save_LIBS ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
-$as_echo "$ac_cv_search_gethostbyname" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
+printf "%s\n" "$ac_cv_search_gethostbyname" >&6; }
ac_res=$ac_cv_search_gethostbyname
-if test "$ac_res" != no; then :
+if test "$ac_res" != no
+then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
-$as_echo_n "checking for library containing socket... " >&6; }
-if ${ac_cv_search_socket+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+printf %s "checking for library containing socket... " >&6; }
+if test ${ac_cv_search_socket+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char socket ();
+char socket (void);
int
-main ()
+main (void)
{
return socket ();
;
return 0;
}
_ACEOF
-for ac_lib in '' socket; do
+for ac_lib in '' socket
+do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- if ac_fn_c_try_link "$LINENO"; then :
+ if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_search_socket=$ac_res
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext
- if ${ac_cv_search_socket+:} false; then :
+ if test ${ac_cv_search_socket+y}
+then :
break
fi
done
-if ${ac_cv_search_socket+:} false; then :
+if test ${ac_cv_search_socket+y}
+then :
-else
- ac_cv_search_socket=no
+else case e in #(
+ e) ac_cv_search_socket=no ;;
+esac
fi
rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+LIBS=$ac_func_search_save_LIBS ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
-$as_echo "$ac_cv_search_socket" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+printf "%s\n" "$ac_cv_search_socket" >&6; }
ac_res=$ac_cv_search_socket
-if test "$ac_res" != no; then :
+if test "$ac_res" != no
+then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-else
- ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "#include <windows.h>
+else case e in #(
+ e) ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "#include <windows.h>
"
-if test "x$ac_cv_header_winsock2_h" = xyes; then :
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
-$as_echo "#define HAVE_WINSOCK2_H 1" >>confdefs.h
+printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h
if test "$ax_pthread_ok" != yes; then
-$as_echo "#define HAVE_WIN32_THREAD 1" >>confdefs.h
+printf "%s\n" "#define HAVE_WIN32_THREAD 1" >>confdefs.h
fi
LIBS="-lws2_32 $LIBS"
fi
+ ;;
+esac
+fi
-fi
+# Autoupdate added the next two lines to ensure that your configure
+# script's behavior did not change. They are probably safe to remove.
+ac_header= ac_cache=
+for ac_item in $ac_header_c_list
+do
+ if test $ac_cache; then
+ ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
+ if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
+ printf "%s\n" "#define $ac_item 1" >> confdefs.h
+ fi
+ ac_header= ac_cache=
+ elif test $ac_header; then
+ ac_cache=$ac_item
+ else
+ ac_header=$ac_item
+ fi
+done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-int
-main ()
-{
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
+
+
+
+
+if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
+then :
+
+printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+printf %s "checking for grep that handles long lines and -e... " >&6; }
+if test ${ac_cv_path_GREP+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in grep ggrep
+ do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in #(
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+#(
+*)
+ ac_count=0
+ printf %s 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ printf "%s\n" 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
else
- ac_cv_header_stdc=no
+ ac_cv_path_GREP=$GREP
+fi
+ ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+printf "%s\n" "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+printf %s "checking for egrep... " >&6; }
+if test ${ac_cv_path_EGREP+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_prog in egrep
+ do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in #(
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+#(
+*)
+ ac_count=0
+ printf %s 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ printf "%s\n" 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
else
- ac_cv_header_stdc=no
+ ac_cv_path_EGREP=$EGREP
fi
-rm -f conftest*
+ fi ;;
+esac
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+printf "%s\n" "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
+ EGREP_TRADITIONAL=$EGREP
+ ac_cv_path_EGREP_TRADITIONAL=$EGREP
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-else
- ac_cv_header_stdc=no
+ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default"
+if test "x$ac_cv_header_arpa_inet_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h
+
fi
-rm -f conftest*
+ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
+if test "x$ac_cv_header_libintl_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_compile "$LINENO" "net/ethernet.h" "ac_cv_header_net_ethernet_h" "$ac_includes_default"
+if test "x$ac_cv_header_net_ethernet_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_NET_ETHERNET_H 1" >>confdefs.h
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
+fi
+ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default"
+if test "x$ac_cv_header_net_if_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+fi
+ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_ioctl_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h
-else
- ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+ac_fn_c_check_header_compile "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sockio_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_SYS_SOCKIO_H 1" >>confdefs.h
+
fi
+ac_fn_c_check_header_compile "$LINENO" "linux/sockios.h" "ac_cv_header_linux_sockios_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_sockios_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_LINUX_SOCKIOS_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_compile "$LINENO" "linux/ip.h" "ac_cv_header_linux_ip_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_ip_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_LINUX_IP_H 1" >>confdefs.h
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
+ac_fn_c_check_header_compile "$LINENO" "linux/udp.h" "ac_cv_header_linux_udp_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_udp_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_LINUX_UDP_H 1" >>confdefs.h
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+fi
+ac_fn_c_check_header_compile "$LINENO" "linux/tcp.h" "ac_cv_header_linux_tcp_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_tcp_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_LINUX_TCP_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_compile "$LINENO" "linux/if_packet.h" "ac_cv_header_linux_if_packet_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_if_packet_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_LINUX_IF_PACKET_H 1" >>confdefs.h
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+fi
+ac_fn_c_check_header_compile "$LINENO" "linux/filter.h" "ac_cv_header_linux_filter_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_filter_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_LINUX_FILTER_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_compile "$LINENO" "linux/if_tun.h" "ac_cv_header_linux_if_tun_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_if_tun_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_LINUX_IF_TUN_H 1" >>confdefs.h
-done
+fi
+ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default"
+if test "x$ac_cv_header_netdb_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h
+fi
+ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_in_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h
-for ac_header in arpa/inet.h libintl.h net/ethernet.h net/if.h sys/ioctl.h sys/sockio.h linux/sockios.h linux/ip.h linux/udp.h linux/if_packet.h linux/filter.h linux/if_tun.h netdb.h netinet/in.h netinet/tcp.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+fi
+ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_tcp_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_NETINET_TCP_H 1" >>confdefs.h
fi
+ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h
-done
+fi
+ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
+if test "x$ac_cv_header_string_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h
+
+fi
+ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default"
+if test "x$ac_cv_header_strings_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h
+fi
+ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_socket_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h
+fi
+ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_time_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+ac_fn_c_check_header_compile "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
+if test "x$ac_cv_header_syslog_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_SYSLOG_H 1" >>confdefs.h
+
+fi
+ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
+if test "x$ac_cv_header_unistd_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h
+
+fi
+ac_fn_c_check_header_compile "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default"
+if test "x$ac_cv_header_signal_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h
+
+fi
+ac_fn_c_check_header_compile "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default"
+if test "x$ac_cv_header_ifaddrs_h" = xyes
+then :
+ printf "%s\n" "#define HAVE_IFADDRS_H 1" >>confdefs.h
+
+fi
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+printf %s "checking for an ANSI C-conforming const... " >&6; }
+if test ${ac_cv_c_const+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __cplusplus
@@ -7255,7 +8963,7 @@ main ()
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
+ /* IBM XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in
an arm of an if-expression whose if-part is not a constant
expression */
@@ -7283,7 +8991,7 @@ main ()
iptr p = 0;
++p;
}
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+ { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; } bx;
struct s *b = &bx; b->j = 5;
@@ -7299,94 +9007,71 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_c_const=yes
-else
- ac_cv_c_const=no
+else case e in #(
+ e) ac_cv_c_const=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+printf "%s\n" "$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then
-$as_echo "#define const /**/" >>confdefs.h
+printf "%s\n" "#define const /**/" >>confdefs.h
fi
ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
+if test "x$ac_cv_type_size_t" = xyes
+then :
+else case e in #(
+ e)
+printf "%s\n" "#define size_t unsigned int" >>confdefs.h
+ ;;
+esac
fi
ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
-if test "x$ac_cv_type_ssize_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SSIZE_T 1
-_ACEOF
+if test "x$ac_cv_type_ssize_t" = xyes
+then :
+printf "%s\n" "#define HAVE_SSIZE_T 1" >>confdefs.h
-else
- cat >>confdefs.h <<_ACEOF
-#define ssize_t int
-_ACEOF
+else case e in #(
+ e) printf "%s\n" "#define ssize_t int" >>confdefs.h
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
-$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if ${ac_cv_header_time+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_time=yes
-else
- ac_cv_header_time=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
-$as_echo "$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+# Obsolete code to be removed.
+if test $ac_cv_header_sys_time_h = yes; then
+
+printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
fi
+# End of obsolete code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
-$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if ${ac_cv_struct_tm+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if test ${ac_cv_struct_tm+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <time.h>
int
-main ()
+main (void)
{
struct tm tm;
int *p = &tm.tm_sec;
@@ -7395,40 +9080,43 @@ struct tm tm;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_struct_tm=time.h
-else
- ac_cv_struct_tm=sys/time.h
+else case e in #(
+ e) ac_cv_struct_tm=sys/time.h ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
-$as_echo "$ac_cv_struct_tm" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+printf "%s\n" "$ac_cv_struct_tm" >&6; }
if test $ac_cv_struct_tm = sys/time.h; then
-$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h
fi
ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default"
-if test "x$ac_cv_type_int64_t" = xyes; then :
+if test "x$ac_cv_type_int64_t" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INT64_T 1
-_ACEOF
+printf "%s\n" "#define HAVE_INT64_T 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 3rd argument of accept" >&5
-$as_echo_n "checking 3rd argument of accept... " >&6; }
-if ${ac_cv_accept_arg+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 3rd argument of accept" >&5
+printf %s "checking 3rd argument of accept... " >&6; }
+if test ${ac_cv_accept_arg+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e)
if test -z "$ac_cv_accept_arg" ; then
@@ -7444,7 +9132,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
$ac_includes_default
#include <sys/socket.h>
int
-main ()
+main (void)
{
socklen_t length;
accept( 0, 0, &length );
@@ -7452,10 +9140,11 @@ socklen_t length;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_accept_arg=socklen_t
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7481,7 +9170,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
$ac_includes_default
#include <sys/socket.h>
int
-main ()
+main (void)
{
int length;
accept( 0, 0, &length );
@@ -7489,10 +9178,11 @@ int length;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_accept_arg=int
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7518,7 +9208,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
$ac_includes_default
#include <sys/socket.h>
int
-main ()
+main (void)
{
size_t length;
accept( 0, 0, &length );
@@ -7526,10 +9216,11 @@ size_t length;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_accept_arg=size_t
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7555,7 +9246,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
$ac_includes_default
#include <sys/socket.h>
int
-main ()
+main (void)
{
short length;
accept( 0, 0, &length );
@@ -7563,10 +9254,11 @@ short length;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_accept_arg=short
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7592,7 +9284,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
$ac_includes_default
#include <sys/socket.h>
int
-main ()
+main (void)
{
long length;
accept( 0, 0, &length );
@@ -7600,10 +9292,11 @@ long length;
return 0;
}
_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"
+then :
ac_cv_accept_arg=long
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -7613,34 +9306,35 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_accept_arg" >&5
-$as_echo "$ac_cv_accept_arg" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_accept_arg" >&5
+printf "%s\n" "$ac_cv_accept_arg" >&6; }
if test -z "$ac_cv_accept_arg" ; then
ac_cv_accept_arg=int
fi
-cat >>confdefs.h <<_ACEOF
-#define Socklen_t $ac_cv_accept_arg
-_ACEOF
+printf "%s\n" "#define Socklen_t $ac_cv_accept_arg" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
-$as_echo_n "checking for working memcmp... " >&6; }
-if ${ac_cv_func_memcmp_working+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
+printf %s "checking for working memcmp... " >&6; }
+if test ${ac_cv_func_memcmp_working+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) if test "$cross_compiling" = yes
+then :
ac_cv_func_memcmp_working=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
-main ()
+main (void)
{
/* Some versions of memcmp are not 8-bit clean. */
@@ -7671,18 +9365,22 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
ac_cv_func_memcmp_working=yes
-else
- ac_cv_func_memcmp_working=no
+else case e in #(
+ e) ac_cv_func_memcmp_working=no ;;
+esac
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+ conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
-$as_echo "$ac_cv_func_memcmp_working" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
+printf "%s\n" "$ac_cv_func_memcmp_working" >&6; }
test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
*" memcmp.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
@@ -7690,25 +9388,17 @@ test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
esac
-for ac_header in sys/select.h sys/socket.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5
-$as_echo_n "checking types of arguments for select... " >&6; }
-if ${ac_cv_func_select_args+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5
+printf %s "checking types of arguments for select... " >&6; }
+if test ${ac_cv_func_select_args+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_func_select_args='int,int *,struct timeval *'
+for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do
for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7722,7 +9412,7 @@ $ac_includes_default
#endif
int
-main ()
+main (void)
{
extern int select ($ac_arg1,
$ac_arg234, $ac_arg234, $ac_arg234,
@@ -7731,236 +9421,340 @@ extern int select ($ac_arg1,
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
done
done
done
-# Provide a safe default value.
-: "${ac_cv_func_select_args=int,int *,struct timeval *}"
-
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5
-$as_echo "$ac_cv_func_select_args" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5
+printf "%s\n" "$ac_cv_func_select_args" >&6; }
ac_save_IFS=$IFS; IFS=','
set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'`
IFS=$ac_save_IFS
shift
-cat >>confdefs.h <<_ACEOF
-#define SELECT_TYPE_ARG1 $1
-_ACEOF
+printf "%s\n" "#define SELECT_TYPE_ARG1 $1" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define SELECT_TYPE_ARG234 ($2)
-_ACEOF
+printf "%s\n" "#define SELECT_TYPE_ARG234 ($2)" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define SELECT_TYPE_ARG5 ($3)
-_ACEOF
+printf "%s\n" "#define SELECT_TYPE_ARG5 ($3)" >>confdefs.h
-rm -f conftest*
+rm -rf conftest*
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
-$as_echo_n "checking return type of signal handlers... " >&6; }
-if ${ac_cv_type_signal+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+printf %s "checking return type of signal handlers... " >&6; }
+if test ${ac_cv_type_signal+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <signal.h>
int
-main ()
+main (void)
{
return *(signal (0, 0)) (0) == 1;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_type_signal=int
-else
- ac_cv_type_signal=void
+else case e in #(
+ e) ac_cv_type_signal=void ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
-$as_echo "$ac_cv_type_signal" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+printf "%s\n" "$ac_cv_type_signal" >&6; }
+
+printf "%s\n" "#define RETSIGTYPE $ac_cv_type_signal" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define RETSIGTYPE $ac_cv_type_signal
-_ACEOF
-for ac_func in strftime
+ for ac_func in strftime
do :
ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
-if test "x$ac_cv_func_strftime" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-else
- # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
-$as_echo_n "checking for strftime in -lintl... " >&6; }
-if ${ac_cv_lib_intl_strftime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
+if test "x$ac_cv_func_strftime" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRFTIME 1" >>confdefs.h
+
+else case e in #(
+ e) # strftime is in -lintl on SCO UNIX.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
+printf %s "checking for strftime in -lintl... " >&6; }
+if test ${ac_cv_lib_intl_strftime+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+ builtin and then its argument prototype would still apply.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
#ifdef __cplusplus
extern "C"
#endif
-char strftime ();
+char strftime (void);
int
-main ()
+main (void)
{
return strftime ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ac_cv_lib_intl_strftime=yes
-else
- ac_cv_lib_intl_strftime=no
+else case e in #(
+ e) ac_cv_lib_intl_strftime=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
-$as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test "x$ac_cv_lib_intl_strftime" = xyes; then :
- $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
+printf "%s\n" "$ac_cv_lib_intl_strftime" >&6; }
+if test "x$ac_cv_lib_intl_strftime" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRFTIME 1" >>confdefs.h
LIBS="-lintl $LIBS"
fi
-
+ ;;
+esac
fi
+
+done
+ac_func=
+for ac_item in $ac_func_c_list
+do
+ if test $ac_func; then
+ ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func
+ if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then
+ echo "#define $ac_item 1" >> confdefs.h
+ fi
+ ac_func=
+ else
+ ac_func=$ac_item
+ fi
done
-for ac_func in vprintf
-do :
- ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
-if test "x$ac_cv_func_vprintf" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_VPRINTF 1
-_ACEOF
+if test "x$ac_cv_func_vprintf" = xno
+then :
+ ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
+if test "x$ac_cv_func__doprnt" = xyes
+then :
-ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
-if test "x$ac_cv_func__doprnt" = xyes; then :
+printf "%s\n" "#define HAVE_DOPRNT 1" >>confdefs.h
-$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
+fi
fi
+ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit"
+if test "x$ac_cv_func_atexit" = xyes
+then :
+ printf "%s\n" "#define HAVE_ATEXIT 1" >>confdefs.h
fi
-done
+ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset"
+if test "x$ac_cv_func_memset" = xyes
+then :
+ printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h
+fi
+ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select"
+if test "x$ac_cv_func_select" = xyes
+then :
+ printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h
-for ac_func in atexit memset select strchr strerror strtol strtoll strtod usleep clock_gettime sched_setscheduler sched_yield mlockall setitimer nanosleep clock_nanosleep freopen
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+fi
+ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr"
+if test "x$ac_cv_func_strchr" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRCHR 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
+if test "x$ac_cv_func_strerror" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol"
+if test "x$ac_cv_func_strtol" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRTOL 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll"
+if test "x$ac_cv_func_strtoll" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRTOLL 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "strtod" "ac_cv_func_strtod"
+if test "x$ac_cv_func_strtod" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRTOD 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep"
+if test "x$ac_cv_func_usleep" = xyes
+then :
+ printf "%s\n" "#define HAVE_USLEEP 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
+if test "x$ac_cv_func_clock_gettime" = xyes
+then :
+ printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler"
+if test "x$ac_cv_func_sched_setscheduler" = xyes
+then :
+ printf "%s\n" "#define HAVE_SCHED_SETSCHEDULER 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "sched_yield" "ac_cv_func_sched_yield"
+if test "x$ac_cv_func_sched_yield" = xyes
+then :
+ printf "%s\n" "#define HAVE_SCHED_YIELD 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall"
+if test "x$ac_cv_func_mlockall" = xyes
+then :
+ printf "%s\n" "#define HAVE_MLOCKALL 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "setitimer" "ac_cv_func_setitimer"
+if test "x$ac_cv_func_setitimer" = xyes
+then :
+ printf "%s\n" "#define HAVE_SETITIMER 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep"
+if test "x$ac_cv_func_nanosleep" = xyes
+then :
+ printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "clock_nanosleep" "ac_cv_func_clock_nanosleep"
+if test "x$ac_cv_func_clock_nanosleep" = xyes
+then :
+ printf "%s\n" "#define HAVE_CLOCK_NANOSLEEP 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "freopen" "ac_cv_func_freopen"
+if test "x$ac_cv_func_freopen" = xyes
+then :
+ printf "%s\n" "#define HAVE_FREOPEN 1" >>confdefs.h
fi
-done
ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
-if test "x$ac_cv_func_snprintf" = xyes; then :
- $as_echo "#define HAVE_SNPRINTF 1" >>confdefs.h
+if test "x$ac_cv_func_snprintf" = xyes
+then :
+ printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h
-else
- case " $LIBOBJS " in
+else case e in #(
+ e) case " $LIBOBJS " in
*" snprintf.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
;;
esac
-
+ ;;
+esac
fi
-
ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
-if test "x$ac_cv_func_inet_pton" = xyes; then :
- $as_echo "#define HAVE_INET_PTON 1" >>confdefs.h
+if test "x$ac_cv_func_inet_pton" = xyes
+then :
+ printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h
-else
- case " $LIBOBJS " in
+else case e in #(
+ e) case " $LIBOBJS " in
*" inet_pton.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS inet_pton.$ac_objext"
;;
esac
-
+ ;;
+esac
fi
-
ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
-if test "x$ac_cv_func_inet_ntop" = xyes; then :
- $as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
+if test "x$ac_cv_func_inet_ntop" = xyes
+then :
+ printf "%s\n" "#define HAVE_INET_NTOP 1" >>confdefs.h
-else
- case " $LIBOBJS " in
+else case e in #(
+ e) case " $LIBOBJS " in
*" inet_ntop.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext"
;;
esac
-
+ ;;
+esac
fi
-
ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
-if test "x$ac_cv_func_gettimeofday" = xyes; then :
- $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
+if test "x$ac_cv_func_gettimeofday" = xyes
+then :
+ printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
-else
- case " $LIBOBJS " in
+else case e in #(
+ e) case " $LIBOBJS " in
*" gettimeofday.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
;;
esac
-
+ ;;
+esac
fi
-
-ac_fn_c_check_decl "$LINENO" "ENOBUFS" "ac_cv_have_decl_ENOBUFS" "#include <errno.h>
-"
-if test "x$ac_cv_have_decl_ENOBUFS" = xyes; then :
+ac_fn_check_decl "$LINENO" "ENOBUFS" "ac_cv_have_decl_ENOBUFS" "#include <errno.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_ENOBUFS" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ENOBUFS $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "EWOULDBLOCK" "ac_cv_have_decl_EWOULDBLOCK" "#include <errno.h>
-"
-if test "x$ac_cv_have_decl_EWOULDBLOCK" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_ENOBUFS $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "EWOULDBLOCK" "ac_cv_have_decl_EWOULDBLOCK" "#include <errno.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_EWOULDBLOCK" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
+printf "%s\n" "#define HAVE_DECL_EWOULDBLOCK $ac_have_decl" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_EWOULDBLOCK $ac_have_decl
-_ACEOF
-
-ac_fn_c_check_decl "$LINENO" "SIOCGIFMTU" "ac_cv_have_decl_SIOCGIFMTU" "
+ac_fn_check_decl "$LINENO" "SIOCGIFMTU" "ac_cv_have_decl_SIOCGIFMTU" "
#ifdef HAVE_LINUX_SOCKIOS_H
#include <linux/sockios.h>
#endif
@@ -7968,55 +9762,61 @@ ac_fn_c_check_decl "$LINENO" "SIOCGIFMTU" "ac_cv_have_decl_SIOCGIFMTU" "
#include <sys/sockio.h>
#endif
-"
-if test "x$ac_cv_have_decl_SIOCGIFMTU" = xyes; then :
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SIOCGIFMTU" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
+printf "%s\n" "#define HAVE_DECL_SIOCGIFMTU $ac_have_decl" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SIOCGIFMTU $ac_have_decl
-_ACEOF
-
-ac_fn_c_check_decl "$LINENO" "pthread_cancel" "ac_cv_have_decl_pthread_cancel" "#include <pthread.h>
-"
-if test "x$ac_cv_have_decl_pthread_cancel" = xyes; then :
+ac_fn_check_decl "$LINENO" "pthread_cancel" "ac_cv_have_decl_pthread_cancel" "#include <pthread.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_pthread_cancel" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
+printf "%s\n" "#define HAVE_DECL_PTHREAD_CANCEL $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "pthread_threadid_np" "ac_cv_have_decl_pthread_threadid_np" "#include <pthread.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_pthread_threadid_np" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_PTHREAD_THREADID_NP $ac_have_decl" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PTHREAD_CANCEL $ac_have_decl
-_ACEOF
-
-ac_fn_c_check_decl "$LINENO" "CPU_SET" "ac_cv_have_decl_CPU_SET" "
+ac_fn_check_decl "$LINENO" "CPU_SET" "ac_cv_have_decl_CPU_SET" "
#define _GNU_SOURCE
#include <sched.h>
-"
-if test "x$ac_cv_have_decl_CPU_SET" = xyes; then :
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_CPU_SET" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
+printf "%s\n" "#define HAVE_DECL_CPU_SET $ac_have_decl" >>confdefs.h
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_CPU_SET $ac_have_decl
-_ACEOF
-
-ac_fn_c_check_decl "$LINENO" "SIGALRM" "ac_cv_have_decl_SIGALRM" "#include <signal.h>
-"
-if test "x$ac_cv_have_decl_SIGALRM" = xyes; then :
+ac_fn_check_decl "$LINENO" "SIGALRM" "ac_cv_have_decl_SIGALRM" "#include <signal.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SIGALRM" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SIGALRM $ac_have_decl
-_ACEOF
+printf "%s\n" "#define HAVE_DECL_SIGALRM $ac_have_decl" >>confdefs.h
@@ -8034,373 +9834,538 @@ in_h='
#endif
'
-ac_fn_c_check_decl "$LINENO" "AF_INET6" "ac_cv_have_decl_AF_INET6" "$in_h
-"
-if test "x$ac_cv_have_decl_AF_INET6" = xyes; then :
+ac_fn_check_decl "$LINENO" "AF_INET6" "ac_cv_have_decl_AF_INET6" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_AF_INET6" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_AF_INET6 $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "SO_TIMESTAMP" "ac_cv_have_decl_SO_TIMESTAMP" "$in_h
-"
-if test "x$ac_cv_have_decl_SO_TIMESTAMP" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_AF_INET6 $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "SO_TIMESTAMP" "ac_cv_have_decl_SO_TIMESTAMP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SO_TIMESTAMP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SO_TIMESTAMP $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "SO_SNDTIMEO" "ac_cv_have_decl_SO_SNDTIMEO" "$in_h
-"
-if test "x$ac_cv_have_decl_SO_SNDTIMEO" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_SO_TIMESTAMP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "SO_SNDTIMEO" "ac_cv_have_decl_SO_SNDTIMEO" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SO_SNDTIMEO" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SO_SNDTIMEO $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "SO_REUSEPORT" "ac_cv_have_decl_SO_REUSEPORT" "$in_h
-"
-if test "x$ac_cv_have_decl_SO_REUSEPORT" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_SO_SNDTIMEO $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "SO_REUSEADDR" "ac_cv_have_decl_SO_REUSEADDR" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SO_REUSEADDR" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SO_REUSEPORT $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "SO_BINDTODEVICE" "ac_cv_have_decl_SO_BINDTODEVICE" "$in_h
-"
-if test "x$ac_cv_have_decl_SO_BINDTODEVICE" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_SO_REUSEADDR $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "SO_REUSEPORT" "ac_cv_have_decl_SO_REUSEPORT" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SO_REUSEPORT" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SO_BINDTODEVICE $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "MSG_DONTWAIT" "ac_cv_have_decl_MSG_DONTWAIT" "$in_h
-"
-if test "x$ac_cv_have_decl_MSG_DONTWAIT" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_SO_REUSEPORT $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "SO_BINDTODEVICE" "ac_cv_have_decl_SO_BINDTODEVICE" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SO_BINDTODEVICE" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MSG_DONTWAIT $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "SO_MAX_PACING_RATE" "ac_cv_have_decl_SO_MAX_PACING_RATE" "$in_h
-"
-if test "x$ac_cv_have_decl_SO_MAX_PACING_RATE" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_SO_BINDTODEVICE $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MSG_DONTWAIT" "ac_cv_have_decl_MSG_DONTWAIT" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MSG_DONTWAIT" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SO_MAX_PACING_RATE $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "SO_DONTROUTE" "ac_cv_have_decl_SO_DONTROUTE" "$in_h
-"
-if test "x$ac_cv_have_decl_SO_DONTROUTE" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MSG_DONTWAIT $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MSG_TRUNC" "ac_cv_have_decl_MSG_TRUNC" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MSG_TRUNC" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SO_DONTROUTE $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IPV6_TCLASS" "ac_cv_have_decl_IPV6_TCLASS" "$in_h
-"
-if test "x$ac_cv_have_decl_IPV6_TCLASS" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MSG_TRUNC $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MSG_CTRUNC" "ac_cv_have_decl_MSG_CTRUNC" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MSG_CTRUNC" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IPV6_TCLASS $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IP_MULTICAST_ALL" "ac_cv_have_decl_IP_MULTICAST_ALL" "$in_h
-"
-if test "x$ac_cv_have_decl_IP_MULTICAST_ALL" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MSG_CTRUNC $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "SO_MAX_PACING_RATE" "ac_cv_have_decl_SO_MAX_PACING_RATE" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SO_MAX_PACING_RATE" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IP_MULTICAST_ALL $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IP_TOS" "ac_cv_have_decl_IP_TOS" "$in_h
-"
-if test "x$ac_cv_have_decl_IP_TOS" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_SO_MAX_PACING_RATE $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "SO_DONTROUTE" "ac_cv_have_decl_SO_DONTROUTE" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SO_DONTROUTE" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IP_TOS $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "MCAST_JOIN_GROUP" "ac_cv_have_decl_MCAST_JOIN_GROUP" "$in_h
-"
-if test "x$ac_cv_have_decl_MCAST_JOIN_GROUP" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_SO_DONTROUTE $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IPV6_TCLASS" "ac_cv_have_decl_IPV6_TCLASS" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IPV6_TCLASS" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MCAST_JOIN_GROUP $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "MCAST_JOIN_SOURCE_GROUP" "ac_cv_have_decl_MCAST_JOIN_SOURCE_GROUP" "$in_h
-"
-if test "x$ac_cv_have_decl_MCAST_JOIN_SOURCE_GROUP" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IPV6_TCLASS $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_MULTICAST_ALL" "ac_cv_have_decl_IP_MULTICAST_ALL" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_MULTICAST_ALL" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MCAST_JOIN_SOURCE_GROUP $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IPV6_JOIN_GROUP" "ac_cv_have_decl_IPV6_JOIN_GROUP" "$in_h
-"
-if test "x$ac_cv_have_decl_IPV6_JOIN_GROUP" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IP_MULTICAST_ALL $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_TOS" "ac_cv_have_decl_IP_TOS" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_TOS" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IPV6_JOIN_GROUP $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IPV6_V6ONLY" "ac_cv_have_decl_IPV6_V6ONLY" "$in_h
-"
-if test "x$ac_cv_have_decl_IPV6_V6ONLY" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IP_TOS $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_DROP_MEMBERSHIP" "ac_cv_have_decl_IP_DROP_MEMBERSHIP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_DROP_MEMBERSHIP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IPV6_V6ONLY $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IPV6_ADD_MEMBERSHIP" "ac_cv_have_decl_IPV6_ADD_MEMBERSHIP" "$in_h
-"
-if test "x$ac_cv_have_decl_IPV6_ADD_MEMBERSHIP" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IP_DROP_MEMBERSHIP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IPV6_LEAVE_GROUP" "ac_cv_have_decl_IPV6_LEAVE_GROUP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IPV6_LEAVE_GROUP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IPV6_ADD_MEMBERSHIP $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IPV6_MULTICAST_HOPS" "ac_cv_have_decl_IPV6_MULTICAST_HOPS" "$in_h
-"
-if test "x$ac_cv_have_decl_IPV6_MULTICAST_HOPS" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IPV6_LEAVE_GROUP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MCAST_LEAVE_GROUP" "ac_cv_have_decl_MCAST_LEAVE_GROUP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MCAST_LEAVE_GROUP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IPV6_MULTICAST_HOPS $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "MSG_PEEK" "ac_cv_have_decl_MSG_PEEK" "$in_h
-"
-if test "x$ac_cv_have_decl_MSG_PEEK" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MCAST_LEAVE_GROUP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MCAST_JOIN_GROUP" "ac_cv_have_decl_MCAST_JOIN_GROUP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MCAST_JOIN_GROUP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MSG_PEEK $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "MSG_WAITALL" "ac_cv_have_decl_MSG_WAITALL" "$in_h
-"
-if test "x$ac_cv_have_decl_MSG_WAITALL" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MCAST_JOIN_GROUP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MCAST_JOIN_SOURCE_GROUP" "ac_cv_have_decl_MCAST_JOIN_SOURCE_GROUP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MCAST_JOIN_SOURCE_GROUP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MSG_WAITALL $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "TCP_NODELAY" "ac_cv_have_decl_TCP_NODELAY" "$in_h
-"
-if test "x$ac_cv_have_decl_TCP_NODELAY" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MCAST_JOIN_SOURCE_GROUP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MCAST_LEAVE_SOURCE_GROUP" "ac_cv_have_decl_MCAST_LEAVE_SOURCE_GROUP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MCAST_LEAVE_SOURCE_GROUP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TCP_NODELAY $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "TCP_INFO" "ac_cv_have_decl_TCP_INFO" "$in_h
-"
-if test "x$ac_cv_have_decl_TCP_INFO" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IPV6_JOIN_GROUP" "ac_cv_have_decl_IPV6_JOIN_GROUP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IPV6_JOIN_GROUP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TCP_INFO $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "TCP_CONNECTION_INFO" "ac_cv_have_decl_TCP_CONNECTION_INFO" "$in_h
-"
-if test "x$ac_cv_have_decl_TCP_CONNECTION_INFO" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IPV6_JOIN_GROUP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IPV6_V6ONLY" "ac_cv_have_decl_IPV6_V6ONLY" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IPV6_V6ONLY" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TCP_CONNECTION_INFO $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "TCP_WINDOW_CLAMP" "ac_cv_have_decl_TCP_WINDOW_CLAMP" "$in_h
-"
-if test "x$ac_cv_have_decl_TCP_WINDOW_CLAMP" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IPV6_V6ONLY $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IPV6_ADD_MEMBERSHIP" "ac_cv_have_decl_IPV6_ADD_MEMBERSHIP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IPV6_ADD_MEMBERSHIP" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TCP_WINDOW_CLAMP $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "TCP_QUICKACK" "ac_cv_have_decl_TCP_QUICKACK" "$in_h
-"
-if test "x$ac_cv_have_decl_TCP_QUICKACK" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IPV6_ADD_MEMBERSHIP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IPV6_MULTICAST_HOPS" "ac_cv_have_decl_IPV6_MULTICAST_HOPS" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IPV6_MULTICAST_HOPS" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TCP_QUICKACK $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "TCP_NOTSENT_LOWAT" "ac_cv_have_decl_TCP_NOTSENT_LOWAT" "$in_h
-"
-if test "x$ac_cv_have_decl_TCP_NOTSENT_LOWAT" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_IPV6_MULTICAST_HOPS $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MSG_PEEK" "ac_cv_have_decl_MSG_PEEK" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MSG_PEEK" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TCP_NOTSENT_LOWAT $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "TCP_MAXSEG" "ac_cv_have_decl_TCP_MAXSEG" "$in_h
-"
-if test "x$ac_cv_have_decl_TCP_MAXSEG" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MSG_PEEK $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MSG_WAITALL" "ac_cv_have_decl_MSG_WAITALL" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MSG_WAITALL" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TCP_MAXSEG $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IP_ADD_MEMBERSHIP" "ac_cv_have_decl_IP_ADD_MEMBERSHIP" "$in_h
-"
-if test "x$ac_cv_have_decl_IP_ADD_MEMBERSHIP" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_MSG_WAITALL $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_CONGESTION" "ac_cv_have_decl_TCP_CONGESTION" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_CONGESTION" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IP_ADD_MEMBERSHIP $ac_have_decl
-_ACEOF
-ac_fn_c_check_decl "$LINENO" "IP_ADD_SOURCE_MEMBERSHIP" "ac_cv_have_decl_IP_ADD_SOURCE_MEMBERSHIP" "$in_h
-"
-if test "x$ac_cv_have_decl_IP_ADD_SOURCE_MEMBERSHIP" = xyes; then :
+printf "%s\n" "#define HAVE_DECL_TCP_CONGESTION $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_NODELAY" "ac_cv_have_decl_TCP_NODELAY" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_NODELAY" = xyes
+then :
ac_have_decl=1
-else
- ac_have_decl=0
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP $ac_have_decl
-_ACEOF
+printf "%s\n" "#define HAVE_DECL_TCP_NODELAY $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_INFO" "ac_cv_have_decl_TCP_INFO" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_INFO" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_TCP_INFO $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_CONNECTION_INFO" "ac_cv_have_decl_TCP_CONNECTION_INFO" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_CONNECTION_INFO" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_TCP_CONNECTION_INFO $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_WINDOW_CLAMP" "ac_cv_have_decl_TCP_WINDOW_CLAMP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_WINDOW_CLAMP" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_TCP_WINDOW_CLAMP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_TX_DELAY" "ac_cv_have_decl_TCP_TX_DELAY" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_TX_DELAY" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_TCP_TX_DELAY $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_QUICKACK" "ac_cv_have_decl_TCP_QUICKACK" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_QUICKACK" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_TCP_QUICKACK $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "SO_ZEROCOPY" "ac_cv_have_decl_SO_ZEROCOPY" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_SO_ZEROCOPY" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_SO_ZEROCOPY $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MSG_ZEROCOPY" "ac_cv_have_decl_MSG_ZEROCOPY" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MSG_ZEROCOPY" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_MSG_ZEROCOPY $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MSG_ERRQUEUE" "ac_cv_have_decl_MSG_ERRQUEUE" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MSG_ERRQUEUE" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_MSG_ERRQUEUE $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_MULTICAST_IF" "ac_cv_have_decl_IP_MULTICAST_IF" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_MULTICAST_IF" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_IP_MULTICAST_IF $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IPV6_MULTICAST_IF" "ac_cv_have_decl_IPV6_MULTICAST_IF" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IPV6_MULTICAST_IF" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_IPV6_MULTICAST_IF $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MCAST_BLOCK_SOURCE" "ac_cv_have_decl_MCAST_BLOCK_SOURCE" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MCAST_BLOCK_SOURCE" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_MCAST_BLOCK_SOURCE $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "MCAST_UNBLOCK_SOURCE" "ac_cv_have_decl_MCAST_UNBLOCK_SOURCE" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_MCAST_UNBLOCK_SOURCE" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_MCAST_UNBLOCK_SOURCE $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_BLOCK_SOURCE" "ac_cv_have_decl_IP_BLOCK_SOURCE" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_BLOCK_SOURCE" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_IP_BLOCK_SOURCE $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_UNBLOCK_SOURCE" "ac_cv_have_decl_IP_UNBLOCK_SOURCE" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_UNBLOCK_SOURCE" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_IP_UNBLOCK_SOURCE $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_NOTSENT_LOWAT" "ac_cv_have_decl_TCP_NOTSENT_LOWAT" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_NOTSENT_LOWAT" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_TCP_NOTSENT_LOWAT $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "TCP_MAXSEG" "ac_cv_have_decl_TCP_MAXSEG" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_TCP_MAXSEG" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_TCP_MAXSEG $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_ADD_MEMBERSHIP" "ac_cv_have_decl_IP_ADD_MEMBERSHIP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_ADD_MEMBERSHIP" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_IP_ADD_MEMBERSHIP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_ADD_SOURCE_MEMBERSHIP" "ac_cv_have_decl_IP_ADD_SOURCE_MEMBERSHIP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_ADD_SOURCE_MEMBERSHIP" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP $ac_have_decl" >>confdefs.h
+ac_fn_check_decl "$LINENO" "IP_DROP_SOURCE_MEMBERSHIP" "ac_cv_have_decl_IP_DROP_SOURCE_MEMBERSHIP" "$in_h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_IP_DROP_SOURCE_MEMBERSHIP" = xyes
+then :
+ ac_have_decl=1
+else case e in #(
+ e) ac_have_decl=0 ;;
+esac
+fi
+printf "%s\n" "#define HAVE_DECL_IP_DROP_SOURCE_MEMBERSHIP $ac_have_decl" >>confdefs.h
ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "$in_h
"
-if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
+if test "x$ac_cv_type_struct_sockaddr_storage" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_STORAGE 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
fi
ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$in_h
"
-if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
+if test "x$ac_cv_type_struct_sockaddr_in6" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_IN6 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
fi
ac_fn_c_check_type "$LINENO" "struct group_source_req" "ac_cv_type_struct_group_source_req" "$in_h
"
-if test "x$ac_cv_type_struct_group_source_req" = xyes; then :
+if test "x$ac_cv_type_struct_group_source_req" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_GROUP_SOURCE_REQ 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_GROUP_SOURCE_REQ 1" >>confdefs.h
fi
ac_fn_c_check_type "$LINENO" "struct ip_mreq" "ac_cv_type_struct_ip_mreq" "$in_h
"
-if test "x$ac_cv_type_struct_ip_mreq" = xyes; then :
+if test "x$ac_cv_type_struct_ip_mreq" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IP_MREQ 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_IP_MREQ 1" >>confdefs.h
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct ip_mreqn" "ac_cv_type_struct_ip_mreqn" "$in_h
+"
+if test "x$ac_cv_type_struct_ip_mreqn" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_IP_MREQN 1" >>confdefs.h
fi
ac_fn_c_check_type "$LINENO" "struct ipv6_mreq" "ac_cv_type_struct_ipv6_mreq" "$in_h
"
-if test "x$ac_cv_type_struct_ipv6_mreq" = xyes; then :
+if test "x$ac_cv_type_struct_ipv6_mreq" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IPV6_MREQ 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_IPV6_MREQ 1" >>confdefs.h
fi
ac_fn_c_check_type "$LINENO" "struct ip_mreq_source" "ac_cv_type_struct_ip_mreq_source" "$in_h
"
-if test "x$ac_cv_type_struct_ip_mreq_source" = xyes; then :
+if test "x$ac_cv_type_struct_ip_mreq_source" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IP_MREQ_SOURCE 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_IP_MREQ_SOURCE 1" >>confdefs.h
fi
@@ -8408,21 +10373,19 @@ fi
ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_len" "ac_cv_member_struct_sockaddr_in6_sin6_len" "$in_h
"
-if test "x$ac_cv_member_struct_sockaddr_in6_sin6_len" = xyes; then :
+if test "x$ac_cv_member_struct_sockaddr_in6_sin6_len" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1" >>confdefs.h
fi
ac_fn_c_check_member "$LINENO" "struct ip_mreq_source" "imr_multiaddr.s_addr" "ac_cv_member_struct_ip_mreq_source_imr_multiaddr_s_addr" "$in_h
"
-if test "x$ac_cv_member_struct_ip_mreq_source_imr_multiaddr_s_addr" = xyes; then :
+if test "x$ac_cv_member_struct_ip_mreq_source_imr_multiaddr_s_addr" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IP_MREQ_SOURCE_IMR_MULTIADDR_S_ADDR 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_IP_MREQ_SOURCE_IMR_MULTIADDR_S_ADDR 1" >>confdefs.h
fi
@@ -8433,127 +10396,245 @@ ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_total_retrans" "ac_cv_mem
#include <netinet/tcp.h>
"
-if test "x$ac_cv_member_struct_tcp_info_tcpi_total_retrans" = xyes; then :
+if test "x$ac_cv_member_struct_tcp_info_tcpi_total_retrans" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_TOTAL_RETRANS 1" >>confdefs.h
+
fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_unacked" "ac_cv_member_struct_tcp_info_tcpi_unacked" "
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_unacked" = xyes
+then :
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_UNACKED 1" >>confdefs.h
-ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_total_retrans" "ac_cv_member_struct_tcp_info_tcpi_total_retrans" "
+
+fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_sacked" "ac_cv_member_struct_tcp_info_tcpi_sacked" "
#include <netinet/in.h>
#include <netinet/tcp.h>
"
-if test "x$ac_cv_member_struct_tcp_info_tcpi_total_retrans" = xyes; then :
+if test "x$ac_cv_member_struct_tcp_info_tcpi_sacked" = xyes
+then :
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_TCP_INFO_TCPI_TOTAL_RETRANS 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_SACKED 1" >>confdefs.h
fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_lost" "ac_cv_member_struct_tcp_info_tcpi_lost" "
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_lost" = xyes
+then :
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_LOST 1" >>confdefs.h
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if ${ac_cv_header_stdbool_h+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_retrans" "ac_cv_member_struct_tcp_info_tcpi_retrans" "
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_retrans" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_RETRANS 1" >>confdefs.h
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_snd_mss" "ac_cv_member_struct_tcp_info_tcpi_snd_mss" "
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_snd_mss" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_SND_MSS 1" >>confdefs.h
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_snd_cwnd" "ac_cv_member_struct_tcp_info_tcpi_snd_cwnd" "
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_snd_cwnd" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND 1" >>confdefs.h
+
+
+fi
+
+
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_delivered" "ac_cv_member_struct_tcp_info_tcpi_delivered" "
+#include <linux/tcp.h>
+
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_delivered" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_DELIVERED 1" >>confdefs.h
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_delivered_ce" "ac_cv_member_struct_tcp_info_tcpi_delivered_ce" "
+#include <linux/tcp.h>
+
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_delivered_ce" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_DELIVERED_CE 1" >>confdefs.h
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_dsack_dups" "ac_cv_member_struct_tcp_info_tcpi_dsack_dups" "
+#include <linux/tcp.h>
+
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_dsack_dups" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_DSACK_DUPS 1" >>confdefs.h
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct tcp_info" "tcpi_data_segs_out" "ac_cv_member_struct_tcp_info_tcpi_data_segs_out" "
+#include <linux/tcp.h>
+
+"
+if test "x$ac_cv_member_struct_tcp_info_tcpi_data_segs_out" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_TCP_INFO_TCPI_DATA_SEGS_OUT 1" >>confdefs.h
+
+
+fi
+
+
+
+ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes
+then :
+
+printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h
+
+
+fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99 or later" >&5
+printf %s "checking for stdbool.h that conforms to C99 or later... " >&6; }
+if test ${ac_cv_header_stdbool_h+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <stdbool.h>
+
+ /* "true" and "false" should be usable in #if expressions and
+ integer constant expressions, and "bool" should be a valid
+ type name.
- #include <stdbool.h>
- #ifndef bool
- "error: bool is not defined"
+ Although C99 requires bool, true, and false to be macros,
+ C23 and C++11 overrule that, so do not test for that.
+ Although C99 requires __bool_true_false_are_defined and
+ _Bool, C23 says they are obsolescent, so do not require
+ them. */
+
+ #if !true
+ #error "'true' is not true"
#endif
- #ifndef false
- "error: false is not defined"
+ #if true != 1
+ #error "'true' is not equal to 1"
#endif
+ char b[true == 1 ? 1 : -1];
+ char c[true];
+
#if false
- "error: false is not 0"
- #endif
- #ifndef true
- "error: true is not defined"
- #endif
- #if true != 1
- "error: true is not 1"
+ #error "'false' is not false"
#endif
- #ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
+ #if false != 0
+ #error "'false' is not equal to 0"
#endif
+ char d[false == 0 ? 1 : -1];
+
+ enum { e = false, f = true, g = false * true, h = true * 256 };
+
+ char i[(bool) 0.5 == true ? 1 : -1];
+ char j[(bool) 0.0 == false ? 1 : -1];
+ char k[sizeof (bool) > 0 ? 1 : -1];
+
+ struct sb { bool s: 1; bool t; } s;
+ char l[sizeof s.t > 0 ? 1 : -1];
- struct s { _Bool s: 1; _Bool t; } s;
-
- char a[true == 1 ? 1 : -1];
- char b[false == 0 ? 1 : -1];
- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) 0.5 == true ? 1 : -1];
- /* See body of main program for 'e'. */
- char f[(_Bool) 0.0 == false ? 1 : -1];
- char g[true];
- char h[sizeof (_Bool)];
- char i[sizeof s.t];
- enum { j = false, k = true, l = false * true, m = true * 256 };
/* The following fails for
HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
- _Bool n[m];
- char o[sizeof n == m * sizeof n[0] ? 1 : -1];
- char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ bool m[h];
+ char n[sizeof m == h * sizeof m[0] ? 1 : -1];
+ char o[-1 - (bool) 0 < 0 ? 1 : -1];
/* Catch a bug in an HP-UX C compiler. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
*/
- _Bool q = true;
- _Bool *pq = &q;
+ bool p = true;
+ bool *pp = &p;
int
-main ()
+main (void)
{
- bool e = &s;
- *pq |= q;
- *pq |= ! q;
- /* Refer to every declared value, to avoid compiler optimizations. */
- return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p + !q + !pq);
+ bool ps = &s;
+ *pp |= p;
+ *pp |= ! p;
+
+ /* Refer to every declared value, so they cannot be
+ discarded as unused. */
+ return (!b + !c + !d + !e + !f + !g + !h + !i + !j + !k
+ + !l + !m + !n + !o + !p + !pp + !ps);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_header_stdbool_h=yes
-else
- ac_cv_header_stdbool_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else case e in #(
+ e) ac_cv_header_stdbool_h=no ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
- ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE__BOOL 1
-_ACEOF
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+printf "%s\n" "$ac_cv_header_stdbool_h" >&6; }
if test $ac_cv_header_stdbool_h = yes; then
-$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_bigendian=unknown
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+printf %s "checking whether byte ordering is bigendian... " >&6; }
+if test ${ac_cv_c_bigendian+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_cv_c_bigendian=unknown
# See if we're dealing with a universal compiler.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8563,7 +10644,8 @@ else
typedef int dummy;
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
# Check for potential -arch flags. It is not universal unless
# there are at least two -arch flags with different values.
@@ -8587,7 +10669,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
fi
done
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
if test $ac_cv_c_bigendian = unknown; then
# See if sys/param.h defines the BYTE_ORDER macro.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8596,10 +10678,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#include <sys/param.h>
int
-main ()
+main (void)
{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\
&& LITTLE_ENDIAN)
bogus endian macros
#endif
@@ -8608,7 +10690,8 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
# It does; now see whether it defined to BIG_ENDIAN or not.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8616,7 +10699,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
#include <sys/param.h>
int
-main ()
+main (void)
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
@@ -8626,14 +10709,16 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
+else case e in #(
+ e) ac_cv_c_bigendian=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
@@ -8642,7 +10727,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#include <limits.h>
int
-main ()
+main (void)
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
bogus endian macros
@@ -8652,14 +10737,15 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
# It does; now see whether it defined to _BIG_ENDIAN or not.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <limits.h>
int
-main ()
+main (void)
{
#ifndef _BIG_ENDIAN
not big endian
@@ -8669,50 +10755,55 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
+else case e in #(
+ e) ac_cv_c_bigendian=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# Compile a test program.
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes
+then :
# Try to guess by grepping values from an object file.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-short int ascii_mm[] =
+unsigned short int ascii_mm[] =
{ 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
+ unsigned short int ascii_ii[] =
{ 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
int use_ascii (int i) {
return ascii_mm[i] + ascii_ii[i];
}
- short int ebcdic_ii[] =
+ unsigned short int ebcdic_ii[] =
{ 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
+ unsigned short int ebcdic_mm[] =
{ 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
int use_ebcdic (int i) {
return ebcdic_mm[i] + ebcdic_ii[i];
}
- extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
+ int
+ main (int argc, char **argv)
+ {
+ /* Intimidate the compiler so that it does not
+ optimize the arrays away. */
+ char *p = argv[0];
+ ascii_mm[1] = *p++; ebcdic_mm[1] = *p++;
+ ascii_ii[1] = *p++; ebcdic_ii[1] = *p++;
+ return use_ascii (argc) == use_ebcdic (*p);
+ }
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+if ac_fn_c_try_link "$LINENO"
+then :
+ if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then
ac_cv_c_bigendian=yes
fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then
if test "$ac_cv_c_bigendian" = unknown; then
ac_cv_c_bigendian=no
else
@@ -8721,13 +10812,14 @@ if ac_fn_c_try_compile "$LINENO"; then :
fi
fi
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
-main ()
+main (void)
{
/* Are we little or big endian? From Harbison&Steele. */
@@ -8743,28 +10835,32 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
ac_cv_c_bigendian=no
-else
- ac_cv_c_bigendian=yes
+else case e in #(
+ e) ac_cv_c_bigendian=yes ;;
+esac
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+ conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
fi
- fi
+ fi ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+printf "%s\n" "$ac_cv_c_bigendian" >&6; }
case $ac_cv_c_bigendian in #(
yes)
- $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+ printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
;; #(
no)
;; #(
universal)
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
;; #(
*)
@@ -8773,76 +10869,78 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettid syscall" >&5
-$as_echo_n "checking for gettid syscall... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettid syscall" >&5
+printf %s "checking for gettid syscall... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <unistd.h>
#include <sys/syscall.h>
int
-main ()
+main (void)
{
syscall(SYS_gettid);
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
ok=yes
-else
- ok=no
+else case e in #(
+ e) ok=no ;;
+esac
fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
if test "$ok" = "yes"; then
-$as_echo "#define HAVE_GETTID_SYSCALL 1" >>confdefs.h
+printf "%s\n" "#define HAVE_GETTID_SYSCALL 1" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ok}" >&5
-$as_echo "${ok}" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${ok}" >&5
+printf "%s\n" "${ok}" >&6; }
if test "$ac_cv_multicast" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast support" >&5
-$as_echo_n "checking for multicast support... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for multicast support" >&5
+printf %s "checking for multicast support... " >&6; }
ac_cv_multicast=no
if test "$ac_cv_have_decl_IP_ADD_MEMBERSHIP" = yes; then
if test "$ac_cv_type_struct_ip_mreq" = yes; then
ac_cv_multicast=yes
fi
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_multicast" >&5
-$as_echo "$ac_cv_multicast" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_multicast" >&5
+printf "%s\n" "$ac_cv_multicast" >&6; }
if test "$ac_cv_multicast" = yes; then
-$as_echo "#define HAVE_MULTICAST 1" >>confdefs.h
+printf "%s\n" "#define HAVE_MULTICAST 1" >>confdefs.h
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast ssm support" >&5
-$as_echo_n "checking for multicast ssm support... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for multicast ssm support" >&5
+printf %s "checking for multicast ssm support... " >&6; }
ac_cv_ssm_multicast=no
if test "$ac_cv_have_decl_MCAST_JOIN_SOURCE_GROUP" = yes || test "$ac_cv_have_decl_IP_ADD_SOURCE_MEMBERSHIP" = yes; then
if test "$ac_cv_type_struct_group_source_req" = yes; then
ac_cv_ssm_multicast=yes
fi
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ssm_multicast" >&5
-$as_echo "$ac_cv_ssm_multicast" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ssm_multicast" >&5
+printf "%s\n" "$ac_cv_ssm_multicast" >&6; }
if test "$ac_cv_ssm_multicast" = yes; then
-$as_echo "#define HAVE_SSM_MULTICAST 1" >>confdefs.h
+printf "%s\n" "#define HAVE_SSM_MULTICAST 1" >>confdefs.h
fi
fi
if test "$ac_cv_tcpstats" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcpstats support" >&5
-$as_echo_n "checking for tcpstats support... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tcpstats support" >&5
+printf %s "checking for tcpstats support... " >&6; }
ac_cv_tcpstats=no
if test "$ac_cv_have_decl_TCP_INFO" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TCP_INFO_TCPI_TOTAL_RETRANS support" >&5
-$as_echo_n "checking for TCP_INFO_TCPI_TOTAL_RETRANS support... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TCP_INFO_TCPI_TOTAL_RETRANS support" >&5
+printf %s "checking for TCP_INFO_TCPI_TOTAL_RETRANS support... " >&6; }
if test "$ac_cv_member_struct_tcp_info_tcpi_total_retrans" = yes; then
ac_cv_tcpstats=yes
fi
@@ -8850,68 +10948,77 @@ $as_echo_n "checking for TCP_INFO_TCPI_TOTAL_RETRANS support... " >&6; }
if test "$ac_cv_have_decl_TCP_CONNECTION_INFO" = yes; then
ac_cv_tcpstats=yes
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tcpstats" >&5
-$as_echo "$ac_cv_tcpstats" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tcpstats" >&5
+printf "%s\n" "$ac_cv_tcpstats" >&6; }
if test "$ac_cv_tcpstats" = yes; then
-$as_echo "#define HAVE_TCP_STATS 1" >>confdefs.h
+printf "%s\n" "#define HAVE_TCP_STATS 1" >>confdefs.h
fi
fi
if test "$ac_cv_have_ipv6" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 headers and structures" >&5
-$as_echo_n "checking for IPv6 headers and structures... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 headers and structures" >&5
+printf %s "checking for IPv6 headers and structures... " >&6; }
ac_cv_have_ipv6=no
if test "$ac_cv_type_struct_sockaddr_storage" = yes; then
if test "$ac_cv_type_struct_sockaddr_in6" = yes; then
if test "$ac_cv_have_decl_AF_INET6" = yes; then
-$as_echo "#define HAVE_IPV6 1" >>confdefs.h
+printf "%s\n" "#define HAVE_IPV6 1" >>confdefs.h
ac_cv_have_ipv6=yes
fi
fi
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ipv6" >&5
-$as_echo "$ac_cv_have_ipv6" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ipv6" >&5
+printf "%s\n" "$ac_cv_have_ipv6" >&6; }
fi
if test "$ac_cv_have_ipv6" = yes; then
if test "$ac_cv_multicast" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 multicast support" >&5
-$as_echo_n "checking for IPv6 multicast support... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 multicast support" >&5
+printf %s "checking for IPv6 multicast support... " >&6; }
ac_cv_have_ipv6_multicast=no
if test "$ac_cv_type_struct_ipv6_mreq" = yes; then
if test "$ac_cv_have_decl_IPV6_ADD_MEMBERSHIP" = yes; then
if test "$ac_cv_have_decl_IPV6_MULTICAST_HOPS" = yes; then
-$as_echo "#define HAVE_IPV6_MULTICAST 1" >>confdefs.h
+printf "%s\n" "#define HAVE_IPV6_MULTICAST 1" >>confdefs.h
ac_cv_have_ipv6_multicast=yes
fi
fi
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ipv6_multicast" >&5
-$as_echo "$ac_cv_have_ipv6_multicast" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ipv6_multicast" >&5
+printf "%s\n" "$ac_cv_have_ipv6_multicast" >&6; }
fi
fi
+if test "$enable_packet_debug" = yes; then
+
+printf "%s\n" "#define HAVE_PACKET_DEBUG 1" >>confdefs.h
+
+fi
if test "$enable_thread_debug" = yes; then
-$as_echo "#define HAVE_THREAD_DEBUG 1" >>confdefs.h
+printf "%s\n" "#define HAVE_THREAD_DEBUG 1" >>confdefs.h
-else
- if test "$enable_debuginfo" = yes; then
+fi
+if test "$enable_summing_debug" = yes; then
-$as_echo "#define DBG_MJZ 1" >>confdefs.h
+printf "%s\n" "#define HAVE_SUMMING_DEBUG 1" >>confdefs.h
- else
+fi
+if test "$enable_debuginfo" = yes; then
-$as_echo "#define NDEBUG 1" >>confdefs.h
+printf "%s\n" "#define DBG_MJZ 1" >>confdefs.h
+
+else
+
+printf "%s\n" "#define NDEBUG 1" >>confdefs.h
- fi
fi
if test "$enable_web100" != no; then
@@ -8925,12 +11032,13 @@ web100_success=""
# Extract the first word of "web100-config", so it can be a program name with args.
set dummy web100-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_WEB100_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $WEB100_CONFIG in
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_WEB100_CONFIG+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) case $WEB100_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_WEB100_CONFIG="$WEB100_CONFIG" # Let the user override the test with a path.
;;
@@ -8939,11 +11047,15 @@ else
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_WEB100_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_path_WEB100_CONFIG="$as_dir$ac_word$ac_exec_ext"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
@@ -8952,30 +11064,31 @@ IFS=$as_save_IFS
test -z "$ac_cv_path_WEB100_CONFIG" && ac_cv_path_WEB100_CONFIG="no"
;;
+esac ;;
esac
fi
WEB100_CONFIG=$ac_cv_path_WEB100_CONFIG
if test -n "$WEB100_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WEB100_CONFIG" >&5
-$as_echo "$WEB100_CONFIG" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WEB100_CONFIG" >&5
+printf "%s\n" "$WEB100_CONFIG" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Web100" >&5
-$as_echo_n "checking for Web100... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Web100" >&5
+printf %s "checking for Web100... " >&6; }
if test "$WEB100_CONFIG" != "no"; then
WEB100_CFLAGS=`$WEB100_CONFIG --cflags`
WEB100_LIBS=`$WEB100_CONFIG --libs`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
echo "*** The web100-config script installed by Web100 could not be found"
echo "*** If Web100 was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the WEB100_CONFIG environment variable to the"
@@ -8985,16 +11098,16 @@ fi
if test x$web100_success = x; then
if test "x" != "x"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Web100 - version " >&5
-$as_echo_n "checking for Web100 - version ... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Web100 - version " >&5
+printf %s "checking for Web100 - version ... " >&6; }
WEB100_VERSION=`$WEB100_CONFIG --version`
if test "$WEB100_VERSION" = ""; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
echo "*** The requested () and installed ($WEB100_VERSION) versions"
echo "*** of Web100 do not match."
web100_success="no"
@@ -9019,55 +11132,61 @@ fi
if test "$web100_success" = yes; then
-$as_echo "#define HAVE_WEB100 1" >>confdefs.h
+printf "%s\n" "#define HAVE_WEB100 1" >>confdefs.h
fi fi fi fi fi fi
fi
if test "$enable_kalman" != no; then
-$as_echo "#define HAVE_KALMAN 1" >>confdefs.h
+printf "%s\n" "#define HAVE_KALMAN 1" >>confdefs.h
+
+fi
+
+if test "$enable_multicast_all" = no; then
+
+printf "%s\n" "#define HAVE_MULTICAST_ALL_DISABLE 1" >>confdefs.h
+
+fi
+
+if test "$enable_write_select" != no; then
+
+printf "%s\n" "#define HAVE_USE_WRITE_SELECT 1" >>confdefs.h
fi
if test "$enable_role_reversal_id" != no; then
-$as_echo "#define HAVE_ROLE_REVERSAL_ID 1" >>confdefs.h
+printf "%s\n" "#define HAVE_ROLE_REVERSAL_ID 1" >>confdefs.h
fi
if test "$enable_default_localonly" = yes; then
-$as_echo "#define HAVE_DEFAULT_DONTROUTE_ON 1" >>confdefs.h
+printf "%s\n" "#define HAVE_DEFAULT_DONTROUTE_ON 1" >>confdefs.h
fi
if test "$enable_seqno64b" != no; then
-$as_echo "#define HAVE_SEQNO64b 1" >>confdefs.h
+printf "%s\n" "#define HAVE_SEQNO64b 1" >>confdefs.h
fi
if test "$enable_isochronous" != no; then
-$as_echo "#define HAVE_ISOCHRONOUS 1" >>confdefs.h
+printf "%s\n" "#define HAVE_ISOCHRONOUS 1" >>confdefs.h
fi
if test "$enable_fastsampling" = yes; then
-$as_echo "#define HAVE_FASTSAMPLING 1" >>confdefs.h
+printf "%s\n" "#define HAVE_FASTSAMPLING 1" >>confdefs.h
fi
if test "$enable_discover_defaultlen" = yes; then
-$as_echo "#define DEFAULT_PAYLOAD_LEN_PER_MTU_DISCOVERY 1" >>confdefs.h
-
-fi
-
-if test "$enable_packet_debug" = yes; then
-
-$as_echo "#define HAVE_PACKET_DEBUG 1" >>confdefs.h
+printf "%s\n" "#define DEFAULT_PAYLOAD_LEN_PER_MTU_DISCOVERY 1" >>confdefs.h
fi
@@ -9079,18 +11198,18 @@ case "$ac_cv_host" in
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make is GNU make" >&5
-$as_echo_n "checking whether make is GNU make... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether make is GNU make" >&5
+printf %s "checking whether make is GNU make... " >&6; }
STRIP_BEGIN=
STRIP_END=
if $ac_make --version 2> /dev/null | grep '^GNU Make ' > /dev/null ; then
STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
STRIP_END=')'
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
fi
STRIP_DUMMY=
@@ -9098,7 +11217,7 @@ STRIP_DUMMY=
-ac_config_files="$ac_config_files Makefile compat/Makefile doc/Makefile include/Makefile src/Makefile man/Makefile"
+ac_config_files="$ac_config_files Makefile compat/Makefile doc/Makefile flows/Makefile include/Makefile src/Makefile man/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -9110,8 +11229,8 @@ cat >confcache <<\_ACEOF
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# 'ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* 'ac_cv_foo' will be assigned the
# following values.
_ACEOF
@@ -9127,8 +11246,8 @@ _ACEOF
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
@@ -9141,14 +11260,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
+ # 'set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
+ # 'set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
@@ -9158,15 +11277,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
/^ac_cv_env_/b end
t clear
:clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
@@ -9180,8 +11299,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;}
fi
fi
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -9198,7 +11317,7 @@ U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -9209,14 +11328,14 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+printf %s "checking that generated files are newer than configure... " >&6; }
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
+printf "%s\n" "done" >&6; }
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
@@ -9245,6 +11364,10 @@ if test -z "${PACKET_DEBUG_TRUE}" && test -z "${PACKET_DEBUG_FALSE}"; then
as_fn_error $? "conditional \"PACKET_DEBUG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${SUMMING_DEBUG_TRUE}" && test -z "${SUMMING_DEBUG_FALSE}"; then
+ as_fn_error $? "conditional \"SUMMING_DEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${CHECKPROGRAMS_TRUE}" && test -z "${CHECKPROGRAMS_FALSE}"; then
as_fn_error $? "conditional \"CHECKPROGRAMS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -9291,8 +11414,8 @@ fi
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
@@ -9315,63 +11438,65 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
+else case e in #(
+ e) case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
+esac ;;
esac
fi
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" "" $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -9380,13 +11505,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
@@ -9395,43 +11513,27 @@ case $0 in #((
for as_dir in $PATH
do
IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
+# We did not find ourselves, most probably we were run as 'sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
@@ -9444,9 +11546,9 @@ as_fn_error ()
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $2" >&2
+ printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -9477,22 +11579,25 @@ as_fn_unset ()
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
+
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
-else
- as_fn_append ()
+else case e in #(
+ e) as_fn_append ()
{
eval $1=\$$1\$2
- }
+ } ;;
+esac
fi # as_fn_append
# as_fn_arith ARG...
@@ -9500,16 +11605,18 @@ fi # as_fn_append
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
-else
- as_fn_arith ()
+else case e in #(
+ e) as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
- }
+ } ;;
+esac
fi # as_fn_arith
@@ -9536,7 +11643,7 @@ as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -9558,6 +11665,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
@@ -9571,6 +11682,12 @@ case `echo -n x` in #(((((
ECHO_N='-n';;
esac
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n. New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
@@ -9582,9 +11699,9 @@ if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
+ # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable.
+ # In both cases, we have to default to 'cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
@@ -9612,7 +11729,7 @@ as_fn_mkdir_p ()
as_dirs=
while :; do
case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
@@ -9621,7 +11738,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -9665,10 +11782,12 @@ as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed '$as_sed_sh'" # deprecated
exec 6>&1
@@ -9683,8 +11802,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Iperf $as_me 2.1.9, which was
-generated by GNU Autoconf 2.69. Invocation command line was
+This file was extended by Iperf $as_me 2.2.0, which was
+generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -9716,7 +11835,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
+'$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
@@ -9746,14 +11865,16 @@ $config_commands
Report bugs to the package provider."
_ACEOF
+ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
+ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-Iperf config.status 2.1.9
-configured by $0, generated by GNU Autoconf 2.69,
+Iperf config.status 2.2.0
+configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2023 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -9793,15 +11914,15 @@ do
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
+ printf "%s\n" "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
+ printf "%s\n" "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
@@ -9809,23 +11930,23 @@ do
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
+ as_fn_error $? "ambiguous option: '$1'
+Try '$0 --help' for more information.";;
--help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
+ printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
+ -*) as_fn_error $? "unrecognized option: '$1'
+Try '$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
@@ -9846,7 +11967,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
@@ -9860,7 +11981,7 @@ exec 5>>config.log
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- $as_echo "$ac_log"
+ printf "%s\n" "$ac_log"
} >&5
_ACEOF
@@ -9883,11 +12004,12 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"compat/Makefile") CONFIG_FILES="$CONFIG_FILES compat/Makefile" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "flows/Makefile") CONFIG_FILES="$CONFIG_FILES flows/Makefile" ;;
"include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -9897,9 +12019,9 @@ done
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+ test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
+ test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers
+ test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands
fi
# Have a temporary directory for convenience. Make it in the build tree
@@ -9907,7 +12029,7 @@ fi
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
+# after its creation but before its name has been assigned to '$tmp'.
$debug ||
{
tmp= ac_tmp=
@@ -9931,7 +12053,7 @@ ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
+# This happens for instance with './config.status config.h'.
if test -n "$CONFIG_FILES"; then
@@ -10089,13 +12211,13 @@ fi # test -n "$CONFIG_FILES"
# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
+# This happens for instance with './config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
-# Transform confdefs.h into an awk script `defines.awk', embedded as
+# Transform confdefs.h into an awk script 'defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.
@@ -10205,7 +12327,7 @@ do
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -10227,33 +12349,33 @@ do
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
+ # because $ac_f cannot contain ':'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;;
esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
- # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # Let's still pretend it is 'configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+printf "%s\n" "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
+ ac_sed_conf_input=`printf "%s\n" "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
@@ -10270,7 +12392,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
+printf "%s\n" X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -10294,9 +12416,9 @@ $as_echo X"$ac_file" |
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -10358,8 +12480,8 @@ ac_sed_dataroot='
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
@@ -10372,7 +12494,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
esac
_ACEOF
-# Neutralize VPATH when `$srcdir' = `.'.
+# Neutralize VPATH when '$srcdir' = '.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
@@ -10403,9 +12525,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
@@ -10421,20 +12543,20 @@ which seems to be undefined. Please make sure it is defined" >&2;}
#
if test x"$ac_file" != x-; then
{
- $as_echo "/* $configure_input */" \
+ printf "%s\n" "/* $configure_input */" >&1 \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
} >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+printf "%s\n" "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
- $as_echo "/* $configure_input */" \
+ printf "%s\n" "/* $configure_input */" >&1 \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
@@ -10454,7 +12576,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$_am_arg" : 'X\(//\)[^/]' \| \
X"$_am_arg" : 'X\(//\)$' \| \
X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
+printf "%s\n" X"$_am_arg" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -10474,8 +12596,8 @@ $as_echo X"$_am_arg" |
s/.*/./; q'`/stamp-h$_am_stamp_count
;;
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
+ :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+printf "%s\n" "$as_me: executing $ac_file commands" >&6;}
;;
esac
@@ -10501,7 +12623,7 @@ esac
for am_mf
do
# Strip MF so we end up with the name of the file.
- am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
@@ -10513,7 +12635,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$am_mf" : 'X\(//\)[^/]' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$am_mf" |
+printf "%s\n" X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -10535,7 +12657,7 @@ $as_echo X"$am_mf" |
$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
X"$am_mf" : 'X\(//\)$' \| \
X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$am_mf" |
+printf "%s\n" X/"$am_mf" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -10560,15 +12682,15 @@ $as_echo X/"$am_mf" |
(exit $ac_status); } || am_rc=$?
done
if test $am_rc -ne 0; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE=\"gmake\" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
-See \`config.log' for more details" "$LINENO" 5; }
+See 'config.log' for more details" "$LINENO" 5; }
fi
{ am_dirpart=; unset am_dirpart;}
{ am_filepart=; unset am_filepart;}
@@ -10611,7 +12733,8 @@ if test "$no_create" != yes; then
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+
diff --git a/configure.ac b/configure.ac
index 274bb9c..2476562 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,9 +4,9 @@ dnl Process this file with autogen.sh to produce configure files
dnl ===================================================================
-AC_PREREQ(2.59)
-AC_INIT(Iperf,2.1.9)
-AC_CONFIG_HEADER([config.h])
+AC_PREREQ([2.71])
+AC_INIT([Iperf],[2.2.0])
+AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE()
dnl The end user may not have autotools
@@ -16,59 +16,51 @@ m4_include([m4/ax_create_stdint_h.m4])
m4_include([m4/dast.m4])
m4_include([m4/ax_pthread.m4])
-AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--disable-ipv6],
- [disable ipv6 support (default is autodetect)]),
+AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--disable-ipv6],[disable ipv6 support (default is autodetect)]),
ac_cv_have_ipv6=$enable_ipv6)
-AC_ARG_ENABLE(multicast, AC_HELP_STRING([--disable-multicast],
- [disable multicast support (default is autodetect)]),
+AC_ARG_ENABLE(multicast, AS_HELP_STRING([--disable-multicast],[disable multicast support (default is autodetect)]),
ac_cv_multicast=$enable_multicast)
-AC_ARG_ENABLE(tcpstats, AC_HELP_STRING([--disable-tcpstats],
- [disable tcpstats support (default is autodetect)]),
+AC_ARG_ENABLE(tcpstats, AS_HELP_STRING([--disable-tcpstats],[disable tcpstats support (default is autodetect)]),
ac_cv_tcpstats=$enable_tcpstats)
-AC_ARG_ENABLE(threads, AC_HELP_STRING([--disable-threads],
- [disable thread support (default is autodetect)]))
+AC_ARG_ENABLE(threads, AS_HELP_STRING([--disable-threads],[disable thread support (default is autodetect)]))
-AC_ARG_ENABLE(debuginfo, AC_HELP_STRING([--enable-debuginfo],
- [enable asserts and debugging info for sockets (default is no)]),
+AC_ARG_ENABLE(debuginfo, AS_HELP_STRING([--enable-debuginfo],[enable asserts and debugging info for sockets (default is no)]),
enable_debuginfo=$enableval,
enable_debuginfo=no)
-AC_ARG_ENABLE(web100, AC_HELP_STRING([--disable-web100],
- [disable web100 support (default is autodetect)]))
+AC_ARG_ENABLE(web100, AS_HELP_STRING([--disable-web100],[disable web100 support (default is autodetect)]))
-AC_ARG_ENABLE(kalman, AC_HELP_STRING([--disable-kalman],
- [disable kalman delay tuning (default is enable)]))
+AC_ARG_ENABLE(kalman, AS_HELP_STRING([--disable-kalman],[disable kalman delay tuning (default is enable)]))
-AC_ARG_ENABLE(role_reversal_id, AC_HELP_STRING([--disable-role-reversal-id],
- [disable role reversal special characters (default is enable)]))
+AC_ARG_ENABLE(multicast_all, AS_HELP_STRING([--disable-multicast-all],[enable the use of IP_MULITICAST_ALL (default is disable)]))
-AC_ARG_ENABLE(default_localonly, AC_HELP_STRING([--enable-default-localonly],
- [enforce limiting test traffic to local-only network (via socket SO_DONTROUTE) as the default mode]))
+AC_ARG_ENABLE(write_select, AS_HELP_STRING([--disable-write-select],[disable use of select before writes (default is enable)]))
-AC_ARG_ENABLE(seqno64b, AC_HELP_STRING([--disable-seqno64b],
- [disable 64 bit sequence numer support (default is enable)]))
+AC_ARG_ENABLE(role_reversal_id, AS_HELP_STRING([--disable-role-reversal-id],[disable role reversal special characters (default is enable)]))
-AC_ARG_ENABLE(fastsampling, AC_HELP_STRING([--enable-fastsampling],
- [enable support for 100 microsecond report intervals (default is disable)]))
+AC_ARG_ENABLE(default_localonly, AS_HELP_STRING([--enable-default-localonly],[enforce limiting test traffic to local-only network (via socket SO_DONTROUTE) as the default mode]))
+
+AC_ARG_ENABLE(seqno64b, AS_HELP_STRING([--disable-seqno64b],[disable 64 bit sequence numer support (default is enable)]))
+
+AC_ARG_ENABLE(fastsampling, AS_HELP_STRING([--enable-fastsampling],[enable support for 100 microsecond report intervals (default is disable)]))
AM_CONDITIONAL([FASTSAMPLING], [test "x$enable_fastsampling" = "xyes"])
-AC_ARG_ENABLE(discover_defaultlen, AC_HELP_STRING([--enable-discover-defaultlen],
- [enable support to set the default payload size after device MTU discovery (default is disable)]))
+AC_ARG_ENABLE(discover_defaultlen, AS_HELP_STRING([--enable-discover-defaultlen],[enable support to set the default payload size after device MTU discovery (default is disable)]))
AM_CONDITIONAL([DISCOVER_DEFAULTLEN], [test "x$enable_discover_defaultlen" = "xyes"])
-AC_ARG_ENABLE(thread_debug, AC_HELP_STRING([--enable-thread-debug],
- [enable support for thread debugging (default is disable)]))
+AC_ARG_ENABLE(thread_debug, AS_HELP_STRING([--enable-thread-debug],[enable support for thread debugging (default is disable)]))
AM_CONDITIONAL([THREAD_DEBUG], [test "x$enable_thread_debug" = "xyes"])
-AC_ARG_ENABLE(packet_debug, AC_HELP_STRING([--enable-packet-debug],
- [enable support for packet level debugging (default is disable)]))
+AC_ARG_ENABLE(packet_debug, AS_HELP_STRING([--enable-packet-debug],[enable support for packet level debugging (default is disable)]))
AM_CONDITIONAL([PACKET_DEBUG], [test "x$enable_packet_debug" = "xyes"])
-AC_ARG_ENABLE(checkprograms, AC_HELP_STRING([--enable-checkprograms],
- [enable support for building support programs such as checkdelay, checkpdfs, etc. (default is disable)]))
+AC_ARG_ENABLE(summing_debug, AS_HELP_STRING([--enable-summing-debug],[enable support for interval summing debugging (default is disable)]))
+AM_CONDITIONAL([SUMMING_DEBUG], [test "x$enable_summing_debug" = "xyes"])
+
+AC_ARG_ENABLE(checkprograms, AS_HELP_STRING([--enable-checkprograms],[enable support for building support programs such as checkdelay, checkpdfs, etc. (default is disable)]))
AM_CONDITIONAL([CHECKPROGRAMS], [test "x$enable_checkprograms" = "xyes"])
AC_ARG_ENABLE([static-bin],
@@ -135,8 +127,10 @@ dnl Checks for programs
dnl ===================================================================
AC_PROG_CXX
+CXXFLAGS=`echo " $CXXFLAGS " | sed -e "s/ -g / /"` # do not want it implicitly
AC_PROG_CC
-AC_ISC_POSIX
+CFLAGS=`echo " $CFLAGS " | sed -e "s/ -g / /"` # do not want it implicitly
+AC_SEARCH_LIBS([strerror],[cposix])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
@@ -172,8 +166,16 @@ AC_SEARCH_LIBS([socket], [socket], [],
[#include <windows.h>])])
dnl Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h libintl.h net/ethernet.h net/if.h sys/ioctl.h sys/sockio.h linux/sockios.h linux/ip.h linux/udp.h linux/if_packet.h linux/filter.h linux/if_tun.h netdb.h netinet/in.h netinet/tcp.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h])
+m4_warn([obsolete],
+[The preprocessor macro `STDC_HEADERS' is obsolete.
+ Except in unusual embedded environments, you can safely include all
+ ISO C90 headers unconditionally.])dnl
+# Autoupdate added the next two lines to ensure that your configure
+# script's behavior did not change. They are probably safe to remove.
+AC_CHECK_INCLUDES_DEFAULT
+AC_PROG_EGREP
+
+AC_CHECK_HEADERS([arpa/inet.h libintl.h net/ethernet.h net/if.h sys/ioctl.h sys/sockio.h linux/sockios.h linux/ip.h linux/udp.h linux/tcp.h linux/if_packet.h linux/filter.h linux/if_tun.h netdb.h netinet/in.h netinet/tcp.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h])
dnl ===================================================================
dnl Checks for typedefs, structures
@@ -182,7 +184,20 @@ dnl ===================================================================
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_TYPES(ssize_t,,AC_DEFINE_UNQUOTED(ssize_t, int))
-AC_HEADER_TIME
+m4_warn([obsolete],
+[Update your code to rely only on HAVE_SYS_TIME_H,
+then remove this warning and the obsolete code below it.
+All current systems provide time.h; it need not be checked for.
+Not all systems provide sys/time.h, but those that do, all allow
+you to include it and time.h simultaneously.])dnl
+AC_CHECK_HEADERS_ONCE([sys/time.h])
+# Obsolete code to be removed.
+if test $ac_cv_header_sys_time_h = yes; then
+ AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both <sys/time.h>
+ and <time.h>. This macro is obsolete.])
+fi
+# End of obsolete code.
+
AC_STRUCT_TM
AC_CHECK_TYPES(int64_t)
@@ -213,7 +228,19 @@ AC_DEFINE_UNQUOTED([Socklen_t], $ac_cv_accept_arg, [Define 3rd arg of accept])
dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_SELECT_ARGTYPES
-AC_TYPE_SIGNAL
+m4_warn([obsolete],
+[your code may safely assume C89 semantics that RETSIGTYPE is void.
+Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
+AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([#include <sys/types.h>
+#include <signal.h>
+],
+ [return *(signal (0, 0)) (0) == 1;])],
+ [ac_cv_type_signal=int],
+ [ac_cv_type_signal=void])])
+AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
+ (`int' or `void').])
+
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([atexit memset select strchr strerror strtol strtoll strtod usleep clock_gettime sched_setscheduler sched_yield mlockall setitimer nanosleep clock_nanosleep freopen])
@@ -227,7 +254,7 @@ AC_CHECK_DECLS([SIOCGIFMTU],[],[],[
#include <sys/sockio.h>
#endif
])
-AC_CHECK_DECLS([pthread_cancel],[],[],[#include <pthread.h>])
+AC_CHECK_DECLS([pthread_cancel, pthread_threadid_np],[],[],[#include <pthread.h>])
AC_CHECK_DECLS([CPU_SET],[],[],[
#define _GNU_SOURCE
#include <sched.h>
@@ -249,29 +276,34 @@ in_h='
#endif
'
-AC_CHECK_DECLS([AF_INET6, SO_TIMESTAMP, SO_SNDTIMEO, SO_REUSEPORT, SO_BINDTODEVICE, MSG_DONTWAIT,
- SO_MAX_PACING_RATE, SO_DONTROUTE, IPV6_TCLASS, IP_MULTICAST_ALL, IP_TOS,
- MCAST_JOIN_GROUP, MCAST_JOIN_SOURCE_GROUP, IPV6_JOIN_GROUP, IPV6_V6ONLY,
- IPV6_ADD_MEMBERSHIP, IPV6_MULTICAST_HOPS, MSG_PEEK, MSG_WAITALL,
- TCP_NODELAY, TCP_INFO, TCP_CONNECTION_INFO, TCP_WINDOW_CLAMP, TCP_QUICKACK,
- TCP_NOTSENT_LOWAT, TCP_MAXSEG, IP_ADD_MEMBERSHIP, IP_ADD_SOURCE_MEMBERSHIP],
+AC_CHECK_DECLS([AF_INET6, SO_TIMESTAMP, SO_SNDTIMEO, SO_REUSEADDR, SO_REUSEPORT, SO_BINDTODEVICE, MSG_DONTWAIT, MSG_TRUNC,
+ MSG_CTRUNC, SO_MAX_PACING_RATE, SO_DONTROUTE, IPV6_TCLASS, IP_MULTICAST_ALL, IP_TOS,
+ IP_DROP_MEMBERSHIP,IPV6_LEAVE_GROUP,MCAST_LEAVE_GROUP,
+ MCAST_JOIN_GROUP, MCAST_JOIN_SOURCE_GROUP, MCAST_LEAVE_SOURCE_GROUP, IPV6_JOIN_GROUP, IPV6_V6ONLY,
+ IPV6_ADD_MEMBERSHIP, IPV6_MULTICAST_HOPS, MSG_PEEK, MSG_WAITALL, TCP_CONGESTION,
+ TCP_NODELAY, TCP_INFO, TCP_CONNECTION_INFO, TCP_WINDOW_CLAMP, TCP_TX_DELAY, TCP_QUICKACK,
+ SO_ZEROCOPY, MSG_ZEROCOPY, MSG_ERRQUEUE, IP_MULTICAST_IF, IPV6_MULTICAST_IF,
+ MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE, IP_BLOCK_SOURCE, IP_UNBLOCK_SOURCE,
+ TCP_NOTSENT_LOWAT, TCP_MAXSEG, IP_ADD_MEMBERSHIP, IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP],
[],[],[$in_h])
AC_CHECK_TYPES([struct sockaddr_storage, struct sockaddr_in6,
- struct group_source_req, struct ip_mreq,
+ struct group_source_req, struct ip_mreq, struct ip_mreqn,
struct ipv6_mreq, struct ip_mreq_source],,,[$in_h])
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len,
struct ip_mreq_source.imr_multiaddr.s_addr], [], [],[$in_h])
-AC_CHECK_MEMBER([struct tcp_info.tcpi_total_retrans], [], [],[
+AC_CHECK_MEMBERS([struct tcp_info.tcpi_total_retrans, struct tcp_info.tcpi_unacked, struct tcp_info.tcpi_sacked,
+ struct tcp_info.tcpi_lost, struct tcp_info.tcpi_retrans, struct tcp_info.tcpi_snd_mss,
+ struct tcp_info.tcpi_snd_cwnd], [], [],[
#include <netinet/in.h>
#include <netinet/tcp.h>
])
-AC_CHECK_MEMBERS([struct tcp_info.tcpi_total_retrans], [], [],[
-#include <netinet/in.h>
-#include <netinet/tcp.h>
+AC_CHECK_MEMBERS([struct tcp_info.tcpi_delivered, struct tcp_info.tcpi_delivered_ce, struct tcp_info.tcpi_dsack_dups,
+ struct tcp_info.tcpi_data_segs_out], [], [],[
+#include <linux/tcp.h>
])
dnl ===================================================================
@@ -284,9 +316,9 @@ AC_C_BIGENDIAN
dnl ===================================================================
dnl Check for system services
AC_MSG_CHECKING([for gettid syscall])
-AC_TRY_LINK([#include <unistd.h>
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
#include <sys/syscall.h>
-], [syscall(SYS_gettid);], [ok=yes], [ok=no])
+]], [[syscall(SYS_gettid);]])],[ok=yes],[ok=no])
if test "$ok" = "yes"; then
AC_DEFINE(HAVE_GETTID_SYSCALL,1,[Define if syscall(SYS_gettid) available.])
fi
@@ -369,14 +401,19 @@ if test "$ac_cv_have_ipv6" = yes; then
fi
+if test "$enable_packet_debug" = yes; then
+ AC_DEFINE([HAVE_PACKET_DEBUG], 1, [Define if packet level debugging is desired])
+fi
if test "$enable_thread_debug" = yes; then
- AC_DEFINE([HAVE_THREAD_DEBUG], 1, [Define for thread level debugging of the code])
-else
- if test "$enable_debuginfo" = yes; then
+ AC_DEFINE([HAVE_THREAD_DEBUG], 1, [Define for thread level debugging])
+fi
+if test "$enable_summing_debug" = yes; then
+ AC_DEFINE([HAVE_SUMMING_DEBUG], 1, [Define for interval summing debugging])
+fi
+if test "$enable_debuginfo" = yes; then
AC_DEFINE([DBG_MJZ], 1, [Define if debugging info is desired])
- else
+else
AC_DEFINE([NDEBUG], [1], [Define to disable asserts])
- fi
fi
if test "$enable_web100" != no; then
@@ -395,6 +432,14 @@ if test "$enable_kalman" != no; then
AC_DEFINE([HAVE_KALMAN], 1, [Define if Kalman tuning is desired and available])
fi
+if test "$enable_multicast_all" = no; then
+AC_DEFINE([HAVE_MULTICAST_ALL_DISABLE], 1, [Define if use of IP_MULTICAST_ALL is desired and available])
+fi
+
+if test "$enable_write_select" != no; then
+AC_DEFINE([HAVE_USE_WRITE_SELECT], 1, [Define if select based writes are desired])
+fi
+
if test "$enable_role_reversal_id" != no; then
AC_DEFINE([HAVE_ROLE_REVERSAL_ID], 1, [Define if role reversal ids are desired ])
fi
@@ -418,10 +463,6 @@ if test "$enable_discover_defaultlen" = yes; then
AC_DEFINE([DEFAULT_PAYLOAD_LEN_PER_MTU_DISCOVERY], 1, [Define if default UDP payload length is based on device MTU and socket buffer size])
fi
-if test "$enable_packet_debug" = yes; then
-AC_DEFINE([HAVE_PACKET_DEBUG], 1, [Define if packet level debugging is desired])
-fi
-
case "$ac_cv_host" in
*-mingw32)
dnl Static link on MINGW for standalone DOS executable
@@ -454,6 +495,7 @@ AC_SUBST(STRIP_END)
AC_CONFIG_FILES([Makefile
compat/Makefile
doc/Makefile
+ flows/Makefile
include/Makefile
src/Makefile
man/Makefile])
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 18f2dde..51a580b 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -133,6 +133,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
@@ -143,6 +145,7 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
@@ -273,7 +276,6 @@ ctags CTAGS:
cscope cscopelist:
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/flows/Makefile.am b/flows/Makefile.am
new file mode 100644
index 0000000..053782b
--- /dev/null
+++ b/flows/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = flows.py ssh_nodes.py Readme.txt
diff --git a/flows/Makefile.in b/flows/Makefile.in
new file mode 100644
index 0000000..1324a26
--- /dev/null
+++ b/flows/Makefile.in
@@ -0,0 +1,430 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = flows
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
+ $(top_srcdir)/m4/dast.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ETAGS = @ETAGS@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+STRIP_BEGIN = @STRIP_BEGIN@
+STRIP_DUMMY = @STRIP_DUMMY@
+STRIP_END = @STRIP_END@
+VERSION = @VERSION@
+WEB100_CFLAGS = @WEB100_CFLAGS@
+WEB100_CONFIG = @WEB100_CONFIG@
+WEB100_LIBS = @WEB100_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = flows.py ssh_nodes.py Readme.txt
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu flows/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu flows/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
+ ctags-am distclean distclean-generic distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/flows/Readme.txt b/flows/Readme.txt
new file mode 100644
index 0000000..3ff19d0
--- /dev/null
+++ b/flows/Readme.txt
@@ -0,0 +1,36 @@
+The following steps needs to be done before running pyflows test:
+
+1) Install Python 3.10 and above
+
+2) sudo dnf install python3-matplotlib
+
+3) install gnuplot 'sudo dnf install gnuplot'
+
+4) Update your ".bashrc" and add the location of your flows files "/your_local_dir/iperf2-code/flows" to PYTHONPATH:
+export PYTHONPATH=/your_local_dir/iperf2-code/flows:$PYTHONPATH
+echo $PYTHONPATH
+
+5) compile the following modules:
+cd /your_local_dir/iperf2-code/flows
+python3 -m py_compile flows.py ssh_nodes.py
+
+6) Configure the IP addresses and LAN addresses in the router_latency.py
+
+7) Make sure passwordless ssh is configured for all the ssh DUTs, e.g.
+
+[bm932125@rjm-wifibt-ctrl:/ltf-local/Code/LTF/pyflows/scripts] $ ssh-copy-id -i ~/.ssh/id_rsa.pub root@10.19.85.40
+/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/bm932125/.ssh/id_rsa.pub"
+/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
+/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
+root@10.19.85.40's password:
+
+Number of key(s) added: 1
+
+Now try logging into the machine, with: "ssh 'root@10.19.85.40'"
+and check to make sure that only the key(s) you wanted were added.
+
+8) Make sure all the wireless devices are loaded and connected to the SSID
+
+9) Run the test:
+cd /your_local_dir/iperf2-code/flows
+python3 router_latency.py
diff --git a/flows/flows.py b/flows/flows.py
new file mode 100644
index 0000000..5465b6b
--- /dev/null
+++ b/flows/flows.py
@@ -0,0 +1,1300 @@
+# ----------------------------------------------------------------
+# * Copyright (c) 2018-2023
+# * Broadcom Corporation
+# * All Rights Reserved.
+# *---------------------------------------------------------------
+# Redistribution and use in source and binary forms, with or without modification, are permitted
+# provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this list of conditions
+# and the following disclaimer. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the documentation and/or other
+# materials provided with the distribution. Neither the name of the Broadcom nor the names of
+# contributors may be used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USEn,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Author Robert J. McMahon, Broadcom LTD
+# Date April 2016 - December 2023
+
+import re
+import subprocess
+import logging
+import asyncio, sys
+import time, datetime
+import locale
+import signal
+import weakref
+import os
+import getpass
+import math
+import scipy
+import scipy.spatial
+import numpy as np
+import tkinter
+import ctypes
+import ipaddress
+import collections
+import csv
+
+from datetime import datetime as datetime, timezone
+from scipy import stats
+from scipy.cluster import hierarchy
+from scipy.cluster.hierarchy import linkage
+import matplotlib.pyplot as plt
+from collections import defaultdict
+
+logger = logging.getLogger(__name__)
+
+class iperf_flow(object):
+ port = 61000
+ iperf = '/usr/bin/iperf'
+ instances = weakref.WeakSet()
+ _loop = None
+ flow_scope = ("flowstats")
+ tasks = []
+ flowid2name = defaultdict(str)
+
+ @classmethod
+ def get_instances(cls):
+ return list(iperf_flow.instances)
+
+ @classmethod
+ @property
+ def loop(cls):
+ if not cls._loop :
+ try :
+ cls._loop = asyncio.get_running_loop()
+ except :
+ if os.name == 'nt':
+ # On Windows, the ProactorEventLoop is necessary to listen on pipes
+ cls._loop = asyncio.ProactorEventLoop()
+ else:
+ cls._loop = asyncio.new_event_loop()
+ return cls._loop
+
+
+ @classmethod
+ def close_loop(cls):
+ if iperf_flow.loop.is_running():
+ iperf_flow.loop.run_until_complete(loop.shutdown_asyncgens())
+ iperf_flow.loop.close()
+
+ @classmethod
+ def sleep(cls, time=0, text=None, stoptext=None) :
+ if text :
+ logging.info('Sleep {} ({})'.format(time, text))
+ iperf_flow.loop.run_until_complete(asyncio.sleep(time))
+ if stoptext :
+ logging.info('Sleep done ({})'.format(stoptext))
+
+
+ @classmethod
+ def run(cls, time=None, amount=None, flows='all', sample_delay=None, io_timer=None, preclean=True, parallel=None, epoch_sync=False) :
+ if flows == 'all' :
+ flows = iperf_flow.get_instances()
+ if not flows:
+ logging.warn('flow run method called with no flows instantiated')
+ return
+
+ if preclean:
+ hosts = [flow.server for flow in flows]
+ hosts.extend([flow.client for flow in flows])
+ hosts=list(set(hosts))
+ tasks = [asyncio.ensure_future(iperf_flow.cleanup(user='root', host=host), loop=iperf_flow.loop) for host in hosts]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('preclean timeout')
+ raise
+
+ logging.info('flow run invoked')
+ tasks = [asyncio.ensure_future(flow.rx.start(time=time), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('flow server start timeout')
+ raise
+ iperf_flow.sleep(time=0.3, text="wait for rx up", stoptext="rx up done")
+
+ if epoch_sync :
+ dt = (datetime.now()).timestamp()
+ tsec = str(dt).split('.')
+ epoch_sync_time = int(tsec[0]) + 2
+ else :
+ epoch_sync_time = None
+
+ tasks = [asyncio.ensure_future(flow.tx.start(time=time, amount=amount, parallel=parallel, epoch_sync_time=epoch_sync_time), loop=iperf_flow.loop) for flow in flows]
+
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('flow client start timeout')
+ raise
+ if sample_delay :
+ iperf_flow.sleep(time=0.3, text="ramp up", stoptext="ramp up done")
+ if io_timer :
+ tasks = [asyncio.ensure_future(flow.is_traffic(), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('flow traffic check timeout')
+ raise
+ if time :
+ iperf_flow.sleep(time=time + 4, text="Running traffic start", stoptext="Stopping flows")
+ # Signal the remote iperf client sessions to stop them
+ tasks = [asyncio.ensure_future(flow.tx.signal_stop(), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=3))
+ except asyncio.TimeoutError:
+ logging.error('flow tx stop timeout')
+ raise
+
+ elif amount:
+ tasks = [asyncio.ensure_future(flow.transmit_completed(), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('flow tx completed timed out')
+ raise
+ logging.info('flow transmit completed')
+
+ # Now signal the remote iperf server sessions to stop them
+ tasks = [asyncio.ensure_future(flow.rx.signal_stop(), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=3))
+ except asyncio.TimeoutError:
+ logging.error('flow tx stop timeout')
+ raise
+
+ # iperf_flow.loop.close()
+ logging.info('flow run finished')
+
+ @classmethod
+ def commence(cls, time=None, flows='all', sample_delay=None, io_timer=None, preclean=True) :
+ if flows == 'all' :
+ flows = iperf_flow.get_instances()
+ if not flows:
+ logging.warn('flow run method called with no flows instantiated')
+ return
+
+ if preclean:
+ hosts = [flow.server for flow in flows]
+ hosts.extend([flow.client for flow in flows])
+ hosts=list(set(hosts))
+ tasks = [asyncio.ensure_future(iperf_flow.cleanup(user='root', host=host), loop=iperf_flow.loop) for host in hosts]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('preclean timeout')
+ raise
+
+ logging.info('flow start invoked')
+ tasks = [asyncio.ensure_future(flow.rx.start(time=time), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('flow server start timeout')
+ raise
+ iperf_flow.sleep(time=0.3, text="wait for rx up", stoptext="rx up done")
+ tasks = [asyncio.ensure_future(flow.tx.start(time=time), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('flow client start timeout')
+ raise
+
+ @classmethod
+ def plot(cls, flows='all', title='None', directory='None') :
+ if flows == 'all' :
+ flows = iperf_flow.get_instances()
+
+ tasks = []
+ for flow in flows :
+ for this_name in flow.histogram_names :
+ path = directory + '/' + this_name
+ os.makedirs(path, exist_ok=True)
+ i = 0
+ # group by name
+ histograms = [h for h in flow.histograms if h.name == this_name]
+ for histogram in histograms :
+ if histogram.ks_index is not None :
+ histogram.output_dir = directory + '/' + this_name + '/' + this_name + str(i)
+ else :
+ histogram.output_dir = directory + '/' + this_name + '/' + this_name + str(histogram.ks_index)
+
+ logging.info('scheduling task {}'.format(histogram.output_dir))
+ tasks.append(asyncio.ensure_future(histogram.async_plot(directory=histogram.output_dir, title=title), loop=iperf_flow.loop))
+ i += 1
+ try :
+ logging.info('runnings tasks')
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=600))
+ except asyncio.TimeoutError:
+ logging.error('plot timed out')
+ raise
+
+
+ @classmethod
+ def cease(cls, flows='all') :
+
+ if flows == 'all' :
+ flows = iperf_flow.get_instances()
+
+ # Signal the remote iperf client sessions to stop them
+ tasks = [asyncio.ensure_future(flow.tx.signal_stop(), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('flow tx stop timeout')
+
+ # Now signal the remote iperf server sessions to stop them
+ tasks = [asyncio.ensure_future(flow.rx.signal_stop(), loop=iperf_flow.loop) for flow in flows]
+ try :
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=10))
+ except asyncio.TimeoutError:
+ logging.error('flow rx stop timeout')
+
+ @classmethod
+ async def cleanup(cls, host=None, sshcmd='/usr/bin/ssh', user='root') :
+ if host:
+ logging.info('ssh {}@{} pkill iperf'.format(user, host))
+ childprocess = await asyncio.create_subprocess_exec(sshcmd, '{}@{}'.format(user, host), 'pkill', 'iperf', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout, _ = await childprocess.communicate()
+ if stdout:
+ logging.info('cleanup: host({}) stdout={} '.format(host, stdout))
+
+ @classmethod
+ def tos_to_txt(cls, tos) :
+ switcher = {
+ int(0x0) : "BE",
+ int(0x02) : "BK",
+ int(0xC0) : "VO",
+ int(0x80) : "VI",
+ }
+ return switcher.get(int(tos), None)
+
+ @classmethod
+ def txt_to_tos(cls, txt) :
+ switcher = {
+ "BE" : "0x0",
+ "BESTEFFORT" : "0x0",
+ "0x0" : "0x0",
+ "BK" : "0x20",
+ "BACKGROUND" : "0x20",
+ "0x20" : "0x20",
+ "VO" : "0xC0",
+ "VOICE" : "0xC0",
+ "0xC0" : "0xC0",
+ "VI" : "0x80",
+ "VIDEO" : "0x80",
+ "0x80" : "0x80",
+ }
+ return switcher.get(txt.upper(), None)
+
+ def __init__(self, name='iperf', server=None, client=None, user=None, proto='TCP', dstip='127.0.0.1', interval=1, format='b', offered_load=None, tos='BE', window='4M', src=None, srcip=None, srcport=None, dstport=None, debug=False, length=None, ipg=0.0, amount=None, trip_times=True, prefetch=None, latency=False, bb=False, working_load=False, bb_period=None, bb_hold=None, txstart_delay_sec=None, burst_size=None, burst_period=None, fullduplex=False, cca=None, tcp_tx_delay=None):
+ iperf_flow.instances.add(self)
+ self.name = name
+ self.latency = latency
+ if not dstport :
+ iperf_flow.port += 1
+ self.dstport = iperf_flow.port
+ else:
+ self.dstport = dstport
+ self.dstip = dstip
+ self.srcip = srcip
+ self.srcport = srcport
+ try :
+ self.server = server.ipaddr
+ except AttributeError:
+ self.server = server
+ try :
+ self.client = client.ipaddr
+ except AttributeError:
+ self.client = client
+
+ self.client_device = client.device
+ self.server_device = server.device
+
+ if not user :
+ self.user = getpass.getuser()
+ else :
+ self.user = user
+ self.proto = proto
+ self.tcp_tx_delay = tcp_tx_delay
+ self.tos = tos
+ if length :
+ self.length = length
+
+ if amount :
+ self.amount = amount
+ if trip_times :
+ self.trip_times = trip_times
+ if burst_period :
+ self.burst_period = burst_period
+ if burst_size :
+ self.burst_size = burst_size
+
+ if txstart_delay_sec:
+ self.txstart_delay_sec = txstart_delay_sec
+
+ if cca:
+ self.cca = cca
+
+ self.interval = round(interval,3)
+ self.format = format
+ self.offered_load = offered_load
+ if self.offered_load :
+ if len(self.offered_load.split(':')) == 2 :
+ self.isoch = True
+ self.name += '-isoch'
+ else :
+ self.isoch = False
+ self.prefetch = prefetch
+ self.ipg = ipg
+ self.debug = debug
+ self.TRAFFIC_EVENT_TIMEOUT = round(self.interval * 4, 3)
+ self.bb = bb
+ self.working_load = working_load
+ self.bb_period = bb_period
+ self.bb_hold = bb_hold
+ self.fullduplex = fullduplex
+ # use python composition for the server and client
+ # i.e. a flow has a server and a client
+ self.rx = iperf_server(name='{}->RX({})'.format(name, str(self.server)), loop=iperf_flow.loop, host=self.server, flow=self, debug=self.debug)
+ self.tx = iperf_client(name='{}->TX({})'.format(name, str(self.client)), loop=iperf_flow.loop, host=self.client, flow=self, debug=self.debug)
+ self.rx.window=window
+ self.tx.window=window
+ self.ks_critical_p = 0.01
+ self.stats_reset()
+
+ #def __del__(self) :
+ # iperf_flow.instances.remove(self)
+
+ def destroy(self) :
+ iperf_flow.instances.remove(self)
+
+ def __getattr__(self, attr) :
+ if attr in self.flowstats :
+ return self.flowstats[attr]
+
+ def stats_reset(self) :
+ # Initialize the flow stats dictionary
+ self.flowstats = {'current_rxbytes' : None , 'current_txbytes' : None , 'flowrate' : None, 'starttime' : None, 'flowid' : None, 'endtime' : None}
+ self.flowstats['txdatetime']=[]
+ self.flowstats['txbytes']=[]
+ self.flowstats['txthroughput']=[]
+ self.flowstats['writes']=[]
+ self.flowstats['errwrites']=[]
+ self.flowstats['retry']=[]
+ self.flowstats['cwnd']=[]
+ self.flowstats['rtt']=[]
+ self.flowstats['rxdatetime']=[]
+ self.flowstats['rxbytes']=[]
+ self.flowstats['rxthroughput']=[]
+ self.flowstats['reads']=[]
+ self.flowstats['histograms']=[]
+ self.flowstats['histogram_names'] = set()
+ self.flowstats['connect_time']=[]
+ self.flowstats['trip_time']=[]
+ self.flowstats['jitter']=[]
+ self.flowstats['rxlostpkts']=[]
+ self.flowstats['rxtotpkts']=[]
+ self.flowstats['meanlat']=[]
+ self.flowstats['minlat']=[]
+ self.flowstats['maxlat']=[]
+ self.flowstats['stdevlat']=[]
+ self.flowstats['rxpps']=[]
+ self.flowstats['inP']=[]
+ self.flowstats['inPvar']=[]
+ self.flowstats['rxpkts']=[]
+ self.flowstats['netPower']=[]
+
+ async def start(self):
+ self.flowstats = {'current_rxbytes' : None , 'current_txbytes' : None , 'flowrate' : None, 'flowid' : None}
+ await self.rx.start()
+ await self.tx.start()
+
+ async def is_traffic(self) :
+ if self.interval < 0.005 :
+ logging.warn('{} {}'.format(self.name, 'traffic check invoked without interval sampling'))
+ else :
+ self.rx.traffic_event.clear()
+ self.tx.traffic_event.clear()
+ logging.info('{} {}'.format(self.name, 'traffic check invoked'))
+ await self.rx.traffic_event.wait()
+ await self.tx.traffic_event.wait()
+
+ async def transmit_completed(self) :
+ logging.info('{} {}'.format(self.name, 'waiting for transmit to complete'))
+ await self.tx.txcompleted.wait()
+
+ async def stop(self):
+ self.tx.stop()
+ self.rx.stop()
+
+ def stats(self):
+ logging.info('stats')
+
+ def compute_ks_table(self, plot=True, directory='.', title=None) :
+
+ if len(self.histogram_names) < 1 :
+ tmp = "***Failed. Expected 1 histogram_names, but instead got {0}".format(len(self.histogram_names))
+ logging.info(tmp)
+ print(tmp)
+ #raise
+
+ for this_name in self.histogram_names :
+ # group by name
+ histograms = [h for h in self.histograms if h.name == this_name]
+ for index, h in enumerate(histograms) :
+ h.ks_index = index
+ tmp = "{} KS Table has {} entries".format(self.name, len(histograms))
+ logging.info(tmp)
+ print(tmp)
+
+ self.condensed_distance_matrix = ([])
+
+ tasks = []
+ for rowindex, h1 in enumerate(histograms) :
+ resultstr = rowindex * 'x'
+ maxp = None
+ minp = None
+ for h2 in histograms[rowindex:] :
+ d,p = stats.ks_2samp(h1.samples, h2.samples)
+ if h1 is not h2 :
+ self.condensed_distance_matrix = np.append(self.condensed_distance_matrix,d)
+ logging.debug('D,p={},{} cp={}'.format(str(d),str(p), str(self.ks_critical_p)))
+ if not minp or p < minp :
+ minp = p
+ if not maxp or (p != 1 and p > maxp) :
+ maxp = p
+ if p > self.ks_critical_p :
+ resultstr += '1'
+ else :
+ resultstr += '0'
+ if plot :
+ tasks.append(asyncio.ensure_future(flow_histogram.plot_two_sample_ks(h1=h1, h2=h2, flowname=self.name, title=title, directory=directory), loop=iperf_flow.loop))
+ print('KS: {0}({1:3d}):{2} minp={3} ptest={4}'.format(this_name, rowindex, resultstr, str(minp), str(self.ks_critical_p)))
+ logging.info('KS: {0}({1:3d}):{2} minp={3} ptest={4}'.format(this_name, rowindex, resultstr, str(minp), str(self.ks_critical_p)))
+ if tasks :
+ try :
+ logging.debug('running KS table plotting coroutines for {} row {}'.format(this_name,str(rowindex)))
+ iperf_flow.loop.run_until_complete(asyncio.wait(tasks, timeout=300))
+ except asyncio.TimeoutError:
+ logging.error('plot timed out')
+ raise
+ logging.info('{} {}(condensed distance matrix)\n{}'.format(self.name, this_name,self.condensed_distance_matrix))
+ self.linkage_matrix=linkage(self.condensed_distance_matrix, 'ward')
+ try :
+ plt.figure(figsize=(18,10))
+ dn = hierarchy.dendrogram(self.linkage_matrix)
+ plt.title("{} {}".format(self.name, this_name))
+ plt.savefig('{}/dn_{}_{}.png'.format(directory,self.name,this_name))
+ logging.info('{} {}(distance matrix)\n{}'.format(self.name, this_name,scipy.spatial.distance.squareform(self.condensed_distance_matrix)))
+ print('{} {}(distance matrix)\n{}'.format(self.name, this_name,scipy.spatial.distance.squareform(self.condensed_distance_matrix)))
+ print('{} {}(cluster linkage)\n{}'.format(self.name,this_name,self.linkage_matrix))
+ logging.info('{} {}(cluster linkage)\n{}'.format(self.name,this_name,self.linkage_matrix))
+ flattened=scipy.cluster.hierarchy.fcluster(self.linkage_matrix, 0.75*self.condensed_distance_matrix.max(), criterion='distance')
+ print('{} {} Clusters:{}'.format(self.name, this_name, flattened))
+ logging.info('{} {} Clusters:{}'.format(self.name, this_name, flattened))
+ except:
+ pass
+
+ def dump_stats(self, directory='.') :
+ logging.info("\n********************** dump_stats for flow {} **********************".format(self.name))
+
+ #logging.info('This flow Name={} id={} items_cnt={}'.format(iperf_flow.flowid2name[self.flowstats['flowid']], str(self.flowstats['flowid']), len(self.flowstats)))
+ #logging.info('All flows Name and id: {}'.format(str(iperf_flow.flowid2name)))
+ #logging.info('This flow Name={} flowstats={}'.format(self.name, str(self.flowstats)))
+
+ csvfilename = os.path.join(directory, '{}.csv'.format(self.name))
+ if not os.path.exists(directory):
+ logging.debug('Making results directory {}'.format(directory))
+ os.makedirs(directory)
+
+ logging.info("Writing stats to '{}'".format(csvfilename))
+
+ for stat_name in [stat for stat in self.flowstats.keys() if stat != 'histograms'] :
+ logging.info("{}={}".format(stat_name, str(self.flowstats[stat_name])))
+
+ with open(csvfilename, 'w', newline='') as fd :
+ keynames = self.flowstats.keys()
+ writer = csv.writer(fd)
+ writer.writerow(keynames)
+ writer.writerow([self.flowstats[keyname] for keyname in keynames])
+ writer.writerow([h.samples for h in self.flowstats['histograms']])
+
+class iperf_server(object):
+
+ class IperfServerProtocol(asyncio.SubprocessProtocol):
+ def __init__(self, server, flow):
+ self.__dict__['flow'] = flow
+ self._exited = False
+ self._closed_stdout = False
+ self._closed_stderr = False
+ self._mypid = None
+ self._server = server
+ self._stdoutbuffer = ""
+ self._stderrbuffer = ""
+
+ def __setattr__(self, attr, value):
+ if attr in iperf_flow.flow_scope:
+ self.flow.__setattr__(self.flow, attr, value)
+ else:
+ self.__dict__[attr] = value
+
+ # methods and attributes not here are handled by the flow object,
+ # aka, the flow object delegates to this object per composition
+ def __getattr__(self, attr):
+ if attr in iperf_flow.flow_scope:
+ return getattr(self.flow, attr)
+
+ @property
+ def finished(self):
+ return self._exited and self._closed_stdout and self._closed_stderr
+
+ def signal_exit(self):
+ if not self.finished:
+ return
+ self._server.closed.set()
+ self._server.opened.clear()
+
+ def connection_made(self, trans):
+ self._server.closed.clear()
+ self._mypid = trans.get_pid()
+ logging.debug('server connection made pid=({})'.format(self._mypid))
+
+ def pipe_data_received(self, fd, data):
+ if self.debug :
+ logging.debug('{} {}'.format(fd, data))
+ data = data.decode("utf-8")
+ if fd == 1:
+ self._stdoutbuffer += data
+ while "\n" in self._stdoutbuffer:
+ line, self._stdoutbuffer = self._stdoutbuffer.split("\n", 1)
+ self._server.adapter.info('{} (stdout,{})'.format(line, self._server.remotepid))
+ if not self._server.opened.is_set() :
+ m = self._server.regex_open_pid.match(line)
+ if m :
+ self._server.remotepid = m.group('pid')
+ self._server.opened.set()
+ logging.debug('{} pipe reading (stdout,{})'.format(self._server.name, self._server.remotepid))
+ else :
+ if self._server.proto == 'TCP' :
+ m = self._server.regex_traffic.match(line)
+ if m :
+ timestamp = datetime.now()
+ if not self._server.traffic_event.is_set() :
+ self._server.traffic_event.set()
+
+ bytes = float(m.group('bytes'))
+ if self.flowstats['current_txbytes'] :
+ flowrate = round((bytes / self.flowstats['current_txbytes']), 2)
+ # *consume* the current *txbytes* where the client pipe will repopulate on its next sample
+ # do this by setting the value to None
+ self.flowstats['current_txbytes'] = None
+ # logging.debug('{} flow ratio={:.2f}'.format(self._server.name, flowrate))
+ self.flowstats['flowrate'] = flowrate
+ else :
+ # *produce* the current *rxbytes* so the client pipe can know this event occurred
+ # indicate this by setting the value to value
+ self.flowstats['current_rxbytes'] = bytes
+ self.flowstats['rxdatetime'].append(timestamp)
+ self.flowstats['rxbytes'].append(m.group('bytes'))
+ self.flowstats['rxthroughput'].append(m.group('throughput'))
+ self.flowstats['reads'].append(m.group('reads'))
+ else :
+ m = self._server.regex_trip_time.match(line)
+ if m :
+ self.flowstats['trip_time'].append(float(m.group('trip_time')) * 1000)
+ else :
+ m = self._server.regex_traffic_udp.match(line)
+ if m :
+ timestamp = datetime.now()
+ if not self._server.traffic_event.is_set() :
+ self._server.traffic_event.set()
+ self.flowstats['rxbytes'].append(m.group('bytes'))
+ self.flowstats['rxthroughput'].append(m.group('throughput'))
+ self.flowstats['jitter'].append(m.group('jitter'))
+ self.flowstats['rxlostpkts'].append(m.group('lost_pkts'))
+ self.flowstats['rxtotpkts'].append(m.group('tot_pkts'))
+ self.flowstats['meanlat'].append(m.group('lat_mean'))
+ self.flowstats['minlat'].append(m.group('lat_min'))
+ self.flowstats['maxlat'].append(m.group('lat_max'))
+ self.flowstats['stdevlat'].append(m.group('lat_stdev'))
+ self.flowstats['rxpps'].append(m.group('pps'))
+ self.flowstats['inP'].append(m.group('inP'))
+ self.flowstats['inPvar'].append(m.group('inPvar'))
+ self.flowstats['rxpkts'].append(m.group('pkts'))
+ self.flowstats['netPower'].append(m.group('netPower'))
+ m = self._server.regex_final_histogram_traffic.match(line)
+ if m :
+ timestamp = datetime.now(timezone.utc).astimezone()
+ self.flowstats['endtime']= timestamp
+ self.flowstats['histogram_names'].add(m.group('pdfname'))
+ this_histogram = flow_histogram(name=m.group('pdfname'),values=m.group('pdf'), population=m.group('population'), binwidth=m.group('binwidth'), starttime=self.flowstats['starttime'], endtime=timestamp, outliers=m.group('outliers'), uci=m.group('uci'), uci_val=m.group('uci_val'), lci=m.group('lci'), lci_val=m.group('lci_val'))
+ self.flowstats['histograms'].append(this_histogram)
+ logging.info('pdf {} found with bin width={} us'.format(m.group('pdfname'), m.group('binwidth')))
+
+ elif fd == 2:
+ self._stderrbuffer += data
+ while "\n" in self._stderrbuffer:
+ line, self._stderrbuffer = self._stderrbuffer.split("\n", 1)
+ logging.info('{} {} (stderr)'.format(self._server.name, line))
+ m = self._server.regex_rx_bind_failed.match(line)
+ if m :
+ logging.error('RX Bind Failed. Check LAN / WLAN between server and client.')
+ iperf_flow.loop.stop()
+ raise
+
+ def pipe_connection_lost(self, fd, exc):
+ if fd == 1:
+ self._closed_stdout = True
+ logging.debug('stdout pipe to {} closed (exception={})'.format(self._server.name, exc))
+ elif fd == 2:
+ self._closed_stderr = True
+ logging.debug('stderr pipe to {} closed (exception={})'.format(self._server.name, exc))
+ if self._closed_stdout and self._closed_stderr :
+ self.remotepid = None;
+ self.signal_exit()
+
+ def process_exited(self):
+ logging.debug('subprocess with pid={} closed'.format(self._mypid))
+ self._exited = True
+ self._mypid = None
+ self.signal_exit()
+
+ class CustomAdapter(logging.LoggerAdapter):
+ def process(self, msg, kwargs):
+ return '[%s] %s' % (self.extra['connid'], msg), kwargs
+
+ def __init__(self, name='Server', loop=None, host='localhost', flow=None, debug=False):
+ self.__dict__['flow'] = flow
+ self.name = name
+ self.iperf = '/usr/local/bin/iperf'
+ self.ssh = '/usr/bin/ssh'
+ self.host = host
+ self.flow = flow
+ self.debug = debug
+ self.opened = asyncio.Event()
+ self.closed = asyncio.Event()
+ self.closed.set()
+ self.traffic_event = asyncio.Event()
+ self._transport = None
+ self._protocol = None
+ self.time = time
+ conn_id = '{}'.format(self.name)
+ self.adapter = self.CustomAdapter(logger, {'connid': conn_id})
+
+ # ex. [ 4] 0.00-0.50 sec 657090 Bytes 10513440 bits/sec 449 449:0:0:0:0:0:0:0
+ self.regex_traffic = re.compile(r'\[\s+\d+] (?P<timestamp>.*) sec\s+(?P<bytes>[0-9]+) Bytes\s+(?P<throughput>[0-9]+) bits/sec\s+(?P<reads>[0-9]+)')
+ self.regex_traffic_udp = re.compile(r'\[\s+\d+] (?P<timestamp>.*) sec\s+(?P<bytes>[0-9]+) Bytes\s+(?P<throughput>[0-9]+) bits/sec\s+(?P<jitter>[0-9.]+)\sms\s(?P<lost_pkts>[0-9]+)/(?P<tot_pkts>[0-9]+).+(?P<lat_mean>[0-9.]+)/(?P<lat_min>[0-9.]+)/(?P<lat_max>[0-9.]+)/(?P<lat_stdev>[0-9.]+)\sms\s(?P<pps>[0-9]+)\spps\s+(?P<netPower>[0-9\.]+)\/(?P<inP>[0-9]+)\((?P<inPvar>[0-9]+)\)\spkts\s(?P<pkts>[0-9]+)')
+ self.regex_final_histogram_traffic = re.compile(r'\[\s*\d+\] (?P<timestamp>.*) sec\s+(?P<pdfname>[A-Za-z0-9\-]+)\(f\)-PDF: bin\(w=(?P<binwidth>[0-9]+)us\):cnt\((?P<population>[0-9]+)\)=(?P<pdf>.+)\s+\((?P<lci>[0-9\.]+)/(?P<uci>[0-9\.]+)/(?P<uci2>[0-9\.]+)%=(?P<lci_val>[0-9]+)/(?P<uci_val>[0-9]+)/(?P<uci_val2>[0-9]+),Outliers=(?P<outliers>[0-9]+),obl/obu=[0-9]+/[0-9]+\)')
+ # 0.0000-0.5259 trip-time (3WHS done->fin+finack) = 0.5597 sec
+ self.regex_trip_time = re.compile(r'.+trip\-time\s+\(3WHS\sdone\->fin\+finack\)\s=\s(?P<trip_time>\d+\.\d+)\ssec')
+ self.regex_rx_bind_failed = re.compile(r'listener bind failed: Cannot assign requested address')
+
+ def __getattr__(self, attr):
+ return getattr(self.flow, attr)
+
+ async def start(self, time=time):
+ if not self.closed.is_set() :
+ return
+
+ # ex. Server listening on TCP port 61003 with pid 2565
+ self.regex_open_pid = re.compile(r'^Server listening on {} port {} with pid (?P<pid>\d+)'.format(self.proto, str(self.dstport)))
+
+ self.opened.clear()
+ self.remotepid = None
+ if time :
+ iperftime = time + 30
+ self.sshcmd=[self.ssh, self.user + '@' + self.host, self.iperf, '-s', '-p ' + str(self.dstport), '-P 1', '-e', '-t ' + str(iperftime), '-f{}'.format(self.format), '-w' , self.window, '--realtime']
+ else :
+ self.sshcmd=[self.ssh, self.user + '@' + self.host, self.iperf, '-s', '-p ' + str(self.dstport), '-P 1', '-e', '-f{}'.format(self.format), '-w' , self.window, '--realtime']
+ if self.interval >= 0.005 :
+ self.sshcmd.extend(['-i ', str(self.interval)])
+ if self.server_device and self.srcip :
+ self.sshcmd.extend(['-B ', '{}%{}'.format(self.dstip, self.server_device)])
+ if self.proto == 'UDP' :
+ self.sshcmd.extend(['-u'])
+ if self.latency :
+ self.sshcmd.extend(['--histograms=100u,100000,50,95'])
+ self.sshcmd.extend(['--jitter-histograms'])
+
+ logging.info('{}'.format(str(self.sshcmd)))
+ self._transport, self._protocol = await iperf_flow.loop.subprocess_exec(lambda: self.IperfServerProtocol(self, self.flow), *self.sshcmd)
+ await self.opened.wait()
+
+ async def signal_stop(self):
+ if self.remotepid and not self.finished :
+ childprocess = await asyncio.create_subprocess_exec(self.ssh, '{}@{}'.format(self.user, self.host), 'kill', '-HUP', '{}'.format(self.remotepid), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ logging.debug('({}) sending signal HUP to {} (pid={})'.format(self.user, self.host, self.remotepid))
+ stdout, _ = await childprocess.communicate()
+ if stdout:
+ logging.info('kill remote pid {} {}({}) {}'.format(self.remotepid, self.user, self.host, stdout))
+ if not self.closed.is_set() :
+ await self.closed.wait()
+ logging.info('await kill completed remote pid {} {}({}) {}'.format(self.remotepid, self.user, self.host, stdout))
+ logging.info('kill remote pid {} {}({}) {}'.format(self.remotepid, self.user, self.host, stdout))
+
+
+class iperf_client(object):
+
+ # Asyncio protocol for subprocess transport
+ class IperfClientProtocol(asyncio.SubprocessProtocol):
+ def __init__(self, client, flow):
+ self.__dict__['flow'] = flow
+ self._exited = False
+ self._closed_stdout = False
+ self._closed_stderr = False
+ self._mypid = None
+ self._client = client
+ self._stdoutbuffer = ""
+ self._stderrbuffer = ""
+
+ def __setattr__(self, attr, value):
+ if attr in iperf_flow.flow_scope:
+ self.flow.__setattr__(self.flow, attr, value)
+ else:
+ self.__dict__[attr] = value
+
+ def __getattr__(self, attr):
+ if attr in iperf_flow.flow_scope:
+ return getattr(self.flow, attr)
+
+ @property
+ def finished(self):
+ return self._exited and self._closed_stdout and self._closed_stderr
+
+ def signal_exit(self):
+ if not self.finished:
+ return
+ self._client.closed.set()
+ self._client.opened.clear()
+ self._client.txcompleted.set()
+
+ def connection_made(self, trans):
+ self._client.closed.clear()
+ self._mypid = trans.get_pid()
+ logging.debug('client connection made pid=({})'.format(self._mypid))
+
+ def pipe_data_received(self, fd, data):
+ if self.debug :
+ logging.debug('{} {}'.format(fd, data))
+ data = data.decode("utf-8")
+ if fd == 1:
+ self._stdoutbuffer += data
+ while "\n" in self._stdoutbuffer:
+ line, self._stdoutbuffer = self._stdoutbuffer.split("\n", 1)
+ self._client.adapter.info('{} (stdout,{})'.format(line, self._client.remotepid))
+ if not self._client.opened.is_set() :
+ m = self._client.regex_open_pid.match(line)
+ if m :
+ self._client.opened.set()
+ self._client.remotepid = m.group('pid')
+ self.flowstats['starttime'] = datetime.now(timezone.utc).astimezone()
+ logging.debug('{} pipe reading at {} (stdout,{})'.format(self._client.name, self.flowstats['starttime'].isoformat(), self._client.remotepid))
+ else :
+ if self.flowstats['flowid'] is None :
+ m = self._client.regex_flowid.match(line)
+ if m :
+ # [ 1] local 192.168.1.15%enp1s0 port 7001 connected with 192.168.1.232 port 7001 (trip-times) (sock=3) on 2021-10-11 14:39:45 (PDT)
+ # self.regex_flowid = re.compile(r'local\s(?P<srcip>[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}).*\sport\s(?P<srcport>[0-9]+)\sconnected with\s(?P<dstip>[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3})\sport\s(?P<dstport>[0-9]+)')
+ #
+ # temp = htonl(config->src_ip);
+ # checksum ^= bcm_compute_xor32((volatile uint32 *)&temp, sizeof(temp) / sizeof(uint32));
+ # temp = htonl(config->dst_ip);
+ # checksum ^= bcm_compute_xor32((volatile uint32 *)&temp, sizeof(temp) / sizeof(uint32));
+ # temp = (hton16(config->dst_port) << 16) | hton16(config->src_port);
+ # checksum ^= bcm_compute_xor32((volatile uint32 *)&temp, sizeof(temp) / sizeof(uint32));
+ # temp = config->proto;
+ # checksum ^= bcm_compute_xor32((volatile uint32 *)&temp, sizeof(temp) / sizeof(uint32));
+ # return "%08x" % netip
+ # NOTE: the network or big endian byte order
+ srcipaddr = ipaddress.ip_address(m.group('srcip'))
+ srcip32 = ctypes.c_uint32(int.from_bytes(srcipaddr.packed, byteorder='little', signed=False))
+ dstipaddr = ipaddress.ip_address(m.group('dstip'))
+ dstip32 = ctypes.c_uint32(int.from_bytes(dstipaddr.packed, byteorder='little', signed=False))
+ dstportbytestr = int(m.group('dstport')).to_bytes(2, byteorder='big', signed=False)
+ dstport16 = ctypes.c_uint16(int.from_bytes(dstportbytestr, byteorder='little', signed=False))
+ srcportbytestr = int(m.group('srcport')).to_bytes(2, byteorder='big', signed=False)
+ srcport16 = ctypes.c_uint16(int.from_bytes(srcportbytestr, byteorder='little', signed=False))
+ ports32 = ctypes.c_uint32((dstport16.value << 16) | srcport16.value)
+ if self._client.proto == 'UDP':
+ proto32 = ctypes.c_uint32(0x11)
+ else :
+ proto32 = ctypes.c_uint32(0x06)
+ quintuplehash = srcip32.value ^ dstip32.value ^ ports32.value ^ proto32.value
+ self.flowstats['flowid'] = '0x{:08x}'.format(quintuplehash)
+ if self._client.flow.name :
+ flowkey = self._client.flow.name
+ else :
+ flowkey = '0x{:08x}'.format(quintuplehash)
+ iperf_flow.flowid2name[self.flowstats['flowid']] = flowkey
+ logging.info('Flow quintuple hash of {} uses name {}'.format(self.flowstats['flowid'], flowkey))
+
+ if self._client.proto == 'TCP':
+ m = self._client.regex_traffic.match(line)
+ if m :
+ timestamp = datetime.now()
+ if not self._client.traffic_event.is_set() :
+ self._client.traffic_event.set()
+
+ bytes = float(m.group('bytes'))
+ if self.flowstats['current_rxbytes'] :
+ flowrate = round((self.flowstats['current_rxbytes'] / bytes), 2)
+ # *consume* the current *rxbytes* where the server pipe will repopulate on its next sample
+ # do this by setting the value to None
+ self.flowstats['current_rxbytes'] = None
+ # logging.debug('{} flow ratio={:.2f}'.format(self._client.name, flowrate))
+ self.flowstats['flowrate'] = flowrate
+ else :
+ # *produce* the current txbytes so the server pipe can know this event occurred
+ # indicate this by setting the value to value
+ self.flowstats['current_txbytes'] = bytes
+
+ self.flowstats['txdatetime'].append(timestamp)
+ self.flowstats['txbytes'].append(m.group('bytes'))
+ self.flowstats['txthroughput'].append(m.group('throughput'))
+ self.flowstats['writes'].append(m.group('writes'))
+ self.flowstats['errwrites'].append(m.group('errwrites'))
+ self.flowstats['retry'].append(m.group('retry'))
+ self.flowstats['cwnd'].append(m.group('cwnd'))
+ self.flowstats['rtt'].append(m.group('rtt'))
+ else :
+ m = self._client.regex_connect_time.match(line)
+ if m :
+ self.flowstats['connect_time'].append(float(m.group('connect_time')))
+ else :
+ pass
+
+ elif fd == 2:
+ self._stderrbuffer += data
+ while "\n" in self._stderrbuffer:
+ line, self._stderrbuffer = self._stderrbuffer.split("\n", 1)
+ logging.info('{} {} (stderr)'.format(self._client.name, line))
+ m = self._client.regex_tx_bind_failed.match(line)
+ if m :
+ logging.error('TX Bind Failed. Check LAN / WLAN between server and client.')
+ iperf_flow.loop.stop()
+ raise
+
+ def pipe_connection_lost(self, fd, exc):
+ if fd == 1:
+ logging.debug('stdout pipe to {} closed (exception={})'.format(self._client.name, exc))
+ self._closed_stdout = True
+ elif fd == 2:
+ logging.debug('stderr pipe to {} closed (exception={})'.format(self._client.name, exc))
+ self._closed_stderr = True
+ self.signal_exit()
+
+ def process_exited(self):
+ logging.debug('subprocess with pid={} closed'.format(self._mypid))
+ self._exited = True
+ self._mypid = None
+ self.signal_exit()
+
+ class CustomAdapter(logging.LoggerAdapter):
+ def process(self, msg, kwargs):
+ return '[%s] %s' % (self.extra['connid'], msg), kwargs
+
+ def __init__(self, name='Client', loop=None, host='localhost', flow = None, debug=False):
+ self.__dict__['flow'] = flow
+ self.opened = asyncio.Event()
+ self.closed = asyncio.Event()
+ self.txcompleted = asyncio.Event()
+ self.closed.set()
+ self.txcompleted.clear()
+ self.traffic_event = asyncio.Event()
+ self.name = name
+ self.iperf = '/usr/local/bin/iperf'
+ self.ssh = '/usr/bin/ssh'
+ self.host = host
+ self.debug = debug
+ self.flow = flow
+ self._transport = None
+ self._protocol = None
+ conn_id = '{}'.format(self.name)
+ self.adapter = self.CustomAdapter(logger, {'connid': conn_id})
+ # traffic ex: [ 3] 0.00-0.50 sec 655620 Bytes 10489920 bits/sec 14/211 446 446K/0 us
+ self.regex_traffic = re.compile(r'\[\s+\d+] (?P<timestamp>.*) sec\s+(?P<bytes>\d+) Bytes\s+(?P<throughput>\d+) bits/sec\s+(?P<writes>\d+)/(?P<errwrites>\d+)\s+(?P<retry>\d+)\s+(?P<cwnd>\d+)K/(?P<rtt>\d+) us')
+ self.regex_connect_time = re.compile(r'\[\s+\d+]\slocal.*\(ct=(?P<connect_time>\d+\.\d+) ms\)')
+ # local 192.168.1.4 port 56949 connected with 192.168.1.1 port 61001
+ self.regex_flowid = re.compile(r'\[\s+\d+]\slocal\s(?P<srcip>[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}).*\sport\s(?P<srcport>[0-9]+)\sconnected with\s(?P<dstip>[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3})\sport\s(?P<dstport>[0-9]+)')
+ self.regex_tx_bind_failed = re.compile(r'bind failed: Cannot assign requested address')
+
+ def __getattr__(self, attr):
+ return getattr(self.flow, attr)
+
+ async def start(self, time=None, amount=None, parallel=None, epoch_sync_time=None):
+ if not self.closed.is_set() :
+ return
+
+ self.opened.clear()
+ self.txcompleted.clear()
+ self.remotepid = None
+ self.flowstats['flowid']=None
+
+ # Client connecting to 192.168.100.33, TCP port 61009 with pid 1903
+ self.regex_open_pid = re.compile(r'Client connecting to .*, {} port {} with pid (?P<pid>\d+)'.format(self.proto, str(self.dstport)))
+ if self.client_device :
+ client_dst = self.dstip + '%' + self.client_device
+ else :
+ client_dst = self.dstip
+ self.sshcmd=[self.ssh, self.user + '@' + self.host, self.iperf, '-c', client_dst, '-p ' + str(self.dstport), '-e', '-f{}'.format(self.format), '-w' , self.window ,'--realtime']
+ if self.tcp_tx_delay :
+ self.sshcmd.extend(['--tcp-tx-delay', self.tcp_tx_delay])
+ if self.tos :
+ self.sshcmd.extend(['-S ', self.tos])
+ if self.length :
+ self.sshcmd.extend(['-l ', str(self.length)])
+ if time:
+ self.sshcmd.extend(['-t ', str(time)])
+ elif amount:
+ iperftime = time
+ self.sshcmd.extend(['-n ', amount])
+ if parallel :
+ self.sshcmd.extend(['-P', str(parallel)])
+ if self.trip_times :
+ self.sshcmd.extend(['--trip-times'])
+ if self.prefetch :
+ self.sshcmd.extend(['--tcp-write-prefetch', self.prefetch])
+ self.sshcmd.extend(['--histograms=1m,100000,5,95'])
+
+ if self.srcip :
+ if self.srcport :
+ self.sshcmd.extend(['-B ', '{}:{}'.format(self.srcip, self.srcport)])
+ else :
+ self.sshcmd.extend(['-B {}'.format(self.srcip)])
+
+ if self.cca :
+ self.sshcmd.extend(['-Z ', self.cca])
+ if self.interval >= 0.005 :
+ self.sshcmd.extend(['-i ', str(self.interval)])
+
+ if self.proto == 'UDP' :
+ self.sshcmd.extend(['-u '])
+ if self.isoch :
+ self.sshcmd.extend(['--isochronous=' + self.offered_load, ' --ipg ', str(self.ipg)])
+ elif self.offered_load :
+ self.sshcmd.extend(['-b', self.offered_load])
+ elif self.proto == 'TCP' and self.offered_load :
+ self.sshcmd.extend(['-b', self.offered_load])
+ elif self.proto == 'TCP' and self.burst_size and self.burst_period :
+ self.sshcmd.extend(['--burst-size', str(self.burst_size)])
+ self.sshcmd.extend(['--burst-period', str(self.burst_period)])
+ elif self.proto == 'TCP' and self.bb :
+ self.sshcmd.extend(['--bounceback'])
+ self.sshcmd.extend(['--bounceback-hold', str(self.bb_hold)])
+ self.sshcmd.extend(['--bounceback-period', str(self.bb_period)])
+ elif self.proto == 'TCP' and self.offered_load :
+ self.sshcmd.extend(['-b', self.offered_load])
+ if not self.bb and self.fullduplex :
+ self.sshcmd.extend(['--full-duplex', str(" ")])
+
+ if self.flow.bb :
+ self.sshcmd.extend(['--bounceback'])
+ if self.flow.working_load :
+ self.sshcmd.extend(['--working-load'])
+
+ if epoch_sync_time :
+ self.sshcmd.extend(['--txstart-time', str(epoch_sync_time)])
+
+ elif self.txstart_delay_sec :
+ # use incoming txstart_delay_sec and convert it to epoch_time_sec to use with '--txstart-time' iperf parameter
+ logging.info('{}'.format(str(datetime.now())))
+ epoch_time_sec = (datetime.now()).timestamp()
+ logging.info('Current epoch_time_sec = {}'.format(str(epoch_time_sec)))
+ new_txstart_time = epoch_time_sec + self.txstart_delay_sec
+ logging.info('new_txstart_time = {}'.format(str(new_txstart_time)))
+ self.sshcmd.extend(['--txstart-time', str(new_txstart_time)])
+
+ logging.info('{}'.format(str(self.sshcmd)))
+ try :
+ self._transport, self._protocol = await iperf_flow.loop.subprocess_exec(lambda: self.IperfClientProtocol(self, self.flow), *self.sshcmd)
+ await self.opened.wait()
+ except:
+ logging.error('flow client start error per: {}'.format(str(self.sshcmd)))
+ pass
+
+ async def signal_stop(self):
+ if self.remotepid and not self.finished :
+ childprocess = await asyncio.create_subprocess_exec(self.ssh, '{}@{}'.format(self.user, self.host), 'kill', '-HUP', '{}'.format(self.remotepid), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ logging.debug('({}) sending signal HUP to {} (pid={})'.format(self.user, self.host, self.remotepid))
+ stdout, _ = await childprocess.communicate()
+ if stdout:
+ logging.info('{}({}) {}'.format(self.user, self.host, stdout))
+ if not self.closed.is_set():
+ await self.closed.wait()
+
+ async def signal_pause(self):
+ if self.remotepid :
+ childprocess = await asyncio.create_subprocess_exec(self.ssh, '{}@{}'.format(self.user, self.host), 'kill', '-STOP', '{}'.format(self.remotepid), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ logging.debug('({}) sending signal STOP to {} (pid={})'.format(self.user, self.host, self.remotepid))
+ stdout, _ = await childprocess.communicate()
+ if stdout:
+ logging.info('{}({}) {}'.format(self.user, self.host, stdout))
+ if not self.closed.is_set():
+ await self.closed.wait()
+
+ async def signal_resume(self):
+ if self.remotepid :
+ childprocess = await asyncio.create_subprocess_exec(self.ssh, '{}@{}'.format(self.user, self.host), 'kill', '-CONT', '{}'.format(self.remotepid), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ logging.debug('({}) sending signal CONT to {} (pid={})'.format(self.user, self.host, self.remotepid))
+ stdout, _ = await childprocess.communicate()
+ if stdout:
+ logging.info('{}({}) {}'.format(self.user, self.host, stdout))
+ if not self.closed.is_set():
+ await self.closed.wait()
+
+class flow_histogram(object):
+
+ @classmethod
+ async def plot_two_sample_ks(cls, h1=None, h2=None, outputtype='png', directory='.', flowname=None, title=None):
+
+ lci_val = int(h2.lci_val) * h2.binwidth
+ uci_val = int(h2.uci_val) * h2.binwidth
+ mytitle = '{} {} two sample KS({},{}) ({} samples) {}/{}%={}/{} us outliers={}\\n{}'.format(flowname, h1.name, h1.ks_index, h2.ks_index, h2.population, h2.lci, h2.uci, lci_val, uci_val, h2.outliers, title)
+ if h1.basefilename is None :
+ h1.output_dir = directory + '/' + flowname + h1.name + '/' + h1.name + '_' + str(h1.ks_index)
+ await h1.write(directory=h1.output_dir)
+
+ if h2.basefilename is None :
+ h2.output_dir = directory + '/' + flowname + h2.name + '/' + h2.name + '_' + str(h2.ks_index)
+ await h2.write(directory=h2.output_dir)
+
+ if (h1.basefilename is not None) and (h2.basefilename is not None) :
+ basefilename = '{}_{}_{}'.format(h1.basefilename, h1.ks_index, h2.ks_index)
+ gpcfilename = basefilename + '.gpc'
+ #write out the gnuplot control file
+ with open(gpcfilename, 'w') as fid :
+ if outputtype == 'canvas' :
+ fid.write('set output \"{}.{}\"\n'.format(basefilename, 'html'))
+ fid.write('set terminal canvas standalone mousing size 1024,768\n')
+ if outputtype == 'svg' :
+ fid.write('set output \"{}_svg.{}\"\n'.format(basefilename, 'html'))
+ fid.write('set terminal svg size 1024,768 dynamic mouse\n')
+ else :
+ fid.write('set output \"{}.{}\"\n'.format(basefilename, 'png'))
+ fid.write('set terminal png size 1024,768\n')
+
+ fid.write('set key bottom\n')
+ fid.write('set title \"{}\" noenhanced\n'.format(mytitle))
+ if float(uci_val) < 400:
+ fid.write('set format x \"%.2f"\n')
+ else :
+ fid.write('set format x \"%.1f"\n')
+ fid.write('set format y \"%.1f"\n')
+ fid.write('set yrange [0:1.01]\n')
+ fid.write('set y2range [0:*]\n')
+ fid.write('set ytics add 0.1\n')
+ fid.write('set y2tics nomirror\n')
+ fid.write('set grid\n')
+ fid.write('set xlabel \"time (ms)\\n{} - {}\"\n'.format(h1.starttime, h2.endtime))
+ default_minx = -0.5
+ if float(uci_val) < 0.4:
+ fid.write('set xrange [{}:0.4]\n'.format(default_minx))
+ fid.write('set xtics auto\n')
+ elif h1.max < 2.0 and h2.max < 2.0 :
+ fid.write('set xrange [{}:2]\n'.format(default_minx))
+ fid.write('set xtics auto\n')
+ elif h1.max < 5.0 and h2.max < 5.0 :
+ fid.write('set xrange [{}:5]\n'.format(default_minx))
+ fid.write('set xtics auto\n')
+ elif h1.max < 10.0 and h2.max < 10.0:
+ fid.write('set xrange [{}:10]\n'.format(default_minx))
+ fid.write('set xtics add 1\n')
+ elif h1.max < 20.0 and h2.max < 20.0 :
+ fid.write('set xrange [{}:20]\n'.format(default_minx))
+ fid.write('set xtics add 1\n')
+ fid.write('set format x \"%.0f"\n')
+ elif h1.max < 40.0 and h2.max < 40.0:
+ fid.write('set xrange [{}:40]\n'.format(default_minx))
+ fid.write('set xtics add 5\n')
+ fid.write('set format x \"%.0f"\n')
+ elif h1.max < 50.0 and h2.max < 50.0:
+ fid.write('set xrange [{}:50]\n'.format(default_minx))
+ fid.write('set xtics add 5\n')
+ fid.write('set format x \"%.0f"\n')
+ elif h1.max < 75.0 and h2.max < 75.0:
+ fid.write('set xrange [{}:75]\n'.format(default_minx))
+ fid.write('set xtics add 5\n')
+ fid.write('set format x \"%.0f"\n')
+ elif h1.max < 100.0 and h2.max < 100.0 :
+ fid.write('set xrange [{}:100]\n'.format(default_minx))
+ fid.write('set xtics add 10\n')
+ fid.write('set format x \"%.0f"\n')
+ else :
+ fid.write('set xrange [{}:*]\n'.format(default_minx))
+ fid.write('set xtics auto\n')
+ fid.write('set format x \"%.0f"\n')
+ fid.write('plot \"{0}\" using 1:2 index 0 axes x1y2 with impulses linetype 3 notitle, \"{1}\" using 1:2 index 0 axes x1y2 with impulses linetype 2 notitle, \"{1}\" using 1:3 index 0 axes x1y1 with lines linetype 1 linewidth 2 notitle, \"{0}\" using 1:3 index 0 axes x1y1 with lines linetype -1 linewidth 2 notitle\n'.format(h1.datafilename, h2.datafilename))
+
+ childprocess = await asyncio.create_subprocess_exec(flow_histogram.gnuplot,gpcfilename, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout, stderr = await childprocess.communicate()
+ if stderr :
+ logging.error('Exec {} {}'.format(flow_histogram.gnuplot, gpcfilename))
+ else :
+ logging.debug('Exec {} {}'.format(flow_histogram.gnuplot, gpcfilename))
+
+ gnuplot = '/usr/bin/gnuplot'
+ def __init__(self, binwidth=None, name=None, values=None, population=None, starttime=None, endtime=None, title=None, outliers=None, lci = None, uci = None, lci_val = None, uci_val = None) :
+ self.raw = values
+ self._entropy = None
+ self._ks_1samp_dist = None
+ self.bins = self.raw.split(',')
+ self.name = name
+ self.ks_index = None
+ self.population = int(population)
+ self.samples = np.zeros(int(self.population))
+ self.binwidth = int(binwidth)
+ self.createtime = datetime.now(timezone.utc).astimezone()
+ self.starttime=starttime
+ self.endtime=endtime
+ self.title=title
+ self.outliers=outliers
+ self.uci = uci
+ self.uci_val = uci_val
+ self.lci = lci
+ self.lci_val = lci_val
+ self.basefilename = None
+ ix = 0
+ for bin in self.bins :
+ x,y = bin.split(':')
+ for i in range(int(y)) :
+ self.samples[ix] = x
+ ix += 1
+
+ @property
+ def entropy(self) :
+ if not self._entropy :
+ self._entropy = 0
+ for bin in self.bins :
+ x,y = bin.split(':')
+ y1 = float(y) / float(self.population)
+ self._entropy -= y1 * math.log2(y1)
+ return self._entropy
+
+ @property
+ def ks_1samp_dist(self):
+ if not self._ks_1samp_dist :
+ self._ks_1samp_dist,p = stats.ks_1samp(self.samples, stats.norm.cdf)
+ return self._ks_1samp_dist
+
+ @property
+ def ampdu_dump(self) :
+ return self._ampdu_rawdump
+
+ @ampdu_dump.setter
+ def ampdu_dump(self, value):
+ self._ampdu_rawdump = value
+
+ async def __exec_gnuplot(self) :
+ logging.info('Plotting {} {}'.format(self.name, self.gpcfilename))
+ childprocess = await asyncio.create_subprocess_exec(flow_histogram.gnuplot, self.gpcfilename, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout, stderr = await childprocess.communicate()
+ if stderr :
+ logging.error('Exec {} {}'.format(flow_histogram.gnuplot, self.gpcfilename))
+ else :
+ logging.debug('Exec {} {}'.format(flow_histogram.gnuplot, self.gpcfilename))
+
+ async def write(self, directory='.', filename=None) :
+ # write out the datafiles for the plotting tool, e.g. gnuplot
+ if filename is None:
+ filename = self.name
+
+ if not os.path.exists(directory):
+ logging.debug('Making results directory {}'.format(directory))
+ os.makedirs(directory)
+
+ logging.debug('Writing {} results to directory {}'.format(directory, filename))
+ basefilename = os.path.join(directory, filename)
+ datafilename = os.path.join(directory, filename + '.data')
+ self.max = None
+ with open(datafilename, 'w') as fid :
+ cummulative = 0.0
+ for bin in self.bins :
+ x,y = bin.split(':')
+ #logging.debug('bin={} x={} y={}'.format(bin, x, y))
+ if (float(y) > 1.0) or ((cummulative / float(self.population)) < 0.99) :
+ cummulative += float(y)
+ perc = cummulative / float(self.population)
+ self.max = float(x) * float(self.binwidth) / 1000.0 # max is the last value
+ fid.write('{} {} {}\n'.format((float(x) * float(self.binwidth) / 1000.0), int(y), perc))
+
+ self.basefilename = basefilename
+ self.datafilename = datafilename
+
+ async def async_plot(self, title=None, directory='.', outputtype='png', filename=None) :
+ if self.basefilename is None :
+ await self.write(directory=directory, filename=filename)
+
+ if self.basefilename is not None :
+ self.gpcfilename = self.basefilename + '.gpc'
+ #write out the gnuplot control file
+ with open(self.gpcfilename, 'w') as fid :
+ if outputtype == 'canvas' :
+ fid.write('set output \"{}.{}\"\n'.format(basefilename, 'html'))
+ fid.write('set terminal canvas standalone mousing size 1024,768\n')
+ if outputtype == 'svg' :
+ fid.write('set output \"{}_svg.{}\"\n'.format(basefilename, 'html'))
+ fid.write('set terminal svg size 1024,768 dynamic mouse\n')
+ else :
+ fid.write('set output \"{}.{}\"\n'.format(basefilename, 'png'))
+ fid.write('set terminal png size 1024,768\n')
+
+ if not title and self.title :
+ title = self.title
+
+ fid.write('set key bottom\n')
+ if self.ks_index is not None :
+ fid.write('set title \"{}({}) {}({}) E={}\" noenhanced\n'.format(self.name, str(self.ks_index), title, int(self.population), self.entropy))
+ else :
+ fid.write('set title \"{}{}({}) E={}\" noenhanced\n'.format(self.name, title, int(self.population), self.entropy))
+ fid.write('set format x \"%.0f"\n')
+ fid.write('set format y \"%.1f"\n')
+ fid.write('set yrange [0:1.01]\n')
+ fid.write('set y2range [0:*]\n')
+ fid.write('set ytics add 0.1\n')
+ fid.write('set y2tics nomirror\n')
+ fid.write('set grid\n')
+ fid.write('set xlabel \"time (ms)\\n{} - {}\"\n'.format(self.starttime, self.endtime))
+ if self.max < 5.0 :
+ fid.write('set xrange [0:5]\n')
+ fid.write('set xtics auto\n')
+ elif self.max < 10.0 :
+ fid.write('set xrange [0:10]\n')
+ fid.write('set xtics add 1\n')
+ elif self.max < 20.0 :
+ fid.write('set xrange [0:20]\n')
+ fid.write('set xtics add 1\n')
+ elif self.max < 40.0 :
+ fid.write('set xrange [0:40]\n')
+ fid.write('set xtics add 5\n')
+ elif self.max < 50.0 :
+ fid.write('set xrange [0:50]\n')
+ fid.write('set xtics add 5\n')
+ elif self.max < 75.0 :
+ fid.write('set xrange [0:75]\n')
+ fid.write('set xtics add 5\n')
+ else :
+ fid.write('set xrange [0:100]\n')
+ fid.write('set xtics add 10\n')
+ fid.write('plot \"{0}\" using 1:2 index 0 axes x1y2 with impulses linetype 3 notitle, \"{0}\" using 1:3 index 0 axes x1y1 with lines linetype -1 linewidth 2 notitle\n'.format(datafilename))
+
+ if outputtype == 'png' :
+ # Create a thumbnail too
+ fid.write('unset output; unset xtics; unset ytics; unset key; unset xlabel; unset ylabel; unset border; unset grid; unset yzeroaxis; unset xzeroaxis; unset title; set lmargin 0; set rmargin 0; set tmargin 0; set bmargin 0\n')
+ fid.write('set output \"{}_thumb.{}\"\n'.format(basefilename, 'png'))
+ fid.write('set terminal png transparent size 64,32 crop\n')
+ fid.write('plot \"{0}\" using 1:2 index 0 axes x1y2 with impulses linetype 3 notitle, \"{0}\" using 1:3 index 0 axes x1y1 with lines linetype -1 linewidth 2 notitle\n'.format(datafilename))
+
+ await self.__exec_gnuplot()
diff --git a/flows/ssh_nodes.py b/flows/ssh_nodes.py
new file mode 100755
index 0000000..73e69f3
--- /dev/null
+++ b/flows/ssh_nodes.py
@@ -0,0 +1,499 @@
+# ---------------------------------------------------------------
+# * Copyright (c) 2018-2023
+# * Broadcom Corporation
+# * All Rights Reserved.
+# *---------------------------------------------------------------
+# Redistribution and use in source and binary forms, with or without modification, are permitted
+# provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this list of conditions
+# and the following disclaimer. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the documentation and/or other
+# materials provided with the distribution. Neither the name of the Broadcom nor the names of
+# contributors may be used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Author Robert J. McMahon, Broadcom LTD
+#
+# Python object to support sending remote commands to a host
+#
+# Date April 2018 - December 2023
+
+import logging
+import asyncio, subprocess
+import time, datetime
+import weakref
+import os
+import re
+
+from datetime import datetime as datetime, timezone
+
+logger = logging.getLogger(__name__)
+
+class ssh_node:
+ DEFAULT_IO_TIMEOUT = 30.0
+ DEFAULT_CMD_TIMEOUT = 30
+ DEFAULT_CONNECT_TIMEOUT = 60.0
+ rexec_tasks = []
+ _loop = None
+ instances = weakref.WeakSet()
+ periodic_cmd_futures = []
+ periodic_cmd_running_event = asyncio.Event()
+ periodic_cmd_done_event = asyncio.Event()
+
+ @classmethod
+ @property
+ def loop(cls):
+ if not cls._loop :
+ try :
+ cls._loop = asyncio.get_running_loop()
+ except :
+ if os.name == 'nt':
+ # On Windows, the ProactorEventLoop is necessary to listen on pipes
+ cls._loop = asyncio.ProactorEventLoop()
+ else:
+ cls._loop = asyncio.new_event_loop()
+ return cls._loop
+
+ @classmethod
+ def sleep(cls, time=0, text=None, stoptext=None) :
+ if text :
+ logging.info('Sleep {} ({})'.format(time, text))
+ ssh_node.loop.run_until_complete(asyncio.sleep(time))
+ if stoptext :
+ logging.info('Sleep done ({})'.format(stoptext))
+
+ @classmethod
+ def get_instances(cls):
+ try :
+ return list(ssh_node.instances)
+ except NameError :
+ return []
+
+ @classmethod
+ def run_all_commands(cls, timeout=None, text=None, stoptext=None) :
+ if ssh_node.rexec_tasks :
+ if text :
+ logging.info('Run all tasks: {})'.format(time, text))
+ ssh_node.loop.run_until_complete(asyncio.wait(ssh_node.rexec_tasks, timeout=timeout))
+ if stoptext :
+ logging.info('Commands done ({})'.format(stoptext))
+ ssh_node.rexec_tasks = []
+
+ @classmethod
+ def open_consoles(cls, silent_mode=False) :
+ nodes = ssh_node.get_instances()
+ node_names = []
+ tasks = []
+ for node in nodes:
+ if node.sshtype.lower() == 'ssh' :
+ tasks.append(asyncio.ensure_future(node.clean(), loop=ssh_node.loop))
+ if tasks :
+ logging.info('Run consoles clean')
+ try :
+ ssh_node.loop.run_until_complete(asyncio.wait(tasks, timeout=20))
+ except asyncio.TimeoutError:
+ logging.error('console cleanup timeout')
+
+ tasks = []
+ ipaddrs = []
+ for node in nodes :
+ #see if we need control master to be started
+ if node.ssh_speedups and not node.ssh_console_session and node.ipaddr not in ipaddrs:
+ logging.info('Run consoles speedup')
+ node.ssh_console_session = ssh_session(name=node.name, hostname=node.ipaddr, node=node, control_master=True, ssh_speedups=True, silent_mode=silent_mode)
+ node.console_task = asyncio.ensure_future(node.ssh_console_session.post_cmd(cmd='/usr/bin/dmesg -w', IO_TIMEOUT=None, CMD_TIMEOUT=None), loop=ssh_node.loop)
+ tasks.append(node.console_task)
+ ipaddrs.append(node.ipaddr)
+ node_names.append(node.name)
+
+ if tasks :
+ s = " "
+ logging.info('Opening consoles: {}'.format(s.join(node_names)))
+ try :
+ ssh_node.loop.run_until_complete(asyncio.wait(tasks, timeout=60))
+ except asyncio.TimeoutError:
+ logging.error('open console timeout')
+ raise
+
+ if tasks :
+ # Sleep to let the control masters settle
+ ssh_node.loop.run_until_complete(asyncio.sleep(1))
+ logging.info('open_consoles done')
+
+ @classmethod
+ def close_consoles(cls) :
+ nodes = ssh_node.get_instances()
+ tasks = []
+ node_names = []
+ for node in nodes :
+ if node.ssh_console_session :
+ node.console_task = asyncio.ensure_future(node.ssh_console_session.close(), loop=ssh_node.loop)
+ tasks.append(node.console_task)
+ node_names.append(node.name)
+
+ if tasks :
+ s = " "
+ logging.info('Closing consoles: {}'.format(s.join(node_names)))
+ ssh_node.loop.run_until_complete(asyncio.wait(tasks, timeout=60))
+ logging.info('Closing consoles done: {}'.format(s.join(node_names)))
+
+ @classmethod
+ def periodic_cmds_stop(cls) :
+ logging.info("Stop periodic futures")
+ ssh_node.periodic_cmd_futures = []
+ ssh_node.periodic_cmd_running_event.clear()
+ while not ssh_node.periodic_cmd_done_event.is_set() :
+ ssh_node.loop.run_until_complete(asyncio.sleep(0.25))
+ logging.debug("Awaiting kill periodic futures")
+ logging.debug("Stop periodic futures done")
+
+ def __init__(self, name=None, ipaddr=None, devip=None, console=False, device=None, ssh_speedups=False, silent_mode=False, sshtype='ssh', relay=None):
+ self.ipaddr = ipaddr
+ self.name = name
+ self.my_futures = []
+ self.device = device
+ self.devip = devip
+ self.sshtype = sshtype.lower()
+ if self.sshtype.lower() == 'ssh' :
+ self.ssh_speedups = ssh_speedups
+ self.controlmasters = '/tmp/controlmasters_{}'.format(self.ipaddr)
+ else :
+ self.ssh_speedups = False
+ self.controlmasters = None
+ self.ssh_console_session = None
+
+ if relay :
+ self.relay = relay
+ self.ssh = ['/usr/bin/ssh', 'root@{}'.format(relay)]
+ else :
+ self.ssh = []
+ if self.sshtype.lower() == 'ush' :
+ self.ssh.extend(['/usr/local/bin/ush'])
+ elif self.sshtype.lower() == 'ssh' :
+ if not self.ssh :
+ logging.debug("node add /usr/bin/ssh")
+ self.ssh.extend(['/usr/bin/ssh'])
+ logging.debug("ssh={} ".format(self.ssh))
+ else :
+ raise ValueError("ssh type invalid")
+
+ ssh_node.instances.add(self)
+
+ def rexec(self, cmd='pwd', IO_TIMEOUT=DEFAULT_IO_TIMEOUT, CMD_TIMEOUT=DEFAULT_CMD_TIMEOUT, CONNECT_TIMEOUT=DEFAULT_CONNECT_TIMEOUT, run_now=True, repeat = None) :
+ io_timer = IO_TIMEOUT
+ cmd_timer = CMD_TIMEOUT
+ connect_timer = CONNECT_TIMEOUT
+ this_session = ssh_session(name=self.name, hostname=self.ipaddr, CONNECT_TIMEOUT=connect_timer, node=self, ssh_speedups=True)
+ this_future = asyncio.ensure_future(this_session.post_cmd(cmd=cmd, IO_TIMEOUT=io_timer, CMD_TIMEOUT=cmd_timer, repeat = repeat), loop=ssh_node.loop)
+ if run_now:
+ ssh_node.loop.run_until_complete(asyncio.wait([this_future], timeout=CMD_TIMEOUT))
+ else:
+ ssh_node.rexec_tasks.append(this_future)
+ self.my_futures.append(this_future)
+ return this_session
+
+ async def clean(self) :
+ childprocess = await asyncio.create_subprocess_exec('/usr/bin/ssh', 'root@{}'.format(self.ipaddr), 'pkill', 'dmesg', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout, stderr = await childprocess.communicate()
+ if stdout :
+ logging.info('{}'.format(stdout))
+ if stderr :
+ logging.info('{}'.format(stderr))
+
+ def close_console(self) :
+ if self.ssh_console_session:
+ self.ssh_console_session.close()
+
+ async def repeat(self, interval, func, *args, **kwargs):
+ """
+ Run func every interval seconds.
+ If func has not finished before *interval*, will run again
+ immediately when the previous iteration finished.
+ *args and **kwargs are passed as the arguments to func.
+ """
+ logging.debug("repeat args={} kwargs={}".format(args, kwargs))
+
+ while ssh_node.periodic_cmd_running_event.is_set() :
+ await asyncio.gather(
+ func(*args, **kwargs),
+ asyncio.sleep(interval),
+ )
+ if interval == 0 :
+ break
+
+ logging.debug("Closing log_fh={}".format(kwargs['log_fh']))
+ kwargs['log_fh'].flush()
+ kwargs['log_fh'].close()
+ ssh_node.periodic_cmd_done_event.set()
+
+ def periodic_cmd_enable(self, cmd='ls', time_period=None, cmd_log_file=None) :
+ log_file_handle = open(cmd_log_file, 'w', errors='ignore')
+
+ if ssh_node.loop :
+ future = asyncio.ensure_future(self.repeat(time_period, self.run_cmd, cmd=cmd, log_fh=log_file_handle), loop=ssh_node.loop)
+ ssh_node.periodic_cmd_futures.append(future)
+ ssh_node.periodic_cmd_running_event.set()
+ ssh_node.periodic_cmd_done_event.clear()
+ else :
+ raise
+
+ async def run_cmd(self, *args, **kwargs) :
+ log_file_handle = kwargs['log_fh']
+ cmd = kwargs['cmd']
+
+ msg = "********************** Periodic Command '{}' Begins **********************".format(cmd)
+ logging.info(msg)
+ t = '%s' % datetime.now()
+ t = t[:-3] + " " + str(msg)
+ log_file_handle.write(t + '\n')
+ logging.debug("ssh={} ipaddr={} cmd={} ".format(self.ssh, self.ipaddr, cmd))
+ this_cmd = []
+ ush_flag = False
+
+ for item in self.ssh:
+ if 'ush' in item :
+ ush_flag = True
+
+ if ush_flag :
+ this_cmd.extend([*self.ssh, self.ipaddr, cmd])
+ else:
+ this_cmd.extend([*self.ssh, 'root@{}'.format(self.ipaddr), cmd])
+ logging.info("run cmd = {}".format(this_cmd))
+
+ childprocess = await asyncio.create_subprocess_exec(*this_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ logging.info("subprocess for periodic cmd = {}".format(this_cmd))
+ stdout, stderr = await childprocess.communicate()
+ if stderr:
+ msg = 'Command {} failed with {}'.format(cmd, stderr)
+ logging.error(msg)
+ t = '%s' % datetime.now()
+ t = t[:-3] + " " + str(msg)
+ log_file_handle.write(t + '\n')
+ log_file_handle.flush()
+ if stdout:
+ stdout = stdout.decode("utf-8")
+ log_file_handle.write(stdout)
+ msg = "********************** Periodic Command Ends **********************"
+ logging.info(msg)
+ t = '%s' % datetime.now()
+ t = t[:-3] + " " + str(msg)
+ log_file_handle.write(t + '\n')
+ log_file_handle.flush()
+
+# Multiplexed sessions need a control master to connect to. The run time parameters -M and -S also correspond
+# to ControlMaster and ControlPath, respectively. So first an initial master connection is established using
+# -M when accompanied by the path to the control socket using -S.
+#
+# ssh -M -S /home/fred/.ssh/controlmasters/fred@server.example.org:22 server.example.org
+# Then subsequent multiplexed connections are made in other terminals. They use ControlPath or -S to point to the control socket.
+# ssh -O check -S ~/.ssh/controlmasters/%r@%h:%p server.example.org
+# ssh -S /home/fred/.ssh/controlmasters/fred@server.example.org:22 server.example.org
+class ssh_session:
+ sessionid = 1;
+ class SSHReaderProtocol(asyncio.SubprocessProtocol):
+ def __init__(self, session, silent_mode):
+ self._exited = False
+ self._closed_stdout = False
+ self._closed_stderr = False
+ self._mypid = None
+ self._stdoutbuffer = ""
+ self._stderrbuffer = ""
+ self.debug = False
+ self._session = session
+ self._silent_mode = silent_mode
+ if self._session.CONNECT_TIMEOUT is not None :
+ self.watchdog = ssh_node.loop.call_later(self._session.CONNECT_TIMEOUT, self.wd_timer)
+ self._session.closed.clear()
+ self.timeout_occurred = asyncio.Event()
+ self.timeout_occurred.clear()
+
+ @property
+ def finished(self):
+ return self._exited and self._closed_stdout and self._closed_stderr
+
+ def signal_exit(self):
+ if not self.finished:
+ return
+ self._session.closed.set()
+
+ def connection_made(self, transport):
+ if self._session.CONNECT_TIMEOUT is not None :
+ self.watchdog.cancel()
+ self._mypid = transport.get_pid()
+ self._transport = transport
+ self._session.sshpipe = self._transport.get_extra_info('subprocess')
+ self._session.adapter.debug('{} ssh node connection made pid=({})'.format(self._session.name, self._mypid))
+ self._session.connected.set()
+ if self._session.IO_TIMEOUT is not None :
+ self.iowatchdog = ssh_node.loop.call_later(self._session.IO_TIMEOUT, self.io_timer)
+ if self._session.CMD_TIMEOUT is not None :
+ self.watchdog = ssh_node.loop.call_later(self._session.CMD_TIMEOUT, self.wd_timer)
+
+ def connection_lost(self, exc):
+ self._session.adapter.debug('{} node connection lost pid=({})'.format(self._session.name, self._mypid))
+ self._session.connected.clear()
+
+ def pipe_data_received(self, fd, data):
+ if self._session.IO_TIMEOUT is not None :
+ self.iowatchdog.cancel()
+ if self.debug :
+ logging.debug('{} {}'.format(fd, data))
+ self._session.results.extend(data)
+ data = data.decode("utf-8")
+ if fd == 1:
+ self._stdoutbuffer += data
+ while "\n" in self._stdoutbuffer:
+ line, self._stdoutbuffer = self._stdoutbuffer.split("\n", 1)
+ if not self._silent_mode :
+ self._session.adapter.info('{}'.format(line.replace("\r","")))
+
+ elif fd == 2:
+ self._stderrbuffer += data
+ while "\n" in self._stderrbuffer:
+ line, self._stderrbuffer = self._stderrbuffer.split("\n", 1)
+ self._session.adapter.warning('{} {}'.format(self._session.name, line.replace("\r","")))
+
+ if self._session.IO_TIMEOUT is not None :
+ self.iowatchdog = ssh_node.loop.call_later(self._session.IO_TIMEOUT, self.io_timer)
+
+ def pipe_connection_lost(self, fd, exc):
+ if self._session.IO_TIMEOUT is not None :
+ self.iowatchdog.cancel()
+ if fd == 1:
+ self._session.adapter.debug('{} stdout pipe closed (exception={})'.format(self._session.name, exc))
+ self._closed_stdout = True
+ elif fd == 2:
+ self._session.adapter.debug('{} stderr pipe closed (exception={})'.format(self._session.name, exc))
+ self._closed_stderr = True
+ self.signal_exit()
+
+ def process_exited(self):
+ if self._session.CMD_TIMEOUT is not None :
+ self.watchdog.cancel()
+ logging.debug('{} subprocess with pid={} closed'.format(self._session.name, self._mypid))
+ self._exited = True
+ self._mypid = None
+ self.signal_exit()
+
+ def wd_timer(self, type=None):
+ logging.error("{}: timeout: pid={}".format(self._session.name, self._mypid))
+ self.timeout_occurred.set()
+ if self._session.sshpipe :
+ self._session.sshpipe.terminate()
+
+ def io_timer(self, type=None):
+ logging.error("{} IO timeout: cmd='{}' host(pid)={}({})".format(self._session.name, self._session.cmd, self._session.hostname, self._mypid))
+ self.timeout_occurred.set()
+ self._session.sshpipe.terminate()
+
+ class CustomAdapter(logging.LoggerAdapter):
+ def process(self, msg, kwargs):
+ return '[%s] %s' % (self.extra['connid'], msg), kwargs
+
+ def __init__(self, user='root', name=None, hostname='localhost', CONNECT_TIMEOUT=None, control_master=False, node=None, silent_mode=False, ssh_speedups=True):
+ self.hostname = hostname
+ self.name = name
+ self.user = user
+ self.opened = asyncio.Event()
+ self.closed = asyncio.Event()
+ self.connected = asyncio.Event()
+ self.closed.set()
+ self.opened.clear()
+ self.connected.clear()
+ self.results = bytearray()
+ self.sshpipe = None
+ self.node = node
+ self.CONNECT_TIMEOUT = CONNECT_TIMEOUT
+ self.IO_TIMEOUT = None
+ self.CMD_TIMEOUT = None
+ self.control_master = control_master
+ self.ssh = node.ssh.copy()
+ self.silent_mode = silent_mode
+ self.ssh_speedups = ssh_speedups
+ logger = logging.getLogger(__name__)
+ if control_master :
+ conn_id = self.name + '(console)'
+ else :
+ conn_id = '{}({})'.format(self.name, ssh_session.sessionid)
+ ssh_session.sessionid += 1
+
+ self.adapter = self.CustomAdapter(logger, {'connid': conn_id})
+
+ def __getattr__(self, attr) :
+ if self.node :
+ return getattr(self.node, attr)
+
+ @property
+ def is_established(self):
+ return self._exited and self._closed_stdout and self._closed_stderr
+
+ async def close(self) :
+ if self.control_master :
+ logging.info('control master close called {}'.format(self.controlmasters))
+ childprocess = await asyncio.create_subprocess_exec('/usr/bin/ssh', 'root@{}'.format(self.ipaddr), 'pkill', 'dmesg', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout, stderr = await childprocess.communicate()
+ if stdout :
+ logging.info('{}'.format(stdout))
+ if stderr :
+ logging.info('{}'.format(stderr))
+ self.sshpipe.terminate()
+ await self.closed.wait()
+ logging.info('control master exit called {}'.format(self.controlmasters))
+ childprocess = await asyncio.create_subprocess_exec(self.ssh, '-o ControlPath={}'.format(self.controlmasters), '-O exit dummy-arg-why-needed', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout, stderr = await childprocess.communicate()
+ if stdout :
+ logging.info('{}'.format(stdout))
+ if stderr :
+ logging.info('{}'.format(stderr))
+
+ elif self.sshpipe :
+ self.sshpipe.terminate()
+ await self.closed.wait()
+
+ async def post_cmd(self, cmd=None, IO_TIMEOUT=None, CMD_TIMEOUT=None, ssh_speedups=True, repeat=None) :
+ logging.debug("{} Post command {}".format(self.name, cmd))
+ self.opened.clear()
+ self.cmd = cmd
+ self.IO_TIMEOUT = IO_TIMEOUT
+ self.CMD_TIMEOUT = CMD_TIMEOUT
+ self.repeatcmd = None
+ sshcmd = self.ssh.copy()
+ if self.control_master :
+ try:
+ os.remove(str(self.controlmasters))
+ except OSError:
+ pass
+ sshcmd.extend(['-o ControlMaster=yes', '-o ControlPath={}'.format(self.controlmasters), '-o ControlPersist=1'])
+ elif self.node.sshtype == 'ssh' :
+ sshcmd.append('-o ControlPath={}'.format(self.controlmasters))
+ if self.node.ssh_speedups :
+ sshcmd.extend(['{}@{}'.format(self.user, self.hostname), cmd])
+ else :
+ sshcmd.extend(['{}'.format(self.hostname), cmd])
+ s = " "
+ logging.info('{} {}'.format(self.name, s.join(sshcmd)))
+ while True :
+ # self in the ReaderProtocol() is this ssh_session instance
+ self._transport, self._protocol = await ssh_node.loop.subprocess_exec(lambda: self.SSHReaderProtocol(self, self.silent_mode), *sshcmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=None)
+ # self.sshpipe = self._transport.get_extra_info('subprocess')
+ # Establish the remote command
+ await self.connected.wait()
+ logging.debug("post_cmd connected")
+ # u = '{}\n'.format(cmd)
+ # self.sshpipe.stdin.write(u.encode())
+ # Wait for the command to complete
+ if not self.control_master :
+ await self.closed.wait()
+ if not repeat :
+ break
+ return self.results
diff --git a/include/Client.hpp b/include/Client.hpp
index 3848e92..8454fc3 100644
--- a/include/Client.hpp
+++ b/include/Client.hpp
@@ -57,6 +57,7 @@
#include "Settings.hpp"
#include "Timestamp.hpp"
#include "isochronous.hpp"
+#include "iperf_multicast_api.h"
#include "Mutex.h"
/* ------------------------------------------------------------------- */
@@ -82,7 +83,7 @@ public:
void mySockInit(void);
bool isConnected(void) const;
int SendFirstPayload(void);
- int BarrierClient(struct BarrierMutex *);
+ bool BarrierClient(struct BarrierMutex *);
void RunBounceBackTCP(void);
struct ReportHeader *myJob;
@@ -97,8 +98,7 @@ private:
void FinishTrafficActions(void);
void AwaitServerFinPacket(void);
bool InProgress(void);
- void PostNullEvent(void);
- void PostNullEvent(bool isFirst);
+ void PostNullEvent(bool isFirst, bool select_retry);
void AwaitServerCloseEvent(void);
inline void tcp_shutdown(void);
bool connected;
@@ -110,13 +110,14 @@ private:
bool apply_first_udppkt_delay;
int udp_payload_minimum;
void myReportPacket(void);
+ void myReportPacket(struct ReportStruct *);
// TCP plain
void RunTCP(void);
// TCP version which supports rate limiting per -b
void RunRateLimitedTCP(void);
void RunNearCongestionTCP(void);
+ bool AwaitSelectWrite(void);
#if HAVE_DECL_TCP_NOTSENT_LOWAT
- bool AwaitWriteSelectEventTCP(void);
void RunWriteEventsTCP(void);
#endif
// UDP traffic with isochronous and vbr support
@@ -142,6 +143,17 @@ private:
bool mysock_init_done;
bool peerclose;
Timestamp write_start;
+#if HAVE_DECL_SO_MAX_PACING_RATE
+ Timestamp PacingStepTime;
+#endif
+#if HAVE_DECL_TCP_TX_DELAY
+ enum delay_state {NO_DELAY=0, ADD_DELAY};
+ delay_state current_state;
+ int state_tokens[2];
+ inline void apply_txdelay_func (void);
+ Timestamp TcpTxDelayQuantumEnd;
+#endif
+
}; // end class Client
#endif // CLIENT_H
diff --git a/include/Listener.hpp b/include/Listener.hpp
index 92baad7..89bbcf1 100644
--- a/include/Listener.hpp
+++ b/include/Listener.hpp
@@ -58,6 +58,7 @@
#include "Thread.h"
#include "Settings.hpp"
#include "Timestamp.hpp"
+#include "iperf_multicast_api.h"
class Listener;
@@ -82,8 +83,7 @@ private:
bool apply_client_settings_tcp(thread_Settings *server);
bool apply_client_settings(thread_Settings *server);
int client_test_ack(thread_Settings *server);
- void my_multicast_join(void);
- void my_listen(void);
+ bool my_listen(void);
int my_accept(thread_Settings *server);
int udp_accept(thread_Settings *server);
int tuntap_accept(thread_Settings *server);
diff --git a/include/Locale.h b/include/Locale.h
index 65e547e..d07bf29 100644
--- a/include/Locale.h
+++ b/include/Locale.h
@@ -79,6 +79,7 @@ extern const char usage_long1[];
extern const char usage_long2[];
extern const char version[];
+extern const char branch_version[];
/* -------------------------------------------------------------------
* settings
@@ -96,6 +97,8 @@ extern const char client_report_epoch_start_current[];
extern const char server_pid_port[];
+extern const char server_working_load_port[];
+
extern const char server_pid_portrange[];
extern const char client_pid_port[];
@@ -140,6 +143,8 @@ extern const char client_burstperiod[];
extern const char client_burstperiodcount[];
+extern const char client_bbburstperiodcount[];
+
extern const char client_bounceback[];
extern const char client_bounceback_noqack[];
@@ -147,6 +152,8 @@ extern const char client_bounceback_noqack[];
extern const char server_burstperiod[];
extern const char client_fq_pacing[];
+
+extern const char client_fq_pacing_step[];
/* -------------------------------------------------------------------
* Legacy reports
* ------------------------------------------------------------------- */
@@ -223,6 +230,16 @@ extern const char report_sumcnt_write_enhanced_write_header[];
extern const char report_bw_write_enhanced_format[];
+extern const char report_bw_write_fq_header[];
+
+extern const char report_bw_write_fq_format[];
+
+extern const char report_bw_write_enhanced_fq_header[];
+
+extern const char report_bw_write_enhanced_fq_format[];
+
+extern const char report_bw_write_enhanced_fq_final_format[];
+
extern const char report_write_enhanced_write_header[];
extern const char report_write_enhanced_write_format[];
@@ -307,14 +324,12 @@ extern const char report_udp_fullduplex_sum_format[];
extern const char report_udp_fullduplex_enhanced_format[];
-extern const char report_sumcnt_udp_fullduplex_header[];
-
-extern const char report_sumcnt_udp_fullduplex_format[];
-
extern const char report_client_bb_bw_header[];
extern const char report_client_bb_bw_format[];
+extern const char report_client_bb_bw_final_format[];
+
extern const char report_client_bb_bw_triptime_format[];
extern const char report_bw_isoch_enhanced_netpwr_header[];
@@ -365,14 +380,20 @@ extern const char reportCSV_peer[];
extern const char reportCSV_bw_format[];
+extern const char reportCSV_bw_read_enhanced_header[];
extern const char reportCSV_bw_read_enhanced_format[];
+extern const char reportCSV_bw_write_enhanced_header[];
extern const char reportCSV_bw_write_enhanced_format[];
extern const char reportCSV_bw_jitter_loss_format[];
+extern const char reportCSV_bw_jitter_loss_pps_header[];
extern const char reportCSV_bw_jitter_loss_pps_format[];
+extern const char reportCSV_client_bb_bw_tcp_header[];
+extern const char reportCSV_client_bb_bw_tcp_format[];
+
/* -------------------------------------------------------------------
* warnings
* ------------------------------------------------------------------- */
@@ -431,6 +452,10 @@ extern const char error_starttime_exceeds[];
extern const char error_delaytime_exceeds[];
+extern const char report_client_bb_triptime_clocksync_error[];
+
+extern const char report_omitted[] ;
+
#ifdef __cplusplus
} /* end extern "C" */
#endif
diff --git a/include/Makefile.am b/include/Makefile.am
index 033fbd3..bde8185 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,2 +1,2 @@
-EXTRA_DIST = Client.hpp Condition.h Extractor.h active_hosts.h packet_ring.h Listener.hpp Locale.h Makefile.am Mutex.h PerfSocket.hpp Reporter.h Server.hpp Settings.hpp SocketAddr.h Thread.h Timestamp.hpp config.win32.h delay.h gettimeofday.h gnu_getopt.h headers.h inet_aton.h service.h snprintf.h util.h version.h histogram.h isochronous.hpp pdfs.h checksums.h payloads.h gettcpinfo.h dscp.h iperf_formattime.h
+EXTRA_DIST = Client.hpp Condition.h Extractor.h active_hosts.h packet_ring.h Listener.hpp Locale.h Makefile.am Mutex.h PerfSocket.hpp Reporter.h Server.hpp Settings.hpp SocketAddr.h Thread.h Timestamp.hpp config.win32.h delay.h gettimeofday.h gnu_getopt.h headers.h inet_aton.h service.h snprintf.h util.h version.h histogram.h isochronous.hpp pdfs.h checksums.h payloads.h gettcpinfo.h dscp.h iperf_formattime.h iperf_multicast_api.h
DISTCLEANFILES = $(top_builddir)/include/iperf-int.h
diff --git a/include/Makefile.in b/include/Makefile.in
index ae4ef10..d920143 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -133,6 +133,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
@@ -143,6 +145,7 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
@@ -234,7 +237,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-EXTRA_DIST = Client.hpp Condition.h Extractor.h active_hosts.h packet_ring.h Listener.hpp Locale.h Makefile.am Mutex.h PerfSocket.hpp Reporter.h Server.hpp Settings.hpp SocketAddr.h Thread.h Timestamp.hpp config.win32.h delay.h gettimeofday.h gnu_getopt.h headers.h inet_aton.h service.h snprintf.h util.h version.h histogram.h isochronous.hpp pdfs.h checksums.h payloads.h gettcpinfo.h dscp.h iperf_formattime.h
+EXTRA_DIST = Client.hpp Condition.h Extractor.h active_hosts.h packet_ring.h Listener.hpp Locale.h Makefile.am Mutex.h PerfSocket.hpp Reporter.h Server.hpp Settings.hpp SocketAddr.h Thread.h Timestamp.hpp config.win32.h delay.h gettimeofday.h gnu_getopt.h headers.h inet_aton.h service.h snprintf.h util.h version.h histogram.h isochronous.hpp pdfs.h checksums.h payloads.h gettcpinfo.h dscp.h iperf_formattime.h iperf_multicast_api.h
DISTCLEANFILES = $(top_builddir)/include/iperf-int.h
all: all-am
@@ -274,7 +277,6 @@ ctags CTAGS:
cscope cscopelist:
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/include/PerfSocket.hpp b/include/PerfSocket.hpp
index 0214c08..2686013 100644
--- a/include/PerfSocket.hpp
+++ b/include/PerfSocket.hpp
@@ -67,6 +67,8 @@ void SetSocketOptions(struct thread_Settings *inSettings);
void SetSocketOptionsSendTimeout(struct thread_Settings *mSettings, int timer);
void SetSocketOptionsReceiveTimeout(struct thread_Settings *mSettings, int timer);
void SetSocketOptionsIPTos (struct thread_Settings *mSettings, int tos);
+void SetSocketTcpTxDelay (struct thread_Settings *mSettings, int delay);
+void SetSocketBindToDeviceIfNeeded (struct thread_Settings *inSettings);
void setsock_tcp_mss(int inSock, int inMSS);
int getsock_tcp_mss(int inSock);
#ifdef DEFAULT_PAYLOAD_LEN_PER_MTU_DISCOVERY
diff --git a/include/Reporter.h b/include/Reporter.h
index 6f97418..bb7ec6f 100644
--- a/include/Reporter.h
+++ b/include/Reporter.h
@@ -58,6 +58,7 @@
#include "histogram.h"
#include "packet_ring.h"
#include "gettcpinfo.h"
+#include "payloads.h"
// forward declarations found in Settings.hpp
struct thread_Settings;
@@ -108,10 +109,24 @@ struct MeanMinMaxStats {
intmax_t err;
};
+struct ShiftIntCounter {
+ intmax_t current;
+ intmax_t prev;
+};
+
+struct ShiftUintCounter {
+ uintmax_t current;
+ uintmax_t prev;
+};
+
#define TCPREADBINCOUNT 8
struct ReadStats {
- intmax_t cntRead;
- intmax_t totcntRead;
+ uintmax_t cntRead;
+ uintmax_t cntReadTimeo;
+ uintmax_t cntReadErrLen;
+ struct ShiftUintCounter ReadCnt;
+ struct ShiftUintCounter ReadTimeoCnt;
+ struct ShiftUintCounter ReadErrLenCnt;
int bins[TCPREADBINCOUNT];
int totbins[TCPREADBINCOUNT];
int binsize;
@@ -120,9 +135,10 @@ struct ReadStats {
struct WriteStats {
intmax_t WriteCnt;
intmax_t WriteErr;
+ intmax_t WriteTimeo;
intmax_t totWriteCnt;
intmax_t totWriteErr;
- intmax_t totWriteWarn;
+ intmax_t totWriteTimeo;
struct iperf_tcpstats tcpstats;
};
@@ -134,13 +150,6 @@ struct WriteStats {
#define L2LENERR 0x02
#define L2CSUMERR 0x04
-enum WriteErrType {
- WriteNoErr = 0,
- WriteErrAccount,
- WriteErrFatal,
- WriteErrNoAccount
-};
-
struct L2Stats {
intmax_t cnt;
intmax_t unknown;
@@ -165,7 +174,8 @@ enum ReportType {
SUM_REPORT,
SETTINGS_REPORT,
CONNECTION_REPORT,
- SERVER_RELAY_REPORT
+ SERVER_RELAY_REPORT,
+ STRING_REPORT
};
enum ReportSubType {
@@ -174,6 +184,11 @@ enum ReportSubType {
TOTALSUM_REPORT
};
+enum TansferIDType {
+ REVERSED = 1,
+ NORMAL
+};
+
union SendReadStats {
struct ReadStats read;
struct WriteStats write;
@@ -186,10 +201,12 @@ struct ReportCommon {
enum ThreadMode ThreadMode;
enum ReportMode ReportMode;
bool KeyCheck;
+ bool Omit;
int flags;
int flags_extend;
int flags_extend2;
int threads;
+ int working_load_threads;
unsigned short Port;
unsigned short PortLast;
unsigned short BindPort;
@@ -212,6 +229,7 @@ struct ReportCommon {
#endif
int winsize_requested;
unsigned int FQPacingRate;
+ int FQPacingRateStep;
int HistBins;
int HistBinsize;
int HistUnits;
@@ -220,6 +238,8 @@ struct ReportCommon {
Socklen_t size_peer;
iperf_sockaddr local;
Socklen_t size_local;
+ iperf_sockaddr multicast_group;
+ Socklen_t size_multicast_group;
char* Host; // -c
char* HideHost;
char* Localhost; // -B
@@ -227,13 +247,16 @@ struct ReportCommon {
char* Ifrnametx;
char* SSMMulticastStr;
char* Congestion;
+ char* LoadCCA;
char* transferIDStr;
char* PermitKey;
int transferID;
+ int peertransferID;
double rtt_weight;
double ListenerTimeout;
double FPS;
int bbsize;
+ int bbreplysize;
int bbhold;
int bbcount;
int jitter_binwidth;
@@ -256,16 +279,7 @@ struct ConnectionInfo {
char peerversion[PEERVERBUFSIZE];
struct MeanMinMaxStats connect_times;
struct iperf_tcpstats tcpinitstats;
-};
-
-struct ShiftIntCounter {
- intmax_t current;
- intmax_t prev;
-};
-
-struct ShiftUintCounter {
- uintmax_t current;
- uintmax_t prev;
+ char connected_cca[TCP_CCA_NAME_MAX];
};
struct ShiftCounters {
@@ -323,6 +337,7 @@ struct ReportTimeStamps {
struct timeval packetTime;
struct timeval prevpacketTime;
struct timeval prevsendTime;
+ struct timeval prevTime;
struct timeval nextTime;
struct timeval intervalTime;
struct timeval IPGstart;
@@ -333,8 +348,13 @@ struct TransferInfo {
struct ReportCommon *common;
struct ReportTimeStamps ts;
void (*output_handler) (struct TransferInfo *stats);
+ struct SumReport *sumreport;
+ enum ReportType type;
+ enum edgeLevel uplevel;
+ enum edgeLevel downlevel;
int groupID;
- int threadcnt;
+ int slot_thread_upcount; // increments on a thread's first sample into a report interval
+ int slot_thread_downcount; // increments on a thread's interval sum output
bool isMaskOutput;
uintmax_t cntBytes;
intmax_t cntError;
@@ -354,10 +374,13 @@ struct TransferInfo {
struct histogram *framelatency_histogram;
struct RunningMMMStats frame; // isochronous frame or msg burst
struct histogram *bbrtt_histogram;
+ struct histogram *bbowdto_histogram;
+ struct histogram *bbowdfro_histogram;
struct RunningMMMStats bbrtt;
struct RunningMMMStats bbowdto;
struct RunningMMMStats bbowdfro;
struct RunningMMMStats bbasym;
+ uintmax_t bb_clocksync_error;
struct MeanMinMaxStats schedule_error;
struct L2Stats l2counts;
// Packet and frame state info
@@ -375,16 +398,18 @@ struct TransferInfo {
double fInP;
double iInPVar;
double fInPVar;
+ intmax_t FQPacingRateCurrent;
+ int threadcnt_final;
};
struct SumReport {
struct ReferenceMutex reference;
int threads;
- int threads_cntr_fsum;
+ int final_thread_upcount;
struct TransferInfo info;
- void (*transfer_protocol_sum_handler) (struct TransferInfo *stats, int final);
+ void (*transfer_protocol_sum_handler) (struct TransferInfo *stats, bool final);
struct BarrierMutex fullduplex_barrier;
- int sum_fd_set;
+ bool sum_fd_set;
bool sum_reverse_set;
};
@@ -392,8 +417,8 @@ struct ReporterData {
// function pointer for per packet processing
void (*packet_handler_pre_report) (struct ReporterData *data, struct ReportStruct *packet);
void (*packet_handler_post_report) (struct ReporterData *data, struct ReportStruct *packet);
- void (*transfer_protocol_handler) (struct ReporterData *data, int final);
- int (*transfer_interval_handler) (struct ReporterData *data, struct ReportStruct *packet);
+ void (*transfer_protocol_handler) (struct ReporterData *data, bool final);
+ bool (*transfer_interval_handler) (struct ReporterData *data, struct ReportStruct *packet);
struct PacketRing *packetring;
int reporter_thread_suspends; // used to detect CPU bound systems
@@ -425,15 +450,16 @@ typedef void (* report_statistics)( struct TransferInfo* );
typedef void (* report_serverstatistics)( struct ConnectionInfo *, struct TransferInfo* );
void SetSumHandlers (struct thread_Settings *inSettings, struct SumReport* sumreport);
-struct SumReport* InitSumReport(struct thread_Settings *inSettings, int inID, int fullduplex);
+struct SumReport* InitSumReport(struct thread_Settings *inSettings, int inID, bool fullduplex);
struct ReportHeader* InitIndividualReport(struct thread_Settings *inSettings);
struct ReportHeader* InitConnectionReport(struct thread_Settings *inSettings);
struct ConnectionInfo* InitConnectOnlyReport(struct thread_Settings *thread);
struct ReportHeader *InitSettingsReport(struct thread_Settings *inSettings);
struct ReportHeader* InitServerRelayUDPReport(struct thread_Settings *inSettings, struct server_hdr *server);
+struct ReportHeader* InitStringReport (char *textoutput);
void PostReport(struct ReportHeader *reporthdr);
bool ReportPacket (struct ReporterData* data, struct ReportStruct *packet);
-int EndJob(struct ReportHeader *reporthdr, struct ReportStruct *packet);
+bool EndJob(struct ReportHeader *reporthdr, struct ReportStruct *packet);
void FreeReport(struct ReportHeader *reporthdr);
void FreeSumReport (struct SumReport *sumreport);
void FreeConnectionReport(struct ConnectionInfo *reporthdr);
@@ -469,34 +495,34 @@ void reporter_handle_packet_bb_server(struct ReporterData *data, struct ReportSt
// Invoked from the Reporter thread per function vector this_ireport->transfer_interval_handler
// This is set during Report instantiation (found in Reports.c)
// These conditionally, e.g per a sample interval, invoke the transfer protocol handlers
-int reporter_condprint_time_interval_report(struct ReporterData *data, struct ReportStruct *packet);
-int reporter_condprint_frame_interval_report_client_udp(struct ReporterData *data, struct ReportStruct *packet);
-int reporter_condprint_frame_interval_report_server_udp(struct ReporterData *data, struct ReportStruct *packet);
-int reporter_condprint_frame_interval_report_server_tcp(struct ReporterData *data, struct ReportStruct *packet);
-int reporter_condprint_frame_interval_report_client_tcp(struct ReporterData *data, struct ReportStruct *packet);
-int reporter_condprint_burst_interval_report_client_udp(struct ReporterData *data, struct ReportStruct *packet);
-int reporter_condprint_burst_interval_report_server_udp(struct ReporterData *data, struct ReportStruct *packet);
-int reporter_condprint_burst_interval_report_server_tcp(struct ReporterData *data, struct ReportStruct *packet);
-int reporter_condprint_burst_interval_report_client_tcp(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_time_interval_report(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_frame_interval_report_client_udp(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_frame_interval_report_server_udp(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_frame_interval_report_server_tcp(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_frame_interval_report_client_tcp(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_burst_interval_report_client_udp(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_burst_interval_report_server_udp(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_burst_interval_report_server_tcp(struct ReporterData *data, struct ReportStruct *packet);
+bool reporter_condprint_burst_interval_report_client_tcp(struct ReporterData *data, struct ReportStruct *packet);
// Each report type needs specialized updating prior to printing its report
// These functions realize that updating. They are called by the transfer protocol handler,
// e.g. (*data->transfer_protocol_handler)(data, 0) found in src/Reporter.c
// These update the TransferInfo stats struct which is used during output (e.g. the output handler)
-void reporter_transfer_protocol_null(struct ReporterData *data, int final);
-void reporter_transfer_protocol_client_tcp(struct ReporterData *data, int final);
-void reporter_transfer_protocol_client_bb_tcp(struct ReporterData *data, int final);
-void reporter_transfer_protocol_client_udp(struct ReporterData *data, int final);
-void reporter_transfer_protocol_server_tcp(struct ReporterData *data, int final);
-void reporter_transfer_protocol_server_bb_tcp(struct ReporterData *data, int final);
-void reporter_transfer_protocol_server_udp(struct ReporterData *data, int final);
+void reporter_transfer_protocol_null(struct ReporterData *data, bool final);
+void reporter_transfer_protocol_client_tcp(struct ReporterData *data, bool final);
+void reporter_transfer_protocol_client_bb_tcp(struct ReporterData *data, bool final);
+void reporter_transfer_protocol_client_udp(struct ReporterData *data, bool final);
+void reporter_transfer_protocol_server_tcp(struct ReporterData *data, bool final);
+void reporter_transfer_protocol_server_bb_tcp(struct ReporterData *data, bool final);
+void reporter_transfer_protocol_server_udp(struct ReporterData *data, bool final);
// Function vectors to suppport sum reports
-void reporter_transfer_protocol_sum_client_tcp(struct TransferInfo *stats, int final);
-void reporter_transfer_protocol_sum_server_tcp(struct TransferInfo *stats, int final);
-void reporter_transfer_protocol_sum_client_udp(struct TransferInfo *stats, int final);
-void reporter_transfer_protocol_sum_server_udp(struct TransferInfo *stats, int final);
-void reporter_transfer_protocol_fullduplex_tcp(struct TransferInfo *stats, int final);
-void reporter_transfer_protocol_fullduplex_udp(struct TransferInfo *stats, int final);
+void reporter_transfer_protocol_sum_client_tcp(struct TransferInfo *stats, bool final);
+void reporter_transfer_protocol_sum_server_tcp(struct TransferInfo *stats, bool final);
+void reporter_transfer_protocol_sum_client_udp(struct TransferInfo *stats, bool final);
+void reporter_transfer_protocol_sum_server_udp(struct TransferInfo *stats, bool final);
+void reporter_transfer_protocol_fullduplex_tcp(struct TransferInfo *stats, bool final);
+void reporter_transfer_protocol_fullduplex_udp(struct TransferInfo *stats, bool final);
// Report output print routines invoked by the transfer_protocol handler
// Bound in Report instantiation and invoked by the transfer protocol
@@ -520,6 +546,7 @@ void tcp_output_burst_write(struct TransferInfo *stats);
void tcp_output_sum_write(struct TransferInfo *stats);
void tcp_output_sumcnt_write(struct TransferInfo *stats);
void tcp_output_write_enhanced (struct TransferInfo *stats);
+void tcp_output_write_enhanced_fq (struct TransferInfo *stats);
void tcp_output_write_enhanced_isoch (struct TransferInfo *stats);
void tcp_output_sum_write_enhanced (struct TransferInfo *stats);
void tcp_output_sumcnt_write_enhanced (struct TransferInfo *stats);
@@ -559,6 +586,7 @@ void udp_output_enhanced_csv(struct TransferInfo *stats);
void tcp_output_basic_csv(struct TransferInfo *stats);
void tcp_output_read_enhanced_csv(struct TransferInfo *stats);
void tcp_output_write_enhanced_csv(struct TransferInfo *stats);
+void tcp_output_write_bb_csv (struct TransferInfo *stats);
// The report output routines that are simpler and aren't related to stats
void reporter_print_connection_report(struct ConnectionInfo *report);
@@ -571,10 +599,11 @@ void reporter_connect_printf_tcp_final(struct ConnectionInfo *report);
void write_UDP_AckFIN(struct TransferInfo *stats, int len);
-int reporter_process_transfer_report (struct ReporterData *this_ireport);
-int reporter_process_report (struct ReportHeader *reporthdr);
+bool reporter_process_transfer_report (struct ReporterData *this_ireport);
+bool reporter_process_report (struct ReportHeader *reporthdr);
-void setTransferID(struct thread_Settings *inSettings, int role_reversal);
+void setTransferID(struct thread_Settings *inSettings, enum TansferIDType traffic_direction);
+void updateTransferIDPeer(struct thread_Settings *inSettings);
void format_ips_port_string (struct TransferInfo *stats, bool sum);
#ifdef __cplusplus
diff --git a/include/Server.hpp b/include/Server.hpp
index cca386a..ee38c3c 100644
--- a/include/Server.hpp
+++ b/include/Server.hpp
@@ -95,6 +95,7 @@ private:
int SkipFirstPayload(void);
void ClientReverseFirstRead(void);
void PostNullEvent(void);
+ inline bool WriteBB(void);
Timestamp connect_done;
bool peerclose;
bool isburst;
@@ -116,6 +117,9 @@ private:
struct msghdr message;
char ctrl[CMSG_SPACE(sizeof(struct timeval))];
struct cmsghdr *cmsg;
+#if HAVE_DECL_MSG_CTRUNC
+ bool ctrunc_warn_enable;
+#endif
#endif
#if defined(HAVE_LINUX_FILTER_H) && defined(HAVE_AF_PACKET)
struct ether_header *eth_hdr;
diff --git a/include/Settings.hpp b/include/Settings.hpp
index 250d3a7..6d87012 100644
--- a/include/Settings.hpp
+++ b/include/Settings.hpp
@@ -77,7 +77,7 @@ extern "C" {
#define SMALLEST_INTERVAL_SEC 0.005 // 5ms
#else
#define SMALLEST_INTERVAL 100 // 100 usec
-#define SMALLEST_INTERVAL_SEC 0.0001 // 5ms
+#define SMALLEST_INTERVAL_SEC 0.0001
#endif
#define SLOPSECS 2
@@ -94,14 +94,14 @@ extern "C" {
#define CSVPEERLIMIT ((REPORT_ADDRLEN * 2) + 40)
#define NEARCONGEST_DEFAULT 0.5
#define DEFAULT_PERMITKEY_LIFE 20.0 // units is seconds
-#define TESTEXCHANGETIMEOUT (4 * 1000000) // 4 secs, units is microseconds
+#define DEFAULT_TESTEXCHANGETIMEOUT (60 * 1000000) // 60 secs, units is microseconds
#ifndef MAXTTL
#define MAXTTL 255
#endif
#define DEFAULT_BOUNCEBACK_BYTES 100
#define SMALL_WRITE_PREFETCH (1024 * 16)
-#define SHALLOW_COPY 1
+#define SHALLOW_COPY 1 // This is likley a bug, using a deep copy is safer but overkill
#define DEEP_COPY 1
// server/client mode
enum ThreadMode {
@@ -178,11 +178,12 @@ struct thread_Settings {
struct thread_Settings *runNow;
struct thread_Settings *runNext;
// int's
+ int sosndtimer;
int mThreads; // -P
int mTOS; // -S
int mRTOS; // reflected TOS
int mTransferID;
- int mConnectRetries;
+ int mPeerTransferID;
#if WIN32
SOCKET mSock;
#else
@@ -246,12 +247,16 @@ struct thread_Settings {
Socklen_t size_peer;
iperf_sockaddr local;
Socklen_t size_local;
+ iperf_sockaddr multicast_group;
+ Socklen_t size_multicast_group;
+ iperf_sockaddr multicast_group_source;
nthread_t mTID;
int incrdstip;
int incrsrcip;
int incrsrcport;
int connectonly_count;
char* mCongestion;
+ char* mLoadCCA;
int mHistBins;
int mHistBinsize;
int mHistUnits;
@@ -270,6 +275,11 @@ struct thread_Settings {
int recvflags; // used to set recv flags,e.g. MSG_TRUNC with L
double mVariance; //vbr variance
uintmax_t mFQPacingRate;
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ int mFQPacingRateStep;
+ uintmax_t mFQPacingRateCurrent;
+ double mFQPacingRateStepInterval;
+#endif
struct timeval txholdback_timer;
struct timeval txstart_epoch;
struct timeval accept_time;
@@ -280,7 +290,7 @@ struct thread_Settings {
int numreportstructs;
int32_t peer_version_u;
int32_t peer_version_l;
- double connecttime;
+ long barrier_time; // wait in units of microseconds
double rtt_nearcongest_weight_factor;
char mPermitKey[MAX_PERMITKEY_LEN + 1]; //add some space for timestamp
struct timeval mPermitKeyTime;
@@ -289,6 +299,7 @@ struct thread_Settings {
int tuntapdev;
int firstreadbytes;
int mBounceBackBytes;
+ int mBounceBackReplyBytes;
int mBounceBackBurst;
int mWorkingLoadThreads; // number of congest threads
uint32_t mBounceBackHold; // units of usecs
@@ -300,6 +311,15 @@ struct thread_Settings {
int mWritePrefetch;
#endif
int jitter_binwidth;
+#if HAVE_DECL_TCP_TX_DELAY
+ float mTcpTxDelayMean;
+ float mTcpTxDelayProb;
+#endif
+ bool mOmit;
+ int sendfirst_pacing;
+ double connecttime;
+ double connect_retry_time; // units in seconds
+ unsigned int connect_retry_timer; // units in usecs
};
/*
@@ -398,6 +418,14 @@ struct thread_Settings {
#define FLAG_DOMAINV4 0x00008000
#define FLAG_JITTER_HISTOGRAM 0x00010000
#define FLAG_UTC 0x00020000
+#define FLAG_LOAD_CCA 0x00040000
+#define FLAG_BURSTSIZE 0x00080000
+#define FLAG_TCPTXDELAY 0x00100000
+#define FLAG_FQPACINGSTEP 0x00200000
+#define FLAG_FQPACINGSTEPINTERVAL 0x00400000
+#define FLAG_SYNCTRANSFERID 0x00800000
+#define FLAG_IGNORESHUTDOWN 0x01000000
+#define FLAG_SETTOS 0x02000000
#define isBuflenSet(settings) ((settings->flags & FLAG_BUFLENSET) != 0)
#define isCompat(settings) ((settings->flags & FLAG_COMPAT) != 0)
@@ -476,6 +504,14 @@ struct thread_Settings {
#define isWorkingLoadDown(settings) ((settings->flags_extend2 & FLAG_WORKING_LOAD_DOWN) != 0)
#define isJitterHistogram(settings) ((settings->flags_extend2 & FLAG_JITTER_HISTOGRAM) != 0)
#define isUTC(settings) ((settings->flags_extend2 & FLAG_UTC) != 0)
+#define isLoadCCA(settings) ((settings->flags_extend2 & FLAG_LOAD_CCA) != 0)
+#define isBurstSize(settings) ((settings->flags_extend2 & FLAG_BURSTSIZE) != 0)
+#define isTcpTxDelay(settings) ((settings->flags_extend2 & FLAG_TCPTXDELAY) != 0)
+#define isFQPacingStep(settings) ((settings->flags_extend2 & FLAG_FQPACINGSTEP) != 0)
+#define isFQPacingStepInterval(settings) ((settings->flags_extend2 & FLAG_FQPACINGSTEPINTERVAL) != 0)
+#define isSyncTransferID(settings) ((settings->flags_extend2 & FLAG_SYNCTRANSFERID) != 0)
+#define isIgnoreShutdown(settings) ((settings->flags_extend2 & FLAG_IGNORESHUTDOWN) != 0)
+#define isSetTOS(settings) ((settings->flags_extend2 & FLAG_SETTOS) != 0)
#define setBuflenSet(settings) settings->flags |= FLAG_BUFLENSET
#define setCompat(settings) settings->flags |= FLAG_COMPAT
@@ -551,6 +587,14 @@ struct thread_Settings {
#define setWorkingLoadDown(settings) settings->flags_extend2 |= FLAG_WORKING_LOAD_DOWN
#define setJitterHistogram(settings) settings->flags_extend2 |= FLAG_JITTER_HISTOGRAM
#define setUTC(settings) settings->flags_extend2 |= FLAG_UTC
+#define setLoadCCA(settings) settings->flags_extend2 |= FLAG_LOAD_CCA
+#define setBurstSize(settings) settings->flags_extend2 |= FLAG_BURSTSIZE
+#define setTcpTxDelay(settings) settings->flags_extend2 |= FLAG_TCPTXDELAY
+#define setFQPacingStep(settings) settings->flags_extend2 |= FLAG_FQPACINGSTEP
+#define setFQPacingStepInterval(settings) settings->flags_extend2 |= FLAG_FQPACINGSTEPINTERVAL
+#define setSyncTransferID(settings) settings->flags_extend2 |= FLAG_SYNCTRANSFERID
+#define setIgnoreShutdown(settings) settings->flags_extend2 |= FLAG_IGNORESHUTDOWN
+#define setSetTOS(settings) settings->flags_extend2 |= FLAG_SETTOS
#define unsetBuflenSet(settings) settings->flags &= ~FLAG_BUFLENSET
#define unsetCompat(settings) settings->flags &= ~FLAG_COMPAT
@@ -625,6 +669,14 @@ struct thread_Settings {
#define unsetWorkingLoadDown(settings) settings->flags_extend2 &= ~FLAG_WORKING_LOAD_DOWN
#define unsetJitterHistogram(settings) settings->flags_extend2 &= ~FLAG_JITTER_HISTOGRAM
#define unsetUTC(settings) settings->flags_extend2 &= ~FLAG_UTC
+#define unsetLoadCCA(settings) settings->flags_extend2 &= ~FLAG_LOAD_CCA
+#define unsetBurstSize(settings) settings->flags_extend2 &= ~FLAG_BURSTSIZE
+#define unsetTcpTxDelay(settings) settings->flags_extend2 &= ~FLAG_TCPTXDELAY
+#define unsetFQPacingStep(settings) settings->flags_extend2 &= ~FLAG_FQPACINGSTEP
+#define unsetFQPacingStepInterval(settings) settings->flags_extend2 &= ~FLAG_FQPACINGSTEPINTERVAL
+#define unsetSyncTransferID(settings) settings->flags_extend2 &= ~FLAG_SYNCTRANSFERID
+#define unsetIgnoreShutdown(settings) settings->flags_extend2 &= ~FLAG_IGNORESHUTDOWN
+#define unsetSetTOS(settings) settings->flags_extend2 &= ~FLAG_SETTOS
// set to defaults
void Settings_Initialize(struct thread_Settings* main);
@@ -632,6 +684,9 @@ void Settings_Initialize(struct thread_Settings* main);
// copy structure
void Settings_Copy(struct thread_Settings* from, struct thread_Settings** into, int copyall);
+// grow mBuf
+void Settings_Grow_mBuf(struct thread_Settings *mSettings, int newsize);
+
// free associated memory
void Settings_Destroy(struct thread_Settings *mSettings);
diff --git a/include/SocketAddr.h b/include/SocketAddr.h
index be391a8..c18c059 100644
--- a/include/SocketAddr.h
+++ b/include/SocketAddr.h
@@ -60,11 +60,13 @@
extern "C" {
#endif
/* ------------------------------------------------------------------- */
+int SockAddr_getAFdomain(iperf_sockaddr *inSockAddr);
void SockAddr_localAddr(struct thread_Settings *inSettings);
void SockAddr_remoteAddr(struct thread_Settings *inSettings);
void SockAddr_setHostname(const char* inHostname,
iperf_sockaddr *inSockAddr,
+ Socklen_t *addr_size,
int isIPv6); // DNS lookup
void SockAddr_getHostname(iperf_sockaddr *inSockAddr,
char* outHostname,
diff --git a/include/Timestamp.hpp b/include/Timestamp.hpp
index e0c9f29..044a145 100644
--- a/include/Timestamp.hpp
+++ b/include/Timestamp.hpp
@@ -83,7 +83,7 @@ public:
/* -------------------------------------------------------------------
* Create a timestamp, with the given seconds/microseconds
* ------------------------------------------------------------------- */
- Timestamp(long sec, long usec) {
+ Timestamp(time_t sec, long usec) {
set(sec, usec);
}
@@ -111,7 +111,7 @@ public:
/* -------------------------------------------------------------------
* Set timestamp to the given seconds/microseconds
* ------------------------------------------------------------------- */
- void set(long sec, long usec) {
+ void set(time_t sec, long usec) {
assert(sec >= 0);
assert(usec >= 0 && usec < kMillion);
@@ -123,14 +123,14 @@ public:
* Set timestamp to the given seconds
* ------------------------------------------------------------------- */
void set(double sec) {
- mTime.tv_sec = (long) sec;
+ mTime.tv_sec = (time_t) sec;
mTime.tv_usec = (long) ((sec - mTime.tv_sec) * kMillion);
}
/* -------------------------------------------------------------------
* return seconds portion of timestamp
* ------------------------------------------------------------------- */
- long inline getSecs(void) {
+ time_t inline getSecs(void) {
return mTime.tv_sec;
}
@@ -240,8 +240,8 @@ public:
* TODO optimize?
* ------------------------------------------------------------------- */
void add(double sec) {
- mTime.tv_sec += (long) sec;
- mTime.tv_usec += (long) ((sec - ((long) sec)) * kMillion);
+ mTime.tv_sec += (time_t) sec;
+ mTime.tv_usec += (long) ((sec - ((time_t) sec)) * kMillion);
// watch for overflow
if (mTime.tv_usec >= kMillion) {
diff --git a/include/active_hosts.h b/include/active_hosts.h
index 9635032..757d15c 100644
--- a/include/active_hosts.h
+++ b/include/active_hosts.h
@@ -66,8 +66,10 @@
*/
struct Iperf_ListEntry {
iperf_sockaddr host;
- struct SumReport *sum_report;
+ iperf_sockaddr multicast;
+ struct SumReport *sumreport;
int thread_count;
+ int gid;
#if WIN32
SOCKET socket;
#else
@@ -78,10 +80,13 @@ struct Iperf_ListEntry {
struct Iperf_Table {
Mutex my_mutex;
- struct Iperf_ListEntry *root;
- int count;
- int total_count;
+ struct Iperf_ListEntry *sum_root;
+ struct Iperf_ListEntry *flow_root;
int groupid;
+#if HAVE_THREAD_DEBUG
+ int sum_count;
+ int flow_count;
+#endif
};
/*
@@ -89,7 +94,6 @@ struct Iperf_Table {
*/
void Iperf_initialize_active_table (void);
void Iperf_destroy_active_table (void);
-int Iperf_push_host (struct thread_Settings *agent);
-int Iperf_push_host_port_conditional (struct thread_Settings *agent);
+bool Iperf_push_host (struct thread_Settings *agent);
void Iperf_remove_host (struct thread_Settings *agent);
#endif
diff --git a/include/dscp.h b/include/dscp.h
index fe5486e..79d779b 100644
--- a/include/dscp.h
+++ b/include/dscp.h
@@ -44,11 +44,27 @@
* by Robert J. McMahon (rjmcmahon@rjmcmahon.com, bob.mcmahon@broadcom.com)
* ------------------------------------------------------------------- */
+/*
+ * 7 6 5 4 3 2 1 0
+ * +--+--+--+--+--+--+--+--+
+ * | DSCP | ECN |
+ * +--+--+--+--+--+--+--+--+
+ *
+ */
+
#ifndef DSCP_H
#define DSCP_H
#ifdef __cplusplus
extern "C" {
#endif
+
+// DSCP bits
+#define DSCP_SHIFT 2
+#define DSCP_BITMASK 0xFC
+#define ECN_BITMASK 0x03
+#define DSCP_VALUE(value) (int)((value & DSCP_BITMASK) >> DSCP_SHIFT)
+#define ECN_VALUE(value) (int)(value & ECN_BITMASK)
+
int parse_ipqos(const char *cp);
const char * iptos2str(int iptos);
#ifdef __cplusplus
diff --git a/include/gettcpinfo.h b/include/gettcpinfo.h
index 995ee20..4eee092 100644
--- a/include/gettcpinfo.h
+++ b/include/gettcpinfo.h
@@ -50,21 +50,28 @@
#include "headers.h"
+#define HAVE_TCP_INFLIGHT (HAVE_TCP_STATS && HAVE_STRUCT_TCP_INFO_TCPI_DSACK_DUPS && \
+ HAVE_STRUCT_TCP_INFO_TCPI_LOST && HAVE_STRUCT_TCP_INFO_TCPI_SACKED \
+ && HAVE_STRUCT_TCP_INFO_TCPI_UNACKED)
+
#ifdef __cplusplus
extern "C" {
#endif
struct iperf_tcpstats {
bool isValid;
- int rtt;
+ uint32_t rtt;
double connecttime;
#if HAVE_TCP_STATS
- int cwnd;
- int rttvar;
- intmax_t retry;
- intmax_t retry_prev;
- intmax_t retry_tot;
- int mss_negotiated;
+ intmax_t cwnd;
+ uint32_t cwnd_packets;
+ uint32_t rttvar;
+ uint32_t retry;
+ uint32_t retry_prev;
+ uint32_t retry_tot;
+ uint32_t mss_negotiated;
+ uint32_t packets_in_flight;
+ intmax_t bytes_in_flight;
#endif
};
diff --git a/include/headers.h b/include/headers.h
index 6fb499d..891c46d 100644
--- a/include/headers.h
+++ b/include/headers.h
@@ -248,7 +248,9 @@ SPECIAL_OSF1_EXTERN_C_START
#include <arpa/inet.h> /* netinet/in.h must be before this on SunOS */
SPECIAL_OSF1_EXTERN_C_STOP
#endif
-#if HAVE_NETINET_TCP_H
+#if HAVE_LINUX_TCP_H && HAVE_DECL_TCP_TX_DELAY
+#include <linux/tcp.h>
+#elif HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
diff --git a/include/histogram.h b/include/histogram.h
index 2cd7b3b..4dee5f8 100644
--- a/include/histogram.h
+++ b/include/histogram.h
@@ -1,5 +1,5 @@
/*---------------------------------------------------------------
- * Copyrighta (c) 2017
+ * Copyright (c) 1999,2000,2001,2002,2003,2023
* Broadcom Corporation
* All Rights Reserved.
*---------------------------------------------------------------
@@ -54,7 +54,8 @@ struct histogram {
unsigned int bincount;
unsigned int binwidth;
unsigned int populationcnt;
- int final;
+ bool Omit;
+ bool final;
int maxbin;
int fmaxbin;
double maxval;
@@ -73,7 +74,7 @@ struct histogram {
};
extern struct histogram *histogram_init(unsigned int bincount, unsigned int binwidth, float offset,\
- float units, double ci_lower, double ci_upper, unsigned int id, char *name);
+ float units, double ci_lower, double ci_upper, unsigned int id, char *name, bool omit);
extern void histogram_delete(struct histogram *h);
extern int histogram_insert(struct histogram *h, float value, struct timeval *ts);
extern void histogram_clear(struct histogram *h);
diff --git a/include/iperf_multicast_api.h b/include/iperf_multicast_api.h
new file mode 100644
index 0000000..4844598
--- /dev/null
+++ b/include/iperf_multicast_api.h
@@ -0,0 +1,73 @@
+/*---------------------------------------------------------------
+ * Copyright (c) 2023
+ * Broadcom Corporation
+ * All Rights Reserved.
+ *---------------------------------------------------------------
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and
+ * the following disclaimers.
+ *
+ *
+ * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimers in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ *
+ * Neither the name of Broadcom Coporation,
+ * nor the names of its contributors may be used to endorse
+ * or promote products derived from this Software without
+ * specific prior written permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTIBUTORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * ________________________________________________________________
+ *
+ * multicast_join.h
+ * pull out multicast join code for maitainability
+ *
+ * by Robert J. McMahon (rjmcmahon@rjmcmahon.com, bob.mcmahon@broadcom.com)
+ * -------------------------------------------------------------------
+ */
+#ifndef MULTICASTJOIN_H
+#define MULTICASTJOIN_H
+
+#include "headers.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum McastJoinResponse {
+ IPERF_MULTICAST_JOIN_SUCCESS = 1,
+ IPERF_MULTICAST_JOIN_FAIL,
+ IPERF_MULTICAST_JOIN_UNSUPPORTED
+};
+
+#define IPERF_MULTICAST_JOIN_SUCCESS 1
+
+enum McastJoinResponse iperf_multicast_join (struct thread_Settings *inSettings);
+bool iperf_multicast_sendif_v4 (struct thread_Settings *inSettings);
+bool iperf_multicast_sendif_v6 (struct thread_Settings *inSettings);
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif
+
+#endif // MULTICASTJOIN_H
diff --git a/include/isochronous.hpp b/include/isochronous.hpp
index 7fb5a92..65609cd 100644
--- a/include/isochronous.hpp
+++ b/include/isochronous.hpp
@@ -63,7 +63,7 @@ namespace Isochronous {
unsigned int get(long *);
unsigned int get(const Timestamp&) const;
unsigned int period_us(void);
- unsigned int wait_tick(long *sched_err);
+ unsigned int wait_tick(long *sched_err, bool sync_strict);
unsigned int wait_sync(long sec, long usec);
long getSecs(void);
long getUsecs(void);
diff --git a/include/packet_ring.h b/include/packet_ring.h
index 3ac6b91..d97a64d 100644
--- a/include/packet_ring.h
+++ b/include/packet_ring.h
@@ -57,6 +57,26 @@ extern "C" {
#define ACKRING_DEFAULTSIZE 100
+enum ReadWriteExtReturnVals {
+ ReadSuccess = 1,
+ ReadTimeo,
+ ReadTimeoFatal,
+ ReadErrLen,
+ ReadNoAccount,
+ WriteSuccess,
+ WriteSelectRetry,
+ WriteErrAccount,
+ WriteErrFatal,
+ WriteTimeo,
+ WriteNoAccount,
+ NullEvent
+};
+
+enum edgeLevel {
+ LOW = 0,
+ HIGH = 1
+};
+
struct ReportStruct {
intmax_t packetID;
intmax_t packetLen;
@@ -64,8 +84,8 @@ struct ReportStruct {
struct timeval prevPacketTime;
struct timeval sentTime;
struct timeval prevSentTime;
- int errwrite;
- int emptyreport;
+ enum ReadWriteExtReturnVals err_readwrite;
+ bool emptyreport;
int l2errors;
int l2len;
int expected_l2len;
@@ -77,7 +97,7 @@ struct ReportStruct {
uint32_t burstsize;
uint32_t burstperiod;
uint32_t remaining;
- int transit_ready;
+ bool transit_ready;
int writecnt;
long write_time;
bool scheduled;
@@ -85,6 +105,9 @@ struct ReportStruct {
struct timeval sentTimeRX;
struct timeval sentTimeTX;
struct iperf_tcpstats tcpstats;
+#if defined(HAVE_DECL_SO_MAX_PACING_RATE)
+ intmax_t FQPacingRate;
+#endif
};
struct PacketRing {
@@ -94,10 +117,12 @@ struct PacketRing {
int producer;
int consumer;
int maxcount;
- int consumerdone;
+ bool consumerdone;
int awaitcounter;
- int mutex_enable;
+ bool mutex_enable;
int bytes;
+ enum edgeLevel uplevel;
+ enum edgeLevel downlevel;
// Use a condition variables
// o) awake_producer - producer waits for the consumer thread to
@@ -116,6 +141,7 @@ extern void enqueue_ackring(struct PacketRing *pr, struct ReportStruct *metapack
extern struct ReportStruct *dequeue_ackring(struct PacketRing * pr);
extern void packetring_free(struct PacketRing *pr);
extern void free_ackring(struct PacketRing *pr);
+extern enum edgeLevel toggleLevel(enum edgeLevel level);
#ifdef HAVE_THREAD_DEBUG
extern int packetring_getcount(struct PacketRing *pr);
#endif
diff --git a/include/payloads.h b/include/payloads.h
index 30080d9..d1eb59b 100644
--- a/include/payloads.h
+++ b/include/payloads.h
@@ -56,6 +56,7 @@ extern "C" {
*/
#define TAPBYTESSLOP 512
+#define TCP_CCA_NAME_MAX 32
/* key for permit */
#define HEADER_KEYCHECK 0x10000000
@@ -88,15 +89,22 @@ extern "C" {
#define RUN_NOW 0x00000001
#define HEADER16_SMALL_TRIPTIMES 0x0002 // use is 16 bits and not 32 bits
+// Num threads highest bit indicates sync id
+#define HEADER_HASTRANSFERID 0x80000000
+#define HEADER_TRANSFERIDMASK 0xFFF00000
+#define HEADER_TRANSFERIDSHIFT 20
+
// Bounceback flag
#define HEADER_BBQUICKACK 0x8000
#define HEADER_BBCLOCKSYNCED 0x4000 // used in the bb header only
#define HEADER_BBTOS 0x2000
#define HEADER_BBSTOP 0x1000
+#define HEADER_BBREPLYSIZE 0x0800
// newer flags available per HEADER_EXTEND
// Below flags are used to pass test settings in *every* UDP packet
// and not just during the header exchange
+// upper flags (16 bit)
#define HEADER_ISOCH 0x0001
#define HEADER_L2ETHPIPV6 0x0002
#define HEADER_L2LENCHECK 0x0004
@@ -114,9 +122,14 @@ extern "C" {
#define HEADER_WRITEPREFETCH 0x4000
#define HEADER_TCPQUICKACK 0x8000
+// lower flags (16 bit)
+#define HEADER_CCA 0x8000
+#define HEADER_BARRIER_TIME 0x4000
+
// later features
#define HDRXACKMAX 2500000 // default 2.5 seconds, units microseconds
#define HDRXACKMIN 10000 // default 10 ms, units microsecond
+
/*
* Structures used for test messages which
* are exchanged between the client and the Server/Listener
@@ -230,6 +243,7 @@ struct bounceback_hdr {
uint32_t bbhold; // up to here is mandatory
uint32_t bbrtt;
struct bb_ts bbread_ts;
+ uint32_t bbreplysize;
};
struct client_hdrext_isoch_settings {
@@ -255,10 +269,10 @@ struct client_hdrext {
uint32_t lRate;
uint32_t uRate;
uint32_t TCPWritePrefetch;
+ uint32_t barrier_usecs;
};
struct client_hdrext_starttime_fq {
- uint32_t reserved;
uint32_t start_tv_sec;
uint32_t start_tv_usec;
uint32_t fqratel;
@@ -440,6 +454,11 @@ struct isoch_payload {
uint32_t reserved;
};
+struct cca_field {
+ uint16_t cca_length;
+ char value[TCP_CCA_NAME_MAX];
+};
+
struct permitKey {
uint16_t length;
char value[MAX_PERMITKEY_LEN];
@@ -457,6 +476,8 @@ struct client_udp_testhdr {
struct client_udpsmall_testhdr {
struct UDP_datagram seqno_ts;
uint16_t flags;
+ uint32_t start_tv_sec;
+ uint32_t start_tv_usec;
};
struct client_hdr_ack_ts {
@@ -513,7 +534,7 @@ struct client_hdr_ack {
* +--------+--------+--------+--------+
* 15 | write prefetch (0.13) |
* +--------+--------+--------+--------+
- * 16 | reserved (0.14 start) |
+ * 16 | barrier wait (usecs) |
* +--------+--------+--------+--------+
* 17 | start tv_sec (0.14) |
* +--------+--------+--------+--------+
@@ -539,12 +560,15 @@ struct client_hdr_ack {
* +--------+--------+--------+--------+
* 28 | BurstIPG |
* +--------+--------+--------+--------+
+ * 29 | CCAS len value ...
+ * +--------+--------+--------+--------+
*/
struct client_tcp_testhdr {
struct client_hdr_v1 base;
struct client_hdrext extend;
struct client_hdrext_starttime_fq start_fq;
struct client_hdrext_isoch_settings isoch_settings;
+ struct cca_field cca;
struct permitKey permitkey;
};
@@ -614,7 +638,7 @@ struct server_hdr {
#define SIZEOF_TCPHDRMSG_V1 (sizeof(struct client_hdr_v1))
#define SIZEOF_TCPHDRMSG_EXT (sizeof(struct client_tcp_testhdr))
#define MINMBUFALLOCSIZE (int) (sizeof(struct client_tcp_testhdr)) + TAPBYTESSLOP
-#define MINTRIPTIMEPLAYOAD (int) (sizeof(struct client_udp_testhdr) - sizeof(struct client_hdrext_isoch_settings))
+#define MINTRIPTIMEPAYLOAD (int) (sizeof(struct client_udp_testhdr) - sizeof(struct client_hdrext_isoch_settings))
#ifdef __cplusplus
} /* end extern "C" */
#endif
diff --git a/include/util.h b/include/util.h
index 0f28ce4..db0e66f 100644
--- a/include/util.h
+++ b/include/util.h
@@ -63,6 +63,8 @@ extern "C" {
extern int sInterupted;
+#define WARNBUFSIZE 256
+
/* -------------------------------------------------------------------
* set/getsockopt wrappers for SO_RCVBUF and SO_SNDBUF; TCP_MAXSEG
* socket.c
@@ -119,6 +121,7 @@ BOOL WINAPI sig_dispatcher(DWORD type);
* ------------------------------------------------------------------- */
void warn (const char *inMessage, const char *inFile, int inLine);
void warn_errno(const char *inMessage, const char *inFile, int inLine);
+int errno_decode (char *decoded_text, size_t len);
#define FAIL_exit(cond, msg) \
do { \
@@ -192,12 +195,27 @@ double bitorbyte_atof(const char *inString);
intmax_t byte_atoi(const char *inString);
uintmax_t bitorbyte_atoi(const char *inString);
void byte_snprintf(char* outString, int inLen, double inNum, char inFormat);
-
+void make_lower(char *s);
/*
* Time macros for C-code (not the include Timestamp.hpp)
*/
#define rMillion 1000000
+
+#ifdef HAVE_CLOCK_GETTIME
+#define TimeGetNow(timeval) do { \
+ struct timespec t1; \
+ clock_gettime(CLOCK_REALTIME, &t1); \
+ timeval.tv_sec = t1.tv_sec; \
+ timeval.tv_usec = t1.tv_nsec / 1000; \
+} while (0)
+#else
+#define TimeGetNow(timeval) do { \
+ gettimeofday(&timeval, NULL); \
+} while (0)
+#endif
+
+
#define TimeZero(timeval) ((timeval.tv_sec == 0) && (timeval.tv_usec == 0))
#define TimeDifference(left, right) ((left.tv_sec - right.tv_sec) + \
@@ -217,6 +235,16 @@ void byte_snprintf(char* outString, int inLen, double inNum, char inFormat);
left.tv_sec += right.tv_sec; \
} while (0)
+#define TimeAddIntUsec(left, right) do { \
+ left.tv_usec += right % 1000000; \
+ if (left.tv_usec > rMillion) { \
+ left.tv_usec -= rMillion; \
+ left.tv_sec++; \
+ } \
+ left.tv_sec += right / 1000000; \
+ } while (0)
+
+
/* -------------------------------------------------------------------
* redirect the stdout to a specified file
* stdio.c
@@ -260,6 +288,8 @@ void redirect(const char *inOutputFileName);
#define NONFATALTCPWRITERR(errno) ((errno = WSAGetLastError()) == WSAETIMEDOUT)
#define FATALUDPWRITERR(errno) (((errno = WSAGetLastError()) != WSAETIMEDOUT) \
&& (errno != WSAECONNREFUSED))
+#define FATALTCPCONNECTERR(errno) (((errno = WSAGetLastError()) != WSAETIMEDOUT) && \
+ (errno != WSAECONNREFUSED) && (errno != WSAEWOULDBLOCK))
#else
#define FATALTCPREADERR(errno) ((errno != EAGAIN) && (errno != EWOULDBLOCK) && (errno != EINTR))
#define FATALUDPREADERR(errno) ((errno != EAGAIN) && (errno != EWOULDBLOCK) && \
@@ -268,11 +298,11 @@ void redirect(const char *inOutputFileName);
#define NONFATALTCPWRITERR(errno) (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)
#define FATALUDPWRITERR(errno) ((errno != EAGAIN) && (errno != EWOULDBLOCK) && (errno != EINTR) \
&& (errno != ECONNREFUSED) && (errno != ENOBUFS))
+#define FATALTCPCONNECTERR(errno) ((errno != EAGAIN) && (errno != EWOULDBLOCK) && (errno != EINTR) \
+ && (errno != ECONNREFUSED))
#endif
-#ifdef WIN32
-#else
-#endif
+#define IPERF_SOCKET_ERROR_NONFATAL -2
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/include/version.h b/include/version.h
index d28d4b0..261d3e0 100644
--- a/include/version.h
+++ b/include/version.h
@@ -1,8 +1,9 @@
#include "config.h"
#define IPERF_VERSION VERSION
-#define IPERF_VERSION_DATE "14 March 2023"
-#define IPERF_VERSION_MAJORHEX 0x00020001
-#define IPERF_VERSION_MINORHEX 0x00090003
+#define IPERF_VERSION_DATE "10 April 2024"
+#define IPERF_VERSION_MAJORHEX 0x00020002
+#define IPERF_VERSION_MINORHEX 0x00000003
+#define IPERF_BRANCH ""
/*
* case 0:
diff --git a/man/Makefile.in b/man/Makefile.in
index 51e1fe5..7481bb4 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -164,6 +164,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
@@ -174,6 +176,7 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
@@ -347,7 +350,6 @@ ctags CTAGS:
cscope cscopelist:
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
diff --git a/man/iperf.1 b/man/iperf.1
index 8ca1343..b867354 100644
--- a/man/iperf.1
+++ b/man/iperf.1
@@ -1,4 +1,4 @@
-.TH IPERF 1 "February 2023" NLANR/DAST "User Manuals"
+.TH IPERF 1 "March 2024" NLANR/DAST "User Manuals"
.SH NAME
iperf \- perform network traffic tests using network sockets. Metrics include throughput and latency or link capacity and responsiveness.
.SH SYNOPSIS
@@ -30,7 +30,7 @@ computers but need not be.
.TP
.BR -b ", " --bandwidth " "
set the target bandwidth and optional standard deviation per
-\fI<mean>\fR,\fI[<stdev>]\fR (See NOTES for suffixes)
+\fI<mean>\fR,\fI[<stdev>]\fR (See NOTES for suffixes) Setting the target bitrate on the client to 0 will disable bitrate limits (particularly useful for UDP tests). Will limit the read rate on the server.
.TP
.BR -e ", " --enhanced " "
Display enhanced output in reports otherwise use legacy report (ver
@@ -65,7 +65,7 @@ Override the default shared memory size between the traffic thread(s) and report
output the report or error message to this specified file
.TP
.BR " --permit-key [=" \fI<value>\fR "]"
-Set a key value that must match for the server to accept traffic on a connection. If the option is given without a value on the server a key value will be autogenerated and displayed in its initial settings report. The lifetime of the key is set using --permit-key-timeout and defaults to twenty seconds. The value is required on clients. The value will also be used as part of the transfer id in reports. The option set on the client but not the server will also cause the server to reject the client's traffic. TCP only, no UDP support.
+Set a key value that must match for the server to accept traffic on a connection. If the option is given without a value on the server a key value will be autogenerated and displayed in its initial settings report. The lifetime of the key is set using --permit-key-timeout and defaults to twenty seconds. The value on clients required the use of '=', e.g. --permit-key=password (even though it's required command line option.) The server will auto-generate a value if '=password' is not given. The value will also be used as part of the transfer id in reports. The option set on the client but not the server will also cause the server to reject the client's traffic. TCP only, no UDP support.
.TP
.BR -p ", " --port " \fIm\fR[-\fIn\fR]"
set client or server port(s) to send or listen on per \fIm\fR (default 5001) w/optional port range per m-n (e.g. -p 6002-6008) (see NOTES)
@@ -76,6 +76,9 @@ sum traffic threads based upon the destination IP address (default is source ip
.BR " --sum-only "
set the output to sum reports only. Useful for -P at large values
.TP
+.BR " --tcp-tx-delay " \fIn\fR,\fI[<prob>]\fR
+Set TCP_TX_DELAY on the socket. Delay units are milliseconds and probability is prob >= 0 and prob <= 1. Values takes float. See Notes for qdisc requirements.
+.TP
.BR -t ", " --time " \fIn\fR"
time in seconds to listen for new traffic connections, receive traffic or send traffic
.TP
@@ -112,8 +115,14 @@ exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
.BR -y ", " --reportstyle " C|c"
if set to C or c report results as CSV (comma separated values)
.TP
+.BR " --tcp-cca "
+Set the congestion control algorithm to be used for TCP connections. See SPECIFIC OPTIONS for more
+.TP
+.BR " --working-load-cca "
+Set the congestion control algorithm to be used for TCP working loads. See SPECIFIC OPTIONS for more
+.TP
.BR -Z ", " --tcp-congestion " "
-Set the default congestion-control algorithm to be used for new connections. Platforms must support setsockopt's TCP_CONGESTION. (Notes: See sysctl and tcp_allowed_congestion_control for available options. May require root privileges.)
+Set the default congestion control algorithm to be used for new connections. Platforms must support setsockopt's TCP_CONGESTION. (Notes: See sysctl and tcp_allowed_congestion_control for available options. May require root privileges.)
.SH "SERVER SPECIFIC OPTIONS"
.TP
.BR -1 ", " --singleclient " "
@@ -143,6 +152,9 @@ Set the receive interface to the TAP device as specified.
.BR " --tcp-rx-window-clamp " \fIn\fR[kmKM]
Set the socket option of TCP_WINDOW_CLAMP, units is bytes.
.TP
+.BR " --test-exchange-timeout " \fI<value>\fR
+Set the maximum wait time for a test excahnge in seconds. Defaults to 60 seconds if not set. A value of zero will disable the timeout.
+.TP
.BR -t ", " --time " \fIn\fR"
time in seconds to listen for new traffic connections and/or receive traffic (defaults to infinite)
.TP
@@ -170,6 +182,15 @@ run in single threaded UDP mode
.TP
.BR -V ", " --ipv6_domain " "
Enable IPv6 reception by setting the domain and socket to AF_INET6 (Can receive on both IPv4 and IPv6)
+.TP
+.BR " --tcp-cca "
+Set the congestion control algorithm to be used for TCP connections - will overide any client side settings (same as --tcp-congestion)
+.TP
+.BR " --working-load "
+Enable support for TCP working loads on UDP traffic streams
+.TP
+.BR " --working-load-cca "
+Set the congestion control algorithm to be used for TCP working loads - will overide any client side settings
.SH "CLIENT SPECIFIC OPTIONS"
.TP
.BR -b ", " --bandwidth " \fIn\fR[kmgKMG][,\fIn\fR[kmgKMG]] | \fIn\fR\fR[kmgKMG]pps"
@@ -177,16 +198,22 @@ set target bandwidth to \fIn\fR bits/sec (default 1 Mbit/sec) or
\fIn\fR packets per sec. This may be used with TCP or UDP. Optionally, for variable loads, use format of mean,standard deviation
.TP
.BR " --bounceback[=" \fIn\fR "]"
-run a TCP bounceback or rps test with optional number writes in a burst per value of n. The default is ten writes every period and the default period is one second (Note: set size with -l or --len which defaults to 100 bytes)
+run a TCP bounceback or rps test with optional number writes in a burst per value of n. The default is ten writes every period and the default period is one second (Note: set size with --bounceback-request). See NOTES on clock unsynchronized detections.
.TP
.BR " --bounceback-hold " \fIn\fR
request the server to insert a delay of n milliseconds between its read and write (default is no delay)
.TP
+.BR " --bounceback-no-quickack "
+request the server not set the TCP_QUICKACK socket option (disabling TCP ACK delays) during a bounceback test (see NOTES)
+.TP
.BR " --bounceback-period[=" \fIn\fR "]"
request the client schedule its send(s) every n seconds (default is one second, use zero value for immediate or continuous back to back)
.TP
-.BR " --bounceback-no-quickack "
-request the server not set the TCP_QUICKACK socket option (disabling TCP ACK delays) during a bounceback test (see NOTES)
+.BR " --bounceback-request " \fIn\fR
+set the bounceback request size in units bytes. Default value is 100 bytes.
+.TP
+.BR " --bounceback-reply " \fIn\fR
+set the bounceback reply size in units bytes. This supports asymmetric message sizes between the request and the reply. Default value is zero, which uses the value of --bounceback-request.
.TP
.BR " --bounceback-txdelay " \fIn\fR
request the client to delay n seconds between the start of the working load and the bounceback traffic (default is no delay)
@@ -196,28 +223,45 @@ Set the burst period in seconds. Defaults to one second. (Note: assumed use case
.TP
.BR " --burst-size " \fIn\fR
Set the burst size in bytes. Defaults to 1M if no value is given.
+.TP
.BR -c ", " --client " \fI\fIhost\fR | \fIhost\fR%\fIdevice\fR"
run in client mode, connecting to \fIhost\fR where the optional %dev will SO_BINDTODEVICE that output interface (requires root and see NOTES)
.TP
-.TP
.BR " --connect-only[=" \fIn\fR "]"
only perform a TCP connect (or 3WHS) without any data transfer, useful to measure TCP connect() times. Optional value of n is the total number of connects to do (zero is run forever.) Note that -i will rate limit the connects where -P will create bursts and -t will end the client and hence end its connect attempts.
.TP
-.BR " --connect-retries[= " \fIn\fR "]"
-number of times to retry a TCP connect at the application level. See operating system information on the details of TCP connect related settings.
+.BR " --connect-retry-time " \fIn\fR
+time value in seconds for application level retries of TCP connect(s). See --connect-retry-timer for the retry time interval. See operating system information for the details of system or kernel TCP connect related settings. This is an application level retry of the connect() call and not the system level connect.
+.TP
+.TP
+.BR " --connect-retry-timer " \fIn\fR
+The minimum time value in seconds to wait before retrying the connect. Note: This a minimum time to wait between retries and can be longer dependent upon the system connect time taken. See operating system information for the details of system or kernel TCP connect related settings.
+.TP
+.BR " --dscp"
+set the DSCP field (masking ECN bits) in the TOS byte (used by IP_TOS & setsockopt)
+.TP
.TP
.BR -d ", " --dualtest " "
Do a bidirectional test simultaneous test using two unidirectional sockets
.TP
-.BR " --fq-rate n[kmgKMG]"
+.BR " --fq-rate \fIn\fR[kmgKMG]"
Set a rate to be used with fair-queuing based socket-level pacing, in bytes or bits per second. Only available on platforms supporting the SO_MAX_PACING_RATE socket option. (Note: Here the suffixes indicate bytes/sec or bits/sec per use of uppercase or lowercase, respectively)
.TP
+.BR " --fq-rate-step \fIn\fR[kmgKMG]"
+Set a step of rate to be used with fair-queuing based socket-level pacing, in bytes or bits per second. Step occurs every fq-rate-step-interval (defaults to one second)
+.TP
+.BR " --fq-rate-step-interval \fIn\fR"
+Time in seconds before stepping the fq-rate
+.TP
.BR " --full-duplex"
run a full duplex test, i.e. traffic in both transmit and receive directions using the \fBsame socket\fR
.TP
.BR " --histograms[="\fIbinwidth\fR[u],\fIbincount\fR,[\fIlowerci\fR],[\fIupperci\fR] "]"
enable select()/write() histograms with --tcp-write-times or --bounceback (these options are mutually exclusive.) The binning can be modified. Bin widths (default 100 microseconds, append u for microseconds, m for milliseconds) bincount is total bins (default 10000), ci is confidence interval between 0-100% (default lower 5%, upper 95%, 3 stdev 99.7%)
.TP
+.BR " --ignore-shutdown"
+don't wait on the TCP shutdown or close (fin & finack) rather use the final write as the ending event
+.TP
.BR " --incr-dstip"
increment the destination ip address when using the parallel (-P) or port range option
.TP
@@ -258,10 +302,16 @@ number of bytes to transmit (instead of -t)
.BR " --permit-key [=" \fI<value>\fR "]"
Set a key value that must match the server's value (also set with --permit-key) in order for the server to accept traffic from the client. TCP only, no UDP support.
.TP
+.BR " --sync-transfer-id"
+Pass the clients' transfer id(s) to the server so both will use the same id in their respective outputs
+.TP
.BR -r ", " --tradeoff " "
Do a bidirectional test individually - client-to-server, followed by
a reversed test, server-to-client
.TP
+.BR " --tcp-cca "
+Set the congestion control algorithm to be used for TCP connections & exchange with the server (same as --tcp-congestion)
+.TP
.BR " --tcp-quickack "
Set TCP_QUICKACK on the socket
.TP
@@ -310,6 +360,9 @@ time-to-live, for multicast (default 1)
.BR " --working-load[="\fBup|down|bidir][\fR,\fIn\fR\fB]\fR
request a concurrent working load, currently TCP stream(s), defaults to full duplex (or bidir) unless the \fBup\fR or \fBdown\fR option is provided. The number of TCP streams defaults to 1 and can be changed via the n value, e.g. \fB--working-load=down,4\fR will use four TCP streams from server to the client as the working load. The IP ToS will be BE (0x0) for working load traffic.
.TP
+.BR " --working-load-cca "
+Set the congestion control algorithm to be used for TCP working loads, exchange with the server
+.TP
.BR -V ", " --ipv6_domain " "
Set the domain to IPv6 (send packets over IPv6)
.TP
@@ -321,44 +374,50 @@ set TCP congestion control algorithm (Linux only)
.SH EXAMPLES
.B TCP tests (client)
-
.B iperf -c <host> -e -i 1
.br
------------------------------------------------------------
.br
-Client connecting to <host>, TCP port 5001 with pid 5149
+Client connecting to 192.168.1.35, TCP port 5001 with pid 256370 (1/0 flows/load)
+.br
+Write buffer size: 131072 Byte
.br
-Write buffer size: 128 KByte
+TCP congestion control using cubic
.br
-TCP window size: 340 KByte (default)
+TOS set to 0x0 (dscp=0,ecn=0) (Nagle on)
+.br
+TCP window size: 100 MByte (default)
.br
------------------------------------------------------------
.br
-[ 3] local 45.56.85.133 port 49960 connected with 45.33.58.123 port 5001 (ct=3.23 ms)
+[ 1] local 192.168.1.103%enp4s0 port 41024 connected with 192.168.1.35 port 5001 (sock=3) (icwnd/mss/irtt=14/1448/158) (ct=0.21 ms) on 2024-03-26 10:48:47.867 (PDT)
.br
-[ ID] Interval Transfer Bandwidth Write/Err Rtry Cwnd/RTT NetPwr
+[ ID] Interval Transfer Bandwidth Write/Err Rtry InF(pkts)/Cwnd(pkts)/RTT(var) NetPwr
+.br
+[ 1] 0.00-1.00 sec 201 MBytes 1.68 Gbits/sec 1605/0 73 1531K(1083)/1566K(1108)/13336(112) us 15775
.br
-[ 3] 0.00-1.00 sec 126 MBytes 1.05 Gbits/sec 1006/0 0 56K/626 us 210636.47
+[ 1] 1.00-2.00 sec 101 MBytes 846 Mbits/sec 807/0 0 1670K(1181)/1689K(1195)/14429(83) us 7331
.br
-[ 3] 1.00-2.00 sec 138 MBytes 1.15 Gbits/sec 1100/0 299 483K/3884 us 37121.32
+[ 1] 2.00-3.00 sec 101 MBytes 847 Mbits/sec 808/0 0 1790K(1266)/1790K(1266)/15325(97) us 6911
.br
-[ 3] 2.00-3.00 sec 137 MBytes 1.15 Gbits/sec 1093/0 24 657K/5087 us 28162.31
+[ 1] 3.00-4.00 sec 134 MBytes 1.13 Gbits/sec 1075/0 0 1858K(1314)/1892K(1338)/16188(99) us 8704
.br
-[ 3] 3.00-4.00 sec 126 MBytes 1.06 Gbits/sec 1010/0 284 294K/2528 us 52366.58
+[ 1] 4.00-5.00 sec 101 MBytes 846 Mbits/sec 807/0 1 1350K(955)/1370K(969)/11620(98) us 9103
.br
-[ 3] 4.00-5.00 sec 117 MBytes 980 Mbits/sec 935/0 373 487K/2025 us 60519.66
+[ 1] 5.00-6.00 sec 121 MBytes 1.01 Gbits/sec 966/0 0 1422K(1006)/1453K(1028)/12405(118) us 10207
.br
-[ 3] 5.00-6.00 sec 144 MBytes 1.20 Gbits/sec 1149/0 2 644K/3570 us 42185.36
+[ 1] 6.00-7.00 sec 115 MBytes 962 Mbits/sec 917/0 0 1534K(1085)/1537K(1087)/13135(105) us 9151
.br
-[ 3] 6.00-7.00 sec 126 MBytes 1.06 Gbits/sec 1011/0 112 582K/5281 us 25092.56
+[ 1] 7.00-8.00 sec 101 MBytes 844 Mbits/sec 805/0 0 1532K(1084)/1580K(1118)/13582(136) us 7769
.br
-[ 3] 7.00-8.00 sec 110 MBytes 922 Mbits/sec 879/0 56 279K/1957 us 58871.89
+[ 1] 8.00-9.00 sec 134 MBytes 1.13 Gbits/sec 1076/0 0 1603K(1134)/1619K(1145)/13858(105) us 10177
.br
-[ 3] 8.00-9.00 sec 127 MBytes 1.06 Gbits/sec 1014/0 46 483K/3372 us 39414.89
+[ 1] 9.00-10.00 sec 101 MBytes 846 Mbits/sec 807/0 0 1602K(1133)/1650K(1167)/14113(105) us 7495
.br
-[ 3] 9.00-10.00 sec 132 MBytes 1.11 Gbits/sec 1054/0 0 654K/3380 us 40872.75
+[ 1] 10.00-10.78 sec 128 KBytes 1.34 Mbits/sec 1/0 0 0K(0)/1681K(1189)/14424(111) us 11.64
+.br
+[ 1] 0.00-10.78 sec 1.18 GBytes 941 Mbits/sec 9674/0 74 0K(0)/1681K(1189)/14424(111) us 8154
.br
-[ 3] 0.00-10.00 sec 1.25 GBytes 1.07 Gbits/sec 10251/0 1196 -1K/3170 us 42382.03
.TP
.B where (per -e,)
@@ -371,15 +430,15 @@ Total number of successful socket writes. Total number of non-fatal socket write
.B Rtry
Total number of TCP retries
.br
-.B Cwnd/RTT (*nix only)
-TCP congestion window and round trip time (sampled where NA indicates no value)
+.B Inf(pkts)/Cwnd/RTT(var) (*nix only)
+TCP byes and packets inflight, congestion window and round trip time (sampled where NA indicates no value). Infight is in units of Kbytes and packets where packets_in_flight = (tcp_info_buf.tcpi_unacked - tcp_info_buf.tcpi_sacked - tcp_info_buf.tcpi_lost + tcp_info_buf.tcpi_retrans) RTT (var) is RTT variance.
.br
.B NetPwr (*nix only)
Network power defined as (throughput / RTT)
.PP
-
-.B iperf -c host.doamin.com -i 1 --bounceback --permit-key=mytest --hide-ips
+.TP
+.B iperf -c host.domain.com -i 1 --bounceback --permit-key=mytest --hide-ips
.br
------------------------------------------------------------
.br
@@ -830,6 +889,7 @@ The --trip-times option indicates that the client's and server's clocks are sync
Network Time Protocol (NTP) or Precision Time Protocol (PTP) are commonly used for
this. The reference clock(s) error and the synchronization protocols will affect
the accuracy of any end to end latency measurements.
+.B See bounceback NOTES section on clock unsynchronized detections
.P
.B Histograms and non-parametric statistics:
The --histograms option provides the raw data where nothing is averaged. This is useful for non-parametric
@@ -938,6 +998,18 @@ is set to a non-zero value. The socket option is applied after every read() on t
and before the hold delay call. It's also applied on the client. Use --bounceback-no-quickack
to have TCP run in default mode per the socket (which is most likely TCP_QUICKACK being off.)
.P
+.B Unsynchronized clock detections with --bounceback and --trip-times (as of March 19, 2023):
+Iperf 2 can detect when the clocks have synchronization errors larger than the bounceback RTT. This is done via the client's send timestamp (clock A),
+the server's recieve timestamp (clock B) and the client's final receive timestamp (clock A.) The check, done on each bounceback, is
+write(A) < read(B) < read(A). This is supported in bounceback tests with
+a slight adjustment: clock write(A) < clock read(B) < clock read(A) - (clock write(B) - clock read(B)). All the
+timestamps are sampled on the initial write or read (not the completion of.)
+Error output looks as shown below and there is no output for a zero value.
+
+.br
+[ 1] 0.00-10.00 sec Clock sync error count = 100
+.br
+.P
.B TCP Connect times:
The TCP connect time (or three way handshake) can be seen on the iperf
client when the -e (--enhanced) option is set. Look for the
@@ -978,6 +1050,27 @@ Iperf 2 supports multicast with a couple of caveats. First, multicast streams ca
.B TCP_QUICKACK:
The TCP_QUICKACK socket option will be applied after every read() on the server such that TCP acks are sent immediately, rather than possibly delayed.
.P
+.B TCP_TX_DELAY (--tcp-tx-delay):
+Iperf 2 flows can set different delays, simulating real world conditions. Units is microseconds.
+This \fBrequires FQ packet scheduler\fR or a EDT-enabled NIC.
+Note that FQ packet scheduler limits might need some tweaking
+ man tc-fq
+ PARAMETERS
+ limit
+ Hard limit on the real queue size. When this limit is
+ reached, new packets are dropped. If the value is lowered,
+ packets are dropped so that the new limit is met. Default
+ is 10000 packets.
+
+ flow_limit
+ Hard limit on the maximum number of packets queued per
+ flow. Default value is 100.
+
+Use of TCP_TX_DELAY option will increase number of skbs in FQ qdisc,
+so packets would be dropped if any of the previous limit is hit.
+Using big delays might very well trigger
+old bugs in TSO auto defer logic and/or sndbuf limited detection.
+.P
.B Fast Sampling:
Use
.B ./configure --enable-fastsampling
diff --git a/src/Client.cpp b/src/Client.cpp
index 89e47e2..d56ee1c 100644
--- a/src/Client.cpp
+++ b/src/Client.cpp
@@ -67,6 +67,7 @@
#include "payloads.h"
#include "active_hosts.h"
#include "gettcpinfo.h"
+#include "iperf_formattime.h"
// const double kSecs_to_usecs = 1e6;
const double kSecs_to_nsecs = 1e9;
@@ -74,6 +75,7 @@ const int kBytes_to_Bits = 8;
#define VARYLOAD_PERIOD 0.1 // recompute the variable load every n seconds
#define MAXUDPBUF 1470
+#define TCPDELAYDEFAULTQUANTUM 4000 // units usecs
Client::Client (thread_Settings *inSettings) {
#ifdef HAVE_THREAD_DEBUG
@@ -136,13 +138,7 @@ Client::~Client () {
void Client::mySockInit (void) {
// create an internet socket
int type = (isUDP(mSettings) ? SOCK_DGRAM : SOCK_STREAM);
- int domain = (SockAddr_isIPv6(&mSettings->peer) ?
-#if HAVE_IPV6
- AF_INET6
-#else
- AF_INET
-#endif
- : AF_INET);
+ int domain = SockAddr_getAFdomain(&mSettings->peer);
mySocket = socket(domain, type, 0);
WARN_errno(mySocket == INVALID_SOCKET, "socket");
@@ -151,20 +147,23 @@ void Client::mySockInit (void) {
SetSocketOptions(mSettings);
SockAddr_localAddr(mSettings);
SockAddr_remoteAddr(mSettings);
- if (mSettings->mLocalhost != NULL) {
- // bind socket to local address
- int rc = bind(mySocket, reinterpret_cast<sockaddr*>(&mSettings->local),
- SockAddr_get_sizeof_sockaddr(&mSettings->local));
- WARN_errno(rc == SOCKET_ERROR, "bind");
+ // do this bind to device after IP addr name lookups per above
+ SetSocketBindToDeviceIfNeeded(mSettings);
+ if (mSettings->mLocalhost != NULL) { // bind src ip if needed
+ // bind socket to local address
+ int rc = bind(mSettings->mSock, (struct sockaddr *)(&mSettings->local), \
+ SockAddr_get_sizeof_sockaddr(&mSettings->local));
+ WARN_errno(rc == SOCKET_ERROR, "bind");
}
- mysock_init_done = true;
- if (!isUDP(mSettings) && isReport(mSettings) && isSettingsReport(mSettings)) {
+ if (isSettingsReport(mSettings)) {
struct ReportHeader *tmp = InitSettingsReport(mSettings);
assert(tmp!=NULL);
PostReport(tmp);
- setNoSettReport(mSettings);
}
+ mysock_init_done = true;
}
+
+
/* -------------------------------------------------------------------
* Setup a socket connected to a server.
* If inLocalhost is not null, bind to that address, specifying
@@ -177,29 +176,69 @@ bool Client::my_connect (bool close_on_fail) {
}
// connect socket
connected = false;
+ int connect_errno = 0;
mSettings->tcpinitstats.connecttime = -1;
if (!isUDP(mSettings)) {
- int trycnt = mSettings->mConnectRetries + 1;
- while (trycnt > 0) {
+ Timestamp end_connect_retry;
+ end_connect_retry.add(mSettings->connect_retry_time);
+ do {
connect_start.setnow();
rc = connect(mySocket, reinterpret_cast<sockaddr*>(&mSettings->peer),
SockAddr_get_sizeof_sockaddr(&mSettings->peer));
- WARN_errno((rc == SOCKET_ERROR), "tcp connect");
+ connect_done.setnow();
if (rc == SOCKET_ERROR) {
- if ((--trycnt) <= 0) {
- if (close_on_fail) {
- close(mySocket);
- mySocket = INVALID_SOCKET;
- }
- } else {
- delay_loop(200000);
+ char timestr[120];
+ char tmpaddr[200];
+ char errtext[50];
+ connect_errno = errno_decode(errtext, sizeof(errtext));
+ unsigned short port = SockAddr_getPort(&mSettings->peer);
+ SockAddr_getHostAddress(&mSettings->peer, tmpaddr, sizeof(tmpaddr));
+ struct timeval t;
+ t.tv_sec = connect_done.getSecs();
+ t.tv_usec = connect_done.getUsecs();
+ iperf_formattime(timestr, sizeof(timestr), t, isEnhanced(mSettings), isUTC(mSettings), YearThruSecTZ);
+ int slen = snprintf(NULL, 0, "%stcp connect to %s port %d failed (%s) on %s", \
+ mSettings->mTransferIDStr, tmpaddr, port, errtext, timestr);
+ char *text = (char *) calloc((slen+1), sizeof(char));
+ if (text) {
+ snprintf(text, (slen+1), "%stcp connect to %s port %d failed (%s) on %s", \
+ mSettings->mTransferIDStr, tmpaddr, port, errtext, timestr);
+ PostReport(InitStringReport(text));
+ FREE_ARRAY(text);
+ }
+ bool need_open = false;
+ if (close_on_fail || FATALTCPCONNECTERR(errno)) { // MAC OS kicks out invalid argument at times, not sure why
+ close(mySocket);
+ mySockInit();
+ delay_loop(10000); // delay the minimum of 10ms
+ need_open = true;
+ }
+ if (!need_open && connect_done.before(end_connect_retry)) {
+ int delay = mSettings->connect_retry_timer - (connect_done.subUsec(connect_start));
+ delay_loop((delay < 10000) ? 10000 : delay); // minimum of 10ms
}
} else {
- connect_done.setnow();
mSettings->tcpinitstats.connecttime = 1e3 * connect_done.subSec(connect_start);
connected = true;
break;
}
+ } while (connect_done.before(end_connect_retry));
+ if (!connected && (mSettings->connect_retry_time > 0)) {
+ char timestr[120];
+ struct timeval t;
+ t.tv_sec = end_connect_retry.getSecs();
+ t.tv_usec = end_connect_retry.getUsecs();
+ iperf_formattime(timestr, sizeof(timestr), t, isEnhanced(mSettings), isUTC(mSettings), YearThruSecTZ);
+ int len = snprintf(NULL, 0, "%stcp connect attempt timer expired on %s\n", \
+ mSettings->mTransferIDStr, timestr);
+ char *text = (char *) calloc(len+1, sizeof(char));
+ if (text) {
+ snprintf(text, len, "%stcp connect attempt timer expried on %s\n", \
+ mSettings->mTransferIDStr, timestr);
+ PostReport(InitStringReport(text));
+ FREE_ARRAY(text);
+ return false;
+ }
}
} else {
rc = connect(mySocket, reinterpret_cast<sockaddr*>(&mSettings->peer),
@@ -217,8 +256,6 @@ bool Client::my_connect (bool close_on_fail) {
}
#endif
// Set the send timeout for the very first write which has the test exchange
- int sosndtimer = TESTEXCHANGETIMEOUT; // 4 sec in usecs
- SetSocketOptionsSendTimeout(mSettings, sosndtimer);
getsockname(mySocket, reinterpret_cast<sockaddr*>(&mSettings->local), &mSettings->size_local);
getpeername(mySocket, reinterpret_cast<sockaddr*>(&mSettings->peer), &mSettings->size_peer);
SockAddr_Ifrname(mSettings);
@@ -230,12 +267,6 @@ bool Client::my_connect (bool close_on_fail) {
if (isUDP(mSettings) && !isIsochronous(mSettings) && !isIPG(mSettings)) {
mSettings->mBurstIPG = get_delay_target() / 1e3; // this is being set for the settings report only
}
- if (isReport(mSettings) && isSettingsReport(mSettings)) {
- struct ReportHeader *tmp = InitSettingsReport(mSettings);
- assert(tmp!=NULL);
- PostReport(tmp);
- setNoSettReport(mSettings);
- }
} else {
if (mySocket != INVALID_SOCKET) {
int rc = close(mySocket);
@@ -252,7 +283,7 @@ bool Client::my_connect (bool close_on_fail) {
cr->connect_timestamp.tv_usec = connect_start.getUsecs();
assert(reporthdr);
PostReport(reporthdr);
- } else {
+ } else if (!connect_errno) {
PostReport(InitConnectionReport(mSettings));
}
}
@@ -277,6 +308,10 @@ inline void Client::myReportPacket (void) {
reportstruct->packetLen = 0;
}
+inline void Client::myReportPacket (struct ReportStruct *reportptr) {
+ ReportPacket(myReport, reportptr);
+}
+
// There are multiple startup synchronizations, this code
// handles them all. The caller decides to apply them
@@ -303,8 +338,8 @@ int Client::StartSynch () {
// o Second is a holdback, a relative amount of seconds between the connect and data xfers
// check for an epoch based start time
reportstruct->packetLen = 0;
- if (!isServerReverse(mSettings)) {
- if (!isCompat(mSettings) && !isBounceBack(mSettings)) {
+ if (!isServerReverse(mSettings) && !isCompat(mSettings)) {
+ if (!isBounceBack(mSettings)) {
reportstruct->packetLen = SendFirstPayload();
// Reverse UDP tests need to retry "first sends" a few times
// before going to server or read mode
@@ -336,14 +371,18 @@ int Client::StartSynch () {
} else if (isTripTime(mSettings) || isPeriodicBurst(mSettings)) {
reportstruct->packetLen = SendFirstPayload();
}
- if (isIsochronous(mSettings) || isPeriodicBurst(mSettings)) {
+ if (isIsochronous(mSettings) || isPeriodicBurst(mSettings) || isBounceBack(mSettings)) {
Timestamp tmp;
- tmp.set(mSettings->txstart_epoch.tv_sec, mSettings->txstart_epoch.tv_usec);
- framecounter = new Isochronous::FrameCounter(mSettings->mFPS, tmp);
- // set the mbuf valid for burst period ahead of time. The same value will be set for all burst writes
- if (!isUDP(mSettings) && framecounter) {
- struct TCP_burst_payload * mBuf_burst = reinterpret_cast<struct TCP_burst_payload *>(mSettings->mBuf);
- mBuf_burst->burst_period_us = htonl(framecounter->period_us());
+ if (isTxStartTime(mSettings)) {
+ tmp.set(mSettings->txstart_epoch.tv_sec, mSettings->txstart_epoch.tv_usec);
+ }
+ if (mSettings->mFPS > 0) {
+ framecounter = new Isochronous::FrameCounter(mSettings->mFPS, tmp);
+ // set the mbuf valid for burst period ahead of time. The same value will be set for all burst writes
+ if (!isUDP(mSettings) && framecounter) {
+ struct TCP_burst_payload * mBuf_burst = reinterpret_cast<struct TCP_burst_payload *>(mSettings->mBuf);
+ mBuf_burst->burst_period_us = htonl(framecounter->period_us());
+ }
}
}
int setfullduplexflag = 0;
@@ -355,12 +394,12 @@ int Client::StartSynch () {
SetReportStartTime();
#if HAVE_TCP_STATS
if (!isUDP(mSettings)) {
- // Near congestion and peridiodic need sampling on every report packet
+ // Near congestion and periodic need sampling on every report packet
if (isNearCongest(mSettings) || isPeriodicBurst(mSettings)) {
myReport->info.isEnableTcpInfo = true;
myReport->info.ts.nextTCPSampleTime.tv_sec = 0;
myReport->info.ts.nextTCPSampleTime.tv_usec = 0;
- } else if (isEnhanced(mSettings) || isBounceBack(mSettings)) {
+ } else if (isEnhanced(mSettings) || isBounceBack(mSettings) || isFQPacing(mSettings)) {
myReport->info.isEnableTcpInfo = true;
myReport->info.ts.nextTCPSampleTime = myReport->info.ts.nextTime;
}
@@ -368,6 +407,7 @@ int Client::StartSynch () {
#endif
if (reportstruct->packetLen > 0) {
+ reportstruct->err_readwrite = WriteSuccess;
reportstruct->packetTime = myReport->info.ts.startTime;
reportstruct->sentTime = reportstruct->packetTime;
reportstruct->prevSentTime = reportstruct->packetTime;
@@ -406,6 +446,9 @@ inline void Client::SetFullDuplexReportStartTime () {
inline void Client::SetReportStartTime () {
assert(myReport!=NULL);
now.setnow();
+ if (isUDP(mSettings) && (mSettings->sendfirst_pacing > 0)) {
+ now.add(static_cast<unsigned int>(mSettings->sendfirst_pacing));
+ }
myReport->info.ts.startTime.tv_sec = now.getSecs();
myReport->info.ts.startTime.tv_usec = now.getUsecs();
myReport->info.ts.IPGstart = myReport->info.ts.startTime;
@@ -491,11 +534,27 @@ void Client::InitTrafficLoop () {
if (isPeriodicBurst(mSettings) && (mSettings->mFPS > 0.0)) {
sosndtimer = static_cast<int>(round(250000.0 / mSettings->mFPS));
} else if (mSettings->mInterval > 0) {
- sosndtimer = static_cast<int>(round(0.5 * mSettings->mInterval));
+ sosndtimer = static_cast<int>(round(((mSettings->mThreads > 1) ? 0.25 : 0.5) * mSettings->mInterval));
} else {
sosndtimer = static_cast<int>(mSettings->mAmount * 5e3);
}
- SetSocketOptionsSendTimeout(mSettings, sosndtimer);
+ // set to 1 second for wraps or too large
+ if ((sosndtimer < 0) || (sosndtimer > 1000000)) {
+ sosndtimer = 1000000;
+ }
+ if (sosndtimer < 1000) {
+ sosndtimer = 1000; //lower bound of 1 ms
+ }
+ if ((mSettings->mInterval > 0) && (mSettings->mIntervalMode == kInterval_Time)) {
+ int interval_half = static_cast<int>(round(mSettings->mAmount * 10000) / 2);
+ if (sosndtimer > interval_half) {
+ sosndtimer = interval_half;
+ }
+ }
+ if (!isUDP(mSettings)) {
+ mSettings->sosndtimer = sosndtimer;
+ SetSocketOptionsSendTimeout(mSettings, sosndtimer);
+ }
// set the lower bounds delay based of the socket timeout timer
// units needs to be in nanoseconds
delay_lower_bounds = static_cast<double>(sosndtimer) * -1e3;
@@ -510,10 +569,18 @@ void Client::InitTrafficLoop () {
mEndTime.add(mSettings->mAmount / 100.0);
// now.setnow(); fprintf(stderr, "DEBUG: end time set to %ld.%ld now is %ld.%ld\n", mEndTime.getSecs(), mEndTime.getUsecs(), now.getSecs(), now.getUsecs());
}
+#if HAVE_DECL_TCP_TX_DELAY
+ current_state = NO_DELAY;
+ if (isTcpTxDelay(mSettings)) {
+ state_tokens[NO_DELAY] = (int) (mSettings->mTcpTxDelayMean * (1 - mSettings->mTcpTxDelayProb));
+ state_tokens[ADD_DELAY] = (int) (mSettings->mTcpTxDelayMean * mSettings->mTcpTxDelayProb);
+ TcpTxDelayQuantumEnd.setnow();
+ }
+#endif
readAt = mSettings->mBuf;
lastPacketTime.set(myReport->info.ts.startTime.tv_sec, myReport->info.ts.startTime.tv_usec);
- reportstruct->errwrite=WriteNoErr;
- reportstruct->emptyreport=0;
+ reportstruct->err_readwrite=WriteSuccess;
+ reportstruct->emptyreport = false;
reportstruct->packetLen = 0;
// Finally, post this thread's "job report" which the reporter thread
// will continuously process as long as there are packets flowing
@@ -576,6 +643,48 @@ void Client::Run () {
}
}
+#if HAVE_DECL_TCP_TX_DELAY
+inline void Client::apply_txdelay_func (void) {
+ now.setnow();
+ if (isTcpTxDelay(mSettings) && TcpTxDelayQuantumEnd.before(now)) {
+ // expense the tokens for the current state
+ state_tokens[current_state] -= now.subUsec(TcpTxDelayQuantumEnd);
+ // add tokens
+ do {
+ state_tokens[NO_DELAY] += (int) (mSettings->mTcpTxDelayMean * (1 - mSettings->mTcpTxDelayProb));
+ state_tokens[ADD_DELAY] += (int) (mSettings->mTcpTxDelayMean * mSettings->mTcpTxDelayProb);
+ } while ((state_tokens[NO_DELAY] < 0) && (state_tokens[ADD_DELAY] < 0));
+ // set the next quantum end
+ while (TcpTxDelayQuantumEnd.before(now))
+ TcpTxDelayQuantumEnd.add((unsigned int) TCPDELAYDEFAULTQUANTUM);
+ // do any state change
+ if ((state_tokens[NO_DELAY] < 0) && (current_state == NO_DELAY)) {
+// printf("**** f state change to 0->1 current=%d %d %d\n", current_state, state_tokens[NO_DELAY], state_tokens[ADD_DELAY]);
+ SetSocketTcpTxDelay(mSettings, (mSettings->mTcpTxDelayMean * 1000.0));
+ current_state = ADD_DELAY;
+ } else if ((state_tokens[ADD_DELAY] < 0) && (current_state == ADD_DELAY)) {
+// printf("**** f state change to 1->0 current=%d %d %d\n", current_state, state_tokens[NO_DELAY], state_tokens[ADD_DELAY]);
+ SetSocketTcpTxDelay(mSettings, 0.0);
+ current_state = NO_DELAY;
+ } else {
+ int rval = (random() % 2);
+ // printf("**** curr=%d rval=%d tokens 0:%d 1:%d\n", current_state, rval, state_tokens[NO_DELAY], state_tokens[ADD_DELAY]);
+ if (rval != current_state) {
+ if (rval && (state_tokens[ADD_DELAY] > 0)) {
+// printf("**** state change to 0->1 rval=%d current=%d %d %d\n", rval, current_state, state_tokens[NO_DELAY], state_tokens[ADD_DELAY]);
+ SetSocketTcpTxDelay(mSettings, (mSettings->mTcpTxDelayMean * 1000.0));
+ current_state = ADD_DELAY;
+ } else if ((rval != 1) && (state_tokens[NO_DELAY] > 0)) {
+// printf("**** state change to 1->0 rval=%d current=%d %d %d\n", rval, current_state, state_tokens[NO_DELAY], state_tokens[ADD_DELAY]);
+ SetSocketTcpTxDelay(mSettings, 0.0);
+ current_state = NO_DELAY;
+ }
+ }
+ }
+ }
+}
+#endif
+
/*
* TCP send loop
*/
@@ -588,6 +697,12 @@ void Client::RunTCP () {
reportstruct->packetTime.tv_sec = now.getSecs();
reportstruct->packetTime.tv_usec = now.getUsecs();
reportstruct->write_time = 0;
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ if (isFQPacingStep(mSettings)) {
+ PacingStepTime = now;
+ PacingStepTime.add(mSettings->mFQPacingRateStepInterval);
+ }
+#endif
while (InProgress()) {
reportstruct->writecnt = 0;
reportstruct->scheduled = false;
@@ -598,7 +713,7 @@ void Client::RunTCP () {
if (isIsochronous(mSettings)) {
assert(mSettings->mMean);
burst_remaining = static_cast<int>(lognormal(mSettings->mMean,mSettings->mVariance)) / (mSettings->mFPS * 8);
- } else if (isPeriodicBurst(mSettings)){
+ } else if (isBurstSize(mSettings)){
assert(mSettings->mBurstSize);
burst_remaining = mSettings->mBurstSize;
} else {
@@ -609,7 +724,7 @@ void Client::RunTCP () {
burst_remaining = static_cast<int>(sizeof(struct TCP_burst_payload));
// apply scheduling if needed
if (framecounter) {
- burst_id = framecounter->wait_tick(&reportstruct->sched_err);
+ burst_id = framecounter->wait_tick(&reportstruct->sched_err, true);
reportstruct->scheduled = true;
if (isPeriodicBurst(mSettings)) {
// low duty cycle traffic needs special event handling
@@ -619,20 +734,17 @@ void Client::RunTCP () {
reportstruct->packetTime.tv_usec = now.getUsecs();
if (!InProgress()) {
reportstruct->packetLen = 0;
- reportstruct->emptyreport = 1;
+ reportstruct->emptyreport = true;
// wait may have crossed the termination boundry
break;
} else {
//time interval crossings may have occurred during the wait
//post a null event to cause the report to flush the packet ring
- PostNullEvent();
+ PostNullEvent(false, false);
}
}
-#if HAVE_DECL_TCP_NOTSENT_LOWAT
- if (isWritePrefetch(mSettings)) {
- AwaitWriteSelectEventTCP();
- }
-#endif
+ if (isWritePrefetch(mSettings) && !AwaitSelectWrite())
+ continue;
}
now.setnow();
reportstruct->packetTime.tv_sec = now.getSecs();
@@ -659,11 +771,8 @@ void Client::RunTCP () {
if (isTcpWriteTimes(mSettings)) {
write_start.setnow();
}
-#if HAVE_DECL_TCP_NOTSENT_LOWAT
- if (isWritePrefetch(mSettings)) {
- AwaitWriteSelectEventTCP();
- }
-#endif
+ if (isWritePrefetch(mSettings) && !AwaitSelectWrite())
+ continue;
reportstruct->packetLen = write(mySocket, mSettings->mBuf, writelen);
now.setnow();
reportstruct->writecnt++;
@@ -676,28 +785,33 @@ void Client::RunTCP () {
}
if (reportstruct->packetLen <= 0) {
if (reportstruct->packetLen == 0) {
+ reportstruct->err_readwrite=WriteErrFatal;
peerclose = true;
} else if (NONFATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrAccount;
+ reportstruct->err_readwrite=WriteErrAccount;
} else if (FATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrFatal;
- WARN_errno(1, "tcp write");
+ reportstruct->err_readwrite=WriteErrFatal;
+ now.setnow();
+ char warnbuf[WARNBUFSIZE];
+ snprintf(warnbuf, sizeof(warnbuf), "%stcp write (%ld.%ld)", mSettings->mTransferIDStr, now.getSecs(), now.getUsecs());
+ warnbuf[sizeof(warnbuf)-1] = '\0';
+ WARN(1, warnbuf);
break;
} else {
- reportstruct->errwrite=WriteErrNoAccount;
+ reportstruct->err_readwrite=WriteNoAccount;
}
reportstruct->packetLen = 0;
- reportstruct->emptyreport = 1;
+ reportstruct->emptyreport = true;
} else {
- reportstruct->emptyreport = 0;
+ reportstruct->emptyreport = false;
totLen += reportstruct->packetLen;
- reportstruct->errwrite=WriteNoErr;
+ reportstruct->err_readwrite=WriteSuccess;
if (isburst) {
burst_remaining -= reportstruct->packetLen;
if (burst_remaining > 0) {
- reportstruct->transit_ready = 0;
+ reportstruct->transit_ready = false;
} else {
- reportstruct->transit_ready = 1;
+ reportstruct->transit_ready = true;
reportstruct->prevSentTime = myReport->info.ts.prevsendTime;
}
}
@@ -711,7 +825,20 @@ void Client::RunTCP () {
}
}
if (!one_report) {
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ if (isFQPacing(mSettings))
+ reportstruct->FQPacingRate = mSettings->mFQPacingRateCurrent;
+#endif
myReportPacket();
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ if (isFQPacingStep(mSettings) && PacingStepTime.before(now)) {
+ mSettings->mFQPacingRateCurrent += mSettings->mFQPacingRateStep;
+ setsockopt(mSettings->mSock, SOL_SOCKET, SO_MAX_PACING_RATE, &mSettings->mFQPacingRateCurrent, sizeof(mSettings->mFQPacingRateCurrent));
+ PacingStepTime.add(mSettings->mFQPacingRateStepInterval);
+ socklen_t len = sizeof(reportstruct->FQPacingRate);
+ getsockopt(mSettings->mSock, SOL_SOCKET, SO_MAX_PACING_RATE, &reportstruct->FQPacingRate, &len);
+ }
+#endif
}
}
FinishTrafficActions();
@@ -761,26 +888,26 @@ void Client::RunNearCongestionTCP () {
reportstruct->packetTime.tv_usec = now.getUsecs();
reportstruct->sentTime = reportstruct->packetTime;
ReportNow:
- reportstruct->transit_ready = 0;
+ reportstruct->transit_ready = false;
if (reportstruct->packetLen < 0) {
if (NONFATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrAccount;
+ reportstruct->err_readwrite=WriteErrAccount;
} else if (FATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrFatal;
+ reportstruct->err_readwrite=WriteErrFatal;
WARN_errno(1, "tcp write");
break;
} else {
- reportstruct->errwrite=WriteErrNoAccount;
+ reportstruct->err_readwrite=WriteNoAccount;
}
reportstruct->packetLen = 0;
- reportstruct->emptyreport = 1;
+ reportstruct->emptyreport = true;
} else {
- reportstruct->emptyreport = 0;
+ reportstruct->emptyreport = false;
totLen += reportstruct->packetLen;
- reportstruct->errwrite=WriteNoErr;
+ reportstruct->err_readwrite=WriteSuccess;
burst_remaining -= reportstruct->packetLen;
if (burst_remaining <= 0) {
- reportstruct->transit_ready = 1;
+ reportstruct->transit_ready = true;
}
}
if (isModeAmount(mSettings) && !reportstruct->emptyreport) {
@@ -814,8 +941,7 @@ void Client::RunNearCongestionTCP () {
void Client::RunRateLimitedTCP () {
double tokens = 0;
Timestamp time1, time2;
- int burst_size = mSettings->mBufLen;
- int burst_remaining = 0;
+ int write_remaining = 0;
int burst_id = 1;
long var_rate = mSettings->mAppRate;
@@ -848,61 +974,79 @@ void Client::RunRateLimitedTCP () {
// perform write
int len = 0;
int len2 = 0;
- if (burst_remaining == 0) {
- burst_remaining = mSettings->mBufLen;
+
+ if (isburst && !(write_remaining > 0)) {
+ if (isWritePrefetch(mSettings) && !AwaitSelectWrite())
+ continue;
+ write_remaining = mSettings->mBufLen;
+ // check for TCP minimum payload
+ if (write_remaining < static_cast<int>(sizeof(struct TCP_burst_payload)))
+ write_remaining = static_cast<int>(sizeof(struct TCP_burst_payload));
now.setnow();
reportstruct->packetTime.tv_sec = now.getSecs();
reportstruct->packetTime.tv_usec = now.getUsecs();
reportstruct->sentTime = reportstruct->packetTime;
- WriteTcpTxHdr(reportstruct, burst_size, burst_id++);
+ WriteTcpTxHdr(reportstruct, write_remaining, burst_id++);
// perform write
- if (isTripTime(mSettings)) {
- len = writen(mySocket, mSettings->mBuf, mSettings->mBufLen, &reportstruct->writecnt);
- WARN(len != mSettings->mBufLen, "burst write failed");
- } else {
- len = writen(mySocket, mSettings->mBuf, sizeof(struct TCP_burst_payload), &reportstruct->writecnt);
- WARN(len != sizeof(struct TCP_burst_payload), "burst hdr write failed");
+ // perform write, full header must succeed
+ if (isTcpWriteTimes(mSettings)) {
+ write_start.setnow();
+ }
+ len = writen(mySocket, mSettings->mBuf, write_remaining, &reportstruct->writecnt);
+ WARN((len < static_cast<int> (sizeof(struct TCP_burst_payload))), "burst hdr write failed");
+ if (isTcpWriteTimes(mSettings)) {
+ now.setnow();
+ reportstruct->write_time = now.subUsec(write_start);
}
if (len < 0) {
len = 0;
if (NONFATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrAccount;
+ reportstruct->err_readwrite=WriteErrAccount;
} else if (FATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrFatal;
+ reportstruct->err_readwrite=WriteErrFatal;
WARN_errno(1, "write");
fatalwrite_err = 1;
break;
} else {
- reportstruct->errwrite=WriteErrNoAccount;
+ reportstruct->err_readwrite=WriteNoAccount;
}
} else {
- burst_remaining -= len;
+ write_remaining -= len;
}
// thread_debug("***write burst header %d id=%d", burst_size, (burst_id - 1));
- } else if (reportstruct->packetLen > burst_remaining) {
- reportstruct->packetLen = burst_remaining;
+ } else {
+ write_remaining = mSettings->mBufLen;
}
- if (burst_remaining > 0) {
- len2 = write(mySocket, mSettings->mBuf, reportstruct->packetLen);
+ if (write_remaining > 0) {
+ if (isTcpWriteTimes(mSettings)) {
+ write_start.setnow();
+ }
+ if (isWritePrefetch(mSettings) && !AwaitSelectWrite())
+ continue;
+ len2 = write(mySocket, mSettings->mBuf, write_remaining);
+ if (isTcpWriteTimes(mSettings)) {
+ now.setnow();
+ reportstruct->write_time = now.subUsec(write_start);
+ }
reportstruct->writecnt++;
}
if (len2 < 0) {
len2 = 0;
if (NONFATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrAccount;
+ reportstruct->err_readwrite=WriteErrAccount;
} else if (FATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrFatal;
+ reportstruct->err_readwrite=WriteErrFatal;
WARN_errno(1, "write");
fatalwrite_err = 1;
break;
} else {
- reportstruct->errwrite=WriteErrNoAccount;
+ reportstruct->err_readwrite=WriteNoAccount;
}
} else {
// Consume tokens per the transmit
tokens -= (len + len2);
- totLen += (len + len2);;
- reportstruct->errwrite=WriteNoErr;
+ totLen += (len + len2);
+ reportstruct->err_readwrite=WriteSuccess;
}
time2.setnow();
reportstruct->packetLen = len + len2;
@@ -922,51 +1066,60 @@ void Client::RunRateLimitedTCP () {
}
} else {
// Use a 4 usec delay to fill tokens
-#if HAVE_DECL_TCP_NOTSENT_LOWAT
- if (isWritePrefetch(mSettings)) {
- AwaitWriteSelectEventTCP();
- } else
-#endif
- {
- delay_loop(4);
+ delay_loop(4);
+ if (isWritePrefetch(mSettings) && !AwaitSelectWrite()) {
+ continue;
}
}
}
FinishTrafficActions();
}
+inline bool Client::AwaitSelectWrite (void) {
#if HAVE_DECL_TCP_NOTSENT_LOWAT
-inline bool Client::AwaitWriteSelectEventTCP (void) {
- int rc;
- struct timeval timeout;
- fd_set writeset;
- FD_ZERO(&writeset);
- FD_SET(mySocket, &writeset);
- if (isModeTime(mSettings)) {
- Timestamp write_event_timeout(0,0);
- if (mSettings->mInterval && (mSettings->mIntervalMode == kInterval_Time)) {
- write_event_timeout.add((double) mSettings->mInterval / 1e6 * 2.0);
+ do {
+ int rc;
+ struct timeval timeout;
+ fd_set writeset;
+ FD_ZERO(&writeset);
+ FD_SET(mySocket, &writeset);
+ if (isModeTime(mSettings)) {
+ Timestamp write_event_timeout(0,0);
+ if (mSettings->mInterval && (mSettings->mIntervalMode == kInterval_Time)) {
+ write_event_timeout.add((double) mSettings->mInterval / ((mSettings->mThreads > 1) ? 4e6 : 2e6));
+ } else {
+ write_event_timeout.add((double) mSettings->mAmount / 4e2);
+ }
+ timeout.tv_sec = write_event_timeout.getSecs();
+ timeout.tv_usec = write_event_timeout.getUsecs();
} else {
- write_event_timeout.add((double) mSettings->mAmount / 1e2 * 4.0);
+ timeout.tv_sec = 1; // longest is 1 seconds
+ timeout.tv_usec = 0;
}
- timeout.tv_sec = write_event_timeout.getSecs();
- timeout.tv_usec = write_event_timeout.getUsecs();
- } else {
- timeout.tv_sec = 10; // longest is 10 seconds
- timeout.tv_usec = 0;
- }
- if ((rc = select(mySocket + 1, NULL, &writeset, NULL, &timeout)) <= 0) {
- WARN_errno((rc < 0), "select");
-#ifdef HAVE_THREAD_DEBUG
- if (rc == 0)
- thread_debug("AwaitWrite timeout");
+ if ((rc = select(mySocket + 1, NULL, &writeset, NULL, &timeout)) <= 0) {
+ WARN_errno((rc < 0), "select");
+ if (rc <= 0)
+ PostNullEvent(false, true);
+#if HAVE_SUMMING_DEBUG
+ if (rc == 0) {
+ char warnbuf[WARNBUFSIZE];
+ snprintf(warnbuf, sizeof(warnbuf), "%sTimeout: write select", mSettings->mTransferIDStr);
+ warnbuf[sizeof(warnbuf)-1] = '\0';
+ WARN(1, warnbuf);
+ }
#endif
- return false;
- }
+ } else {
+ return true;
+ }
+ } while (InProgress());
+ return false;
+#else
return true;
+#endif
}
+#if HAVE_DECL_TCP_NOTSENT_LOWAT
void Client::RunWriteEventsTCP () {
int burst_id = 0;
int writelen = mSettings->mBufLen;
@@ -975,18 +1128,28 @@ void Client::RunWriteEventsTCP () {
now.setnow();
reportstruct->packetTime.tv_sec = now.getSecs();
reportstruct->packetTime.tv_usec = now.getUsecs();
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ if (isFQPacingStep(mSettings)) {
+ PacingStepTime = now;
+ PacingStepTime.add(mSettings->mFQPacingRateStepInterval);
+ }
+#endif
while (InProgress()) {
+#if HAVE_DECL_TCP_TX_DELAY
+// apply_txdelay_func();
+#endif
if (isModeAmount(mSettings)) {
writelen = ((mSettings->mAmount < static_cast<unsigned>(mSettings->mBufLen)) ? mSettings->mAmount : mSettings->mBufLen);
}
now.setnow();
reportstruct->write_time = 0;
+ reportstruct->writecnt = 0;
if (isTcpWriteTimes(mSettings)) {
write_start = now;
}
- bool rc = AwaitWriteSelectEventTCP();
- reportstruct->emptyreport = (rc == false) ? 1 : 0;
- if (rc) {
+ if (isWritePrefetch(mSettings) && !AwaitSelectWrite())
+ continue;
+ if (!reportstruct->emptyreport) {
now.setnow();
reportstruct->packetTime.tv_sec = now.getSecs();
reportstruct->packetTime.tv_usec = now.getUsecs();
@@ -999,7 +1162,7 @@ void Client::RunWriteEventsTCP () {
peerclose = true;
}
reportstruct->packetLen = 0;
- reportstruct->emptyreport = 1;
+ reportstruct->emptyreport = true;
} else if (isTcpWriteTimes(mSettings)) {
write_end.setnow();
reportstruct->write_time = write_end.subUsec(write_start);
@@ -1014,7 +1177,20 @@ void Client::RunWriteEventsTCP () {
}
}
if (!one_report) {
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ if (isFQPacing(mSettings))
+ reportstruct->FQPacingRate = mSettings->mFQPacingRateCurrent;
+#endif
myReportPacket();
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ if (isFQPacingStep(mSettings) && PacingStepTime.before(now)) {
+ mSettings->mFQPacingRateCurrent += mSettings->mFQPacingRateStep;
+ setsockopt(mSettings->mSock, SOL_SOCKET, SO_MAX_PACING_RATE, &mSettings->mFQPacingRateCurrent, sizeof(mSettings->mFQPacingRateCurrent));
+ PacingStepTime.add(mSettings->mFQPacingRateStepInterval);
+ socklen_t len = sizeof(reportstruct->FQPacingRate);
+ getsockopt(mSettings->mSock, SOL_SOCKET, SO_MAX_PACING_RATE, &reportstruct->FQPacingRate, &len);
+ }
+#endif
}
}
FinishTrafficActions();
@@ -1022,7 +1198,7 @@ void Client::RunWriteEventsTCP () {
#endif
void Client::RunBounceBackTCP () {
int burst_id = 0;
- int writelen = mSettings->mBufLen;
+ int writelen = mSettings->mBounceBackBytes;
memset(mSettings->mBuf, 0x5A, sizeof(struct bounceback_hdr));
if (mSettings->mInterval && (mSettings->mIntervalMode == kInterval_Time)) {
int sotimer = static_cast<int>(round(mSettings->mInterval / 2.0));
@@ -1044,11 +1220,12 @@ void Client::RunBounceBackTCP () {
reportstruct->packetTime.tv_usec = now.getUsecs();
while (InProgress()) {
int n;
+ long remaining;
reportstruct->writecnt = 0;
bool isFirst;
if (framecounter) {
- burst_id = framecounter->wait_tick(&reportstruct->sched_err);
- PostNullEvent(true); // this will set the now timestamp
+ burst_id = framecounter->wait_tick(&reportstruct->sched_err, false);
+ PostNullEvent(true, false); // now is set in this call
reportstruct->sentTime.tv_sec = now.getSecs();
reportstruct->sentTime.tv_usec = now.getUsecs();
isFirst = true;
@@ -1057,7 +1234,7 @@ void Client::RunBounceBackTCP () {
isFirst = false;
}
int bb_burst = (mSettings->mBounceBackBurst > 0) ? mSettings->mBounceBackBurst : 1;
- while (bb_burst > 0) {
+ while ((bb_burst > 0) && InProgress() && (!framecounter || (framecounter->get(&remaining)) == (unsigned int) burst_id)) {
bb_burst--;
if (isFirst) {
isFirst = false;
@@ -1067,28 +1244,31 @@ void Client::RunBounceBackTCP () {
reportstruct->sentTime.tv_usec = now.getUsecs();
}
WriteTcpTxBBHdr(reportstruct, burst_id, 0);
- reportstruct->packetLen = writen(mySocket, mSettings->mBuf, writelen, &reportstruct->writecnt);
- if (reportstruct->packetLen <= 0) {
- if ((reportstruct->packetLen < 0) && FATALTCPWRITERR(errno)) {
- reportstruct->errwrite=WriteErrFatal;
+ int write_offset = 0;
+ reportstruct->writecnt = 0;
+ RETRY_WRITE:
+ n = writen(mySocket, (mSettings->mBuf + write_offset), (writelen - write_offset), &reportstruct->writecnt);
+ if (n < 0) {
+ if (FATALTCPWRITERR(errno)) {
+ reportstruct->err_readwrite=WriteErrFatal;
WARN_errno(1, "tcp bounceback write fatal error");
peerclose = true;
- } else if (reportstruct->packetLen == 0) {
- peerclose = true;
- } else if (reportstruct->packetLen != writelen) {
- WARN_errno(1, "tcp bounceback writen incomplete");
- peerclose = true;
- } else {
- // retry the write
- bb_burst++;
- continue;
+ break;
+ } else if (InProgress()) {
+ PostNullEvent(false,false);
+ goto RETRY_WRITE;
}
- break;
}
- if (reportstruct->packetLen == writelen) {
- reportstruct->emptyreport = 0;
- totLen += reportstruct->packetLen;
- reportstruct->errwrite=WriteNoErr;
+ write_offset += n;
+ if ((write_offset < writelen) && InProgress()) {
+ WARN_errno(1, "tcp bounceback writen incomplete");
+ PostNullEvent(false,false);
+ goto RETRY_WRITE;
+ }
+ if (write_offset == writelen) {
+ reportstruct->emptyreport = false;
+ totLen += writelen;
+ reportstruct->err_readwrite=WriteSuccess;
#if HAVE_DECL_TCP_QUICKACK
if (isTcpQuickAck(mSettings)) {
int opt = 1;
@@ -1098,43 +1278,50 @@ void Client::RunBounceBackTCP () {
WARN_errno(rc == SOCKET_ERROR, "setsockopt TCP_QUICKACK");
}
#endif
- if ((n = recvn(mySocket, mSettings->mBuf, mSettings->mBounceBackBytes, 0)) == mSettings->mBounceBackBytes) {
- struct bounceback_hdr *bbhdr = reinterpret_cast<struct bounceback_hdr *>(mSettings->mBuf);
- now.setnow();
- reportstruct->sentTimeRX.tv_sec = ntohl(bbhdr->bbserverRx_ts.sec);
- reportstruct->sentTimeRX.tv_usec = ntohl(bbhdr->bbserverRx_ts.usec);
- reportstruct->sentTimeTX.tv_sec = ntohl(bbhdr->bbserverTx_ts.sec);
- reportstruct->sentTimeTX.tv_usec = ntohl(bbhdr->bbserverTx_ts.usec);
- reportstruct->packetTime.tv_sec = now.getSecs();
- reportstruct->packetTime.tv_usec = now.getUsecs();
- reportstruct->packetLen += n;
- reportstruct->emptyreport = 0;
- myReportPacket();
+ int read_offset = 0;
+ RETRY_READ:
+ n = recvn(mySocket, (mSettings->mBuf + read_offset), (mSettings->mBounceBackReplyBytes - read_offset), 0);
+ if (n > 0) {
+ read_offset += n;
+ if (read_offset == mSettings->mBounceBackReplyBytes) {
+ struct bounceback_hdr *bbhdr = reinterpret_cast<struct bounceback_hdr *>(mSettings->mBuf);
+ now.setnow();
+ reportstruct->sentTimeRX.tv_sec = ntohl(bbhdr->bbserverRx_ts.sec);
+ reportstruct->sentTimeRX.tv_usec = ntohl(bbhdr->bbserverRx_ts.usec);
+ reportstruct->sentTimeTX.tv_sec = ntohl(bbhdr->bbserverTx_ts.sec);
+ reportstruct->sentTimeTX.tv_usec = ntohl(bbhdr->bbserverTx_ts.usec);
+ reportstruct->packetTime.tv_sec = now.getSecs();
+ reportstruct->packetTime.tv_usec = now.getUsecs();
+ reportstruct->packetLen += n;
+ reportstruct->emptyreport = false;
+ reportstruct->packetID = burst_id;
+ myReportPacket();
+ } else if (InProgress()) {
+ PostNullEvent(false,false);
+ goto RETRY_READ;
+ } else {
+ break;
+ }
} else if (n == 0) {
peerclose = true;
- } else if (n < 0) {
+ break;
+ } else {
if (FATALTCPREADERR(errno)) {
- WARN_errno(1, "bounceback read");
+ FAIL_errno(1, "fatal bounceback read", mSettings);
peerclose = true;
- n = 0;
+ break;
} else {
- WARN(1, "timeout: bounceback read");
+ WARN_errno(1, "timeout: bounceback read");
+ PostNullEvent(false,false);
+ if (InProgress())
+ goto RETRY_READ;
}
}
- } else if ((reportstruct->packetLen < 0 ) && NONFATALTCPWRITERR(errno)) {
- reportstruct->packetLen = 0;
- reportstruct->emptyreport = 1;
- reportstruct->errwrite=WriteErrNoAccount;
- myReportPacket();
- } else {
- reportstruct->errwrite=WriteErrFatal;
- reportstruct->packetLen = -1;
- FAIL_errno(1, "tcp bounce-back write", mSettings);
}
}
}
- WriteTcpTxBBHdr(reportstruct, 0x0, 1);
- disarm_itimer();
+ if (!peerclose)
+ WriteTcpTxBBHdr(reportstruct, 0x0, 1); // Signal end of BB test
FinishTrafficActions();
}
/*
@@ -1148,10 +1335,11 @@ double Client::get_delay_target () {
// compute delay target in units of nanoseconds
if (mSettings->mAppRateUnits == kRate_BW) {
// compute delay for bandwidth restriction, constrained to [0,1] seconds
- delay_target = (mSettings->mBufLen * ((kSecs_to_nsecs * kBytes_to_Bits)
- / mSettings->mAppRate));
+ delay_target = ((mSettings->mAppRate > 0) ? \
+ (mSettings->mBufLen * ((kSecs_to_nsecs * kBytes_to_Bits) / mSettings->mAppRate)) \
+ : 0);
} else {
- delay_target = 1e9 / mSettings->mAppRate;
+ delay_target = (mSettings->mAppRate > 0) ? (1e9 / mSettings->mAppRate) : 0;
}
}
return delay_target;
@@ -1202,53 +1390,77 @@ void Client::RunUDP () {
mBuf_UDP->tv_sec = htonl(reportstruct->packetTime.tv_sec);
mBuf_UDP->tv_usec = htonl(reportstruct->packetTime.tv_usec);
- // Adjustment for the running delay
- // o measure how long the last loop iteration took
- // o calculate the delay adjust
- // - If write succeeded, adjust = target IPG - the loop time
- // - If write failed, adjust = the loop time
- // o then adjust the overall running delay
- // Note: adjust units are nanoseconds,
- // packet timestamps are microseconds
- if (currLen > 0)
- adjust = delay_target + \
- (1000.0 * lastPacketTime.subUsec(reportstruct->packetTime));
- else
- adjust = 1000.0 * lastPacketTime.subUsec(reportstruct->packetTime);
-
- lastPacketTime.set(reportstruct->packetTime.tv_sec, reportstruct->packetTime.tv_usec);
- // Since linux nanosleep/busyloop can exceed delay
- // there are two possible equilibriums
- // 1) Try to perserve inter packet gap
- // 2) Try to perserve requested transmit rate
- // The latter seems preferred, hence use a running delay
- // that spans the life of the thread and constantly adjust.
- // A negative delay means the iperf app is behind.
- delay += adjust;
- // Don't let delay grow unbounded
- if (delay < delay_lower_bounds) {
- delay = delay_target;
- }
+ if (delay_target > 0) {
+ // Adjustment for the running delay
+ // o measure how long the last loop iteration took
+ // o calculate the delay adjust
+ // - If write succeeded, adjust = target IPG - the loop time
+ // - If write failed, adjust = the loop time
+ // o then adjust the overall running delay
+ // Note: adjust units are nanoseconds,
+ // packet timestamps are microseconds
+ if (currLen > 0)
+ adjust = delay_target + \
+ (1000.0 * lastPacketTime.subUsec(reportstruct->packetTime));
+ else
+ adjust = 1000.0 * lastPacketTime.subUsec(reportstruct->packetTime);
- reportstruct->errwrite = WriteNoErr;
- reportstruct->emptyreport = 0;
+ lastPacketTime.set(reportstruct->packetTime.tv_sec, reportstruct->packetTime.tv_usec);
+ // Since linux nanosleep/busyloop can exceed delay
+ // there are two possible equilibriums
+ // 1) Try to perserve inter packet gap
+ // 2) Try to perserve requested transmit rate
+ // The latter seems preferred, hence use a running delay
+ // that spans the life of the thread and constantly adjust.
+ // A negative delay means the iperf app is behind.
+ delay += adjust;
+ // Don't let delay grow unbounded
+ if (delay < delay_lower_bounds) {
+ delay = delay_target;
+ }
+ }
+ reportstruct->err_readwrite = WriteSuccess;
+ reportstruct->emptyreport = false;
// perform write
if (isModeAmount(mSettings)) {
currLen = write(mySocket, mSettings->mBuf, (mSettings->mAmount < static_cast<unsigned>(mSettings->mBufLen)) ? mSettings->mAmount : mSettings->mBufLen);
} else {
+ currLen = -1;
+#if (HAVE_USE_WRITE_SELECT) && (HAVE_SELECT)
+#if HAVE_DECL_MSG_DONTWAIT
+ currLen = send(mySocket, mSettings->mBuf, mSettings->mBufLen, MSG_DONTWAIT);
+ if ((currLen < 0) && !FATALUDPWRITERR(errno)) {
+ if (AwaitSelectWrite()) {
+ currLen = write(mySocket, mSettings->mBuf, mSettings->mBufLen);
+ reportstruct->err_readwrite = WriteSelectRetry;
+ } else {
+ reportstruct->err_readwrite = WriteTimeo;
+ }
+ }
+#else
+ if (AwaitSelectWrite()) {
+ currLen = write(mySocket, mSettings->mBuf, mSettings->mBufLen);
+ } else {
+ reportstruct->err_readwrite = WriteTimeo;
+ }
+#endif
+#else
currLen = write(mySocket, mSettings->mBuf, mSettings->mBufLen);
+#endif
}
if (currLen < 0) {
reportstruct->packetID--;
if (FATALUDPWRITERR(errno)) {
- reportstruct->errwrite = WriteErrFatal;
+ reportstruct->err_readwrite = WriteErrFatal;
WARN_errno(1, "write");
+ currLen = 0;
break;
} else {
- reportstruct->errwrite = WriteErrAccount;
+ //WARN_errno(1, "write n");
currLen = 0;
+ reportstruct->err_readwrite = WriteErrAccount;
}
- reportstruct->emptyreport = 1;
+ reportstruct->emptyreport = true;
}
if (isModeAmount(mSettings)) {
@@ -1310,7 +1522,7 @@ void Client::RunUDPIsochronous () {
udp_payload->isoch.burstsize = htonl(bytecnt);
udp_payload->isoch.prevframeid = htonl(frameid);
reportstruct->burstsize=bytecnt;
- frameid = framecounter->wait_tick(&reportstruct->sched_err);
+ frameid = framecounter->wait_tick(&reportstruct->sched_err, true);
reportstruct->scheduled = true;
udp_payload->isoch.frameid = htonl(frameid);
lastPacketTime.setnow();
@@ -1356,8 +1568,8 @@ void Client::RunUDPIsochronous () {
// delay = delay_target;
// }
- reportstruct->errwrite = WriteNoErr;
- reportstruct->emptyreport = 0;
+ reportstruct->err_readwrite = WriteSuccess;
+ reportstruct->emptyreport = false;
reportstruct->writecnt = 1;
// perform write
@@ -1373,21 +1585,22 @@ void Client::RunUDPIsochronous () {
if (currLen < 0) {
reportstruct->packetID--;
- reportstruct->emptyreport = 1;
- currLen = 0;
+ reportstruct->emptyreport = true;
if (FATALUDPWRITERR(errno)) {
- reportstruct->errwrite = WriteErrFatal;
+ reportstruct->err_readwrite = WriteErrFatal;
WARN_errno(1, "write");
fatalwrite_err = 1;
- } else {
- reportstruct->errwrite = WriteErrAccount;
+ currLen = 0;
+ } else {
+ currLen = 0;
+ reportstruct->err_readwrite = WriteErrAccount;
}
} else {
bytecnt -= currLen;
if (!bytecnt)
- reportstruct->transit_ready = 1;
+ reportstruct->transit_ready = true;
else
- reportstruct->transit_ready = 0;
+ reportstruct->transit_ready = false;
// adjust bytecnt so last packet of burst is greater or equal to min packet
if ((bytecnt > 0) && (bytecnt < udp_payload_minimum)) {
bytecnt = udp_payload_minimum;
@@ -1504,8 +1717,11 @@ void Client::WriteTcpTxBBHdr (struct ReportStruct *reportstruct, uint32_t bbid,
if (final) {
bbflags |= HEADER_BBSTOP;
}
+ if ((mSettings->mBounceBackReplyBytes > 0) && (mSettings->mBounceBackReplyBytes != mSettings->mBounceBackBytes)) {
+ bbflags |= HEADER_BBREPLYSIZE;
+ }
mBuf_bb->bbflags = htons(bbflags);
- mBuf_bb->bbsize = htonl(mSettings->mBufLen);
+ mBuf_bb->bbsize = htonl(mSettings->mBounceBackBytes);
mBuf_bb->bbid = htonl(bbid);
mBuf_bb->bbclientTx_ts.sec = htonl(reportstruct->packetTime.tv_sec);
mBuf_bb->bbclientTx_ts.usec = htonl(reportstruct->packetTime.tv_usec);
@@ -1514,6 +1730,7 @@ void Client::WriteTcpTxBBHdr (struct ReportStruct *reportstruct, uint32_t bbid,
mBuf_bb->bbserverTx_ts.sec = -1;
mBuf_bb->bbserverTx_ts.usec = -1;
mBuf_bb->bbhold = htonl(mSettings->mBounceBackHold);
+ mBuf_bb->bbreplysize = htonl(mSettings->mBounceBackReplyBytes);
}
inline bool Client::InProgress (void) {
@@ -1535,7 +1752,10 @@ inline void Client::tcp_shutdown (void) {
#ifdef HAVE_THREAD_DEBUG
thread_debug("Client calls shutdown() SHUTW_WR on tcp socket %d", mySocket);
#endif
- WARN_errno(rc == SOCKET_ERROR, "shutdown");
+ char warnbuf[256];
+ snprintf(warnbuf, sizeof(warnbuf), "%sshutdown", mSettings->mTransferIDStr);
+ warnbuf[sizeof(warnbuf)-1] = '\0';
+ WARN_errno(rc == SOCKET_ERROR, warnbuf);
if (!rc && !isFullDuplex(mSettings))
AwaitServerCloseEvent();
}
@@ -1557,7 +1777,9 @@ void Client::FinishTrafficActions () {
disarm_itimer();
// Shutdown the TCP socket's writes as the event for the server to end its traffic loop
if (!isUDP(mSettings)) {
- tcp_shutdown();
+ if (!isIgnoreShutdown(mSettings)) {
+ tcp_shutdown();
+ }
now.setnow();
reportstruct->packetTime.tv_sec = now.getSecs();
reportstruct->packetTime.tv_usec = now.getUsecs();
@@ -1568,6 +1790,8 @@ void Client::FinishTrafficActions () {
*
*/
reportstruct->packetLen = totLen;
+ reportstruct->err_readwrite = WriteSuccess;
+ myReportPacket();
}
} else {
// stop timing
@@ -1593,7 +1817,7 @@ void Client::FinishTrafficActions () {
}
reportstruct->packetLen = 0;
}
- int do_close = EndJob(myJob, reportstruct);
+ bool do_close = EndJob(myJob, reportstruct);
if (isIsochronous(mSettings) && (myReport->info.schedule_error.cnt > 2)) {
fprintf(stderr,"%sIsoch schedule errors (mean/min/max/stdev) = %0.3f/%0.3f/%0.3f/%0.3f ms\n",mSettings->mTransferIDStr, \
((myReport->info.schedule_error.sum / myReport->info.schedule_error.cnt) * 1e-3), (myReport->info.schedule_error.min * 1e-3), \
@@ -1632,6 +1856,7 @@ void Client::AwaitServerFinPacket () {
struct timeval timeout;
int ack_success = 0;
int count = RETRYCOUNT;
+ static int read_warn_rate_limiter = 3; // rate limit read warn msgs
while (--count >= 0) {
// wait until the socket is readable, or our timeout expires
FD_ZERO(&readSet);
@@ -1664,8 +1889,16 @@ void Client::AwaitServerFinPacket () {
continue;
}
}
-
- WARN_errno(rc < 0, "read");
+ // only warn when threads is small, too many warnings are too much outputs
+ if (rc < 0 && (--read_warn_rate_limiter > 0)) {
+ int len = snprintf(NULL, 0, "%sRead UDP fin", mSettings->mTransferIDStr);
+ char *tmpbuf = (char *)calloc(1, len + 2);
+ if (tmpbuf) {
+ len = snprintf(tmpbuf, len + 1, "%sRead UDP fin", mSettings->mTransferIDStr);
+ WARN_errno(1, tmpbuf);
+ free(tmpbuf);
+ }
+ }
if (rc > 0) {
ack_success = 1;
#ifdef HAVE_THREAD_DEBUG
@@ -1682,32 +1915,23 @@ void Client::AwaitServerFinPacket () {
fprintf(stderr, warn_no_ack, mySocket, (isModeTime(mSettings) ? 10 : 1));
}
-
-void Client::PostNullEvent (void) {
+// isFirst indicates first event occurred per wait_tick
+void Client::PostNullEvent (bool isFirst, bool select_retry) {
assert(myReport!=NULL);
// push a nonevent into the packet ring
// this will cause the reporter to process
// up to this event
- memset(reportstruct, 0, sizeof(struct ReportStruct));
+ struct ReportStruct report_nopacket;
+ memset(&report_nopacket, 0, sizeof(struct ReportStruct));
now.setnow();
- reportstruct->packetTime.tv_sec = now.getSecs();
- reportstruct->packetTime.tv_usec = now.getUsecs();
- reportstruct->emptyreport=1;
- myReportPacket();
-}
-
-void Client::PostNullEvent (bool isFirst) {
- assert(myReport!=NULL);
- // push a nonevent into the packet ring
- // this will cause the reporter to process
- // up to this event
- memset(reportstruct, 0, sizeof(struct ReportStruct));
- now.setnow();
- reportstruct->packetTime.tv_sec = now.getSecs();
- reportstruct->packetTime.tv_usec = now.getUsecs();
- reportstruct->emptyreport=1;
- reportstruct->scheduled = isFirst;
- myReportPacket();
+ report_nopacket.packetTime.tv_sec = now.getSecs();
+ report_nopacket.packetTime.tv_usec = now.getUsecs();
+ report_nopacket.emptyreport = true;
+ report_nopacket.scheduled = isFirst;
+ report_nopacket.packetID = 0;
+ report_nopacket.err_readwrite = (select_retry ? WriteSelectRetry : WriteNoAccount);
+ reportstruct->packetTime = report_nopacket.packetTime; // needed for the InProgress loop test
+ myReportPacket(&report_nopacket);
}
// The client end timer is based upon the final fin, fin-ack w/the server
@@ -1717,7 +1941,7 @@ void Client::PostNullEvent (bool isFirst) {
#define MINAWAITCLOSEUSECS 2000000
void Client::AwaitServerCloseEvent () {
// the await detection can take awhile so post a non event ahead of it
- PostNullEvent();
+ PostNullEvent(false,false);
unsigned int amount_usec = \
(isModeTime(mSettings) ? static_cast<int>(mSettings->mAmount * 10000) : MINAWAITCLOSEUSECS);
if (amount_usec < MINAWAITCLOSEUSECS)
@@ -1739,6 +1963,9 @@ void Client::AwaitServerCloseEvent () {
int Client::SendFirstPayload () {
int pktlen = 0;
if (!isConnectOnly(mSettings)) {
+ if (isUDP(mSettings) && (mSettings->sendfirst_pacing > 0)) {
+ delay_loop(mSettings->sendfirst_pacing);
+ }
if (myReport && !TimeZero(myReport->info.ts.startTime) && !(mSettings->mMode == kTest_TradeOff)) {
reportstruct->packetTime = myReport->info.ts.startTime;
} else {
@@ -1746,7 +1973,7 @@ int Client::SendFirstPayload () {
reportstruct->packetTime.tv_sec = now.getSecs();
reportstruct->packetTime.tv_usec = now.getUsecs();
}
- pattern(mSettings->mBuf, mSettings->mBufLen);
+
if (isTxStartTime(mSettings)) {
pktlen = Settings_GenerateClientHdr(mSettings, (void *) mSettings->mBuf, mSettings->txstart_epoch);
} else {
@@ -1766,6 +1993,9 @@ int Client::SendFirstPayload () {
#endif
apply_first_udppkt_delay = true;
} else {
+ // Set the send timeout for the very first write which has the test exchange
+ int sosndtimer = DEFAULT_TESTEXCHANGETIMEOUT; //in usecs
+ SetSocketOptionsSendTimeout(mSettings, sosndtimer);
#if HAVE_DECL_TCP_NODELAY
if (!isNoDelay(mSettings) && isPeerVerDetect(mSettings) && isTripTime(mSettings)) {
int optflag=1;
@@ -1781,9 +2011,19 @@ int Client::SendFirstPayload () {
#else
pktlen = send(mySocket, mSettings->mBuf, pktlen, 0);
#endif
+ SetSocketOptionsSendTimeout(mSettings, mSettings->sosndtimer);
if (isPeerVerDetect(mSettings) && !isServerReverse(mSettings)) {
PeerXchange();
}
+ if (!isFileInput(mSettings)) {
+ int buflen = (mSettings->mBufLen < (int) sizeof(struct client_tcp_testhdr)) ? mSettings->mBufLen \
+ : sizeof(struct client_tcp_testhdr);
+ if (isTripTime(mSettings)) {
+ memset(mSettings->mBuf, 0xA5, buflen);
+ } else {
+ pattern(mSettings->mBuf, buflen); // reset the pattern in the payload for future writes
+ }
+ }
#if HAVE_DECL_TCP_NODELAY
if (!isNoDelay(mSettings) && isPeerVerDetect(mSettings) && isTripTime(mSettings)) {
int optflag=0;
@@ -1833,22 +2073,15 @@ void Client::PeerXchange () {
/*
* BarrierClient allows for multiple stream clients to be syncronized
*/
-int Client::BarrierClient (struct BarrierMutex *barrier) {
- int last = 0;
+#define BARRIER_MIN 100 // units is seconds to inform the server
+bool Client::BarrierClient (struct BarrierMutex *barrier) {
+ bool last = false;
#ifdef HAVE_THREAD
assert(barrier != NULL);
+ Timestamp now;
Condition_Lock(barrier->await);
if (--barrier->count <= 0) {
- // store the barrier release timer
-#ifdef HAVE_CLOCK_GETTIME
- struct timespec t1;
- clock_gettime(CLOCK_REALTIME, &t1);
- barrier->release_time.tv_sec = t1.tv_sec;
- barrier->release_time.tv_usec = t1.tv_nsec / 1000;
-#else
- gettimeofday(&barrier->release_time, NULL);
-#endif
- last = 1;
+ last = true;
// last one wake's up everyone else
Condition_Broadcast(&barrier->await);
#ifdef HAVE_THREAD_DEBUG
@@ -1858,14 +2091,25 @@ int Client::BarrierClient (struct BarrierMutex *barrier) {
#ifdef HAVE_THREAD_DEBUG
thread_debug("Barrier WAIT on condition %p count=%d", (void *)&barrier->await, barrier->count);
#endif
- Condition_Wait(&barrier->await);
+ if (isModeTime(mSettings)) {
+ int barrier_wait_secs = int(mSettings->mAmount / 100); // convert from 10 ms to seconds
+ if (barrier_wait_secs <= 0)
+ barrier_wait_secs = 1;
+ Condition_TimedWait(&barrier->await, barrier_wait_secs);
+ } else {
+ Condition_Wait(&barrier->await);
+ }
}
Condition_Unlock(barrier->await);
#ifdef HAVE_THREAD_DEBUG
thread_debug("Barrier EXIT on condition %p", (void *)&barrier->await);
#endif
+ mSettings->barrier_time = now.delta_usec();
+ if (mSettings->barrier_time < BARRIER_MIN) {
+ mSettings->barrier_time = 0;
+ }
#else
- last = 1;
+ last = true;
#endif // HAVE_THREAD
return last;
}
diff --git a/src/Launch.cpp b/src/Launch.cpp
index 9f0c633..721f95e 100644
--- a/src/Launch.cpp
+++ b/src/Launch.cpp
@@ -167,7 +167,7 @@ void server_spawn(struct thread_Settings *thread) {
}
static void clientside_client_basic (struct thread_Settings *thread, Client *theClient) {
- setTransferID(thread, 0);
+ setTransferID(thread, NORMAL);
#ifdef HAVE_THREAD_DEBUG
if (isBounceBack(thread)) {
thread_debug("Launch: spawn client bounce-back mode, size = %d", thread->mBurstSize);
@@ -176,24 +176,12 @@ static void clientside_client_basic (struct thread_Settings *thread, Client *the
}
#endif
SockAddr_remoteAddr(thread);
- // Bounceback start delays the connect too
- if (isBounceBack(thread)) {
- if (isTxStartTime(thread)) {
- theClient->mySockInit();
- clock_usleep_abstime(&thread->txstart_epoch);
- } else if (isTxHoldback(thread)) {
- unsetTxHoldback(thread);
- theClient->mySockInit();
- clock_usleep(&thread->txholdback_timer);
- }
- }
- theClient->my_connect(true);
+ theClient->my_connect(false);
if ((thread->mThreads > 1) && !isNoConnectSync(thread) && !isCompat(thread))
// When -P > 1 then all threads finish connect before starting traffic
theClient->BarrierClient(thread->connects_done);
if (theClient->isConnected()) {
- if ((thread->mThreads > 1) || isSumOnly(thread))
- Iperf_push_host(thread);
+ Iperf_push_host(thread);
theClient->StartSynch();
theClient->Run();
}
@@ -201,9 +189,9 @@ static void clientside_client_basic (struct thread_Settings *thread, Client *the
static void clientside_client_reverse (struct thread_Settings *thread, \
struct thread_Settings *reverse_client, Client *theClient) {
- setTransferID(thread, 0);
+ setTransferID(thread, NORMAL);
SockAddr_remoteAddr(thread);
- theClient->my_connect(true);
+ theClient->my_connect(false);
#ifdef HAVE_THREAD_DEBUG
thread_debug("Launch: client spawn thread reverse (sock=%d)", thread->mSock);
#endif
@@ -212,7 +200,7 @@ static void clientside_client_reverse (struct thread_Settings *thread, \
theClient->BarrierClient(thread->connects_done);
if (theClient->isConnected()) {
FAIL((!reverse_client || !(thread->mSock > 0)), "Reverse test failed to start per thread settings or socket problem", thread);
- setTransferID(reverse_client, 1);
+ setTransferID(reverse_client, REVERSED);
theClient->StartSynch();
reverse_client->mSock = thread->mSock; // use the same socket for both directions
reverse_client->mThreadMode = kMode_Server;
@@ -220,8 +208,7 @@ static void clientside_client_reverse (struct thread_Settings *thread, \
setNoUDPfin(reverse_client); // disable the fin report - no need
reverse_client->size_local = sizeof(iperf_sockaddr);
getsockname(reverse_client->mSock, reinterpret_cast<sockaddr*>(&reverse_client->local), &reverse_client->size_local);
- if ((thread->mThreads > 1) || isSumOnly(thread))
- Iperf_push_host(reverse_client);
+ Iperf_push_host(reverse_client);
thread_start(reverse_client);
if (theClient->myJob)
FreeReport(theClient->myJob);
@@ -230,20 +217,17 @@ static void clientside_client_reverse (struct thread_Settings *thread, \
static void clientside_client_fullduplex (struct thread_Settings *thread, \
struct thread_Settings *reverse_client, Client *theClient) {
- setTransferID(thread, 0);
+ setTransferID(thread, NORMAL);
SockAddr_remoteAddr(thread);
if (!isBounceBack(thread)) {
- thread->mFullDuplexReport = InitSumReport(thread, -1, 1);
+ thread->mFullDuplexReport = InitSumReport(thread, -1, true);
}
Settings_Copy(thread, &reverse_client, SHALLOW_COPY);
- if ((thread->mThreads > 1) || isSumOnly(thread) || \
- (!(thread->mThreads > 1) && !isEnhanced(thread))) {
- Iperf_push_host(thread);
- Iperf_push_host(reverse_client);
- }
+ Iperf_push_host(thread);
+ Iperf_push_host(reverse_client);
assert(reverse_client != NULL);
- setTransferID(reverse_client, 1);
- theClient->my_connect(true);
+ setTransferID(reverse_client, REVERSED);
+ theClient->my_connect(false);
#ifdef HAVE_THREAD_DEBUG
thread_debug("Launch: client spawn thread fullduplex (sock=%d)", thread->mSock);
#endif
@@ -270,7 +254,7 @@ static void serverside_client_fullduplex (struct thread_Settings *thread, Client
#ifdef HAVE_THREAD_DEBUG
thread_debug("Launch: Listener spawn client thread (fd sock=%d)", thread->mSock);
#endif
- setTransferID(thread, 1);
+ setTransferID(thread, REVERSED);
if (theClient->StartSynch() != -1) {
theClient->Run();
}
@@ -280,7 +264,7 @@ static void serverside_client_bidir (struct thread_Settings *thread, Client *the
#ifdef HAVE_THREAD_DEBUG
thread_debug("Launch: Listener spawn client thread (bidir sock=%d)", thread->mSock);
#endif
- setTransferID(thread, 1);
+ setTransferID(thread, REVERSED);
SockAddr_zeroAddress(&thread->peer);
SockAddr_remoteAddr(thread);
if (thread->mReportMode == kReport_CSV) {
@@ -324,7 +308,7 @@ void client_spawn (struct thread_Settings *thread) {
thread_setscheduler(thread);
#endif
// start up the client
- setTransferID(thread, 0);
+ setTransferID(thread, NORMAL);
theClient = new Client(thread);
// let the reporter thread go first in the case of -P greater than 1
Condition_Lock(reporter_state.await);
@@ -400,10 +384,21 @@ void client_init(struct thread_Settings *clients) {
if (isIncrSrcIP(clients) && (clients->mLocalhost != NULL)) {
next->incrsrcip = i;
}
+ if (isTxStartTime(clients)) {
+ // break apart -P first pkt sends by some usecs
+ // this allows the listener thread to spawn a server, connect() and open
+ // a new socket for subsequent threads. This issue is most
+ // notable with --tx-starttime and -P > 1
+ // use max cores & a max aggregate delay to limit this so it's bounded
+#define MAXCORES 10
+#define MAXDELAY 20000 // 20 ms
+ next->sendfirst_pacing = (i % MAXCORES) * (MAXDELAY / MAXCORES);
+ }
if (isIncrDstIP(clients)) {
next->incrdstip = i;
// force a setHostname
SockAddr_zeroAddress(&next->peer);
+ setNoSettReport(next);
} else if (clients->mBindPort) {
// Increment the source port of none of the quintuple is being change or the user requests it
if ((!isIncrDstPort(clients) && !isIncrDstIP(clients) && !isIncrSrcIP(clients)) || isIncrSrcPort(clients)) {
@@ -419,11 +414,22 @@ void client_init(struct thread_Settings *clients) {
itr->runNow = next;
itr = next;
}
- if ((isBounceBack(clients) || isConnectOnly(clients) || isPeriodicBurst(clients)) \
- && (isWorkingLoadUp(clients) || isWorkingLoadDown(clients))) {
+ if (isWorkingLoadUp(clients) || isWorkingLoadDown(clients)) {
int working_load_threads = (clients->mWorkingLoadThreads == 0) ? 1 : clients->mWorkingLoadThreads;
while (working_load_threads--) {
Settings_Copy(clients, &next, DEEP_COPY);
+ if (isUDP(next)) {
+ unsetUDP(next);
+ unsetBWSet(next);
+ setNoSettReport(next);
+ next->mAppRate=0;
+ }
+ if (isLoadCCA(next)) {
+ unsetCongestionControl(next);
+ }
+ if (isIsochronous(next)) {
+ unsetIsochronous(next);
+ }
if (next != NULL) {
unsetBounceBack(next);
unsetConnectOnly(next);
@@ -439,15 +445,24 @@ void client_init(struct thread_Settings *clients) {
} else if (isWorkingLoadDown(clients)) {
setReverse(next);
}
- if (isBounceBack(clients) && (clients->mWorkingLoadThreads > 1)) {
- Iperf_push_host(clients);
- }
+ Iperf_push_host(clients);
// Bump the bounceback time to include the delay time
if (next->txholdback_timer.tv_sec || next->txholdback_timer.tv_usec) {
// mAmount units are 10 ms
next->mAmount += (next->txholdback_timer.tv_sec * 100);
next->mAmount += (next->txholdback_timer.tv_usec / 10000);
}
+ if (isLoadCCA(next)) {
+ char *tmp = new char[strlen(next->mLoadCCA) + 1];
+ if (tmp) {
+ if (next->mCongestion)
+ DELETE_ARRAY(next->mCongestion);
+ setCongestionControl(next);
+ strcpy(tmp, next->mLoadCCA);
+ tmp[strlen(next->mLoadCCA)] = '\0';
+ next->mCongestion = tmp;
+ }
+ }
itr->runNow = next;
itr = next;
}
@@ -475,4 +490,16 @@ void listeners_init(struct thread_Settings *listener) {
itr = next;
}
}
+ // See if a working load TCP listener is needed
+ if (isUDP(listener) && (isWorkingLoadUp(listener) || isWorkingLoadDown(listener))) {
+ Settings_Copy(listener, &next, DEEP_COPY);
+ if (next != NULL) {
+ unsetUDP(next);
+ next->mAppRate = 0;
+ unsetBWSet(next);
+ setNoSettReport(next);
+ itr->runNow = next;
+ itr = next;
+ }
+ }
}
diff --git a/src/Listener.cpp b/src/Listener.cpp
index a517cbc..c6ea969 100644
--- a/src/Listener.cpp
+++ b/src/Listener.cpp
@@ -1,16 +1,15 @@
/*---------------------------------------------------------------
- * Copyright (c) 1999,2000,2001,2002,2003
- * The Board of Trustees of the University of Illinois
- * All Rights Reserved.
- *---------------------------------------------------------------
+ * Copyright (c) 1999,2000,2001,2002,2003 The Board of Trustees of the
+ * University of Illinois All Rights Reserved.
+ * ---------------------------------------------------------------
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software (Iperf) and associated
* documentation files (the "Software"), to deal in the Software
- * without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute,
- * sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do
- * so, subject to the following conditions:
+ * without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
*
*
* Redistributions of source code must retain the above
@@ -139,7 +138,8 @@ void Listener::Run () {
}
if (!isUDP(mSettings)) {
// TCP needs just one listen
- my_listen(); // This will set ListenSocket to a new sock fd
+ if (!my_listen()) // This will set ListenSocket to a new sock fd
+ return;
}
bool mMode_Time = isServerModeTime(mSettings) && !isDaemon(mSettings);
if (mMode_Time) {
@@ -150,7 +150,9 @@ void Listener::Run () {
mEndTime.add(mSettings->mListenerTimeout);
}
Timestamp now;
+ bool need_listen = true;
#define SINGLECLIENTDELAY_DURATION 50000 // units is microseconds
+
while (!sInterupted && mCount) {
#ifdef HAVE_THREAD_DEBUG
thread_debug("Listener main loop port %d ", mSettings->mPort);
@@ -163,8 +165,8 @@ void Listener::Run () {
break;
}
// Serialize in the event the -1 option or --singleclient is set
- int tc;
- if ((isSingleClient(mSettings) || isMulticast(mSettings)) && \
+ int tc = 0;
+ if ((isSingleClient(mSettings) || (isUDP(mSettings) && isMulticast(mSettings))) && \
mCount && (tc = (thread_numtrafficthreads()) > 0)) {
// Start with a delay in the event some traffic
// threads are pending to be scheduled and haven't
@@ -178,9 +180,14 @@ void Listener::Run () {
#endif
continue;
}
- if (isUDP(mSettings)) {
+ // This will set ListenSocket to a new sock fd
+ if (isUDP(mSettings) && need_listen) {
// UDP needs a new listen per every new socket
- my_listen(); // This will set ListenSocket to a new sock fd
+ if (!my_listen()) {
+ break;
+ } else {
+ need_listen = false;
+ }
}
// Use a select() with a timeout if -t is set or if this is a v1 -r or -d test
fd_set set;
@@ -195,12 +202,6 @@ void Listener::Run () {
timeout.tv_sec = static_cast<long>(mSettings->mListenerTimeout);
timeout.tv_usec = (static_cast<long>(mSettings->mListenerTimeout) * 1000000) % 1000000;
}
- if (isTxStartTime(mSettings)) {
- now.setnow();
- long adjsecs = (mSettings->txstart_epoch.tv_sec - now.getSecs());
- if (adjsecs > 0)
- timeout.tv_sec += adjsecs + 1;
- }
FD_ZERO(&set);
FD_SET(ListenSocket, &set);
if (!(select(ListenSocket + 1, &set, NULL, NULL, &timeout) > 0)) {
@@ -234,7 +235,7 @@ void Listener::Run () {
Settings_Destroy(server);
continue;
}
-
+ need_listen = true;
#ifdef HAVE_THREAD_DEBUG
thread_debug("Listener thread accepted server sock=%d transferID", server->mSock, server->mTransferID);
#endif
@@ -309,7 +310,7 @@ void Listener::Run () {
if (isUDP(server) && isCompat(mSettings)) {
setSeqNo64b(server);
}
- setTransferID(server, 0);
+ setTransferID(server, NORMAL);
if ((mSettings->mReportMode == kReport_CSV) && server->mSumReport && !server->mSumReport->sum_reverse_set) {
format_ips_port_string(&server->mSumReport->info, 1);
server->mSumReport->sum_reverse_set = true;
@@ -334,7 +335,7 @@ void Listener::Run () {
if (listener_client_settings) {
if (server->mMode != kTest_Normal)
listener_client_settings->mTransferID = 0;
- setTransferID(listener_client_settings, 1);
+ setTransferID(listener_client_settings, REVERSED);
if (isFullDuplex(listener_client_settings) || isReverse(listener_client_settings))
Iperf_push_host(listener_client_settings);
if (isFullDuplex(server)) {
@@ -344,9 +345,9 @@ void Listener::Run () {
// now that it's know to be full duplex. This wasn't known
// during accept()
SetSumHandlers(server, server->mSumReport);
- server->mSumReport->sum_fd_set = 1;
+ server->mSumReport->sum_fd_set = true;
}
- server->mFullDuplexReport = InitSumReport(server, server->mSock, 1);
+ server->mFullDuplexReport = InitSumReport(server, server->mSock, true);
listener_client_settings->mFullDuplexReport = server->mFullDuplexReport;
#if HAVE_THREAD_DEBUG
thread_debug("FullDuplex report client=%p/%p server=%p/%p", (void *) listener_client_settings, (void *) listener_client_settings->mFullDuplexReport, (void *) server, (void *) server->mFullDuplexReport);
@@ -368,7 +369,7 @@ void Listener::Run () {
}
}
}
- setTransferID(server, 0);
+ setTransferID(server, NORMAL);
if (isConnectionReport(server) && !isSumOnly(server)) {
struct ReportHeader *reporthdr = InitConnectionReport(server);
struct ConnectionInfo *cr = static_cast<struct ConnectionInfo *>(reporthdr->this_report);
@@ -393,7 +394,7 @@ void Listener::Run () {
* wildcard server address, specifying what incoming interface to
* accept connections on.
* ------------------------------------------------------------------- */
-void Listener::my_listen () {
+bool Listener::my_listen () {
int rc;
int type;
int domain;
@@ -414,20 +415,13 @@ void Listener::my_listen () {
// for the case of L2 testing and UDP, a new AF_PACKET
// will be created to supercede this one
type = (isUDP(mSettings) ? SOCK_DGRAM : SOCK_STREAM);
- domain = (SockAddr_isIPv6(&mSettings->local) ?
-#if HAVE_IPV6
- AF_INET6
-#else
- AF_INET
-#endif
- : AF_INET);
+ domain = SockAddr_getAFdomain(&mSettings->local);
#ifdef WIN32
- if (SockAddr_isMulticast(&mSettings->local)) {
+ if (SockAddr_isMulticast(&mSettings->multicast_group)) {
// Multicast on Win32 requires special handling
ListenSocket = WSASocket(domain, type, 0, 0, 0, WSA_FLAG_MULTIPOINT_C_LEAF | WSA_FLAG_MULTIPOINT_D_LEAF);
WARN_errno(ListenSocket == INVALID_SOCKET, "socket");
-
} else
#endif
{
@@ -436,31 +430,46 @@ void Listener::my_listen () {
}
mSettings->mSock = ListenSocket;
SetSocketOptions(mSettings);
- // reuse the address, so we can run if a former server was killed off
- int boolean = 1;
- Socklen_t len = sizeof(boolean);
- rc = setsockopt(ListenSocket, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&boolean), len);
- // bind socket to server address
+ SetSocketBindToDeviceIfNeeded(mSettings);
+ rc = SOCKET_ERROR;
+ if (isUDP(mSettings) && SockAddr_isMulticast(&mSettings->multicast_group)) {
+#if HAVE_MULTICAST
#ifdef WIN32
- if (SockAddr_isMulticast(&mSettings->local)) {
// Multicast on Win32 requires special handling
- rc = WSAJoinLeaf(ListenSocket, (sockaddr*) &mSettings->local, mSettings->size_local,0,0,0,0,JL_BOTH);
+ rc = WSAJoinLeaf(ListenSocket, reinterpret_cast<sockaddr*> (&mSettings->local), mSettings->size_local,0,0,0,0,JL_BOTH);
WARN_errno(rc == SOCKET_ERROR, "WSAJoinLeaf (aka bind)");
- } else
+#else
+#if 0 && (HAVE_DECL_IP_ADD_MEMBERSHIP || HAVE_DECL_MCAST_JOIN_GROUP) // possible future, bind to all including unicast
+ iperf_sockaddr tmp;
+ memcpy(&tmp, &mSettings->local, sizeof(tmp));
+ SockAddr_setAddressAny(&tmp); // the multicast join will take care of this
+ rc = bind(ListenSocket, reinterpret_cast<sockaddr*>(&tmp), mSettings->size_local);
+ printf("***** any bind\n");
+#else
+ rc = bind(ListenSocket, reinterpret_cast<sockaddr*> (&mSettings->local), mSettings->size_local);
+// printf("***** single bind\n");
#endif
- {
- rc = bind(ListenSocket, reinterpret_cast<sockaddr*>(&mSettings->local), mSettings->size_local);
- FAIL_errno(rc == SOCKET_ERROR, "listener bind", mSettings);
+ FAIL_errno(rc == SOCKET_ERROR, "listener bind", mSettings);
+ // if UDP and multicast, join the group
+ if (iperf_multicast_join(mSettings) != IPERF_MULTICAST_JOIN_SUCCESS) {
+ rc = SOCKET_ERROR;
}
+#endif
+#else
+ fprintf(stderr, "Multicast not supported");
+#endif // HAVE_MULTICAST
+ } else {
+ // bind socket for unicast
+ rc = bind(ListenSocket, reinterpret_cast<sockaddr*>(&mSettings->local), mSettings->size_local);
+ }
+ FAIL_errno(rc == SOCKET_ERROR, "listener bind", mSettings);
}
-
// update the reporter thread
- if (isReport(mSettings) && isSettingsReport(mSettings)) {
- struct ReportHeader *report_settings = InitSettingsReport(mSettings);
- assert(report_settings != NULL);
- // disable future settings reports, listener should only do it once
- unsetReport(mSettings);
- PostReport(report_settings);
+ if (isSettingsReport(mSettings)) {
+ struct ReportHeader *tmp = InitSettingsReport(mSettings);
+ setNoSettReport(mSettings);
+ assert(tmp!=NULL);
+ PostReport(tmp);
}
// listen for connections (TCP only).
@@ -472,253 +481,10 @@ void Listener::my_listen () {
rc = listen(ListenSocket, INT_MAX);
}
WARN_errno(rc == SOCKET_ERROR, "listen");
- } else {
-#ifndef WIN32
- // if UDP and multicast, join the group
- if (SockAddr_isMulticast(&mSettings->local)) {
-#ifdef HAVE_MULTICAST
- my_multicast_join();
-#else
- fprintf(stderr, "Multicast not supported");
-#endif // HAVE_MULTICAST
- }
-#endif
}
+ return true;
} // end my_listen()
-/* -------------------------------------------------------------------
- * Joins the multicast group or source and group (SSM S,G)
- *
- * taken from: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.hale001/ipv6d0141001708.htm
- *
- * Multicast function IPv4 IPv6 Protocol-independent
- * ================== ==== ==== ====================
- * Level of specified option on setsockopt()/getsockopt() IPPROTO_IP IPPROTO_IPV6 IPPROTO_IP or IPPROTO_IPV6
- * Join a multicast group IP_ADD_MEMBERSHIP IPV6_JOIN_GROUP MCAST_JOIN_GROUP
- * Leave a multicast group or leave all sources of that
- * multicast group IP_DROP_MEMBERSHIP IPV6_LEAVE_GROUP MCAST_LEAVE_GROUP
- * Select outbound interface for sending multicast datagrams IP_MULTICAST_IF IPV6_MULTICAST_IF NA
- * Set maximum hop count IP_MULTICAST_TTL IPV6_MULTICAST_HOPS NA
- * Enable multicast loopback IP_MULTICAST_LOOP IPV6_MULTICAST_LOOP NA
- * Join a source multicast group IP_ADD_SOURCE_MEMBERSHIP NA MCAST_JOIN_SOURCE_GROUP
- * Leave a source multicast group IP_DROP_SOURCE_MEMBERSHIP NA MCAST_LEAVE_SOURCE_GROUP
- * Block data from a source to a multicast group IP_BLOCK_SOURCE NA MCAST_BLOCK_SOURCE
- * Unblock a previously blocked source for a multicast group IP_UNBLOCK_SOURCE NA MCAST_UNBLOCK_SOURCE
- *
- *
- * Reminder: The os will decide which version of IGMP or MLD to use. This may be controlled by system settings, e.g.:
- *
- * [rmcmahon@lvnvdb0987:~/Code/ssm/iperf2-code] $ sysctl -a | grep mld | grep force
- * net.ipv6.conf.all.force_mld_version = 0
- * net.ipv6.conf.default.force_mld_version = 0
- * net.ipv6.conf.lo.force_mld_version = 0
- * net.ipv6.conf.eth0.force_mld_version = 0
- *
- * [rmcmahon@lvnvdb0987:~/Code/ssm/iperf2-code] $ sysctl -a | grep igmp | grep force
- * net.ipv4.conf.all.force_igmp_version = 0
- * net.ipv4.conf.default.force_igmp_version = 0
- * net.ipv4.conf.lo.force_igmp_version = 0
- * net.ipv4.conf.eth0.force_igmp_version = 0
- *
- * ------------------------------------------------------------------- */
-void Listener::my_multicast_join () {
- // This is the older mulitcast join code. Both SSM and binding the
- // an interface requires the newer socket options. Using the older
- // code here will maintain compatiblity with previous iperf versions
- if (!isSSMMulticast(mSettings) && !mSettings->mIfrname) {
- if (!SockAddr_isIPv6(&mSettings->local)) {
- struct ip_mreq mreq;
- memcpy(&mreq.imr_multiaddr, SockAddr_get_in_addr(&mSettings->local), \
- sizeof(mreq.imr_multiaddr));
- mreq.imr_interface.s_addr = htonl(INADDR_ANY);
- int rc = setsockopt(ListenSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
- reinterpret_cast<char*>(&mreq), sizeof(mreq));
- WARN_errno(rc == SOCKET_ERROR, "multicast join");
-#if HAVE_DECL_IP_MULTICAST_ALL
- int mc_all = 0;
- rc = setsockopt(ListenSocket, IPPROTO_IP, IP_MULTICAST_ALL, (void*) &mc_all, sizeof(mc_all));
- WARN_errno(rc == SOCKET_ERROR, "ip_multicast_all");
-#endif
- } else {
-#if (HAVE_IPV6 && HAVE_IPV6_MULTICAST && (HAVE_DECL_IPV6_JOIN_GROUP || HAVE_DECL_IPV6_ADD_MEMBERSHIP))
- struct ipv6_mreq mreq;
- memcpy(&mreq.ipv6mr_multiaddr, SockAddr_get_in6_addr(&mSettings->local), sizeof(mreq.ipv6mr_multiaddr));
- mreq.ipv6mr_interface = 0;
-#if HAVE_DECL_IPV6_JOIN_GROUP
- int rc = setsockopt(ListenSocket, IPPROTO_IPV6, IPV6_JOIN_GROUP, \
- reinterpret_cast<char*>(&mreq), sizeof(mreq));
-#else
- int rc = setsockopt(ListenSocket, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, \
- reinterpret_cast<char*>(&mreq), sizeof(mreq));
-#endif
- FAIL_errno(rc == SOCKET_ERROR, "multicast v6 join", mSettings);
-#else
- fprintf(stderr, "IPv6 multicast is not supported on this platform\n");
-#endif
- }
- } else {
- int rc;
-#ifdef HAVE_SSM_MULTICAST
- // Here it's either an SSM S,G multicast join or a *,G with an interface specifier
- // Use the newer socket options when these are specified
- socklen_t socklen = sizeof(struct sockaddr_storage);
- int iface=0;
-#ifdef HAVE_NET_IF_H
- /* Set the interface or any */
- if (mSettings->mIfrname) {
- iface = if_nametoindex(mSettings->mIfrname);
- FAIL_errno(!iface, "mcast if_nametoindex",mSettings);
- } else {
- iface = 0;
- }
-#endif
-
- if (isIPV6(mSettings)) {
-#if HAVE_IPV6_MULTICAST
- if (mSettings->mSSMMulticastStr) {
- struct group_source_req group_source_req;
- struct sockaddr_in6 *group;
- struct sockaddr_in6 *source;
-
- memset(&group_source_req, 0, sizeof(struct group_source_req));
-
- group_source_req.gsr_interface = iface;
- group=reinterpret_cast<struct sockaddr_in6*>(&group_source_req.gsr_group);
- source=reinterpret_cast<struct sockaddr_in6*>(&group_source_req.gsr_source);
- source->sin6_family = AF_INET6;
- group->sin6_family = AF_INET6;
- /* Set the group */
- rc=getsockname(ListenSocket,reinterpret_cast<struct sockaddr *>(group), &socklen);
- FAIL_errno(rc == SOCKET_ERROR, "mcast join source group getsockname",mSettings);
- group->sin6_port = 0; /* Ignored */
-
- /* Set the source, apply the S,G */
- rc=inet_pton(AF_INET6, mSettings->mSSMMulticastStr,&source->sin6_addr);
- FAIL_errno(rc != 1, "mcast v6 join source group pton",mSettings);
- source->sin6_port = 0; /* Ignored */
-#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
- source->sin6_len = group->sin6_len;
-#endif
- rc = -1;
-#if HAVE_DECL_MCAST_JOIN_SOURCE_GROUP
- rc = setsockopt(ListenSocket,IPPROTO_IPV6,MCAST_JOIN_SOURCE_GROUP, reinterpret_cast<const char *>(&group_source_req),
- sizeof(group_source_req));
-#endif
- FAIL_errno(rc == SOCKET_ERROR, "mcast v6 join source group",mSettings);
- } else {
- struct group_req group_req;
- struct sockaddr_in6 *group;
-
- memset(&group_req, 0, sizeof(struct group_req));
-
- group_req.gr_interface = iface;
- group=reinterpret_cast<struct sockaddr_in6*>(&group_req.gr_group);
- group->sin6_family = AF_INET6;
- /* Set the group */
- rc=getsockname(ListenSocket,reinterpret_cast<struct sockaddr *>(group), &socklen);
- FAIL_errno(rc == SOCKET_ERROR, "mcast v6 join group getsockname",mSettings);
- group->sin6_port = 0; /* Ignored */
- rc = -1;
-#if HAVE_DECL_MCAST_JOIN_GROUP
- rc = setsockopt(ListenSocket,IPPROTO_IPV6,MCAST_JOIN_GROUP, reinterpret_cast<const char *>(&group_req),
- sizeof(group_source_req));
-#endif
- FAIL_errno(rc == SOCKET_ERROR, "mcast v6 join group",mSettings);
- }
-#else
- fprintf(stderr, "Unfortunately, IPv6 multicast is not supported on this platform\n");
-#endif
- } else {
- if (mSettings->mSSMMulticastStr) {
- struct sockaddr_in *group;
- struct sockaddr_in *source;
-
- // Fill out both structures because we don't which one will succeed
- // and both may need to be tried
-#ifdef HAVE_STRUCT_IP_MREQ_SOURCE
- struct ip_mreq_source imr;
- memset (&imr, 0, sizeof (imr));
-#endif
-#ifdef HAVE_STRUCT_GROUP_SOURCE_REQ
- struct group_source_req group_source_req;
- memset(&group_source_req, 0, sizeof(struct group_source_req));
- group_source_req.gsr_interface = iface;
- group=reinterpret_cast<struct sockaddr_in*>(&group_source_req.gsr_group);
- source=reinterpret_cast<struct sockaddr_in*>(&group_source_req.gsr_source);
-#else
- struct sockaddr_in imrgroup;
- struct sockaddr_in imrsource;
- group = &imrgroup;
- source = &imrsource;
-#endif
- source->sin_family = AF_INET;
- group->sin_family = AF_INET;
- /* Set the group */
- rc=getsockname(ListenSocket,reinterpret_cast<struct sockaddr *>(group), &socklen);
- FAIL_errno(rc == SOCKET_ERROR, "mcast join source group getsockname",mSettings);
- group->sin_port = 0; /* Ignored */
-
- /* Set the source, apply the S,G */
- rc=inet_pton(AF_INET,mSettings->mSSMMulticastStr,&source->sin_addr);
- FAIL_errno(rc != 1, "mcast join source pton",mSettings);
-#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
- source->sin_len = group->sin_len;
-#endif
- source->sin_port = 0; /* Ignored */
- rc = -1;
-
-#if HAVE_DECL_MCAST_JOIN_SOURCE_GROUP
- rc = setsockopt(ListenSocket,IPPROTO_IP,MCAST_JOIN_SOURCE_GROUP, reinterpret_cast<const char *>(&group_source_req),
- sizeof(group_source_req));
-#endif
-
-#if HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP
-#ifdef HAVE_STRUCT_IP_MREQ_SOURCE
- // Some operating systems will have MCAST_JOIN_SOURCE_GROUP but still fail
- // In those cases try the IP_ADD_SOURCE_MEMBERSHIP
- if (rc < 0) {
-#ifdef HAVE_STRUCT_IP_MREQ_SOURCE_IMR_MULTIADDR_S_ADDR
- imr.imr_multiaddr = ((const struct sockaddr_in *)group)->sin_addr;
- imr.imr_sourceaddr = ((const struct sockaddr_in *)source)->sin_addr;
-#else
- // Some Android versions declare mreq_source without an s_addr
- imr.imr_multiaddr = ((const struct sockaddr_in *)group)->sin_addr.s_addr;
- imr.imr_sourceaddr = ((const struct sockaddr_in *)source)->sin_addr.s_addr;
-#endif
- rc = setsockopt (ListenSocket, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP, reinterpret_cast<char*>(&imr), sizeof (imr));
- }
-#endif
-#endif
- FAIL_errno(rc == SOCKET_ERROR, "mcast join source group",mSettings);
- } else {
- struct group_req group_req;
- struct sockaddr_in *group;
-
- memset(&group_req, 0, sizeof(struct group_req));
-
- group_req.gr_interface = iface;
- group=reinterpret_cast<struct sockaddr_in*>(&group_req.gr_group);
- group->sin_family = AF_INET;
- /* Set the group */
- rc=getsockname(ListenSocket,reinterpret_cast<struct sockaddr *>(group), &socklen);
- FAIL_errno(rc == SOCKET_ERROR, "mcast join group getsockname",mSettings);
- group->sin_port = 0; /* Ignored */
- rc = -1;
-#if HAVE_DECL_MCAST_JOIN_GROUP
- rc = setsockopt(ListenSocket,IPPROTO_IP,MCAST_JOIN_GROUP, reinterpret_cast<const char *>(&group_req),
- sizeof(group_source_req));
-#endif
- FAIL_errno(rc == SOCKET_ERROR, "mcast join group",mSettings);
- }
- }
-
-#else
- fprintf(stderr, "Unfortunately, SSM is not supported on this platform\n");
- exit(-1);
-#endif
- }
-}
-// end my_multicast_join()
bool Listener::L2_setup (thread_Settings *server, int sockfd) {
#if defined(HAVE_LINUX_FILTER_H) && defined(HAVE_AF_PACKET)
@@ -905,6 +671,7 @@ int Listener::udp_accept (thread_Settings *server) {
// most likely not a new client thread requiring a new server thread, but remnants of an
// old one that already ended. Hence, the Listener should ignore "first packets" when
// they have negative seq numbers.
+ RETRYREAD:
do {
packetID = 0;
nread = recvfrom(ListenSocket, server->mBuf, server->mBufLen, 0, \
@@ -925,22 +692,12 @@ int Listener::udp_accept (thread_Settings *server) {
Timestamp now;
server->accept_time.tv_sec = now.getSecs();
server->accept_time.tv_usec = now.getUsecs();
-#if HAVE_THREAD_DEBUG
- {
- char tmpaddr[200];
- size_t len=200;
- unsigned short port = SockAddr_getPort(&server->peer);
- SockAddr_getHostAddress(&server->peer, tmpaddr, len);
- thread_debug("rcvfrom peer: %s port %d len=%d", tmpaddr, port, nread);
- }
-#endif
- // Handle connection for UDP sockets
- int gid = Iperf_push_host_port_conditional(server);
-#if HAVE_THREAD_DEBUG
- if (gid < 0)
- thread_debug("rcvfrom peer: drop duplicate");
-#endif
- if (gid > 0) {
+ // Drop duplicates, may need to use a BPF drop for better performance
+ // or ebfs
+ if (!Iperf_push_host(server)) {
+ packetID = 0;
+ goto RETRYREAD;
+ } else {
int rc;
// We have a new UDP flow (based upon key of quintuple)
// so let's hand off this socket
@@ -953,11 +710,28 @@ int Listener::udp_accept (thread_Settings *server) {
// This connect() routing is only supported with AF_INET or AF_INET6 sockets,
// e.g. AF_PACKET sockets can't do this. We'll handle packet sockets later
// All UDP accepts here will use AF_INET. This is intentional and needed
- rc = connect(server->mSock, reinterpret_cast<struct sockaddr*>(&server->peer), server->size_peer);
- FAIL_errno(rc == SOCKET_ERROR, "connect UDP", mSettings);
- server->size_local = sizeof(iperf_sockaddr);
- getsockname(server->mSock, reinterpret_cast<sockaddr*>(&server->local), &server->size_local);
- SockAddr_Ifrname(server);
+ if (!isMulticast(server)) {
+ rc = connect(server->mSock, reinterpret_cast<struct sockaddr*>(&server->peer), server->size_peer);
+ FAIL_errno(rc == SOCKET_ERROR, "connect UDP", mSettings);
+ server->size_local = sizeof(iperf_sockaddr);
+ getsockname(server->mSock, reinterpret_cast<sockaddr*>(&server->local), &server->size_local);
+ SockAddr_Ifrname(server);
+ } else {
+ server->size_multicast_group = sizeof(iperf_sockaddr);
+ iperf_sockaddr sent_dstaddr;
+ getsockname(server->mSock, reinterpret_cast<sockaddr*>(&sent_dstaddr), &server->size_multicast_group);
+ int join_send_match = SockAddr_Hostare_Equal(&sent_dstaddr, &server->multicast_group);
+#if DEBUG_MCAST
+ char joinaddr[200];
+ char pktaddr[200];
+ size_t len=200;
+ SockAddr_getHostAddress(&sent_dstaddr, joinaddr, len);
+ SockAddr_getHostAddress(&server->multicast_group, pktaddr, len);
+ printf("mcast(%d): join addr %s pkt group addr %s\n", join_send_match, joinaddr, pktaddr);
+#endif
+ WARN(!join_send_match, "mcast join and packet group addr");
+ // RJM - use a cmesg to read the interface name
+ }
server->firstreadbytes = nread;
}
}
@@ -1046,8 +820,12 @@ bool Listener::apply_client_settings (thread_Settings *server) {
bool rc = false;
// Set the receive timeout for the very first read
- int sorcvtimer = TESTEXCHANGETIMEOUT; // 4 sec in usecs
- SetSocketOptionsReceiveTimeout(server, sorcvtimer);
+ if (mSettings->mListenerTimeout >= 0) {
+ SetSocketOptionsReceiveTimeout(server, (int) (mSettings->mListenerTimeout * 1000000));
+ } else {
+ int sorcvtimer = DEFAULT_TESTEXCHANGETIMEOUT; // in usecs
+ SetSocketOptionsReceiveTimeout(server, sorcvtimer);
+ }
server->peer_version_u = 0;
server->peer_version_l = 0;
server->mMode = kTest_Normal;
@@ -1111,26 +889,39 @@ bool Listener::apply_client_settings_udp (thread_Settings *server) {
#if HAVE_THREAD_DEBUG
thread_debug("UDP small header");
#endif
+ struct client_udpsmall_testhdr *smallhdr = reinterpret_cast<struct client_udpsmall_testhdr *>(server->mBuf + server->l4payloadoffset);
server->sent_time.tv_sec = ntohl(hdr->seqno_ts.tv_sec);
server->sent_time.tv_usec = ntohl(hdr->seqno_ts.tv_usec);
+ server->txstart_epoch.tv_sec = ntohl(smallhdr->start_tv_sec);
+ server->txstart_epoch.tv_usec = ntohl(smallhdr->start_tv_usec);
uint32_t seqno = ntohl(hdr->seqno_ts.id);
+ if (server->txstart_epoch.tv_sec > 0) {
+ setTxStartTime(server);
+ }
if (seqno != 1) {
fprintf(stderr, "WARN: first received packet (id=%d) was not first sent packet, report start time will be off\n", seqno);
}
Timestamp now;
if (!isTxStartTime(server) && ((abs(now.getSecs() - server->sent_time.tv_sec)) > (MAXDIFFTIMESTAMPSECS + 1))) {
- fprintf(stdout,"WARN: ignore --trip-times because client didn't provide valid start timestamp within %d seconds of now\n", MAXDIFFTIMESTAMPSECS);
+ fprintf(stdout,"WARN: ignore --trip-times because client didn't provide valid start timestamp within %d seconds of now (now=%ld send=%ld)\n", MAXDIFFTIMESTAMPSECS, now.getSecs(), server->sent_time.tv_sec);
unsetTripTime(server);
} else {
setTripTime(server);
}
setEnhanced(server);
} else if ((flags & HEADER_VERSION1) || (flags & HEADER_VERSION2) || (flags & HEADER_EXTEND)) {
- if ((flags & HEADER_VERSION1) && !(flags & HEADER_VERSION2)) {
- if (flags & RUN_NOW)
- server->mMode = kTest_DualTest;
- else
- server->mMode = kTest_TradeOff;
+ if (flags & HEADER_VERSION1) {
+ uint32_t tidthreads = ntohl(hdr->base.numThreads);
+ if (tidthreads & HEADER_HASTRANSFERID) {
+ tidthreads &= (~HEADER_HASTRANSFERID & HEADER_TRANSFERIDMASK);
+ server->mPeerTransferID = tidthreads >> HEADER_TRANSFERIDSHIFT;
+ setSyncTransferID(server);
+ } else if (!(flags & HEADER_VERSION2)) {
+ if (flags & RUN_NOW)
+ server->mMode = kTest_DualTest;
+ else
+ server->mMode = kTest_TradeOff;
+ }
}
if (flags & HEADER_EXTEND) {
upperflags = htons(hdr->extend.upperflags);
@@ -1234,6 +1025,18 @@ bool Listener::apply_client_settings_tcp (thread_Settings *server) {
}
readptr += nread;
server->mBounceBackBytes = ntohl(bbhdr->bbsize);
+ if (server->mBounceBackBytes > server->mBufLen) {
+ if (isBuflenSet(server)) {
+ WARN(1, "Buffer length (-l) too small for bounceback request. Increase -l size or don't set (for auto-adjust)");
+ rc = false;
+ goto DONE;
+ } else {
+ int read_offset = readptr - server->mBuf;
+ Settings_Grow_mBuf(server, server->mBounceBackBytes);
+ readptr = server->mBuf + read_offset;
+ bbhdr = reinterpret_cast<struct bounceback_hdr *>(server->mBuf);
+ }
+ }
server->mBounceBackHold = ntohl(bbhdr->bbhold);
uint16_t bbflags = ntohs(bbhdr->bbflags);
if (bbflags & HEADER_BBCLOCKSYNCED) {
@@ -1249,6 +1052,23 @@ bool Listener::apply_client_settings_tcp (thread_Settings *server) {
setTcpQuickAck(server);
}
#endif
+ if (bbflags & HEADER_BBREPLYSIZE) {
+ server->mBounceBackReplyBytes = ntohl(bbhdr->bbreplysize);
+ } else {
+ server->mBounceBackReplyBytes = server->mBounceBackBytes;
+ }
+ if (server->mBounceBackReplyBytes > server->mBufLen) {
+ if (isBuflenSet(server)) {
+ WARN(1, "Buffer length (-l) too small for bounceback reply. Increase -l size or don't set (for auto-adjust)");
+ rc = false;
+ goto DONE;
+ } else {
+ int read_offset = readptr - server->mBuf;
+ Settings_Grow_mBuf(server, server->mBounceBackReplyBytes);
+ readptr = server->mBuf + read_offset;
+ bbhdr = reinterpret_cast<struct bounceback_hdr *>(server->mBuf);
+ }
+ }
int remaining = server->mBounceBackBytes - (sizeof(struct bounceback_hdr) + sizeof(uint32_t));
if (remaining < 0) {
WARN(1, "bounce back bytes too small");
@@ -1267,9 +1087,15 @@ bool Listener::apply_client_settings_tcp (thread_Settings *server) {
bbhdr->bbserverRx_ts.usec = htonl(now.getUsecs());
} else {
uint16_t upperflags = 0;
+ uint16_t lowerflags = 0;
int readlen;
// figure out the length of the test header
if ((readlen = Settings_ClientTestHdrLen(flags, server)) > 0) {
+ if (readlen > (server->mBufLen - nread)) {
+ WARN(1, "read tcp header too large");
+ rc = false;
+ goto DONE;
+ }
// read the test settings passed to the server by the client
nread += recvn(server->mSock, readptr, (readlen - (int) sizeof(uint32_t)), 0);
FAIL_errno((nread < readlen), "read tcp test info", server);
@@ -1285,14 +1111,22 @@ bool Listener::apply_client_settings_tcp (thread_Settings *server) {
}
server->firstreadbytes = nread;
struct client_tcp_testhdr *hdr = reinterpret_cast<struct client_tcp_testhdr*>(server->mBuf);
- if ((flags & HEADER_VERSION1) && !(flags & HEADER_VERSION2)) {
- if (flags & RUN_NOW)
- server->mMode = kTest_DualTest;
- else
- server->mMode = kTest_TradeOff;
+ if (flags & HEADER_VERSION1) {
+ uint32_t tidthreads = ntohl(hdr->base.numThreads);
+ if (tidthreads & HEADER_HASTRANSFERID) {
+ tidthreads &= (~HEADER_HASTRANSFERID & HEADER_TRANSFERIDMASK);
+ server->mPeerTransferID = tidthreads >> HEADER_TRANSFERIDSHIFT;
+ setSyncTransferID(server);
+ } else if (!(flags & HEADER_VERSION2)) {
+ if (flags & RUN_NOW)
+ server->mMode = kTest_DualTest;
+ else
+ server->mMode = kTest_TradeOff;
+ }
}
if (flags & HEADER_EXTEND) {
upperflags = htons(hdr->extend.upperflags);
+ lowerflags = htons(hdr->extend.lowerflags);
server->mTOS = ntohs(hdr->extend.tos);
server->peer_version_u = ntohl(hdr->extend.version_u);
server->peer_version_l = ntohl(hdr->extend.version_l);
@@ -1335,6 +1169,30 @@ bool Listener::apply_client_settings_tcp (thread_Settings *server) {
server->mFPS = 1.0;
}
}
+ if ((lowerflags & HEADER_CCA) && !isCongestionControl(server)) {
+#if HAVE_DECL_TCP_CONGESTION
+ int ccalen = ntohs(hdr->cca.cca_length);
+ setCongestionControl(server);
+ setEnhanced(server);
+ server->mCongestion = new char[ccalen+1];
+ if (server->mCongestion) {
+ strncpy(server->mCongestion, hdr->cca.value, ccalen);
+ server->mCongestion[ccalen] = '\0';
+ Socklen_t len = strlen(server->mCongestion) + 1;
+ int rc = setsockopt(server->mSock, IPPROTO_TCP, TCP_CONGESTION,
+ server->mCongestion, len);
+ if (rc == SOCKET_ERROR) {
+ fprintf(stderr, "Attempt to set '%s' congestion control failed: %s\n",
+ server->mCongestion, strerror(errno));
+ unsetCongestionControl(server);
+ DELETE_ARRAY(server->mCongestion);
+ }
+ }
+#endif
+ }
+ if (lowerflags & HEADER_BARRIER_TIME) {
+ server->barrier_time = ntohl(hdr->extend.barrier_usecs);
+ }
if (flags & HEADER_VERSION2) {
if (upperflags & HEADER_FULLDUPLEX) {
setFullDuplex(server);
diff --git a/src/Locale.c b/src/Locale.c
index 09333b0..34c82dd 100644
--- a/src/Locale.c
+++ b/src/Locale.c
@@ -50,8 +50,25 @@
* -------------------------------------------------------------------
* Strings and other stuff that is locale specific.
* ------------------------------------------------------------------- */
+
+/* Format specifiers per inttypes.h
+ *
+ * macro description example
+ * PRIxMAX printf specifier for intmax_t PRIiMAX is the equivalent of i (in "%i") for intmax_t values
+ * PRIxN printf specifier for intN_t PRId16 is the equivalent of d (in "%d") for int16_t values
+ * PRIxLEASTN printf specifier for int_leastN_t PRIuLEAST32 is the equivalent of u (in "%u") for uint32_t values
+ * PRIxFASTN printf specifier for int_fastN_t PRIxFAST8 is the equivalent of x (in "%x") for uint8_t values
+ * PRIxPTR printf specifier for intptr_t PRIuPTR is the equivalent of u (in "%u") for uintptr_t values
+ *
+ Where:
+ * x is one of d, i, o,u or x (for the printf specifiers this can also be an uppercase X).*
+ * N is 8, 16, 32, 64, or any other type width supported by the library in <cstdint>.
+ * * The specifier assumes the type to be signed for i and d, and unsigned for o, u, x and X.
+ */
+
#include "headers.h"
#include "version.h"
+#include "gettcpinfo.h"
#ifdef __cplusplus
extern "C" {
@@ -73,12 +90,14 @@ Client/Server:\n\
-e, --enhanced use enhanced reporting giving more tcp/udp and traffic information\n\
-f, --format [kmgKMG] format to report: Kbits, Mbits, KBytes, MBytes\n\
--hide-ips hide ip addresses and host names within outputs\n\
+ --histograms enable histograms (see client or server for more)\n\
-i, --interval # seconds between periodic bandwidth reports\n\
-l, --len #[kmKM] length of buffer in bytes to read or write (Defaults: TCP=128K, v4 UDP=1470, v6 UDP=1450)\n\
-m, --print_mss print TCP maximum segment size\n\
-o, --output <filename> output the report or error message to this specified file\n\
-p, --port # client/server port to listen/send on and to connect\n\
--permit-key permit key to be used to verify client and server (TCP only)\n\
+ --tcp-tx-delay set transmit delay\n\
--sum-only output sum only reports\n\
-u, --udp use UDP rather than TCP\n\
--utc use coordinated universal time (UTC) with time output\n\
@@ -102,6 +121,7 @@ Server specific:\n\
--jitter-histograms enable jitter histograms\n\
--permit-key-timeout set the timeout for a permit key in seconds\n\
--tcp-rx-window-clamp set the TCP receive window clamp size in bytes\n\
+ --test-exchange-timeout set the timeout on the test exchange, use 0 for no timeout\n\
--tap-dev #[<dev>] use TAP device to receive at L2 layer\n\
-t, --time # time in seconds to listen for new connections as well as to receive traffic (default not set)\n\
-B, --bind <ip>[%<dev>] bind to multicast address and optional device\n\
@@ -119,25 +139,34 @@ const char usage_long2[] = "\
Client specific:\n\
--bounceback request a bounceback test (use -l for size, defaults to 100 bytes)\n\
--bounceback-hold request the server to insert a delay of n milliseconds between its read and write\n\
- --bounceback-period request the client schedule a send every n milliseconds\n\
--bounceback-no-quickack request the server not set the TCP_QUICKACK socket option (disabling TCP ACK delays) during a bounceback test\n\
+ --bounceback-period request the client schedule a send every n milliseconds\n \
+ --bounceback-reply set the bounceback reply message size (defaults to symmetric)\n \
+ --bounceback-txdelay request the bounceback server delay n seconds between the request and the reply\n \
-c, --client <host> run in client mode, connecting to <host>\n\
--connect-only run a connect only test\n\
- --connect-retries # number of times to retry tcp connect\n\
+ --connect-retry-timer minimum time interval in seconds between application level connect retries\n\
+ --connect-retry-time time interval in seconds to attempt application level connect retries \n\
+ --dscp set the DSCP field (masking ECN bits) in TOS byte\n\
-d, --dualtest Do a bidirectional test simultaneously (multiple sockets)\n\
--fq-rate #[kmgKMG] bandwidth to socket pacing\n\
+ --fq-rate-step #[kmgKMG] step value to socket pacing\n\
+ --fq-rate-step-interval #[kmgKMG] step interval (in seconds) for socket pacing\n\
--full-duplex run full duplex test using same socket\n\
- --ipg set the the interpacket gap (milliseconds) for packets within an isochronous frame\n\
- --isochronous <frames-per-second>:<mean>,<stddev> send traffic in bursts (frames - emulate video traffic)\n\
+ --histograms enable histograms for --tcp-write-times\n\
+ --ignore-shutdown don't wait on the TCP shutdown or close (fin & finack) rather use the final write as the ending event\n\
--incr-dstip Increment the destination ip with parallel (-P) traffic threads\n\
--incr-dstport Increment the destination port with parallel (-P) traffic threads\n\
--incr-srcip Increment the source ip with parallel (-P) traffic threads\n\
--incr-srcport Increment the source port with parallel (-P) traffic threads\n\
+ --ipg set the the interpacket gap (milliseconds) for packets within an isochronous frame\n\
+ --isochronous <frames-per-second>:<mean>,<stddev> send traffic in bursts (frames - emulate video traffic)\n\
--local-only Set don't route on socket\n\
--near-congestion=[w] Use a weighted write delay per the sampled TCP RTT (experimental)\n\
--no-connect-sync No sychronization after connect when -P or parallel traffic threads\n\
--no-udp-fin No final server to client stats at end of UDP test\n\
-n, --num #[kmgKMG] number of bytes to transmit (instead of -t)\n\
+ --sync-transfer-id pass the clients' transfer id(s) to the server so both will use the same id in their respective outputs\n\
-r, --tradeoff Do a fullduplexectional test individually\n\
--tcp-quickack set the socket's TCP_QUICKACK option (off by default)\n\
--tcp-write-prefetch set the socket's TCP_NOTSENT_LOWAT value in bytes and use event based writes\n\
@@ -160,7 +189,8 @@ Client specific:\n\
#endif
" -S, --tos IP DSCP or tos settings\n\
-T, --ttl # time-to-live, for multicast (default 1)\n\
- --working-load request a concurrent TCP stream\n\
+ --working-load request working load(s)\n\
+ --working-load-cca set working load CCA\n\
-V, --ipv6_domain Set the domain to IPv6 (send packets over IPv6)\n\
-X, --peer-detect perform server version detection and version exchange\n\
\n\
@@ -196,6 +226,8 @@ Report bugs to <iperf-users@lists.sourceforge.net>\n";
const char version[] =
"iperf version " IPERF_VERSION " (" IPERF_VERSION_DATE ") " IPERF_THREADS "\n";
+const char branch_version[] =
+"iperf (branch " IPERF_BRANCH ") (" IPERF_VERSION_DATE ") " IPERF_THREADS "\n";
/* -------------------------------------------------------------------
* settings
@@ -213,14 +245,17 @@ const char client_port[] =
const char server_pid_port[] =
"Server listening on %s port %d with pid %d\n";
+const char server_working_load_port[] =
+"Working load listening on %s port %d\n";
+
const char server_pid_portrange[] =
"Server listening on %s ports %d-%d with pid %d\n";
const char client_pid_port[] =
-"Client connecting to %s, %s port %d with pid %d (%d flows)\n";
+"Client connecting to %s, %s port %d with pid %d (%d/%d flows/load)\n";
const char client_pid_port_dev[] =
-"Client connecting to %s, %s port %d with pid %d via %s (%d flows)\n";
+"Client connecting to %s, %s port %d with pid %d via %s (%d/%d flows/load)\n";
const char bind_address[] =
"Binding to local address %s\n";
@@ -277,10 +312,13 @@ const char client_burstperiodcount[] =
"Bursting: %s writes %d times every %0.2f second(s)\n";
const char client_bounceback[] =
-"Bounce-back test (size=%s) (server hold req=%d usecs & tcp_quickack)\n";
+"Bounceback test (req/reply size =%s/%s) (server hold req=%d usecs & tcp_quickack)\n";
+
+const char client_bbburstperiodcount[] =
+"Bursting request %d times every %0.2f second(s)\n";
const char client_bounceback_noqack[] =
-"Bounce-back test (size=%s) (server hold req=%d usecs)\n";
+"Bounceback test (req/reply size =%s/%s) (server hold req=%d usecs)\n";
const char server_burstperiod[] =
"Burst wait timeout set to (2 * %0.2f) seconds (use --burst-period=<n secs> to change)\n";
@@ -288,6 +326,9 @@ const char server_burstperiod[] =
const char client_fq_pacing [] =
"fair-queue socket pacing set to %s/s\n";
+const char client_fq_pacing_step [] =
+"fair-queue socket pacing set to %s/s (stepping rate by %s/s)\n";
+
/* -------------------------------------------------------------------
* Legacy reports
* ------------------------------------------------------------------- */
@@ -296,28 +337,28 @@ const char report_bw_header[] =
"[ ID] Interval Transfer Bandwidth\n";
const char report_bw_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec%s\n";
const char report_sum_bw_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec%s\n";
const char report_sumcnt_bw_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec%s\n";
const char report_bw_jitter_loss_header[] =
"[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams\n";
const char report_bw_jitter_loss_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%)\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%)%s\n";
const char report_sum_bw_jitter_loss_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " (%.2g%%)\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " (%.2g%%)%s\n";
const char report_sumcnt_bw_jitter_loss_header[] =
"[SUM-cnt] Interval Transfer Bandwidth Lost/Total PPS\n";
const char report_sumcnt_bw_jitter_loss_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8.0f pps\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8.0f pps%s\n";
/* -------------------------------------------------------------------
* Enhanced reports (per -e)
@@ -335,172 +376,250 @@ const char server_read_size[] =
"Read buffer size";
const char report_bw_enhanced_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec%s\n";
const char report_sum_bw_enhanced_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec%s\n";
const char report_bw_read_enhanced_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Reads=Dist\n";
const char report_bw_read_enhanced_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d%s\n";
const char report_sumcnt_bw_read_enhanced_header[] =
"[SUM-cnt] Interval" IPERFTimeSpace "Transfer Bandwidth Reads=Dist\n";
const char report_sumcnt_bw_read_enhanced_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d%s\n";
const char report_sumcnt_bw_read_triptime_header[] =
"[SUM-cnt] Interval" IPERFTimeSpace "Transfer Bandwidth InP Reads=Dist\n";
const char report_sumcnt_bw_read_triptime_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %s %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %s %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d%s\n";
const char report_bw_read_enhanced_netpwr_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Burst Latency avg/min/max/stdev (cnt/size) inP NetPwr Reads=Dist\n";
const char report_bw_read_enhanced_netpwr_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %.3f/%.3f/%.3f/%.3f ms (%d/%d) %s %s %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %.3f/%.3f/%.3f/%.3f ms (%d/%d) %s %s %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d%s\n";
const char report_bw_isoch_enhanced_netpwr_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Burst Latency avg/min/max/stdev (cnt/size) NetPwr Reads=Dist\n";
const char report_bw_isoch_enhanced_netpwr_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %.3f/%.3f/%.3f/%.3f ms (%d/%d) %s %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %.3f/%.3f/%.3f/%.3f ms (%d/%d) %s %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d%s\n";
const char report_sum_bw_read_enhanced_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d%s\n";
const char report_triptime_enhanced_format[] =
-"%s" IPERFTimeFrmt " trip-time (3WHS done->fin+finack) = %.4f sec\n";
+"%s" IPERFTimeFrmt " trip-time (3WHS done->fin+finack) = %.4f sec%s\n";
#if HAVE_TCP_STATS
+#if HAVE_TCP_INFLIGHT
+const char report_bw_write_enhanced_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry InF(pkts)/Cwnd(pkts)/RTT(var) NetPwr\n";
+
+const char report_bw_write_enhanced_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX " %8" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s\n";
+
+const char report_write_enhanced_nocwnd_write_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIdMAX " NA/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s %.3f/%.3f/%.3f/%.3f ms (%" PRIdMAX ")%s\n";
+
+const char report_bw_write_enhanced_fq_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry InF(pkts)/Cwnd(pkts)/RTT(var) fq-rate NetPwr\n";
+
+const char report_bw_write_enhanced_fq_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX " %8" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s/sec %s%s\n";
+
const char report_client_bb_bw_header[] =
-"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth BB cnt=avg/min/max/stdev Rtry Cwnd/RTT RPS\n";
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth BB cnt=avg/min/max/stdev Rtry Cwnd(pkts)/RTT(var) RPS(avg)\n";
const char report_client_bb_bw_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%.3f/%.3f/%.3f/%.3f ms %4d %4dK/%u us %s rps\n";
-#else
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%.3f/%.3f/%.3f/%.3f ms %4" PRIuLEAST32 "%4" PRIdMAX "K/(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s rps%s\n";
+
+const char report_client_bb_bw_final_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%.3f/%.3f/%.3f/%.3f ms %4" PRIuLEAST32 " -(-)/-(-) %s rps%s\n";
+
+const char report_write_enhanced_write_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry InF(pkts)/Cwnd(pkts)/RTT(var) NetPwr write-times avg/min/max/stdev (cnt)\n";
+
+const char report_write_enhanced_write_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8" PRIuLEAST32 "%7" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s %.3f/%.3f/%.3f/%.3f ms (%" PRIdMAX ")%s\n";
+
+#else // no inflight
+const char report_bw_write_enhanced_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry Cwnd(pkts)/RTT(var) NetPwr\n";
+
+const char report_bw_write_enhanced_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIuLEAST32 " %8" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s\n";
+
+const char report_bw_write_enhanced_fq_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry Cwnd(pkts)/RTT(var) fq-rate NetPwr\n";
+
+const char report_bw_write_enhanced_fq_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIuLEAST32 " %8" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s/sec %s%s\n";
+
const char report_client_bb_bw_header[] =
-"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth BB cnt=avg/min/max/stdev RPS\n";
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth BB cnt=avg/min/max/stdev Rtry Cwnd(pkts)/RTT(var) RPS(avg)\n";
const char report_client_bb_bw_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%.3f/%.3f/%.3f/%.3f ms %s rps\n";
-#endif
-const char report_client_bb_bw_triptime_format[] =
-"%s" IPERFTimeFrmt " sec OWD Delays (ms) Cnt=%" PRIdMAX " To=%.3f/%.3f/%.3f/%.3f From=%.3f/%.3f/%.3f/%.3f Asymmetry=%.3f/%.3f/%.3f/%.3f %s rps\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%.3f/%.3f/%.3f/%.3f ms %4" PRIuLEAST32 " %4" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s rps%s\n";
+
+const char report_client_bb_bw_final_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%.3f/%.3f/%.3f/%.3f ms %4" PRIuLEAST32 " -(-)/-(-) %s rps%s\n";
const char report_write_enhanced_write_header[] =
-"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry Cwnd/RTT NetPwr write-times avg/min/max/stdev (cnt)\n";
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry Cwnd(pkts)/RTT(var) NetPwr write-times avg/min/max/stdev (cnt)\n";
const char report_write_enhanced_write_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIdMAX "%8dK/%u us %s %.3f/%.3f/%.3f/%.3f ms (%" PRIdMAX ")\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIuLEAST32 "%8" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s %.3f/%.3f/%.3f/%.3f ms (%" PRIdMAX ")%s\n";
const char report_write_enhanced_nocwnd_write_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIdMAX " NA/%u us %s %.3f/%.3f/%.3f/%.3f ms (%" PRIdMAX ")\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIuLEAST32 " NA/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %s %.3f/%.3f/%.3f/%.3f ms (%" PRIdMAX ")%s\n";
-
-#if HAVE_TCP_STATS
-const char report_bw_write_enhanced_header[] =
-"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry Cwnd/RTT(var) NetPwr\n";
+#endif //HAVE_TCP_INFLIGHT
const char report_sum_bw_write_enhanced_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX "\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIuLEAST32 " %s\n";
-const char report_bw_write_enhanced_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX " %8dK/%u(%u) us %s\n";
+const char report_bw_write_enhanced_fq_final_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIuLEAST32 " %8dK/%u(%u) us %s%s\n";
const char report_bw_write_enhanced_nocwnd_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIdMAX " NA/%u us %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIuLEAST32 " NA/%" PRIuLEAST32 "(%" PRIuLEAST32 ")us %s\n";
const char report_write_enhanced_isoch_header[] =
-"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry Cwnd/RTT isoch:tx/miss/slip NetPwr\n";
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry Cwnd(pkts)/RTT(var) isoch:tx/miss/slip NetPwr\n";
const char report_write_enhanced_isoch_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8d %8dK/%u us %9" PRIuMAX "/%" PRIuMAX "/%" PRIuMAX " %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8" PRIuLEAST32 " %8" PRIdMAX "K(%" PRIuLEAST32 ")/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %9" PRIuMAX "/%" PRIuMAX "/%" PRIuMAX " %s%s\n";
const char report_write_enhanced_isoch_nocwnd_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIdMAX " NA/%u us %9" PRIuMAX "/%" PRIuMAX "/%" PRIuMAX " %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %10" PRIuLEAST32 " NA/%" PRIuLEAST32 "(%" PRIuLEAST32 ") us %9" PRIuMAX "/%" PRIuMAX "/%" PRIuMAX " %s%s\n";
-#else
+#else //no tcpstat
+
+const char report_client_bb_bw_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth BB cnt=avg/min/max/stdev RPS(avg)\n";
+
+const char report_client_bb_bw_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%.3f/%.3f/%.3f/%.3f ms %s rps%s\n";
+
+const char report_bw_write_enhanced_fq_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err fq-rate NetPwr\n";
+
+const char report_bw_write_enhanced_fq_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%s/sec %s%s\n";
const char report_bw_write_enhanced_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err\n";
const char report_bw_write_enhanced_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%s\n";
const char report_sum_bw_write_enhanced_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%s\n";
const char report_write_enhanced_isoch_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err isoch:tx/miss/slip\n";
const char report_write_enhanced_isoch_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%9" PRIuMAX "/%" PRIuMAX "/%" PRIuMAX "\n";
-#endif
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%9" PRIuMAX "/%" PRIuMAX "/%" PRIuMAX "%s\n";
+
+const char report_write_enhanced_write_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err NetPwr write-times avg/min/max/stdev (cnt)\n";
+
+const char report_write_enhanced_write_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%s %.3f/%.3f/%.3f/%.3f ms (%" PRIdMAX ")%s\n";
+
+const char report_bw_write_fq_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err fq-rate\n";
+
+const char report_bw_write_fq_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %s/sec%s\n";
+
+#endif //no tcp stat
+
+const char report_client_bb_bw_triptime_format[] =
+"%s" IPERFTimeFrmt " sec OWD (ms) Cnt=%" PRIdMAX " TX=%.3f/%.3f/%.3f/%.3f RX=%.3f/%.3f/%.3f/%.3f Asymmetry=%.3f/%.3f/%.3f/%.3f%s\n";
const char report_sumcnt_bw_write_enhanced_header[] =
"[SUM-cnt] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err Rtry\n";
const char report_sumcnt_bw_write_enhanced_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX "\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX "%s\n";
const char report_bw_pps_enhanced_header[] =
-"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err PPS\n";
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err/Timeo PPS\n";
const char report_bw_pps_enhanced_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8.0f pps\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "/%" PRIdMAX "%8.0f pps%s\n";
const char report_sumcnt_bw_pps_enhanced_header[] =
"[SUM-cnt] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err PPS\n";
const char report_sumcnt_bw_pps_enhanced_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8.0f pps\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8.0f pps%s\n";
const char report_sumcnt_udp_enhanced_header[] =
"[SUM-cnt] Interval" IPERFTimeSpace "Transfer Bandwidth Lost/Total PPS\n";
const char report_sumcnt_udp_enhanced_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8.0f pps\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %8.0f pps%s\n";
const char report_sumcnt_udp_triptime_header[] =
"[SUM-cnt] Interval" IPERFTimeSpace "Transfer Bandwidth Lost/Total Rx/inP PPS\n";
const char report_sumcnt_udp_triptime_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %" PRIdMAX "/%.0f %8.0f pps\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX " %" PRIdMAX "/%.0f %8.0f pps%s\n";
const char report_bw_pps_enhanced_isoch_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Write/Err PPS isoch:tx/miss/slip\n";
const char report_bw_pps_enhanced_isoch_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%8.0f pps %3" PRIuMAX "/%" PRIuMAX "/%" PRIuMAX "\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%8.0f pps %3" PRIuMAX "/%" PRIuMAX "/%" PRIuMAX "%s\n";
const char report_sum_bw_pps_enhanced_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%8.0f pps\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "/%" PRIdMAX "%8.0f pps%s\n";
const char report_bw_jitter_loss_pps_header[] =
"[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams PPS\n";
const char report_bw_jitter_loss_pps_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %8.0f pps\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %8.0f pps%s\n";
+#if HAVE_DECL_MSG_TRUNC
const char report_bw_jitter_loss_enhanced_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Jitter Lost/Total \
- Latency avg/min/max/stdev PPS NetPwr\n";
+ Latency avg/min/max/stdev PPS Read/Timeo/Trunc NetPwr\n";
const char report_bw_jitter_loss_enhanced_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %" PRIdMAX "/%" PRIdMAX "/%" PRIdMAX " %s%s\n";
const char report_bw_jitter_loss_enhanced_triptime_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Jitter Lost/Total \
- Latency avg/min/max/stdev PPS Rx/inP NetPwr\n";
+ Latency avg/min/max/stdev PPS Rx/inP Read/Timeo/Trunc NetPwr\n";
const char report_bw_jitter_loss_enhanced_triptime_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %" PRIdMAX "/%s %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %" PRIdMAX "/%s %" PRIdMAX "/%" PRIdMAX "/%" PRIdMAX " %s%s\n";
+#else
+const char report_bw_jitter_loss_enhanced_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Jitter Lost/Total \
+ Latency avg/min/max/stdev PPS Read/Timeo NetPwr\n";
+
+const char report_bw_jitter_loss_enhanced_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %" PRIdMAX "/%" PRIdMAX " %s%s\n";
+const char report_bw_jitter_loss_enhanced_triptime_header[] =
+"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Jitter Lost/Total \
+ Latency avg/min/max/stdev PPS Rx/inP Read/Timeo NetPwr\n";
+
+const char report_bw_jitter_loss_enhanced_triptime_format[] =
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %" PRIdMAX "/%s %" PRIdMAX "/%" PRIdMAX "%s%s\n";
+#endif //msgtrunc
const char report_bw_jitter_loss_enhanced_isoch_header[] =
"[ ID] Interval" IPERFTimeSpace "Transfer Bandwidth Jitter Lost/Total \
Latency avg/min/max/stdev PPS NetPwr Isoch:rx/lost\n";
@@ -510,16 +629,16 @@ const char report_bw_jitter_loss_enhanced_isoch_triptime_header[] =
Latency avg/min/max/stdev PPS Frame:rx/lost Frame-latency avg/min/max/stdev NetPwr\n";
const char report_bw_jitter_loss_enhanced_isoch_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %3d/%d %.3f/%.3f/%.3f/%.3f ms %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %3" PRIdMAX " /% " PRIdMAX " %.3f/%.3f/%.3f/%.3f ms %s%s\n";
const char report_sum_bw_jitter_loss_enhanced_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.0f pps\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.0f pps%s\n";
const char report_sumcnt_bw_jitter_loss_enhanced_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.0f pps\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.0f pps%s\n";
const char report_bw_jitter_loss_suppress_enhanced_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) -/-/-/- ms %.0f pps\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) -/-/-/- ms %.0f pps %" PRIdMAX "/%" PRIdMAX "/%" PRIdMAX "%s\n";
/*
* Frame interval reports
@@ -531,10 +650,10 @@ const char report_frame_jitter_loss_enhanced_header[] =
Latency avg/min/max/stdev PPS inP NetPwr\n";
const char report_frame_jitter_loss_enhanced_format[] =
-"%s" IPERFFTimeFrmt "(%0.4f) sec %ss %ss/sec %" PRIdMAX " %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %2.0f pkts %s\n";
+"%s" IPERFFTimeFrmt "(%0.4f) sec %ss %ss/sec %" PRIdMAX " %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) %.3f/%.3f/%.3f/%.3f ms %.0f pps %2.0f pkts %s%s\n";
const char report_frame_jitter_loss_suppress_enhanced_format[] =
-"%s" IPERFTimeFrmt "(%0.4f) sec %" PRIdMAX " %ss %ss/sec %" PRIdMAX " %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) -/-/-/- ms %.0f pps\n";
+"%s" IPERFTimeFrmt "(%0.4f) sec %" PRIdMAX " %ss %ss/sec %" PRIdMAX " %6.3f ms %" PRIdMAX "/%" PRIdMAX " (%.2g%%) -/-/-/- ms %.0f pps %s%s\n";
const char report_frame_tcp_enhanced_header[] =
"[ ID] Interval(f-transit)" IPERFFTimeSpace "Transfer Bandwidth FrameID\n";
@@ -543,7 +662,7 @@ const char report_burst_read_tcp_header[] =
"[ ID] Burst (start-end)" IPERFFTimeSpace "Transfer Bandwidth XferTime (DC%) Reads=Dist NetPwr\n";
const char report_burst_read_tcp_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms (%.2g%%) %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms (%.2g%%) %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d %s%s\n";
const char report_burst_read_tcp_final_format[] =
"%s" IPERFTimeFrmt " sec %ss %ss/sec %.3f/%.3f/%.3f/%.3f ms %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d\n";
@@ -552,63 +671,57 @@ const char report_burst_write_tcp_header[] =
"[ ID] Burst (start-end)" IPERFFTimeSpace "Transfer Bandwidth XferTime Write/Err Rtry Cwnd/RTT NetPwr\n";
const char report_burst_write_tcp_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX "%8dK/%u %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX "%8dK/%u %s%s\n";
#else
const char report_burst_write_tcp_header[] =
"[ ID] Burst (start-end)" IPERFFTimeSpace "Transfer Bandwidth XferTime Write/Err\n";
const char report_burst_write_tcp_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX"\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX"%s\n";
#endif
const char report_burst_write_tcp_nocwnd_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX "NA/%u %s\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %6.3f ms %" PRIdMAX "/%" PRIdMAX "%10" PRIdMAX "NA/%"PRIuLEAST32 "(%" PRIuLEAST32 ")%s\n";
const char report_burst_write_tcp_final_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "=%d:%d:%d:%d:%d:%d:%d:%d%s\n";
/* -------------------------------------------------------------------
* Fullduplex reports
* ------------------------------------------------------------------- */
const char report_bw_sum_fullduplex_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec%s\n";
const char report_bw_sum_fullduplex_enhanced_format[] =
-"[FD%d] " IPERFTimeFrmt " sec %ss %ss/sec\n";
+"[FD%d] " IPERFTimeFrmt " sec %ss %ss/sec%s\n";
const char report_udp_fullduplex_header[] =
"[ ID] Interval Transfer Bandwidth Datagrams PPS\n";
-const char report_sumcnt_udp_fullduplex_header[] =
-"[SUM-cnt] Interval Transfer Bandwidth Datagrams PPS\n";
-
-const char report_sumcnt_udp_fullduplex_format[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "%8.0f pps\n";
-
const char report_udp_fullduplex_format[] =
-"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "%8.0f pps\n";
+"%s" IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "%8.0f pps%s\n";
const char report_udp_fullduplex_enhanced_format[] =
-"[FD%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "%8.0f pps\n";
+"[FD%d] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "%8.0f pps%s\n";
const char report_udp_fullduplex_sum_format[] =
-"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "%8.0f pps\n";
+"[SUM] " IPERFTimeFrmt " sec %ss %ss/sec %" PRIdMAX "%8.0f pps%s\n";
/* -------------------------------------------------------------------
* Misc reports
* ------------------------------------------------------------------- */
const char report_outoforder[] =
-"%s" IPERFTimeFrmt " sec %d datagrams received out-of-order\n";
+"%s" IPERFTimeFrmt " sec %d datagrams received out-of-order%s\n";
const char report_sumcnt_outoforder[] =
-"[SUM-%d] " IPERFTimeFrmt " sec %d datagrams received out-of-order\n";
+"[SUM-%d] " IPERFTimeFrmt " sec %d datagrams received out-of-order%s\n";
const char report_l2statistics[] =
"%s" IPERFTimeFrmt " sec L2 processing detected errors, total(length/checksum/unknown) = %" PRIdMAX "(%" PRIdMAX "/%" PRIdMAX "/%" PRIdMAX ")\n";
const char report_sum_outoforder[] =
-"[SUM] " IPERFTimeFrmt " sec %d datagrams received out-of-order\n";
+"[SUM] " IPERFTimeFrmt " sec %d datagrams received out-of-order%s\n";
const char report_peer [] =
"%slocal %s port %u connected with %s port %u%s\n";
@@ -629,13 +742,13 @@ const char report_mss[] =
"MSS req size %d bytes (per TCP_MAXSEG)\n";
const char report_datagrams[] =
-"[%3d] Sent %d datagrams\n";
+"[%3d] Sent %" PRIdMAX " datagrams\n";
const char report_sumcnt_datagrams[] =
-"[SUM-%d] Sent %d datagrams\n";
+"[SUM-%d] Sent %" PRIdMAX " datagrams\n";
const char report_sum_datagrams[] =
-"[SUM] Sent %d datagrams\n";
+"[SUM] Sent %" PRIdMAX " datagrams\n";
const char server_reporting[] =
"[%3d] Server Report:\n";
@@ -644,7 +757,9 @@ const char reportCSV_peer[] =
"%s,%u,%s,%u";
const char report_l2length_error[] =
-"%s" IPERFTimeFrmt " sec %d datagrams received out-of-order\n";
+"%s" IPERFTimeFrmt " sec %" PRIdMAX " datagrams received out-of-order\n";
+
+const char report_client_bb_triptime_clocksync_error[] ="%s" IPERFTimeFrmt " sec Clock sync error count = %" PRIdMAX "\n";
/*-------------------------------------------------------------------
* CSV outputs
@@ -652,17 +767,32 @@ const char report_l2length_error[] =
const char reportCSV_bw_format[] =
"%s,%s,%d,%.1f-%.1f,%" PRIdMAX ",%" PRIdMAX "\n";
+const char reportCSV_bw_read_enhanced_header[] =
+"time,srcaddress,srcport,dstaddr,dstport,transferid,istart,iend,bytes,speed,readcnt,bin0,bin1,bin2,bin3,bin4,bin5,bin6,bin7\n";
+
const char reportCSV_bw_read_enhanced_format[] =
-"%s,%s,%d,%.1f-%.1f,%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%d,%d,%d,%d,%d,%d,%d,%d\n";
+"%s,%s,%d,%.1f,%.1f,%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%d,%d,%d,%d,%d,%d,%d,%d\n";
+
+const char reportCSV_bw_write_enhanced_header[] =
+"time,srcaddress,srcport,dstaddr,dstport,transferid,istart,iend,bytes,speed,writecnt,writeerr,tcpretry,tcpcwnd,tcppcwnd,tcprtt,tcprttvar\n";
const char reportCSV_bw_write_enhanced_format[] =
-"%s,%s,%d,%.1f-%.1f,%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%d,%u,%u\n";
+"%s,%s,%d,%.1f,%.1f,%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%" PRIuLEAST32 ",%" PRIdMAX ",%" PRIuLEAST32 ",%" PRIuLEAST32 ",%" PRIuLEAST32 "\n";
const char reportCSV_bw_jitter_loss_format[] =
"%s,%s,%d,%.1f-%.1f,%" PRIdMAX ",%" PRIdMAX ",%.3f,%" PRIdMAX ",%" PRIdMAX ",%.3f,%" PRIdMAX "\n";
+const char reportCSV_bw_jitter_loss_pps_header[] =
+"time,srcaddress,srcport,dstaddr,dstport,transferid,istart,iend,bytes,speed,jitter,errors,datagrams,errpercent,outoforder,writecnt,writeerr,pps\n";
+
const char reportCSV_bw_jitter_loss_pps_format[] =
-"%s,%s,%d,%.1f-%.1f,%" PRIdMAX ",%" PRIdMAX ",%.3f,%" PRIdMAX ",%" PRIdMAX ",%.3f,%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%f\n";
+"%s,%s,%d,%.1f,%.1f,%" PRIdMAX ",%" PRIdMAX ",%.3f,%" PRIdMAX ",%" PRIdMAX ",%.3f,%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%f\n";
+
+const char reportCSV_client_bb_bw_tcp_header[] =
+"time,srcaddress,srcport,dstaddr,dstport,transferid,istart,iend,bytes,speed,bbcnt,bbavg,bbmin,bbmax,bbstdev,tcpretry,tcpcwnd,tcprtt,rps\n";
+
+const char reportCSV_client_bb_bw_tcp_format[] =
+"%s,%s,%d,%.1f,%.1f,%" PRIdMAX ",%" PRIdMAX ",%" PRIdMAX ",%.3f,%.3f,%.3f,%.3f,%" PRIuLEAST32 ",%" PRIdMAX ",%" PRIuLEAST32 ",%0.1f\n";
/* -------------------------------------------------------------------
* warnings
@@ -744,14 +874,16 @@ const char warn_compat_and_peer_exchange[] =
"WARNING: Options of '-C' '--compatibility' AND '-X' '--peerdetect' are mutually exclusive, --peerdetect ignored\n";
const char warn_start_before_now[] =
-"[%3d] WARNING: --txstart-time (%" PRIdMAX ".%" PRIdMAX ") %s is before now %s\n";
+"[%3d] WARNING: --txstart-time (%ld.%06ld) %s is before now %s\n";
const char error_starttime_exceeds[] =
-"ERROR: --txstart-time (%" PRIdMAX ".%" PRIdMAX ") %s exceeds max scheduled delay of %d secs\n";
+"ERROR: --txstart-time %ld.%06ld %s exceeds max scheduled delay of %d secs\n";
const char error_delaytime_exceeds[] =
"ERROR: --txdelay-time of %d seconds is more than the supported delay of %d seconds\n";
+const char report_omitted[] = " (omitted)";
+
#ifdef __cplusplus
} /* end extern "C" */
#endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 37db611..e6c8f86 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,7 +49,8 @@ iperf_SOURCES = \
tcp_window_size.c \
pdfs.c \
dscp.c \
- iperf_formattime.c
+ iperf_formattime.c \
+ iperf_multicast_api.c
iperf_LDADD = $(LIBCOMPAT_LDADDS)
diff --git a/src/Makefile.in b/src/Makefile.in
index a8ab595..ea6ccc7 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -138,7 +138,7 @@ am__iperf_SOURCES_DIST = Client.cpp Extractor.c isochronous.cpp \
Settings.cpp SocketAddr.c gnu_getopt.c gnu_getopt_long.c \
histogram.c main.cpp service.c socket_io.c stdio.c \
packet_ring.c tcp_window_size.c pdfs.c dscp.c \
- iperf_formattime.c checksums.c
+ iperf_formattime.c iperf_multicast_api.c checksums.c
@AF_PACKET_TRUE@am__objects_1 = checksums.$(OBJEXT)
am_iperf_OBJECTS = Client.$(OBJEXT) Extractor.$(OBJEXT) \
isochronous.$(OBJEXT) Launch.$(OBJEXT) active_hosts.$(OBJEXT) \
@@ -149,7 +149,8 @@ am_iperf_OBJECTS = Client.$(OBJEXT) Extractor.$(OBJEXT) \
histogram.$(OBJEXT) main.$(OBJEXT) service.$(OBJEXT) \
socket_io.$(OBJEXT) stdio.$(OBJEXT) packet_ring.$(OBJEXT) \
tcp_window_size.$(OBJEXT) pdfs.$(OBJEXT) dscp.$(OBJEXT) \
- iperf_formattime.$(OBJEXT) $(am__objects_1)
+ iperf_formattime.$(OBJEXT) iperf_multicast_api.$(OBJEXT) \
+ $(am__objects_1)
iperf_OBJECTS = $(am_iperf_OBJECTS)
iperf_DEPENDENCIES = $(am__DEPENDENCIES_1)
iperf_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(iperf_LDFLAGS) \
@@ -180,7 +181,8 @@ am__depfiles_remade = ./$(DEPDIR)/Client.Po ./$(DEPDIR)/Extractor.Po \
./$(DEPDIR)/checksums.Po ./$(DEPDIR)/dscp.Po \
./$(DEPDIR)/gnu_getopt.Po ./$(DEPDIR)/gnu_getopt_long.Po \
./$(DEPDIR)/histogram.Po ./$(DEPDIR)/igmp_querier.Po \
- ./$(DEPDIR)/iperf_formattime.Po ./$(DEPDIR)/isochronous.Po \
+ ./$(DEPDIR)/iperf_formattime.Po \
+ ./$(DEPDIR)/iperf_multicast_api.Po ./$(DEPDIR)/isochronous.Po \
./$(DEPDIR)/main.Po ./$(DEPDIR)/packet_ring.Po \
./$(DEPDIR)/pdfs.Po ./$(DEPDIR)/service.Po \
./$(DEPDIR)/socket_io.Po ./$(DEPDIR)/stdio.Po \
@@ -238,8 +240,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
@@ -254,6 +254,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
@@ -264,6 +266,7 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
@@ -373,7 +376,7 @@ iperf_SOURCES = Client.cpp Extractor.c isochronous.cpp Launch.cpp \
SocketAddr.c gnu_getopt.c gnu_getopt_long.c histogram.c \
main.cpp service.c socket_io.c stdio.c packet_ring.c \
tcp_window_size.c pdfs.c dscp.c iperf_formattime.c \
- $(am__append_5)
+ iperf_multicast_api.c $(am__append_5)
iperf_LDADD = $(LIBCOMPAT_LDADDS)
@CHECKPROGRAMS_TRUE@checkdelay_SOURCES = checkdelay.c
@CHECKPROGRAMS_TRUE@checkdelay_LDADD = $(LIBCOMPAT_LDADDS)
@@ -510,6 +513,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/histogram.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/igmp_querier.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_formattime.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iperf_multicast_api.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isochronous.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet_ring.Po@am__quote@ # am--include-marker
@@ -604,7 +608,6 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
@@ -704,6 +707,7 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/histogram.Po
-rm -f ./$(DEPDIR)/igmp_querier.Po
-rm -f ./$(DEPDIR)/iperf_formattime.Po
+ -rm -f ./$(DEPDIR)/iperf_multicast_api.Po
-rm -f ./$(DEPDIR)/isochronous.Po
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/packet_ring.Po
@@ -780,6 +784,7 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/histogram.Po
-rm -f ./$(DEPDIR)/igmp_querier.Po
-rm -f ./$(DEPDIR)/iperf_formattime.Po
+ -rm -f ./$(DEPDIR)/iperf_multicast_api.Po
-rm -f ./$(DEPDIR)/isochronous.Po
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/packet_ring.Po
diff --git a/src/PerfSocket.cpp b/src/PerfSocket.cpp
index bad4074..363e8b1 100644
--- a/src/PerfSocket.cpp
+++ b/src/PerfSocket.cpp
@@ -74,6 +74,7 @@
#include "PerfSocket.hpp"
#include "SocketAddr.h"
#include "util.h"
+#include "iperf_multicast_api.h"
/* -------------------------------------------------------------------
* Set socket options before the listen() or connect() calls.
@@ -85,9 +86,8 @@ void SetSocketOptions (struct thread_Settings *inSettings) {
// must occur before call to accept() for large window sizes
setsock_tcp_windowsize(inSettings->mSock, inSettings->mTCPWin,
(inSettings->mThreadMode == kMode_Client ? 1 : 0));
-
+#if HAVE_DECL_TCP_CONGESTION
if (isCongestionControl(inSettings)) {
-#ifdef TCP_CONGESTION
Socklen_t len = strlen(inSettings->mCongestion) + 1;
int rc = setsockopt(inSettings->mSock, IPPROTO_TCP, TCP_CONGESTION,
inSettings->mCongestion, len);
@@ -95,12 +95,56 @@ void SetSocketOptions (struct thread_Settings *inSettings) {
fprintf(stderr, "Attempt to set '%s' congestion control failed: %s\n",
inSettings->mCongestion, strerror(errno));
unsetCongestionControl(inSettings);
+ thread_stop(inSettings);
+ }
+ char cca[TCP_CCA_NAME_MAX] = "";
+ len = sizeof(cca);
+ if (getsockopt(inSettings->mSock, IPPROTO_TCP, TCP_CONGESTION, &cca, &len) == 0) {
+ cca[TCP_CCA_NAME_MAX-1]='\0';
+ if (strcmp(cca, inSettings->mCongestion) != 0) {
+ fprintf(stderr, "Failed to set '%s' congestion control got '%s'\n", inSettings->mCongestion, cca);
+ thread_stop(inSettings);
+ }
}
+ } else if (isLoadCCA(inSettings)) {
+ Socklen_t len = strlen(inSettings->mLoadCCA) + 1;
+ int rc = setsockopt(inSettings->mSock, IPPROTO_TCP, TCP_CONGESTION,
+ inSettings->mLoadCCA, len);
+ if (rc == SOCKET_ERROR) {
+ fprintf(stderr, "Attempt to set '%s' load congestion control failed: %s\n",
+ inSettings->mLoadCCA, strerror(errno));
+ unsetLoadCCA(inSettings);
+ thread_stop(inSettings);
+ }
+ char cca[TCP_CCA_NAME_MAX] = "";
+ len = sizeof(cca);
+ if (getsockopt(inSettings->mSock, IPPROTO_TCP, TCP_CONGESTION, &cca, &len) == 0) {
+ cca[TCP_CCA_NAME_MAX-1]='\0';
+ if (strcmp(cca, inSettings->mLoadCCA) != 0) {
+ fprintf(stderr, "Failed to set '%s' load congestion control got '%s'\n", inSettings->mLoadCCA, cca);
+ thread_stop(inSettings);
+ }
+ }
+ }
#else
- fprintf(stderr, "The -Z option is not available on this operating system\n");
-#endif
+ if (isCongestionControl(inSettings) || isLoadCCA(inSettings)) {
+ fprintf(stderr, "TCP congestion control not supported\n");
+ thread_stop(inSettings);
}
+#endif
+ int boolean = 1;
+ int rc;
+ Socklen_t len = sizeof(boolean);
+#if HAVE_DECL_SO_REUSEADDR
+ // reuse the address, so we can run if a former server was killed off
+ rc = setsockopt(inSettings->mSock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&boolean), len);
+ WARN_errno(rc == SOCKET_ERROR, "SO_REUSEADDR");
+#endif
+#if HAVE_DECL_SO_REUSEPORT
+ setsockopt(inSettings->mSock, SOL_SOCKET, SO_REUSEPORT, (char*) &boolean, len);
+ WARN_errno(rc == SOCKET_ERROR, "SO_REUSEADDR");
+#endif
#if ((HAVE_TUNTAP_TAP) && (HAVE_TUNTAP_TUN))
if (isTunDev(inSettings) || isTapDev(inSettings)) {
@@ -140,28 +184,6 @@ void SetSocketOptions (struct thread_Settings *inSettings) {
#endif
} else
#endif
-#if (HAVE_DECL_SO_BINDTODEVICE)
- {
- char **device = (inSettings->mThreadMode == kMode_Client) ? &inSettings->mIfrnametx : &inSettings->mIfrname;
- if (*device) {
- struct ifreq ifr;
- memset(&ifr, 0, sizeof(ifr));
- snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", *device);
- if (setsockopt(inSettings->mSock, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) < 0) {
- char *buf;
- int len = snprintf(NULL, 0, "%s %s", "bind to device", *device);
- len++; // Trailing null byte + extra
- buf = static_cast<char *>(malloc(len));
- len = snprintf(buf, len, "%s %s", "bind to device", *device);
- WARN_errno(1, buf);
- free(buf);
- free(*device);
- *device = NULL;
- FAIL(1, "setsockopt() SO_BINDTODEVICE", inSettings);
- }
- }
- }
-#endif
// check if we're sending multicast
if (isMulticast(inSettings)) {
@@ -201,9 +223,7 @@ void SetSocketOptions (struct thread_Settings *inSettings) {
WARN_errno(rc == SOCKET_ERROR, "v4 ttl");
}
-#if HAVE_DECL_IP_TOS
SetSocketOptionsIPTos(inSettings, inSettings->mTOS);
-#endif
if (!isUDP(inSettings)) {
if (isTCPMSS(inSettings)) {
@@ -255,12 +275,18 @@ void SetSocketOptions (struct thread_Settings *inSettings) {
WARN_errno(rc == SOCKET_ERROR, "setsockopt TCP_NOTSENT_LOWAT");
}
#endif
+#if HAVE_DECL_TCP_TX_DELAY
+ if (isTcpTxDelay(inSettings) && (inSettings->mTcpTxDelayProb >= 1.0)) {
+ SetSocketTcpTxDelay(inSettings, inSettings->mTcpTxDelayMean * 1000);
+ }
+#endif
}
#if HAVE_DECL_SO_MAX_PACING_RATE
/* If socket pacing is specified try to enable it. */
if (isFQPacing(inSettings) && inSettings->mFQPacingRate > 0) {
int rc = setsockopt(inSettings->mSock, SOL_SOCKET, SO_MAX_PACING_RATE, &inSettings->mFQPacingRate, sizeof(inSettings->mFQPacingRate));
+ inSettings->mFQPacingRateCurrent = inSettings->mFQPacingRate;
WARN_errno(rc == SOCKET_ERROR, "setsockopt SO_MAX_PACING_RATE");
}
#endif /* HAVE_SO_MAX_PACING_RATE */
@@ -310,37 +336,149 @@ void SetSocketOptionsReceiveTimeout (struct thread_Settings *mSettings, int time
void SetSocketOptionsIPTos (struct thread_Settings *mSettings, int tos) {
-#if HAVE_DECL_IP_TOS
-#ifdef HAVE_THREAD_DEBUG
- thread_debug("Set socket IP_TOS to 0x%x", tos);
+ bool supported = true;
+ // set IP TOS (type-of-service) field
+ if (isOverrideTOS(mSettings) || isSetTOS(mSettings) || (tos > 0)) {
+ // IPV6_TCLASS is defined on Windows but not implemented.
+#if !HAVE_DECL_IPV6_TCLASS || HAVE_WINSOCK2_H
+ if (isIPV6(mSettings)) {
+ WARN(1, "WARN: IPV6_TCLASS not supported, setting --tos");
+ mSettings->mTOS = 0;
+ supported = false;
+ }
#endif
-#if HAVE_DECL_IPV6_TCLASS && ! defined HAVE_WINSOCK2_H
- // IPV6_TCLASS is defined on Windows but not implemented.
- if (isIPV6(mSettings)) {
- const int dscp = tos;
- int rc = setsockopt(mSettings->mSock, IPPROTO_IPV6, IPV6_TCLASS, (char*) &dscp, sizeof(dscp));
- WARN_errno(rc == SOCKET_ERROR, "setsockopt IPV6_TCLASS");
- } else
+#if !HAVE_DECL_IP_TOS
+ if (!isIPV6(mSettings)) {
+ WARN(1, "WARN: IP_TOS not supported, setting --tos");
+ mSettings->mTOS = 0;
+ supported = false;
+ }
#endif
- // set IP TOS (type-of-service) field
- if (isOverrideTOS(mSettings) || (tos > 0)) {
+ if (supported) {
int reqtos = tos;
Socklen_t len = sizeof(reqtos);
- int rc = setsockopt(mSettings->mSock, IPPROTO_IP, IP_TOS,
- reinterpret_cast<char*>(&reqtos), len);
- WARN_errno(rc == SOCKET_ERROR, "setsockopt IP_TOS");
- rc = getsockopt(mSettings->mSock, IPPROTO_IP, IP_TOS,
- reinterpret_cast<char*>(&reqtos), &len);
- WARN_errno(rc == SOCKET_ERROR, "getsockopt IP_TOS");
- WARN((reqtos != tos), "IP_TOS setting failed");
+ int rc = setsockopt(mSettings->mSock, (isIPV6(mSettings) ? IPPROTO_IPV6 : IPPROTO_IP), \
+ (isIPV6(mSettings) ? IPV6_TCLASS : IP_TOS), reinterpret_cast<char*>(&reqtos), len);
+ WARN_errno(rc == SOCKET_ERROR, (isIPV6(mSettings) ? "setsockopt IPV6_TCLASS" : "setsockopt IP_TOS"));
+ rc = getsockopt(mSettings->mSock, (isIPV6(mSettings) ? IPPROTO_IPV6 : IPPROTO_IP), \
+ (isIPV6(mSettings) ? IPV6_TCLASS : IP_TOS), reinterpret_cast<char*>(&reqtos), &len);
+ WARN_errno(rc == SOCKET_ERROR, (isIPV6(mSettings) ? "getsockopt IPV6_TCLASS" : "getsockopt IP_TOS"));
+ if (reqtos != tos) {
+ char warnbuf[256];
+ snprintf(warnbuf, sizeof(warnbuf), "Warning: IP_TOS set to 0x%x, request for setting to 0x%x", reqtos, tos);
+ warnbuf[sizeof(warnbuf)-1] = '\0';
+ WARN(1, warnbuf);
+ mSettings->mTOS = reqtos;
+ }
}
+ }
+}
+
+/*
+ * Networking tools can now establish thousands of flows, each of them
+ * with a different delay, simulating real world conditions.
+ *
+ * This requires FQ packet scheduler or a EDT-enabled NIC.
+ *
+ * TCP_TX_DELAY socket option, to set a delay in usec units.
+ * Note that FQ packet scheduler limits might need some tweaking :
+ *
+ * man tc-fq
+ *
+ * PARAMETERS
+ * limit
+ * Hard limit on the real queue size. When this limit is
+ * reached, new packets are dropped. If the value is lowered,
+ * packets are dropped so that the new limit is met. Default
+ * is 10000 packets.
+ *
+ * flow_limit
+ * Hard limit on the maximum number of packets queued per
+ * flow. Default value is 100.
+ *
+ * Use of TCP_TX_DELAY option will increase number of skbs in FQ qdisc,
+ * so packets would be dropped if any of the previous limit is hit.
+ * Using big delays might very well trigger
+ * old bugs in TSO auto defer logic and/or sndbuf limited detection.
+ ^
+ * [root@rjm-nas rjmcmahon]# tc qdisc replace dev enp4s0 root fq
+ * [root@rjm-nas rjmcmahon]# tc qdisc replace dev enp2s0 root fq
+ */
+void SetSocketTcpTxDelay(struct thread_Settings *mSettings, int delay) {
+#ifdef TCP_TX_DELAY
+#if HAVE_DECL_TCP_TX_DELAY
+ int rc = setsockopt(mSettings->mSock, IPPROTO_TCP, TCP_TX_DELAY, &delay, sizeof(delay));
+ if (rc == SOCKET_ERROR) {
+ fprintf(stderr, "Fail on TCP_TX_DELAY for sock %d\n", mSettings->mSock);
+ }
+#ifdef HAVE_THREAD_DEBUG
+ else {
+ Socklen_t len = sizeof(delay);
+ rc = getsockopt(mSettings->mSock, IPPROTO_TCP, TCP_TX_DELAY, reinterpret_cast<char*>(&delay), &len);
+ thread_debug("TCP_TX_DELAY set to %d for sock %d", (int) delay, mSettings->mSock);
+ }
+#endif
+#endif
#endif
}
+void sol_bindtodevice (struct thread_Settings *inSettings) {
+ char *device = (inSettings->mThreadMode == kMode_Client) ? inSettings->mIfrnametx : inSettings->mIfrname;
+ if (device) {
+#if (HAVE_DECL_SO_BINDTODEVICE)
+ struct ifreq ifr;
+ memset(&ifr, 0, sizeof(ifr));
+ snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", device);
+ if (setsockopt(inSettings->mSock, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) < 0) {
+ char *buf;
+ int len = snprintf(NULL, 0, "%s %s", "bind to device", device);
+ len++; // Trailing null byte + extra
+ buf = static_cast<char *>(malloc(len));
+ len = snprintf(buf, len, "%s %s", "bind to device", device);
+ WARN_errno(1, buf);
+ free(buf);
+ }
+#else
+ fprintf(stderr, "bind to device not supported\n");
+#endif
+
+ }
+}
+
+void SetSocketBindToDeviceIfNeeded (struct thread_Settings *inSettings) {
+ if (!isMulticast(inSettings)) {
+ // typically requires root privileges for unicast bind to device
+ sol_bindtodevice(inSettings);
+ }
+#ifndef WIN32
+ else { // multicast bind below
+ if (inSettings->mThreadMode != kMode_Client) {
+ // multicast on the server uses iperf_multicast_join for device binding
+ // found in listener code, do nothing and return
+ return;
+ }
+ // Handle client side bind to device for multicast
+ if (!isIPV6(inSettings)) {
+ // v4 tries with the -B ip first, then legacy socket bind
+ if (!((inSettings->mLocalhost != NULL) && iperf_multicast_sendif_v4(inSettings))) {
+ if (inSettings->mIfrnametx != NULL) {
+ sol_bindtodevice(inSettings);
+ }
+ }
+ } else {
+ if (!((inSettings->mIfrnametx != NULL) && iperf_multicast_sendif_v6(inSettings))) {
+ if (inSettings->mIfrnametx != NULL) {
+ sol_bindtodevice(inSettings);
+ }
+ }
+ }
+ }
+#endif
+}
/*
* Set a socket to blocking or non-blocking
-*
+ *
* Returns true on success, or false if there was an error
*/
bool setsock_blocking (int fd, bool blocking) {
diff --git a/src/ReportOutputs.c b/src/ReportOutputs.c
index e977433..2e34cb5 100644
--- a/src/ReportOutputs.c
+++ b/src/ReportOutputs.c
@@ -51,6 +51,7 @@
#include "Locale.h"
#include "SocketAddr.h"
#include "iperf_formattime.h"
+#include "dscp.h"
// These static variables are not thread safe but ok to use becase only
// the repoter thread usses them
@@ -68,6 +69,8 @@ static int HEADING_FLAG(report_bw_jitter_loss) = 0;
static int HEADING_FLAG(report_bw_read_enhanced) = 0;
static int HEADING_FLAG(report_bw_read_enhanced_netpwr) = 0;
static int HEADING_FLAG(report_bw_write_enhanced) = 0;
+static int HEADING_FLAG(report_bw_write_enhanced_fq) = 0;
+static int HEADING_FLAG(report_bw_write_fq) = 0;
static int HEADING_FLAG(report_write_enhanced_write) = 0;
static int HEADING_FLAG(report_bw_write_enhanced_netpwr) = 0;
static int HEADING_FLAG(report_bw_pps_enhanced) = 0;
@@ -81,7 +84,6 @@ static int HEADING_FLAG(report_frame_tcp_enhanced) = 0;
static int HEADING_FLAG(report_frame_read_tcp_enhanced_triptime) = 0;
static int HEADING_FLAG(report_udp_fullduplex) = 0;
static int HEADING_FLAG(report_sumcnt_bw) = 0;
-static int HEADING_FLAG(report_sumcnt_udp_fullduplex) = 0;
static int HEADING_FLAG(report_sumcnt_bw_read_enhanced) = 0;
static int HEADING_FLAG(report_sumcnt_bw_read_triptime) = 0;
static int HEADING_FLAG(report_sumcnt_bw_write_enhanced) = 0;
@@ -94,16 +96,21 @@ static int HEADING_FLAG(report_burst_write_tcp) = 0;
static int HEADING_FLAG(report_bw_isoch_enhanced_netpwr) = 0;
static int HEADING_FLAG(report_sumcnt_udp_enhanced) = 0;
static int HEADING_FLAG(report_sumcnt_udp_triptime) = 0;
+static int HEADING_FLAG(reportCSV_bw_read_enhanced) = 0;
+static int HEADING_FLAG(reportCSV_bw_write_enhanced) = 0;
+static int HEADING_FLAG(reportCSV_bw_jitter_loss_pps) = 0;
+static int HEADING_FLAG(reportCSV_client_bb_bw_tcp) = 0;
void reporter_default_heading_flags (int flag) {
HEADING_FLAG(report_bw) = flag;
HEADING_FLAG(report_client_bb_bw) = flag;
HEADING_FLAG(report_sumcnt_bw) = flag;
- HEADING_FLAG(report_sumcnt_udp_fullduplex) = flag;
HEADING_FLAG(report_bw_jitter_loss) = flag;
HEADING_FLAG(report_bw_read_enhanced) = flag;
HEADING_FLAG(report_bw_read_enhanced_netpwr) = flag;
HEADING_FLAG(report_bw_write_enhanced) = flag;
+ HEADING_FLAG(report_bw_write_enhanced_fq) = flag;
+ HEADING_FLAG(report_bw_write_fq) = flag;
HEADING_FLAG(report_write_enhanced_write) = flag;
HEADING_FLAG(report_write_enhanced_isoch) = flag;
HEADING_FLAG(report_bw_write_enhanced_netpwr) = flag;
@@ -126,7 +133,30 @@ void reporter_default_heading_flags (int flag) {
HEADING_FLAG(report_bw_isoch_enhanced_netpwr) = flag;
HEADING_FLAG(report_sumcnt_udp_enhanced) = flag;
HEADING_FLAG(report_sumcnt_udp_triptime) = flag;
+ HEADING_FLAG(reportCSV_bw_read_enhanced) = 0;
+ HEADING_FLAG(reportCSV_bw_write_enhanced) = 0;
+ HEADING_FLAG(reportCSV_bw_jitter_loss_pps) = 0;
+ HEADING_FLAG(reportCSV_client_bb_bw_tcp) = 0;
}
+
+//
+// flush when
+//
+// o) it's a final report
+// o) this is the sum report (all preceding interval reports need flush)
+// o) below the flush rate limiter
+//
+#define FLUSH_RATE_LIMITER 1000 //units is microseconds
+static inline void cond_flush (struct TransferInfo *stats) {
+ static struct timeval prev={0,0};
+ struct timeval now;
+ TimeGetNow(now);
+ if (stats->final || (stats->type == SUM_REPORT) || !(TimeDifferenceUsec(now, prev) < FLUSH_RATE_LIMITER)) {
+ fflush(stdout);
+ prev = now;
+ }
+}
+
static inline void _print_stats_common (struct TransferInfo *stats) {
assert(stats!=NULL);
outbuffer[0] = '\0';
@@ -145,13 +175,13 @@ static inline void _output_outoforder(struct TransferInfo *stats) {
if (stats->cntOutofOrder > 0) {
printf(report_outoforder,
stats->common->transferIDStr, stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
}
if (stats->l2counts.cnt) {
printf(report_l2statistics,
stats->common->transferIDStr, stats->ts.iStart,
stats->ts.iEnd, stats->l2counts.cnt, stats->l2counts.lengtherr,
- stats->l2counts.udpcsumerr, stats->l2counts.unknown);
+ stats->l2counts.udpcsumerr, stats->l2counts.unknown, (stats->common->Omit ? report_omitted : ""));
}
}
@@ -209,29 +239,29 @@ static inline void set_netpowerbuf(double meantransit, struct TransferInfo *stat
void tcp_output_fullduplex (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw);
_print_stats_common(stats);
- printf(report_bw_sum_fullduplex_format, stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext);
- fflush(stdout);
+ printf(report_bw_sum_fullduplex_format, stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_fullduplex_sum (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw);
_print_stats_common(stats);
- printf(report_sum_bw_format, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext);
- fflush(stdout);
+ printf(report_sum_bw_format, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_fullduplex_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw);
_print_stats_common(stats);
- printf(report_bw_sum_fullduplex_enhanced_format, stats->common->transferID, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext);
- fflush(stdout);
+ printf(report_bw_sum_fullduplex_enhanced_format, stats->common->transferID, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_read (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw);
_print_stats_common(stats);
- printf(report_bw_format, stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext);
- fflush(stdout);
+ printf(report_bw_format, stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
//TCP read or server output
void tcp_output_read_enhanced (struct TransferInfo *stats) {
@@ -248,8 +278,9 @@ void tcp_output_read_enhanced (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
- fflush(stdout);
+ stats->sock_callstats.read.bins[7],
+ (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_read_triptime (struct TransferInfo *stats) {
double meantransit;
@@ -279,7 +310,8 @@ void tcp_output_read_triptime (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
+ stats->sock_callstats.read.bins[7],
+ (stats->common->Omit ? report_omitted : ""));
} else {
meantransit = (stats->transit.total.cnt > 0) ? (stats->transit.total.sum / stats->transit.total.cnt) : 0;
set_netpowerbuf(meantransit, stats);
@@ -302,12 +334,13 @@ void tcp_output_read_triptime (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
+ stats->sock_callstats.read.bins[7],
+ (stats->common->Omit ? report_omitted : ""));
}
if (stats->framelatency_histogram) {
histogram_print(stats->framelatency_histogram, stats->ts.iStart, stats->ts.iEnd);
}
- fflush(stdout);
+ cond_flush(stats);
}
void tcp_output_read_enhanced_isoch (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_isoch_enhanced_netpwr);
@@ -334,7 +367,8 @@ void tcp_output_read_enhanced_isoch (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
+ stats->sock_callstats.read.bins[7],
+ (stats->common->Omit ? report_omitted : ""));
} else {
meantransit = (stats->isochstats.transit.total.cnt > 0) ? (stats->isochstats.transit.total.sum / stats->isochstats.transit.total.cnt) : 0;
set_netpowerbuf(meantransit, stats);
@@ -356,12 +390,13 @@ void tcp_output_read_enhanced_isoch (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
+ stats->sock_callstats.read.bins[7],
+ (stats->common->Omit ? report_omitted : ""));
}
if (stats->framelatency_histogram) {
histogram_print(stats->framelatency_histogram, stats->ts.iStart, stats->ts.iEnd);
}
- fflush(stdout);
+ cond_flush(stats);
}
void tcp_output_frame_read (struct TransferInfo *stats) {
@@ -378,8 +413,9 @@ void tcp_output_frame_read (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
- fflush(stdout);
+ stats->sock_callstats.read.bins[7],
+ (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_frame_read_triptime (struct TransferInfo *stats) {
fprintf(stderr, "FIXME\n");
@@ -403,7 +439,8 @@ void tcp_output_burst_read (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
stats->sock_callstats.read.bins[7],
- netpower_buf);
+ netpower_buf,
+ (stats->common->Omit ? report_omitted : ""));
} else {
printf(report_burst_read_tcp_final_format,
stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
@@ -420,9 +457,10 @@ void tcp_output_burst_read (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
+ stats->sock_callstats.read.bins[7],
+ (stats->common->Omit ? report_omitted : ""));
}
- fflush(stdout);
+ cond_flush(stats);
}
//TCP write or client output
@@ -431,8 +469,8 @@ void tcp_output_write (struct TransferInfo *stats) {
_print_stats_common(stats);
printf(report_bw_format, stats->common->transferIDStr,
stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- fflush(stdout);
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_write_bb (struct TransferInfo *stats) {
@@ -448,18 +486,35 @@ void tcp_output_write_bb (struct TransferInfo *stats) {
rps_string[sizeof(rps_string) - 1] = '\0';
#if HAVE_TCP_STATS
- printf(report_client_bb_bw_format, stats->common->transferIDStr,
- stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext,
- stats->bbrtt.total.cnt,
- (stats->bbrtt.total.mean * 1e3),
- (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.min * 1e3),
- (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.max * 1e3),
- (stats->bbrtt.total.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.total.m2 / (stats->bbrtt.total.cnt - 1))),
- stats->sock_callstats.write.tcpstats.retry,
- stats->sock_callstats.write.tcpstats.cwnd,
- stats->sock_callstats.write.tcpstats.rtt,
- rps_string);
+ if (!stats->final) {
+ printf(report_client_bb_bw_format, stats->common->transferIDStr,
+ stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->bbrtt.total.cnt,
+ (stats->bbrtt.total.mean * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.min * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.max * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.total.m2 / (stats->bbrtt.total.cnt - 1))),
+ stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.cwnd_packets,
+ stats->sock_callstats.write.tcpstats.rtt,
+ stats->sock_callstats.write.tcpstats.rttvar,
+ rps_string,
+ (stats->common->Omit ? report_omitted : ""));
+ } else {
+ printf(report_client_bb_bw_final_format, stats->common->transferIDStr,
+ stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->bbrtt.total.cnt,
+ (stats->bbrtt.total.mean * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.min * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.max * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.total.m2 / (stats->bbrtt.total.cnt - 1))),
+ stats->sock_callstats.write.tcpstats.retry,
+ rps_string,
+ (stats->common->Omit ? report_omitted : ""));
+ }
#else
printf(report_client_bb_bw_format, stats->common->transferIDStr,
stats->ts.iStart, stats->ts.iEnd,
@@ -469,7 +524,8 @@ void tcp_output_write_bb (struct TransferInfo *stats) {
(stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.min * 1e3),
(stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.max * 1e3),
(stats->bbrtt.total.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.total.m2 / (stats->bbrtt.total.cnt - 1))),
- rps_string);
+ rps_string,
+ (stats->common->Omit ? report_omitted : ""));
#endif
if (isTripTime(stats->common)) {
printf(report_client_bb_bw_triptime_format, stats->common->transferIDStr,
@@ -487,11 +543,23 @@ void tcp_output_write_bb (struct TransferInfo *stats) {
(stats->bbasym.total.cnt < 2) ? 0 : (stats->bbasym.total.min * 1e3),
(stats->bbasym.total.cnt < 2) ? 0 : (stats->bbasym.total.max * 1e3),
(stats->bbasym.total.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbasym.total.m2 / (stats->bbasym.total.cnt - 1))),
- rps_string);
+ (stats->common->Omit ? report_omitted : ""));
+ }
+ if (stats->bbowdto_histogram) {
+ stats->bbowdto_histogram->final = 1;
+ histogram_print(stats->bbowdto_histogram, stats->ts.iStart, stats->ts.iEnd);
+ }
+ if (stats->bbowdfro_histogram) {
+ stats->bbowdfro_histogram->final = 1;
+ histogram_print(stats->bbowdfro_histogram, stats->ts.iStart, stats->ts.iEnd);
}
if (stats->bbrtt_histogram) {
+ stats->bbrtt_histogram->final = 1;
histogram_print(stats->bbrtt_histogram, stats->ts.iStart, stats->ts.iEnd);
}
+ if (isTripTime(stats->common) && (stats->bb_clocksync_error > 0)) {
+ printf(report_client_bb_triptime_clocksync_error, stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd, stats->bb_clocksync_error);
+ }
} else {
double rps = ((stats->bbrtt.current.cnt > 0) && (stats->iBBrunning > 0)) ? ((double) stats->bbrtt.current.cnt / stats->iBBrunning) : 0;
if (rps < 10)
@@ -511,8 +579,11 @@ void tcp_output_write_bb (struct TransferInfo *stats) {
(stats->bbrtt.current.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.current.m2 / (stats->bbrtt.current.cnt - 1))),
stats->sock_callstats.write.tcpstats.retry,
stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.cwnd_packets,
stats->sock_callstats.write.tcpstats.rtt,
- rps_string);
+ stats->sock_callstats.write.tcpstats.rttvar,
+ rps_string,
+ (stats->common->Omit ? report_omitted : ""));
#else
printf(report_client_bb_bw_format, stats->common->transferIDStr,
stats->ts.iStart, stats->ts.iEnd,
@@ -522,10 +593,43 @@ void tcp_output_write_bb (struct TransferInfo *stats) {
(stats->bbrtt.current.cnt < 2) ? 0 : (stats->bbrtt.current.min * 1e3),
(stats->bbrtt.current.cnt < 2) ? 0 : (stats->bbrtt.current.max * 1e3),
(stats->bbrtt.current.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.current.m2 / (stats->bbrtt.current.cnt - 1))),
- rps_string);
+ rps_string,
+ (stats->common->Omit ? report_omitted : ""));
#endif
+ if (isTripTime(stats->common)) {
+ printf(report_client_bb_bw_triptime_format, stats->common->transferIDStr,
+ stats->ts.iStart, stats->ts.iEnd,
+ stats->bbowdto.current.cnt,
+ (stats->bbowdto.current.mean * 1e3),
+ (stats->bbowdto.current.cnt < 2) ? 0 : (stats->bbowdto.current.min * 1e3),
+ (stats->bbowdto.current.cnt < 2) ? 0 : (stats->bbowdto.current.max * 1e3),
+ (stats->bbowdto.current.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbowdto.current.m2 / (stats->bbowdto.current.cnt - 1))),
+ (stats->bbowdfro.current.mean * 1e3),
+ (stats->bbowdfro.current.cnt < 2) ? 0 : (stats->bbowdfro.current.min * 1e3),
+ (stats->bbowdfro.current.cnt < 2) ? 0 : (stats->bbowdfro.current.max * 1e3),
+ (stats->bbowdfro.current.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbowdfro.current.m2 / (stats->bbowdfro.current.cnt - 1))),
+ (stats->bbasym.current.mean * 1e3),
+ (stats->bbasym.current.cnt < 2) ? 0 : (stats->bbasym.current.min * 1e3),
+ (stats->bbasym.current.cnt < 2) ? 0 : (stats->bbasym.current.max * 1e3),
+ (stats->bbasym.current.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbasym.current.m2 / (stats->bbasym.current.cnt - 1))),
+ (stats->common->Omit ? report_omitted : ""));
+ }
+ if (isHistogram(stats->common)) {
+ if (stats->bbowdto_histogram) {
+ stats->bbowdto_histogram->final = 0;
+ histogram_print(stats->bbowdto_histogram, stats->ts.iStart, stats->ts.iEnd);
+ }
+ if (stats->bbowdfro_histogram) {
+ stats->bbowdfro_histogram->final = 0;
+ histogram_print(stats->bbowdfro_histogram, stats->ts.iStart, stats->ts.iEnd);
+ }
+ if (stats->bbrtt_histogram) {
+ stats->bbrtt_histogram->final = 0;
+ histogram_print(stats->bbrtt_histogram, stats->ts.iStart, stats->ts.iEnd);
+ }
+ }
}
- fflush(stdout);
+ cond_flush(stats);
}
void tcp_output_burst_write (struct TransferInfo *stats) {
@@ -542,16 +646,18 @@ void tcp_output_burst_write (struct TransferInfo *stats) {
stats->sock_callstats.write.tcpstats.retry,
stats->sock_callstats.write.tcpstats.cwnd,
stats->sock_callstats.write.tcpstats.rtt,
- netpower_buf);
+ netpower_buf,
+ (stats->common->Omit ? report_omitted : ""));
#else
printf(report_burst_write_tcp_format, stats->common->transferIDStr,
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->transit.current.mean,
stats->sock_callstats.write.WriteCnt,
- stats->sock_callstats.write.WriteErr);
+ stats->sock_callstats.write.WriteErr,
+ (stats->common->Omit ? report_omitted : ""));
#endif
- fflush(stdout);
+ cond_flush(stats);
}
void tcp_output_write_enhanced (struct TransferInfo *stats) {
@@ -562,37 +668,121 @@ void tcp_output_write_enhanced (struct TransferInfo *stats) {
stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->sock_callstats.write.WriteCnt,
- stats->sock_callstats.write.WriteErr);
+ stats->sock_callstats.write.WriteErr,
+ (stats->common->Omit ? report_omitted : ""));
#else
set_netpowerbuf(stats->sock_callstats.write.tcpstats.rtt * 1e-6, stats);
- if (stats->sock_callstats.write.tcpstats.cwnd > 0) {
- printf(report_bw_write_enhanced_format,
+#if HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND
+ printf(report_bw_write_enhanced_format,
+ stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->sock_callstats.write.WriteCnt,
+ stats->sock_callstats.write.WriteErr,
+ stats->sock_callstats.write.tcpstats.retry,
+#if HAVE_TCP_INFLIGHT
+ stats->sock_callstats.write.tcpstats.bytes_in_flight,
+ stats->sock_callstats.write.tcpstats.packets_in_flight,
+#endif
+ stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.cwnd_packets,
+ stats->sock_callstats.write.tcpstats.rtt,
+ stats->sock_callstats.write.tcpstats.rttvar,
+ netpower_buf,
+ (stats->common->Omit ? report_omitted : ""));
+#else
+ printf(report_bw_write_enhanced_nocwnd_format,
+ stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->sock_callstats.write.WriteCnt,
+ stats->sock_callstats.write.WriteErr,
+ stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.rtt,
+ stats->sock_callstats.write.tcpstats.rttvar,
+ netpower_buf,
+ (stats->common->Omit ? report_omitted : ""));
+#endif
+#endif
+#if HAVE_DECL_TCP_NOTSENT_LOWAT
+ if (stats->latency_histogram) {
+ histogram_print(stats->latency_histogram, stats->ts.iStart, stats->ts.iEnd);
+ }
+#endif
+ cond_flush(stats);
+}
+
+void tcp_output_write_enhanced_fq (struct TransferInfo *stats) {
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ _print_stats_common(stats);
+ char pacingrate[40];
+ if (!stats->final) {
+ byte_snprintf(pacingrate, sizeof(pacingrate), stats->FQPacingRateCurrent, 'a');
+ pacingrate[39] = '\0';
+ } else {
+ pacingrate[0] = '\0';
+ }
+#if !(HAVE_TCP_STATS)
+ HEADING_PRINT_COND(report_bw_write_fq);
+ printf(report_bw_write_fq_format,
+ stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->sock_callstats.write.WriteCnt,
+ stats->sock_callstats.write.WriteErr,
+ pacingrate,
+ (stats->common->Omit ? report_omitted : ""));
+#else
+ HEADING_PRINT_COND(report_bw_write_enhanced_fq);
+ set_netpowerbuf(stats->sock_callstats.write.tcpstats.rtt * 1e-6, stats);
+#if HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND
+ if (!stats->final) {
+ printf(report_bw_write_enhanced_fq_format,
stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->sock_callstats.write.WriteCnt,
stats->sock_callstats.write.WriteErr,
stats->sock_callstats.write.tcpstats.retry,
+#if HAVE_TCP_INFLIGHT
+ stats->sock_callstats.write.tcpstats.bytes_in_flight,
+ stats->sock_callstats.write.tcpstats.packets_in_flight,
+#endif
stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.cwnd_packets,
stats->sock_callstats.write.tcpstats.rtt,
stats->sock_callstats.write.tcpstats.rttvar,
- netpower_buf);
+ pacingrate, netpower_buf,
+ (stats->common->Omit ? report_omitted : ""));
} else {
- printf(report_bw_write_enhanced_nocwnd_format,
+ printf(report_bw_write_enhanced_fq_final_format,
stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->sock_callstats.write.WriteCnt,
stats->sock_callstats.write.WriteErr,
stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.cwnd,
stats->sock_callstats.write.tcpstats.rtt,
- netpower_buf);
+ stats->sock_callstats.write.tcpstats.rttvar,
+ netpower_buf,
+ (stats->common->Omit ? report_omitted : ""));
}
+#else
+ printf(report_bw_write_enhanced_nocwnd_format,
+ stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->sock_callstats.write.WriteCnt,
+ stats->sock_callstats.write.WriteErr,
+ stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.rtt,
+ stats->sock_callstats.write.tcpstats.rttvar,
+ netpower_buf,
+ (stats->common->Omit ? report_omitted : ""));
+#endif
#endif
#if HAVE_DECL_TCP_NOTSENT_LOWAT
if (stats->latency_histogram) {
histogram_print(stats->latency_histogram, stats->ts.iStart, stats->ts.iEnd);
}
#endif
- fflush(stdout);
+ cond_flush(stats);
+#endif
}
void tcp_output_write_enhanced_write (struct TransferInfo *stats) {
@@ -608,39 +798,48 @@ void tcp_output_write_enhanced_write (struct TransferInfo *stats) {
stats->write_mmm.current.min * 1e3,
stats->write_mmm.current.max * 1e3,
(stats->write_mmm.current.cnt < 2) ? 0 : (1e-3 * sqrt(stats->write_mmm.current.m2 / (stats->write_mmm.current.cnt - 1))),
- stats->write_mmm.current.cnt);
+ stats->write_mmm.current.cnt,
+ (stats->common->Omit ? report_omitted : ""));
#else
set_netpowerbuf(stats->sock_callstats.write.tcpstats.rtt * 1e-6, stats);
- if (stats->sock_callstats.write.tcpstats.cwnd > 0) {
- printf(report_write_enhanced_write_format,
- stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext,
- stats->sock_callstats.write.WriteCnt,
- stats->sock_callstats.write.WriteErr,
- stats->sock_callstats.write.tcpstats.retry,
- stats->sock_callstats.write.tcpstats.cwnd,
- stats->sock_callstats.write.tcpstats.rtt,
- netpower_buf,
- stats->write_mmm.current.mean * 1e-3,
- stats->write_mmm.current.min * 1e-3,
- stats->write_mmm.current.max * 1e-3,
- (stats->write_mmm.current.cnt < 2) ? 0 : (1e-3 * sqrt(stats->write_mmm.current.m2 / (stats->write_mmm.current.cnt - 1))),
- stats->write_mmm.current.cnt);
- } else {
- printf(report_write_enhanced_nocwnd_write_format,
- stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext,
- stats->sock_callstats.write.WriteCnt,
- stats->sock_callstats.write.WriteErr,
- stats->sock_callstats.write.tcpstats.retry,
- stats->sock_callstats.write.tcpstats.rtt,
- netpower_buf,
- stats->write_mmm.current.mean * 1e3,
- stats->write_mmm.current.min * 1e3,
- stats->write_mmm.current.max * 1e3,
- (stats->write_mmm.current.cnt < 2) ? 0 : (1e3 * sqrt(stats->write_mmm.current.m2 / (stats->write_mmm.current.cnt - 1))),
- stats->write_mmm.current.cnt);
- }
+#if HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND
+ printf(report_write_enhanced_write_format,
+ stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->sock_callstats.write.WriteCnt,
+ stats->sock_callstats.write.WriteErr,
+ stats->sock_callstats.write.tcpstats.retry,
+#if HAVE_TCP_INFLIGHT
+ stats->sock_callstats.write.tcpstats.bytes_in_flight,
+ stats->sock_callstats.write.tcpstats.packets_in_flight,
+#endif
+ stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.cwnd_packets,
+ stats->sock_callstats.write.tcpstats.rtt,
+ stats->sock_callstats.write.tcpstats.rttvar,
+ netpower_buf,
+ stats->write_mmm.current.mean * 1e-3,
+ stats->write_mmm.current.min * 1e-3,
+ stats->write_mmm.current.max * 1e-3,
+ (stats->write_mmm.current.cnt < 2) ? 0 : (1e-3 * sqrt(stats->write_mmm.current.m2 / (stats->write_mmm.current.cnt - 1))),
+ stats->write_mmm.current.cnt,
+ (stats->common->Omit ? report_omitted : ""));
+#else
+ printf(report_write_enhanced_nocwnd_write_format,
+ stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->sock_callstats.write.WriteCnt,
+ stats->sock_callstats.write.WriteErr,
+ stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.rtt,
+ stats->sock_callstats.write.tcpstats.rttvar,
+ netpower_buf,
+ stats->write_mmm.current.mean * 1e3,
+ stats->write_mmm.current.min * 1e3,
+ stats->write_mmm.current.max * 1e3,
+ (stats->write_mmm.current.cnt < 2) ? 0 : (1e3 * sqrt(stats->write_mmm.current.m2 / (stats->write_mmm.current.cnt - 1))),
+ stats->write_mmm.current.cnt, (stats->common->Omit ? report_omitted : ""));
+#endif
#endif
if (stats->latency_histogram) {
histogram_print(stats->latency_histogram, stats->ts.iStart, stats->ts.iEnd);
@@ -648,7 +847,7 @@ void tcp_output_write_enhanced_write (struct TransferInfo *stats) {
if (stats->write_histogram) {
histogram_print(stats->write_histogram, stats->ts.iStart, stats->ts.iEnd);
}
- fflush(stdout);
+ cond_flush(stats);
}
void tcp_output_write_enhanced_isoch (struct TransferInfo *stats) {
@@ -660,38 +859,41 @@ void tcp_output_write_enhanced_isoch (struct TransferInfo *stats) {
outbuffer, outbufferext,
stats->sock_callstats.write.WriteCnt,
stats->sock_callstats.write.WriteErr,
- stats->isochstats.cntFrames, stats->isochstats.cntFramesMissed, stats->isochstats.cntSlips);
+ stats->isochstats.cntFrames, stats->isochstats.cntFramesMissed, stats->isochstats.cntSlips, (stats->common->Omit ? report_omitted : ""));
#else
set_netpowerbuf(stats->sock_callstats.write.tcpstats.rtt * 1e-6, stats);
- if (stats->sock_callstats.write.tcpstats.cwnd > 0) {
- printf(report_write_enhanced_isoch_format,
- stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext,
- stats->sock_callstats.write.WriteCnt,
- stats->sock_callstats.write.WriteErr,
- stats->sock_callstats.write.tcpstats.retry,
- stats->sock_callstats.write.tcpstats.cwnd,
- stats->sock_callstats.write.tcpstats.rtt,
- stats->isochstats.cntFrames, stats->isochstats.cntFramesMissed, stats->isochstats.cntSlips,
- netpower_buf);
- } else {
- printf(report_write_enhanced_isoch_nocwnd_format,
- stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext,
- stats->sock_callstats.write.WriteCnt,
- stats->sock_callstats.write.WriteErr,
- stats->sock_callstats.write.tcpstats.retry,
- stats->sock_callstats.write.tcpstats.rtt,
- stats->isochstats.cntFrames, stats->isochstats.cntFramesMissed, stats->isochstats.cntSlips,
- netpower_buf);
- }
+#if HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND
+ printf(report_write_enhanced_isoch_format,
+ stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->sock_callstats.write.WriteCnt,
+ stats->sock_callstats.write.WriteErr,
+ stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.cwnd_packets,
+ stats->sock_callstats.write.tcpstats.rtt,
+ stats->sock_callstats.write.tcpstats.rttvar,
+ stats->isochstats.cntFrames, stats->isochstats.cntFramesMissed, stats->isochstats.cntSlips,
+ netpower_buf,(stats->common->Omit ? report_omitted : ""));
+#else
+ printf(report_write_enhanced_isoch_nocwnd_format,
+ stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ stats->sock_callstats.write.WriteCnt,
+ stats->sock_callstats.write.WriteErr,
+ stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.rtt,
+ stats->sock_callstats.write.tcpstats.rttvar,
+ stats->isochstats.cntFrames, stats->isochstats.cntFramesMissed, stats->isochstats.cntSlips,
+ netpower_buf,(stats->common->Omit ? report_omitted : ""));
+#endif
#endif
#if HAVE_DECL_TCP_NOTSENT_LOWAT
if (stats->latency_histogram) {
histogram_print(stats->latency_histogram, stats->ts.iStart, stats->ts.iEnd);
}
#endif
- fflush(stdout);
+ cond_flush(stats);
}
@@ -700,50 +902,65 @@ void udp_output_fullduplex (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_udp_fullduplex);
_print_stats_common(stats);
printf(report_udp_fullduplex_format, stats->common->transferIDStr, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, \
- stats->cntDatagrams, (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0));
- fflush(stdout);
+ stats->cntDatagrams, (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0),(stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void udp_output_fullduplex_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_udp_fullduplex);
_print_stats_common(stats);
printf(report_udp_fullduplex_enhanced_format, stats->common->transferID, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, \
- stats->cntDatagrams, (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0));
- fflush(stdout);
+ stats->cntDatagrams, (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0),(stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void udp_output_fullduplex_sum (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_udp_fullduplex);
_print_stats_common(stats);
printf(report_udp_fullduplex_sum_format, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, \
- stats->cntDatagrams, (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0));
- fflush(stdout);
+ stats->cntDatagrams, (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0),(stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void udp_output_read (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_jitter_loss);
_print_stats_common(stats);
- printf(report_bw_jitter_loss_format, stats->common->transferIDStr,
- stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext,
- (stats->final) ? ((stats->inline_jitter.total.sum / (double) stats->inline_jitter.total.cnt) * 1e3) : (stats->jitter * 1e3), \
- stats->cntError, stats->cntDatagrams,
- (100.0 * stats->cntError) / stats->cntDatagrams);
+ if (!stats->cntIPG) {
+ printf(report_bw_jitter_loss_format, stats->common->transferIDStr,
+ stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ 0.0, stats->cntError,
+ stats->cntDatagrams,
+ 0.0,(stats->common->Omit ? report_omitted : ""));
+ } else {
+ printf(report_bw_jitter_loss_format, stats->common->transferIDStr,
+ stats->ts.iStart, stats->ts.iEnd,
+ outbuffer, outbufferext,
+ (stats->final) ? ((stats->inline_jitter.total.sum / (double) stats->inline_jitter.total.cnt) * 1e3) : (stats->jitter * 1e3), \
+ stats->cntError, stats->cntDatagrams,
+ (100.0 * stats->cntError) / stats->cntDatagrams, (stats->common->Omit ? report_omitted : ""));
+ }
_output_outoforder(stats);
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_read_triptime (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_jitter_loss_enhanced_triptime);
_print_stats_common(stats);
+
if (!stats->cntIPG) {
printf(report_bw_jitter_loss_suppress_enhanced_format, stats->common->transferIDStr,
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
0.0, stats->cntError,
stats->cntDatagrams,
- 0.0,0.0,0.0,0.0,0.0,0.0);
+ stats->sock_callstats.read.cntRead,
+ stats->sock_callstats.read.cntReadTimeo,
+#if HAVE_DECL_MSG_TRUNC
+ stats->sock_callstats.read.cntReadErrLen,
+#endif
+ 0.0,0.0,0.0,0.0,0.0,0.0,(stats->common->Omit ? report_omitted : ""));
} else {
if ((stats->transit.current.min > UNREALISTIC_LATENCYMINMAX) ||
(stats->transit.current.min < UNREALISTIC_LATENCYMINMIN)) {
@@ -753,7 +970,14 @@ void udp_output_read_triptime (struct TransferInfo *stats) {
(stats->final) ? ((stats->inline_jitter.total.sum / (double) stats->inline_jitter.total.cnt) * 1e3) : (stats->jitter * 1e3),
stats->cntError, stats->cntDatagrams,
(100.0 * stats->cntError) / stats->cntDatagrams,
- (stats->cntIPG / stats->IPGsum));
+ (stats->cntIPG / stats->IPGsum),
+ stats->sock_callstats.read.cntRead,
+#if HAVE_DECL_MSG_TRUNC
+ stats->sock_callstats.read.cntReadTimeo,
+ stats->sock_callstats.read.cntReadErrLen,(stats->common->Omit ? report_omitted : ""));
+#else
+ stats->sock_callstats.read.cntReadTimeo, (stats->common->Omit ? report_omitted : ""));
+#endif
} else {
double meantransit;
double variance;
@@ -785,7 +1009,12 @@ void udp_output_read_triptime (struct TransferInfo *stats) {
(stats->cntIPG / stats->IPGsum),
stats->cntIPG,
llaw_bufstr,
- netpower_buf);
+ stats->sock_callstats.read.cntRead,
+ stats->sock_callstats.read.cntReadTimeo,
+#if HAVE_DECL_MSG_TRUNC
+ stats->sock_callstats.read.cntReadErrLen,
+#endif
+ netpower_buf, (stats->common->Omit ? report_omitted : ""));
}
}
if (stats->latency_histogram) {
@@ -795,7 +1024,7 @@ void udp_output_read_triptime (struct TransferInfo *stats) {
histogram_print(stats->jitter_histogram, stats->ts.iStart, stats->ts.iEnd);
}
_output_outoforder(stats);
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_read_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_jitter_loss_enhanced);
@@ -806,7 +1035,12 @@ void udp_output_read_enhanced (struct TransferInfo *stats) {
outbuffer, outbufferext,
0.0, stats->cntError,
stats->cntDatagrams,
- 0.0,0.0,0.0,0.0,0.0,0.0);
+ stats->sock_callstats.read.cntRead,
+ stats->sock_callstats.read.cntReadTimeo,
+#if HAVE_DECL_MSG_TRUNC
+ stats->sock_callstats.read.cntReadErrLen,
+#endif
+ 0.0,0.0,0.0,0.0,0.0,0.0, (stats->common->Omit ? report_omitted : ""));
} else {
if ((stats->transit.current.min > UNREALISTIC_LATENCYMINMAX) ||
(stats->transit.current.min < UNREALISTIC_LATENCYMINMIN)) {
@@ -816,7 +1050,14 @@ void udp_output_read_enhanced (struct TransferInfo *stats) {
(stats->final) ? ((stats->inline_jitter.total.sum / (double) stats->inline_jitter.total.cnt) * 1e3) : (stats->jitter * 1e3),
stats->cntError, stats->cntDatagrams,
(100.0 * stats->cntError) / stats->cntDatagrams,
- (stats->cntIPG / stats->IPGsum));
+ (stats->cntIPG / stats->IPGsum),
+ stats->sock_callstats.read.cntRead,
+#if HAVE_DECL_MSG_TRUNC
+ stats->sock_callstats.read.cntReadTimeo,
+ stats->sock_callstats.read.cntReadErrLen, (stats->common->Omit ? report_omitted : ""));
+#else
+ stats->sock_callstats.read.cntReadTimeo, (stats->common->Omit ? report_omitted : ""));
+#endif
} else {
double meantransit;
double variance;
@@ -841,7 +1082,12 @@ void udp_output_read_enhanced (struct TransferInfo *stats) {
((stats->final ? stats->transit.total.max : stats->transit.current.max) * 1e3),
(stats->final ? (stats->transit.total.cnt < 2) : (stats->transit.current.cnt < 2)) ? 0 : (1e3 * variance), // convert from sec to ms
(stats->cntIPG / stats->IPGsum),
- netpower_buf);
+ stats->sock_callstats.read.cntRead,
+ stats->sock_callstats.read.cntReadTimeo,
+#if HAVE_DECL_MSG_TRUNC
+ stats->sock_callstats.read.cntReadErrLen,
+#endif
+ netpower_buf, (stats->common->Omit ? report_omitted : ""));
}
}
if (stats->latency_histogram) {
@@ -851,7 +1097,7 @@ void udp_output_read_enhanced (struct TransferInfo *stats) {
histogram_print(stats->jitter_histogram, stats->ts.iStart, stats->ts.iEnd);
}
_output_outoforder(stats);
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_read_triptime_isoch (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_jitter_loss_enhanced_isoch_triptime);
@@ -876,7 +1122,7 @@ void udp_output_read_triptime_isoch (struct TransferInfo *stats) {
(stats->final) ? ((stats->inline_jitter.total.sum / (double) stats->inline_jitter.total.cnt) * 1e3) : (stats->jitter * 1e3),
stats->cntError, stats->cntDatagrams,
(100.0 * stats->cntError) / stats->cntDatagrams,
- (stats->cntIPG / stats->IPGsum));
+ (stats->cntIPG / stats->IPGsum), (stats->common->Omit ? report_omitted : ""));
} else {
double frame_meantransit = (stats->isochstats.transit.current.cnt > 0) ? (stats->isochstats.transit.current.sum / stats->isochstats.transit.current.cnt) : 0;
double meantransit = (stats->transit.current.cnt > 0) ? (stats->transit.current.sum / stats->transit.current.cnt) : 0;
@@ -897,7 +1143,7 @@ void udp_output_read_triptime_isoch (struct TransferInfo *stats) {
stats->isochstats.transit.current.min * 1e3,
stats->isochstats.transit.current.max * 1e3,
(stats->isochstats.transit.current.cnt < 2) ? 0 : 1e3 * (sqrt(stats->isochstats.transit.current.m2 / (stats->isochstats.transit.current.cnt - 1))),
- netpower_buf);
+ netpower_buf, (stats->common->Omit ? report_omitted : ""));
#if 0
if (stats->final) {
printf("***** Jitter MMM = %f/%f/%f\n",stats->inline_jitter.total.mean, stats->inline_jitter.total.min, stats->inline_jitter.total.max);
@@ -915,15 +1161,15 @@ void udp_output_read_triptime_isoch (struct TransferInfo *stats) {
histogram_print(stats->framelatency_histogram, stats->ts.iStart, stats->ts.iEnd);
}
_output_outoforder(stats);
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_write (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw);
_print_stats_common(stats);
printf(report_bw_format, stats->common->transferIDStr,
stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- fflush(stdout);
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void udp_output_write_enhanced (struct TransferInfo *stats) {
@@ -934,8 +1180,9 @@ void udp_output_write_enhanced (struct TransferInfo *stats) {
outbuffer, outbufferext,
stats->sock_callstats.write.WriteCnt,
stats->sock_callstats.write.WriteErr,
- (stats->cntIPG ? (stats->cntIPG / stats->IPGsum) : 0.0));
- fflush(stdout);
+ stats->sock_callstats.write.WriteTimeo,
+ (stats->cntIPG ? (stats->cntIPG / stats->IPGsum) : 0.0), (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void udp_output_write_enhanced_isoch (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_pps_enhanced_isoch);
@@ -946,8 +1193,8 @@ void udp_output_write_enhanced_isoch (struct TransferInfo *stats) {
stats->sock_callstats.write.WriteCnt,
stats->sock_callstats.write.WriteErr,
(stats->cntIPG ? (stats->cntIPG / stats->IPGsum) : 0.0),
- stats->isochstats.cntFrames, stats->isochstats.cntFramesMissed, stats->isochstats.cntSlips);
- fflush(stdout);
+ stats->isochstats.cntFrames, stats->isochstats.cntFramesMissed, stats->isochstats.cntSlips, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
// Sum reports
@@ -958,121 +1205,123 @@ void udp_output_sum_read (struct TransferInfo *stats) {
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->cntError, stats->cntDatagrams,
- (100.0 * stats->cntError) / stats->cntDatagrams);
+ ((100.0 * stats->cntError) / stats->cntDatagrams),
+ (stats->common->Omit ? report_omitted : ""));
if ((stats->cntOutofOrder > 0) && stats->final) {
printf(report_sum_outoforder,
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
}
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_sumcnt (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw);
_print_stats_common(stats);
- printf(report_sumcnt_bw_format, stats->threadcnt,
+ printf(report_sumcnt_bw_format, stats->slot_thread_downcount,
stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- if ((stats->cntOutofOrder > 0) && stats->final) {
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ if ((stats->cntOutofOrder > 0) && stats->final) {
if (isSumOnly(stats->common)) {
printf(report_sumcnt_outoforder,
- stats->threadcnt,
+ stats->threadcnt_final,
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
} else {
printf(report_outoforder,
stats->common->transferIDStr, stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
}
}
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_sumcnt_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw_jitter_loss);
_print_stats_common(stats);
- printf(report_sumcnt_bw_jitter_loss_format, stats->threadcnt, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, \
- stats->cntError, stats->cntDatagrams, (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0));
+ printf(report_sumcnt_bw_jitter_loss_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount), stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, \
+ stats->cntError, stats->cntDatagrams, (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0), (stats->common->Omit ? report_omitted : ""));
if ((stats->cntOutofOrder > 0) && stats->final) {
if (isSumOnly(stats->common)) {
printf(report_sumcnt_outoforder,
- stats->threadcnt,
+ (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
} else {
printf(report_sum_outoforder,
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder,(stats->common->Omit ? report_omitted : ""));
}
}
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_sumcnt_read_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw_read_enhanced);
_print_stats_common(stats);
- printf(report_sumcnt_bw_read_enhanced_format, stats->threadcnt,
+ printf(report_sumcnt_bw_read_enhanced_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
(stats->final) ? ((stats->inline_jitter.total.sum / (double) stats->inline_jitter.total.cnt) * 1e3) : (stats->jitter * 1e3), \
stats->cntError, stats->cntDatagrams,
- (100.0 * stats->cntError) / stats->cntDatagrams);
+ (100.0 * stats->cntError) / stats->cntDatagrams, (stats->common->Omit ? report_omitted : ""));
if ((stats->cntOutofOrder > 0) && stats->final) {
if (isSumOnly(stats->common)) {
printf(report_sumcnt_outoforder,
- stats->threadcnt,
+ (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
} else {
printf(report_sum_outoforder,
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
}
}
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_sumcnt_read_triptime (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_udp_triptime);
_print_stats_common(stats);
- printf(report_sumcnt_udp_triptime_format, stats->threadcnt, stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, \
- stats->cntError, stats->cntDatagrams, stats->cntIPG, (stats->final ? stats->fInP : stats->iInP), (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0));
- if ((stats->cntOutofOrder > 0) && stats->final) {
+ printf(report_sumcnt_udp_triptime_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount), stats->ts.iStart, stats->ts.iEnd, outbuffer, outbufferext, \
+ stats->cntError, stats->cntDatagrams, stats->cntIPG, (stats->final ? stats->fInP : stats->iInP), \
+ (stats->cntIPG && (stats->IPGsum > 0.0) ? (stats->cntIPG / stats->IPGsum) : 0.0), (stats->common->Omit ? report_omitted : ""));
+ if ((stats->cntOutofOrder > 0) && stats->final) {
if (isSumOnly(stats->common)) {
printf(report_sumcnt_outoforder,
- stats->threadcnt,
+ stats->threadcnt_final,
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
} else {
printf(report_sum_outoforder,
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
}
}
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_sum_write (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw);
_print_stats_common(stats);
printf(report_sum_bw_format, stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- fflush(stdout);
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void udp_output_sumcnt_write (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw);
_print_stats_common(stats);
- printf(report_sumcnt_bw_format, stats->threadcnt,
+ printf(report_sumcnt_bw_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- fflush(stdout);
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void udp_output_sum_read_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_udp_enhanced);
_print_stats_common(stats);
- printf(report_sumcnt_udp_enhanced_format, stats->threadcnt,
+ printf(report_sumcnt_udp_enhanced_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->cntError, stats->cntDatagrams,
- (stats->cntIPG ? (stats->cntIPG / stats->IPGsum) : 0.0));
+ (stats->cntIPG ? (stats->cntIPG / stats->IPGsum) : 0.0), (stats->common->Omit ? report_omitted : ""));
if (stats->latency_histogram && stats->final) {
histogram_print(stats->latency_histogram, stats->ts.iStart, stats->ts.iEnd);
}
@@ -1082,16 +1331,16 @@ void udp_output_sum_read_enhanced (struct TransferInfo *stats) {
if ((stats->cntOutofOrder > 0) && stats->final) {
if (isSumOnly(stats->common)) {
printf(report_sumcnt_outoforder,
- stats->threadcnt,
+ stats->threadcnt_final,
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
} else {
printf(report_sum_outoforder,
stats->ts.iStart,
- stats->ts.iEnd, stats->cntOutofOrder);
+ stats->ts.iEnd, stats->cntOutofOrder, (stats->common->Omit ? report_omitted : ""));
}
}
- fflush(stdout);
+ cond_flush(stats);
}
void udp_output_sum_write_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_pps_enhanced);
@@ -1101,19 +1350,19 @@ void udp_output_sum_write_enhanced (struct TransferInfo *stats) {
outbuffer, outbufferext,
stats->sock_callstats.write.WriteCnt,
stats->sock_callstats.write.WriteErr,
- ((stats->cntIPG && (stats->IPGsum > 0.0)) ? (stats->cntIPG / stats->IPGsum) : 0.0));
- fflush(stdout);
+ ((stats->cntIPG && (stats->IPGsum > 0.0)) ? (stats->cntIPG / stats->IPGsum) : 0.0), (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void udp_output_sumcnt_write_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw_pps_enhanced);
_print_stats_common(stats);
- printf(report_sumcnt_bw_pps_enhanced_format, stats->threadcnt,
+ printf(report_sumcnt_bw_pps_enhanced_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->sock_callstats.write.WriteCnt,
stats->sock_callstats.write.WriteErr,
- ((stats->cntIPG && (stats->IPGsum > 0.0)) ? (stats->cntIPG / stats->IPGsum) : 0.0));
- fflush(stdout);
+ ((stats->cntIPG && (stats->IPGsum > 0.0)) ? (stats->cntIPG / stats->IPGsum) : 0.0), (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_sum_read (struct TransferInfo *stats) {
@@ -1121,8 +1370,8 @@ void tcp_output_sum_read (struct TransferInfo *stats) {
_print_stats_common(stats);
printf(report_sum_bw_format,
stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- fflush(stdout);
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_sum_read_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_read_enhanced);
@@ -1138,24 +1387,24 @@ void tcp_output_sum_read_enhanced (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
+ stats->sock_callstats.read.bins[7], (stats->common->Omit ? report_omitted : ""));
if (stats->framelatency_histogram && stats->final) {
histogram_print(stats->framelatency_histogram, stats->ts.iStart, stats->ts.iEnd);
}
- fflush(stdout);
+ cond_flush(stats);
}
void tcp_output_sumcnt_read (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw);
_print_stats_common(stats);
- printf(report_sumcnt_bw_format, stats->threadcnt,
+ printf(report_sumcnt_bw_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- fflush(stdout);
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_sumcnt_read_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw_read_enhanced);
_print_stats_common(stats);
- printf(report_sumcnt_bw_read_enhanced_format, stats->threadcnt,
+ printf(report_sumcnt_bw_read_enhanced_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->sock_callstats.read.cntRead,
@@ -1166,15 +1415,15 @@ void tcp_output_sumcnt_read_enhanced (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
- fflush(stdout);
+ stats->sock_callstats.read.bins[7], (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_sumcnt_read_triptime (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw_read_triptime);
_print_stats_common(stats);
char llaw_bufstr[LLAWBUFSIZE];
human_format_llawbuf(llaw_bufstr, sizeof(llaw_bufstr), ((stats->final) ? stats->fInP : stats->iInP));
- printf(report_sumcnt_bw_read_triptime_format, stats->threadcnt,
+ printf(report_sumcnt_bw_read_triptime_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
llaw_bufstr,
@@ -1186,8 +1435,8 @@ void tcp_output_sumcnt_read_triptime (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[4],
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
- stats->sock_callstats.read.bins[7]);
- fflush(stdout);
+ stats->sock_callstats.read.bins[7], (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_sum_write (struct TransferInfo *stats) {
@@ -1195,16 +1444,16 @@ void tcp_output_sum_write (struct TransferInfo *stats) {
_print_stats_common(stats);
printf(report_sum_bw_format,
stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- fflush(stdout);
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_sumcnt_write (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw);
_print_stats_common(stats);
- printf(report_sumcnt_bw_format, stats->threadcnt,
+ printf(report_sumcnt_bw_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
- outbuffer, outbufferext);
- fflush(stdout);
+ outbuffer, outbufferext, (stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_sum_write_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_bw_write_enhanced);
@@ -1217,13 +1466,13 @@ void tcp_output_sum_write_enhanced (struct TransferInfo *stats) {
#if HAVE_TCP_STATS
,stats->sock_callstats.write.tcpstats.retry
#endif
- );
- fflush(stdout);
+ ,(stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
void tcp_output_sumcnt_write_enhanced (struct TransferInfo *stats) {
HEADING_PRINT_COND(report_sumcnt_bw_write_enhanced);
_print_stats_common(stats);
- printf(report_sumcnt_bw_write_enhanced_format, stats->threadcnt,
+ printf(report_sumcnt_bw_write_enhanced_format, (stats->final ? stats->threadcnt_final: stats->slot_thread_downcount),
stats->ts.iStart, stats->ts.iEnd,
outbuffer, outbufferext,
stats->sock_callstats.write.WriteCnt,
@@ -1231,8 +1480,8 @@ void tcp_output_sumcnt_write_enhanced (struct TransferInfo *stats) {
#if HAVE_TCP_STATS
,stats->sock_callstats.write.tcpstats.retry
#endif
- );
- fflush(stdout);
+ ,(stats->common->Omit ? report_omitted : ""));
+ cond_flush(stats);
}
// CSV outputs
@@ -1313,12 +1562,28 @@ void format_ips_port_string (struct TransferInfo *stats, bool sum) {
#endif
}
+static inline void _print_stats_csv_timestr(struct TransferInfo *stats,
+ char *timestr, int buflen)
+{
+ iperf_formattime(timestr,
+ buflen,
+ (!stats->final ? stats->ts.nextTime : stats->ts.packetTime),
+ isEnhanced(stats->common),
+ isUTC(stats->common),
+ (isEnhanced(stats->common) ? CSVTZ : CSV));
+}
+
+static inline intmax_t _print_stats_csv_speed(struct TransferInfo *stats)
+{
+ return (intmax_t) (((stats->cntBytes > 0) && (stats->ts.iEnd - stats->ts.iStart) > 0.0)
+ ? (((double)stats->cntBytes * 8.0) / (stats->ts.iEnd - stats->ts.iStart))
+ : 0);
+}
+
void udp_output_basic_csv (struct TransferInfo *stats) {
char timestr[120];
- iperf_formattime(timestr, sizeof(timestr), (!stats->final ? stats->ts.nextTime : stats->ts.packetTime), \
- isEnhanced(stats->common), isUTC(stats->common), (isEnhanced(stats->common) ? CSVTZ : CSV));
- intmax_t speed = (intmax_t) (((stats->cntBytes > 0) && (stats->ts.iEnd - stats->ts.iStart) > 0.0) ? \
- (((double)stats->cntBytes * 8.0) / (stats->ts.iEnd - stats->ts.iStart)) : 0);
+ _print_stats_csv_timestr(stats, timestr, sizeof(timestr));
+ intmax_t speed = _print_stats_csv_speed(stats);
printf(reportCSV_bw_jitter_loss_format,
timestr,
stats->csv_peer,
@@ -1331,15 +1596,14 @@ void udp_output_basic_csv (struct TransferInfo *stats) {
stats->cntError,
stats->cntDatagrams,
(100.0 * stats->cntError) / stats->cntDatagrams, stats->cntOutofOrder );
+ cond_flush(stats);
}
void udp_output_enhanced_csv (struct TransferInfo *stats) {
- char timestr[80];
- iperf_formattime(timestr, sizeof(timestr), (!stats->final ? stats->ts.nextTime : stats->ts.packetTime), \
- isEnhanced(stats->common), isUTC(stats->common),
- isEnhanced(stats->common) ? CSVTZ : CSV);
- intmax_t speed = (intmax_t) (((stats->cntBytes > 0) && (stats->ts.iEnd - stats->ts.iStart) > 0.0) ? \
- (((double)stats->cntBytes * 8.0) / (stats->ts.iEnd - stats->ts.iStart)) : 0);
+ HEADING_PRINT_COND(reportCSV_bw_jitter_loss_pps);
+ char timestr[120];
+ _print_stats_csv_timestr(stats, timestr, sizeof(timestr));
+ intmax_t speed = _print_stats_csv_speed(stats);
printf(reportCSV_bw_jitter_loss_pps_format,
timestr,
stats->csv_peer,
@@ -1356,14 +1620,13 @@ void udp_output_enhanced_csv (struct TransferInfo *stats) {
stats->sock_callstats.write.WriteCnt,
stats->sock_callstats.write.WriteErr,
(stats->cntIPG ? (stats->cntIPG / stats->IPGsum) : 0.0));
+ cond_flush(stats);
}
void tcp_output_basic_csv (struct TransferInfo *stats) {
- char timestr[80];
- iperf_formattime(timestr, sizeof(timestr), (!stats->final ? stats->ts.nextTime : stats->ts.packetTime), \
- isEnhanced(stats->common), isUTC(stats->common), (isEnhanced(stats->common) ? CSVTZ : CSV));
- intmax_t speed = (intmax_t) (((stats->cntBytes > 0) && (stats->ts.iEnd - stats->ts.iStart) > 0.0) ? \
- (((double)stats->cntBytes * 8.0) / (stats->ts.iEnd - stats->ts.iStart)) : 0);
+ char timestr[120];
+ _print_stats_csv_timestr(stats, timestr, sizeof(timestr));
+ intmax_t speed = _print_stats_csv_speed(stats);
printf(reportCSV_bw_format,
timestr,
stats->csv_peer,
@@ -1372,15 +1635,14 @@ void tcp_output_basic_csv (struct TransferInfo *stats) {
stats->ts.iEnd,
stats->cntBytes,
speed);
+ cond_flush(stats);
}
void tcp_output_read_enhanced_csv (struct TransferInfo *stats) {
+ HEADING_PRINT_COND(reportCSV_bw_read_enhanced);
char timestr[80];
- iperf_formattime(timestr, sizeof(timestr), (!stats->final ? stats->ts.nextTime : stats->ts.packetTime), \
- isEnhanced(stats->common), isUTC(stats->common),
- isEnhanced(stats->common) ? CSVTZ : CSV);
- intmax_t speed = (intmax_t) (((stats->cntBytes > 0) && (stats->ts.iEnd - stats->ts.iStart) > 0.0) ? \
- (((double)stats->cntBytes * 8.0) / (stats->ts.iEnd - stats->ts.iStart)) : 0);
+ _print_stats_csv_timestr(stats, timestr, sizeof(timestr));
+ intmax_t speed = _print_stats_csv_speed(stats);
printf(reportCSV_bw_read_enhanced_format,
timestr,
stats->csv_peer,
@@ -1398,15 +1660,14 @@ void tcp_output_read_enhanced_csv (struct TransferInfo *stats) {
stats->sock_callstats.read.bins[5],
stats->sock_callstats.read.bins[6],
stats->sock_callstats.read.bins[7]);
+ cond_flush(stats);
}
void tcp_output_write_enhanced_csv (struct TransferInfo *stats) {
- char timestr[80];
- iperf_formattime(timestr, sizeof(timestr), (!stats->final ? stats->ts.nextTime : stats->ts.packetTime), \
- isEnhanced(stats->common), isUTC(stats->common),
- isEnhanced(stats->common) ? CSVTZ : CSV);
- intmax_t speed = (intmax_t) (((stats->cntBytes > 0) && (stats->ts.iEnd - stats->ts.iStart) > 0.0) ? \
- (((double)stats->cntBytes * 8.0) / (stats->ts.iEnd - stats->ts.iStart)) : 0);
+ HEADING_PRINT_COND(reportCSV_bw_write_enhanced);
+ char timestr[120];
+ _print_stats_csv_timestr(stats, timestr, sizeof(timestr));
+ intmax_t speed = _print_stats_csv_speed(stats);
#if !(HAVE_TCP_STATS)
printf(reportCSV_bw_write_enhanced_format,
timestr,
@@ -1420,6 +1681,7 @@ void tcp_output_write_enhanced_csv (struct TransferInfo *stats) {
-1,
-1,
-1,
+ -1,
0,
0);
#else
@@ -1437,9 +1699,11 @@ void tcp_output_write_enhanced_csv (struct TransferInfo *stats) {
stats->sock_callstats.write.WriteErr,
stats->sock_callstats.write.tcpstats.retry,
-1,
+ -1,
0,
0);
- } else if (stats->sock_callstats.write.tcpstats.cwnd > 0) {
+ } else {
+#if HAVE_STRUCT_TCP_INFO_TCPI_SND_CWND
printf(reportCSV_bw_write_enhanced_format,
timestr,
stats->csv_peer,
@@ -1452,9 +1716,10 @@ void tcp_output_write_enhanced_csv (struct TransferInfo *stats) {
stats->sock_callstats.write.WriteErr,
stats->sock_callstats.write.tcpstats.retry,
stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.cwnd_packets,
stats->sock_callstats.write.tcpstats.rtt,
stats->sock_callstats.write.tcpstats.rttvar);
- } else {
+#else
printf(reportCSV_bw_write_enhanced_format,
timestr,
stats->csv_peer,
@@ -1467,10 +1732,101 @@ void tcp_output_write_enhanced_csv (struct TransferInfo *stats) {
stats->sock_callstats.write.WriteErr,
stats->sock_callstats.write.tcpstats.retry,
-1,
+ -1,
stats->sock_callstats.write.tcpstats.rtt,
0);
+#endif
}
#endif
+ cond_flush(stats);
+}
+
+void tcp_output_write_bb_csv (struct TransferInfo *stats) {
+ HEADING_PRINT_COND(reportCSV_client_bb_bw_tcp);
+ char timestr[120];
+ _print_stats_csv_timestr(stats, timestr, sizeof(timestr));
+ intmax_t speed = _print_stats_csv_speed(stats);
+ if (stats->final) {
+ double rps = ((stats->fBBrunning > 0) && (stats->bbrtt.total.cnt > 0)) ? ((double) stats->bbrtt.total.cnt / stats->fBBrunning) : 0;
+
+#if HAVE_TCP_STATS
+ printf(reportCSV_client_bb_bw_tcp_format,
+ timestr,
+ stats->csv_peer,
+ stats->common->transferID,
+ stats->ts.iStart,
+ stats->ts.iEnd,
+ stats->cntBytes,
+ speed,
+ stats->bbrtt.total.cnt,
+ (stats->bbrtt.total.mean * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.min * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.max * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.total.m2 / (stats->bbrtt.total.cnt - 1))),
+ stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.rtt,
+ rps);
+#else
+ printf(reportCSV_client_bb_bw_tcp_format,
+ timestr,
+ stats->csv_peer,
+ stats->common->transferID,
+ stats->ts.iStart,
+ stats->ts.iEnd,
+ stats->cntBytes,
+ speed,
+ stats->bbrtt.total.cnt,
+ (stats->bbrtt.total.mean * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.min * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : (stats->bbrtt.total.max * 1e3),
+ (stats->bbrtt.total.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.total.m2 / (stats->bbrtt.total.cnt - 1))),
+ -1,
+ -1,
+ -1,
+ rps);
+#endif
+ } else {
+ double rps = ((stats->bbrtt.current.cnt > 0) && (stats->iBBrunning > 0)) ? ((double) stats->bbrtt.current.cnt / stats->iBBrunning) : 0;
+#if HAVE_TCP_STATS
+ printf(reportCSV_client_bb_bw_tcp_format,
+ timestr,
+ stats->csv_peer,
+ stats->common->transferID,
+ stats->ts.iStart,
+ stats->ts.iEnd,
+ stats->cntBytes,
+ speed,
+ stats->bbrtt.current.cnt,
+ (stats->bbrtt.current.mean * 1e3),
+ (stats->bbrtt.current.cnt < 2) ? 0 : (stats->bbrtt.current.min * 1e3),
+ (stats->bbrtt.current.cnt < 2) ? 0 : (stats->bbrtt.current.max * 1e3),
+ (stats->bbrtt.current.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.current.m2 / (stats->bbrtt.current.cnt - 1))),
+ stats->sock_callstats.write.tcpstats.retry,
+ stats->sock_callstats.write.tcpstats.cwnd,
+ stats->sock_callstats.write.tcpstats.rtt,
+ rps);
+#else
+ printf(reportCSV_client_bb_bw_tcp_format,
+ timestr,
+ stats->csv_peer,
+ stats->common->transferID,
+ stats->ts.iStart,
+ stats->ts.iEnd,
+ stats->cntBytes,
+ speed,
+ stats->bbrtt.current.cnt,
+ (stats->bbrtt.current.mean * 1e3),
+ (stats->bbrtt.current.cnt < 2) ? 0 : (stats->bbrtt.current.min * 1e3),
+ (stats->bbrtt.current.cnt < 2) ? 0 : (stats->bbrtt.current.max * 1e3),
+ (stats->bbrtt.current.cnt < 2) ? 0 : 1e3 * (sqrt(stats->bbrtt.current.m2 / (stats->bbrtt.current.cnt - 1))),
+ -1,
+ -1,
+ -1,
+ rps);
+#endif
+ }
+ cond_flush(stats);
}
/*
@@ -1498,7 +1854,11 @@ static void reporter_output_listener_settings (struct ReportSettings *report) {
report->common->Port, report->common->PortLast, report->pid);
} else {
printf(isEnhanced(report->common) ? server_pid_port : server_port,
- (isUDP(report->common) ? "UDP" : "TCP"), report->common->Port, report->pid);
+ (isUDP(report->common) ? ((isIPV6(report->common) && isEnhanced(report->common)) ? "UDP (v6)" : "UDP") : \
+ ((isIPV6(report->common) && isEnhanced(report->common)) ? "TCP (v6)" : "TCP")), report->common->Port, report->pid);
+ }
+ if (isUDP(report->common) && isWorkingLoadUp(report->common) && isWorkingLoadDown(report->common)) {
+ printf(server_working_load_port, "TCP", report->common->Port);
}
if (report->common->Localhost != NULL) {
if (isEnhanced(report->common) && !SockAddr_isMulticast(&report->local)) {
@@ -1543,17 +1903,36 @@ static void reporter_output_listener_settings (struct ReportSettings *report) {
printf(bind_address_iface_taptun, report->common->Ifrname);
}
if (isEnhanced(report->common)) {
- byte_snprintf(outbuffer, sizeof(outbuffer), report->common->BufLen, toupper((int)report->common->Format));
- byte_snprintf(outbufferext, sizeof(outbufferext), report->common->BufLen / 8, 'A');
- outbuffer[(sizeof(outbuffer)-1)] = '\0';
- outbufferext[(sizeof(outbufferext)-1)] = '\0';
- printf("%s: %s (Dist bin width=%s)\n", server_read_size, outbuffer, outbufferext);
+ if (!(isUDP(report->common))) {
+ byte_snprintf(outbuffer, sizeof(outbuffer), report->common->BufLen, toupper((int)report->common->Format));
+ byte_snprintf(outbufferext, sizeof(outbufferext), report->common->BufLen / 8, 'A');
+ outbuffer[(sizeof(outbuffer)-1)] = '\0';
+ outbufferext[(sizeof(outbufferext)-1)] = '\0';
+ printf("%s: %s (Dist bin width=%s)\n", server_read_size, outbuffer, outbufferext);
+ } else {
+ byte_snprintf(outbuffer, sizeof(outbuffer), report->common->BufLen, 'B');
+ outbuffer[(sizeof(outbuffer)-1)] = '\0';
+ printf("%s: %s \n", server_read_size, outbuffer);
+ }
+
}
- if (isCongestionControl(report->common) && report->common->Congestion) {
- fprintf(stdout, "TCP congestion control set to %s\n", report->common->Congestion);
+#if HAVE_DECL_TCP_CONGESTION
+ if (isCongestionControl(report->common) || isEnhanced(report->common)) {
+ char cca[40] = "";
+ Socklen_t len = sizeof(cca);
+ if (getsockopt(report->common->socket, IPPROTO_TCP, TCP_CONGESTION, &cca, &len) == 0) {
+ cca[len]='\0';
+ }
+ if (report->common->Congestion) {
+ fprintf(stdout,"TCP congestion control default set to %s using %s\n", report->common->Congestion, cca);
+ } else if (strlen(cca)) {
+ fprintf(stdout,"TCP congestion control default %s\n", cca);
+ }
}
+#endif
if (isOverrideTOS(report->common)) {
- fprintf(stdout, "Reflected TOS will be set to 0x%x\n", report->common->RTOS);
+ fprintf(stdout, "Reflected TOS will be set to 0x%x (dscp=%d,ecn=%d)\n", report->common->RTOS, \
+ DSCP_VALUE(report->common->RTOS), ECN_VALUE(report->common->RTOS));
}
if (isPrintMSS(report->common)) {
if (isTCPMSS(report->common)) {
@@ -1563,7 +1942,8 @@ static void reporter_output_listener_settings (struct ReportSettings *report) {
}
}
if (report->common->TOS) {
- fprintf(stdout, "TOS will be set to 0x%x\n", report->common->TOS);
+ fprintf(stdout, "TOS will be set to 0x%x (dscp=%d,ecn=%d)\n", report->common->TOS, \
+ DSCP_VALUE(report->common->RTOS), ECN_VALUE(report->common->RTOS));
}
if (isUDP(report->common)) {
if (isSingleClient(report->common)) {
@@ -1574,7 +1954,7 @@ static void reporter_output_listener_settings (struct ReportSettings *report) {
} else if (isSingleClient(report->common)) {
fprintf(stdout, "Server set to single client traffic mode (serialize traffic tests)\n");
}
- if (isMulticast(report->common)) {
+ if (isMulticast(report->common) && (report->common->Port == report->common->PortLast)) {
fprintf(stdout, "Server set to single client traffic mode (per multicast receive)\n");
}
if (isHistogram(report->common)) {
@@ -1608,19 +1988,31 @@ static void reporter_output_client_settings (struct ReportSettings *report) {
if (!report->common->Ifrnametx) {
printf(isEnhanced(report->common) ? client_pid_port : client_port, hoststr,
(isUDP(report->common) ? "UDP" : "TCP"), report->common->Port, report->pid, \
- (!report->common->threads ? 1 : report->common->threads));
+ (!report->common->threads ? 1 : report->common->threads),
+ (!report->common->threads ? 1 : report->common->working_load_threads));
} else {
printf(client_pid_port_dev, hoststr,
(isUDP(report->common) ? "UDP" : "TCP"), report->common->Port, report->pid, \
- report->common->Ifrnametx, (!report->common->threads ? 1 : report->common->threads));
+ report->common->Ifrnametx, (!report->common->threads ? 1 : report->common->threads),
+ (!report->common->threads ? 1 : report->common->working_load_threads));
}
- if ((isEnhanced(report->common) || isNearCongest(report->common)) && !isUDP(report->common)) {
+ if ((isEnhanced(report->common) || isNearCongest(report->common)) && !isUDP(report->common) && !isBounceBack(report->common)) {
byte_snprintf(outbuffer, sizeof(outbuffer), report->common->BufLen, 'B');
outbuffer[(sizeof(outbuffer)-1)] = '\0';
- if (isTcpWriteTimes(report->common)) {
- printf("%s: %s (writetimer-enabled)\n", client_write_size, outbuffer);
+ if (!isBurstSize(report->common)) {
+ if (isTcpWriteTimes(report->common)) {
+ printf("%s: %s (write timer enabled)\n", client_write_size, outbuffer);
+ } else {
+ printf("%s: %s\n", client_write_size, outbuffer);
+ }
} else {
- printf("%s: %s\n", client_write_size, outbuffer);
+ byte_snprintf(outbufferext, sizeof(outbufferext), report->common->BurstSize, 'B');
+ outbufferext[(sizeof(outbufferext)-1)] = '\0';
+ if (isTcpWriteTimes(report->common)) {
+ printf("%s: %s Burst size: %s (write timer enabled)\n", client_write_size, outbuffer, outbufferext);
+ } else {
+ printf("%s: %s Burst size: %s\n", client_write_size, outbuffer, outbufferext);
+ }
}
}
if (isIsochronous(report->common)) {
@@ -1631,30 +2023,47 @@ static void reporter_output_client_settings (struct ReportSettings *report) {
meanbuf[39]='\0'; variancebuf[39]='\0';
printf(client_isochronous, report->isochstats.mFPS, meanbuf, variancebuf, (report->isochstats.mBurstInterval/1000.0), (report->isochstats.mBurstIPG/1000.0));
}
- if (isPeriodicBurst(report->common)) {
- char tmpbuf[40];
- byte_snprintf(tmpbuf, sizeof(tmpbuf), report->common->BurstSize, 'A');
- tmpbuf[39]='\0';
- if (report->common->bbcount) {
- printf(client_burstperiodcount, tmpbuf, report->common->bbcount, (1.0 / report->common->FPS));
- } else {
- printf(client_burstperiod, tmpbuf, (1.0 / report->common->FPS));
- }
- }
if (isBounceBack(report->common)) {
- char tmpbuf[40];
- byte_snprintf(tmpbuf, sizeof(tmpbuf), report->common->bbsize, 'A');
- tmpbuf[39]='\0';
+ char tmplbuf[40];
+ byte_snprintf(tmplbuf, sizeof(tmplbuf), report->common->bbsize, 'A');
+ tmplbuf[39]='\0';
+ char tmprbuf[40];
+ byte_snprintf(tmprbuf, sizeof(tmprbuf), report->common->bbreplysize, 'A');
+ tmprbuf[39]='\0';
if (isTcpQuickAck(report->common)) {
- printf(client_bounceback, tmpbuf, report->common->bbhold);
+ printf(client_bounceback, tmplbuf, tmprbuf, report->common->bbhold);
} else {
- printf(client_bounceback_noqack, tmpbuf, report->common->bbhold);
+ printf(client_bounceback_noqack, tmplbuf, tmprbuf, report->common->bbhold);
+ }
+ if (report->common->FPS > 0) {
+ printf(client_bbburstperiodcount, report->common->bbcount, (1.0 / report->common->FPS));
+ }
+ } else {
+ if (isPeriodicBurst(report->common) && (report->common->FPS > 0)) {
+ char tmpbuf[40];
+ byte_snprintf(tmpbuf, sizeof(tmpbuf), report->common->BurstSize, 'A');
+ tmpbuf[39]='\0';
+ if (report->common->bbcount) {
+ printf(client_burstperiodcount, tmpbuf, report->common->bbcount, (1.0 / report->common->FPS));
+ } else {
+ printf(client_burstperiod, tmpbuf, (1.0 / report->common->FPS));
+ }
}
}
if (isFQPacing(report->common)) {
- byte_snprintf(outbuffer, sizeof(outbuffer), report->common->FQPacingRate, 'a');
- outbuffer[(sizeof(outbuffer)-1)] = '\0';
- printf(client_fq_pacing,outbuffer);
+ char prate[40];
+ byte_snprintf(prate, sizeof(prate), report->common->FQPacingRate, 'a');
+ prate[39] = '\0';
+ if (isFQPacingStep(report->common)) {
+ char pratestep[40];
+ byte_snprintf(pratestep, sizeof(pratestep), report->common->FQPacingRateStep, 'a');
+ pratestep[39] = '\0';
+ printf(client_fq_pacing_step,prate, pratestep);
+ } else {
+ byte_snprintf(outbuffer, sizeof(outbuffer), report->common->FQPacingRate, 'a');
+ outbuffer[(sizeof(outbuffer)-1)] = '\0';
+ printf(client_fq_pacing,outbuffer);
+ }
}
if (isPrintMSS(report->common)) {
if (isTCPMSS(report->common)) {
@@ -1663,16 +2072,41 @@ static void reporter_output_client_settings (struct ReportSettings *report) {
printf(report_default_mss, report->sockmaxseg);
}
}
-
- if (isCongestionControl(report->common) && report->common->Congestion) {
- fprintf(stdout, "TCP congestion control set to %s\n", report->common->Congestion);
+#if HAVE_DECL_TCP_CONGESTION
+ if (isCongestionControl(report->common) || isEnhanced(report->common)) {
+ char cca[40] = "";
+ Socklen_t len = sizeof(cca);
+ if (getsockopt(report->common->socket, IPPROTO_TCP, TCP_CONGESTION, &cca, &len) == 0) {
+ cca[len]='\0';
+ }
+ if (report->common->Congestion) {
+ fprintf(stdout,"TCP congestion control set to %s using %s\n", report->common->Congestion, cca);
+ } else if (strlen(cca)) {
+ fprintf(stdout,"TCP congestion control using %s\n", cca);
+ }
+ }
+ if ((isWorkingLoadUp(report->common) || isWorkingLoadDown(report->common)) && isLoadCCA(report->common)) {
+ fprintf(stdout,"TCP working load congestion control set to %s\n", report->common->LoadCCA);
}
+#endif
if (isEnhanced(report->common)) {
+ char strtext[10];
+ if (isSetTOS(report->common)) {
+ strcpy(strtext, "set");
+ } else {
+ strcpy(strtext, "defaults");
+ }
+ fprintf(stdout, "TOS %s to 0x%x (dscp=%d,ecn=%d)", strtext, report->common->TOS, \
+ DSCP_VALUE(report->common->TOS), ECN_VALUE(report->common->TOS));
+ if (ECN_VALUE(report->common->TOS)) {
+ fprintf(stdout, " (warn ecn bits set)");
+ }
if (isNoDelay(report->common)) {
- fprintf(stdout, "TOS set to 0x%x and nodelay (Nagle off)\n", report->common->TOS);
+ fprintf(stdout," and nodelay (Nagle off)");
} else {
- fprintf(stdout, "TOS set to 0x%x (Nagle on)\n", report->common->TOS);
+ fprintf(stdout," (Nagle on)");
}
+ fprintf(stdout, "\n");
}
if (isNearCongest(report->common)) {
if (report->common->rtt_weight == NEARCONGEST_DEFAULT) {
@@ -1716,15 +2150,23 @@ static void reporter_output_client_settings (struct ReportSettings *report) {
fflush(stdout);
}
+#define MINSAMPLES_FORVARIANCE 25
void reporter_connect_printf_tcp_final (struct ConnectionInfo * report) {
- if (report->connect_times.cnt > 1) {
- double variance = (report->connect_times.cnt < 2) ? 0 : 1e3* (sqrt(report->connect_times.m2 / (report->connect_times.cnt - 1)));
+ if (report->connect_times.cnt >= MINSAMPLES_FORVARIANCE) {
+ double variance = (sqrt(report->connect_times.m2 / (report->connect_times.cnt - 1)));
fprintf(stdout, "[ CT] final connect times (min/avg/max/stdev) = %0.3f/%0.3f/%0.3f/%0.3f ms (tot/err) = %" PRIdMAX "/%" PRIdMAX "\n", \
report->connect_times.min, \
(report->connect_times.sum / report->connect_times.cnt), \
report->connect_times.max, variance, \
(report->connect_times.cnt + report->connect_times.err), \
report->connect_times.err);
+ } else if (report->connect_times.cnt > 2) {
+ fprintf(stdout, "[ CT] final connect times (min/avg/max) = %0.3f/%0.3f/%0.3f ms (tot/err) = %" PRIdMAX "/%" PRIdMAX "\n", \
+ report->connect_times.min, \
+ (report->connect_times.sum / report->connect_times.cnt), \
+ report->connect_times.max, \
+ (report->connect_times.cnt + report->connect_times.err), \
+ report->connect_times.err);
}
fflush(stdout);
}
@@ -1739,7 +2181,6 @@ void reporter_print_connection_report (struct ConnectionInfo *report) {
outbuffer[0]='\0';
outbufferext[0]='\0';
char *b = &outbuffer[0];
-
#if HAVE_DECL_TCP_WINDOW_CLAMP
if (!isUDP(report->common) && isRxClamp(report->common)) {
snprintf(b, SNBUFFERSIZE-strlen(b), " (%s%d)", "clamp=", report->common->ClampSize);
@@ -1781,9 +2222,11 @@ void reporter_print_connection_report (struct ConnectionInfo *report) {
}
if (isBounceBack(report->common)) {
if (isTcpQuickAck(report->common)) {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (bb w/quickack len/hold=%d/%d)", report->common->bbsize, report->common->bbhold);
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (bb w/quickack req/reply/hold=%d/%d/%d)", report->common->bbsize, \
+ report->common->bbreplysize, report->common->bbhold);
} else {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (bb len/hold=%d/%d)", report->common->bbsize, report->common->bbhold);
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (bb req/reply/hold=%d/%d/%d)", report->common->bbsize, \
+ report->common->bbreplysize, report->common->bbhold);
}
b += strlen(b);
}
@@ -1800,23 +2243,47 @@ void reporter_print_connection_report (struct ConnectionInfo *report) {
b += strlen(b);
}
if (isEnhanced(report->common)) {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (sock=%d)", report->common->socket);;
- b += strlen(b);
+ if (isCongestionControl(report->common)) {
+#if HAVE_DECL_TCP_CONGESTION
+ char cca[40] = "";
+ Socklen_t len = sizeof(cca);
+ int rc;
+ if ((rc = getsockopt(report->common->socket, IPPROTO_TCP, TCP_CONGESTION, &cca, &len)) == 0) {
+ cca[len]='\0';
+ }
+ if (rc != SOCKET_ERROR) {
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (sock=%d/%s)", report->common->socket, cca);
+ b += strlen(b);
+ }
+#endif
+ } else {
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (sock=%d)", report->common->socket);
+ b += strlen(b);
+ }
}
if (isOverrideTOS(report->common)) {
if (isFullDuplex(report->common)) {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (tos rx/tx=0x%x/0x%x)", report->common->TOS, report->common->RTOS);
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (tos rx/tx=0x%x,dscp=%d,ecn=%d, /0x%x,dscp=%d,ecn=%d)", report->common->TOS, \
+ DSCP_VALUE(report->common->TOS), ECN_VALUE(report->common->TOS), \
+ report->common->RTOS, \
+ DSCP_VALUE(report->common->RTOS), ECN_VALUE(report->common->RTOS));
} else if (isReverse(report->common)) {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (tos tx=0x%x)", report->common->TOS);
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (tos rx=0x%x,dscp=%d,ecn=%d)", report->common->TOS, \
+ DSCP_VALUE(report->common->TOS), ECN_VALUE(report->common->TOS));
}
b += strlen(b);
} else if (report->common->TOS) {
if (isFullDuplex(report->common) || isBounceBack(report->common)) {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (tos rx/tx=0x%x/0x%x)", report->common->TOS, report->common->TOS);
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (tos rx/tx=0x%x,dscp=%d,ecn=%d/0x%x,dscp=%d,ecn=%d)", report->common->TOS, \
+ DSCP_VALUE(report->common->TOS), ECN_VALUE(report->common->TOS), \
+ report->common->TOS, \
+ DSCP_VALUE(report->common->TOS), ECN_VALUE(report->common->TOS));
} else if (isReverse(report->common)) {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (tos tx=0x%x)", report->common->TOS);
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (tos rx=0x%x,dscp=%d,ecn=%d)", report->common->TOS, \
+ DSCP_VALUE(report->common->TOS), ECN_VALUE(report->common->TOS));
} else {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (tos rx=0x%x)", report->common->TOS);
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (tos tx=0x%x,dscp=%d,ecn=%d)", report->common->TOS, \
+ DSCP_VALUE(report->common->TOS), ECN_VALUE(report->common->TOS));
}
b += strlen(b);
}
@@ -1833,13 +2300,12 @@ void reporter_print_connection_report (struct ConnectionInfo *report) {
}
#endif
#if HAVE_TCP_STATS
- if (!isUDP(report->common) && (report->tcpinitstats.isValid)) {
- snprintf(b, SNBUFFERSIZE-strlen(b), " (icwnd/mss/irtt=%u/%u/%u)", \
+ if (!isUDP(report->common) && (report->tcpinitstats.isValid) && isEnhanced(report->common)) {
+ snprintf(b, SNBUFFERSIZE-strlen(b), " (icwnd/mss/irtt=%" PRIdMAX "/%" PRIuLEAST32 "/%" PRIuLEAST32 ")", \
report->tcpinitstats.cwnd, report->tcpinitstats.mss_negotiated, report->tcpinitstats.rtt);
b += strlen(b);
}
#endif
-
if ((isFullDuplex(report->common) || !isServerReverse(report->common)) \
&& (isEnhanced(report->common) || isConnectOnly(report->common))) {
if (report->connect_timestamp.tv_sec > 0) {
@@ -1923,14 +2389,7 @@ void reporter_print_connection_report (struct ConnectionInfo *report) {
if ((report->common->ThreadMode == kMode_Client) && !isServerReverse(report->common)) {
if (isTxHoldback(report->common) || isTxStartTime(report->common)) {
struct timeval now;
-#ifdef HAVE_CLOCK_GETTIME
- struct timespec t1;
- clock_gettime(CLOCK_REALTIME, &t1);
- now.tv_sec = t1.tv_sec;
- now.tv_usec = t1.tv_nsec / 1000;
-#else
- gettimeofday(&now, NULL);
-#endif
+ TimeGetNow(now);
int seconds_from_now;
if (isTxHoldback(report->common)) {
seconds_from_now = report->txholdbacktime.tv_sec;
diff --git a/src/Reporter.c b/src/Reporter.c
index bbd6fd5..e200a80 100644
--- a/src/Reporter.c
+++ b/src/Reporter.c
@@ -82,12 +82,12 @@ static void reporter_reset_transfer_stats_client_tcp(struct TransferInfo *stats)
static void reporter_reset_transfer_stats_client_udp(struct TransferInfo *stats);
static void reporter_reset_transfer_stats_server_udp(struct TransferInfo *stats);
static void reporter_reset_transfer_stats_server_tcp(struct TransferInfo *stats);
+static void reporter_reset_transfer_stats_sum(struct TransferInfo *stats);
// code for welfornd's algorithm to produce running mean/min/max/var
static void reporter_update_mmm (struct MeanMinMaxStats *stats, double value);
static void reporter_reset_mmm (struct MeanMinMaxStats *stats);
-
// one way delay (OWD) calculations
static void reporter_handle_packet_oneway_transit(struct TransferInfo *stats, struct ReportStruct *packet);
static void reporter_handle_isoch_oneway_transit_tcp(struct TransferInfo *stats, struct ReportStruct *packet);
@@ -160,8 +160,10 @@ bool ReportPacket (struct ReporterData* data, struct ReportStruct *packet) {
if (!TimeZero(stats->ts.nextTCPSampleTime) && (TimeDifference(stats->ts.nextTCPSampleTime, packet->packetTime) < 0)) {
gettcpinfo(data->info.common->socket, &packet->tcpstats);
TimeAdd(stats->ts.nextTCPSampleTime, stats->ts.intervalTime);
+ rc = true;
} else {
gettcpinfo(data->info.common->socket, &packet->tcpstats);
+ rc = true;
}
}
#endif
@@ -194,14 +196,14 @@ bool ReportPacket (struct ReporterData* data, struct ReportStruct *packet) {
* thread to print a final report and to remove the data report from its jobq.
* It also handles the freeing reports and other closing actions
*/
-int EndJob (struct ReportHeader *reporthdr, struct ReportStruct *finalpacket) {
+bool EndJob (struct ReportHeader *reporthdr, struct ReportStruct *finalpacket) {
assert(reporthdr!=NULL);
assert(finalpacket!=NULL);
struct ReporterData *report = (struct ReporterData *) reporthdr->this_report;
struct ReportStruct packet;
memset(&packet, 0, sizeof(struct ReportStruct));
- int do_close = 1;
+ bool do_close = true;
/*
* Using PacketID of -1 ends reporting
* It pushes a "special packet" through
@@ -217,24 +219,25 @@ int EndJob (struct ReportHeader *reporthdr, struct ReportStruct *finalpacket) {
}
#endif
// clear the reporter done predicate
- report->packetring->consumerdone = 0;
+ report->packetring->consumerdone = false;
// the negative packetID is used to inform the report thread this traffic thread is done
packet.packetID = -1;
packet.packetLen = finalpacket->packetLen;
packet.packetTime = finalpacket->packetTime;
+ packet.err_readwrite = NullEvent; // this is not a real event
if (isSingleUDP(report->info.common)) {
packetring_enqueue(report->packetring, &packet);
reporter_process_transfer_report(report);
} else {
ReportPacket(report, &packet);
-#ifdef HAVE_THREAD_DEBUG
- thread_debug( "Traffic thread awaiting reporter to be done with %p and cond %p", (void *)report, (void *) report->packetring->awake_producer);
-#endif
Condition_Lock((*(report->packetring->awake_producer)));
while (!report->packetring->consumerdone) {
// This wait time is the lag between the reporter thread
// and the traffic thread, a reporter thread with lots of
// reports (e.g. fastsampling) can lag per the i/o
+#ifdef HAVE_THREAD_DEBUG
+ thread_debug( "Traffic thread awaiting reporter to be done with %p and cond %p", (void *)report, (void *) report->packetring->awake_producer);
+#endif
Condition_TimedWait(report->packetring->awake_producer, 1);
// printf("Consumer done may be stuck\n");
}
@@ -249,7 +252,7 @@ int EndJob (struct ReportHeader *reporthdr, struct ReportStruct *finalpacket) {
#endif
FreeSumReport(report->FullDuplexReport);
} else {
- do_close = 0;
+ do_close = false;
}
}
return do_close;
@@ -422,7 +425,7 @@ void reporter_spawn (struct thread_Settings *thread) {
#ifdef HAVE_THREAD_DEBUG
thread_debug( "Reporter thread started");
#endif
- if (isEnhanced(thread)) {
+ if (isEnhanced(thread) && (thread->mThreadMode == kMode_Client)) {
myConnectionReport = InitConnectOnlyReport(thread);
}
/*
@@ -480,8 +483,9 @@ void reporter_spawn (struct thread_Settings *thread) {
// Report process report returns true
// when a report needs to be removed
// from the jobq. Also, work item might
- // be removed as part of processing
- // Store a cached pointer for the linked list maitenance
+ // be free as part of its processing
+ // Store a cached pointer tmp
+ // for the next work item
struct ReportHeader *tmp = (*work_item)->next;
if (reporter_process_report(*work_item)) {
#ifdef HAVE_THREAD_DEBUG
@@ -510,11 +514,11 @@ void reporter_spawn (struct thread_Settings *thread) {
}
// The Transfer or Data report is by far the most complicated report
-int reporter_process_transfer_report (struct ReporterData *this_ireport) {
+bool reporter_process_transfer_report (struct ReporterData *this_ireport) {
assert(this_ireport != NULL);
struct TransferInfo *sumstats = (this_ireport->GroupSumReport ? &this_ireport->GroupSumReport->info : NULL);
struct TransferInfo *fullduplexstats = (this_ireport->FullDuplexReport ? &this_ireport->FullDuplexReport->info : NULL);
- int need_free = 0;
+ bool need_free = false;
// The consumption detector applies delay to the reporter
// thread when its consumption rate is too low. This allows
// the traffic threads to send aggregates vs thrash
@@ -530,7 +534,7 @@ int reporter_process_transfer_report (struct ReporterData *this_ireport) {
apply_consumption_detector();
// If there are more packets to process then handle them
struct ReportStruct *packet = NULL;
- int advance_jobq = 0;
+ bool advance_jobq = false;
while (!advance_jobq && (packet = packetring_dequeue(this_ireport->packetring))) {
// Increment the total packet count processed by this thread
// this will be used to make decisions on if the reporter
@@ -543,9 +547,21 @@ int reporter_process_transfer_report (struct ReporterData *this_ireport) {
reporter_handle_packet_tcpistats(this_ireport, packet);
}
#endif
+ if (this_ireport->transfer_interval_handler) {
+ if (sumstats && (this_ireport->packetring->uplevel != sumstats->uplevel) \
+ && (TimeDifference(sumstats->ts.nextTime, packet->packetTime) > 0)) {
+ sumstats->slot_thread_upcount++;
+#if HAVE_SUMMING_DEBUG
+ printf("**** %s upcnt (%p) pkt=%ld.%ld (up/down)=%d/%d uplevel (sum/pkt)=%d/%d\n", this_ireport->info.common->transferIDStr, (void *)this_ireport->packetring, \
+ (long) packet->packetTime.tv_sec, (long) packet->packetTime.tv_usec, sumstats->slot_thread_upcount, sumstats->slot_thread_downcount, \
+ sumstats->uplevel, this_ireport->packetring->uplevel);
+#endif
+ this_ireport->packetring->uplevel = toggleLevel(this_ireport->packetring->uplevel);
+ }
+ }
if (!(packet->packetID < 0)) {
// Check to output any interval reports,
- // bursts need to report the packet first
+ // bursts need to report the packet first
if (this_ireport->packet_handler_pre_report) {
(*this_ireport->packet_handler_pre_report)(this_ireport, packet);
}
@@ -564,8 +580,8 @@ int reporter_process_transfer_report (struct ReporterData *this_ireport) {
if (fullduplexstats)
fullduplexstats->ts.packetTime = packet->packetTime;
} else {
- need_free = 1;
- advance_jobq = 1;
+ need_free = true;
+ advance_jobq = true;
// A last packet event was detected
// printf("last packet event detected\n"); fflush(stdout);
this_ireport->reporter_thread_suspends = consumption_detector.reporter_thread_suspends;
@@ -577,7 +593,7 @@ int reporter_process_transfer_report (struct ReporterData *this_ireport) {
}
this_ireport->info.ts.packetTime = packet->packetTime;
assert(this_ireport->transfer_protocol_handler != NULL);
- (*this_ireport->transfer_protocol_handler)(this_ireport, 1);
+ (*this_ireport->transfer_protocol_handler)(this_ireport, true);
// This is a final report so set the sum report header's packet time
// Note, the thread with the max value will set this
if (fullduplexstats && isEnhanced(this_ireport->info.common)) {
@@ -587,20 +603,22 @@ int reporter_process_transfer_report (struct ReporterData *this_ireport) {
}
if (DecrSumReportRefCounter(this_ireport->FullDuplexReport) == 0) {
if (this_ireport->FullDuplexReport->transfer_protocol_sum_handler) {
- (*this_ireport->FullDuplexReport->transfer_protocol_sum_handler)(fullduplexstats, 1);
+ (*this_ireport->FullDuplexReport->transfer_protocol_sum_handler)(fullduplexstats, true);
}
// FullDuplex report gets freed by a traffic thread (per its barrier)
}
}
if (sumstats) {
- if (!this_ireport->GroupSumReport->threads_cntr_fsum)
- this_ireport->GroupSumReport->threads_cntr_fsum = this_ireport->GroupSumReport->reference.maxcount;
if (TimeDifference(sumstats->ts.packetTime, packet->packetTime) > 0) {
sumstats->ts.packetTime = packet->packetTime;
}
- if (this_ireport->GroupSumReport->transfer_protocol_sum_handler && \
- (--this_ireport->GroupSumReport->threads_cntr_fsum == 0) && (this_ireport->GroupSumReport->reference.maxcount > 1)) {
- (*this_ireport->GroupSumReport->transfer_protocol_sum_handler)(&this_ireport->GroupSumReport->info, 1);
+ if (this_ireport->GroupSumReport->transfer_protocol_sum_handler) {
+ Mutex_Lock(&this_ireport->GroupSumReport->reference.lock);
+ if ((++this_ireport->GroupSumReport->final_thread_upcount == this_ireport->GroupSumReport->reference.maxcount) && \
+ ((this_ireport->GroupSumReport->reference.maxcount > 1) || isSumOnly(this_ireport->info.common))) {
+ (*this_ireport->GroupSumReport->transfer_protocol_sum_handler)(&this_ireport->GroupSumReport->info, true);
+ }
+ Mutex_Unlock(&this_ireport->GroupSumReport->reference.lock);
}
}
}
@@ -614,17 +632,20 @@ int reporter_process_transfer_report (struct ReporterData *this_ireport) {
* can't use them anymore (except for the DATA REPORT);
*
*/
-inline int reporter_process_report (struct ReportHeader *reporthdr) {
+inline bool reporter_process_report (struct ReportHeader *reporthdr) {
assert(reporthdr != NULL);
- int done = 1;
+ bool done = true;
switch (reporthdr->type) {
case DATA_REPORT:
done = reporter_process_transfer_report((struct ReporterData *)reporthdr->this_report);
- fflush(stdout);
if (done) {
struct ReporterData *tmp = (struct ReporterData *)reporthdr->this_report;
struct PacketRing *pr = tmp->packetring;
- pr->consumerdone = 1;
+ pr->consumerdone = true;
+# ifdef HAVE_THREAD_DEBUG
+ struct ReporterData *report = (struct ReporterData *) reporthdr->this_report;
+ thread_debug( "Reporter thread signal traffic thread %p %p", (void *)report, (void *) report->packetring->awake_producer);
+#endif
// Data Reports are special because the traffic thread needs to free them, just signal
Condition_Signal(pr->awake_producer);
}
@@ -642,20 +663,23 @@ inline int reporter_process_report (struct ReportHeader *reporthdr) {
}
}
reporter_print_connection_report(creport);
- fflush(stdout);
FreeReport(reporthdr);
}
break;
case SETTINGS_REPORT:
reporter_print_settings_report((struct ReportSettings *)reporthdr->this_report);
- fflush(stdout);
FreeReport(reporthdr);
break;
case SERVER_RELAY_REPORT:
reporter_print_server_relay_report((struct ServerRelay *)reporthdr->this_report);
- fflush(stdout);
FreeReport(reporthdr);
break;
+ case STRING_REPORT:
+ if (reporthdr->this_report) {
+ printf("%s\n", (char *)reporthdr->this_report);
+ free((char *)reporthdr->this_report);
+ }
+ break;
default:
fprintf(stderr,"Invalid report type in process report %p\n", reporthdr->this_report);
assert(0);
@@ -675,7 +699,7 @@ inline int reporter_process_report (struct ReportHeader *reporthdr) {
// Reporter private routines
void reporter_handle_packet_null (struct ReporterData *data, struct ReportStruct *packet) {
}
-void reporter_transfer_protocol_null (struct ReporterData *data, int final){
+void reporter_transfer_protocol_null (struct ReporterData *data, bool final){
}
static inline void reporter_compute_packet_pps (struct TransferInfo *stats, struct ReportStruct *packet) {
@@ -694,7 +718,7 @@ static void reporter_handle_packet_oneway_transit (struct TransferInfo *stats, s
// Transit or latency updates done inline below
double transit = TimeDifference(packet->packetTime, packet->sentTime);
if (stats->latency_histogram) {
- histogram_insert(stats->latency_histogram, transit, NULL);
+ histogram_insert(stats->latency_histogram, transit, &packet->packetTime);
}
double deltaTransit;
deltaTransit = transit - stats->transit.current.last;
@@ -756,7 +780,6 @@ static void reporter_handle_packet_oneway_transit (struct TransferInfo *stats, s
}
}
-
static void reporter_handle_isoch_oneway_transit_tcp (struct TransferInfo *stats, struct ReportStruct *packet) {
// printf("fid=%lu bs=%lu remain=%lu\n", packet->frameID, packet->burstsize, packet->remaining);
if (packet->frameID && packet->transit_ready) {
@@ -908,12 +931,12 @@ static void reporter_handle_frame_isoch_oneway_transit (struct TransferInfo *sta
void reporter_handle_packet_client (struct ReporterData *data, struct ReportStruct *packet) {
struct TransferInfo *stats = &data->info;
stats->ts.packetTime = packet->packetTime;
- if (!packet->emptyreport) {
+ switch (packet->err_readwrite) {
+ case WriteSelectRetry :
+ stats->sock_callstats.write.WriteErr++;
+ stats->sock_callstats.write.totWriteErr++;
+ case WriteSuccess :
stats->total.Bytes.current += packet->packetLen;
- if (packet->errwrite && (packet->errwrite != WriteErrNoAccount)) {
- stats->sock_callstats.write.WriteErr++;
- stats->sock_callstats.write.totWriteErr++;
- }
// These are valid packets that need standard iperf accounting
stats->sock_callstats.write.WriteCnt += packet->writecnt;
stats->sock_callstats.write.totWriteCnt += packet->writecnt;
@@ -929,7 +952,20 @@ void reporter_handle_packet_client (struct ReporterData *data, struct ReportStru
histogram_insert(stats->write_histogram, (1e-6 * packet->write_time), NULL);
}
}
+ break;
+ case WriteTimeo:
+ stats->sock_callstats.write.WriteTimeo++;
+ stats->sock_callstats.write.totWriteTimeo++;
+ case WriteErrAccount :
+ stats->sock_callstats.write.WriteErr++;
+ stats->sock_callstats.write.totWriteErr++;
+ case WriteNoAccount:
+ case NullEvent:
+ break;
+ default :
+ fprintf(stderr, "Program error: invalid client packet->err_readwrite %d\n", packet->err_readwrite);
}
+
if (isUDP(stats->common)) {
stats->PacketID = packet->packetID;
reporter_compute_packet_pps(stats, packet);
@@ -945,25 +981,47 @@ void reporter_handle_packet_bb_client (struct ReporterData *data, struct ReportS
if (!packet->emptyreport && (packet->packetLen > 0)) {
stats->total.Bytes.current += packet->packetLen;
double bbrtt = TimeDifference(packet->packetTime, packet->sentTime);
- double bbowdto = TimeDifference(packet->sentTimeRX, packet->sentTime);
- double bbowdfro = TimeDifference(packet->packetTime, packet->sentTimeTX);
- double asym = bbowdfro - bbowdto;
- stats->ts.prevpacketTime = packet->packetTime;
-#if DEBUG_BB_TIMESTAMPS
- fprintf(stderr, "BB Debug: ctx=%lx.%lx srx=%lx.%lx stx=%lx.%lx crx=%lx.%lx (hex)\n", packet->sentTime.tv_sec, packet->sentTime.tv_usec, packet->sentTimeRX.tv_sec, packet->sentTimeRX.tv_usec, packet->sentTimeTX.tv_sec, packet->sentTimeTX.tv_usec, packet->packetTime.tv_sec, packet->packetTime.tv_usec);
- fprintf(stderr, "BB Debug: ctx=%ld.%ld srx=%ld.%ld stx=%ld.%ld crx=%ld.%ld\n", packet->sentTime.tv_sec, packet->sentTime.tv_usec, packet->sentTimeRX.tv_sec, packet->sentTimeRX.tv_usec, packet->sentTimeTX.tv_sec, packet->sentTimeTX.tv_usec, packet->packetTime.tv_sec, packet->packetTime.tv_usec);
- fprintf(stderr, "BB RTT=%f OWDTo=%f OWDFro=%f Asym=%f\n", bbrtt, bbowdto, bbowdfro, asym);
-#endif
stats->iBBrunning += bbrtt;
stats->fBBrunning += bbrtt;
reporter_update_mmm(&stats->bbrtt.current, bbrtt);
reporter_update_mmm(&stats->bbrtt.total, bbrtt);
- reporter_update_mmm(&stats->bbowdto.total, bbowdto);
- reporter_update_mmm(&stats->bbowdfro.total, bbowdfro);
- reporter_update_mmm(&stats->bbasym.total, fabs(asym));
if (stats->bbrtt_histogram) {
histogram_insert(stats->bbrtt_histogram, bbrtt, NULL);
}
+ if (isTripTime(stats->common)) {
+ double bbowdto = TimeDifference(packet->sentTimeRX, packet->sentTime);
+ double bbowdfro = TimeDifference(packet->packetTime, packet->sentTimeTX);
+ double asym = bbowdfro - bbowdto;
+ double bbturnaround = TimeDifference(packet->sentTimeTX, packet->sentTimeRX);
+ double bbadj = TimeDifference(packet->packetTime, packet->sentTimeRX);
+ // If you measure RTT, you can detect when clock are unsync.
+ // If you have the sent-time, rcv-time and return-time, you can check that
+ // sent-time < rcv-time < return-time. As sent-time and return-time use
+ // the same clock, you can detect any drift bigger than RTT. JT
+ //
+ // Adjust this clock A write < clock B read < Clock A read - (clock B write - clock B read)
+ if ((bbowdto < 0) || ((bbadj - bbturnaround) < 0)) {
+ stats->bb_clocksync_error++;
+ }
+ reporter_update_mmm(&stats->bbowdto.total, bbowdto);
+ reporter_update_mmm(&stats->bbowdfro.total, bbowdfro);
+ reporter_update_mmm(&stats->bbasym.total, fabs(asym));
+ reporter_update_mmm(&stats->bbowdto.current, bbowdto);
+ reporter_update_mmm(&stats->bbowdfro.current, bbowdfro);
+ reporter_update_mmm(&stats->bbasym.current, fabs(asym));
+ if (stats->bbowdto_histogram) {
+ histogram_insert(stats->bbowdto_histogram, bbowdto, NULL);
+ }
+ if (stats->bbowdfro_histogram) {
+ histogram_insert(stats->bbowdfro_histogram, bbowdfro, NULL);
+ }
+ }
+ stats->ts.prevpacketTime = packet->packetTime;
+#if DEBUG_BB_TIMESTAMPS
+ fprintf(stderr, "BB Debug: ctx=%lx.%lx srx=%lx.%lx stx=%lx.%lx crx=%lx.%lx (hex)\n", packet->sentTime.tv_sec, packet->sentTime.tv_usec, packet->sentTimeRX.tv_sec, packet->sentTimeRX.tv_usec, packet->sentTimeTX.tv_sec, packet->sentTimeTX.tv_usec, packet->packetTime.tv_sec, packet->packetTime.tv_usec);
+ fprintf(stderr, "BB Debug: ctx=%ld.%ld srx=%ld.%ld stx=%ld.%ld crx=%ld.%ld\n", packet->sentTime.tv_sec, packet->sentTime.tv_usec, packet->sentTimeRX.tv_sec, packet->sentTimeRX.tv_usec, packet->sentTimeTX.tv_sec, packet->sentTimeTX.tv_usec, packet->packetTime.tv_sec, packet->packetTime.tv_usec);
+ fprintf(stderr, "BB RTT=%f OWDTo=%f OWDFro=%f Asym=%f\n", bbrtt, bbowdto, bbowdfro, asym);
+#endif
}
}
@@ -981,8 +1039,7 @@ inline void reporter_handle_packet_server_tcp (struct ReporterData *data, struct
int bin;
stats->total.Bytes.current += packet->packetLen;
// mean min max tests
- stats->sock_callstats.read.cntRead++;
- stats->sock_callstats.read.totcntRead++;
+ stats->sock_callstats.read.ReadCnt.current++;
bin = (int)floor((packet->packetLen -1)/stats->sock_callstats.read.binsize);
if (bin < TCPREADBINCOUNT) {
stats->sock_callstats.read.bins[bin]++;
@@ -1007,8 +1064,21 @@ inline void reporter_handle_packet_server_udp (struct ReporterData *data, struct
// Hence, set the per interval min to infinity
// and the per interval max and sum to zero
reporter_reset_mmm(&stats->transit.current);
- } else if (packet->packetID > 0) {
- stats->total.Bytes.current += packet->packetLen;
+ } else if (!packet->emptyreport && (packet->packetID > 0)) {
+ bool ooo_packet = false;
+ // packet loss occured if the datagram numbers aren't sequential
+ if (packet->packetID != stats->PacketID + 1) {
+ if (packet->packetID < stats->PacketID + 1) {
+ stats->total.OutofOrder.current++;
+ ooo_packet = true;
+ } else {
+ stats->total.Lost.current += packet->packetID - stats->PacketID - 1;
+ }
+ }
+ // never decrease datagramID (e.g. if we get an out-of-order packet)
+ if (packet->packetID > stats->PacketID) {
+ stats->PacketID = packet->packetID;
+ }
// These are valid packets that need standard iperf accounting
// Do L2 accounting first (if needed)
if (packet->l2errors && (stats->total.Datagrams.current > L2DROPFILTERCOUNTER)) {
@@ -1027,20 +1097,17 @@ inline void reporter_handle_packet_server_udp (struct ReporterData *data, struct
stats->l2counts.tot_udpcsumerr++;
}
}
- // packet loss occured if the datagram numbers aren't sequential
- if (packet->packetID != stats->PacketID + 1) {
- if (packet->packetID < stats->PacketID + 1) {
- stats->total.OutofOrder.current++;
- } else {
- stats->total.Lost.current += packet->packetID - stats->PacketID - 1;
- }
+ if (packet->err_readwrite == ReadErrLen) {
+ stats->sock_callstats.read.ReadErrLenCnt.current++;
}
- // never decrease datagramID (e.g. if we get an out-of-order packet)
- if (packet->packetID > stats->PacketID) {
- stats->PacketID = packet->packetID;
+ if (!ooo_packet && \
+ ((packet->err_readwrite == ReadSuccess) ||
+ ((packet->err_readwrite == ReadErrLen) && (packet->packetLen >= sizeof(struct UDP_datagram))))) {
+ reporter_handle_packet_oneway_transit(stats, packet);
}
+ stats->total.Bytes.current += packet->packetLen;
reporter_compute_packet_pps(stats, packet);
- reporter_handle_packet_oneway_transit(stats, packet);
+
if (packet->transit_ready) {
if (isIsochronous(stats->common)) {
reporter_handle_isoch_oneway_transit_udp(stats, packet);
@@ -1049,9 +1116,14 @@ inline void reporter_handle_packet_server_udp (struct ReporterData *data, struct
}
}
}
+ if (packet->err_readwrite != ReadNoAccount) {
+ if (packet->emptyreport) {
+ stats->sock_callstats.read.ReadTimeoCnt.current++;
+ } else {
+ stats->sock_callstats.read.ReadCnt.current++;
+ }
+ }
}
-
-// This is done in reporter thread context
#if HAVE_TCP_STATS
static inline void reporter_handle_packet_tcpistats (struct ReporterData *data, struct ReportStruct *packet) {
assert(data!=NULL);
@@ -1060,12 +1132,22 @@ static inline void reporter_handle_packet_tcpistats (struct ReporterData *data,
stats->sock_callstats.write.tcpstats.retry_prev = packet->tcpstats.retry_tot;
stats->sock_callstats.write.tcpstats.retry_tot = packet->tcpstats.retry_tot;
stats->sock_callstats.write.tcpstats.cwnd = packet->tcpstats.cwnd;
+ stats->sock_callstats.write.tcpstats.cwnd_packets = packet->tcpstats.cwnd_packets;
stats->sock_callstats.write.tcpstats.rtt = packet->tcpstats.rtt;
stats->sock_callstats.write.tcpstats.rttvar = packet->tcpstats.rttvar;
+#if HAVE_TCP_INFLIGHT
+ stats->sock_callstats.write.tcpstats.packets_in_flight = packet->tcpstats.packets_in_flight;
+ stats->sock_callstats.write.tcpstats.bytes_in_flight = packet->tcpstats.bytes_in_flight;
+#else
+ stats->sock_callstats.write.tcpstats.bytes_in_flight = -1;
+ stats->sock_callstats.write.tcpstats.packets_in_flight = -1;
+#endif
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ stats->FQPacingRateCurrent = packet->FQPacingRate;
+#endif
}
#endif
-
/*
* Report printing routines below
*/
@@ -1110,6 +1192,22 @@ static inline void reporter_set_timestamps_time (struct TransferInfo *stats, enu
}
}
+#if HAVE_SUMMING_DEBUG
+static void reporter_dump_timestamps (struct ReportStruct *packet, struct TransferInfo *stats, struct TransferInfo *sumstats) {
+ if (packet)
+ printf("**** %s pkt =%ld.%ld (up/down)=%d/%d\n", stats->common->transferIDStr, (long) packet->packetTime.tv_sec, \
+ (long) packet->packetTime.tv_usec, sumstats->slot_thread_upcount, sumstats->slot_thread_downcount);
+ else {
+ printf("**** %s pkt ts =%ld.%ld prev=%ld.%ld (up/down)=%d/%d\n", stats->common->transferIDStr, (long) stats->ts.packetTime.tv_sec, \
+ (long) stats->ts.packetTime.tv_usec, (long) stats->ts.prevpacketTime.tv_sec, (long) stats->ts.prevpacketTime.tv_usec, sumstats->slot_thread_upcount, sumstats->slot_thread_downcount);
+ }
+ printf("**** %s stats =%ld.%ld next=%ld.%ld prev=%ld.%ld\n", stats->common->transferIDStr, (long) stats->ts.packetTime.tv_sec, \
+ (long) stats->ts.packetTime.tv_usec, (long) stats->ts.nextTime.tv_sec, (long) stats->ts.nextTime.tv_usec, (long) stats->ts.prevpacketTime.tv_sec, (long) stats->ts.prevpacketTime.tv_usec);
+ printf("**** %s sum stats=%ld.%ld next=%ld.%ld prev=%ld.%ld \n", stats->common->transferIDStr, (long) sumstats->ts.packetTime.tv_sec, \
+ (long) sumstats->ts.packetTime.tv_usec, (long) sumstats->ts.nextTime.tv_sec, (long) sumstats->ts.nextTime.tv_usec, (long) sumstats->ts.prevTime.tv_sec, (long) sumstats->ts.prevTime.tv_usec);
+}
+#endif
+
// If reports were missed, catch up now
static inline void reporter_transfer_protocol_missed_reports (struct TransferInfo *stats, struct ReportStruct *packet) {
while (TimeDifference(packet->packetTime, stats->ts.nextTime) > TimeDouble(stats->ts.intervalTime)) {
@@ -1125,10 +1223,24 @@ static inline void reporter_transfer_protocol_missed_reports (struct TransferInf
}
}
+static inline void reporter_reset_transfer_stats_sum (struct TransferInfo *sumstats) {
+#if HAVE_SUMMING_DEBUG
+ printf("***** [SUM] RESET %ld.%ld nxt %ld.%ld down=%d up=%d\n", (long) sumstats->ts.prevTime.tv_sec, (long) sumstats->ts.prevTime.tv_usec, \
+ (long) sumstats->ts.nextTime.tv_sec, (long) sumstats->ts.nextTime.tv_usec, sumstats->slot_thread_downcount, sumstats->slot_thread_upcount);
+#endif
+ sumstats->slot_thread_upcount -= sumstats->slot_thread_downcount;
+ sumstats->slot_thread_downcount = 0;
+ sumstats->ts.prevTime = sumstats->ts.nextTime;
+ sumstats->iInP = 0;
+ sumstats->uplevel = toggleLevel(sumstats->uplevel);
+ sumstats->downlevel = toggleLevel(sumstats->downlevel);
+}
+
static inline void reporter_reset_transfer_stats_client_tcp (struct TransferInfo *stats) {
stats->total.Bytes.prev = stats->total.Bytes.current;
stats->sock_callstats.write.WriteCnt = 0;
stats->sock_callstats.write.WriteErr = 0;
+ stats->sock_callstats.write.WriteTimeo = 0;
stats->isochstats.framecnt.prev = stats->isochstats.framecnt.current;
stats->isochstats.framelostcnt.prev = stats->isochstats.framelostcnt.current;
stats->isochstats.slipcnt.prev = stats->isochstats.slipcnt.current;
@@ -1144,13 +1256,7 @@ static inline void reporter_reset_transfer_stats_client_tcp (struct TransferInfo
reporter_reset_mmm(&stats->bbasym.current);
}
if (isTcpWriteTimes(stats->common)) {
- stats->write_mmm.current.cnt = 0;
- stats->write_mmm.current.min = FLT_MAX;
- stats->write_mmm.current.max = FLT_MIN;
- stats->write_mmm.current.sum = 0;
- stats->write_mmm.current.vd = 0;
- stats->write_mmm.current.mean = 0;
- stats->write_mmm.current.m2 = 0;
+ reporter_reset_mmm(&stats->write_mmm.current);
}
}
@@ -1164,6 +1270,7 @@ static inline void reporter_reset_transfer_stats_client_udp (struct TransferInfo
stats->total.IPG.prev = stats->total.IPG.current;
stats->sock_callstats.write.WriteCnt = 0;
stats->sock_callstats.write.WriteErr = 0;
+ stats->sock_callstats.write.WriteTimeo = 0;
stats->isochstats.framecnt.prev = stats->isochstats.framecnt.current;
stats->isochstats.framelostcnt.prev = stats->isochstats.framelostcnt.current;
stats->isochstats.slipcnt.prev = stats->isochstats.slipcnt.current;
@@ -1174,7 +1281,7 @@ static inline void reporter_reset_transfer_stats_client_udp (struct TransferInfo
static inline void reporter_reset_transfer_stats_server_tcp (struct TransferInfo *stats) {
int ix;
stats->total.Bytes.prev = stats->total.Bytes.current;
- stats->sock_callstats.read.cntRead = 0;
+ stats->sock_callstats.read.ReadCnt.prev = stats->sock_callstats.read.ReadCnt.current;
for (ix = 0; ix < 8; ix++) {
stats->sock_callstats.read.bins[ix] = 0;
}
@@ -1198,8 +1305,10 @@ static inline void reporter_reset_transfer_stats_server_udp (struct TransferInfo
stats->l2counts.unknown = 0;
stats->l2counts.udpcsumerr = 0;
stats->l2counts.lengtherr = 0;
- stats->threadcnt = 0;
stats->iInP = 0;
+ stats->sock_callstats.read.ReadCnt.prev = stats->sock_callstats.read.ReadCnt.current;
+ stats->sock_callstats.read.ReadTimeoCnt.prev = stats->sock_callstats.read.ReadTimeoCnt.current;
+ stats->sock_callstats.read.ReadErrLenCnt.prev = stats->sock_callstats.read.ReadErrLenCnt.current;
if (stats->cntDatagrams)
stats->IPGsum = 0;
}
@@ -1209,7 +1318,7 @@ static inline void reporter_reset_transfer_stats_server_udp (struct TransferInfo
// o) set the TransferInfo struct and then calls the individual report output handler
// o) updates the sum and fullduplex reports
//
-void reporter_transfer_protocol_server_udp (struct ReporterData *data, int final) {
+void reporter_transfer_protocol_server_udp (struct ReporterData *data, bool final) {
struct TransferInfo *stats = &data->info;
struct TransferInfo *sumstats = (data->GroupSumReport != NULL) ? &data->GroupSumReport->info : NULL;
struct TransferInfo *fullduplexstats = (data->FullDuplexReport != NULL) ? &data->FullDuplexReport->info : NULL;
@@ -1223,6 +1332,9 @@ void reporter_transfer_protocol_server_udp (struct ReporterData *data, int final
stats->cntError = 0;
stats->cntDatagrams = stats->PacketID - stats->total.Datagrams.prev;
stats->cntIPG = stats->total.IPG.current - stats->total.IPG.prev;
+ stats->sock_callstats.read.cntRead = stats->sock_callstats.read.ReadCnt.current - stats->sock_callstats.read.ReadCnt.prev;
+ stats->sock_callstats.read.cntReadTimeo = stats->sock_callstats.read.ReadTimeoCnt.current - stats->sock_callstats.read.ReadTimeoCnt.prev;
+ stats->sock_callstats.read.cntReadErrLen = stats->sock_callstats.read.ReadErrLenCnt.current - stats->sock_callstats.read.ReadErrLenCnt.prev;
if (stats->latency_histogram) {
stats->latency_histogram->final = final;
@@ -1258,8 +1370,24 @@ void reporter_transfer_protocol_server_udp (struct ReporterData *data, int final
sumstats->total.IPG.current += stats->cntIPG;
if (sumstats->IPGsum < stats->IPGsum)
sumstats->IPGsum = stats->IPGsum;
- sumstats->threadcnt++;
sumstats->iInP += stats->iInP;
+ sumstats->sock_callstats.read.cntRead += stats->sock_callstats.read.cntRead;
+ sumstats->sock_callstats.read.cntReadTimeo += stats->sock_callstats.read.cntReadTimeo;
+ sumstats->sock_callstats.read.cntReadErrLen += stats->sock_callstats.read.cntReadErrLen;
+ if (final) {
+ sumstats->threadcnt_final++;
+ if (data->packetring->downlevel != sumstats->downlevel) {
+ sumstats->slot_thread_downcount++;
+ }
+ if (data->packetring->uplevel != sumstats->uplevel){
+ sumstats->slot_thread_upcount++;
+ }
+#if HAVE_SUMMING_DEBUG
+ printf("**** %s downcnt (%p) (up/down)=%d/%d final true uplevel (sum/pkt)=%d/%d\n", stats->common->transferIDStr, (void *)data->packetring, \
+ sumstats->slot_thread_upcount, sumstats->slot_thread_downcount, \
+ sumstats->uplevel, data->packetring->uplevel);
+#endif
+ }
}
if (fullduplexstats) {
fullduplexstats->total.Bytes.current += stats->cntBytes;
@@ -1321,20 +1449,23 @@ void reporter_transfer_protocol_server_udp (struct ReporterData *data, int final
if (stats->latency_histogram) {
if (sumstats && sumstats->latency_histogram) {
histogram_add(sumstats->latency_histogram, stats->latency_histogram);
- sumstats->latency_histogram->final = 1;
+ sumstats->latency_histogram->final = true;
}
- stats->latency_histogram->final = 1;
+ stats->latency_histogram->final = true;
}
if (stats->jitter_histogram) {
if (sumstats && sumstats->jitter_histogram) {
histogram_add(sumstats->jitter_histogram, stats->jitter_histogram);
- sumstats->jitter_histogram->final = 1;
+ sumstats->jitter_histogram->final = true;
}
- stats->jitter_histogram->final = 1;
+ stats->jitter_histogram->final = true;
}
if (stats->framelatency_histogram) {
- stats->framelatency_histogram->final = 1;
+ stats->framelatency_histogram->final = true;
}
+ stats->sock_callstats.read.cntRead = stats->sock_callstats.read.ReadCnt.current;
+ stats->sock_callstats.read.cntReadTimeo = stats->sock_callstats.read.ReadTimeoCnt.current;
+ stats->sock_callstats.read.cntReadErrLen = stats->sock_callstats.read.ReadErrLenCnt.current;
}
if ((stats->output_handler) && !(stats->isMaskOutput))
(*stats->output_handler)(stats);
@@ -1342,7 +1473,7 @@ void reporter_transfer_protocol_server_udp (struct ReporterData *data, int final
reporter_reset_transfer_stats_server_udp(stats);
}
-void reporter_transfer_protocol_sum_server_udp (struct TransferInfo *stats, int final) {
+void reporter_transfer_protocol_sum_server_udp (struct TransferInfo *stats, bool final) {
if (final) {
reporter_set_timestamps_time(stats, TOTAL);
stats->cntOutofOrder = stats->total.OutofOrder.current;
@@ -1368,15 +1499,16 @@ void reporter_transfer_protocol_sum_server_udp (struct TransferInfo *stats, int
stats->cntBytes = stats->total.Bytes.current - stats->total.Bytes.prev;
stats->cntIPG = stats->total.IPG.current - stats->total.IPG.prev;
}
- if ((stats->output_handler) && !(stats->isMaskOutput))
+ if ((stats->output_handler) && !(stats->isMaskOutput)) {
(*stats->output_handler)(stats);
+ }
if (!final) {
// there is no packet ID for sum server reports, set it to total cnt for calculation
stats->PacketID = stats->total.Datagrams.current;
reporter_reset_transfer_stats_server_udp(stats);
}
}
-void reporter_transfer_protocol_sum_client_udp (struct TransferInfo *stats, int final) {
+void reporter_transfer_protocol_sum_client_udp (struct TransferInfo *stats, bool final) {
if (final) {
reporter_set_timestamps_time(stats, TOTAL);
stats->sock_callstats.write.WriteErr = stats->sock_callstats.write.totWriteErr;
@@ -1390,19 +1522,18 @@ void reporter_transfer_protocol_sum_client_udp (struct TransferInfo *stats, int
stats->cntIPG = stats->total.IPG.current - stats->total.IPG.prev;
stats->cntDatagrams = stats->total.Datagrams.current - stats->total.Datagrams.prev;
}
- if ((stats->output_handler) && !(stats->isMaskOutput))
+ if ((stats->output_handler) && !(stats->isMaskOutput)) {
(*stats->output_handler)(stats);
-
+ }
if (!final) {
- stats->threadcnt = 0;
reporter_reset_transfer_stats_client_udp(stats);
} else if ((stats->common->ReportMode != kReport_CSV) && !(stats->isMaskOutput)) {
- printf(report_sumcnt_datagrams, stats->threadcnt, stats->total.Datagrams.current);
+ printf(report_sumcnt_datagrams, stats->threadcnt_final, stats->total.Datagrams.current);
fflush(stdout);
}
}
-void reporter_transfer_protocol_client_udp (struct ReporterData *data, int final) {
+void reporter_transfer_protocol_client_udp (struct ReporterData *data, bool final) {
struct TransferInfo *stats = &data->info;
struct TransferInfo *sumstats = (data->GroupSumReport != NULL) ? &data->GroupSumReport->info : NULL;
struct TransferInfo *fullduplexstats = (data->FullDuplexReport != NULL) ? &data->FullDuplexReport->info : NULL;
@@ -1418,13 +1549,28 @@ void reporter_transfer_protocol_client_udp (struct ReporterData *data, int final
sumstats->total.Bytes.current += stats->cntBytes;
sumstats->sock_callstats.write.WriteErr += stats->sock_callstats.write.WriteErr;
sumstats->sock_callstats.write.WriteCnt += stats->sock_callstats.write.WriteCnt;
+ sumstats->sock_callstats.write.WriteTimeo += stats->sock_callstats.write.WriteTimeo;
sumstats->sock_callstats.write.totWriteErr += stats->sock_callstats.write.WriteErr;
sumstats->sock_callstats.write.totWriteCnt += stats->sock_callstats.write.WriteCnt;
+ sumstats->sock_callstats.write.totWriteTimeo += stats->sock_callstats.write.WriteTimeo;
sumstats->total.Datagrams.current += stats->cntDatagrams;
if (sumstats->IPGsum < stats->IPGsum)
sumstats->IPGsum = stats->IPGsum;
sumstats->total.IPG.current += stats->cntIPG;
- sumstats->threadcnt++;
+ if (final) {
+ sumstats->threadcnt_final++;
+ if (data->packetring->downlevel != sumstats->downlevel) {
+ sumstats->slot_thread_downcount++;
+ }
+ if (data->packetring->uplevel != sumstats->uplevel){
+ sumstats->slot_thread_upcount++;
+ }
+#if HAVE_SUMMING_DEBUG
+ printf("**** %s downcnt (%p) (up/down)=%d/%d final true level (sum/pkt)=%d/%d\n", stats->common->transferIDStr, (void *)data->packetring, \
+ sumstats->slot_thread_upcount, sumstats->slot_thread_downcount, \
+ sumstats->uplevel, data->packetring->uplevel);
+#endif
+ }
}
if (fullduplexstats) {
fullduplexstats->total.Bytes.current += stats->cntBytes;
@@ -1438,6 +1584,7 @@ void reporter_transfer_protocol_client_udp (struct ReporterData *data, int final
stats->cntBytes = stats->total.Bytes.current;
stats->sock_callstats.write.WriteErr = stats->sock_callstats.write.totWriteErr;
stats->sock_callstats.write.WriteCnt = stats->sock_callstats.write.totWriteCnt;
+ stats->sock_callstats.write.WriteTimeo = stats->sock_callstats.write.totWriteTimeo;
stats->cntIPG = stats->total.IPG.current;
stats->cntDatagrams = stats->PacketID;
stats->IPGsum = TimeDifference(stats->ts.packetTime, stats->ts.startTime);
@@ -1463,14 +1610,14 @@ void reporter_transfer_protocol_client_udp (struct ReporterData *data, int final
reporter_reset_transfer_stats_client_udp(stats);
}
-void reporter_transfer_protocol_server_tcp (struct ReporterData *data, int final) {
+void reporter_transfer_protocol_server_tcp (struct ReporterData *data, bool final) {
struct TransferInfo *stats = &data->info;
struct TransferInfo *sumstats = (data->GroupSumReport != NULL) ? &data->GroupSumReport->info : NULL;
struct TransferInfo *fullduplexstats = (data->FullDuplexReport != NULL) ? &data->FullDuplexReport->info : NULL;
stats->cntBytes = stats->total.Bytes.current - stats->total.Bytes.prev;
int ix;
if (stats->framelatency_histogram) {
- stats->framelatency_histogram->final = 0;
+ stats->framelatency_histogram->final = false;
}
double thisInP;
if (!final) {
@@ -1479,18 +1626,18 @@ void reporter_transfer_protocol_server_tcp (struct ReporterData *data, int final
double meantransit = (double) ((stats->transit.current.cnt > 0) ? (stats->transit.current.sum / stats->transit.current.cnt) : 0.0);
thisInP = lambda * meantransit;
stats->iInP = thisInP;
+ stats->sock_callstats.read.cntRead = stats->sock_callstats.read.ReadCnt.current - stats->sock_callstats.read.ReadCnt.prev;
} else {
double bytecnt = (double) stats->cntBytes;
double lambda = (stats->IPGsum > 0.0) ? (bytecnt / stats->IPGsum) : 0.0;
double meantransit = (double) ((stats->transit.total.cnt > 0) ? (stats->transit.total.sum / stats->transit.total.cnt) : 0.0);
thisInP = lambda * meantransit;
stats->fInP = thisInP;
+ stats->sock_callstats.read.cntRead = stats->sock_callstats.read.ReadCnt.current;
}
if (sumstats) {
- sumstats->threadcnt++;
sumstats->total.Bytes.current += stats->cntBytes;
- sumstats->sock_callstats.read.cntRead += stats->sock_callstats.read.cntRead;
- sumstats->sock_callstats.read.totcntRead += stats->sock_callstats.read.cntRead;
+ sumstats->sock_callstats.read.ReadCnt.current += stats->sock_callstats.read.cntRead;
for (ix = 0; ix < TCPREADBINCOUNT; ix++) {
sumstats->sock_callstats.read.bins[ix] += stats->sock_callstats.read.bins[ix];
sumstats->sock_callstats.read.totbins[ix] += stats->sock_callstats.read.bins[ix];
@@ -1499,6 +1646,18 @@ void reporter_transfer_protocol_server_tcp (struct ReporterData *data, int final
sumstats->iInP += thisInP;
} else {
sumstats->fInP += thisInP;
+ sumstats->threadcnt_final++;
+ if (data->packetring->downlevel != sumstats->downlevel) {
+ sumstats->slot_thread_downcount++;
+ }
+ if (data->packetring->uplevel != sumstats->uplevel){
+ sumstats->slot_thread_upcount++;
+ }
+#if HAVE_SUMMING_DEBUG
+ printf("**** %s downcnt (%p) (up/down)=%d/%d final true level (sum/pkt)=%d/%d\n", stats->common->transferIDStr, (void *)data->packetring, \
+ sumstats->slot_thread_upcount, sumstats->slot_thread_downcount, \
+ sumstats->uplevel, data->packetring->uplevel);
+#endif
}
}
if (fullduplexstats) {
@@ -1520,12 +1679,12 @@ void reporter_transfer_protocol_server_tcp (struct ReporterData *data, int final
}
}
if (stats->framelatency_histogram) {
- stats->framelatency_histogram->final = 1;
+ stats->framelatency_histogram->final = true;
}
reporter_set_timestamps_time(stats, TOTAL);
stats->cntBytes = stats->total.Bytes.current;
stats->IPGsum = stats->ts.iEnd;
- stats->sock_callstats.read.cntRead = stats->sock_callstats.read.totcntRead;
+ stats->sock_callstats.read.cntRead = stats->sock_callstats.read.ReadCnt.current;
for (ix = 0; ix < TCPREADBINCOUNT; ix++) {
stats->sock_callstats.read.bins[ix] = stats->sock_callstats.read.totbins[ix];
}
@@ -1538,9 +1697,9 @@ void reporter_transfer_protocol_server_tcp (struct ReporterData *data, int final
if (stats->framelatency_histogram) {
if (sumstats && sumstats->framelatency_histogram) {
histogram_add(sumstats->framelatency_histogram, stats->framelatency_histogram);
- sumstats->framelatency_histogram->final = 1;
+ sumstats->framelatency_histogram->final = true;
}
- stats->framelatency_histogram->final = 1;
+ stats->framelatency_histogram->final = true;
}
} else if (isIsochronous(stats->common)) {
stats->isochstats.cntFrames = stats->isochstats.framecnt.current - stats->isochstats.framecnt.prev;
@@ -1557,7 +1716,7 @@ void reporter_transfer_protocol_server_tcp (struct ReporterData *data, int final
reporter_reset_transfer_stats_server_tcp(stats);
}
-void reporter_transfer_protocol_client_tcp (struct ReporterData *data, int final) {
+void reporter_transfer_protocol_client_tcp (struct ReporterData *data, bool final) {
struct TransferInfo *stats = &data->info;
struct TransferInfo *sumstats = (data->GroupSumReport != NULL) ? &data->GroupSumReport->info : NULL;
struct TransferInfo *fullduplexstats = (data->FullDuplexReport != NULL) ? &data->FullDuplexReport->info : NULL;
@@ -1585,7 +1744,24 @@ void reporter_transfer_protocol_client_tcp (struct ReporterData *data, int final
sumstats->sock_callstats.write.WriteCnt += stats->sock_callstats.write.WriteCnt;
sumstats->sock_callstats.write.totWriteErr += stats->sock_callstats.write.WriteErr;
sumstats->sock_callstats.write.totWriteCnt += stats->sock_callstats.write.WriteCnt;
- sumstats->threadcnt++;
+ if (final) {
+ sumstats->threadcnt_final++;
+ if (data->packetring->downlevel != sumstats->downlevel) {
+ sumstats->slot_thread_downcount++;
+ }
+ if (data->packetring->uplevel != sumstats->uplevel){
+ sumstats->slot_thread_upcount++;
+ }
+#if HAVE_SUMMING_DEBUG
+ printf("**** %s downcnt (%p) (up/down)=%d/%d final true level (sum/pkt)=%d/%d\n", stats->common->transferIDStr, (void *)data->packetring, \
+ sumstats->slot_thread_upcount, sumstats->slot_thread_downcount, \
+ sumstats->uplevel, data->packetring->uplevel);
+#endif
+ }
+#if HAVE_SUMMING_DEBUG
+ reporter_dump_timestamps(NULL, stats, sumstats);
+#endif
+
#if HAVE_TCP_STATS
sumstats->sock_callstats.write.tcpstats.retry += stats->sock_callstats.write.tcpstats.retry;
sumstats->sock_callstats.write.tcpstats.retry_tot += stats->sock_callstats.write.tcpstats.retry;
@@ -1596,10 +1772,10 @@ void reporter_transfer_protocol_client_tcp (struct ReporterData *data, int final
}
if (final) {
if (stats->latency_histogram) {
- stats->latency_histogram->final = 1;
+ stats->latency_histogram->final = true;
}
if (stats->write_histogram) {
- stats->write_histogram->final = 1;
+ stats->write_histogram->final = true;
}
if ((stats->cntBytes > 0) && stats->output_handler && !TimeZero(stats->ts.intervalTime)) {
// print a partial interval report if enable and this a final
@@ -1626,7 +1802,7 @@ void reporter_transfer_protocol_client_tcp (struct ReporterData *data, int final
stats->sock_callstats.write.tcpstats.retry = stats->sock_callstats.write.tcpstats.retry_tot;
#endif
if (stats->framelatency_histogram) {
- stats->framelatency_histogram->final = 1;
+ stats->framelatency_histogram->final = true;
}
stats->cntBytes = stats->total.Bytes.current;
stats->write_mmm.current = stats->write_mmm.total;
@@ -1646,19 +1822,20 @@ void reporter_transfer_protocol_client_tcp (struct ReporterData *data, int final
/*
* Handles summing of threads
*/
-void reporter_transfer_protocol_sum_client_tcp (struct TransferInfo *stats, int final) {
+void reporter_transfer_protocol_sum_client_tcp (struct TransferInfo *stats, bool final) {
if (!final || (final && (stats->cntBytes > 0) && !TimeZero(stats->ts.intervalTime))) {
stats->cntBytes = stats->total.Bytes.current - stats->total.Bytes.prev;
if (final) {
if ((stats->output_handler) && !(stats->isMaskOutput)) {
reporter_set_timestamps_time(stats, FINALPARTIAL);
- if ((stats->ts.iEnd - stats->ts.iStart) > stats->ts.significant_partial)
+ if ((stats->ts.iEnd - stats->ts.iStart) > stats->ts.significant_partial) {
(*stats->output_handler)(stats);
+ }
reporter_reset_transfer_stats_client_tcp(stats);
}
} else if ((stats->output_handler) && !(stats->isMaskOutput)) {
(*stats->output_handler)(stats);
- stats->threadcnt = 0;
+ reporter_reset_transfer_stats_sum(stats);
}
reporter_reset_transfer_stats_client_tcp(stats);
}
@@ -1675,7 +1852,7 @@ void reporter_transfer_protocol_sum_client_tcp (struct TransferInfo *stats, int
}
}
-void reporter_transfer_protocol_client_bb_tcp (struct ReporterData *data, int final) {
+void reporter_transfer_protocol_client_bb_tcp (struct ReporterData *data, bool final) {
struct TransferInfo *stats = &data->info;
if (final) {
@@ -1703,7 +1880,7 @@ void reporter_transfer_protocol_client_bb_tcp (struct ReporterData *data, int fi
}
}
-void reporter_transfer_protocol_server_bb_tcp (struct ReporterData *data, int final) {
+void reporter_transfer_protocol_server_bb_tcp (struct ReporterData *data, bool final) {
struct TransferInfo *stats = &data->info;
if (final) {
if ((stats->cntBytes > 0) && stats->output_handler && !TimeZero(stats->ts.intervalTime)) {
@@ -1716,7 +1893,6 @@ void reporter_transfer_protocol_server_bb_tcp (struct ReporterData *data, int fi
}
}
#if HAVE_TCP_STATS
-
stats->sock_callstats.write.tcpstats.retry = stats->sock_callstats.write.tcpstats.retry_tot;
#endif
stats->cntBytes = stats->total.Bytes.current;
@@ -1730,26 +1906,27 @@ void reporter_transfer_protocol_server_bb_tcp (struct ReporterData *data, int fi
reporter_reset_transfer_stats_client_tcp(stats);
}
-void reporter_transfer_protocol_sum_server_tcp (struct TransferInfo *stats, int final) {
+void reporter_transfer_protocol_sum_server_tcp (struct TransferInfo *stats, bool final) {
if (!final || (final && (stats->cntBytes > 0) && !TimeZero(stats->ts.intervalTime))) {
stats->cntBytes = stats->total.Bytes.current - stats->total.Bytes.prev;
+ stats->sock_callstats.read.cntRead = stats->sock_callstats.read.ReadCnt.current - stats->sock_callstats.read.ReadCnt.prev;
if (final) {
if ((stats->output_handler) && !(stats->isMaskOutput)) {
reporter_set_timestamps_time(stats, FINALPARTIAL);
- if ((stats->ts.iEnd - stats->ts.iStart) > stats->ts.significant_partial)
+ if ((stats->ts.iEnd - stats->ts.iStart) > stats->ts.significant_partial) {
(*stats->output_handler)(stats);
+ }
}
} else if ((stats->output_handler) && !(stats->isMaskOutput)) {
(*stats->output_handler)(stats);
- stats->threadcnt = 0;
- stats->iInP = 0;
+ reporter_reset_transfer_stats_sum(stats);
}
reporter_reset_transfer_stats_server_tcp(stats);
}
if (final) {
int ix;
stats->cntBytes = stats->total.Bytes.current;
- stats->sock_callstats.read.cntRead = stats->sock_callstats.read.totcntRead;
+ stats->sock_callstats.read.cntRead = stats->sock_callstats.read.ReadCnt.current;
for (ix = 0; ix < TCPREADBINCOUNT; ix++) {
stats->sock_callstats.read.bins[ix] = stats->sock_callstats.read.totbins[ix];
}
@@ -1759,7 +1936,7 @@ void reporter_transfer_protocol_sum_server_tcp (struct TransferInfo *stats, int
(*stats->output_handler)(stats);
}
}
-void reporter_transfer_protocol_fullduplex_tcp (struct TransferInfo *stats, int final) {
+void reporter_transfer_protocol_fullduplex_tcp (struct TransferInfo *stats, bool final) {
if (!final || (final && (stats->cntBytes > 0) && !TimeZero(stats->ts.intervalTime))) {
stats->cntBytes = stats->total.Bytes.current - stats->total.Bytes.prev;
if (final) {
@@ -1781,7 +1958,7 @@ void reporter_transfer_protocol_fullduplex_tcp (struct TransferInfo *stats, int
(*stats->output_handler)(stats);
}
-void reporter_transfer_protocol_fullduplex_udp (struct TransferInfo *stats, int final) {
+void reporter_transfer_protocol_fullduplex_udp (struct TransferInfo *stats, bool final) {
if (!final || (final && (stats->cntBytes > 0) && !TimeZero(stats->ts.intervalTime))) {
stats->cntBytes = stats->total.Bytes.current - stats->total.Bytes.prev;
stats->cntDatagrams = stats->total.Datagrams.current - stats->total.Datagrams.prev;
@@ -1814,11 +1991,11 @@ void reporter_transfer_protocol_fullduplex_udp (struct TransferInfo *stats, int
}
// Conditional print based on time
-int reporter_condprint_time_interval_report (struct ReporterData *data, struct ReportStruct *packet) {
+bool reporter_condprint_time_interval_report (struct ReporterData *data, struct ReportStruct *packet) {
struct TransferInfo *stats = &data->info;
assert(stats!=NULL);
// printf("***sum handler = %p\n", (void *) data->GroupSumReport->transfer_protocol_sum_handler);
- int advance_jobq = 0;
+ bool advance_jobq = false;
// Print a report if packet time exceeds the next report interval time,
// Also signal to the caller to move to the next report (or packet ring)
// if there was output. This will allow for more precise interval sum accounting.
@@ -1826,7 +2003,7 @@ int reporter_condprint_time_interval_report (struct ReporterData *data, struct R
// printf("***** nt %ld.%ld pt %ld.%ld pid=%lld empty=%d\n", stats->ts.nextTime.tv_sec, stats->ts.nextTime.tv_usec, packet->packetTime.tv_sec, packet->packetTime.tv_usec, packet->packetID, packet->emptyreport);
if (TimeDifference(stats->ts.nextTime, packet->packetTime) < 0) {
assert(data->transfer_protocol_handler!=NULL);
- advance_jobq = 1;
+ advance_jobq = true;
struct TransferInfo *sumstats = (data->GroupSumReport ? &data->GroupSumReport->info : NULL);
struct TransferInfo *fullduplexstats = (data->FullDuplexReport ? &data->FullDuplexReport->info : NULL);
stats->ts.packetTime = packet->packetTime;
@@ -1838,10 +2015,19 @@ int reporter_condprint_time_interval_report (struct ReporterData *data, struct R
if (fullduplexstats && ((++data->FullDuplexReport->threads) == 2) && isEnhanced(stats->common)) {
data->FullDuplexReport->threads = 0;
assert(data->FullDuplexReport->transfer_protocol_sum_handler != NULL);
- (*data->FullDuplexReport->transfer_protocol_sum_handler)(fullduplexstats, 0);
+ (*data->FullDuplexReport->transfer_protocol_sum_handler)(fullduplexstats, false);
}
if (sumstats) {
- if ((++data->GroupSumReport->threads) == data->GroupSumReport->reference.count) {
+ if (data->packetring->downlevel != sumstats->downlevel) {
+ sumstats->slot_thread_downcount++;
+ data->packetring->downlevel = toggleLevel(data->packetring->downlevel);
+#if HAVE_SUMMING_DEBUG
+ printf("**** %s downcnt (%p) pkt=%ld.%ld (up/down)=%d/%d final false level (sum/pkt)=%d/%d\n", stats->common->transferIDStr, (void *)data->packetring, \
+ (long) packet->packetTime.tv_sec, (long) packet->packetTime.tv_usec, sumstats->slot_thread_upcount, sumstats->slot_thread_downcount, \
+ sumstats->uplevel, data->packetring->uplevel);
+#endif
+ }
+ if ((sumstats->slot_thread_downcount) == sumstats->slot_thread_upcount) {
data->GroupSumReport->threads = 0;
if ((data->GroupSumReport->reference.count > (fullduplexstats ? 2 : 1)) || \
isSumOnly(data->info.common)) {
@@ -1849,9 +2035,12 @@ int reporter_condprint_time_interval_report (struct ReporterData *data, struct R
} else {
sumstats->isMaskOutput = true;
}
+#if HAVE_SUMMING_DEBUG
+ reporter_dump_timestamps(packet, stats, sumstats);
+#endif
reporter_set_timestamps_time(sumstats, INTERVAL);
assert(data->GroupSumReport->transfer_protocol_sum_handler != NULL);
- (*data->GroupSumReport->transfer_protocol_sum_handler)(sumstats, 0);
+ (*data->GroupSumReport->transfer_protocol_sum_handler)(sumstats, false);
}
}
// In the (hopefully unlikely event) the reporter fell behind
@@ -1863,9 +2052,9 @@ int reporter_condprint_time_interval_report (struct ReporterData *data, struct R
}
// Conditional print based on bursts or frames
-int reporter_condprint_frame_interval_report_server_udp (struct ReporterData *data, struct ReportStruct *packet) {
+bool reporter_condprint_frame_interval_report_server_udp (struct ReporterData *data, struct ReportStruct *packet) {
struct TransferInfo *stats = &data->info;
- int advance_jobq = 0;
+ bool advance_jobq = false;
// first packet of a burst and not a duplicate
if ((packet->burstsize == (packet->remaining + packet->packetLen)) && (stats->matchframeID != packet->frameID)) {
stats->matchframeID=packet->frameID;
@@ -1887,35 +2076,36 @@ int reporter_condprint_frame_interval_report_server_udp (struct ReporterData *da
if ((stats->output_handler) && !(stats->isMaskOutput))
(*stats->output_handler)(stats);
reporter_reset_transfer_stats_server_udp(stats);
- advance_jobq = 1;
+ advance_jobq = true;
}
return advance_jobq;
}
-int reporter_condprint_frame_interval_report_server_tcp (struct ReporterData *data, struct ReportStruct *packet) {
+bool reporter_condprint_frame_interval_report_server_tcp (struct ReporterData *data, struct ReportStruct *packet) {
fprintf(stderr, "FIX ME\n");
- return 1;
+ return true;
}
-int reporter_condprint_burst_interval_report_server_tcp (struct ReporterData *data, struct ReportStruct *packet) {
+bool reporter_condprint_burst_interval_report_server_tcp (struct ReporterData *data, struct ReportStruct *packet) {
struct TransferInfo *stats = &data->info;
- int advance_jobq = 0;
+ int advance_jobq = false;
if (packet->transit_ready) {
stats->ts.prevpacketTime = packet->sentTime;
stats->ts.packetTime = packet->packetTime;
reporter_set_timestamps_time(stats, INTERVALPARTIAL);
stats->cntBytes = stats->total.Bytes.current - stats->total.Bytes.prev;
+ stats->sock_callstats.read.cntRead = stats->sock_callstats.read.ReadCnt.current - stats->sock_callstats.read.ReadCnt.prev;
if ((stats->output_handler) && !(stats->isMaskOutput))
(*stats->output_handler)(stats);
reporter_reset_transfer_stats_server_tcp(stats);
- advance_jobq = 1;
+ advance_jobq = true;
}
return advance_jobq;
}
-int reporter_condprint_burst_interval_report_client_tcp (struct ReporterData *data, struct ReportStruct *packet) {
+bool reporter_condprint_burst_interval_report_client_tcp (struct ReporterData *data, struct ReportStruct *packet) {
struct TransferInfo *stats = &data->info;
- int advance_jobq = 0;
+ int advance_jobq = false;
// first packet of a burst and not a duplicate
if (packet->transit_ready) {
reporter_handle_packet_oneway_transit(stats, packet);
@@ -1927,7 +2117,7 @@ int reporter_condprint_burst_interval_report_client_tcp (struct ReporterData *da
if ((stats->output_handler) && !(stats->isMaskOutput))
(*stats->output_handler)(stats);
reporter_reset_transfer_stats_client_tcp(stats);
- advance_jobq = 1;
+ advance_jobq = true;
}
return advance_jobq;
}
diff --git a/src/Reports.c b/src/Reports.c
index 008f7f4..296078e 100644
--- a/src/Reports.c
+++ b/src/Reports.c
@@ -59,6 +59,7 @@
#include "Locale.h"
#include "active_hosts.h"
#include "payloads.h"
+
static int transferid_counter = 0;
static inline int my_str_copy(char **dst, char *src) {
@@ -90,6 +91,7 @@ static void common_copy (struct ReportCommon **common, struct thread_Settings *i
my_str_copy(&(*common)->Ifrnametx, inSettings->mIfrnametx);
my_str_copy(&(*common)->SSMMulticastStr, inSettings->mSSMMulticastStr);
my_str_copy(&(*common)->Congestion, inSettings->mCongestion);
+ my_str_copy(&(*common)->LoadCCA, inSettings->mLoadCCA);
my_str_copy(&(*common)->transferIDStr, inSettings->mTransferIDStr);
my_str_copy(&(*common)->PermitKey, inSettings->mPermitKey);
@@ -107,6 +109,9 @@ static void common_copy (struct ReportCommon **common, struct thread_Settings *i
(*common)->MSS = inSettings->mMSS;
(*common)->TCPWin = inSettings->mTCPWin;
(*common)->FQPacingRate = inSettings->mFQPacingRate;
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ (*common)->FQPacingRateStep = inSettings->mFQPacingRateStep;
+#endif
(*common)->Port = inSettings->mPort;
(*common)->PortLast = inSettings->mPortLast;
(*common)->BindPort = inSettings->mBindPort;
@@ -116,7 +121,9 @@ static void common_copy (struct ReportCommon **common, struct thread_Settings *i
(*common)->AppRateUnits = inSettings->mAppRateUnits;
(*common)->socket = inSettings->mSock;
(*common)->transferID = inSettings->mTransferID;
+ (*common)->peertransferID = inSettings->mPeerTransferID;
(*common)->threads = inSettings->mThreads;
+ (*common)->working_load_threads = inSettings->mWorkingLoadThreads;
(*common)->winsize_requested = inSettings->mTCPWin;
#if defined(HAVE_LINUX_FILTER_H) && defined(HAVE_AF_PACKET)
(*common)->socketdrop = inSettings->mSockDrop;
@@ -126,18 +133,22 @@ static void common_copy (struct ReportCommon **common, struct thread_Settings *i
(*common)->jitter_binwidth = inSettings->jitter_binwidth;
(*common)->local = inSettings->local;
(*common)->size_local = inSettings->size_local;
+ (*common)->multicast_group = inSettings->multicast_group;
+ (*common)->size_multicast_group = inSettings->size_multicast_group;
(*common)->HistBins =inSettings->mHistBins;
(*common)->HistBinsize =inSettings->mHistBinsize;
(*common)->HistUnits =inSettings->mHistUnits;
(*common)->pktIPG =inSettings->mBurstIPG;
(*common)->rtt_weight = inSettings->rtt_nearcongest_weight_factor;
(*common)->ListenerTimeout =inSettings->mListenerTimeout;
- (*common)->FPS = inSettings->mFPS;
+ (*common)->FPS = (inSettings->mFPS > 0) ? inSettings->mFPS : 0;
(*common)->TOS = inSettings->mTOS;
(*common)->RTOS = inSettings->mRTOS;
(*common)->bbsize = inSettings->mBounceBackBytes;
+ (*common)->bbreplysize = inSettings->mBounceBackReplyBytes;
(*common)->bbhold = inSettings->mBounceBackHold;
(*common)->bbcount = inSettings->mBounceBackBurst;
+ (*common)->Omit = inSettings->mOmit;
#if HAVE_DECL_TCP_WINDOW_CLAMP
(*common)->ClampSize = inSettings->mClampSize;
#endif
@@ -169,6 +180,8 @@ static void free_common_copy (struct ReportCommon *common) {
free(common->SSMMulticastStr);
if (common->Congestion)
free(common->Congestion);
+ if (common->LoadCCA)
+ free(common->LoadCCA);
if (common->transferIDStr)
free(common->transferIDStr);
if (common->PermitKey)
@@ -180,7 +193,7 @@ static void free_common_copy (struct ReportCommon *common) {
// on the setting object. If the current id is zero
// this will get the next one. Otherwise it will use
// the value.
-void setTransferID (struct thread_Settings *inSettings, int role_reversal) {
+void setTransferID (struct thread_Settings *inSettings, enum TansferIDType traffic_direction) {
if (!inSettings->mTransferIDStr) {
if (!inSettings->mTransferID) {
Mutex_Lock(&transferid_mutex);
@@ -188,7 +201,7 @@ void setTransferID (struct thread_Settings *inSettings, int role_reversal) {
Mutex_Unlock(&transferid_mutex);
}
int len = 0;
- if (role_reversal) {
+ if (traffic_direction == REVERSED) {
#ifdef HAVE_ROLE_REVERSAL_ID
if (isPermitKey(inSettings) && (inSettings->mPermitKey[0] != '\0')) {
len = snprintf(NULL, 0, "[%s(*%d)] ", \
@@ -220,6 +233,17 @@ void setTransferID (struct thread_Settings *inSettings, int role_reversal) {
}
}
+void updateTransferIDPeer (struct thread_Settings *inSettings) {
+ if (inSettings->mPeerTransferID && (inSettings->mPeerTransferID != inSettings->mTransferID)) {
+ if (inSettings->mTransferIDStr)
+ FREE_ARRAY(inSettings->mTransferIDStr);
+ int len = snprintf(NULL, 0, "[%3d] ", inSettings->mPeerTransferID);
+ inSettings->mTransferIDStr = (char *) calloc(len+1, sizeof(char));
+ if (inSettings->mTransferIDStr) {
+ len = sprintf(inSettings->mTransferIDStr, "[%3d] ", inSettings->mPeerTransferID);
+ }
+ }
+}
void SetFullDuplexHandlers (struct thread_Settings *inSettings, struct SumReport* sumreport) {
if (isUDP(inSettings)) {
sumreport->transfer_protocol_sum_handler = reporter_transfer_protocol_fullduplex_udp;
@@ -252,7 +276,7 @@ void SetSumHandlers (struct thread_Settings *inSettings, struct SumReport* sumre
} else if (isFullDuplex(inSettings)) {
sumreport->info.output_handler = udp_output_fullduplex_sum;
} else {
- sumreport->info.output_handler = (isEnhanced(inSettings) ? udp_output_sum_read_enhanced : udp_output_sum_read);
+ sumreport->info.output_handler = (isEnhanced(inSettings) ? udp_output_sumcnt_read_enhanced : udp_output_sum_read);
}
}
} else {
@@ -270,7 +294,7 @@ void SetSumHandlers (struct thread_Settings *inSettings, struct SumReport* sumre
} else if (isFullDuplex(inSettings)) {
sumreport->info.output_handler = tcp_output_sum_read;
} else {
- sumreport->info.output_handler = (isEnhanced(inSettings) ? tcp_output_sum_read_enhanced : tcp_output_sum_read);
+ sumreport->info.output_handler = (isEnhanced(inSettings) ? tcp_output_sumcnt_read_enhanced : tcp_output_sum_read);
}
}
}
@@ -290,7 +314,7 @@ void SetSumHandlers (struct thread_Settings *inSettings, struct SumReport* sumre
} else if (isFullDuplex(inSettings)) {
sumreport->info.output_handler = udp_output_fullduplex_sum;
} else {
- sumreport->info.output_handler = (isEnhanced(inSettings) ? udp_output_sum_write_enhanced : udp_output_sum_write);
+ sumreport->info.output_handler = (isEnhanced(inSettings) ? udp_output_sumcnt_write_enhanced : udp_output_sum_write);
}
}
} else {
@@ -306,7 +330,7 @@ void SetSumHandlers (struct thread_Settings *inSettings, struct SumReport* sumre
} else if (isFullDuplex(inSettings)) {
sumreport->info.output_handler = tcp_output_fullduplex_sum;
} else {
- sumreport->info.output_handler = (isEnhanced(inSettings) ? tcp_output_sum_write_enhanced : tcp_output_sum_write);
+ sumreport->info.output_handler = (isEnhanced(inSettings) ? tcp_output_sumcnt_write_enhanced : tcp_output_sum_write);
}
}
}
@@ -316,7 +340,7 @@ void SetSumHandlers (struct thread_Settings *inSettings, struct SumReport* sumre
}
}
-struct SumReport* InitSumReport(struct thread_Settings *inSettings, int inID, int fullduplex_report) {
+struct SumReport* InitSumReport(struct thread_Settings *inSettings, int inID, bool fullduplex_report) {
struct SumReport *sumreport = (struct SumReport *) calloc(1, sizeof(struct SumReport));
if (sumreport == NULL) {
FAIL(1, "Out of Memory!!\n", inSettings);
@@ -324,11 +348,17 @@ struct SumReport* InitSumReport(struct thread_Settings *inSettings, int inID, in
sumreport->reference.count = 0;
sumreport->reference.maxcount = 0;
Mutex_Initialize(&sumreport->reference.lock);
- sumreport->threads = 0;
common_copy(&sumreport->info.common, inSettings);
// sumreport->info.common->transferID = inID; // this is now set in the active code
- sumreport->info.threadcnt = 0;
sumreport->info.isMaskOutput = false;
+ sumreport->info.sumreport = sumreport;
+ sumreport->info.type = SUM_REPORT;
+ sumreport->info.uplevel = LOW;
+ sumreport->info.downlevel = LOW;
+ sumreport->info.slot_thread_upcount = 0;
+ sumreport->info.slot_thread_downcount = 0;
+ sumreport->final_thread_upcount = 0;
+
if (inSettings->mReportMode == kReport_CSV) {
format_ips_port_string(&sumreport->info, 1);
}
@@ -348,18 +378,18 @@ struct SumReport* InitSumReport(struct thread_Settings *inSettings, int inID, in
char name[] = "SUMT8";
sumreport->info.latency_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0,\
pow(10,inSettings->mHistUnits), \
- inSettings->mHistci_lower, inSettings->mHistci_upper, sumreport->info.common->transferID, name);
+ inSettings->mHistci_lower, inSettings->mHistci_upper, sumreport->info.common->transferID, name, false);
} else {
char name[] = "SUMF8";
sumreport->info.framelatency_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0, \
pow(10,inSettings->mHistUnits), inSettings->mHistci_lower, \
- inSettings->mHistci_upper, sumreport->info.common->transferID, name);
+ inSettings->mHistci_upper, sumreport->info.common->transferID, name, false);
}
}
if (isJitterHistogram(inSettings) && isUDP(inSettings)) {
char name[] = "SUMJ8";
sumreport->info.jitter_histogram = histogram_init(JITTER_BINCNT,inSettings->jitter_binwidth,0,JITTER_UNITS, \
- JITTER_LCI, JITTER_UCI, sumreport->info.common->transferID, name);
+ JITTER_LCI, JITTER_UCI, sumreport->info.common->transferID, name, false);
}
}
if (fullduplex_report) {
@@ -417,6 +447,12 @@ void FreeSumReport (struct SumReport *sumreport) {
if (sumreport->info.bbrtt_histogram) {
histogram_delete(sumreport->info.bbrtt_histogram);
}
+ if (sumreport->info.bbowdto_histogram) {
+ histogram_delete(sumreport->info.bbowdto_histogram);
+ }
+ if (sumreport->info.bbowdfro_histogram) {
+ histogram_delete(sumreport->info.bbowdfro_histogram);
+ }
if (sumreport->info.jitter_histogram) {
histogram_delete(sumreport->info.jitter_histogram);
}
@@ -453,6 +489,12 @@ static void Free_iReport (struct ReporterData *ireport) {
if (ireport->info.bbrtt_histogram) {
histogram_delete(ireport->info.bbrtt_histogram);
}
+ if (ireport->info.bbowdto_histogram) {
+ histogram_delete(ireport->info.bbowdto_histogram);
+ }
+ if (ireport->info.bbowdfro_histogram) {
+ histogram_delete(ireport->info.bbowdfro_histogram);
+ }
free_common_copy(ireport->info.common);
free(ireport);
}
@@ -568,13 +610,18 @@ struct ReportHeader* InitIndividualReport (struct thread_Settings *inSettings) {
}
// Copy common settings into the transfer report section
common_copy(&ireport->info.common, inSettings);
+ ireport->info.sumreport = inSettings->mSumReport;
ireport->info.final = false;
ireport->info.burstid_transition = false;
ireport->info.isEnableTcpInfo = false;
+ ireport->info.type = DATA_REPORT;
// Create a new packet ring which is used to communicate
// packet stats from the traffic thread to the reporter
// thread. The reporter thread does all packet accounting
+ // ring events causes the packet ring to return a NULL on
+ // dequeue across a boundary, e.g. an interval report timestamp.
+ // This is needed so summing works properly
ireport->packetring = packetring_init((inSettings->numreportstructs ? inSettings->numreportstructs : (isSingleUDP(inSettings) ? 40 : NUM_REPORT_STRUCTS)), \
&ReportCond, (isSingleUDP(inSettings) ? NULL : &inSettings->awake_me));
#ifdef HAVE_THREAD_DEBUG
@@ -693,21 +740,28 @@ struct ReportHeader* InitIndividualReport (struct thread_Settings *inSettings) {
ireport->transfer_protocol_handler = reporter_transfer_protocol_client_tcp;
if (isSumOnly(inSettings)) {
ireport->info.output_handler = NULL;
+ } else if (isBounceBack(inSettings)) {
+ ireport->packet_handler_post_report = reporter_handle_packet_bb_client;
+ ireport->transfer_protocol_handler = reporter_transfer_protocol_client_bb_tcp;
+ if (inSettings->mReportMode == kReport_CSV)
+ ireport->info.output_handler = tcp_output_write_bb_csv;
+ else
+ ireport->info.output_handler = tcp_output_write_bb;
} else if ((inSettings->mReportMode == kReport_CSV) && !isSumOnly(inSettings)) {
if (isEnhanced(inSettings))
ireport->info.output_handler = tcp_output_write_enhanced_csv;
else
ireport->info.output_handler = tcp_output_basic_csv;
- } else if (isBounceBack(inSettings)) {
- ireport->packet_handler_post_report = reporter_handle_packet_bb_client;
- ireport->transfer_protocol_handler = reporter_transfer_protocol_client_bb_tcp;
- ireport->info.output_handler = tcp_output_write_bb;
} else if (isIsochronous(inSettings)) {
ireport->info.output_handler = tcp_output_write_enhanced_isoch;
} else if (isTcpWriteTimes(inSettings)) {
ireport->info.output_handler = tcp_output_write_enhanced_write;
} else if (isEnhanced(inSettings)) {
- ireport->info.output_handler = tcp_output_write_enhanced;
+ if (isFQPacing(inSettings))
+ ireport->info.output_handler = tcp_output_write_enhanced_fq;
+ else {
+ ireport->info.output_handler = tcp_output_write_enhanced;
+ }
} else if (isFullDuplex(inSettings)) {
ireport->info.output_handler = tcp_output_write;
} else {
@@ -729,13 +783,13 @@ struct ReportHeader* InitIndividualReport (struct thread_Settings *inSettings) {
if (isJitterHistogram(inSettings)) {
char name[] = "J8";
ireport->info.jitter_histogram = histogram_init(JITTER_BINCNT,inSettings->jitter_binwidth,0,JITTER_UNITS, \
- JITTER_LCI, JITTER_UCI, ireport->info.common->transferID, name);
+ JITTER_LCI, JITTER_UCI, ireport->info.common->transferID, name, false);
}
if (isTripTime(inSettings) && isHistogram(inSettings)) {
char name[] = "T8";
ireport->info.latency_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0,\
pow(10,inSettings->mHistUnits), \
- inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, name);
+ inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, name, false);
}
}
if (isHistogram(inSettings) && (isIsochronous(inSettings) || (!isUDP(inSettings) && isTripTime(inSettings)))) {
@@ -743,7 +797,7 @@ struct ReportHeader* InitIndividualReport (struct thread_Settings *inSettings) {
// make sure frame bin size min is 100 microsecond
ireport->info.framelatency_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0, \
pow(10,inSettings->mHistUnits), inSettings->mHistci_lower, \
- inSettings->mHistci_upper, ireport->info.common->transferID, name);
+ inSettings->mHistci_upper, ireport->info.common->transferID, name, false);
}
}
if ((inSettings->mThreadMode == kMode_Client) && !isUDP(inSettings) && isHistogram(inSettings)) {
@@ -751,16 +805,16 @@ struct ReportHeader* InitIndividualReport (struct thread_Settings *inSettings) {
char name[] = "W8";
ireport->info.write_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0,\
pow(10,inSettings->mHistUnits), \
- inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, name);
+ inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, name, false);
} else if (isWritePrefetch(inSettings)) {
char name[] = "S8";
ireport->info.latency_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0,\
pow(10,inSettings->mHistUnits), \
- inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, name);
+ inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, name, false);
}
}
if ((inSettings->mThreadMode == kMode_Client) && isBounceBack(inSettings)) {
- char name[] = "BB8";
+ char name[] = " BB8";
if (!isHistogram(inSettings)) {
inSettings->mHistBins = 100000; // 10 seconds wide
inSettings->mHistBinsize = 100; // 100 usec bins
@@ -769,8 +823,16 @@ struct ReportHeader* InitIndividualReport (struct thread_Settings *inSettings) {
inSettings->mHistci_upper = 95;
}
ireport->info.bbrtt_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0, \
- pow(10,inSettings->mHistUnits), \
- inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, name);
+ pow(10,inSettings->mHistUnits), \
+ inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, name, false);
+ if (isTripTime(inSettings)) {
+ ireport->info.bbowdto_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0, \
+ pow(10,inSettings->mHistUnits), \
+ inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, " OWD-TX", false);
+ ireport->info.bbowdfro_histogram = histogram_init(inSettings->mHistBins,inSettings->mHistBinsize,0, \
+ pow(10,inSettings->mHistUnits), \
+ inSettings->mHistci_lower, inSettings->mHistci_upper, ireport->info.common->transferID, " OWD-RX", false);
+ }
}
return reporthdr;
}
@@ -838,8 +900,14 @@ struct ReportHeader* InitConnectionReport (struct thread_Settings *inSettings) {
creport->common->winsize_requested = inSettings->mTCPWin;
creport->txholdbacktime = inSettings->txholdback_timer;
if (isPeriodicBurst(inSettings)) {
- creport->common->FPS = inSettings->mFPS;
+ creport->common->FPS = (inSettings->mFPS > 0) ? inSettings->mFPS : 0;
+ }
+ if (isLoadCCA(inSettings) && (isWorkingLoadUp(inSettings) || isWorkingLoadDown(inSettings))) {
+ strncpy(creport->connected_cca, inSettings->mLoadCCA, TCP_CCA_NAME_MAX);
+ } else if (isCongestionControl(inSettings)) {
+ strncpy(creport->connected_cca, inSettings->mCongestion, TCP_CCA_NAME_MAX);
}
+ creport->connected_cca[TCP_CCA_NAME_MAX - 1] = '\0';
#ifdef HAVE_THREAD_DEBUG
char rs[REPORTTXTMAX];
reporttype_text(reporthdr, &rs[0]);
@@ -972,6 +1040,19 @@ struct ReportHeader* InitServerRelayUDPReport(struct thread_Settings *inSettings
return reporthdr;
}
+struct ReportHeader* InitStringReport (char *textoutput) {
+ struct ReportHeader *reporthdr = (struct ReportHeader *) calloc(1, sizeof(struct ReportHeader));
+ if (reporthdr == NULL) {
+ WARN_errno(1, "Out of Memory!!\n");
+ }
+ reporthdr->type = STRING_REPORT;
+
+ reporthdr->this_report = (void *) calloc((strlen(textoutput) + 1), sizeof(char));
+ char *dst = (char *)(reporthdr->this_report);
+ strcpy(dst, textoutput);
+ return reporthdr;
+}
+
/* -------------------------------------------------------------------
* Send an AckFIN (a datagram acknowledging a FIN) on the socket,
* then select on the socket for some time to check for silence.
@@ -985,7 +1066,7 @@ void write_UDP_AckFIN (struct TransferInfo *stats, int len) {
int ackpacket_length = (int) (sizeof(struct UDP_datagram) + sizeof(struct server_hdr));
int readlen = ((ackpacket_length * 2) > len * 2) ? (ackpacket_length * 2) : (len * 2);
char *ackPacket = (char *) calloc(1, readlen);
- int success = 0;
+ bool success = false;
assert(ackPacket);
fd_set readSet;
int rc = 1;
@@ -1068,7 +1149,7 @@ void write_UDP_AckFIN (struct TransferInfo *stats, int len) {
#ifdef HAVE_THREAD_DEBUG
thread_debug("UDP server detected silence - server stats assumed received by client");
#endif
- success = 1;
+ success = true;
break;
}
rc = read(stats->common->socket, ackPacket, readlen);
diff --git a/src/Server.cpp b/src/Server.cpp
index c271cd7..76eba40 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -70,7 +70,6 @@
#include "checksums.h"
#endif
-
/* -------------------------------------------------------------------
* Stores connected socket and socket info.
* ------------------------------------------------------------------- */
@@ -94,6 +93,9 @@ Server::Server (thread_Settings *inSettings) {
}
}
#endif
+#if HAVE_DECL_MSG_CTRUNC
+ ctrunc_warn_enable = true;
+#endif
// Enable kernel level timestamping if available
InitKernelTimeStamping();
int sorcvtimer = 0;
@@ -101,15 +103,24 @@ Server::Server (thread_Settings *inSettings) {
// minterval double, units seconds
// mAmount integer, units 10 milliseconds
// divide by two so timeout is 1/2 the interval
- if (mSettings->mInterval && (mSettings->mIntervalMode == kInterval_Time)) {
+ if ((mSettings->mInterval > 0) && (mSettings->mIntervalMode == kInterval_Time)) {
sorcvtimer = static_cast<int>(round(mSettings->mInterval / 2.0));
} else if (isServerModeTime(mSettings)) {
sorcvtimer = static_cast<int>(round(mSettings->mAmount * 10000) / 2);
}
- isburst = (isIsochronous(mSettings) || isPeriodicBurst(mSettings) || (isTripTime(mSettings) && !isUDP(mSettings)));
+ isburst = (isIsochronous(mSettings) || isPeriodicBurst(mSettings) || (isTripTime(mSettings)&& !isUDP(mSettings)));
if (isburst && (mSettings->mFPS > 0.0)) {
sorcvtimer = static_cast<int>(round(2000000.0 / mSettings->mFPS));
}
+ if ((mSettings->mInterval > 0) && (mSettings->mIntervalMode == kInterval_Time)) {
+ int interval_quarter = static_cast<int>(round(mSettings->mAmount * 10000) / 4);
+ if (sorcvtimer > interval_quarter) {
+ sorcvtimer = interval_quarter;
+ }
+ if (sorcvtimer < 1000) {
+ sorcvtimer = 1000; // lower bound of 1 ms
+ }
+ }
if (sorcvtimer > 0) {
SetSocketOptionsReceiveTimeout(mSettings, sorcvtimer);
}
@@ -162,7 +173,7 @@ void Server::RunTCP () {
reportstruct->packetTime.tv_usec = now.getUsecs();
while (InProgress()) {
// printf("***** bid expect = %u\n", burstid_expect);
- reportstruct->emptyreport=1;
+ reportstruct->emptyreport = true;
currLen = 0;
// perform read
if (isBWSet(mSettings)) {
@@ -170,13 +181,13 @@ void Server::RunTCP () {
tokens += time2.subSec(time1) * (mSettings->mAppRate / 8.0);
time1 = time2;
}
- reportstruct->transit_ready = 0;
+ reportstruct->transit_ready = false;
if (tokens >= 0.0) {
int n = 0;
int readLen = mSettings->mBufLen;
if (burst_nleft > 0)
readLen = (mSettings->mBufLen < burst_nleft) ? mSettings->mBufLen : burst_nleft;
- reportstruct->emptyreport=1;
+ reportstruct->emptyreport = true;
#if HAVE_DECL_TCP_QUICKACK
if (isTcpQuickAck(mSettings)) {
int opt = 1;
@@ -215,7 +226,7 @@ void Server::RunTCP () {
burst_nleft = burst_info.burst_size - n;
if (burst_nleft == 0) {
reportstruct->prevSentTime = myReport->info.ts.prevsendTime;
- reportstruct->transit_ready = 1;
+ reportstruct->transit_ready = true;
reportstruct->burstperiod = burst_info.burst_period_us;
}
currLen += n;
@@ -237,7 +248,7 @@ void Server::RunTCP () {
if (!reportstruct->transit_ready) {
n = recv(mSettings->mSock, mSettings->mBuf, readLen, 0);
if (n > 0) {
- reportstruct->emptyreport = 0;
+ reportstruct->emptyreport = false;
if (isburst) {
burst_nleft -= n;
if (burst_nleft == 0) {
@@ -247,7 +258,7 @@ void Server::RunTCP () {
reportstruct->isochStartTime.tv_usec = burst_info.send_tt.write_tv_usec;
reportstruct->burstperiod = burst_info.burst_period_us;
}
- reportstruct->transit_ready = 1;
+ reportstruct->transit_ready = true;
}
}
} else if (n == 0) {
@@ -256,9 +267,14 @@ void Server::RunTCP () {
thread_debug("Server thread detected EOF on socket %d", mSettings->mSock);
#endif
} else if ((n < 0) && (FATALTCPREADERR(errno))) {
- WARN_errno(1, "recv");
peerclose = true;
n = 0;
+ now.setnow();
+ char warnbuf[WARNBUFSIZE];
+ snprintf(warnbuf, sizeof(warnbuf), "%stcp recv (%ld.%ld)",\
+ mSettings->mTransferIDStr, now.getSecs(), now.getUsecs());
+ warnbuf[sizeof(warnbuf)-1] = '\0';
+ WARN_errno(1, warnbuf);
}
currLen += n;
}
@@ -305,44 +321,103 @@ void Server::PostNullEvent () {
// push a nonevent into the packet ring
// this will cause the reporter to process
// up to this event
- memset(reportstruct, 0, sizeof(struct ReportStruct));
+ struct ReportStruct report_nopacket;
+ memset(&report_nopacket, 0, sizeof(struct ReportStruct));
now.setnow();
- reportstruct->packetTime.tv_sec = now.getSecs();
- reportstruct->packetTime.tv_usec = now.getUsecs();
- reportstruct->emptyreport=1;
- ReportPacket(myReport, reportstruct);
+ report_nopacket.packetTime.tv_sec = now.getSecs();
+ report_nopacket.packetTime.tv_usec = now.getUsecs();
+ report_nopacket.emptyreport = true;
+ report_nopacket.err_readwrite = WriteNoAccount;
+ reportstruct->packetTime = report_nopacket.packetTime; // needed for the InProgress loop test
+ ReportPacket(myReport, &report_nopacket);
}
inline bool Server::ReadBBWithRXTimestamp () {
bool rc = false;
int n;
- while (1) {
- if ((n = recvn(mySocket, mSettings->mBuf, mSettings->mBounceBackBytes, 0)) == mSettings->mBounceBackBytes) {
- struct bounceback_hdr *bbhdr = reinterpret_cast<struct bounceback_hdr *>(mSettings->mBuf);
- uint16_t bbflags = ntohs(bbhdr->bbflags);
- if (!(bbflags & HEADER_BBSTOP)) {
+ while (InProgress()) {
+ int read_offset = 0;
+ RETRY_READ :
+ n = recvn(mySocket, (mSettings->mBuf + read_offset), (mSettings->mBounceBackBytes - read_offset), 0);
+ if (n > 0) {
+ read_offset += n;
+ if (read_offset == mSettings->mBounceBackBytes) {
+ struct bounceback_hdr *bbhdr = reinterpret_cast<struct bounceback_hdr *>(mSettings->mBuf);
+ uint16_t bbflags = ntohs(bbhdr->bbflags);
now.setnow();
reportstruct->packetTime.tv_sec = now.getSecs();
reportstruct->packetTime.tv_usec = now.getUsecs();
- reportstruct->emptyreport=0;
+ reportstruct->emptyreport = false;
reportstruct->packetLen = mSettings->mBounceBackBytes;
// write the rx timestamp back into the payload
bbhdr->bbserverRx_ts.sec = htonl(reportstruct->packetTime.tv_sec);
bbhdr->bbserverRx_ts.usec = htonl(reportstruct->packetTime.tv_usec);
ReportPacket(myReport, reportstruct);
- rc = true;
+ if (!(bbflags & HEADER_BBSTOP)) {
+ rc = true;
+ } else {
+ // last BB write received from client, false return code stops this side
+ }
+ break;
+ }
+ } else if (n == 0) {
+ peerclose = true;
+ } else if (n == IPERF_SOCKET_ERROR_NONFATAL) {
+ PostNullEvent();
+ if (InProgress())
+ goto RETRY_READ;
+ } else {
+ if (FATALTCPREADERR(errno)) {
+ WARN_errno(1, "fatal bounceback read");
+ peerclose = true;
+ break;
} else {
+ WARN(1, "timeout: bounceback read");
+ PostNullEvent();
+ if (InProgress())
+ goto RETRY_READ;
+ }
+ }
+ }
+ return rc;
+}
+
+inline bool Server::WriteBB () {
+ int n;
+ bool rc = false;
+ struct bounceback_hdr *bbhdr = reinterpret_cast<struct bounceback_hdr *>(mSettings->mBuf);
+ now.setnow();
+ bbhdr->bbserverTx_ts.sec = htonl(now.getSecs());
+ bbhdr->bbserverTx_ts.usec = htonl(now.getUsecs());
+ if (mSettings->mTOS) {
+ bbhdr->tos = htons((uint16_t)(mSettings->mTOS & 0xFF));
+ }
+ int write_offset = 0;
+ reportstruct->writecnt = 0;
+ int writelen = mSettings->mBounceBackReplyBytes;
+ while (InProgress()) {
+ n = writen(mySocket, (mSettings->mBuf + write_offset), (writelen - write_offset), &reportstruct->writecnt);
+ if (n < 0) {
+ if (FATALTCPWRITERR(errno)) {
+ reportstruct->err_readwrite=WriteErrFatal;
+ FAIL_errno(1, "tcp bounceback writen", mSettings);
peerclose = true;
+ break;
+ } else {
+ PostNullEvent();
+ continue;
}
- break;
- } else if (n==0) {
- peerclose = true;
- break;
- } else if (n == -2){
+ }
+ write_offset += n;
+ if (write_offset < writelen) {
+ WARN_errno(1, "tcp bounceback writen incomplete");
PostNullEvent();
- } else {
- break;
+ continue;
}
+ reportstruct->emptyreport = false;
+ reportstruct->err_readwrite=WriteSuccess;
+ reportstruct->packetLen = writelen;
+ return true;
}
return rc;
}
@@ -374,40 +449,21 @@ void Server::RunBounceBackTCP () {
reportstruct->packetTime.tv_sec = now.getSecs();
reportstruct->packetTime.tv_usec = now.getUsecs();
reportstruct->packetLen = mSettings->mBounceBackBytes;
- reportstruct->emptyreport=0;
+ reportstruct->emptyreport = false;
ReportPacket(myReport, reportstruct);
- while (InProgress()) {
- int n;
- reportstruct->emptyreport=1;
- do {
- struct bounceback_hdr *bbhdr = reinterpret_cast<struct bounceback_hdr *>(mSettings->mBuf);
- if (mSettings->mBounceBackHold) {
-#if HAVE_DECL_TCP_QUICKACK
- if (isTcpQuickAck(mSettings)) {
- int opt = 1;
- Socklen_t len = sizeof(opt);
- int rc = setsockopt(mySocket, IPPROTO_TCP, TCP_QUICKACK,
- reinterpret_cast<char*>(&opt), len);
- WARN_errno(rc == SOCKET_ERROR, "setsockopt TCP_QUICKACK");
- }
-#endif
- delay_loop(mSettings->mBounceBackHold);
- }
- now.setnow();
- bbhdr->bbserverTx_ts.sec = htonl(now.getSecs());
- bbhdr->bbserverTx_ts.usec = htonl(now.getUsecs());
- if (mSettings->mTOS) {
- bbhdr->tos = htons((uint16_t)(mSettings->mTOS & 0xFF));
- }
- if ((n = writen(mySocket, mSettings->mBuf, mSettings->mBounceBackBytes, &reportstruct->writecnt)) == mSettings->mBounceBackBytes) {
- reportstruct->emptyreport=0;
- reportstruct->packetLen = n;
- ReportPacket(myReport, reportstruct);
- } else {
+ int rc;
+ while (InProgress() && (rc = WriteBB())) {
+ if (rc) {
+ ReportPacket(myReport, reportstruct);
+ if (ReadBBWithRXTimestamp())
+ continue;
+ else {
break;
}
- } while (ReadBBWithRXTimestamp());
+ } else {
+ break;
+ }
}
disarm_itimer();
// stop timing
@@ -471,10 +527,17 @@ inline void Server::SetReportStartTime () {
// Servers that aren't full duplex use the accept timestamp for start
myReport->info.ts.startTime.tv_sec = mSettings->sent_time.tv_sec;
myReport->info.ts.startTime.tv_usec = mSettings->sent_time.tv_usec;
- } else if (!TimeZero(mSettings->accept_time) && !isTxStartTime(mSettings)) {
+ } else if (!TimeZero(mSettings->accept_time)) {
// Servers that aren't full duplex use the accept timestamp for start
myReport->info.ts.startTime.tv_sec = mSettings->accept_time.tv_sec;
myReport->info.ts.startTime.tv_usec = mSettings->accept_time.tv_usec;
+ // The client may have had a barrier between the connect and start of traffic, check and adjust
+ if (mSettings->barrier_time) {
+ now.setnow();
+ if (now.subUsec(mSettings->accept_time) >= mSettings->barrier_time) {
+ TimeAddIntUsec(myReport->info.ts.startTime, mSettings->barrier_time);
+ }
+ }
} else {
now.setnow();
myReport->info.ts.startTime.tv_sec = now.getSecs();
@@ -579,6 +642,20 @@ void Server::ClientReverseFirstRead (void) {
bool Server::InitTrafficLoop (void) {
bool UDPReady = true;
+ if (isSyncTransferID(mSettings)) {
+ if (mSettings->mPeerTransferID != mSettings->mTransferID) {
+ int len = snprintf(NULL, 0, "%sTransfer ID %d remapped to %d\n", \
+ mSettings->mTransferIDStr, mSettings->mTransferID, mSettings->mPeerTransferID);
+ char *text = (char *) calloc(len+1, sizeof(char));
+ if (text) {
+ snprintf(text, len, "%sTransfer ID %d remapped to %d\n", \
+ mSettings->mTransferIDStr, mSettings->mTransferID, mSettings->mPeerTransferID);
+ PostReport(InitStringReport(text));
+ FREE_ARRAY(text);
+ }
+ updateTransferIDPeer(mSettings);
+ }
+ }
myJob = InitIndividualReport(mSettings);
myReport = static_cast<struct ReporterData *>(myJob->this_report);
assert(myJob != NULL);
@@ -598,21 +675,42 @@ bool Server::InitTrafficLoop (void) {
reportstruct->l2errors = 0x0;
int setfullduplexflag = 0;
+ Timestamp now;
+
+ if ((mSettings->txstart_epoch.tv_sec > 0) && (mSettings->txstart_epoch.tv_sec - now.getSecs()) > 1) {
+ // Have the server thread wait on the client's epoch start
+ // unblocking one second ahead
+ struct timeval wait_until = mSettings->txstart_epoch;
+ wait_until.tv_sec -= 1;
+ clock_usleep_abstime(&wait_until);
+ }
if (isFullDuplex(mSettings) && !isServerReverse(mSettings)) {
assert(mSettings->mFullDuplexReport != NULL);
if ((setfullduplexflag = fullduplex_start_barrier(&mSettings->mFullDuplexReport->fullduplex_barrier)) < 0)
exit(-1);
}
- Timestamp now;
if (isReverse(mSettings)) {
mSettings->accept_time.tv_sec = now.getSecs();
mSettings->accept_time.tv_usec = now.getUsecs();
ClientReverseFirstRead();
}
if (isTripTime(mSettings)) {
- if ((abs(now.getSecs() - mSettings->sent_time.tv_sec)) > MAXDIFFTIMESTAMPSECS) {
+ int diff_tolerance;
+ if (mSettings->mInterval && (mSettings->mIntervalMode == kInterval_Time)) {
+ diff_tolerance = ceil(mSettings->mInterval / 1000000);
+ } else {
+ diff_tolerance = MAXDIFFTIMESTAMPSECS;
+ }
+ if (diff_tolerance < 2) {
+ diff_tolerance = 2; // min is 2 seconds
+ }
+ if (mSettings->txstart_epoch.tv_sec > 0) {
+ mSettings->accept_time.tv_sec = mSettings->txstart_epoch.tv_sec;
+ mSettings->accept_time.tv_usec = mSettings->txstart_epoch.tv_usec;
+ mSettings->sent_time = mSettings->accept_time; // the first sent time w/epoch starts uses now()
+ } else if ((abs(now.getSecs() - mSettings->sent_time.tv_sec)) > diff_tolerance) {
unsetTripTime(mSettings);
- fprintf(stdout,"WARN: ignore --trip-times because client didn't provide valid start timestamp within %d seconds of now\n", MAXDIFFTIMESTAMPSECS);
+ fprintf(stdout,"WARN: ignore --trip-times because client didn't provide valid start timestamp within %d seconds of now\n", diff_tolerance);
mSettings->accept_time.tv_sec = now.getSecs();
mSettings->accept_time.tv_usec = now.getUsecs();
}
@@ -643,8 +741,8 @@ bool Server::InitTrafficLoop (void) {
reportstruct->packetLen = mSettings->firstreadbytes;
if (isUDP(mSettings)) {
int offset = 0;
- UDPReady = !ReadPacketID(offset);
reportstruct->packetTime = mSettings->accept_time;
+ UDPReady = !ReadPacketID(offset);
} else {
reportstruct->sentTime.tv_sec = myReport->info.ts.startTime.tv_sec;
reportstruct->sentTime.tv_usec = myReport->info.ts.startTime.tv_usec;
@@ -656,21 +754,36 @@ bool Server::InitTrafficLoop (void) {
}
inline int Server::ReadWithRxTimestamp () {
- long currLen;
- int tsdone = 0;
+ int currLen;
+ int tsdone = false;
-#if HAVE_DECL_SO_TIMESTAMP
+ reportstruct->err_readwrite = ReadSuccess;
+
+#if (HAVE_DECL_SO_TIMESTAMP) && (HAVE_DECL_MSG_CTRUNC)
cmsg = reinterpret_cast<struct cmsghdr *>(&ctrl);
currLen = recvmsg(mSettings->mSock, &message, mSettings->recvflags);
if (currLen > 0) {
- for (cmsg = CMSG_FIRSTHDR(&message); cmsg != NULL;
- cmsg = CMSG_NXTHDR(&message, cmsg)) {
- if (cmsg->cmsg_level == SOL_SOCKET &&
- cmsg->cmsg_type == SCM_TIMESTAMP &&
- cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) {
- memcpy(&(reportstruct->packetTime), CMSG_DATA(cmsg), sizeof(struct timeval));
- tsdone = 1;
+#if HAVE_DECL_MSG_TRUNC
+ if (message.msg_flags & MSG_TRUNC) {
+ reportstruct->err_readwrite = ReadErrLen;
+ }
+#endif
+ if (!(message.msg_flags & MSG_CTRUNC)) {
+ for (cmsg = CMSG_FIRSTHDR(&message); cmsg != NULL;
+ cmsg = CMSG_NXTHDR(&message, cmsg)) {
+ if (cmsg->cmsg_level == SOL_SOCKET &&
+ cmsg->cmsg_type == SCM_TIMESTAMP &&
+ cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) {
+ memcpy(&(reportstruct->packetTime), CMSG_DATA(cmsg), sizeof(struct timeval));
+ if (TimeZero(myReport->info.ts.prevpacketTime)) {
+ myReport->info.ts.prevpacketTime = reportstruct->packetTime;
+ }
+ tsdone = true;
+ }
}
+ } else if (ctrunc_warn_enable && mSettings->mTransferIDStr) {
+ fprintf(stderr, "%sWARN: recvmsg MSG_CTRUNC occured\n", mSettings->mTransferIDStr);
+ ctrunc_warn_enable = false;
}
}
#else
@@ -678,13 +791,15 @@ inline int Server::ReadWithRxTimestamp () {
#endif
if (currLen <=0) {
// Socket read timeout or read error
- reportstruct->emptyreport=1;
+ reportstruct->emptyreport = true;
if (currLen == 0) {
peerclose = true;
} else if (FATALUDPREADERR(errno)) {
WARN_errno(1, "recvmsg");
currLen = 0;
peerclose = true;
+ } else {
+ reportstruct->err_readwrite = ReadTimeo;
}
} else if (TimeZero(myReport->info.ts.prevpacketTime)) {
myReport->info.ts.prevpacketTime = reportstruct->packetTime;
@@ -704,29 +819,45 @@ inline bool Server::ReadPacketID (int offset_adjust) {
// terminate when datagram begins with negative index
// the datagram ID should be correct, just negated
+ // read the sent timestamp from the rx packet
+ reportstruct->sentTime.tv_sec = ntohl(mBuf_UDP->tv_sec);
+ reportstruct->sentTime.tv_usec = ntohl(mBuf_UDP->tv_usec);
if (isSeqNo64b(mSettings)) {
- // New client - Signed PacketID packed into unsigned id2,id
- reportstruct->packetID = (static_cast<uint32_t>(ntohl(mBuf_UDP->id))) | (static_cast<uintmax_t>(ntohl(mBuf_UDP->id2)) << 32);
+ // New client - Signed PacketID packed into unsigned id2,id
+ reportstruct->packetID = (static_cast<uint32_t>(ntohl(mBuf_UDP->id))) | (static_cast<uintmax_t>(ntohl(mBuf_UDP->id2)) << 32);
#ifdef HAVE_PACKET_DEBUG
- printf("id 0x%x, 0x%x -> %" PRIdMAX " (0x%" PRIxMAX ")\n",
- ntohl(mBuf_UDP->id), ntohl(mBuf_UDP->id2), reportstruct->packetID, reportstruct->packetID);
+ if (isTripTime(mSettings)) {
+ int len = snprintf(NULL,0,"%sPacket id 0x%x, 0x%x -> %" PRIdMAX " (0x%" PRIxMAX ") Sent: %ld.%ld6 Received: %ld.%ld6 Delay: %f\n", \
+ mSettings->mTransferIDStr,ntohl(mBuf_UDP->id), ntohl(mBuf_UDP->id2), reportstruct->packetID, reportstruct->packetID, \
+ reportstruct->sentTime.tv_sec, reportstruct->sentTime.tv_usec, \
+ reportstruct->packetTime.tv_sec, reportstruct->packetTime.tv_usec, TimeDifference(reportstruct->packetTime, reportstruct->sentTime));
+ char *text = (char *) calloc(len+1, sizeof(char));
+ if (text) {
+ snprintf(text, len,"%sPacket ID id 0x%x, 0x%x -> %" PRIdMAX " (0x%" PRIxMAX ") Sent: %ld.%ld Received: %ld.%ld Delay: %f\n", \
+ mSettings->mTransferIDStr,ntohl(mBuf_UDP->id), ntohl(mBuf_UDP->id2), reportstruct->packetID, reportstruct->packetID, \
+ reportstruct->sentTime.tv_sec, reportstruct->sentTime.tv_usec, \
+ reportstruct->packetTime.tv_sec, reportstruct->packetTime.tv_usec, TimeDifference(reportstruct->packetTime, reportstruct->sentTime));
+ PostReport(InitStringReport(text));
+ FREE_ARRAY(text);
+ }
+ } else {
+ printf("id 0x%x, 0x%x -> %" PRIdMAX " (0x%" PRIxMAX ")\n",
+ ntohl(mBuf_UDP->id), ntohl(mBuf_UDP->id2), reportstruct->packetID, reportstruct->packetID);
+ }
#endif
} else {
- // Old client - Signed PacketID in Signed id
- reportstruct->packetID = static_cast<int32_t>(ntohl(mBuf_UDP->id));
+ // Old client - Signed PacketID in Signed id
+ reportstruct->packetID = static_cast<int32_t>(ntohl(mBuf_UDP->id));
#ifdef HAVE_PACKET_DEBUG
- printf("id 0x%x -> %" PRIdMAX " (0x%" PRIxMAX ")\n",
- ntohl(mBuf_UDP->id), reportstruct->packetID, reportstruct->packetID);
+ printf("id 0x%x -> %" PRIdMAX " (0x%" PRIxMAX ")\n",
+ ntohl(mBuf_UDP->id), reportstruct->packetID, reportstruct->packetID);
#endif
}
if (reportstruct->packetID < 0) {
- reportstruct->packetID = - reportstruct->packetID;
- terminate = true;
+ reportstruct->packetID = -reportstruct->packetID;
+ terminate = true;
}
- // read the sent timestamp from the rx packet
- reportstruct->sentTime.tv_sec = ntohl(mBuf_UDP->tv_sec);
- reportstruct->sentTime.tv_usec = ntohl(mBuf_UDP->tv_usec);
return terminate;
}
@@ -749,7 +880,7 @@ void Server::L2_processing () {
if (L2_quintuple_filter() != 0) {
reportstruct->l2errors |= L2UNKNOWN;
reportstruct->l2errors |= L2CSUMERR;
- reportstruct->emptyreport = 1;
+ reportstruct->emptyreport = true;
}
}
if (!(reportstruct->l2errors & L2UNKNOWN)) {
@@ -759,7 +890,7 @@ void Server::L2_processing () {
if (rc) {
reportstruct->l2errors |= L2CSUMERR;
if ((!(reportstruct->l2errors & L2LENERR)) && (L2_quintuple_filter() != 0)) {
- reportstruct->emptyreport = 1;
+ reportstruct->emptyreport = true;
reportstruct->l2errors |= L2UNKNOWN;
}
}
@@ -848,7 +979,7 @@ int Server::L2_quintuple_filter () {
}
inline void Server::udp_isoch_processing (int rxlen) {
- reportstruct->transit_ready = 0;
+ reportstruct->transit_ready = false;
// Ignore runt sized isoch packets
if (rxlen < static_cast<int>(sizeof(struct UDP_datagram) + sizeof(struct client_hdr_v1) + sizeof(struct client_hdrext) + sizeof(struct isoch_payload))) {
reportstruct->burstsize = 0;
@@ -865,7 +996,7 @@ inline void Server::udp_isoch_processing (int rxlen) {
reportstruct->burstperiod = ntohl(udp_pkt->isoch.burstperiod);
reportstruct->remaining = ntohl(udp_pkt->isoch.remaining);
if ((reportstruct->remaining == (uint32_t) rxlen) && ((reportstruct->frameID - reportstruct->prevframeID) == 1)) {
- reportstruct->transit_ready = 1;
+ reportstruct->transit_ready = true;
}
}
}
@@ -891,13 +1022,13 @@ void Server::RunUDP () {
// bandwidth accounting, basically it's indicating
// that the reportstruct itself couldn't be
// completely filled out.
- reportstruct->emptyreport=1;
+ reportstruct->emptyreport = true;
reportstruct->packetLen=0;
// read the next packet with timestamp
// will also set empty report or not
rxlen=ReadWithRxTimestamp();
if (!peerclose && (rxlen > 0)) {
- reportstruct->emptyreport = 0;
+ reportstruct->emptyreport = false;
reportstruct->packetLen = rxlen;
if (isL2LengthCheck(mSettings)) {
reportstruct->l2len = rxlen;
@@ -924,7 +1055,7 @@ void Server::RunUDP () {
}
}
disarm_itimer();
- int do_close = EndJob(myJob, reportstruct);
+ bool do_close = EndJob(myJob, reportstruct);
if (!isMulticast(mSettings) && !isNoUDPfin(mSettings)) {
// send a UDP acknowledgement back except when:
// 1) we're NOT receiving multicast
diff --git a/src/Settings.cpp b/src/Settings.cpp
index 39229f5..246eddd 100644
--- a/src/Settings.cpp
+++ b/src/Settings.cpp
@@ -90,10 +90,13 @@ static int txstarttime = 0;
static int noconnectsync = 0;
static int txholdback = 0;
static int fqrate = 0;
+static int fqratestep = 0;
+static int fqratestepinterval = 0;
static int triptime = 0;
static int infinitetime = 0;
static int connectonly = 0;
-static int connectretry = 0;
+static int connectretrytime = 0;
+static int connectretryinterval = 0;
static int burstipg = 0;
static int burstsize = 0;
static int burstperiodic = 0;
@@ -113,7 +116,10 @@ static int hideips = 0;
static int bounceback = 0;
static int bouncebackhold = 0;
static int bouncebackperiod = 0;
+static int bouncebackrequest = 0;
+static int bouncebackreply = 0;
static int overridetos = 0;
+static int dscp = 0;
static int notcpbbquickack = 0;
static int tcpquickack = 0;
static int notcpbbquickack_cliset = 0;
@@ -121,6 +127,12 @@ static int workingload = 0;
static int utctimes = 0;
static int bouncebackdelaystart = 0;
static int tcpwritetimes = 0;
+static int primarycca = 0;
+static int loadcca = 0;
+static int tcptxdelay = 0;
+static int testxchangetimeout = 0;
+static int synctransferid = 0;
+static int ignoreshutdown = 0;
void Settings_Interpret(char option, const char *optarg, struct thread_Settings *mExtSettings);
// apply compound settings after the command line has been fully parsed
@@ -173,8 +185,11 @@ const struct option long_options[] =
{"bounceback-hold", required_argument, &bouncebackhold, 1},
{"bounceback-no-quickack", no_argument, &notcpbbquickack, 1},
{"bounceback-period", required_argument, &bouncebackperiod, 1},
+{"bounceback-request", required_argument, &bouncebackrequest, 1},
+{"bounceback-reply", required_argument, &bouncebackreply, 1},
{"compatibility", no_argument, NULL, 'C'},
{"daemon", no_argument, NULL, 'D'},
+{"dscp", required_argument, &dscp, 1},
{"file_input", required_argument, NULL, 'F'},
{"ssm-host", required_argument, NULL, 'H'},
{"stdin_input", no_argument, NULL, 'I'},
@@ -187,6 +202,7 @@ const struct option long_options[] =
#else
{"reverse", no_argument, NULL, 'R'},
#endif
+{"sync-transfer-id", no_argument, &synctransferid, 1},
{"tos", required_argument, NULL, 'S'},
{"ttl", required_argument, NULL, 'T'},
{"single_udp", no_argument, NULL, 'U'},
@@ -199,6 +215,7 @@ const struct option long_options[] =
{"jitter-histograms", optional_argument, &jitter_histogram, 1},
{"udp-histograms", optional_argument, &histogram, 1}, // keep support per 2.0.13 usage
{"l2checks", no_argument, &l2checks, 1},
+{"ignore-shutdown", no_argument, &ignoreshutdown, 1},
{"incr-dstip", no_argument, &incrdstip, 1},
{"incr-srcip", no_argument, &incrsrcip, 1},
{"incr-dstport", no_argument, &incrdstport, 1},
@@ -207,10 +224,13 @@ const struct option long_options[] =
{"txstart-time", required_argument, &txstarttime, 1},
{"txdelay-time", required_argument, &txholdback, 1},
{"fq-rate", required_argument, &fqrate, 1},
+{"fq-rate-step", required_argument, &fqratestep, 1},
+{"fq-rate-step-interval", required_argument, &fqratestepinterval, 1},
{"trip-times", no_argument, &triptime, 1},
{"no-udp-fin", no_argument, &noudpfin, 1},
{"connect-only", optional_argument, &connectonly, 1},
-{"connect-retries", required_argument, &connectretry, 1},
+{"connect-retry-time", required_argument, &connectretrytime, 1},
+{"connect-retry-timer", required_argument, &connectretryinterval, 1},
{"no-connect-sync", no_argument, &noconnectsync, 1},
{"full-duplex", no_argument, &fullduplextest, 1},
{"ipg", required_argument, &burstipg, 1},
@@ -225,11 +245,15 @@ const struct option long_options[] =
{"tos-override", required_argument, &overridetos, 1},
{"tcp-rx-window-clamp", required_argument, &rxwinclamp, 1},
{"tcp-quickack", no_argument, &tcpquickack, 1},
+{"tcp-tx-delay", required_argument, &tcptxdelay, 1},
{"tcp-write-prefetch", required_argument, &txnotsentlowwater, 1}, // see doc/DESIGN_NOTES
{"tcp-write-times", no_argument, &tcpwritetimes, 1},
+{"test-exchange-timeout", required_argument, &testxchangetimeout, 1},
{"tap-dev", optional_argument, &tapif, 1},
{"tun-dev", optional_argument, &tunif, 1},
{"working-load", optional_argument, &workingload, 1},
+{"working-load-cca", required_argument, &loadcca, 1},
+{"tcp-cca", required_argument, &primarycca, 1},
{"utc", no_argument, &utctimes, 1},
{"NUM_REPORT_STRUCTS", required_argument, &numreportstructs, 1},
#ifdef WIN32
@@ -294,8 +318,7 @@ const char short_options[] = "146b:c:def:hi:l:mn:o:p:rst:uvw:x:y:zAB:CDF:H:IL:M:
const long kDefault_UDPRate = 1024 * 1024; // -u if set, 1 Mbit/sec
const int kDefault_TCPBufLen = 128 * 1024; // TCP default read/write size
-const int kDefault_BBTCPBufLen = 100; // default bounce-back size in bytes
-
+const int kDefault_BBTCPReqLen = 100; // default bounce-back size in bytes
/* -------------------------------------------------------------------
* Initialize all settings to defaults.
@@ -414,6 +437,10 @@ void Settings_Copy (struct thread_Settings *from, struct thread_Settings **into,
(*into)->mCongestion = new char[strlen(from->mCongestion) + 1];
strcpy((*into)->mCongestion, from->mCongestion);
}
+ if (from->mLoadCCA != NULL) {
+ (*into)->mLoadCCA = new char[strlen(from->mLoadCCA) + 1];
+ strcpy((*into)->mLoadCCA, from->mLoadCCA);
+ }
} else {
(*into)->mHost = NULL;
(*into)->mOutputFileName = NULL;
@@ -458,6 +485,15 @@ void Settings_Copy (struct thread_Settings *from, struct thread_Settings **into,
unsetReport((*into));
}
+void Settings_Grow_mBuf (struct thread_Settings *mSettings, int newsize) {
+ char *tmp = new char[newsize];
+ pattern(tmp, newsize);
+ memcpy(tmp, mSettings->mBuf, mSettings->mBufLen);
+ DELETE_ARRAY(mSettings->mBuf);
+ mSettings->mBuf = tmp;
+ mSettings->mBufLen = newsize;
+}
+
/* -------------------------------------------------------------------
* Delete memory: Does not clean up open file pointers or ptr_parents
* ------------------------------------------------------------------- */
@@ -477,6 +513,7 @@ void Settings_Destroy (struct thread_Settings *mSettings) {
DELETE_ARRAY(mSettings->mHistogramStr);
DELETE_ARRAY(mSettings->mSSMMulticastStr);
DELETE_ARRAY(mSettings->mCongestion);
+ DELETE_ARRAY(mSettings->mLoadCCA);
FREE_ARRAY(mSettings->mIfrname);
FREE_ARRAY(mSettings->mIfrnametx);
FREE_ARRAY(mSettings->mTransferIDStr);
@@ -729,7 +766,10 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
break;
case 'v': // print version and exit
- fprintf(stdout, "%s", version);
+ if (strlen(IPERF_BRANCH))
+ fprintf(stdout, "%s", branch_version);
+ else
+ fprintf(stdout, "%s", version);
exit(0);
break;
@@ -888,9 +928,12 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
// TODO use a function that understands base-2
// the zero base here allows the user to specify
// "0x#" hex, "0#" octal, and "#" decimal numbers
- if ((mExtSettings->mTOS = parse_ipqos(optarg)) == -1) {
- fprintf(stderr, "Invalid --tos value of %s\n", optarg);
+ mExtSettings->mTOS = parse_ipqos(optarg);
+ if (mExtSettings->mTOS == -1) {
+ fprintf(stderr, "WARN: Invalid --tos value of %s ignored\n", optarg);
mExtSettings->mTOS = 0;
+ } else {
+ setSetTOS(mExtSettings);
}
break;
@@ -923,10 +966,14 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
break;
case 'Z':
-#ifdef TCP_CONGESTION
- setCongestionControl(mExtSettings);
- mExtSettings->mCongestion = new char[strlen(optarg)+1];
- strcpy(mExtSettings->mCongestion, optarg);
+#if HAVE_DECL_TCP_CONGESTION
+ if (isCongestionControl(mExtSettings)) {
+ fprintf(stderr, "Option --tcp-congestion or -Z ignored because --tcp-cca set\n");
+ } else {
+ setCongestionControl(mExtSettings);
+ mExtSettings->mCongestion = new char[strlen(optarg)+1];
+ strcpy(mExtSettings->mCongestion, optarg);
+ }
#else
fprintf(stderr, "The -Z option is not available on this operating system\n");
#endif
@@ -949,10 +996,18 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
incrsrcport = 0;
setIncrSrcPort(mExtSettings);
}
+ if (ignoreshutdown) {
+ ignoreshutdown = 0;
+ setIgnoreShutdown(mExtSettings);
+ }
if (sumdstip) {
sumdstip = 0;
setSumServerDstIP(mExtSettings);
}
+ if (synctransferid) {
+ synctransferid = 0;
+ setSyncTransferID(mExtSettings);
+ }
if (txstarttime) {
long seconds;
long usecs;
@@ -1013,9 +1068,36 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
mExtSettings->connectonly_count = -1;
}
}
- if (connectretry) {
- connectretry = 0;
- mExtSettings->mConnectRetries = atoi(optarg);
+ if (connectretryinterval) {
+ connectretryinterval = 0;
+ char *end;
+ double period = strtof(optarg, &end);
+ if ((*end != '\0') || (period < 0 )) {
+ fprintf (stderr, "Invalid value of '%s' for --connect-retry-timer\n", optarg);
+ exit(1);
+ }
+ if (period > (UINT_MAX / 1e6)) {
+ fprintf (stderr, "Too large value of '%s' for --connect-retry-timer, max is %f\n", optarg, (UINT_MAX / 1e6));
+ exit(1);
+ }
+ mExtSettings->connect_retry_timer = static_cast<unsigned int>(ceil(period * 1e6));
+ if (mExtSettings->connect_retry_timer == 0) {
+ mExtSettings->connect_retry_timer = 10000;
+ }
+ }
+ if (connectretrytime) {
+ connectretrytime = 0;
+ char *end;
+ double timer = strtof(optarg, &end);
+ if (*end != '\0') {
+ fprintf (stderr, "Invalid value of '%s' for --connect-retry-time\n", optarg);
+ exit(1);
+ }
+ if (timer > (UINT_MAX / 1e6)) {
+ fprintf (stderr, "Too large value of '%s' for --connect-retry-time, max is %f\n", optarg, (UINT_MAX / 1e6));
+ exit(1);
+ }
+ mExtSettings->connect_retry_time = timer;
}
if (sumonly) {
sumonly = 0;
@@ -1048,7 +1130,7 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
permitkey = 0;
if (optarg) {
strncpy(mExtSettings->mPermitKey, optarg, MAX_PERMITKEY_LEN);
- mExtSettings->mPermitKey[MAX_PERMITKEY_LEN] = '\0';
+ mExtSettings->mPermitKey[MAX_PERMITKEY_LEN-1] = '\0';
} else {
mExtSettings->mPermitKey[0] = '\0';
}
@@ -1056,7 +1138,12 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
}
if (permitkeytimeout) {
permitkeytimeout = 0;
- if (atof(optarg) >= 0.0)
+ if (atof(optarg) > mExtSettings->mListenerTimeout)
+ mExtSettings->mListenerTimeout = static_cast<size_t>(atof(optarg));
+ }
+ if (testxchangetimeout) {
+ testxchangetimeout = 0;
+ if (atof(optarg) > mExtSettings->mListenerTimeout)
mExtSettings->mListenerTimeout = static_cast<size_t>(atof(optarg));
}
if (histogram) {
@@ -1096,8 +1183,13 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
setOverrideTOS(mExtSettings);
}
}
+ if (dscp) {
+ dscp = 0;
+ // dscp needs to shifted by 2 and the ECN bits masked off to map to a TOS byte
+ mExtSettings->mTOS = (atoi(optarg) << DSCP_SHIFT) & DSCP_BITMASK; //2 & 0xFC
+ }
if (fqrate) {
-#if defined(HAVE_DECL_SO_MAX_PACING_RATE)
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
fqrate=0;
setFQPacing(mExtSettings);
mExtSettings->mFQPacingRate = static_cast<uintmax_t>(bitorbyte_atoi(optarg) / 8);
@@ -1105,6 +1197,34 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
fprintf(stderr, "WARNING: The --fq-rate option is not supported\n");
#endif
}
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ if (fqratestep) {
+ fqratestep=0;
+ setFQPacingStep(mExtSettings);
+ mExtSettings->mFQPacingRateStep = static_cast<uintmax_t>(bitorbyte_atoi(optarg) / 8);
+ setEnhanced(mExtSettings);
+ }
+ if (fqratestepinterval) {
+ fqratestepinterval=0;
+ double val;
+#if HAVE_STRTOD
+ char *end;
+ errno = 0;
+ val = strtod(optarg, &end);
+ if (errno || (*end != '\0')) {
+ fprintf(stderr, "ERROR: --fq-rate-step-interval value of '%s' not recognized\n", optarg);
+ exit(1);
+ }
+#else
+ val = atof(optarg);
+#endif
+ if (val > 0.0) {
+ mExtSettings->mFQPacingRateStepInterval = val;
+ setFQPacingStepInterval(mExtSettings);
+ setEnhanced(mExtSettings);
+ }
+ }
+#endif
if (isochronous) {
isochronous = 0;
setEnhanced(mExtSettings);
@@ -1153,14 +1273,59 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
setTcpQuickAck(mExtSettings);
#endif
}
+ if (tcptxdelay) {
+ tcptxdelay = 0;
+#if HAVE_DECL_TCP_TX_DELAY
+ char *tmp= new char [strlen(optarg) + 1];
+ char *results;
+ strcpy(tmp, optarg);
+ mExtSettings->mTcpTxDelayProb = 1.0;
+ if (((results = strtok(tmp, ",")) != NULL) && !strcmp(results,tmp)) {
+ mExtSettings->mTcpTxDelayMean = atof(results);
+ if ((results = strtok(NULL, ",")) != NULL) {
+ mExtSettings->mTcpTxDelayProb = atof(results);
+ }
+ }
+ if (mExtSettings->mTcpTxDelayMean > 0) {
+ setTcpTxDelay(mExtSettings);
+ }
+#else
+ fprintf(stderr, "The --tcp-tx-delay option is not available on this operating system\n");
+#endif
+ }
if (utctimes) {
setUTC(mExtSettings);
}
+ if (loadcca) {
+ loadcca = 0;
+#if HAVE_DECL_TCP_CONGESTION
+ setLoadCCA(mExtSettings);
+ mExtSettings->mLoadCCA = new char[strlen(optarg)+1];
+ strcpy(mExtSettings->mLoadCCA, optarg);
+#else
+ fprintf(stderr, "The --working-load-cca option is not available on this operating system\n");
+#endif
+ }
+ if (primarycca) {
+ primarycca = 0;
+#if HAVE_DECL_TCP_CONGESTION
+ if (isCongestionControl(mExtSettings)) {
+ fprintf(stderr, "Option --tcp-cca ignored because --tcp-congestion or -Z set\n");
+ } else {
+ setCongestionControl(mExtSettings);
+ mExtSettings->mCongestion = new char[strlen(optarg)+1];
+ strcpy(mExtSettings->mCongestion, optarg);
+ }
+#else
+ fprintf(stderr, "The --tcp-cca option is not available on this operating system\n");
+#endif
+ }
if (workingload) {
workingload = 0;
#ifdef HAVE_THREAD
setWorkingLoadUp(mExtSettings);
setWorkingLoadDown(mExtSettings);
+ setEnhanced(mExtSettings);
if (optarg) {
char *tmp= new char [strlen(optarg) + 1];
if (tmp) {
@@ -1224,7 +1389,7 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
}
if (burstsize) {
burstsize = 0;
- setPeriodicBurst(mExtSettings);
+ setBurstSize(mExtSettings);
if (optarg) {
mExtSettings->mBurstSize = byte_atoi(optarg);
}
@@ -1300,6 +1465,20 @@ void Settings_Interpret (char option, const char *optarg, struct thread_Settings
}
}
}
+ if (bouncebackrequest) {
+ bouncebackrequest = 0;
+ if (optarg)
+ mExtSettings->mBounceBackBytes = byte_atoi(optarg);
+ else
+ mExtSettings->mBounceBackBytes = 0;
+ }
+ if (bouncebackreply) {
+ bouncebackreply = 0;
+ if (optarg)
+ mExtSettings->mBounceBackReplyBytes = byte_atoi(optarg);
+ else
+ mExtSettings->mBounceBackReplyBytes = 0;
+ }
break;
default: // ignore unknown
break;
@@ -1383,7 +1562,7 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
}
} else {
if (isBounceBack(mExtSettings))
- mExtSettings->mBufLen = kDefault_BBTCPBufLen;
+ mExtSettings->mBufLen = kDefault_TCPBufLen;
else
mExtSettings->mBufLen = kDefault_TCPBufLen;
}
@@ -1428,12 +1607,6 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
fprintf(stderr, "ERROR: compatibility mode not supported with the requested with options\n");
bail = true;
}
-#if !(HAVE_DECL_IP_TOS)
- if (isOverrideTOS(mExtSettings) || mExtSettings->mTOS) {
- unsetOverrideTOS(mExtSettings);
- fprintf(stderr, "WARN: IP_TOS not supported\n");
- }
-#endif
if (isPermitKey(mExtSettings)) {
if (isUDP(mExtSettings)) {
fprintf(stderr, "ERROR: Option of --permit-key not supported with UDP\n");
@@ -1486,10 +1659,6 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
fprintf(stderr, "WARN: option of --jitter-histogram not supported on the client\n");
unsetJitterHistogram(mExtSettings);
}
- if (isIncrSrcPort(mExtSettings) && !mExtSettings->mBindPort) {
- fprintf(stderr, "WARN: option of --incr-srcport requires -B bind option w/port to be set\n");
- unsetIncrSrcPort(mExtSettings);
- }
if (isPeriodicBurst(mExtSettings)) {
setEnhanced(mExtSettings);
setFrameInterval(mExtSettings);
@@ -1502,6 +1671,17 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
fprintf(stderr, "ERROR: option of --permit-key requires a value on the client\n");
bail = true;
}
+#if (HAVE_DECL_SO_MAX_PACING_RATE)
+ if (isFQPacingStep(mExtSettings)) {
+ if (!isFQPacing(mExtSettings)) {
+ setFQPacing(mExtSettings);
+ mExtSettings->mFQPacingRate = mExtSettings->mFQPacingRateStep;
+ }
+ if (!isFQPacingStepInterval(mExtSettings)) {
+ mExtSettings->mFQPacingRateStepInterval = 1.0;
+ }
+ }
+#endif
if (!isUDP(mExtSettings) && isTxHoldback(mExtSettings) && isTxStartTime(mExtSettings)) {
fprintf(stderr,"ERROR: options of --txstart-time and --txdelay-time are mutually exclusive\n");
bail = true;
@@ -1527,11 +1707,40 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
bail = true;
}
}
+ if (isTripTime(mExtSettings) && (mExtSettings->mBufLen < static_cast<int> (sizeof(struct TCP_burst_payload)))) {
+ fprintf(stderr, "ERROR: payload (-l) size of %d too small for --trip-times, must be %d or greater\n",\
+ mExtSettings->mBufLen, static_cast<int> (sizeof(struct TCP_burst_payload)));
+ bail = true;
+ }
if (isBounceBack(mExtSettings)) {
if (static_cast<int> (mExtSettings->mBurstSize) > 0) {
fprintf(stderr, "WARN: options of --burst-size for bounce-back ignored, use -l sets size\n");
}
- mExtSettings->mBounceBackBytes = mExtSettings->mBufLen;
+ if (mExtSettings->mBounceBackBytes <= 0) {
+ if (isBuflenSet(mExtSettings)) {
+ // Backward compatibility with older versions
+ mExtSettings->mBounceBackBytes = mExtSettings->mBufLen;
+ } else {
+ mExtSettings->mBounceBackBytes = kDefault_BBTCPReqLen;
+ }
+ } else if (mExtSettings->mBounceBackBytes > mExtSettings->mBufLen) {
+ if (isBuflenSet(mExtSettings)) {
+ mExtSettings->mBounceBackBytes = mExtSettings->mBufLen;
+ fprintf(stderr, "WARN: bounceback request will use -l length and not --bounceback-request value\n");
+ } else {
+ mExtSettings->mBufLen = mExtSettings->mBounceBackBytes;
+ }
+ }
+ if (mExtSettings->mBounceBackReplyBytes <= 0) {
+ mExtSettings->mBounceBackReplyBytes = mExtSettings->mBounceBackBytes;
+ } else if (mExtSettings->mBounceBackReplyBytes > mExtSettings->mBufLen) {
+ if (isBuflenSet(mExtSettings)) {
+ mExtSettings->mBounceBackReplyBytes = mExtSettings->mBufLen;
+ fprintf(stderr, "WARN: bounceback reply will use -l length and not --bounceback-reply value\n");
+ } else {
+ mExtSettings->mBufLen = mExtSettings->mBounceBackReplyBytes;
+ }
+ }
mExtSettings->mBurstSize = mExtSettings->mBufLen;
#if HAVE_DECL_TCP_QUICKACK
if (notcpbbquickack_cliset && isTcpQuickAck(mExtSettings)) {
@@ -1559,15 +1768,17 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
}
}
#if HAVE_DECL_TCP_NOTSENT_LOWAT
- if (isTripTime(mExtSettings) && !isUDP(mExtSettings)) {
- if (isWritePrefetch(mExtSettings)) {
- if (mExtSettings->mWritePrefetch <= 0) {
- unsetWritePrefetch(mExtSettings);
+ if (!isUDP(mExtSettings)) {
+ if (isTcpWriteTimes(mExtSettings) || isTripTime(mExtSettings)) {
+ if (isWritePrefetch(mExtSettings)) {
+ if (mExtSettings->mWritePrefetch <= 0) {
+ unsetWritePrefetch(mExtSettings);
+ }
+ } else {
+ mExtSettings->mWritePrefetch = SMALL_WRITE_PREFETCH;
+ setWritePrefetch(mExtSettings);
+ setEnhanced(mExtSettings);
}
- } else {
- mExtSettings->mWritePrefetch = SMALL_WRITE_PREFETCH;
- setWritePrefetch(mExtSettings);
- setEnhanced(mExtSettings);
}
}
#endif
@@ -1585,10 +1796,14 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
fprintf(stderr, "ERROR: option of --burst-size %d must be equal or larger to write length (-l) %d\n", mExtSettings->mBurstSize, mExtSettings->mBufLen);
bail = true;
}
- } else if (!isBounceBack(mExtSettings) && (static_cast<int> (mExtSettings->mBurstSize) > 0)) {
- setPeriodicBurst(mExtSettings);
- mExtSettings->mFPS = 1.0;
- fprintf(stderr, "WARN: option of --burst-size without --burst-period defaults --burst-period to 1 second\n");
+ }
+ if ((mExtSettings->connect_retry_time > 0) && !mExtSettings->connect_retry_timer) {
+ fprintf(stderr, "WARN: companion option of --connect-retry-timer not set - setting to default value of one second\n");
+ mExtSettings->connect_retry_timer = 1000000; // 1 sec in units usecs
+ }
+ if ((mExtSettings->connect_retry_timer > 0) && (mExtSettings->connect_retry_time <= 0)) {
+ fprintf(stderr, "WARN: companion option of --connect-retry-time not set - setting to default value of ten seconds\n");
+ mExtSettings->connect_retry_time = 10;
}
if (isUDP(mExtSettings)) {
if (isPeerVerDetect(mExtSettings)) {
@@ -1615,7 +1830,7 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
fprintf(stderr, "ERROR: option --ipg must be a positive value\n");
bail = true;
}
- if (mExtSettings->mConnectRetries > 0) {
+ if (mExtSettings->connect_retry_timer > 0) {
fprintf(stderr, "ERROR: option --connect-retries not supported with -u UDP\n");
bail = true;
}
@@ -1627,18 +1842,22 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
fprintf(stderr, "WARN: setting of option --tcp-quickack is not supported with -u UDP\n");
unsetWritePrefetch(mExtSettings);
}
+ if (isTcpTxDelay(mExtSettings)) {
+ fprintf(stderr, "WARN: setting of option --tcp-tx-delay is not supported with -u UDP\n");
+ unsetTcpTxDelay(mExtSettings);
+ }
{
double delay_target;
if (isIPG(mExtSettings)) {
- delay_target = mExtSettings->mBurstIPG * 1e9; // convert from seconds to nanoseconds
+ delay_target = ((mExtSettings->mBurstIPG > 0) ? mExtSettings->mBurstIPG * 1e9 : 0); // convert from seconds to nanoseconds
} else {
// compute delay target in units of nanoseconds
if (mExtSettings->mAppRateUnits == kRate_BW) {
// compute delay for bandwidth restriction, constrained to [0,max] seconds
- delay_target = (mExtSettings->mBufLen * 8e9) / mExtSettings->mAppRate;
+ delay_target = ((mExtSettings->mAppRate > 0) ? ((mExtSettings->mBufLen * 8e9) / mExtSettings->mAppRate) : 0);
} else {
- delay_target = 1e9 / mExtSettings->mAppRate;
+ delay_target = ((mExtSettings->mAppRate > 0) ? (1e9 / mExtSettings->mAppRate) : 0);
}
}
if (delay_target < 0 ||
@@ -1648,9 +1867,9 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
}
}
if (isTripTime(mExtSettings)) {
- if (mExtSettings->mBufLen < MINTRIPTIMEPLAYOAD) {
+ if (mExtSettings->mBufLen < MINTRIPTIMEPAYLOAD) {
if (isReverse(mExtSettings) || isFullDuplex(mExtSettings) || (mExtSettings->mMode != kTest_Normal)) {
- fprintf(stderr, "ERROR: payload (-l) size of %d too small for --trip-times, must be %d or greater\n", mExtSettings->mBufLen, MINTRIPTIMEPLAYOAD);
+ fprintf(stderr, "ERROR: payload (-l) size of %d too small for --trip-times, must be %d or greater\n", mExtSettings->mBufLen, MINTRIPTIMEPAYLOAD);
bail = true;
} else {
setSmallTripTime(mExtSettings);
@@ -1731,6 +1950,11 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
mExtSettings->mListenerTimeout = DEFAULT_PERMITKEY_LIFE;
}
}
+ if ((mExtSettings->mWorkingLoadThreads > 0) || (!isWorkingLoadUp(mExtSettings) && isWorkingLoadDown(mExtSettings)) \
+ || (isWorkingLoadUp(mExtSettings) && !isWorkingLoadDown(mExtSettings))) {
+ fprintf(stderr, "ERROR: setting of --working-load options is not supported on the server, just use --working-load\n");
+ bail = true;
+ }
if (isBounceBack(mExtSettings)) {
fprintf(stderr, "ERROR: setting of option --bounce-back is not supported on the server\n");
bail = true;
@@ -1769,6 +1993,9 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
if (isIncrDstIP(mExtSettings)) {
fprintf(stderr, "WARN: option of --incr-dstip is not supported on the server\n");
}
+ if (isIgnoreShutdown(mExtSettings)) {
+ fprintf(stderr, "WARN: option of --ignore-shutdown is not supported on the server\n");
+ }
if (isFQPacing(mExtSettings)) {
fprintf(stderr, "WARN: option of --fq-rate is not supported on the server\n");
}
@@ -1778,12 +2005,15 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
if (isPeerVerDetect(mExtSettings)) {
fprintf(stderr, "WARN: option of -X or --peer-detect not supported on the server\n");
}
- if (mExtSettings->mConnectRetries > 0) {
+ if (mExtSettings->connect_retry_timer > 0) {
fprintf(stderr, "WARN: option --connect-retries not supported on the server\n");
}
if (isNearCongest(mExtSettings)) {
fprintf(stderr, "WARN: option of --near-congestion not supported on the server\n");
}
+ if (isSyncTransferID(mExtSettings)) {
+ fprintf(stderr, "WARN: option of --sync-transfer-id is not supported on the server\n");
+ }
if (isPeriodicBurst(mExtSettings)) {
fprintf(stderr, "WARN: option of --burst-period can only be set on the client\n");
}
@@ -1802,15 +2032,15 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
if (isHistogram(mExtSettings)) {
if (!mExtSettings->mHistogramStr) {
if (mExtSettings->mThreadMode == kMode_Server) {
- // set default rx histogram settings, milliseconds bins between 0 and 1 secs
- mExtSettings->mHistBins = 1000;
+ // set default rx histogram settings, milliseconds bins between 0 and 10 secs
+ mExtSettings->mHistBins = 10000;
mExtSettings->mHistBinsize = 1;
mExtSettings->mHistUnits = 3;
mExtSettings->mHistci_lower = 5;
mExtSettings->mHistci_upper = 95;
} else {
// set default tx histogram settings, microseconds with 100 us bins
- mExtSettings->mHistBins = 10000;
+ mExtSettings->mHistBins = 100000;
mExtSettings->mHistBinsize = 100;
mExtSettings->mHistUnits = 6;
mExtSettings->mHistci_lower = 5;
@@ -1910,7 +2140,6 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
// Check for further mLocalhost (-B) and <dev> requests
// full addresses look like 192.168.1.1:6001%eth0 or [2001:e30:1401:2:d46e:b891:3082:b939]:6001%eth0
- iperf_sockaddr tmp;
// Parse -B addresses
if (mExtSettings->mLocalhost) {
if (((results = strtok(mExtSettings->mLocalhost, "%")) != NULL) && ((results = strtok(NULL, "%")) != NULL)) {
@@ -1934,17 +2163,26 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
fprintf(stderr, "WARNING: port %s ignored - set receive port on server via -p or -L\n", results);
}
}
- // Check for multicast per the -B
- SockAddr_setHostname(mExtSettings->mLocalhost, &tmp,
- (isIPV6(mExtSettings) ? 1 : 0));
- if ((mExtSettings->mThreadMode != kMode_Client) && SockAddr_isMulticast(&tmp)) {
- setMulticast(mExtSettings);
- } else if (SockAddr_isMulticast(&tmp)) {
- if (mExtSettings->mIfrname) {
- free(mExtSettings->mIfrname);
- mExtSettings->mIfrname = NULL;
+ // Do multicast address checking and processing
+ SockAddr_setHostname(mExtSettings->mLocalhost, &mExtSettings->multicast_group, \
+ &mExtSettings->size_multicast_group, (isIPV6(mExtSettings) ? 1 : 0));
+ if (SockAddr_isMulticast(&mExtSettings->multicast_group)) {
+ if (mExtSettings->mThreadMode == kMode_Client) {
+ fprintf(stderr, "WARNING: Client src addr (per -B) must be ip unicast\n");
+ exit(1);
+ } else {
+ setMulticast(mExtSettings);
+ if (isSSMMulticast(mExtSettings)) {
+ SockAddr_setHostname(mExtSettings->mSSMMulticastStr, &mExtSettings->multicast_group_source, \
+ &mExtSettings->size_multicast_group, (isIPV6(mExtSettings) ? 1 : 0));
+ if (SockAddr_isMulticast(&mExtSettings->multicast_group_source)) {
+ fprintf(stderr, "WARNING: SSM host src address (-H or --ssm-host) must be ip unicast\n");
+ exit(1);
+ }
+ }
}
- fprintf(stderr, "WARNING: Client src addr (per -B) must be ip unicast\n");
+ } else {
+ SockAddr_zeroAddress(&mExtSettings->multicast_group); // Zero out multicast sockaddr
}
}
// Parse client (-c) addresses for multicast, link-local and bind to device, port incr
@@ -1987,25 +2225,22 @@ void Settings_ModalOptions (struct thread_Settings *mExtSettings) {
}
if (SockAddr_isMulticast(&mExtSettings->peer)) {
bail = false;
- if ((mExtSettings->mThreads > 1) && !isIncrDstIP(mExtSettings)) {
- fprintf(stderr, "ERROR: client option of -P greater than 1 not supported with multicast address\n");
- bail = true;
- } else if (isFullDuplex(mExtSettings) || isReverse(mExtSettings) || (mExtSettings->mMode != kTest_Normal)) {
+ if (isFullDuplex(mExtSettings) || isReverse(mExtSettings) || (mExtSettings->mMode != kTest_Normal)) {
fprintf(stderr, "ERROR: options of --full-duplex, --reverse, -d and -r not supported with multicast addresses\n");
bail = true;
+ } else if (isSyncTransferID(mExtSettings)) {
+ fprintf(stderr, "ERROR: option of --sync-transfer-id incompatibile with multicast\n");
+ bail = true;
}
if (bail)
exit(1);
else
setMulticast(mExtSettings);
}
-#ifndef HAVE_DECL_SO_BINDTODEVICE
- if (mExtSettings->mIfrnametx) {
- fprintf(stderr, "bind to device will be ignored because not supported\n");
- free(mExtSettings->mIfrnametx);
- mExtSettings->mIfrnametx=NULL;
- }
-#endif
+ }
+ if (isIncrSrcPort(mExtSettings) && !mExtSettings->mBindPort) {
+ fprintf(stderr, "WARN: option of --incr-srcport requires -B bind option w/port to be set\n");
+ unsetIncrSrcPort(mExtSettings);
}
if ((mExtSettings->mIntervalMode == kInterval_Time) && (mExtSettings->mIntervalMode <= 0)) {
mExtSettings->mIntervalMode = kInterval_None;
@@ -2151,7 +2386,7 @@ void Settings_GenerateClientSettings (struct thread_Settings *server, struct thr
thread_debug("header set for a version 1 test");
#endif
if (isFullDuplex(server) || isServerReverse(server))
- setTransferID(server, 1);
+ setTransferID(server, REVERSED);
if (isFullDuplex(server) || v1test) {
Settings_Copy(server, client, SHALLOW_COPY);
reversed_thread = *client;
@@ -2291,7 +2526,16 @@ int Settings_GenerateClientHdrV1 (struct thread_Settings *client, struct client_
} else {
hdr->mPort = htonl(client->mPort);
}
- hdr->numThreads = htonl(client->mThreads);
+ if (isSyncTransferID(client)) {
+ if (client->mTransferID & (HEADER_HASTRANSFERID | HEADER_TRANSFERIDMASK)) {
+ fprintf(stderr, "WARN: num threads too large for --sync-transfer-id\n");
+ } else {
+ uint32_t tidthreads = (HEADER_HASTRANSFERID | ((client->mTransferID << HEADER_TRANSFERIDSHIFT) & HEADER_TRANSFERIDMASK) | client->mThreads);
+ hdr->numThreads = htonl(tidthreads);
+ }
+ } else {
+ hdr->numThreads = htonl(client->mThreads);
+ }
if (isModeTime(client)) {
hdr->mAmount = htonl(-(long)client->mAmount);
} else {
@@ -2325,10 +2569,13 @@ int Settings_GenerateClientHdr (struct thread_Settings *client, void *testhdr, s
struct client_udpsmall_testhdr *hdr = static_cast<struct client_udpsmall_testhdr *>(testhdr);
memset(hdr, 0, buflen);
hdr->flags = htons(HEADER16_SMALL_TRIPTIMES);
+ if (isTxStartTime(client) && !TimeZero(startTime)) {
+ hdr->start_tv_sec = htonl(startTime.tv_sec);
+ }
#ifdef HAVE_THREAD_DEBUG
thread_debug("UDP small trip times flags = %X", ntohs(hdr->flags));
#endif
- return (MINIPERFPAYLOAD);
+ return buflen;
}
// flags common to both TCP and UDP
if (isReverse(client) && !isCompat(client)) {
@@ -2473,7 +2720,7 @@ int Settings_GenerateClientHdr (struct thread_Settings *client, void *testhdr, s
}
len += sizeof(struct client_hdrext);
len += Settings_GenerateClientHdrV1(client, &hdr->base);
- if (!isCompat(client) && (client->mMode != kTest_Normal)) {
+ if ((!isCompat(client) && (client->mMode != kTest_Normal)) || isSyncTransferID(client)) {
flags |= HEADER_VERSION1;
if (client->mMode == kTest_DualTest)
flags |= RUN_NOW;
@@ -2481,7 +2728,7 @@ int Settings_GenerateClientHdr (struct thread_Settings *client, void *testhdr, s
if (isPeerVerDetect(client)) {
flags |= (HEADER_V2PEERDETECT | HEADER_VERSION2);
}
- if (isTripTime(client) || isFQPacing(client) || isIsochronous(client) || isTxStartTime(client)) {
+ if (isTripTime(client) || isFQPacing(client) || isIsochronous(client) || isTxStartTime(client) || isLoadCCA(client) || isCongestionControl(client)) {
hdr->start_fq.start_tv_sec = htonl(startTime.tv_sec);
hdr->start_fq.start_tv_usec = htonl(startTime.tv_usec);
hdr->start_fq.fqratel = htonl((uint32_t) client->mFQPacingRate);
@@ -2503,6 +2750,10 @@ int Settings_GenerateClientHdr (struct thread_Settings *client, void *testhdr, s
hdr->extend.TCPWritePrefetch = htonl((long)client->mWritePrefetch);
}
#endif
+ if (client->barrier_time) {
+ lowerflags |= HEADER_BARRIER_TIME;
+ hdr->extend.barrier_usecs = htonl((long)client->barrier_time);
+ }
#if HAVE_DECL_TCP_QUICKACK
if (isTcpQuickAck(client) && (!isReverse(client) || isFullDuplex(client))) {
upperflags |= HEADER_TCPQUICKACK;
@@ -2529,6 +2780,26 @@ int Settings_GenerateClientHdr (struct thread_Settings *client, void *testhdr, s
}
len += sizeof(struct client_hdrext_isoch_settings);
}
+ } else if (isLoadCCA(client) || isCongestionControl(client)) {
+ // just jump the enclave hdr
+ len += sizeof(struct client_hdrext_isoch_settings);
+ }
+ if (isLoadCCA(client) && (isWorkingLoadUp(client) || isWorkingLoadDown(client))) {
+ uint16_t lenfield = ((client->mLoadCCA != NULL) ? (strlen(client->mLoadCCA)) : 0);
+ if (lenfield > 0) {
+ hdr->cca.cca_length = htons(lenfield);
+ lowerflags |= HEADER_CCA;
+ memcpy(hdr->cca.value, client->mLoadCCA, lenfield);
+ len += sizeof(uint16_t) + lenfield;
+ }
+ } else if (isCongestionControl(client)) {
+ uint16_t lenfield = ((client->mCongestion != NULL) ? (strlen(client->mCongestion)) : 0);
+ if (lenfield > 0) {
+ hdr->cca.cca_length = htons(lenfield);
+ lowerflags |= HEADER_CCA;
+ memcpy(hdr->cca.value, client->mCongestion, lenfield);
+ len += sizeof(uint16_t) + lenfield;
+ }
}
if (isReverse(client) || isFullDuplex(client)) {
flags |= HEADER_VERSION2;
diff --git a/src/SocketAddr.c b/src/SocketAddr.c
index 4322475..b42d272 100644
--- a/src/SocketAddr.c
+++ b/src/SocketAddr.c
@@ -62,6 +62,16 @@
extern "C" {
#endif
+int SockAddr_getAFdomain (iperf_sockaddr *inSockAddr) {
+ return (SockAddr_isIPv6(inSockAddr) ?
+#if HAVE_IPV6
+ AF_INET6
+#else
+ AF_INET
+#endif
+ : AF_INET);
+}
+
/* -------------------------------------------------------------------
* Create a socket address. If inHostname is not null, resolve that
* address and fill it in. Fill in the port number. Use IPv6 ADDR_ANY
@@ -70,7 +80,7 @@ extern "C" {
void SockAddr_remoteAddr (struct thread_Settings *inSettings) {
if (SockAddr_isZeroAddress(&inSettings->peer) == 0) {
if (inSettings->mHost != NULL) {
- SockAddr_setHostname(inSettings->mHost, &inSettings->peer, isIPV6(inSettings));
+ SockAddr_setHostname(inSettings->mHost, &inSettings->peer, &inSettings->size_peer, isIPV6(inSettings));
if (inSettings->incrdstip)
SockAddr_incrAddress(&inSettings->peer, inSettings->incrdstip);
} else {
@@ -100,11 +110,10 @@ void SockAddr_localAddr (struct thread_Settings *inSettings) {
SockAddr_zeroAddress(&inSettings->local);
if (inSettings->mLocalhost != NULL) {
- SockAddr_setHostname(inSettings->mLocalhost, &inSettings->local,
+ SockAddr_setHostname(inSettings->mLocalhost, &inSettings->local, &inSettings->size_local,
isIPV6(inSettings));
if (inSettings->incrsrcip)
SockAddr_incrAddress(&inSettings->local, inSettings->incrsrcip);
-
} else {
#if HAVE_IPV6
if (isIPV6(inSettings)) {
@@ -158,11 +167,6 @@ void SockAddr_localAddr (struct thread_Settings *inSettings) {
/*
* User specified port so use it
*/
-#if HAVE_DECL_SO_REUSEPORT
- int boolean = 1;
- Socklen_t len = sizeof(boolean);
- setsockopt(inSettings->mSock, SOL_SOCKET, SO_REUSEPORT, (char*) &boolean, len);
-#endif
SockAddr_setPort(&inSettings->local, (inSettings->mBindPort + inSettings->incrsrcport));
} else {
/*
@@ -179,12 +183,13 @@ void SockAddr_localAddr (struct thread_Settings *inSettings) {
}
}
}
+
// end SocketAddr
/* -------------------------------------------------------------------
* Resolve the hostname address and fill it in.
* ------------------------------------------------------------------- */
-void SockAddr_setHostname (const char* inHostname, iperf_sockaddr *inSockAddr, int isIPv6) {
+void SockAddr_setHostname (const char* inHostname, iperf_sockaddr *inSockAddr, Socklen_t *addr_size, int isIPv6) {
// ..I think this works for both ipv6 & ipv4... we'll see
bool found = false;
int ret_ga;
@@ -201,6 +206,7 @@ void SockAddr_setHostname (const char* inHostname, iperf_sockaddr *inSockAddr, i
while (itr != NULL) {
if (itr->ai_family == AF_INET) {
memcpy(inSockAddr, (itr->ai_addr), (itr->ai_addrlen));
+ *addr_size = (Socklen_t) sizeof(struct sockaddr_in);
freeaddrinfo(res);
found = true;
break;
@@ -223,6 +229,7 @@ void SockAddr_setHostname (const char* inHostname, iperf_sockaddr *inSockAddr, i
if (itr->ai_family == AF_INET6) {
memcpy(inSockAddr, (itr->ai_addr), (itr->ai_addrlen));
freeaddrinfo(res);
+ *addr_size = (Socklen_t) sizeof(struct sockaddr_in6);
found = true;
break;
} else {
@@ -271,7 +278,11 @@ void SockAddr_setHostname (const char* inHostname, iperf_sockaddr *inSockAddr, i
}
}
if (!found) {
- fprintf(stderr, "ERROR: failed to find an ip address for host '%s'\n", inHostname);
+ if (!isIPv6) {
+ fprintf(stderr, "ERROR: failed to find an ip address for host '%s'\n", inHostname);
+ } else {
+ fprintf(stderr, "ERROR: failed to find an ipv6 address for host '%s'\n", inHostname);
+ }
exit(1);
}
}
diff --git a/src/active_hosts.cpp b/src/active_hosts.cpp
index a3455ab..24358c3 100644
--- a/src/active_hosts.cpp
+++ b/src/active_hosts.cpp
@@ -61,10 +61,18 @@
* Global table with active hosts, their sum reports and active thread counts
*/
static struct Iperf_Table active_table;
-static bool Iperf_host_port_present (iperf_sockaddr *find);
static struct Iperf_ListEntry* Iperf_host_present (iperf_sockaddr *find);
+static struct Iperf_ListEntry* Iperf_flow_present (iperf_sockaddr *find);
#if HAVE_THREAD_DEBUG
+static void rcvfrom_peer_debug (thread_Settings *server, bool duplicate) {
+ char tmpaddr[200];
+ size_t len=200;
+ unsigned short port = SockAddr_getPort(&server->peer);
+ SockAddr_getHostAddress(&server->peer, tmpaddr, len);
+ thread_debug("rcvfrom peer: %s port %d dup=%s", tmpaddr, port, (duplicate ? "true" : "false"));
+}
+
static void active_table_show_entry(const char *action, Iperf_ListEntry *entry, int found) {
assert(action != NULL);
assert(entry != NULL);
@@ -72,9 +80,9 @@ static void active_table_show_entry(const char *action, Iperf_ListEntry *entry,
size_t len=200;
unsigned short port = SockAddr_getPort(&(entry->host));
SockAddr_getHostAddress(&(entry->host), tmpaddr, len);
- thread_debug("active table: %s %s port %d (flag=%d) rootp=%p entryp=%p totcnt/activecnt/hostcnt = %d/%d/%d", \
- action, tmpaddr, port, found, (void *) active_table.root, (void *) entry, active_table.total_count, \
- active_table.count, entry->thread_count);
+ thread_debug("active table: %s %s port %d (flag=%d) rootp=%p entryp=%p hostcnt/flowcnt/threadcnt = %d/%d/%d", \
+ action, tmpaddr, port, found, (void *) active_table.sum_root, (void *) entry->sumreport, active_table.sum_count, \
+ active_table.flow_count, entry->thread_count);
}
static void active_table_show_compare(const char *action, Iperf_ListEntry *entry, iperf_sockaddr *host, const char *type) {
assert(action != NULL);
@@ -92,79 +100,108 @@ static void active_table_show_compare(const char *action, Iperf_ListEntry *entry
void Iperf_initialize_active_table () {
Mutex_Initialize(&active_table.my_mutex);
- active_table.root = NULL;
+ active_table.flow_root = NULL;
+ active_table.sum_root = NULL;
active_table.groupid = 0;
+#if HAVE_THREAD_DEBUG
+ active_table.sum_count = 0;
+ active_table.flow_count = 0;
+#endif
}
/*
- * Add Entry add to the list or update thread count
+ * Add Entry add to the list or update thread count, return 0 on UDP tuple duplicate
*/
-static void active_table_update (iperf_sockaddr *host, struct thread_Settings *agent) {
- assert(host != NULL);
- assert(agent != NULL);
- Iperf_ListEntry *this_entry = Iperf_host_present(host);
- active_table.total_count++;
- if (this_entry == NULL) {
- this_entry = new Iperf_ListEntry();
- assert(this_entry != NULL);
- this_entry->host = *host;
- this_entry->next = active_table.root;
- this_entry->thread_count = 1;
- this_entry->socket = agent->mSock;
- active_table.count++;
- active_table.groupid++;
- active_table.root = this_entry;
- this_entry->sum_report = InitSumReport(agent, active_table.total_count, 0);
- IncrSumReportRefCounter(this_entry->sum_report);
- agent->mSumReport = this_entry->sum_report;
- this_entry->sum_report->info.common->transferID = -active_table.groupid; // sum ids are negative
+static inline struct Iperf_ListEntry *hostkey_insert (iperf_sockaddr *host) {
+ struct Iperf_ListEntry *this_key = new Iperf_ListEntry();
+ assert(this_key != NULL);
+ if (!this_key) {
+ fprintf(stderr, "Memory alloc failure in key insert\n");
+ exit(1);
+ }
+ this_key->next = active_table.sum_root;
+ active_table.sum_root = this_key;
+ this_key->host = *host;
+ this_key->thread_count = 0;
#if HAVE_THREAD_DEBUG
- active_table_show_entry("new entry", this_entry, ((SockAddr_are_Equal(&this_entry->host, host) && SockAddr_Hostare_Equal(&this_entry->host, host))));
+ active_table.sum_count++;
+ active_table_show_entry("new host entry", this_key, ((SockAddr_are_Equal(&this_key->host, host) && SockAddr_Hostare_Equal(&this_key->host, host))));
#endif
- } else {
- this_entry->thread_count++;
- agent->mSumReport = this_entry->sum_report;
- IncrSumReportRefCounter(this_entry->sum_report);
+ return this_key;
+}
+
+static inline struct Iperf_ListEntry *flowkey_insert (iperf_sockaddr *host) {
+ struct Iperf_ListEntry *this_key = new Iperf_ListEntry();
+ assert(this_key != NULL);
+ if (!this_key) {
+ fprintf(stderr, "Memory alloc failure in key insert\n");
+ exit(1);
+ }
+ this_key->next = active_table.flow_root;
+ active_table.flow_root = this_key;
+ this_key->host = *host;
#if HAVE_THREAD_DEBUG
- active_table_show_entry("incr entry", this_entry, 1);
+ active_table.flow_count++;
+// active_table_show_flow_entry("new flow entry", this_key, ((SockAddr_are_Equal(&this_key->host, host) && SockAddr_Hostare_Equal(&this_key->host, host))));
#endif
- }
+ return this_key;
}
static inline iperf_sockaddr *active_table_get_host_key (struct thread_Settings *agent) {
- iperf_sockaddr *key = (isSumServerDstIP(agent) ? &agent->local : &agent->peer);
+ iperf_sockaddr *key = ((isIncrDstIP(agent) || isSumServerDstIP(agent)) ? &agent->local : &agent->peer);
return key;
}
-// Thread access to store a host
-int Iperf_push_host (struct thread_Settings *agent) {
- iperf_sockaddr *host = active_table_get_host_key(agent);
- Mutex_Lock(&active_table.my_mutex);
- active_table_update(host, agent);
- int groupid = active_table.groupid;
- Mutex_Unlock(&active_table.my_mutex);
- return groupid;
+static bool Iperf_push_flow (iperf_sockaddr *host) {
+ bool rc;
+ if (Iperf_flow_present(host)) {
+ rc = false;
+ } else {
+ flowkey_insert(host);
+ rc = true;
+ }
+ return rc;
}
-// Used for UDP push of a new host, returns negative value if the host/port is already present
-// This is critical because UDP is connectionless and designed to be stateless
-int Iperf_push_host_port_conditional (struct thread_Settings *agent) {
- iperf_sockaddr *host = active_table_get_host_key(agent);
- int rc = -1;
+// Thread access to store a host
+bool Iperf_push_host (struct thread_Settings *agent) {
Mutex_Lock(&active_table.my_mutex);
- if (!Iperf_host_port_present(host)) {
- active_table_update(host, agent);
- rc = active_table.groupid;
+ if (isUDP(agent) && (agent->mThreadMode == kMode_Server)) {
+ if (!Iperf_push_flow(&agent->peer)) {
+ // this is a duplicate on UDP, should just ignore
+ Mutex_Unlock(&active_table.my_mutex);
+#if HAVE_THREAD_DEBUG
+ rcvfrom_peer_debug(agent, true);
+#endif
+ return false;
+ }
}
+ struct Iperf_ListEntry *this_host = Iperf_host_present(active_table_get_host_key(agent));
+ if (!this_host) {
+ this_host = hostkey_insert(active_table_get_host_key(agent));
+ active_table.groupid++;
+ this_host->sumreport = InitSumReport(agent, -active_table.groupid, false);
+ this_host->sumreport->info.common->transferID = -active_table.groupid;
+#if HAVE_THREAD_DEBUG
+ active_table_show_entry("new sum report", this_host , 0);
+#endif
+ }
+ agent->mSumReport = this_host->sumreport;
+ this_host->thread_count++;
+ IncrSumReportRefCounter(this_host->sumreport);
+ this_host->socket = agent->mSock;
+#if HAVE_THREAD_DEBUG
+ active_table_show_entry("bind sum report", this_host, 0);
+#endif
Mutex_Unlock(&active_table.my_mutex);
- return (rc);
+ return true;
}
/*
* Remove a host from the table
*/
void Iperf_remove_host (struct thread_Settings *agent) {
- iperf_sockaddr *del = active_table_get_host_key(agent);
+ iperf_sockaddr *del;
// remove_list_entry(entry) {
// indirect = &head;
// while ((*indirect) != entry) {
@@ -172,7 +209,25 @@ void Iperf_remove_host (struct thread_Settings *agent) {
// }
// *indirect = entry->next
Mutex_Lock(&active_table.my_mutex);
- Iperf_ListEntry **tmp = &active_table.root;
+ // Delete any flow entries first
+ if (isUDP(agent)) {
+ del = &agent->peer;
+ Iperf_ListEntry **tmp = &active_table.flow_root;
+ while ((*tmp) && !(SockAddr_are_Equal(&(*tmp)->host, del))) {
+ tmp = &(*tmp)->next;
+ }
+ if (*tmp) {
+ Iperf_ListEntry *remove = (*tmp);
+#if HAVE_THREAD_DEBUG
+ active_table.flow_count--;
+#endif
+ *tmp = remove->next;
+ delete remove;
+ }
+ }
+
+ del = active_table_get_host_key(agent);
+ Iperf_ListEntry **tmp = &active_table.sum_root;
while ((*tmp) && !(SockAddr_Hostare_Equal(&(*tmp)->host, del))) {
#if HAVE_THREAD_DEBUG
active_table_show_compare("miss", *tmp, del, "client ip");
@@ -182,16 +237,16 @@ void Iperf_remove_host (struct thread_Settings *agent) {
if (*tmp) {
if (--(*tmp)->thread_count == 0) {
Iperf_ListEntry *remove = (*tmp);
- active_table.count--;
agent->mSumReport = NULL;
#if HAVE_THREAD_DEBUG
+ active_table.sum_count--;
active_table_show_entry("delete", remove, 1);
#endif
*tmp = remove->next;
- FreeSumReport(remove->sum_report);
+ FreeSumReport(remove->sumreport);
delete remove;
} else {
- DecrSumReportRefCounter((*tmp)->sum_report);
+ DecrSumReportRefCounter((*tmp)->sumreport);
#if HAVE_THREAD_DEBUG
active_table_show_entry("decr", (*tmp), 1);
#endif
@@ -204,55 +259,60 @@ void Iperf_remove_host (struct thread_Settings *agent) {
* Destroy the table
*/
void Iperf_destroy_active_table () {
- Iperf_ListEntry *itr1 = active_table.root, *itr2;
+ Iperf_ListEntry *itr1 = active_table.sum_root, *itr2;
+ while (itr1 != NULL) {
+ itr2 = itr1->next;
+ delete itr1;
+ itr1 = itr2;
+ }
+ itr1 = active_table.flow_root;
while (itr1 != NULL) {
itr2 = itr1->next;
delete itr1;
itr1 = itr2;
}
Mutex_Destroy(&active_table.my_mutex);
- active_table.root = NULL;
- active_table.count = 0;
- active_table.total_count = 0;
+ active_table.sum_root = NULL;
+#if HAVE_THREAD_DEBUG
+ active_table.sum_count = 0;
+#endif
}
/*
* Check if the host and port are present in the active table
*/
-bool Iperf_host_port_present (iperf_sockaddr *find) {
- Iperf_ListEntry *itr = active_table.root;
- bool rc = false;
+struct Iperf_ListEntry* Iperf_flow_present (iperf_sockaddr *find) {
+ Iperf_ListEntry *itr = active_table.flow_root;
while (itr != NULL) {
if (SockAddr_are_Equal(&itr->host, find)) {
#if HAVE_THREAD_DEBUG
- active_table_show_compare("match", itr, find, "client ip/port");
+ active_table_show_compare("match host/port", itr, find, "client ip/port");
#endif
- rc = true;
break;
} else {
#if HAVE_THREAD_DEBUG
- active_table_show_compare("miss", itr, find, "client ip/port");
+ active_table_show_compare("miss host/port", itr, find, "client ip/port");
#endif
itr = itr->next;
}
}
- return rc;
+ return itr;
}
/*
* Check if the host is present in the active table
*/
static Iperf_ListEntry* Iperf_host_present (iperf_sockaddr *find) {
- Iperf_ListEntry *itr = active_table.root;
+ Iperf_ListEntry *itr = active_table.sum_root;
while (itr != NULL) {
if (SockAddr_Hostare_Equal(&itr->host, find)) {
#if HAVE_THREAD_DEBUG
- active_table_show_compare("match", itr, find, "client ip");
+ active_table_show_compare("match host", itr, find, "client ip");
#endif
break;
} else {
#if HAVE_THREAD_DEBUG
- active_table_show_compare("miss", itr, find, "client ip");
+ active_table_show_compare("miss host", itr, find, "client ip");
#endif
itr = itr->next;
}
diff --git a/src/dscp.c b/src/dscp.c
index de691a7..f7bae7a 100644
--- a/src/dscp.c
+++ b/src/dscp.c
@@ -23,6 +23,12 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * 7 6 5 4 3 2 1 0
+ * +--+--+--+--+--+--+--+--+
+ * | DSCP | ECN |
+ * +--+--+--+--+--+--+--+--+
+ *
*/
#if HAVE_CONFIG_H
@@ -137,8 +143,8 @@ static const struct {
{ "nqb2", IPTOS_DSCP_NQB2 },
{ "ac_be", IPTOS_DSCP_CS0 },
{ "ac_bk", IPTOS_DSCP_CS1 },
- { "ac_vi", IPTOS_DSCP_CS4 },
- { "ac_vo", IPTOS_DSCP_EF },
+ { "ac_vi", IPTOS_DSCP_CS5 },
+ { "ac_vo", IPTOS_DSCP_CS6 },
{ "lowdelay", IPTOS_LOWDELAY },
{ "throughput", IPTOS_THROUGHPUT },
{ "reliability", IPTOS_RELIABILITY },
diff --git a/src/histogram.c b/src/histogram.c
index 3a9b82c..f00ffc7 100644
--- a/src/histogram.c
+++ b/src/histogram.c
@@ -47,17 +47,20 @@
*/
#include "headers.h"
#include "histogram.h"
+#include "Locale.h"
+#include "util.h"
#ifdef HAVE_THREAD_DEBUG
// needed for thread_debug
#include "Thread.h"
#endif
struct histogram *histogram_init(unsigned int bincount, unsigned int binwidth, float offset, float units,\
- double ci_lower, double ci_upper, unsigned int id, char *name) {
+ double ci_lower, double ci_upper, unsigned int id, char *name, bool Omit) {
struct histogram *this = (struct histogram *) malloc(sizeof(struct histogram));
if (!this) {
fprintf(stderr,"Malloc failure in histogram init\n");
return(NULL);
}
+ this->Omit = Omit;
if (!bincount)
bincount = 1000;
this->mybins = (unsigned int *) malloc(sizeof(unsigned int) * bincount);
@@ -196,7 +199,7 @@ void histogram_print(struct histogram *h, double start, double end) {
histogram_clear(h->prev);
}
if (!h->prev) {
- h->prev = histogram_init(h->bincount, h->binwidth, h->offset, h->units, h->ci_lower, h->ci_upper, h->id, h->myname);
+ h->prev = histogram_init(h->bincount, h->binwidth, h->offset, h->units, h->ci_lower, h->ci_upper, h->id, h->myname, h->Omit);
}
int n = 0, ix, delta, lowerci, upperci, outliercnt, fence_lower, fence_upper, upper3stdev;
int running=0;
@@ -258,12 +261,18 @@ void histogram_print(struct histogram *h, double start, double end) {
fprintf(stdout, "%s (%.2f/%.2f/99.7%%=%d/%d/%d,Outliers=%d,obl/obu=%d/%d)", \
h->outbuf, h->ci_lower, h->ci_upper, lowerci, upperci, upper3stdev, outliercnt, oob_l, oob_u);
if (!h->final && (h->maxval > 0) && ((h->maxts.tv_sec > 0) || h->maxts.tv_usec > 0)) {
- fprintf(stdout, " (%0.3f ms/%ld.%ld)\n", (h->maxval * 1e3), (long) h->maxts.tv_sec, (long) h->maxts.tv_usec);
+ fprintf(stdout, " (%0.3f ms/%ld.%ld)", (h->maxval * 1e3), (long) h->maxts.tv_sec, (long) h->maxts.tv_usec);
+ if (TimeDifference(h->prev->maxts, h->maxts) > 0) {
+ fprintf(stdout, "(clock_err)");
+ }
h->maxbin = -1;
h->maxval = 0;
+ h->prev->maxts.tv_sec = 0;
+ h->prev->maxts.tv_usec = 0;
+ h->maxts.tv_sec = 0;
+ h->maxts.tv_usec = 0;
} else if (h->final && (h->fmaxval > 0) && ((h->maxts.tv_sec > 0) || h->maxts.tv_usec > 0)) {
- fprintf(stdout, " (%0.3f ms/%ld.%ld)\n", (h->fmaxval * 1e3), (long) h->fmaxts.tv_sec, (long) h->fmaxts.tv_usec);
- } else {
- fprintf(stdout, "\n");
+ fprintf(stdout, " (%0.3f ms/%ld.%ld)", (h->fmaxval * 1e3), (long) h->fmaxts.tv_sec, (long) h->fmaxts.tv_usec);
}
+ fprintf(stdout, "%s\n", (h->Omit ? report_omitted : ""));
}
diff --git a/src/iperf_formattime.c b/src/iperf_formattime.c
index df65650..f0e8d1d 100644
--- a/src/iperf_formattime.c
+++ b/src/iperf_formattime.c
@@ -50,51 +50,53 @@
#include "iperf_formattime.h"
inline void iperf_formattime (char *timestr, int buflen, struct timeval timestamp, bool prec_ms, bool utc_time, enum TimeFormatType ftype) {
- struct tm ts ;
- ts = (utc_time ? *gmtime(&timestamp.tv_sec) : *localtime(&timestamp.tv_sec));
- switch (ftype) {
- case YearThruSec:
- strftime(timestr, buflen, "%Y-%m-%d %H:%M:%S", &ts);
- if (prec_ms) {
+ if (buflen > 0) {
+ struct tm ts ;
+ ts = (utc_time ? *gmtime(&timestamp.tv_sec) : *localtime(&timestamp.tv_sec));
+ switch (ftype) {
+ case YearThruSec:
+ strftime(timestr, buflen, "%Y-%m-%d %H:%M:%S", &ts);
+ if (prec_ms) {
+ int currlen = strlen(timestr);
+ if (currlen > 5) {
+ snprintf((timestr + currlen), 5, ".%.3d", (int) (timestamp.tv_usec/1000));
+ }
+ }
+ break;
+ case YearThruSecTZ:
+ strftime(timestr, buflen, "%Y-%m-%d %H:%M:%S", &ts);
int currlen = strlen(timestr);
- if (currlen > 5) {
- snprintf((timestr + currlen), 5, ".%.3d", (int) (timestamp.tv_usec/1000));
+ if (prec_ms) {
+ if (currlen > 5) {
+ snprintf((timestr + currlen), 5, ".%.3d", (int) (timestamp.tv_usec/1000));
+ currlen = strlen(timestr);
+ }
}
- }
- break;
- case YearThruSecTZ:
- strftime(timestr, buflen, "%Y-%m-%d %H:%M:%S", &ts);
- int currlen = strlen(timestr);
- if (prec_ms) {
- if (currlen > 5) {
- snprintf((timestr + currlen), 5, ".%.3d", (int) (timestamp.tv_usec/1000));
- currlen = strlen(timestr);
+ if ((buflen - currlen) > 5) {
+ strftime((timestr + currlen), (buflen - currlen), " (%Z)", &ts);
}
- }
- if ((buflen - currlen) > 5) {
- strftime((timestr + currlen), (buflen - currlen), " (%Z)", &ts);
- }
- break;
- case CSV:
- strftime(timestr, buflen, "%Y%m%d%H%M%S", &ts);
- if (prec_ms) {
- int currlen = strlen(timestr);
- if (currlen > 5) {
- snprintf((timestr + currlen), 5, ".%.3d", (int) (timestamp.tv_usec/1000));
+ break;
+ case CSV:
+ strftime(timestr, buflen, "%Y%m%d%H%M%S", &ts);
+ if (prec_ms) {
+ int currlen = strlen(timestr);
+ if (currlen > 5) {
+ snprintf((timestr + currlen), 5, ".%.3d", (int) (timestamp.tv_usec/1000));
+ }
}
- }
- break;
- case CSVTZ:
- strftime(timestr, buflen, "%z:%Y%m%d%H%M%S", &ts);
- if (prec_ms) {
- int currlen = strlen(timestr);
- if (currlen > 5) {
- snprintf((timestr + currlen), 5, ".%.3d", (int) (timestamp.tv_usec/1000));
+ break;
+ case CSVTZ:
+ strftime(timestr, buflen, "%z:%Y%m%d%H%M%S", &ts);
+ if (prec_ms) {
+ int currlen = strlen(timestr);
+ if (currlen > 5) {
+ snprintf((timestr + currlen), 5, ".%.3d", (int) (timestamp.tv_usec/1000));
+ }
}
+ break;
+ default:
+ FAIL_exit(1, "iperf_formattime program error");
}
- break;
- default:
- FAIL_exit(1, "iperf_formattime program error");
+ timestr[buflen - 1] = '\0'; // make sure string is null terminated
}
- timestr[buflen - 1] = '\0'; // make sure string is null terminated
}
diff --git a/src/iperf_multicast_api.c b/src/iperf_multicast_api.c
new file mode 100644
index 0000000..48c0184
--- /dev/null
+++ b/src/iperf_multicast_api.c
@@ -0,0 +1,386 @@
+/*---------------------------------------------------------------
+ * Copyright (c) 2023
+ * Broadcom Corporation
+ * All Rights Reserved.
+ *---------------------------------------------------------------
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software
+ * without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and
+ * the following disclaimers.
+ *
+ *
+ * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimers in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ *
+ * Neither the name of Broadcom Coporation,
+ * nor the names of its contributors may be used to endorse
+ * or promote products derived from this Software without
+ * specific prior written permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTIBUTORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * ________________________________________________________________
+ *
+ * iperf_multicast_api.c
+ * pull iperf multicast code for maitainability
+ *
+ * by Robert J. McMahon (rjmcmahon@rjmcmahon.com, bob.mcmahon@broadcom.com)
+ *
+ *
+ * Joins the multicast group or source and group (SSM S,G)
+ *
+ * taken from: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.hale001/ipv6d0141001708.htm
+ *
+ * Multicast function IPv4 IPv6 Protocol-independent
+ * ================== ==== ==== ====================
+ * Level of specified option on setsockopt()/getsockopt() IPPROTO_IP IPPROTO_IPV6 IPPROTO_IP or IPPROTO_IPV6
+ * Join a multicast group IP_ADD_MEMBERSHIP IPV6_JOIN_GROUP MCAST_JOIN_GROUP
+ * Leave a multicast group or leave all sources of that
+ * multicast group IP_DROP_MEMBERSHIP IPV6_LEAVE_GROUP MCAST_LEAVE_GROUP
+ * Select outbound interface for sending multicast datagrams IP_MULTICAST_IF IPV6_MULTICAST_IF NA
+ * Set maximum hop count IP_MULTICAST_TTL IPV6_MULTICAST_HOPS NA
+ * Enable multicast loopback IP_MULTICAST_LOOP IPV6_MULTICAST_LOOP NA
+ * Join a source multicast group IP_ADD_SOURCE_MEMBERSHIP NA MCAST_JOIN_SOURCE_GROUP
+ * Leave a source multicast group IP_DROP_SOURCE_MEMBERSHIP NA MCAST_LEAVE_SOURCE_GROUP
+ * Block data from a source to a multicast group IP_BLOCK_SOURCE NA MCAST_BLOCK_SOURCE
+ * Unblock a previously blocked source for a multicast group IP_UNBLOCK_SOURCE NA MCAST_UNBLOCK_SOURCE
+ *
+ *
+ * Reminder: The os will decide which version of IGMP or MLD to use. This may be controlled by system settings, e.g.:
+ *
+ * [rmcmahon@lvnvdb0987:~/Code/ssm/iperf2-code] $ sysctl -a | grep mld | grep force
+ * net.ipv6.conf.all.force_mld_version = 0
+ * net.ipv6.conf.default.force_mld_version = 0
+ * net.ipv6.conf.lo.force_mld_version = 0
+ * net.ipv6.conf.eth0.force_mld_version = 0
+ *
+ * [rmcmahon@lvnvdb0987:~/Code/ssm/iperf2-code] $ sysctl -a | grep igmp | grep force
+ * net.ipv4.conf.all.force_igmp_version = 0
+ * net.ipv4.conf.default.force_igmp_version = 0
+ * net.ipv4.conf.lo.force_igmp_version = 0
+ * net.ipv4.conf.eth0.force_igmp_version = 0
+ *
+ * ------------------------------------------------------------------- */
+#include "headers.h"
+#include "Settings.hpp"
+#include "iperf_multicast_api.h"
+#include "SocketAddr.h"
+#include "util.h"
+
+#ifdef HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+
+static unsigned int mcast_iface (struct thread_Settings *inSettings) {
+ unsigned int iface=0;
+ /* Set the interface or any */
+ if (inSettings->mIfrname) {
+#if HAVE_NET_IF_H && !WIN32
+ iface = if_nametoindex(inSettings->mIfrname);
+ FAIL_errno(!iface, "mcast if_nametoindex", inSettings);
+#else
+ fprintf(stderr, "multicast bind to device not supported on this platform\n");
+#endif
+ }
+ return iface;
+}
+
+
+// IP_MULTICAST_ALL is on be default, disable it here.
+// If set to 1, the socket will receive messages from all the groups that have been joined
+// globally on the whole system. Otherwise, it will deliver messages only from the
+// groups that have been explicitly joined (for example via the IP_ADD_MEMBERSHIP option)
+// on this particular socket.
+#if HAVE_MULTICAST_ALL_DISABLE
+static int iperf_multicast_all_disable (struct thread_Settings *inSettings) {
+ int rc = 0;
+#if HAVE_DECL_IP_MULTICAST_ALL
+ int mc_all = 0;
+ rc = setsockopt(inSettings->mSock, IPPROTO_IP, IP_MULTICAST_ALL, (void*) &mc_all, sizeof(mc_all));
+ FAIL_errno(rc == SOCKET_ERROR, "ip_multicast_all", inSettings);
+#endif
+ return rc;
+}
+#endif
+
+// This is the older mulitcast join code. Both SSM and binding the
+// an interface requires the newer socket options. Using the older
+// code here will maintain compatiblity with previous iperf versions
+static int iperf_multicast_join_v4_legacy (struct thread_Settings *inSettings) {
+#if HAVE_DECL_IP_ADD_MEMBERSHIP
+#if (HAVE_STRUCT_IP_MREQ) || (HAVE_STRUCT_IP_MREQN)
+#if HAVE_STRUCT_IP_MREQ
+ struct ip_mreq mreq;
+ mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+ size_t len = sizeof(struct ip_mreq);
+#elif HAVE_STRUCT_IP_MREQN
+ // struct ip_mreqn {
+ // struct in_addr imr_multiaddr; /* IP multicast address of group */
+ // struct in_addr imr_interface; /* local IP address of interface */
+ // int imr_ifindex; /* interface index */
+ // }
+ struct ip_mreqn mreq;
+ size_t len = sizeof(struct ip_mreqn);
+ mreq.imr_address.s_addr = htonl(INADDR_ANY);
+ mreq.imr_ifindex = mcast_iface(inSettings);
+#endif
+ memcpy(&mreq.imr_multiaddr, SockAddr_get_in_addr(&inSettings->multicast_group), sizeof(mreq.imr_multiaddr));
+ int rc = setsockopt(inSettings->mSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+ (char*)(&mreq), len);
+ FAIL_errno(rc == SOCKET_ERROR, "multicast join", inSettings);
+#if HAVE_MULTICAST_ALL_DISABLE
+ iperf_multicast_all_disable(inSettings);
+#endif
+ return ((rc == 0) ? IPERF_MULTICAST_JOIN_SUCCESS : IPERF_MULTICAST_JOIN_FAIL);
+#endif
+#endif
+ return IPERF_MULTICAST_JOIN_UNSUPPORTED;
+}
+
+static int iperf_multicast_join_v4_pi (struct thread_Settings *inSettings) {
+#if HAVE_DECL_MCAST_JOIN_GROUP
+ int rc = -1;
+ struct group_req group_req;
+
+ memset(&group_req, 0, sizeof(struct group_req));
+ memcpy(&group_req.gr_group, (struct sockaddr_in *)(&inSettings->multicast_group), sizeof(struct sockaddr_in));
+ group_req.gr_interface = mcast_iface(inSettings);
+ group_req.gr_group.ss_family = AF_INET;
+ rc = setsockopt(inSettings->mSock, IPPROTO_IP, MCAST_JOIN_GROUP, (const char *)(&group_req),
+ (socklen_t) sizeof(struct group_source_req));
+ FAIL_errno(rc == SOCKET_ERROR, "mcast v4 join group pi", inSettings);
+ return ((rc == 0) ? IPERF_MULTICAST_JOIN_SUCCESS : IPERF_MULTICAST_JOIN_FAIL);
+#else
+ return IPERF_MULTICAST_JOIN_UNSUPPORTED;
+#endif
+}
+
+
+static int iperf_multicast_join_v6 (struct thread_Settings *inSettings) {
+#if (HAVE_DECL_IPV6_JOIN_GROUP || HAVE_DECL_IPV6_ADD_MEMBERSHIP)
+#if HAVE_STRUCT_IPV6_MREQ
+ struct ipv6_mreq mreq;
+ memcpy(&mreq.ipv6mr_multiaddr, SockAddr_get_in6_addr(&inSettings->multicast_group), sizeof(mreq.ipv6mr_multiaddr));
+ mreq.ipv6mr_interface = mcast_iface(inSettings);
+#if HAVE_DECL_IPV6_JOIN_GROUP
+ int rc = setsockopt(inSettings->mSock, IPPROTO_IPV6, IPV6_JOIN_GROUP, \
+ (char*)(&mreq), sizeof(mreq));
+#else
+ int rc = setsockopt(inSettings->mSock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, \
+ (char*)(&mreq), sizeof(mreq));
+#endif
+ FAIL_errno(rc == SOCKET_ERROR, "multicast v6 join", inSettings);
+ return ((rc == 0) ? IPERF_MULTICAST_JOIN_SUCCESS : IPERF_MULTICAST_JOIN_FAIL);
+#endif
+#endif
+ return IPERF_MULTICAST_JOIN_UNSUPPORTED;
+
+}
+
+static int iperf_multicast_join_v6_pi (struct thread_Settings *inSettings) {
+#if HAVE_DECL_MCAST_JOIN_GROUP
+ int rc = -1;
+ struct group_req group_req;
+
+ memset(&group_req, 0, sizeof(struct group_req));
+ memcpy(&group_req.gr_group, (struct sockaddr_in6 *)(&inSettings->multicast_group), sizeof(struct sockaddr_in6));
+ group_req.gr_interface = mcast_iface(inSettings);
+ group_req.gr_group.ss_family = AF_INET6;
+ rc = setsockopt(inSettings->mSock, IPPROTO_IPV6, MCAST_JOIN_GROUP, (const char *)(&group_req),
+ (socklen_t) sizeof(struct group_source_req));
+ FAIL_errno(rc == SOCKET_ERROR, "mcast v6 join group", inSettings);
+ return ((rc == 0) ? IPERF_MULTICAST_JOIN_SUCCESS : IPERF_MULTICAST_JOIN_FAIL);
+#endif
+ return IPERF_MULTICAST_JOIN_UNSUPPORTED;
+}
+
+
+static int iperf_multicast_ssm_join_v4 (struct thread_Settings *inSettings) {
+#if HAVE_SSM_MULTICAST
+ int rc;
+ struct sockaddr_in *group;
+ struct sockaddr_in *source;
+
+ // Fill out both structures because we don't which one will succeed
+ // and both may need to be tried
+#if HAVE_STRUCT_IP_MREQ_SOURCE
+ struct ip_mreq_source imr;
+ memset (&imr, 0, sizeof (imr));
+#endif
+#if HAVE_STRUCT_GROUP_SOURCE_REQ
+ struct group_source_req group_source_req;
+ memset(&group_source_req, 0, sizeof(struct group_source_req));
+ group_source_req.gsr_interface = mcast_iface(inSettings);
+ group=(struct sockaddr_in *)(&group_source_req.gsr_group);
+ source=(struct sockaddr_in *)(&group_source_req.gsr_source);
+#else
+ struct sockaddr_in imrgroup;
+ struct sockaddr_in imrsource;
+ group = &imrgroup;
+ source = &imrsource;
+#endif
+ source->sin_family = AF_INET;
+ group->sin_family = AF_INET;
+ /* Set the group and SSM source*/
+ memcpy(group, (struct sockaddr_in *)(&inSettings->multicast_group), sizeof(struct sockaddr_in));
+ memcpy(source, (struct sockaddr_in *)(&inSettings->multicast_group_source), sizeof(struct sockaddr_in));
+#if HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+ source->sin_len = group->sin_len;
+#endif
+ source->sin_port = 0; /* Ignored */
+ rc = -1;
+
+#if HAVE_DECL_MCAST_JOIN_SOURCE_GROUP
+ rc = setsockopt(inSettings->mSock,IPPROTO_IP,MCAST_JOIN_SOURCE_GROUP, (const char *)(&group_source_req), \
+ sizeof(struct group_source_req));
+ WARN(rc == SOCKET_ERROR, "mcast v4 join ssm join_src");
+#endif
+
+#if (HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP && HAVE_STRUCT_IP_MREQ_SOURCE)
+ // Some operating systems will have MCAST_JOIN_SOURCE_GROUP but still fail
+ // In those cases try the IP_ADD_SOURCE_MEMBERSHIP
+ if (rc < 0) {
+#if HAVE_STRUCT_IP_MREQ_SOURCE_IMR_MULTIADDR_S_ADDR
+ imr.imr_multiaddr = ((const struct sockaddr_in *)group)->sin_addr;
+ imr.imr_sourceaddr = ((const struct sockaddr_in *)source)->sin_addr;
+#else
+ // Some Android versions declare mreq_source without an s_addr
+ imr.imr_multiaddr = ((const struct sockaddr_in *)group)->sin_addr.s_addr;
+ imr.imr_sourceaddr = ((const struct sockaddr_in *)source)->sin_addr.s_addr;
+#endif
+ rc = setsockopt (inSettings->mSock, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP, (char*)(&imr), sizeof (imr));
+ FAIL_errno(rc == SOCKET_ERROR, "mcast v4 join ssm add_src", inSettings);
+ }
+#endif
+ return ((rc == 0) ? IPERF_MULTICAST_JOIN_SUCCESS : IPERF_MULTICAST_JOIN_FAIL);
+#endif
+ return IPERF_MULTICAST_JOIN_UNSUPPORTED;
+}
+
+static int iperf_multicast_ssm_join_v6 (struct thread_Settings *inSettings) {
+#if (HAVE_IPV6_MULTICAST && HAVE_SSM_MULTICAST && HAVE_DECL_MCAST_JOIN_SOURCE_GROUP)
+ int rc;
+
+ // Here it's either an SSM S,G multicast join or a *,G with an interface specifier
+ // Use the newer socket options when these are specified
+ struct group_source_req group_source_req;
+ struct sockaddr_in6 *group;
+ struct sockaddr_in6 *source;
+
+ memset(&group_source_req, 0, sizeof(struct group_source_req));
+
+ group_source_req.gsr_interface = mcast_iface(inSettings);
+ group=(struct sockaddr_in6*)(&group_source_req.gsr_group);
+ source=(struct sockaddr_in6*)(&group_source_req.gsr_source);
+ source->sin6_family = AF_INET6;
+ group->sin6_family = AF_INET6;
+ /* Set the group and SSM source*/
+ memcpy(group, (struct sockaddr_in *)(&inSettings->multicast_group), sizeof(struct sockaddr_in6));
+ memcpy(source, (struct sockaddr_in *)(&inSettings->multicast_group_source), sizeof(struct sockaddr_in6));
+ group->sin6_port = 0; /* Ignored */
+#if HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+ source->sin6_len = group->sin6_len;
+#endif
+ rc = setsockopt(inSettings->mSock,IPPROTO_IPV6,MCAST_JOIN_SOURCE_GROUP, (const char *)(&group_source_req),
+ sizeof(struct group_source_req));
+ FAIL_errno(rc == SOCKET_ERROR, "mcast v6 join source group", inSettings);
+ return ((rc == 0) ? IPERF_MULTICAST_JOIN_SUCCESS : IPERF_MULTICAST_JOIN_FAIL);
+#endif
+ return IPERF_MULTICAST_JOIN_UNSUPPORTED;
+}
+
+enum McastJoinResponse iperf_multicast_join (struct thread_Settings *inSettings) {
+ int rc = IPERF_MULTICAST_JOIN_FAIL;
+ if (!isSSMMulticast(inSettings)) {
+ // *.G join
+ if (!SockAddr_isIPv6(&inSettings->multicast_group)) {
+ if (!mcast_iface(inSettings)) {
+ rc = iperf_multicast_join_v4_legacy(inSettings);
+ }
+ if (rc != IPERF_MULTICAST_JOIN_SUCCESS) {
+ rc = iperf_multicast_join_v4_pi(inSettings);
+ }
+ } else {
+ rc = iperf_multicast_join_v6(inSettings);
+ if (rc != IPERF_MULTICAST_JOIN_SUCCESS) {
+ rc = iperf_multicast_join_v6_pi(inSettings);
+ }
+ }
+ } else {
+ // SSM or S,G join
+ if (!SockAddr_isIPv6(&inSettings->multicast_group)) {
+ rc = iperf_multicast_ssm_join_v4(inSettings);
+ } else {
+ rc = iperf_multicast_ssm_join_v6(inSettings);
+ }
+ }
+ return rc;
+}
+
+static void iperf_multicast_sync_ifrname (struct thread_Settings *inSettings) {
+ if (inSettings->mIfrname && !inSettings->mIfrnametx) {
+ int len = strlen(inSettings->mIfrname);
+ inSettings->mIfrnametx = calloc((len + 1), sizeof(char));
+ if (inSettings->mIfrnametx) {
+ strncpy(inSettings->mIfrnametx, inSettings->mIfrname, len+1);
+ }
+ }
+ if (!inSettings->mIfrname && inSettings->mIfrnametx) {
+ int len = strlen(inSettings->mIfrnametx);
+ inSettings->mIfrname = calloc((len + 1), sizeof(char));
+ if (inSettings->mIfrname) {
+ strncpy(inSettings->mIfrname, inSettings->mIfrnametx, len+1);
+ }
+ }
+}
+
+bool iperf_multicast_sendif_v4 (struct thread_Settings *inSettings) {
+ bool result = false;
+#if HAVE_DECL_IP_MULTICAST_IF
+ struct in_addr interface_addr;
+ memcpy(&interface_addr, SockAddr_get_in_addr(&inSettings->local), sizeof(interface_addr));
+ int rc = setsockopt(inSettings->mSock, IPPROTO_IP, IP_MULTICAST_IF, \
+ (char*)(&interface_addr), sizeof(interface_addr));
+ if ((rc != SOCKET_ERROR) && SockAddr_Ifrname(inSettings)) {
+ iperf_multicast_sync_ifrname(inSettings);
+ }
+ FAIL_errno(rc == SOCKET_ERROR, "v4 multicast if", inSettings);
+ result = ((rc == 0) ? true : false);
+#endif
+ return result;
+}
+
+bool iperf_multicast_sendif_v6 (struct thread_Settings *inSettings) {
+ int result = false;
+#if HAVE_DECL_IPV6_MULTICAST_IF && HAVE_NET_IF_H && !WIN32
+ if (inSettings->mIfrnametx) {
+ unsigned int ifindex = if_nametoindex(inSettings->mIfrnametx);
+ if (ifindex) {
+ int rc = setsockopt(inSettings->mSock, IPPROTO_IPV6, IPV6_MULTICAST_IF, &ifindex, sizeof(ifindex));
+ if (rc == 0) {
+ iperf_multicast_sync_ifrname(inSettings);
+ result = true;
+ }
+ }
+ }
+#endif
+ return result;
+}
diff --git a/src/isochronous.cpp b/src/isochronous.cpp
index 573f05a..62c9703 100644
--- a/src/isochronous.cpp
+++ b/src/isochronous.cpp
@@ -57,7 +57,7 @@ using namespace Isochronous;
FrameCounter::FrameCounter (double value, const Timestamp& start) : frequency(value) {
period = static_cast<unsigned int>(1000000 / frequency);
startTime = start;
- nextslotTime=start;
+ nextslotTime = start;
lastcounter = 0;
slot_counter = 0;
slip = 0;
@@ -69,6 +69,8 @@ FrameCounter::FrameCounter (double value) : frequency(value) {
if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL))
WARN_errno(1, "SetThreadPriority");
#endif
+ startTime.setnow();
+ nextslotTime = startTime;
period = static_cast<unsigned int>(1000000 / frequency); // unit us
lastcounter = 0;
slot_counter = 0;
@@ -119,23 +121,23 @@ int FrameCounter::mySetWaitableTimer (long delay_time) {
#endif
#if HAVE_CLOCK_NANOSLEEP
-unsigned int FrameCounter::wait_tick (long *sched_err) {
+unsigned int FrameCounter::wait_tick (long *sched_err, bool sync_strict) {
Timestamp now;
int rc = true;
if (!slot_counter) {
slot_counter = 1;
- now.setnow();
nextslotTime = now;
+ startTime = now;
} else {
- while (!now.before(nextslotTime)) {
- now.setnow();
+ nextslotTime.add(period);
+ slot_counter++;
+ while (now.subUsec(nextslotTime) > static_cast<long>(sync_strict ? 0 : period)) {
nextslotTime.add(period);
-// printf("***** next slot %ld.%ld\n",nextslotTime.getSecs(), nextslotTime.getUsecs());
slot_counter++;
}
- if (lastcounter && ((slot_counter - lastcounter) > 1)) {
+ if (lastcounter && ((slot_counter - lastcounter) > 1)) {
slip++;
- }
+ }
}
#ifndef WIN32
timespec txtime_ts;
@@ -179,42 +181,42 @@ unsigned int FrameCounter::wait_tick (long *sched_err) {
return(slot_counter);
}
#else
-unsigned int FrameCounter::wait_tick (long *sched_err) {
- long remaining;
- unsigned int framecounter;
-
- if (!lastcounter) {
- reset();
- framecounter = 1;
+unsigned int FrameCounter::wait_tick (long *sched_err, bool sync_strict) {
+ Timestamp now;
+ if (!slot_counter) {
+ slot_counter = 1;
+ startTime = now;
+ nextslotTime = now;
} else {
- framecounter = get(&remaining);
- if ((framecounter - lastcounter) > 1)
- slip++;
-// delay_loop(remaining);
- remaining *= 1000;
- struct timespec tv0={0,0}, tv1;
- tv0.tv_sec = (remaining / BILLION);
- tv0.tv_nsec += (remaining % BILLION);
- if (tv0.tv_nsec >= BILLION) {
- tv0.tv_sec++;
- tv0.tv_nsec -= BILLION;
+ long remaining;
+ nextslotTime.add(period);
+ slot_counter++;
+ while (now.subUsec(nextslotTime) > (sync_strict ? 0 : period)) {
+ nextslotTime.add(period);
+ slot_counter++;
}
- Timestamp slotstart = startTime;
- slot_counter = get();
- // period unit is in microseconds, convert to seconds
- slotstart.add(slot_counter * period * 1e-6);
- int rc = nanosleep(&tv0, &tv1);
- if (sched_err) {
- Timestamp actual;
- *sched_err = actual.subUsec(slotstart);
-// printf("**** slot %ld.%ld actual %ld.%ld %ld\n", slotstart.getSecs(), slotstart.getUsecs(), actual.getSecs(), actual.getUsecs(), *sched_err);
+// printf("**** sync strict %d now %ld.%ld next %ld.%ld\n", sync_strict, now.getSecs(), now.getUsecs(), nextslotTime.getSecs(), nextslotTime.getUsecs());
+ if (now.before(nextslotTime)) {
+ struct timespec tv0={0,0}, tv1;
+ get(&remaining);
+ remaining *= 1000; // convert to nano seconds
+ tv0.tv_sec = (remaining / BILLION);
+ tv0.tv_nsec += (remaining % BILLION);
+ if (tv0.tv_nsec >= BILLION) {
+ tv0.tv_sec++;
+ tv0.tv_nsec -= BILLION;
+ }
+// printf("**** wait: nanos %ld remain %ld.%ld\n", remaining, tv0.tv_sec, tv0.tv_nsec);
+ int rc = nanosleep(&tv0, &tv1);
+ if (sched_err) {
+ Timestamp actual;
+ *sched_err = actual.subUsec(nextslotTime);
+ // printf("**** slot %ld.%ld actual %ld.%ld %ld\n", slotstart.getSecs(), slotstart.getUsecs(), actual.getSecs(), actual.getUsecs(), *sched_err);
+ }
+ WARN_errno((rc != 0), "nanosleep wait_tick");
}
- WARN_errno((rc != 0), "nanosleep wait_tick"); ;
-// printf("****** rc = %d, remain %ld.%ld\n", rc, tv1.tv_sec, tv1.tv_nsec);
- framecounter ++;
}
- lastcounter = framecounter;
- return(framecounter);
+ return(slot_counter);
}
#endif
inline unsigned int FrameCounter::get () const {
@@ -226,7 +228,7 @@ inline unsigned int FrameCounter::get (const Timestamp& slot) const {
return(slot_counter + 1); // Frame counter for packets starts at 1
}
-inline unsigned int FrameCounter::get (long *ticks_remaining) {
+unsigned int FrameCounter::get (long *ticks_remaining) {
assert(ticks_remaining != NULL);
Timestamp sampleTime; // Constructor will initialize timestamp to now
long usecs = -startTime.subUsec(sampleTime);
@@ -234,7 +236,7 @@ inline unsigned int FrameCounter::get (long *ticks_remaining) {
// figure out how many usecs before the next frame counter tick
// the caller can use this to delay until the next tick
*ticks_remaining = (counter * period) - usecs;
- return(counter + 1); // Frame counter for packets starts at 1
+ return(counter); // Frame counter for packets starts at 1
}
inline Timestamp FrameCounter::next_slot () {
diff --git a/src/packet_ring.c b/src/packet_ring.c
index 93e7578..97a25a5 100644
--- a/src/packet_ring.c
+++ b/src/packet_ring.c
@@ -55,6 +55,11 @@ static int totalpacketringcount = 0;
Mutex packetringdebug_mutex;
#endif
+//
+// Initialize a packet ring between a traffic thread and the reporter thread
+// Note: enable dequeue events will have the dequeue return null on an event relevant to
+// the reporter thread moving to the next ring. This is needed for proper summing
+//
struct PacketRing * packetring_init (int count, struct Condition *awake_consumer, struct Condition *awake_producer) {
assert(awake_consumer != NULL);
struct PacketRing *pr = NULL;
@@ -78,6 +83,8 @@ struct PacketRing * packetring_init (int count, struct Condition *awake_consumer
pr->mutex_enable=1;
pr->consumerdone = 0;
pr->awaitcounter = 0;
+ pr->uplevel = HIGH;
+ pr->downlevel = HIGH;
#ifdef HAVE_THREAD_DEBUG
Mutex_Lock(&packetringdebug_mutex);
totalpacketringcount++;
@@ -103,7 +110,7 @@ inline void packetring_enqueue (struct PacketRing *pr, struct ReportStruct *meta
{
struct timeval now;
static struct timeval prev={0, 0};
- gettimeofday( &now, NULL );
+ TimeGetNow(now);
if (!prev.tv_sec || (TimeDifference(now, prev) > 1.0)) {
prev = now;
thread_debug( "Not good, traffic's packet ring %p stalled per %p", (void *)pr, (void *)&pr->awake_producer);
@@ -127,16 +134,18 @@ inline void packetring_enqueue (struct PacketRing *pr, struct ReportStruct *meta
inline struct ReportStruct *packetring_dequeue (struct PacketRing *pr) {
struct ReportStruct *packet = NULL;
- if (pr->producer == pr->consumer)
+ if (pr->producer == pr->consumer) {
return NULL;
-
+ }
int readindex;
if ((pr->consumer + 1) == pr->maxcount)
readindex = 0;
else
readindex = (pr->consumer + 1);
+
packet = (pr->data + readindex);
- // advance the consumer pointer last
+ // See if the dequeue needs to detect an event so the reporter
+ // can move to the next packet ring
pr->consumer = readindex;
if (pr->mutex_enable) {
// Signal the traffic thread assigned to this ring
@@ -152,6 +161,10 @@ inline struct ReportStruct *packetring_dequeue (struct PacketRing *pr) {
return packet;
}
+inline enum edgeLevel toggleLevel(enum edgeLevel level) {
+ return ((level == HIGH) ? LOW : HIGH);
+}
+
inline void enqueue_ackring (struct PacketRing *pr, struct ReportStruct *metapacket) {
packetring_enqueue(pr, metapacket);
// Keep the latency low by signaling the consumer thread
diff --git a/src/pdfs.c b/src/pdfs.c
index a1e0382..8110c8f 100644
--- a/src/pdfs.c
+++ b/src/pdfs.c
@@ -63,13 +63,16 @@
#define TRUE 1
float box_muller(void) {
float x1, x2, w, y1;
+#if 0
static float y2;
static int generate = FALSE;
/* Each iteration produces two values, if one exists use the value from previous call */
generate = !generate;
if (!generate) {
y1 = y2;
- } else {
+ } else
+#endif
+ {
int loopcontrol=100;
do {
x1 = 2.0 * (float)rand()/(float)(RAND_MAX) - 1.0;
@@ -82,7 +85,9 @@ float box_muller(void) {
} else {
w = sqrt( (-2.0 * logf( w ) ) / w );
y1 = x1 * w;
+#if 0
y2 = x2 * w;
+#endif
}
}
return(y1);
diff --git a/src/socket_io.c b/src/socket_io.c
index 0475310..0f83a6c 100644
--- a/src/socket_io.c
+++ b/src/socket_io.c
@@ -82,7 +82,7 @@ ssize_t readn (int inSock, void *outBuf, size_t inLen) {
if (errno == EINTR)
nread = 0; /* interupted, call read again */
else
- return -1; /* error */
+ return SOCKET_ERROR; /* error */
} else if (nread == 0)
break; /* EOF */
@@ -119,7 +119,7 @@ int recvn (int inSock, char *outBuf, int inLen, int flags) {
// Note: use TCP fatal error codes even for UDP
if (FATALTCPREADERR(errno)) {
WARN_errno(1, "recvn peek");
- nread = -1;
+ nread = SOCKET_ERROR;
sInterupted = 1;
goto DONE;
}
@@ -151,11 +151,11 @@ int recvn (int inSock, char *outBuf, int inLen, int flags) {
// Note: use TCP fatal error codes even for UDP
if (FATALTCPREADERR(errno)) {
WARN_errno(1, "recvn");
- nread = -1;
+ nread = SOCKET_ERROR;
sInterupted = 1;
goto DONE;
} else {
- nread = -2;
+ nread = IPERF_SOCKET_ERROR_NONFATAL;
goto DONE;
}
#ifdef HAVE_THREAD_DEBUG
@@ -179,7 +179,7 @@ int recvn (int inSock, char *outBuf, int inLen, int flags) {
}
DONE:
return(nread);
-} /* end readn */
+} /* end recvn */
/* -------------------------------------------------------------------
* Attempts to write n bytes to a socket.
@@ -202,7 +202,6 @@ int writen (int inSock, const void *inBuf, int inLen, int *count) {
ptr = (char*) inBuf;
nleft = inLen;
nwritten = 0;
- *count = 0;
while ((nleft > 0) && !sInterupted) {
nwritten = write(inSock, ptr, nleft);
@@ -212,9 +211,8 @@ int writen (int inSock, const void *inBuf, int inLen, int *count) {
// check for a fatal error vs an error that should retry
if ((errno != EINTR) && (errno != EAGAIN) && (errno != EWOULDBLOCK)) {
nwritten = inLen - nleft;
- fprintf(stdout, "FAIL: writen errno = %d\n", errno);
- WARN_errno(1, "writen fatal");
- sInterupted = 1;
+ fprintf(stdout, "FAIL: writen errno = %d (bytes=%d)\n", errno, nwritten);
+// sInterupted = 1;
goto DONE;
}
break;
diff --git a/src/stdio.c b/src/stdio.c
index 3bdf668..33e58ac 100644
--- a/src/stdio.c
+++ b/src/stdio.c
@@ -322,6 +322,17 @@ void byte_snprintf(char* outString, int inLen, double inNum, char inFormat) {
snprintf(outString, inLen, format, inNum, suffix);
} /* end byte_snprintf */
+
+void make_lower (char *s) {
+ if (s) {
+ int length = strlen(s);
+ for (int i = 0; i < length; i++) {
+ s[i] = tolower(s[i]);
+ }
+ }
+ return;
+}
+
/* -------------------------------------------------------------------
* redirect
*
diff --git a/t/base.sh b/t/base.sh
index 097a995..eee1878 100644
--- a/t/base.sh
+++ b/t/base.sh
@@ -17,17 +17,20 @@ run_iperf() {
mode=server
server=(-s)
client=(-c)
+ match=""
# Split server and client args lists
- for a; do
- case $a in
+ while [ $# -gt 0 ]; do
+ case $1 in
(-c) mode=client;;
(-s) mode=server;;
+ (-match) shift; match=$1;;
(*)
case $mode in
- (server) server+=($a);;
- (client) client+=($a);;
+ (server) server+=($1);;
+ (client) client+=($1);;
esac
esac
+ shift
done
# Start server
# Wait for "listening"
@@ -43,5 +46,8 @@ run_iperf() {
if [[ "$results" =~ unrecognized|ignoring|failed|not\ valid ]]; then
exit 1
fi
+ if [[ -n "$match" && ! ("$results" =~ "$match") ]]; then
+ exit 1
+ fi
+ exit 0
}
-
diff --git a/t/t14_udp_triptimes.sh b/t/t14_udp_triptimes.sh
new file mode 100755
index 0000000..9fcac04
--- /dev/null
+++ b/t/t14_udp_triptimes.sh
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+. $(dirname $0)/base.sh
+
+# usage:
+# run_iperf -s server args -c client args
+#
+# client args should contain $ip or -V $ip6
+# results returned in $results
+
+run_iperf \
+ -s -P 1 -u -i 1 -t 3 \
+ -c $ip -P 1 -u -b 10m -i 1 -t 2 --trip-times
diff --git a/t/t15_udp_enhanced.sh b/t/t15_udp_enhanced.sh
new file mode 100755
index 0000000..4706c50
--- /dev/null
+++ b/t/t15_udp_enhanced.sh
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+. $(dirname $0)/base.sh
+
+# usage:
+# run_iperf -s server args -c client args
+#
+# client args should contain $ip or -V $ip6
+# results returned in $results
+
+run_iperf \
+ -s -P 1 -u -i 1 -t 3 -e \
+ -c $ip -P 1 -u -b 10m -i 1 -t 2 -e
diff --git a/t/t16_udp_histograms.sh b/t/t16_udp_histograms.sh
new file mode 100755
index 0000000..a23e072
--- /dev/null
+++ b/t/t16_udp_histograms.sh
@@ -0,0 +1,13 @@
+#!/bin/bash -e
+. $(dirname $0)/base.sh
+
+# usage:
+# run_iperf -s server args -c client args
+#
+# client args should contain $ip or -V $ip6
+# results returned in $results
+
+run_iperf \
+ -match "T8(f)-PDF:" \
+ -s -P 1 -u -i 1 -t 3 --histograms \
+ -c $ip -P 1 -u -b 10m -i 1 -t 2 --trip-times