Ethereal-dev: Re: [Ethereal-dev] [Patch] tethereal -z tcp,close

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Ronnie Sahlberg" <ronnie_sahlberg@xxxxxxxxxxxxxx>
Date: Thu, 28 Nov 2002 08:58:11 +1100
----- Original Message -----
From: "Guy Harris"
Sent: Wednesday, November 27, 2002 6:59 PM
Subject: Re: [Ethereal-dev] [Patch] tethereal -z tcp,close


> The reason why it individually fetches the fields using "tvb_get_xxx" is
> that if the packet is short, you get at least *some* of the fields put
> into the protocol tree before it throws a BoundsException, rather than
> getting nothing unless the entire header is available in the tvbuff:

Good point.

> As such, the TCP dissector should continue to access the fields directly
> using the "tvb_get_xxx" routines; however, instead of having separate
> variables for the fields, we could have a structure with members for
> those variables, fill in those members by fetching values with the
> "tvb_get_xxx" routines, and then use that structure for the tap.

Yes. I also think there are current dissectors that should be changed in
this way.
I am pretty sure there are existing dissectors that starts by putting all
header fields
in such a struct before it starts to dissect it, why those dissectors would
have the same problem tcp had previously.