Ethereal-dev: Re: [ethereal-dev] Patch to fix up byte order handling

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Laurent Deniel <deniel@xxxxxxxxxxx>
Date: Sat, 03 Oct 1998 23:03:38 +0200
Guy Harris wrote:
> 
> 1) "pntohs()" and "pntohl()", if they work by extracting individual
>    bytes and shifting-and-ORing them (which is how they work), are
>    independent of the byte order of the underlying machine - there's no
>    need for separate versions for big-endian and little-endian machines;
> 

This is wrong.

Gerald, please, do not include the first patch (packet.h) else the whole
code will be broken.

> 2) however, the other versions are potentially of use when extracting
>    known-to-be-little-endian values from packets (and if there's ever an
>    SMB decoder in Ethereal, it'll be extracting a lot of
>    known-to-be-little-endian values from packets...);

> 3) "LITTLE_ENDIAN" and "BIG_ENDIAN" need to have different values in
>    order to make tests such as
> 
ok

--
Laurent DENIEL            | E-mail: deniel@xxxxxxxxxxx
Paris, FRANCE             |         deniel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
                          | WWW   : http://www.worldnet.fr/~deniel
    All above opinions are personal, unless stated otherwise.