aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x25.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2007-08-18 22:56:44 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2007-08-18 22:56:44 +0000
commit10752972eaa75e4466036ef3639726cb2ff1f43e (patch)
treebb96cd6794839f04f0cf445b85a90bc628e09cbc /epan/dissectors/packet-x25.c
parentd36abc4549dbce4c5af0c9ebbaa4f1f5c1e4ca2e (diff)
Check for COTP if Call Request has not been captured.
Fixed an offset for diagnostic in COL_INFO. This file should really be rewritten to use more proto_tree_add_item's instead of proto_tree_add_text's. svn path=/trunk/; revision=22552
Diffstat (limited to 'epan/dissectors/packet-x25.c')
-rw-r--r--epan/dissectors/packet-x25.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c
index 757004474f..69468e3703 100644
--- a/epan/dissectors/packet-x25.c
+++ b/epan/dissectors/packet-x25.c
@@ -2056,7 +2056,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s - Diag.:%d",
short_name,
restart_code(tvb_get_guint8(tvb, 3)),
- (int)tvb_get_guint8(tvb, 3));
+ (int)tvb_get_guint8(tvb, 4));
}
if (x25_tree) {
proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1,
@@ -2346,7 +2346,21 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* If the Call Req. has not been captured, let's look at the first
- byte of the payload to see if this looks like IP or CLNP. */
+ two bytes of the payload to see if this looks like COTP. */
+ if (tvb_get_guint8(tvb, localoffset) == tvb_length(next_tvb)-1) {
+ /* First byte contains the length of the remaining buffer */
+ if ((tvb_get_guint8(tvb, localoffset+1) & 0x0F) == 0) {
+ /* Second byte contains a valid COTP TPDU */
+ if (!pinfo->fd->flags.visited)
+ x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle);
+ call_dissector(ositp_handle, next_tvb, pinfo, tree);
+ pinfo->private_data = saved_private_data;
+ return;
+ }
+ }
+
+ /* Then let's look at the first byte of the payload to see if this
+ looks like IP or CLNP. */
switch (tvb_get_guint8(tvb, localoffset)) {
case 0x45: