+/* Additions in Rel-8 */
+static const true_false_string priority_utran_start = {
+ "This is the first instance of the message",
+ "This is not the first instance of the message"
+};
+
+static const true_false_string priority_utran_stop = {
+ "This is the last instance of the message",
+ "This is not the last instance of the message"
+};
+
+static const true_false_string eutran_ccn_active = {
+ "CCN towards E-UTRAN cells is enabled in the cell",
+ "The broadcast E-UTRAN_CCN_ACTIVE parameter shall apply if applicable. Otherwise, CCN towards E-UTRAN cells is disabled in the cell"
+};
+
+static const value_string gsm_a_rr_pcid_psc_pattern_length[] = {
+ { 0, "1"},
+ { 1, "2"},
+ { 2, "3"},
+ { 3, "4"},
+ { 4, "5"},
+ { 5, "6"},
+ { 6, "7"},
+ { 7, "8"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_eutran_measurement_bandwidth[] = {
+ { 0, "NRB = 6"},
+ { 1, "NRB = 15"},
+ { 2, "NRB = 25"},
+ { 3, "NRB = 50"},
+ { 4, "NRB = 75"},
+ { 5, "NRB = 100"},
+ { 6, "Reserved for future use"},
+ { 7, "Reserved for future use"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_serving_cell_thresh_gsm_low[] = {
+ { 0, "0 dB"},
+ { 1, "2 dB"},
+ { 2, "4 dB"},
+ { 3, "6 dB"},
+ { 4, "8 dB"},
+ { 5, "10 dB"},
+ { 6, "12 dB"},
+ { 7, "14 dB"},
+ { 8, "16 dB"},
+ { 9, "18 dB"},
+ {10, "20 dB"},
+ {11, "22 dB"},
+ {12, "24 dB"},
+ {13, "26 dB"},
+ {14, "28 dB"},
+ {15, "Always allowed"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_serving_cell_thresh_priority_search[] = {
+ { 0, "-98 dBm"},
+ { 1, "-95 dBm"},
+ { 2, "-92 dBm"},
+ { 3, "-89 dBm"},
+ { 4, "-86 dBm"},
+ { 5, "-83 dBm"},
+ { 6, "-80 dBm"},
+ { 7, "-77 dBm"},
+ { 8, "-74 dBm"},
+ { 9, "-71 dBm"},
+ {10, "-68 dBm"},
+ {11, "-65 dBm"},
+ {12, "-62 dBm"},
+ {13, "-59 dBm"},
+ {14, "-56 dBm"},
+ {15, "Always search"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_utran_qrxlevmin[] = {
+ { 0, "-119 dBm"},
+ { 1, "-117 dBm"},
+ { 2, "-115 dBm"},
+ { 3, "-113 dBm"},
+ { 4, "-111 dBm"},
+ { 5, "-109 dBm"},
+ { 6, "-107 dBm"},
+ { 7, "-105 dBm"},
+ { 8, "-103 dBm"},
+ { 9, "-101 dBm"},
+ {10, "-99 dBm"},
+ {11, "-97 dBm"},
+ {12, "-95 dBm"},
+ {13, "-93 dBm"},
+ {14, "-91 dBm"},
+ {15, "-89 dBm"},
+ {16, "-87 dBm"},
+ {17, "-85 dBm"},
+ {18, "-83 dBm"},
+ {19, "-81 dBm"},
+ {20, "-79 dBm"},
+ {21, "-77 dBm"},
+ {22, "-75 dBm"},
+ {23, "-73 dBm"},
+ {24, "-71 dBm"},
+ {25, "-69 dBm"},
+ {26, "-67 dBm"},
+ {27, "-65 dBm"},
+ {28, "-63 dBm"},
+ {29, "-61 dBm"},
+ {30, "-59 dBm"},
+ {31, "-57 dBm"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_thresh_utran_eutran_high_low[] = {
+ { 0, "0 dB"},
+ { 1, "2 dB"},
+ { 2, "4 dB"},
+ { 3, "6 dB"},
+ { 4, "8 dB"},
+ { 5, "10 dB"},
+ { 6, "12 dB"},
+ { 7, "14 dB"},
+ { 8, "16 dB"},
+ { 9, "18 dB"},
+ {10, "20 dB"},
+ {11, "22 dB"},
+ {12, "24 dB"},
+ {13, "26 dB"},
+ {14, "28 dB"},
+ {15, "30 dB"},
+ {16, "32 dB"},
+ {17, "34 dB"},
+ {18, "36 dB"},
+ {19, "38 dB"},
+ {20, "40 dB"},
+ {21, "42 dB"},
+ {22, "44 dB"},
+ {23, "46 dB"},
+ {24, "48 dB"},
+ {25, "50 dB"},
+ {26, "52 dB"},
+ {27, "54 dB"},
+ {28, "56 dB"},
+ {29, "58 dB"},
+ {30, "60 dB"},
+ {31, "62 dB"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_eutran_qrxlevmin[] = {
+ { 0, "-140 dBm"},
+ { 1, "-138 dBm"},
+ { 2, "-136 dBm"},
+ { 3, "-134 dBm"},
+ { 4, "-132 dBm"},
+ { 5, "-130 dBm"},
+ { 6, "-128 dBm"},
+ { 7, "-126 dBm"},
+ { 8, "-124 dBm"},
+ { 9, "-122 dBm"},
+ {10, "-120 dBm"},
+ {11, "-118 dBm"},
+ {12, "-116 dBm"},
+ {13, "-114 dBm"},
+ {14, "-112 dBm"},
+ {15, "-110 dBm"},
+ {16, "-108 dBm"},
+ {17, "-106 dBm"},
+ {18, "-104 dBm"},
+ {19, "-102 dBm"},
+ {20, "-100 dBm"},
+ {21, "-98 dBm"},
+ {22, "-96 dBm"},
+ {23, "-94 dBm"},
+ {24, "-92 dBm"},
+ {25, "-90 dBm"},
+ {26, "-88 dBm"},
+ {27, "-86 dBm"},
+ {28, "-84 dBm"},
+ {29, "-82 dBm"},
+ {30, "-80 dBm"},
+ {31, "-78 dBm"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_serving_cell_priority_param_h_prio[] = {
+ { 0, "disabled"},
+ { 1, "5 dB"},
+ { 2, "4 dB"},
+ { 3, "3 dB"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_serving_cell_priority_param_t_reselection[] = {
+ { 0, "5 s"},
+ { 1, "10 s"},
+ { 2, "15 s"},
+ { 3, "20 s"},
+ { 0, NULL }
+};
+
+static const value_string gsm_a_rr_qsearch_c_eutran_initial[] = {
+ { 0, "search if signal is below -98 dBm"},
+ { 1, "search if signal is below -94 dBm"},
+ { 2, "search if signal is below -90 dBm"},
+ { 3, "search if signal is below -86 dBm"},
+ { 4, "search if signal is below -82 dBm"},
+ { 5, "search if signal is below -78 dBm"},
+ { 6, "search if signal is below -74 dBm"},
+ { 7, "always search"},
+ { 8, "search is signal is above -78 dBm"},
+ { 9, "search is signal is above -74 dBm"},
+ {10, "search is signal is above -70 dBm"},
+ {11, "search is signal is above -66 dBm"},
+ {12, "search is signal is above -62 dBm"},
+ {13, "search is signal is above -58 dBm"},
+ {14, "search is signal is above -54 dBm"},
+ {15, "never search"},
+ { 0, NULL }
+};
+
+static const true_false_string gsm_a_rr_pcid_pattern_sense = {
+ "The group of identified cells are the one not belonging to the PCID_BITMAP_GROUP",
+ "The group of identified cells are the one identified by the PCID_BITMAP_GROUP"
+};
+
+static gint
+de_rr_3g_priority_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ proto_tree *subtree;
+ proto_item *item;
+ gint curr_bit_offset;
+ guint8 value;
+ curr_bit_offset = bit_offset;
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_PRIORITY_PARAM_DESC].strptr);
+ subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_PRIORITY_PARAM_DESC]);
+
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_utran_start, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_utran_stop, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_default_utran_prio, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_default_threshold_utran, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_3g_priority_param_desc_default_utran_qrxlevmin, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ }
+ /* Repeated UTRAN Priority Parameters */
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ proto_tree *subtree_rep_utran_prio;
+ proto_item *item_rep_utran_prio;
+ gint rep_utran_prio_bit_offset = curr_bit_offset;
+
+ item_rep_utran_prio = proto_tree_add_text(subtree, tvb, curr_bit_offset>>3, 1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_UTRAN_PRIO_PARAM].strptr);
+ subtree_rep_utran_prio = proto_item_add_subtree(item_rep_utran_prio, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_UTRAN_PRIO_PARAM]);
+
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_utran_frequency_index, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_utran_priority, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ }
+ proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_thresh_utran_high, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_thresh_utran_low, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree_rep_utran_prio, hf_gsm_a_rr_utran_qrxlevmin, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ }
+ proto_item_set_len(item_rep_utran_prio,((curr_bit_offset-rep_utran_prio_bit_offset)>>3)+1);
+ }
+
+ proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
+
+ return(curr_bit_offset - bit_offset);
+}
+
+static gint
+de_rr_eutran_neighbour_cells(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ proto_tree *subtree;
+ proto_item *item;
+ gint curr_bit_offset;
+ guint8 value;
+ curr_bit_offset = bit_offset;
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_NEIGHBOUR_CELLS].strptr);
+ subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_NEIGHBOUR_CELLS]);
+
+ while ((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_earfcn, tvb, curr_bit_offset, 16, FALSE);
+ curr_bit_offset += 16;
+
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_measurement_bandwidth, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ }
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_priority, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ }
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_thresh_eutran_high, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_thresh_eutran_low, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_qrxlevmin, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ }
+
+ proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
+
+ return(curr_bit_offset - bit_offset);
+}
+
+static gint
+de_rr_eutran_pcid(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ gint curr_bit_offset = bit_offset;
+ guint8 value;
+ proto_item *item;
+
+ while ((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid, tvb, curr_bit_offset, 9, FALSE);
+ curr_bit_offset += 9;
+ }
+
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ gint i;
+ guint8 bitmap = tvb_get_bits8(tvb,curr_bit_offset,6);
+ item = proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid_bitmap_group, tvb, curr_bit_offset, 6, FALSE);
+ if (bitmap > 0)
+ {
+ proto_item_append_text(item, ": Cells IDs addressed by the bitmap:");
+ }
+ for (i = 0; i < 6; i++)
+ {
+ if ((1 << i) & bitmap)
+ {
+ if ( i != 0)
+ {
+ proto_item_append_text(item, ",");
+ }
+ proto_item_append_text(item, " %d to %d",i*84, (i+1)*84 - 1);
+ }
+ }
+ curr_bit_offset += 6;
+ }
+ while ((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ gint pcid_pattern_length;
+ gint pcid_pattern;
+ gint pattern_lower_bound, pattern_upper_bound;
+ gint i;
+
+ pcid_pattern_length = tvb_get_bits8(tvb,curr_bit_offset,3) + 1;
+ proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid_pattern_length, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ pcid_pattern = tvb_get_bits8(tvb,curr_bit_offset, pcid_pattern_length);
+
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, 1, "%s = PCID_Pattern: %d",
+ decode_bits_in_field(curr_bit_offset,pcid_pattern_length, pcid_pattern),
+ pcid_pattern);
+
+ pattern_lower_bound = pcid_pattern << (9 - pcid_pattern_length);
+ pattern_upper_bound = pattern_lower_bound;
+ for (i = 0; i < (9-pcid_pattern_length); i++)
+ {
+ pattern_upper_bound |= 1 << i;
+ }
+ proto_item_append_text(item, ": Cells IDs addressed by the pattern: %d to %d", pattern_lower_bound, pattern_upper_bound);
+
+ curr_bit_offset += pcid_pattern_length;
+ proto_tree_add_bits_item(tree, hf_gsm_a_rr_eutran_pcid_pattern_sense, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ }
+
+ return(curr_bit_offset - bit_offset);
+}
+
+static gint
+de_rr_eutran_not_allowed_cells(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ proto_tree *subtree;
+ proto_item *item;
+ gint curr_bit_offset;
+ guint8 value;
+ curr_bit_offset = bit_offset;
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_NOT_ALLOWED_CELLS].strptr);
+ subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_NOT_ALLOWED_CELLS]);
+
+ /* dissect PCID group */
+ curr_bit_offset += de_rr_eutran_pcid(tvb, subtree, curr_bit_offset);
+
+ while ((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_frequency_index, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ }
+
+ proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
+
+ return(curr_bit_offset - bit_offset);
+}
+
+static gint
+de_rr_eutran_pcid_to_ta_mapping(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ proto_tree *subtree;
+ proto_item *item;
+ gint curr_bit_offset;
+ guint8 value;
+ curr_bit_offset = bit_offset;
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_PCID_TO_TA_MAPPING].strptr);
+ subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_PCID_TO_TA_MAPPING]);
+
+ while ((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ /* dissect PCID group */
+ curr_bit_offset += de_rr_eutran_pcid(tvb, subtree, curr_bit_offset);
+ }
+
+ proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
+
+ return(curr_bit_offset - bit_offset);
+}
+
+static gint
+de_rr_eutran_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ proto_tree *subtree;
+ proto_item *item;
+ gint curr_bit_offset;
+ guint8 value;
+ curr_bit_offset = bit_offset;
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_PARAM_DESC].strptr);
+ subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_PARAM_DESC]);
+
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_ccn_active, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_start, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_stop, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ /* E-UTRAN Measurement Parameters Description */
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_qsearch_c_eutran_initial, tvb, curr_bit_offset, 4, FALSE);
+ curr_bit_offset += 4;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_rep_quant, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_multirat_reporting, tvb, curr_bit_offset, 2, FALSE);
+ curr_bit_offset += 2;
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (!value)
+ {
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_fdd_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2, tvb, curr_bit_offset, 6, FALSE);
+ curr_bit_offset += 6;
+ }
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_tdd_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2, tvb, curr_bit_offset, 6, FALSE);
+ curr_bit_offset += 6;
+ }
+ }
+ }
+ else
+ {
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_fdd_measurement_report_offset, tvb, curr_bit_offset, 6, FALSE);
+ curr_bit_offset += 6;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2, tvb, curr_bit_offset, 6, FALSE);
+ curr_bit_offset += 6;
+ }
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_tdd_measurement_report_offset, tvb, curr_bit_offset, 6, FALSE);
+ curr_bit_offset += 6;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2, tvb, curr_bit_offset, 6, FALSE);
+ curr_bit_offset += 6;
+ }
+ }
+ }
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_reporting_granularity, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ /* GPRS E-UTRAN Measurement Parameters Description */
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_qsearch_p_eutran, tvb, curr_bit_offset, 4, FALSE);
+ curr_bit_offset += 4;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_rep_quant, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_multirat_reporting, tvb, curr_bit_offset, 2, FALSE);
+ curr_bit_offset += 2;
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_fdd_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_fdd_reporting_threshold_2, tvb, curr_bit_offset, 6, FALSE);
+ curr_bit_offset += 6;
+ }
+ }
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_tdd_reporting_threshold, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ if (value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_eutran_tdd_reporting_threshold_2, tvb, curr_bit_offset, 6, FALSE);
+ curr_bit_offset += 6;
+ }
+ }
+ }
+
+ /* Repeated E-UTRAN Neighbour Cells */
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ curr_bit_offset += de_rr_eutran_neighbour_cells(tvb, subtree, curr_bit_offset);
+ }
+
+ /* Repeated E-UTRAN Not Allowed Cells */
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ curr_bit_offset += de_rr_eutran_not_allowed_cells(tvb, subtree, curr_bit_offset);
+ }
+
+ /* Repeated E-UTRAN PCID to TA mapping */
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ curr_bit_offset += de_rr_eutran_pcid_to_ta_mapping(tvb, subtree, curr_bit_offset);
+ }
+
+ proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
+
+ return(curr_bit_offset - bit_offset);
+}
+
+static gint
+de_rr_priority_and_eutran_param_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ proto_tree *subtree;
+ proto_item *item;
+ gint curr_bit_offset;
+ guint8 value;
+
+ curr_bit_offset = bit_offset;
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_PRIORITY_AND_EUTRAN_PARAM_DESC].strptr);
+ subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_PRIORITY_AND_EUTRAN_PARAM_DESC]);
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+
+ /* Serving Cell Priority Parameters Description */
+ if (value)
+ {
+ proto_tree *subtree_serv;
+ proto_item *item_serv;
+ gint serv_bit_offset = curr_bit_offset;
+
+ item_serv = proto_tree_add_text(subtree, tvb, curr_bit_offset>>3, ((curr_bit_offset+15)>>3)-(curr_bit_offset>>3) + 1 , "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_SERVING_CELL_PRIORITY_PARAM_DESC].strptr);
+ subtree_serv = proto_item_add_subtree(item_serv, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_SERVING_CELL_PRIORITY_PARAM_DESC]);
+
+ proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_geran_priority, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_thresh_prio_search, tvb, curr_bit_offset, 4, FALSE);
+ curr_bit_offset += 4;
+ proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_thresh_gsm_low, tvb, curr_bit_offset, 4, FALSE);
+ curr_bit_offset += 4;
+ proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_h_prio, tvb, curr_bit_offset, 2, FALSE);
+ curr_bit_offset += 2;
+ proto_tree_add_bits_item(subtree_serv, hf_gsm_a_rr_serving_cell_priority_param_t_reselection, tvb, curr_bit_offset, 2, FALSE);
+ curr_bit_offset += 2;
+ proto_item_set_len(item_serv,((curr_bit_offset-serv_bit_offset)>>3)+1);
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ /* 3G Priority Parameters Description */
+ if (value)
+ {
+ curr_bit_offset += de_rr_3g_priority_param_desc(tvb, subtree, curr_bit_offset);
+ }
+ value = tvb_get_bits8(tvb,curr_bit_offset,1);
+ curr_bit_offset += 1;
+ /* E-UTRAN Parameters Description */
+ if (value)
+ {
+ curr_bit_offset += de_rr_eutran_param_desc(tvb, subtree, curr_bit_offset);
+ }
+
+ proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
+
+ return(curr_bit_offset - bit_offset);
+}
+
+static gint
+de_rr_3g_csg_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ proto_tree *subtree;
+ proto_item *item;
+ gint curr_bit_offset;
+ guint8 value;
+
+ curr_bit_offset = bit_offset;
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_3G_CSG_DESC].strptr);
+ subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_3G_CSG_DESC]);
+
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ /* CSG_PSC_SPLIT struct */
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_psc, tvb, curr_bit_offset, 9, FALSE);
+ curr_bit_offset += 9;
+ }
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ gint psc_pattern_length;
+ gint psc_pattern;
+
+ psc_pattern_length = tvb_get_bits8(tvb,curr_bit_offset,3) + 1;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_psc_pattern_length, tvb, curr_bit_offset, 3, FALSE);
+ curr_bit_offset += 3;
+ psc_pattern = tvb_get_bits8(tvb,curr_bit_offset, psc_pattern_length);
+
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, 1, "%s = PSC_Pattern: %d",
+ decode_bits_in_field(curr_bit_offset,psc_pattern_length, psc_pattern),
+ psc_pattern);
+
+ curr_bit_offset += psc_pattern_length;
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_psc_pattern_sense, tvb, curr_bit_offset, 1, FALSE);
+ curr_bit_offset += 1;
+ }
+
+ while ((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_frequency_index, tvb, curr_bit_offset, 5, FALSE);
+ curr_bit_offset += 5;
+ }
+ }
+
+ while((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ /* CSG_FDD_UARFCN */
+ value = tvb_get_bits8(tvb,bit_offset,1);
+ bit_offset += 1;
+ if (!value)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_csg_fdd_uarfcn, tvb, curr_bit_offset, 14, FALSE);
+ curr_bit_offset += 14;
+ }
+ else
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_utran_csg_tdd_uarfcn, tvb, curr_bit_offset, 14, FALSE);
+ curr_bit_offset += 14;
+ }
+ }
+
+ proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
+
+ return(curr_bit_offset - bit_offset);
+}
+
+static gint
+de_rr_eutran_csg_desc(tvbuff_t *tvb, proto_tree *tree, gint bit_offset)
+{
+ proto_tree *subtree;
+ proto_item *item;
+ gint curr_bit_offset;
+ guint8 value;
+
+ curr_bit_offset = bit_offset;
+ item = proto_tree_add_text(tree, tvb, curr_bit_offset>>3, -1, "%s", gsm_rr_rest_octets_elem_strings[DE_RR_REST_OCTETS_EUTRAN_CSG_DESC].strptr);
+ subtree = proto_item_add_subtree(item, ett_gsm_rr_rest_octets_elem[DE_RR_REST_OCTETS_EUTRAN_CSG_DESC]);
+
+ while ((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ /* dissect PCID group */
+ curr_bit_offset += de_rr_eutran_pcid(tvb, subtree, curr_bit_offset);
+ }
+
+ while ((value = tvb_get_bits8(tvb,curr_bit_offset++,1)) == 1)
+ {
+ proto_tree_add_bits_item(subtree, hf_gsm_a_rr_csg_earfcn, tvb, curr_bit_offset, 16, FALSE);
+ curr_bit_offset += 16;
+ }
+
+ proto_item_set_len(item,((curr_bit_offset-bit_offset)>>3)+1);
+
+ return(curr_bit_offset - bit_offset);
+}
+