10 #define TCP_KEEPINTVL 5
14 #define TCP_DEFER_ACCEPT 9
15 #define TCP_WINDOW_CLAMP 10
17 #define TCP_QUICKACK 12
18 #define TCP_CONGESTION 13
20 #define TCP_THIN_LINEAR_TIMEOUTS 16
21 #define TCP_THIN_DUPACK 17
22 #define TCP_USER_TIMEOUT 18
24 #define TCP_REPAIR_QUEUE 20
25 #define TCP_QUEUE_SEQ 21
26 #define TCP_REPAIR_OPTIONS 22
27 #define TCP_FASTOPEN 23
28 #define TCP_TIMESTAMP 24
29 #define TCP_NOTSENT_LOWAT 25
30 #define TCP_CC_INFO 26
31 #define TCP_SAVE_SYN 27
32 #define TCP_SAVED_SYN 28
33 #define TCP_REPAIR_WINDOW 29
34 #define TCP_FASTOPEN_CONNECT 30
36 #define TCP_MD5SIG_EXT 32
37 #define TCP_FASTOPEN_KEY 33
38 #define TCP_FASTOPEN_NO_COOKIE 34
39 #define TCP_ZEROCOPY_RECEIVE 35
41 #define TCP_TX_DELAY 37
43 #define TCP_CM_INQ TCP_INQ
45 #define TCP_ESTABLISHED 1
46 #define TCP_SYN_SENT 2
47 #define TCP_SYN_RECV 3
48 #define TCP_FIN_WAIT1 4
49 #define TCP_FIN_WAIT2 5
50 #define TCP_TIME_WAIT 6
52 #define TCP_CLOSE_WAIT 8
53 #define TCP_LAST_ACK 9
55 #define TCP_CLOSING 11
61 TCP_NLA_SNDBUF_LIMITED
,
62 TCP_NLA_DATA_SEGS_OUT
,
63 TCP_NLA_TOTAL_RETRANS
,
65 TCP_NLA_DELIVERY_RATE
,
69 TCP_NLA_RECUR_RETRANS
,
70 TCP_NLA_DELIVERY_RATE_APP_LMT
,
77 TCP_NLA_BYTES_RETRANS
,
81 TCP_NLA_TIMEOUT_REHASH
,
82 TCP_NLA_BYTES_NOTSENT
,
87 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
90 #define TCPOPT_MAXSEG 2
91 #define TCPOPT_WINDOW 3
92 #define TCPOPT_SACK_PERMITTED 4
94 #define TCPOPT_TIMESTAMP 8
95 #define TCPOLEN_SACK_PERMITTED 2
96 #define TCPOLEN_WINDOW 3
97 #define TCPOLEN_MAXSEG 4
98 #define TCPOLEN_TIMESTAMP 10
102 #include <sys/types.h>
103 #include <sys/socket.h>
106 typedef uint32_t tcp_seq
;
126 #if __BYTE_ORDER == __LITTLE_ENDIAN
158 #if __BYTE_ORDER == __LITTLE_ENDIAN
177 #define TCPI_OPT_TIMESTAMPS 1
178 #define TCPI_OPT_SACK 2
179 #define TCPI_OPT_WSCALE 4
180 #define TCPI_OPT_ECN 8
182 #define TCP_CA_Open 0
183 #define TCP_CA_Disorder 1
185 #define TCP_CA_Recovery 3
186 #define TCP_CA_Loss 4
188 enum tcp_fastopen_client_fail
{
190 TFO_COOKIE_UNAVAILABLE
,
192 TFO_SYN_RETRANSMITTED
,
197 uint8_t tcpi_ca_state
;
198 uint8_t tcpi_retransmits
;
200 uint8_t tcpi_backoff
;
201 uint8_t tcpi_options
;
202 uint8_t tcpi_snd_wscale
: 4, tcpi_rcv_wscale
: 4;
203 uint8_t tcpi_delivery_rate_app_limited
: 1, tcpi_fastopen_client_fail
: 2;
206 uint32_t tcpi_snd_mss
;
207 uint32_t tcpi_rcv_mss
;
208 uint32_t tcpi_unacked
;
209 uint32_t tcpi_sacked
;
211 uint32_t tcpi_retrans
;
212 uint32_t tcpi_fackets
;
213 uint32_t tcpi_last_data_sent
;
214 uint32_t tcpi_last_ack_sent
;
215 uint32_t tcpi_last_data_recv
;
216 uint32_t tcpi_last_ack_recv
;
218 uint32_t tcpi_rcv_ssthresh
;
220 uint32_t tcpi_rttvar
;
221 uint32_t tcpi_snd_ssthresh
;
222 uint32_t tcpi_snd_cwnd
;
223 uint32_t tcpi_advmss
;
224 uint32_t tcpi_reordering
;
225 uint32_t tcpi_rcv_rtt
;
226 uint32_t tcpi_rcv_space
;
227 uint32_t tcpi_total_retrans
;
228 uint64_t tcpi_pacing_rate
;
229 uint64_t tcpi_max_pacing_rate
;
230 uint64_t tcpi_bytes_acked
;
231 uint64_t tcpi_bytes_received
;
232 uint32_t tcpi_segs_out
;
233 uint32_t tcpi_segs_in
;
234 uint32_t tcpi_notsent_bytes
;
235 uint32_t tcpi_min_rtt
;
236 uint32_t tcpi_data_segs_in
;
237 uint32_t tcpi_data_segs_out
;
238 uint64_t tcpi_delivery_rate
;
239 uint64_t tcpi_busy_time
;
240 uint64_t tcpi_rwnd_limited
;
241 uint64_t tcpi_sndbuf_limited
;
242 uint32_t tcpi_delivered
;
243 uint32_t tcpi_delivered_ce
;
244 uint64_t tcpi_bytes_sent
;
245 uint64_t tcpi_bytes_retrans
;
246 uint32_t tcpi_dsack_dups
;
247 uint32_t tcpi_reord_seen
;
248 uint32_t tcpi_rcv_ooopack
;
249 uint32_t tcpi_snd_wnd
;
252 #define TCP_MD5SIG_MAXKEYLEN 80
254 #define TCP_MD5SIG_FLAG_PREFIX 0x1
255 #define TCP_MD5SIG_FLAG_IFINDEX 0x2
258 struct sockaddr_storage tcpm_addr
;
260 uint8_t tcpm_prefixlen
;
261 uint16_t tcpm_keylen
;
263 uint8_t tcpm_key
[TCP_MD5SIG_MAXKEYLEN
];
266 struct tcp_diag_md5sig
{
268 uint8_t tcpm_prefixlen
;
269 uint16_t tcpm_keylen
;
270 uint32_t tcpm_addr
[4];
271 uint8_t tcpm_key
[TCP_MD5SIG_MAXKEYLEN
];
274 #define TCP_REPAIR_ON 1
275 #define TCP_REPAIR_OFF 0
276 #define TCP_REPAIR_OFF_NO_WP -1
278 struct tcp_repair_window
{
286 #define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1
288 struct tcp_zerocopy_receive
{
291 uint32_t recv_skip_hint
;
294 uint64_t copybuf_address
;
297 uint64_t msg_control
;
298 uint64_t msg_controllen
;