From 338e6102a60a33661812753f03f1d426ab1a7fe1 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 3 Jan 2014 15:58:40 -0800 Subject: [PATCH] Add TCPOPT_* constants. Adds the TCPOPT_* constants from NetBSD. Note that the BSDs also have TCPOPT_SIGNATURE, but Linux calls that TCPOPT_MD5SIG and glibc doesn't have any corresponding constant yet, so let's wait until we see which name wins out. Change-Id: If53cdada5595285d9a7e7248ef74cd7502d804c0 --- libc/include/netinet/tcp.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libc/include/netinet/tcp.h b/libc/include/netinet/tcp.h index bc52249b4..5601645ee 100644 --- a/libc/include/netinet/tcp.h +++ b/libc/include/netinet/tcp.h @@ -25,10 +25,10 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + #ifndef _NETINET_TCP_H #define _NETINET_TCP_H -#include /* Include *before* linux/tcp.h */ #include __BEGIN_DECLS @@ -47,6 +47,21 @@ enum { TCP_CLOSING }; +#define TCPOPT_EOL 0 +#define TCPOPT_NOP 1 +#define TCPOPT_MAXSEG 2 +#define TCPOLEN_MAXSEG 4 +#define TCPOPT_WINDOW 3 +#define TCPOLEN_WINDOW 3 +#define TCPOPT_SACK_PERMITTED 4 +#define TCPOLEN_SACK_PERMITTED 2 +#define TCPOPT_SACK 5 +#define TCPOPT_TIMESTAMP 8 +#define TCPOLEN_TIMESTAMP 10 +#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) + +#define TCPOPT_TSTAMP_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) + __END_DECLS #endif /* _NETINET_TCP_H */