summaryrefslogtreecommitdiffstats
path: root/usr.bin/tcpbench/tcpbench.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Implement the nc(1) -D socket debug option also in tcpbench(1).bluhm2021-02-041-4/+20
| | | | | This allows to analyse TCP connections. OK claudio@
* tcpbench: display stats on SIGINFO, not just at exit. ok tb@ procter@ deraadt@sthen2020-05-041-3/+10
|
* Add ping(1)-like summary statistics.procter2020-05-021-40/+152
| | | | ok djm@ deraadt@
* Standardize argument naming for "sourceaddr" and unify the wording a bit,schwarze2020-02-121-2/+2
| | | | similar to what deraadt@ recently did in other manual pages.
* Prevent divide-by zero in tcpbench(1). Found while testing iwm(4).stsp2019-11-261-1/+5
| | | | | | | | | | | #0 0x000004c27b9051a9 in udp_process_slice (fd=<optimized out>, event=<optimized out>, v_sc=0x4c55279f500) at /usr/src/usr.bin/tcpbench/tcpbench.c:606 606 pps = (sc->udp_slice_pkts * 1000) / since_last; (gdb) p since_last $1 = 0 ok benno@
* If tpcbench(8) is startet with -r0 it does not print statistics.bluhm2018-09-281-1/+4
| | | | | | But there was still the header line. Make -r0 really quiet and document the feature. OK deraadt@
* Fix white spaces.bluhm2018-09-281-26/+26
|
* In the early pledge, add "unveil" to permit changes a little later on.deraadt2018-08-081-4/+17
| | | | | | If kernel variables are being watched unveil /dev/mem, /dev/kmem, and /dev/ksyms. If testing AF_UNIX, unveil that patch. The next pledge removes "unveil", then tcpbench is largely filesystem restricted.
* drop unnecessary timerclear; tv_sec & tv_usec are assigned immediatelycheloha2018-05-221-2/+1
| | | | | | From Nan Xiao ok tb@
* more errx -> err, from schwarze@benno2018-05-101-3/+3
|
* Do not mention TCP in tcpbench comments and error messages regardingbluhm2018-05-101-5/+5
| | | | | socket buffer sizes. They affect TCP, UDP, and UNIX. pointed out by Nan Xiao
* print strdup error with err(). From Nan Xiao nan AT chinadtrace DOTbenno2018-05-101-2/+2
| | | | org, Thanks.
* Add OpenBSD RCS id.bluhm2016-09-191-0/+2
|
* Add AF_UNIX support to tcpbench and also make it possible to randomize theclaudio2016-07-211-27/+60
| | | | | | write size in the client. pledge setup can be made tighter but that will be done in a second step. OK benno@, henning@, markus@ and some man page input by jmc@
* Lose the pointless third paramater to fcntl(F_GETFL). Using SOCK_NONBLOCKkrw2016-04-061-1/+1
| | | | | | instead of fcntl() dance would significantly change designed semantics. ok djm@
* remove unused variablechl2016-03-281-1/+1
| | | | ok millert@
* Instead of creating a socket with socket() or accept() and thenguenther2016-03-211-6/+2
| | | | | | | | setting the O_NONBLOCK flag on it with fcntl(F_SETFL) afterwards, just pass SOCK_NONBLOCK to socket() or accept4() and get it right to begin with. ok millert@ krw@ beck@ deraadt@ jca@
* pledge tcpbench, from David Hill, tweaked the -s case.benno2015-11-131-4/+17
| | | | ok deraadt@
* If the kmem options are in use, drop the gid earlier.deraadt2015-02-091-10/+11
| | | | ok djm
* Prefer setvbuf() to setlinebuf() for portability; ok deraadt@millert2014-11-261-1/+1
|
* Remove unnecessary include: netinet/in_systm.h is not needed by theselteo2014-10-241-1/+0
| | | | | | programs. ok deraadt@ millert@
* Use reallocarray() to get integer overflow detection.lteo2014-10-161-2/+2
| | | | ok deraadt@ djm@
* add -4 and -6 flags for saying if you want to force ipv4 or ipv6dlg2014-08-191-3/+11
| | | | | | | respectively. tweaks from jmc@ ok djm@
* final circleq to tailq fix. restore the previous pointer check by readingtedu2013-12-251-1/+12
| | | | | the previous value again and checking prev.next is still next. maybe ok guenther
* more fixing after circleq conversion. a better fix to check the prevtedu2013-12-241-13/+4
| | | | pointer is forthcoming.
* Switch inpt_queue from CIRCLEQ to TAILQ. Thus ending use of CIRCLEQkrw2013-12-201-4/+4
| | | | | | | in the base. Ports fixes to follow shortly for the two ports (gkrellm and net-snmp) affected. ok zhuk@ millert@
* handle ECONNABORTED errors from accept(). In many code blocks they can bederaadt2013-03-111-1/+2
| | | | | ignored silently and without aborting, much like EINTR and EWOULDBLOCK are. ok's from various maintainers of these directories...
* Simplify rtable assignment and cut some crufthaesbaert2012-10-021-22/+5
|
* When the last user disconnects, make sure we display the status linehaesbaert2012-06-161-4/+5
| | | | | | one more time. ok sthen@
* Fix double-free when -n is used with -b.haesbaert2012-05-081-1/+2
| | | | From Erik Lax, also tested by lteo.
* Kill "goto again" uppon EINTR and check EWOULDBLOCK in accept(2).haesbaert2012-04-131-19/+7
| | | | | | Also make the code more similar to the other daemons. "you can go ahead" deraadt@.
* Rate-limit accepting of new connections while we are experiencing fdhaesbaert2012-04-071-10/+50
| | | | | | exaustion for tcpbench. ok deraadt
* Remove setpgid() call, this is a leftover from when we were forked.haesbaert2012-01-311-3/+0
| | | | | | From Erik Lax "commit it" mikeb@
* Don't use floating precision while printing PPS in UDP mode.haesbaert2012-01-291-3/+3
| | | | | "go for it" mikeb@ "looks good to me" henning@
* add a timer to tcpbench as a command-line option (-t) sohenning2012-01-261-4/+26
| | | | | | | that it is possible to stop the tcpbench client after a certain number of seconds. This makes it easier to use tcpbench as part of a script. From: Lawrence Teo <lteo at lteo.net> ok phessler haesbaert and myself
* Don't lie the number of estabilished connections. nconns is the numberhaesbaert2011-12-181-1/+2
| | | | of requested, not estabilished connections, so use mainstats.nconns.
* Fix some warnx() calls which should be fprintf plus KNF.haesbaert2011-12-041-5/+5
|
* Kill unecessary break in UDP_MODE, simplify code a bit by killing somehaesbaert2011-10-071-18/+11
| | | | | | conditionals, KNF. No functional changes. ok claudio@
* Sort the lines on -l output and match the order on the column output.haesbaert2011-10-011-40/+41
| | | | | | | Also make the -l output go to stdout as it's easier to grep with it, and set stdout to linebuf. ok djm@ "as long as you add a setlinebuf(stdout) :-)"
* Add -b option which allows the client side to bind the socket to ahaesbaert2011-09-091-11/+43
| | | | | | numeric address. Requested by mikeb@ in order to test ipsec. ok mcbride mikeb djm jmc
* Allow TOS/TCLASS to be set with -T, accept the same keywords as in pf.conf.haesbaert2011-08-231-4/+98
| | | | | ok mcbride@ djm@ 'fine from me' jmc@
* event_del() a persistent event; fixes segfault seen on the server when thesthen2011-08-201-0/+1
| | | | | | remote end closes and reopens a connection. From Christiano F. Haesbaert, ok claudio@
* Convert SO_RTABLE's protocol level to the SOL_SOCKET; ok claudiomikeb2011-06-211-12/+18
|
* various cleanup;jmc2011-03-161-4/+4
|
* Implement UDP mode for tcpbench and switch tcpbench to use libevent.claudio2011-03-091-427/+461
| | | | | | | | In UDP mode the tcpbench client tries to flood the pipe to the maximum and the server will busy read the packets. For TCP mode nothing has changed. All the work was done by Christiano F. Haesbaert (haesbaert(at)haesbaert org). OK myself and a lot of pushing from deraadt@
* Add a few more tcpcb and sockbuffer variables that tcpbench can inspect.claudio2010-10-191-0/+12
|
* Make -k work in clientmode by passing the right socket to theclaudio2010-09-281-3/+2
| | | | stats_prepare() function.
* Fix the naming of interfaces and variables for rdomains and rtablesguenther2010-07-031-18/+18
| | | | | | | | | | | | and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
* try not to use size_t in places it does not belong; ok djmderaadt2009-12-111-5/+5
|
* - adjust usage() to fit in 80 columnssthen2009-09-111-5/+4
| | | | | | | - re-order client options in usage() to match server options and the manual, as suggested by jmc. ok jmc@