1
1
Граф коммитов

887 Коммитов

Автор SHA1 Сообщение Дата
Boris Okunev
d60f6234d5 Issue #659 (#660)
Ignore nonsensical TCP MSS when trying to compute the default UDP packet size.  This fix seems to be primarily needed for Windows systems, but it's a good bit of sanity checking to do in any case.
2017-10-27 14:38:08 -07:00
Bruce A. Mah
010fc7e6c8 Don't overwrite a PID file corresponding to a valid process. (#654)
This fixes a problem described in issue #623 where the PID file
opened by a running instance of iperf3 could be overwritten /
deleted by a subsequent invocation of iperf3.
2017-10-25 10:04:26 -07:00
Bruce A. Mah
24da2caa09 Fix memory leak introduced in 1460aa3433. (#652)
Pointed out by:  @pprindeville
Should have been found by:  @bmah888
2017-10-13 11:01:06 -07:00
ralcini
1460aa3433 fix for https://github.com/esnet/iperf/issues/650 (#651)
Reset authentication token between tests.  Fixes #650.
2017-10-11 14:03:57 -07:00
Bruce A. Mah
b5640ac6c2 Clear TOS value when resetting test parameters. (#647)
This addresses a problem where the --tos parameter would incorrectly
"stick" on the server, causing wrong TOS values to be inserted into
packets during --reverse tests.  Fixes #639.
2017-10-11 12:10:11 -07:00
Bruce A. Mah
720a0a3e63 Allow the client to pass a duration of 0 to the server. (#648)
Seems to fix #645.
2017-10-11 11:05:55 -07:00
Bruce A. Mah
25f5947512 Fix a problem formatting very large numbers. (#642)
Avoid walking off the end of an array when trying to format a number larger than 1000T.

Motivated by #641, as reported by @shingchuang, but slightly
reimplemented.
2017-10-04 10:15:19 -07:00
Malte
b2900fd710 Delete outdated comment
This comment became outdated with cba8584b2
2017-10-04 02:09:30 +02:00
Bruce A. Mah
ca954c7668
Reverse the order of tests for better legibility and logical sense.
Suggested by @pprindeville.
2017-09-19 09:14:24 -07:00
Bruce A. Mah
d6a6751746
Two fixes for a warning for possibly-too-large UDP packets.
1.  Make sure we have a valid TCP MSS on the path when comparing
the UDP block size.

2.  Fix a redundant "warning".

This should fix a bug observed on Windows but not (so far) on any
UNIX-like platforms.  Fixes #608.
2017-09-18 15:17:18 -07:00
Bruce A. Mah
7cf95d205d
Regen. 2017-08-14 13:46:35 -07:00
Philip Prindeville
517ad2248f Add required RSA header for OpenSSL (#622)
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-08-01 11:16:07 -07:00
Bruce A. Mah
dadbd25838
Fix spelling mistake in manpage.
Fixes #610, pointed out by @borenius-dfn-de.
2017-07-17 08:22:45 -07:00
Bruce A. Mah
4f3a7a5403
Greatly expand description section.
Based on text by @eriitguy, fixes #480.
2017-06-20 15:04:30 -07:00
p0intR
946a5a0f15 Close ctrl_sck iperf_client_end() (#597)
This avoids a leak of file descriptors.
2017-06-12 09:42:21 -07:00
Bruce A. Mah
b0aff8490a Fix a few printf format string warnings seen on macOS / clang. (#593) 2017-06-05 10:57:07 -07:00
Bruce A. Mah
b5597278b5 Towards issue #278. Don't print small, dataless last intervals. (#592)
This is mostly a cosmetic fix...due to timing differences or
interference from data packets, it is possible that the server
will have a very small last measurement window, possibly with
no data transferred.  This looks odd (although it's not incorrect)
and we'd like to eliminate these.  If there's an interval
(presumably it'd be the last measurement interval) less than
10% of the length of a standard measurement/reporting interval,
and there are no bytes transferred in the interval, then suppress
printing the results and don't add them to the grand total.
2017-06-05 10:38:36 -07:00
Bruce A. Mah
7f06146221 Fix out-of-order / loss counting issues with UDP (#457) (#589)
* Towards issue #457.  Try to not count the sequence number
gaps resulting from out-of-order packets as actual losses.

* Put all of the UDP diagnostic output behind the --debug flag.
2017-06-02 09:35:19 -07:00
Bruce A. Mah
c458a115b7 Fix -F problems (#588)
Attempt to fix some brokenness in -F from #301.

In some work related to #125, we introduced a bug in which
chunks of a file being read for the -F option were not
completely sent, particularly with TCP sockets.  We attempt
to fix this by detecting cases in which not all data passed
to a socket could be actually sent (for example due to full
socket buffers) and preserving that data for future send
iterations.

The ending statistics in the "diskfile" JSON structure were
wrong, and did not properly distinguish between sender-side
and receiver-side statistics.  This has been fixed (at least
for the client side).

Specifically mention in the manpage that "iperf -F" is not
a file transfer tool.
2017-05-30 14:15:28 -07:00
Kenneth Wong
acb4c4c9d5 Improve C++ compatibilty (#587)
Improve the compatibility of iperf_api.h with C++ so that libiperf can more easily be used with C++ programs.

This involves function declarations as extern "C" and inclusion of a couple of more headers (which arguably improves the C use case).
2017-05-30 13:30:08 -07:00
Bruce A. Mah
39de1e0f27
Merge branch 'master' of github.com:esnet/iperf 2017-05-24 11:08:37 -07:00
Bruce A. Mah
3410d58fdc
Silence a warning for an unused variable. 2017-05-24 11:08:15 -07:00
Bruce A. Mah
0f081b7b2e Issue 583 (#586)
* s/bandwidth/bitrate/ in user-facing places.  Towards #583.

iperf3 has long misused terminology; bandwidth is a measure of
capacity.  iperf3 measures bitrate or throughput.  We standardize
on "bitrate" because it begins with the same letter as "bandwidth"
(to match the -b command-line option).

User-facing output mentioning "bandwidth" now uses "bitrate".
The long command-line option for -b (--bandwidth) is now --bitrate
(--bandwidth is transparently accepted for backward compatibility).
A few places in documentation that talk about bandwidth as a
measured value have been reworded to use bitrate or throughput.

There are a number of places in code where variables are still
called "bandwidth".  We leave these alone for now.

A mention of "bandwidth" in the test parameters JSON also needs
to remain unchanged to avoid breaking compatibility.  However,
the test results JSON never used the term "bandwidth" in
the first place.

* s/bandwidth/throughput in one place in RPM description.  Towards #583.
2017-05-24 10:50:44 -07:00
Bruce A. Mah
7a15a7ae85 Fix another compiler warning. 2017-05-23 13:05:09 -07:00
Bruce A. Mah
dc74346f26
Fix compiler warning with clang. 2017-05-23 12:52:16 -07:00
Sami Farin
e7ab564cb5 Return random ascii-string in make_cookie. (#582)
Having hostname and microsecond timestamp in the cookie is not
necessary.  Also fill test buffer with data from /dev/urandom
instead of using random().
2017-05-21 11:30:18 -07:00
Bruce A. Mah
2541b86174
Bump manpage date. 2017-05-18 16:39:55 -07:00
Brian Tierney
0c4d5992fd clarified a couple options 2017-05-18 11:43:50 -07:00
Bruce A. Mah
9d7d60aca1 Issue 216 (#581)
* Add configurable timeout for the setup of the control connection.
This is specified using the new --connect-timeout option, with an
integer parameter in ms.  The iperf3 client will wait for this
amount of time for the setup of the control connection to the
server.  If this option is not given, the OS default for TCP
connection setup is used.  Specifying a smaller connection timeout
allows faster detection of a down / unresponsive iperf3 server.

The implementation uses a variation on the timeout_connect()
function from OpenBSD's netcat utility.

Fixes #216.
2017-05-17 12:50:50 -07:00
Bruce A. Mah
52375c105a Grab TCP PMTU during tests (on Linux only). Towards #569. (#578) 2017-05-12 13:42:50 -07:00
Bruce A. Mah
d54d49c0ac
Don't free memory in uninitialized structures
Also, tighten up the scope/lifetime of some memory structures.

Inspired by #577.
2017-05-12 09:12:48 -07:00
Bruce A. Mah
35ec9e545a Bunch of reporting fixes found while investigating bug #236. (#575)
For the case of multiple TCP streams, compute the grand total
summaries using the appropriate times for the sender and receiver
ends.

Add some divide-by-zero checks.

On the server side, only print the side of the grand total lines
where we have data.  (This follows the behavior of the other
end-of-test output lines.)

Fix a minor (compared to all the other problems) bug with
UDP output printing the wrong ending timestamp.
2017-05-11 14:12:16 -07:00
Bruce A. Mah
8f0d9c47ec
Print the cJSON version in our version info. 2017-05-11 12:31:22 -07:00
Bruce A. Mah
c71712875a Fix NaN in summaries with a client talking to an iperf 3.1/3.0 server.
Recent code changes require the server to send the start and end
timestamps for a test, so that the client can accurately compute
statistics for the sender side of a test.  iperf 3.1 and 3.0
servers won't do this, so if this information isn't passed back
in the results at the end of a test, we fall back to using the
client's timestamps.  The results might not match what's displayed
on the server, but this is basically what iperf 3.1 and earlier
did anyway.

Fixes #574.
2017-05-11 11:40:14 -07:00
Bruce A. Mah
cab5dba86c Import cjson 1.5.2 (#573)
* Import source files for cJSON 1.5.2.

* Portability and 64-bit changes for cJSON.
2017-05-11 10:17:34 -07:00
Bruce A. Mah
e255a12eb9 Fix problems in human-readable UDP output
Keep track of UDP packets sent/received and use appropriately.

We were using the number of UDP packets seen on the server
(regardless of whether it was the sender or receiver) for
computing loss percentages, etc.  This caused confusion in the
case that the last UDP packet doesn't make it to the server
before the test finishes (or if a packet gets lost), because
the client and server had different ideas of how many packets were
sent (OK) and we used the wrong number when computing statistics.

This fix changes the human-readable output to make more sense.
It doesn't change the JSON output.  That needs some more review.
I'm reluctant to make structural changes to the JSON output,
because other programs rely on that format.

We also need to investigate whether the last UDP packet can be
still in flight when the test ends (per hypothesis), and if so
what we should do about this.

We apply similar fixes for human-readable summaries for multi-stream UDP tests.

The fixes are similar to those already done for the stream
summary statistics, but these cover a type of output that's only
done if there is more than one stream.

Adjust the JSON computations / output to do a better job of figuring
out the total number of packets sent.

We really need to disentangle the computation and output formatting,
these two operations shouldn't be mixed together like this.

Fixes #252.
2017-05-09 14:29:22 -07:00
Bruce A. Mah
37d913dfcc Improve error handling and documentation for -f/--format. (#568)
We now reject all invalid format characters given as the
argument to the -f/--format flag.  All valid characters are now
documented in the usage message and manual page.

Towards #566.
2017-05-08 10:01:15 -07:00
Bruce A. Mah
67653543ad
Improve / fix comments regarding UDP jitter calculation.
Internal documentation fix only, no functional change.
2017-05-05 08:59:13 -07:00
Bruce A. Mah
103d4318e8 Fix a heap corruption issue leading to a server-side crash. (#564)
Commit 5ab2132c (PR #551) fixed, among other things, a memory
leak.  The solution, however, causes a hazard where a free() of
an invalid pointer can corrupt the heap.  We've observed this
fairly repeatably while running the test_commands.sh script on
CentOS 7.

To remedy this, we NULL out a pointer after the object it
pointed to has been free-d, just like a number of other similar
objects.
2017-05-04 14:16:42 -07:00
Bruce A. Mah
5abc5f29b7
IRIX 6.5 compatibility, via a patch from @canavan in #368.
Not independently tested.
2017-05-04 09:03:43 -07:00
Bruce A. Mah
cba8584b2d Pacing timer (#563)
* Add --pacing-timer option to allow tuning of -b timers.
These control the granularity of the timer and hence burstiness
of iperf3's sends.  The default is 1ms (1000), which is the default
starting with iperf 3.2.  Follow-on to the commit in #460.

* Update manpage and release notes for --pacing-timer.
2017-05-03 16:18:32 -07:00
Bruce A. Mah
e73821cd03 Normalize socket buffer debugging output, put socket buffer sizes in JSON.
These values show up in the start structure as sock_bufsize (requested
size), sndbuf_actual (actual SO_SNDBUF value) and rcvbuf_actual (actual
SO_RCVBUF value).  These values are available for both TCP and UDP.
Both client and server emit these values in their JSON output for their
respective sides, but don't exchange them.

Towards #558.
2017-05-03 14:03:22 -07:00
Bruce A. Mah
246c1bcacd Remove some dead code. 2017-05-03 12:25:32 -07:00
Bruce A. Mah
10e2cc241e Fix various problems with summary statistics (#562)
* Untangle some problems with printing summary statistics.

There were (at least) two problems:

o The server cannot print summary statistics as seen from the
client, because the server has to generate its summaries
before receiving any statistics from the client.  This
shortcoming is somewhat hard-coded into the semantics of
messages on the control channel, and probably can't be easily
changed.

o UDP summary statistics for each stream were ambiguous in that
it wasn't clear whether they were intended to apply to the
sender or receiver.

To fix this, we split UDP summary statistics into two lines,
one for the sender side and one for the receiver side.  This
hopefully eliminates any ambiguity about the statistics.  On the
server, we don't attempt to print the (not very meaningful and
potentially misleading) statistics corresponding to the client.

Possible fix for #560.

* Try to report more accurate ending statistics.

Basically the client side was using only its measured test duration
to compute figures such as bitrate, but the server's test duration
could be different due to network delays/jitter.  So we make sure
that the test durations (for each stream) are passed in the test
results and used appropriately when we print statistics for the
sender and receiver.

Towards #560, also this could help towards #238.

* Silence a warning over an uninitialized variable.
2017-05-03 10:21:34 -07:00
Bruce A. Mah
c8531ca31f
Fix possible integer overflow in tera prefix conversions.
Follow-on commit for #402, possible fix for #561.
2017-05-02 10:21:59 -07:00
Bruce A. Mah
65ed04deb5
Fix bug introduced in 03224c9 where we fail on default UDP blocksize.
Fixes #559, follow up to #390..
2017-05-01 09:14:21 -07:00
Bruce A. Mah
7f996b5e98 Print TOS byte value.
It's at the start of the test output for human-readable output, and in
the test_start object in the JSON.

Fixes #226.
2017-04-27 12:47:03 -07:00
Bruce A. Mah
9c033cbf68 Do sanity checks on -w argument as floating point to avoid integer
overflows.  There might be some other places where this applies,
but this commit at least fixes the observed bug.  Fixes #557.
2017-04-27 11:35:56 -07:00
Gabriel Ganne
d1c64c8a36 fix invalid sizeof on pointer instead of type (#556)
This is only a coherency fix since sizeof(char*) >> sizeof(char)
There should be no functional nor stability impact whatsoever
2017-04-26 10:08:53 -07:00
Bruce A. Mah
b9478db947
Fix a problem when getting snd_cwnd on FreeBSD.
On FreeBSD, unlike Linux (and NetBSD?) snd_cwnd is expressed in
octets instead of segments.  Hilarity ensued when we erroneously
multiplied by snd_mss and integer overflows occureed.

Possible fix for #465, #475, #338.  Testing from FreeBSD users
appreciated.
2017-04-22 07:56:31 -07:00
Bruce A. Mah
89e97f05e0
Manpage fixups. Follow-up to #517. 2017-04-20 17:48:22 -07:00
Bruce A. Mah
4dfe721b10
Merge branch 'master' of git://github.com/dmdailey/iperf into dmdailey-master 2017-04-20 14:13:33 -07:00
Gabriel Ganne
5ab2132ce3 warning fixes (#551)
* fix Wstrict-prototypes warnings found by clang

also fix usage_long() call

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>

* fix Wunreachable-code-break warnings found by clang

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>

* fix Wshadow warnings found by clang

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>

* fix Wmissing-noreturn warning found by clang

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>

* ix memory leak found by clang

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>

* fix Wmisleading-indentation warnings raised by gcc-6

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>

* fix warning: Value stored to 'ptr' during its initialization is never read found by clang

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>

* fix warning: The left operand of '>' is a garbage value found by clang

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>

* fix memory leak in global cleanup

Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-04-20 13:33:15 -07:00
Bruce A. Mah
5e52a8460b
Regen. 2017-04-20 12:38:18 -07:00
Bruce A. Mah
02d411cb02
Fix some help text. Add authentication as a feature in --version.
Follow-up to #517.
2017-04-20 12:26:39 -07:00
asavah
ac2604dda8 fix missing source files in src/Makefile.am (#554)
Follow-up fix for #517.
2017-04-20 12:09:44 -07:00
ralcini
a51045de19 Service Authentication (#517)
Add an optional mode that requires clients to authenticate with the server.

In this mode, clients need to provide a username and a password, which are checked against a password file on the server.  The authentication credentials are protected by an RSA public keypair...the encrypted credentials are sent along with the test parameters.

Operationally the use of this feature places the following additional requirements on the build and installation of iperf3:

o The presence of the OpenSSL headers and libraries to build iperf3, and the libraries available on the client and server at runtime.

o Generation of an RSA public keypair; the private part is used by the server and the public part must be distributed to the clients.

o Username/password pairs for all authorized users, to be stored in a file on the server.

o Loose time synchronization between the server and clients (to within approximately 30 seconds).

o Appropriate command-line flags given on the client and server.

Note that iperf3 can be built and run as before, without fulfilling any of these requirements.

Partial documentation for this feature is included in this commit.  It is anticipated that additional documentation text and editing will follow this merge.

Submitted by @ralcini.  First suggested by @codyhanson in pull request #242.
2017-04-20 10:01:08 -07:00
Bruce A. Mah
05600c201a
Minor follow-ups to #508.
Change the internal command-line option code for --dscp from the literal
'5' to a constant defined as OPT_DSCP.

Add manpage text for --dscp option.

Tweak help text for --dscp (while here, fix problem in --tos text).
2017-04-14 13:44:32 -07:00
Bruce A. Mah
a68712c7a8
Regen, follow up to #508. 2017-04-14 13:29:25 -07:00
Dave Täht
97c95c3be2 add support for specifying --dscp symbolically and numerically (#508)
Using a command line adding dscp (instead of tos) you can:

--dscp EF,CS1,etc.
--dscp 0x08
--dscp 63

These will provide the correct shifted left 2 tos value for these, and
for people that think in terms of dscp values, this is a goodness.

Having this option available lets an enduser clearly distinguish between
an old version of iperf with a non-working --tos facility, vs a
version where it works, with something saner that lets just specify
the dscp.

I did not come up with a good -? option for it, and used -5 internally.
2017-04-14 13:27:18 -07:00
Bruce A. Mah
e9e2d6d19c
Add support for tera- prefix [Tt] in input and output.
Also add some more unit tests for this and prune unused code
from unit test program.

Fixes #402.
2017-04-14 13:14:44 -07:00
Bruce A. Mah
d51501ef83
Make explicitly requested usage output (--help) go to stdout.
Also in this case make the process exit code 0.

Fixes #405.
2017-04-14 12:45:24 -07:00
Bruce A. Mah
b07ed14dae
Be more explicit about the direction of data during tests.
Documentation change only, no functional change.
Fixes #384.
2017-04-14 12:36:47 -07:00
Bruce A. Mah
08758a16d2 More gracefully handle the case where a congestion control
algorithm isn't available on the server.  This can happen
if the client and server machines have different sets of
congestion control algorithms loaded in kernel modules, etc.
If the requested algorithm isn't available on the server, then
print a warning on the server side, but otherwise continue to
run the test.

Towards #549.
2017-04-11 15:11:17 -07:00
Bruce A. Mah
6f414a0408
Ignore SIGPIPE signals to simplify error handling.
This is an attempt to avoid server-side crashes/exits when the
client abruptly closes its control connection, as found in some
testing for #549.

Fixes #550.
2017-04-11 15:06:01 -07:00
Bruce A. Mah
03224c9f56 Prevent specifying a UDP send size that's too small.
We need at least 16 bytes to hold counters and timestamps.
Avoids a problem noted in issue #390.
2017-04-11 09:43:41 -07:00
Tran Viet Hoang
5d14d10697 add tcp rttvar to stream info (#534)
Fixes #525.
2017-03-30 16:29:16 -07:00
Bruce A. Mah
8066a1d222
Fix divide-by-zero / weird output with -F and a zero-length file.
Fixes #361.
2017-03-30 15:33:20 -07:00
f1rebird
a8ee9c650b Fix header includes and build failures on musl (#518)
* Include stdint.h in files where its types are used

Signed-off-by: Moritz Kick <f1rebird@users.noreply.github.com>

* Fix type of len parameter passed to getsockopt

getsockopt expects socklen_t instead of int as its fifth argument

Signed-off-by: Moritz Kick <f1rebird@users.noreply.github.com>

* Remove unnecassary includes of netinet/tcp.h

also cleanup the second include of stdint.h in main.c

This commit fixes #331 and is a replacement for #344.

Signed-off-by: Moritz Kick <f1rebird@users.noreply.github.com>
2017-03-22 12:00:08 -07:00
Bruce A. Mah
b3828fed23
Change "iperf" to "iperf3" in usage strings. Fixes #529. 2017-03-17 07:59:15 -07:00
ShaunCurrier
9f28b247ba Remove unused hstrerror(), bad nanosleep() message in configure.ac (#503) (#523)
* Remove unused hstrerror(), bad nanosleep() message in configure.ac (#503)

* Remove dead code involving h_errno and hstrerror()

h_errno was formerly set as a side effect of a failed
gethostbyname(3) call, but this function has been
deprecated.
2017-03-13 09:36:45 -07:00
Bruce A. Mah
f46e2e3edc Prevent two recently added messages from spamming JSON output on UDP tests.
Stumbled on by:	@daldoyle
2017-02-02 09:23:29 -08:00
Bruce A. Mah
7c79294b5b
Fix a bug where specifying --title leaked into server JSON in future runs.
Fixes #500, based on pull request in #501 submitted by @slankes.
2017-01-25 14:42:15 -08:00
Bruce A. Mah
de3e9d49b6 Revert "Fail gracefully if --fq-rate or --no-fq-socket-pacing are specified on"
This reverts commit 9c83a707eb.

Fixes #504.
2017-01-25 13:53:49 -08:00
Bruce A. Mah
1ff12f4c3e Add 1KB to default UDP socket buffer sizes under certain circumstances.
This fixes a problem observed on FreeBSD and macOS where the MTU on
the loopback interface is larger than the default socket buffer size.
We adjusted the socket buffer size upwards to match the UDP payload
size, but that's apparently not enough and we ended up dropping packets.
This is bad.  Add a 1KB fudge factor, which seesm to avoid this problem.
Affects UDP tests only, not TCP or SCTP.

Part of #496.

(cherry picked from commit d76198944d210e8a575747d3ddbee41a886a10c9)
Signed-off-by: Bruce A. Mah <bmah@es.net>
2017-01-11 11:52:18 -08:00
Bruce A. Mah
0fd60a3686 Issue 496 (#498)
* Dynamically determine an appropriate default UDP send size.

We use the TCP MSS for the control connection as the default UDP
sending length, if the --length parameter is not specified for a
UDP test.  This computation replaces the former hard-coded 8K
default, which was way too large for non-jumbo-frame Ethernet
networks.

The concept for this solution was adapted from nuttcp.  The
iperf3 implementation is pretty easy since we already were
getting the MSS for the control connection anyway (although we
needed to get it slightly earlier in the setup process to be
useful).

Towards issue #496.

While here, s/int/socklen_t/ in one place to fix a compile warning,
and bump a few copyright dates.

* Warn if doing a UDP test and the socket buffer isn't big enough.

This is surprisingly an issue on FreeBSD and macOS, where the MTU
over the loopback interface is actually larger than the default
UDP socket buffer size.  In these cases, doing a UDP test over the
loopback interface (with the new UDP defaults) will fail unless a
smaller --length or a larger --window size is set explicitly.

Linux has larger UDP socket buffers by default (much larger than the
largest possible MTU), but even in the case that the socket buffers
are too small to hold an MTU-sized send, the kernel seems to do the
send correctly anyway.

Still working towards a good solution for issue #496.

* Further refinement on UDP buffer size settings.

If the default buffer size on a UDP test can't hold a packet,
then increase the buffer size to be large enough to hold one
packet payload.  (If the buffer size was explicitly set, but too
small to hold a packet payload, then warn but don't change the
buffer size.)

Minor code refactoring to...factor out some common code into
a new iperf_udp_buffercheck() function.

Still working towards issue #496.
2017-01-10 09:13:57 -08:00
Bruce A. Mah
9c83a707eb
Fail gracefully if --fq-rate or --no-fq-socket-pacing are specified on
platforms where they aren't supported.

Requested by:	@bltierney
2016-12-14 09:32:46 -08:00
Bruce A. Mah
a094d9feef Separate out application-level and fair-queueing-based pacing (#488)
* First try to fix pacing issues.  Code compiles, lightly run-tested.

Make --bandwidth only control application-level pacing, refecting
behavior of iperf 3.1.2 and earlier.

Add a new --fq-rate that controls only FQ-based per-socket pacing.
A given test can use application-level pacing, FQ pacing, both,
or neither.

Deprecate the --no-fq-socket-pacing option; specifying this generates
a warning and is equivalent to --fq-rate=0.

Towards issue #467 and related to issue #325.

* Move --fq-rate in the help text to be just below --b, tweak wording.

* Sigh.  One more tweak on help text.

Some day I probably need to review and rewrite the whole thing.

Still working towards #467.
2016-12-12 13:47:53 -08:00
Bruce A. Mah
7d2d5c41dd
Revert "Fix a bug in FQ pacing, where application pacing wasn't completely disabled."
This reverts commit 1fa41308fe.

This doesn't really do what we want.  Start over.
2016-12-08 15:25:06 -08:00
Bruce A. Mah
5307eae461
Revert "Reduce the default UDP send size to 1452 to avoid IP fragmentation"
This reverts commit f1e62c8d48.

Right idea, but it turns out to be a pretty high-impact change.
Need to rethink this, maybe with a more intelligent implementation
that checks the interface (or path?) MTU.
2016-12-08 15:23:51 -08:00
Bruce A. Mah
f1e62c8d48
Reduce the default UDP send size to 1452 to avoid IP fragmentation
with default parameters.

A UDP payload of 1452, plus an 8-byte UDP header, plus a 40-byte IPv6
header, results in a 1500 byte IP packet.  The IPv4 header is smaller
at 20 bytes.
2016-12-05 14:00:15 -08:00
Bruce A. Mah
1fa41308fe
Fix a bug in FQ pacing, where application pacing wasn't completely disabled.
It was therefore possible to have multiple levels of pacing happening,
which resulted in very nicely smoothed traffic, but wasn't really
the original design.

Do pacing correctly in iperf_check_throttle() and remove a hack in
iperf_send() where we were explicitly checking for the type of
pacing, but didn't really need to.

It turns out that with UDP and only-FQ pacing, iperf3 sends and throws
packets on the floor as fast as it can.  This isn't really desirable,
and probably not what was wanted in a test anyway, so if we're not
doing TCP tests, force the use of application-level pacing.
2016-12-05 10:37:56 -08:00
Bruce A. Mah
55598a072f
Fix socket buffer size checks. Clearly this wasn't tested well.
On Linux it's possible to set the socket buffer to one size but
(correctly it seems) get back some larger size up to 2x what you
asked for (see tcp(7)).

While here, make related debugging output more useful.

Fixes (again) #356.
2016-12-01 11:53:37 -08:00
Bruce A. Mah
a621cc263f
Improve debug output for application and fair-queue-based pacing. 2016-11-30 07:13:28 -08:00
Bruce A. Mah
d2202ee3be
After setting socket buffer sizes, verify they were set correctly.
Do this for both TCP and UDP, but not SCTP (which strangely doesn't
support --window, that's probably a bug).  Fixes #356.
2016-11-23 11:05:47 -08:00
Bruce A. Mah
6aff679e96
Fix executable name and date in the manpage heading. 2016-11-10 13:49:44 -08:00
Nevo Hed
ad2a706fd1 Replace iprintf w/ iperf_printf (cygwin conflict) (#468)
This does not seek to address all cygwin portability issues
just this specific compile-time conflict

See also #280 and #295.
See https://github.com/esnet/iperf/issues/280
2016-10-17 13:25:07 -07:00
Bruce A. Mah
d99a69f92b
Fix a buffer overflow in upstream cJSON.
This is DaveGamble/cJSON#30, and fixes issue #466.
2016-10-05 13:59:40 -07:00
Bruce A. Mah
1a756a949e Only print congestion control algorithm for a TCP test.
Properly (I think) label the two TCP instsances as "sender"
and "receiver".
2016-09-22 15:27:24 -07:00
Bruce A. Mah
7d413a5015 Fix build on FreeBSD. 2016-09-22 14:52:57 -07:00
Bruce A. Mah
7eeaa1cb07 First try at issue #461.
First, realize that we've been setting the congestion control (CC)
algorithm unnecessarily; rather than doing it for all listening or
connecting sockets, do it just for those sockets that are being used
for TCP test streams.

Record the CC algorithm in use (this handles the case where a CC algorithm
hasn't been specified), and have the client and server exchange this
information.

Report the CC algorithms that were used (note that it's theoretically
possible for the two ends of the test to be using different algorithms,
if no algorithm was explicitly specified and the two end hosts have
different defaults, or if one side allows setting the CC algorithm and
the other doesn't).

Committing to a branch to make it easier to test this code on a
wider combination of systems.
2016-09-22 13:34:52 -07:00
Bruce A. Mah
353615b772
Fix divide-by-zero problem that can occur with a zero-length interval
(this can happen at the end of a test under certain circumstances).
Fixes #388, alternate solution from pull request in #389.
2016-09-21 13:22:54 -07:00
Bruce A. Mah
03340fe595
Prevent a double-close on the server side in some cases.
Alternate solution to a problem pointed out by @g-coder in pull request #429.
2016-09-21 11:25:18 -07:00
woody77
93c498d417 Change pacing timer from 100ms to 1ms to smoothen out microbusts as much as possible (#460) 2016-09-21 10:31:48 -07:00
woody77
14caac895c Properly setting the no_fq_socket_pacing option when support for it is not compiled in. (#459) 2016-09-21 10:21:59 -07:00
dmdailey
f7fd67d4a2 Update iperf_server_api.c
When a test in in progress and the client completely disappears, both the control socket and the stream sockets are left around forever.  Patch modified from another patch submitted by mkall to add closing of the data stream sockets.
2016-08-05 16:41:52 -04:00
Bruce A. Mah
b7ab2b4b25
Make the server more tolerant of most types of errors encountered
during tests.

We used to exit if 5 consecutive errors were encountered.  Instead,
only exit if certain types of fatal errors happen.
2016-06-03 09:26:05 -07:00
Bruce A. Mah
4dcb275b5b
Make error handling on the control channel more robust. 2016-06-03 09:25:14 -07:00
Bruce A. Mah
ed94082be2
Fix a buffer overflow / heap corruption issue that could occur if a
malformed JSON string was passed on the control channel.  This issue,
present in the cJSON library, was already fixed upstream, so was
addressed here in iperf3 by importing a newer version of cJSON (plus
local ESnet modifications).

Discovered and reported by Dave McDaniel, Cisco Talos.

Based on a patch by @dopheide-esnet, with input from @DaveGamble.

Cross-references:  TALOS-CAN-0164, ESNET-SECADV-2016-0001,
CVE-2016-4303
2016-06-03 09:23:59 -07:00
Bruce A. Mah
a5f5765c8c
Regen. 2016-05-26 09:49:16 -07:00
Bruce A. Mah
9915746a8b
Squashed commit of the following:
commit 2dc03630a736be2ae9f64823aabb5776e7074c2a
Merge: 61e325c 0da552c
Author: Bruce A. Mah <bmah@es.net>
Date:   Thu May 26 09:40:58 2016 -0700

    Merge branch 'master' into issue-325

commit 61e325c5d0a4e7a9823221ce507db0f478fc98b5
Merge: 227992f ccbcee6
Author: Bruce A. Mah <bmah@es.net>
Date:   Thu May 26 11:09:54 2016 -0400

    Merge branch 'issue-325' of github.com:esnet/iperf into issue-325

    Conflicts:
    	src/iperf3.1

commit 227992f366e7f4895b6762011576ba22a42a752e
Author: Bruce A. Mah <bmah@es.net>
Date:   Thu May 26 11:07:01 2016 -0400

    Don't set SO_MAX_PACING_RATE if the rate is 0.  Also tweak some help text.

    Towards #325, in response to feedback from @bltierney.

commit ccbcee6366d50ec632fc00eb11fde8a886f8febe
Author: Bruce A. Mah <bmah@es.net>
Date:   Tue May 24 09:19:41 2016 -0700

    Fix manpage formatting for consistency.

commit 90ac5a9ce09bd746ca5f943a8226ab864da3ebf8
Author: Bruce A. Mah <bmah@es.net>
Date:   Tue May 24 12:14:16 2016 -0400

    Add some documentation for fair-queueing per-socket pacing.

    For #325.

commit 5571059870f7aefefb574816de70b6406848888f
Author: Bruce A. Mah <bmah@es.net>
Date:   Tue May 24 11:55:44 2016 -0400

    Change the fair-queueing socket pacing logic in response to feedback.

    By default, on platforms where per-socket pacing is available, it
    will be used.  If not available, iperf3 will fall back to application-
    level pacing.

    The --no-fq-socket-pacing option can be used to forcibly disable
    fair-queueing per-socket pacing.  (The earlier --socket-pacing option
    has been removed.)

    Tested on CentOS 7, more testing on other platforms is required to
    be sure it didn't break the old application-level pacing behavior.

    For #325.

commit 3e3f506fe9f375a5771c9e3ddfe8677c1a7146e7
Merge: 50a379e 3b23112
Author: Bruce A. Mah <bmah@es.net>
Date:   Tue May 24 09:54:39 2016 -0400

    Merge branch 'master' into issue-325

commit 50a379eddfa89d1313d2aeeb62a6fbc82f00ea17
Author: Bruce A. Mah <bmah@es.net>
Date:   Sat Apr 16 02:55:42 2016 -0400

    Regen.

commit 200d3fe3917b3d298bdf52a0bde32c47cf2727b0
Author: Bruce A. Mah <bmah@es.net>
Date:   Sat Apr 16 02:41:32 2016 -0400

    Checkpoint for initial work on #325 to add socket pacing.

    This works only on Linux and depends on the availability of
    the SO_MAX_PACING_RATE socket option and the fq queue discipline.
    Use --socket-pacing to use SO_MAX_PACING_RATE instead of the
    default iperf3 user-level rate limiting; in either case, the
    --bandwidth parameter controls the desired rate.

    Lightly tested with both --tcp and --udp, normal and --reverse.
    Real testing requires analysis of packet timestamps between
    multiple hosts.
2016-05-26 09:47:48 -07:00
g-coder
0da552c390 Safe programming practice. Added va_end. (#425)
In file iperf_util.c:
Function 'va_start' is called at line:327. But, 'va_end' is not called before returning from function 'iperf_json_printf()' at line:352 and line:355. 
The va_end performs cleanup for the argp object initialized by a call to va_start. If va_end is not called before a function that calls va_start returns, the behavior is undefined.

Applied Fix: added va_end before returning from the function.
2016-05-26 09:06:16 -07:00
g-coder
8fcfc2479f DEREF_AFTER_NULL in src/iperf_error.c (#423)
DEREF_AFTER_NULL: pointer ‘test’ at line:77 is passed as an argument to function iperf_delete_pidfile(), in which it is dereferenced at iperf_api.c:2832.
Pointer ‘test’ can be NULL and dereferencing a NULL pointer causes seg-fault.

Applied Fix: pointer ‘test’ is checked for NULL before passing it to function iperf_delete_pidfile().
2016-05-26 08:47:29 -07:00
Joe McEachern
3b2311263a Add fix for #412 (#414)
* Add fix for #412
This prevents negative loss counters with UDP when omit is used

* Track the original start time and bytes omitted. This allows the
throttle function to work after the omit timer fires. This is
a fix for issue #419.

* Remove changes to switch the bandwidth to received instead of sent bandwidth

* Roll back bandwidth sent vs received changes
2016-05-20 11:40:18 -07:00
Bruce A. Mah
f88486443c
Fix build on FreeBSD 11-CURRENT, as described in issue #413.
This caused by a combination of the iperf3 build somehow using
the system queue.h on FreeBSD 11 (possibly only on this platform)
and TAILQ_END not being defined in the system queue.h.

Expanding the TAILQ_END macro to NULL seems to solve the problem.

Submitted by:	@rbgarga
2016-05-20 10:05:24 -07:00
QuaSoft
08a2de459b Add command line option --forceflush to allow user to request flushing of output at the end of each interval.
Fixes #299
2016-03-06 16:47:02 +02:00
Bruce A. Mah
670c18584b
Get rid of nan values when there were no packets in a UDP interval.
This was causing some headaches for code trying to parse JSON.
Also revise a prior partial fix that hard-coded 100% loss for the
case of zero packets.

Partially fixes #278.

Merge candidate for 3.0 and 3.1 bugfix branches.
2016-01-28 16:04:33 -08:00
Bruce A. Mah
224ae8c764
Fix a bug where we printed the incorrect value for out-of-order UDP packets.
Fixes #329, submitted by @bhegardt.

While here, add this value to the JSON output.
2015-11-20 08:31:09 -08:00
Bruce A. Mah
956d115851 Improve command error handling.
Exit with non-zero exit code if server mode has too many errors.

Properly detect complain about non-numeric arguments to -A, -L, and -S.

Implement range checks for argument to -S.

Fixes #316.
2015-11-18 09:40:24 -08:00
Bruce A. Mah
44485b5b88
Fix a bug where the -T title option was not being output correctly
in JSON output.

Fixes #292.

Patch from:	@SLX-WI
2015-11-17 10:47:47 -08:00
Bruce A. Mah
6e48bb2a5d
Markup fixes in manpages for Debian compatibility.
Fixes #291.

Merge candidate for 3.1 stable release if applicable.
2015-11-16 12:00:36 -08:00
Bruce A. Mah
7b2abbc59a
Rename the recently-added template member in the iperf_test structure
to improve C++ compatibility.

Fixes #323.
2015-11-16 11:22:15 -08:00
Bruce A. Mah
8774140404 Bump version numbers and dates for iperf 3.1. 2015-10-16 10:00:30 -07:00
Tobias Nießen
20585b9896 Fix bug in iperf_new_stream leading to EINVAL
Fix invocation of snprintf in iperf_new_stream to prevent mkstemp from producing EINVAL.
2015-10-11 15:58:52 +02:00
Bruce A. Mah
ee306250d7 Merge pull request #288 from yeahdongcn/master
Add tmp_path in order to make the template path workable on iOS.
2015-10-07 13:05:32 -07:00
R0CKSTAR
9a3775091b Change tmp_path to template and use snprintf instead of strcpy 2015-09-21 11:07:41 +08:00
Matthieu Coudron
eb3faee64f Fixes a smashing stack problem as described in https://bugzilla.kernel.org/show_bug.cgi?id=104601 2015-09-19 14:08:47 +02:00
R0CKSTAR
7baf44a8b9 Missing one file 2015-08-03 09:40:53 +08:00
R0CKSTAR
01b82c9e3c Add tmp_path in order to make the template path workable on iOS. 2015-08-03 00:01:02 +08:00
Bruce A. Mah
883a465a72
Fix tarball generation (it was missing a file) and regen build goop.
Found by:	@arlake228
2015-06-30 13:19:38 -07:00
Bruce A. Mah
b6a2021c0b
Bump version number and manpage rev dates for 3.1b1. 2015-06-19 11:27:16 -07:00
Eduardo Abinader
1c89715936 iflush for interval results
In order to keep the same behavior of stdout, iflush the results
to files as they are printed.
2015-06-06 10:44:32 -04:00
Bruce A. Mah
25eb62c7cd Handle the case where EAGAIN != EWOULDBLOCK
Fixes #268, suggested by @tvastri.
2015-05-21 10:31:17 -07:00
Bruce A. Mah
7be67e1d2c
Fix a potential syntax error if PACKAGE_BUGREPORT is undefined.
Fixes #269, solution suggested by @tvastri.
2015-05-21 09:58:41 -07:00
Bruce A. Mah
2210d55277 Merge pull request #258 from manojdelphix/master
Fix segfault in signal handler on the server if a signal arrives at the "wrong" time.

The change causes the signal handler to use a stack context whose lifetime should be valid the entire time the signal handler is active.

Fixes #257, #258.
2015-05-11 13:45:14 -07:00
Bruce A. Mah
5824381111
Make --get-server-output properly include all of the server side output.
Fixes #251, with a bug fix based on diagnosis and analysis from @nomel.
2015-05-11 10:44:06 -07:00
Bruce A. Mah
5461579d32
Regen.
This uses a newer automake, than was in use previously, although that
wasn't the main point of doing this change.
2015-05-11 10:42:44 -07:00
Manoj Joseph
9293ec2c2b 257 Segfault in the signal handler 2015-03-31 11:08:16 -07:00
Bruce A. Mah
7645027d0d Remove an extra #ifdef left behind by #248. 2015-03-13 12:59:39 -07:00
Havard Eidnes
86daf673f3 Add support for NetBSD systems which have TCP_INFO implemented. 2015-02-19 14:23:01 +01:00
Bruce A. Mah
a337b698d0 Merge pull request #247 from he32/unused-fix
Remove unused local variable.
2015-02-12 14:51:12 -08:00
Bruce A. Mah
a47aa46b05 Merge pull request #246 from he32/include-fix
Include <sys/time.h> for struct timeval definition.
2015-02-12 14:49:52 -08:00
Havard Eidnes
c95ee19c59 Fix a toupper() usage too to avoid negative signed chars. 2015-02-12 15:13:00 +01:00
Havard Eidnes
bf53fb1304 Remove unused local variable. 2015-02-12 15:07:56 +01:00
Havard Eidnes
621a152b7c Include <sys/time.h> for struct timeval definition. 2015-02-12 15:04:16 +01:00
Havard Eidnes
081ad7c08c Add casts for the two remaining tolower() uses, since
tolower() is undefined for negative character values
(except for -1).

Also simplify the existing casts for tolower() usages.
2015-02-12 14:58:54 +01:00
Bruce A. Mah
6bd4e258d0 Make the combination of -B and -P but not --cport work
The case where we should have been binding the client sockets to
ephemeral ports at a specific address for parallel tests was broken.

Fixes #239

Submitted by:  @jfitzgibbon
2015-01-14 08:40:26 -08:00
Bruce A. Mah
bf32d9de66
Regen. 2015-01-06 10:40:04 -08:00
Bruce A. Mah
3b60f09017 Unbreak (partially) SCTP on Solaris.
Solaris implements an (older?) version of the API for SCTP_MAXSEG,
which takes an integer argument rather than a struct sctp_assoc_val.
We need to test for that and handle it appropriately.  There are some
signs it doesn't even work correctly if we do this, so quietly ignore
errors that happen if the OS complains it's unsupported.

Also, Solaris doesn't support SCTP_DISABLE_FRAGMENTS even though it
defines the preprocessor symbol for this.  Rather than aborting when
we try to unsuccessfully unset this option, just ignore the error.

Lightly tested with SCTP over IPv6 on localhost.
2015-01-06 10:22:00 -08:00
Bruce A. Mah
4874c4a88b
Regen. 2015-01-05 15:23:07 -08:00
Bruce A. Mah
e142062572
Add -X to restrict SCTP binding to a subset of interfaces.
Contains an alternate implementation of previously-submitted patches
to set the maximum segment size and no-delay options.

As a result of this change, SCTP functionality on Linux will generally
require the libsctp library (on CentOS and similar distributions this
is provided by the lksctp-tools RPM).

Part of #131.

Submitted by:	Bruce Simpson <bs48@st-andrews.ac.uk>
2015-01-05 15:19:57 -08:00
Bruce A. Mah
eb9a2c07c3 Unbreak master builds on CentOS 5.
The problem is that the new byte-ordering macros adopted on master
don't support CentOS 5 because they assumed that any Linux system had
endian(3) support.  CentOS 6 (and presumably newer) do, but CentOS 5
doesn't.

So instead we only do glibc endian(3) support if we're on a system
with glibc 2.9 or higher (which is when this functionality was
introduced).

For any other platform that we don't detect (which now includes older
glibc such as CentOS 5), bring back our homebrewed htonll and ntohll
implementation from iperf 3.0.x.

Fixes #224.
2015-01-05 10:42:09 -08:00
Bruce A. Mah
bebb7dea76 Merge branch 'candlerb-multisend' of https://github.com/candlerb/iperf into candlerb-candlerb-multisend 2015-01-02 10:00:37 -08:00
Bruce A. Mah
c0f4fa6ac0 Merge pull request #231 from candlerb/candlerb-sendfile-stats
Fix calculation of sendfile throughput on OSX and FreeBSD.
2015-01-02 09:54:34 -08:00
Bruce A. Mah
d275f166c8 Merge pull request #222 from hasso/timeout-udp
Timeout if UDP port isn't reachable.

This handles the case that a control connection succeeds but UDP packets are blocked by a firewall.
2014-12-23 10:39:11 -08:00
Brian Candler
a80368bb7f Drop out of multisend loop if none of the streams are accepting data 2014-12-23 09:38:50 +00:00
Bruce A. Mah
dba611dbe4 Add one-off mode, where the server serves exactly one request.
Primarily useful for bwctl integration, this is enabled with the -1
and/or --one-off flags.

Fixes #230, based on a patch by @i2aaron.

Signed-off-by: Bruce A. Mah <bmah@es.net>
2014-12-22 14:45:40 -08:00
Brian Candler
8961016f90 Ignore set_test_zerocopy if host does not support it 2014-12-22 18:04:56 +00:00
Brian Candler
588ee5223e Fix calculation of sendfile throughput on OSX
Note that sendfile can return -1 for EINTR whilst having already sent
partial results; these were not being counted previously.
2014-12-22 10:38:59 +00:00
Hasso Tepper
b83791882d Add ifdef to the SO_RCVTIMEO code
Not all platforms have a SO_RCVTIMEO socket option.
2014-12-11 12:59:02 +02:00
Hasso Tepper
9b9dd03096 Timeout if UDP port isn't reachable
Add timeout to the UDP socket. Without it client would block infinitely
if creating a control connection succeeds, but UDP packets are dropped
by firewall.
2014-11-24 10:02:37 +02:00
Bruce A. Mah
72ac83e7f2 Make UDP tests honor the -w option for setting the socket buffer
size.

This appears to be necessary on some long, high-bandwidth paths
to get sane results, either by reducing packet loss or by somehow
allowing the sending host of a test to go faster.

Fixes #219.
2014-11-12 13:58:23 -08:00
Bruce A. Mah
d65986030a Document how we use UDP sockets.
Comment changes only, no functional changes.
2014-11-12 12:10:33 -08:00
Bruce A. Mah
29dbc41c1d Also maintain the min and mean of the RTT.
For issue #215.
2014-10-23 13:39:58 -07:00
Bruce A. Mah
c7b0726a38 Merge branch 'master' of github.com:esnet/iperf 2014-10-23 11:11:08 -07:00
Bruce A. Mah
432ef7ebb3 Retrieve RTT information on platforms supporting it.
This value is available on the sender side, expressed in
microseconds.  It's available in the JSON output.

In the JSON output we also output the maximum observed RTT
per-stream.  Note that since the observation interval is many times
the RTT, it's not clear how good this value would be at capturing the
largest computed RTT value over the lifetime of each stream.

While here, also determine the maximum observed snd_cwnd value over
the lifetime of each stream.

This all works pretty well on Linux, but on FreeBSD (which should
theoretically be supported) we don't do a good job of supporting the
tcp_info structure.  We need to make this code a lot more portable,
rather than just assuming the world of platforms is "Linux"
vs. "everything else".  Fixing this requires some rearchitecting of
the way that we retrieve, compute, and print statistics.

Part of a fix for #215.
2014-10-23 11:10:39 -07:00
Bruce A. Mah
1d85c269a6 Fix an error message. 2014-10-16 12:30:51 -07:00
Bruce A. Mah
662a7ca035 Regen. 2014-10-16 11:30:07 -07:00
Bruce A. Mah
c5cf8972a0 Merge pull request #211 from atcorner/illumos
Fix build on illumos.
2014-10-16 11:13:47 -07:00
Ante Vojvodic
a565fa6b27 Identify Solaris based OS. 2014-10-16 18:01:29 +02:00
Bruce A. Mah
96d0c77ca2 The maximum send length for UDP is the maximum size of a UDP datagram.
For UDP over IPv4, this is the maximum IPv4 packet size (65535) minus
the size of the IPv4 and UDP headers, arriving at 65507.

In theory for a system implementing IPv6 jumbogram support, there is
no maximum packet size for UDP.  In practice we've observed with
CentOS 5 a limitation of 65535 - 8, which is dictated by the size
field in the UDP header (it has a maximum value of 65535, but needs
to count both payload and header bytes, thus subtracting off the 8
bytes for the UDP header).

We take the most conservative approach and use the 65507 value
for UDP / IPv4.

This is (I believe) the last part of issue #212.
2014-10-13 08:55:41 -07:00
Bruce A. Mah
8694d1db0d Make UDP packet reception work right with non-blocking sockets and enable.
We need this to permit a UDP receiving iperf3 server to listen on its
control channel.

The fix for non-blocking sockets basically makes sure that if we do a
read on a non-blocking sockets, but there's no data, the UDP processing
code does *not* try to do the normal protocol packet processing on the
non-existent packet.

This is part of an ongoing fix for issue #212 but also should have been
a part of the fix for issue #125.
2014-10-13 04:28:58 -07:00
Bruce A. Mah
78033c4359 Fix a crash when we try to print ending stats but no tests were run.
This can happen if the server gets into a weird state (see the test
cases for reproducing issue #212).  We need to do a couple of checks
to make sure we're not dereferencing NULL pointers (yay C).

While here, also fix up a couple of related output glitches, where
in this case we can emit some invalid JSON (NaN values, such as what
you get if there's a division by zero, are not valid JSON).

Part of a fix in progress for #212.
2014-10-13 01:50:04 -07:00
Ante Vojvodic
165d10de0f Fix build on illumos. 2014-10-06 18:38:17 +02:00
Bruce A. Mah
da9f046f19
Update license and copyright text to conform to LBNL standards.
Note that the license remains a 3-clause BSD license; the only
license changes were to add the name of the program and to add
some punctuation.
2014-09-29 14:00:46 -07:00
Bruce A. Mah
8365c3d003
Don't pass NULL when we really mean to pass 0.
Fixes a warning on MacOS.
2014-09-22 15:11:59 -07:00
Bruce A. Mah
9fc0149e1c
Fix a couple of printf format warnings.
Also if we try to compile on an unsupported platform, emit some code
in portable_endian.h that at least has a chance of compiling, rather
than erroring out right away.

For #191.
2014-09-22 15:06:27 -07:00
Bruce A. Mah
738c4dc68f Make this work on FreeBSD.
From my understanding this should make it work on NetBSD and Dragonfly
as well.

Part of #191.
2014-09-19 15:11:02 -07:00
Bruce A. Mah
529aeacfd2 Make portable_endian.h more portable.
Add a minimal amount of stuff so we can compile on Solaris 11.

Fixes (sort of) #191.
2014-09-19 11:14:29 -07:00
Bruce A. Mah
236dcb0b2a Use HAVE_STDINT_H to prevent a recurrence of #175. 2014-09-19 11:12:49 -07:00
Bruce A. Mah
d0d17267a7 Merge pull request #206 from duyaokun/fix-compile-cjson-error
Fixed compilation error in src/cjson.c observed in Visual Studio 2013.

This problem didn't cause breakage on any other platform, but this change should have been present anyway.

(cherry picked from commit dd2968f21e641945026db4bbdf02b3c13f833d74)
Signed-off-by: Bruce A. Mah <bmah@es.net>
2014-09-16 13:00:58 -07:00
Bruce A. Mah
1f29ffe70d Fix build on OpenBSD (tested on 5.4).
Breakage was introduced with commits for Issue #191.
2014-09-15 15:09:50 -07:00
Bruce A. Mah
ac468c8bc0 Comment fix: Fix the option associated with iperf_test.bind_port.
No functional change.
2014-09-15 14:30:33 -07:00
Kevin Constantine
517321138a Support --cport and --parallel
When running multiple parallel streams, the specified port number
is incremented for each successive stream.

Signed-off-by: Kevin Constantine <kevin.constantine@gmail.com>
2014-09-15 14:15:04 -07:00
Kevin Constantine
90f317355d Fix declaration of iperf_test.bind_port
Signed-off-by: Kevin Constantine <kevin.constantine@gmail.com>
2014-09-15 14:14:10 -07:00
Bruce A. Mah
de1683975b
Minor documentation updates for new --cport option.
For #207.
2014-09-15 13:11:15 -07:00
Bruce A. Mah
785c8a42c9 Merge branch 'master' of github.com:kevinconstantine/iperf into kevinconstantine-master 2014-09-15 12:58:01 -07:00
Kevin Constantine
023fb45e7a specify client-side port: UDP support
--cport can be specified for udp connections

Signed-off-by: Kevin Constantine <kevin.constantine@gmail.com>
2014-09-15 10:57:43 -07:00
Kevin Constantine
499b122230 specify client-side port: Only support --cport
Remove support for short-option -e

Signed-off-by: Kevin Constantine <kevin.constantine@gmail.com>
2014-09-15 10:55:09 -07:00
Bruce A. Mah
b09e51eb40
Regen. 2014-09-15 10:45:03 -07:00
Bruce A. Mah
a1861d5f87
Rename locale.{c,h} to iperf_locale.{c,h} to avoid filename collision
with system header <locale.h>.

This apparently fixes problems on an ARM build, but this was generally
broken anyway.  It's slightly amazing this didn't cause problems before;
perhaps we never used <locale.h> before?

Addresses #203.
2014-09-15 10:42:36 -07:00
Kevin Constantine
b7b1b32afe Add support for specifying client-side epemeral port
-e/--cport now allows a user to specify the client-side port
used for data transfer.

Signed-off-by: Kevin Constantine <kevin.constantine@gmail.com>
2014-09-09 16:31:57 -07:00
Bruce A. Mah
329523a557
Add a --udp-counters-64bit feature to support very long UDP tests.
UDP tests store a packet sequence number in the packets to detect loss
and ordering issues.  This sequence number is a 32-bit signed integer,
which can wrap during very long-running UDP tests.  This change adds
an option (defaulting to off) which uses a 64-bit unsigned integer to
store this quantity in the packet.  The option is specified on the
client side; the server must support this feature for proper
functioning (older servers will interoperate with newer clients, as
long as --udp-counters-64-bit is not used).

The default might be changed in a future version of iperf3.

As a part of this change, the client sends its version string to the
server in the parameter block.

Uses a public-domain compatibility shim for 64-bit byte order
conversions.  There are probably some additional platforms that need
to be supported, in particular Solaris.  We might add some
configure-time checks to only enable this feature on platforms where
we can support the byte-order conversions.

This change is not well-tested.

Towards issue #191.
2014-08-28 08:59:32 -07:00
Bruce A. Mah
40d45dcf34 Fix a problem that could disrupt existing tests.
By design, an iperf3 server only runs one test at a time.  New
connections from other clients (during an existing test) are
rejected.  A problem is that the server code that rejects the test
tries (for some reason) to read the cookie from the client, even
though it's going to reject the connection anyway.

A way to break an existing test is:  With a test running, make a TCP
connection to the server's control port (this can easily be done with
a telnet client).  The server will hang in a blocking read call trying
to read the cookie from a non-existent client, while the test is
essentially frozen.

The fix is to remove the attempted read of the cookie.

Fixes #202.
2014-08-27 14:48:09 -07:00
Bruce A. Mah
f50627706f
When parsing the -b (bandwidth) argument, use 10-based suffices.
We support using k, m, and g as suffices on input values.  In most
cases these are 2-based suffixes (i.e. K == 1024) because they are
sizes of objects.  In the case of rates, we need to use 10-based
suffices (i.e. K == 1000).

We do this by implementing (using copy-and-paste) a unit_atof_rate()
subroutine that parses strings similarly to unit_atof but using
10-based suffices instead.

Fixes #173.
2014-08-25 16:43:46 -07:00
Bruce A. Mah
e6fba4e8d7
Note that specifying -b 0 disables bandwidth limits.
Documentation change only, no functional changes.

Fixes #170.
2014-08-25 13:15:06 -07:00
Bruce A. Mah
eb1cfe5e16 Another iteration on issue #193, fixes -B with some TCP tests.
When we do TCP tests and specify the socket buffer size, MSS, or
TCP no delay option, the iperf3 server destroys the socket it was
using to listen for the control connection and opens up a new
listening socket for the test's data connections.  This is (I think)
to make sure that the data connections all have the correct TCP
parameters.

When we re-create the listening socket, we also need to go through
the binding logic again (with all of the address family selectiion,
etc. goop).  The bug fixes that were a part of issue #193 need to
be ported to this code as well.

This problem only affects TCP tests, because for other protocols,
the listening socket for data cannot be the same listening sock as
for the control connection.

While here, add some comments so anybody trying to understand this
code will have an easier time.

Based on patch by:	@i2aaron
2014-08-01 16:24:14 -07:00
Bruce A. Mah
bfb213929a Minor doc fix: add some missing (?) characters in manpage. 2014-07-24 09:43:13 -07:00
Bruce A. Mah
e0d039ea3c Add API methods to allow setting the bind_address test parameter.
This is the same functionality as the -B iperf3 command-line option.

Fixes #197.
2014-07-24 09:30:45 -07:00
Bruce A. Mah
bef5ef87f5 Don't try to do IPV6_V6ONLY on OpenBSD either.
setsockopt(3) returns an error if passing 0 to this option (which
we do if no address family is specified when we bind to the wildcard
address, say by invoking "iperf3 -s" with no other options).  This
is because OpenBSD explicitly does not support IPv4-mapped addresses,
so even though the IPV6_V6ONLY socket options exists, it only works
with a non-zero argument.

Fixes #196.
2014-06-16 08:32:18 -07:00
Bruce A. Mah
147d3369a0
Only do the IPV6_V6ONLY setsockopt(3) stuff if that option is available.
Should fix #177, in which compilation failed on older Solaris systems
that didn't have it.  This is a different approach than a patch
suggested in that issue.

Weakly regression-tested on other platforms (test this by specifying
-6, -4, or neither to the server when binding to the wildcard address,
and seeing if a client can connect with various of -6, -4, or neither).
2014-07-21 10:34:06 -07:00
Bruce A. Mah
76b5942f6f
Fix a problem with binding to the wildcard address.
On CentOS 6 and MacOS, if no address family was specified, we'd
get back an IPv4 address from getaddrinfo(3), with the result that
we couldn't accept IPv6 connections in the default server configuration.

There was an earlier attempt at fixing this problem that caused
Issue #193.  This change is a follow-up fix to that issue.

While here, put lots of comments around the fix so we remember
why we're doing these shenanigans.
2014-07-17 17:14:20 -07:00
Bruce A. Mah
5b760eef47
Fix two related bugs with -B and IPv4 addresses.
If specifying -B with an IPv4 literal address or with an FQDN that
resolved to an IPv4 address, but we had not explicitly specified an
address family with -4, we failed to set up the socket correctly
because we assumed binding to an IPv6 address, and instead (after some
error spewage) wound up binding to wildcard address.

The fix in this commit has multiple parts:  First, if the address
family hasn't been explictly specified, don't force AF_INET6 in the
hints to getaddrinfo(3).  AF_UNSPEC should generate the correct
(according to RFC 6724) behavior.

Second, iperf_reset_test() should not discard members that were passed
from command-line parameters, because that alters the behavior of the
iperf3 when it tries to recreate the listening socket.  In the failure
situation described in this issue (and possibly other as well), the
value of -B gets discarded, so on subsequent attempts to set up the
listening socket it just binds to the wildcard address.

While here, fix on-line help related to the -B option to match
reality.

Note that we're not completely in compliance with RFC 6724, which
states that we should actually try all of the addresses in returned by
getaddrinfo(3), rather than just the first one.

Fixes Issue #193.
2014-07-17 14:30:39 -07:00
Bruce A. Mah
fa0e81c853
Fix incorrect help text; "--num" should be "--bytes".
Fixes issue #192.
2014-07-10 09:49:31 -07:00
Bruce A. Mah
6c0147f2fe Remove unnecessary inclusion of <sys/queue.h>, as well as some ifdef-ed
out code that depended on it.

Fixes #180.
2014-06-17 13:15:26 -07:00
Bruce A. Mah
edf9d4e8cf Merge pull request #185 from fornwall/struct-in6_flowlabel_req-already-defined-on-android
in6_flowlabel_req is already defined on Android
2014-06-17 13:00:22 -07:00
Bruce A. Mah
846ddcba74 Merge pull request #184 from fornwall/include-select-h
Include <sys/select.h> for select(2)
2014-06-17 12:49:49 -07:00
Fredrik Fornwall
58fd2c37fc in6_flowlabel_req is already defined on Android 2014-06-16 09:02:44 +02:00
Fredrik Fornwall
1ceacc1362 Include <sys/select.h> for select(2)
The sys/select.h include is the correct one and fixes building on Android.

See e.g. http://pubs.opengroup.org/onlinepubs/009604599/functions/pselect.html
2014-06-16 08:59:08 +02:00
Bruce A. Mah
188f8eb69d
Regen. 2014-06-12 11:54:21 -07:00
Bruce A. Mah
a134ba0a02
Fix a bug in the structure of the --json output.
The various "connected" structures were just dumped into the "start"
structure.  This caused problems if there were multiple connections
(i.e. multiple parallel streams), because the "connected" structures
would overwrite themselves.  Instead, make these structures members
of a "connected" array.

This is technically an incompatible API change, but the prior behavior
was unusable.

Discovered and fix suggested by:	@i2aaron
2014-06-12 11:38:43 -07:00
Bruce A. Mah
b3903f4ca2 Revert "Explicitly run ldconfig after "make install"."
This reverts commit 72d410561e.
2014-06-11 13:25:19 -07:00
Bruce A. Mah
23c1008132 Be more tolerant of certain autoconf-defined variables not being
available.

This can happen if needing to regenerate the autoconf goop on an
older system (such as CentOS 6), where PACKAGE_URL doesn't get
defined.
2014-06-11 12:01:35 -07:00
Bruce A. Mah
265c54a01f
Fix programming misteak.
Part of issue #160, pointed out by @i2aaron.
2014-06-11 09:55:31 -07:00
Bruce A. Mah
c5e1205e49
Fix build on Fedora 21.
An open(2) call had two arguments instead of the required three.
While here, replace a hard-coded mode in a different open(2) call
with symbolic constants for readability.

Fixes #183.

Submitted by @ssahani.
2014-06-09 13:41:30 -07:00
Bruce A. Mah
552e943a65
Consolidate multiple (not current) copies of the author list into
the GitHub Pages documentation and attempt to make current.
2014-06-09 10:18:50 -07:00
Bruce A. Mah
ba8d6e6246
Implement a --get-server-output flag that allows the client to
retrieve (most of) the output emitted by the server.

If the server was invoked with the --json flag, the output will be in
JSON, otherwise it will be in the human-readable format.

If the client was invoked with the --json flag, the output will be
contained within the JSON output structure, otherwise it will be
appended (in whatever format) to the bottom of the human-readable
output.

Because of the sequencing of the output generation and display, the
server-side output includes only the starting output, interval
statistics and summaries, but not the overall summaries.  (The overall
summaries were already displayed in the client's output.)

Towards issue #160.
2014-06-05 09:48:55 -07:00
Bruce A. Mah
94c0bfffcb Another try at portability. Don't do -Werror. While probably
the best thing to do from a code hygeine standpoint, it's too
painful to try to get right for now.

Fixes #174 (second try).
2014-05-19 15:22:08 -07:00
Bruce A. Mah
8de51b589f
Portability fixes for Solaris Sun Studio and MacOS.
Only do -Wall by default if on GCC (or something that looks like
GCC, such as clang/llvm).

Turn on -Werror so we can get some better error-checking, but
we also need -Wno-deprecated-declarations at least for MacOS,
because daemon(3) is deprecated starting with MacOS 10.5.

Fixes #174 (I think).

Submitted by:	@marksolaris
2014-05-19 15:02:02 -07:00
Bruce A. Mah
426221a327
Check HAVE_STDINT_H before trying to include <stdint.h>.
Partial fix for compilation on some Solaris versions.  Fixes #175.

Submitted by:	@marksolaris
2014-05-19 10:15:36 -07:00
Bruce A. Mah
df1a7a2194
Regen. 2014-05-12 15:50:20 -07:00
Bruce A. Mah
72d410561e Explicitly run ldconfig after "make install".
This might address Issue #153.
2014-05-12 15:48:49 -07:00
Bruce A. Mah
aac3bd9e45 Merge branch 'master' of github.com:/esnet/iperf 2014-05-12 14:28:36 -07:00
Bruce A. Mah
ef3eae69bf
Add reverse member to start.test_start JSON, which is 1 in --reverse mode.
This lets us tell easily from the JSON output whether a test was run in
--reverse mode or not.  Resolves #167 (one comment made in that issue
anyway).
2014-05-12 14:27:01 -07:00
Bruce A. Mah
c8a98bd371
Increase maximum test running time to 1 day.
Fixes #166.
2014-05-09 14:08:05 -07:00
Bruce A. Mah
daff72b682
Add PACKAGE_URL to help message. 2014-05-05 15:32:57 -07:00
Bruce A. Mah
4318163373
Point to GitHub Pages. 2014-05-05 15:28:05 -07:00
carlsborg
78525e4629 fix sendfile ifdef check 2014-05-05 04:00:46 +01:00
Bruce A. Mah
81dbb9e2e1 More consistent documentation for the statistics gathering and
printing functions.
2014-05-02 12:41:07 -07:00
Bruce A. Mah
f9820fd6c0 Fix a comment. 2014-05-02 12:10:43 -07:00
Bruce A. Mah
6edfd8d65c
Use AM_MAINTAINER_MODE and regenerate autotools / libtool goop
using recent versions.

Resolves #161.
2014-05-02 11:32:12 -07:00
Bruce A. Mah
6b16244baa Make sockets for non-UDP tests non-blocking (rather than all sender
side sockets).  This is reported to fix some oddities after a recent
change in this area.

Somewhat related to Issue #125.

Submitted by:	@i2aaron
2014-04-25 13:23:13 -07:00
Bruce A. Mah
f8401dfb3a Take out some debugging goop. 2014-04-25 13:11:15 -07:00
Bruce A. Mah
bf219a4d51 Fix a problem where CPU time was computed wrong.
This definitely affected FreeBSD, which breaks POSIX.1 by not
setting CLOCKS_PER_SEC to 1000000 (see clock(3)).  At this point
I can't tell if any other platforms were affected by this.
2014-04-25 12:50:15 -07:00
Bruce A. Mah
fa2752296a Regen. 2014-04-24 10:25:36 -07:00
Bruce A. Mah
d141c52dab Get the iperf version number from autoconf, don't track the tagging date.
These simplify the release process because they eliminate a manual
file-editing step.
2014-04-24 10:23:31 -07:00
Bruce A. Mah
cbacc1d670
Only set sockets to non-blocking mode on the sending side of the
transfer.

Note that the sender can either be the client or the server depending
on whether --reverse is used.

This fixes some problems with UDP transfers getting severely confused
and (wrongly) complaining about packets arriving out of order.

Related to issue #125.
2014-04-23 15:01:27 -07:00
Bruce A. Mah
721ffc1bc5 Fix rookie C mistake committed in revision d076653b as part of
Issue #99.

This caused random output to be displayed on the client's stdout in
--json mode.

Pointed out by:	@bltierney
Pointy hat to:	@bmah888
2014-04-22 10:09:00 -07:00
Bruce A. Mah
081ba8e4e9
Commit a version of the patch for #125 for testing.
Originally submitted by:	@i2aaron
2014-04-16 16:23:13 -07:00
Bruce A. Mah
9ac254da7d Fix build on systems without sendfile(2).
Tested on:	OpenBSD 5.4
2014-04-15 02:51:54 -07:00
Bruce A. Mah
de542356af Regen. 2014-04-14 14:49:39 -07:00
Bruce A. Mah
7f6360334d
Fix potential compile error observed on MacOS 10.8. 2014-04-14 14:45:09 -07:00
Bruce A. Mah
3f8c33cd76
Better sendfile / zerocopy detection.
There's still a bunch of OS-dependent fu because every platform that
supports sendfile(2) does it differently.
2014-04-14 14:16:07 -07:00
Bruce A. Mah
3e9b0eb334
Recent feature detection changes have gotten the -C (TCP congestion
algorithm selection) option to work on FreeBSD for free, starting with
FreeBSD 9.  Update various documentation places to note this.  One
specifies the congestion algorithm in the same was on Linux, although
the names of the algorithms are (at least in the general case) different.
"sysctl net.inet.tcp.cc" on FreeBSD provides a list of available
algorithms, which are implemented as loadable kernel modules.

Rename the --linux-congestion long option to --congestion (retaining
the old option as a deprecated synonym).
2014-04-14 13:43:02 -07:00
Bruce A. Mah
a57bcc2d77 Regen. 2014-04-14 13:37:47 -07:00
Bruce A. Mah
40050b7bee
Fix breakage due to iperf.h depending on the autoconf config.h file but
not including it.

To fix this required us to change config.h to iperf_config.h (to
avoid potential filename collisions with this generic name).  Then
iperf.h could include this.

Adjust the existing header file inclusions to track this, and also
canonicalize their inclusion to be at the top of *.c files.
2014-04-14 13:33:33 -07:00
Bruce A. Mah
75ee0f4f26 Regen. 2014-04-14 10:49:59 -07:00
Bruce A. Mah
40a1faf332 Improve detection of CPU affinity support (for FreeBSD and Linux).
As with several other recent commits, don't check explicitly for an
OS platform, but rather detect the various API bits that are used
to implement CPU affinity setting.
2014-04-14 10:45:46 -07:00
Bruce A. Mah
5976bac34e Merge remote branch 'origin/master' into feature/sctp-build-fixes 2014-04-10 15:01:26 -07:00
Bruce A. Mah
5a657ae894
Get rid of this obsolete file. 2014-04-10 11:33:11 -07:00
Bruce A. Mah
cbc17310cd Get a missed HAVE_TCP_CONGESTION change. 2014-04-10 11:24:47 -07:00
Bruce A. Mah
b904a787af Regen. 2014-04-10 11:22:49 -07:00
Bruce A. Mah
4155c45471 Improve detection of IPv6 flowlabel support (Linux only).
We check at configure-time to see if IPV6_FLOWLABEL_MGR is defined
in <linux/in.6>, if it is we set a HAVE_FLOWLABEL CPP symbol to
turn on conditional compilation of the support for this feature.
2014-04-10 11:20:36 -07:00
Bruce A. Mah
8cb96d1405 Regen. 2014-04-10 10:55:26 -07:00
Bruce A. Mah
c550ef4605 Non-platform-specific detection of TCP_CONGESTION socket option.
Rather than checking for anything Linux-specific at configure-time,
see if TCP_CONGESTION is defined in <netinet/tcp.h> and if so define
a CPP variable HAVE_TCP_CONGESTION, which we then use to enable
conditional compilation of the code for this feature.
2014-04-10 10:53:18 -07:00
Bruce A. Mah
e90f34f61a Merge remote-tracking branch 'origin/master' into feature/sctp-build-fixes 2014-04-09 13:55:03 -07:00
Bruce A. Mah
449f47e4ef
Use the PACKAGE_BUGREPORT and PACKAGE_STRING macros from automake
in --help and --version.  Notably this provides the correct URL
for the bugtracker.
2014-04-09 13:29:03 -07:00
Bruce A. Mah
cfed9382b7
Get rid of definitions of ntohll and htonll that were broken on FreeBSD.
These macros were never used anywhere in iperf3 anyways, and
conflicted with macro definitions that were in FreeBSD's system
headers.

Bump copyright date and add a comment to inclusion guard while here.
2014-04-09 11:28:02 -07:00
Bruce A. Mah
cd81de3c0a
Rework detection / enabling of SCTP support.
Rather than doing checks for platforms that we believe support SCTP,
instead look for an indication (notably the presence of <netinet/sctp.h>)
that it's supported.  This makes the conditionals for SCTP more obvious.
In addition, it opens up the possibility that SCTP might work on some
new OS that's not FreeBSD or Linux.

This change may force some additional build-time requirements on Linux,
such as lksctp-tools-devel on CentOS / Fedora or libsctp-dev on
Ubuntu.

Committing this first cut for review and to enable testing on multiple
platforms.  So far this works correctly on Linux (SCTP support) and
MacOS (no SCTP support).
2014-04-09 10:29:16 -07:00
Bruce A. Mah
2939863b1a
Resolves #147.
Squashed commit of the following:

commit 23ef0d047fb5396df671be9245f7872153fc299c
Author: Bruce A. Mah <bmah@es.net>
Date:   Mon Apr 7 13:35:29 2014 -0700

    Add a few API calls to the client-side example program so we can
    exercise recently-added JSON-related functionality.

commit 5f8301e8d0380133d533da9b2e39ca4ac522e1c3
Author: Bruce A. Mah <bmah@es.net>
Date:   Mon Apr 7 13:16:39 2014 -0700

    Revert part of earlier change.

    We still want to save the JSON for libiperf consumers that might want it,
    but preserve the prior behavior of writing that JSON to stdout.  This
    maintains (roughly) the behavior of older libiperf, in which libiperf
    consumers (such as the iperf3 executable) do not need to explicitly print
    the JSON if that's all they're doing with it.

commit 173dcdb05867af00103205bfe39d1b71e18689e9
Author: Bruce A. Mah <bmah@es.net>
Date:   Tue Mar 25 13:55:45 2014 -0700

    Update manpage for newly-added library calls.

    Bump document date while here.

    Part of Issue #147.

commit 51a275de9463febc440d41cee9d971fcd381e01c
Author: Bruce A. Mah <bmah@es.net>
Date:   Tue Mar 25 13:30:09 2014 -0700

    Allow consumers of libiperf3 to get the JSON output for a just-completed test.

    This changes the behavior of iperf_json_finish() so that it no longer
    outputs JSON output, but saves the rendered output in a NUL-terminated
    string buffer.  After calling iperf_run_server() or iperf_run_client(),
    the client application should check iperf_get_test_json_output() to see
    if it returns a non-NULL pointer.  If so, there is JSON data available
    for it to print or otherwise consume.  The buffer is automatically
    deallocated when the containing iperf_test structure is deallocated
    with iperf_free_test().

    Also adds a new API call iperf_get_test_outfile() to find the output
    FILE* structure.

    Modifies the iperf3 application to use the new API.  Users of iperf3
    will not notice any functional change.

    No effect in "normal" output mode (non-JSON).
2014-04-07 14:12:47 -07:00