diff options
| author | Mikhail Kshevetskiy <[email protected]> | 2024-12-28 13:46:29 +0300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-12-28 11:59:42 -0600 |
| commit | ddedfe1cb8b6c262990b629494165082320cc884 (patch) | |
| tree | 8e3f575a7742331bc7717951ddf2359f0e2e6f9c /include/net | |
| parent | 40d3d6557d929bed17eafe1fab05b2ac7b3c6d01 (diff) | |
net/tcp: put connection specific data into a tcp_stream structure
no functional changes
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/tcp.h | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index c29d4ce24a7..14aee64cb1c 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -277,9 +277,40 @@ enum tcp_state { TCP_FIN_WAIT_2 }; -enum tcp_state tcp_get_tcp_state(void); -void tcp_set_tcp_state(enum tcp_state new_state); -int tcp_set_tcp_header(uchar *pkt, int dport, int sport, int payload_len, +/** + * struct tcp_stream - TCP data stream structure + * + * @state: TCP connection state + * + * @seq_init: Initial receive sequence number + * @ack_edge: Receive next + * + * @loc_timestamp: Local timestamp + * @rmt_timestamp: Remote timestamp + * + * @lost: Used for SACK + */ +struct tcp_stream { + /* TCP connection state */ + enum tcp_state state; + + u32 seq_init; + u32 ack_edge; + + /* TCP option timestamp */ + u32 loc_timestamp; + u32 rmt_timestamp; + + /* TCP sliding window control used to request re-TX */ + struct tcp_sack_v lost; +}; + +struct tcp_stream *tcp_stream_get(void); + +enum tcp_state tcp_get_tcp_state(struct tcp_stream *tcp); +void tcp_set_tcp_state(struct tcp_stream *tcp, enum tcp_state new_state); +int tcp_set_tcp_header(struct tcp_stream *tcp, uchar *pkt, int dport, + int sport, int payload_len, u8 action, u32 tcp_seq_num, u32 tcp_ack_num); /** |
