aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/acse
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2017-08-29 17:03:05 +0200
committerMichael Mann <mmann78@netscape.net>2017-08-29 19:49:29 +0000
commitf05f4893fa57ceac0ecb6266b9e536266f93aa1b (patch)
tree0318fb2156f19b69e08de372acc4b8abffb1cb1a /epan/dissectors/asn1/acse
parented6239d17ec995ab5eaa51319c1f13fac8ae3a06 (diff)
[ACSE] Get rid of global variable top_tree.
Change-Id: I2084c313e778f0895a4f7a58dee445f0e742e78e Reviewed-on: https://code.wireshark.org/review/23290 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Tomáš Kukosa <tomas.kukosa@ixperta.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/asn1/acse')
-rw-r--r--epan/dissectors/asn1/acse/acse.cnf6
-rw-r--r--epan/dissectors/asn1/acse/packet-acse-template.c15
2 files changed, 8 insertions, 13 deletions
diff --git a/epan/dissectors/asn1/acse/acse.cnf b/epan/dissectors/asn1/acse/acse.cnf
index 6fa8bbc052..c9d531c6dc 100644
--- a/epan/dissectors/asn1/acse/acse.cnf
+++ b/epan/dissectors/asn1/acse/acse.cnf
@@ -52,7 +52,7 @@ PDV-list/presentation-data-values/octet-aligned pDVList_octet_aligned
#.FN_BODY Authentication-value-other/other-mechanism-value
if (actx->external.direct_ref_present) {
- offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, top_tree, actx->private_data);
+ offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, actx->subtree.top_tree, actx->private_data);
}
#.FN_BODY PDV-list/presentation-data-values/simple-ASN1-type
@@ -104,12 +104,12 @@ PDV-list/presentation-data-values/octet-aligned pDVList_octet_aligned
#.FN_BODY EXTERNALt/_untag/encoding/single-ASN1-type
if (actx->external.direct_ref_present) {
- offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, actx->private_data);
+ offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, actx->subtree.top_tree ? actx->subtree.top_tree : tree, actx->private_data);
}
#.FN_BODY EXTERNALt/_untag/encoding/octet-aligned
if (actx->external.direct_ref_present) {
- offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, top_tree ? top_tree : tree, actx->private_data);
+ offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, actx->subtree.top_tree ? actx->subtree.top_tree : tree, actx->private_data);
}
#.FN_BODY AARQ-apdu
diff --git a/epan/dissectors/asn1/acse/packet-acse-template.c b/epan/dissectors/asn1/acse/packet-acse-template.c
index 02adb4e98e..ee179af819 100644
--- a/epan/dissectors/asn1/acse/packet-acse-template.c
+++ b/epan/dissectors/asn1/acse/packet-acse-template.c
@@ -81,8 +81,6 @@ static dissector_handle_t acse_handle = NULL;
kind of data is transferred in SES_DATA_TRANSFER_PDUs */
static guint32 indir_ref=0;
-static proto_tree *top_tree=NULL;
-
#if NOT_NEEDED
/* to keep track of presentation context identifiers and protocol-oids */
typedef struct _acse_ctx_oid_t {
@@ -177,7 +175,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
asn1_ctx.private_data = session;
/* save parent_tree so subdissectors can create new top nodes */
- top_tree=parent_tree;
+ asn1_ctx.subtree.top_tree = parent_tree;
/* ACSE has only AARQ,AARE,RLRQ,RLRE,ABRT type of pdu */
/* reject everything else */
@@ -198,17 +196,15 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
proto_tree_add_expert_format(parent_tree, pinfo, &ei_acse_invalid_oid, tvb, offset, -1,
"Invalid OID: %s", ACSE_APDU_OID);
}
- else {
- call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree, NULL);
- }
+ else {
+ call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree, NULL);
+ }
} else {
proto_tree_add_expert(parent_tree, pinfo, &ei_acse_dissector_not_available,
- tvb, offset, -1);
+ tvb, offset, -1);
}
- top_tree = NULL;
return 0;
default:
- top_tree = NULL;
return 0;
}
@@ -239,7 +235,6 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
}
- top_tree = NULL;
return tvb_captured_length(tvb);
}