On Fri, May 24, 2002 at 06:25:54PM +0200, Joerg Mayer wrote:
> see subject/changelog
> I've one thing about this patch I'm not feeling comfortable with:
> Is the method used to obtain the block size ok, or is this only the
> captured size?
"tvb_reported_length_remaining()" should give the bytes in packet from
the specified offset to the end, where "the end" is the end of the
packet data *on the wire* rather than the *captured* packet data, for
all capture file formats where the packet size on the wire is supplied.
That's true for most capture file formats, although some of the
text-based formats (Toshiba ISDN router, VMS TCPIPtrace, DBS-ETHERTRACE)
apparently don't supply separate "captured length" and "actual length"
values; I don't know whether that's because the captured length is
always the full length of the packet (i.e., packets are never cut off at
a snapshot length), in which case "tvb_reported_length_remaining()"
would give the remaining length of the packet on the wire, or if it's
because they cut the packet off at some length and don't bother telling
the user (for whom the text output is presumably intended) about that,
in which case "tvb_reported_length_remaining()" wouldn't give the answer
you want.
Given that there's nothing you can do about that, your change is
probably the right thing to check in - for most captures, it'll give the
right answer, and for captures where the "actual length" is bogus, there
are plenty of other dissectors that will also say something bogus.