netinet/tcp.h: add tcp_info fields from linux v4.19
authorSzabolcs Nagy <nsz@port70.net>
Sat, 10 Nov 2018 20:04:50 +0000 (20:04 +0000)
committerRich Felker <dalias@aerifal.cx>
Wed, 13 Mar 2019 16:30:12 +0000 (12:30 -0400)
new fields for RFC 4898 tcp stats in linux
tcpi_bytes_sent added in commit ba113c3aa79a7f941ac162d05a3620bdc985c58d
tcpi_bytes_retrans added in commit fb31c9b9f6c85b1bad569ecedbde78d9e37cd87b
tcpi_dsack_dups added in commit 7e10b6554ff2ce7f86d5d3eec3af5db8db482caa
tcpi_reord_seen added in commit 7ec65372ca534217b53fd208500cf7aac223a383

The new fields change the size of a public struct and thus an ABI break,
but this is how the getsockopt TCP_INFO api is designed: the tcp_info
type must only be used with a length parameter in extern interfaces.

include/netinet/tcp.h

index 584af2f5b92c353c401f50b343b2560bafefe247..2eac793eddf0efcda5b3b963a1c9709a1de7f39f 100644 (file)
@@ -72,6 +72,10 @@ enum {
        TCP_NLA_SND_SSTHRESH,
        TCP_NLA_DELIVERED,
        TCP_NLA_DELIVERED_CE,
+       TCP_NLA_BYTES_SENT,
+       TCP_NLA_BYTES_RETRANS,
+       TCP_NLA_DSACK_DUPS,
+       TCP_NLA_REORD_SEEN,
 };
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
@@ -225,6 +229,10 @@ struct tcp_info {
        uint64_t tcpi_sndbuf_limited;
        uint32_t tcpi_delivered;
        uint32_t tcpi_delivered_ce;
+       uint64_t tcpi_bytes_sent;
+       uint64_t tcpi_bytes_retrans;
+       uint32_t tcpi_dsack_dups;
+       uint32_t tcpi_reord_seen;
 };
 
 #define TCP_MD5SIG_MAXKEYLEN    80