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,
85 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
88 #define TCPOPT_MAXSEG 2
89 #define TCPOPT_WINDOW 3
90 #define TCPOPT_SACK_PERMITTED 4
92 #define TCPOPT_TIMESTAMP 8
93 #define TCPOLEN_SACK_PERMITTED 2
94 #define TCPOLEN_WINDOW 3
95 #define TCPOLEN_MAXSEG 4
96 #define TCPOLEN_TIMESTAMP 10
100 #include <sys/types.h>
101 #include <sys/socket.h>
104 typedef uint32_t tcp_seq;
124 #if __BYTE_ORDER == __LITTLE_ENDIAN
156 #if __BYTE_ORDER == __LITTLE_ENDIAN
175 #define TCPI_OPT_TIMESTAMPS 1
176 #define TCPI_OPT_SACK 2
177 #define TCPI_OPT_WSCALE 4
178 #define TCPI_OPT_ECN 8
180 #define TCP_CA_Open 0
181 #define TCP_CA_Disorder 1
183 #define TCP_CA_Recovery 3
184 #define TCP_CA_Loss 4
186 enum tcp_fastopen_client_fail {
188 TFO_COOKIE_UNAVAILABLE,
190 TFO_SYN_RETRANSMITTED,
195 uint8_t tcpi_ca_state;
196 uint8_t tcpi_retransmits;
198 uint8_t tcpi_backoff;
199 uint8_t tcpi_options;
200 uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
201 uint8_t tcpi_delivery_rate_app_limited : 1, tcpi_fastopen_client_fail : 2;
204 uint32_t tcpi_snd_mss;
205 uint32_t tcpi_rcv_mss;
206 uint32_t tcpi_unacked;
207 uint32_t tcpi_sacked;
209 uint32_t tcpi_retrans;
210 uint32_t tcpi_fackets;
211 uint32_t tcpi_last_data_sent;
212 uint32_t tcpi_last_ack_sent;
213 uint32_t tcpi_last_data_recv;
214 uint32_t tcpi_last_ack_recv;
216 uint32_t tcpi_rcv_ssthresh;
218 uint32_t tcpi_rttvar;
219 uint32_t tcpi_snd_ssthresh;
220 uint32_t tcpi_snd_cwnd;
221 uint32_t tcpi_advmss;
222 uint32_t tcpi_reordering;
223 uint32_t tcpi_rcv_rtt;
224 uint32_t tcpi_rcv_space;
225 uint32_t tcpi_total_retrans;
226 uint64_t tcpi_pacing_rate;
227 uint64_t tcpi_max_pacing_rate;
228 uint64_t tcpi_bytes_acked;
229 uint64_t tcpi_bytes_received;
230 uint32_t tcpi_segs_out;
231 uint32_t tcpi_segs_in;
232 uint32_t tcpi_notsent_bytes;
233 uint32_t tcpi_min_rtt;
234 uint32_t tcpi_data_segs_in;
235 uint32_t tcpi_data_segs_out;
236 uint64_t tcpi_delivery_rate;
237 uint64_t tcpi_busy_time;
238 uint64_t tcpi_rwnd_limited;
239 uint64_t tcpi_sndbuf_limited;
240 uint32_t tcpi_delivered;
241 uint32_t tcpi_delivered_ce;
242 uint64_t tcpi_bytes_sent;
243 uint64_t tcpi_bytes_retrans;
244 uint32_t tcpi_dsack_dups;
245 uint32_t tcpi_reord_seen;
246 uint32_t tcpi_rcv_ooopack;
247 uint32_t tcpi_snd_wnd;
250 #define TCP_MD5SIG_MAXKEYLEN 80
252 #define TCP_MD5SIG_FLAG_PREFIX 0x1
253 #define TCP_MD5SIG_FLAG_IFINDEX 0x2
256 struct sockaddr_storage tcpm_addr;
258 uint8_t tcpm_prefixlen;
259 uint16_t tcpm_keylen;
261 uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
264 struct tcp_diag_md5sig {
266 uint8_t tcpm_prefixlen;
267 uint16_t tcpm_keylen;
268 uint32_t tcpm_addr[4];
269 uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
272 #define TCP_REPAIR_ON 1
273 #define TCP_REPAIR_OFF 0
274 #define TCP_REPAIR_OFF_NO_WP -1
276 struct tcp_repair_window {
284 struct tcp_zerocopy_receive {
287 uint32_t recv_skip_hint;