summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2023-05-19 01:04:40 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2023-05-19 01:04:40 +0000
commit195e450bddd093cbc2cc085e8a37a440c09e3045 (patch)
treecfc9364bd13dd37c06660d80bd09368360e10bb2
parentf9317185ffaf9fabf924796a1986aedf0ee2428d (diff)
Move tcp_info structure to be under '#if __BSD_VISIBLE' to repair
compliance with POSIX/SUS restrictions on <netinet/tcp.h> ok bluhm@ ports testing and ok sthen@
-rw-r--r--sys/netinet/tcp.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index b9cf23d4c53..9783d731bdf 100644
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp.h,v 1.23 2022/08/11 09:13:21 claudio Exp $ */
+/* $OpenBSD: tcp.h,v 1.24 2023/05/19 01:04:39 guenther Exp $ */
/* $NetBSD: tcp.h,v 1.8 1995/04/17 05:32:58 cgd Exp $ */
/*
@@ -117,24 +117,6 @@ struct tcphdr {
#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
-#endif /* __BSD_VISIBLE */
-
-/*
- * User-settable options (used with setsockopt).
- */
-#define TCP_NODELAY 0x01 /* don't delay send to coalesce pkts */
-#define TCP_MAXSEG 0x02 /* set maximum segment size */
-#define TCP_MD5SIG 0x04 /* enable TCP MD5 signature option */
-#define TCP_SACK_ENABLE 0x08 /* enable SACKs (if disabled by def.) */
-#define TCP_INFO 0x09 /* retrieve tcp_info structure */
-#define TCP_NOPUSH 0x10 /* don't push last block of write */
-
-#define TCPI_OPT_TIMESTAMPS 0x01
-#define TCPI_OPT_SACK 0x02
-#define TCPI_OPT_WSCALE 0x04
-#define TCPI_OPT_ECN 0x08
-#define TCPI_OPT_TOE 0x10
-
/*
* The TCP_INFO socket option comes from the Linux 2.6 TCP API, and permits
* the caller to query certain information about the state of a TCP
@@ -149,6 +131,11 @@ struct tcp_info {
uint8_t __tcpi_probes;
uint8_t __tcpi_backoff;
uint8_t tcpi_options; /* Options enabled on conn. */
+#define TCPI_OPT_TIMESTAMPS 0x01
+#define TCPI_OPT_SACK 0x02
+#define TCPI_OPT_WSCALE 0x04
+#define TCPI_OPT_ECN 0x08
+#define TCPI_OPT_TOE 0x10
uint8_t tcpi_snd_wscale; /* RFC1323 send shift value. */
uint8_t tcpi_rcv_wscale; /* RFC1323 recv shift value. */
@@ -220,4 +207,16 @@ struct tcp_info {
uint32_t tcpi_so_snd_sb_wat;
};
+#endif /* __BSD_VISIBLE */
+
+/*
+ * User-settable options (used with setsockopt).
+ */
+#define TCP_NODELAY 0x01 /* don't delay send to coalesce pkts */
+#define TCP_MAXSEG 0x02 /* set maximum segment size */
+#define TCP_MD5SIG 0x04 /* enable TCP MD5 signature option */
+#define TCP_SACK_ENABLE 0x08 /* enable SACKs (if disabled by def.) */
+#define TCP_INFO 0x09 /* retrieve tcp_info structure */
+#define TCP_NOPUSH 0x10 /* don't push last block of write */
+
#endif /* _NETINET_TCP_H_ */