Commit Graph

537 Commits

Author SHA1 Message Date
Bruce A. Mah
73936538a7
Minor style fixes, no functional change.
Related to Issue #155.
2014-03-25 13:05:03 -07:00
Aeneas Jaißle
ce38fb1029 Prevent possible buffer overflow in iperf_error.c 2014-03-25 14:09:21 +01:00
Bruce A. Mah
2808a0b6c4 Fix a crash that can be triggered by libiperf3 clients that don't use
iperf_parse_arguments().  Basically we need to initialize the
output stream in the iperf_test structure regardless of whether
iperf_parse_arguments() gets called; some programs (in particular
the programs in the examples/ directory and bwctl) don't do this
(and indeed should not need to).

This problem was introduced in the solution for Issue #119; the fix
needs to be merged to any codeline where fixes for Issue #119 go.
2014-03-20 10:24:25 -07:00
Bruce A. Mah
5d2f2cf983 Regen. 2014-03-20 09:58:27 -07:00
Bruce A. Mah
974c88e8d9
Include summary structures in JSON even if there's only one stream.
This makes consuming the JSON easier and more consistent.

Resolves #151.

Submitted by:	@i2aaron
2014-03-18 09:44:37 -07:00
Bruce A. Mah
3fa8072e9b Fix a call to iprintf(), also fix sequencing of some output flushes.
Related to Issue #119.
2014-03-14 15:48:31 -07:00
Bruce A. Mah
aeb6938d5a
Support --logfile argument to make all output go to a file.
This works for both client and server side (in the case of the server,
either for daemon or non-daemon mode).

Consistifies a few places that were using printf instead of iprintf.

Fixes Issue 119.
2014-03-14 14:23:38 -07:00
Bruce A. Mah
7af6d5a2f9
In debug mode, print out SO_SNDBUF when setting up each socket
(regardless of whether this was set explicitly or not).
2014-03-06 15:11:25 -08:00
Bruce A. Mah
dc1dd2dc7d Regen to pick up changes from issue #146. 2014-03-04 14:34:40 -08:00
Bruce A. Mah
3c4ef74e5e
Build libiperf3 as both a shared library and a static library by default.
Use --disable-static or --disable-shared to build only one flavor
of libraries.

Tested on MacOS, FreeBSD, and CentOS 6 Linux.

Resolves #146.

Originally submitted by:	@i2aaron
2014-03-04 14:31:35 -08:00
Bruce A. Mah
103838183a Update version and bug-report fields in AC_INIT and regen files. 2014-02-27 22:40:01 -08:00
Bruce A. Mah
70e4b713b7
Update URLs pointing to Google Code to use GitHub.
While here, update a couple of dates in manpages.
2014-02-27 21:56:53 -08:00
Bruce A. Mah
91d5d5e717 Increase buffer size for formatted numeric quantities, to avoid truncation.
This can happen if the user forces a particular output format that leads
to many digits (6 or more) being printed.  The new buffer size is probably
larger than it needs to be, but better safe than sorry.

Fixes Issue 142.
2014-02-21 14:24:56 -08:00
Bruce A. Mah
a3736b64e7 Don't append a colon and two spaces to title in --json output.
Resolves Issue 139.
2014-02-21 13:24:38 -08:00
Bruce A. Mah
f2c4e2b5bd Provide an API call in libiperf to set the test unit format.
Resolves Issue 144.

Submitted by:	 AaronMatthewBrown
2014-02-21 13:07:55 -08:00
Bruce A. Mah
3eaf324ab3 Remove incorrect references to multicast from -B documentation.
(This is partially because iperf3 doesn't do multicast, yet.)

Also it's not specifically a client-side option, so relocate it in
the manpage.
2014-02-14 14:58:01 -08:00
Bruce A. Mah
ede8dabb83 Set the default message size for SCTP to 64KB.
This makes SCTP with default parameters work on CentOS 6; formerly
it was just using the TCP default (128KB) and failing with
a "message too long" error.  It might be possible to fix this with
some manipulation of other default values, so that TCP and SCTP
can use the same default message size, but I haven't figure out
what this would be.

This ties up one loose end from Issue 131.
2014-02-14 14:06:08 -08:00
Bruce A. Mah
60bd98a538 Add SCTP support with the --sctp flag (Linux and FreeBSD only).
Note this option only has a long option flag; we're running out of
letters for short options.

Based heavily on a patch submitted in Issue 131 (SCTP support for
iperf); I added support for FreeBSD and did some other packaging and
documentation improvements.

We probably shouldn't tie SCTP support to looking specifically for
Linux or FreeBSD; we probably leave support enabled all the time if
possible, possibly with some configure-time checks.
2014-02-14 11:52:16 -08:00
Bruce A. Mah
d076653bd4 Output TCP snd_cwnd (on platforms supporting it) in normal output.
We were computing and printing this in JSON output mode anyway; this
change just exposes this quantity in a human-friendly manner (better
than the first attempt at this) when doing normal output.

Resolves Issue 99 (Additional TCP_INFO items).
2014-02-14 11:17:43 -08:00
Bruce A. Mah
4addea8502 Fix unfiled bug that could break TCP tests under some circumstances.
The bug and solution are very similar to Issue 126 (fixed in
d7e0c1445c0a).  Basically a setsockopt(IPV6_V6ONLY) call had a bogus
level argument, but we never checked the return value so we never
noticed this.

As with the prior issue, the fix is to unbreak the setsockopt() call,
and add some error checking to detect future breakage.

This bug was on a codepath that only got called if non-default values
were set for the socket buffer size, the MSS, or the NODELAY parameter.
It might have affected some FreeBSD tests, but really only got noticed
when debugging some other code that was (probably) cut-and-pasted
from this code.
2014-02-04 15:05:39 -08:00
Bruce A. Mah
9a829841eb Replace system("uname -a") with call to uname(3).
Slightly reworked version of a patch that was...

Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-30 15:15:53 -08:00
Bruce A. Mah
441d8b75a0 Add support for writing the PID to a file in server mode.
This is specified with the -I or --pidfile option.

Issue:		120 (PID file support)
2014-01-24 16:42:10 -08:00
Bruce A. Mah
09f54a4f44 Fix warning on platforms that don't support processor affinity.
No functional change.
2014-01-21 15:03:29 -08:00
Bruce A. Mah
723f2f7b2a Fix an abort observed on MacOS X 10.9 (but applicable to other platforms).
mapped_v4_to_regular_v4() committed the sin of doing strcpy(3) on
overlapping buffers.  This caused an abort on MacOS X 10.9.  Fix this
to use memcpy(3) instead, which handles overlapping buffers correctly.

Issue:		135 (Crash on OS X when using IP address)
2014-01-21 12:59:47 -08:00
Bruce A. Mah
0ff7575499 Fix build on Linux distros that don't support TCP_CONGESTION.
Apparently older kernels don't support TCP_CONGESTION, so we can't
just test for defined(linux) to know if we can use this sockopt or not.
This change unbreaks the build on (notably) CentOS 5.
2014-01-16 10:43:08 -08:00
Bruce A. Mah
7234074fe8 Whoops. Forgot to document the -d flag properly. Do this. 2014-01-15 12:01:22 -08:00
Bruce A. Mah
cf59099b49 Add support for a -d debug flag to enable debugging output.
Mostly intended for developer use.  At the moment there are no public
uses for this flag.
2014-01-15 10:27:33 -08:00
Bruce A. Mah
deefb95fea Add FreeBSD support for -A (set CPU affinity).
Mostly this change consists of adding FreeBSD-specific code to handle
this feature.  The concepts and system calls are very similar to what's
already done for Linux.  One difference is that on FreeBSD, the CPU
affinity mask is saved before -A processing and restored afterwards.
This causes a slight change to the function signatures for
iperf_setaffinity() and iperf_clearaffinity() (these functions
however are not documented as a part of the libiperf3 API).

Slightly improve some of the documentation for the -A command line
option, to hopefully stave off some of the questions about this
feature.

Mostly based on a submitted patch.

Issue:          128 (better error message for CPU affinity failure)
Submitted by:   Susant Sahani <ssahani@redhat.com>
2014-01-13 10:58:47 -08:00
Bruce A. Mah
55a453c2a1 Clean up some memory leaks in iperf_new_stream error handling.
Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-13 09:27:42 -08:00
Bruce A. Mah
49f74e582c Prepare for iperf3 3.0.1. 2014-01-10 13:22:11 -08:00
Bruce A. Mah
c04bdcb9d0 Second try at printing statistics when processes are interrupted.
When the client process gets interrupted, both the client and server
dump out accumulated interval statistics, as well as a partial set of
summary statistics (basically each side dumps what it has, but without
the exchange of information that usually happens at the end of a
normal run).

If the server process gets interrupted, the server dumps out its
accumulated interval and summary statistics as above.  The client does
this as well in the -R case, but exits with a "Broken pipe" in the non
-R case (this behavior was present all along; it was not introduced in
this change).  More investigation will be needed to understand the
client behavior.

Bump copyright dates in a few places.

Issue:		132 (signal handler for API calls)
Discussed with:	aaron@internet2.edu
2014-01-07 16:06:27 -08:00
Bruce A. Mah
a898ff8b8e If the client gets interrupted / signaled, dump JSON output.
Issue:		132 (signal handler for API calls)
2014-01-06 12:18:21 -08:00
Bruce A. Mah
ac0786c828 Fix typos: s/exitting/exiting/
Bump a couple of copyright dates while here.
2014-01-03 11:24:06 -08:00
Bruce A. Mah
c7ddebaa6c Fix memory leaks in iperf_reset_test().
Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-03 11:19:26 -08:00
Bruce A. Mah
0b9ba1005a Fix a server side crash with -P and -R.
The problem was a mangled printf format string, which I introduced in
616ac79bd80b.

Issue:		129 (iperf3 hangs with -R and -Z flags)
2014-01-03 10:33:28 -08:00
Bruce A. Mah
0fdda50c64 Fix a deadlock leading to a hang in -R mode.
In -R mode, the test consists of the server sending to the client
until the client tells it to stop by setting the test state to
TEST_END via the control socket.  However once the client changes the
test state, it stopped reading the incoming test data from the server.
In many (but not all) scenarios this could result in the server
filling up its send window (thus blocking on writes) before the
TEST_END message arrived from the client.  At this point the server
was hanging waiting for the client to drain its data connection(s),
and the client was waiting for the server to send a state change
message for EXCHANGE_RESULTS.

Bump copyright date while here.

This fix handles at least part of...

Issue:		129 (iperf3 hangs with -R and -Z flags)
2014-01-03 10:06:16 -08:00
Bruce A. Mah
48e66b9b9a Improve error message for TCP congestion algorithm setting failure.
Also remove a couple of places where we were saving and restoring errno
where we didn't need to.

Submitted by:	Susant Sahani <ssahani@redhat.com>
Issue:		121 (TCP congestion control algorithm support for client)
2014-01-02 13:49:56 -08:00
Bruce A. Mah
7da3d76096 Fix another minor memory leak.
Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-02 13:26:51 -08:00
Bruce A. Mah
e3faf8e421 Fix minor memory leak.
Submitted by:	Susant Sahani <ssahani@redhat.com>
2014-01-02 13:21:49 -08:00
Bruce A. Mah
39ad947995 For now, suppress printing congestion window stats in the output.
(It remains in the JSON output.)

We have some issues we need to resolve about the formatting and
representation of this (and other future values that we might be
adding).
2013-12-19 14:44:15 -08:00
Bruce A. Mah
dcd7b32b15 Follow-on to 4cfce137e89c based on some feedback and experience.
Rip out the tcpi_sacked support...it doesn't really keep a cumulative
total of SACKs received like we thought it did (it's instantaneous
state).

Convert tcpi_snd_cwnd (originally expressed in segments) to octets before
printing.

Re-work internal APIs for functions to get stuff out of tcp_info...rather
than doing a getsockopt() call per value, grab the values out of a
saved copy of the tcp_info structure (which we were getting in almost
every case anyway).

Issue:		99 (Additional TCP_INFO items)
2013-12-19 13:37:50 -08:00
Bruce A. Mah
310bd92410 Fix minor output glitch where we printed "receiver" when we meant "sender". 2013-12-19 11:44:03 -08:00
Bruce A. Mah
8d1388a3b8 Fix a logic bug in JSON output where default MSS was output as 0. 2013-12-19 11:33:38 -08:00
Jef Poskanzer
f11d3fa332 Added -k / --blockcount. 2013-12-19 10:31:22 -08:00
Bruce A. Mah
c2cb7b7520 Remove some (commented out) debugging code accidentally left in. 2013-12-19 09:27:12 -08:00
Jef Poskanzer
3f4d657209 Added note to -h output for -b flag's burst mode. 2013-12-18 20:56:21 -08:00
Jef Poskanzer
6a00b2dfdd Branch merge. 2013-12-18 15:12:43 -08:00
Bruce A. Mah
5cdc6a4ac8 Keep track of SACKs and snd_cwnd from tcp_info (Linux only for now).
Committing this WIP so we can get some experimentation done with it.
2013-12-18 15:09:46 -08:00
Jef Poskanzer
10e7a31811 Branch merge. 2013-12-18 15:08:20 -08:00
Bruce A. Mah
cfe8c5fb47 Make "iperf3 -s" accept both IPv4 and IPv6 connections on FreeBSD.
(Formerly it was just accepting IPv6.)

The problem here was that FreeBSD by default wasn't allowing IPv4
mapped addresses on IPv6 sockets, whereas other platforms
(specifically Linux and OS X) both do permit this.  We tried to turn
on mapped addresses via a setsockopt(IPV6_V6ONLY) call, but this call
was broken because the level argument was incorrect.  We didn't know
about this because we never checked the return value.

Fix this by providing the correct argument to setsockopt().  Add some
error checking to this and one other setsockopt() call, so we at least
don't fail silently in similar situations.

Issue:		126 (FreeBSD:  iperf3 -s only accepts IPv6
		connections)
2013-12-18 14:43:12 -08:00
Jef Poskanzer
bdf5335c2b Added burst mode. 2013-12-17 16:12:24 -08:00
Jef Poskanzer
62bfa88ceb Added -C / --linux-congestion.
Also a few other bugfixes I ran across.
2013-12-13 19:57:52 -08:00
Jef Poskanzer
adec7fe48b Re-order one line to clarify code. 2013-12-12 12:09:42 -08:00
Jef Poskanzer
950f6c8f59 Better error checking in net.c 2013-12-12 12:07:17 -08:00
Jef Poskanzer
fdcbd49578 Check return from tmr_create in timer test. 2013-12-12 12:04:11 -08:00
Bruce A. Mah
0193ee1881 Commit a file addition I forgot in 2ad1efdb977e. 2013-12-12 09:32:15 -08:00
Bruce A. Mah
d04c7bd0a4 Support setting the IPv6 flow label on Linux systems (only).
This functionality uses some setsockopt(2) calls that unfortunately
don't seem to have an analog on other platforms.

Slightly tweaked version of a patch that was...

Submitted by:	ssahani@redhat.com
Issue:		40 (Option for setting Flow Label field in IPv6
		header)
2013-12-12 09:21:36 -08:00
Jef Poskanzer
c8a0a2229d Added a check for malloc fail.
Eventually we need to add a whole bunch more of these.
2013-12-12 08:15:15 -08:00
Jef Poskanzer
b70c54055f Fixed t_units.c so that 'make check' once again works. 2013-12-09 17:52:59 -08:00
Jef Poskanzer
c06bc78c65 Fixed initialization issue.
It was causing the server side to mess up after the first test.
2013-12-05 12:00:46 -08:00
Jef Poskanzer
a4c1383a77 Fixed bug where -R mode selected on a closed file.
Also added a debugging routine to dump an fd_set.
2013-12-05 08:49:27 -08:00
Jef Poskanzer
95360b2046 Show UDP stats in interval reports.
To the extent possible, anyway - on the sender side,
only the packet counts are available.

Also a few minor bug fixes.
2013-12-04 09:16:37 -08:00
Jef Poskanzer
e41823c46b Pushing out merge of inadvertent branch. 2013-12-02 09:55:48 -08:00
Bruce A. Mah
adbc1f4860 Document the recently-added -D / --daemon flag from changeset
4a9b814c16e6.
2013-12-02 09:38:13 -08:00
Jef Poskanzer
ba123d5c1e Use setitimer() instead of alarm().
This lets us check timers every tenth second instead of every second,
so we can switch out of the more expensive select() mode even with
the default reporting interval of a second.
2013-11-29 08:58:51 -08:00
Bruce A. Mah
fe4a13ab4d Support daemonizing with -D flag.
Possible related work still under consideration:

o Use syslog in daemon mode for output that would normally go to
  stdout / stderr.

o Write a PID file.

This is basically the gist of Issue 105.
2013-11-26 15:40:19 -08:00
Jef Poskanzer
ace30a641e Fix server-side timers. 2013-11-26 15:14:07 -08:00
Jef Poskanzer
056361fc5d Show user/system CPU usage as well as total. 2013-11-26 14:47:15 -08:00
Jef Poskanzer
ba7b91d26e Changed bug report email to google code link.
Also bumped package id from 3.0a4 to 3.0a5.

This changeset consists of a one-line edit to configure.ac, plus
about fifty kilolines of diffs to a bunch of other config files
generated by bootstrap.sh.
2013-11-26 10:07:32 -08:00
Jef Poskanzer
96feeac5a4 Performance improvement - only put socket fd's into the appropriate
fdset, not into both sets.
2013-11-25 11:13:28 -08:00
Jef Poskanzer
979405373d When receiving a disk file with the -F flag, do an fsync() after each write(). 2013-11-25 09:57:50 -08:00
Jef Poskanzer
7bcbb1f653 Performance improvements. 2013-11-15 09:54:21 -08:00
Jef Poskanzer
37ba3f73dd Simplified output formatting. 2013-11-12 08:58:00 -08:00
Jef Poskanzer
b47e9f6a66 Couple of improvements to the report format. 2013-11-11 12:16:38 -08:00
Jef Poskanzer
a98b10bf91 Get rid of compiler warning. 2013-11-11 11:38:52 -08:00
Jef Poskanzer
d1405717cd Redid the CPU Utilization report so it shows sender/receiver as
well as local/remote.
2013-11-11 11:37:07 -08:00
Jef Poskanzer
558c9b8013 Moved a bunch more output strings to locale.[hc]. 2013-11-11 11:18:46 -08:00
Jef Poskanzer
5348f76aa9 Typo in test code. 2013-11-09 14:26:01 -08:00
Jef Poskanzer
32ebd649b3 Fixed some memory & fd leaks in error cases of various network setup
routines.
2013-11-09 14:23:36 -08:00
Jef Poskanzer
0e60ef1f9c Get rid of some compiler warnings about iprintf. 2013-11-08 21:19:59 -08:00
Jef Poskanzer
d38ab4c8df Added the -T / --title flag. 2013-11-08 20:31:19 -08:00
Jef Poskanzer
243c974f23 Note -i's default in the man page. 2013-11-08 16:13:40 -08:00
Jef Poskanzer
565366424b Changed default for -i from 0 to 1. 2013-11-08 16:12:26 -08:00
Jef Poskanzer
082cbb0ee6 The ctrl_sck does not need to be in the select write_set, and indeed
having it there may cause the select to return immediately every
time. Which is bad, m'kay?

Also, changed the coding idiom used to keep track of the maximum fd
in the fd sets, to be clearer.
2013-11-08 15:59:17 -08:00
Jef Poskanzer
e35f2035d5 Added a cast to avoid a compiler warning. 2013-11-07 08:20:04 -08:00
Jef Poskanzer
d2b9eb1a87 Another potentially protocol-breaking but necessary change.
The error numbers sent for SERVER_ERROR state were declared
as ints, and therefore could be 32 or 64 bits depending on
architecture.  I changed them to be explicitly 32 bits.

This should be the last of these, I've checked out at every network
read/write call and they look ok.

And bumped the version to 3.0-RC5.
2013-11-07 08:14:45 -08:00
Jef Poskanzer
8115b2a26e Grammar correction in error message. 2013-11-06 15:24:47 -08:00
Jef Poskanzer
4e2ef5070b More sizeof changes.
A couple more sizeof issues found and fixed.  One of them is
actually another protocol change, but due to a fortuitous accident
it should remain compatible with older versions.

Detailed explanation: When a client attempts to connect to a server that
is already busy, the server is supposed to return ACCESS_DENIED as a
state value.  It was doing so, but was writing it as an int, even though
state values are supposed to be signed chars.  The client read the value
correctly as a signed char, getting one byte and throwing away the rest.
So why did this ever work?  Because ACCESS_DENIED is the value -1, and
any byte of an int -1 equals a signed char -1.  If ACCESS_DENIED had been
any other value, this would have been an opvious bug and would have long
since been fixed.  As is, it stuck around working by accident until now.
2013-11-06 11:05:46 -08:00
Jef Poskanzer
2944aaa05b State is signed char.
test->state is an explicitly signed char, so the two routines that
manipulate it must use explicitly signed chars too.

One could argue that the two negative state values should have been
positive like the rest, but changing them now would be a protocol change.
2013-11-06 10:33:26 -08:00
Jef Poskanzer
3651fa29e2 Bump version.
On further reflection, last night's seemingly trivial change to
the JSON sending/receiving routines is actually a protocol change,
on some machines, and therefore merits a version number change.
2013-11-06 09:42:54 -08:00
Jef Poskanzer
ddb503b5a3 The JSON length field should be explicitly 32 bits, not just "int",
for better interoperation.
2013-11-05 21:50:29 -08:00
Jef Poskanzer
9393606f5b Changed -O default from 1 to 0. 2013-11-03 14:22:37 -08:00
Jef Poskanzer
578a1961cf Bump version to 3.0-RC3. 2013-11-01 14:01:20 -07:00
Jef Poskanzer
38917b1f3f Run -i interval timers on the server as well as the client. 2013-11-01 13:59:33 -07:00
Jef Poskanzer
9019e92411 Bump version to RC2. 2013-10-29 15:05:05 -07:00
Jef Poskanzer
afe6222a89 Move termination signal handing from main into iperf_run_client
and iperf_run_server, so that API users get it too.  Also, call
iperf_errexit with an appropriate message, which in -J mode dumps
out any accumulated JSON data.
2013-10-29 15:03:17 -07:00
Jef Poskanzer
7639c1a631 Bump version to RC1. 2013-10-28 17:14:25 -07:00
Jef Poskanzer
69376ec7ed Fix retransmit accounting so it works right with the --omit flag. 2013-10-28 17:13:30 -07:00
Jef Poskanzer
8a7e01eb8f Implement -A flag to set CPU affinity. 2013-10-25 17:00:52 -07:00
Jef Poskanzer
a953f5aa2c Re-do of how --omit works. 2013-10-24 14:08:04 -07:00
Jef Poskanzer
ea5d93b241 Always send omit client->server, otherwise omit==0 doesn't work. 2013-10-22 13:55:56 -07:00
Jef Poskanzer
965d8d7688 Added a summary line to the final report for the -F option. 2013-10-21 16:15:27 -07:00
Jef Poskanzer
e32a7bcd77 Added the -F / --file flag, to use a specified file instead
of random data for sending, and to save the data in the file
on receiving.
2013-10-19 07:43:38 -07:00
Jef Poskanzer
36662029e5 Added a timestamp in verbose and JSON output. 2013-09-14 08:59:50 -07:00
Jef Poskanzer
66ee0e2084 Got rid of the -d/--debug flag, it was not being used for anything. 2013-09-14 08:36:11 -07:00
Jef Poskanzer
cc2376c1e3 Bump version & date. 2013-09-14 08:33:17 -07:00
Jef Poskanzer
9e5f6f57f4 Add note in man page about the -w flag getting transmitted to the server. 2013-09-14 08:31:06 -07:00
Jef Poskanzer
f8bd11af23 Ran across a little error in some code that is currently
commented out. Worth fixing anyway.
2013-09-12 11:01:48 -07:00
Jef Poskanzer
65b2261d4c Slight enhancement to the logic for switching to SIGALRM timing mode. 2013-08-29 17:43:20 -07:00
Jef Poskanzer
8bdc8fffcf Fix bug in reverse mode. 2013-08-29 11:38:20 -07:00
Jef Poskanzer
78a711169e Crash fix from Aaron Brown. 2013-08-19 12:29:35 -07:00
Jef Poskanzer
5c01581b32 Detect that the system doesn't support IPv6 and try falling back to IPv4. 2013-08-19 10:02:01 -07:00
Jef Poskanzer
019434022c test->state needs to be explicitly signed char to accomodate a couple
of error states which are negative.  On most systems this doesn't
matter because char is signed, but on ARM CPUs char is unsigned.
2013-08-16 13:19:42 -07:00
Jef Poskanzer
cb6347fba9 Fix for issue 79, bad results when using the API. 2013-08-10 09:12:07 -07:00
Jef Poskanzer
d611f13e18 Fix incorrect default bandwidth limit when using the API instead
of the command line.
2013-07-12 19:56:49 -07:00
Andy Lake
861c06d862 Add queue.h to Makefile so will be included in package generated by 'make dist' 2013-07-11 14:07:41 -04:00
Jef Poskanzer
ba51358f7c Added API routines to get/set the verbose flag. 2013-07-10 15:12:51 -07:00
Jef Poskanzer
5789260432 Changed the -I / --ignore flag to -O / --omit, so that we can use the
same flag in bwctl.
2013-07-05 13:52:19 -07:00
Jef Poskanzer
26e392e175 Oops, left out the --version4 long opt. 2013-07-04 18:06:29 -07:00
Jef Poskanzer
c969359995 Added -I flag to ignore an initial period of data transfer,
defaulting to one second.
2013-07-03 12:01:57 -07:00
Jef Poskanzer
434e786fd0 More descriptive variable names for the throttling code. 2013-06-25 15:05:37 -07:00
Jef Poskanzer
647d3b95a8 New implementation of the -b bandwidth limit flag, that applies to
TCP as well as UDP.
2013-06-24 07:14:14 -07:00
Jef Poskanzer
cf06ba653a Server now exits after five consecutive errors. 2013-06-07 15:28:05 -07:00
Jef Poskanzer
3433c4d2c1 Better ifdefs for sendfile on OS/X. 2013-06-07 08:41:38 -07:00
Jef Poskanzer
c39c4f503f Added an ifdef for Mac OS/X version, to better protect the sendfile code. 2013-06-07 08:16:24 -07:00
Jef Poskanzer
5ec1d758f1 Raise maximum TCP buffer size to 512 MB. 2013-06-04 16:38:49 -07:00
Jef Poskanzer
481853ae5a Convert IPv4-mapped IPv6 address strings into regular old IPv4 format. 2013-06-04 00:11:41 -07:00
Jef Poskanzer
c687db9da2 Storing the known-to-not-work Flow Label code, just to save it.
The user-visible parts are commented out or return a "not implemented
yet" error message.  The other parts are harmless.

We'll come back to this once we figure out how exactly one sets
the Flow Label.
2013-06-03 13:12:43 -07:00
Jef Poskanzer
912bf5784f Add message emphasizing when we're doing reverse mode. 2013-05-31 10:36:12 -07:00
Jef Poskanzer
69bdbfd36d Handle retransmits correctly in reverse mode. 2013-05-29 15:18:18 -07:00
Jef Poskanzer
2c042fd469 Simplify multiple client/server forward/reverse checks into
a single sender boolean.
2013-05-29 12:32:42 -07:00
Jef Poskanzer
aa0e8fd5ac Remove temp file. 2013-05-25 07:22:11 -07:00
Jef Poskanzer
d95da48aee Bytes == 0 is no longer notable; bytes < 0 remains so. 2013-05-08 18:45:25 -07:00
Brian Tierney
854088329a remove "NLANR" tag 2013-05-08 14:53:31 -07:00
Jef Poskanzer
e321855d26 getopt_long returns int, not char. 2013-05-06 09:41:35 -07:00
Jef Poskanzer
12d474e2b4 A couple other places that used struct sockaddr_in when they should
have used struct sockaddr_storage - fixed now.
2013-05-02 15:28:30 -07:00
Jef Poskanzer
111645ed0f Fix UDP for IPv6 and dual-stack. 2013-05-02 15:18:07 -07:00
Jef Poskanzer
a27f6534b5 Added second concurrency model based on SIGALRM. 2013-04-09 11:42:30 -07:00
Jef Poskanzer
a6b3f26be1 Dual-stack operation - IPv4 and IP46 in the same server.
Also added -4 flag to force IPv4.
2013-03-29 17:49:27 -07:00
Jon M. Dugan
495aeb6ba7 bump date to current date 2013-03-28 12:02:39 -05:00
Jef Poskanzer
c50556ff4f Renamed burst mode to multisend mode, because there's an nuttcp feature
we want to add someday that is also called burst mode.
2013-03-13 09:41:02 -07:00
Jef Poskanzer
0f53b154a3 Improved setnonblocking() to set the flag on or off instead of just on. 2013-03-12 13:05:50 -07:00
Jef Poskanzer
65db384358 Polishing up the iperf3.1 man page. 2013-03-12 12:57:19 -07:00
Jef Poskanzer
3e58754281 Added library man page and examples subdir. 2013-03-11 22:03:36 -07:00
Jef Poskanzer
e96ab74093 Move the JSON initialization/finalization insode the API. 2013-03-08 20:56:52 -08:00
Jef Poskanzer
a5621dd908 Added zerocopy stuff to the API, so that bwctl can use it. 2013-03-06 07:46:28 -08:00
Jef Poskanzer
c57e9f2494 Slight change to net.c routines to better handle writes/sendfiles
to a full socket.
2013-03-04 16:11:03 -08:00
Jef Poskanzer
987b432316 A bunch of changes mixed together in this commit, but the significant
one is the new -Z flag.

- Fixed potential bug in net.c's Nread and Nwrite routines.  If they
had ever needed to loop they would have read/written the wrong address,
due to incorrect pointer arithmetic - sizeof(void) is not 1.  Fix
was to change the type of the buffer pointer to char*, which also
meant adding casts to some callers.

- Better checking for conflicts between command-line flags - now they
should no longer be order-dependent.

- Added a new -Z / --zerocopy flag, to use a "zero copy" method of
sending data, such as sendfile(2) instead of the usual write(2).

- Renumbered error enum to make inserting new ones easier.
2013-03-04 15:55:16 -08:00
Jef Poskanzer
358985eb58 Page-align the read/write buffer. Unclear if this helps, but
it certainly doesn't hurt.
2013-03-01 09:41:33 -08:00
Jef Poskanzer
0da578e79f Improved version of setnonblocking() - still not used. 2013-02-28 11:26:51 -08:00