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] tvb_reported_length() vs tvb_length()

From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Thu, 24 Sep 2009 15:45:15 -0400
wmeier@xxxxxxxxxxxxx wrote:
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=30122

User: wmeier
Date: 2009/09/24 12:26 PM

Log:
 Minor: Use tvb_reported_length... not tvb_length...

After having made many a comment (on new dissectors) about using the wrong function, I start to wonder:

Should we rename tvb_length() to, say, tvb_captured_length() and tvb_reported_length() to tvb_length()?

Looking at it from the point of the TVB API it doesn't make much sense, but since [it appears that] many dissector writers tend to not think of snapshot lengths when dealing with TVBs, it might be the best way to prevent this problem going forward.