Ethereal-dev: RE: [Ethereal-dev] tcpdump endianness

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

From: "Viral Mehta" <viral.mehta@xxxxxxxxxxxxxx>
Date: Fri, 18 Aug 2006 18:22:45 +0530
-------------------
The Ethereal project is being continued at a new site.  Please go to
http://www.wireshark.org and subscribe to wireshark-dev@xxxxxxxxxxxxx.
Don't forget to unsubscribe from this list at
http://www.ethereal.com/mailman/listinfo/ethereal-dev
-------------------

Title: RE: [Ethereal-dev] tcpdump endianness

Hi,

The below sentence in bold letters confuses me. I think I need to swap if I have magic number as "d4c3b2a1"

And not when I get it as 0xa1b2c3d4..

M I right?

> If endianness is architecture

> dependant then how would I know that I have to swap 2 bytes or 4 bytes?

You have to swap if the magic number is 0xa1b2c3d4.

You have to swap 2 bytes if you have to swap and you're processing a

2-byte quantity.

You have to swap 4 bytes if you have to swap and you're processing a

4-byte quantity.

Note, by the way, that this applies *ONLY* to the per-file and

per-packet headers.  It does not apply to the packet data, which is in

whatever byte order it was put into on the wire.

_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev