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
40 #define TCP_ESTABLISHED 1
41 #define TCP_SYN_SENT 2
42 #define TCP_SYN_RECV 3
43 #define TCP_FIN_WAIT1 4
44 #define TCP_FIN_WAIT2 5
45 #define TCP_TIME_WAIT 6
47 #define TCP_CLOSE_WAIT 8
48 #define TCP_LAST_ACK 9
50 #define TCP_CLOSING 11
56 TCP_NLA_SNDBUF_LIMITED,
57 TCP_NLA_DATA_SEGS_OUT,
58 TCP_NLA_TOTAL_RETRANS,
61 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
64 #define TCPOPT_MAXSEG 2
65 #define TCPOPT_WINDOW 3
66 #define TCPOPT_SACK_PERMITTED 4
68 #define TCPOPT_TIMESTAMP 8
69 #define TCPOLEN_SACK_PERMITTED 2
70 #define TCPOLEN_WINDOW 3
71 #define TCPOLEN_MAXSEG 4
72 #define TCPOLEN_TIMESTAMP 10
76 #include <sys/types.h>
77 #include <sys/socket.h>
81 typedef uint32_t tcp_seq;
101 #if __BYTE_ORDER == __LITTLE_ENDIAN
133 #if __BYTE_ORDER == __LITTLE_ENDIAN
152 #define TCPI_OPT_TIMESTAMPS 1
153 #define TCPI_OPT_SACK 2
154 #define TCPI_OPT_WSCALE 4
155 #define TCPI_OPT_ECN 8
157 #define TCP_CA_Open 0
158 #define TCP_CA_Disorder 1
160 #define TCP_CA_Recovery 3
161 #define TCP_CA_Loss 4
165 uint8_t tcpi_ca_state;
166 uint8_t tcpi_retransmits;
168 uint8_t tcpi_backoff;
169 uint8_t tcpi_options;
170 uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
171 uint8_t tcpi_delivery_rate_app_limited : 1;
174 uint32_t tcpi_snd_mss;
175 uint32_t tcpi_rcv_mss;
176 uint32_t tcpi_unacked;
177 uint32_t tcpi_sacked;
179 uint32_t tcpi_retrans;
180 uint32_t tcpi_fackets;
181 uint32_t tcpi_last_data_sent;
182 uint32_t tcpi_last_ack_sent;
183 uint32_t tcpi_last_data_recv;
184 uint32_t tcpi_last_ack_recv;
186 uint32_t tcpi_rcv_ssthresh;
188 uint32_t tcpi_rttvar;
189 uint32_t tcpi_snd_ssthresh;
190 uint32_t tcpi_snd_cwnd;
191 uint32_t tcpi_advmss;
192 uint32_t tcpi_reordering;
193 uint32_t tcpi_rcv_rtt;
194 uint32_t tcpi_rcv_space;
195 uint32_t tcpi_total_retrans;
196 uint64_t tcpi_pacing_rate;
197 uint64_t tcpi_max_pacing_rate;
198 uint64_t tcpi_bytes_acked;
199 uint64_t tcpi_bytes_received;
200 uint32_t tcpi_segs_out;
201 uint32_t tcpi_segs_in;
202 uint32_t tcpi_notsent_bytes;
203 uint32_t tcpi_min_rtt;
204 uint32_t tcpi_data_segs_in;
205 uint32_t tcpi_data_segs_out;
206 uint64_t tcpi_delivery_rate;
207 uint64_t tcpi_busy_time;
208 uint64_t tcpi_rwnd_limited;
209 uint64_t tcpi_sndbuf_limited;
212 #define TCP_MD5SIG_MAXKEYLEN 80
214 #define TCP_MD5SIG_FLAG_PREFIX 1
217 struct sockaddr_storage tcpm_addr;
219 uint8_t tcpm_prefixlen;
220 uint16_t tcpm_keylen;
222 uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
225 struct tcp_diag_md5sig {
227 uint8_t tcpm_prefixlen;
228 uint16_t tcpm_keylen;
229 uint32_t tcpm_addr[4];
230 uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
233 struct tcp_repair_window {