From 096fa94f0c62f5cd813f35bd229f2c6f003e92c3 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 13 Jul 2007 11:32:53 +0100 Subject: Add support for TCP timestamps --- src/include/gpxe/tcp.h | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/gpxe/tcp.h b/src/include/gpxe/tcp.h index d927d2411..d967791f1 100644 --- a/src/include/gpxe/tcp.h +++ b/src/include/gpxe/tcp.h @@ -27,18 +27,59 @@ struct tcp_header { uint16_t urg; /* Urgent pointer */ }; -/** - * TCP MSS option +/** @defgroup tcpopts TCP options + * @{ */ + +/** End of TCP options list */ +#define TCP_OPTION_END 0 + +/** TCP option pad */ +#define TCP_OPTION_NOP 1 + +/** Generic TCP option */ +struct tcp_option { + uint8_t kind; + uint8_t length; +} __attribute__ (( packed )); + +/** TCP MSS option */ struct tcp_mss_option { uint8_t kind; uint8_t length; uint16_t mss; -}; +} __attribute__ (( packed )); /** Code for the TCP MSS option */ #define TCP_OPTION_MSS 2 +/** TCP timestamp option */ +struct tcp_timestamp_option { + uint8_t kind; + uint8_t length; + uint32_t tsval; + uint32_t tsecr; +} __attribute__ (( packed )); + +/** Padded TCP timestamp option (used for sending) */ +struct tcp_timestamp_padded_option { + uint8_t nop[2]; + struct tcp_timestamp_option tsopt; +} __attribute__ (( packed )); + +/** Code for the TCP timestamp option */ +#define TCP_OPTION_TS 8 + +/** Parsed TCP options */ +struct tcp_options { + /** MSS option, if present */ + const struct tcp_mss_option *mssopt; + /** Timestampe option, if present */ + const struct tcp_timestamp_option *tsopt; +}; + +/** @} */ + /* * TCP flags */ -- cgit v1.2.3-55-g7522