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>
This commit is contained in:
Pascal Quantin 2017-04-28 18:39:07 +02:00 committed by Anders Broman
parent 5bda98586b
commit fb1a6320ec
11 changed files with 778 additions and 506 deletions

View File

@ -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); subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_isdn_address_string);
dissect_gsm_map_msisdn(parameter_tvb, actx->pinfo , subtree); 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 = &parameter_tvb #.FN_BODY IMSI VAL_PTR = &parameter_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, &parameter_tvb); offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &parameter_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) if(tvb_reported_length(parameter_tvb)==0)
return offset; return offset;
/* Hide the octet string default printout */ /* Hide the octet string default printout */
PROTO_ITEM_SET_HIDDEN(actx->created_item); PROTO_ITEM_SET_HIDDEN(actx->created_item);
actx->private_data = wmem_strdup(actx->pinfo->pool, imsi_str = dissect_e212_imsi(parameter_tvb, actx->pinfo, tree,
dissect_e212_imsi(parameter_tvb, actx->pinfo, tree, 0, tvb_reported_length(parameter_tvb), FALSE);
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 = &parameter_tvb #.FN_BODY LMSI VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb; tvbuff_t *parameter_tvb;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (parameter_tvb) { if (parameter_tvb && !PINFO_FD_VISITED(actx->pinfo)) {
actx->private_data = tvb_bytes_to_str(actx->pinfo->pool, parameter_tvb, 0, tvb_captured_length(parameter_tvb)); actx->private_data = tvb_bytes_to_str(wmem_file_scope(), parameter_tvb, 0, tvb_captured_length(parameter_tvb));
} }
#.FN_BODY TBCD-STRING VAL_PTR = &parameter_tvb #.FN_BODY TBCD-STRING VAL_PTR = &parameter_tvb
@ -314,6 +317,8 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
guint8 octet; guint8 octet;
tvbuff_t *next_tvb; tvbuff_t *next_tvb;
proto_tree *subtree; proto_tree *subtree;
gsm_map_private_info_t *gsm_map_priv;
sccp_msg_info_t *sccp_msg_info;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
@ -321,6 +326,8 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
if (!parameter_tvb) if (!parameter_tvb)
return offset; 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); subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_LongSignalInfo);
switch (AccessNetworkProtocolId){ switch (AccessNetworkProtocolId){
@ -333,8 +340,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
/* Strip off discrimination and length */ /* Strip off discrimination and length */
proto_tree_add_item(subtree, hf_gsm_map_len, parameter_tvb, 1,1,ENC_BIG_ENDIAN); 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); next_tvb = tvb_new_subset_remaining(parameter_tvb, 2);
call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, sccp_msg_info);
p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num));
}else if(octet==1){ }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_dlci, parameter_tvb, 1,1,ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_gsm_map_len, parameter_tvb, 2,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; actx->pinfo->p2p_dir = P2P_DIR_SENT;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_oa_id = GSM_MAP_RP_OA_SERVICE_CENTER_ADDRESS; gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS;
gsm_map_pi->rp_oa_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_oa_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_SENT;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_oa_id = GSM_MAP_RP_OA_SERVICE_CENTER_ADDRESS; gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS;
gsm_map_pi->rp_oa_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_oa_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_SENT;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_IMSI; gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_IMSI;
gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_SENT;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_LMSI; gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_LMSI;
gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_SENT;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_IMSI; gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_IMSI;
gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_SENT;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_LMSI; gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_LMSI;
gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_RECV;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_oa_id = GSM_MAP_RP_OA_MSISDN; gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_MSISDN;
gsm_map_pi->rp_oa_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_oa_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_RECV;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_oa_id = GSM_MAP_RP_OA_MSISDN; gsm_map_pi->sm_rp_oa_id = GSM_MAP_SM_RP_OA_MSISDN;
gsm_map_pi->rp_oa_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_oa_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_RECV;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_SERVICE_CENTER_ADDRESS; gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS;
gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data;
actx->private_data = NULL; 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; actx->pinfo->p2p_dir = P2P_DIR_RECV;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (actx->private_data) { if (actx->private_data) {
gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx->pinfo); gsm_map_packet_info_t *gsm_map_pi = gsm_map_get_packet_info(actx, TRUE);
gsm_map_pi->rp_da_id = GSM_MAP_RP_DA_SERVICE_CENTER_ADDRESS; gsm_map_pi->sm_rp_da_id = GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS;
gsm_map_pi->rp_da_str = (const gchar*)actx->private_data; gsm_map_pi->sm_rp_da_str = (const gchar*)actx->private_data;
actx->private_data = NULL; actx->private_data = NULL;
} }
#.FN_BODY SignalInfo VAL_PTR = &parameter_tvb #.FN_BODY SM-RP-OAold/noSM-RP-OA
tvbuff_t *parameter_tvb; 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);
}
%(DEFAULT_BODY)s #.FN_BODY SM-RP-OA/noSM-RP-OA
actx->value_ptr = (void*)parameter_tvb; 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 = &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
if (gsm_map_priv)
gsm_map_priv->signal_info_tvb = parameter_tvb;
#.FN_BODY SM-DeliveryFailureCause #.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; guint8 oct;
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
if (!actx->value_ptr) if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
return offset; return offset;
/* Detailed diagnostic information contains either a SMS-SUBMIT-REPORT or a SMS-DELIVERY-REPORT */ /* 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; 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 #.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 %(DEFAULT_BODY)s
if (!actx->value_ptr) if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
return offset; return offset;
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
if (gsmmap_pdu_type == 1) { if (gsmmap_pdu_type == 1) {
actx->pinfo->p2p_dir = P2P_DIR_SENT; actx->pinfo->p2p_dir = P2P_DIR_SENT;
} else { } else {
actx->pinfo->p2p_dir = P2P_DIR_RECV; actx->pinfo->p2p_dir = P2P_DIR_RECV;
} }
} }
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 MO-ForwardSM-Arg #.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 %(DEFAULT_BODY)s
if (!actx->value_ptr) if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
return offset; return offset;
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_RECV; actx->pinfo->p2p_dir = P2P_DIR_RECV;
} }
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 MO-ForwardSM-Res #.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 %(DEFAULT_BODY)s
if (!actx->value_ptr) if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
return offset; return offset;
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_SENT; actx->pinfo->p2p_dir = 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 MT-ForwardSM-Arg #.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 %(DEFAULT_BODY)s
if (!actx->value_ptr) if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
return offset; return offset;
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_SENT; actx->pinfo->p2p_dir = 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 MT-ForwardSM-Res #.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 %(DEFAULT_BODY)s
if (!actx->value_ptr) if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
return offset; return offset;
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_RECV; actx->pinfo->p2p_dir = P2P_DIR_RECV;
} }
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 MT-ForwardSM-VGCS-Arg #.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 %(DEFAULT_BODY)s
if (!actx->value_ptr) if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
return offset; return offset;
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_SENT; actx->pinfo->p2p_dir = 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 MT-ForwardSM-VGCS-Res #.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 %(DEFAULT_BODY)s
if (!actx->value_ptr) if (!gsm_map_priv || !gsm_map_priv->signal_info_tvb)
return offset; return offset;
if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) { if (actx->pinfo->p2p_dir == P2P_DIR_UNKNOWN) {
actx->pinfo->p2p_dir = P2P_DIR_RECV; actx->pinfo->p2p_dir = P2P_DIR_RECV;
} }
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 SS-Status VAL_PTR = &parameter_tvb #.FN_BODY SS-Status VAL_PTR = &parameter_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. For the coding of the messages see GSM 08.06 and GSM 08.08.
*/ */
ProtocolId = 0xffffffff; ProtocolId = 0xffffffff;
gsm_map_private_info_t *gsm_map_priv;
%(DEFAULT_BODY)s %(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; return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_externalsignalinfo); subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_externalsignalinfo);
switch (ProtocolId){ switch (ProtocolId){
@ -834,56 +881,54 @@ if (!actx->value_ptr)
* function * function
*/ */
/* Get tag */ /* Get tag */
octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0);
proto_tree_add_item(subtree, hf_gsm_map_ie_tag, (tvbuff_t*)actx->value_ptr, 0,1,ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_gsm_map_ie_tag, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN);
/* get length */ /* get length */
length = tvb_get_guint8((tvbuff_t*)actx->value_ptr,1); length = tvb_get_guint8(gsm_map_priv->signal_info_tvb,1);
proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
/* Branch on tag */ /* Branch on tag */
switch(octet){ switch(octet){
case 4: case 4:
/* Dissect the data part */ /* 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 */ /* TODO: There may be more than one IE */
break; break;
default: 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; break;
}/* switch(octet) */ }/* switch(octet) */
break; break;
case 2: case 2:
/* gsm-0806 */ /* 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 */ /* 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) */ if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */
/* Strip off discrimination and length */ /* Strip off discrimination and length */
proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); 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((tvbuff_t*)actx->value_ptr, 2); next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2);
call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info);
p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num));
}else if(octet==1){ }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_dlci, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 2,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((tvbuff_t*)actx->value_ptr, 3); next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 3);
call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree); call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree);
} }
break; break;
case 3: case 3:
/* gsm-BSSMAP -- Value 3 is reserved and must not be used*/ /* 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 */ if ( octet == 0) {/* DISCRIMINATION TS 48 006 */
next_tvb = tvb_new_subset_remaining((tvbuff_t*)actx->value_ptr, 2); next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2);
call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info);
p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num));
} }
break; break;
/* ets-300102-1 (~Q.931 ) */ /* ets-300102-1 (~Q.931 ) */
case 4: case 4:
octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0);
length = tvb_get_guint8((tvbuff_t*)actx->value_ptr,1); length = tvb_get_guint8(gsm_map_priv->signal_info_tvb,1);
if ( octet == 4 ) 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; break;
default: default:
break; break;
@ -902,10 +947,12 @@ MAP interfaces
guint8 length; guint8 length;
tvbuff_t *next_tvb; tvbuff_t *next_tvb;
proto_tree *subtree; proto_tree *subtree;
gsm_map_private_info_t *gsm_map_priv;
ProtocolId = 0xffffffff; ProtocolId = 0xffffffff;
%(DEFAULT_BODY)s %(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; return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_externalsignalinfo); subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_externalsignalinfo);
switch (ProtocolId){ switch (ProtocolId){
@ -916,56 +963,54 @@ if (!actx->value_ptr)
* function * function
*/ */
/* Get tag */ /* Get tag */
octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0);
proto_tree_add_item(subtree, hf_gsm_map_ie_tag, (tvbuff_t*)actx->value_ptr, 0,1,ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_gsm_map_ie_tag, gsm_map_priv->signal_info_tvb, 0,1,ENC_BIG_ENDIAN);
/* get length */ /* get length */
length = tvb_get_guint8((tvbuff_t*)actx->value_ptr,1); length = tvb_get_guint8(gsm_map_priv->signal_info_tvb,1);
proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_gsm_map_len, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
/* Branch on tag */ /* Branch on tag */
switch(octet){ switch(octet){
case 4: case 4:
/* Dissect the data part */ /* 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 */ /* TODO: There may be more than one IE */
break; break;
default: 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; break;
}/* switch(octet) */ }/* switch(octet) */
break; break;
case 2: case 2:
/* gsm-0806 */ /* 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 */ /* 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) */ if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */
/* Strip off discrimination and length */ /* Strip off discrimination and length */
proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 1,1,ENC_BIG_ENDIAN); 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((tvbuff_t*)actx->value_ptr, 2); next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2);
call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info);
p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num));
}else if(octet==1){ }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_dlci, gsm_map_priv->signal_info_tvb, 1,1,ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_gsm_map_len, (tvbuff_t*)actx->value_ptr, 2,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((tvbuff_t*)actx->value_ptr, 3); next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 3);
call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree); call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree);
} }
break; break;
case 3: case 3:
/* gsm-BSSMAP TODO Is it correct to stripp off two first octets here?*/ /* 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 */ if ( octet == 0) {/* DISCRIMINATION TS 48 006 */
next_tvb = tvb_new_subset_remaining((tvbuff_t*)actx->value_ptr, 2); next_tvb = tvb_new_subset_remaining(gsm_map_priv->signal_info_tvb, 2);
call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, call_dissector_with_data(bssap_handle, next_tvb, actx->pinfo, subtree, gsm_map_priv->sccp_msg_info);
p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_gsm_map, actx->pinfo->curr_layer_num));
} }
break; break;
/* ets-300102-1 (~Q.931 ) */ /* ets-300102-1 (~Q.931 ) */
case 4: case 4:
octet = tvb_get_guint8((tvbuff_t*)actx->value_ptr,0); octet = tvb_get_guint8(gsm_map_priv->signal_info_tvb,0);
length = tvb_get_guint8((tvbuff_t*)actx->value_ptr,1); length = tvb_get_guint8(gsm_map_priv->signal_info_tvb,1);
if ( octet == 4 ) 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; break;
default: default:
break; break;

View File

@ -53,6 +53,7 @@
#include <epan/oids.h> #include <epan/oids.h>
#include <epan/expert.h> #include <epan/expert.h>
#include <epan/proto_data.h> #include <epan/proto_data.h>
#include <epan/conversation.h>
#include <wsutil/strtoi.h> #include <wsutil/strtoi.h>
#include <epan/asn1.h> #include <epan/asn1.h>
@ -76,7 +77,7 @@ void proto_register_gsm_map(void);
void proto_reg_handoff_gsm_map(void); void proto_reg_handoff_gsm_map(void);
/* Initialize the protocol and registered fields */ /* 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_dialogue = -1;
static int proto_gsm_map_ms = -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); 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); 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); 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) if (!gsm_map_pi) {
return gsm_map_pi; gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
gsm_map_pi = wmem_new0(pinfo->pool, gsm_map_packet_info_t); gsm_map_pi = wmem_new0(wmem_file_scope(), gsm_map_packet_info_t);
p_add_proto_data(pinfo->pool, pinfo, proto_gsm_map, 0, gsm_map_pi); 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; 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 */ /* Value strings */
const value_string gsm_map_PDP_Type_Organisation_vals[] = { 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 static int
dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
int hf_index _U_, struct tcap_private_t * p_private_tcap) { asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
char *version_ptr; char *version_ptr;
opcode = 0; opcode = 0;
if (pref_application_context_version == APPLICATON_CONTEXT_FROM_TRACE) { 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; application_context_version = 0;
if (p_private_tcap != NULL){ if (gsm_map_priv && gsm_map_priv->tcap_private != NULL){
if (p_private_tcap->acv==TRUE ){ if (gsm_map_priv->tcap_private->acv==TRUE ){
version_ptr = strrchr((const char*)p_private_tcap->oid,'.'); version_ptr = strrchr((const char*)gsm_map_priv->tcap_private->oid,'.');
if (version_ptr){ if (version_ptr){
ws_strtoi32(version_ptr + 1, NULL, &application_context_version); 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 */ /* Used for gsm_map TAP */
static gsm_map_tap_rec_t tap_rec; static gsm_map_tap_rec_t tap_rec;
gint op_idx; gint op_idx;
struct tcap_private_t * p_private_tcap = (struct tcap_private_t *)data;
asn1_ctx_t asn1_ctx; asn1_ctx_t asn1_ctx;
gsm_map_private_info_t *gsm_map_priv;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); 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; 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 */ /* create display subtree for the protocol */
item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA); item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_gsm_map); 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); try_val_to_str_idx(opcode, gsm_map_opr_code_strings, &op_idx);
if (op_idx != -1) { 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; static gsm_map_tap_rec_t tap_rec;
gint op_idx; gint op_idx;
asn1_ctx_t asn1_ctx; asn1_ctx_t asn1_ctx;
gsm_map_private_info_t *gsm_map_priv;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); 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; 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 */ /* create display subtree for the protocol */
item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA); item = proto_tree_add_item(parent_tree, proto_gsm_map, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_gsm_map); tree = proto_item_add_subtree(item, ett_gsm_map);
/* Save the sccp_msg_info_t data (if present) because it can't be passed dissect_gsm_map_GSMMAPPDU(FALSE, tvb, 0, &asn1_ctx, tree, -1);
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);
try_val_to_str_idx(opcode, gsm_map_opr_code_strings, &op_idx); try_val_to_str_idx(opcode, gsm_map_opr_code_strings, &op_idx);
if (op_idx != -1) { if (op_idx != -1) {

View File

@ -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); void dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree);
typedef enum { typedef enum {
GSM_MAP_RP_OA_NO_ID = 0, GSM_MAP_SM_RP_OA_NO_ID = 0,
GSM_MAP_RP_OA_MSISDN, GSM_MAP_SM_RP_OA_MSISDN,
GSM_MAP_RP_OA_SERVICE_CENTER_ADDRESS GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS
} gsm_map_rp_oa_id; } gsm_map_sm_rp_oa_id;
typedef enum { typedef enum {
GSM_MAP_RP_DA_NO_ID = 0, GSM_MAP_SM_RP_DA_NO_ID = 0,
GSM_MAP_RP_DA_IMSI, GSM_MAP_SM_RP_DA_IMSI,
GSM_MAP_RP_DA_LMSI, GSM_MAP_SM_RP_DA_LMSI,
GSM_MAP_RP_DA_SERVICE_CENTER_ADDRESS GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS
} gsm_map_rp_da_id; } 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 { typedef struct {
gsm_map_rp_oa_id rp_oa_id; gsm_map_sm_rp_oa_id sm_rp_oa_id;
const gchar *rp_oa_str; const gchar *sm_rp_oa_str;
gsm_map_rp_da_id rp_da_id; gsm_map_sm_rp_da_id sm_rp_da_id;
const gchar *rp_da_str; const gchar *sm_rp_da_str;
guint32 tcap_src_tid;
} gsm_map_packet_info_t; } gsm_map_packet_info_t;
extern int proto_gsm_map;
#include "packet-gsm_map-exp.h" #include "packet-gsm_map-exp.h"

View File

@ -87,7 +87,6 @@ static struct tcapsrt_info_t tcapsrt_global_info[MAX_TCAP_INSTANCE];
#define MAX_SSN 254 #define MAX_SSN 254
static range_t *global_ssn_range; static range_t *global_ssn_range;
static range_t *ssn_range; static range_t *ssn_range;
struct tcap_private_t tcap_private;
gboolean gtcap_HandleSRT=FALSE; gboolean gtcap_HandleSRT=FALSE;
/* These two timeout (in second) are used when some message are lost, /* These two timeout (in second) are used when some message are lost,
@ -117,7 +116,6 @@ static proto_tree * tcap_stat_tree=NULL;
static dissector_handle_t data_handle; static dissector_handle_t data_handle;
static dissector_handle_t ansi_tcap_handle; static dissector_handle_t ansi_tcap_handle;
static void raz_tcap_private(struct tcap_private_t * p_tcap_private);
static int dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset);
static int dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_); static int dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_);
@ -1826,6 +1824,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
gint8 ber_class; gint8 ber_class;
gboolean pc; gboolean pc;
gint tag; gint tag;
struct tcap_private_t *p_tcap_private;
/* Check if ANSI TCAP and call the ANSI TCAP dissector if that's the case /* Check if ANSI TCAP and call the ANSI TCAP dissector if that's the case
* PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU, * PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU,
@ -1874,9 +1873,9 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
} }
cur_oid = NULL; cur_oid = NULL;
tcapext_oid = NULL; tcapext_oid = NULL;
raz_tcap_private(&tcap_private);
asn1_ctx.value_ptr = &tcap_private; p_tcap_private = wmem_new0(wmem_packet_scope(), struct tcap_private_t);
asn1_ctx.value_ptr = p_tcap_private;
gp_tcapsrt_info=tcapsrt_razinfo(); gp_tcapsrt_info=tcapsrt_razinfo();
tcap_subdissector_used=FALSE; tcap_subdissector_used=FALSE;
gp_tcap_context=NULL; gp_tcap_context=NULL;
@ -1884,7 +1883,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
if (gtcap_HandleSRT && !tcap_subdissector_used ) { if (gtcap_HandleSRT && !tcap_subdissector_used ) {
p_tcap_context=tcapsrt_call_matching(tvb, pinfo, tcap_stat_tree, gp_tcapsrt_info); p_tcap_context=tcapsrt_call_matching(tvb, pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_private.context=p_tcap_context; p_tcap_private->context=p_tcap_context;
/* If the current message is TCAP only, /* If the current message is TCAP only,
* save the Application Context Name for the next messages * save the Application Context Name for the next messages
@ -2191,20 +2190,16 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset
return offset; return offset;
} }
static void raz_tcap_private(struct tcap_private_t * p_tcap_private)
{
memset(p_tcap_private,0,sizeof(struct tcap_private_t) );
}
/* /*
* Call ITU Subdissector to decode the Tcap Component * Call ITU Subdissector to decode the Tcap Component
*/ */
static int static int
dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_)
{ {
dissector_handle_t subdissector_handle=NULL; dissector_handle_t subdissector_handle=NULL;
gboolean is_subdissector=FALSE; gboolean is_subdissector=FALSE;
struct tcaphash_context_t * p_tcap_context=NULL; struct tcaphash_context_t * p_tcap_context=NULL;
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
/* /*
* ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it. * ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it.
@ -2218,11 +2213,11 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info); p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_subdissector_used=TRUE; tcap_subdissector_used=TRUE;
gp_tcap_context=p_tcap_context; gp_tcap_context=p_tcap_context;
tcap_private.context=p_tcap_context; p_tcap_private->context=p_tcap_context;
} else { } else {
/* Take the last TCAP context */ /* Take the last TCAP context */
p_tcap_context = gp_tcap_context; p_tcap_context = gp_tcap_context;
tcap_private.context=p_tcap_context; p_tcap_private->context=p_tcap_context;
} }
} }
if (p_tcap_context) { if (p_tcap_context) {
@ -2261,8 +2256,8 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
} else { } else {
/* Copy the OID from the TCAP context to the current oid */ /* Copy the OID from the TCAP context to the current oid */
if (p_tcap_context->oid_present) { if (p_tcap_context->oid_present) {
tcap_private.oid= (void*) p_tcap_context->oid; p_tcap_private->oid= (void*) p_tcap_context->oid;
tcap_private.acv=TRUE; p_tcap_private->acv=TRUE;
} }
} /* no OID */ } /* no OID */
} /* no TCAP context */ } /* no TCAP context */

View File

@ -66,6 +66,8 @@ struct tcap_private_t {
guint32 session_id; guint32 session_id;
void * context; void * context;
gchar *TransactionID_str; gchar *TransactionID_str;
guint32 src_tid;
guint32 dst_tid;
}; };
/** @file /** @file

View File

@ -113,25 +113,29 @@ ABRT-apdu/_untag/user-information abrt_user_information
#---------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------
#.FN_BODY AUDT-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid #.FN_BODY AUDT-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
tcap_private.oid= (const void*) cur_oid; p_tcap_private->oid= (const void*) cur_oid;
tcap_private.acv=TRUE; p_tcap_private->acv=TRUE;
#---------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------
#.FN_BODY AARQ-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid #.FN_BODY AARQ-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
tcap_private.oid= (const void*) cur_oid; p_tcap_private->oid= (const void*) cur_oid;
tcap_private.acv=TRUE; p_tcap_private->acv=TRUE;
#---------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------
#.FN_BODY AARE-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid #.FN_BODY AARE-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
%(DEFAULT_BODY)s %(DEFAULT_BODY)s
tcap_private.oid= (const void*) cur_oid; p_tcap_private->oid= (const void*) cur_oid;
tcap_private.acv=TRUE; p_tcap_private->acv=TRUE;
#---------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------
#.FN_BODY OrigTransactionID #.FN_BODY OrigTransactionID
tvbuff_t *parameter_tvb; tvbuff_t *parameter_tvb;
guint8 len, i; guint8 len, i;
proto_tree *subtree; proto_tree *subtree;
int saved_offset; int saved_offset;
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
hf_index = hf_tcap_tid; hf_index = hf_tcap_tid;
saved_offset = offset; saved_offset = offset;
@ -159,6 +163,7 @@ ABRT-apdu/_untag/user-information abrt_user_information
gp_tcapsrt_info->src_tid=0; gp_tcapsrt_info->src_tid=0;
break; break;
} }
p_tcap_private->src_tid = gp_tcapsrt_info->src_tid;
if (len) { if (len) {
col_append_str(actx->pinfo->cinfo, COL_INFO, "otid("); col_append_str(actx->pinfo->cinfo, COL_INFO, "otid(");
@ -175,6 +180,7 @@ ABRT-apdu/_untag/user-information abrt_user_information
guint8 len , i; guint8 len , i;
proto_tree *subtree; proto_tree *subtree;
int saved_offset; int saved_offset;
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
hf_index = hf_tcap_tid; hf_index = hf_tcap_tid;
saved_offset = offset; saved_offset = offset;
@ -202,6 +208,7 @@ ABRT-apdu/_untag/user-information abrt_user_information
gp_tcapsrt_info->dst_tid=0; gp_tcapsrt_info->dst_tid=0;
break; break;
} }
p_tcap_private->dst_tid = gp_tcapsrt_info->dst_tid;
if (len) { if (len) {
col_append_str(actx->pinfo->cinfo, COL_INFO, "dtid("); col_append_str(actx->pinfo->cinfo, COL_INFO, "dtid(");

File diff suppressed because it is too large Load Diff

View File

@ -62,28 +62,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); void dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree);
typedef enum { typedef enum {
GSM_MAP_RP_OA_NO_ID = 0, GSM_MAP_SM_RP_OA_NO_ID = 0,
GSM_MAP_RP_OA_MSISDN, GSM_MAP_SM_RP_OA_MSISDN,
GSM_MAP_RP_OA_SERVICE_CENTER_ADDRESS GSM_MAP_SM_RP_OA_SERVICE_CENTER_ADDRESS
} gsm_map_rp_oa_id; } gsm_map_sm_rp_oa_id;
typedef enum { typedef enum {
GSM_MAP_RP_DA_NO_ID = 0, GSM_MAP_SM_RP_DA_NO_ID = 0,
GSM_MAP_RP_DA_IMSI, GSM_MAP_SM_RP_DA_IMSI,
GSM_MAP_RP_DA_LMSI, GSM_MAP_SM_RP_DA_LMSI,
GSM_MAP_RP_DA_SERVICE_CENTER_ADDRESS GSM_MAP_SM_RP_DA_SERVICE_CENTER_ADDRESS
} gsm_map_rp_da_id; } 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 { typedef struct {
gsm_map_rp_oa_id rp_oa_id; gsm_map_sm_rp_oa_id sm_rp_oa_id;
const gchar *rp_oa_str; const gchar *sm_rp_oa_str;
gsm_map_rp_da_id rp_da_id; gsm_map_sm_rp_da_id sm_rp_da_id;
const gchar *rp_da_str; const gchar *sm_rp_da_str;
guint32 tcap_src_tid;
} gsm_map_packet_info_t; } gsm_map_packet_info_t;
extern int proto_gsm_map;
/*--- Included file: packet-gsm_map-exp.h ---*/ /*--- Included file: packet-gsm_map-exp.h ---*/
#line 1 "./asn1/gsm_map/packet-gsm_map-exp.h" #line 1 "./asn1/gsm_map/packet-gsm_map-exp.h"
@ -298,7 +297,7 @@ int dissect_gsm_ss_LocationMethod(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
int dissect_NokiaMAP_Extensions_ServiceKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); int dissect_NokiaMAP_Extensions_ServiceKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
/*--- End of included file: packet-gsm_map-exp.h ---*/ /*--- End of included file: packet-gsm_map-exp.h ---*/
#line 80 "./asn1/gsm_map/packet-gsm_map-template.h" #line 79 "./asn1/gsm_map/packet-gsm_map-template.h"
#endif /* PACKET_GSM_MAP_H */ #endif /* PACKET_GSM_MAP_H */

View File

@ -47,7 +47,8 @@
#include "packet-gsm_map.h" #include "packet-gsm_map.h"
#include "packet-sip.h" #include "packet-sip.h"
static gint proto_sip = -1; static gint proto_gsm_map = -1;
static gint proto_sip = -1;
void proto_register_gsm_sms(void); void proto_register_gsm_sms(void);
@ -1980,13 +1981,13 @@ dis_field_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset
if (proto_is_frame_protocol(pinfo->layers, "gsm_map")) { if (proto_is_frame_protocol(pinfo->layers, "gsm_map")) {
gsm_map_packet_info_t *gsm_map_packet_info; gsm_map_packet_info_t *gsm_map_packet_info;
wmem_strbuf_append(addr_info_strbuf, "MAP"); wmem_strbuf_append(addr_info_strbuf, "MAP");
if ((gsm_map_packet_info = (gsm_map_packet_info_t*)p_get_proto_data(pinfo->pool, pinfo, proto_gsm_map, 0)) != NULL) { if ((gsm_map_packet_info = (gsm_map_packet_info_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_gsm_map, 0)) != NULL) {
if (gsm_map_packet_info->rp_oa_id == GSM_MAP_RP_OA_MSISDN) if (gsm_map_packet_info->sm_rp_oa_id == GSM_MAP_SM_RP_OA_MSISDN)
wmem_strbuf_append(addr_info_strbuf, gsm_map_packet_info->rp_oa_str); wmem_strbuf_append(addr_info_strbuf, gsm_map_packet_info->sm_rp_oa_str);
else if (gsm_map_packet_info->rp_da_id == GSM_MAP_RP_DA_IMSI) else if (gsm_map_packet_info->sm_rp_da_id == GSM_MAP_SM_RP_DA_IMSI)
wmem_strbuf_append(addr_info_strbuf, gsm_map_packet_info->rp_da_str); wmem_strbuf_append(addr_info_strbuf, gsm_map_packet_info->sm_rp_da_str);
else if (gsm_map_packet_info->rp_da_id == GSM_MAP_RP_DA_LMSI) else if (gsm_map_packet_info->sm_rp_da_id == GSM_MAP_SM_RP_DA_LMSI)
wmem_strbuf_append(addr_info_strbuf, gsm_map_packet_info->rp_da_str); wmem_strbuf_append(addr_info_strbuf, gsm_map_packet_info->sm_rp_da_str);
} }
} else if (proto_is_frame_protocol(pinfo->layers, "sip")) { } else if (proto_is_frame_protocol(pinfo->layers, "sip")) {
sip_info_value_t *sip_info; sip_info_value_t *sip_info;
@ -3569,7 +3570,8 @@ proto_register_gsm_sms(void)
void void
proto_reg_handoff_gsm_sms(void) proto_reg_handoff_gsm_sms(void)
{ {
proto_sip = proto_get_id_by_filter_name( "sip" ); proto_gsm_map = proto_get_id_by_filter_name("gsm_map");
proto_sip = proto_get_id_by_filter_name("sip");
} }
/* /*

View File

@ -205,7 +205,6 @@ static struct tcapsrt_info_t tcapsrt_global_info[MAX_TCAP_INSTANCE];
#define MAX_SSN 254 #define MAX_SSN 254
static range_t *global_ssn_range; static range_t *global_ssn_range;
static range_t *ssn_range; static range_t *ssn_range;
struct tcap_private_t tcap_private;
gboolean gtcap_HandleSRT=FALSE; gboolean gtcap_HandleSRT=FALSE;
/* These two timeout (in second) are used when some message are lost, /* These two timeout (in second) are used when some message are lost,
@ -235,7 +234,6 @@ static proto_tree * tcap_stat_tree=NULL;
static dissector_handle_t data_handle; static dissector_handle_t data_handle;
static dissector_handle_t ansi_tcap_handle; static dissector_handle_t ansi_tcap_handle;
static void raz_tcap_private(struct tcap_private_t * p_tcap_private);
static int dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset); static int dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset);
static int dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_); static int dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_);
@ -757,11 +755,12 @@ dissect_tcap_OCTET_STRING_SIZE_1_4(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
static int static int
dissect_tcap_OrigTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_OrigTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 131 "./asn1/tcap/tcap.cnf" #line 134 "./asn1/tcap/tcap.cnf"
tvbuff_t *parameter_tvb; tvbuff_t *parameter_tvb;
guint8 len, i; guint8 len, i;
proto_tree *subtree; proto_tree *subtree;
int saved_offset; int saved_offset;
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
hf_index = hf_tcap_tid; hf_index = hf_tcap_tid;
saved_offset = offset; saved_offset = offset;
@ -791,6 +790,7 @@ dissect_tcap_OrigTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
gp_tcapsrt_info->src_tid=0; gp_tcapsrt_info->src_tid=0;
break; break;
} }
p_tcap_private->src_tid = gp_tcapsrt_info->src_tid;
if (len) { if (len) {
col_append_str(actx->pinfo->cinfo, COL_INFO, "otid("); col_append_str(actx->pinfo->cinfo, COL_INFO, "otid(");
@ -816,7 +816,7 @@ static const ber_sequence_t Begin_sequence[] = {
static int static int
dissect_tcap_Begin(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_Begin(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 215 "./asn1/tcap/tcap.cnf" #line 222 "./asn1/tcap/tcap.cnf"
gp_tcapsrt_info->ope=TC_BEGIN; gp_tcapsrt_info->ope=TC_BEGIN;
/* Do not change col_add_str() to col_append_str() here: we _want_ this call /* Do not change col_add_str() to col_append_str() here: we _want_ this call
@ -838,11 +838,12 @@ gp_tcapsrt_info->ope=TC_BEGIN;
static int static int
dissect_tcap_DestTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_DestTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 174 "./asn1/tcap/tcap.cnf" #line 179 "./asn1/tcap/tcap.cnf"
tvbuff_t *parameter_tvb; tvbuff_t *parameter_tvb;
guint8 len , i; guint8 len , i;
proto_tree *subtree; proto_tree *subtree;
int saved_offset; int saved_offset;
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
hf_index = hf_tcap_tid; hf_index = hf_tcap_tid;
saved_offset = offset; saved_offset = offset;
@ -872,6 +873,7 @@ dissect_tcap_DestTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
gp_tcapsrt_info->dst_tid=0; gp_tcapsrt_info->dst_tid=0;
break; break;
} }
p_tcap_private->dst_tid = gp_tcapsrt_info->dst_tid;
if (len) { if (len) {
col_append_str(actx->pinfo->cinfo, COL_INFO, "dtid("); col_append_str(actx->pinfo->cinfo, COL_INFO, "dtid(");
@ -896,7 +898,7 @@ static const ber_sequence_t End_sequence[] = {
static int static int
dissect_tcap_End(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_End(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 229 "./asn1/tcap/tcap.cnf" #line 236 "./asn1/tcap/tcap.cnf"
gp_tcapsrt_info->ope=TC_END; gp_tcapsrt_info->ope=TC_END;
col_set_str(actx->pinfo->cinfo, COL_INFO, "End "); col_set_str(actx->pinfo->cinfo, COL_INFO, "End ");
@ -918,7 +920,7 @@ static const ber_sequence_t Continue_sequence[] = {
static int static int
dissect_tcap_Continue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_Continue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 236 "./asn1/tcap/tcap.cnf" #line 243 "./asn1/tcap/tcap.cnf"
gp_tcapsrt_info->ope=TC_CONT; gp_tcapsrt_info->ope=TC_CONT;
col_set_str(actx->pinfo->cinfo, COL_INFO, "Continue "); col_set_str(actx->pinfo->cinfo, COL_INFO, "Continue ");
@ -989,7 +991,7 @@ static const ber_sequence_t Abort_sequence[] = {
static int static int
dissect_tcap_Abort(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_Abort(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 243 "./asn1/tcap/tcap.cnf" #line 250 "./asn1/tcap/tcap.cnf"
gp_tcapsrt_info->ope=TC_ABORT; gp_tcapsrt_info->ope=TC_ABORT;
col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort "); col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
@ -1039,10 +1041,11 @@ dissect_tcap_AUDT_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
static int static int
dissect_tcap_AUDT_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_AUDT_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 116 "./asn1/tcap/tcap.cnf" #line 116 "./asn1/tcap/tcap.cnf"
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid); offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
tcap_private.oid= (const void*) cur_oid; p_tcap_private->oid= (const void*) cur_oid;
tcap_private.acv=TRUE; p_tcap_private->acv=TRUE;
return offset; return offset;
@ -1135,11 +1138,12 @@ dissect_tcap_AARQ_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
static int static int
dissect_tcap_AARQ_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_AARQ_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 121 "./asn1/tcap/tcap.cnf" #line 122 "./asn1/tcap/tcap.cnf"
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid); offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
tcap_private.oid= (const void*) cur_oid; p_tcap_private->oid= (const void*) cur_oid;
tcap_private.acv=TRUE; p_tcap_private->acv=TRUE;
return offset; return offset;
@ -1203,11 +1207,12 @@ dissect_tcap_AARE_protocol_version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
static int static int
dissect_tcap_AARE_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { dissect_tcap_AARE_application_context_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 126 "./asn1/tcap/tcap.cnf" #line 128 "./asn1/tcap/tcap.cnf"
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid); offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cur_oid);
tcap_private.oid= (const void*) cur_oid; p_tcap_private->oid= (const void*) cur_oid;
tcap_private.acv=TRUE; p_tcap_private->acv=TRUE;
return offset; return offset;
@ -1423,7 +1428,7 @@ static int dissect_DialoguePDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr
/*--- End of included file: packet-tcap-fn.c ---*/ /*--- End of included file: packet-tcap-fn.c ---*/
#line 157 "./asn1/tcap/packet-tcap-template.c" #line 155 "./asn1/tcap/packet-tcap-template.c"
/* /*
* DEBUG functions * DEBUG functions
@ -3096,6 +3101,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
gint8 ber_class; gint8 ber_class;
gboolean pc; gboolean pc;
gint tag; gint tag;
struct tcap_private_t *p_tcap_private;
/* Check if ANSI TCAP and call the ANSI TCAP dissector if that's the case /* Check if ANSI TCAP and call the ANSI TCAP dissector if that's the case
* PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU, * PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU,
@ -3144,9 +3150,9 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
} }
cur_oid = NULL; cur_oid = NULL;
tcapext_oid = NULL; tcapext_oid = NULL;
raz_tcap_private(&tcap_private);
asn1_ctx.value_ptr = &tcap_private; p_tcap_private = wmem_new0(wmem_packet_scope(), struct tcap_private_t);
asn1_ctx.value_ptr = p_tcap_private;
gp_tcapsrt_info=tcapsrt_razinfo(); gp_tcapsrt_info=tcapsrt_razinfo();
tcap_subdissector_used=FALSE; tcap_subdissector_used=FALSE;
gp_tcap_context=NULL; gp_tcap_context=NULL;
@ -3154,7 +3160,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
if (gtcap_HandleSRT && !tcap_subdissector_used ) { if (gtcap_HandleSRT && !tcap_subdissector_used ) {
p_tcap_context=tcapsrt_call_matching(tvb, pinfo, tcap_stat_tree, gp_tcapsrt_info); p_tcap_context=tcapsrt_call_matching(tvb, pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_private.context=p_tcap_context; p_tcap_private->context=p_tcap_context;
/* If the current message is TCAP only, /* If the current message is TCAP only,
* save the Application Context Name for the next messages * save the Application Context Name for the next messages
@ -3194,7 +3200,7 @@ proto_reg_handoff_tcap(void)
/*--- End of included file: packet-tcap-dis-tab.c ---*/ /*--- End of included file: packet-tcap-dis-tab.c ---*/
#line 1920 "./asn1/tcap/packet-tcap-template.c" #line 1919 "./asn1/tcap/packet-tcap-template.c"
} }
static void init_tcap(void); static void init_tcap(void);
@ -3536,7 +3542,7 @@ proto_register_tcap(void)
NULL, HFILL }}, NULL, HFILL }},
/*--- End of included file: packet-tcap-hfarr.c ---*/ /*--- End of included file: packet-tcap-hfarr.c ---*/
#line 1993 "./asn1/tcap/packet-tcap-template.c" #line 1992 "./asn1/tcap/packet-tcap-template.c"
}; };
/* Setup protocol subtree array */ /* Setup protocol subtree array */
@ -3584,7 +3590,7 @@ proto_register_tcap(void)
&ett_tcap_Associate_source_diagnostic, &ett_tcap_Associate_source_diagnostic,
/*--- End of included file: packet-tcap-ettarr.c ---*/ /*--- End of included file: packet-tcap-ettarr.c ---*/
#line 2003 "./asn1/tcap/packet-tcap-template.c" #line 2002 "./asn1/tcap/packet-tcap-template.c"
}; };
/*static enum_val_t tcap_options[] = { /*static enum_val_t tcap_options[] = {
@ -3776,20 +3782,16 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset
return offset; return offset;
} }
static void raz_tcap_private(struct tcap_private_t * p_tcap_private)
{
memset(p_tcap_private,0,sizeof(struct tcap_private_t) );
}
/* /*
* Call ITU Subdissector to decode the Tcap Component * Call ITU Subdissector to decode the Tcap Component
*/ */
static int static int
dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_)
{ {
dissector_handle_t subdissector_handle=NULL; dissector_handle_t subdissector_handle=NULL;
gboolean is_subdissector=FALSE; gboolean is_subdissector=FALSE;
struct tcaphash_context_t * p_tcap_context=NULL; struct tcaphash_context_t * p_tcap_context=NULL;
struct tcap_private_t *p_tcap_private = (struct tcap_private_t*)actx->value_ptr;
/* /*
* ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it. * ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it.
@ -3803,11 +3805,11 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info); p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_subdissector_used=TRUE; tcap_subdissector_used=TRUE;
gp_tcap_context=p_tcap_context; gp_tcap_context=p_tcap_context;
tcap_private.context=p_tcap_context; p_tcap_private->context=p_tcap_context;
} else { } else {
/* Take the last TCAP context */ /* Take the last TCAP context */
p_tcap_context = gp_tcap_context; p_tcap_context = gp_tcap_context;
tcap_private.context=p_tcap_context; p_tcap_private->context=p_tcap_context;
} }
} }
if (p_tcap_context) { if (p_tcap_context) {
@ -3846,8 +3848,8 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
} else { } else {
/* Copy the OID from the TCAP context to the current oid */ /* Copy the OID from the TCAP context to the current oid */
if (p_tcap_context->oid_present) { if (p_tcap_context->oid_present) {
tcap_private.oid= (void*) p_tcap_context->oid; p_tcap_private->oid= (void*) p_tcap_context->oid;
tcap_private.acv=TRUE; p_tcap_private->acv=TRUE;
} }
} /* no OID */ } /* no OID */
} /* no TCAP context */ } /* no TCAP context */

View File

@ -74,6 +74,8 @@ struct tcap_private_t {
guint32 session_id; guint32 session_id;
void * context; void * context;
gchar *TransactionID_str; gchar *TransactionID_str;
guint32 src_tid;
guint32 dst_tid;
}; };
/** @file /** @file
@ -241,6 +243,6 @@ int dissect_tcap_UniDialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
int dissect_tcap_DialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); int dissect_tcap_DialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
/*--- End of included file: packet-tcap-exp.h ---*/ /*--- End of included file: packet-tcap-exp.h ---*/
#line 228 "./asn1/tcap/packet-tcap-template.h" #line 230 "./asn1/tcap/packet-tcap-template.h"
#endif /* PACKET_tcap_H */ #endif /* PACKET_tcap_H */