Diameter-3gpp: Dissect the SMS inside AVP 3301 SM-RP-UI.

Change-Id: I0f293ea529dce5147eef5bfb9d8d4b39640fd0aa
Reviewed-on: https://code.wireshark.org/review/30554
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Anders Broman 2018-11-09 14:02:24 +01:00 committed by Anders Broman
parent 34d3afa3e4
commit ab68b2c9ce
3 changed files with 51 additions and 0 deletions

View File

@ -1239,6 +1239,8 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
}
cmd_item = proto_tree_add_item_ret_uint(diam_tree, hf_diameter_code, tvb, 5, 3, ENC_BIG_ENDIAN, &cmd);
diam_sub_dis_inf->cmd_code = cmd;
switch (version) {
case DIAMETER_V16: {

View File

@ -27,6 +27,7 @@ typedef struct _diameter_req_ans_pair_t
/* Info needed by AVP sub dissectors */
typedef struct _diam_sub_dis_t {
guint32 application_id;
guint32 cmd_code;
guint32 feature_list_id;
gboolean dis_gouped; /**< Set during dissection of grouped AVP */
guint32 vendor_id;

View File

@ -494,6 +494,7 @@ static int hf_diameter_3gpp_ikev2_cause = -1;
/* Dissector handles */
static dissector_handle_t xml_handle;
static dissector_handle_t gsm_sms_handle;
/* Forward declarations */
static int dissect_diameter_3gpp_ipv6addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_);
@ -2336,6 +2337,49 @@ dissect_diameter_3gpp_ran_nas_release_cause(tvbuff_t *tvb, packet_info *pinfo _U
return offset;
}
/* AVP Code: 3301 SM-RP-UI */
static int
dissect_diameter_3gpp_sm_rp_ui(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
int length = tvb_reported_length(tvb);
diam_sub_dis_t *diam_sub_dis_inf = (diam_sub_dis_t*)data;
guint32 cmd = 0;
if (diam_sub_dis_inf) {
cmd = diam_sub_dis_inf->cmd_code;
}
if ((length > 0) && (cmd != 0)) {
switch (cmd){
case 8388645:
/* Command Code: 8388645 MO-Forward-Short-Message
* serving MME or SGSN or IP-SM-GW and the SMS-IWMSC to forward
* mobile originated short messages from a mobile user to a Service Centre
*
*/
/*pinfo->link_dir = P2P_DIR_UL;*/
pinfo->p2p_dir = P2P_DIR_RECV;
call_dissector(gsm_sms_handle, tvb, pinfo, tree);
break;
case 8388646:
/* code="8388646 MT Forward Short Message
* SMS-GMSC and the serving MME or SGSN(transiting an SMS Router, if present)
* or IP-SM-GW to forward mobile terminated short messages.
*/
pinfo->p2p_dir = P2P_DIR_SENT;
call_dissector(gsm_sms_handle, tvb, pinfo, tree);
break;
default:
break;
}
}
return length;
}
/* AVP Code: 3502 MBMS-Bearer-Event */
static int
dissect_diameter_3gpp_mbms_bearer_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
@ -2628,6 +2672,9 @@ proto_reg_handoff_diameter_3gpp(void)
/* AVP Code: 2819 RAN-NAS-Release-Cause */
dissector_add_uint("diameter.3gpp", 2819, create_dissector_handle(dissect_diameter_3gpp_ran_nas_release_cause, proto_diameter_3gpp));
/* AVP Code: 3301 SM-RP-UI */
dissector_add_uint("diameter.3gpp", 3301, create_dissector_handle(dissect_diameter_3gpp_sm_rp_ui, proto_diameter_3gpp));
/* AVP Code: 3502 MBMS-Bearer-Event */
dissector_add_uint("diameter.3gpp", 3502, create_dissector_handle(dissect_diameter_3gpp_mbms_bearer_event, proto_diameter_3gpp));
@ -2641,6 +2688,7 @@ proto_reg_handoff_diameter_3gpp(void)
dissector_add_uint("diameter.3gpp", 3514, create_dissector_handle(dissect_diameter_3gpp_tmgi_deallocation_result, proto_diameter_3gpp));
xml_handle = find_dissector_add_dependency("xml", proto_diameter_3gpp);
gsm_sms_handle = find_dissector_add_dependency("gsm_sms", proto_diameter_3gpp);
}
/*