Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] how to extract "IP.len" (IP_total length) to my local variab

Date: Sat, 25 Jun 2011 05:13:37 +0800
thanks a lot

I really appreciate your help

> From: guy@xxxxxxxxxxxx
> Date: Fri, 24 Jun 2011 12:37:06 -0700
> To: wireshark-dev@xxxxxxxxxxxxx
> Subject: Re: [Wireshark-dev] how to extract "IP.len" (IP_total length) to my local variable in my dissector?
>
>
> 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@xxxxxxxxxxxxx>
> Archives: http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
> mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe