ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] need to read three bytes of offset

From: prashanth s <prbanglore@xxxxxxxxx>
Date: Thu, 4 Mar 2010 23:40:25 +0530
Thanks Harris for the response. In our case the functional spec of the company says that the offset is a three byte field. And I am reading the packets from the pcap captured on wireshark / tcpdump.
 
Regards,
Prashanth

On Thu, Mar 4, 2010 at 11:31 PM, Guy Harris <guy@xxxxxxxxxxxx> wrote:

On Mar 4, 2010, at 7:23 AM, prashanth s wrote:

> I am reading a pcap file and writing to a text file. I am getting a field offset which is supposed to be of three bytes long. How do I read it?
> Should I assume that the three bytes obey the network byte order or are the three bytes of offset are supposed be just read as three bytes of u_char type?

There are no 3-byte fields in the pcap per-packet header, so you must be referring to a field in a packet.

Whether they're a 3-byte integral value in network byte order (big-endian byte order), a 3-byte value in little-endian byte order, 3 one-byte values, a 2-byte integral value in network byte order followed by a 1-byte value, a 2-byte integral value in little-endian byte order followed by a 1-byte value, a 1-byte value followed by a 2-byte value in network byte order, a 1-byte value followed by a 2-byte value in little-endian byte order, etc. is indicated by the specification for the protocol to which that field belongs.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe