Dan Anderson wrote:
> I'm working on RFE 5007142, which implements new 64-bit htonll() and ntohll()
> functions. I implemented these functions in inline assembly in the same
> manner as existing htonl() and ntohl().
>
> Similar functions already exist in various parts of Solaris: dhcp_ntohll()
> inlibdhcputil, ike_ntohll() in ikeadm, and ntohll/htonll in iSCSI, all
> implemented with #define or a C function--I replaced all these with the above
> unified functions.
>
> I will use new htonll() and ntohll() functions to optimize existing crypto
> framework code in Solaris x86 and this is my main motivation for this work.
>
> The ntohll() and htonll() functions are already in Linux, NetBSD, and AIX OS,
> and they are used in various apps such as SSH and netfilter (with emulation
> for Solaris and other OSs that are missing these functions.
>
> The ntohll() and htonll() functions are NOT a part of the XPG standard, and I
> placed header guards in sys/byteorder.h to allow for this.
>
> Here's a preliminary webrev for those who may be interested (but I'm not
> looking for a review yet):
> http://sw.west/~da73024/reviews/onnv/5007142-bswap
>
> Any comments? Good idea? Bad idea? Suggestions?
>
Good idea. I'd still *really* like to have a generic ddi_swapXX
equivalent that was optimized, but if you're not doing it as part of
this, then I will later. (ntohll is conditional, and doesn't swap on
SPARC. Sometimes you need to convert to little endian, e.g. when
dealing with little endian audio data.)
-- Garrett
> - Dan
>
>
> This message posted from opensolaris.org
> _______________________________________________
> networking-discuss mailing list
> [email protected]
>
_______________________________________________
networking-discuss mailing list
[email protected]