Index | Thread | Search

From:
Alexander Bluhm <bluhm@openbsd.org>
Subject:
Re: tcpbench: cleanup headers
To:
tech@openbsd.org
Date:
Mon, 27 Jul 2026 20:07:28 +0200

Download raw body.

Thread
On Mon, Jul 27, 2026 at 10:57:56PM +1000, Jonathan Gray wrote:
> On Mon, Jul 27, 2026 at 02:46:10PM +0200, Claudio Jeker wrote:
> > With the use of TCP_INFO and struct tcp_info none of those kernel internal
> > headers are needed anymore.
> > 
> > Code still compiles for me.
> 
> include-what-you-use shows some more

I maintain the tcpbench-portable Linux port.  There it also works
and reduces #ifdef __OpenBSD__

https://github.com/bluhm/tcpbench-portable/pull/40/changes

OK bluhm@

> Index: tcpbench.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/tcpbench/tcpbench.c,v
> diff -u -p -r1.76 tcpbench.c
> --- tcpbench.c	6 Dec 2025 09:48:30 -0000	1.76
> +++ tcpbench.c	27 Jul 2026 12:54:47 -0000
> @@ -20,22 +20,13 @@
>  #include <sys/types.h>
>  #include <sys/time.h>
>  #include <sys/socket.h>
> -#include <sys/socketvar.h>
>  #include <sys/resource.h>
>  #include <sys/queue.h>
>  #include <sys/un.h>
>  
> -#include <net/route.h>
> -
>  #include <netinet/in.h>
>  #include <netinet/ip.h>
>  #include <netinet/tcp.h>
> -#include <netinet/tcp_timer.h>
> -#include <netinet/tcp_fsm.h>
> -#include <netinet/in_pcb.h>
> -#include <netinet/tcp_var.h>
> -
> -#include <arpa/inet.h>
>  
>  #include <unistd.h>
>  #include <limits.h>
> @@ -49,14 +40,8 @@
>  #include <err.h>
>  #include <fcntl.h>
>  #include <poll.h>
> -#include <paths.h>
>  #include <math.h>
>  #include <tls.h>
> -
> -#include <openssl/evp.h>
> -#include <openssl/rsa.h>
> -#include <openssl/pem.h>
> -#include <openssl/x509.h>
>  
>  #define DEFAULT_PORT "12345"
>  #define DEFAULT_STATS_INTERVAL 1000 /* ms */
> 
>