10000 add TCP_INFO and TCP_MD5SIG socket option related structures · micropython/micropython@e2b4525 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2b4525

Browse files
fabledrichfelker
authored andcommitted
add TCP_INFO and TCP_MD5SIG socket option related structures
1 parent 65ea604 commit e2b4525

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

include/netinet/tcp.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,64 @@ struct tcphdr
7979
u_int16_t check;
8080
u_int16_t urg_ptr;
8181
};
82+
83+
#define TCPI_OPT_TIMESTAMPS 1
84+
#define TCPI_OPT_SACK 2
85+
#define TCPI_OPT_WSCALE 4
86+
#define TCPI_OPT_ECN 8
87+
88+
#define TCP_CA_Open 0
89+
#define TCP_CA_Disorder 1
90+
#define TCP_CA_CWR 2
91+
#define TCP_CA_Recovery 3
92+
#define TCP_CA_Loss 4
93+
94+
struct tcp_info
95+
{
96+
u_int8_t tcpi_state;
97+
u_int8_t tcpi_ca_state;
98+
u_int8_t tcpi_retransmits;
99+
u_int8_t tcpi_probes;
100+
u_int8_t tcpi_backoff;
101+
u_int8_t tcpi_options;
102+
u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
103+
u_int32_t tcpi_rto;
104+
u_int32_t tcpi_ato;
105+
u_int32_t tcpi_snd_mss;
106+
u_int32_t tcpi_rcv_mss;
107+
u_int32_t tcpi_unacked;
108+
u_int32_t tcpi_sacked;
109+
u_int32_t tcpi_lost;
110+
u_int32_t tcpi_retrans;
111+
u_int32_t tcpi_fackets;
112+
u_int32_t tcpi_last_data_sent;
113+
u_int32_t tcpi_last_ack_sent;
114+
u_int32_t tcpi_last_data_recv;
115+
u_int32_t tcpi_last_ack_recv;
116+
u_int32_t tcpi_pmtu;
117+
u_int32_t tcpi_rcv_ssthresh;
118+
u_int32_t tcpi_rtt;
119+
u_int32_t tcpi_rttvar;
120+
u_int32_t tcpi_snd_ssthresh;
121+
u_int32_t tcpi_snd_cwnd;
122+
u_int32_t tcpi_advmss;
123+
u_int32_t tcpi_reordering;
124+
u_int32_t tcpi_rcv_rtt;
125+
u_int32_t tcpi_rcv_space;
126+
u_int32_t tcpi_total_retrans;
127+
};
128+
129+
#define TCP_MD5SIG_MAXKEYLEN 80
130+
131+
struct tcp_md5sig
132+
{
133+
struct sockaddr_storage tcpm_addr;
134+
u_int16_t __tcpm_pad1;
135+
u_int16_t tcpm_keylen;
136+
u_int32_t __tcpm_pad2;
137+
u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
138+
};
139+
82140
#endif
83141

84142
#endif

0 commit comments

Comments
 (0)
0