From 985cfbd4cfbc38fcdd6d41095ba2f662f4b48b54 Mon Sep 17 00:00:00 2001 From: millert Date: Fri, 4 Apr 1997 03:05:28 +0000 Subject: [PATCH] Define in_addr_t and in_port_t everywhere but use u_intXX_t for htonl and friends. --- sys/arch/alpha/include/endian.h | 18 +++++++++--------- sys/arch/arc/include/endian.h | 5 ++++- sys/arch/arm32/include/endian.h | 5 ++++- sys/arch/i386/include/endian.h | 5 ++++- sys/arch/m68k/include/endian.h | 5 ++++- sys/arch/mvme88k/include/endian.h | 21 ++++++++++++--------- sys/arch/pc532/include/endian.h | 5 ++++- sys/arch/pmax/include/endian.h | 16 ++++++++-------- sys/arch/powerpc/include/endian.h | 13 ++++++++----- sys/arch/sparc/include/endian.h | 5 ++++- sys/arch/vax/include/endian.h | 5 ++++- sys/arch/wgrisc/include/endian.h | 21 ++++++++++++--------- 12 files changed, 77 insertions(+), 47 deletions(-) diff --git a/sys/arch/alpha/include/endian.h b/sys/arch/alpha/include/endian.h index ec524c5f64e..f2852a785bb 100644 --- a/sys/arch/alpha/include/endian.h +++ b/sys/arch/alpha/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.3 1996/10/30 22:39:03 niklas Exp $ */ +/* $OpenBSD: endian.h,v 1.4 1997/04/04 03:05:28 millert Exp $ */ /* $NetBSD: endian.h,v 1.3 1996/10/13 19:57:59 cgd Exp $ */ /* @@ -62,10 +62,10 @@ typedef u_int32_t in_addr_t; typedef u_int16_t in_port_t; __BEGIN_DECLS -in_addr_t htonl __P((in_addr_t)); -in_port_t htons __P((in_port_t)); -in_addr_t ntohl __P((in_addr_t)); -in_port_t ntohs __P((in_port_t)); +u_int32_t htonl __P((u_int32_t)); +u_int16_t htons __P((u_int16_t)); +u_int32_t ntohl __P((u_int32_t)); +u_int16_t ntohs __P((u_int16_t)); __END_DECLS /* @@ -84,10 +84,10 @@ __END_DECLS #else -#define NTOHL(x) (x) = ntohl((in_addr_t)x) -#define NTOHS(x) (x) = ntohs((in_port_t)x) -#define HTONL(x) (x) = htonl((in_addr_t)x) -#define HTONS(x) (x) = htons((in_port_t)x) +#define NTOHL(x) (x) = ntohl((u_int32_t)x) +#define NTOHS(x) (x) = ntohs((u_int16_t)x) +#define HTONL(x) (x) = htonl((u_int32_t)x) +#define HTONS(x) (x) = htons((u_int16_t)x) #endif #endif /* !_POSIX_SOURCE */ #endif /* !_ENDIAN_H_ */ diff --git a/sys/arch/arc/include/endian.h b/sys/arch/arc/include/endian.h index 199bbf21675..694fa5e0cbd 100644 --- a/sys/arch/arc/include/endian.h +++ b/sys/arch/arc/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.2 1996/11/25 13:11:16 niklas Exp $ */ +/* $OpenBSD: endian.h,v 1.3 1997/04/04 03:05:29 millert Exp $ */ /* $NetBSD: endian.h,v 1.4 1994/10/26 21:09:38 cgd Exp $ */ /* @@ -63,6 +63,9 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS u_int32_t htonl __P((u_int32_t)); u_int16_t htons __P((u_int16_t)); diff --git a/sys/arch/arm32/include/endian.h b/sys/arch/arm32/include/endian.h index 6bbed9ec351..3d47cfe3638 100644 --- a/sys/arch/arm32/include/endian.h +++ b/sys/arch/arm32/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.2 1996/11/25 13:11:18 niklas Exp $ */ +/* $OpenBSD: endian.h,v 1.3 1997/04/04 03:05:30 millert Exp $ */ /* $NetBSD: endian.h,v 1.2 1996/03/14 23:11:10 mark Exp $ */ /* @@ -59,6 +59,9 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS u_int32_t htonl __P((u_int32_t)); u_int16_t htons __P((u_int16_t)); diff --git a/sys/arch/i386/include/endian.h b/sys/arch/i386/include/endian.h index e7eb3be5284..37420cd889f 100644 --- a/sys/arch/i386/include/endian.h +++ b/sys/arch/i386/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.5 1996/11/25 14:44:26 niklas Exp $ */ +/* $OpenBSD: endian.h,v 1.6 1997/04/04 03:05:31 millert Exp $ */ /* $NetBSD: endian.h,v 1.16 1995/06/01 17:19:18 mycroft Exp $ */ /* @@ -60,6 +60,9 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS u_int32_t htonl __P((u_int32_t)); u_int16_t htons __P((u_int16_t)); diff --git a/sys/arch/m68k/include/endian.h b/sys/arch/m68k/include/endian.h index 9974a8875aa..a1467a56a1c 100644 --- a/sys/arch/m68k/include/endian.h +++ b/sys/arch/m68k/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.5 1997/04/02 20:40:47 niklas Exp $ */ +/* $OpenBSD: endian.h,v 1.6 1997/04/04 03:05:31 millert Exp $ */ /* $NetBSD: endian.h,v 1.10 1996/10/13 02:59:55 christos Exp $ */ /* @@ -58,6 +58,9 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS #if 0 /* diff --git a/sys/arch/mvme88k/include/endian.h b/sys/arch/mvme88k/include/endian.h index de4a384a294..c5e61bd0620 100644 --- a/sys/arch/mvme88k/include/endian.h +++ b/sys/arch/mvme88k/include/endian.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)endian.h 8.1 (Berkeley) 6/11/93 - * $Id: endian.h,v 1.4 1997/03/03 20:20:58 rahnds Exp $ + * $Id: endian.h,v 1.5 1997/04/04 03:05:32 millert Exp $ */ #ifndef _ENDIAN_H_ @@ -57,11 +57,14 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS -unsigned long htonl __P((unsigned long)); -unsigned short htons __P((unsigned short)); -unsigned long ntohl __P((unsigned long)); -unsigned short ntohs __P((unsigned short)); +u_int32_t htonl __P((u_int32_t)); +u_int16_t htons __P((u_int16_t)); +u_int32_t ntohl __P((u_int32_t)); +u_int16_t ntohs __P((u_int16_t)); __END_DECLS /* @@ -80,10 +83,10 @@ __END_DECLS #else -#define NTOHL(x) (x) = ntohl((u_long)x) -#define NTOHS(x) (x) = ntohs((u_short)x) -#define HTONL(x) (x) = htonl((u_long)x) -#define HTONS(x) (x) = htons((u_short)x) +#define NTOHL(x) (x) = ntohl((u_int32_t)x) +#define NTOHS(x) (x) = ntohs((u_int16_t)x) +#define HTONL(x) (x) = htonl((u_int32_t)x) +#define HTONS(x) (x) = htons((u_int16_t)x) #endif #endif /* ! _POSIX_SOURCE */ #endif /* !_ENDIAN_H_ */ diff --git a/sys/arch/pc532/include/endian.h b/sys/arch/pc532/include/endian.h index ebb4778bf0d..388513c91f8 100644 --- a/sys/arch/pc532/include/endian.h +++ b/sys/arch/pc532/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.2 1996/11/25 13:11:31 niklas Exp $ */ +/* $OpenBSD: endian.h,v 1.3 1997/04/04 03:05:33 millert Exp $ */ /* $NetBSD: endian.h,v 1.8 1995/06/18 07:13:46 phil Exp $ */ /* @@ -58,6 +58,9 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS u_int32_t htonl __P((u_int32_t)); u_int16_t htons __P((u_int16_t)); diff --git a/sys/arch/pmax/include/endian.h b/sys/arch/pmax/include/endian.h index d9dee656d27..3224ab1890b 100644 --- a/sys/arch/pmax/include/endian.h +++ b/sys/arch/pmax/include/endian.h @@ -67,10 +67,10 @@ typedef u_int32_t in_addr_t; typedef u_int16_t in_port_t; __BEGIN_DECLS -in_addr_t htonl __P((in_addr_t)); -in_port_t htons __P((in_port_t)); -in_addr_t ntohl __P((in_addr_t)); -in_port_t ntohs __P((in_port_t)); +u_int32_t htonl __P((u_int32_t)); +u_int16_t htons __P((u_int16_t)); +u_int32_t ntohl __P((u_int32_t)); +u_int16_t ntohs __P((u_int16_t)); __END_DECLS /* @@ -89,10 +89,10 @@ __END_DECLS #else -#define NTOHL(x) (x) = ntohl((in_addr_t)x) -#define NTOHS(x) (x) = ntohs((in_port_t)x) -#define HTONL(x) (x) = htonl((in_addr_t)x) -#define HTONS(x) (x) = htons((in_port_t)x) +#define NTOHL(x) (x) = ntohl((u_int32_t)x) +#define NTOHS(x) (x) = ntohs((u_int16_t)x) +#define HTONL(x) (x) = htonl((u_int32_t)x) +#define HTONS(x) (x) = htons((u_int16_t)x) #endif #endif /* ! _POSIX_SOURCE */ #endif /* !_ENDIAN_H_ */ diff --git a/sys/arch/powerpc/include/endian.h b/sys/arch/powerpc/include/endian.h index f5db7ea9216..15cb3226815 100644 --- a/sys/arch/powerpc/include/endian.h +++ b/sys/arch/powerpc/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.3 1996/12/28 06:25:05 rahnds Exp $ */ +/* $OpenBSD: endian.h,v 1.4 1997/04/04 03:05:34 millert Exp $ */ /* $NetBSD: endian.h,v 1.2 1996/10/13 03:16:41 christos Exp $ */ /*- @@ -52,6 +52,9 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS u_int32_t htonl __P((u_int32_t)); u_int16_t htons __P((u_int16_t)); @@ -75,10 +78,10 @@ __END_DECLS #else -#define NTOHL(x) (x) = ntohl((in_addr_t)x) -#define NTOHS(x) (x) = ntohs((in_port_t)x) -#define HTONL(x) (x) = htonl((in_addr_t)x) -#define HTONS(x) (x) = htons((in_port_t)x) +#define NTOHL(x) (x) = ntohl((u_int32_t)x) +#define NTOHS(x) (x) = ntohs((u_int16_t)x) +#define HTONL(x) (x) = htonl((u_int32_t)x) +#define HTONS(x) (x) = htons((u_int16_t)x) #endif #endif /* _POSIX_SOURCE */ diff --git a/sys/arch/sparc/include/endian.h b/sys/arch/sparc/include/endian.h index b7a1556c73b..8a90a04bb50 100644 --- a/sys/arch/sparc/include/endian.h +++ b/sys/arch/sparc/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.3 1996/11/25 13:11:36 niklas Exp $ */ +/* $OpenBSD: endian.h,v 1.4 1997/04/04 03:05:35 millert Exp $ */ /* $NetBSD: endian.h,v 1.3 1996/02/13 17:04:58 christos Exp $ */ /* @@ -54,6 +54,9 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS u_int32_t htonl __P((u_int32_t)); u_int16_t htons __P((u_int16_t)); diff --git a/sys/arch/vax/include/endian.h b/sys/arch/vax/include/endian.h index 02e1fee60a0..cf1970eb989 100644 --- a/sys/arch/vax/include/endian.h +++ b/sys/arch/vax/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.4 1997/01/15 23:24:37 maja Exp $ */ +/* $OpenBSD: endian.h,v 1.5 1997/04/04 03:05:36 millert Exp $ */ /* $NetBSD: endian.h,v 1.8 1996/10/13 03:28:00 christos Exp $ */ /* @@ -56,6 +56,9 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS u_int32_t htonl __P((u_int32_t)); u_int16_t htons __P((u_int16_t)); diff --git a/sys/arch/wgrisc/include/endian.h b/sys/arch/wgrisc/include/endian.h index 14f00a9bc05..57ef0088e79 100644 --- a/sys/arch/wgrisc/include/endian.h +++ b/sys/arch/wgrisc/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.1.1.1 1997/02/06 16:02:43 pefo Exp $ */ +/* $OpenBSD: endian.h,v 1.2 1997/04/04 03:05:37 millert Exp $ */ /* $NetBSD: endian.h,v 1.4 1994/10/26 21:09:38 cgd Exp $ */ /* @@ -63,11 +63,14 @@ #include +typedef u_int32_t in_addr_t; +typedef u_int16_t in_port_t; + __BEGIN_DECLS -unsigned long htonl __P((unsigned long)); -unsigned short htons __P((unsigned short)); -unsigned long ntohl __P((unsigned long)); -unsigned short ntohs __P((unsigned short)); +u_int32_t htonl __P((u_int32_t)); +u_int16_t htons __P((u_int16_t)); +u_int32_t ntohl __P((u_int32_t)); +u_int16_t ntohs __P((u_int16_t)); __END_DECLS /* @@ -86,10 +89,10 @@ __END_DECLS #else -#define NTOHL(x) (x) = ntohl((u_long)x) -#define NTOHS(x) (x) = ntohs((u_short)x) -#define HTONL(x) (x) = htonl((u_long)x) -#define HTONS(x) (x) = htons((u_short)x) +#define NTOHL(x) (x) = ntohl((u_int32_t)x) +#define NTOHS(x) (x) = ntohs((u_int16_t)x) +#define HTONL(x) (x) = htonl((u_int32_t)x) +#define HTONS(x) (x) = htons((u_int16_t)x) #endif #endif /* ! _POSIX_SOURCE */ #endif /* !_ENDIAN_H_ */ -- 2.20.1