diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-05 18:47:26 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-05 18:47:26 +0000 |
commit | b6b78d69dbae80ea0a0efc39400e3e88d5f9e337 (patch) | |
tree | 3b236e73ee8f1d83c07ecc5ab7a67af8bb19cc85 /epan/dissectors/packet-ses.c | |
parent | 389423aaaac460f5b0fcbaf37b4f3d5cd7941c5b (diff) |
In an effort to reduce the use of pinfo->private_data (and some true global variables), I converted the ASN.1 dissectors that use pinfo->private_data to exchange a SESSION_DATA_STRUCTURE to instead only exchange it in the context of ASN.1. This meant converting dissectors to the "new" style to pass the SESSION_DATA_STRUCTURE as well as providing a pointer to it in asn1_ctx_t.private_data. Yes, it's still "private data", but it's not used by all dissectors like pinfo->private data is.
svn path=/trunk/; revision=53090
Diffstat (limited to 'epan/dissectors/packet-ses.c')
-rw-r--r-- | epan/dissectors/packet-ses.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/epan/dissectors/packet-ses.c b/epan/dissectors/packet-ses.c index fac7941d42..9b05806200 100644 --- a/epan/dissectors/packet-ses.c +++ b/epan/dissectors/packet-ses.c @@ -322,8 +322,6 @@ call_pres_dissector(tvbuff_t *tvb, int offset, guint16 param_len, proto_tree *param_tree, struct SESSION_DATA_STRUCTURE *session) { - void *saved_private_data; - /* do we have OSI presentation packet dissector ? */ if(!pres_handle) { @@ -340,20 +338,8 @@ call_pres_dissector(tvbuff_t *tvb, int offset, guint16 param_len, tvbuff_t *next_tvb; next_tvb = tvb_new_subset(tvb, offset, param_len, param_len); - /* save type of session pdu. We'll need it in the presentation dissector */ - saved_private_data = pinfo->private_data; - pinfo->private_data = session; - TRY - { - call_dissector(pres_handle, next_tvb, pinfo, tree); - } - CATCH_ALL - { - show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); - } - ENDTRY; - /* Restore private_data even if there was an exception */ - pinfo->private_data = saved_private_data; + /* Pass the session pdu to the presentation dissector */ + call_dissector_with_data(pres_handle, next_tvb, pinfo, tree, session); } } @@ -1031,7 +1017,6 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int len_len; guint16 parameters_len; tvbuff_t *next_tvb = NULL; - void *save_private_data; guint32 *pres_ctx_id = NULL; guint8 enclosure_item_flags = BEGINNING_SPDU|END_SPDU; struct SESSION_DATA_STRUCTURE session; @@ -1163,11 +1148,8 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, if (!pres_handle) { call_dissector(data_handle, next_tvb, pinfo, tree); } else { - /* save type of session pdu. We'll need it in the presentation dissector */ - save_private_data = pinfo->private_data; - pinfo->private_data = &session; - call_dissector(pres_handle, next_tvb, pinfo, tree); - pinfo->private_data = save_private_data; + /* Pass the session pdu to the presentation dissector */ + call_dissector_with_data(pres_handle, next_tvb, pinfo, tree, &session); } /* |