aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2017-08-29 13:33:01 +0200
committerAnders Broman <a.broman58@gmail.com>2017-08-29 16:18:02 +0000
commited6239d17ec995ab5eaa51319c1f13fac8ae3a06 (patch)
treeed64e012ff7ebde9a0a3845ef5eef4d8a2fc573b /epan/dissectors/asn1
parent37d06faed3bc3c4d8ff908993b5f9cfb91e3c1a4 (diff)
[GSM MAP] Get rid of a global variable and use the new
dissector_try_uint_new() interface. Change-Id: I714ca04f43c00017969e8655614566df4c53e5e9 Reviewed-on: https://code.wireshark.org/review/23288 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Tomáš Kukosa <tomas.kukosa@ixperta.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/asn1')
-rw-r--r--epan/dissectors/asn1/gsm_map/gsm_map.cnf16
-rw-r--r--epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c11
2 files changed, 13 insertions, 14 deletions
diff --git a/epan/dissectors/asn1/gsm_map/gsm_map.cnf b/epan/dissectors/asn1/gsm_map/gsm_map.cnf
index 28add08f91..de93a8a296 100644
--- a/epan/dissectors/asn1/gsm_map/gsm_map.cnf
+++ b/epan/dissectors/asn1/gsm_map/gsm_map.cnf
@@ -531,7 +531,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
/* Detailed diagnostic information contains either a SMS-SUBMIT-REPORT or a SMS-DELIVERY-REPORT */
oct = tvb_get_guint8(gsm_map_priv->signal_info_tvb, 0);
actx->pinfo->p2p_dir = ((oct & 0x03) == 0) ? P2P_DIR_RECV : P2P_DIR_SENT;
- call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL);
+ call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
#.FN_BODY ForwardSM-Arg
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
@@ -547,7 +547,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
actx->pinfo->p2p_dir = P2P_DIR_RECV;
}
}
- call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL);
+ call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
#.FN_BODY MO-ForwardSM-Arg
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
@@ -559,7 +559,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_RECV;
}
- call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL);
+ call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
#.FN_BODY MO-ForwardSM-Res
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
@@ -571,7 +571,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_SENT;
}
- call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL);
+ call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
#.FN_BODY MT-ForwardSM-Arg
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
@@ -583,7 +583,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_SENT;
}
- call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL);
+ call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
#.FN_BODY MT-ForwardSM-Res
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
@@ -595,7 +595,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_RECV;
}
- call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL);
+ call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
#.FN_BODY MT-ForwardSM-VGCS-Arg
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
@@ -607,7 +607,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_SENT;
}
- call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL);
+ call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
#.FN_BODY MT-ForwardSM-VGCS-Res
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
@@ -619,7 +619,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_RECV;
}
- call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL);
+ call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, actx->subtree.top_tree, NULL);
#.FN_BODY SS-Status VAL_PTR = &parameter_tvb
diff --git a/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c b/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c
index d3617e45e3..1402ee5b76 100644
--- a/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c
+++ b/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c
@@ -227,7 +227,6 @@ static gboolean pref_ericsson_proprietary_ext = FALSE;
/* Global variables */
static guint32 opcode=0;
static guint32 errorCode;
-static proto_tree *top_tree;
static int application_context_version;
static guint ProtocolId;
static guint AccessNetworkProtocolId;
@@ -1630,7 +1629,7 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_
case 126: /*SS-protocol explicitCT no Argument*/
break;
default:
- if(!dissector_try_uint(map_prop_arg_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree)){
+ if(!dissector_try_uint_new(map_prop_arg_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree, TRUE, NULL)){
proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData,
tvb, offset, -1, "Unknown invokeData %d", opcode);
}
@@ -1942,7 +1941,7 @@ static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,
break;
default:
- if(!dissector_try_uint(map_prop_res_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree)){
+ if(!dissector_try_uint_new(map_prop_res_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree, TRUE, NULL)){
proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData,
tvb, offset, -1, "Unknown returnResultData %d", opcode);
}
@@ -2105,7 +2104,7 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,
offset=dissect_gsm_map_er_InformationNotAvailableParam(FALSE, tvb, offset, actx, tree, -1);
break;
default:
- if(!dissector_try_uint(map_prop_err_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree)){
+ if(!dissector_try_uint_new(map_prop_err_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree, TRUE, NULL)){
proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData,
tvb, offset, -1, "Unknown returnErrorData %d", opcode);
}
@@ -2419,7 +2418,7 @@ dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM MAP");
- top_tree = parent_tree;
+ asn1_ctx.subtree.top_tree = parent_tree;
gsm_map_priv = wmem_new0(wmem_packet_scope(), gsm_map_private_info_t);
gsm_map_priv->tcap_private = (struct tcap_private_t *)data;
@@ -2458,7 +2457,7 @@ dissect_gsm_map_sccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM MAP");
- top_tree = parent_tree;
+ asn1_ctx.subtree.top_tree = parent_tree;
gsm_map_priv = wmem_new0(wmem_packet_scope(), gsm_map_private_info_t);
gsm_map_priv->sccp_msg_info = (sccp_msg_info_t *)data;