diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-04-28 18:39:07 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-04-29 06:04:18 +0000 |
commit | fb1a6320ec67fc30414948b8e7e8c63c37a15983 (patch) | |
tree | 5ceda3d9f686c6c4f698d7b382041d109f5138f0 /epan/dissectors/asn1/gsm_map | |
parent | 5bda98586b4f81c14a5f3b8feacd10392dc0d078 (diff) |
GSM MAP: use TCAP OTID to retrieve SM-RP-OA and SM-RP-DA fields when required
Bug: 13592
Change-Id: Ib8a0ff6d897699c44e5c4b8834123169066cf904
Reviewed-on: https://code.wireshark.org/review/21397
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.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/gsm_map')
-rw-r--r-- | epan/dissectors/asn1/gsm_map/gsm_map.cnf | 353 | ||||
-rw-r--r-- | epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c | 105 | ||||
-rw-r--r-- | epan/dissectors/asn1/gsm_map/packet-gsm_map-template.h | 31 |
3 files changed, 300 insertions, 189 deletions
diff --git a/epan/dissectors/asn1/gsm_map/gsm_map.cnf b/epan/dissectors/asn1/gsm_map/gsm_map.cnf index 5e751aeba5..1681e9aea6 100644 --- a/epan/dissectors/asn1/gsm_map/gsm_map.cnf +++ b/epan/dissectors/asn1/gsm_map/gsm_map.cnf @@ -253,10 +253,12 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_isdn_address_string); dissect_gsm_map_msisdn(parameter_tvb, actx->pinfo , subtree); - actx->private_data = tvb_bytes_to_str(actx->pinfo->pool, parameter_tvb, 0, tvb_captured_length(parameter_tvb)); + if (!PINFO_FD_VISITED(actx->pinfo)) + actx->private_data = tvb_bytes_to_str(wmem_file_scope(), parameter_tvb, 0, tvb_captured_length(parameter_tvb)); #.FN_BODY IMSI VAL_PTR = ¶meter_tvb - tvbuff_t *parameter_tvb; + tvbuff_t *parameter_tvb; + const char *imsi_str; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, ¶meter_tvb); @@ -265,17 +267,18 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" if(tvb_reported_length(parameter_tvb)==0) return offset; - /* Hide the octet string default printout */ - PROTO_ITEM_SET_HIDDEN(actx->created_item); - actx->private_data = wmem_strdup(actx->pinfo->pool, - dissect_e212_imsi(parameter_tvb, actx->pinfo, tree, - 0, tvb_reported_length(parameter_tvb), FALSE)); + /* Hide the octet string default printout */ + PROTO_ITEM_SET_HIDDEN(actx->created_item); + imsi_str = dissect_e212_imsi(parameter_tvb, actx->pinfo, tree, + 0, tvb_reported_length(parameter_tvb), FALSE); + if (!PINFO_FD_VISITED(actx->pinfo)) + actx->private_data = wmem_strdup(wmem_file_scope(), imsi_str); #.FN_BODY LMSI VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb; %(DEFAULT_BODY)s - if (parameter_tvb) { - actx->private_data = tvb_bytes_to_str(actx->pinfo->pool, parameter_tvb, 0, tvb_captured_length(parameter_tvb)); + if (parameter_tvb && !PINFO_FD_VISITED(actx->pinfo)) { + actx->private_data = tvb_bytes_to_str(wmem_file_scope(), parameter_tvb, 0, tvb_captured_length(parameter_tvb)); } #.FN_BODY TBCD-STRING VAL_PTR = ¶meter_tvb @@ -314,6 +317,8 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" guint8 octet; tvbuff_t *next_tvb; proto_tree *subtree; + gsm_map_private_info_t *gsm_map_priv; + sccp_msg_info_t *sccp_msg_info; %(DEFAULT_BODY)s @@ -321,6 +326,8 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" if (!parameter_tvb) return offset; + gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; + sccp_msg_info = gsm_map_priv ? gsm_map_priv->sccp_msg_info : NULL; subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_LongSignalInfo); switch (AccessNetworkProtocolId){ @@ -333,8 +340,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" /* Strip off discrimination and length */ proto_tree_add_item(subtree, hf_gsm_map_len, parameter_tvb, 1,1,ENC_BIG_ENDIAN); next_tvb = tvb_new_subset_remaining(parameter_tvb, 2); - call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, - p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num)); + call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, sccp_msg_info); }else if(octet==1){ proto_tree_add_item(subtree, hf_gsm_map_dlci, parameter_tvb, 1,1,ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_gsm_map_len, parameter_tvb, 2,1,ENC_BIG_ENDIAN); @@ -357,9 +363,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_SENT; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_oa_id = GSM_MAP_RP_OA_SERVICE_CENTER_ADDRESS; - gsm_map_pi->rp_oa_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS; + gsm_map_pi->sm_rp_oa_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -368,9 +374,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_SENT; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_oa_id = GSM_MAP_RP_OA_SERVICE_CENTER_ADDRESS; - gsm_map_pi->rp_oa_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS; + gsm_map_pi->sm_rp_oa_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -379,9 +385,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_SENT; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_IMSI; - gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_IMSI; + gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -390,9 +396,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_SENT; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_LMSI; - gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_LMSI; + gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -401,9 +407,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_SENT; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_IMSI; - gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_IMSI; + gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -412,9 +418,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_SENT; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_LMSI; - gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_LMSI; + gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -423,9 +429,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_RECV; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_oa_id = GSM_MAP_RP_OA_MSISDN; - gsm_map_pi->rp_oa_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_MSISDN; + gsm_map_pi->sm_rp_oa_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -433,9 +439,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_RECV; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_oa_id = GSM_MAP_RP_OA_MSISDN; - gsm_map_pi->rp_oa_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_MSISDN; + gsm_map_pi->sm_rp_oa_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -444,9 +450,9 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_RECV; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_SERVICE_CENTER_ADDRESS; - gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS; + gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data; actx->private_data = NULL; } @@ -455,118 +461,157 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS" actx->pinfo->p2p_dir = P2P_DIR_RECV; %(DEFAULT_BODY)s if (actx->private_data) { - gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); - gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_SERVICE_CENTER_ADDRESS; - gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE); + gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS; + gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data; actx->private_data = NULL; } +#.FN_BODY SM-RP-OAold/noSM-RP-OA + gsm_map_packet_info_t *prev_packet_info = gsm_map_get_matching_tcap_info(actx); +%(DEFAULT_BODY)s + if (prev_packet_info && !PINFO_FD_VISITED(actx->pinfo)) { + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, FALSE); + gsm_map_pi->sm_rp_oa_id = prev_packet_info->sm_rp_oa_id; + gsm_map_pi->sm_rp_oa_str = wmem_strdup(wmem_file_scope(), prev_packet_info->sm_rp_oa_str); + } + +#.FN_BODY SM-RP-OA/noSM-RP-OA + gsm_map_packet_info_t *prev_packet_info = gsm_map_get_matching_tcap_info(actx); +%(DEFAULT_BODY)s + if (prev_packet_info && !PINFO_FD_VISITED(actx->pinfo)) { + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, FALSE); + gsm_map_pi->sm_rp_oa_id = prev_packet_info->sm_rp_oa_id; + gsm_map_pi->sm_rp_oa_str = wmem_strdup(wmem_file_scope(), prev_packet_info->sm_rp_oa_str); + } + +#.FN_BODY SM-RP-DAold/noSM-RP-DA + gsm_map_packet_info_t *prev_packet_info = gsm_map_get_matching_tcap_info(actx); +%(DEFAULT_BODY)s + if (prev_packet_info && !PINFO_FD_VISITED(actx->pinfo)) { + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, FALSE); + gsm_map_pi->sm_rp_da_id = prev_packet_info->sm_rp_da_id; + gsm_map_pi->sm_rp_da_str = wmem_strdup(wmem_file_scope(), prev_packet_info->sm_rp_da_str); + } + +#.FN_BODY SM-RP-DA/noSM-RP-DA + gsm_map_packet_info_t *prev_packet_info = gsm_map_get_matching_tcap_info(actx); +%(DEFAULT_BODY)s + if (prev_packet_info && !PINFO_FD_VISITED(actx->pinfo)) { + gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, FALSE); + gsm_map_pi->sm_rp_da_id = prev_packet_info->sm_rp_da_id; + gsm_map_pi->sm_rp_da_str = wmem_strdup(wmem_file_scope(), prev_packet_info->sm_rp_da_str); + } + #.FN_BODY SignalInfo VAL_PTR = ¶meter_tvb - tvbuff_t *parameter_tvb; + tvbuff_t *parameter_tvb; + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; - %(DEFAULT_BODY)s - actx->value_ptr = (void*)parameter_tvb; +%(DEFAULT_BODY)s + if (gsm_map_priv) + gsm_map_priv->signal_info_tvb = parameter_tvb; #.FN_BODY SM-DeliveryFailureCause - /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ guint8 oct; + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; %(DEFAULT_BODY)s - if (!actx->value_ptr) + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) return offset; /* Detailed diagnostic information contains either a SMS-SUBMIT-REPORT or a SMS-DELIVERY-REPORT */ - oct = tvb_get_guint8((tvbuff_t*)actx->value_ptr, 0); + 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, (tvbuff_t*)actx->value_ptr, actx->pinfo, top_tree, NULL); + call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL); #.FN_BODY ForwardSM-Arg - - /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; %(DEFAULT_BODY)s - if (!actx->value_ptr) - return offset; - if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { - if (gsmmap_pdu_type == 1) { - actx->pinfo->p2p_dir = P2P_DIR_SENT; - } else { - actx->pinfo->p2p_dir = P2P_DIR_RECV; - } - } - call_dissector_only(gsm_sms_handle, (tvbuff_t*)actx->value_ptr, actx->pinfo, top_tree, NULL); + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) + return offset; + if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { + if (gsmmap_pdu_type == 1) { + actx->pinfo->p2p_dir = P2P_DIR_SENT; + } else { + actx->pinfo->p2p_dir = P2P_DIR_RECV; + } + } + call_dissector_only(gsm_sms_handle, gsm_map_priv->signal_info_tvb, actx->pinfo, top_tree, NULL); #.FN_BODY MO-ForwardSM-Arg - - /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; %(DEFAULT_BODY)s - if (!actx->value_ptr) - return offset; - if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { - actx->pinfo->p2p_dir = P2P_DIR_RECV; - } - call_dissector_only(gsm_sms_handle, (tvbuff_t*)actx->value_ptr, actx->pinfo, top_tree, NULL); + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) + return offset; + 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); #.FN_BODY MO-ForwardSM-Res - - /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; %(DEFAULT_BODY)s - if (!actx->value_ptr) - return offset; - if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { - actx->pinfo->p2p_dir = P2P_DIR_SENT; - } - call_dissector_only(gsm_sms_handle, (tvbuff_t*)actx->value_ptr, actx->pinfo, top_tree, NULL); + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) + return offset; + 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); #.FN_BODY MT-ForwardSM-Arg - - /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; %(DEFAULT_BODY)s - if (!actx->value_ptr) - return offset; - if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { - actx->pinfo->p2p_dir = P2P_DIR_SENT; - } - call_dissector_only(gsm_sms_handle, (tvbuff_t*)actx->value_ptr, actx->pinfo, top_tree, NULL); + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) + return offset; + 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); #.FN_BODY MT-ForwardSM-Res - - /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; %(DEFAULT_BODY)s - if (!actx->value_ptr) - return offset; - if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { - actx->pinfo->p2p_dir = P2P_DIR_RECV; - } - call_dissector_only(gsm_sms_handle, (tvbuff_t*)actx->value_ptr, actx->pinfo, top_tree, NULL); + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) + return offset; + 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); #.FN_BODY MT-ForwardSM-VGCS-Arg - - /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; %(DEFAULT_BODY)s - if (!actx->value_ptr) - return offset; - if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { - actx->pinfo->p2p_dir = P2P_DIR_SENT; - } - call_dissector_only(gsm_sms_handle, (tvbuff_t*)actx->value_ptr, actx->pinfo, top_tree, NULL); + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) + return offset; + 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); #.FN_BODY MT-ForwardSM-VGCS-Res - - /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + /* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */ + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; %(DEFAULT_BODY)s - if (!actx->value_ptr) - return offset; - if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { - actx->pinfo->p2p_dir = P2P_DIR_RECV; - } - call_dissector_only(gsm_sms_handle, (tvbuff_t*)actx->value_ptr, actx->pinfo, top_tree, NULL); + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) + return offset; + 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); #.FN_BODY SS-Status VAL_PTR = ¶meter_tvb @@ -822,8 +867,10 @@ and GSM 09.10. The Protocol ID indicates that the message or messages are accord For the coding of the messages see GSM 08.06 and GSM 08.08. */ ProtocolId = 0xffffffff; + gsm_map_private_info_t *gsm_map_priv; %(DEFAULT_BODY)s -if (!actx->value_ptr) + gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; +if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_externalsignalinfo); switch (ProtocolId){ @@ -834,56 +881,54 @@ if (!actx->value_ptr) * function */ /* Get tag */ - octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); - proto_tree_add_item(subtree, hf_gsm_map_ie_tag, (tvbuff_t*)actx->value_ptr, 0,1,ENC_BIG_ENDIAN); + octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0); + proto_tree_add_item(subtree, hf_gsm_map_ie_tag, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN); /* get length */ - length = tvb_get_guint8((tvbuff_t*)actx->value_ptr,1); - proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); + length = tvb_get_guint8(gsm_map_priv->signal_info_tvb,1); + proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN); /* Branch on tag */ switch(octet){ case 4: /* Dissect the data part */ - de_bearer_cap((tvbuff_t*)actx->value_ptr, subtree, actx->pinfo, 2, length, NULL, 0); + de_bearer_cap(gsm_map_priv->signal_info_tvb, subtree, actx->pinfo, 2, length, NULL, 0); /* TODO: There may be more than one IE */ break; default: - proto_tree_add_expert(subtree, actx->pinfo, &ei_gsm_map_undecoded, (tvbuff_t*)actx->value_ptr, 0, length); + proto_tree_add_expert(subtree, actx->pinfo, &ei_gsm_map_undecoded, gsm_map_priv->signal_info_tvb, 0, length); break; }/* switch(octet) */ break; case 2: /* gsm-0806 */ - octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); + octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0); /* Discrimination parameter */ - proto_tree_add_item(subtree, hf_gsm_map_disc_par, (tvbuff_t*)actx->value_ptr, 0,1,ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_gsm_map_disc_par, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN); if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */ /* Strip off discrimination and length */ - proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); - next_tvb = tvb_new_subset_remaining((tvbuff_t*)actx->value_ptr, 2); - call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, - p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num)); + proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN); + next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2); + call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info); }else if(octet==1){ - proto_tree_add_item(subtree, hf_gsm_map_dlci, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); - proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 2,1,ENC_BIG_ENDIAN); - next_tvb = tvb_new_subset_remaining((tvbuff_t*)actx->value_ptr, 3); + proto_tree_add_item(subtree, hf_gsm_map_dlci, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 2,1,ENC_BIG_ENDIAN); + next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 3); call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree); } break; case 3: /* gsm-BSSMAP -- Value 3 is reserved and must not be used*/ - octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); + octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0); if ( octet == 0) {/* DISCRIMINATION TS 48 006 */ - next_tvb = tvb_new_subset_remaining((tvbuff_t*)actx->value_ptr, 2); - call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, - p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num)); + next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2); + call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info); } break; /* ets-300102-1 (~Q.931 ) */ case 4: - octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); - length = tvb_get_guint8((tvbuff_t*)actx->value_ptr,1); + octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0); + length = tvb_get_guint8(gsm_map_priv->signal_info_tvb,1); if ( octet == 4 ) - dissect_q931_bearer_capability_ie((tvbuff_t*)actx->value_ptr, 2, length, subtree); + dissect_q931_bearer_capability_ie(gsm_map_priv->signal_info_tvb, 2, length, subtree); break; default: break; @@ -902,10 +947,12 @@ MAP interfaces guint8 length; tvbuff_t *next_tvb; proto_tree *subtree; + gsm_map_private_info_t *gsm_map_priv; ProtocolId = 0xffffffff; %(DEFAULT_BODY)s -if (!actx->value_ptr) + gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; + if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb) return offset; subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_externalsignalinfo); switch (ProtocolId){ @@ -916,56 +963,54 @@ if (!actx->value_ptr) * function */ /* Get tag */ - octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); - proto_tree_add_item(subtree, hf_gsm_map_ie_tag, (tvbuff_t*)actx->value_ptr, 0,1,ENC_BIG_ENDIAN); + octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0); + proto_tree_add_item(subtree, hf_gsm_map_ie_tag, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN); /* get length */ - length = tvb_get_guint8((tvbuff_t*)actx->value_ptr,1); - proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); + length = tvb_get_guint8(gsm_map_priv->signal_info_tvb,1); + proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN); /* Branch on tag */ switch(octet){ case 4: /* Dissect the data part */ - de_bearer_cap((tvbuff_t*)actx->value_ptr, subtree, actx->pinfo, 2, length, NULL, 0); + de_bearer_cap(gsm_map_priv->signal_info_tvb, subtree, actx->pinfo, 2, length, NULL, 0); /* TODO: There may be more than one IE */ break; default: - proto_tree_add_expert(subtree, actx->pinfo, &ei_gsm_map_undecoded, (tvbuff_t*)actx->value_ptr, 0, length); + proto_tree_add_expert(subtree, actx->pinfo, &ei_gsm_map_undecoded, gsm_map_priv->signal_info_tvb, 0, length); break; }/* switch(octet) */ break; case 2: /* gsm-0806 */ - octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); + octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0); /* Discrimination parameter */ - proto_tree_add_item(subtree, hf_gsm_map_disc_par, (tvbuff_t*)actx->value_ptr, 0,1,ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_gsm_map_disc_par, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN); if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */ /* Strip off discrimination and length */ - proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); - next_tvb = tvb_new_subset_remaining((tvbuff_t*)actx->value_ptr, 2); - call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, - p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num)); + proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN); + next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2); + call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info); }else if(octet==1){ - proto_tree_add_item(subtree, hf_gsm_map_dlci, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); - proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 2,1,ENC_BIG_ENDIAN); - next_tvb = tvb_new_subset_remaining((tvbuff_t*)actx->value_ptr, 3); + proto_tree_add_item(subtree, hf_gsm_map_dlci, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 2,1,ENC_BIG_ENDIAN); + next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 3); call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree); } break; case 3: /* gsm-BSSMAP TODO Is it correct to stripp off two first octets here?*/ - octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); + octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0); if ( octet == 0) {/* DISCRIMINATION TS 48 006 */ - next_tvb = tvb_new_subset_remaining((tvbuff_t*)actx->value_ptr, 2); - call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, - p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num)); + next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2); + call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info); } break; /* ets-300102-1 (~Q.931 ) */ case 4: - octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); - length = tvb_get_guint8((tvbuff_t*)actx->value_ptr,1); + octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0); + length = tvb_get_guint8(gsm_map_priv->signal_info_tvb,1); if ( octet == 4 ) - dissect_q931_bearer_capability_ie((tvbuff_t*)actx->value_ptr, 2, length, subtree); + dissect_q931_bearer_capability_ie(gsm_map_priv->signal_info_tvb, 2, length, subtree); break; default: break; 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 897b2d2e0b..c4b79eefa8 100644 --- a/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c +++ b/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c @@ -53,6 +53,7 @@ #include <epan/oids.h> #include <epan/expert.h> #include <epan/proto_data.h> +#include <epan/conversation.h> #include <wsutil/strtoi.h> #include <epan/asn1.h> @@ -76,7 +77,7 @@ void proto_register_gsm_map(void); void proto_reg_handoff_gsm_map(void); /* Initialize the protocol and registered fields */ -int proto_gsm_map = -1; +static int proto_gsm_map = -1; static int proto_gsm_map_dialogue = -1; static int proto_gsm_map_ms = -1; @@ -231,15 +232,75 @@ static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx); const gchar* gsm_map_opr_code(guint32 val, proto_item *item); -static gsm_map_packet_info_t *gsm_map_get_packet_info(packet_info *pinfo) +typedef struct { + struct tcap_private_t * tcap_private; + sccp_msg_info_t *sccp_msg_info; + tvbuff_t *signal_info_tvb; +} gsm_map_private_info_t; + +typedef struct { + wmem_tree_t *packets; +} gsm_map_conv_info_t; + +static gsm_map_packet_info_t *gsm_map_get_packet_info(asn1_ctx_t *actx, gboolean store_conv_info) { - gsm_map_packet_info_t *gsm_map_pi = (gsm_map_packet_info_t*)p_get_proto_data(pinfo->pool, pinfo, proto_gsm_map, 0); - if (gsm_map_pi) - return gsm_map_pi; - gsm_map_pi = wmem_new0(pinfo->pool, gsm_map_packet_info_t); - p_add_proto_data(pinfo->pool, pinfo, proto_gsm_map, 0, gsm_map_pi); + gsm_map_packet_info_t *gsm_map_pi = (gsm_map_packet_info_t*)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_gsm_map, 0); + if (!gsm_map_pi) { + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; + gsm_map_pi = wmem_new0(wmem_file_scope(), gsm_map_packet_info_t); + p_add_proto_data(wmem_file_scope(), actx->pinfo, proto_gsm_map, 0, gsm_map_pi); + if (store_conv_info && gsm_map_priv && gsm_map_priv->tcap_private) { + conversation_t *conversation; + gsm_map_conv_info_t *gsm_map_info; + wmem_tree_key_t key[3]; + conversation = find_or_create_conversation(actx->pinfo); + gsm_map_info = (gsm_map_conv_info_t *)conversation_get_proto_data(conversation, proto_gsm_map); + if (!gsm_map_info) { + gsm_map_info = wmem_new(wmem_file_scope(), gsm_map_conv_info_t); + gsm_map_info->packets = wmem_tree_new(wmem_file_scope()); + conversation_add_proto_data(conversation, proto_gsm_map, gsm_map_info); + } + gsm_map_pi->tcap_src_tid = gsm_map_priv->tcap_private->src_tid; + key[0].length = 1; + key[0].key = &gsm_map_priv->tcap_private->src_tid; + key[1].length = 1; + key[1].key = &actx->pinfo->num; + key[2].length = 0; + key[2].key = NULL; + wmem_tree_insert32_array(gsm_map_info->packets, key, (void *)gsm_map_pi); + } + } return gsm_map_pi; } + +static gsm_map_packet_info_t *gsm_map_get_matching_tcap_info(asn1_ctx_t *actx) +{ + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; + if (gsm_map_priv && gsm_map_priv->tcap_private) { + conversation_t *conversation; + gsm_map_conv_info_t *gsm_map_info; + wmem_tree_key_t key[3]; + gsm_map_packet_info_t *gsm_map_pi; + conversation = find_or_create_conversation(actx->pinfo); + gsm_map_info = (gsm_map_conv_info_t *)conversation_get_proto_data(conversation, proto_gsm_map); + if (!gsm_map_info) { + gsm_map_info = wmem_new(wmem_file_scope(), gsm_map_conv_info_t); + gsm_map_info->packets = wmem_tree_new(wmem_file_scope()); + conversation_add_proto_data(conversation, proto_gsm_map, gsm_map_info); + } + key[0].length = 1; + key[0].key = &gsm_map_priv->tcap_private->src_tid; + key[1].length = 1; + key[1].key = &actx->pinfo->num; + key[2].length = 0; + key[2].key = NULL; + gsm_map_pi = (gsm_map_packet_info_t*)wmem_tree_lookup32_array_le(gsm_map_info->packets, key); + if (gsm_map_pi && gsm_map_pi->tcap_src_tid == gsm_map_priv->tcap_private->src_tid) + return gsm_map_pi; + } + return NULL; +} + /* Value strings */ const value_string gsm_map_PDP_Type_Organisation_vals[] = { @@ -2098,17 +2159,18 @@ static int dissect_NokiaMAP_ext_DsdArgExt(tvbuff_t *tvb, packet_info *pinfo, pro } static int -dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, - int hf_index _U_, struct tcap_private_t * p_private_tcap) { +dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, + asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) { char *version_ptr; opcode = 0; if (pref_application_context_version == APPLICATON_CONTEXT_FROM_TRACE) { + gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr; application_context_version = 0; - if (p_private_tcap != NULL){ - if (p_private_tcap->acv==TRUE ){ - version_ptr = strrchr((const char*)p_private_tcap->oid,'.'); + if (gsm_map_priv && gsm_map_priv->tcap_private != NULL){ + if (gsm_map_priv->tcap_private->acv==TRUE ){ + version_ptr = strrchr((const char*)gsm_map_priv->tcap_private->oid,'.'); if (version_ptr){ ws_strtoi32(version_ptr + 1, NULL, &application_context_version); } @@ -2141,8 +2203,8 @@ dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void /* Used for gsm_map TAP */ static gsm_map_tap_rec_t tap_rec; gint op_idx; - struct tcap_private_t * p_private_tcap = (struct tcap_private_t *)data; asn1_ctx_t asn1_ctx; + gsm_map_private_info_t *gsm_map_priv; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -2150,11 +2212,15 @@ dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void 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; + asn1_ctx.value_ptr = gsm_map_priv; + /* create display subtree for the protocol */ item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_gsm_map); - dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1, p_private_tcap); + dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1); try_val_to_str_idx(opcode, gsm_map_opr_code_strings, &op_idx); if (op_idx != -1) { @@ -2177,6 +2243,7 @@ dissect_gsm_map_sccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, static gsm_map_tap_rec_t tap_rec; gint op_idx; asn1_ctx_t asn1_ctx; + gsm_map_private_info_t *gsm_map_priv; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -2184,15 +2251,15 @@ dissect_gsm_map_sccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, 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; + asn1_ctx.value_ptr = gsm_map_priv; + /* create display subtree for the protocol */ item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_gsm_map); - /* Save the sccp_msg_info_t data (if present) because it can't be passed - through function calls */ - p_add_proto_data(pinfo->pool, pinfo, proto_gsm_map, pinfo->curr_layer_num, data); - - dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1, NULL); + dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1); try_val_to_str_idx(opcode, gsm_map_opr_code_strings, &op_idx); if (op_idx != -1) { diff --git a/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.h b/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.h index fdce0ccb9d..c1c0ee7902 100644 --- a/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.h +++ b/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.h @@ -54,28 +54,27 @@ guint8 dissect_cbs_data_coding_scheme(tvbuff_t *tvb, packet_info *pinfo _U_, pro void dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree); typedef enum { - GSM_MAP_RP_OA_NO_ID = 0, - GSM_MAP_RP_OA_MSISDN, - GSM_MAP_RP_OA_SERVICE_CENTER_ADDRESS -} gsm_map_rp_oa_id; + GSM_MAP_SM_RP_OA_NO_ID = 0, + GSM_MAP_SM_RP_OA_MSISDN, + GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS +} gsm_map_sm_rp_oa_id; typedef enum { - GSM_MAP_RP_DA_NO_ID = 0, - GSM_MAP_RP_DA_IMSI, - GSM_MAP_RP_DA_LMSI, - GSM_MAP_RP_DA_SERVICE_CENTER_ADDRESS -} gsm_map_rp_da_id; + GSM_MAP_SM_RP_DA_NO_ID = 0, + GSM_MAP_SM_RP_DA_IMSI, + GSM_MAP_SM_RP_DA_LMSI, + GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS +} gsm_map_sm_rp_da_id; -/* structure accessible via p_get_proto_data(pinfo->pool, pinfo, proto_gsm_map, 0) */ +/* structure accessible via p_get_proto_data(wmem_file_scope(), pinfo, proto_gsm_map, 0) */ typedef struct { - gsm_map_rp_oa_id rp_oa_id; - const gchar *rp_oa_str; - gsm_map_rp_da_id rp_da_id; - const gchar *rp_da_str; + gsm_map_sm_rp_oa_id sm_rp_oa_id; + const gchar *sm_rp_oa_str; + gsm_map_sm_rp_da_id sm_rp_da_id; + const gchar *sm_rp_da_str; + guint32 tcap_src_tid; } gsm_map_packet_info_t; -extern int proto_gsm_map; - #include "packet-gsm_map-exp.h" |