Subject: Re: ncr.4 & byte ordering
To: Mike Long <mike.long@analog.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 01/16/1997 12:32:14
On Thu, 16 Jan 97 15:18:12 EST
Mike Long <mike.long@analog.com> wrote:
> I'd like that, but I have to say "dream on." We haven't even cleared
> up which byte order IP_HDRINCL should use yet.
...hmm, thanks for jogging my memory on that :-)
> I like htole16(), htole32(), letoh16(), and letoh32() for the
> little-endian vs. host routines. Likewise, htobe16(), htobe32(),
> betoh16(), and betoh32() for a corresponding set of big-endian
> vs. host routines. Such a naming scheme would leave room for 64-bit
> versions, if required. ntohl() et. al. can be aliases for the latter
> set, so we can restrict their use to the network code where they
> belong.
Say, I like this idea. A bus's natural order is known by drivers
on that bus... and bus-indepependent driver cores could simply
use a "sc_busorder" member in their softc, set to BIG_ENDIAN or
LITTLE_ENDIAN (used to select, e.g. letoh16() or betoh16()).
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: 408.866.1912
NAS: M/S 258-6 Work: 415.604.0935
Moffett Field, CA 94035 Pager: 415.428.6939