public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] This is an implementation of the client side of TCP Fast Open (TFO)
@ 2018-08-24 13:10 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2018-08-24 13:10 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b4d6660d85b244191d2e507e9bdaba14ed9cca12

commit b4d6660d85b244191d2e507e9bdaba14ed9cca12
Author: pkelsey <pkelsey@FreeBSD.org>
Date:   Mon Feb 26 02:53:22 2018 +0000

    This is an implementation of the client side of TCP Fast Open (TFO)
    
    [RFC7413]. It also includes a pre-shared key mode of operation in which
    the server requires the client to be in possession of a shared secret in
    order to successfully open TFO connections with that server.
    
    The names of some existing fastopen sysctls have changed (e.g.,
    net.inet.tcp.fastopen.enabled -> net.inet.tcp.fastopen.server_enable).
    
    Reviewed by:	tuexen
    MFC after:	1 month
    Sponsored by:	Limelight Networks
    Differential Revision:	https://reviews.freebsd.org/D14047

Diff:
---
 newlib/libc/sys/rtems/include/netinet/tcp.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/netinet/tcp.h b/newlib/libc/sys/rtems/include/netinet/tcp.h
index 7eb4e9a..4c1c9d4 100644
--- a/newlib/libc/sys/rtems/include/netinet/tcp.h
+++ b/newlib/libc/sys/rtems/include/netinet/tcp.h
@@ -101,8 +101,6 @@ struct tcphdr {
 #define	   TCPOLEN_SIGNATURE		18
 #define	TCPOPT_FAST_OPEN	34
 #define	   TCPOLEN_FAST_OPEN_EMPTY	2
-#define	   TCPOLEN_FAST_OPEN_MIN	6
-#define	   TCPOLEN_FAST_OPEN_MAX	18
 
 /* Miscellaneous constants */
 #define	MAX_SACK_BLKS	6	/* Max # SACK blocks stored at receiver side */
@@ -152,6 +150,10 @@ struct tcphdr {
 #define TCP_MAXHLEN	(0xf<<2)	/* max length of header in bytes */
 #define TCP_MAXOLEN	(TCP_MAXHLEN - sizeof(struct tcphdr))
 					/* max space left for options */
+
+#define TCP_FASTOPEN_MIN_COOKIE_LEN	4	/* Per RFC7413 */
+#define TCP_FASTOPEN_MAX_COOKIE_LEN	16	/* Per RFC7413 */
+#define TCP_FASTOPEN_PSK_LEN		16	/* Same as TCP_FASTOPEN_KEY_LEN */
 #endif /* __BSD_VISIBLE */
 
 /*
@@ -252,6 +254,16 @@ struct tcp_info {
 	/* Padding to grow without breaking ABI. */
 	u_int32_t	__tcpi_pad[26];		/* Padding. */
 };
+
+/*
+ * If this structure is provided when setting the TCP_FASTOPEN socket
+ * option, and the enable member is non-zero, a subsequent connect will use
+ * pre-shared key (PSK) mode using the provided key.
+ */
+struct tcp_fastopen {
+	int enable;
+	uint8_t psk[TCP_FASTOPEN_PSK_LEN];
+};
 #endif
 #define TCP_FUNCTION_NAME_LEN_MAX 32


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-24 13:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-24 13:10 [newlib-cygwin] This is an implementation of the client side of TCP Fast Open (TFO) Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).