aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tpkt.h
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-02 02:51:20 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-02 02:51:20 +0000
commitc1e4e90ddf1a5314eb61abac595e5ac6fe6d46a7 (patch)
treef455cdf13d6752fdfd2731b61de4c96a473974d2 /packet-tpkt.h
parent2fb70c522154187681d2bc69d1171a1e9a03774a (diff)
Clean up the heuristic code in the Q.931 dissector. If it's a heuristic
dissector, it's looking for Q.931 encapsulated inside TPKT, so it shouldn't check whether the first byte is NLPID_Q_931 or not, as it *won't* be NLPID_Q_931, it'll be 3, for the TPKT version. It should first check whether "is_tpkt()" thinks it's a TPKT packet, and then check that the packet has at least 3 bytes past the TPKT header, then check the first byte in the payload to see whether it's NLPID_Q_931. If that all succeeds, treat it as Q.931 inside TPKT. Make "is_tpkt()" return the length from the TPKT header on success, and -1 on failure, and return the offset past the TPKT header via a pointer (so clients don't have to know that the TPKT header is 4 bytes long). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4669 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-tpkt.h')
-rw-r--r--packet-tpkt.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/packet-tpkt.h b/packet-tpkt.h
index 588e1c7a33..9afc02a01a 100644
--- a/packet-tpkt.h
+++ b/packet-tpkt.h
@@ -5,7 +5,7 @@
* Copyright 2000, Philips Electronics N.V.
* Andreas Sikkema <andreas.sikkema@philips.com>
*
- * $Id: packet-tpkt.h,v 1.4 2001/06/12 06:31:14 guy Exp $
+ * $Id: packet-tpkt.h,v 1.5 2002/02/02 02:51:20 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -28,8 +28,11 @@
/*
* Check whether this could be a TPKT-encapsulated PDU.
+ * Returns -1 if it's not.
+ * Sets "*offset" to the offset of the first byte past the TPKT header,
+ * and returns the length from the TPKT header, if it is.
*/
-gboolean is_tpkt( tvbuff_t *tvb, unsigned int* offset );
+int is_tpkt( tvbuff_t *tvb, int *offset );
/*
@@ -38,8 +41,6 @@ gboolean is_tpkt( tvbuff_t *tvb, unsigned int* offset );
*
* Returns -1 if TPKT isn't enabled, otherwise returns the PDU length
* from the TPKT header.
- *
- * Sets "*offset" to the offset following the TPKT header.
*/
-int dissect_tpkt_header( tvbuff_t *tvb, unsigned int* offset,
- packet_info *pinfo, proto_tree *tree );
+int dissect_tpkt_header( tvbuff_t *tvb, int offset, packet_info *pinfo,
+ proto_tree *tree );