1 /* Routines for 5G/NR MAC disassembly
3 * Based on packet-mac-lte.c
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <epan/packet.h>
15 #include <epan/exceptions.h>
16 #include <epan/expert.h>
17 #include <epan/proto_data.h>
21 #include <wsutil/array.h>
23 #include "packet-mac-nr.h"
24 #include "packet-mac-3gpp-common.h"
25 #include "packet-rlc-nr.h"
27 void proto_register_mac_nr(void);
28 void proto_reg_handoff_mac_nr(void);
31 * 3GPP TS 38.321 NR; Medium Access Control (MAC) protocol specification v15.6.0
34 /* Initialize the protocol and registered fields. */
37 static int mac_nr_tap
= -1;
39 static dissector_handle_t rlc_nr_handle
;
41 /* Decoding context */
42 static int hf_mac_nr_context
;
43 static int hf_mac_nr_context_radio_type
;
44 static int hf_mac_nr_context_direction
;
45 static int hf_mac_nr_context_rnti
;
46 static int hf_mac_nr_context_rnti_type
;
47 static int hf_mac_nr_context_ueid
;
48 static int hf_mac_nr_context_sysframe_number
;
49 static int hf_mac_nr_context_slot_number
;
50 static int hf_mac_nr_context_harqid
;
51 static int hf_mac_nr_context_bcch_transport_channel
;
52 static int hf_mac_nr_context_phr_type2_othercell
;
55 static int hf_mac_nr_subheader
;
56 static int hf_mac_nr_subheader_reserved
;
57 static int hf_mac_nr_subheader_f
;
58 static int hf_mac_nr_subheader_length_1_byte
;
59 static int hf_mac_nr_subheader_length_2_bytes
;
60 static int hf_mac_nr_lcid
;
61 static int hf_mac_nr_ulsch_lcid
;
62 static int hf_mac_nr_dlsch_lcid
;
63 static int hf_mac_nr_dlsch_elcid_2oct
;
64 static int hf_mac_nr_ulsch_elcid_2oct
;
65 static int hf_mac_nr_dlsch_elcid_1oct
;
66 static int hf_mac_nr_ulsch_elcid_1oct
;
67 static int hf_mac_nr_dlsch_sdu
;
68 static int hf_mac_nr_ulsch_sdu
;
69 static int hf_mac_nr_bcch_pdu
;
70 static int hf_mac_nr_pcch_pdu
;
72 static int hf_mac_nr_control_crnti
;
73 static int hf_mac_nr_control_ue_contention_resolution_identity
;
74 static int hf_mac_nr_control_timing_advance_tagid
;
75 static int hf_mac_nr_control_timing_advance_command
;
76 static int hf_mac_nr_control_se_phr_reserved
;
77 static int hf_mac_nr_control_se_phr_ph
;
78 static int hf_mac_nr_control_se_phr_pcmax_f_c
;
79 static int hf_mac_nr_control_recommended_bit_rate_query_lcid
;
80 static int hf_mac_nr_control_recommended_bit_rate_query_dir
;
81 static int hf_mac_nr_control_recommended_bit_rate_query_bit_rate
;
82 static int hf_mac_nr_control_recommended_bit_rate_query_reserved
;
83 static int hf_mac_nr_control_me_phr_c7_flag
;
84 static int hf_mac_nr_control_me_phr_c6_flag
;
85 static int hf_mac_nr_control_me_phr_c5_flag
;
86 static int hf_mac_nr_control_me_phr_c4_flag
;
87 static int hf_mac_nr_control_me_phr_c3_flag
;
88 static int hf_mac_nr_control_me_phr_c2_flag
;
89 static int hf_mac_nr_control_me_phr_c1_flag
;
90 static int hf_mac_nr_control_me_phr_c15_flag
;
91 static int hf_mac_nr_control_me_phr_c14_flag
;
92 static int hf_mac_nr_control_me_phr_c13_flag
;
93 static int hf_mac_nr_control_me_phr_c12_flag
;
94 static int hf_mac_nr_control_me_phr_c11_flag
;
95 static int hf_mac_nr_control_me_phr_c10_flag
;
96 static int hf_mac_nr_control_me_phr_c9_flag
;
97 static int hf_mac_nr_control_me_phr_c8_flag
;
98 static int hf_mac_nr_control_me_phr_c23_flag
;
99 static int hf_mac_nr_control_me_phr_c22_flag
;
100 static int hf_mac_nr_control_me_phr_c21_flag
;
101 static int hf_mac_nr_control_me_phr_c20_flag
;
102 static int hf_mac_nr_control_me_phr_c19_flag
;
103 static int hf_mac_nr_control_me_phr_c18_flag
;
104 static int hf_mac_nr_control_me_phr_c17_flag
;
105 static int hf_mac_nr_control_me_phr_c16_flag
;
106 static int hf_mac_nr_control_me_phr_c31_flag
;
107 static int hf_mac_nr_control_me_phr_c30_flag
;
108 static int hf_mac_nr_control_me_phr_c29_flag
;
109 static int hf_mac_nr_control_me_phr_c28_flag
;
110 static int hf_mac_nr_control_me_phr_c27_flag
;
111 static int hf_mac_nr_control_me_phr_c26_flag
;
112 static int hf_mac_nr_control_me_phr_c25_flag
;
113 static int hf_mac_nr_control_me_phr_c24_flag
;
114 static int hf_mac_nr_control_me_phr_entry
;
115 static int hf_mac_nr_control_me_phr_p
;
116 static int hf_mac_nr_control_me_phr_v
;
117 static int hf_mac_nr_control_me_phr_reserved_2
;
118 static int hf_mac_nr_control_me_phr_ph_type2_spcell
;
119 static int hf_mac_nr_control_me_phr_ph_type1_pcell
;
120 static int hf_mac_nr_control_me_phr_ph_c31
;
121 static int hf_mac_nr_control_me_phr_ph_c30
;
122 static int hf_mac_nr_control_me_phr_ph_c29
;
123 static int hf_mac_nr_control_me_phr_ph_c28
;
124 static int hf_mac_nr_control_me_phr_ph_c27
;
125 static int hf_mac_nr_control_me_phr_ph_c26
;
126 static int hf_mac_nr_control_me_phr_ph_c25
;
127 static int hf_mac_nr_control_me_phr_ph_c24
;
128 static int hf_mac_nr_control_me_phr_ph_c23
;
129 static int hf_mac_nr_control_me_phr_ph_c22
;
130 static int hf_mac_nr_control_me_phr_ph_c21
;
131 static int hf_mac_nr_control_me_phr_ph_c20
;
132 static int hf_mac_nr_control_me_phr_ph_c19
;
133 static int hf_mac_nr_control_me_phr_ph_c18
;
134 static int hf_mac_nr_control_me_phr_ph_c17
;
135 static int hf_mac_nr_control_me_phr_ph_c16
;
136 static int hf_mac_nr_control_me_phr_ph_c15
;
137 static int hf_mac_nr_control_me_phr_ph_c14
;
138 static int hf_mac_nr_control_me_phr_ph_c13
;
139 static int hf_mac_nr_control_me_phr_ph_c12
;
140 static int hf_mac_nr_control_me_phr_ph_c11
;
141 static int hf_mac_nr_control_me_phr_ph_c10
;
142 static int hf_mac_nr_control_me_phr_ph_c9
;
143 static int hf_mac_nr_control_me_phr_ph_c8
;
144 static int hf_mac_nr_control_me_phr_ph_c7
;
145 static int hf_mac_nr_control_me_phr_ph_c6
;
146 static int hf_mac_nr_control_me_phr_ph_c5
;
147 static int hf_mac_nr_control_me_phr_ph_c4
;
148 static int hf_mac_nr_control_me_phr_ph_c3
;
149 static int hf_mac_nr_control_me_phr_ph_c2
;
150 static int hf_mac_nr_control_me_phr_ph_c1
;
151 static int hf_mac_nr_control_me_phr_reserved
;
152 static int hf_mac_nr_control_me_phr_pcmax_f_c_type2_spcell
;
153 static int hf_mac_nr_control_me_phr_pcmax_f_c_type1_pcell
;
154 /* TODO: is it worth having separate fields for each SCellIndex for this field too? */
155 static int hf_mac_nr_control_me_phr_pcmax_f_c_typeX
;
156 static int hf_mac_nr_control_recommended_bit_rate_lcid
;
157 static int hf_mac_nr_control_recommended_bit_rate_dir
;
158 static int hf_mac_nr_control_recommended_bit_rate_bit_rate
;
159 static int hf_mac_nr_control_recommended_bit_rate_reserved
;
160 static int hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_ad
;
161 static int hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_serving_cell_id
;
162 static int hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_bwp_id
;
163 static int hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_reserved_2
;
164 static int hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_sp_zp_rs_resource_set_id
;
165 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_reserved
;
166 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_serving_cell_id
;
167 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_bwp_id
;
168 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_pucch_resource_id
;
169 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_s8
;
170 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_s7
;
171 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_s6
;
172 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_s5
;
173 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_s4
;
174 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_s3
;
175 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_s2
;
176 static int hf_mac_nr_control_pucch_spatial_rel_act_deact_s1
;
177 static int hf_mac_nr_control_sp_srs_act_deact_ad
;
178 static int hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_cell_id
;
179 static int hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_bwp_id
;
180 static int hf_mac_nr_control_sp_srs_act_deact_reserved
;
181 static int hf_mac_nr_control_sp_srs_act_deact_c
;
182 static int hf_mac_nr_control_sp_srs_act_deact_sul
;
183 static int hf_mac_nr_control_sp_srs_act_deact_sp_srs_resource_set_id
;
184 static int hf_mac_nr_control_sp_srs_act_deact_f
;
185 static int hf_mac_nr_control_sp_srs_act_deact_resource_id
;
186 static int hf_mac_nr_control_sp_srs_act_deact_resource_id_ssb
;
187 static int hf_mac_nr_control_sp_srs_act_deact_resource_serving_cell_id
;
188 static int hf_mac_nr_control_sp_srs_act_deact_resource_bwp_id
;
189 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_reserved
;
190 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_serving_cell_id
;
191 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_bwp_id
;
192 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s7
;
193 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s6
;
194 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s5
;
195 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s4
;
196 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s3
;
197 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s2
;
198 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s1
;
199 static int hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s0
;
200 static int hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_serving_cell_id
;
201 static int hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_coreset_id
;
202 static int hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_tci_state_id
;
203 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_reserved
;
204 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_serving_cell_id
;
205 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_bwp_id
;
206 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t7
;
207 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t6
;
208 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t5
;
209 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t4
;
210 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t3
;
211 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t2
;
212 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t1
;
213 static int hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t0
;
214 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_reserved
;
215 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_serving_cell_id
;
216 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_bwp_id
;
217 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_t7
;
218 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_t6
;
219 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_t5
;
220 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_t4
;
221 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_t3
;
222 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_t2
;
223 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_t1
;
224 static int hf_mac_nr_control_aper_csi_trigger_state_subselect_t0
;
225 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_ad
;
226 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_serving_cell_id
;
227 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_bwp_id
;
228 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved
;
229 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_im
;
230 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_rs_res_set_id
;
231 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved2
;
232 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_im_res_set_id
;
233 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved3
;
234 static int hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_tci_state_id
;
235 static int hf_mac_nr_control_dupl_act_deact_drb7
;
236 static int hf_mac_nr_control_dupl_act_deact_drb6
;
237 static int hf_mac_nr_control_dupl_act_deact_drb5
;
238 static int hf_mac_nr_control_dupl_act_deact_drb4
;
239 static int hf_mac_nr_control_dupl_act_deact_drb3
;
240 static int hf_mac_nr_control_dupl_act_deact_drb2
;
241 static int hf_mac_nr_control_dupl_act_deact_drb1
;
242 static int hf_mac_nr_control_dupl_act_deact_reserved
;
243 static int hf_mac_nr_control_scell_act_deact_cell7
;
244 static int hf_mac_nr_control_scell_act_deact_cell6
;
245 static int hf_mac_nr_control_scell_act_deact_cell5
;
246 static int hf_mac_nr_control_scell_act_deact_cell4
;
247 static int hf_mac_nr_control_scell_act_deact_cell3
;
248 static int hf_mac_nr_control_scell_act_deact_cell2
;
249 static int hf_mac_nr_control_scell_act_deact_cell1
;
250 static int hf_mac_nr_control_scell_act_deact_reserved
;
251 static int hf_mac_nr_control_scell_act_deact_cell15
;
252 static int hf_mac_nr_control_scell_act_deact_cell14
;
253 static int hf_mac_nr_control_scell_act_deact_cell13
;
254 static int hf_mac_nr_control_scell_act_deact_cell12
;
255 static int hf_mac_nr_control_scell_act_deact_cell11
;
256 static int hf_mac_nr_control_scell_act_deact_cell10
;
257 static int hf_mac_nr_control_scell_act_deact_cell9
;
258 static int hf_mac_nr_control_scell_act_deact_cell8
;
259 static int hf_mac_nr_control_scell_act_deact_cell23
;
260 static int hf_mac_nr_control_scell_act_deact_cell22
;
261 static int hf_mac_nr_control_scell_act_deact_cell21
;
262 static int hf_mac_nr_control_scell_act_deact_cell20
;
263 static int hf_mac_nr_control_scell_act_deact_cell19
;
264 static int hf_mac_nr_control_scell_act_deact_cell18
;
265 static int hf_mac_nr_control_scell_act_deact_cell17
;
266 static int hf_mac_nr_control_scell_act_deact_cell16
;
267 static int hf_mac_nr_control_scell_act_deact_cell31
;
268 static int hf_mac_nr_control_scell_act_deact_cell30
;
269 static int hf_mac_nr_control_scell_act_deact_cell29
;
270 static int hf_mac_nr_control_scell_act_deact_cell28
;
271 static int hf_mac_nr_control_scell_act_deact_cell27
;
272 static int hf_mac_nr_control_scell_act_deact_cell26
;
273 static int hf_mac_nr_control_scell_act_deact_cell25
;
274 static int hf_mac_nr_control_scell_act_deact_cell24
;
275 static int hf_mac_nr_control_bsr_short_lcg
;
276 static int hf_mac_nr_control_bsr_short_bs_lcg0
;
277 static int hf_mac_nr_control_bsr_short_bs_lcg1
;
278 static int hf_mac_nr_control_bsr_short_bs_lcg2
;
279 static int hf_mac_nr_control_bsr_short_bs_lcg3
;
280 static int hf_mac_nr_control_bsr_short_bs_lcg4
;
281 static int hf_mac_nr_control_bsr_short_bs_lcg5
;
282 static int hf_mac_nr_control_bsr_short_bs_lcg6
;
283 static int hf_mac_nr_control_bsr_short_bs_lcg7
;
284 static int hf_mac_nr_control_bsr_long_lcg7
;
285 static int hf_mac_nr_control_bsr_long_lcg6
;
286 static int hf_mac_nr_control_bsr_long_lcg5
;
287 static int hf_mac_nr_control_bsr_long_lcg4
;
288 static int hf_mac_nr_control_bsr_long_lcg3
;
289 static int hf_mac_nr_control_bsr_long_lcg2
;
290 static int hf_mac_nr_control_bsr_long_lcg1
;
291 static int hf_mac_nr_control_bsr_long_lcg0
;
292 static int hf_mac_nr_control_bsr_trunc_long_bs
;
293 static int hf_mac_nr_control_bsr_long_bs_lcg0
;
294 static int hf_mac_nr_control_bsr_long_bs_lcg1
;
295 static int hf_mac_nr_control_bsr_long_bs_lcg2
;
296 static int hf_mac_nr_control_bsr_long_bs_lcg3
;
297 static int hf_mac_nr_control_bsr_long_bs_lcg4
;
298 static int hf_mac_nr_control_bsr_long_bs_lcg5
;
299 static int hf_mac_nr_control_bsr_long_bs_lcg6
;
300 static int hf_mac_nr_control_bsr_long_bs_lcg7
;
301 static int hf_mac_nr_control_timing_advance_report_reserved
;
302 static int hf_mac_nr_control_timing_advance_report_ta
;
304 static int hf_mac_nr_rar
;
305 static int hf_mac_nr_rar_subheader
;
306 static int hf_mac_nr_rar_e
;
307 static int hf_mac_nr_rar_t
;
308 static int hf_mac_nr_rar_reserved
;
309 static int hf_mac_nr_rar_reserved1
;
311 static int hf_mac_nr_rar_bi
;
312 static int hf_mac_nr_rar_rapid
;
313 static int hf_mac_nr_rar_ta
;
314 static int hf_mac_nr_rar_grant
;
315 static int hf_mac_nr_rar_grant_hopping
;
316 static int hf_mac_nr_rar_grant_fra
;
317 static int hf_mac_nr_rar_grant_tsa
;
318 static int hf_mac_nr_rar_grant_mcs
;
319 static int hf_mac_nr_rar_grant_tcsp
;
320 static int hf_mac_nr_rar_grant_csi
;
322 static int hf_mac_nr_rar_temp_crnti
;
324 static int hf_mac_nr_msgb
;
325 static int hf_mac_nr_msgb_subheader
;
326 static int hf_mac_nr_msgb_e
;
327 static int hf_mac_nr_msgb_t1
;
328 static int hf_mac_nr_msgb_t2
;
329 static int hf_mac_nr_msgb_s
;
330 static int hf_mac_nr_msgb_reserved
;
331 static int hf_mac_nr_msgb_reserved2
;
332 static int hf_mac_nr_msgb_reserved3
;
333 static int hf_mac_nr_msgb_ta_command
;
334 static int hf_mac_nr_msgb_channelaccess_cpext
;
335 static int hf_mac_nr_msgb_tpc
;
336 static int hf_mac_nr_msgb_harq_feedback_timing_indicator
;
337 static int hf_mac_nr_msgb_pucch_resource_indicator
;
339 static int hf_mac_nr_padding
;
341 static int hf_mac_nr_differential_koffset
;
342 static int hf_mac_nr_differential_koffset_reserved
;
344 static int ett_mac_nr
;
345 static int ett_mac_nr_context
;
346 static int ett_mac_nr_subheader
;
347 static int ett_mac_nr_rar_subheader
;
348 static int ett_mac_nr_rar_grant
;
349 static int ett_mac_nr_me_phr_entry
;
351 static expert_field ei_mac_nr_no_per_frame_data
;
352 static expert_field ei_mac_nr_sdu_length_different_from_dissected
;
353 static expert_field ei_mac_nr_unknown_udp_framing_tag
;
354 static expert_field ei_mac_nr_dl_sch_control_subheader_after_data_subheader
;
355 static expert_field ei_mac_nr_ul_sch_control_subheader_before_data_subheader
;
358 static dissector_handle_t nr_rrc_bcch_bch_handle
;
359 static dissector_handle_t nr_rrc_bcch_dl_sch_handle
;
360 static dissector_handle_t nr_rrc_pcch_handle
;
361 static dissector_handle_t nr_rrc_dl_ccch_handle
;
362 static dissector_handle_t nr_rrc_ul_ccch_handle
;
363 static dissector_handle_t nr_rrc_ul_ccch1_handle
;
366 /**************************************************************************/
367 /* Preferences state */
368 /**************************************************************************/
370 /* By default try to decode transparent data (BCCH, PCCH and CCCH) data using NR RRC dissector */
371 static bool global_mac_nr_attempt_rrc_decode
= true;
373 /* Whether should attempt to decode lcid 1-3 SDUs as srb1-3 (i.e. AM RLC) */
374 static bool global_mac_nr_attempt_srb_decode
= true;
376 /* Which layer info to show in the info column */
378 ShowPHYLayer
, ShowMACLayer
, ShowRLCLayer
381 /* Which layer's details to show in Info column */
382 static int global_mac_nr_layer_to_show
= (int)ShowRLCLayer
;
385 /***********************************************************************/
386 /* How to dissect lcid 3-32 (presume drb logical channels) */
388 /* Where to take LCID -> DRB mappings from */
389 enum lcid_drb_source
{
390 FromStaticTable
, FromConfigurationProtocol
392 static int global_mac_nr_lcid_drb_source
= (int)FromStaticTable
;
395 static const value_string drb_lcid_vals
[] = {
429 /* N.B. for now, only doing static config, and assume channel has same SN length in both directions */
430 typedef enum rlc_bearer_type_t
{
439 static const value_string rlc_bearer_type_vals
[] = {
441 { rlcUM6
, "UM, SN Len=6"},
442 { rlcUM12
, "UM, SN Len=12"},
443 { rlcAM12
, "AM, SN Len=12"},
444 { rlcAM18
, "AM, SN Len=18"},
450 typedef struct lcid_drb_mapping_t
{
453 rlc_bearer_type_t bearer_type_ul
;
454 rlc_bearer_type_t bearer_type_dl
;
455 } lcid_drb_mapping_t
;
458 static lcid_drb_mapping_t
*lcid_drb_mappings
;
459 static unsigned num_lcid_drb_mappings
;
461 UAT_VS_DEF(lcid_drb_mappings
, lcid
, lcid_drb_mapping_t
, uint8_t, 3, "LCID 3")
462 UAT_DEC_CB_DEF(lcid_drb_mappings
, drbid
, lcid_drb_mapping_t
)
463 UAT_VS_DEF(lcid_drb_mappings
, bearer_type_ul
, lcid_drb_mapping_t
, rlc_bearer_type_t
, rlcAM12
, "AM")
464 UAT_VS_DEF(lcid_drb_mappings
, bearer_type_dl
, lcid_drb_mapping_t
, rlc_bearer_type_t
, rlcAM12
, "AM")
467 static uat_t
* lcid_drb_mappings_uat
;
469 /* Dynamic mappings (set by configuration protocol)
470 LCID is the index into the array of these */
471 typedef struct dynamic_lcid_drb_mapping_t
{
474 rlc_bearer_type_t bearer_type_ul
;
475 rlc_bearer_type_t bearer_type_dl
;
476 uint8_t ul_priority
; // N.B. not yet in rlc_nr_info
477 } dynamic_lcid_drb_mapping_t
;
479 typedef struct ue_dynamic_drb_mappings_t
{
482 dynamic_lcid_drb_mapping_t mapping
[33]; /* Index is LCID (3-32) */
483 uint8_t drb_to_lcid_mappings
[33]; /* Also map drbid -> lcid (1-32) */
484 } ue_dynamic_drb_mappings_t
;
486 /* ueId -> ue_dynamic_drb_mappings_t* */
487 static GHashTable
*mac_nr_ue_bearers_hash
;
492 /* When showing RLC info, count PDUs so can append info column properly */
493 static uint8_t s_number_of_rlc_pdus_shown
;
496 extern int proto_rlc_nr
;
499 /* Constants and value strings */
501 static const value_string radio_type_vals
[] =
508 static const value_string direction_vals
[] =
510 { DIRECTION_UPLINK
, "Uplink"},
511 { DIRECTION_DOWNLINK
, "Downlink"},
515 static const value_string rnti_type_vals
[] =
517 { NO_RNTI
, "NO-RNTI"},
519 { RA_RNTI
, "RA-RNTI"},
521 { SI_RNTI
, "SI-RNTI"},
522 { CS_RNTI
, "CS-RNTI"},
523 { MSGB_RNTI
, "MSGB-RNTI"},
527 static const value_string bcch_transport_channel_vals
[] =
529 { SI_RNTI
, "DL-SCH"},
535 #define TWO_OCTET_ELCID_FIELD 33
536 #define ONE_OCTET_ELCID_FIELD 34
537 #define RECOMMENDED_BIT_RATE_LCID 47
538 #define SP_ZP_CSI_RS_RESOURCE_SET_ACT_DEACT_LCID 48
539 #define PUCCH_SPATIAL_REL_ACT_DEACT_LCID 49
540 #define SP_SRS_ACT_DEACT_LCID 50
541 #define SP_CSI_REPORT_ON_PUCCH_ACT_DEACT_LCID 51
542 #define TCI_STATE_IND_FOR_UE_SPEC_PDCCH_LCID 52
543 #define TCI_STATES_ACT_DEACT_FOR_UE_SPEC_PDSCH_LCID 53
544 #define APER_CSI_TRIGGER_STATE_SUBSELECT_LCID 54
545 #define SP_CSI_RS_CSI_IM_RES_SET_ACT_DEACT_LCID 55
546 #define DUPLICATION_ACTIVATION_DEACTIVATION_LCID 56
547 #define SCELL_ACTIVATION_DEACTIVATION_4_LCID 57
548 #define SCELL_ACTIVATION_DEACTIVATION_1_LCID 58
549 #define LONG_DRX_COMMAND_LCID 59
550 #define DRX_COMMAND_LCID 60
551 #define TIMING_ADVANCE_COMMAND_LCID 61
552 #define UE_CONTENTION_RESOLUTION_IDENTITY_LCID 62
553 #define PADDING_LCID 63
555 static const value_string dlsch_lcid_vals
[] =
557 { CCCH_LCID
, "CCCH"},
590 { 33, "Extended logical channel ID field(two octet eLCID field)"},
591 { 34, "Extended logical channel ID field(one octet eLCID field)"},
604 { RECOMMENDED_BIT_RATE_LCID
, "Recommended Bit Rate"},
605 { SP_ZP_CSI_RS_RESOURCE_SET_ACT_DEACT_LCID
, "SP ZP CSI-RS Resource Set Activation/Deactivation"},
606 { PUCCH_SPATIAL_REL_ACT_DEACT_LCID
, "PUCCH spatial relation Activation/Deactivation"},
607 { SP_SRS_ACT_DEACT_LCID
, "SP SRS Activation/Deactivation"},
608 { SP_CSI_REPORT_ON_PUCCH_ACT_DEACT_LCID
, "SP CSI reporting on PUCCH Activation/Deactivation"},
609 { TCI_STATE_IND_FOR_UE_SPEC_PDCCH_LCID
, "TCI State Indication for UE-specific PDCCH"},
610 { TCI_STATES_ACT_DEACT_FOR_UE_SPEC_PDSCH_LCID
, "TCI States Activation/Deactivation for UE-specific PDSCH"},
611 { APER_CSI_TRIGGER_STATE_SUBSELECT_LCID
, "Aperiodic CSI Trigger State Subselection"},
612 { SP_CSI_RS_CSI_IM_RES_SET_ACT_DEACT_LCID
, "SP CSI-RS / CSI-IM Resource Set Activation/Deactivation"},
613 { DUPLICATION_ACTIVATION_DEACTIVATION_LCID
, "Duplication Activation/Deactivation"},
614 { SCELL_ACTIVATION_DEACTIVATION_4_LCID
, "SCell Activation/Deactivation (4 octet)"},
615 { SCELL_ACTIVATION_DEACTIVATION_1_LCID
, "SCell Activation/Deactivation (1 octet)"},
616 { LONG_DRX_COMMAND_LCID
, "Long DRX Command"},
617 { DRX_COMMAND_LCID
, "DRX Command"},
618 { TIMING_ADVANCE_COMMAND_LCID
, "Timing Advance Command"},
619 { UE_CONTENTION_RESOLUTION_IDENTITY_LCID
, "UE Contention Resolution Identity"},
620 { PADDING_LCID
, "Padding"},
623 static value_string_ext dlsch_lcid_vals_ext
= VALUE_STRING_EXT_INIT(dlsch_lcid_vals
);
625 /* TODO: not all LCIDs handled yet */
626 #define TRUNCATED_ENHANCED_BFR_LCID 43
627 #define TIMING_ADVANCE_REPORT_LCID 44
628 #define TRUNCATED_SIDELINK_BSR_LCID 45
629 #define SIDELINK_BSR_LCID 46
630 #define RESERVED_47_LCID 47
631 #define LBT_FAILURE_4_OCTETS_LCID 48
632 #define LBT_FAILURE_1_OCTET_LCID 49
634 #define TRUNCATED_BFR_LCID 51
635 #define CCCH_48_BITS_LCID 52
636 #define RECOMMENDED_BIT_RATE_QUERY_LCID 53
637 #define MULTIPLE_ENTRY_PHR_4_LCID 54
638 #define CONFIGURED_GRANT_CONFIGURATION_LCID 55
639 #define MULTIPLE_ENTRY_PHR_1_LCID 56
640 #define SINGLE_ENTRY_PHR_LCID 57
641 #define C_RNTI_LCID 58
642 #define SHORT_TRUNCATED_BSR_LCID 59
643 #define LONG_TRUNCATED_BSR_LCID 60
644 #define SHORT_BSR_LCID 61
645 #define LONG_BSR_LCID 62
647 /* Table 6.2.1-1b Values of one-octet eLCID for DL-SCH */
649 #define SERVING_CELL_SET_BASED_SRS_TCI_STATE_INDICATIONS_ELCD 227
650 #define SP_AP_SRS_TCI_STATE_INDICATION_ELCD 228
651 #define BFD_RS_INDICATION_ELCD 229
652 #define DIFFERENTIAL_KOFFSET_ELCD 230
653 #define ENHANCED_SCELL_ACTIVATION_DEACTIVATION_MAC_CE_WITH_ONE_OCTET_CI_FIELD_ELCD 231
654 #define ENHANCED_SCELL_ACTIVATION_DEACTIVATION_MAC_CE_WITH_FOUR_OCTET_CI_FIELD_ELCD 232
655 #define UNIFIED_TCI_STATES_ACTIVATION_DEACTIVATION_ELCD 233
656 #define PUCCH_POWER_CONTROL_SET_UPDATE_FOR_MULTIPLE_TRP_PUCCH_REPETITION__ELCD 234
657 #define PUCCH_SPATIAL_RELATION_ACTIVATION_DEACTIVATION_FOR_MULTIPLE_TRP_PUCCH_REPETITION_ELCD 235
658 #define ENHANCED_TCI_STATES_INDICATION_FOR_UE_SPECIFIC_PDCCH_ELCD 236
659 #define POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_COMMAND_ELCD 237
660 #define PPW_ACTIVATION_DEACTIVATION_COMMAND_ELCD 238
661 #define DL_TX_POWER_ADJUSTMENT_ELCD 239
662 #define TIMING_CASE_INDICATION_ELCD 240
663 #define CHILD_IAB_DU_RESTRICTED_BEAM_INDICATION_ELCD 241
664 #define CASE_7_TIMING_ADVANCE_OFFSET_ELCD 242
665 #define PROVIDED_GUARD_SYMBOLS_FOR_CASE_6_TIMING_ELCD 243
666 #define PROVIDED_GUARD_SYMBOLS_FOR_CASE_7_TIMING_ELCD 244
667 #define SERVING_CELL_SET_BASED_SRS_SPATIAL_RELATION_INDICATION_ELCD 245
668 #define PUSCH_PATHLOSS_REFERENCE_RS_UPDATE_ELCD 246
669 #define SRS_PATHLOSS_REFERENCE_RS_UPDATE_ELCD 247
670 #define ENHANCED_SP_AP_SRS_SPATIAL_RELATION_INDICATION_ELCD 248
671 #define ENHANCED_PUCCH_SPATIAL_RELATION_ACTIVATION_DEACTIVATION_ELCD 249
672 #define ENHANCED_TCI_STATES_ACTIVATION_DEACTIVATION_FOR_UE_SPECIFIC_PDSCH_ELCD 250
673 #define DUPLICATION_RLC_ACTIVATION_DEACTIVATION_ELCD 251
674 #define ABSOLUTE_TIMING_ADVANCE_COMMAND_ELCD 252
675 #define SP_POSITIONING_SRS_ACTIVATION_DEACTIVATION_ELCD 253
676 #define PROVIDED_GUARD_SYMBOLS_ELCD 254
677 #define TIMING_DELTA_ELCD 255
679 static const value_string dlsch_elcid_vals
[] =
681 //0 to 226 64 to 290 Reserved
682 { 227, "Serving Cell Set based SRS TCI State Indication"},
683 { 228, "SP/AP SRS TCI State Indication"},
684 { 229, "BFD-RS Indication"},
685 { 230, "Differential Koffset"},
686 { 231, "Enhanced SCell Activation/Deactivation with one octet Ci field"},
687 { 232, "Enhanced SCell Activation/Deactivation with four octet Ci field"},
688 { 233, "Unified TCI States Activation/Deactivation"},
689 { 234, "PUCCH Power Control Set Update for multiple TRP PUCCH repetition"},
690 { 235, "PUCCH spatial relation Activation/Deactivation for multiple TRP PUCCH repetition"},
691 { 236, "Enhanced TCI States Indication for UE-specific PDCCH"},
692 { 237, "Positioning Measurement Gap Activation/Deactivation Command"},
693 { 238, "PPW Activation/Deactivation Command"},
694 { 239, "DL Tx Power Adjustment"},
695 { 240, "Timing Case Indication"},
696 { 241, "Child IAB-DU Restricted Beam Indication"},
697 { 242, "Case-7 Timing advance offset"},
698 { 243, "Provided Guard Symbols for Case-6 timing"},
699 { 244, "Provided Guard Symbols for Case-7 timing"},
700 { 245, "Serving Cell Set based SRS Spatial Relation Indication"},
701 { 246, "PUSCH Pathloss Reference RS Update"},
702 { 247, "SRS Pathloss Reference RS Update"},
703 { 248, "Enhanced SP/AP SRS Spatial Relation Indication"},
704 { 249, "Enhanced PUCCH Spatial Relation Activation/Deactivation"},
705 { 250, "Enhanced TCI States Activation/Deactivation for UE-specific PDSCH"},
706 { 251, "Duplication RLC Activation/Deactivation"},
707 { 252, "Absolute Timing Advance Command"},
708 { 253, "SP Positioning SRS Activation/Deactivation"},
709 { 254, "Provided Guard Symbols"},
710 { 255, "Timing Delta"},
713 static value_string_ext dlsch_elcid_vals_ext
= VALUE_STRING_EXT_INIT(dlsch_elcid_vals
);
715 static const value_string ulsch_lcid_vals
[] =
717 { CCCH_LCID
, "CCCH (64 bits)"},
750 { 33, "Extended logical channel ID field(two-octet eLCID field)"},
751 { 34, "Extended logical channel ID field(one-octet eLCID field)"},
752 { 35, "CCCH of size 48 bits(referred to as 'CCCH' in TS 38.331[5]) for a RedCap UE"},
753 { 36, "CCCH of size 64 bits(referred to as 'CCCH1' in TS 38.331[5]) for a RedCap UE"},
760 { TRUNCATED_ENHANCED_BFR_LCID
, "Truncated Enhanced BFR"}, // 43
761 { TIMING_ADVANCE_REPORT_LCID
, "Timing Advance Report"}, // 44
762 { TRUNCATED_SIDELINK_BSR_LCID
, "Truncated Sidelink BSR"}, // 45
763 { SIDELINK_BSR_LCID
, "Sidelink BSR"}, // 46
764 { RESERVED_47_LCID
, "Reserved"}, // 47
765 { LBT_FAILURE_4_OCTETS_LCID
, "LBT Failure 4 octets"}, // 48
766 { LBT_FAILURE_1_OCTET_LCID
, "LBT Failure 1 octet"}, // 49
767 { BFR_LCID
, "BFR"}, // 50
768 { TRUNCATED_BFR_LCID
, "Truncated BFR"}, // 51
769 { CCCH_48_BITS_LCID
, "CCCH (48 bits)"}, // 52
770 { RECOMMENDED_BIT_RATE_QUERY_LCID
, "Recommended Bit Rate Query"}, // 53
771 { MULTIPLE_ENTRY_PHR_4_LCID
, "Multiple Entry PHR (4 octet C)"}, // 54
772 { CONFIGURED_GRANT_CONFIGURATION_LCID
, "Configured Grant Confirmation"}, // 55
773 { MULTIPLE_ENTRY_PHR_1_LCID
, "Multiple Entry PHR (1 octet C)"}, // 56
774 { SINGLE_ENTRY_PHR_LCID
, "Single Entry PHR"}, // 57
775 { C_RNTI_LCID
, "C-RNTI"}, // 58
776 { SHORT_TRUNCATED_BSR_LCID
, "Short Truncated BSR"}, // 59
777 { LONG_TRUNCATED_BSR_LCID
, "Long Truncated BSR"}, // 60
778 { SHORT_BSR_LCID
, "Short BSR"}, // 61
779 { LONG_BSR_LCID
, "Long BSR"}, // 62
780 { PADDING_LCID
, "Padding"}, // 63
783 static value_string_ext ulsch_lcid_vals_ext
= VALUE_STRING_EXT_INIT(ulsch_lcid_vals
);
785 #define ENHANCED_MULTIPLE_ENTRY_PHR_FOR_MULTIPLE_TRP_FOUR_OCTETS_CI 229
786 #define ENHANCED_MULTIPLE_ENTRY_PHR_FOR_MULTIPLE_TRP_ONE_OCTETS_CI 230
787 #define ENHANCED_SINGLE_ENTRY_PHR_FOR_MULTIPLE_TRP 231
788 #define ENHANCED_MULTIPLE_ENTRY_PHR_FOUR_OCTETS_CI 232
789 #define ENHANCED_MULTIPLE_ENTRY_PHR_ONE_OCTETS_CI 233
790 #define ENHANCED_SINGLE_ENTRY_PHR 234
791 #define ENHANCED_BFR_ONE_OCTET_CI 235
792 #define ENHANCED_BFR_FOUR_OCTET_CI 236
793 #define TRUNCATED_ENHANCED_BFR_FOUR_OCTET_CI 237
794 #define POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_REQUEST 238
795 #define IAB_MT_RECOMMENDED_BEAM_INDICATION 239
796 #define DESIRED_IAB_MT_PSD_RANGE 240
797 #define DESIRED_DL_TX_POWER_ADJUSTMENT 241
798 #define CASE_6_TIMING_REQUEST 242
799 #define DESIRED_GUARD_SYMBOLS_FOR_CASE_6_TIMING 243
800 #define DESIRED_GUARD_SYMBOLS_FOR_CASE_7_TIMING 244
801 #define EXTENDED_SHORT_TRUNCATED_BSR 245
802 #define EXTENDED_LONG_TRUNCATED_BSR 246
803 #define EXTENDED_SHORT_BSR 247
804 #define EXTENDED_LONG_BSR 248
805 #define EXTENDED_PRE_EMPTIVE_BSR 249
806 #define BFR_FOUR_OCTETS_CI 250
807 #define TRUNCATED_BFR_FOUR_OCTETS_CI 251
808 #define MULTIPLE_ENTRY_CONFIGURED_GRANT_CONFIRMATION 252
809 #define SIDELINK_CONFIGURED_GRANT_CONFIRMATION 253
810 #define DESIRED_GUARD_SYMBOLS 254
811 #define PRE_EMPTIVE_BSR 255
813 static const value_string ulsch_elcid_vals
[] =
815 //Table 6.2.1-2b Values of one-octet eLCID for UL-SCH
816 //Codepoint Index LCID values
817 //0 to 228 64 to 292 Reserved
818 { 229, "Enhanced Multiple Entry PHR for multiple TRP(four octets Ci)"},
819 { 230, "Enhanced Multiple Entry PHR for multiple TRP(one octets Ci)"},
820 { 231, "Enhanced Single Entry PHR for multiple TRP"},
821 { 232, "Enhanced Multiple Entry PHR(four octets Ci)"},
822 { 233, "Enhanced Multiple Entry PHR(one octets Ci)"},
823 { 234, "Enhanced Single Entry PHR"},
824 { 235, "Enhanced BFR(one octet Ci)"},
825 { 236, "Enhanced BFR(four octet Ci)"},
826 { 237, "Truncated Enhanced BFR(four octet Ci)"},
827 { 238, "Positioning Measurement Gap Activation/Deactivation Request"},
828 { 239, "IAB-MT Recommended Beam Indication"},
829 { 240, "Desired IAB-MT PSD range"},
830 { 241, "Desired DL Tx Power Adjustment"},
831 { 242, "Case-6 Timing Request"},
832 { 243, "Desired Guard Symbols for Case 6 timing"},
833 { 244, "Desired Guard Symbols for Case 7 timing"},
834 { 245, "Extended Short Truncated BSR"},
835 { 246, "Extended Long Truncated BSR"},
836 { 247, "Extended Short BSR"},
837 { 248, "Extended Long BSR"},
838 { 249, "Extended Pre-emptive BSR"},
839 { 250, "BFR(four octets Ci)"},
840 { 251, "Truncated BFR(four octets Ci)"},
841 { 252, "Multiple Entry Configured Grant Confirmation"},
842 { 253, "Sidelink Configured Grant Confirmation"},
843 { 254, "Desired Guard Symbols"},
844 { 255, "Pre-emptive BSR"},
847 static value_string_ext ulsch_elcid_vals_ext
= VALUE_STRING_EXT_INIT(ulsch_elcid_vals
);
849 static const true_false_string rar_ext_vals
=
851 "Another MAC subPDU follows",
855 static const true_false_string rar_type_vals
=
858 "Backoff Indicator present"
861 static const value_string rar_bi_vals
[] =
882 static const value_string buffer_size_5bits_vals
[] =
885 { 1, "0 < BS <= 10"},
886 { 2, "10 < BS <= 14"},
887 { 3, "14 < BS <= 20"},
888 { 4, "20 < BS <= 28"},
889 { 5, "28 < BS <= 38"},
890 { 6, "38 < BS <= 53"},
891 { 7, "53 < BS <= 74"},
892 { 8, "74 < BS <= 102"},
893 { 9, "102 < BS <= 142"},
894 { 10, "142 < BS <= 198"},
895 { 11, "198 < BS <= 276"},
896 { 12, "276 < BS <= 384"},
897 { 13, "384 < BS <= 535"},
898 { 14, "535 < BS <= 745"},
899 { 15, "745 < BS <= 1038"},
900 { 16, "1038 < BS <= 1446"},
901 { 17, "1446 < BS <= 2014"},
902 { 18, "2014 < BS <= 2806"},
903 { 19, "2806 < BS <= 3909"},
904 { 20, "3909 < BS <= 5446"},
905 { 21, "5446 < BS <= 7587"},
906 { 22, "7587 < BS <= 10570"},
907 { 23, "10570 < BS <= 14726"},
908 { 24, "14726 < BS <= 20516"},
909 { 25, "20516 < BS <= 28581"},
910 { 26, "28581 < BS <= 39818"},
911 { 27, "39818 < BS <= 55474"},
912 { 28, "55474 < BS <= 77284"},
913 { 29, "77284 < BS <= 107669"},
914 { 30, "107669 < BS <= 150000"},
915 { 31, "BS > 150000"},
918 static value_string_ext buffer_size_5bits_vals_ext
= VALUE_STRING_EXT_INIT(buffer_size_5bits_vals
);
921 static const value_string buffer_size_8bits_vals
[] =
924 { 1, "0 < BS <= 10"},
925 { 2, "10 < BS <= 11"},
926 { 3, "11 < BS <= 12"},
927 { 4, "12 < BS <= 13"},
928 { 5, "13 < BS <= 14"},
929 { 6, "14 < BS <= 15"},
930 { 7, "15 < BS <= 16"},
931 { 8, "16 < BS <= 17"},
932 { 9, "17 < BS <= 18"},
933 { 10, "18 < BS <= 19"},
934 { 11, "19 < BS <= 20"},
935 { 12, "20 < BS <= 22"},
936 { 13, "22 < BS <= 23"},
937 { 14, "23 < BS <= 25"},
938 { 15, "25 < BS <= 26"},
939 { 16, "26 < BS <= 28"},
940 { 17, "28 < BS <= 30"},
941 { 18, "30 < BS <= 32"},
942 { 19, "32 < BS <= 34"},
943 { 20, "34 < BS <= 36"},
944 { 21, "36 < BS <= 38"},
945 { 22, "38 < BS <= 40"},
946 { 23, "40 < BS <= 43"},
947 { 24, "43 < BS <= 46"},
948 { 25, "46 < BS <= 49"},
949 { 26, "49 < BS <= 52"},
950 { 27, "52 < BS <= 55"},
951 { 28, "52 < BS <= 59"},
952 { 29, "59 < BS <= 62"},
953 { 30, "62 < BS <= 66"},
954 { 31, "66 < BS <= 71"},
955 { 32, "71 < BS <= 75"},
956 { 33, "75 < BS <= 80"},
957 { 34, "80 < BS <= 85"},
958 { 35, "85 < BS <= 91"},
959 { 36, "91 < BS <= 97"},
960 { 37, "97 < BS <= 103"},
961 { 38, "103 < BS <= 110"},
962 { 39, "110 < BS <= 117"},
963 { 40, "117 < BS <= 124"},
964 { 41, "124 < BS <= 132"},
965 { 42, "132 < BS <= 141"},
966 { 43, "141 < BS <= 150"},
967 { 44, "150 < BS <= 160"},
968 { 45, "160 < BS <= 170"},
969 { 46, "170 < BS <= 181"},
970 { 47, "181 < BS <= 193"},
971 { 48, "193 < BS <= 205"},
972 { 49, "205 < BS <= 218"},
973 { 50, "218 < BS <= 233"},
974 { 51, "233 < BS <= 248"},
975 { 52, "248 < BS <= 264"},
976 { 53, "264 < BS <= 281"},
977 { 54, "281 < BS <= 299"},
978 { 55, "299 < BS <= 318"},
979 { 56, "318 < BS <= 339"},
980 { 57, "339 < BS <= 361"},
981 { 58, "361 < BS <= 384"},
982 { 59, "384 < BS <= 409"},
983 { 60, "409 < BS <= 436"},
984 { 61, "436 < BS <= 464"},
985 { 62, "464 < BS <= 494"},
986 { 63, "494 < BS <= 526"},
987 { 64, "526 < BS <= 560"},
988 { 65, "560 < BS <= 597"},
989 { 66, "597 < BS <= 635"},
990 { 67, "635 < BS <= 677"},
991 { 68, "677 < BS <= 720"},
992 { 69, "720 < BS <= 767"},
993 { 70, "767 < BS <= 817"},
994 { 71, "817 < BS <= 870"},
995 { 72, "870 < BS <= 926"},
996 { 73, "926 < BS <= 987"},
997 { 74, "987 < BS <= 1051"},
998 { 75, "1051 < BS <= 1119"},
999 { 76, "1119 < BS <= 1191"},
1000 { 77, "1191 < BS <= 1269"},
1001 { 78, "1269 < BS <= 1351"},
1002 { 79, "1351 < BS <= 1439"},
1003 { 80, "1439 < BS <= 1532"},
1004 { 81, "1532 < BS <= 1631"},
1005 { 82, "1631 < BS <= 1737"},
1006 { 83, "1737 < BS <= 1850"},
1007 { 84, "1850 < BS <= 1970"},
1008 { 85, "1970 < BS <= 2098"},
1009 { 86, "2098 < BS <= 2234"},
1010 { 87, "2234 < BS <= 2379"},
1011 { 88, "2379 < BS <= 2533"},
1012 { 89, "2533 < BS <= 2698"},
1013 { 90, "2698 < BS <= 2873"},
1014 { 91, "2873 < BS <= 3059"},
1015 { 92, "3059 < BS <= 3258"},
1016 { 93, "3258 < BS <= 3469"},
1017 { 94, "3469 < BS <= 3694"},
1018 { 95, "3694 < BS <= 3934"},
1019 { 96, "3934 < BS <= 4189"},
1020 { 97, "4189 < BS <= 4461"},
1021 { 98, "4461 < BS <= 4751"},
1022 { 99, "4751 < BS <= 5059"},
1023 { 100, "5059 < BS <= 5387"},
1024 { 101, "5387 < BS <= 5737"},
1025 { 102, "5737 < BS <= 6109"},
1026 { 103, "6109 < BS <= 6506"},
1027 { 104, "6506 < BS <= 6928"},
1028 { 105, "6928 < BS <= 7378"},
1029 { 106, "7378 < BS <= 7857"},
1030 { 107, "7857 < BS <= 8367"},
1031 { 108, "8367 < BS <= 8910"},
1032 { 109, "8910 < BS <= 9488"},
1033 { 110, "9488 < BS <= 10104"},
1034 { 111, "10104 < BS <= 10760"},
1035 { 112, "10760 < BS <= 11458"},
1036 { 113, "11458 < BS <= 12202"},
1037 { 114, "12202 < BS <= 12994"},
1038 { 115, "12994 < BS <= 13838"},
1039 { 116, "13838 < BS <= 14736"},
1040 { 117, "14736 < BS <= 15692"},
1041 { 118, "15692 < BS <= 16711"},
1042 { 119, "16711 < BS <= 17795"},
1043 { 120, "17795 < BS <= 18951"},
1044 { 121, "18951 < BS <= 20181"},
1045 { 122, "20181 < BS <= 21491"},
1046 { 123, "21491 < BS <= 22885"},
1047 { 124, "22885 < BS <= 24371"},
1048 { 125, "24371 < BS <= 25953"},
1049 { 126, "25953 < BS <= 27638"},
1050 { 127, "27638 < BS <= 29431"},
1051 { 128, "29431 < BS <= 31342"},
1052 { 129, "31342 < BS <= 33376"},
1053 { 130, "33376 < BS <= 35543"},
1054 { 131, "35543 < BS <= 37850"},
1055 { 132, "37850 < BS <= 40307"},
1056 { 133, "40307 < BS <= 42923"},
1057 { 134, "42923 < BS <= 45709"},
1058 { 135, "45709 < BS <= 48676"},
1059 { 136, "48676 < BS <= 51836"},
1060 { 137, "51836 < BS <= 55200"},
1061 { 138, "55200 < BS <= 58784"},
1062 { 139, "58784 < BS <= 62599"},
1063 { 140, "62599 < BS <= 66663"},
1064 { 141, "66663 < BS <= 70990"},
1065 { 142, "70990 < BS <= 75598"},
1066 { 143, "75598 < BS <= 80505"},
1067 { 144, "80505 < BS <= 85730"},
1068 { 145, "85730 < BS <= 91295"},
1069 { 146, "91295 < BS <= 97221"},
1070 { 147, "97221 < BS <= 103532"},
1071 { 148, "103532 < BS <= 110252"},
1072 { 149, "110252 < BS <= 117409"},
1073 { 150, "117409 < BS <= 125030"},
1074 { 151, "125030 < BS <= 133146"},
1075 { 152, "133146 < BS <= 141789"},
1076 { 153, "141789 < BS <= 150992"},
1077 { 154, "150992 < BS <= 160793"},
1078 { 155, "160793 < BS <= 171231"},
1079 { 156, "171231 < BS <= 182345"},
1080 { 157, "182345 < BS <= 194182"},
1081 { 158, "194182 < BS <= 206786"},
1082 { 159, "206786 < BS <= 220209"},
1083 { 160, "220209 < BS <= 234503"},
1084 { 161, "234503 < BS <= 249725"},
1085 { 162, "249725 < BS <= 265935"},
1086 { 163, "265935 < BS <= 283197"},
1087 { 164, "283197 < BS <= 301579"},
1088 { 165, "301579 < BS <= 321155"},
1089 { 166, "321155 < BS <= 342002"},
1090 { 167, "342002 < BS <= 364202"},
1091 { 168, "364202 < BS <= 387842"},
1092 { 169, "387842 < BS <= 413018"},
1093 { 170, "413018 < BS <= 439827"},
1094 { 171, "439827 < BS <= 468377"},
1095 { 172, "468377 < BS <= 498780"},
1096 { 173, "498780 < BS <= 531156"},
1097 { 174, "531156 < BS <= 565634"},
1098 { 175, "565634 < BS <= 602350"},
1099 { 176, "602350 < BS <= 641449"},
1100 { 177, "641449 < BS <= 683087"},
1101 { 178, "683087 < BS <= 727427"},
1102 { 179, "727427 < BS <= 774645"},
1103 { 180, "774645 < BS <= 824928"},
1104 { 181, "824928 < BS <= 878475"},
1105 { 182, "878475 < BS <= 935498"},
1106 { 183, "935498 < BS <= 996222"},
1107 { 184, "996222 < BS <= 1060888"},
1108 { 185, "1060888 < BS <= 1129752"},
1109 { 186, "1129752 < BS <= 1203085"},
1110 { 187, "1203085 < BS <= 1281179"},
1111 { 188, "1281179 < BS <= 1364342"},
1112 { 189, "1364342 < BS <= 1452903"},
1113 { 190, "1452903 < BS <= 1547213"},
1114 { 191, "1547213 < BS <= 1647644"},
1115 { 192, "1647644 < BS <= 1754595"},
1116 { 193, "1754595 < BS <= 1868488"},
1117 { 194, "1868488 < BS <= 1989774"},
1118 { 195, "1989774 < BS <= 2118933"},
1119 { 196, "2118933 < BS <= 2256475"},
1120 { 197, "2256475 < BS <= 2402946"},
1121 { 198, "2402946 < BS <= 2558924"},
1122 { 199, "2558924 < BS <= 2725027"},
1123 { 200, "2725027 < BS <= 2901912"},
1124 { 201, "2901912 < BS <= 3090279"},
1125 { 202, "3090279 < BS <= 3290873"},
1126 { 203, "3290873 < BS <= 3504487"},
1127 { 204, "3504487 < BS <= 3731968"},
1128 { 205, "3731968 < BS <= 3974215"},
1129 { 206, "3974215 < BS <= 4232186"},
1130 { 207, "4232186 < BS <= 4506902"},
1131 { 208, "4506902 < BS <= 4799451"},
1132 { 209, "4799451 < BS <= 5110989"},
1133 { 210, "5110989 < BS <= 5442750"},
1134 { 211, "5442750 < BS <= 5796046"},
1135 { 212, "5796046 < BS <= 6172275"},
1136 { 213, "6172275 < BS <= 6572925"},
1137 { 214, "6572925 < BS <= 6999582"},
1138 { 215, "6999582 < BS <= 7453933"},
1139 { 216, "7453933 < BS <= 7937777"},
1140 { 217, "7937777 < BS <= 8453028"},
1141 { 218, "8453028 < BS <= 9001725"},
1142 { 219, "9001725 < BS <= 9586039"},
1143 { 220, "9586039 < BS <= 10208280"},
1144 { 221, "10208280 < BS <= 10870913"},
1145 { 222, "10870913 < BS <= 11576557"},
1146 { 223, "11576557 < BS <= 12328006"},
1147 { 224, "12328006 < BS <= 13128233"},
1148 { 225, "13128233 < BS <= 13980403"},
1149 { 226, "13980403 < BS <= 14887889"},
1150 { 227, "14887889 < BS <= 15854280"},
1151 { 228, "15854280 < BS <= 16883401"},
1152 { 229, "16883401 < BS <= 17979324"},
1153 { 230, "17979324 < BS <= 19146385"},
1154 { 231, "19146385 < BS <= 20389201"},
1155 { 232, "20389201 < BS <= 21712690"},
1156 { 233, "21712690 < BS <= 23122088"},
1157 { 234, "23122088 < BS <= 24622972"},
1158 { 235, "24622972 < BS <= 26221280"},
1159 { 236, "26221280 < BS <= 27923336"},
1160 { 237, "27923336 < BS <= 29735875"},
1161 { 238, "29735875 < BS <= 31666069"},
1162 { 239, "31666069 < BS <= 33721553"},
1163 { 240, "33721553 < BS <= 35910462"},
1164 { 241, "35910462 < BS <= 38241455"},
1165 { 242, "38241455 < BS <= 40723756"},
1166 { 243, "40723756 < BS <= 43367187"},
1167 { 244, "43367187 < BS <= 46182206"},
1168 { 245, "46182206 < BS <= 49179951"},
1169 { 246, "49179951 < BS <= 52372284"},
1170 { 247, "52372284 < BS <= 55771835"},
1171 { 248, "55771835 < BS <= 59392055"},
1172 { 249, "59392055 < BS <= 63247269"},
1173 { 250, "63247269 < BS <= 67352729"},
1174 { 251, "67352729 < BS <= 71724679"},
1175 { 252, "71724679 < BS <= 76380419"},
1176 { 253, "76380419 < BS <= 81338368"},
1177 { 254, "BS > 81338368"},
1181 static value_string_ext buffer_size_8bits_vals_ext
= VALUE_STRING_EXT_INIT(buffer_size_8bits_vals
);
1183 static const value_string tpc_command_vals
[] =
1198 static const true_false_string power_backoff_affects_power_management_vals
=
1200 "Power backoff is applied to power management",
1201 "Power backoff not applied to power management"
1204 static const true_false_string phr_source_vals
=
1206 "PH based on reference format",
1207 "PH based on real transmission",
1210 static const true_false_string activation_deactivation_vals
=
1216 static const true_false_string c_vals
=
1218 "Octets containing Resource Serving Cell ID field(s) and Resource BWP ID field(s) are present",
1219 "Octets containing Resource Serving Cell ID field(s) and Resource BWP ID field(s) are not present"
1222 static const true_false_string sul_vals
=
1224 "Applies to the SUL carrier configuration",
1225 "Applies to the NUL carrier configuration"
1228 static const true_false_string sp_srs_act_deact_f_vals
=
1230 "NZP CSI-RS resource index is used",
1231 "SSB index or SRS resource index is used"
1234 static const true_false_string aper_csi_trigger_state_t_vals
=
1236 "Mapped to the codepoint of the DCI CSI request field",
1237 "Not mapped to the codepoint of the DCI CSI request field"
1240 static const value_string bit_rate_vals
[] =
1242 { 0, "no bit rate recommendation"},
1258 { 16, "104 kbit/s"},
1259 { 17, "120 kbit/s"},
1260 { 18, "140 kbit/s"},
1261 { 19, "160 kbit/s"},
1262 { 20, "180 kbit/s"},
1263 { 21, "200 kbit/s"},
1264 { 22, "220 kbit/s"},
1265 { 23, "240 kbit/s"},
1266 { 24, "260 kbit/s"},
1267 { 25, "280 kbit/s"},
1268 { 26, "300 kbit/s"},
1269 { 27, "350 kbit/s"},
1270 { 28, "400 kbit/s"},
1271 { 29, "450 kbit/s"},
1272 { 30, "500 kbit/s"},
1273 { 31, "600 kbit/s"},
1274 { 32, "700 kbit/s"},
1275 { 33, "800 kbit/s"},
1276 { 34, "900 kbit/s"},
1277 { 35, "1000 kbit/s"},
1278 { 36, "1100 kbit/s"},
1279 { 37, "1200 kbit/s"},
1280 { 38, "1300 kbit/s"},
1281 { 39, "1400 kbit/s"},
1282 { 40, "1500 kbit/s"},
1283 { 41, "1750 kbit/s"},
1284 { 42, "2000 kbit/s"},
1285 { 43, "2250 kbit/s"},
1286 { 44, "2500 kbit/s"},
1287 { 45, "2750 kbit/s"},
1288 { 46, "3000 kbit/s"},
1289 { 47, "3500 kbit/s"},
1290 { 48, "4000 kbit/s"},
1291 { 49, "4500 kbit/s"},
1292 { 50, "5000 kbit/s"},
1293 { 51, "5500 kbit/s"},
1294 { 52, "6000 kbit/s"},
1295 { 53, "6500 kbit/s"},
1296 { 54, "7000 kbit/s"},
1297 { 55, "7500 kbit/s"},
1298 { 56, "8000 kbit/s"},
1301 static value_string_ext bit_rate_vals_ext
= VALUE_STRING_EXT_INIT(bit_rate_vals
);
1304 static const true_false_string msgb_t1_vals
= {
1305 "Random Access Preamble ID present",
1309 static const true_false_string msgb_t2_vals
= {
1311 "Backoff Indicator",
1314 static const true_false_string msgb_s_vals
= {
1315 "MAC subPDU(s) for MAC SDU present",
1316 "MAC subPDU(s) for MAC SDU *NOT* present"
1320 /* Forward declarations */
1321 static int dissect_mac_nr(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void*);
1323 static int dissect_ulsch_or_dlsch(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1324 proto_item
*pdu_ti
, uint32_t offset
,
1325 mac_nr_info
*p_mac_nr_info
,
1326 mac_3gpp_tap_info
*tap_info
);
1329 /* Write the given formatted text to:
1330 - the info column (if pinfo != NULL)
1331 - 1 or 2 other labels (optional)
1333 static void write_pdu_label_and_info(proto_item
*ti1
, proto_item
*ti2
,
1334 packet_info
*pinfo
, const char *format
, ...) G_GNUC_PRINTF(4,5);
1335 static void write_pdu_label_and_info(proto_item
*ti1
, proto_item
*ti2
,
1336 packet_info
*pinfo
, const char *format
, ...)
1338 #define MAX_INFO_BUFFER 256
1339 static char info_buffer
[MAX_INFO_BUFFER
];
1342 if ((ti1
== NULL
) && (ti2
== NULL
) && (pinfo
== NULL
)) {
1346 va_start(ap
, format
);
1347 vsnprintf(info_buffer
, MAX_INFO_BUFFER
, format
, ap
);
1350 /* Add to indicated places */
1351 if (pinfo
!= NULL
) {
1352 col_append_str(pinfo
->cinfo
, COL_INFO
, info_buffer
);
1355 proto_item_append_text(ti1
, "%s", info_buffer
);
1358 proto_item_append_text(ti2
, "%s", info_buffer
);
1362 /* Version of function above, where no vsnprintf() call needed */
1363 static void write_pdu_label_and_info_literal(proto_item
*ti1
, proto_item
*ti2
,
1364 packet_info
*pinfo
, const char *info_buffer
)
1366 /* Add to indicated places */
1367 if (pinfo
!= NULL
) {
1368 col_append_str(pinfo
->cinfo
, COL_INFO
, info_buffer
);
1371 proto_item_append_text(ti1
, "%s", info_buffer
);
1374 proto_item_append_text(ti2
, "%s", info_buffer
);
1379 call_with_catch_all(dissector_handle_t handle
, tvbuff_t
* tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1381 /* Call it (catch exceptions so that stats will be updated) */
1384 call_dissector_only(handle
, tvb
, pinfo
, tree
, NULL
);
1392 /* Dissect BCCH PDU */
1393 static void dissect_bcch(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1396 mac_nr_info
*p_mac_nr_info
,
1397 mac_3gpp_tap_info
*tap_info _U_
)
1401 write_pdu_label_and_info(pdu_ti
, NULL
, pinfo
,
1402 "BCCH PDU (%u bytes, on %s transport) ",
1403 tvb_reported_length_remaining(tvb
, offset
),
1404 val_to_str_const(p_mac_nr_info
->rntiType
,
1405 bcch_transport_channel_vals
,
1408 /* Show which transport layer it came in on (inferred from RNTI type) */
1409 ti
= proto_tree_add_uint(tree
, hf_mac_nr_context_bcch_transport_channel
,
1410 tvb
, offset
, 0, p_mac_nr_info
->rntiType
);
1411 proto_item_set_generated(ti
);
1413 /****************************************/
1414 /* Whole frame is BCCH data */
1417 ti
= proto_tree_add_item(tree
, hf_mac_nr_bcch_pdu
,
1418 tvb
, offset
, -1, ENC_NA
);
1420 if (global_mac_nr_attempt_rrc_decode
) {
1421 /* Attempt to decode payload using NR RRC dissector */
1422 dissector_handle_t protocol_handle
;
1423 tvbuff_t
*rrc_tvb
= tvb_new_subset_remaining(tvb
, offset
);
1425 if (p_mac_nr_info
->rntiType
== NO_RNTI
) {
1426 protocol_handle
= nr_rrc_bcch_bch_handle
;
1428 protocol_handle
= nr_rrc_bcch_dl_sch_handle
;
1431 /* Hide raw view of bytes */
1432 proto_item_set_hidden(ti
);
1434 call_with_catch_all(protocol_handle
, rrc_tvb
, pinfo
, tree
);
1438 /* Dissect PCCH PDU */
1439 static void dissect_pcch(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1440 proto_item
*pdu_ti
, int offset
,
1441 mac_nr_info
*p_mac_nr_info _U_
,
1442 mac_3gpp_tap_info
*tap_info _U_
)
1446 write_pdu_label_and_info(pdu_ti
, NULL
, pinfo
,
1447 "PCCH PDU (%u bytes) ",
1448 tvb_reported_length_remaining(tvb
, offset
));
1450 /****************************************/
1451 /* Whole frame is PCCH data */
1453 /* Always show as raw data */
1454 ti
= proto_tree_add_item(tree
, hf_mac_nr_pcch_pdu
,
1455 tvb
, offset
, -1, ENC_NA
);
1457 // TODO: add to tap_info->number_of_paging_ids. See LTE.
1459 if (global_mac_nr_attempt_rrc_decode
) {
1461 /* Attempt to decode payload using NR RRC dissector */
1462 tvbuff_t
*rrc_tvb
= tvb_new_subset_remaining(tvb
, offset
);
1464 /* Hide raw view of bytes */
1465 proto_item_set_hidden(ti
);
1467 call_with_catch_all(nr_rrc_pcch_handle
, rrc_tvb
, pinfo
, tree
);
1472 /* Common to RAR and MSGB */
1473 static int dissect_fallbackrar(proto_tree
*tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
,
1474 proto_item
*ti
, proto_item
*pdu_ti
, uint32_t rapid
)
1476 /* 1 reserved bit */
1477 proto_tree_add_item(tree
, hf_mac_nr_rar_reserved1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1481 proto_tree_add_item_ret_uint(tree
, hf_mac_nr_rar_ta
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &ta
);
1484 /* Break down the 27-bits of the grant field, according to 38.213, section 8.2 */
1485 static int * const rar_grant_fields
[] = {
1486 &hf_mac_nr_rar_grant_hopping
,
1487 &hf_mac_nr_rar_grant_fra
,
1488 &hf_mac_nr_rar_grant_tsa
,
1489 &hf_mac_nr_rar_grant_mcs
,
1490 &hf_mac_nr_rar_grant_tcsp
,
1491 &hf_mac_nr_rar_grant_csi
,
1494 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_mac_nr_rar_grant
,
1495 ett_mac_nr_rar_grant
, rar_grant_fields
, ENC_BIG_ENDIAN
);
1498 /* C-RNTI (2 bytes) */
1500 proto_tree_add_item_ret_uint(tree
, hf_mac_nr_rar_temp_crnti
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &c_rnti
);
1503 write_pdu_label_and_info(pdu_ti
, ti
, pinfo
,
1504 "(RAPID=%u TA=%u Temp C-RNTI=%u) ", rapid
, ta
, c_rnti
);
1510 static void dissect_rar(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1511 proto_item
*pdu_ti _U_
, uint32_t offset
,
1512 mac_nr_info
*p_mac_nr_info
, mac_3gpp_tap_info
*tap_info
)
1514 write_pdu_label_and_info(pdu_ti
, NULL
, pinfo
,
1515 "RAR (RA-RNTI=%u) ",
1516 p_mac_nr_info
->rnti
);
1518 /* Create hidden 'virtual root' so can filter on mac-nr.rar */
1519 proto_item
*ti
= proto_tree_add_item(tree
, hf_mac_nr_rar
, tvb
, offset
, -1, ENC_NA
);
1520 proto_item_set_hidden(ti
);
1526 proto_item
*subheader_ti
= proto_tree_add_item(tree
,
1527 hf_mac_nr_rar_subheader
,
1528 tvb
, offset
, 0, ENC_ASCII
);
1529 proto_tree
*rar_subheader_tree
= proto_item_add_subtree(subheader_ti
, ett_mac_nr_rar_subheader
);
1531 /* Note extension & T bits */
1532 proto_tree_add_item_ret_boolean(rar_subheader_tree
, hf_mac_nr_rar_e
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &E
);
1533 proto_tree_add_item_ret_boolean(rar_subheader_tree
, hf_mac_nr_rar_t
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &T
);
1538 /* 2 reserved bits */
1539 proto_tree_add_item(rar_subheader_tree
, hf_mac_nr_rar_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1543 proto_tree_add_item_ret_uint(rar_subheader_tree
, hf_mac_nr_rar_bi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &BI
);
1546 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
1552 proto_tree_add_item_ret_uint(rar_subheader_tree
, hf_mac_nr_rar_rapid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &rapid
);
1556 /* SubPDU. Not for SI request - TODO: define RAPID range for SI request in mac_nr_info */
1558 offset
= dissect_fallbackrar(rar_subheader_tree
, pinfo
, tvb
, offset
, subheader_ti
, pdu_ti
, rapid
);
1560 tap_info
->number_of_rars
++;
1562 /* Set subheader (+subpdu..) length */
1563 proto_item_set_end(subheader_ti
, tvb
, offset
);
1567 /* Any remaining length is padding */
1568 if (tvb_reported_length_remaining(tvb
, offset
)) {
1569 proto_tree_add_item(tree
, hf_mac_nr_padding
, tvb
, offset
, -1, ENC_NA
);
1572 /* Update padding bytes in stats */
1573 tap_info
->padding_bytes
+= (p_mac_nr_info
->length
- offset
);
1576 static void dissect_msgb(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1577 proto_item
*pdu_ti _U_
, uint32_t offset
,
1578 mac_nr_info
*p_mac_nr_info
, mac_3gpp_tap_info
*tap_info
)
1580 write_pdu_label_and_info(pdu_ti
, NULL
, pinfo
,
1581 "MSGB (MSGB-RNTI=%u) ",
1582 p_mac_nr_info
->rnti
);
1584 /* Create hidden 'virtual root' so can filter on mac-nr.msgb */
1585 proto_item
*ti
= proto_tree_add_item(tree
, hf_mac_nr_msgb
, tvb
, offset
, -1, ENC_NA
);
1586 proto_item_set_hidden(ti
);
1590 /* N.B. T2 only present if T1 is 0 */
1591 /* N.B. T2 indicates BI (can only appear in first subheader */
1595 proto_item
*subheader_ti
= proto_tree_add_item(tree
,
1596 hf_mac_nr_msgb_subheader
,
1597 tvb
, offset
, 0, ENC_ASCII
);
1598 proto_tree
*msgb_subheader_tree
= proto_item_add_subtree(subheader_ti
, ett_mac_nr_rar_subheader
);
1600 /* Note extension & T1, T2 bits */
1601 proto_tree_add_item_ret_boolean(msgb_subheader_tree
, hf_mac_nr_msgb_e
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &E
);
1602 proto_tree_add_item_ret_boolean(msgb_subheader_tree
, hf_mac_nr_msgb_t1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &T1
);
1605 proto_tree_add_item_ret_boolean(msgb_subheader_tree
, hf_mac_nr_msgb_t2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &T2
);
1609 /* RAPID (FallbackRAR MAC subheader) */
1611 proto_tree_add_item_ret_uint(msgb_subheader_tree
, hf_mac_nr_rar_rapid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &rapid
);
1614 /* FallbackRAR (see 6.2.3a) */
1615 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
, "FallbackRAR ");
1616 offset
= dissect_fallbackrar(msgb_subheader_tree
, pinfo
, tvb
, offset
,
1617 subheader_ti
, pdu_ti
, rapid
);
1623 /* 1 reserved bit */
1624 proto_tree_add_item(msgb_subheader_tree
, hf_mac_nr_msgb_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1626 /* N.B., should define & use own BI field? */
1627 proto_tree_add_item_ret_uint(msgb_subheader_tree
, hf_mac_nr_rar_bi
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &BI
);
1630 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
1634 /* Read S (MAC SDU Indicator) */
1635 proto_tree_add_item_ret_boolean(msgb_subheader_tree
, hf_mac_nr_msgb_s
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &S
);
1637 /* 4 reserved bits */
1638 proto_tree_add_item(msgb_subheader_tree
, hf_mac_nr_msgb_reserved2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1641 /* successRAR is in 6.2.3a-2 */
1642 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
, "SuccessRAR ");
1644 /* UE Contention Resolution Identity */
1645 proto_tree_add_item(msgb_subheader_tree
, hf_mac_nr_control_ue_contention_resolution_identity
,
1646 tvb
, offset
, 6, ENC_NA
);
1650 proto_tree_add_item(msgb_subheader_tree
, hf_mac_nr_msgb_reserved3
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1651 /* ChannelAccess-CPext */
1652 proto_tree_add_item(msgb_subheader_tree
, hf_mac_nr_msgb_channelaccess_cpext
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1654 proto_tree_add_item(msgb_subheader_tree
, hf_mac_nr_msgb_tpc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1655 /* HARQ Feedback Timing Indicator */
1656 proto_tree_add_item(msgb_subheader_tree
, hf_mac_nr_msgb_harq_feedback_timing_indicator
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1659 /* PUCCH Resource Indicator */
1660 proto_tree_add_item(msgb_subheader_tree
, hf_mac_nr_msgb_pucch_resource_indicator
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1661 /* Timing Advance Command */
1662 uint32_t ta_command
;
1663 proto_tree_add_item_ret_uint(msgb_subheader_tree
, hf_mac_nr_msgb_ta_command
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &ta_command
);
1668 proto_tree_add_item_ret_uint(msgb_subheader_tree
, hf_mac_nr_rar_temp_crnti
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &c_rnti
);
1671 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
1672 "(C-RNTI=%u, TA=%u) ", c_rnti
, ta_command
);
1675 /* subPDU(s) for MAC SDU present */
1676 offset
= dissect_ulsch_or_dlsch(tvb
, pinfo
, tree
, pdu_ti
, offset
,
1681 /* Set subheader (+subpdu..) length */
1682 proto_item_set_end(subheader_ti
, tvb
, offset
);
1686 /* Any remaining length is padding */
1687 if (tvb_reported_length_remaining(tvb
, offset
)) {
1688 proto_tree_add_item(tree
, hf_mac_nr_padding
, tvb
, offset
, -1, ENC_NA
);
1691 /* Update padding bytes in stats */
1692 tap_info
->padding_bytes
+= (p_mac_nr_info
->length
- offset
);
1696 static bool is_fixed_sized_lcid(uint8_t lcid
, uint8_t direction
)
1698 if (direction
== DIRECTION_UPLINK
) {
1701 case 35: /* RedCap CCCH (48 bits) */
1702 case 36: /* RedCap CCCH1 (64 bits) */
1703 case CCCH_48_BITS_LCID
:
1704 case TIMING_ADVANCE_REPORT_LCID
:
1705 case RECOMMENDED_BIT_RATE_QUERY_LCID
:
1706 case CONFIGURED_GRANT_CONFIGURATION_LCID
:
1707 case SINGLE_ENTRY_PHR_LCID
:
1709 case SHORT_TRUNCATED_BSR_LCID
:
1710 case SHORT_BSR_LCID
:
1719 case TWO_OCTET_ELCID_FIELD
:
1720 case ONE_OCTET_ELCID_FIELD
:
1721 case RECOMMENDED_BIT_RATE_LCID
:
1722 case SP_ZP_CSI_RS_RESOURCE_SET_ACT_DEACT_LCID
:
1723 case PUCCH_SPATIAL_REL_ACT_DEACT_LCID
:
1724 case SP_CSI_REPORT_ON_PUCCH_ACT_DEACT_LCID
:
1725 case TCI_STATE_IND_FOR_UE_SPEC_PDCCH_LCID
:
1726 case DUPLICATION_ACTIVATION_DEACTIVATION_LCID
:
1727 case SCELL_ACTIVATION_DEACTIVATION_4_LCID
:
1728 case SCELL_ACTIVATION_DEACTIVATION_1_LCID
:
1729 case LONG_DRX_COMMAND_LCID
:
1730 case DRX_COMMAND_LCID
:
1731 case TIMING_ADVANCE_COMMAND_LCID
:
1732 case UE_CONTENTION_RESOLUTION_IDENTITY_LCID
:
1741 static bool is_fixed_sized_elcid(uint8_t elcid
, uint8_t direction
)
1743 if (direction
== DIRECTION_UPLINK
) {
1745 case ENHANCED_SINGLE_ENTRY_PHR_FOR_MULTIPLE_TRP
:
1746 /* Enhanced Single Entry PHR for multiple TRP */
1747 case POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_REQUEST
:
1748 /* Positioning Measurement Gap Activation/Deactivation Request */
1749 case CASE_6_TIMING_REQUEST
:
1750 /* Case-6 Timing Request */
1751 case DESIRED_GUARD_SYMBOLS_FOR_CASE_6_TIMING
:
1752 /* Desired Guard Symbols for Case 6 timing */
1753 case DESIRED_GUARD_SYMBOLS_FOR_CASE_7_TIMING
:
1754 /* Desired Guard Symbols for Case 7 timing*/
1755 case EXTENDED_SHORT_TRUNCATED_BSR
:
1756 /* Extended Short Truncated BSR */
1757 case EXTENDED_SHORT_BSR
:
1758 /* Extended Short BSR */
1759 case MULTIPLE_ENTRY_CONFIGURED_GRANT_CONFIRMATION
:
1760 /* Multiple Entry Configured Grant Confirmation 4 octets*/
1761 case SIDELINK_CONFIGURED_GRANT_CONFIRMATION
:
1762 /* Sidelink Configured Grant Confirmation 1 oct*/
1763 case DESIRED_GUARD_SYMBOLS
:
1764 /* Desired Guard Symbols 3 oct*/
1767 /* Enhanced Multiple Entry PHR for multiple TRP (one octets Ci) */
1768 /* 234 Enhanced Single Entry PHR*/
1769 /* 235 Enhanced BFR (one octet Ci) */
1770 /* 236 Enhanced BFR (four octet Ci) */
1771 /* 237 Truncated Enhanced BFR(four octet Ci) */
1772 /* 239 IAB-MT Recommended Beam Indication */
1773 /* 240 Desired IAB-MT PSD range */
1774 /* 241 Desired DL Tx Power Adjustment */
1775 /* 246 Extended Long Truncated BSR */
1776 /* 248 Extended Long BSR */
1777 /* 249 Extended Pre-emptive BSR */
1778 /* 250 BFR (four octets Ci) */
1779 /* 251 Truncated BFR (four octets Ci)*/
1780 /* 255 Pre-emptive BSR */
1786 case DIFFERENTIAL_KOFFSET_ELCD
:
1787 /* Differential Koffset, 6bits(1 oct)*/
1788 case ENHANCED_TCI_STATES_INDICATION_FOR_UE_SPECIFIC_PDCCH_ELCD
:
1789 /* Enhanced TCI States Indication for UE-specific PDCCH 3 oct*/
1790 case POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_COMMAND_ELCD
:
1791 /* Positioning Measurement Gap Activation/Deactivation Command 1 oct*/
1792 case CASE_7_TIMING_ADVANCE_OFFSET_ELCD
:
1793 /* Case-7 Timing advance offset 2 oct*/
1794 case PROVIDED_GUARD_SYMBOLS_FOR_CASE_6_TIMING_ELCD
:
1795 /* Provided Guard Symbols for Case-6 timing 3 oct*/
1796 case PROVIDED_GUARD_SYMBOLS_FOR_CASE_7_TIMING_ELCD
:
1797 /* Provided Guard Symbols for Case-7 timing 3 oct*/
1798 case SRS_PATHLOSS_REFERENCE_RS_UPDATE_ELCD
:
1799 /* SRS Pathloss Reference RS Update 3 oct*/
1800 case DUPLICATION_RLC_ACTIVATION_DEACTIVATION_ELCD
:
1801 /* Duplication RLC Activation/Deactivation 1 oct*/
1802 case ABSOLUTE_TIMING_ADVANCE_COMMAND_ELCD
:
1803 /* Absolute Timing Advance Command 2 oct*/
1804 case PROVIDED_GUARD_SYMBOLS_ELCD
:
1805 /* Provided Guard Symbols 4 oct*/
1806 case TIMING_DELTA_ELCD
:
1807 /* Timing Delta 2 oct*/
1810 /* 227 Serving Cell Set based SRS TCI State Indication */
1811 /* 228 SP/AP SRS TCI State Indication */
1812 /* 229 BFD-RS Indication */
1813 /* 231 Enhanced SCell Activation/Deactivation with one octet Ci field */
1814 /* 232 Enhanced SCell Activation/Deactivation with four octet Ci field */
1815 /* 233 Unified TCI States Activation/Deactivation */
1816 /* 234 PUCCH Power Control Set Update for multiple TRP PUCCH repetition*/
1817 /* 235 PUCCH spatial relation Activation/Deactivation for multiple TRP PUCCH repetition */
1818 /* 238 PPW Activation/Deactivation Command */
1819 /* 239 DL Tx Power Adjustment */
1820 /* 240 Timing Case Indication*/
1821 /* 241 Child IAB-DU Restricted Beam Indication*/
1822 /* 245 Serving Cell Set based SRS Spatial Relation Indication */
1823 /* 246 PUSCH Pathloss Reference RS Update */
1824 /* 248 Enhanced SP/AP SRS Spatial Relation Indication */
1825 /* 249 Enhanced PUCCH Spatial Relation Activation/Deactivation */
1826 /* 250 Enhanced TCI States Activation/Deactivation for UE-specific PDSCH */
1827 /* 253 SP Positioning SRS Activation/Deactivation */
1832 static true_false_string subheader_f_vals
= {
1838 /* Returns new subtree that was added for this item */
1839 static proto_item
* dissect_me_phr_ph(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
1840 int ph_item
, int pcmax_f_c_item
,
1841 uint32_t *PH
, uint32_t *offset
)
1843 /* Subtree for this entry */
1844 proto_item
*entry_ti
= proto_tree_add_item(tree
,
1845 hf_mac_nr_control_me_phr_entry
,
1846 tvb
, *offset
, 0, ENC_ASCII
);
1847 proto_tree
*entry_tree
= proto_item_add_subtree(entry_ti
, ett_mac_nr_me_phr_entry
);
1850 proto_tree_add_item(entry_tree
, hf_mac_nr_control_me_phr_p
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
1853 proto_tree_add_item_ret_boolean(entry_tree
, hf_mac_nr_control_me_phr_v
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
, &V
);
1854 /* PH. TODO: infer whether value relates to Type1 (PUSCH), Type2 (PUCCH) or Type3 (SRS).
1856 - there needs to be a separate field for each SCellIndex and type OR
1857 - a generated field added with the inferred type OR
1858 - just do proto_item_append_text() indicating what the type was
1860 proto_tree_add_item_ret_uint(entry_tree
, ph_item
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
, PH
);
1864 /* Reserved (2 bits) */
1865 proto_tree_add_item(entry_tree
, hf_mac_nr_control_me_phr_reserved_2
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
1866 /* pcmax_f_c (6 bits) */
1867 proto_tree_add_item(entry_tree
, pcmax_f_c_item
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
1871 proto_item_set_end(entry_ti
, tvb
, *offset
);
1876 static uint8_t get_rlc_seqnum_length(rlc_bearer_type_t rlc_bearer_type
)
1878 switch (rlc_bearer_type
) {
1896 /* Lookup bearer details for lcid */
1897 static bool lookup_rlc_bearer_from_lcid(uint16_t ueid
,
1900 rlc_bearer_type_t
*rlc_bearer_type
, /* out */
1901 uint8_t *seqnum_length
, /* out */
1902 int *drb_id
, /* out */
1903 bool *is_srb
) /* out */
1905 /* Zero params (in case no match is found) */
1906 *rlc_bearer_type
= rlcRaw
;
1912 if (global_mac_nr_lcid_drb_source
== (int)FromStaticTable
) {
1914 /* Look up in static (UAT) table */
1916 for (m
=0; m
< num_lcid_drb_mappings
; m
++) {
1917 if (lcid
== lcid_drb_mappings
[m
].lcid
) {
1919 /* Found, set out parameters */
1920 if (direction
== DIRECTION_UPLINK
) {
1921 *rlc_bearer_type
= lcid_drb_mappings
[m
].bearer_type_ul
;
1924 *rlc_bearer_type
= lcid_drb_mappings
[m
].bearer_type_dl
;
1926 *seqnum_length
= get_rlc_seqnum_length(*rlc_bearer_type
);
1927 *drb_id
= lcid_drb_mappings
[m
].drbid
;
1931 if (lcid
==3 || lcid
==4) {
1932 /* Wasn't found as DRB, so lets assume SRB-3 (or SRB-4) */
1938 /* Look up the dynamic mappings for this UE */
1939 ue_dynamic_drb_mappings_t
*ue_mappings
= (ue_dynamic_drb_mappings_t
*)g_hash_table_lookup(mac_nr_ue_bearers_hash
, GUINT_TO_POINTER((unsigned)ueid
));
1941 /* No entry for this UE.. */
1942 if (lcid
==3 || lcid
==4) {
1949 *is_srb
= ue_mappings
->srb3_set
;
1952 *is_srb
= ue_mappings
->srb4_set
;
1955 /* Look up setting gleaned from configuration protocol */
1956 if (!ue_mappings
->mapping
[lcid
].valid
) {
1960 /* Found, set out params */
1961 *rlc_bearer_type
= (direction
== DIRECTION_UPLINK
) ?
1962 ue_mappings
->mapping
[lcid
].bearer_type_ul
:
1963 ue_mappings
->mapping
[lcid
].bearer_type_dl
;
1964 *seqnum_length
= get_rlc_seqnum_length(*rlc_bearer_type
);
1965 *drb_id
= ue_mappings
->mapping
[lcid
].drbid
;
1972 /* Helper function to call RLC dissector for SDUs (where channel params are known) */
1973 static void call_rlc_dissector(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
1975 int offset
, uint16_t data_length
,
1976 uint8_t mode
, uint8_t direction
, uint16_t ueid
,
1977 uint8_t bearerType
, uint8_t bearerId
,
1978 uint8_t sequenceNumberLength
,
1979 uint8_t priority _U_
)
1981 tvbuff_t
*rb_tvb
= tvb_new_subset_length(tvb
, offset
, data_length
);
1982 struct rlc_nr_info
*p_rlc_nr_info
;
1984 /* Reuse or create RLC info */
1985 p_rlc_nr_info
= (rlc_nr_info
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_rlc_nr
, 0);
1986 if (p_rlc_nr_info
== NULL
) {
1987 p_rlc_nr_info
= wmem_new0(wmem_file_scope(), struct rlc_nr_info
);
1990 /* Fill in details for channel */
1991 p_rlc_nr_info
->rlcMode
= mode
;
1992 p_rlc_nr_info
->direction
= direction
;
1993 /* p_rlc_nr_info->priority = priority; */
1994 p_rlc_nr_info
->ueid
= ueid
;
1995 p_rlc_nr_info
->bearerType
= bearerType
;
1996 p_rlc_nr_info
->bearerId
= bearerId
;
1997 p_rlc_nr_info
->pduLength
= data_length
;
1998 p_rlc_nr_info
->sequenceNumberLength
= sequenceNumberLength
;
2000 /* Store info in packet */
2001 p_add_proto_data(wmem_file_scope(), pinfo
, proto_rlc_nr
, 0, p_rlc_nr_info
);
2003 if (global_mac_nr_layer_to_show
!= ShowRLCLayer
) {
2004 /* Don't want these columns replaced */
2005 col_set_writable(pinfo
->cinfo
, -1, false);
2008 /* Clear info column before first RLC PDU */
2009 if (s_number_of_rlc_pdus_shown
== 0) {
2010 col_clear(pinfo
->cinfo
, COL_INFO
);
2013 /* Add a separator and protect column contents here */
2014 write_pdu_label_and_info_literal(pdu_ti
, NULL
, pinfo
, " || ");
2015 col_set_fence(pinfo
->cinfo
, COL_INFO
);
2018 s_number_of_rlc_pdus_shown
++;
2020 /* Call it (catch exceptions so that stats will be updated) */
2021 call_with_catch_all(rlc_nr_handle
, rb_tvb
, pinfo
, tree
);
2023 /* Let columns be written to again */
2024 col_set_writable(pinfo
->cinfo
, -1, true);
2027 /* see 3GPP 38.133 Table 10.1.17.1-1 */
2029 mac_nr_phr_fmt(char *s
, uint32_t v
)
2031 int32_t val
= (int32_t)v
;
2034 snprintf(s
, ITEM_LABEL_LENGTH
, "PH < -32 dB (0)");
2035 } else if (val
== 63) {
2036 snprintf(s
, ITEM_LABEL_LENGTH
, "PH >= 38 dB (63)");
2037 } else if (val
<= 54) {
2038 snprintf(s
, ITEM_LABEL_LENGTH
, "%d dB <= PH < %d dB (%d)", val
- 33, val
- 32, val
);
2040 snprintf(s
, ITEM_LABEL_LENGTH
, "%d dB <= PH < %d dB (%d)", 22 + 2 * (val
- 55), 24 + 2 * (val
- 55), val
);
2044 /* see 3GPP 38.133 Table 10.1.18.1-1 */
2046 mac_nr_pcmax_f_c_fmt(char *s
, uint32_t v
)
2048 int32_t val
= (int32_t)v
;
2051 snprintf(s
, ITEM_LABEL_LENGTH
, "Pcmax,f,c < -29 dBm (0)");
2052 } else if (val
== 63) {
2053 snprintf(s
, ITEM_LABEL_LENGTH
, "Pcmax,f,c >= 33 dBm (63)");
2055 snprintf(s
, ITEM_LABEL_LENGTH
, "%d dBm <= Pcmax,f,c < %d dBm (%d)", val
- 30, val
- 29, val
);
2059 /* UL-SCH and DL-SCH formats have much in common, so handle them in a common
2061 static int dissect_ulsch_or_dlsch(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
2062 proto_item
*pdu_ti
, uint32_t offset
,
2063 mac_nr_info
*p_mac_nr_info
,
2064 mac_3gpp_tap_info
*tap_info
)
2066 bool ces_seen
= false;
2067 bool data_seen
= false;
2069 write_pdu_label_and_info(pdu_ti
, NULL
, pinfo
,
2071 (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) ? "UL-SCH" : "DL-SCH");
2073 tap_info
->raw_length
= p_mac_nr_info
->length
;
2075 /************************************************************************/
2076 /* Dissect each sub-pdu. */
2079 proto_item
*subheader_ti
= proto_tree_add_item(tree
,
2080 hf_mac_nr_subheader
,
2081 tvb
, offset
, 0, ENC_ASCII
);
2082 proto_tree
*subheader_tree
= proto_item_add_subtree(subheader_ti
, ett_mac_nr_subheader
);
2086 uint32_t SDU_length
=0;
2088 /* 1st bit is always reserved */
2089 /* 2nd bit depends upon LCID */
2090 uint8_t lcid
= tvb_get_uint8(tvb
, offset
) & 0x3f;
2093 case TWO_OCTET_ELCID_FIELD
:
2094 elcid
= tvb_get_uint16(tvb
, offset
+1, ENC_BIG_ENDIAN
);
2097 case ONE_OCTET_ELCID_FIELD
:
2098 elcid
= tvb_get_uint8(tvb
, offset
+1);
2099 fixed_len
= is_fixed_sized_elcid(elcid
, p_mac_nr_info
->direction
);
2104 /* No elcid present */
2105 fixed_len
= is_fixed_sized_lcid(lcid
, p_mac_nr_info
->direction
);
2108 proto_tree_add_bits_item(subheader_tree
, hf_mac_nr_subheader_reserved
, tvb
, offset
<<3, 2, ENC_BIG_ENDIAN
);
2111 proto_tree_add_bits_item(subheader_tree
, hf_mac_nr_subheader_reserved
, tvb
, offset
<<3, 1, ENC_BIG_ENDIAN
);
2112 /* Data, so check F bit and length */
2113 proto_tree_add_item_ret_boolean(subheader_tree
, hf_mac_nr_subheader_f
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &F
);
2116 /* LCID (UL or DL) */
2117 proto_tree_add_uint(subheader_tree
,
2118 (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) ?
2119 hf_mac_nr_ulsch_lcid
: hf_mac_nr_dlsch_lcid
,
2120 tvb
, offset
, 1, lcid
);
2121 /* Also add LCID as a hidden, direction-less field */
2122 proto_item
*bi_di_lcid
= proto_tree_add_uint(subheader_tree
, hf_mac_nr_lcid
, tvb
, offset
, 1, lcid
);
2123 proto_item_set_hidden(bi_di_lcid
);
2126 /* Show eLCID, if present */
2128 case TWO_OCTET_ELCID_FIELD
:
2129 elcid
= tvb_get_uint16(tvb
, offset
, ENC_BIG_ENDIAN
);
2130 proto_tree_add_uint(subheader_tree
,
2131 (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) ?
2132 hf_mac_nr_ulsch_elcid_2oct
: hf_mac_nr_dlsch_elcid_2oct
,
2133 tvb
, offset
, 2, elcid
);
2136 case ONE_OCTET_ELCID_FIELD
:
2137 elcid
= tvb_get_uint8(tvb
, offset
);
2138 proto_tree_add_uint(subheader_tree
,
2139 (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) ?
2140 hf_mac_nr_ulsch_elcid_1oct
: hf_mac_nr_dlsch_elcid_1oct
,
2141 tvb
, offset
, 1, elcid
);
2153 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_subheader_length_2_bytes
, tvb
, offset
, 2, ENC_BIG_ENDIAN
, &SDU_length
);
2158 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_subheader_length_1_byte
, tvb
, offset
, 1, ENC_BIG_ENDIAN
, &SDU_length
);
2163 if (lcid
<= 32 || (p_mac_nr_info
->direction
== DIRECTION_UPLINK
&&
2164 (lcid
== 35 || lcid
== 36 || lcid
== CCCH_48_BITS_LCID
))) {
2165 proto_item
*sch_pdu_ti
;
2167 /* Note whether this sub-pdu gets dissected by RLC/RRC */
2168 bool dissected_by_upper_layer
= false;
2170 /* Add SDU, for now just as hex data */
2171 if (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) {
2172 /* UL. Check various CCCH LCIDs */
2173 if ((lcid
== CCCH_LCID
) || (lcid
== 36)) {
2175 } else if ((lcid
== CCCH_48_BITS_LCID
) || (lcid
== 35)) {
2178 sch_pdu_ti
= proto_tree_add_item(subheader_tree
, hf_mac_nr_ulsch_sdu
,
2179 tvb
, offset
, SDU_length
, ENC_NA
);
2183 sch_pdu_ti
= proto_tree_add_item(subheader_tree
, hf_mac_nr_dlsch_sdu
,
2184 tvb
, offset
, SDU_length
, ENC_NA
);
2187 bool is_srb
= false;
2188 if (lcid
== 3 || lcid
== 4) {
2189 /* Work out whether we are to assume that we are dealing with SRB-3 or SRB-4 */
2190 rlc_bearer_type_t rlc_bearer_type
;
2191 uint8_t seqnum_length
;
2194 lookup_rlc_bearer_from_lcid(p_mac_nr_info
->ueid
,
2196 p_mac_nr_info
->direction
,
2203 /* Might also call RLC if configured to do so for this SDU */
2204 if ((lcid
>= 3) && (lcid
<= 32) && !is_srb
) {
2205 /* Look for DRB mapping for this LCID to drb channel set by UAT table */
2206 rlc_bearer_type_t rlc_bearer_type
;
2207 uint8_t seqnum_length
;
2210 tap_info
->sdus_for_lcid
[lcid
]++;
2211 tap_info
->bytes_for_lcid
[lcid
] += SDU_length
;
2213 // TODO: priority not set.
2214 uint8_t priority
= 0;
2215 lookup_rlc_bearer_from_lcid(p_mac_nr_info
->ueid
,
2217 p_mac_nr_info
->direction
,
2223 /* Dissect according to channel type */
2224 switch (rlc_bearer_type
) {
2227 call_rlc_dissector(tvb
, pinfo
, tree
, pdu_ti
, offset
, SDU_length
,
2228 RLC_UM_MODE
, p_mac_nr_info
->direction
, p_mac_nr_info
->ueid
,
2229 BEARER_TYPE_DRB
, drb_id
, seqnum_length
,
2231 dissected_by_upper_layer
= true;
2235 call_rlc_dissector(tvb
, pinfo
, tree
, pdu_ti
, offset
, SDU_length
,
2236 RLC_AM_MODE
, p_mac_nr_info
->direction
, p_mac_nr_info
->ueid
,
2237 BEARER_TYPE_DRB
, drb_id
, seqnum_length
,
2239 dissected_by_upper_layer
= true;
2242 call_rlc_dissector(tvb
, pinfo
, tree
, pdu_ti
, offset
, SDU_length
,
2243 RLC_TM_MODE
, p_mac_nr_info
->direction
, p_mac_nr_info
->ueid
,
2244 BEARER_TYPE_DRB
, drb_id
, 0,
2246 dissected_by_upper_layer
= true;
2249 /* Nothing to do! */
2252 } else if ((lcid
>= 1 && lcid
<= 2) || ((lcid
==3 || lcid
==4) && is_srb
)) {
2254 tap_info
->sdus_for_lcid
[lcid
]++;
2255 tap_info
->bytes_for_lcid
[lcid
] += SDU_length
;
2257 if (global_mac_nr_attempt_srb_decode
) {
2258 /* SRB, call RLC dissector */
2259 /* These are defaults (38.331, 9.2.1) - only priority may be overridden, but not passing in yet. */
2260 call_rlc_dissector(tvb
, pinfo
, tree
, pdu_ti
, offset
, SDU_length
,
2261 RLC_AM_MODE
, p_mac_nr_info
->direction
, p_mac_nr_info
->ueid
,
2262 BEARER_TYPE_SRB
, lcid
, 12,
2263 (lcid
== 2) ? 3 : 1);
2264 dissected_by_upper_layer
= true;
2266 } else if (global_mac_nr_attempt_rrc_decode
) {
2267 dissector_handle_t protocol_handle
;
2268 tvbuff_t
*rrc_tvb
= tvb_new_subset_length(tvb
, offset
, SDU_length
);
2270 if (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) {
2271 protocol_handle
= ((lcid
== CCCH_LCID
) || (lcid
== 36)) ?
2272 nr_rrc_ul_ccch1_handle
:
2273 nr_rrc_ul_ccch_handle
;
2275 protocol_handle
= nr_rrc_dl_ccch_handle
;
2277 /* Hide raw view of bytes */
2278 proto_item_set_hidden(sch_pdu_ti
);
2279 call_with_catch_all(protocol_handle
, rrc_tvb
, pinfo
, tree
);
2280 dissected_by_upper_layer
= true;
2283 /* Only write summary to Info column if didn't send to upper_layer dissector */
2284 write_pdu_label_and_info(pdu_ti
, subheader_ti
, dissected_by_upper_layer
? NULL
: pinfo
,
2285 "(LCID:%u %u bytes) ", lcid
, SDU_length
);
2287 offset
+= SDU_length
;
2290 if (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) {
2292 expert_add_info_format(pinfo
, subheader_ti
, &ei_mac_nr_ul_sch_control_subheader_before_data_subheader
,
2293 "UL-SCH: should not have Data SDUs after Control Elements");
2299 /* UL Control Elements */
2301 /* Add some space to info column between entries */
2302 if (data_seen
|| ces_seen
) {
2303 col_append_str(pinfo
->cinfo
, COL_INFO
, " ");
2306 if (lcid
!= PADDING_LCID
) {
2310 if (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) {
2311 uint32_t phr_ph
, phr_pcmax_f_c
, c_rnti
, lcg_id
, bs
, br_lcid
, bit_rate
;
2315 case TWO_OCTET_ELCID_FIELD
:
2316 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
, "(Identity of the logical channel %u) ", elcid
);
2318 case ONE_OCTET_ELCID_FIELD
:
2320 case ENHANCED_MULTIPLE_ENTRY_PHR_FOR_MULTIPLE_TRP_FOUR_OCTETS_CI
:
2321 /* It has a variable size, */
2322 offset
+= SDU_length
;
2324 case ENHANCED_MULTIPLE_ENTRY_PHR_FOR_MULTIPLE_TRP_ONE_OCTETS_CI
:
2325 /* It has a variable size, */
2326 offset
+= SDU_length
;
2328 case ENHANCED_SINGLE_ENTRY_PHR_FOR_MULTIPLE_TRP
:
2329 /* It has a fixed size and consists of three octets */
2332 case ENHANCED_MULTIPLE_ENTRY_PHR_FOUR_OCTETS_CI
:
2333 /* has a variable size */
2334 offset
+= SDU_length
;
2336 case ENHANCED_MULTIPLE_ENTRY_PHR_ONE_OCTETS_CI
:
2337 offset
+= SDU_length
;
2339 case ENHANCED_SINGLE_ENTRY_PHR
:
2340 /* has a variable size */
2341 offset
+= SDU_length
;
2343 case ENHANCED_BFR_ONE_OCTET_CI
:
2344 /* have a variable size */
2345 offset
+= SDU_length
;
2347 case ENHANCED_BFR_FOUR_OCTET_CI
:
2348 /* have a variable size*/
2349 offset
+= SDU_length
;
2351 case TRUNCATED_ENHANCED_BFR_FOUR_OCTET_CI
:
2352 /* have a variable size*/
2353 offset
+= SDU_length
;
2355 case POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_REQUEST
:
2356 /* It has a fixed size of zero bits */
2358 case IAB_MT_RECOMMENDED_BEAM_INDICATION
:
2359 /* It has a variable size */
2360 offset
+= SDU_length
;
2362 case DESIRED_IAB_MT_PSD_RANGE
:
2364 case DESIRED_DL_TX_POWER_ADJUSTMENT
:
2366 case CASE_6_TIMING_REQUEST
:
2368 case DESIRED_GUARD_SYMBOLS_FOR_CASE_6_TIMING
:
2370 case DESIRED_GUARD_SYMBOLS_FOR_CASE_7_TIMING
:
2372 case EXTENDED_SHORT_TRUNCATED_BSR
:
2374 case EXTENDED_LONG_TRUNCATED_BSR
:
2376 case EXTENDED_SHORT_BSR
:
2378 case EXTENDED_LONG_BSR
:
2380 case EXTENDED_PRE_EMPTIVE_BSR
:
2382 case BFR_FOUR_OCTETS_CI
:
2384 case TRUNCATED_BFR_FOUR_OCTETS_CI
:
2386 case MULTIPLE_ENTRY_CONFIGURED_GRANT_CONFIRMATION
:
2388 case SIDELINK_CONFIGURED_GRANT_CONFIRMATION
:
2390 case DESIRED_GUARD_SYMBOLS
:
2392 case PRE_EMPTIVE_BSR
:
2398 case TRUNCATED_ENHANCED_BFR_LCID
:
2400 offset
+= SDU_length
;
2402 case TIMING_ADVANCE_REPORT_LCID
:
2404 /* Reserved (2 bits) */
2405 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_timing_advance_report_reserved
,
2406 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2407 /* Timing Advance */
2409 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_timing_advance_report_ta
,
2410 tvb
, offset
, 2, ENC_BIG_ENDIAN
, &ta
);
2411 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
, "(Timing Advance Report TA=%u) ", ta
);
2416 case TRUNCATED_SIDELINK_BSR_LCID
:
2417 /* No description? */
2419 case SIDELINK_BSR_LCID
:
2420 /* No description? */
2422 case LBT_FAILURE_4_OCTETS_LCID
:
2425 case LBT_FAILURE_1_OCTET_LCID
:
2430 offset
+= SDU_length
;
2432 case TRUNCATED_BFR_LCID
:
2433 offset
+= SDU_length
;
2435 /* CCCH_48_BITS_LCID Handled above*/
2436 case RECOMMENDED_BIT_RATE_QUERY_LCID
:
2437 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_recommended_bit_rate_query_lcid
,
2438 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &br_lcid
);
2439 proto_tree_add_item_ret_boolean(subheader_tree
, hf_mac_nr_control_recommended_bit_rate_query_dir
,
2440 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &dir
);
2441 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_recommended_bit_rate_query_bit_rate
,
2442 tvb
, offset
, 2, ENC_BIG_ENDIAN
, &bit_rate
);
2443 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_recommended_bit_rate_query_reserved
,
2444 tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
2445 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
2446 "(Recommended BR Query LCID=%u Dir=%s BR=%s) ", br_lcid
, dir
? "UL" : "DL",
2447 val_to_str_ext_const(bit_rate
, &bit_rate_vals_ext
, "Unknown"));
2450 case CONFIGURED_GRANT_CONFIGURATION_LCID
:
2451 /* Fixed size of zero bits */
2452 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
2453 "(Configured Grant Config) ");
2455 case MULTIPLE_ENTRY_PHR_1_LCID
:
2456 case MULTIPLE_ENTRY_PHR_4_LCID
:
2458 static int* const me_phr_byte1_flags
[] = {
2459 &hf_mac_nr_control_me_phr_c7_flag
,
2460 &hf_mac_nr_control_me_phr_c6_flag
,
2461 &hf_mac_nr_control_me_phr_c5_flag
,
2462 &hf_mac_nr_control_me_phr_c4_flag
,
2463 &hf_mac_nr_control_me_phr_c3_flag
,
2464 &hf_mac_nr_control_me_phr_c2_flag
,
2465 &hf_mac_nr_control_me_phr_c1_flag
,
2466 &hf_mac_nr_control_me_phr_reserved
,
2469 static int* const me_phr_byte2_flags
[] = {
2470 &hf_mac_nr_control_me_phr_c15_flag
,
2471 &hf_mac_nr_control_me_phr_c14_flag
,
2472 &hf_mac_nr_control_me_phr_c13_flag
,
2473 &hf_mac_nr_control_me_phr_c12_flag
,
2474 &hf_mac_nr_control_me_phr_c11_flag
,
2475 &hf_mac_nr_control_me_phr_c10_flag
,
2476 &hf_mac_nr_control_me_phr_c9_flag
,
2477 &hf_mac_nr_control_me_phr_c8_flag
,
2480 static int* const me_phr_byte3_flags
[] = {
2481 &hf_mac_nr_control_me_phr_c23_flag
,
2482 &hf_mac_nr_control_me_phr_c22_flag
,
2483 &hf_mac_nr_control_me_phr_c21_flag
,
2484 &hf_mac_nr_control_me_phr_c20_flag
,
2485 &hf_mac_nr_control_me_phr_c19_flag
,
2486 &hf_mac_nr_control_me_phr_c18_flag
,
2487 &hf_mac_nr_control_me_phr_c17_flag
,
2488 &hf_mac_nr_control_me_phr_c16_flag
,
2491 static int* const me_phr_byte4_flags
[] = {
2492 &hf_mac_nr_control_me_phr_c31_flag
,
2493 &hf_mac_nr_control_me_phr_c30_flag
,
2494 &hf_mac_nr_control_me_phr_c29_flag
,
2495 &hf_mac_nr_control_me_phr_c28_flag
,
2496 &hf_mac_nr_control_me_phr_c27_flag
,
2497 &hf_mac_nr_control_me_phr_c26_flag
,
2498 &hf_mac_nr_control_me_phr_c25_flag
,
2499 &hf_mac_nr_control_me_phr_c24_flag
,
2502 uint32_t start_offset
= offset
;
2503 uint8_t scell_bitmap1
;
2504 uint32_t scell_bitmap2_3_4
= 0;
2505 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, me_phr_byte1_flags
, ENC_NA
);
2506 scell_bitmap1
= tvb_get_uint8(tvb
, offset
);
2508 if (lcid
== MULTIPLE_ENTRY_PHR_4_LCID
) {
2509 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, me_phr_byte2_flags
, ENC_NA
);
2510 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
+ 1, 1, me_phr_byte3_flags
, ENC_NA
);
2511 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
+ 2, 1, me_phr_byte4_flags
, ENC_NA
);
2512 scell_bitmap2_3_4
= tvb_get_letoh24(tvb
, offset
); /* read them in little endian on purpose */
2516 static int* const ph_fields1
[] = {
2517 &hf_mac_nr_control_me_phr_ph_c1
,
2518 &hf_mac_nr_control_me_phr_ph_c2
,
2519 &hf_mac_nr_control_me_phr_ph_c3
,
2520 &hf_mac_nr_control_me_phr_ph_c4
,
2521 &hf_mac_nr_control_me_phr_ph_c5
,
2522 &hf_mac_nr_control_me_phr_ph_c6
,
2523 &hf_mac_nr_control_me_phr_ph_c7
,
2525 static int* const ph_fields2_3_4
[] = {
2526 &hf_mac_nr_control_me_phr_ph_c8
,
2527 &hf_mac_nr_control_me_phr_ph_c9
,
2528 &hf_mac_nr_control_me_phr_ph_c10
,
2529 &hf_mac_nr_control_me_phr_ph_c11
,
2530 &hf_mac_nr_control_me_phr_ph_c12
,
2531 &hf_mac_nr_control_me_phr_ph_c13
,
2532 &hf_mac_nr_control_me_phr_ph_c14
,
2533 &hf_mac_nr_control_me_phr_ph_c15
,
2534 &hf_mac_nr_control_me_phr_ph_c16
,
2535 &hf_mac_nr_control_me_phr_ph_c17
,
2536 &hf_mac_nr_control_me_phr_ph_c18
,
2537 &hf_mac_nr_control_me_phr_ph_c19
,
2538 &hf_mac_nr_control_me_phr_ph_c20
,
2539 &hf_mac_nr_control_me_phr_ph_c21
,
2540 &hf_mac_nr_control_me_phr_ph_c22
,
2541 &hf_mac_nr_control_me_phr_ph_c23
,
2542 &hf_mac_nr_control_me_phr_ph_c24
,
2543 &hf_mac_nr_control_me_phr_ph_c25
,
2544 &hf_mac_nr_control_me_phr_ph_c26
,
2545 &hf_mac_nr_control_me_phr_ph_c27
,
2546 &hf_mac_nr_control_me_phr_ph_c28
,
2547 &hf_mac_nr_control_me_phr_ph_c29
,
2548 &hf_mac_nr_control_me_phr_ph_c30
,
2549 &hf_mac_nr_control_me_phr_ph_c31
,
2554 proto_item
* entry_ti
;
2555 if (p_mac_nr_info
->phr_type2_othercell
) {
2556 /* The PH and PCMAX,f,c fields can be either for a LTE or NR cell */
2557 entry_ti
= dissect_me_phr_ph(tvb
, pinfo
, subheader_ti
, hf_mac_nr_control_me_phr_ph_type2_spcell
,
2558 hf_mac_nr_control_me_phr_pcmax_f_c_type2_spcell
, &PH
, &offset
);
2559 proto_item_append_text(entry_ti
, " (Type2, SpCell PH=%u)", PH
);
2561 entry_ti
= dissect_me_phr_ph(tvb
, pinfo
, subheader_ti
, hf_mac_nr_control_me_phr_ph_type1_pcell
,
2562 hf_mac_nr_control_me_phr_pcmax_f_c_type1_pcell
, &PH
, &offset
);
2563 proto_item_append_text(entry_ti
, " (Type1, PCell PH=%u)", PH
);
2567 /* The PH and PCMAX,f,c fields can be either for a LTE or NR cell */
2568 for (int n
= 1; n
<= 7; n
++) {
2569 if (scell_bitmap1
& (1 << n
)) {
2570 entry_ti
= dissect_me_phr_ph(tvb
, pinfo
, subheader_ti
, *ph_fields1
[n
- 1],
2571 hf_mac_nr_control_me_phr_pcmax_f_c_typeX
, &PH
, &offset
);
2572 proto_item_append_text(entry_ti
, " (SCellIndex %d PH=%u)", n
, PH
);
2575 if (lcid
== MULTIPLE_ENTRY_PHR_4_LCID
) {
2576 for (int n
= 0; n
<= 23; n
++) {
2577 if (scell_bitmap2_3_4
& (1 << n
)) {
2578 entry_ti
= dissect_me_phr_ph(tvb
, pinfo
, subheader_ti
, *ph_fields2_3_4
[n
],
2579 hf_mac_nr_control_me_phr_pcmax_f_c_typeX
, &PH
, &offset
);
2580 proto_item_append_text(entry_ti
, " (SCellIndex %d PH=%u)", n
+ 8, PH
);
2585 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
2586 "(Multi-entry PHR) ");
2588 /* Make sure dissected length matches signalled length */
2589 if (offset
!= start_offset
+ SDU_length
) {
2590 proto_tree_add_expert_format(subheader_tree
, pinfo
, &ei_mac_nr_sdu_length_different_from_dissected
,
2591 tvb
, start_offset
, offset
- start_offset
,
2592 "A Multiple-Entry PHR subheader has a length field of %u bytes, but "
2593 "dissected %u bytes", SDU_length
, offset
- start_offset
);
2594 /* Assume length was correct, so at least can dissect further subheaders */
2595 offset
= start_offset
+ SDU_length
;
2599 case SINGLE_ENTRY_PHR_LCID
:
2600 /* R R PH (6 bits) */
2601 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_se_phr_reserved
,
2602 tvb
, offset
, 1, ENC_NA
);
2603 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_se_phr_ph
,
2604 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &phr_ph
);
2607 /* R R PCMAX_f_c (6 bits) */
2608 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_se_phr_reserved
,
2609 tvb
, offset
, 1, ENC_NA
);
2610 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_se_phr_pcmax_f_c
,
2611 tvb
, offset
, 1, ENC_NA
, &phr_pcmax_f_c
);
2613 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
2614 "(PHR PH=%u PCMAX_f_c=%u) ", phr_ph
, phr_pcmax_f_c
);
2617 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_crnti
,
2618 tvb
, offset
, 2, ENC_BIG_ENDIAN
, &c_rnti
);
2619 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
2620 "(C-RNTI=%u) ", c_rnti
);
2623 case SHORT_TRUNCATED_BSR_LCID
:
2624 case SHORT_BSR_LCID
:
2626 static int* const hf_mac_nr_control_bsr_short_bs_lcg
[] = {
2627 &hf_mac_nr_control_bsr_short_bs_lcg0
,
2628 &hf_mac_nr_control_bsr_short_bs_lcg1
,
2629 &hf_mac_nr_control_bsr_short_bs_lcg2
,
2630 &hf_mac_nr_control_bsr_short_bs_lcg3
,
2631 &hf_mac_nr_control_bsr_short_bs_lcg4
,
2632 &hf_mac_nr_control_bsr_short_bs_lcg5
,
2633 &hf_mac_nr_control_bsr_short_bs_lcg6
,
2634 &hf_mac_nr_control_bsr_short_bs_lcg7
2637 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_bsr_short_lcg
,
2638 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &lcg_id
);
2639 proto_tree_add_item_ret_uint(subheader_tree
, *hf_mac_nr_control_bsr_short_bs_lcg
[lcg_id
],
2640 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &bs
);
2641 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
2642 "(Short %sBSR LCG ID=%u BS=%u) ",
2643 lcid
== SHORT_BSR_LCID
? "" : "Truncated ", lcg_id
, bs
);
2647 case LONG_TRUNCATED_BSR_LCID
:
2649 static int* const long_bsr_flags
[] = {
2650 &hf_mac_nr_control_bsr_long_lcg7
,
2651 &hf_mac_nr_control_bsr_long_lcg6
,
2652 &hf_mac_nr_control_bsr_long_lcg5
,
2653 &hf_mac_nr_control_bsr_long_lcg4
,
2654 &hf_mac_nr_control_bsr_long_lcg3
,
2655 &hf_mac_nr_control_bsr_long_lcg2
,
2656 &hf_mac_nr_control_bsr_long_lcg1
,
2657 &hf_mac_nr_control_bsr_long_lcg0
,
2661 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, long_bsr_flags
, ENC_NA
);
2662 unsigned CE_start
= offset
;
2665 while ((offset
- CE_start
) < SDU_length
) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_trunc_long_bs
, tvb
, offset
++, 1, ENC_NA
);
2667 /* TODO: show in string here how many BSs were seen */
2668 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
2669 "(Long Truncated BSR) ");
2671 if (SDU_length
> 7) {
2672 proto_tree_add_expert_format(subheader_tree
, pinfo
, &ei_mac_nr_sdu_length_different_from_dissected
,
2673 tvb
, CE_start
, SDU_length
,
2674 "A Long Truncated BSR subheader should have a length field up to 7 bytes, but "
2675 "is set to %u bytes", SDU_length
);
2681 static int* const long_bsr_flags
[] = {
2682 &hf_mac_nr_control_bsr_long_lcg7
,
2683 &hf_mac_nr_control_bsr_long_lcg6
,
2684 &hf_mac_nr_control_bsr_long_lcg5
,
2685 &hf_mac_nr_control_bsr_long_lcg4
,
2686 &hf_mac_nr_control_bsr_long_lcg3
,
2687 &hf_mac_nr_control_bsr_long_lcg2
,
2688 &hf_mac_nr_control_bsr_long_lcg1
,
2689 &hf_mac_nr_control_bsr_long_lcg0
,
2693 uint8_t flags
= tvb_get_uint8(tvb
, offset
);
2694 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, long_bsr_flags
, ENC_NA
);
2695 unsigned CE_start
= offset
;
2698 /* Show BSR values. */
2699 if (flags
& 0x01) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_long_bs_lcg0
, tvb
, offset
++, 1, ENC_NA
);
2700 if (flags
& 0x02) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_long_bs_lcg1
, tvb
, offset
++, 1, ENC_NA
);
2701 if (flags
& 0x04) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_long_bs_lcg2
, tvb
, offset
++, 1, ENC_NA
);
2702 if (flags
& 0x08) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_long_bs_lcg3
, tvb
, offset
++, 1, ENC_NA
);
2703 if (flags
& 0x10) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_long_bs_lcg4
, tvb
, offset
++, 1, ENC_NA
);
2704 if (flags
& 0x20) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_long_bs_lcg5
, tvb
, offset
++, 1, ENC_NA
);
2705 if (flags
& 0x40) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_long_bs_lcg6
, tvb
, offset
++, 1, ENC_NA
);
2706 if (flags
& 0x80) proto_tree_add_item(subheader_tree
, hf_mac_nr_control_bsr_long_bs_lcg7
, tvb
, offset
++, 1, ENC_NA
);
2708 /* TODO: show in string here how many BSs were seen */
2709 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
2713 /* Make sure dissected length matches signalled length */
2714 if ((offset
- CE_start
) != SDU_length
) {
2715 proto_tree_add_expert_format(subheader_tree
, pinfo
, &ei_mac_nr_sdu_length_different_from_dissected
,
2716 tvb
, CE_start
, offset
- CE_start
,
2717 "A Long BSR subheader has a length field of %u bytes, but "
2718 "dissected %u bytes", SDU_length
, offset
- CE_start
);
2719 /* Assume length was correct, so at least can dissect further subheaders */
2720 offset
= CE_start
+ SDU_length
;
2726 /* The rest of the PDU is padding */
2727 int pad_len
= tvb_reported_length_remaining(tvb
, offset
);
2729 proto_tree_add_item(subheader_tree
, hf_mac_nr_padding
, tvb
, offset
, -1, ENC_NA
);
2730 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
, "(Padding %u bytes) ", pad_len
);
2731 /* Move to the end of the frame */
2732 offset
= tvb_reported_length(tvb
);
2738 /* Downlink control elements */
2739 uint32_t ta_tag_id
, ta_ta
, br_lcid
, bit_rate
;
2742 if (lcid
!= PADDING_LCID
) {
2744 expert_add_info_format(pinfo
, subheader_ti
, &ei_mac_nr_dl_sch_control_subheader_after_data_subheader
,
2745 "DL-SCH: should not have Control Elements after Data SDUs");
2749 case TWO_OCTET_ELCID_FIELD
:
2752 case ONE_OCTET_ELCID_FIELD
:
2754 case SERVING_CELL_SET_BASED_SRS_TCI_STATE_INDICATIONS_ELCD
:
2756 case SP_AP_SRS_TCI_STATE_INDICATION_ELCD
:
2758 case BFD_RS_INDICATION_ELCD
:
2760 case DIFFERENTIAL_KOFFSET_ELCD
:
2763 proto_tree_add_item(subheader_tree
, hf_mac_nr_differential_koffset_reserved
,
2764 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2765 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_differential_koffset
,
2766 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &koffset
);
2768 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
2769 "(Differential Koffset %u) ", koffset
);
2772 case ENHANCED_SCELL_ACTIVATION_DEACTIVATION_MAC_CE_WITH_ONE_OCTET_CI_FIELD_ELCD
:
2774 case ENHANCED_SCELL_ACTIVATION_DEACTIVATION_MAC_CE_WITH_FOUR_OCTET_CI_FIELD_ELCD
:
2776 case UNIFIED_TCI_STATES_ACTIVATION_DEACTIVATION_ELCD
:
2778 case PUCCH_POWER_CONTROL_SET_UPDATE_FOR_MULTIPLE_TRP_PUCCH_REPETITION__ELCD
:
2780 case PUCCH_SPATIAL_RELATION_ACTIVATION_DEACTIVATION_FOR_MULTIPLE_TRP_PUCCH_REPETITION_ELCD
:
2782 case ENHANCED_TCI_STATES_INDICATION_FOR_UE_SPECIFIC_PDCCH_ELCD
:
2784 case POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_COMMAND_ELCD
:
2786 case PPW_ACTIVATION_DEACTIVATION_COMMAND_ELCD
:
2788 case DL_TX_POWER_ADJUSTMENT_ELCD
:
2790 case TIMING_CASE_INDICATION_ELCD
:
2792 case CHILD_IAB_DU_RESTRICTED_BEAM_INDICATION_ELCD
:
2794 case CASE_7_TIMING_ADVANCE_OFFSET_ELCD
:
2796 case PROVIDED_GUARD_SYMBOLS_FOR_CASE_6_TIMING_ELCD
:
2798 case PROVIDED_GUARD_SYMBOLS_FOR_CASE_7_TIMING_ELCD
:
2800 case SERVING_CELL_SET_BASED_SRS_SPATIAL_RELATION_INDICATION_ELCD
:
2802 case PUSCH_PATHLOSS_REFERENCE_RS_UPDATE_ELCD
:
2804 case SRS_PATHLOSS_REFERENCE_RS_UPDATE_ELCD
:
2806 case ENHANCED_SP_AP_SRS_SPATIAL_RELATION_INDICATION_ELCD
:
2808 case ENHANCED_PUCCH_SPATIAL_RELATION_ACTIVATION_DEACTIVATION_ELCD
:
2810 case ENHANCED_TCI_STATES_ACTIVATION_DEACTIVATION_FOR_UE_SPECIFIC_PDSCH_ELCD
:
2812 case DUPLICATION_RLC_ACTIVATION_DEACTIVATION_ELCD
:
2815 case ABSOLUTE_TIMING_ADVANCE_COMMAND_ELCD
:
2817 case SP_POSITIONING_SRS_ACTIVATION_DEACTIVATION_ELCD
:
2819 case PROVIDED_GUARD_SYMBOLS_ELCD
:
2821 case TIMING_DELTA_ELCD
:
2827 case RECOMMENDED_BIT_RATE_LCID
:
2828 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_recommended_bit_rate_lcid
,
2829 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &br_lcid
);
2830 proto_tree_add_item_ret_boolean(subheader_tree
, hf_mac_nr_control_recommended_bit_rate_dir
,
2831 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &dir
);
2832 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_recommended_bit_rate_bit_rate
,
2833 tvb
, offset
, 2, ENC_BIG_ENDIAN
, &bit_rate
);
2834 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_recommended_bit_rate_reserved
,
2835 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
2837 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
2838 "(Recommended BR LCID=%u Dir=%s BR=%s) ", br_lcid
, dir
? "UL" : "DL",
2839 val_to_str_ext_const(bit_rate
, &bit_rate_vals_ext
, "Unknown"));
2841 case SP_ZP_CSI_RS_RESOURCE_SET_ACT_DEACT_LCID
:
2842 proto_tree_add_item(subheader_tree
, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_ad
,
2843 tvb
, offset
, 1, ENC_NA
);
2844 proto_tree_add_item(subheader_tree
, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_serving_cell_id
,
2845 tvb
, offset
, 1, ENC_NA
);
2846 proto_tree_add_item(subheader_tree
, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_bwp_id
,
2847 tvb
, offset
, 1, ENC_NA
);
2849 proto_tree_add_item(subheader_tree
, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_reserved_2
,
2850 tvb
, offset
, 1, ENC_NA
);
2851 proto_tree_add_item(subheader_tree
, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_sp_zp_rs_resource_set_id
,
2852 tvb
, offset
, 1, ENC_NA
);
2854 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
2855 "(SP ZP CSI-RS Res Set Act/Deact) ");
2857 case PUCCH_SPATIAL_REL_ACT_DEACT_LCID
:
2859 static int * const pucch_spatial_rel_act_deact_flags
[] = {
2860 &hf_mac_nr_control_pucch_spatial_rel_act_deact_s8
,
2861 &hf_mac_nr_control_pucch_spatial_rel_act_deact_s7
,
2862 &hf_mac_nr_control_pucch_spatial_rel_act_deact_s6
,
2863 &hf_mac_nr_control_pucch_spatial_rel_act_deact_s5
,
2864 &hf_mac_nr_control_pucch_spatial_rel_act_deact_s4
,
2865 &hf_mac_nr_control_pucch_spatial_rel_act_deact_s3
,
2866 &hf_mac_nr_control_pucch_spatial_rel_act_deact_s2
,
2867 &hf_mac_nr_control_pucch_spatial_rel_act_deact_s1
,
2870 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_pucch_spatial_rel_act_deact_reserved
,
2871 tvb
, offset
, 1, ENC_NA
);
2872 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_pucch_spatial_rel_act_deact_serving_cell_id
,
2873 tvb
, offset
, 1, ENC_NA
);
2874 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_pucch_spatial_rel_act_deact_bwp_id
,
2875 tvb
, offset
, 1, ENC_NA
);
2877 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_pucch_spatial_rel_act_deact_reserved
,
2878 tvb
, offset
, 1, ENC_NA
);
2879 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_pucch_spatial_rel_act_deact_pucch_resource_id
,
2880 tvb
, offset
, 1, ENC_NA
);
2882 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, pucch_spatial_rel_act_deact_flags
, ENC_NA
);
2884 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
2885 "(PUCCH Spatial Rel Act/Deact) ");
2888 case SP_SRS_ACT_DEACT_LCID
:
2891 uint32_t start_offset
= offset
;
2892 unsigned resources
= 0;
2895 proto_tree_add_item_ret_boolean(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_ad
,
2896 tvb
, offset
, 1, ENC_NA
, &ad
);
2897 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_cell_id
,
2898 tvb
, offset
, 1, ENC_NA
);
2899 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_bwp_id
,
2900 tvb
, offset
, 1, ENC_NA
);
2903 proto_tree_add_bits_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_reserved
,
2904 tvb
, offset
<<3, 2, ENC_NA
);
2905 proto_tree_add_item_ret_boolean(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_c
,
2906 tvb
, offset
, 1, ENC_NA
, &c
);
2907 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_sul
,
2908 tvb
, offset
, 1, ENC_NA
);
2909 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_sp_srs_resource_set_id
,
2910 tvb
, offset
, 1, ENC_NA
);
2914 /* Activating - show info for resources */
2915 unsigned length
= c
? (SDU_length
-2) / 2 + 2: SDU_length
;
2916 while (offset
- start_offset
< length
) {
2918 proto_tree_add_item_ret_boolean(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_f
,
2919 tvb
, offset
, 1, ENC_NA
, &f
);
2920 uint32_t resource_id
= tvb_get_uint8(tvb
, offset
) & 0x7f;
2921 proto_item
*resource_id_ti
;
2922 if (!f
&& (resource_id
& 0x40)) {
2923 /* SSB case - first bit just indicates type */
2924 resource_id_ti
= proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_resource_id_ssb
,
2925 tvb
, offset
, 1, ENC_NA
);
2926 proto_item_append_text(resource_id_ti
, " (SSB)");
2929 resource_id_ti
= proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_resource_id
,
2930 tvb
, offset
, 1, ENC_NA
);
2932 proto_item_append_text(resource_id_ti
, " (NZP-CSI-RS)");
2935 proto_item_append_text(resource_id_ti
, " (SRS)");
2944 /* Deactivating (no resources) */
2945 while (offset
- start_offset
< SDU_length
) {
2946 proto_tree_add_bits_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_reserved
,
2947 tvb
, offset
<<3, 1, ENC_NA
);
2948 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_resource_serving_cell_id
,
2949 tvb
, offset
, 1, ENC_NA
);
2950 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_srs_act_deact_resource_bwp_id
,
2951 tvb
, offset
, 1, ENC_NA
);
2956 /* Add summary to Info column */
2958 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
, "(SP SRS Act/Deact Activate %d resources)", resources
);
2961 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
, "(SP SRS Act/Deact Deactivate)");
2965 case SP_CSI_REPORT_ON_PUCCH_ACT_DEACT_LCID
:
2967 static int * const sp_csi_report_on_pucch_act_deact_flags
[] = {
2968 &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s7
,
2969 &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s6
,
2970 &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s5
,
2971 &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s4
,
2972 &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s3
,
2973 &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s2
,
2974 &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s1
,
2975 &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s0
,
2978 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_reserved
,
2979 tvb
, offset
, 1, ENC_NA
);
2980 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_serving_cell_id
,
2981 tvb
, offset
, 1, ENC_NA
);
2982 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_bwp_id
,
2983 tvb
, offset
, 1, ENC_NA
);
2985 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, sp_csi_report_on_pucch_act_deact_flags
, ENC_NA
);
2987 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
2988 "(SP CSI Report on PUCCH Act/Deact) ");
2991 case TCI_STATE_IND_FOR_UE_SPEC_PDCCH_LCID
:
2992 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_serving_cell_id
,
2993 tvb
, offset
, 1, ENC_NA
);
2994 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_coreset_id
,
2995 tvb
, offset
, 2, ENC_NA
);
2997 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_tci_state_id
,
2998 tvb
, offset
, 1, ENC_NA
);
3000 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
3001 "(TCI State Ind PDCCH) ");
3003 case TCI_STATES_ACT_DEACT_FOR_UE_SPEC_PDSCH_LCID
:
3005 uint32_t start_offset
= offset
;
3006 static int * const tci_states_act_deact_for_ue_spec_pdsc_flags
[] = {
3007 &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t7
,
3008 &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t6
,
3009 &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t5
,
3010 &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t4
,
3011 &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t3
,
3012 &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t2
,
3013 &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t1
,
3014 &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t0
,
3017 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_reserved
,
3018 tvb
, offset
, 1, ENC_NA
);
3019 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_serving_cell_id
,
3020 tvb
, offset
, 1, ENC_NA
);
3021 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_bwp_id
,
3022 tvb
, offset
, 1, ENC_NA
);
3024 while (offset
- start_offset
< SDU_length
) {
3025 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, tci_states_act_deact_for_ue_spec_pdsc_flags
, ENC_NA
);
3028 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
3029 "(TCI States Act Deact PDSCH) ");
3032 case APER_CSI_TRIGGER_STATE_SUBSELECT_LCID
:
3034 uint32_t start_offset
= offset
;
3035 static int * const aper_csi_trigger_state_subselect_flags
[] = {
3036 &hf_mac_nr_control_aper_csi_trigger_state_subselect_t7
,
3037 &hf_mac_nr_control_aper_csi_trigger_state_subselect_t6
,
3038 &hf_mac_nr_control_aper_csi_trigger_state_subselect_t5
,
3039 &hf_mac_nr_control_aper_csi_trigger_state_subselect_t4
,
3040 &hf_mac_nr_control_aper_csi_trigger_state_subselect_t3
,
3041 &hf_mac_nr_control_aper_csi_trigger_state_subselect_t2
,
3042 &hf_mac_nr_control_aper_csi_trigger_state_subselect_t1
,
3043 &hf_mac_nr_control_aper_csi_trigger_state_subselect_t0
,
3046 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_aper_csi_trigger_state_subselect_reserved
,
3047 tvb
, offset
, 1, ENC_NA
);
3048 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_aper_csi_trigger_state_subselect_serving_cell_id
,
3049 tvb
, offset
, 1, ENC_NA
);
3050 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_aper_csi_trigger_state_subselect_bwp_id
,
3051 tvb
, offset
, 1, ENC_NA
);
3053 while (offset
- start_offset
< SDU_length
) {
3054 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, aper_csi_trigger_state_subselect_flags
, ENC_NA
);
3057 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
3058 "(Aperiodic CSI Trigger State Subselection) ");
3061 case SP_CSI_RS_CSI_IM_RES_SET_ACT_DEACT_LCID
:
3064 uint32_t start_offset
= offset
;
3065 static int * const sp_csi_rs_csi_im_res_set_act_deact_flags
[] = {
3066 &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved3
,
3067 &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_tci_state_id
,
3070 proto_tree_add_item_ret_boolean(subheader_tree
, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_ad
,
3071 tvb
, offset
, 1, ENC_NA
, &ad
);
3072 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_serving_cell_id
,
3073 tvb
, offset
, 1, ENC_NA
);
3074 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_bwp_id
,
3075 tvb
, offset
, 1, ENC_NA
);
3077 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved
,
3078 tvb
, offset
, 1, ENC_NA
);
3079 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_im
,
3080 tvb
, offset
, 1, ENC_NA
);
3081 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_rs_res_set_id
,
3082 tvb
, offset
, 1, ENC_NA
);
3084 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved2
,
3085 tvb
, offset
, 1, ENC_NA
);
3086 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_im_res_set_id
,
3087 tvb
, offset
, 1, ENC_NA
);
3090 while (offset
- start_offset
< SDU_length
) {
3091 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, sp_csi_rs_csi_im_res_set_act_deact_flags
, ENC_NA
);
3095 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
3096 "(SP CSI-RS/CSI-IM Res Set Act/Deact) ");
3099 case DUPLICATION_ACTIVATION_DEACTIVATION_LCID
:
3101 static int * const dupl_act_deact_flags
[] = {
3102 &hf_mac_nr_control_dupl_act_deact_drb7
,
3103 &hf_mac_nr_control_dupl_act_deact_drb6
,
3104 &hf_mac_nr_control_dupl_act_deact_drb5
,
3105 &hf_mac_nr_control_dupl_act_deact_drb4
,
3106 &hf_mac_nr_control_dupl_act_deact_drb3
,
3107 &hf_mac_nr_control_dupl_act_deact_drb2
,
3108 &hf_mac_nr_control_dupl_act_deact_drb1
,
3109 &hf_mac_nr_control_dupl_act_deact_reserved
,
3112 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, dupl_act_deact_flags
, ENC_NA
);
3114 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
3115 "(Dupl Act/Deact) ");
3118 case SCELL_ACTIVATION_DEACTIVATION_4_LCID
:
3120 static int * const scell_act_deact_1_flags
[] = {
3121 &hf_mac_nr_control_scell_act_deact_cell7
,
3122 &hf_mac_nr_control_scell_act_deact_cell6
,
3123 &hf_mac_nr_control_scell_act_deact_cell5
,
3124 &hf_mac_nr_control_scell_act_deact_cell4
,
3125 &hf_mac_nr_control_scell_act_deact_cell3
,
3126 &hf_mac_nr_control_scell_act_deact_cell2
,
3127 &hf_mac_nr_control_scell_act_deact_cell1
,
3128 &hf_mac_nr_control_scell_act_deact_reserved
,
3131 static int * const scell_act_deact_2_flags
[] = {
3132 &hf_mac_nr_control_scell_act_deact_cell15
,
3133 &hf_mac_nr_control_scell_act_deact_cell14
,
3134 &hf_mac_nr_control_scell_act_deact_cell13
,
3135 &hf_mac_nr_control_scell_act_deact_cell12
,
3136 &hf_mac_nr_control_scell_act_deact_cell11
,
3137 &hf_mac_nr_control_scell_act_deact_cell10
,
3138 &hf_mac_nr_control_scell_act_deact_cell9
,
3139 &hf_mac_nr_control_scell_act_deact_cell8
,
3142 static int * const scell_act_deact_3_flags
[] = {
3143 &hf_mac_nr_control_scell_act_deact_cell23
,
3144 &hf_mac_nr_control_scell_act_deact_cell22
,
3145 &hf_mac_nr_control_scell_act_deact_cell21
,
3146 &hf_mac_nr_control_scell_act_deact_cell20
,
3147 &hf_mac_nr_control_scell_act_deact_cell19
,
3148 &hf_mac_nr_control_scell_act_deact_cell18
,
3149 &hf_mac_nr_control_scell_act_deact_cell17
,
3150 &hf_mac_nr_control_scell_act_deact_cell16
,
3153 static int * const scell_act_deact_4_flags
[] = {
3154 &hf_mac_nr_control_scell_act_deact_cell31
,
3155 &hf_mac_nr_control_scell_act_deact_cell30
,
3156 &hf_mac_nr_control_scell_act_deact_cell29
,
3157 &hf_mac_nr_control_scell_act_deact_cell28
,
3158 &hf_mac_nr_control_scell_act_deact_cell27
,
3159 &hf_mac_nr_control_scell_act_deact_cell26
,
3160 &hf_mac_nr_control_scell_act_deact_cell25
,
3161 &hf_mac_nr_control_scell_act_deact_cell24
,
3164 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, scell_act_deact_1_flags
, ENC_NA
);
3166 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, scell_act_deact_2_flags
, ENC_NA
);
3168 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, scell_act_deact_3_flags
, ENC_NA
);
3170 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, scell_act_deact_4_flags
, ENC_NA
);
3173 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
,
3174 "(SCell Act/Deact 4) ");
3177 case SCELL_ACTIVATION_DEACTIVATION_1_LCID
:
3179 static int * const scell_act_deact_1_flags
[] = {
3180 &hf_mac_nr_control_scell_act_deact_cell7
,
3181 &hf_mac_nr_control_scell_act_deact_cell6
,
3182 &hf_mac_nr_control_scell_act_deact_cell5
,
3183 &hf_mac_nr_control_scell_act_deact_cell4
,
3184 &hf_mac_nr_control_scell_act_deact_cell3
,
3185 &hf_mac_nr_control_scell_act_deact_cell2
,
3186 &hf_mac_nr_control_scell_act_deact_cell1
,
3187 &hf_mac_nr_control_scell_act_deact_reserved
,
3190 proto_tree_add_bitmask_list(subheader_tree
, tvb
, offset
, 1, scell_act_deact_1_flags
, ENC_NA
);
3193 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
, "(SCell Act/Deact 1) ");
3196 case LONG_DRX_COMMAND_LCID
:
3197 /* Fixed size of zero bits */
3198 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
, "(Long DRX) ");
3200 case DRX_COMMAND_LCID
:
3201 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
, "(DRX) ");
3203 case TIMING_ADVANCE_COMMAND_LCID
:
3204 /* TAG ID (2 bits) */
3205 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_timing_advance_tagid
,
3206 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &ta_tag_id
);
3208 /* Timing Advance Command (6 bits) */
3209 proto_tree_add_item_ret_uint(subheader_tree
, hf_mac_nr_control_timing_advance_command
,
3210 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &ta_ta
);
3213 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
,
3214 "(TAG=%u TA=%u) ", ta_tag_id
, ta_ta
);
3216 case UE_CONTENTION_RESOLUTION_IDENTITY_LCID
:
3217 proto_tree_add_item(subheader_tree
, hf_mac_nr_control_ue_contention_resolution_identity
,
3218 tvb
, offset
, 6, ENC_NA
);
3220 write_pdu_label_and_info_literal(pdu_ti
, subheader_ti
, pinfo
, "(Contention Resolution) ");
3224 /* The rest of the PDU is padding */
3225 int pad_len
= tvb_reported_length_remaining(tvb
, offset
);
3227 proto_tree_add_item(subheader_tree
, hf_mac_nr_padding
, tvb
, offset
, -1, ENC_NA
);
3228 write_pdu_label_and_info(pdu_ti
, subheader_ti
, pinfo
, "(Padding %u bytes) ", pad_len
);
3229 /* Move to the end of the frame */
3230 offset
= tvb_reported_length(tvb
);
3237 /* Set subheader extent here */
3238 proto_item_set_end(subheader_ti
, tvb
, offset
);
3240 } while (tvb_reported_length_remaining(tvb
, offset
));
3246 /*****************************/
3247 /* Main dissection function. */
3248 static int dissect_mac_nr(tvbuff_t
*tvb
, packet_info
*pinfo
,
3249 proto_tree
*tree
, void* data _U_
)
3251 proto_tree
*mac_nr_tree
;
3253 proto_tree
*context_tree
;
3254 proto_item
*context_ti
, *ti
;
3256 struct mac_nr_info
*p_mac_nr_info
;
3258 /* Allocate and zero tap struct */
3259 mac_3gpp_tap_info
*tap_info
= wmem_new0(wmem_file_scope(), mac_3gpp_tap_info
);
3260 tap_info
->rat
= MAC_RAT_NR
;
3262 /* Set protocol name */
3263 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "MAC-NR");
3265 /* Create protocol tree */
3266 pdu_ti
= proto_tree_add_item(tree
, proto_mac_nr
, tvb
, offset
, tvb_reported_length(tvb
), ENC_NA
);
3267 proto_item_append_text(pdu_ti
, " ");
3268 mac_nr_tree
= proto_item_add_subtree(pdu_ti
, ett_mac_nr
);
3270 /* Look for packet info! */
3271 p_mac_nr_info
= (mac_nr_info
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_mac_nr
, 0);
3273 /* Can't dissect anything without it... */
3274 if (p_mac_nr_info
== NULL
) {
3275 proto_tree_add_expert(mac_nr_tree
, pinfo
, &ei_mac_nr_no_per_frame_data
, tvb
, offset
, -1);
3279 /* Clear info column */
3280 col_clear(pinfo
->cinfo
, COL_INFO
);
3282 /* Restart this count */
3283 s_number_of_rlc_pdus_shown
= 0;
3286 /*****************************************/
3287 /* Show context information */
3289 /* Create context root */
3290 context_ti
= proto_tree_add_string_format(mac_nr_tree
, hf_mac_nr_context
,
3291 tvb
, offset
, 0, "", "Context");
3292 context_tree
= proto_item_add_subtree(context_ti
, ett_mac_nr_context
);
3293 proto_item_set_generated(context_ti
);
3296 ti
= proto_tree_add_uint(context_tree
, hf_mac_nr_context_radio_type
,
3297 tvb
, 0, 0, p_mac_nr_info
->radioType
);
3298 proto_item_set_generated(ti
);
3301 ti
= proto_tree_add_uint(context_tree
, hf_mac_nr_context_direction
,
3302 tvb
, 0, 0, p_mac_nr_info
->direction
);
3303 proto_item_set_generated(ti
);
3305 /* RNTI type and value */
3306 if (p_mac_nr_info
->rntiType
!= NO_RNTI
) {
3307 ti
= proto_tree_add_uint(context_tree
, hf_mac_nr_context_rnti
,
3308 tvb
, 0, 0, p_mac_nr_info
->rnti
);
3309 proto_item_set_generated(ti
);
3310 proto_item_append_text(context_ti
, " (RNTI=%u)", p_mac_nr_info
->rnti
);
3313 ti
= proto_tree_add_uint(context_tree
, hf_mac_nr_context_rnti_type
,
3314 tvb
, 0, 0, p_mac_nr_info
->rntiType
);
3315 proto_item_set_generated(ti
);
3318 if (p_mac_nr_info
->ueid
!= 0) {
3319 ti
= proto_tree_add_uint(context_tree
, hf_mac_nr_context_ueid
,
3320 tvb
, 0, 0, p_mac_nr_info
->ueid
);
3321 proto_item_set_generated(ti
);
3324 if (p_mac_nr_info
->sfnSlotInfoPresent
) {
3325 ti
= proto_tree_add_uint(context_tree
, hf_mac_nr_context_sysframe_number
,
3326 tvb
, 0, 0, p_mac_nr_info
->sysframeNumber
);
3327 proto_item_set_generated(ti
);
3328 ti
= proto_tree_add_uint(context_tree
, hf_mac_nr_context_slot_number
,
3329 tvb
, 0, 0, p_mac_nr_info
->slotNumber
);
3330 proto_item_set_generated(ti
);
3333 if (p_mac_nr_info
->rntiType
== C_RNTI
|| p_mac_nr_info
->rntiType
== CS_RNTI
) {
3335 ti
= proto_tree_add_uint(context_tree
, hf_mac_nr_context_harqid
,
3336 tvb
, 0, 0, p_mac_nr_info
->harqid
);
3337 proto_item_set_generated(ti
);
3339 if (p_mac_nr_info
->direction
== DIRECTION_UPLINK
) {
3341 ti
= proto_tree_add_boolean(context_tree
, hf_mac_nr_context_phr_type2_othercell
,
3342 tvb
, 0, 0, p_mac_nr_info
->phr_type2_othercell
);
3343 proto_item_set_generated(ti
);
3347 /* Set context-info parts of tap struct */
3348 tap_info
->rnti
= p_mac_nr_info
->rnti
;
3349 tap_info
->ueid
= p_mac_nr_info
->ueid
;
3350 tap_info
->rntiType
= p_mac_nr_info
->rntiType
;
3351 tap_info
->isPredefinedData
= false;
3352 tap_info
->isPHYRetx
= false; /* don't really know */
3353 tap_info
->crcStatusValid
= false; /* don't really know */
3354 tap_info
->direction
= p_mac_nr_info
->direction
;
3356 tap_info
->mac_time
= pinfo
->abs_ts
;
3357 tap_info
->single_number_of_bytes
= tvb_reported_length_remaining(tvb
, offset
);
3359 /* Dissect the MAC PDU itself. Format depends upon RNTI type. */
3360 switch (p_mac_nr_info
->rntiType
) {
3364 dissect_pcch(tvb
, pinfo
, mac_nr_tree
, pdu_ti
, offset
, p_mac_nr_info
, tap_info
);
3369 dissect_rar(tvb
, pinfo
, mac_nr_tree
, pdu_ti
, offset
, p_mac_nr_info
, tap_info
);
3374 dissect_msgb(tvb
, pinfo
, mac_nr_tree
, pdu_ti
, offset
, p_mac_nr_info
, tap_info
);
3379 /* Can be UL-SCH or DL-SCH */
3380 dissect_ulsch_or_dlsch(tvb
, pinfo
, mac_nr_tree
, pdu_ti
, offset
,
3381 p_mac_nr_info
, tap_info
);
3385 /* BCCH over DL-SCH */
3386 dissect_bcch(tvb
, pinfo
, mac_nr_tree
, pdu_ti
, offset
,
3387 p_mac_nr_info
, tap_info
);
3391 /* Must be BCCH over BCH... */
3392 dissect_bcch(tvb
, pinfo
, mac_nr_tree
, pdu_ti
, offset
,
3393 p_mac_nr_info
, tap_info
);
3400 tap_queue_packet(mac_nr_tap
, pinfo
, tap_info
);
3405 /* Heuristic dissector looks for supported framing protocol (see header file for details) */
3406 static bool dissect_mac_nr_heur(tvbuff_t
*tvb
, packet_info
*pinfo
,
3407 proto_tree
*tree
, void *data _U_
)
3410 mac_nr_info
*p_mac_nr_info
;
3413 /* Needs to be at least as long as:
3414 - the signature string
3415 - fixed header bytes
3417 - at least one byte of MAC PDU payload */
3418 if (tvb_captured_length_remaining(tvb
, offset
) < (int)(strlen(MAC_NR_START_STRING
)+3+2)) {
3422 /* OK, compare with signature string */
3423 if (tvb_strneql(tvb
, offset
, MAC_NR_START_STRING
, strlen(MAC_NR_START_STRING
)) != 0) {
3426 offset
+= (int)strlen(MAC_NR_START_STRING
);
3428 /* If redissecting, use previous info struct (if available) */
3429 p_mac_nr_info
= (mac_nr_info
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_mac_nr
, 0);
3430 if (p_mac_nr_info
== NULL
) {
3431 /* Allocate new info struct for this frame */
3432 p_mac_nr_info
= wmem_new0(wmem_file_scope(), mac_nr_info
);
3433 /* Dissect the fields to populate p_mac_nr */
3434 if(!dissect_mac_nr_context_fields(p_mac_nr_info
, tvb
, pinfo
, tree
, &offset
)){
3437 /* Store info in packet */
3438 p_add_proto_data(wmem_file_scope(), pinfo
, proto_mac_nr
, 0, p_mac_nr_info
);
3441 offset
= tvb_reported_length(tvb
) - p_mac_nr_info
->length
;
3444 /**************************************/
3445 /* OK, now dissect as MAC NR */
3447 /* Create tvb that starts at actual MAC PDU */
3448 mac_tvb
= tvb_new_subset_remaining(tvb
, offset
);
3449 dissect_mac_nr(mac_tvb
, pinfo
, tree
, NULL
);
3454 /* Dissect context fields in the format described in packet-mac-nr.h.
3455 Return true if the necessary information was successfully found */
3456 bool dissect_mac_nr_context_fields(struct mac_nr_info
*p_mac_nr_info
, tvbuff_t
*tvb
,
3457 packet_info
*pinfo
, proto_tree
*tree
, int *p_offset
)
3459 int offset
= *p_offset
;
3462 /* Read fixed fields */
3463 p_mac_nr_info
->radioType
= tvb_get_uint8(tvb
, offset
++);
3464 p_mac_nr_info
->direction
= tvb_get_uint8(tvb
, offset
++);
3465 p_mac_nr_info
->rntiType
= tvb_get_uint8(tvb
, offset
++);
3467 /* Read optional fields */
3469 /* Process next tag */
3470 tag
= tvb_get_uint8(tvb
, offset
++);
3472 case MAC_NR_RNTI_TAG
:
3473 p_mac_nr_info
->rnti
= tvb_get_ntohs(tvb
, offset
);
3476 case MAC_NR_UEID_TAG
:
3477 p_mac_nr_info
->ueid
= tvb_get_ntohs(tvb
, offset
);
3481 p_mac_nr_info
->harqid
= tvb_get_uint8(tvb
, offset
);
3484 case MAC_NR_FRAME_SUBFRAME_TAG
:
3488 case MAC_NR_PHR_TYPE2_OTHERCELL_TAG
:
3489 p_mac_nr_info
->phr_type2_othercell
= tvb_get_uint8(tvb
, offset
);
3492 case MAC_NR_FRAME_SLOT_TAG
:
3493 p_mac_nr_info
->sfnSlotInfoPresent
= true;
3494 p_mac_nr_info
->sysframeNumber
= tvb_get_ntohs(tvb
, offset
);
3495 p_mac_nr_info
->slotNumber
= tvb_get_ntohs(tvb
, offset
+2);
3498 case MAC_NR_PAYLOAD_TAG
:
3499 /* Have reached data, so set payload length and get out of loop */
3500 /* TODO: this is not correct if there is padding which isn't in frame */
3501 p_mac_nr_info
->length
= tvb_reported_length_remaining(tvb
, offset
);
3504 /* It must be a recognised tag */
3507 proto_tree
*subtree
;
3509 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "MAC-NR");
3510 col_clear(pinfo
->cinfo
, COL_INFO
);
3511 ti
= proto_tree_add_item(tree
, proto_mac_nr
, tvb
, offset
, tvb_reported_length(tvb
), ENC_NA
);
3512 subtree
= proto_item_add_subtree(ti
, ett_mac_nr
);
3513 proto_tree_add_expert(subtree
, pinfo
, &ei_mac_nr_unknown_udp_framing_tag
,
3516 wmem_free(wmem_file_scope(), p_mac_nr_info
);
3519 } while (tag
!= MAC_NR_PAYLOAD_TAG
);
3521 /* Pass out where offset is now */
3527 /* Callback used as part of configuring a channel mapping using UAT */
3528 static void* lcid_drb_mapping_copy_cb(void* dest
, const void* orig
, size_t len _U_
)
3530 const lcid_drb_mapping_t
*o
= (const lcid_drb_mapping_t
*)orig
;
3531 lcid_drb_mapping_t
*d
= (lcid_drb_mapping_t
*)dest
;
3533 /* Copy all items over */
3535 d
->drbid
= o
->drbid
;
3536 d
->bearer_type_ul
= o
->bearer_type_ul
;
3537 d
->bearer_type_dl
= o
->bearer_type_dl
;
3542 static void set_bearer_type(dynamic_lcid_drb_mapping_t
*mapping
, uint8_t rlcMode
, uint8_t rlcSnLength
, uint8_t direction
)
3544 /* Point to field for appropriate direction */
3545 rlc_bearer_type_t
*type_var
= (direction
== DIRECTION_UPLINK
) ?
3546 &mapping
->bearer_type_ul
:
3547 &mapping
->bearer_type_dl
;
3551 switch (rlcSnLength
) {
3553 *type_var
= rlcAM12
;
3556 *type_var
= rlcAM18
;
3564 switch (rlcSnLength
) {
3569 *type_var
= rlcUM12
;
3583 /* Set LCID -> RLC channel mappings from signalling protocol (i.e. RRC or similar). */
3584 void set_mac_nr_bearer_mapping(nr_drb_mac_rlc_mapping_t
*drb_mapping
)
3586 ue_dynamic_drb_mappings_t
*ue_mappings
;
3589 /* Check lcid range */
3590 if (drb_mapping
->lcid_present
) {
3591 lcid
= drb_mapping
->lcid
;
3593 /* Ignore if LCID is out of range. */
3594 if ((lcid
< 3) || (lcid
> 32)) {
3599 /* Look for existing UE entry */
3600 ue_mappings
= (ue_dynamic_drb_mappings_t
*)g_hash_table_lookup(mac_nr_ue_bearers_hash
,
3601 GUINT_TO_POINTER((unsigned)drb_mapping
->ueid
));
3603 /* If not found, create & add to table */
3604 ue_mappings
= wmem_new0(wmem_file_scope(), ue_dynamic_drb_mappings_t
);
3605 g_hash_table_insert(mac_nr_ue_bearers_hash
,
3606 GUINT_TO_POINTER((unsigned)drb_mapping
->ueid
),
3610 /* If lcid wasn't supplied, need to try to look up from drbid */
3611 if ((lcid
== 0) && (drb_mapping
->rbid
<= 32)) {
3612 lcid
= ue_mappings
->drb_to_lcid_mappings
[drb_mapping
->rbid
];
3615 /* Still no lcid - give up */
3619 /* Set array entry */
3620 ue_mappings
->mapping
[lcid
].valid
= true;
3621 ue_mappings
->mapping
[lcid
].drbid
= drb_mapping
->rbid
;
3622 ue_mappings
->drb_to_lcid_mappings
[drb_mapping
->rbid
] = lcid
;
3624 /* Fill in available RLC info */
3625 if (drb_mapping
->rlcMode_present
) {
3626 if (drb_mapping
->rlcUlSnLength_present
) {
3627 set_bearer_type(&ue_mappings
->mapping
[lcid
], drb_mapping
->rlcMode
, drb_mapping
->rlcUlSnLength
, DIRECTION_UPLINK
);
3629 if (drb_mapping
->rlcDlSnLength_present
) {
3630 set_bearer_type(&ue_mappings
->mapping
[lcid
], drb_mapping
->rlcMode
, drb_mapping
->rlcDlSnLength
, DIRECTION_DOWNLINK
);
3635 void set_mac_nr_srb3_in_use(uint16_t ueid
)
3637 ue_dynamic_drb_mappings_t
*ue_mappings
;
3639 /* Look for existing UE entry */
3640 ue_mappings
= (ue_dynamic_drb_mappings_t
*)g_hash_table_lookup(mac_nr_ue_bearers_hash
,
3641 GUINT_TO_POINTER(ueid
));
3643 /* If not found, create & add to table */
3644 ue_mappings
= wmem_new0(wmem_file_scope(), ue_dynamic_drb_mappings_t
);
3645 g_hash_table_insert(mac_nr_ue_bearers_hash
,
3646 GUINT_TO_POINTER(ueid
),
3649 ue_mappings
->srb3_set
= true;
3652 void set_mac_nr_srb4_in_use(uint16_t ueid
)
3654 ue_dynamic_drb_mappings_t
*ue_mappings
;
3656 /* Look for existing UE entry */
3657 ue_mappings
= (ue_dynamic_drb_mappings_t
*)g_hash_table_lookup(mac_nr_ue_bearers_hash
,
3658 GUINT_TO_POINTER(ueid
));
3660 /* If not found, create & add to table */
3661 ue_mappings
= wmem_new0(wmem_file_scope(), ue_dynamic_drb_mappings_t
);
3662 g_hash_table_insert(mac_nr_ue_bearers_hash
,
3663 GUINT_TO_POINTER(ueid
),
3666 ue_mappings
->srb4_set
= true;
3671 /* Function to be called from outside this module (e.g. in a plugin) to get per-packet data */
3672 mac_nr_info
*get_mac_nr_proto_data(packet_info
*pinfo
)
3674 return (mac_nr_info
*)p_get_proto_data(wmem_file_scope(), pinfo
, proto_mac_nr
, 0);
3677 /* Function to be called from outside this module (e.g. in a plugin) to set per-packet data */
3678 void set_mac_nr_proto_data(packet_info
*pinfo
, mac_nr_info
*p_mac_nr_info
)
3680 p_add_proto_data(wmem_file_scope(), pinfo
, proto_mac_nr
, 0, p_mac_nr_info
);
3683 /* Initializes the hash tables each time a new
3684 * file is loaded or re-loaded in wireshark */
3685 static void mac_nr_init_protocol(void)
3687 mac_nr_ue_bearers_hash
= g_hash_table_new(g_direct_hash
, g_direct_equal
);
3690 static void mac_nr_cleanup_protocol(void)
3692 g_hash_table_destroy(mac_nr_ue_bearers_hash
);
3697 void proto_register_mac_nr(void)
3699 static hf_register_info hf
[] =
3701 /**********************************/
3702 /* Items for decoding context */
3703 { &hf_mac_nr_context
,
3705 "mac-nr.context", FT_STRING
, BASE_NONE
, NULL
, 0x0,
3709 { &hf_mac_nr_context_radio_type
,
3711 "mac-nr.radio-type", FT_UINT8
, BASE_DEC
, VALS(radio_type_vals
), 0x0,
3715 { &hf_mac_nr_context_direction
,
3717 "mac-nr.direction", FT_UINT8
, BASE_DEC
, VALS(direction_vals
), 0x0,
3718 "Direction of message", HFILL
3721 { &hf_mac_nr_context_rnti
,
3723 "mac-nr.rnti", FT_UINT16
, BASE_HEX_DEC
, NULL
, 0x0,
3724 "RNTI associated with message", HFILL
3727 { &hf_mac_nr_context_rnti_type
,
3729 "mac-nr.rnti-type", FT_UINT8
, BASE_DEC
, VALS(rnti_type_vals
), 0x0,
3730 "Type of RNTI associated with message", HFILL
3733 { &hf_mac_nr_context_ueid
,
3735 "mac-nr.ueid", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3736 "User Equipment Identifier associated with message", HFILL
3739 { &hf_mac_nr_context_sysframe_number
,
3740 { "System Frame Number",
3741 "mac-nr.sfn", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3742 "System Frame Number associated with message", HFILL
3745 { &hf_mac_nr_context_slot_number
,
3747 "mac-nr.slot", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3748 "Slot number associated with message", HFILL
3751 { &hf_mac_nr_context_harqid
,
3753 "mac-nr.harqid", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3754 "HARQ Identifier", HFILL
3757 { &hf_mac_nr_context_bcch_transport_channel
,
3758 { "Transport channel",
3759 "mac-nr.bcch-transport-channel", FT_UINT8
, BASE_DEC
, VALS(bcch_transport_channel_vals
), 0x0,
3760 "Transport channel BCCH data was carried on", HFILL
3763 { &hf_mac_nr_context_phr_type2_othercell
,
3764 { "PHR Type2 other cell PHR",
3765 "mac-nr.type2-other-cell", FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
3770 { &hf_mac_nr_subheader
,
3772 "mac-nr.subheader", FT_STRING
, BASE_NONE
, NULL
, 0x0,
3776 { &hf_mac_nr_subheader_reserved
,
3778 "mac-nr.subheader.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
3782 { &hf_mac_nr_subheader_f
,
3784 "mac-nr.subheader.f", FT_BOOLEAN
, 8, TFS(&subheader_f_vals
), 0x40,
3785 "Format of subheader length field", HFILL
3788 { &hf_mac_nr_subheader_length_1_byte
,
3790 "mac-nr.subheader.sdu-length", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
3794 { &hf_mac_nr_subheader_length_2_bytes
,
3796 "mac-nr.subheader.sdu-length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3800 /* Will be hidden, but useful for bi-directional filtering */
3803 "mac-nr.lcid", FT_UINT8
, BASE_HEX
, NULL
, 0x3f,
3804 "Logical Channel Identifier", HFILL
3807 { &hf_mac_nr_ulsch_lcid
,
3809 "mac-nr.ulsch.lcid", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &ulsch_lcid_vals_ext
, 0x3f,
3810 "UL-SCH Logical Channel Identifier", HFILL
3813 { &hf_mac_nr_dlsch_lcid
,
3815 "mac-nr.dlsch.lcid", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &dlsch_lcid_vals_ext
, 0x3f,
3816 "DL-SCH Logical Channel Identifier", HFILL
3819 { &hf_mac_nr_dlsch_elcid_2oct
,
3821 "mac-nr.dlsch.elcid-2oct", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3825 { &hf_mac_nr_ulsch_elcid_2oct
,
3827 "mac-nr.dlsch.elcid-2oct", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
3831 { &hf_mac_nr_dlsch_elcid_1oct
,
3833 "mac-nr.dlsch.elcid-1oct", FT_UINT8
,BASE_DEC
|BASE_EXT_STRING
,&dlsch_elcid_vals_ext
, 0x0,
3837 { &hf_mac_nr_ulsch_elcid_1oct
,
3839 "mac-nr.dlsch.elcid-1oct", FT_UINT8
,BASE_DEC
|BASE_EXT_STRING
,&ulsch_elcid_vals_ext
, 0x0,
3843 { &hf_mac_nr_ulsch_sdu
,
3845 "mac-nr.ulsch.sdu", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
3849 { &hf_mac_nr_dlsch_sdu
,
3851 "mac-nr.dlsch.sdu", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
3855 { &hf_mac_nr_bcch_pdu
,
3857 "mac-nr.bcch.pdu", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
3861 { &hf_mac_nr_pcch_pdu
,
3863 "mac-nr.pcch.pdu", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
3869 /*********************************/
3873 "mac-nr.rar", FT_NONE
, BASE_NONE
, NULL
, 0x0,
3879 "mac-nr.rar.e", FT_BOOLEAN
, 8, TFS(&rar_ext_vals
), 0x80,
3885 "mac-nr.rar.t", FT_BOOLEAN
, 8, TFS(&rar_type_vals
), 0x40,
3889 { &hf_mac_nr_rar_reserved
,
3891 "mac-nr.rar.reserved", FT_UINT8
, BASE_DEC
, NULL
, 0x30,
3895 { &hf_mac_nr_rar_reserved1
,
3897 "mac-nr.rar.reserved", FT_UINT8
, BASE_DEC
, NULL
, 0x80,
3902 { &hf_mac_nr_rar_subheader
,
3904 "mac-nr.rar.subheader", FT_STRING
, BASE_NONE
, NULL
, 0x0,
3908 { &hf_mac_nr_rar_bi
,
3909 { "Backoff Indicator",
3910 "mac-nr.rar.bi", FT_UINT8
, BASE_DEC
, VALS(rar_bi_vals
), 0x0f,
3914 { &hf_mac_nr_rar_rapid
,
3916 "mac-nr.rar.rapid", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
3920 { &hf_mac_nr_rar_ta
,
3922 "mac-nr.rar.ta", FT_UINT16
, BASE_DEC
, NULL
, 0x7ff8,
3927 { &hf_mac_nr_rar_grant
,
3929 "mac-nr.rar.grant", FT_UINT32
, BASE_HEX
, NULL
, 0x07ffffff,
3930 "UL Grant details", HFILL
3933 { &hf_mac_nr_rar_grant_hopping
,
3934 { "Frequency hopping flag",
3935 "mac-nr.rar.grant.hopping", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x04000000,
3939 { &hf_mac_nr_rar_grant_fra
,
3940 { "Msg3 PUSCH frequency resource allocation",
3941 "mac-nr.rar.grant.fra", FT_UINT32
, BASE_DEC
, NULL
, 0x03fff000,
3945 { &hf_mac_nr_rar_grant_tsa
,
3946 { "Msg3 PUSCH time resource allocation",
3947 "mac-nr.rar.grant.tsa", FT_UINT32
, BASE_DEC
, NULL
, 0x00000f00,
3951 { &hf_mac_nr_rar_grant_mcs
,
3953 "mac-nr.rar.grant.mcs", FT_UINT32
, BASE_DEC
, NULL
, 0x000000f0,
3957 { &hf_mac_nr_rar_grant_tcsp
,
3958 { "TPC command for Msg3 PUSCH",
3959 "mac-nr.rar.grant.tcsp", FT_UINT32
, BASE_DEC
, VALS(tpc_command_vals
), 0x0000000e,
3963 { &hf_mac_nr_rar_grant_csi
,
3965 "mac-nr.rar.grant.csi", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), 0x00000001,
3969 { &hf_mac_nr_rar_temp_crnti
,
3970 { "Temporary C-RNTI",
3971 "mac-nr.rar.temp_crnti", FT_UINT16
, BASE_HEX_DEC
, NULL
, 0x0,
3979 "mac-nr.msgb", FT_NONE
, BASE_NONE
, NULL
, 0x0,
3983 { &hf_mac_nr_msgb_subheader
,
3985 "mac-nr.msgb.subheader", FT_STRING
, BASE_NONE
, NULL
, 0x0,
3989 { &hf_mac_nr_msgb_e
,
3991 "mac-nr.msgb.e", FT_BOOLEAN
, 8, TFS(&rar_ext_vals
), 0x80,
3995 { &hf_mac_nr_msgb_t1
,
3997 "mac-nr.msgb.t1", FT_BOOLEAN
, 8, TFS(&msgb_t1_vals
), 0x40,
4001 { &hf_mac_nr_msgb_t2
,
4003 "mac-nr.msgb.t2", FT_BOOLEAN
, 8, TFS(&msgb_t2_vals
), 0x20,
4007 { &hf_mac_nr_msgb_s
,
4009 "mac-nr.msgb.s", FT_BOOLEAN
, 8, TFS(&msgb_s_vals
), 0x10,
4010 "MAC SDU indicator", HFILL
4014 { &hf_mac_nr_msgb_reserved
,
4016 "mac-nr.msgb.reserved", FT_UINT8
, BASE_DEC
, NULL
, 0x10,
4020 { &hf_mac_nr_msgb_reserved2
,
4022 "mac-nr.msgb.reserved", FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
4026 { &hf_mac_nr_msgb_reserved3
,
4028 "mac-nr.msgb.reserved", FT_UINT8
, BASE_DEC
, NULL
, 0x80,
4032 { &hf_mac_nr_msgb_ta_command
,
4033 { "Timing Advance Command",
4034 "mac-nr.msgb.ta-command", FT_UINT16
, BASE_DEC
, NULL
, 0x0fff,
4038 /* TODO: vals from 38.213 [6] */
4039 { &hf_mac_nr_msgb_channelaccess_cpext
,
4040 { "ChannelAccess-CPext",
4041 "mac-nr.msgb.channelaccess-cpext", FT_UINT8
, BASE_DEC
, NULL
, 0x60,
4045 /* TODO: vals from 38.213 [6] */
4046 { &hf_mac_nr_msgb_tpc
,
4048 "mac-nr.msgb.tpc", FT_UINT8
, BASE_DEC
, NULL
, 0x18,
4049 "TPC command for the PUCCH resource containing HARQ feedback for MSGB", HFILL
4052 { &hf_mac_nr_msgb_harq_feedback_timing_indicator
,
4053 { "HARQ Feedback Timing Indicator",
4054 "mac-nr.msgb.harq-feedback-timing-indicator", FT_UINT8
, BASE_DEC
, NULL
, 0x07,
4058 { &hf_mac_nr_msgb_pucch_resource_indicator
,
4059 { "PUCCH Resource Indicator",
4060 "mac-nr.msgb.pucch-resource-indicator", FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
4065 { &hf_mac_nr_padding
,
4067 "mac-nr.padding", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4072 { &hf_mac_nr_control_crnti
,
4074 "mac-nr.control.crnti", FT_UINT16
, BASE_HEX_DEC
, NULL
, 0x0,
4078 { &hf_mac_nr_control_ue_contention_resolution_identity
,
4079 { "UE Contention Resolution Identity",
4080 "mac-nr.control.ue-contention-resolution.identity", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
4084 { &hf_mac_nr_control_timing_advance_tagid
,
4086 "mac-nr.control.timing-advance.tag-id", FT_UINT8
, BASE_DEC
, NULL
, 0xc0,
4090 { &hf_mac_nr_control_timing_advance_command
,
4091 { "Timing Advance Command",
4092 "mac-nr.control.timing-advance.command", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4096 { &hf_mac_nr_control_se_phr_reserved
,
4098 "mac-nr.control.se-phr.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0xc0,
4102 { &hf_mac_nr_control_se_phr_ph
,
4104 "mac-nr.control.se-phr.ph", FT_UINT8
, BASE_CUSTOM
, CF_FUNC(mac_nr_phr_fmt
), 0x3f,
4108 { &hf_mac_nr_control_se_phr_pcmax_f_c
,
4110 "mac-nr.control.se-phr.pcmax_f_c", FT_UINT8
, BASE_CUSTOM
, CF_FUNC(mac_nr_pcmax_f_c_fmt
), 0x3f,
4115 { &hf_mac_nr_control_recommended_bit_rate_query_lcid
,
4117 "mac-nr.control.recommended-bit-rate-query.lcid", FT_UINT8
, BASE_DEC
, NULL
, 0xfc,
4121 { &hf_mac_nr_control_recommended_bit_rate_query_dir
,
4123 "mac-nr.control.recommended-bit-rate-query.dir", FT_BOOLEAN
, 8, TFS(&tfs_uplink_downlink
), 0x02,
4127 { &hf_mac_nr_control_recommended_bit_rate_query_bit_rate
,
4129 "mac-nr.control.recommended-bit-rate-query.bit-rate", FT_UINT16
, BASE_DEC
|BASE_EXT_STRING
, &bit_rate_vals_ext
, 0x01f8,
4133 { &hf_mac_nr_control_recommended_bit_rate_query_reserved
,
4135 "mac-nr.control.recommended-bit-rate-query.reserved", FT_UINT8
, BASE_DEC
, NULL
, 0x07,
4140 { &hf_mac_nr_control_me_phr_c7_flag
,
4142 "mac-nr.control.me-phr.c7", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x80,
4143 "SCellIndex 7 PHR report flag", HFILL
4146 { &hf_mac_nr_control_me_phr_c6_flag
,
4148 "mac-nr.control.me-phr.c6", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x40,
4149 "SCellIndex 6 PHR report flag", HFILL
4152 { &hf_mac_nr_control_me_phr_c5_flag
,
4154 "mac-nr.control.me-phr.c5", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x20,
4155 "SCellIndex 5 PHR report flag", HFILL
4158 { &hf_mac_nr_control_me_phr_c4_flag
,
4160 "mac-nr.control.me-phr.c4", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x10,
4161 "SCellIndex 4 PHR report flag", HFILL
4164 { &hf_mac_nr_control_me_phr_c3_flag
,
4166 "mac-nr.control.me-phr.c3", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x08,
4167 "SCellIndex 3 PHR report flag", HFILL
4170 { &hf_mac_nr_control_me_phr_c2_flag
,
4172 "mac-nr.control.me-phr.c2", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x04,
4173 "SCellIndex 2 PHR report flag", HFILL
4176 { &hf_mac_nr_control_me_phr_c1_flag
,
4178 "mac-nr.control.me-phr.c1", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x02,
4179 "SCellIndex 1 PHR report flag", HFILL
4182 { &hf_mac_nr_control_me_phr_c15_flag
,
4184 "mac-nr.control.me-phr.c15", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x80,
4185 "SCellIndex 15 PHR report flag", HFILL
4188 { &hf_mac_nr_control_me_phr_c14_flag
,
4190 "mac-nr.control.me-phr.c14", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x40,
4191 "SCellIndex 14 PHR report flag", HFILL
4194 { &hf_mac_nr_control_me_phr_c13_flag
,
4196 "mac-nr.control.me-phr.c13", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x20,
4197 "SCellIndex 13 PHR report flag", HFILL
4200 { &hf_mac_nr_control_me_phr_c12_flag
,
4202 "mac-nr.control.me-phr.c12", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x10,
4203 "SCellIndex 12 PHR report flag", HFILL
4206 { &hf_mac_nr_control_me_phr_c11_flag
,
4208 "mac-nr.control.me-phr.c11", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x08,
4209 "SCellIndex 11 PHR report flag", HFILL
4212 { &hf_mac_nr_control_me_phr_c10_flag
,
4214 "mac-nr.control.me-phr.c10", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x04,
4215 "SCellIndex 10 PHR report flag", HFILL
4218 { &hf_mac_nr_control_me_phr_c9_flag
,
4220 "mac-nr.control.me-phr.c9", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x02,
4221 "SCellIndex 9 PHR report flag", HFILL
4224 { &hf_mac_nr_control_me_phr_c8_flag
,
4226 "mac-nr.control.me-phr.c8", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x01,
4227 "SCellIndex 8 PHR report flag", HFILL
4230 { &hf_mac_nr_control_me_phr_c23_flag
,
4232 "mac-nr.control.me-phr.c23", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x80,
4233 "SCellIndex 23 PHR report flag", HFILL
4236 { &hf_mac_nr_control_me_phr_c22_flag
,
4238 "mac-nr.control.me-phr.c22", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x40,
4239 "SCellIndex 22 PHR report flag", HFILL
4242 { &hf_mac_nr_control_me_phr_c21_flag
,
4244 "mac-nr.control.me-phr.c21", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x20,
4245 "SCellIndex 21 PHR report flag", HFILL
4248 { &hf_mac_nr_control_me_phr_c20_flag
,
4250 "mac-nr.control.me-phr.c20", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x10,
4251 "SCellIndex 20 PHR report flag", HFILL
4254 { &hf_mac_nr_control_me_phr_c19_flag
,
4256 "mac-nr.control.me-phr.c19", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x08,
4257 "SCellIndex 19 PHR report flag", HFILL
4260 { &hf_mac_nr_control_me_phr_c18_flag
,
4262 "mac-nr.control.me-phr.c18", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x04,
4263 "SCellIndex 18 PHR report flag", HFILL
4266 { &hf_mac_nr_control_me_phr_c17_flag
,
4268 "mac-nr.control.me-phr.c17", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x02,
4269 "SCellIndex 17 PHR report flag", HFILL
4272 { &hf_mac_nr_control_me_phr_c16_flag
,
4274 "mac-nr.control.me-phr.c16", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x01,
4275 "SCellIndex 16 PHR report flag", HFILL
4278 { &hf_mac_nr_control_me_phr_c31_flag
,
4280 "mac-nr.control.me-phr.c31", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x80,
4281 "SCellIndex 31 PHR report flag", HFILL
4284 { &hf_mac_nr_control_me_phr_c30_flag
,
4286 "mac-nr.control.me-phr.c30", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x40,
4287 "SCellIndex 30 PHR report flag", HFILL
4290 { &hf_mac_nr_control_me_phr_c29_flag
,
4292 "mac-nr.control.me-phr.c29", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x20,
4293 "SCellIndex 29 PHR report flag", HFILL
4296 { &hf_mac_nr_control_me_phr_c28_flag
,
4298 "mac-nr.control.me-phr.c28", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x10,
4299 "SCellIndex 28 PHR report flag", HFILL
4302 { &hf_mac_nr_control_me_phr_c27_flag
,
4304 "mac-nr.control.me-phr.c27", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x08,
4305 "SCellIndex 27 PHR report flag", HFILL
4308 { &hf_mac_nr_control_me_phr_c26_flag
,
4310 "mac-nr.control.me-phr.c26", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x04,
4311 "SCellIndex 26 PHR report flag", HFILL
4314 { &hf_mac_nr_control_me_phr_c25_flag
,
4316 "mac-nr.control.me-phr.c25", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x02,
4317 "SCellIndex 25 PHR report flag", HFILL
4320 { &hf_mac_nr_control_me_phr_c24_flag
,
4322 "mac-nr.control.me-phr.c24", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x01,
4323 "SCellIndex 24 PHR report flag", HFILL
4326 { &hf_mac_nr_control_me_phr_entry
,
4328 "mac-nr.control.me.phr.entry", FT_STRING
, BASE_NONE
, NULL
, 0x0,
4332 { &hf_mac_nr_control_me_phr_reserved
,
4334 "mac-nr.control.me-phr.reserved", FT_BOOLEAN
, 8, NULL
, 0x01,
4338 { &hf_mac_nr_control_me_phr_p
,
4340 "mac-nr.control.me-phr.p", FT_BOOLEAN
, 8, TFS(&power_backoff_affects_power_management_vals
), 0x80,
4344 { &hf_mac_nr_control_me_phr_v
,
4346 "mac-nr.control.me-phr.v", FT_BOOLEAN
, 8, TFS(&phr_source_vals
), 0x40,
4350 { &hf_mac_nr_control_me_phr_ph_type2_spcell
,
4351 { "Power Headroom, (Type2, SpCell)",
4352 "mac-nr.control.me-phr.ph", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4356 { &hf_mac_nr_control_me_phr_ph_type1_pcell
,
4357 { "Power Headroom (Type1, PCell)",
4358 "mac-nr.control.me-phr.ph.type1-pcell", FT_UINT8
, BASE_CUSTOM
, CF_FUNC(mac_nr_phr_fmt
), 0x3f,
4363 { &hf_mac_nr_control_me_phr_ph_c31
,
4364 { "PH for SCellIndex 31",
4365 "mac-nr.control.me-phr.ph.c31", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4369 { &hf_mac_nr_control_me_phr_ph_c30
,
4370 { "PH for SCellIndex 30",
4371 "mac-nr.control.me-phr.ph.c30", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4375 { &hf_mac_nr_control_me_phr_ph_c29
,
4376 { "PH for SCellIndex 29",
4377 "mac-nr.control.me-phr.ph.c29", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4381 { &hf_mac_nr_control_me_phr_ph_c28
,
4382 { "PH for SCellIndex 28",
4383 "mac-nr.control.me-phr.ph.c28", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4387 { &hf_mac_nr_control_me_phr_ph_c27
,
4388 { "PH for SCellIndex 27",
4389 "mac-nr.control.me-phr.ph.c27", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4393 { &hf_mac_nr_control_me_phr_ph_c26
,
4394 { "PH for SCellIndex 26",
4395 "mac-nr.control.me-phr.ph.c26", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4399 { &hf_mac_nr_control_me_phr_ph_c25
,
4400 { "PH for SCellIndex 25",
4401 "mac-nr.control.me-phr.ph.c25", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4405 { &hf_mac_nr_control_me_phr_ph_c24
,
4406 { "PH for SCellIndex 24",
4407 "mac-nr.control.me-phr.ph.c24", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4411 { &hf_mac_nr_control_me_phr_ph_c23
,
4412 { "PH for SCellIndex 23",
4413 "mac-nr.control.me-phr.ph.c23", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4417 { &hf_mac_nr_control_me_phr_ph_c22
,
4418 { "PH for SCellIndex 22",
4419 "mac-nr.control.me-phr.ph.c22", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4423 { &hf_mac_nr_control_me_phr_ph_c21
,
4424 { "PH for SCellIndex 21",
4425 "mac-nr.control.me-phr.ph.c21", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4429 { &hf_mac_nr_control_me_phr_ph_c20
,
4430 { "PH for SCellIndex 20",
4431 "mac-nr.control.me-phr.ph.c20", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4435 { &hf_mac_nr_control_me_phr_ph_c19
,
4436 { "PH for SCellIndex 19",
4437 "mac-nr.control.me-phr.ph.c19", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4441 { &hf_mac_nr_control_me_phr_ph_c18
,
4442 { "PH for SCellIndex 18",
4443 "mac-nr.control.me-phr.ph.c18", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4447 { &hf_mac_nr_control_me_phr_ph_c17
,
4448 { "PH for SCellIndex 17",
4449 "mac-nr.control.me-phr.ph.c17", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4453 { &hf_mac_nr_control_me_phr_ph_c16
,
4454 { "PH for SCellIndex 16",
4455 "mac-nr.control.me-phr.ph.c16", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4459 { &hf_mac_nr_control_me_phr_ph_c15
,
4460 { "PH for SCellIndex 15",
4461 "mac-nr.control.me-phr.ph.c15", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4465 { &hf_mac_nr_control_me_phr_ph_c14
,
4466 { "PH for SCellIndex 14",
4467 "mac-nr.control.me-phr.ph.c14", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4471 { &hf_mac_nr_control_me_phr_ph_c13
,
4472 { "PH for SCellIndex 13",
4473 "mac-nr.control.me-phr.ph.c13", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4477 { &hf_mac_nr_control_me_phr_ph_c12
,
4478 { "PH for SCellIndex 12",
4479 "mac-nr.control.me-phr.ph.c12", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4483 { &hf_mac_nr_control_me_phr_ph_c11
,
4484 { "PH for SCellIndex 11",
4485 "mac-nr.control.me-phr.ph.c11", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4489 { &hf_mac_nr_control_me_phr_ph_c10
,
4490 { "PH for SCellIndex 10",
4491 "mac-nr.control.me-phr.ph.c10", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4495 { &hf_mac_nr_control_me_phr_ph_c9
,
4496 { "PH for SCellIndex 9",
4497 "mac-nr.control.me-phr.ph.c9", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4501 { &hf_mac_nr_control_me_phr_ph_c8
,
4502 { "PH for SCellIndex 8",
4503 "mac-nr.control.me-phr.ph.c8", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4507 { &hf_mac_nr_control_me_phr_ph_c7
,
4508 { "PH for SCellIndex 7",
4509 "mac-nr.control.me-phr.ph.c7", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4513 { &hf_mac_nr_control_me_phr_ph_c6
,
4514 { "PH for SCellIndex 6",
4515 "mac-nr.control.me-phr.ph.c6", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4519 { &hf_mac_nr_control_me_phr_ph_c5
,
4520 { "PH for SCellIndex 5",
4521 "mac-nr.control.me-phr.ph.c5", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4525 { &hf_mac_nr_control_me_phr_ph_c4
,
4526 { "PH for SCellIndex 4",
4527 "mac-nr.control.me-phr.ph.c4", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4531 { &hf_mac_nr_control_me_phr_ph_c3
,
4532 { "PH for SCellIndex 3",
4533 "mac-nr.control.me-phr.ph.c3", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4537 { &hf_mac_nr_control_me_phr_ph_c2
,
4538 { "PH for SCellIndex 2",
4539 "mac-nr.control.me-phr.ph.c2", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4543 { &hf_mac_nr_control_me_phr_ph_c1
,
4544 { "PH for SCellIndex 1",
4545 "mac-nr.control.me-phr.ph.c1", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4549 { &hf_mac_nr_control_me_phr_reserved_2
,
4551 "mac-nr.control.me-phr.reserved", FT_BOOLEAN
, 8, NULL
, 0xc0,
4555 { &hf_mac_nr_control_me_phr_pcmax_f_c_type2_spcell
,
4557 "mac-nr.control.me-phr.type2-spcell", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4561 { &hf_mac_nr_control_me_phr_pcmax_f_c_type1_pcell
,
4563 "mac-nr.control.me-phr.type1-pcell", FT_UINT8
, BASE_CUSTOM
, CF_FUNC(mac_nr_pcmax_f_c_fmt
), 0x3f,
4567 { &hf_mac_nr_control_me_phr_pcmax_f_c_typeX
,
4569 "mac-nr.control.me-phr.typeX", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4574 { &hf_mac_nr_control_recommended_bit_rate_lcid
,
4576 "mac-nr.control.recommended-bit-rate.lcid", FT_UINT8
, BASE_DEC
, NULL
, 0xfc,
4580 { &hf_mac_nr_control_recommended_bit_rate_dir
,
4582 "mac-nr.control.recommended-bit-rate.dir", FT_BOOLEAN
, 8, TFS(&tfs_uplink_downlink
), 0x02,
4586 { &hf_mac_nr_control_recommended_bit_rate_bit_rate
,
4588 "mac-nr.control.recommended-bit-rate.bit-rate", FT_UINT16
, BASE_DEC
|BASE_EXT_STRING
, &bit_rate_vals_ext
, 0x01f8,
4592 { &hf_mac_nr_control_recommended_bit_rate_reserved
,
4594 "mac-nr.control.recommended-bit-rate.reserved", FT_UINT8
, BASE_DEC
, NULL
, 0x07,
4599 { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_ad
,
4601 "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.ad", FT_BOOLEAN
, 8, TFS(&activation_deactivation_vals
), 0x80,
4605 { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_serving_cell_id
,
4606 { "Serving Cell ID",
4607 "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.serving-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7c,
4611 { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_bwp_id
,
4613 "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.bwp-id", FT_UINT8
, BASE_DEC
, NULL
, 0x03,
4617 { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_reserved_2
,
4619 "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0xf0,
4623 { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_sp_zp_rs_resource_set_id
,
4624 { "SP ZP CSI-RS resource set ID",
4625 "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.sp-zp-rs-resource-set-id", FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
4629 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_reserved
,
4631 "mac-nr.control.pucch-spatial-rel-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x80,
4635 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_serving_cell_id
,
4636 { "Serving Cell ID",
4637 "mac-nr.control.pucch-spatial-rel-act-deact.serving-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7c,
4641 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_bwp_id
,
4643 "mac-nr.control.pucch-spatial-rel-act-deact.bwp-id", FT_UINT8
, BASE_DEC
, NULL
, 0x03,
4647 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_pucch_resource_id
,
4648 { "PUCCH Resource ID",
4649 "mac-nr.control.pucch-spatial-rel-act-deact.pucch-resource-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7f,
4653 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s8
,
4654 { "PUCCH Spatial Relation Info 8",
4655 "mac-nr.control.pucch-spatial-rel-act-deact.s8", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x80,
4659 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s7
,
4660 { "PUCCH Spatial Relation Info 7",
4661 "mac-nr.control.pucch-spatial-rel-act-deact.s7", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x40,
4665 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s6
,
4666 { "PUCCH Spatial Relation Info 6",
4667 "mac-nr.control.pucch-spatial-rel-act-deact.s6", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x20,
4671 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s5
,
4672 { "PUCCH Spatial Relation Info 5",
4673 "mac-nr.control.pucch-spatial-rel-act-deact.s5", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
4677 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s4
,
4678 { "PUCCH Spatial Relation Info 4",
4679 "mac-nr.control.pucch-spatial-rel-act-deact.s4", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x08,
4683 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s3
,
4684 { "PUCCH Spatial Relation Info 3",
4685 "mac-nr.control.pucch-spatial-rel-act-deact.s3", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x04,
4689 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s2
,
4690 { "PUCCH Spatial Relation Info 2",
4691 "mac-nr.control.pucch-spatial-rel-act-deact.s2", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x02,
4695 { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s1
,
4696 { "PUCCH Spatial Relation Info 1",
4697 "mac-nr.control.pucch-spatial-rel-act-deact.s1", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x01,
4701 { &hf_mac_nr_control_sp_srs_act_deact_ad
,
4703 "mac-nr.control.sp-srs-act-deact.ad", FT_BOOLEAN
, 8, TFS(&activation_deactivation_vals
), 0x80,
4707 { &hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_cell_id
,
4708 { "SRS Resource Set's Cell ID",
4709 "mac-nr.control.sp-srs-act-deact.srs-resource-set-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7c,
4713 { &hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_bwp_id
,
4714 { "SRS Resource Set's BWP ID",
4715 "mac-nr.control.sp-srs-act-deact.srs-resource-set-bwp-id", FT_UINT8
, BASE_DEC
, NULL
, 0x03,
4719 { &hf_mac_nr_control_sp_srs_act_deact_reserved
,
4721 "mac-nr.control.sp-srs-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x00,
4725 { &hf_mac_nr_control_sp_srs_act_deact_c
,
4727 "mac-nr.control.sp-srs-act-deact.c", FT_BOOLEAN
, 8, TFS(&c_vals
), 0x20,
4731 { &hf_mac_nr_control_sp_srs_act_deact_sul
,
4733 "mac-nr.control.sp-srs-act-deact.sul", FT_BOOLEAN
, 8, TFS(&sul_vals
), 0x10,
4737 { &hf_mac_nr_control_sp_srs_act_deact_sp_srs_resource_set_id
,
4738 { "SP SRS Resource Set ID",
4739 "mac-nr.control.sp-srs-act-deact.sp-srs-resource-set-id", FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
4743 { &hf_mac_nr_control_sp_srs_act_deact_f
,
4745 "mac-nr.control.sp-srs-act-deact.f", FT_BOOLEAN
, 8, TFS(&sp_srs_act_deact_f_vals
), 0x80,
4749 { &hf_mac_nr_control_sp_srs_act_deact_resource_id
,
4751 "mac-nr.control.sp-srs-act-deact.resource-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7f,
4755 { &hf_mac_nr_control_sp_srs_act_deact_resource_id_ssb
,
4757 "mac-nr.control.sp-srs-act-deact.resource-id", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
4762 { &hf_mac_nr_control_sp_srs_act_deact_resource_serving_cell_id
,
4763 { "Resource Serving Cell ID",
4764 "mac-nr.control.sp-srs-act-deact.resource-serving-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7c,
4768 { &hf_mac_nr_control_sp_srs_act_deact_resource_bwp_id
,
4769 { "Resource BWP ID",
4770 "mac-nr.control.sp-srs-act-deact.resource-bwp-id", FT_UINT8
, BASE_DEC
, NULL
, 0x03,
4774 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_reserved
,
4776 "mac-nr.control.sp-csi-report-on-pucch-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x80,
4780 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_serving_cell_id
,
4781 { "Serving Cell ID",
4782 "mac-nr.control.sp-csi-report-on-pucch-act-deact.serving-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7c,
4786 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_bwp_id
,
4788 "mac-nr.control.sp-csi-report-on-pucch-act-deact.bwp-id", FT_UINT8
, BASE_DEC
, NULL
, 0x03,
4792 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s7
,
4793 { "Semi-Persistent CSI report configuration 7",
4794 "mac-nr.control.sp-csi-report-on-pucch-act-deact.s7", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x80,
4798 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s6
,
4799 { "Semi-Persistent CSI report configuration 6",
4800 "mac-nr.control.sp-csi-report-on-pucch-act-deact.s6", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x40,
4804 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s5
,
4805 { "Semi-Persistent CSI report configuration 5",
4806 "mac-nr.control.sp-csi-report-on-pucch-act-deact.s5", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x20,
4810 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s4
,
4811 { "Semi-Persistent CSI report configuration 4",
4812 "mac-nr.control.sp-csi-report-on-pucch-act-deact.s4", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
4816 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s3
,
4817 { "Semi-Persistent CSI report configuration 3",
4818 "mac-nr.control.sp-csi-report-on-pucch-act-deact.s3", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x08,
4822 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s2
,
4823 { "Semi-Persistent CSI report configuration 2",
4824 "mac-nr.control.sp-csi-report-on-pucch-act-deact.s2", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x04,
4828 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s1
,
4829 { "Semi-Persistent CSI report configuration 1",
4830 "mac-nr.control.sp-csi-report-on-pucch-act-deact.s1", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x02,
4834 { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s0
,
4835 { "Semi-Persistent CSI report configuration 0",
4836 "mac-nr.control.sp-csi-report-on-pucch-act-deact.s0", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x01,
4840 { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_serving_cell_id
,
4841 { "Serving Cell ID",
4842 "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.serving-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0xf8,
4846 { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_coreset_id
,
4848 "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.coreset-id", FT_UINT16
, BASE_DEC
, NULL
, 0x0780,
4852 { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_tci_state_id
,
4854 "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.tci-state-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7f,
4858 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_reserved
,
4860 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x80,
4864 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_serving_cell_id
,
4865 { "Serving Cell ID",
4866 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.serving-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7c,
4870 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_bwp_id
,
4872 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.bwp-id", FT_UINT8
, BASE_DEC
, NULL
, 0x03,
4876 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t7
,
4878 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t7", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x80,
4882 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t6
,
4884 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t6", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x40,
4888 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t5
,
4890 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t5", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x20,
4894 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t4
,
4896 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t4", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
4900 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t3
,
4902 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t3", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x08,
4906 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t2
,
4908 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t2", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x04,
4912 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t1
,
4914 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t1", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x02,
4918 { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t0
,
4920 "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t0", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x01,
4924 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_reserved
,
4926 "mac-nr.control.aper-csi-trigger-state-subselect.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x80,
4930 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_serving_cell_id
,
4931 { "Serving Cell ID",
4932 "mac-nr.control.aper-csi-trigger-state-subselect.serving-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7c,
4936 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_bwp_id
,
4938 "mac-nr.control.aper-csi-trigger-state-subselect.bwp-id", FT_UINT8
, BASE_DEC
, NULL
, 0x03,
4942 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t7
,
4943 { "Aperiodic trigger state N+7",
4944 "mac-nr.control.aper-csi-trigger-state-subselect.t7", FT_BOOLEAN
, 8, TFS(&aper_csi_trigger_state_t_vals
), 0x80,
4948 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t6
,
4949 { "Aperiodic trigger state N+6",
4950 "mac-nr.control.aper-csi-trigger-state-subselect.t6", FT_BOOLEAN
, 8, TFS(&aper_csi_trigger_state_t_vals
), 0x40,
4954 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t5
,
4955 { "Aperiodic trigger state N+5",
4956 "mac-nr.control.aper-csi-trigger-state-subselect.t5", FT_BOOLEAN
, 8, TFS(&aper_csi_trigger_state_t_vals
), 0x20,
4960 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t4
,
4961 { "Aperiodic trigger state N+4",
4962 "mac-nr.control.aper-csi-trigger-state-subselect.t4", FT_BOOLEAN
, 8, TFS(&aper_csi_trigger_state_t_vals
), 0x10,
4966 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t3
,
4967 { "Aperiodic trigger state N+3",
4968 "mac-nr.control.aper-csi-trigger-state-subselect.t3", FT_BOOLEAN
, 8, TFS(&aper_csi_trigger_state_t_vals
), 0x08,
4972 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t2
,
4973 { "Aperiodic trigger state N+2",
4974 "mac-nr.control.aper-csi-trigger-state-subselect.t2", FT_BOOLEAN
, 8, TFS(&aper_csi_trigger_state_t_vals
), 0x04,
4978 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t1
,
4979 { "Aperiodic trigger state N+1",
4980 "mac-nr.control.aper-csi-trigger-state-subselect.t1", FT_BOOLEAN
, 8, TFS(&aper_csi_trigger_state_t_vals
), 0x02,
4984 { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t0
,
4985 { "Aperiodic trigger state N",
4986 "mac-nr.control.aper-csi-trigger-state-subselect.t0", FT_BOOLEAN
, 8, TFS(&aper_csi_trigger_state_t_vals
), 0x01,
4990 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_ad
,
4992 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.ad", FT_BOOLEAN
, 8, TFS(&activation_deactivation_vals
), 0x80,
4996 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_serving_cell_id
,
4997 { "Serving Cell ID",
4998 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.serving-cell-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7c,
5002 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_bwp_id
,
5004 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.bwp-id", FT_UINT8
, BASE_DEC
, NULL
, 0x03,
5008 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved
,
5010 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0xe0,
5014 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_im
,
5016 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.im", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
5020 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_rs_res_set_id
,
5021 { "SP CSI-RS resource set ID",
5022 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.sp-csi-rs-res-set-id", FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
5026 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved2
,
5028 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0xf0,
5032 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_im_res_set_id
,
5033 { "SP CSI-IM resource set ID",
5034 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.sp-csi-im-res-set-id", FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
5038 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved3
,
5040 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x80,
5044 { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_tci_state_id
,
5046 "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.tci-state-id", FT_UINT8
, BASE_DEC
, NULL
, 0x7f,
5050 { &hf_mac_nr_control_dupl_act_deact_drb7
,
5052 "mac-nr.control.dupl-act-deact.drb7", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x80,
5056 { &hf_mac_nr_control_dupl_act_deact_drb6
,
5058 "mac-nr.control.dupl-act-deact.drb6", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x40,
5062 { &hf_mac_nr_control_dupl_act_deact_drb5
,
5064 "mac-nr.control.dupl-act-deact.drb5", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x20,
5068 { &hf_mac_nr_control_dupl_act_deact_drb4
,
5070 "mac-nr.control.dupl-act-deact.drb4", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
5074 { &hf_mac_nr_control_dupl_act_deact_drb3
,
5076 "mac-nr.control.dupl-act-deact.drb3", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x08,
5080 { &hf_mac_nr_control_dupl_act_deact_drb2
,
5082 "mac-nr.control.dupl-act-deact.drb2", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x04,
5086 { &hf_mac_nr_control_dupl_act_deact_drb1
,
5088 "mac-nr.control.dupl-act-deact.drb1", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x02,
5092 { &hf_mac_nr_control_dupl_act_deact_reserved
,
5094 "mac-nr.control.dupl-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x01,
5098 { &hf_mac_nr_control_scell_act_deact_cell7
,
5100 "mac-nr.control.scell-act-deact.cell7", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x80,
5104 { &hf_mac_nr_control_scell_act_deact_cell6
,
5106 "mac-nr.control.scell-act-deact.cell6", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x40,
5110 { &hf_mac_nr_control_scell_act_deact_cell5
,
5112 "mac-nr.control.scell-act-deact.cell5", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x20,
5116 { &hf_mac_nr_control_scell_act_deact_cell4
,
5118 "mac-nr.control.scell-act-deact.cell4", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
5122 { &hf_mac_nr_control_scell_act_deact_cell3
,
5124 "mac-nr.control.scell-act-deact.cell3", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x08,
5128 { &hf_mac_nr_control_scell_act_deact_cell2
,
5130 "mac-nr.control.scell-act-deact.cell2", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x04,
5134 { &hf_mac_nr_control_scell_act_deact_cell1
,
5136 "mac-nr.control.scell-act-deact.cell1", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x02,
5140 { &hf_mac_nr_control_scell_act_deact_reserved
,
5142 "mac-nr.control.scell-act-deact.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0x01,
5146 { &hf_mac_nr_control_scell_act_deact_cell15
,
5148 "mac-nr.control.scell-act-deact.cell15", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x80,
5152 { &hf_mac_nr_control_scell_act_deact_cell14
,
5154 "mac-nr.control.scell-act-deact.cell14", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x40,
5158 { &hf_mac_nr_control_scell_act_deact_cell13
,
5160 "mac-nr.control.scell-act-deact.cell13", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x20,
5164 { &hf_mac_nr_control_scell_act_deact_cell12
,
5166 "mac-nr.control.scell-act-deact.cell12", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
5170 { &hf_mac_nr_control_scell_act_deact_cell11
,
5172 "mac-nr.control.scell-act-deact.cell11", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x08,
5176 { &hf_mac_nr_control_scell_act_deact_cell10
,
5178 "mac-nr.control.scell-act-deact.cell10", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x04,
5182 { &hf_mac_nr_control_scell_act_deact_cell9
,
5184 "mac-nr.control.scell-act-deact.cell9", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x02,
5188 { &hf_mac_nr_control_scell_act_deact_cell8
,
5190 "mac-nr.control.scell-act-deact.cell8", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x01,
5194 { &hf_mac_nr_control_scell_act_deact_cell23
,
5196 "mac-nr.control.scell-act-deact.cell23", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x80,
5200 { &hf_mac_nr_control_scell_act_deact_cell22
,
5202 "mac-nr.control.scell-act-deact.cell22", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x40,
5206 { &hf_mac_nr_control_scell_act_deact_cell21
,
5208 "mac-nr.control.scell-act-deact.cell21", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x20,
5212 { &hf_mac_nr_control_scell_act_deact_cell20
,
5214 "mac-nr.control.scell-act-deact.cell20", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
5218 { &hf_mac_nr_control_scell_act_deact_cell19
,
5220 "mac-nr.control.scell-act-deact.cell19", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x08,
5224 { &hf_mac_nr_control_scell_act_deact_cell18
,
5226 "mac-nr.control.scell-act-deact.cell18", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x04,
5230 { &hf_mac_nr_control_scell_act_deact_cell17
,
5232 "mac-nr.control.scell-act-deact.cell17", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x02,
5236 { &hf_mac_nr_control_scell_act_deact_cell16
,
5238 "mac-nr.control.scell-act-deact.cell16", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x01,
5242 { &hf_mac_nr_control_scell_act_deact_cell31
,
5244 "mac-nr.control.scell-act-deact.cell31", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x80,
5248 { &hf_mac_nr_control_scell_act_deact_cell30
,
5250 "mac-nr.control.scell-act-deact.cell30", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x40,
5254 { &hf_mac_nr_control_scell_act_deact_cell29
,
5256 "mac-nr.control.scell-act-deact.cell29", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x20,
5260 { &hf_mac_nr_control_scell_act_deact_cell28
,
5262 "mac-nr.control.scell-act-deact.cell28", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x10,
5266 { &hf_mac_nr_control_scell_act_deact_cell27
,
5268 "mac-nr.control.scell-act-deact.cell27", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x08,
5272 { &hf_mac_nr_control_scell_act_deact_cell26
,
5274 "mac-nr.control.scell-act-deact.cell26", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x04,
5278 { &hf_mac_nr_control_scell_act_deact_cell25
,
5280 "mac-nr.control.scell-act-deact.cell25", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x02,
5284 { &hf_mac_nr_control_scell_act_deact_cell24
,
5286 "mac-nr.control.scell-act-deact.cell24", FT_BOOLEAN
, 8, TFS(&tfs_activated_deactivated
), 0x01,
5290 { &hf_mac_nr_control_bsr_short_lcg
,
5292 "mac-nr.control.bsr.short.lcg", FT_UINT8
, BASE_DEC
, NULL
, 0xe0,
5293 "Logical Channel Group", HFILL
5296 { &hf_mac_nr_control_bsr_short_bs_lcg0
,
5297 { "Buffer Size for LCG0",
5298 "mac-nr.control.bsr.bs-lcg0", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_5bits_vals_ext
, 0x1f,
5302 { &hf_mac_nr_control_bsr_short_bs_lcg1
,
5303 { "Buffer Size for LCG1",
5304 "mac-nr.control.bsr.bs-lcg1", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_5bits_vals_ext
, 0x1f,
5308 { &hf_mac_nr_control_bsr_short_bs_lcg2
,
5309 { "Buffer Size for LCG2",
5310 "mac-nr.control.bsr.bs-lcg2", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_5bits_vals_ext
, 0x1f,
5314 { &hf_mac_nr_control_bsr_short_bs_lcg3
,
5315 { "Buffer Size for LCG3",
5316 "mac-nr.control.bsr.bs-lcg3", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_5bits_vals_ext
, 0x1f,
5320 { &hf_mac_nr_control_bsr_short_bs_lcg4
,
5321 { "Buffer Size for LCG4",
5322 "mac-nr.control.bsr.bs-lcg4", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_5bits_vals_ext
, 0x1f,
5326 { &hf_mac_nr_control_bsr_short_bs_lcg5
,
5327 { "Buffer Size for LCG5",
5328 "mac-nr.control.bsr.bs-lcg5", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_5bits_vals_ext
, 0x1f,
5332 { &hf_mac_nr_control_bsr_short_bs_lcg6
,
5333 { "Buffer Size for LCG6",
5334 "mac-nr.control.bsr.bs-lcg6", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_5bits_vals_ext
, 0x1f,
5338 { &hf_mac_nr_control_bsr_short_bs_lcg7
,
5339 { "Buffer Size for LCG7",
5340 "mac-nr.control.bsr.bs-lcg7", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_5bits_vals_ext
, 0x1f,
5344 { &hf_mac_nr_control_bsr_long_lcg7
,
5346 "mac-nr.control.bsr.long.lcg7", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x80,
5347 "Logical Channel Group 7", HFILL
5350 { &hf_mac_nr_control_bsr_long_lcg6
,
5352 "mac-nr.control.bsr.long.lcg6", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x40,
5353 "Logical Channel Group 6", HFILL
5356 { &hf_mac_nr_control_bsr_long_lcg5
,
5358 "mac-nr.control.bsr.long.lcg5", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x20,
5359 "Logical Channel Group 5", HFILL
5362 { &hf_mac_nr_control_bsr_long_lcg4
,
5364 "mac-nr.control.bsr.long.lcg4", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x10,
5365 "Logical Channel Group 4", HFILL
5368 { &hf_mac_nr_control_bsr_long_lcg3
,
5370 "mac-nr.control.bsr.long.lcg3", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x08,
5371 "Logical Channel Group 3", HFILL
5374 { &hf_mac_nr_control_bsr_long_lcg2
,
5376 "mac-nr.control.bsr.long.lcg2", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x04,
5377 "Logical Channel Group 2", HFILL
5380 { &hf_mac_nr_control_bsr_long_lcg1
,
5382 "mac-nr.control.bsr.long.lcg1", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x02,
5383 "Logical Channel Group 1", HFILL
5386 { &hf_mac_nr_control_bsr_long_lcg0
,
5388 "mac-nr.control.bsr.long.lcg0", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x01,
5389 "Logical Channel Group 0", HFILL
5392 { &hf_mac_nr_control_bsr_trunc_long_bs
,
5394 "mac-nr.control.bsr.trunc-bs", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5398 { &hf_mac_nr_control_bsr_long_bs_lcg7
,
5399 { "Buffer Size for LCG7",
5400 "mac-nr.control.bsr.bs-lcg7", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5404 { &hf_mac_nr_control_bsr_long_bs_lcg6
,
5405 { "Buffer Size for LCG6",
5406 "mac-nr.control.bsr.bs-lcg6", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5410 { &hf_mac_nr_control_bsr_long_bs_lcg5
,
5411 { "Buffer Size for LCG5",
5412 "mac-nr.control.bsr.bs-lcg5", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5416 { &hf_mac_nr_control_bsr_long_bs_lcg4
,
5417 { "Buffer Size for LCG4",
5418 "mac-nr.control.bsr.bs-lcg4", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5422 { &hf_mac_nr_control_bsr_long_bs_lcg3
,
5423 { "Buffer Size for LCG3",
5424 "mac-nr.control.bsr.bs-lcg3", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5428 { &hf_mac_nr_control_bsr_long_bs_lcg2
,
5429 { "Buffer Size for LCG2",
5430 "mac-nr.control.bsr.bs-lcg2", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5434 { &hf_mac_nr_control_bsr_long_bs_lcg1
,
5435 { "Buffer Size for LCG1",
5436 "mac-nr.control.bsr.bs-lcg1", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5440 { &hf_mac_nr_control_bsr_long_bs_lcg0
,
5441 { "Buffer Size for LCG0",
5442 "mac-nr.control.bsr.bs-lcg0", FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &buffer_size_8bits_vals_ext
, 0x0,
5446 { &hf_mac_nr_control_timing_advance_report_reserved
,
5448 "mac-nr.control.ta-command.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0xc0,
5452 { &hf_mac_nr_control_timing_advance_report_ta
,
5454 "mac-nr.control.ta-command.ta", FT_UINT16
, BASE_DEC
, NULL
, 0x3f,
5458 { &hf_mac_nr_differential_koffset
,
5459 { "Differential Koffset",
5460 "mac-nr.differential_koffset", FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
5464 { &hf_mac_nr_differential_koffset_reserved
,
5466 "mac-nr.differential_koffset.reserved", FT_UINT8
, BASE_DEC
, NULL
, 0xc0,
5474 &ett_mac_nr_context
,
5475 &ett_mac_nr_subheader
,
5476 &ett_mac_nr_rar_subheader
,
5477 &ett_mac_nr_rar_grant
,
5478 &ett_mac_nr_me_phr_entry
5481 static ei_register_info ei
[] = {
5482 { &ei_mac_nr_no_per_frame_data
, { "mac-nr.no_per_frame_data", PI_UNDECODED
, PI_WARN
, "Can't dissect NR MAC frame because no per-frame info was attached!", EXPFILL
}},
5483 { &ei_mac_nr_sdu_length_different_from_dissected
, { "mac-nr.sdu-length-different-from-dissected", PI_UNDECODED
, PI_WARN
, "Something is wrong with sdu length or dissection is wrong", EXPFILL
}},
5484 { &ei_mac_nr_unknown_udp_framing_tag
, { "mac-nr.unknown-udp-framing-tag", PI_UNDECODED
, PI_WARN
, "Unknown UDP framing tag, aborting dissection", EXPFILL
}},
5485 { &ei_mac_nr_dl_sch_control_subheader_after_data_subheader
, { "mac-nr.ulsch.ce-after-data", PI_SEQUENCE
, PI_WARN
, "For DL-SCH PDUs, CEs should come before data", EXPFILL
}},
5486 { &ei_mac_nr_ul_sch_control_subheader_before_data_subheader
, { "mac-nr.dlsch.ce-before-data", PI_SEQUENCE
, PI_WARN
, "For UL-SCH PDUs, CEs should come after data", EXPFILL
}}
5489 module_t
*mac_nr_module
;
5490 expert_module_t
* expert_mac_nr
;
5492 static const enum_val_t lcid_drb_source_vals
[] = {
5493 {"from-static-stable", "From static table", FromStaticTable
},
5494 {"from-configuration-protocol", "From configuration protocol", FromConfigurationProtocol
},
5498 static uat_field_t lcid_drb_mapping_flds
[] = {
5499 UAT_FLD_VS(lcid_drb_mappings
, lcid
, "LCID (3-32)", drb_lcid_vals
,
5500 "The MAC LCID. Note that under NR-DC, LCID 3 may be SRB-3. "
5501 "LCID 4 may also be LCID4"),
5502 UAT_FLD_DEC(lcid_drb_mappings
, drbid
,"DRBID id (1-32)", "Identifier of logical data channel"),
5503 UAT_FLD_VS(lcid_drb_mappings
, bearer_type_ul
, "UL RLC Bearer Type", rlc_bearer_type_vals
, "UL Bearer Mode"),
5504 UAT_FLD_VS(lcid_drb_mappings
, bearer_type_dl
, "DL RLC Bearer Type", rlc_bearer_type_vals
, "DL Bearer Mode"),
5508 /* Register protocol. */
5509 proto_mac_nr
= proto_register_protocol("MAC-NR", "MAC-NR", "mac-nr");
5510 proto_register_field_array(proto_mac_nr
, hf
, array_length(hf
));
5511 proto_register_subtree_array(ett
, array_length(ett
));
5512 expert_mac_nr
= expert_register_protocol(proto_mac_nr
);
5513 expert_register_field_array(expert_mac_nr
, ei
, array_length(ei
));
5515 /* Allow other dissectors to find this one by name. */
5516 register_dissector("mac-nr", dissect_mac_nr
, proto_mac_nr
);
5518 /* Register the tap name. */
5519 mac_nr_tap
= register_tap("mac-3gpp");
5522 mac_nr_module
= prefs_register_protocol(proto_mac_nr
, NULL
);
5524 prefs_register_bool_preference(mac_nr_module
, "attempt_rrc_decode",
5525 "Attempt to decode BCCH, PCCH and CCCH data using NR RRC dissector",
5526 "Attempt to decode BCCH, PCCH and CCCH data using NR RRC dissector",
5527 &global_mac_nr_attempt_rrc_decode
);
5529 prefs_register_bool_preference(mac_nr_module
, "attempt_to_dissect_srb_sdus",
5530 "Attempt to dissect LCID 1-4 as srb1-4",
5531 "Will call NR RLC dissector with standard settings as per RRC spec, unless "
5532 "LCID 3,4 are being used for user-plane",
5533 &global_mac_nr_attempt_srb_decode
);
5535 prefs_register_enum_preference(mac_nr_module
, "lcid_to_drb_mapping_source",
5536 "Source of LCID -> drb channel settings",
5537 "Set whether LCID -> drb Table is taken from static table (below) or from "
5538 "info learned from control protocol (i.e. RRC)",
5539 &global_mac_nr_lcid_drb_source
, lcid_drb_source_vals
, false);
5541 lcid_drb_mappings_uat
= uat_new("Static LCID -> drb Table",
5542 sizeof(lcid_drb_mapping_t
),
5546 &num_lcid_drb_mappings
,
5547 UAT_AFFECTS_DISSECTION
, /* affects dissection of packets, but not set of named fields */
5548 "", /* TODO: is this ref to help manual? */
5549 lcid_drb_mapping_copy_cb
,
5554 lcid_drb_mapping_flds
);
5556 prefs_register_uat_preference(mac_nr_module
,
5558 "LCID -> DRB Mappings Table",
5559 "A table that maps from configurable lcids -> RLC bearer configs",
5560 lcid_drb_mappings_uat
);
5562 register_init_routine(&mac_nr_init_protocol
);
5563 register_cleanup_routine(&mac_nr_cleanup_protocol
);
5566 void proto_reg_handoff_mac_nr(void)
5568 /* Add as a heuristic UDP dissector */
5569 heur_dissector_add("udp", dissect_mac_nr_heur
, "MAC-NR over UDP", "mac_nr_udp", proto_mac_nr
, HEURISTIC_DISABLE
);
5571 rlc_nr_handle
= find_dissector_add_dependency("rlc-nr", proto_mac_nr
);
5572 nr_rrc_bcch_bch_handle
= find_dissector_add_dependency("nr-rrc.bcch.bch", proto_mac_nr
);
5573 nr_rrc_bcch_dl_sch_handle
= find_dissector_add_dependency("nr-rrc.bcch.dl.sch", proto_mac_nr
);
5574 nr_rrc_pcch_handle
= find_dissector_add_dependency("nr-rrc.pcch", proto_mac_nr
);
5575 nr_rrc_dl_ccch_handle
= find_dissector_add_dependency("nr-rrc.dl.ccch", proto_mac_nr
);
5576 nr_rrc_ul_ccch_handle
= find_dissector_add_dependency("nr-rrc.ul.ccch", proto_mac_nr
);
5577 nr_rrc_ul_ccch1_handle
= find_dissector_add_dependency("nr-rrc.ul.ccch1", proto_mac_nr
);
5582 * Editor modelines - https://www.wireshark.org/tools/modelines.html
5587 * indent-tabs-mode: nil
5590 * vi: set shiftwidth=4 tabstop=8 expandtab:
5591 * :indentSize=4:tabSize=8:noTabs=true: