aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x25.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-02-28 00:48:06 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-02-28 00:48:06 +0000
commit9751950c1f729a86f2592c872aecfe5067c56520 (patch)
tree9477d4cdc342b54dd5f7ed071c443aa95d8589a0 /packet-x25.c
parent0736bc8a2a92cdf6802ea81084e27b157100356b (diff)
From Laurent Meyer: let the user data in CALL REQUEST and CALL CONFIRM
PDUs be dissected by the appropriate dissector for the connection. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7216 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-x25.c')
-rw-r--r--packet-x25.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/packet-x25.c b/packet-x25.c
index cd52d02ccf..288e88046a 100644
--- a/packet-x25.c
+++ b/packet-x25.c
@@ -2,7 +2,7 @@
* Routines for X.25 packet disassembly
* Olivier Abad <oabad@noos.fr>
*
- * $Id: packet-x25.c,v 1.77 2003/02/16 20:55:10 deniel Exp $
+ * $Id: packet-x25.c,v 1.78 2003/02/28 00:48:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1415,7 +1415,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint x25_pkt_len;
int modulo;
guint16 vc;
- dissector_handle_t dissect;
+ dissector_handle_t dissect = NULL;
gboolean toa; /* TOA/NPI address format */
guint16 bytes0_1;
guint8 pkt_type;
@@ -1715,7 +1715,31 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"X.263 secondary protocol ID: %s",
val_to_str(spi, nlpid_vals, "Unknown (0x%02x)"));
}
- localoffset++;
+
+ /*
+ * If there's more than one octet of user data, we'll
+ * dissect it; for some protocols, the NLPID is considered
+ * to be part of the PDU, so, for those cases, we don't
+ * skip past it. For other protocols, we skip the NLPID.
+ */
+ switch (spi) {
+
+ case NLPID_ISO8473_CLNP:
+ case NLPID_ISO9542_ESIS:
+ case NLPID_ISO10589_ISIS:
+ case NLPID_ISO10747_IDRP:
+ case NLPID_SNDCF:
+ /*
+ * The NLPID is part of the PDU. Don't skip it.
+ */
+ break;
+
+ default:
+ /*
+ * The NLPID isn't part of the PDU - skip it.
+ */
+ localoffset++;
+ }
if (!pinfo->fd->flags.visited) {
/*
@@ -1727,13 +1751,6 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
x25_hash_add_proto_start(vc, pinfo->fd->num, dissect);
}
}
- if (localoffset < tvb_length(tvb)) {
- if (userdata_tree) {
- proto_tree_add_text(userdata_tree, tvb, localoffset, -1,
- "Data");
- }
- localoffset = tvb_length(tvb);
- }
}
break;
case X25_CALL_ACCEPTED:
@@ -1771,13 +1788,6 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (localoffset < x25_pkt_len) /* facilities */
dump_facilities(x25_tree, &localoffset, tvb);
-
- if (localoffset < tvb_reported_length(tvb)) { /* user data */
- if (x25_tree)
- proto_tree_add_text(x25_tree, tvb, localoffset,
- tvb_reported_length(tvb)-localoffset, "Data");
- localoffset=tvb_reported_length(tvb);
- }
break;
case X25_CLEAR_REQUEST:
switch (dir) {