From ea0f0939bb7c4a0b12864f36a6525fa930cc11b8 Mon Sep 17 00:00:00 2001 From: "S. Shapira" Date: Sun, 26 Mar 2017 00:37:41 +0300 Subject: [PATCH] [UMTS RRC] Added dissection of "Cell Identity" According to TS 25.401 / 6.1.5 Cell Identifier Change-Id: I74996e76328f536dec0d34aa8229a1074ed47187 Reviewed-on: https://code.wireshark.org/review/20709 Reviewed-by: Pascal Quantin Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- .../dissectors/asn1/rrc/packet-rrc-template.c | 12 +++ epan/dissectors/asn1/rrc/rrc.cnf | 27 +++++-- epan/dissectors/packet-rrc.c | 80 ++++++++++++------- 3 files changed, 85 insertions(+), 34 deletions(-) diff --git a/epan/dissectors/asn1/rrc/packet-rrc-template.c b/epan/dissectors/asn1/rrc/packet-rrc-template.c index 72306c0ee6..57b88e799a 100644 --- a/epan/dissectors/asn1/rrc/packet-rrc-template.c +++ b/epan/dissectors/asn1/rrc/packet-rrc-template.c @@ -108,6 +108,7 @@ static int ett_rrc = -1; static gint ett_rrc_eutraFeatureGroupIndicators = -1; static gint ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo = -1; static gint ett_rrc_ims_info = -1; +static gint ett_rrc_cellIdentity = -1; static expert_field ei_rrc_no_hrnti = EI_INIT; @@ -122,6 +123,8 @@ static int hf_rrc_ims_info_atgw_trans_det_cont_type = -1; static int hf_rrc_ims_info_atgw_udp_port = -1; static int hf_rrc_ims_info_atgw_ipv4 = -1; static int hf_rrc_ims_info_atgw_ipv6 = -1; +static int hf_rrc_cellIdentity_rnc_id = -1; +static int hf_rrc_cellIdentity_c_id = -1; static const true_false_string rrc_eutra_feat_group_ind_1_val = { "UTRA CELL_PCH to EUTRA RRC_IDLE cell reselection - Supported", @@ -310,6 +313,14 @@ void proto_register_rrc(void) { {"ATGW IPv6", "rrc.rsrvcc_info.ims_info_atgw_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "rSR-VCC IMS information ATGW IPv6", HFILL}}, + { &hf_rrc_cellIdentity_rnc_id, + {"RNC Identifier", "rrc.cellIdentity.rnc_id", + FT_UINT32, BASE_DEC, NULL, 0, + "The RNC Identifier (RNC-Id) part of the Cell Identity", HFILL }}, + { &hf_rrc_cellIdentity_c_id, + {"Cell Identifier", "rrc.cellIdentity.c_id", + FT_UINT32, BASE_DEC, NULL, 0, + "The Cell Identifier (C-Id) part of the Cell Identity", HFILL }} }; /* List of subtrees */ @@ -319,6 +330,7 @@ void proto_register_rrc(void) { &ett_rrc_eutraFeatureGroupIndicators, &ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, &ett_rrc_ims_info, + &ett_rrc_cellIdentity, }; static ei_register_info ei[] = { diff --git a/epan/dissectors/asn1/rrc/rrc.cnf b/epan/dissectors/asn1/rrc/rrc.cnf index 444db4e0d5..f85c7a69cf 100644 --- a/epan/dissectors/asn1/rrc/rrc.cnf +++ b/epan/dissectors/asn1/rrc/rrc.cnf @@ -728,17 +728,17 @@ HNBName TYPE=FT_STRING DISPLAY=STR_UNICODE switch (GPOINTER_TO_UINT(actx->private_data)-1) { case RRC_NAS_SYS_INFO_CN_COMMON: subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, - ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CN Common GSM-MAP NAS system information"); + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CN Common GSM-MAP NAS system information"); de_cn_common_gsm_map_nas_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; case RRC_NAS_SYS_INFO_CS: subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, - ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CS domain specific system information"); + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CS domain specific system information"); de_cs_domain_spec_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; case RRC_NAS_SYS_INFO_PS: subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, - ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "PS domain specific system information"); + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "PS domain specific system information"); de_ps_domain_spec_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; default: @@ -748,9 +748,22 @@ HNBName TYPE=FT_STRING DISPLAY=STR_UNICODE } } -/*Here we try to figure out which HS-DSCH channels are multiplexed*/ -#.FN_BODY DL-TransportChannelType-r5 VAL_PTR = &type +#.FN_BODY CellIdentity VAL_PTR = &cell_id_tvb + tvbuff_t * cell_id_tvb = NULL; + proto_item *temp_ti; + proto_tree *cell_identity_tree; +%(DEFAULT_BODY)s + if(cell_id_tvb != NULL) { + cell_identity_tree = proto_item_add_subtree(actx->created_item, ett_rrc_cellIdentity); + temp_ti = proto_tree_add_bits_item(cell_identity_tree, hf_rrc_cellIdentity_rnc_id,cell_id_tvb, 0, 12, ENC_BIG_ENDIAN); + PROTO_ITEM_SET_GENERATED(temp_ti); + temp_ti = proto_tree_add_bits_item(cell_identity_tree, hf_rrc_cellIdentity_c_id, cell_id_tvb, 12, 16, ENC_BIG_ENDIAN); + PROTO_ITEM_SET_GENERATED(temp_ti); + } + +#.FN_BODY DL-TransportChannelType-r5 VAL_PTR = &type +/*Here we try to figure out which HS-DSCH channels are multiplexed*/ guint *flowd_p; guint *cur_val=NULL; struct rrc_info *rrcinf; @@ -783,9 +796,9 @@ HNBName TYPE=FT_STRING DISPLAY=STR_UNICODE } } -/*Here we try to figure out which HS-DSCH channels are multiplexed*/ -#.FN_BODY DL-TransportChannelType-r7 VAL_PTR = &type +#.FN_BODY DL-TransportChannelType-r7 VAL_PTR = &type +/*Here we try to figure out which HS-DSCH channels are multiplexed*/ guint *flowd_p; guint *cur_val=NULL; struct rrc_info *rrcinf; diff --git a/epan/dissectors/packet-rrc.c b/epan/dissectors/packet-rrc.c index 7f11caf1cc..d9470ed003 100644 --- a/epan/dissectors/packet-rrc.c +++ b/epan/dissectors/packet-rrc.c @@ -17841,6 +17841,7 @@ static gint ett_rrc_UL_RFC3095_Context = -1; static gint ett_rrc_eutraFeatureGroupIndicators = -1; static gint ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo = -1; static gint ett_rrc_ims_info = -1; +static gint ett_rrc_cellIdentity = -1; static expert_field ei_rrc_no_hrnti = EI_INIT; @@ -17855,6 +17856,8 @@ static int hf_rrc_ims_info_atgw_trans_det_cont_type = -1; static int hf_rrc_ims_info_atgw_udp_port = -1; static int hf_rrc_ims_info_atgw_ipv4 = -1; static int hf_rrc_ims_info_atgw_ipv6 = -1; +static int hf_rrc_cellIdentity_rnc_id = -1; +static int hf_rrc_cellIdentity_c_id = -1; static const true_false_string rrc_eutra_feat_group_ind_1_val = { "UTRA CELL_PCH to EUTRA RRC_IDLE cell reselection - Supported", @@ -18166,7 +18169,7 @@ dissect_rrc_ActivationTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ static int dissect_rrc_RB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 919 "./asn1/rrc/rrc.cnf" +#line 932 "./asn1/rrc/rrc.cnf" offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 32U, &rbid, FALSE); @@ -18183,7 +18186,7 @@ dissect_rrc_RB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, static int dissect_rrc_RLC_SequenceNumber(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 925 "./asn1/rrc/rrc.cnf" +#line 938 "./asn1/rrc/rrc.cnf" offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, &activation_frame, FALSE); @@ -18203,7 +18206,7 @@ static const per_sequence_t RB_ActivationTimeInfo_sequence[] = { static int dissect_rrc_RB_ActivationTimeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 897 "./asn1/rrc/rrc.cnf" +#line 910 "./asn1/rrc/rrc.cnf" fp_info *fpinf; rrc_ciphering_info * c_inf; @@ -18368,17 +18371,17 @@ dissect_rrc_NAS_SystemInformationGSM_MAP(tvbuff_t *tvb _U_, int offset _U_, asn1 switch (GPOINTER_TO_UINT(actx->private_data)-1) { case RRC_NAS_SYS_INFO_CN_COMMON: subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, - ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CN Common GSM-MAP NAS system information"); + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CN Common GSM-MAP NAS system information"); de_cn_common_gsm_map_nas_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; case RRC_NAS_SYS_INFO_CS: subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, - ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CS domain specific system information"); + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CS domain specific system information"); de_cs_domain_spec_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; case RRC_NAS_SYS_INFO_PS: subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, - ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "PS domain specific system information"); + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "PS domain specific system information"); de_ps_domain_spec_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; default: @@ -18388,7 +18391,6 @@ dissect_rrc_NAS_SystemInformationGSM_MAP(tvbuff_t *tvb _U_, int offset _U_, asn1 } } -/*Here we try to figure out which HS-DSCH channels are multiplexed*/ return offset; @@ -22076,8 +22078,23 @@ dissect_rrc_SSDT_UL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pro static int dissect_rrc_CellIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { +#line 752 "./asn1/rrc/rrc.cnf" + tvbuff_t * cell_id_tvb = NULL; + proto_item *temp_ti; + proto_tree *cell_identity_tree; + offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, - 28, 28, FALSE, NULL, NULL); + 28, 28, FALSE, &cell_id_tvb, NULL); + + if(cell_id_tvb != NULL) { + cell_identity_tree = proto_item_add_subtree(actx->created_item, ett_rrc_cellIdentity); + temp_ti = proto_tree_add_bits_item(cell_identity_tree, hf_rrc_cellIdentity_rnc_id,cell_id_tvb, 0, 12, ENC_BIG_ENDIAN); + PROTO_ITEM_SET_GENERATED(temp_ti); + temp_ti = proto_tree_add_bits_item(cell_identity_tree, hf_rrc_cellIdentity_c_id, cell_id_tvb, 12, 16, ENC_BIG_ENDIAN); + PROTO_ITEM_SET_GENERATED(temp_ti); + } + + return offset; } @@ -22286,7 +22303,7 @@ dissect_rrc_T_r3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_ static int dissect_rrc_H_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 827 "./asn1/rrc/rrc.cnf" +#line 840 "./asn1/rrc/rrc.cnf" tvbuff_t *hrnti_tvb; struct rrc_info *rrcinf; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, @@ -22295,7 +22312,7 @@ dissect_rrc_H_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot -#line 832 "./asn1/rrc/rrc.cnf" +#line 845 "./asn1/rrc/rrc.cnf" rrcinf = (struct rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0); if (!rrcinf) { rrcinf = wmem_new0(wmem_file_scope(), struct rrc_info); @@ -45572,7 +45589,7 @@ dissect_rrc_RLC_Info_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, static int dissect_rrc_MAC_d_FlowIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 824 "./asn1/rrc/rrc.cnf" +#line 837 "./asn1/rrc/rrc.cnf" offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 7U, &flowd, FALSE); @@ -45620,8 +45637,8 @@ static const per_choice_t DL_TransportChannelType_r5_choice[] = { static int dissect_rrc_DL_TransportChannelType_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 753 "./asn1/rrc/rrc.cnf" - +#line 766 "./asn1/rrc/rrc.cnf" +/*Here we try to figure out which HS-DSCH channels are multiplexed*/ guint *flowd_p; guint *cur_val=NULL; struct rrc_info *rrcinf; @@ -45657,7 +45674,7 @@ dissect_rrc_DL_TransportChannelType_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_c } } -/*Here we try to figure out which HS-DSCH channels are multiplexed*/ + return offset; @@ -49094,8 +49111,8 @@ static const per_choice_t DL_TransportChannelType_r7_choice[] = { static int dissect_rrc_DL_TransportChannelType_r7(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 788 "./asn1/rrc/rrc.cnf" - +#line 801 "./asn1/rrc/rrc.cnf" +/*Here we try to figure out which HS-DSCH channels are multiplexed*/ guint *flowd_p; guint *cur_val=NULL; struct rrc_info *rrcinf; @@ -88358,7 +88375,7 @@ static const value_string rrc_ReleaseCause_vals[] = { static int dissect_rrc_ReleaseCause(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 946 "./asn1/rrc/rrc.cnf" +#line 959 "./asn1/rrc/rrc.cnf" guint32 value; offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index, 8, &value, FALSE, 0, NULL); @@ -97779,7 +97796,7 @@ static const per_choice_t DL_DCCH_MessageType_choice[] = { static int dissect_rrc_DL_DCCH_MessageType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 929 "./asn1/rrc/rrc.cnf" +#line 942 "./asn1/rrc/rrc.cnf" offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rrc_DL_DCCH_MessageType, DL_DCCH_MessageType_choice, &msg_type); @@ -97799,7 +97816,7 @@ static const per_sequence_t DL_DCCH_Message_sequence[] = { static int dissect_rrc_DL_DCCH_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 932 "./asn1/rrc/rrc.cnf" +#line 945 "./asn1/rrc/rrc.cnf" offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rrc_DL_DCCH_Message, DL_DCCH_Message_sequence); @@ -97813,7 +97830,7 @@ dissect_rrc_DL_DCCH_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx static int dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 840 "./asn1/rrc/rrc.cnf" +#line 853 "./asn1/rrc/rrc.cnf" tvbuff_t * start_val; fp_info *fpinf; rrc_ciphering_info * c_inf; @@ -127357,7 +127374,7 @@ static const per_choice_t HandoverToUTRANCommand_choice[] = { static int dissect_rrc_HandoverToUTRANCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 935 "./asn1/rrc/rrc.cnf" +#line 948 "./asn1/rrc/rrc.cnf" offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rrc_HandoverToUTRANCommand, HandoverToUTRANCommand_choice, NULL); @@ -127498,7 +127515,7 @@ static const per_sequence_t UE_SecurityInformation_sequence[] = { static int dissect_rrc_UE_SecurityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 938 "./asn1/rrc/rrc.cnf" +#line 951 "./asn1/rrc/rrc.cnf" actx->private_data = GUINT_TO_POINTER(RRC_NAS_SYS_INFO_CS+1); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rrc_UE_SecurityInformation, UE_SecurityInformation_sequence); @@ -127901,7 +127918,7 @@ static const per_sequence_t UE_SecurityInformation2_sequence[] = { static int dissect_rrc_UE_SecurityInformation2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 942 "./asn1/rrc/rrc.cnf" +#line 955 "./asn1/rrc/rrc.cnf" actx->private_data = GUINT_TO_POINTER(RRC_NAS_SYS_INFO_PS+1); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rrc_UE_SecurityInformation2, UE_SecurityInformation2_sequence); @@ -160384,7 +160401,7 @@ static int dissect_MeasurementReport_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _ /*--- End of included file: packet-rrc-fn.c ---*/ -#line 195 "./asn1/rrc/packet-rrc-template.c" +#line 198 "./asn1/rrc/packet-rrc-template.c" @@ -203283,7 +203300,7 @@ void proto_register_rrc(void) { NULL, HFILL }}, /*--- End of included file: packet-rrc-hfarr.c ---*/ -#line 277 "./asn1/rrc/packet-rrc-template.c" +#line 280 "./asn1/rrc/packet-rrc-template.c" { &hf_test, { "RAB Test", "rrc.RAB.test", FT_UINT8, BASE_DEC, NULL, 0, @@ -203320,6 +203337,14 @@ void proto_register_rrc(void) { {"ATGW IPv6", "rrc.rsrvcc_info.ims_info_atgw_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "rSR-VCC IMS information ATGW IPv6", HFILL}}, + { &hf_rrc_cellIdentity_rnc_id, + {"RNC Identifier", "rrc.cellIdentity.rnc_id", + FT_UINT32, BASE_DEC, NULL, 0, + "The RNC Identifier (RNC-Id) part of the Cell Identity", HFILL }}, + { &hf_rrc_cellIdentity_c_id, + {"Cell Identifier", "rrc.cellIdentity.c_id", + FT_UINT32, BASE_DEC, NULL, 0, + "The Cell Identifier (C-Id) part of the Cell Identity", HFILL }} }; /* List of subtrees */ @@ -210142,10 +210167,11 @@ void proto_register_rrc(void) { &ett_rrc_UL_RFC3095_Context, /*--- End of included file: packet-rrc-ettarr.c ---*/ -#line 319 "./asn1/rrc/packet-rrc-template.c" +#line 330 "./asn1/rrc/packet-rrc-template.c" &ett_rrc_eutraFeatureGroupIndicators, &ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, &ett_rrc_ims_info, + &ett_rrc_cellIdentity, }; static ei_register_info ei[] = { @@ -210240,7 +210266,7 @@ void proto_register_rrc(void) { /*--- End of included file: packet-rrc-dis-reg.c ---*/ -#line 341 "./asn1/rrc/packet-rrc-template.c" +#line 353 "./asn1/rrc/packet-rrc-template.c"