summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-11-30 18:50:20 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-11-30 18:50:20 +0000
commit0fa29ed3de6efe4c1718a1d01c73f320dbfbe53a (patch)
treea661a68f1de56c9ea0ffe003b5cc6063b877f129
parent82e3aed69c58396e3e6765d48b1017f3ae9b4079 (diff)
Move in_addr_t and in_port_t to <sys/types.h> and add sa_family_t
and suseconds_t types for XPG4.2.
-rw-r--r--sys/netinet/in.h12
-rw-r--r--sys/sys/endian.h5
-rw-r--r--sys/sys/socket.h8
-rw-r--r--sys/sys/types.h14
4 files changed, 24 insertions, 15 deletions
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 88d7848dc31..d86a6779e8d 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.h,v 1.10 1997/07/28 15:22:30 millert Exp $ */
+/* $OpenBSD: in.h,v 1.11 1997/11/30 18:50:19 millert Exp $ */
/* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */
/*
@@ -193,11 +193,11 @@ struct in_addr {
* Socket address, internet style.
*/
struct sockaddr_in {
- u_int8_t sin_len;
- u_int8_t sin_family;
- u_int16_t sin_port;
- struct in_addr sin_addr;
- int8_t sin_zero[8];
+ u_int8_t sin_len;
+ sa_family_t sin_family;
+ in_port_t sin_port;
+ struct in_addr sin_addr;
+ int8_t sin_zero[8];
};
/*
diff --git a/sys/sys/endian.h b/sys/sys/endian.h
index 5af7fd3d4e0..5e9bee14be4 100644
--- a/sys/sys/endian.h
+++ b/sys/sys/endian.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: endian.h,v 1.2 1997/11/10 10:29:14 niklas Exp $ */
+/* $OpenBSD: endian.h,v 1.3 1997/11/30 18:50:17 millert Exp $ */
/*-
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
@@ -51,9 +51,6 @@
#define BIG_ENDIAN 4321
#define PDP_ENDIAN 3412
-typedef u_int32_t in_addr_t;
-typedef u_int16_t in_port_t;
-
#ifdef __GNUC__
#define __swap16gen(x) ({ \
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index 0e038d8dc5d..9548b7b643f 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: socket.h,v 1.18 1997/11/16 19:57:39 deraadt Exp $ */
+/* $OpenBSD: socket.h,v 1.19 1997/11/30 18:50:17 millert Exp $ */
/* $NetBSD: socket.h,v 1.14 1996/02/09 18:25:36 christos Exp $ */
/*
@@ -135,9 +135,9 @@ struct linger {
* addresses.
*/
struct sockaddr {
- u_char sa_len; /* total length */
- u_char sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
+ u_int8_t sa_len; /* total length */
+ sa_family_t sa_family; /* address family */
+ char sa_data[14]; /* actually longer; address value */
};
/*
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 6159e50a7d5..9ba246f0123 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: types.h,v 1.11 1997/11/06 01:25:47 millert Exp $ */
+/* $OpenBSD: types.h,v 1.12 1997/11/30 18:50:18 millert Exp $ */
/* $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ */
/*-
@@ -82,6 +82,18 @@ typedef int32_t segsz_t; /* segment size */
typedef int32_t swblk_t; /* swap offset */
typedef u_int32_t uid_t; /* user id */
typedef u_int32_t useconds_t; /* microseconds */
+typedef int32_t suseconds_t; /* microseconds (signed) */
+
+/*
+ * XPG4.2 states that inclusion of <netinet/in.h> must pull these
+ * in and that inclusion of <sys/socket.h> must pull in sa_family_t.
+ * We put there here because there are other headers that require
+ * these types and <sys/socket.h> and <netinet/in.h> will indirectly
+ * include <sys/types.h>. Thus we are compliant without too many hoops.
+ */
+typedef u_int32_t in_addr_t; /* base type for internet address */
+typedef u_int16_t in_port_t; /* IP port type */
+typedef u_int8_t sa_family_t; /* sockaddr address family type */
/*
* These belong in unistd.h, but are placed here too to ensure that