summaryrefslogtreecommitdiff
path: root/epan/tvbuff.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-18 10:38:33 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-18 10:38:33 +0000
commitc8196a1d1ca5a5021388cfc1bcbb64cdda5e9dc3 (patch)
tree5e117f446c6e233d14b642596d67c985e685f328 /epan/tvbuff.h
parent56a0c40c18271046d22bffcc5db10cfb16a2bf6c (diff)
downloadwireshark-c8196a1d1ca5a5021388cfc1bcbb64cdda5e9dc3.tar.gz
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors. Register the IP dissector and have dissectors that call it directly (rather than through a port table) call it through a handle. Add a routine "tvb_set_reported_length()" which a dissector can use if it was handed a tvbuff that contains more data than is actually in its part of the packet - for example, handing a padded Ethernet frame to IP; the routine sets the reported length of the tvbuff (and also adjusts the actual length, as appropriate). Then use it in IP. Given that, "ethertype()" can determine how much of the Ethernet frame was actually part of an IP datagram (and can do the same for other protocols under Ethernet that use "tvb_set_reported_length()"; have it return the actual length, and have "dissect_eth()" and "dissect_vlan()" use that to mark trailer data in Ethernet II frames as well as in 802.3 frames. svn path=/trunk/; revision=2658
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r--epan/tvbuff.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h
index 3093ee3c43..ca24ee4bf4 100644
--- a/epan/tvbuff.h
+++ b/epan/tvbuff.h
@@ -9,7 +9,7 @@
* the data of a backing tvbuff, or can be a composite of
* other tvbuffs.
*
- * $Id: tvbuff.h,v 1.7 2000/11/14 04:33:34 gram Exp $
+ * $Id: tvbuff.h,v 1.8 2000/11/18 10:38:33 guy Exp $
*
* Copyright (c) 2000 by Gilbert Ramirez <gram@xiexie.org>
*
@@ -201,6 +201,14 @@ gboolean tvb_offset_exists(tvbuff_t*, gint offset);
/* Get reported length of buffer */
guint tvb_reported_length(tvbuff_t*);
+/* Set the reported length of a tvbuff to a given value; used for protocols
+ whose headers contain an explicit length and where the calling
+ dissector's payload may include padding as well as the packet for
+ this protocol.
+
+ Also adjusts the data length. */
+void tvb_set_reported_length(tvbuff_t*, guint);
+
/* Returns the offset from the first byte of real data. This is
* the same value as 'offset' in tvb_compat() */
gint tvb_raw_offset(tvbuff_t*);