aboutsummaryrefslogtreecommitdiffstats
path: root/packet-q2931.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-29 08:57:42 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-29 08:57:42 +0000
commit10ea13ed18be32c74c42ac023ae1258f79c6406e (patch)
tree4fd5ee67a918eb9d9180274b1f82b44be2ae7470 /packet-q2931.h
parentcb5b6c4719439cc777a78ae0b3c98088ac114d92 (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). svn path=/trunk/; revision=2023
Diffstat (limited to 'packet-q2931.h')
-rw-r--r--packet-q2931.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/packet-q2931.h b/packet-q2931.h
index fcf949d2d8..a9b9ac863b 100644
--- a/packet-q2931.h
+++ b/packet-q2931.h
@@ -1,6 +1,6 @@
/* packet-q2931.h
*
- * $Id: packet-q2931.h,v 1.1 2000/02/15 21:02:56 gram Exp $
+ * $Id: packet-q2931.h,v 1.2 2000/05/29 08:57:38 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_q2931(const u_char *, int, frame_data *, proto_tree *);
+void dissect_q2931(tvbuff_t *, packet_info *, proto_tree *);