Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 1998 15:44:07 +0000
From:      Brian Somers <brian@awfulhak.org>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   New typedefs in sys/types.h
Message-ID:  <199801111544.PAA27565@awfulhak.demon.co.uk>

next in thread | raw e-mail | index | archive | help
With the upcoming Alpha stuff, it looks like there are going to be 
some problems..... I'm assuming that a `long' is gonna be 64 bits 
rather than 32.

Certainly, the ppp code expects a u_long to be 32bits, and even uses 
u_longs all over the place when writing network data.  I'll bet it's 
not the only guilty party.

The OpenBSD sys/types.h has the following:
/*
 * 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 */

I'd like to bring this into -current.  Are there any objections ?

Also, what's the plan with things like htonl() and ntohl() ?  I am 
assuming they'll stay 32bit despite their name.... or will they ?

We could also have hton16(), ntoh16(), hton32() and ntoh32().

If these changes are ok, I'd also like to change __FreeBSD_version 
(in osreldate.h) to 300002 so that the ports will have a chance of 
using them (if they wish).

-- 
Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
      <http://www.Awfulhak.org>;
Don't _EVER_ lose your sense of humour....





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801111544.PAA27565>