Subject: Re: htonq()/ntohq() objection
To: None <tech-userlevel@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-userlevel
Date: 06/18/1999 23:39:49
Todd Vierling wrote:

> [From a post to port-alpha, so that the people watching the thread here see
> it:]
> 
> htonl() is NOT intended to do anything but work with `unsigned long' in a
> networking interpretation.  Other code that uses it should be shot with
> great vengeance.
> 
> This reminds me ... I'd like to raise my own objection to {h,n}to{n,h}q()
> as you described a need for generic, NOT network-stack-only, interpretation
> of 64-bit reversal.  This was brought up before, and it was generally
> decided that a new naming scheme for generic functions, expressed in terms
> of bswap*(), and capable of converting to and from both big and little
> endian, was needed.

I don't remember the previous discussion - do you remember which list it
was on so I can go searching?

Does something along the lines of hto{le,be}{16,32,64,...}() sound
ok?  Would we also want the reverse {le,be}{...}toh() as well for
completeness?

Simon.