Wireshark mailing list archives

Re: how to extract "IP.len" (IP_total length) to my local variable in my dissector?


From: Guy Harris <guy () alum mit edu>
Date: Fri, 24 Jun 2011 12:37:06 -0700


On Jun 24, 2011, at 12:25 PM, John x wrote:

but how to get the location (called offset, right?) value? since I need to reach to the last byte of the packet

Offsets within the tvbuff containing your packet start at 0, so if your packet is N bytes long, the offset of the last 
byte of the packet is N-1.

Subtract 1 from the result of tvb_reported_length(); that's the offset to use.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: