summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2010-10-23 22:50:08 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2010-10-23 22:50:08 +0000
commitbc1b833472e6c54c5065114926c97c9391315d38 (patch)
treefee7df8b49278aa1562e4a7b3698c684037b9a27
parent4f8b2f3c313f5d4001ac0093c82f0f68c8b126c1 (diff)
Fix pr 6192: make netinet/tcp.h follow SUSv4 namespace rules by
hiding everything but the TCP_* options unless __BSD_VISIBLE. While we're here, change the structure to use u_int32_t instead of u_int to cut-off the types discussion. ok tedu@, mikeb@
-rw-r--r--sys/netinet/tcp.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index c6b22e70c3b..2dffa983efd 100644
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp.h,v 1.17 2006/04/27 02:19:32 tedu Exp $ */
+/* $OpenBSD: tcp.h,v 1.18 2010/10/23 22:50:07 guenther Exp $ */
/* $NetBSD: tcp.h,v 1.8 1995/04/17 05:32:58 cgd Exp $ */
/*
@@ -35,6 +35,10 @@
#ifndef _NETINET_TCP_H_
#define _NETINET_TCP_H_
+#include <sys/cdefs.h>
+
+#if __BSD_VISIBLE
+
typedef u_int32_t tcp_seq;
/*
@@ -47,11 +51,11 @@ struct tcphdr {
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
#if _BYTE_ORDER == _LITTLE_ENDIAN
- u_int th_x2:4, /* (unused) */
+ u_int32_t th_x2:4, /* (unused) */
th_off:4; /* data offset */
#endif
#if _BYTE_ORDER == _BIG_ENDIAN
- u_int th_off:4, /* data offset */
+ u_int32_t th_off:4, /* data offset */
th_x2:4; /* (unused) */
#endif
u_int8_t th_flags;
@@ -114,6 +118,8 @@ struct tcphdr {
#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
+#endif /* __BSD_VISIBLE */
+
/*
* User-settable options (used with setsockopt).
*/