diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-05-29 08:57:42 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-05-29 08:57:42 +0000 |
commit | 66a6fcf9f68433bf4fa1d784bab56d7b8113f4d4 (patch) | |
tree | 4fd5ee67a918eb9d9180274b1f82b44be2ae7470 /packet-sscop.h | |
parent | f27015916970c3e6eaa88f754a5065917a079dc4 (diff) |
Add "tvb_reported_length()" to get the "reported length" of a tvbuff
(i.e., the amount of data that was in the packet, even if not all of it
was captured), for use when dissecting packets containing data that
fills the packet (we want the dissector to try to dissect all of it; if
it runs past the end of the captured data, we want it to throw an
exception so that we'll put a "Short Frame" note in the protocol tree).
This means we always want a tvbuff to have a real reported length value,
so we make it an unsigned integer, and don't bother checking it for -1,
as it should never be -1.
If the reported length passed in to "tvb_set_subset()" is -1, set the
reported length to the reported length of the tvbuff of which the new
tvbuff will be a subset minus the offset in that tvbuff of the subset,
so that "-1" means "what's left of the packet after we chop off the
header". This is necessary in order to ensure that all tvbuffs have a
real reported length value.
Have "dissect_packet()" set the reported length of the top-level tvbuff
to the reported length of the frame, so that we start out with a tvbuff
with a real reported length value.
Have "tvb_offset_exists()" return FALSE if the offset is past the end of
the tvbuff.
If the offset passed to it is postitive, have "compute_offset_length()"
check for that it's not more than one byte past the end of the tvbuff -
if it's just past the end, we don't want the check to fail, as we don't
want attempts to create a subset tvbuff containing zero bytes to fail;
that would be done if a captured packet was all header and no payload,
and we'd want the dissector of the payload, not the dissector of the
header, to throw an exception, as the problem isn't with the protocol
for the header, it's with the protocol for the payload.
Convert the ATM dissector, the SSCOP dissector, the Q.2931 dissector,
and the Q.931 dissector to use tvbuffs.
Make the LAPD dissector set up a tvbuff for the Q.931 dissector (it's
not converted yet).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2023 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-sscop.h')
-rw-r--r-- | packet-sscop.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packet-sscop.h b/packet-sscop.h index 8545669584..2781ee400b 100644 --- a/packet-sscop.h +++ b/packet-sscop.h @@ -1,6 +1,6 @@ /* packet-sscop.h * - * $Id: packet-sscop.h,v 1.1 2000/02/15 21:03:13 gram Exp $ + * $Id: packet-sscop.h,v 1.2 2000/05/29 08:57:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -22,5 +22,4 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -void dissect_sscop(const u_char *, int, frame_data *, proto_tree *); +void dissect_sscop(tvbuff_t *, packet_info *, proto_tree *); |