aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-acse.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-06-22 08:28:59 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-06-22 08:28:59 +0000
commit1a663222b4adaf75ce24a1e4f8af3f65f507f54b (patch)
tree15fd320f756660f15fa664882e86f6a4e746c2ea /epan/dissectors/packet-acse.c
parent5a3ff9906cf446fce4baba794528cc9c8e9f07ff (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 svn path=/trunk/; revision=14726
Diffstat (limited to 'epan/dissectors/packet-acse.c')
-rw-r--r--epan/dissectors/packet-acse.c36
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){