ce426f
commit e83d72988d89378e7c70a1b7ba0b450a699ea70a
ce426f
Author: David S. Miller <davem@davemloft.net>
ce426f
Date:   Wed Jan 9 23:04:32 2013 -0800
ce426f
ce426f
    Sync netinet/tcp.h with upstream Linux kernel.
ce426f
    
ce426f
    	[BZ# 15003]
ce426f
    	* sysdeps/gnu/netinet/tcp.h (TCP_COOKIE_TRANSACTIONS,
ce426f
    	TCP_THIN_LINEAR_TIMEOUTS, TCP_THIN_DUPACK, TCP_USER_TIMEOUT,
ce426f
    	TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS,
ce426f
    	TCP_FASTOPEN): Define.
ce426f
    	(tcp_repair_opt): New structure.
ce426f
    	(TCP_NO_QUEUE, TCP_RECV_QUEUE, TCP_SEND_QUEUE, TCP_QUEUES_NR): New
ce426f
    	enum values.
ce426f
    	(TCP_COOKIE_MIN, TCP_COOKIE_MAX, TCP_COOKIE_PAIR_SIZE,
ce426f
    	TCP_COOKIE_IN_ALWAYS, TCP_COOKIE_OUT_NEVER, TCP_S_DATA_IN,
ce426f
    	TCP_S_DATA_OUT, TCP_MSS_DEFAULT, TCP_MSS_DESIRED): Define.
ce426f
    	(tcp_cookie_transactions): New structure.
ce426f
ce426f
diff --git glibc-2.17-c758a686/sysdeps/gnu/netinet/tcp.h glibc-2.17-c758a686/sysdeps/gnu/netinet/tcp.h
ce426f
index 278fc9d..b62a696 100644
ce426f
--- glibc-2.17-c758a686/sysdeps/gnu/netinet/tcp.h
ce426f
+++ glibc-2.17-c758a686/sysdeps/gnu/netinet/tcp.h
ce426f
@@ -37,20 +37,29 @@
ce426f
 /*
ce426f
  * User-settable options (used with setsockopt).
ce426f
  */
ce426f
-#define	TCP_NODELAY	 1	/* Don't delay send to coalesce packets  */
ce426f
-#define	TCP_MAXSEG	 2	/* Set maximum segment size  */
ce426f
-#define TCP_CORK	 3	/* Control sending of partial frames  */
ce426f
-#define TCP_KEEPIDLE	 4	/* Start keeplives after this period */
ce426f
-#define TCP_KEEPINTVL	 5	/* Interval between keepalives */
ce426f
-#define TCP_KEEPCNT	 6	/* Number of keepalives before death */
ce426f
-#define TCP_SYNCNT	 7	/* Number of SYN retransmits */
ce426f
-#define TCP_LINGER2	 8	/* Life time of orphaned FIN-WAIT-2 state */
ce426f
-#define TCP_DEFER_ACCEPT 9	/* Wake up listener only when data arrive */
ce426f
-#define TCP_WINDOW_CLAMP 10	/* Bound advertised window */
ce426f
-#define TCP_INFO	 11	/* Information about this connection. */
ce426f
-#define	TCP_QUICKACK	 12	/* Bock/reenable quick ACKs.  */
ce426f
-#define TCP_CONGESTION	 13	/* Congestion control algorithm.  */
ce426f
-#define TCP_MD5SIG	 14	/* TCP MD5 Signature (RFC2385) */
ce426f
+#define	TCP_NODELAY		 1  /* Don't delay send to coalesce packets  */
ce426f
+#define	TCP_MAXSEG		 2  /* Set maximum segment size  */
ce426f
+#define TCP_CORK		 3  /* Control sending of partial frames  */
ce426f
+#define TCP_KEEPIDLE		 4  /* Start keeplives after this period */
ce426f
+#define TCP_KEEPINTVL		 5  /* Interval between keepalives */
ce426f
+#define TCP_KEEPCNT		 6  /* Number of keepalives before death */
ce426f
+#define TCP_SYNCNT		 7  /* Number of SYN retransmits */
ce426f
+#define TCP_LINGER2		 8  /* Life time of orphaned FIN-WAIT-2 state */
ce426f
+#define TCP_DEFER_ACCEPT	 9  /* Wake up listener only when data arrive */
ce426f
+#define TCP_WINDOW_CLAMP	 10 /* Bound advertised window */
ce426f
+#define TCP_INFO		 11 /* Information about this connection. */
ce426f
+#define	TCP_QUICKACK		 12 /* Bock/reenable quick ACKs.  */
ce426f
+#define TCP_CONGESTION		 13 /* Congestion control algorithm.  */
ce426f
+#define TCP_MD5SIG		 14 /* TCP MD5 Signature (RFC2385) */
ce426f
+#define TCP_COOKIE_TRANSACTIONS	 15 /* TCP Cookie Transactions */
ce426f
+#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
ce426f
+#define TCP_THIN_DUPACK		 17 /* Fast retrans. after 1 dupack */
ce426f
+#define TCP_USER_TIMEOUT	 18 /* How long for loss retry before timeout */
ce426f
+#define TCP_REPAIR		 19 /* TCP sock is under repair right now */
ce426f
+#define TCP_REPAIR_QUEUE	 20 /* Set TCP queue to repair */
ce426f
+#define TCP_QUEUE_SEQ		 21 /* Set sequence number of repaired queue. */
ce426f
+#define TCP_REPAIR_OPTIONS	 22 /* Repair TCP connection options */
ce426f
+#define TCP_FASTOPEN		 23 /* Enable FastOpen on listeners */
ce426f
 
ce426f
 #ifdef __USE_MISC
ce426f
 # include <sys/types.h>
ce426f
@@ -243,6 +252,49 @@ struct tcp_md5sig
ce426f
   u_int8_t	tcpm_key[TCP_MD5SIG_MAXKEYLEN];	/* Key (binary).  */
ce426f
 };
ce426f
 
ce426f
+/* For socket repair options.  */
ce426f
+struct tcp_repair_opt
ce426f
+{
ce426f
+  u_int32_t	opt_code;
ce426f
+  u_int32_t	opt_val;
ce426f
+};
ce426f
+
ce426f
+/* Queue to repair, for TCP_REPAIR_QUEUE.  */
ce426f
+enum
ce426f
+{
ce426f
+  TCP_NO_QUEUE,
ce426f
+  TCP_RECV_QUEUE,
ce426f
+  TCP_SEND_QUEUE,
ce426f
+  TCP_QUEUES_NR,
ce426f
+};
ce426f
+
ce426f
+/* For cookie transactions socket options.  */
ce426f
+#define TCP_COOKIE_MIN		8		/*  64-bits */
ce426f
+#define TCP_COOKIE_MAX		16		/* 128-bits */
ce426f
+#define TCP_COOKIE_PAIR_SIZE	(2*TCP_COOKIE_MAX)
ce426f
+
ce426f
+/* Flags for both getsockopt and setsockopt */
ce426f
+#define TCP_COOKIE_IN_ALWAYS	(1 << 0)	/* Discard SYN without cookie */
ce426f
+#define TCP_COOKIE_OUT_NEVER	(1 << 1)	/* Prohibit outgoing cookies,
ce426f
+						 * supercedes everything. */
ce426f
+
ce426f
+/* Flags for getsockopt */
ce426f
+#define TCP_S_DATA_IN		(1 << 2)	/* Was data received? */
ce426f
+#define TCP_S_DATA_OUT		(1 << 3)	/* Was data sent? */
ce426f
+
ce426f
+#define TCP_MSS_DEFAULT		 536U	/* IPv4 (RFC1122, RFC2581) */
ce426f
+#define TCP_MSS_DESIRED		1220U	/* IPv6 (tunneled), EDNS0 (RFC3226) */
ce426f
+
ce426f
+struct tcp_cookie_transactions
ce426f
+{
ce426f
+  u_int16_t	tcpct_flags;
ce426f
+  u_int8_t	__tcpct_pad1;
ce426f
+  u_int8_t	tcpct_cookie_desired;
ce426f
+  u_int16_t	tcpct_s_data_desired;
ce426f
+  u_int16_t	tcpct_used;
ce426f
+  u_int8_t	tcpct_value[TCP_MSS_DEFAULT];
ce426f
+};
ce426f
+
ce426f
 #endif /* Misc.  */
ce426f
 
ce426f
 #endif /* netinet/tcp.h */