LTE RRC: only display band mapping for the initial supportedBandListEUTRA IE
authorPascal Quantin <pascal.quantin@gmail.com>
Mon, 2 Feb 2015 15:02:59 +0000 (16:02 +0100)
committerPascal Quantin <pascal.quantin@gmail.com>
Mon, 2 Feb 2015 16:32:41 +0000 (16:32 +0000)
Handling bands > 64 would require to store the mapping in file scope and current code is broken for the Carrier Aggregation band combination list

Change-Id: I9f10022a50520ca9bc16a33f2c16361729f1b01b
Reviewed-on: https://code.wireshark.org/review/6917
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
asn1/lte-rrc/lte-rrc.cnf
asn1/lte-rrc/packet-lte-rrc-template.c
epan/dissectors/packet-lte-rrc.c

index 97ec1bcc067ff0fa65db01d0e3219e9f7ca46ecb..86a52f9f9207863c7e2f58384b41f5dd828bcc2e 100644 (file)
@@ -1815,23 +1815,15 @@ SoundingRS-UL-ConfigDedicated/setup/duration STRINGS=TFS(&lte_rrc_duration_val)
 %(DEFAULT_BODY)s
   set_freq_band_indicator(value, actx);
 
-#.FN_BODY FreqBandIndicator-v9e0 VAL_PTR=&value
-  guint32 value;
-%(DEFAULT_BODY)s
-  set_freq_band_indicator(value, actx);
-
-#.FN_BODY FreqBandIndicator-r11 VAL_PTR=&value
-  guint32 value;
-%(DEFAULT_BODY)s
-  set_freq_band_indicator(value, actx);
-
+#.FN_FTR BandParameters-r10/bandEUTRA-r10
+  remove_last_freq_band_indicator(actx);
 
 #.FN_BODY InterFreqBandInfo
   meas_capabilities_item_band_mappings_t *mappings;
   proto_item *it;
 %(DEFAULT_BODY)s
   mappings = private_data_meas_capabilities_item_band_mappings(actx);
-  if (mappings->number_of_interfreq_serving_read <= mappings->number_of_bands_set) {
+  if (mappings->number_of_interfreq_serving_read < mappings->number_of_bands_set) {
     guint16 serving_band = mappings->band_by_item[mappings->number_of_interfreq_serving_read];
     guint16 target_band = mappings->band_by_item[mappings->number_of_interfreq_target_read++];
     if (mappings->number_of_interfreq_target_read == mappings->number_of_bands_set) {
@@ -1845,6 +1837,13 @@ SoundingRS-UL-ConfigDedicated/setup/duration STRINGS=TFS(&lte_rrc_duration_val)
     PROTO_ITEM_SET_GENERATED(it);
   }
 
+#.FN_BODY UE-EUTRA-Capability/measParameters
+  meas_capabilities_item_band_mappings_t *mappings;
+%(DEFAULT_BODY)s
+  /* Clear band mapping once measParameters IE has been decoded */
+  mappings = private_data_meas_capabilities_item_band_mappings(actx);
+  mappings->number_of_bands_set = 0;
+
 #.FN_BODY ReleaseCause VAL_PTR=&value
   guint32 value;
 %(DEFAULT_BODY)s
index 150b03be38ba71ca6c64a5bf2d79244510a7e501..1751200c6e5dcdcb293df12a5b246b5cbdaec23c 100644 (file)
@@ -2159,6 +2159,13 @@ static void set_freq_band_indicator(guint32 value, asn1_ctx_t *actx)
   }
 }
 
+static void remove_last_freq_band_indicator(asn1_ctx_t *actx)
+{
+  meas_capabilities_item_band_mappings_t *mappings = private_data_meas_capabilities_item_band_mappings(actx);
+  if ((mappings->number_of_bands_set > 0) && (mappings->number_of_bands_set < 256)) {
+    mappings->number_of_bands_set--;
+  }
+}
 
 /* Cell type for simultaneousPUCCH-PUSCH-r10 */
 static simult_pucch_pusch_cell_type private_data_get_simult_pucch_pusch_cell_type(asn1_ctx_t *actx)
index a77e9b98f00c0fb90125fab3a7d419465447749a..c2bb57cc2ee3fe7d378872de96616a16a52354f4 100644 (file)
@@ -2414,7 +2414,7 @@ static int hf_lte_rrc_ue_Category = -1;           /* INTEGER_1_5 */
 static int hf_lte_rrc_pdcp_Parameters = -1;       /* PDCP_Parameters */
 static int hf_lte_rrc_phyLayerParameters = -1;    /* PhyLayerParameters */
 static int hf_lte_rrc_rf_Parameters = -1;         /* RF_Parameters */
-static int hf_lte_rrc_measParameters = -1;        /* MeasParameters */
+static int hf_lte_rrc_measParameters = -1;        /* T_measParameters */
 static int hf_lte_rrc_featureGroupIndicators = -1;  /* T_featureGroupIndicators */
 static int hf_lte_rrc_interRAT_Parameters = -1;   /* T_interRAT_Parameters */
 static int hf_lte_rrc_utraFDD = -1;               /* IRAT_ParametersUTRA_FDD */
@@ -2593,7 +2593,7 @@ static int hf_lte_rrc_supported_r12 = -1;         /* T_supported_r12 */
 static int hf_lte_rrc_asynchronous_r12 = -1;      /* T_asynchronous_r12 */
 static int hf_lte_rrc_supportedCellGrouping_r12 = -1;  /* BIT_STRING_SIZE_1_15 */
 static int hf_lte_rrc_supportedNAICS_2CRS_AP_r12 = -1;  /* BIT_STRING_SIZE_1_maxNAICS_Entries_r12 */
-static int hf_lte_rrc_bandEUTRA_r10 = -1;         /* FreqBandIndicator */
+static int hf_lte_rrc_bandEUTRA_r10 = -1;         /* T_bandEUTRA_r10 */
 static int hf_lte_rrc_bandParametersUL_r10 = -1;  /* BandParametersUL_r10 */
 static int hf_lte_rrc_bandParametersDL_r10 = -1;  /* BandParametersDL_r10 */
 static int hf_lte_rrc_bandEUTRA_v1090 = -1;       /* FreqBandIndicator_v9e0 */
@@ -6222,6 +6222,13 @@ static void set_freq_band_indicator(guint32 value, asn1_ctx_t *actx)
   }
 }
 
+static void remove_last_freq_band_indicator(asn1_ctx_t *actx)
+{
+  meas_capabilities_item_band_mappings_t *mappings = private_data_meas_capabilities_item_band_mappings(actx);
+  if ((mappings->number_of_bands_set > 0) && (mappings->number_of_bands_set < 256)) {
+    mappings->number_of_bands_set--;
+  }
+}
 
 /* Cell type for simultaneousPUCCH-PUSCH-r10 */
 static simult_pucch_pusch_cell_type private_data_get_simult_pucch_pusch_cell_type(asn1_ctx_t *actx)
@@ -11359,13 +11366,8 @@ dissect_lte_rrc_MBMS_SAI_InterFreqList_r11(tvbuff_t *tvb _U_, int offset _U_, as
 
 static int
 dissect_lte_rrc_FreqBandIndicator_r11(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-  guint32 value;
   offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
-                                                            1U, maxFBI2, &value, FALSE);
-
-  set_freq_band_indicator(value, actx);
-
-
+                                                            1U, maxFBI2, NULL, FALSE);
 
   return offset;
 }
@@ -36127,12 +36129,8 @@ dissect_lte_rrc_MultiBandInfoList(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
 
 static int
 dissect_lte_rrc_FreqBandIndicator_v9e0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-  guint32 value;
   offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
-                                                            maxFBI_Plus1, maxFBI2, &value, FALSE);
-
-  set_freq_band_indicator(value, actx);
-
+                                                            maxFBI_Plus1, maxFBI2, NULL, FALSE);
 
   return offset;
 }
@@ -37029,7 +37027,7 @@ dissect_lte_rrc_InterFreqBandInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
                                    ett_lte_rrc_InterFreqBandInfo, InterFreqBandInfo_sequence);
 
   mappings = private_data_meas_capabilities_item_band_mappings(actx);
-  if (mappings->number_of_interfreq_serving_read <= mappings->number_of_bands_set) {
+  if (mappings->number_of_interfreq_serving_read < mappings->number_of_bands_set) {
     guint16 serving_band = mappings->band_by_item[mappings->number_of_interfreq_serving_read];
     guint16 target_band = mappings->band_by_item[mappings->number_of_interfreq_target_read++];
     if (mappings->number_of_interfreq_target_read == mappings->number_of_bands_set) {
@@ -37134,6 +37132,21 @@ dissect_lte_rrc_MeasParameters(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
 
 
 
+static int
+dissect_lte_rrc_T_measParameters(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
+  meas_capabilities_item_band_mappings_t *mappings;
+  offset = dissect_lte_rrc_MeasParameters(tvb, offset, actx, tree, hf_index);
+
+  /* Clear band mapping once measParameters IE has been decoded */
+  mappings = private_data_meas_capabilities_item_band_mappings(actx);
+  mappings->number_of_bands_set = 0;
+
+
+  return offset;
+}
+
+
+
 static int
 dissect_lte_rrc_T_featureGroupIndicators(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
   tvbuff_t *featureGroupIndicators_tvb=NULL;
@@ -38106,6 +38119,17 @@ dissect_lte_rrc_PhyLayerParameters_v1020(tvbuff_t *tvb _U_, int offset _U_, asn1
 }
 
 
+
+static int
+dissect_lte_rrc_T_bandEUTRA_r10(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
+  offset = dissect_lte_rrc_FreqBandIndicator(tvb, offset, actx, tree, hf_index);
+
+  remove_last_freq_band_indicator(actx);
+
+  return offset;
+}
+
+
 static const value_string lte_rrc_CA_BandwidthClass_r10_vals[] = {
   {   0, "a" },
   {   1, "b" },
@@ -38218,7 +38242,7 @@ dissect_lte_rrc_BandParametersDL_r10(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx
 
 
 static const per_sequence_t BandParameters_r10_sequence[] = {
-  { &hf_lte_rrc_bandEUTRA_r10, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_lte_rrc_FreqBandIndicator },
+  { &hf_lte_rrc_bandEUTRA_r10, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_lte_rrc_T_bandEUTRA_r10 },
   { &hf_lte_rrc_bandParametersUL_r10, ASN1_NO_EXTENSIONS     , ASN1_OPTIONAL    , dissect_lte_rrc_BandParametersUL_r10 },
   { &hf_lte_rrc_bandParametersDL_r10, ASN1_NO_EXTENSIONS     , ASN1_OPTIONAL    , dissect_lte_rrc_BandParametersDL_r10 },
   { NULL, 0, 0, NULL }
@@ -40365,7 +40389,7 @@ static const per_sequence_t UE_EUTRA_Capability_sequence[] = {
   { &hf_lte_rrc_pdcp_Parameters, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_lte_rrc_PDCP_Parameters },
   { &hf_lte_rrc_phyLayerParameters, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_lte_rrc_PhyLayerParameters },
   { &hf_lte_rrc_rf_Parameters, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_lte_rrc_RF_Parameters },
-  { &hf_lte_rrc_measParameters, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_lte_rrc_MeasParameters },
+  { &hf_lte_rrc_measParameters, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_lte_rrc_T_measParameters },
   { &hf_lte_rrc_featureGroupIndicators, ASN1_NO_EXTENSIONS     , ASN1_OPTIONAL    , dissect_lte_rrc_T_featureGroupIndicators },
   { &hf_lte_rrc_interRAT_Parameters, ASN1_NO_EXTENSIONS     , ASN1_NOT_OPTIONAL, dissect_lte_rrc_T_interRAT_Parameters },
   { &hf_lte_rrc_nonCriticalExtension_124, ASN1_NO_EXTENSIONS     , ASN1_OPTIONAL    , dissect_lte_rrc_UE_EUTRA_Capability_v920_IEs },
@@ -42016,7 +42040,7 @@ static int dissect_UEAssistanceInformation_r11_PDU(tvbuff_t *tvb _U_, packet_inf
 
 
 /*--- End of included file: packet-lte-rrc-fn.c ---*/
-#line 2476 "../../asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 2483 "../../asn1/lte-rrc/packet-lte-rrc-template.c"
 
 static void
 dissect_lte_rrc_DL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -51776,7 +51800,7 @@ void proto_register_lte_rrc(void) {
     { &hf_lte_rrc_bandEUTRA_r10,
       { "bandEUTRA-r10", "lte-rrc.bandEUTRA_r10",
         FT_UINT32, BASE_DEC, NULL, 0,
-        "FreqBandIndicator", HFILL }},
+        NULL, HFILL }},
     { &hf_lte_rrc_bandParametersUL_r10,
       { "bandParametersUL-r10", "lte-rrc.bandParametersUL_r10",
         FT_UINT32, BASE_DEC, NULL, 0,
@@ -52751,7 +52775,7 @@ void proto_register_lte_rrc(void) {
         "RSRQ_Range_v12xy", HFILL }},
 
 /*--- End of included file: packet-lte-rrc-hfarr.c ---*/
-#line 2646 "../../asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 2653 "../../asn1/lte-rrc/packet-lte-rrc-template.c"
 
     { &hf_lte_rrc_eutra_cap_feat_group_ind_1,
       { "Indicator 1", "lte-rrc.eutra_cap_feat_group_ind_1",
@@ -54674,7 +54698,7 @@ void proto_register_lte_rrc(void) {
     &ett_lte_rrc_CandidateCellInfo_r10,
 
 /*--- End of included file: packet-lte-rrc-ettarr.c ---*/
-#line 3269 "../../asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 3276 "../../asn1/lte-rrc/packet-lte-rrc-template.c"
 
     &ett_lte_rrc_featureGroupIndicators,
     &ett_lte_rrc_featureGroupIndRel9Add,
@@ -54747,7 +54771,7 @@ void proto_register_lte_rrc(void) {
 
 
 /*--- End of included file: packet-lte-rrc-dis-reg.c ---*/
-#line 3326 "../../asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 3333 "../../asn1/lte-rrc/packet-lte-rrc-template.c"
 
   register_init_routine(&lte_rrc_init_protocol);
 }