1 /* Routines for UMTS FP disassembly
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #include <epan/packet.h>
31 #include <epan/expert.h>
32 #include <epan/prefs.h>
34 #include "packet-umts_fp.h"
36 /* The Frame Protocol (FP) is described in:
37 * 3GPP TS 25.427 (for dedicated channels)
38 * 3GPP TS 25.435 (for common/shared channels)
41 * - IUR interface-specific formats
42 * - verify header & payload CRCs
43 * - do CRC verification before further parsing
46 /* Initialize the protocol and registered fields. */
49 static int hf_fp_release = -1;
50 static int hf_fp_release_version = -1;
51 static int hf_fp_release_year = -1;
52 static int hf_fp_release_month = -1;
53 static int hf_fp_channel_type = -1;
54 static int hf_fp_division = -1;
55 static int hf_fp_direction = -1;
56 static int hf_fp_ddi_config = -1;
57 static int hf_fp_ddi_config_ddi = -1;
58 static int hf_fp_ddi_config_macd_pdu_size = -1;
60 static int hf_fp_header_crc = -1;
61 static int hf_fp_ft = -1;
62 static int hf_fp_cfn = -1;
63 static int hf_fp_pch_cfn = -1;
64 static int hf_fp_pch_toa = -1;
65 static int hf_fp_cfn_control = -1;
66 static int hf_fp_toa = -1;
67 static int hf_fp_tfi = -1;
68 static int hf_fp_usch_tfi = -1;
69 static int hf_fp_cpch_tfi = -1;
70 static int hf_fp_propagation_delay = -1;
71 static int hf_fp_tb = -1;
72 static int hf_fp_chan_zero_tbs = -1;
73 static int hf_fp_received_sync_ul_timing_deviation = -1;
74 static int hf_fp_pch_pi = -1;
75 static int hf_fp_pch_tfi = -1;
76 static int hf_fp_fach_tfi = -1;
77 static int hf_fp_transmit_power_level = -1;
78 static int hf_fp_paging_indication_bitmap = -1;
79 static int hf_fp_pdsch_set_id = -1;
80 static int hf_fp_rx_timing_deviation = -1;
81 static int hf_fp_dch_e_rucch_flag = -1;
82 static int hf_fp_dch_control_frame_type = -1;
83 static int hf_fp_dch_rx_timing_deviation = -1;
84 static int hf_fp_quality_estimate = -1;
85 static int hf_fp_payload_crc = -1;
86 static int hf_fp_edch_header_crc = -1;
87 static int hf_fp_edch_fsn = -1;
88 static int hf_fp_edch_subframe = -1;
89 static int hf_fp_edch_number_of_subframes = -1;
90 static int hf_fp_edch_harq_retransmissions = -1;
91 static int hf_fp_edch_subframe_number = -1;
92 static int hf_fp_edch_number_of_mac_es_pdus = -1;
93 static int hf_fp_edch_ddi = -1;
94 static int hf_fp_edch_subframe_header = -1;
95 static int hf_fp_edch_number_of_mac_d_pdus = -1;
96 static int hf_fp_edch_pdu_padding = -1;
97 static int hf_fp_edch_tsn = -1;
98 static int hf_fp_edch_mac_es_pdu = -1;
100 static int hf_fp_edch_user_buffer_size = -1;
101 static int hf_fp_edch_no_macid_sdus = -1;
102 static int hf_fp_edch_number_of_mac_is_pdus = -1;
104 static int hf_fp_edch_e_rnti = -1;
105 static int hf_fp_edch_macis_descriptors = -1;
106 static int hf_fp_edch_macis_lchid = -1;
107 static int hf_fp_edch_macis_length = -1;
108 static int hf_fp_edch_macis_flag = -1;
109 static int hf_fp_edch_macis_tsn = -1;
110 static int hf_fp_edch_macis_ss = -1;
111 static int hf_fp_edch_macis_sdu = -1;
113 static int hf_fp_frame_seq_nr = -1;
114 static int hf_fp_hsdsch_pdu_block_header = -1;
115 static int hf_fp_hsdsch_pdu_block = -1;
116 static int hf_fp_flush = -1;
117 static int hf_fp_fsn_drt_reset = -1;
118 static int hf_fp_drt_indicator = -1;
119 static int hf_fp_fach_indicator = -1;
120 static int hf_fp_total_pdu_blocks = -1;
121 static int hf_fp_drt = -1;
122 static int hf_fp_hrnti = -1;
123 static int hf_fp_rach_measurement_result = -1;
124 static int hf_fp_lchid = -1;
125 static int hf_fp_pdu_length_in_block = -1;
126 static int hf_fp_pdus_in_block = -1;
127 static int hf_fp_cmch_pi = -1;
128 static int hf_fp_user_buffer_size = -1;
129 static int hf_fp_hsdsch_credits = -1;
130 static int hf_fp_hsdsch_max_macd_pdu_len = -1;
131 static int hf_fp_hsdsch_max_macdc_pdu_len = -1;
132 static int hf_fp_hsdsch_interval = -1;
133 static int hf_fp_hsdsch_calculated_rate = -1;
134 static int hf_fp_hsdsch_unlimited_rate = -1;
135 static int hf_fp_hsdsch_repetition_period = -1;
136 static int hf_fp_hsdsch_data_padding = -1;
137 static int hf_fp_hsdsch_new_ie_flags = -1;
138 static int hf_fp_hsdsch_new_ie_flag[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
139 static int hf_fp_hsdsch_drt = -1;
140 static int hf_fp_hsdsch_entity = -1;
141 static int hf_fp_timing_advance = -1;
142 static int hf_fp_num_of_pdu = -1;
143 static int hf_fp_mac_d_pdu_len = -1;
144 static int hf_fp_mac_d_pdu = -1;
145 static int hf_fp_data = -1;
146 static int hf_fp_crcis = -1;
147 static int hf_fp_crci[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
148 static int hf_fp_common_control_frame_type = -1;
149 static int hf_fp_t1 = -1;
150 static int hf_fp_t2 = -1;
151 static int hf_fp_t3 = -1;
152 static int hf_fp_ul_sir_target = -1;
153 static int hf_fp_pusch_set_id = -1;
154 static int hf_fp_activation_cfn = -1;
155 static int hf_fp_duration = -1;
156 static int hf_fp_power_offset = -1;
157 static int hf_fp_code_number = -1;
158 static int hf_fp_spreading_factor = -1;
159 static int hf_fp_mc_info = -1;
161 static int hf_fp_rach_new_ie_flags = -1;
162 static int hf_fp_rach_new_ie_flag_unused[7] = {-1, -1, -1, -1, -1, -1, -1 };
163 static int hf_fp_rach_ext_propagation_delay_present = -1;
164 static int hf_fp_rach_cell_portion_id_present = -1;
165 static int hf_fp_rach_angle_of_arrival_present = -1;
166 static int hf_fp_rach_ext_rx_sync_ul_timing_deviation_present = -1;
167 static int hf_fp_rach_ext_rx_timing_deviation_present = -1;
169 static int hf_fp_cell_portion_id = -1;
170 static int hf_fp_ext_propagation_delay = -1;
171 static int hf_fp_angle_of_arrival = -1;
172 static int hf_fp_ext_received_sync_ul_timing_deviation = -1;
174 static int hf_fp_radio_interface_parameter_update_flag[5] = {-1, -1, -1, -1, -1};
175 static int hf_fp_dpc_mode = -1;
176 static int hf_fp_tpc_po = -1;
177 static int hf_fp_multiple_rl_set_indicator = -1;
178 static int hf_fp_max_ue_tx_pow = -1;
179 static int hf_fp_congestion_status = -1;
180 static int hf_fp_e_rucch_present = -1;
181 static int hf_fp_extended_bits_present = -1;
182 static int hf_fp_extended_bits = -1;
183 static int hf_fp_spare_extension = -1;
186 static int ett_fp = -1;
187 static int ett_fp_release = -1;
188 static int ett_fp_data = -1;
189 static int ett_fp_crcis = -1;
190 static int ett_fp_ddi_config = -1;
191 static int ett_fp_edch_subframe_header = -1;
192 static int ett_fp_edch_subframe = -1;
193 static int ett_fp_edch_maces = -1;
194 static int ett_fp_edch_macis_descriptors = -1;
195 static int ett_fp_edch_macis_pdu = -1;
196 static int ett_fp_hsdsch_new_ie_flags = -1;
197 static int ett_fp_rach_new_ie_flags = -1;
198 static int ett_fp_hsdsch_pdu_block_header = -1;
200 static dissector_handle_t mac_fdd_dch_handle;
201 static dissector_handle_t mac_fdd_rach_handle;
202 static dissector_handle_t mac_fdd_fach_handle;
203 static dissector_handle_t mac_fdd_pch_handle;
204 static dissector_handle_t mac_fdd_edch_handle;
205 static dissector_handle_t mac_fdd_hsdsch_handle;
207 static proto_tree *top_level_tree = NULL;
209 /* Variables used for preferences */
210 static gboolean preferences_call_mac_dissectors = TRUE;
211 static gboolean preferences_show_release_info = TRUE;
214 /* E-DCH (T1) channel header information */
215 struct edch_t1_subframe_info
217 guint8 subframe_number;
218 guint8 number_of_mac_es_pdus;
220 guint16 number_of_mac_d_pdus[64];
223 /* E-DCH (T2) channel header information */
224 struct edch_t2_subframe_info
226 guint8 subframe_number;
227 guint8 number_of_mac_is_pdus;
228 guint8 number_of_mac_is_sdus[16];
229 guint8 mac_is_lchid[16][16];
230 guint16 mac_is_length[16][16];
234 static const value_string channel_type_vals[] =
236 { CHANNEL_RACH_FDD, "RACH_FDD" },
237 { CHANNEL_RACH_TDD, "RACH_TDD" },
238 { CHANNEL_FACH_FDD, "FACH_FDD" },
239 { CHANNEL_FACH_TDD, "FACH_TDD" },
240 { CHANNEL_DSCH_FDD, "DSCH_FDD" },
241 { CHANNEL_DSCH_TDD, "DSCH_TDD" },
242 { CHANNEL_USCH_TDD_384, "USCH_TDD_384" },
243 { CHANNEL_USCH_TDD_128, "USCH_TDD_128" },
244 { CHANNEL_PCH, "PCH" },
245 { CHANNEL_CPCH, "CPCH" },
246 { CHANNEL_BCH, "BCH" },
247 { CHANNEL_DCH, "DCH" },
248 { CHANNEL_HSDSCH, "HSDSCH" },
249 { CHANNEL_IUR_CPCHF, "IUR CPCHF" },
250 { CHANNEL_IUR_FACH, "IUR FACH" },
251 { CHANNEL_IUR_DSCH, "IUR DSCH" },
252 { CHANNEL_EDCH, "EDCH" },
253 { CHANNEL_RACH_TDD_128, "RACH_TDD_128" },
254 { CHANNEL_HSDSCH_COMMON,"HSDSCH-COMMON" },
255 { CHANNEL_HSDSCH_COMMON_T3,"HSDSCH-COMMON-T3" },
256 { CHANNEL_EDCH_COMMON, "EDCH-COMMON"},
260 static const value_string division_vals[] =
262 { Division_FDD, "FDD"},
263 { Division_TDD_384, "TDD-384"},
264 { Division_TDD_128, "TDD-128"},
265 { Division_TDD_768, "TDD-768"},
270 static const value_string data_control_vals[] = {
276 static const value_string direction_vals[] = {
282 static const value_string crci_vals[] = {
284 { 1, "Not correct" },
288 static const value_string paging_indication_vals[] = {
289 { 0, "no PI-bitmap in payload" },
290 { 1, "PI-bitmap in payload" },
294 static const value_string spreading_factor_vals[] = {
305 static const value_string congestion_status_vals[] = {
306 {0, "No TNL congestion"},
307 {1, "Reserved for future use"},
308 {2, "TNL congestion - detected by delay build-up"},
309 {3, "TNL congestion - detected by frame loss"},
313 static const value_string e_rucch_flag_vals[] = {
314 { 0, "Conventional E-RUCCH reception" },
315 { 1, "TA Request reception" },
319 static const value_string hsdshc_mac_entity_vals[] = {
320 { entity_not_specified, "Unspecified (assume MAC-hs)" },
326 /* TODO: add and use */
327 static const value_string segmentation_status_vals[] = {
335 static const value_string lchid_vals[] = {
336 { 0, "Logical Channel 1" },
337 { 1, "Logical Channel 2" },
338 { 2, "Logical Channel 3" },
339 { 3, "Logical Channel 4" },
340 { 4, "Logical Channel 5" },
341 { 5, "Logical Channel 6" },
342 { 6, "Logical Channel 7" },
343 { 7, "Logical Channel 8" },
344 { 8, "Logical Channel 9" },
345 { 9, "Logical Channel 10" },
346 { 10, "Logical Channel 11" },
347 { 11, "Logical Channel 12" },
348 { 12, "Logical Channel 13" },
349 { 13, "Logical Channel 14" },
350 { 14, "CCCH (SRB0)" },
351 { 15, "E-RNTI being included (FDD only)" },
355 /* Dedicated control types */
356 #define DCH_OUTER_LOOP_POWER_CONTROL 1
357 #define DCH_TIMING_ADJUSTMENT 2
358 #define DCH_DL_SYNCHRONISATION 3
359 #define DCH_UL_SYNCHRONISATION 4
361 #define DCH_DL_NODE_SYNCHRONISATION 6
362 #define DCH_UL_NODE_SYNCHRONISATION 7
363 #define DCH_RX_TIMING_DEVIATION 8
364 #define DCH_RADIO_INTERFACE_PARAMETER_UPDATE 9
365 #define DCH_TIMING_ADVANCE 10
366 #define DCH_TNL_CONGESTION_INDICATION 11
368 static const value_string dch_control_frame_type_vals[] = {
369 { DCH_OUTER_LOOP_POWER_CONTROL, "OUTER LOOP POWER CONTROL" },
370 { DCH_TIMING_ADJUSTMENT, "TIMING ADJUSTMENT" },
371 { DCH_DL_SYNCHRONISATION, "DL SYNCHRONISATION" },
372 { DCH_UL_SYNCHRONISATION, "UL SYNCHRONISATION" },
373 { 5, "Reserved Value" },
374 { DCH_DL_NODE_SYNCHRONISATION, "DL NODE SYNCHRONISATION" },
375 { DCH_UL_NODE_SYNCHRONISATION, "UL NODE SYNCHRONISATION" },
376 { DCH_RX_TIMING_DEVIATION, "RX TIMING DEVIATION" },
377 { DCH_RADIO_INTERFACE_PARAMETER_UPDATE, "RADIO INTERFACE PARAMETER UPDATE" },
378 { DCH_TIMING_ADVANCE, "TIMING ADVANCE" },
379 { DCH_TNL_CONGESTION_INDICATION, "TNL CONGESTION INDICATION" },
384 /* Common channel control types */
385 #define COMMON_OUTER_LOOP_POWER_CONTROL 1
386 #define COMMON_TIMING_ADJUSTMENT 2
387 #define COMMON_DL_SYNCHRONISATION 3
388 #define COMMON_UL_SYNCHRONISATION 4
390 #define COMMON_DL_NODE_SYNCHRONISATION 6
391 #define COMMON_UL_NODE_SYNCHRONISATION 7
392 #define COMMON_DYNAMIC_PUSCH_ASSIGNMENT 8
393 #define COMMON_TIMING_ADVANCE 9
394 #define COMMON_HS_DSCH_Capacity_Request 10
395 #define COMMON_HS_DSCH_Capacity_Allocation 11
396 #define COMMON_HS_DSCH_Capacity_Allocation_Type_2 12
398 static const value_string common_control_frame_type_vals[] = {
399 { COMMON_OUTER_LOOP_POWER_CONTROL, "OUTER LOOP POWER CONTROL" },
400 { COMMON_TIMING_ADJUSTMENT, "TIMING ADJUSTMENT" },
401 { COMMON_DL_SYNCHRONISATION, "DL SYNCHRONISATION" },
402 { COMMON_UL_SYNCHRONISATION, "UL SYNCHRONISATION" },
403 { 5, "Reserved Value" },
404 { COMMON_DL_NODE_SYNCHRONISATION, "DL NODE SYNCHRONISATION" },
405 { COMMON_UL_NODE_SYNCHRONISATION, "UL NODE SYNCHRONISATION" },
406 { COMMON_DYNAMIC_PUSCH_ASSIGNMENT, "DYNAMIC PUSCH ASSIGNMENT" },
407 { COMMON_TIMING_ADVANCE, "TIMING ADVANCE" },
408 { COMMON_HS_DSCH_Capacity_Request, "HS-DSCH Capacity Request" },
409 { COMMON_HS_DSCH_Capacity_Allocation, "HS-DSCH Capacity Allocation" },
410 { COMMON_HS_DSCH_Capacity_Allocation_Type_2, "HS-DSCH Capacity Allocation Type 2" },
414 /* Dissect message parts */
415 static int dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
416 int offset, struct fp_info *p_fp_info,
417 dissector_handle_t *data_handle);
418 static int dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
419 int offset, guint16 length, guint16 number_of_pdus);
420 static int dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
421 int offset, guint16 length, guint16 number_of_pdus);
423 static int dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
424 fp_info *p_fp_info, int offset);
425 static void dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo,
426 proto_tree *tree, guint8 dch_crc_present,
429 /* Dissect common control messages */
430 static int dissect_common_outer_loop_power_control(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
431 int offset, struct fp_info *p_fp_info);
432 static int dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
433 int offset, struct fp_info *p_fp_info);
434 static int dissect_common_dl_node_synchronisation(packet_info *pinfo, proto_tree *tree,
435 tvbuff_t *tvb, int offset);
436 static int dissect_common_ul_node_synchronisation(packet_info *pinfo, proto_tree *tree,
437 tvbuff_t *tvb, int offset);
438 static int dissect_common_dl_synchronisation(packet_info *pinfo, proto_tree *tree,
439 tvbuff_t *tvb, int offset,
440 struct fp_info *p_fp_info);
441 static int dissect_common_ul_synchronisation(packet_info *pinfo, proto_tree *tree,
442 tvbuff_t *tvb, int offset,
443 struct fp_info *p_fp_info);
444 static int dissect_common_timing_advance(packet_info *pinfo, proto_tree *tree,
445 tvbuff_t *tvb, int offset);
446 static int dissect_hsdpa_capacity_request(packet_info *pinfo, proto_tree *tree,
447 tvbuff_t *tvb, int offset);
448 static int dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree,
449 tvbuff_t *tvb, int offset,
450 struct fp_info *p_fp_info);
451 static int dissect_hsdpa_capacity_allocation_type_2(packet_info *pinfo, proto_tree *tree,
452 tvbuff_t *tvb, int offset);
453 static void dissect_common_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
454 int offset, struct fp_info *p_fp_info);
455 static int dissect_common_dynamic_pusch_assignment(packet_info *pinfo, proto_tree *tree,
456 tvbuff_t *tvb, int offset);
458 /* Dissect common channel types */
459 static void dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
460 int offset, struct fp_info *p_fp_info);
461 static void dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
462 int offset, struct fp_info *p_fp_info);
463 static void dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
464 int offset, struct fp_info *p_fp_info);
465 static void dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
466 int offset, struct fp_info *p_fp_info);
467 static void dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
468 int offset, struct fp_info *p_fp_info);
469 static void dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
470 int offset, struct fp_info *p_fp_info);
471 static void dissect_bch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
472 int offset, struct fp_info *p_fp_info);
473 static void dissect_iur_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
474 int offset, struct fp_info *p_fp_info);
475 static void dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
476 int offset, struct fp_info *p_fp_info);
477 static void dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
478 int offset, struct fp_info *p_fp_info);
481 /* Dissect DCH control messages */
482 static int dissect_dch_timing_adjustment(proto_tree *tree, packet_info *pinfo,
483 tvbuff_t *tvb, int offset);
484 static int dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
485 struct fp_info *p_fp_info);
486 static int dissect_dch_dl_synchronisation(proto_tree *tree, packet_info *pinfo,
487 tvbuff_t *tvb, int offset);
488 static int dissect_dch_ul_synchronisation(proto_tree *tree, packet_info *pinfo,
489 tvbuff_t *tvb, int offset);
490 static int dissect_dch_outer_loop_power_control(proto_tree *tree, packet_info *pinfo,
491 tvbuff_t *tvb, int offset);
492 static int dissect_dch_dl_node_synchronisation(proto_tree *tree, packet_info *pinfo,
493 tvbuff_t *tvb, int offset);
494 static int dissect_dch_ul_node_synchronisation(proto_tree *tree, packet_info *pinfo,
495 tvbuff_t *tvb, int offset);
496 static int dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinfo,
497 tvbuff_t *tvb, int offset);
498 static int dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo,
499 tvbuff_t *tvb, int offset, struct fp_info *p_fp_info);
500 static int dissect_dch_tnl_congestion_indication(proto_tree *tree, packet_info *pinfo,
501 tvbuff_t *tvb, int offset);
504 static void dissect_dch_control_frame(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
505 int offset, struct fp_info *p_fp_info);
508 /* Dissect a DCH channel */
509 static void dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
510 int offset, struct fp_info *p_fp_info);
512 /* Dissect dedicated channels */
513 static void dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
514 int offset, struct fp_info *p_fp_info,
517 static void dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
518 int offset, struct fp_info *p_fp_info,
519 int number_of_subframes,
522 /* Main dissection function */
523 static void dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
525 /* Protocol registration */
526 void proto_register_fp(void);
527 void proto_reg_handoff_fp(void);
530 static int get_tb_count(struct fp_info *p_fp_info)
532 int chan, tb_count = 0;
533 for (chan = 0; chan < p_fp_info->num_chans; chan++) {
534 tb_count += p_fp_info->chan_num_tbs[chan];
539 /* Dissect the TBs of a data frame */
540 static int dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
541 int offset, struct fp_info *p_fp_info,
542 dissector_handle_t *data_handle)
544 int chan, num_tbs = 0;
547 proto_item *tree_ti = NULL;
548 proto_tree *data_tree = NULL;
549 gboolean dissected = FALSE;
553 /* Add data subtree */
554 tree_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, FALSE);
555 proto_item_set_text(tree_ti, "TB data for %u chans", p_fp_info->num_chans);
556 data_tree = proto_item_add_subtree(tree_ti, ett_fp_data);
559 /* Now for the TB data */
560 for (chan=0; chan < p_fp_info->num_chans; chan++)
564 /* Clearly show channels with no TBs */
565 if (p_fp_info->chan_num_tbs[chan] == 0)
567 proto_item *no_tb_ti = proto_tree_add_uint(data_tree, hf_fp_chan_zero_tbs, tvb,
568 offset+(bit_offset/8),
570 proto_item_append_text(no_tb_ti, " (of size %d)",
571 p_fp_info->chan_tf_size[chan]);
572 PROTO_ITEM_SET_GENERATED(no_tb_ti);
575 /* Show TBs from non-empty channels */
576 pinfo->fd->subnum = chan; /* set subframe number to current TB */
577 for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++)
582 ti = proto_tree_add_item(data_tree, hf_fp_tb, tvb,
583 offset + (bit_offset/8),
584 ((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8,
586 proto_item_set_text(ti, "TB (chan %u, tb %u, %u bits)",
587 chan+1, n+1, p_fp_info->chan_tf_size[chan]);
589 if (preferences_call_mac_dissectors && data_handle &&
590 p_fp_info->chan_tf_size[chan] > 0) {
592 next_tvb = tvb_new_subset(tvb, offset + bit_offset/8,
593 ((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8, -1);
594 /* TODO: maybe this decision can be based only on info available in fp_info */
595 call_dissector(*data_handle, next_tvb, pinfo, top_level_tree);
600 /* Advance bit offset */
601 bit_offset += p_fp_info->chan_tf_size[chan];
602 data_bits += p_fp_info->chan_tf_size[chan];
604 /* Pad out to next byte */
607 bit_offset += (8 - (bit_offset % 8));
612 if (dissected == FALSE) {
613 col_append_fstr(pinfo->cinfo, COL_INFO, "(%u bits in %u tbs)",
617 /* Data tree should cover entire length */
619 proto_item_set_len(tree_ti, bit_offset/8);
620 proto_item_append_text(tree_ti, " (%u bits in %u tbs)", data_bits, num_tbs);
623 /* Move offset past TBs (we know its already padded out to next byte) */
624 offset += (bit_offset / 8);
630 /* Dissect the MAC-d PDUs of an HS-DSCH (type 1) frame.
631 Length is in bits, and payload is offset by 4 bits of padding */
632 static int dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
633 int offset, guint16 length, guint16 number_of_pdus)
637 proto_item *pdus_ti = NULL;
638 proto_tree *data_tree = NULL;
639 gboolean dissected = FALSE;
641 /* Add data subtree */
644 pdus_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, FALSE);
645 proto_item_set_text(pdus_ti, "%u MAC-d PDUs of %u bits", number_of_pdus, length);
646 data_tree = proto_item_add_subtree(pdus_ti, ett_fp_data);
649 /* Now for the PDUs */
650 for (pdu=0; pdu < number_of_pdus; pdu++) {
654 /* Show 4 bits padding at start of PDU */
655 proto_tree_add_item(data_tree, hf_fp_hsdsch_data_padding, tvb, offset+(bit_offset/8), 1, FALSE);
661 pinfo->fd->subnum = pdu; /* set subframe number to current TB */
662 pdu_ti = proto_tree_add_item(data_tree, hf_fp_mac_d_pdu, tvb,
663 offset + (bit_offset/8),
664 ((bit_offset % 8) + length + 7) / 8,
666 proto_item_set_text(pdu_ti, "MAC-d PDU (PDU %u)", pdu+1);
668 if (preferences_call_mac_dissectors) {
670 next_tvb = tvb_new_subset(tvb, offset + bit_offset/8,
671 ((bit_offset % 8) + length + 7)/8, -1);
672 call_dissector(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree);
676 /* Advance bit offset */
677 bit_offset += length;
679 /* Pad out to next byte */
682 bit_offset += (8 - (bit_offset % 8));
686 /* Data tree should cover entire length */
687 proto_item_set_len(pdus_ti, bit_offset/8);
689 /* Move offset past PDUs (we know its already padded out to next byte) */
690 offset += (bit_offset / 8);
692 /* Show summary in info column */
693 if (dissected == FALSE) {
694 col_append_fstr(pinfo->cinfo, COL_INFO, " %u PDUs of %u bits",
695 number_of_pdus, length);
702 /* Dissect the MAC-d PDUs of an HS-DSCH (type 2) frame.
703 Length is in bytes, and payload is byte-aligned (no padding) */
704 static int dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
705 int offset, guint16 length, guint16 number_of_pdus)
708 proto_item *pdus_ti = NULL;
709 proto_tree *data_tree = NULL;
710 int first_offset = offset;
711 gboolean dissected = FALSE;
713 /* Add data subtree */
716 pdus_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, FALSE);
717 proto_item_set_text(pdus_ti, "%u MAC-d PDUs of %u bytes", number_of_pdus, length);
718 data_tree = proto_item_add_subtree(pdus_ti, ett_fp_data);
721 /* Now for the PDUs */
722 for (pdu=0; pdu < number_of_pdus; pdu++)
729 pdu_ti = proto_tree_add_item(data_tree, hf_fp_mac_d_pdu, tvb,
730 offset, length, FALSE);
731 proto_item_set_text(pdu_ti, "MAC-d PDU (PDU %u)", pdu+1);
732 if (preferences_call_mac_dissectors) {
733 tvbuff_t *next_tvb = tvb_new_subset(tvb, offset, length, -1);
734 call_dissector(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree);
743 /* Data tree should cover entire length */
744 proto_item_set_len(pdus_ti, offset-first_offset);
746 /* Show summary in info column */
748 col_append_fstr(pinfo->cinfo, COL_INFO, " %u PDUs of %u bits",
749 number_of_pdus, length*8);
755 /* Dissect CRCI bits (uplink) */
756 static int dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
757 fp_info *p_fp_info, int offset)
760 proto_item *ti = NULL;
761 proto_tree *crcis_tree = NULL;
764 num_tbs = get_tb_count(p_fp_info);
766 /* Add CRCIs subtree */
769 ti = proto_tree_add_item(tree, hf_fp_crcis, tvb, offset, (num_tbs+7)/8, FALSE);
770 proto_item_set_text(ti, "CRCI bits for %u tbs", num_tbs);
771 crcis_tree = proto_item_add_subtree(ti, ett_fp_crcis);
775 for (n=0; n < num_tbs; n++)
777 int bit = (tvb_get_guint8(tvb, offset+(n/8)) >> (7-(n%8))) & 0x01;
778 proto_tree_add_item(crcis_tree, hf_fp_crci[n%8], tvb, offset+(n/8),
784 expert_add_info_format(pinfo, ti,
785 PI_CHECKSUM, PI_WARN,
786 "CRCI error bit set for TB");
792 /* Highlight range of bytes covered by indicator bits */
793 proto_item_set_len(ti, (num_tbs+7) / 8);
795 /* Show error count in root text */
796 proto_item_append_text(ti, " (%u errors)", errors);
799 offset += ((num_tbs+7) / 8);
804 static void dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo,
805 proto_tree *tree, guint8 dch_crc_present,
809 int remain = tvb_length_remaining(tvb, offset);
810 proto_item *ti = NULL;
812 /* Payload CRC (optional) */
813 if (dch_crc_present == 1 || (dch_crc_present == 2 && remain >= 2))
818 if (remain > crc_size)
820 ti = proto_tree_add_item(tree, hf_fp_spare_extension, tvb,
821 offset, remain-crc_size, FALSE);
822 proto_item_append_text(ti, " (%u octets)", remain-crc_size);
823 expert_add_info_format(pinfo, ti,
824 PI_UNDECODED, PI_WARN,
825 "Spare Extension present (%u bytes)", remain-crc_size);
826 offset += remain-crc_size;
831 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, crc_size,
838 /***********************************************************/
839 /* Common control message types */
841 int dissect_common_outer_loop_power_control(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
842 int offset, struct fp_info *p_fp_info _U_)
844 return dissect_dch_outer_loop_power_control(tree, pinfo, tvb, offset);
848 int dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
849 int offset, struct fp_info *p_fp_info)
851 if (p_fp_info->channel != CHANNEL_PCH)
857 cfn = tvb_get_guint8(tvb, offset);
858 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
862 toa = tvb_get_ntohs(tvb, offset);
863 proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, FALSE);
866 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u, ToA=%d", cfn, toa);
873 /* PCH CFN is 12 bits */
874 cfn = (tvb_get_ntohs(tvb, offset) >> 4);
875 proto_tree_add_item(tree, hf_fp_pch_cfn, tvb, offset, 2, FALSE);
878 /* 4 bits of padding follow... */
880 /* 20 bits of ToA (followed by 4 padding bits) */
881 toa = ((int)(tvb_get_ntoh24(tvb, offset) << 8)) / 4096;
882 proto_tree_add_int(tree, hf_fp_pch_toa, tvb, offset, 3, toa);
885 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u, ToA=%d", cfn, toa);
890 static int dissect_common_dl_node_synchronisation(packet_info *pinfo, proto_tree *tree,
891 tvbuff_t *tvb, int offset)
894 guint32 t1 = tvb_get_ntoh24(tvb, offset);
895 proto_tree_add_item(tree, hf_fp_t1, tvb, offset, 3, FALSE);
898 col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%u", t1);
903 static int dissect_common_ul_node_synchronisation(packet_info *pinfo, proto_tree *tree,
904 tvbuff_t *tvb, int offset)
909 t1 = tvb_get_ntoh24(tvb, offset);
910 proto_tree_add_item(tree, hf_fp_t1, tvb, offset, 3, FALSE);
914 t2 = tvb_get_ntoh24(tvb, offset);
915 proto_tree_add_item(tree, hf_fp_t2, tvb, offset, 3, FALSE);
919 t3 = tvb_get_ntoh24(tvb, offset);
920 proto_tree_add_item(tree, hf_fp_t3, tvb, offset, 3, FALSE);
923 col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%u T2=%u, T3=%u",
929 static int dissect_common_dl_synchronisation(packet_info *pinfo, proto_tree *tree,
930 tvbuff_t *tvb, int offset, struct fp_info *p_fp_info)
934 if (p_fp_info->channel != CHANNEL_PCH)
937 cfn = tvb_get_guint8(tvb, offset);
938 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
943 /* PCH CFN is 12 bits */
944 cfn = (tvb_get_ntohs(tvb, offset) >> 4);
945 proto_tree_add_item(tree, hf_fp_pch_cfn, tvb, offset, 2, FALSE);
947 /* 4 bits of padding follow... */
951 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u", cfn);
956 static int dissect_common_ul_synchronisation(packet_info *pinfo, proto_tree *tree,
957 tvbuff_t *tvb, int offset, struct fp_info *p_fp_info)
959 return dissect_common_timing_adjustment(pinfo, tree, tvb, offset, p_fp_info);
962 static int dissect_common_timing_advance(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
965 guint16 timing_advance;
968 cfn = tvb_get_guint8(tvb, offset);
969 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
973 timing_advance = (tvb_get_guint8(tvb, offset) & 0x3f) * 4;
974 proto_tree_add_uint(tree, hf_fp_timing_advance, tvb, offset, 1, timing_advance);
977 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, TA = %u",
978 cfn, timing_advance);
983 static int dissect_hsdpa_capacity_request(packet_info *pinfo, proto_tree *tree,
984 tvbuff_t *tvb, int offset)
987 guint16 user_buffer_size;
990 priority = (tvb_get_guint8(tvb, offset) & 0x0f);
991 proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, FALSE);
994 /* User buffer size */
995 user_buffer_size = tvb_get_ntohs(tvb, offset);
996 proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, FALSE);
999 col_append_fstr(pinfo->cinfo, COL_INFO, " CmCH-PI=%u User-Buffer-Size=%u",
1000 priority, user_buffer_size);
1005 static int dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree,
1006 tvbuff_t *tvb, int offset,
1007 struct fp_info *p_fp_info)
1010 proto_item *rate_ti;
1011 guint16 max_pdu_length;
1012 guint8 repetition_period;
1016 /* Congestion status (introduced sometime during R6...) */
1017 if ((p_fp_info->release == 6) || (p_fp_info->release == 7))
1019 proto_tree_add_bits_item(tree, hf_fp_congestion_status, tvb,
1020 offset*8 + 2, 2, FALSE);
1024 proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, FALSE);
1027 /* Max MAC-d PDU length (13 bits) */
1028 max_pdu_length = tvb_get_ntohs(tvb, offset) >> 3;
1029 proto_tree_add_item(tree, hf_fp_hsdsch_max_macd_pdu_len, tvb, offset, 2, FALSE);
1032 /* HS-DSCH credits (11 bits) */
1033 ti = proto_tree_add_bits_ret_val(tree, hf_fp_hsdsch_credits, tvb,
1034 offset*8 + 5, 11, &credits, FALSE);
1037 /* Interesting values */
1040 proto_item_append_text(ti, " (stop transmission)");
1041 expert_add_info_format(pinfo, ti,
1042 PI_RESPONSE_CODE, PI_NOTE,
1043 "Stop HSDPA transmission");
1045 if (credits == 2047)
1047 proto_item_append_text(ti, " (unlimited)");
1050 /* HS-DSCH Interval */
1051 interval = tvb_get_guint8(tvb, offset);
1052 ti = proto_tree_add_uint(tree, hf_fp_hsdsch_interval, tvb, offset, 1, interval*10);
1056 proto_item_append_text(ti, " (none of the credits shall be used)");
1059 /* HS-DSCH Repetition period */
1060 repetition_period = tvb_get_guint8(tvb, offset);
1061 ti = proto_tree_add_item(tree, hf_fp_hsdsch_repetition_period, tvb, offset, 1, FALSE);
1063 if (repetition_period == 0)
1065 proto_item_append_text(ti, " (unlimited repetition period)");
1068 /* Calculated and show effective rate enabled */
1069 if (credits == 2047)
1071 rate_ti = proto_tree_add_item(tree, hf_fp_hsdsch_unlimited_rate, tvb, 0, 0, FALSE);
1072 PROTO_ITEM_SET_GENERATED(rate_ti);
1078 /* Cast on credits is safe, since we know it won't exceed 10^11 */
1079 rate_ti = proto_tree_add_uint(tree, hf_fp_hsdsch_calculated_rate, tvb, 0, 0,
1080 (guint16)credits * max_pdu_length * (1000 / (interval*10)));
1081 PROTO_ITEM_SET_GENERATED(rate_ti);
1085 col_append_fstr(pinfo->cinfo, COL_INFO,
1086 " Max-PDU-len=%u Credits=%u Interval=%u Rep-Period=%u",
1087 max_pdu_length, (guint16)credits, interval, repetition_period);
1092 static int dissect_hsdpa_capacity_allocation_type_2(packet_info *pinfo, proto_tree *tree,
1093 tvbuff_t *tvb, int offset)
1096 proto_item *rate_ti;
1097 guint16 max_pdu_length;
1098 guint8 repetition_period;
1102 /* Congestion status */
1103 proto_tree_add_bits_item(tree, hf_fp_congestion_status, tvb,
1104 offset*8 + 2, 2, FALSE);
1107 proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, FALSE);
1110 /* 5 spare bits follow here */
1112 /* Max MAC-d/c PDU length (11 bits) */
1113 max_pdu_length = tvb_get_ntohs(tvb, offset) & 0x7ff;
1114 proto_tree_add_item(tree, hf_fp_hsdsch_max_macdc_pdu_len, tvb, offset, 2, FALSE);
1117 /* HS-DSCH credits (16 bits) */
1118 credits = (tvb_get_ntohs(tvb, offset));
1119 ti = proto_tree_add_uint(tree, hf_fp_hsdsch_credits, tvb,
1120 offset, 2, credits);
1123 /* Interesting values */
1126 proto_item_append_text(ti, " (stop transmission)");
1127 expert_add_info_format(pinfo, ti,
1128 PI_RESPONSE_CODE, PI_NOTE,
1129 "Stop HSDPA transmission");
1131 if (credits == 65535)
1133 proto_item_append_text(ti, " (unlimited)");
1136 /* HS-DSCH Interval */
1137 interval = tvb_get_guint8(tvb, offset);
1138 ti = proto_tree_add_uint(tree, hf_fp_hsdsch_interval, tvb, offset, 1, interval*10);
1142 proto_item_append_text(ti, " (none of the credits shall be used)");
1145 /* HS-DSCH Repetition period */
1146 repetition_period = tvb_get_guint8(tvb, offset);
1147 ti = proto_tree_add_item(tree, hf_fp_hsdsch_repetition_period, tvb, offset, 1, FALSE);
1149 if (repetition_period == 0)
1151 proto_item_append_text(ti, " (unlimited repetition period)");
1154 /* Calculated and show effective rate enabled */
1155 if (credits == 65535)
1157 rate_ti = proto_tree_add_item(tree, hf_fp_hsdsch_unlimited_rate, tvb, 0, 0, FALSE);
1158 PROTO_ITEM_SET_GENERATED(rate_ti);
1164 rate_ti = proto_tree_add_uint(tree, hf_fp_hsdsch_calculated_rate, tvb, 0, 0,
1165 credits * max_pdu_length * (1000 / (interval*10)));
1166 PROTO_ITEM_SET_GENERATED(rate_ti);
1170 col_append_fstr(pinfo->cinfo, COL_INFO,
1171 " Max-PDU-len=%u Credits=%u Interval=%u Rep-Period=%u",
1172 max_pdu_length, credits, interval, repetition_period);
1179 static int dissect_common_dynamic_pusch_assignment(packet_info *pinfo, proto_tree *tree,
1180 tvbuff_t *tvb, int offset)
1182 guint8 pusch_set_id;
1183 guint8 activation_cfn;
1187 pusch_set_id = tvb_get_guint8(tvb, offset);
1188 proto_tree_add_item(tree, hf_fp_pusch_set_id, tvb, offset, 1, FALSE);
1191 /* Activation CFN */
1192 activation_cfn = tvb_get_guint8(tvb, offset);
1193 proto_tree_add_item(tree, hf_fp_activation_cfn, tvb, offset, 1, FALSE);
1197 duration = tvb_get_guint8(tvb, offset) * 10;
1198 proto_tree_add_uint(tree, hf_fp_duration, tvb, offset, 1, duration);
1201 col_append_fstr(pinfo->cinfo, COL_INFO,
1202 " PUSCH Set Id=%u Activation CFN=%u Duration=%u",
1203 pusch_set_id, activation_cfn, duration);
1212 /* Dissect the control part of a common channel message */
1213 static void dissect_common_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1214 int offset, struct fp_info *p_fp_info)
1216 /* Common control frame type */
1217 guint8 control_frame_type = tvb_get_guint8(tvb, offset);
1218 proto_tree_add_item(tree, hf_fp_common_control_frame_type, tvb, offset, 1, FALSE);
1221 col_append_str(pinfo->cinfo, COL_INFO,
1222 val_to_str(control_frame_type, common_control_frame_type_vals, "Unknown"));
1224 /* Frame-type specific dissection */
1225 switch (control_frame_type)
1227 case COMMON_OUTER_LOOP_POWER_CONTROL:
1228 offset = dissect_common_outer_loop_power_control(pinfo, tree, tvb, offset, p_fp_info);
1230 case COMMON_TIMING_ADJUSTMENT:
1231 offset = dissect_common_timing_adjustment(pinfo, tree, tvb, offset, p_fp_info);
1233 case COMMON_DL_SYNCHRONISATION:
1234 offset = dissect_common_dl_synchronisation(pinfo, tree, tvb, offset, p_fp_info);
1236 case COMMON_UL_SYNCHRONISATION:
1237 offset = dissect_common_ul_synchronisation(pinfo, tree, tvb, offset, p_fp_info);
1239 case COMMON_DL_NODE_SYNCHRONISATION:
1240 offset = dissect_common_dl_node_synchronisation(pinfo, tree, tvb, offset);
1242 case COMMON_UL_NODE_SYNCHRONISATION:
1243 offset = dissect_common_ul_node_synchronisation(pinfo, tree, tvb, offset);
1245 case COMMON_DYNAMIC_PUSCH_ASSIGNMENT:
1246 offset = dissect_common_dynamic_pusch_assignment(pinfo, tree, tvb, offset);
1248 case COMMON_TIMING_ADVANCE:
1249 offset = dissect_common_timing_advance(pinfo, tree, tvb, offset);
1251 case COMMON_HS_DSCH_Capacity_Request:
1252 offset = dissect_hsdpa_capacity_request(pinfo, tree, tvb, offset);
1254 case COMMON_HS_DSCH_Capacity_Allocation:
1255 offset = dissect_hsdpa_capacity_allocation(pinfo, tree, tvb, offset, p_fp_info);
1257 case COMMON_HS_DSCH_Capacity_Allocation_Type_2:
1258 offset = dissect_hsdpa_capacity_allocation_type_2(pinfo, tree, tvb, offset);
1265 /* Spare Extension */
1266 dissect_spare_extension_and_crc(tvb, pinfo, tree, 0, offset);
1271 /**************************/
1272 /* Dissect a RACH channel */
1273 static void dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1274 int offset, struct fp_info *p_fp_info)
1276 gboolean is_control_frame;
1279 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1282 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1283 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1286 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1288 if (is_control_frame)
1290 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1295 guint32 propagation_delay = 0;
1296 proto_item *propagation_delay_ti = NULL;
1297 guint32 received_sync_ul_timing_deviation = 0;
1298 proto_item *received_sync_ul_timing_deviation_ti = NULL;
1299 proto_item *rx_timing_deviation_ti = NULL;
1300 guint16 rx_timing_deviation = 0;
1305 cfn = tvb_get_guint8(tvb, offset);
1306 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1309 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1312 proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, FALSE);
1315 if (p_fp_info->channel == CHANNEL_RACH_FDD)
1317 /* Propagation delay */
1318 propagation_delay = tvb_get_guint8(tvb, offset);
1319 propagation_delay_ti = proto_tree_add_uint(tree, hf_fp_propagation_delay, tvb, offset, 1,
1320 propagation_delay*3);
1324 /* Should be TDD 3.84 or 7.68 */
1325 if (p_fp_info->channel == CHANNEL_RACH_TDD)
1327 /* Rx Timing Deviation */
1328 rx_timing_deviation = tvb_get_guint8(tvb, offset);
1329 rx_timing_deviation_ti = proto_tree_add_item(tree, hf_fp_rx_timing_deviation, tvb, offset, 1, FALSE);
1333 if (p_fp_info->channel == CHANNEL_RACH_TDD_128)
1335 /* Received SYNC UL Timing Deviation */
1336 received_sync_ul_timing_deviation = tvb_get_guint8(tvb, offset);
1337 received_sync_ul_timing_deviation_ti =
1338 proto_tree_add_item(tree, hf_fp_received_sync_ul_timing_deviation, tvb, offset, 1, FALSE);
1343 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &mac_fdd_rach_handle);
1346 offset = dissect_crci_bits(tvb, pinfo, tree, p_fp_info, offset);
1348 /* Info introduced in R6 */
1349 /* only check if it looks as if they are present */
1350 if (((p_fp_info->release == 6) || (p_fp_info->release == 7)) &&
1351 tvb_length_remaining(tvb, offset) > 2)
1355 /* guint8 flag_bytes = 0; */
1357 gboolean cell_portion_id_present = FALSE;
1358 gboolean ext_propagation_delay_present = FALSE;
1359 gboolean angle_of_arrival_present = FALSE;
1360 gboolean ext_rx_sync_ul_timing_deviation_present = FALSE;
1361 gboolean ext_rx_timing_deviation_present = FALSE;
1363 /* New IE flags (assume mandatory for now) */
1366 proto_item *new_ie_flags_ti;
1367 proto_tree *new_ie_flags_tree;
1368 guint ies_found = 0;
1370 /* Add new IE flags subtree */
1371 new_ie_flags_ti = proto_tree_add_string_format(tree, hf_fp_rach_new_ie_flags, tvb, offset, 1,
1372 "", "New IE flags");
1373 new_ie_flags_tree = proto_item_add_subtree(new_ie_flags_ti, ett_fp_rach_new_ie_flags);
1375 /* Read next byte */
1376 flags = tvb_get_guint8(tvb, offset);
1379 /* Dissect individual bits */
1380 for (n=0; n < 8; n++)
1384 switch (p_fp_info->division)
1387 /* Ext propagation delay */
1388 ext_propagation_delay_present = TRUE;
1389 proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_propagation_delay_present,
1390 tvb, offset, 1, FALSE);
1392 case Division_TDD_128:
1393 /* Ext Rx Sync UL Timing */
1394 ext_rx_sync_ul_timing_deviation_present = TRUE;
1395 proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_rx_sync_ul_timing_deviation_present,
1396 tvb, offset, 1, FALSE);
1401 proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_new_ie_flag_unused[6],
1402 tvb, offset, 1, FALSE);
1407 switch (p_fp_info->division)
1410 /* Cell Portion ID */
1411 cell_portion_id_present = TRUE;
1412 proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_cell_portion_id_present,
1413 tvb, offset, 1, FALSE);
1415 case Division_TDD_128:
1417 angle_of_arrival_present = TRUE;
1418 proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_angle_of_arrival_present,
1419 tvb, offset, 1, FALSE);
1421 case Division_TDD_384:
1422 case Division_TDD_768:
1423 /* Extended Rx Timing Deviation */
1424 ext_rx_timing_deviation_present = TRUE;
1425 proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_rx_timing_deviation_present,
1426 tvb, offset, 1, FALSE);
1432 /* No defined meanings */
1433 /* Visual Studio Code Analyzer wrongly thinks n can be 7 here. It can't */
1434 proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_new_ie_flag_unused[n],
1435 tvb, offset, 1, FALSE);
1438 if ((flags >> (7-n)) & 0x01)
1445 proto_item_append_text(new_ie_flags_ti, " (%u IEs found)", ies_found);
1447 /* Last bit set will indicate another flags byte follows... */
1448 } while (0); /*((flags & 0x01) && (flag_bytes < 31));*/
1450 /* Cell Portion ID */
1451 if (cell_portion_id_present) {
1452 proto_tree_add_item(tree, hf_fp_cell_portion_id, tvb, offset, 1, FALSE);
1456 /* Ext Rx Timing Deviation */
1457 if (ext_rx_timing_deviation_present)
1460 guint bits_to_extend;
1461 switch (p_fp_info->division)
1463 case Division_TDD_384:
1466 case Division_TDD_768:
1471 /* TODO: report unexpected division type */
1475 extra_bits = tvb_get_guint8(tvb, offset) &
1476 ((bits_to_extend == 1) ? 0x01 : 0x03);
1477 rx_timing_deviation = (extra_bits << 8) | (rx_timing_deviation);
1478 proto_item_append_text(rx_timing_deviation_ti,
1479 " (extended to 0x%x)",
1480 rx_timing_deviation);
1481 proto_tree_add_bits_item(tree, hf_fp_extended_bits, tvb,
1482 offset*8 + (8-bits_to_extend), bits_to_extend, FALSE);
1486 /* Ext propagation delay. */
1487 if (ext_propagation_delay_present)
1489 guint16 extra_bits = tvb_get_ntohs(tvb, offset) & 0x03ff;
1490 proto_tree_add_item(tree, hf_fp_ext_propagation_delay, tvb, offset, 2, FALSE);
1492 /* Adding 10 bits to original 8 */
1493 proto_item_append_text(propagation_delay_ti, " (extended to %u)",
1494 ((extra_bits << 8) | propagation_delay) * 3);
1498 /* Angle of Arrival (AOA) */
1499 if (angle_of_arrival_present)
1501 proto_tree_add_item(tree, hf_fp_angle_of_arrival, tvb, offset, 2, FALSE);
1505 /* Ext. Rx Sync UL Timing Deviation */
1506 if (ext_rx_sync_ul_timing_deviation_present) {
1509 /* Ext received Sync UL Timing Deviation */
1510 extra_bits = tvb_get_ntohs(tvb, offset) & 0x1fff;
1511 proto_tree_add_item(tree, hf_fp_ext_received_sync_ul_timing_deviation, tvb, offset, 2, FALSE);
1513 /* Adding 13 bits to original 8 */
1514 proto_item_append_text(received_sync_ul_timing_deviation_ti, " (extended to %u)",
1515 (extra_bits << 8) | received_sync_ul_timing_deviation);
1520 /* Spare Extension and Payload CRC */
1521 dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset);
1526 /**************************/
1527 /* Dissect a FACH channel */
1528 static void dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1529 int offset, struct fp_info *p_fp_info)
1531 gboolean is_control_frame;
1534 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1537 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1538 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1541 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1543 if (is_control_frame)
1545 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1554 cfn = tvb_get_guint8(tvb, offset);
1555 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1558 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1561 proto_tree_add_item(tree, hf_fp_fach_tfi, tvb, offset, 1, FALSE);
1564 /* Transmit power level */
1565 proto_tree_add_float(tree, hf_fp_transmit_power_level, tvb, offset, 1,
1566 (float)(int)(tvb_get_guint8(tvb, offset)) / 10);
1570 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &mac_fdd_fach_handle);
1572 /* New IE flags (if it looks as though they are present) */
1573 if ((p_fp_info->release == 7) &&
1574 (tvb_length_remaining(tvb, offset) > 2))
1576 guint8 flags = tvb_get_guint8(tvb, offset);
1577 guint8 aoa_present = flags & 0x01;
1582 proto_tree_add_item(tree, hf_fp_angle_of_arrival, tvb, offset, 2, FALSE);
1587 /* Spare Extension and Payload CRC */
1588 dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset);
1593 /**************************/
1594 /* Dissect a DSCH channel */
1595 static void dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1596 int offset, struct fp_info *p_fp_info)
1598 gboolean is_control_frame;
1601 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1604 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1605 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1608 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1610 if (is_control_frame)
1612 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1621 cfn = tvb_get_guint8(tvb, offset);
1622 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1625 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1628 proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, FALSE);
1632 /* Other fields depend upon release & FDD/TDD settings */
1633 if (((p_fp_info->release == 99) || (p_fp_info->release == 4)) &&
1634 (p_fp_info->channel == CHANNEL_DSCH_FDD))
1637 proto_tree_add_float(tree, hf_fp_power_offset, tvb, offset, 1,
1639 ((float)(int)(tvb_get_guint8(tvb, offset)) * (float)(0.25)));
1643 proto_tree_add_item(tree, hf_fp_code_number, tvb, offset, 1, FALSE);
1646 /* Spreading Factor (3 bits) */
1647 proto_tree_add_item(tree, hf_fp_spreading_factor, tvb, offset, 1, FALSE);
1649 /* MC info (4 bits)*/
1650 proto_tree_add_item(tree, hf_fp_mc_info, tvb, offset, 1, FALSE);
1652 /* Last bit of this byte is spare */
1660 proto_tree_add_item(tree, hf_fp_pdsch_set_id, tvb, offset, 1, FALSE);
1663 /* Transmit power level */
1664 proto_tree_add_float(tree, hf_fp_transmit_power_level, tvb, offset, 1,
1665 (float)(int)(tvb_get_guint8(tvb, offset)) / 10);
1670 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, NULL);
1672 /* Spare Extension and Payload CRC */
1673 dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset);
1678 /**************************/
1679 /* Dissect a USCH channel */
1680 static void dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1681 int offset, struct fp_info *p_fp_info)
1683 gboolean is_control_frame;
1686 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1689 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1690 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1693 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1695 if (is_control_frame)
1697 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1702 guint16 rx_timing_deviation;
1703 proto_item *rx_timing_deviation_ti;
1708 cfn = tvb_get_guint8(tvb, offset);
1709 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1712 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1715 proto_tree_add_item(tree, hf_fp_usch_tfi, tvb, offset, 1, FALSE);
1718 /* Rx Timing Deviation */
1719 rx_timing_deviation = tvb_get_guint8(tvb, offset);
1720 rx_timing_deviation_ti = proto_tree_add_item(tree, hf_fp_rx_timing_deviation,
1721 tvb, offset, 1, FALSE);
1725 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, NULL);
1728 proto_tree_add_item(tree, hf_fp_quality_estimate, tvb, offset, 1, FALSE);
1732 offset = dissect_crci_bits(tvb, pinfo, tree, p_fp_info, offset);
1735 if ((p_fp_info->release == 7) &&
1736 (tvb_length_remaining(tvb, offset) > 2))
1738 guint8 flags = tvb_get_guint8(tvb, offset);
1739 guint8 bits_extended = flags & 0x01;
1744 guint8 extra_bits = tvb_get_guint8(tvb, offset) & 0x03;
1745 proto_item_append_text(rx_timing_deviation_ti,
1746 " (extended to %u)",
1747 (rx_timing_deviation << 2) | extra_bits);
1752 /* Spare Extension and Payload CRC */
1753 dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset);
1759 /**************************/
1760 /* Dissect a PCH channel */
1761 static void dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1762 int offset, struct fp_info *p_fp_info)
1764 gboolean is_control_frame;
1766 gboolean paging_indication;
1769 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1772 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1773 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1776 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1778 if (is_control_frame)
1780 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1786 /* 12-bit CFN value */
1787 proto_tree_add_item(tree, hf_fp_pch_cfn, tvb, offset, 2, FALSE);
1788 pch_cfn = (tvb_get_ntohs(tvb, offset) & 0xfff0) >> 4;
1791 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%04u ", pch_cfn);
1793 /* Paging indication */
1794 proto_tree_add_item(tree, hf_fp_pch_pi, tvb, offset, 1, FALSE);
1795 paging_indication = tvb_get_guint8(tvb, offset) & 0x01;
1799 proto_tree_add_item(tree, hf_fp_pch_tfi, tvb, offset, 1, FALSE);
1802 /* Optional paging indications */
1803 if (paging_indication)
1806 ti = proto_tree_add_item(tree, hf_fp_paging_indication_bitmap, tvb,
1808 (p_fp_info->paging_indications+7) / 8,
1810 proto_item_append_text(ti, " (%u bits)", p_fp_info->paging_indications);
1811 offset += ((p_fp_info->paging_indications+7) / 8);
1815 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &mac_fdd_pch_handle);
1817 /* Spare Extension and Payload CRC */
1818 dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset);
1823 /**************************/
1824 /* Dissect a CPCH channel */
1825 static void dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1826 int offset, struct fp_info *p_fp_info)
1828 gboolean is_control_frame;
1831 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1834 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1835 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1838 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1840 if (is_control_frame)
1842 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1851 cfn = tvb_get_guint8(tvb, offset);
1852 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1855 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1858 proto_tree_add_item(tree, hf_fp_cpch_tfi, tvb, offset, 1, FALSE);
1861 /* Propagation delay */
1862 proto_tree_add_uint(tree, hf_fp_propagation_delay, tvb, offset, 1,
1863 tvb_get_guint8(tvb, offset) * 3);
1867 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, NULL);
1870 offset = dissect_crci_bits(tvb, pinfo, tree, p_fp_info, offset);
1872 /* Spare Extension and Payload CRC */
1873 dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset);
1878 /**************************/
1879 /* Dissect a BCH channel */
1880 static void dissect_bch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1881 int offset, struct fp_info *p_fp_info)
1883 gboolean is_control_frame;
1886 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1889 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1890 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1893 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1895 if (is_control_frame)
1897 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1902 /********************************/
1903 /* Dissect an IUR DSCH channel */
1904 static void dissect_iur_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1905 int offset, struct fp_info *p_fp_info)
1907 gboolean is_control_frame;
1910 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1913 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1914 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1917 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1919 if (is_control_frame)
1921 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1932 /************************/
1933 /* DCH control messages */
1935 static int dissect_dch_timing_adjustment(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1942 control_cfn = tvb_get_guint8(tvb, offset);
1943 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
1947 toa = tvb_get_ntohs(tvb, offset);
1948 toa_ti = proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, FALSE);
1951 expert_add_info_format(pinfo, toa_ti,
1952 PI_SEQUENCE, PI_WARN,
1953 "Timing adjustmentment reported (%f ms)",
1956 col_append_fstr(pinfo->cinfo, COL_INFO,
1957 " CFN = %u, ToA = %d", control_cfn, toa);
1962 static int dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
1963 tvbuff_t *tvb, int offset,
1964 struct fp_info *p_fp_info)
1966 guint16 timing_deviation = 0;
1967 gint timing_deviation_chips = 0;
1968 proto_item *timing_deviation_ti = NULL;
1971 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
1974 /* Rx Timing Deviation */
1975 timing_deviation = tvb_get_guint8(tvb, offset);
1976 timing_deviation_ti = proto_tree_add_item(tree, hf_fp_dch_rx_timing_deviation, tvb, offset, 1, FALSE);
1979 /* May be extended in R7, but in this case there are at least 2 bytes remaining */
1980 if ((p_fp_info->release == 7) &&
1981 (tvb_length_remaining(tvb, offset) >= 2))
1984 guint64 extended_bits_present;
1985 guint64 e_rucch_present;
1988 proto_tree_add_bits_ret_val(tree, hf_fp_e_rucch_present, tvb,
1989 offset*8 + 6, 1, &e_rucch_present, FALSE);
1990 proto_tree_add_bits_ret_val(tree, hf_fp_extended_bits_present, tvb,
1991 offset*8 + 7, 1, &extended_bits_present, FALSE);
1994 /* Optional E-RUCCH */
1995 if (e_rucch_present)
1997 /* Value of bit_offset depends upon division type */
2000 switch (p_fp_info->division)
2002 case Division_TDD_384:
2005 case Division_TDD_768:
2010 proto_item *ti = proto_tree_add_text(tree, tvb, 0, 0,
2011 "Error: expecting TDD-384 or TDD-768");
2012 PROTO_ITEM_SET_GENERATED(ti);
2013 expert_add_info_format(pinfo, ti,
2014 PI_MALFORMED, PI_NOTE,
2015 "Error: expecting TDD-384 or TDD-768");
2020 proto_tree_add_item(tree, hf_fp_dch_e_rucch_flag, tvb, offset, 1, FALSE);
2021 proto_tree_add_bits_item(tree, hf_fp_dch_e_rucch_flag, tvb,
2022 offset*8 + bit_offset, 1, FALSE);
2025 /* Timing deviation may be extended by another:
2026 - 1 bits (3.84 TDD) OR
2029 if (extended_bits_present)
2032 guint bits_to_extend;
2033 switch (p_fp_info->division)
2035 case Division_TDD_384:
2038 case Division_TDD_768:
2043 /* TODO: report unexpected division type */
2047 extra_bits = tvb_get_guint8(tvb, offset) &
2048 ((bits_to_extend == 1) ? 0x01 : 0x03);
2049 timing_deviation = (extra_bits << 8) | (timing_deviation);
2050 proto_item_append_text(timing_deviation_ti,
2051 " (extended to 0x%x)",
2053 proto_tree_add_bits_item(tree, hf_fp_extended_bits, tvb,
2054 offset*8 + (8-bits_to_extend), bits_to_extend, FALSE);
2059 timing_deviation_chips = (timing_deviation*4) - 1024;
2060 proto_item_append_text(timing_deviation_ti, " (%d chips)",
2061 timing_deviation_chips);
2063 col_append_fstr(pinfo->cinfo, COL_INFO, " deviation = %u (%d chips)",
2064 timing_deviation, timing_deviation_chips);
2069 static int dissect_dch_dl_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
2072 guint cfn = tvb_get_guint8(tvb, offset);
2073 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
2076 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u", cfn);
2081 static int dissect_dch_ul_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
2087 cfn = tvb_get_guint8(tvb, offset);
2088 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
2092 toa = tvb_get_ntohs(tvb, offset);
2093 proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, FALSE);
2096 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, ToA = %d",
2102 static int dissect_dch_outer_loop_power_control(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
2105 float target = (float)-8.2 + ((float)0.1 * (float)(int)(tvb_get_guint8(tvb, offset)));
2106 proto_tree_add_float(tree, hf_fp_ul_sir_target, tvb, offset, 1, target);
2109 col_append_fstr(pinfo->cinfo, COL_INFO, " UL SIR Target = %f", target);
2114 static int dissect_dch_dl_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
2116 return dissect_common_dl_node_synchronisation(pinfo, tree, tvb, offset);
2119 static int dissect_dch_ul_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
2121 return dissect_common_ul_node_synchronisation(pinfo, tree, tvb, offset);
2124 static int dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
2129 /* Show defined flags in these 2 bytes */
2130 for (n=4; n >= 0; n--)
2132 proto_tree_add_item(tree, hf_fp_radio_interface_parameter_update_flag[n], tvb, offset, 2, FALSE);
2137 tvb_get_guint8(tvb, offset);
2138 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
2142 proto_tree_add_item(tree, hf_fp_dpc_mode, tvb, offset, 1, FALSE);
2145 proto_tree_add_item(tree, hf_fp_tpc_po, tvb, offset, 1, FALSE);
2148 /* Multiple RL sets indicator */
2149 proto_tree_add_item(tree, hf_fp_multiple_rl_set_indicator, tvb, offset, 1, FALSE);
2153 value = (tvb_get_guint8(tvb, offset) & 0x7f);
2154 proto_tree_add_int(tree, hf_fp_max_ue_tx_pow, tvb, offset, 1, -55 + value);
2160 static int dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo,
2161 tvbuff_t *tvb, int offset, struct fp_info *p_fp_info)
2164 guint16 timing_advance;
2165 proto_item *timing_advance_ti;
2168 cfn = tvb_get_guint8(tvb, offset);
2169 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
2172 /* Timing Advance */
2173 timing_advance = (tvb_get_guint8(tvb, offset) & 0x3f) * 4;
2174 timing_advance_ti = proto_tree_add_uint(tree, hf_fp_timing_advance, tvb, offset, 1, timing_advance);
2177 if ((p_fp_info->release == 7) &&
2178 (tvb_length_remaining(tvb, offset) > 0))
2181 guint8 flags = tvb_get_guint8(tvb, offset);
2182 guint8 extended_bits = flags & 0x01;
2187 guint8 extra_bit = tvb_get_guint8(tvb, offset) & 0x01;
2188 proto_item_append_text(timing_advance_ti, " (extended to %u)",
2189 (timing_advance << 1) | extra_bit);
2195 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, TA = %u",
2196 cfn, timing_advance);
2201 static int dissect_dch_tnl_congestion_indication(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
2205 /* Congestion status */
2206 proto_tree_add_bits_ret_val(tree, hf_fp_congestion_status, tvb,
2207 offset*8 + 6, 2, &status, FALSE);
2210 col_append_fstr(pinfo->cinfo, COL_INFO, " status = %s",
2211 val_to_str((guint16)status, congestion_status_vals, "unknown"));
2219 /* DCH control frame */
2220 static void dissect_dch_control_frame(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
2221 struct fp_info *p_fp_info)
2223 /* Control frame type */
2224 guint8 control_frame_type = tvb_get_guint8(tvb, offset);
2225 proto_tree_add_item(tree, hf_fp_dch_control_frame_type, tvb, offset, 1, FALSE);
2228 col_append_str(pinfo->cinfo, COL_INFO,
2229 val_to_str(control_frame_type,
2230 dch_control_frame_type_vals, "Unknown"));
2232 switch (control_frame_type)
2234 case DCH_TIMING_ADJUSTMENT:
2235 offset = dissect_dch_timing_adjustment(tree, pinfo, tvb, offset);
2237 case DCH_RX_TIMING_DEVIATION:
2238 offset = dissect_dch_rx_timing_deviation(pinfo, tree, tvb, offset, p_fp_info);
2240 case DCH_DL_SYNCHRONISATION:
2241 offset = dissect_dch_dl_synchronisation(tree, pinfo, tvb, offset);
2243 case DCH_UL_SYNCHRONISATION:
2244 offset = dissect_dch_ul_synchronisation(tree, pinfo, tvb, offset);
2246 case DCH_OUTER_LOOP_POWER_CONTROL:
2247 offset = dissect_dch_outer_loop_power_control(tree, pinfo, tvb, offset);
2249 case DCH_DL_NODE_SYNCHRONISATION:
2250 offset = dissect_dch_dl_node_synchronisation(tree, pinfo, tvb, offset);
2252 case DCH_UL_NODE_SYNCHRONISATION:
2253 offset = dissect_dch_ul_node_synchronisation(tree, pinfo, tvb, offset);
2255 case DCH_RADIO_INTERFACE_PARAMETER_UPDATE:
2256 offset = dissect_dch_radio_interface_parameter_update(tree, pinfo, tvb, offset);
2258 case DCH_TIMING_ADVANCE:
2259 offset = dissect_dch_timing_advance(tree, pinfo, tvb, offset, p_fp_info);
2261 case DCH_TNL_CONGESTION_INDICATION:
2262 offset = dissect_dch_tnl_congestion_indication(tree, pinfo, tvb, offset);
2266 /* Spare Extension */
2267 dissect_spare_extension_and_crc(tvb, pinfo, tree, 0, offset);
2270 /*******************************/
2271 /* Dissect a DCH channel */
2272 static void dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2273 int offset, struct fp_info *p_fp_info)
2275 gboolean is_control_frame;
2279 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
2282 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
2283 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
2286 col_append_str(pinfo->cinfo, COL_INFO,
2287 is_control_frame ? " [Control] " :
2288 ((p_fp_info->is_uplink) ? " [ULData] " :
2291 if (is_control_frame)
2293 /* DCH control frame */
2294 dissect_dch_control_frame(tree, pinfo, tvb, offset, p_fp_info);
2298 /************************/
2303 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
2304 cfn = tvb_get_guint8(tvb, offset);
2307 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
2309 /* One TFI for each channel */
2310 for (chan=0; chan < p_fp_info->num_chans; chan++)
2312 proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, FALSE);
2316 /* Dissect TB data */
2317 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &mac_fdd_dch_handle);
2319 /* QE (uplink only) */
2320 if (p_fp_info->is_uplink)
2322 proto_tree_add_item(tree, hf_fp_quality_estimate, tvb, offset, 1, FALSE);
2326 /* CRCI bits (uplink only) */
2327 if (p_fp_info->is_uplink)
2329 offset = dissect_crci_bits(tvb, pinfo, tree, p_fp_info, offset);
2332 /* Spare extension and payload CRC (optional) */
2333 dissect_spare_extension_and_crc(tvb, pinfo, tree,
2334 p_fp_info->dch_crc_present, offset);
2340 /**********************************/
2341 /* Dissect an E-DCH channel */
2342 static void dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2343 int offset, struct fp_info *p_fp_info,
2346 gboolean is_control_frame;
2347 guint8 number_of_subframes;
2350 struct edch_t1_subframe_info subframes[16];
2352 if (p_fp_info->edch_type == 1) {
2353 col_append_str(pinfo->cinfo, COL_INFO, " (T2)");
2357 proto_tree_add_item(tree, hf_fp_edch_header_crc, tvb, offset, 2, FALSE);
2360 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
2361 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
2364 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
2366 if (is_control_frame)
2368 /* DCH control frame */
2369 dissect_dch_control_frame(tree, pinfo, tvb, offset, p_fp_info);
2373 /********************************/
2374 /* E-DCH data here */
2376 guint bit_offset = 0;
2377 guint total_pdus = 0;
2378 guint total_bits = 0;
2379 gboolean dissected = FALSE;
2382 proto_tree_add_item(tree, hf_fp_edch_fsn, tvb, offset, 1, FALSE);
2385 /* Number of subframes.
2386 This was 3 bits in early releases, is 4 bits offset by 1 in later releases */
2387 if ((p_fp_info->release >= 6) &&
2388 ((p_fp_info->release_year > 2005) ||
2389 (p_fp_info->release_year == 2005 && p_fp_info->release_month >= 9)))
2391 /* Use 4 bits plus offset of 1 */
2392 number_of_subframes = (tvb_get_guint8(tvb, offset) & 0x0f) + 1;
2396 /* Use 3 bits only */
2397 number_of_subframes = (tvb_get_guint8(tvb, offset) & 0x07);
2399 proto_tree_add_uint(tree, hf_fp_edch_number_of_subframes, tvb, offset, 1,
2400 number_of_subframes);
2405 cfn = tvb_get_guint8(tvb, offset);
2406 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
2409 /* Remainder of T2 or common data frames differ here... */
2410 if (p_fp_info->edch_type == 1) {
2411 dissect_e_dch_t2_or_common_channel_info(tvb, pinfo, tree, offset, p_fp_info,
2412 number_of_subframes, is_common);
2416 /* EDCH subframe header list */
2417 for (n=0; n < number_of_subframes; n++)
2420 int start_offset = offset;
2421 proto_item *subframe_header_ti;
2422 proto_tree *subframe_header_tree;
2424 /* Add subframe header subtree */
2425 subframe_header_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe_header, tvb, offset, 0,
2427 subframe_header_tree = proto_item_add_subtree(subframe_header_ti, ett_fp_edch_subframe_header);
2429 /* Number of HARQ Retransmissions */
2430 proto_tree_add_item(subframe_header_tree, hf_fp_edch_harq_retransmissions, tvb,
2433 /* Subframe number */
2434 subframes[n].subframe_number = (tvb_get_guint8(tvb, offset) & 0x07);
2435 proto_tree_add_bits_item(subframe_header_tree, hf_fp_edch_subframe_number, tvb,
2436 offset*8+5, 1, FALSE);
2439 /* Number of MAC-es PDUs */
2440 subframes[n].number_of_mac_es_pdus = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
2441 proto_tree_add_item(subframe_header_tree, hf_fp_edch_number_of_mac_es_pdus,
2442 tvb, offset, 1, FALSE);
2445 proto_item_append_text(subframe_header_ti, " %u header (%u MAC-es PDUs)",
2446 subframes[n].subframe_number,
2447 subframes[n].number_of_mac_es_pdus);
2449 /* Details of each MAC-es PDU */
2450 for (i=0; i < subframes[n].number_of_mac_es_pdus; i++)
2459 ddi_ti = proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_ddi, tvb,
2460 offset*8 + bit_offset, 6, &ddi, FALSE);
2462 /* Look up the size from this DDI value */
2463 for (p=0; p < p_fp_info->no_ddi_entries; p++)
2465 if (ddi == p_fp_info->edch_ddi[p])
2467 ddi_size = p_fp_info->edch_macd_pdu_size[p];
2473 expert_add_info_format(pinfo, ddi_ti,
2474 PI_MALFORMED, PI_ERROR,
2475 "DDI %u not defined for this UE!", (guint)ddi);
2480 proto_item_append_text(ddi_ti, " (%d bits)", ddi_size);
2483 subframes[n].ddi[i] = (guint8)ddi;
2486 /* Number of MAC-d PDUs (6 bits) */
2487 proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_number_of_mac_d_pdus, tvb,
2488 offset*8 + bit_offset, 6, &n_pdus, FALSE);
2490 subframes[n].number_of_mac_d_pdus[i] = (guint8)n_pdus;
2494 offset += ((bit_offset+7)/8);
2496 /* Tree should cover entire subframe header */
2497 proto_item_set_len(subframe_header_ti, offset - start_offset);
2500 /* EDCH subframes */
2502 for (n=0; n < number_of_subframes; n++)
2505 proto_item *subframe_ti;
2506 proto_tree *subframe_tree;
2507 guint bits_in_subframe = 0;
2508 guint mac_d_pdus_in_subframe = 0;
2512 /* Add subframe subtree */
2513 subframe_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe, tvb, offset, 0,
2514 "", "Subframe %u data", subframes[n].subframe_number);
2515 subframe_tree = proto_item_add_subtree(subframe_ti, ett_fp_edch_subframe);
2517 for (i=0; i < subframes[n].number_of_mac_es_pdus; i++)
2525 proto_tree *maces_tree = NULL;
2527 /* Look up mac-d pdu size for this ddi */
2528 for (m=0; m < p_fp_info->no_ddi_entries; m++)
2530 if (subframes[n].ddi[i] == p_fp_info->edch_ddi[m])
2532 size = p_fp_info->edch_macd_pdu_size[m];
2537 if (m == p_fp_info->no_ddi_entries)
2539 /* Not found. Oops */
2543 /* Send MAC-dd PDUs together as one MAC-es PDU */
2544 send_size = size * subframes[n].number_of_mac_d_pdus[i];
2547 proto_tree_add_item(subframe_tree, hf_fp_edch_pdu_padding, tvb,
2548 offset + (bit_offset/8),
2553 /* tsn = (tvb_get_guint8(tvb, offset + (bit_offset/8)) & 0x3f); */
2554 proto_tree_add_item(subframe_tree, hf_fp_edch_tsn, tvb,
2555 offset + (bit_offset/8),
2562 ti = proto_tree_add_item(subframe_tree, hf_fp_edch_mac_es_pdu, tvb,
2563 offset + (bit_offset/8),
2564 ((bit_offset % 8) + send_size + 7) / 8,
2566 proto_item_append_text(ti, " (%u * %u = %u bits, PDU %d)",
2567 size, subframes[n].number_of_mac_d_pdus[i],
2569 maces_tree = proto_item_add_subtree(ti, ett_fp_edch_maces);
2571 for (macd_idx = 0; macd_idx < subframes[n].number_of_mac_d_pdus[i]; macd_idx++) {
2573 if (preferences_call_mac_dissectors) {
2575 pinfo->fd->subnum = macd_idx; /* set subframe number to current TB */
2576 /* create new TVB and pass further on */
2577 next_tvb = tvb_new_subset(tvb, offset + bit_offset/8,
2578 ((bit_offset % 8) + size + 7) / 8, -1);
2579 /* TODO: use maces_tree? */
2580 call_dissector(mac_fdd_edch_handle, next_tvb, pinfo, top_level_tree);
2584 /* Just add as a MAC-d PDU */
2585 proto_tree_add_item(maces_tree, hf_fp_mac_d_pdu, tvb,
2586 offset + (bit_offset/8),
2587 ((bit_offset % 8) + size + 7) / 8,
2593 bits_in_subframe += send_size;
2594 mac_d_pdus_in_subframe += subframes[n].number_of_mac_d_pdus[i];
2596 /* Pad out to next byte */
2599 bit_offset += (8 - (bit_offset % 8));
2605 /* Tree should cover entire subframe */
2606 proto_item_set_len(subframe_ti, bit_offset/8);
2607 /* Append summary info to subframe label */
2608 proto_item_append_text(subframe_ti, " (%u bits in %u MAC-d PDUs)",
2609 bits_in_subframe, mac_d_pdus_in_subframe);
2611 total_pdus += mac_d_pdus_in_subframe;
2612 total_bits += bits_in_subframe;
2614 offset += (bit_offset/8);
2617 /* Report number of subframes in info column
2618 * do this only if no other dissector was called */
2619 if (dissected == FALSE)
2621 col_append_fstr(pinfo->cinfo, COL_INFO,
2622 " CFN = %03u (%u bits in %u pdus in %u subframes)",
2623 cfn, total_bits, total_pdus, number_of_subframes);
2626 /* Spare extension and payload CRC (optional) */
2627 dissect_spare_extension_and_crc(tvb, pinfo, tree,
2628 p_fp_info->dch_crc_present, offset);
2632 /* Dissect the remainder of the T2 or common frame that differs from T1 */
2633 static void dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2634 int offset, struct fp_info *p_fp_info,
2635 int number_of_subframes,
2640 static struct edch_t2_subframe_info subframes[16];
2641 guint64 total_macis_sdus;
2642 guint16 macis_sdus_found = 0;
2643 guint16 macis_pdus = 0;
2644 guint32 total_bytes = 0;
2645 gboolean F = TRUE; /* We want to continue loop if get E-RNTI indication... */
2646 proto_item *subframe_macis_descriptors_ti = NULL;
2649 /* User Buffer size */
2650 proto_tree_add_bits_item(tree, hf_fp_edch_user_buffer_size, tvb, offset*8,
2654 /* Spare is in-between... */
2656 /* Total number of MAC-is SDUs */
2657 proto_tree_add_bits_ret_val(tree, hf_fp_edch_no_macid_sdus, tvb, offset*8+4,
2658 12, &total_macis_sdus, FALSE);
2663 proto_tree_add_item(tree, hf_fp_edch_e_rnti, tvb, offset, 2, FALSE);
2667 bit_offset = offset*8;
2668 /* EDCH subframe header list */
2669 for (n=0; n < number_of_subframes; n++) {
2670 guint64 subframe_number;
2671 guint64 no_of_macis_pdus;
2672 proto_item *subframe_header_ti;
2673 proto_tree *subframe_header_tree;
2675 /* Add subframe header subtree */
2676 subframe_header_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe_header, tvb, offset, 0,
2678 subframe_header_tree = proto_item_add_subtree(subframe_header_ti, ett_fp_edch_subframe_header);
2684 /* Number of HARQ Retransmissions */
2685 proto_tree_add_item(subframe_header_tree, hf_fp_edch_harq_retransmissions, tvb,
2686 bit_offset/8, 1, FALSE);
2690 /* Subframe number */
2691 proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_subframe_number, tvb,
2692 bit_offset, 3, &subframe_number, FALSE);
2693 subframes[n].subframe_number = (guint8)subframe_number;
2696 /* Number of MAC-is PDUs */
2697 proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_number_of_mac_is_pdus, tvb,
2698 bit_offset, 4, &no_of_macis_pdus, FALSE);
2700 subframes[n].number_of_mac_is_pdus = (guint8)no_of_macis_pdus;
2701 macis_pdus += subframes[n].number_of_mac_is_pdus;
2703 /* Next 4 bits are spare for T2*/
2708 /* Show summary in root */
2709 proto_item_append_text(subframe_header_ti, " (SFN %u, %u MAC-is PDUs)",
2710 subframes[n].subframe_number, subframes[n].number_of_mac_is_pdus);
2711 proto_item_set_len(subframe_header_ti, is_common ? 1 : 2);
2713 offset = bit_offset / 8;
2716 /* MAC-is PDU descriptors for each subframe follow */
2717 for (n=0; n < number_of_subframes; n++) {
2718 proto_tree *subframe_macis_descriptors_tree;
2720 /* Add subframe header subtree */
2721 subframe_macis_descriptors_ti = proto_tree_add_string_format(tree, hf_fp_edch_macis_descriptors, tvb, offset, 0,
2722 "", "MAC-is descriptors (SFN %u)", subframes[n].subframe_number);
2723 proto_item_set_len(subframe_macis_descriptors_ti, subframes[n].number_of_mac_is_pdus*2);
2724 subframe_macis_descriptors_tree = proto_item_add_subtree(subframe_macis_descriptors_ti,
2725 ett_fp_edch_macis_descriptors);
2727 /* Find a sequence of descriptors for each MAC-is PDU in this subframe */
2728 for (pdu_no=0; pdu_no < subframes[n].number_of_mac_is_pdus; pdu_no++) {
2729 proto_item *f_ti = NULL;
2731 subframes[n].number_of_mac_is_sdus[pdu_no] = 0;
2734 /* Check we haven't gone past the limit */
2735 if (macis_sdus_found++ > total_macis_sdus) {
2736 expert_add_info_format(pinfo, f_ti, PI_MALFORMED, PI_ERROR,
2737 "Found too many (%u) MAC-is SDUs - header said there were %u",
2738 macis_sdus_found, (guint16)total_macis_sdus);
2742 subframes[n].mac_is_lchid[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
2743 proto_tree_add_item(subframe_macis_descriptors_tree, hf_fp_edch_macis_lchid, tvb, offset, 1, FALSE);
2744 if (subframes[n].mac_is_lchid[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] == 15) {
2747 /* 4 bits of spare */
2751 ti = proto_tree_add_item(tree, hf_fp_edch_e_rnti, tvb, offset, 2, FALSE);
2754 /* This is only allowed if:
2755 - its the common case AND
2756 - its the first descriptor */
2758 expert_add_info_format(pinfo, ti,
2759 PI_MALFORMED, PI_ERROR,
2760 "E-RNTI not supposed to appear for T2 EDCH frames");
2762 if (subframes[n].number_of_mac_is_sdus[pdu_no] > 0) {
2763 expert_add_info_format(pinfo, ti,
2764 PI_MALFORMED, PI_ERROR,
2765 "E-RNTI must be first entry among descriptors");
2771 subframes[n].mac_is_length[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] = (tvb_get_ntohs(tvb, offset) & 0x0ffe) >> 1;
2772 proto_tree_add_item(subframe_macis_descriptors_tree, hf_fp_edch_macis_length, tvb, offset, 2, FALSE);
2776 F = tvb_get_guint8(tvb, offset) & 0x01;
2777 f_ti = proto_tree_add_item(subframe_macis_descriptors_tree, hf_fp_edch_macis_flag, tvb, offset, 1, FALSE);
2779 subframes[n].number_of_mac_is_sdus[pdu_no]++;
2786 /* Check overall count of MAC-is SDUs */
2787 if (macis_sdus_found != total_macis_sdus) {
2788 expert_add_info_format(pinfo, subframe_macis_descriptors_ti, PI_MALFORMED, PI_ERROR,
2789 "Frame contains %u MAC-is SDUs - header said there would be %u!",
2790 macis_sdus_found, (guint16)total_macis_sdus);
2794 for (n=0; n < number_of_subframes; n++) {
2797 for (pdu_no=0; pdu_no < subframes[n].number_of_mac_is_pdus; pdu_no++) {
2800 guint32 subframe_bytes = 0;
2803 proto_item *macis_pdu_ti;
2804 proto_tree *macis_pdu_tree;
2806 /* Add subframe header subtree */
2807 macis_pdu_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe_header, tvb, offset, 0,
2808 "", "MAC-is PDU (SFN=%u PDU %u)",
2809 subframes[n].subframe_number, pdu_no+1);
2810 macis_pdu_tree = proto_item_add_subtree(macis_pdu_ti, ett_fp_edch_macis_pdu);
2814 ss = (tvb_get_guint8(tvb, offset) & 0xc0) >> 6;
2815 proto_tree_add_item(macis_pdu_tree, hf_fp_edch_macis_ss, tvb, offset, 1, FALSE);
2818 tsn = tvb_get_guint8(tvb, offset) & 0x03;
2819 proto_tree_add_item(macis_pdu_tree, hf_fp_edch_macis_tsn, tvb, offset, 1, FALSE);
2823 /* MAC-is SDUs (i.e. MACd PDUs) */
2824 for (sdu_no=0; sdu_no < subframes[n].number_of_mac_is_sdus[pdu_no]; sdu_no++) {
2825 const guint8 *pdu_data;
2829 ti = proto_tree_add_item(macis_pdu_tree, hf_fp_edch_macis_sdu, tvb,
2831 subframes[n].mac_is_length[pdu_no][sdu_no],
2833 proto_item_append_text(ti, " (%s Len=%u): ",
2834 val_to_str_const(subframes[n].mac_is_lchid[pdu_no][sdu_no], lchid_vals, "Unknown"),
2835 subframes[n].mac_is_length[pdu_no][sdu_no]);
2837 /* Show bytes too. There must be a nicer way of doing this! */
2838 pdu_data = tvb_get_ptr(tvb, offset, subframes[n].mac_is_length[pdu_no][sdu_no]);
2839 for (i=0; i < subframes[n].mac_is_length[pdu_no][sdu_no]; i++) {
2840 g_snprintf(buff+(i*2), 3, "%02x", pdu_data[i]);
2842 g_snprintf(buff+(i*2), 4, "...");
2846 proto_item_append_text(ti, "%s", buff);
2848 offset += subframes[n].mac_is_length[pdu_no][sdu_no];
2849 subframe_bytes += subframes[n].mac_is_length[pdu_no][sdu_no];
2852 proto_item_append_text(macis_pdu_ti, " - SS=%u TSN=%u (%u bytes in %u SDUs)",
2853 ss, tsn, subframe_bytes, subframes[n].number_of_mac_is_sdus[pdu_no]);
2855 proto_item_set_len(macis_pdu_ti, 1+subframe_bytes);
2856 total_bytes += subframe_bytes;
2860 /* Add data summary to info column */
2861 col_append_fstr(pinfo->cinfo, COL_INFO, " (%u bytes in %u SDUs in %u MAC-is PDUs in %u subframes)",
2862 total_bytes, macis_sdus_found, macis_pdus, number_of_subframes);;
2864 /* Spare extension and payload CRC (optional) */
2865 dissect_spare_extension_and_crc(tvb, pinfo, tree,
2866 p_fp_info->dch_crc_present, offset);
2870 /**********************************************************/
2871 /* Dissect an HSDSCH channel */
2872 /* The data format corresponds to the format */
2873 /* described in R5 and R6, and frame type 1 in Release 7. */
2874 static void dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2875 int offset, struct fp_info *p_fp_info)
2877 gboolean is_control_frame;
2880 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
2883 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
2884 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
2887 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
2889 if (is_control_frame)
2891 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
2895 guint8 number_of_pdus;
2897 guint16 user_buffer_size;
2899 /**************************************/
2900 /* HS-DCH data here (type 1 in R7) */
2903 if ((p_fp_info->release == 6) ||
2904 (p_fp_info->release == 7))
2906 guint8 frame_seq_no = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
2907 proto_tree_add_item(tree, hf_fp_frame_seq_nr, tvb, offset, 1, FALSE);
2909 col_append_fstr(pinfo->cinfo, COL_INFO, " seqno=%u", frame_seq_no);
2913 proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, FALSE);
2916 /* MAC-d PDU Length (13 bits) */
2917 pdu_length = (tvb_get_ntohs(tvb, offset) >> 3);
2918 proto_tree_add_item(tree, hf_fp_mac_d_pdu_len, tvb, offset, 2, FALSE);
2921 if ((p_fp_info->release == 6) ||
2922 (p_fp_info->release == 7))
2925 proto_tree_add_item(tree, hf_fp_flush, tvb, offset-1, 1, FALSE);
2927 /* FSN/DRT reset bit */
2928 proto_tree_add_item(tree, hf_fp_fsn_drt_reset, tvb, offset-1, 1, FALSE);
2933 number_of_pdus = tvb_get_guint8(tvb, offset);
2934 proto_tree_add_item(tree, hf_fp_num_of_pdu, tvb, offset, 1, FALSE);
2937 /* User buffer size */
2938 user_buffer_size = tvb_get_ntohs(tvb, offset);
2939 proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, FALSE);
2943 offset = dissect_macd_pdu_data(tvb, pinfo, tree, offset, pdu_length,
2946 col_append_fstr(pinfo->cinfo, COL_INFO, " %ux%u-bit PDUs User-Buffer-Size=%u",
2947 number_of_pdus, pdu_length, user_buffer_size);
2949 /* Extra IEs (if there is room for them) */
2950 if (((p_fp_info->release == 6) ||
2951 (p_fp_info->release == 7)) &&
2952 (tvb_length_remaining(tvb, offset) > 2))
2956 /* guint8 flag_bytes = 0; */
2961 proto_item *new_ie_flags_ti;
2962 proto_tree *new_ie_flags_tree;
2963 guint ies_found = 0;
2965 /* Add new IE flags subtree */
2966 new_ie_flags_ti = proto_tree_add_string_format(tree, hf_fp_hsdsch_new_ie_flags, tvb, offset, 1,
2967 "", "New IE flags");
2968 new_ie_flags_tree = proto_item_add_subtree(new_ie_flags_ti, ett_fp_hsdsch_new_ie_flags);
2970 /* Read next byte */
2971 flags = tvb_get_guint8(tvb, offset);
2974 /* Dissect individual bits */
2975 for (n=0; n < 8; n++)
2977 proto_tree_add_item(new_ie_flags_tree, hf_fp_hsdsch_new_ie_flag[n], tvb, offset, 1, FALSE);
2978 if ((flags >> (7-n)) & 0x01)
2985 proto_item_append_text(new_ie_flags_ti, " (%u IEs found)", ies_found);
2987 /* Last bit set will indicate another flags byte follows... */
2988 } while (0); /*((flags & 0x01) && (flag_bytes < 31));*/
2990 if (1) /*(flags & 0x8) */
2992 /* DRT is shown as mandatory in the diagram (3GPP TS 25.435 V6.3.0),
2993 but the description below it states that
2994 it should depend upon the first bit. The detailed description of
2995 New IE flags doesn't agree, so treat as mandatory for now... */
2996 proto_tree_add_item(tree, hf_fp_hsdsch_drt, tvb, offset, 2, FALSE);
3001 /* Spare Extension and Payload CRC */
3002 dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset);
3007 /******************************************/
3008 /* Dissect an HSDSCH type 2 channel */
3009 /* (introduced in Release 7) */
3010 /* N.B. there is currently no support for */
3011 /* frame type 3 (IuR only?) */
3012 static void dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
3013 int offset, struct fp_info *p_fp_info)
3015 gboolean is_control_frame;
3018 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
3021 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
3022 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
3025 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
3027 if (is_control_frame)
3029 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
3033 guint8 number_of_pdu_blocks;
3034 gboolean drt_present = FALSE;
3035 gboolean fach_present = FALSE;
3036 guint16 user_buffer_size;
3039 #define MAX_PDU_BLOCKS 31
3040 guint64 lchid[MAX_PDU_BLOCKS];
3041 guint64 pdu_length[MAX_PDU_BLOCKS];
3042 guint64 no_of_pdus[MAX_PDU_BLOCKS];
3044 /********************************/
3045 /* HS-DCH type 2 data here */
3047 col_append_str(pinfo->cinfo, COL_INFO, "(ehs)");
3049 /* Frame Seq Nr (4 bits) */
3050 if ((p_fp_info->release == 6) ||
3051 (p_fp_info->release == 7))
3053 guint8 frame_seq_no = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
3054 proto_tree_add_item(tree, hf_fp_frame_seq_nr, tvb, offset, 1, FALSE);
3056 col_append_fstr(pinfo->cinfo, COL_INFO, " seqno=%u", frame_seq_no);
3059 /* CmCH-PI (4 bits) */
3060 proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, FALSE);
3063 /* Total number of PDU blocks (5 bits) */
3064 number_of_pdu_blocks = (tvb_get_guint8(tvb, offset) >> 3);
3065 proto_tree_add_item(tree, hf_fp_total_pdu_blocks, tvb, offset, 1, FALSE);
3067 if (p_fp_info->release == 7)
3070 proto_tree_add_item(tree, hf_fp_flush, tvb, offset, 1, FALSE);
3072 /* FSN/DRT reset bit */
3073 proto_tree_add_item(tree, hf_fp_fsn_drt_reset, tvb, offset, 1, FALSE);
3076 drt_present = tvb_get_guint8(tvb, offset) & 0x01;
3077 proto_tree_add_item(tree, hf_fp_drt_indicator, tvb, offset, 1, FALSE);
3081 /* FACH Indicator flag */
3082 fach_present = (tvb_get_guint8(tvb, offset) & 0x08) >> 7;
3083 proto_tree_add_item(tree, hf_fp_fach_indicator, tvb, offset, 1, FALSE);
3086 /* User buffer size */
3087 user_buffer_size = tvb_get_ntohs(tvb, offset);
3088 proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, FALSE);
3091 col_append_fstr(pinfo->cinfo, COL_INFO, " User-Buffer-Size=%u", user_buffer_size);
3094 /********************************************************************/
3095 /* Now read number_of_pdu_blocks header entries */
3096 for (n=0; n < number_of_pdu_blocks; n++)
3098 proto_item *pdu_block_header_ti;
3099 proto_tree *pdu_block_header_tree;
3100 int block_header_start_offset = offset;
3102 /* Add PDU block header subtree */
3103 pdu_block_header_ti = proto_tree_add_string_format(tree, hf_fp_hsdsch_pdu_block_header,
3106 "PDU Block Header");
3107 pdu_block_header_tree = proto_item_add_subtree(pdu_block_header_ti,
3108 ett_fp_hsdsch_pdu_block_header);
3110 /* MAC-d/c PDU length in this block (11 bits) */
3111 proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_pdu_length_in_block, tvb,
3112 (offset*8) + ((n % 2) ? 4 : 0), 11,
3113 &pdu_length[n], FALSE);
3120 /* # PDUs in this block (4 bits) */
3121 proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_pdus_in_block, tvb,
3122 (offset*8) + ((n % 2) ? 0 : 4), 4,
3123 &no_of_pdus[n], FALSE);
3128 /* Logical channel ID in block (4 bits) */
3129 proto_tree_add_bits_ret_val(pdu_block_header_tree, hf_fp_lchid, tvb,
3130 (offset*8) + ((n % 2) ? 4 : 0), 4,
3136 if (n == (number_of_pdu_blocks-1)) {
3137 /* Byte is padded out for last block */
3142 /* Append summary to header tree root */
3143 proto_item_append_text(pdu_block_header_ti,
3144 " (lch:%u, %u pdus of %u bytes)",
3146 (guint16)no_of_pdus[n],
3147 (guint16)pdu_length[n]);
3149 /* Set length of header tree item */
3150 if (((n % 2) == 0) && (n < (number_of_pdu_blocks-1))) {
3151 proto_item_set_len(pdu_block_header_ti,
3152 offset - block_header_start_offset+1);
3155 proto_item_set_len(pdu_block_header_ti,
3156 offset - block_header_start_offset);
3161 /**********************************************/
3162 /* Optional fields indicated by earlier flags */
3166 proto_tree_add_item(tree, hf_fp_drt, tvb, offset, 2, FALSE);
3173 proto_tree_add_item(tree, hf_fp_hrnti, tvb, offset, 2, FALSE);
3176 /* RACH Measurement Result */
3177 proto_tree_add_item(tree, hf_fp_rach_measurement_result, tvb, offset, 2, FALSE);
3182 /********************************************************************/
3183 /* Now read the MAC-d/c PDUs for each block using info from headers */
3184 for (n=0; n < number_of_pdu_blocks; n++)
3186 /* Add PDU block header subtree */
3187 offset = dissect_macd_pdu_data_type_2(tvb, pinfo, tree, offset,
3188 (guint16)pdu_length[n],
3189 (guint16)no_of_pdus[n]);
3192 /* Spare Extension and Payload CRC */
3193 dissect_spare_extension_and_crc(tvb, pinfo, tree, 1, offset);
3197 static gboolean heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3199 struct fp_info *p_fp_info;
3201 p_fp_info = p_get_proto_data(pinfo->fd, proto_fp);
3203 /* if no FP info is present, assume this is not FP over UDP */
3204 if (!p_fp_info) return FALSE;
3206 /* if FP info is present, check that it really is an ethernet link */
3207 if (p_fp_info->link_type != FP_Link_Ethernet) {
3211 /* remember 'lower' UDP layer port information */
3212 if (!p_fp_info->srcport || !p_fp_info->destport) {
3213 p_fp_info->srcport = pinfo->srcport;
3214 p_fp_info->destport = pinfo->destport;
3217 /* discriminate 'lower' UDP layer from 'user data' UDP layer
3218 * (i.e. if an FP over UDP packet contains a user UDP packet */
3219 if (p_fp_info->srcport != pinfo->srcport ||
3220 p_fp_info->destport != pinfo->destport)
3223 /* assume this is FP */
3224 dissect_fp(tvb, pinfo, tree);
3229 /*****************************/
3230 /* Main dissection function. */
3231 void dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3233 proto_tree *fp_tree;
3236 struct fp_info *p_fp_info;
3238 /* Append this protocol name rather than replace. */
3239 col_set_str(pinfo->cinfo, COL_PROTOCOL, "FP");
3241 /* Create fp tree. */
3242 ti = proto_tree_add_item(tree, proto_fp, tvb, offset, -1, FALSE);
3243 fp_tree = proto_item_add_subtree(ti, ett_fp);
3245 top_level_tree = tree;
3247 /* Look for packet info! */
3248 p_fp_info = p_get_proto_data(pinfo->fd, proto_fp);
3250 /* Can't dissect anything without it... */
3251 if (p_fp_info == NULL)
3253 ti = proto_tree_add_text(fp_tree, tvb, offset, -1,
3254 "Can't dissect FP frame because no per-frame info was attached!");
3255 PROTO_ITEM_SET_GENERATED(ti);
3259 /* Show release information */
3260 if (preferences_show_release_info) {
3261 proto_item *release_ti;
3262 proto_tree *release_tree;
3263 proto_item *temp_ti;
3265 release_ti = proto_tree_add_item(fp_tree, hf_fp_release, tvb, 0, 0, FALSE);
3266 PROTO_ITEM_SET_GENERATED(release_ti);
3267 proto_item_append_text(release_ti, " R%u (%d/%d)",
3268 p_fp_info->release, p_fp_info->release_year, p_fp_info->release_month);
3269 release_tree = proto_item_add_subtree(release_ti, ett_fp_release);
3271 temp_ti = proto_tree_add_uint(release_tree, hf_fp_release_version, tvb, 0, 0, p_fp_info->release);
3272 PROTO_ITEM_SET_GENERATED(temp_ti);
3274 temp_ti = proto_tree_add_uint(release_tree, hf_fp_release_year, tvb, 0, 0, p_fp_info->release_year);
3275 PROTO_ITEM_SET_GENERATED(temp_ti);
3277 temp_ti = proto_tree_add_uint(release_tree, hf_fp_release_month, tvb, 0, 0, p_fp_info->release_month);
3278 PROTO_ITEM_SET_GENERATED(temp_ti);
3281 /* Show channel type in info column, tree */
3282 col_add_str(pinfo->cinfo, COL_INFO,
3283 val_to_str(p_fp_info->channel,
3285 "Unknown channel type"));
3286 proto_item_append_text(ti, " (%s)",
3287 val_to_str(p_fp_info->channel,
3289 "Unknown channel type"));
3291 /* Add channel type as a generated field */
3292 ti = proto_tree_add_uint(fp_tree, hf_fp_channel_type, tvb, 0, 0, p_fp_info->channel);
3293 PROTO_ITEM_SET_GENERATED(ti);
3295 /* Add division type as a generated field */
3296 if (p_fp_info->release == 7)
3298 ti = proto_tree_add_uint(fp_tree, hf_fp_division, tvb, 0, 0, p_fp_info->division);
3299 PROTO_ITEM_SET_GENERATED(ti);
3302 /* Add link direction as a generated field */
3303 ti = proto_tree_add_uint(fp_tree, hf_fp_direction, tvb, 0, 0, p_fp_info->is_uplink);
3304 PROTO_ITEM_SET_GENERATED(ti);
3306 /* Don't currently handle IuR-specific formats, but its useful to even see
3307 the channel type and direction */
3308 if (p_fp_info->iface_type == IuR_Interface)
3313 /* Show DDI config info */
3314 if (p_fp_info->no_ddi_entries > 0) {
3316 proto_item *ddi_config_ti;
3317 proto_tree *ddi_config_tree;
3319 ddi_config_ti = proto_tree_add_string_format(fp_tree, hf_fp_ddi_config, tvb, offset, 0,
3320 "", "DDI Config (");
3321 PROTO_ITEM_SET_GENERATED(ddi_config_ti);
3322 ddi_config_tree = proto_item_add_subtree(ddi_config_ti, ett_fp_ddi_config);
3324 /* Add each entry */
3325 for (n=0; n < p_fp_info->no_ddi_entries; n++) {
3326 proto_item_append_text(ddi_config_ti, "%s%u->%ubits",
3328 p_fp_info->edch_ddi[n], p_fp_info->edch_macd_pdu_size[n]);
3329 ti = proto_tree_add_uint(ddi_config_tree, hf_fp_ddi_config_ddi, tvb, 0, 0,
3330 p_fp_info->edch_ddi[n]);
3331 PROTO_ITEM_SET_GENERATED(ti);
3332 ti = proto_tree_add_uint(ddi_config_tree, hf_fp_ddi_config_macd_pdu_size, tvb, 0, 0,
3333 p_fp_info->edch_macd_pdu_size[n]);
3334 PROTO_ITEM_SET_GENERATED(ti);
3337 proto_item_append_text(ddi_config_ti, ")");
3340 /*************************************/
3341 /* Dissect according to channel type */
3342 switch (p_fp_info->channel)
3344 case CHANNEL_RACH_TDD:
3345 case CHANNEL_RACH_TDD_128:
3346 case CHANNEL_RACH_FDD:
3347 dissect_rach_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3350 dissect_dch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3352 case CHANNEL_FACH_FDD:
3353 case CHANNEL_FACH_TDD:
3354 dissect_fach_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3356 case CHANNEL_DSCH_FDD:
3357 case CHANNEL_DSCH_TDD:
3358 dissect_dsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3360 case CHANNEL_USCH_TDD_128:
3361 case CHANNEL_USCH_TDD_384:
3362 dissect_usch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3365 dissect_pch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3368 dissect_cpch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3371 dissect_bch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3373 case CHANNEL_HSDSCH:
3374 /* Show configured MAC HS-DSCH entity in use */
3377 proto_item *entity_ti;
3378 entity_ti = proto_tree_add_uint(fp_tree, hf_fp_hsdsch_entity,
3380 p_fp_info->hsdsch_entity);
3381 PROTO_ITEM_SET_GENERATED(entity_ti);
3383 switch (p_fp_info->hsdsch_entity) {
3384 case entity_not_specified:
3386 /* This is the pre-R7 default */
3387 dissect_hsdsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3390 dissect_hsdsch_type_2_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3393 /* TODO: dissector error */
3397 case CHANNEL_HSDSCH_COMMON:
3400 case CHANNEL_HSDSCH_COMMON_T3:
3403 case CHANNEL_IUR_CPCHF:
3406 case CHANNEL_IUR_FACH:
3409 case CHANNEL_IUR_DSCH:
3410 dissect_iur_dsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
3413 case CHANNEL_EDCH_COMMON:
3414 dissect_e_dch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info,
3415 p_fp_info->channel == CHANNEL_EDCH_COMMON);
3424 void proto_register_fp(void)
3426 static hf_register_info hf[] =
3430 "fp.release", FT_NONE, BASE_NONE, NULL, 0x0,
3431 "Release information", HFILL
3434 { &hf_fp_release_version,
3435 { "Release Version",
3436 "fp.release.version", FT_UINT8, BASE_DEC, NULL, 0x0,
3437 "3GPP Release number", HFILL
3440 { &hf_fp_release_year,
3442 "fp.release.year", FT_UINT16, BASE_DEC, NULL, 0x0,
3446 { &hf_fp_release_month,
3448 "fp.release.month", FT_UINT8, BASE_DEC, NULL, 0x0,
3452 { &hf_fp_channel_type,
3454 "fp.channel-type", FT_UINT8, BASE_HEX, VALS(channel_type_vals), 0x0,
3460 "fp.division", FT_UINT8, BASE_HEX, VALS(division_vals), 0x0,
3461 "Radio division type", HFILL
3466 "fp.direction", FT_UINT8, BASE_HEX, VALS(direction_vals), 0x0,
3467 "Link direction", HFILL
3470 { &hf_fp_ddi_config,
3472 "fp.ddi-config", FT_STRING, BASE_NONE, NULL, 0x0,
3473 "DDI Config (for E-DCH)", HFILL
3476 { &hf_fp_ddi_config_ddi,
3478 "fp.ddi-config.ddi", FT_UINT8, BASE_DEC, NULL, 0x0,
3482 { &hf_fp_ddi_config_macd_pdu_size,
3484 "fp.ddi-config.macd-pdu-size", FT_UINT16, BASE_DEC, NULL, 0x0,
3490 { &hf_fp_header_crc,
3492 "fp.header-crc", FT_UINT8, BASE_HEX, NULL, 0xfe,
3498 "fp.ft", FT_UINT8, BASE_HEX, VALS(data_control_vals), 0x01,
3504 "fp.cfn", FT_UINT8, BASE_DEC, NULL, 0x0,
3505 "Connection Frame Number", HFILL
3510 "fp.pch.cfn", FT_UINT16, BASE_DEC, NULL, 0xfff0,
3511 "PCH Connection Frame Number", HFILL
3516 "fp.pch.toa", FT_INT24, BASE_DEC, NULL, 0x0,
3517 "PCH Time of Arrival", HFILL
3520 { &hf_fp_cfn_control,
3522 "fp.cfn-control", FT_UINT8, BASE_DEC, NULL, 0x0,
3523 "Connection Frame Number Control", HFILL
3528 "fp.toa", FT_INT16, BASE_DEC, NULL, 0x0,
3529 "Time of arrival (units are 125 microseconds)", HFILL
3534 "fp.tb", FT_BYTES, BASE_NONE, NULL, 0x0,
3535 "Transport Block", HFILL
3538 { &hf_fp_chan_zero_tbs,
3539 { "No TBs for channel",
3540 "fp.channel-with-zero-tbs", FT_UINT32, BASE_DEC, NULL, 0x0,
3541 "Channel with 0 TBs", HFILL
3546 "fp.tfi", FT_UINT8, BASE_DEC, NULL, 0x0,
3547 "Transport Format Indicator", HFILL
3552 "fp.usch.tfi", FT_UINT8, BASE_DEC, NULL, 0x1f,
3553 "USCH Transport Format Indicator", HFILL
3558 "fp.cpch.tfi", FT_UINT8, BASE_DEC, NULL, 0x1f,
3559 "CPCH Transport Format Indicator", HFILL
3562 { &hf_fp_propagation_delay,
3563 { "Propagation Delay",
3564 "fp.propagation-delay", FT_UINT8, BASE_DEC, NULL, 0x0,
3568 { &hf_fp_dch_control_frame_type,
3569 { "Control Frame Type",
3570 "fp.dch.control.frame-type", FT_UINT8, BASE_HEX, VALS(dch_control_frame_type_vals), 0x0,
3571 "DCH Control Frame Type", HFILL
3574 { &hf_fp_dch_rx_timing_deviation,
3575 { "Rx Timing Deviation",
3576 "fp.dch.control.rx-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0,
3577 "DCH Rx Timing Deviation", HFILL
3580 { &hf_fp_quality_estimate,
3581 { "Quality Estimate",
3582 "fp.dch.quality-estimate", FT_UINT8, BASE_DEC, 0, 0x0,
3586 { &hf_fp_payload_crc,
3588 "fp.payload-crc", FT_UINT16, BASE_HEX, 0, 0x0,
3592 { &hf_fp_common_control_frame_type,
3593 { "Control Frame Type",
3594 "fp.common.control.frame-type", FT_UINT8, BASE_HEX, VALS(common_control_frame_type_vals), 0x0,
3595 "Common Control Frame Type", HFILL
3600 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x80,
3601 "CRC correctness indicator", HFILL
3606 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x40,
3607 "CRC correctness indicator", HFILL
3612 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x20,
3613 "CRC correctness indicator", HFILL
3618 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x10,
3619 "CRC correctness indicator", HFILL
3624 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x08,
3625 "CRC correctness indicator", HFILL
3630 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x04,
3631 "CRC correctness indicator", HFILL
3636 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x02,
3637 "CRC correctness indicator", HFILL
3642 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x01,
3643 "CRC correctness indicator", HFILL
3646 { &hf_fp_received_sync_ul_timing_deviation,
3647 { "Received SYNC UL Timing Deviation",
3648 "fp.rx-sync-ul-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0,
3653 { "Paging Indication",
3654 "fp.pch.pi", FT_UINT8, BASE_DEC, VALS(paging_indication_vals), 0x01,
3655 "Indicates if the PI Bitmap is present", HFILL
3660 "fp.pch.tfi", FT_UINT8, BASE_DEC, 0, 0x1f,
3661 "PCH Transport Format Indicator", HFILL
3666 "fp.fach.tfi", FT_UINT8, BASE_DEC, 0, 0x1f,
3667 "FACH Transport Format Indicator", HFILL
3670 { &hf_fp_transmit_power_level,
3671 { "Transmit Power Level",
3672 "fp.transmit-power-level", FT_FLOAT, BASE_NONE, 0, 0x0,
3673 "Transmit Power Level (dB)", HFILL
3676 { &hf_fp_pdsch_set_id,
3678 "fp.pdsch-set-id", FT_UINT8, BASE_DEC, 0, 0x0,
3679 "A pointer to the PDSCH Set which shall be used to transmit", HFILL
3682 { &hf_fp_paging_indication_bitmap,
3683 { "Paging Indications bitmap",
3684 "fp.pch.pi-bitmap", FT_NONE, BASE_NONE, NULL, 0x0,
3685 "Paging Indication bitmap", HFILL
3688 { &hf_fp_rx_timing_deviation,
3689 { "Rx Timing Deviation",
3690 "fp.common.control.rx-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0,
3691 "Common Rx Timing Deviation", HFILL
3694 { &hf_fp_dch_e_rucch_flag,
3696 "fp.common.control.e-rucch-flag", FT_UINT8, BASE_DEC, VALS(e_rucch_flag_vals), 0x0,
3700 { &hf_fp_edch_header_crc,
3701 { "E-DCH Header CRC",
3702 "fp.edch.header-crc", FT_UINT16, BASE_HEX, 0, 0xfef,
3708 "fp.edch.fsn", FT_UINT8, BASE_DEC, 0, 0x0f,
3709 "E-DCH Frame Sequence Number", HFILL
3712 { &hf_fp_edch_number_of_subframes,
3713 { "No of subframes",
3714 "fp.edch.no-of-subframes", FT_UINT8, BASE_DEC, 0, 0x0f,
3715 "E-DCH Number of subframes", HFILL
3718 { &hf_fp_edch_harq_retransmissions,
3719 { "No of HARQ Retransmissions",
3720 "fp.edch.no-of-harq-retransmissions", FT_UINT8, BASE_DEC, 0, 0x78,
3721 "E-DCH Number of HARQ retransmissions", HFILL
3724 { &hf_fp_edch_subframe_number,
3725 { "Subframe number",
3726 "fp.edch.subframe-number", FT_UINT8, BASE_DEC, 0, 0x0,
3727 "E-DCH Subframe number", HFILL
3730 { &hf_fp_edch_number_of_mac_es_pdus,
3731 { "Number of Mac-es PDUs",
3732 "fp.edch.number-of-mac-es-pdus", FT_UINT8, BASE_DEC, 0, 0xf0,
3738 "fp.edch.ddi", FT_UINT8, BASE_DEC, 0, 0x0,
3739 "E-DCH Data Description Indicator", HFILL
3742 { &hf_fp_edch_subframe,
3744 "fp.edch.subframe", FT_STRING, BASE_NONE, NULL, 0x0,
3745 "EDCH Subframe", HFILL
3748 { &hf_fp_edch_subframe_header,
3749 { "Subframe header",
3750 "fp.edch.subframe-header", FT_STRING, BASE_NONE, NULL, 0x0,
3751 "EDCH Subframe header", HFILL
3754 { &hf_fp_edch_number_of_mac_d_pdus,
3755 { "Number of Mac-d PDUs",
3756 "fp.edch.number-of-mac-d-pdus", FT_UINT8, BASE_DEC, 0, 0x0,
3760 { &hf_fp_edch_pdu_padding,
3762 "fp.edch-data-padding", FT_UINT8, BASE_DEC, 0, 0xc0,
3763 "E-DCH padding before PDU", HFILL
3768 "fp.edch-tsn", FT_UINT8, BASE_DEC, 0, 0x3f,
3769 "E-DCH Transmission Sequence Number", HFILL
3772 { &hf_fp_edch_mac_es_pdu,
3774 "fp.edch.mac-es-pdu", FT_NONE, BASE_NONE, NULL, 0x0,
3779 { &hf_fp_edch_user_buffer_size,
3780 { "User Buffer Size",
3781 "fp.edch.user-buffer-size", FT_UINT24, BASE_DEC, NULL, 0x0,
3785 { &hf_fp_edch_no_macid_sdus,
3786 { "No of MAC-is SDUs",
3787 "fp.edch.no-macis-sdus", FT_UINT16, BASE_DEC, NULL, 0x0,
3791 { &hf_fp_edch_number_of_mac_is_pdus,
3792 { "Number of Mac-is PDUs",
3793 "fp.edch.number-of-mac-is-pdus", FT_UINT8, BASE_DEC, 0, 0x0,
3797 { &hf_fp_edch_e_rnti,
3799 "fp.edch.e-rnti", FT_UINT16, BASE_DEC, 0, 0x0,
3804 { &hf_fp_edch_macis_descriptors,
3805 { "MAC-is Descriptors",
3806 "fp.edch.mac-is.descriptors", FT_STRING, BASE_NONE, NULL, 0x0,
3810 { &hf_fp_edch_macis_lchid,
3812 "fp.edch.mac-is.lchid", FT_UINT8, BASE_HEX, VALS(lchid_vals), 0xf0,
3816 { &hf_fp_edch_macis_length,
3818 "fp.edch.mac-is.length", FT_UINT16, BASE_DEC, 0, 0x0ffe,
3822 { &hf_fp_edch_macis_flag,
3824 "fp.edch.mac-is.lchid", FT_UINT8, BASE_HEX, 0, 0x01,
3825 "Indicates if another entry follows", HFILL
3828 { &hf_fp_edch_macis_ss,
3831 "fp.edch.mac-is.tsn", FT_UINT8, BASE_HEX, 0, 0xc0,
3832 "Segmentation Status", HFILL
3835 { &hf_fp_edch_macis_tsn,
3837 "fp.edch.mac-is.tsn", FT_UINT8, BASE_HEX, 0, 0x3f,
3838 "Transmission Sequence Number", HFILL
3841 { &hf_fp_edch_macis_sdu,
3843 "fp.edch.mac-is.sdu", FT_NONE, BASE_NONE, NULL, 0x0,
3849 { &hf_fp_frame_seq_nr,
3851 "fp.frame-seq-nr", FT_UINT8, BASE_DEC, 0, 0xf0,
3852 "Frame Sequence Number", HFILL
3855 { &hf_fp_hsdsch_pdu_block_header,
3856 { "PDU block header",
3857 "fp.hsdsch.pdu-block-header", FT_STRING, BASE_NONE, NULL, 0x0,
3858 "HS-DSCH type 2 PDU block header", HFILL
3861 { &hf_fp_hsdsch_pdu_block,
3863 "fp.hsdsch.pdu-block", FT_STRING, BASE_NONE, NULL, 0x0,
3864 "HS-DSCH type 2 PDU block data", HFILL
3869 "fp.flush", FT_UINT8, BASE_DEC, 0, 0x04,
3870 "Whether all PDUs for this priority queue should be removed", HFILL
3873 { &hf_fp_fsn_drt_reset,
3875 "fp.fsn-drt-reset", FT_UINT8, BASE_DEC, 0, 0x02,
3876 "FSN/DRT Reset Flag", HFILL
3879 { &hf_fp_drt_indicator,
3881 "fp.drt-indicator", FT_UINT8, BASE_DEC, 0, 0x01,
3885 { &hf_fp_fach_indicator,
3887 "fp.fach-indicator", FT_UINT8, BASE_DEC, 0, 0x80,
3891 { &hf_fp_total_pdu_blocks,
3893 "fp.pdu_blocks", FT_UINT8, BASE_DEC, 0, 0xf8,
3894 "Total number of PDU blocks", HFILL
3899 "fp.drt", FT_UINT16, BASE_DEC, 0, 0x0,
3905 "fp.hrnti", FT_UINT16, BASE_DEC, 0, 0x0,
3909 { &hf_fp_rach_measurement_result,
3910 { "RACH Measurement Result",
3911 "fp.rach-measurement-result", FT_UINT16, BASE_DEC, 0, 0x0,
3916 { "Logical Channel ID",
3917 "fp.lchid", FT_UINT8, BASE_DEC, NULL, 0x0,
3921 { &hf_fp_pdu_length_in_block,
3922 { "PDU length in block",
3923 "fp.pdu-length-in-block", FT_UINT8, BASE_DEC, 0, 0x0,
3924 "Length of each PDU in this block in bytes", HFILL
3927 { &hf_fp_pdus_in_block,
3929 "fp.no-pdus-in-block", FT_UINT8, BASE_DEC, 0, 0x0,
3930 "Number of PDUs in block", HFILL
3935 "fp.cmch-pi", FT_UINT8, BASE_DEC, 0, 0x0f,
3936 "Common Transport Channel Priority Indicator", HFILL
3939 { &hf_fp_user_buffer_size,
3940 { "User buffer size",
3941 "fp.user-buffer-size", FT_UINT16, BASE_DEC, 0, 0x0,
3942 "User buffer size in octets", HFILL
3945 { &hf_fp_hsdsch_credits,
3946 { "HS-DSCH Credits",
3947 "fp.hsdsch-credits", FT_UINT16, BASE_DEC, 0, 0x0,
3951 { &hf_fp_hsdsch_max_macd_pdu_len,
3952 { "Max MAC-d PDU Length",
3953 "fp.hsdsch.max-macd-pdu-len", FT_UINT16, BASE_DEC, 0, 0xfff8,
3954 "Maximum MAC-d PDU Length in bits", HFILL
3957 { &hf_fp_hsdsch_max_macdc_pdu_len,
3958 { "Max MAC-d/c PDU Length",
3959 "fp.hsdsch.max-macdc-pdu-len", FT_UINT16, BASE_DEC, 0, 0x07ff,
3960 "Maximum MAC-d/c PDU Length in bits", HFILL
3963 { &hf_fp_hsdsch_interval,
3964 { "HS-DSCH Interval in milliseconds",
3965 "fp.hsdsch-interval", FT_UINT8, BASE_DEC, 0, 0x0,
3969 { &hf_fp_hsdsch_calculated_rate,
3970 { "Calculated rate allocation (bps)",
3971 "fp.hsdsch-calculated-rate", FT_UINT32, BASE_DEC, 0, 0x0,
3972 "Calculated rate RNC is allowed to send in bps", HFILL
3975 { &hf_fp_hsdsch_unlimited_rate,
3977 "fp.hsdsch-unlimited-rate", FT_NONE, BASE_NONE, 0, 0x0,
3978 "No restriction on rate at which date may be sent", HFILL
3981 { &hf_fp_hsdsch_repetition_period,
3982 { "HS-DSCH Repetition Period",
3983 "fp.hsdsch-repetition-period", FT_UINT8, BASE_DEC, 0, 0x0,
3984 "HS-DSCH Repetition Period in milliseconds", HFILL
3987 { &hf_fp_hsdsch_data_padding,
3989 "fp.hsdsch-data-padding", FT_UINT8, BASE_DEC, 0, 0xf0,
3990 "HS-DSCH Repetition Period in milliseconds", HFILL
3993 { &hf_fp_hsdsch_new_ie_flags,
3995 "fp.hsdsch.new-ie-flags", FT_STRING, BASE_NONE, 0, 0x0,
3999 { &hf_fp_hsdsch_new_ie_flag[0],
4001 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x80,
4005 { &hf_fp_hsdsch_new_ie_flag[1],
4007 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x40,
4011 { &hf_fp_hsdsch_new_ie_flag[2],
4013 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x20,
4017 { &hf_fp_hsdsch_new_ie_flag[3],
4019 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x10,
4023 { &hf_fp_hsdsch_new_ie_flag[4],
4025 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x08,
4029 { &hf_fp_hsdsch_new_ie_flag[5],
4031 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x04,
4035 { &hf_fp_hsdsch_new_ie_flag[6],
4037 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x02,
4041 { &hf_fp_hsdsch_new_ie_flag[7],
4042 { "Another new IE flags byte",
4043 "fp.hsdsch.new-ie-flags-byte", FT_UINT8, BASE_DEC, 0, 0x01,
4044 "Another new IE flagsbyte", HFILL
4047 { &hf_fp_hsdsch_drt,
4049 "fp.hsdsch.drt", FT_UINT8, BASE_DEC, 0, 0xf0,
4050 "Delay Reference Time", HFILL
4053 { &hf_fp_hsdsch_entity,
4055 "fp.hsdsch.entity", FT_UINT8, BASE_DEC, VALS(hsdshc_mac_entity_vals), 0x0,
4056 "Type of MAC entity for this HS-DSCH channel", HFILL
4059 { &hf_fp_timing_advance,
4061 "fp.timing-advance", FT_UINT8, BASE_DEC, 0, 0x3f,
4062 "Timing advance in chips", HFILL
4065 { &hf_fp_num_of_pdu,
4067 "fp.hsdsch.num-of-pdu", FT_UINT8, BASE_DEC, 0, 0x0,
4068 "Number of PDUs in the payload", HFILL
4071 { &hf_fp_mac_d_pdu_len,
4072 { "MAC-d PDU Length",
4073 "fp.hsdsch.mac-d-pdu-len", FT_UINT16, BASE_DEC, 0, 0xfff8,
4074 "MAC-d PDU Length in bits", HFILL
4079 "fp.mac-d-pdu", FT_BYTES, BASE_NONE, NULL, 0x0,
4085 "fp.data", FT_BYTES, BASE_NONE, NULL, 0x0,
4091 "fp.crcis", FT_BYTES, BASE_NONE, NULL, 0x0,
4092 "CRC Indicators for uplink TBs", HFILL
4097 "fp.t1", FT_UINT24, BASE_DEC, NULL, 0x0,
4098 "RNC frame number indicating time it sends frame", HFILL
4103 "fp.t2", FT_UINT24, BASE_DEC, NULL, 0x0,
4104 "NodeB frame number indicating time it received DL Sync", HFILL
4109 "fp.t3", FT_UINT24, BASE_DEC, NULL, 0x0,
4110 "NodeB frame number indicating time it sends frame", HFILL
4113 { &hf_fp_ul_sir_target,
4115 "fp.ul-sir-target", FT_FLOAT, BASE_NONE, 0, 0x0,
4116 "Value (in dB) of the SIR target to be used by the UL inner loop power control", HFILL
4119 { &hf_fp_pusch_set_id,
4121 "fp.pusch-set-id", FT_UINT8, BASE_DEC, NULL, 0x0,
4122 "Identifies PUSCH Set from those configured in NodeB", HFILL
4125 { &hf_fp_activation_cfn,
4127 "fp.activation-cfn", FT_UINT8, BASE_DEC, NULL, 0x0,
4128 "Activation Connection Frame Number", HFILL
4133 "fp.pusch-set-id", FT_UINT8, BASE_DEC, NULL, 0x0,
4134 "Duration of the activation period of the PUSCH Set", HFILL
4137 { &hf_fp_power_offset,
4139 "fp.power-offset", FT_FLOAT, BASE_NONE, NULL, 0x0,
4140 "Power offset (in dB)", HFILL
4143 { &hf_fp_code_number,
4145 "fp.code-number", FT_UINT8, BASE_DEC, NULL, 0x0,
4149 { &hf_fp_spreading_factor,
4150 { "Spreading factor",
4151 "fp.spreading-factor", FT_UINT8, BASE_DEC, VALS(spreading_factor_vals), 0xf0,
4157 "fp.mc-info", FT_UINT8, BASE_DEC, NULL, 0x0e,
4161 { &hf_fp_rach_new_ie_flags,
4163 "fp.rach.new-ie-flags", FT_STRING, BASE_NONE, 0, 0x0,
4167 { &hf_fp_rach_new_ie_flag_unused[0],
4169 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x80,
4173 { &hf_fp_rach_new_ie_flag_unused[1],
4175 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x40,
4179 { &hf_fp_rach_new_ie_flag_unused[2],
4181 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x20,
4182 "New IE present (unused)", HFILL
4185 { &hf_fp_rach_new_ie_flag_unused[3],
4187 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x10,
4188 "New IE present (unused)", HFILL
4191 { &hf_fp_rach_new_ie_flag_unused[4],
4193 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x08,
4194 "New IE present (unused)", HFILL
4197 { &hf_fp_rach_new_ie_flag_unused[5],
4199 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x04,
4200 "New IE present (unused)", HFILL
4203 { &hf_fp_rach_new_ie_flag_unused[6],
4205 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x02,
4206 "New IE present (unused)", HFILL
4209 { &hf_fp_rach_cell_portion_id_present,
4210 { "Cell portion ID present",
4211 "fp.rach.cell-portion-id-present", FT_UINT8, BASE_DEC, 0, 0x01,
4215 { &hf_fp_rach_angle_of_arrival_present,
4216 { "Angle of arrival present",
4217 "fp.rach.angle-of-arrival-present", FT_UINT8, BASE_DEC, 0, 0x01,
4221 { &hf_fp_rach_ext_propagation_delay_present,
4222 { "Ext Propagation Delay Present",
4223 "fp.rach.ext-propagation-delay-present", FT_UINT8, BASE_DEC, 0, 0x02,
4227 { &hf_fp_rach_ext_rx_sync_ul_timing_deviation_present,
4228 { "Ext Received Sync UL Timing Deviation present",
4229 "fp.rach.ext-rx-sync-ul-timing-deviation-present", FT_UINT8, BASE_DEC, 0, 0x02,
4233 { &hf_fp_rach_ext_rx_timing_deviation_present,
4234 { "Ext Rx Timing Deviation present",
4235 "fp.rach.ext-rx-timing-deviation-present", FT_UINT8, BASE_DEC, 0, 0x01,
4239 { &hf_fp_cell_portion_id,
4240 { "Cell Portion ID",
4241 "fp.cell-portion-id", FT_UINT8, BASE_DEC, NULL, 0x3f,
4245 { &hf_fp_ext_propagation_delay,
4246 { "Ext Propagation Delay",
4247 "fp.ext-propagation-delay", FT_UINT16, BASE_DEC, NULL, 0x03ff,
4251 { &hf_fp_angle_of_arrival,
4252 { "Angle of Arrival",
4253 "fp.angle-of-arrival", FT_UINT16, BASE_DEC, NULL, 0x03ff,
4257 { &hf_fp_ext_received_sync_ul_timing_deviation,
4258 { "Ext Received SYNC UL Timing Deviation",
4259 "fp.ext-received-sync-ul-timing-deviation", FT_UINT16, BASE_DEC, NULL, 0x1fff,
4265 { &hf_fp_radio_interface_parameter_update_flag[0],
4267 "fp.radio-interface-param.cfn-valid", FT_UINT16, BASE_DEC, 0, 0x0001,
4271 { &hf_fp_radio_interface_parameter_update_flag[1],
4273 "fp.radio-interface-param.tpc-po-valid", FT_UINT16, BASE_DEC, 0, 0x0002,
4277 { &hf_fp_radio_interface_parameter_update_flag[2],
4279 "fp.radio-interface-param.dpc-mode-valid", FT_UINT16, BASE_DEC, 0, 0x0004,
4283 { &hf_fp_radio_interface_parameter_update_flag[3],
4284 { "RL sets indicator valid",
4285 "fp.radio-interface_param.rl-sets-indicator-valid", FT_UINT16, BASE_DEC, 0, 0x0020,
4289 { &hf_fp_radio_interface_parameter_update_flag[4],
4290 { "MAX_UE_TX_POW valid",
4291 "fp.radio-interface-param.max-ue-tx-pow-valid", FT_UINT16, BASE_DEC, 0, 0x0040,
4292 "MAX UE TX POW valid", HFILL
4297 "fp.dpc-mode", FT_UINT8, BASE_DEC, NULL, 0x20,
4298 "DPC Mode to be applied in the uplink", HFILL
4303 "fp.tpc-po", FT_UINT8, BASE_DEC, NULL, 0x1f,
4307 { &hf_fp_multiple_rl_set_indicator,
4308 { "Multiple RL sets indicator",
4309 "fp.multiple-rl-sets-indicator", FT_UINT8, BASE_DEC, NULL, 0x80,
4313 { &hf_fp_max_ue_tx_pow,
4315 "fp.max-ue-tx-pow", FT_INT8, BASE_DEC, NULL, 0x0,
4316 "Max UE TX POW (dBm)", HFILL
4319 { &hf_fp_congestion_status,
4320 { "Congestion Status",
4321 "fp.congestion-status", FT_UINT8, BASE_DEC, VALS(congestion_status_vals), 0x0,
4325 { &hf_fp_e_rucch_present,
4326 { "E-RUCCH Present",
4327 "fp.erucch-present", FT_UINT8, BASE_DEC, NULL, 0x0,
4331 { &hf_fp_extended_bits_present,
4332 { "Extended Bits Present",
4333 "fp.extended-bits-present", FT_UINT8, BASE_DEC, NULL, 0x0,
4337 { &hf_fp_extended_bits,
4339 "fp.extended-bits", FT_UINT8, BASE_HEX, NULL, 0x0,
4343 { &hf_fp_spare_extension,
4344 { "Spare Extension",
4345 "fp.spare-extension", FT_NONE, BASE_NONE, NULL, 0x0,
4353 static gint *ett[] =
4359 &ett_fp_edch_subframe_header,
4360 &ett_fp_edch_subframe,
4362 &ett_fp_edch_macis_descriptors,
4363 &ett_fp_edch_macis_pdu,
4364 &ett_fp_hsdsch_new_ie_flags,
4365 &ett_fp_rach_new_ie_flags,
4366 &ett_fp_hsdsch_pdu_block_header,
4370 module_t *fp_module;
4372 /* Register protocol. */
4373 proto_fp = proto_register_protocol("FP", "FP", "fp");
4374 proto_register_field_array(proto_fp, hf, array_length(hf));
4375 proto_register_subtree_array(ett, array_length(ett));
4377 /* Allow other dissectors to find this one by name. */
4378 register_dissector("fp", dissect_fp, proto_fp);
4381 fp_module = prefs_register_protocol(proto_fp, NULL);
4383 /* Determines whether release information should be displayed */
4384 prefs_register_bool_preference(fp_module, "show_release_info",
4385 "Show reported release info",
4386 "Show reported release info",
4387 &preferences_show_release_info);
4389 /* Determines whether MAC dissector should be called for payloads */
4390 prefs_register_bool_preference(fp_module, "call_mac",
4391 "Call MAC dissector for payloads",
4392 "Call MAC dissector for payloads",
4393 &preferences_call_mac_dissectors);
4398 void proto_reg_handoff_fp(void)
4400 mac_fdd_rach_handle = find_dissector("mac.fdd.rach");
4401 mac_fdd_fach_handle = find_dissector("mac.fdd.fach");
4402 mac_fdd_pch_handle = find_dissector("mac.fdd.pch");
4403 mac_fdd_dch_handle = find_dissector("mac.fdd.dch");
4404 mac_fdd_edch_handle = find_dissector("mac.fdd.edch");
4405 mac_fdd_hsdsch_handle = find_dissector("mac.fdd.hsdsch");
4407 heur_dissector_add("udp", heur_dissect_fp, proto_fp);