diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-06-22 08:28:59 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-06-22 08:28:59 +0000 |
commit | e83361c99befee8ffceefd27fdbd25fd7b304e3b (patch) | |
tree | 15fd320f756660f15fa664882e86f6a4e746c2ea /epan/dissectors | |
parent | 816da9c18283803bc59f6ff0b96a81018d693f56 (diff) |
only create the ACSE protocol tree if there is an ACSE layer present.
do not create it if it is just a SES_DATA_TRANSFER PDU
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14726 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-acse.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/epan/dissectors/packet-acse.c b/epan/dissectors/packet-acse.c index 9cb93c829f..90feaf723d 100644 --- a/epan/dissectors/packet-acse.c +++ b/epan/dissectors/packet-acse.c @@ -1813,37 +1813,26 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) /* save parent_tree so subdissectors can create new top nodes */ top_tree=parent_tree; - /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_item(parent_tree, proto_acse, tvb, 0, -1, FALSE); - tree = proto_item_add_subtree(item, ett_acse); - } - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_set_str(pinfo->cinfo, COL_PROTOCOL, "ACSE"); - if (check_col(pinfo->cinfo, COL_INFO)) - col_clear(pinfo->cinfo, COL_INFO); - - /* first, try to check length */ /* do we have at least 2 bytes */ if (!tvb_bytes_exist(tvb, 0, 2)){ - proto_tree_add_text(tree, tvb, offset, + proto_tree_add_text(parent_tree, tvb, offset, tvb_reported_length_remaining(tvb,offset), "User data"); return; /* no, it isn't a ACSE PDU */ } /* do we have spdu type from the session dissector? */ if( !pinfo->private_data ){ - if(tree){ - proto_tree_add_text(tree, tvb, offset, -1, + if(parent_tree){ + proto_tree_add_text(parent_tree, tvb, offset, -1, "Internal error:can't get spdu type from session dissector."); } return ; } else { session = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) ); if(session->spdu_type == 0 ) { - if(tree){ - proto_tree_add_text(tree, tvb, offset, -1, + if(parent_tree){ + proto_tree_add_text(parent_tree, tvb, offset, -1, "Internal error:wrong spdu type %x from session dissector.",session->spdu_type); return ; } @@ -1863,9 +1852,9 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) case SES_DATA_TRANSFER: oid=find_oid_by_ctx_id(pinfo, indir_ref); if(oid){ - call_ber_oid_callback(oid, tvb, offset, pinfo, top_tree); + call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree); } else { - proto_tree_add_text(tree, tvb, offset, -1, + proto_tree_add_text(parent_tree, tvb, offset, -1, "dissector is not available"); } return; @@ -1873,6 +1862,17 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) return; } + /* create display subtree for the protocol */ + if(parent_tree){ + item = proto_tree_add_item(parent_tree, proto_acse, tvb, 0, -1, FALSE); + tree = proto_item_add_subtree(item, ett_acse); + } + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "ACSE"); + if (check_col(pinfo->cinfo, COL_INFO)) + col_clear(pinfo->cinfo, COL_INFO); + + /* we can't make any additional checking here */ /* postpone it before dissector will have more information */ while (tvb_reported_length_remaining(tvb, offset) > 0){ |