Coverage Report

Created: 2026-08-14 06:45

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-mac-nr.c
Line
Count
Source
1
/* Routines for 5G/NR MAC disassembly
2
 *
3
 * Based on packet-mac-lte.c
4
 *
5
 * Wireshark - Network traffic analyzer
6
 * By Gerald Combs <gerald@wireshark.org>
7
 * Copyright 1998 Gerald Combs
8
 *
9
 * SPDX-License-Identifier: GPL-2.0-or-later
10
 */
11
12
#include "config.h"
13
14
#include <epan/packet.h>
15
#include <epan/exceptions.h>
16
#include <epan/expert.h>
17
#include <epan/proto_data.h>
18
#include <epan/tap.h>
19
#include <epan/uat.h>
20
#include <epan/tfs.h>
21
#include <wsutil/array.h>
22
23
#include "packet-mac-nr.h"
24
#include "packet-mac-3gpp-common.h"
25
#include "packet-rlc-nr.h"
26
27
void proto_register_mac_nr(void);
28
void proto_reg_handoff_mac_nr(void);
29
30
/* Described in:
31
 * 3GPP TS 38.321 NR; Medium Access Control (MAC) protocol specification v15.6.0
32
 */
33
34
/* Initialize the protocol and registered fields. */
35
static int proto_mac_nr;
36
37
static int mac_nr_tap = -1;
38
39
static dissector_handle_t rlc_nr_handle;
40
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;
53
54
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;
71
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;
303
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;
310
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;
321
322
static int hf_mac_nr_rar_temp_crnti;
323
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;
338
339
static int hf_mac_nr_padding;
340
341
static int hf_mac_nr_differential_koffset;
342
static int hf_mac_nr_differential_koffset_reserved;
343
/* Subtrees. */
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;
350
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;
356
357
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;
364
365
366
/**************************************************************************/
367
/* Preferences state                                                      */
368
/**************************************************************************/
369
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;
372
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;
375
376
/* Which layer info to show in the info column */
377
enum layer_to_show {
378
    ShowPHYLayer, ShowMACLayer, ShowRLCLayer
379
};
380
381
/* Which layer's details to show in Info column */
382
static int      global_mac_nr_layer_to_show = (int)ShowRLCLayer;
383
384
385
/***********************************************************************/
386
/* How to dissect lcid 3-32 (presume drb logical channels)             */
387
388
/* Where to take LCID -> DRB mappings from */
389
enum lcid_drb_source {
390
    FromStaticTable, FromConfigurationProtocol
391
};
392
static int global_mac_nr_lcid_drb_source = (int)FromStaticTable;
393
394
395
static const value_string drb_lcid_vals[] = {
396
    { 3,  "LCID 3"},
397
    { 4,  "LCID 4"},
398
    { 5,  "LCID 5"},
399
    { 6,  "LCID 6"},
400
    { 7,  "LCID 7"},
401
    { 8,  "LCID 8"},
402
    { 9,  "LCID 9"},
403
    { 10, "LCID 10"},
404
    { 11, "LCID 11"},
405
    { 12, "LCID 12"},
406
    { 13, "LCID 13"},
407
    { 14, "LCID 14"},
408
    { 15, "LCID 15"},
409
    { 16, "LCID 16"},
410
    { 17, "LCID 17"},
411
    { 18, "LCID 18"},
412
    { 19, "LCID 19"},
413
    { 20, "LCID 20"},
414
    { 21, "LCID 21"},
415
    { 22, "LCID 22"},
416
    { 23, "LCID 23"},
417
    { 24, "LCID 24"},
418
    { 25, "LCID 25"},
419
    { 26, "LCID 26"},
420
    { 27, "LCID 27"},
421
    { 28, "LCID 28"},
422
    { 29, "LCID 29"},
423
    { 30, "LCID 30"},
424
    { 31, "LCID 31"},
425
    { 32, "LCID 32"},
426
    { 0, NULL }
427
};
428
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 {
431
    rlcRaw,
432
    rlcTM,
433
    rlcUM6,
434
    rlcUM12,
435
    rlcAM12,
436
    rlcAM18
437
} rlc_bearer_type_t;
438
439
static const value_string rlc_bearer_type_vals[] = {
440
    { rlcTM                , "TM"},
441
    { rlcUM6               , "UM, SN Len=6"},
442
    { rlcUM12              , "UM, SN Len=12"},
443
    { rlcAM12              , "AM, SN Len=12"},
444
    { rlcAM18              , "AM, SN Len=18"},
445
    { 0, NULL }
446
};
447
448
449
/* Mapping type */
450
typedef struct lcid_drb_mapping_t {
451
    uint32_t          lcid;
452
    uint32_t          drbid;
453
    rlc_bearer_type_t bearer_type_ul;
454
    rlc_bearer_type_t bearer_type_dl;
455
} lcid_drb_mapping_t;
456
457
/* Mapping entity */
458
static lcid_drb_mapping_t *lcid_drb_mappings;
459
static unsigned num_lcid_drb_mappings;
460
461
0
UAT_VS_DEF(lcid_drb_mappings, lcid, lcid_drb_mapping_t, uint8_t, 3, "LCID 3")
Unexecuted instantiation: packet-mac-nr.c:lcid_drb_mappings_lcid_set_cb
Unexecuted instantiation: packet-mac-nr.c:lcid_drb_mappings_lcid_tostr_cb
462
0
UAT_DEC_CB_DEF(lcid_drb_mappings, drbid, lcid_drb_mapping_t)
Unexecuted instantiation: packet-mac-nr.c:lcid_drb_mappings_drbid_set_cb
Unexecuted instantiation: packet-mac-nr.c:lcid_drb_mappings_drbid_tostr_cb
463
0
UAT_VS_DEF(lcid_drb_mappings, bearer_type_ul, lcid_drb_mapping_t, rlc_bearer_type_t, rlcAM12, "AM")
Unexecuted instantiation: packet-mac-nr.c:lcid_drb_mappings_bearer_type_ul_set_cb
Unexecuted instantiation: packet-mac-nr.c:lcid_drb_mappings_bearer_type_ul_tostr_cb
464
0
UAT_VS_DEF(lcid_drb_mappings, bearer_type_dl, lcid_drb_mapping_t, rlc_bearer_type_t, rlcAM12, "AM")
Unexecuted instantiation: packet-mac-nr.c:lcid_drb_mappings_bearer_type_dl_set_cb
Unexecuted instantiation: packet-mac-nr.c:lcid_drb_mappings_bearer_type_dl_tostr_cb
465
466
/* UAT object */
467
static uat_t* lcid_drb_mappings_uat;
468
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 {
472
    bool valid;
473
    int      drbid;
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;
478
479
typedef struct ue_dynamic_drb_mappings_t {
480
    bool srb3_set;
481
    bool srb4_set;
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;
485
486
/* ueId -> ue_dynamic_drb_mappings_t* */
487
static GHashTable *mac_nr_ue_bearers_hash;
488
489
490
491
492
/* When showing RLC info, count PDUs so can append info column properly */
493
static uint8_t  s_number_of_rlc_pdus_shown;
494
495
496
static int proto_rlc_nr;
497
498
499
/* Constants and value strings */
500
501
static const value_string radio_type_vals[] =
502
{
503
    { FDD_RADIO,      "FDD"},
504
    { TDD_RADIO,      "TDD"},
505
    { 0, NULL }
506
};
507
508
static const value_string direction_vals[] =
509
{
510
    { DIRECTION_UPLINK,      "Uplink"},
511
    { DIRECTION_DOWNLINK,    "Downlink"},
512
    { 0, NULL }
513
};
514
515
static const value_string rnti_type_vals[] =
516
{
517
    { NO_RNTI,     "NO-RNTI"},
518
    { P_RNTI,      "P-RNTI"},
519
    { RA_RNTI,     "RA-RNTI"},
520
    { C_RNTI,      "C-RNTI"},
521
    { SI_RNTI,     "SI-RNTI"},
522
    { CS_RNTI,     "CS-RNTI"},
523
    { MSGB_RNTI,   "MSGB-RNTI"},
524
    { 0, NULL }
525
};
526
527
static const value_string bcch_transport_channel_vals[] =
528
{
529
    { SI_RNTI,      "DL-SCH"},
530
    { NO_RNTI,      "BCH"},
531
    { 0, NULL }
532
};
533
534
0
#define CCCH_LCID                                   0
535
0
#define TWO_OCTET_ELCID_FIELD                       33
536
0
#define ONE_OCTET_ELCID_FIELD                       34
537
0
#define RECOMMENDED_BIT_RATE_LCID                   47
538
0
#define SP_ZP_CSI_RS_RESOURCE_SET_ACT_DEACT_LCID    48
539
0
#define PUCCH_SPATIAL_REL_ACT_DEACT_LCID            49
540
0
#define SP_SRS_ACT_DEACT_LCID                       50
541
0
#define SP_CSI_REPORT_ON_PUCCH_ACT_DEACT_LCID       51
542
0
#define TCI_STATE_IND_FOR_UE_SPEC_PDCCH_LCID        52
543
0
#define TCI_STATES_ACT_DEACT_FOR_UE_SPEC_PDSCH_LCID 53
544
0
#define APER_CSI_TRIGGER_STATE_SUBSELECT_LCID       54
545
0
#define SP_CSI_RS_CSI_IM_RES_SET_ACT_DEACT_LCID     55
546
0
#define DUPLICATION_ACTIVATION_DEACTIVATION_LCID    56
547
0
#define SCELL_ACTIVATION_DEACTIVATION_4_LCID        57
548
0
#define SCELL_ACTIVATION_DEACTIVATION_1_LCID        58
549
0
#define LONG_DRX_COMMAND_LCID                       59
550
0
#define DRX_COMMAND_LCID                            60
551
0
#define TIMING_ADVANCE_COMMAND_LCID                 61
552
0
#define UE_CONTENTION_RESOLUTION_IDENTITY_LCID      62
553
0
#define PADDING_LCID                                63
554
555
static const value_string dlsch_lcid_vals[] =
556
{
557
    { CCCH_LCID,                                   "CCCH"},
558
    { 1,                                           "1"},
559
    { 2,                                           "2"},
560
    { 3,                                           "3"},
561
    { 4,                                           "4"},
562
    { 5,                                           "5"},
563
    { 6,                                           "6"},
564
    { 7,                                           "7"},
565
    { 8,                                           "8"},
566
    { 9,                                           "9"},
567
    { 10,                                          "10"},
568
    { 11,                                          "11"},
569
    { 12,                                          "12"},
570
    { 13,                                          "13"},
571
    { 14,                                          "14"},
572
    { 15,                                          "15"},
573
    { 16,                                          "16"},
574
    { 17,                                          "17"},
575
    { 18,                                          "18"},
576
    { 19,                                          "19"},
577
    { 20,                                          "20"},
578
    { 21,                                          "21"},
579
    { 22,                                          "22"},
580
    { 23,                                          "23"},
581
    { 24,                                          "24"},
582
    { 25,                                          "25"},
583
    { 26,                                          "26"},
584
    { 27,                                          "27"},
585
    { 28,                                          "28"},
586
    { 29,                                          "29"},
587
    { 30,                                          "30"},
588
    { 31,                                          "31"},
589
    { 32,                                          "32"},
590
    { 33,                                          "Extended logical channel ID field(two octet eLCID field)"},
591
    { 34,                                          "Extended logical channel ID field(one octet eLCID field)"},
592
    { 35,                                          "Reserved"},
593
    { 36,                                          "Reserved"},
594
    { 37,                                          "Reserved"},
595
    { 38,                                          "Reserved"},
596
    { 39,                                          "Reserved"},
597
    { 40,                                          "Reserved"},
598
    { 41,                                          "Reserved"},
599
    { 42,                                          "Reserved"},
600
    { 43,                                          "Reserved"},
601
    { 44,                                          "Reserved"},
602
    { 45,                                          "Reserved"},
603
    { 46,                                          "Reserved"},
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"},
621
    { 0, NULL }
622
};
623
static value_string_ext dlsch_lcid_vals_ext = VALUE_STRING_EXT_INIT(dlsch_lcid_vals);
624
625
/* TODO: not all LCIDs handled yet */
626
0
#define TRUNCATED_ENHANCED_BFR_LCID          43
627
0
#define TIMING_ADVANCE_REPORT_LCID           44
628
0
#define TRUNCATED_SIDELINK_BSR_LCID          45
629
0
#define SIDELINK_BSR_LCID                    46
630
#define RESERVED_47_LCID                     47
631
0
#define LBT_FAILURE_4_OCTETS_LCID            48
632
0
#define LBT_FAILURE_1_OCTET_LCID             49
633
0
#define BFR_LCID                             50
634
0
#define TRUNCATED_BFR_LCID                   51
635
0
#define CCCH_48_BITS_LCID                    52
636
0
#define RECOMMENDED_BIT_RATE_QUERY_LCID      53
637
0
#define MULTIPLE_ENTRY_PHR_4_LCID            54
638
0
#define CONFIGURED_GRANT_CONFIGURATION_LCID  55
639
0
#define MULTIPLE_ENTRY_PHR_1_LCID            56
640
0
#define SINGLE_ENTRY_PHR_LCID                57
641
0
#define C_RNTI_LCID                          58
642
0
#define SHORT_TRUNCATED_BSR_LCID             59
643
0
#define LONG_TRUNCATED_BSR_LCID              60
644
0
#define SHORT_BSR_LCID                       61
645
0
#define LONG_BSR_LCID                        62
646
647
/* Table 6.2.1-1b Values of one-octet eLCID for DL-SCH */
648
649
0
#define SERVING_CELL_SET_BASED_SRS_TCI_STATE_INDICATIONS_ELCD                                       227
650
0
#define SP_AP_SRS_TCI_STATE_INDICATION_ELCD                                                         228
651
0
#define BFD_RS_INDICATION_ELCD                                                                      229
652
0
#define DIFFERENTIAL_KOFFSET_ELCD                                                                   230
653
0
#define ENHANCED_SCELL_ACTIVATION_DEACTIVATION_MAC_CE_WITH_ONE_OCTET_CI_FIELD_ELCD                  231
654
0
#define ENHANCED_SCELL_ACTIVATION_DEACTIVATION_MAC_CE_WITH_FOUR_OCTET_CI_FIELD_ELCD                 232
655
0
#define UNIFIED_TCI_STATES_ACTIVATION_DEACTIVATION_ELCD                                             233
656
0
#define PUCCH_POWER_CONTROL_SET_UPDATE_FOR_MULTIPLE_TRP_PUCCH_REPETITION__ELCD                      234
657
0
#define PUCCH_SPATIAL_RELATION_ACTIVATION_DEACTIVATION_FOR_MULTIPLE_TRP_PUCCH_REPETITION_ELCD       235
658
0
#define ENHANCED_TCI_STATES_INDICATION_FOR_UE_SPECIFIC_PDCCH_ELCD                                   236
659
0
#define POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_COMMAND_ELCD                            237
660
0
#define PPW_ACTIVATION_DEACTIVATION_COMMAND_ELCD                                                    238
661
0
#define DL_TX_POWER_ADJUSTMENT_ELCD                                                                 239
662
0
#define TIMING_CASE_INDICATION_ELCD                                                                 240
663
0
#define CHILD_IAB_DU_RESTRICTED_BEAM_INDICATION_ELCD                                                241
664
0
#define CASE_7_TIMING_ADVANCE_OFFSET_ELCD                                                           242
665
0
#define PROVIDED_GUARD_SYMBOLS_FOR_CASE_6_TIMING_ELCD                                               243
666
0
#define PROVIDED_GUARD_SYMBOLS_FOR_CASE_7_TIMING_ELCD                                               244
667
0
#define SERVING_CELL_SET_BASED_SRS_SPATIAL_RELATION_INDICATION_ELCD                                 245
668
0
#define PUSCH_PATHLOSS_REFERENCE_RS_UPDATE_ELCD                                                     246
669
0
#define SRS_PATHLOSS_REFERENCE_RS_UPDATE_ELCD                                                       247
670
0
#define ENHANCED_SP_AP_SRS_SPATIAL_RELATION_INDICATION_ELCD                                         248
671
0
#define ENHANCED_PUCCH_SPATIAL_RELATION_ACTIVATION_DEACTIVATION_ELCD                                249
672
0
#define ENHANCED_TCI_STATES_ACTIVATION_DEACTIVATION_FOR_UE_SPECIFIC_PDSCH_ELCD                      250
673
0
#define DUPLICATION_RLC_ACTIVATION_DEACTIVATION_ELCD                                                251
674
0
#define ABSOLUTE_TIMING_ADVANCE_COMMAND_ELCD                                                        252
675
0
#define SP_POSITIONING_SRS_ACTIVATION_DEACTIVATION_ELCD                                             253
676
0
#define PROVIDED_GUARD_SYMBOLS_ELCD                                                                 254
677
0
#define TIMING_DELTA_ELCD                                                                           255
678
679
static const value_string dlsch_elcid_vals[] =
680
{
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"},
711
    { 0, NULL }
712
};
713
static value_string_ext dlsch_elcid_vals_ext = VALUE_STRING_EXT_INIT(dlsch_elcid_vals);
714
715
static const value_string ulsch_lcid_vals[] =
716
{
717
    { CCCH_LCID,                            "CCCH (64 bits)"},
718
    { 1,                                    "1"},
719
    { 2,                                    "2"},
720
    { 3,                                    "3"},
721
    { 4,                                    "4"},
722
    { 5,                                    "5"},
723
    { 6,                                    "6"},
724
    { 7,                                    "7"},
725
    { 8,                                    "8"},
726
    { 9,                                    "9"},
727
    { 10,                                   "10"},
728
    { 11,                                   "11"},
729
    { 12,                                   "12"},
730
    { 13,                                   "13"},
731
    { 14,                                   "14"},
732
    { 15,                                   "15"},
733
    { 16,                                   "16"},
734
    { 17,                                   "17"},
735
    { 18,                                   "18"},
736
    { 19,                                   "19"},
737
    { 20,                                   "20"},
738
    { 21,                                   "21"},
739
    { 22,                                   "22"},
740
    { 23,                                   "23"},
741
    { 24,                                   "24"},
742
    { 25,                                   "25"},
743
    { 26,                                   "26"},
744
    { 27,                                   "27"},
745
    { 28,                                   "28"},
746
    { 29,                                   "29"},
747
    { 30,                                   "30"},
748
    { 31,                                   "31"},
749
    { 32,                                   "32"},
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"},
754
    { 37,                                   "Reserved"},
755
    { 38,                                   "Reserved"},
756
    { 39,                                   "Reserved"},
757
    { 40,                                   "Reserved"},
758
    { 41,                                   "Reserved"},
759
    { 42,                                   "Reserved"},
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
781
    { 0, NULL }
782
};
783
static value_string_ext ulsch_lcid_vals_ext = VALUE_STRING_EXT_INIT(ulsch_lcid_vals);
784
785
0
#define ENHANCED_MULTIPLE_ENTRY_PHR_FOR_MULTIPLE_TRP_FOUR_OCTETS_CI      229
786
0
#define ENHANCED_MULTIPLE_ENTRY_PHR_FOR_MULTIPLE_TRP_ONE_OCTETS_CI       230
787
0
#define ENHANCED_SINGLE_ENTRY_PHR_FOR_MULTIPLE_TRP                       231
788
0
#define ENHANCED_MULTIPLE_ENTRY_PHR_FOUR_OCTETS_CI                       232
789
0
#define ENHANCED_MULTIPLE_ENTRY_PHR_ONE_OCTETS_CI                        233
790
0
#define ENHANCED_SINGLE_ENTRY_PHR                                        234
791
0
#define ENHANCED_BFR_ONE_OCTET_CI                                        235
792
0
#define ENHANCED_BFR_FOUR_OCTET_CI                                       236
793
0
#define TRUNCATED_ENHANCED_BFR_FOUR_OCTET_CI                             237
794
0
#define POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_REQUEST      238
795
0
#define IAB_MT_RECOMMENDED_BEAM_INDICATION                               239
796
0
#define DESIRED_IAB_MT_PSD_RANGE                                         240
797
0
#define DESIRED_DL_TX_POWER_ADJUSTMENT                                   241
798
0
#define CASE_6_TIMING_REQUEST                                            242
799
0
#define DESIRED_GUARD_SYMBOLS_FOR_CASE_6_TIMING                          243
800
0
#define DESIRED_GUARD_SYMBOLS_FOR_CASE_7_TIMING                          244
801
0
#define EXTENDED_SHORT_TRUNCATED_BSR                                     245
802
0
#define EXTENDED_LONG_TRUNCATED_BSR                                      246
803
0
#define EXTENDED_SHORT_BSR                                               247
804
0
#define EXTENDED_LONG_BSR                                                248
805
0
#define EXTENDED_PRE_EMPTIVE_BSR                                         249
806
0
#define BFR_FOUR_OCTETS_CI                                               250
807
0
#define TRUNCATED_BFR_FOUR_OCTETS_CI                                     251
808
0
#define MULTIPLE_ENTRY_CONFIGURED_GRANT_CONFIRMATION                     252
809
0
#define SIDELINK_CONFIGURED_GRANT_CONFIRMATION                           253
810
0
#define DESIRED_GUARD_SYMBOLS                                            254
811
0
#define PRE_EMPTIVE_BSR                                                  255
812
813
static const value_string ulsch_elcid_vals[] =
814
{
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"},
845
    { 0, NULL }
846
};
847
static value_string_ext ulsch_elcid_vals_ext = VALUE_STRING_EXT_INIT(ulsch_elcid_vals);
848
849
static const true_false_string rar_ext_vals =
850
{
851
    "Another MAC subPDU follows",
852
    "Last MAC subPDU"
853
};
854
855
static const true_false_string rar_type_vals =
856
{
857
    "RAPID present",
858
    "Backoff Indicator present"
859
};
860
861
static const value_string rar_bi_vals[] =
862
{
863
    { 0,  "5ms"},
864
    { 1,  "10ms"},
865
    { 2,  "20ms"},
866
    { 3,  "30ms"},
867
    { 4,  "40ms"},
868
    { 5,  "60ms"},
869
    { 6,  "80ms"},
870
    { 7,  "120ms"},
871
    { 8,  "160ms"},
872
    { 9,  "240ms"},
873
    { 10, "320ms"},
874
    { 11, "480ms"},
875
    { 12, "960ms"},
876
    { 13, "1920ms"},
877
    { 14, "Reserved"},
878
    { 15, "Reserved"},
879
    { 0, NULL }
880
};
881
882
static const value_string buffer_size_5bits_vals[] =
883
{
884
    { 0,  "BS = 0"},
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"},
916
    { 0, NULL }
917
};
918
static value_string_ext buffer_size_5bits_vals_ext = VALUE_STRING_EXT_INIT(buffer_size_5bits_vals);
919
920
921
static const value_string buffer_size_8bits_vals[] =
922
{
923
    { 0,   "BS = 0"},
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"},
1178
    { 255, "Reserved"},
1179
    { 0, NULL }
1180
};
1181
static value_string_ext buffer_size_8bits_vals_ext = VALUE_STRING_EXT_INIT(buffer_size_8bits_vals);
1182
1183
static const value_string tpc_command_vals[] =
1184
{
1185
    { 0,   "-6dB"},
1186
    { 1,   "-4dB"},
1187
    { 2,   "-2dB"},
1188
    { 3,   "0dB"},
1189
    { 4,   "2dB"},
1190
    { 5,   "4dB"},
1191
    { 6,   "6dB"},
1192
    { 7,   "8dB"},
1193
    { 0,   NULL }
1194
};
1195
1196
1197
1198
static const true_false_string power_backoff_affects_power_management_vals =
1199
{
1200
    "Power backoff is applied to power management",
1201
    "Power backoff not applied to power management"
1202
};
1203
1204
static const true_false_string phr_source_vals =
1205
{
1206
    "PH based on reference format",
1207
    "PH based on real transmission",
1208
};
1209
1210
static const true_false_string activation_deactivation_vals =
1211
{
1212
    "Activation",
1213
    "Deactivation"
1214
};
1215
1216
static const true_false_string c_vals =
1217
{
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"
1220
};
1221
1222
static const true_false_string sul_vals =
1223
{
1224
    "Applies to the SUL carrier configuration",
1225
    "Applies to the NUL carrier configuration"
1226
};
1227
1228
static const true_false_string sp_srs_act_deact_f_vals =
1229
{
1230
    "NZP CSI-RS resource index is used",
1231
    "SSB index or SRS resource index is used"
1232
};
1233
1234
static const true_false_string aper_csi_trigger_state_t_vals =
1235
{
1236
    "Mapped to the codepoint of the DCI CSI request field",
1237
    "Not mapped to the codepoint of the DCI CSI request field"
1238
};
1239
1240
static const value_string bit_rate_vals[] =
1241
{
1242
    { 0, "no bit rate recommendation"},
1243
    { 1, "0 kbit/s"},
1244
    { 2, "9 kbit/s"},
1245
    { 3, "11 kbit/s"},
1246
    { 4, "13 kbit/s"},
1247
    { 5, "17 kbit/s"},
1248
    { 6, "21 kbit/s"},
1249
    { 7, "25 kbit/s"},
1250
    { 8, "29 kbit/s"},
1251
    { 9, "32 kbit/s"},
1252
    { 10, "36 kbit/s"},
1253
    { 11, "40 kbit/s"},
1254
    { 12, "48 kbit/s"},
1255
    { 13, "56 kbit/s"},
1256
    { 14, "72 kbit/s"},
1257
    { 15, "88 kbit/s"},
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"},
1299
    { 0, NULL }
1300
};
1301
static value_string_ext bit_rate_vals_ext = VALUE_STRING_EXT_INIT(bit_rate_vals);
1302
1303
1304
static const true_false_string msgb_t1_vals = {
1305
    "Random Access Preamble ID present",
1306
    "T2 is valid"
1307
};
1308
1309
static const true_false_string msgb_t2_vals = {
1310
    "S is valid",
1311
    "Backoff Indicator",
1312
};
1313
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"
1317
};
1318
1319
1320
/* Forward declarations */
1321
static int dissect_mac_nr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*);
1322
1323
static unsigned 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);
1327
1328
1329
/* Write the given formatted text to:
1330
   - the info column (if pinfo != NULL)
1331
   - 1 or 2 other labels (optional)
1332
*/
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, ...)
1337
0
{
1338
0
    #define MAX_INFO_BUFFER 256
1339
0
    static char info_buffer[MAX_INFO_BUFFER];
1340
0
    va_list ap;
1341
1342
0
    if ((ti1 == NULL) && (ti2 == NULL) && (pinfo == NULL)) {
1343
0
        return;
1344
0
    }
1345
1346
0
    va_start(ap, format);
1347
0
    vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap);
1348
0
    va_end(ap);
1349
1350
    /* Add to indicated places */
1351
0
    if (pinfo != NULL) {
1352
0
        col_append_str(pinfo->cinfo, COL_INFO, info_buffer);
1353
0
    }
1354
0
    if (ti1 != NULL) {
1355
0
        proto_item_append_text(ti1, "%s", info_buffer);
1356
0
    }
1357
0
    if (ti2 != NULL) {
1358
0
        proto_item_append_text(ti2, "%s", info_buffer);
1359
0
    }
1360
0
}
1361
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)
1365
0
{
1366
    /* Add to indicated places */
1367
0
    if (pinfo != NULL) {
1368
0
        col_append_str(pinfo->cinfo, COL_INFO, info_buffer);
1369
0
    }
1370
0
    if (ti1 != NULL) {
1371
0
        proto_item_append_text(ti1, "%s", info_buffer);
1372
0
    }
1373
0
    if (ti2 != NULL) {
1374
0
        proto_item_append_text(ti2, "%s", info_buffer);
1375
0
    }
1376
0
}
1377
1378
static void
1379
call_with_catch_all(dissector_handle_t handle, tvbuff_t* tvb, packet_info *pinfo, proto_tree *tree)
1380
0
{
1381
    /* Call it (catch exceptions so that stats will be updated) */
1382
0
    if (handle) {
1383
0
        TRY {
1384
0
            call_dissector_only(handle, tvb, pinfo, tree, NULL);
1385
0
        }
1386
0
        CATCH_ALL {
1387
0
        }
1388
0
        ENDTRY
1389
0
    }
1390
0
}
1391
1392
/* Dissect BCCH PDU */
1393
static void dissect_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1394
                         proto_item *pdu_ti,
1395
                         unsigned offset,
1396
                         mac_nr_info *p_mac_nr_info,
1397
                         mac_3gpp_tap_info *tap_info _U_)
1398
0
{
1399
0
    proto_item *ti;
1400
1401
0
    write_pdu_label_and_info(pdu_ti, NULL, pinfo,
1402
0
                             "BCCH PDU (%u bytes, on %s transport) ",
1403
0
                             tvb_reported_length_remaining(tvb, offset),
1404
0
                             val_to_str_const(p_mac_nr_info->rntiType,
1405
0
                                              bcch_transport_channel_vals,
1406
0
                                              "Unknown"));
1407
1408
    /* Show which transport layer it came in on (inferred from RNTI type) */
1409
0
    ti = proto_tree_add_uint(tree, hf_mac_nr_context_bcch_transport_channel,
1410
0
                             tvb, offset, 0, p_mac_nr_info->rntiType);
1411
0
    proto_item_set_generated(ti);
1412
1413
    /****************************************/
1414
    /* Whole frame is BCCH data             */
1415
1416
    /* Raw data */
1417
0
    ti = proto_tree_add_item(tree, hf_mac_nr_bcch_pdu,
1418
0
                             tvb, offset, -1, ENC_NA);
1419
1420
0
    if (global_mac_nr_attempt_rrc_decode) {
1421
        /* Attempt to decode payload using NR RRC dissector */
1422
0
        dissector_handle_t protocol_handle;
1423
0
        tvbuff_t *rrc_tvb = tvb_new_subset_remaining(tvb, offset);
1424
1425
0
        if (p_mac_nr_info->rntiType == NO_RNTI) {
1426
0
            protocol_handle = nr_rrc_bcch_bch_handle;
1427
0
        } else {
1428
0
            protocol_handle = nr_rrc_bcch_dl_sch_handle;
1429
0
        }
1430
1431
        /* Hide raw view of bytes */
1432
0
        proto_item_set_hidden(ti);
1433
1434
0
        call_with_catch_all(protocol_handle, rrc_tvb, pinfo, tree);
1435
0
    }
1436
0
}
1437
1438
/* Dissect PCCH PDU */
1439
static void dissect_pcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1440
                         proto_item *pdu_ti, unsigned offset,
1441
                         mac_nr_info *p_mac_nr_info _U_,
1442
                         mac_3gpp_tap_info *tap_info _U_)
1443
0
{
1444
0
    proto_item *ti;
1445
1446
0
    write_pdu_label_and_info(pdu_ti, NULL, pinfo,
1447
0
                             "PCCH PDU (%u bytes) ",
1448
0
                             tvb_reported_length_remaining(tvb, offset));
1449
1450
    /****************************************/
1451
    /* Whole frame is PCCH data             */
1452
1453
    /* Always show as raw data */
1454
0
    ti = proto_tree_add_item(tree, hf_mac_nr_pcch_pdu,
1455
0
                             tvb, offset, -1, ENC_NA);
1456
1457
    // TODO: add to tap_info->number_of_paging_ids.  See LTE.
1458
1459
0
    if (global_mac_nr_attempt_rrc_decode) {
1460
1461
        /* Attempt to decode payload using NR RRC dissector */
1462
0
        tvbuff_t *rrc_tvb = tvb_new_subset_remaining(tvb, offset);
1463
1464
        /* Hide raw view of bytes */
1465
0
        proto_item_set_hidden(ti);
1466
1467
0
        call_with_catch_all(nr_rrc_pcch_handle, rrc_tvb, pinfo, tree);
1468
1469
0
    }
1470
0
}
1471
1472
/* Common to RAR and MSGB */
1473
static unsigned dissect_fallbackrar(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, unsigned offset,
1474
                               proto_item *ti, proto_item *pdu_ti, uint32_t rapid)
1475
0
{
1476
    /* 1 reserved bit */
1477
0
    proto_tree_add_item(tree, hf_mac_nr_rar_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
1478
1479
    /* TA (12 bits) */
1480
0
    uint32_t ta;
1481
0
    proto_tree_add_item_ret_uint(tree, hf_mac_nr_rar_ta, tvb, offset, 2, ENC_BIG_ENDIAN, &ta);
1482
0
    offset++;
1483
1484
    /* Break down the 27-bits of the grant field, according to 38.213, section 8.2 */
1485
0
    static int * const rar_grant_fields[] = {
1486
0
        &hf_mac_nr_rar_grant_hopping,
1487
0
        &hf_mac_nr_rar_grant_fra,
1488
0
        &hf_mac_nr_rar_grant_tsa,
1489
0
        &hf_mac_nr_rar_grant_mcs,
1490
0
        &hf_mac_nr_rar_grant_tcsp,
1491
0
        &hf_mac_nr_rar_grant_csi,
1492
0
        NULL
1493
0
    };
1494
0
    proto_tree_add_bitmask(tree, tvb, offset, hf_mac_nr_rar_grant,
1495
0
                           ett_mac_nr_rar_grant, rar_grant_fields, ENC_BIG_ENDIAN);
1496
0
    offset += 4;
1497
1498
    /* C-RNTI (2 bytes) */
1499
0
    uint32_t c_rnti;
1500
0
    proto_tree_add_item_ret_uint(tree, hf_mac_nr_rar_temp_crnti, tvb, offset, 2, ENC_BIG_ENDIAN, &c_rnti);
1501
0
    offset += 2;
1502
1503
0
    write_pdu_label_and_info(pdu_ti, ti, pinfo,
1504
0
                             "(RAPID=%u TA=%u Temp C-RNTI=%u) ", rapid, ta, c_rnti);
1505
1506
0
    return offset;
1507
0
}
1508
1509
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)
1513
0
{
1514
0
    write_pdu_label_and_info(pdu_ti, NULL, pinfo,
1515
0
                             "RAR (RA-RNTI=%u) ",
1516
0
                             p_mac_nr_info->rnti);
1517
1518
    /* Create hidden 'virtual root' so can filter on mac-nr.rar */
1519
0
    proto_item *ti = proto_tree_add_item(tree, hf_mac_nr_rar, tvb, offset, -1, ENC_NA);
1520
0
    proto_item_set_hidden(ti);
1521
1522
0
    bool E, T;
1523
1524
0
    do {
1525
        /* Subheader */
1526
0
        proto_item *subheader_ti = proto_tree_add_item(tree,
1527
0
                                                       hf_mac_nr_rar_subheader,
1528
0
                                                       tvb, offset, 0, ENC_ASCII);
1529
0
        proto_tree *rar_subheader_tree = proto_item_add_subtree(subheader_ti, ett_mac_nr_rar_subheader);
1530
1531
        /* Note extension & T bits */
1532
0
        proto_tree_add_item_ret_boolean(rar_subheader_tree, hf_mac_nr_rar_e, tvb, offset, 1, ENC_BIG_ENDIAN, &E);
1533
0
        proto_tree_add_item_ret_boolean(rar_subheader_tree, hf_mac_nr_rar_t, tvb, offset, 1, ENC_BIG_ENDIAN, &T);
1534
1535
0
        if (!T) {
1536
            /* BI */
1537
1538
            /* 2 reserved bits */
1539
0
            proto_tree_add_item(rar_subheader_tree, hf_mac_nr_rar_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1540
1541
            /* BI (4 bits) */
1542
0
            uint32_t BI;
1543
0
            proto_tree_add_item_ret_uint(rar_subheader_tree, hf_mac_nr_rar_bi, tvb, offset, 1, ENC_BIG_ENDIAN, &BI);
1544
0
            offset++;
1545
1546
0
            write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
1547
0
                                     "(BI=%u) ", BI);
1548
0
        }
1549
0
        else {
1550
            /* RAPID */
1551
0
            uint32_t rapid;
1552
0
            proto_tree_add_item_ret_uint(rar_subheader_tree, hf_mac_nr_rar_rapid, tvb, offset, 1, ENC_BIG_ENDIAN, &rapid);
1553
0
            offset++;
1554
1555
0
            if (true) {
1556
                /* SubPDU.  Not for SI request - TODO: define RAPID range for SI request in mac_nr_info */
1557
1558
0
                offset = dissect_fallbackrar(rar_subheader_tree, pinfo, tvb, offset, subheader_ti, pdu_ti, rapid);
1559
0
            }
1560
0
            tap_info->number_of_rars++;
1561
0
        }
1562
        /* Set subheader (+subpdu..) length */
1563
0
        proto_item_set_end(subheader_ti, tvb, offset);
1564
1565
0
    } while (E);
1566
1567
    /* Any remaining length is padding */
1568
0
    if (tvb_reported_length_remaining(tvb, offset)) {
1569
0
        proto_tree_add_item(tree, hf_mac_nr_padding, tvb, offset, -1, ENC_NA);
1570
0
    }
1571
1572
    /* Update padding bytes in stats */
1573
0
    tap_info->padding_bytes += (p_mac_nr_info->length - offset);
1574
0
}
1575
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)
1579
0
{
1580
0
    write_pdu_label_and_info(pdu_ti, NULL, pinfo,
1581
0
                             "MSGB (MSGB-RNTI=%u) ",
1582
0
                             p_mac_nr_info->rnti);
1583
1584
    /* Create hidden 'virtual root' so can filter on mac-nr.msgb */
1585
0
    proto_item *ti = proto_tree_add_item(tree, hf_mac_nr_msgb, tvb, offset, -1, ENC_NA);
1586
0
    proto_item_set_hidden(ti);
1587
1588
0
    bool E, T1, T2, S;
1589
1590
    /* N.B. T2 only present if T1 is 0 */
1591
    /* N.B. T2 indicates BI (can only appear in first subheader */
1592
1593
0
    do {
1594
        /* Subheader */
1595
0
        proto_item *subheader_ti = proto_tree_add_item(tree,
1596
0
                                                       hf_mac_nr_msgb_subheader,
1597
0
                                                       tvb, offset, 0, ENC_ASCII);
1598
0
        proto_tree *msgb_subheader_tree = proto_item_add_subtree(subheader_ti, ett_mac_nr_rar_subheader);
1599
1600
        /* Note extension & T1, T2 bits */
1601
0
        proto_tree_add_item_ret_boolean(msgb_subheader_tree, hf_mac_nr_msgb_e, tvb, offset, 1, ENC_BIG_ENDIAN, &E);
1602
0
        proto_tree_add_item_ret_boolean(msgb_subheader_tree, hf_mac_nr_msgb_t1, tvb, offset, 1, ENC_BIG_ENDIAN, &T1);
1603
0
        if (!T1) {
1604
            /* T2 */
1605
0
            proto_tree_add_item_ret_boolean(msgb_subheader_tree, hf_mac_nr_msgb_t2, tvb, offset, 1, ENC_BIG_ENDIAN, &T2);
1606
0
        }
1607
1608
0
        if (T1) {
1609
            /* RAPID (FallbackRAR MAC subheader) */
1610
0
            uint32_t rapid;
1611
0
            proto_tree_add_item_ret_uint(msgb_subheader_tree, hf_mac_nr_rar_rapid, tvb, offset, 1, ENC_BIG_ENDIAN, &rapid);
1612
0
            offset++;
1613
1614
            /* FallbackRAR (see 6.2.3a) */
1615
0
            write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo, "FallbackRAR ");
1616
0
            offset = dissect_fallbackrar(msgb_subheader_tree, pinfo, tvb, offset,
1617
0
                                         subheader_ti, pdu_ti, rapid);
1618
0
        }
1619
0
        else if (!T2) {
1620
            /* BI */
1621
0
            uint32_t BI;
1622
1623
            /* 1 reserved bit */
1624
0
            proto_tree_add_item(msgb_subheader_tree, hf_mac_nr_msgb_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1625
            /* BI (4 bits) */
1626
            /* N.B., should define & use own BI field? */
1627
0
            proto_tree_add_item_ret_uint(msgb_subheader_tree, hf_mac_nr_rar_bi, tvb, offset, 1, ENC_BIG_ENDIAN, &BI);
1628
0
            offset++;
1629
1630
0
            write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
1631
0
                                     "(BI=%u) ", BI);
1632
0
        }
1633
0
        else {
1634
            /* Read S (MAC SDU Indicator) */
1635
0
            proto_tree_add_item_ret_boolean(msgb_subheader_tree, hf_mac_nr_msgb_s, tvb, offset, 1, ENC_BIG_ENDIAN, &S);
1636
1637
            /* 4 reserved bits */
1638
0
            proto_tree_add_item(msgb_subheader_tree, hf_mac_nr_msgb_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
1639
0
            offset += 1;
1640
1641
            /* successRAR is in 6.2.3a-2 */
1642
0
            write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo, "SuccessRAR ");
1643
1644
            /* UE Contention Resolution Identity */
1645
0
            proto_tree_add_item(msgb_subheader_tree, hf_mac_nr_control_ue_contention_resolution_identity,
1646
0
                                tvb, offset, 6, ENC_NA);
1647
0
            offset += 6;
1648
1649
            /* R (1 bit) */
1650
0
            proto_tree_add_item(msgb_subheader_tree, hf_mac_nr_msgb_reserved3, tvb, offset, 1, ENC_BIG_ENDIAN);
1651
            /* ChannelAccess-CPext */
1652
0
            proto_tree_add_item(msgb_subheader_tree, hf_mac_nr_msgb_channelaccess_cpext, tvb, offset, 1, ENC_BIG_ENDIAN);
1653
            /* TPC */
1654
0
            proto_tree_add_item(msgb_subheader_tree, hf_mac_nr_msgb_tpc, tvb, offset, 1, ENC_BIG_ENDIAN);
1655
            /* HARQ Feedback Timing Indicator */
1656
0
            proto_tree_add_item(msgb_subheader_tree, hf_mac_nr_msgb_harq_feedback_timing_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
1657
0
            offset += 1;
1658
1659
            /* PUCCH Resource Indicator */
1660
0
            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
0
            uint32_t ta_command;
1663
0
            proto_tree_add_item_ret_uint(msgb_subheader_tree, hf_mac_nr_msgb_ta_command, tvb, offset, 2, ENC_BIG_ENDIAN, &ta_command);
1664
0
            offset += 2;
1665
1666
            /* C-RNTI */
1667
0
            uint32_t c_rnti;
1668
0
            proto_tree_add_item_ret_uint(msgb_subheader_tree, hf_mac_nr_rar_temp_crnti, tvb, offset, 2, ENC_BIG_ENDIAN, &c_rnti);
1669
0
            offset += 2;
1670
1671
0
            write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
1672
0
                                     "(C-RNTI=%u, TA=%u) ", c_rnti, ta_command);
1673
1674
0
            if (S) {
1675
                /* subPDU(s) for MAC SDU present */
1676
0
                offset = dissect_ulsch_or_dlsch(tvb, pinfo, tree, pdu_ti, offset,
1677
0
                                                p_mac_nr_info,
1678
0
                                                tap_info);
1679
0
            }
1680
0
        }
1681
        /* Set subheader (+subpdu..) length */
1682
0
        proto_item_set_end(subheader_ti, tvb, offset);
1683
1684
0
    } while (E);
1685
1686
    /* Any remaining length is padding */
1687
0
    if (tvb_reported_length_remaining(tvb, offset)) {
1688
0
        proto_tree_add_item(tree, hf_mac_nr_padding, tvb, offset, -1, ENC_NA);
1689
0
    }
1690
1691
    /* Update padding bytes in stats */
1692
0
    tap_info->padding_bytes += (p_mac_nr_info->length - offset);
1693
0
}
1694
1695
1696
static bool is_fixed_sized_lcid(uint8_t lcid, uint8_t direction)
1697
0
{
1698
0
    if (direction == DIRECTION_UPLINK) {
1699
0
        switch (lcid) {
1700
0
            case CCCH_LCID:
1701
0
            case 35:   /* RedCap CCCH (48 bits) */
1702
0
            case 36:   /* RedCap CCCH1 (64 bits) */
1703
0
            case CCCH_48_BITS_LCID:
1704
0
            case TIMING_ADVANCE_REPORT_LCID:
1705
0
            case RECOMMENDED_BIT_RATE_QUERY_LCID:
1706
0
            case CONFIGURED_GRANT_CONFIGURATION_LCID:
1707
0
            case SINGLE_ENTRY_PHR_LCID:
1708
0
            case C_RNTI_LCID:
1709
0
            case SHORT_TRUNCATED_BSR_LCID:
1710
0
            case SHORT_BSR_LCID:
1711
0
            case PADDING_LCID:
1712
0
                return true;
1713
0
            default:
1714
0
                return false;
1715
0
        }
1716
0
    }
1717
0
    else {
1718
0
        switch (lcid) {
1719
0
            case TWO_OCTET_ELCID_FIELD:
1720
0
            case ONE_OCTET_ELCID_FIELD:
1721
0
            case RECOMMENDED_BIT_RATE_LCID:
1722
0
            case SP_ZP_CSI_RS_RESOURCE_SET_ACT_DEACT_LCID:
1723
0
            case PUCCH_SPATIAL_REL_ACT_DEACT_LCID:
1724
0
            case SP_CSI_REPORT_ON_PUCCH_ACT_DEACT_LCID:
1725
0
            case TCI_STATE_IND_FOR_UE_SPEC_PDCCH_LCID:
1726
0
            case DUPLICATION_ACTIVATION_DEACTIVATION_LCID:
1727
0
            case SCELL_ACTIVATION_DEACTIVATION_4_LCID:
1728
0
            case SCELL_ACTIVATION_DEACTIVATION_1_LCID:
1729
0
            case LONG_DRX_COMMAND_LCID:
1730
0
            case DRX_COMMAND_LCID:
1731
0
            case TIMING_ADVANCE_COMMAND_LCID:
1732
0
            case UE_CONTENTION_RESOLUTION_IDENTITY_LCID:
1733
0
            case PADDING_LCID:
1734
0
                return true;
1735
0
            default:
1736
0
                return false;
1737
0
        }
1738
0
    }
1739
0
}
1740
1741
static bool is_fixed_sized_elcid(uint8_t elcid, uint8_t direction)
1742
0
{
1743
0
    if (direction == DIRECTION_UPLINK) {
1744
0
        switch (elcid) {
1745
0
        case ENHANCED_SINGLE_ENTRY_PHR_FOR_MULTIPLE_TRP:
1746
            /* Enhanced Single Entry PHR for multiple TRP */
1747
0
        case POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_REQUEST:
1748
            /* Positioning Measurement Gap Activation/Deactivation Request */
1749
0
        case CASE_6_TIMING_REQUEST:
1750
            /* Case-6 Timing Request */
1751
0
        case DESIRED_GUARD_SYMBOLS_FOR_CASE_6_TIMING:
1752
            /* Desired Guard Symbols for Case 6 timing */
1753
0
        case DESIRED_GUARD_SYMBOLS_FOR_CASE_7_TIMING:
1754
            /* Desired Guard Symbols for Case 7 timing*/
1755
0
        case EXTENDED_SHORT_TRUNCATED_BSR:
1756
            /* Extended Short Truncated BSR */
1757
0
        case EXTENDED_SHORT_BSR:
1758
            /* Extended Short BSR */
1759
0
        case MULTIPLE_ENTRY_CONFIGURED_GRANT_CONFIRMATION:
1760
            /* Multiple Entry Configured Grant Confirmation 4 octets*/
1761
0
        case SIDELINK_CONFIGURED_GRANT_CONFIRMATION:
1762
            /* Sidelink Configured Grant Confirmation 1 oct*/
1763
0
        case DESIRED_GUARD_SYMBOLS:
1764
            /* Desired Guard Symbols 3 oct*/
1765
0
            return true;
1766
0
        default:
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 */
1781
0
            return false;
1782
0
        }
1783
0
    }
1784
0
    else {
1785
0
        switch (elcid) {
1786
0
        case DIFFERENTIAL_KOFFSET_ELCD:
1787
            /* Differential Koffset, 6bits(1 oct)*/
1788
0
        case ENHANCED_TCI_STATES_INDICATION_FOR_UE_SPECIFIC_PDCCH_ELCD:
1789
            /* Enhanced TCI States Indication for UE-specific PDCCH 3 oct*/
1790
0
        case POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_COMMAND_ELCD:
1791
            /* Positioning Measurement Gap Activation/Deactivation Command 1 oct*/
1792
0
        case CASE_7_TIMING_ADVANCE_OFFSET_ELCD:
1793
            /* Case-7 Timing advance offset 2 oct*/
1794
0
        case PROVIDED_GUARD_SYMBOLS_FOR_CASE_6_TIMING_ELCD:
1795
            /* Provided Guard Symbols for Case-6 timing 3 oct*/
1796
0
        case PROVIDED_GUARD_SYMBOLS_FOR_CASE_7_TIMING_ELCD:
1797
            /* Provided Guard Symbols for Case-7 timing 3 oct*/
1798
0
        case SRS_PATHLOSS_REFERENCE_RS_UPDATE_ELCD:
1799
            /* SRS Pathloss Reference RS Update 3 oct*/
1800
0
        case DUPLICATION_RLC_ACTIVATION_DEACTIVATION_ELCD:
1801
            /* Duplication RLC Activation/Deactivation 1 oct*/
1802
0
        case ABSOLUTE_TIMING_ADVANCE_COMMAND_ELCD:
1803
            /* Absolute Timing Advance Command 2 oct*/
1804
0
        case PROVIDED_GUARD_SYMBOLS_ELCD:
1805
            /* Provided Guard Symbols 4 oct*/
1806
0
        case TIMING_DELTA_ELCD:
1807
            /* Timing Delta 2 oct*/
1808
0
            return true;
1809
0
        default:
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 */
1828
0
            return false;
1829
0
        }
1830
0
    }
1831
0
}
1832
static true_false_string subheader_f_vals = {
1833
    "16 bits",
1834
    "8 bits"
1835
};
1836
1837
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)
1842
0
{
1843
    /* Subtree for this entry */
1844
0
    proto_item *entry_ti = proto_tree_add_item(tree,
1845
0
                                               hf_mac_nr_control_me_phr_entry,
1846
0
                                               tvb, *offset, 0, ENC_ASCII);
1847
0
    proto_tree *entry_tree = proto_item_add_subtree(entry_ti, ett_mac_nr_me_phr_entry);
1848
1849
    /* P */
1850
0
    proto_tree_add_item(entry_tree, hf_mac_nr_control_me_phr_p, tvb, *offset, 1, ENC_BIG_ENDIAN);
1851
    /* V */
1852
0
    bool V;
1853
0
    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).
1855
       And decide whether:
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
1859
     */
1860
0
    proto_tree_add_item_ret_uint(entry_tree, ph_item, tvb, *offset, 1, ENC_BIG_ENDIAN, PH);
1861
0
    (*offset)++;
1862
1863
0
    if (!V) {
1864
        /* Reserved (2 bits) */
1865
0
        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
0
        proto_tree_add_item(entry_tree, pcmax_f_c_item, tvb, *offset, 1, ENC_BIG_ENDIAN);
1868
0
        (*offset)++;
1869
0
    }
1870
1871
0
    proto_item_set_end(entry_ti, tvb, *offset);
1872
0
    return entry_ti;
1873
0
}
1874
1875
1876
static uint8_t get_rlc_seqnum_length(rlc_bearer_type_t rlc_bearer_type)
1877
0
{
1878
0
    switch (rlc_bearer_type) {
1879
0
        case rlcUM6:
1880
0
            return 6;
1881
0
        case rlcUM12:
1882
0
            return 12;
1883
0
        case rlcAM12:
1884
0
            return 12;
1885
0
        case rlcAM18:
1886
0
            return 18;
1887
1888
0
        default:
1889
            /* Not expected */
1890
0
            return 0;
1891
0
    }
1892
0
}
1893
1894
1895
1896
/* Lookup bearer details for lcid */
1897
static bool lookup_rlc_bearer_from_lcid(uint16_t ueid,
1898
                                            uint8_t lcid,
1899
                                            uint8_t direction,
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 */
1904
0
{
1905
    /* Zero params (in case no match is found) */
1906
0
    *rlc_bearer_type = rlcRaw;
1907
0
    *seqnum_length    = 0;
1908
0
    *drb_id           = 0;
1909
1910
0
    *is_srb = false;
1911
1912
0
    if (global_mac_nr_lcid_drb_source == (int)FromStaticTable) {
1913
1914
        /* Look up in static (UAT) table */
1915
0
        unsigned m;
1916
0
        for (m=0; m < num_lcid_drb_mappings; m++) {
1917
0
            if (lcid == lcid_drb_mappings[m].lcid) {
1918
1919
                /* Found, set out parameters */
1920
0
                if (direction == DIRECTION_UPLINK) {
1921
0
                    *rlc_bearer_type = lcid_drb_mappings[m].bearer_type_ul;
1922
0
                }
1923
0
                else {
1924
0
                    *rlc_bearer_type = lcid_drb_mappings[m].bearer_type_dl;
1925
0
                }
1926
0
                *seqnum_length = get_rlc_seqnum_length(*rlc_bearer_type);
1927
0
                *drb_id = lcid_drb_mappings[m].drbid;
1928
0
                return true;
1929
0
            }
1930
0
        }
1931
0
        if (lcid==3 || lcid==4) {
1932
            /* Wasn't found as DRB, so lets assume SRB-3 (or SRB-4) */
1933
0
            *is_srb = true;
1934
0
        }
1935
0
        return false;
1936
0
    }
1937
0
    else {
1938
        /* Look up the dynamic mappings for this UE */
1939
0
        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));
1940
0
        if (!ue_mappings) {
1941
            /* No entry for this UE.. */
1942
0
            if (lcid==3 || lcid==4) {
1943
0
                *is_srb = true;
1944
0
            }
1945
0
            return false;
1946
0
        }
1947
1948
0
        if (lcid==3) {
1949
0
            *is_srb = ue_mappings->srb3_set;
1950
0
        }
1951
0
        if (lcid==4) {
1952
0
            *is_srb = ue_mappings->srb4_set;
1953
0
        }
1954
1955
        /* Look up setting gleaned from configuration protocol */
1956
0
        if (!ue_mappings->mapping[lcid].valid) {
1957
0
            return false;
1958
0
        }
1959
1960
        /* Found, set out params */
1961
0
        *rlc_bearer_type = (direction == DIRECTION_UPLINK) ?
1962
0
                           ue_mappings->mapping[lcid].bearer_type_ul :
1963
0
                           ue_mappings->mapping[lcid].bearer_type_dl;
1964
0
        *seqnum_length = get_rlc_seqnum_length(*rlc_bearer_type);
1965
0
        *drb_id = ue_mappings->mapping[lcid].drbid;
1966
1967
0
        return true;
1968
0
    }
1969
0
}
1970
1971
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,
1974
                               proto_item *pdu_ti,
1975
                               unsigned 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_)
1980
0
{
1981
0
    tvbuff_t            *rb_tvb = tvb_new_subset_length(tvb, offset, data_length);
1982
0
    struct rlc_nr_info *p_rlc_nr_info;
1983
1984
    /* Reuse or create RLC info */
1985
0
    p_rlc_nr_info = (rlc_nr_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rlc_nr, 0);
1986
0
    if (p_rlc_nr_info == NULL) {
1987
0
        p_rlc_nr_info = wmem_new0(wmem_file_scope(), struct rlc_nr_info);
1988
0
    }
1989
1990
    /* Fill in details for channel */
1991
0
    p_rlc_nr_info->rlcMode = mode;
1992
0
    p_rlc_nr_info->direction = direction;
1993
    /* p_rlc_nr_info->priority = priority; */
1994
0
    p_rlc_nr_info->ueid = ueid;
1995
0
    p_rlc_nr_info->bearerType = bearerType;
1996
0
    p_rlc_nr_info->bearerId = bearerId;
1997
0
    p_rlc_nr_info->pduLength = data_length;
1998
0
    p_rlc_nr_info->sequenceNumberLength = sequenceNumberLength;
1999
2000
    /* Store info in packet */
2001
0
    p_add_proto_data(wmem_file_scope(), pinfo, proto_rlc_nr, 0, p_rlc_nr_info);
2002
2003
0
    if (global_mac_nr_layer_to_show != ShowRLCLayer) {
2004
        /* Don't want these columns replaced */
2005
0
        col_set_writable(pinfo->cinfo, -1, false);
2006
0
    }
2007
0
    else {
2008
        /* Clear info column before first RLC PDU */
2009
0
        if (s_number_of_rlc_pdus_shown == 0) {
2010
0
            col_clear(pinfo->cinfo, COL_INFO);
2011
0
        }
2012
0
        else {
2013
            /* Add a separator and protect column contents here */
2014
0
            write_pdu_label_and_info_literal(pdu_ti, NULL, pinfo, "   ||   ");
2015
0
            col_set_fence(pinfo->cinfo, COL_INFO);
2016
0
        }
2017
0
    }
2018
0
    s_number_of_rlc_pdus_shown++;
2019
2020
    /* Call it (catch exceptions so that stats will be updated) */
2021
0
    call_with_catch_all(rlc_nr_handle, rb_tvb, pinfo, tree);
2022
2023
    /* Let columns be written to again */
2024
0
    col_set_writable(pinfo->cinfo, -1, true);
2025
0
}
2026
2027
/* see 3GPP 38.133 Table 10.1.17.1-1 */
2028
static void
2029
mac_nr_phr_fmt(char *s, uint32_t v)
2030
0
{
2031
0
    int32_t val = (int32_t)v;
2032
2033
0
    if (val == 0) {
2034
0
        snprintf(s, ITEM_LABEL_LENGTH, "PH < -32 dB (0)");
2035
0
    } else if (val == 63) {
2036
0
        snprintf(s, ITEM_LABEL_LENGTH, "PH >= 38 dB (63)");
2037
0
    } else if (val <= 54) {
2038
0
        snprintf(s, ITEM_LABEL_LENGTH, "%d dB <= PH < %d dB (%d)", val - 33, val - 32, val);
2039
0
    } else {
2040
0
        snprintf(s, ITEM_LABEL_LENGTH, "%d dB <= PH < %d dB (%d)", 22 + 2 * (val - 55), 24 + 2 * (val - 55), val);
2041
0
    }
2042
0
}
2043
2044
/* see 3GPP 38.133 Table 10.1.18.1-1 */
2045
static void
2046
mac_nr_pcmax_f_c_fmt(char *s, uint32_t v)
2047
0
{
2048
0
    int32_t val = (int32_t)v;
2049
2050
0
    if (val == 0) {
2051
0
        snprintf(s, ITEM_LABEL_LENGTH, "Pcmax,f,c < -29 dBm (0)");
2052
0
    } else if (val == 63) {
2053
0
        snprintf(s, ITEM_LABEL_LENGTH, "Pcmax,f,c >= 33 dBm (63)");
2054
0
    } else {
2055
0
        snprintf(s, ITEM_LABEL_LENGTH, "%d dBm <= Pcmax,f,c < %d dBm (%d)", val - 30, val - 29, val);
2056
0
    }
2057
0
}
2058
2059
/* UL-SCH and DL-SCH formats have much in common, so handle them in a common
2060
   function */
2061
static unsigned 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)
2065
0
{
2066
0
    bool ces_seen = false;
2067
0
    bool data_seen = false;
2068
2069
0
    write_pdu_label_and_info(pdu_ti, NULL, pinfo,
2070
0
                             "%s ",
2071
0
                             (p_mac_nr_info->direction == DIRECTION_UPLINK) ? "UL-SCH" : "DL-SCH");
2072
2073
0
    tap_info->raw_length = p_mac_nr_info->length;
2074
2075
    /************************************************************************/
2076
    /* Dissect each sub-pdu.                                             */
2077
0
    do {
2078
        /* Subheader */
2079
0
        proto_item *subheader_ti = proto_tree_add_item(tree,
2080
0
                                                       hf_mac_nr_subheader,
2081
0
                                                       tvb, offset, 0, ENC_ASCII);
2082
0
        proto_tree *subheader_tree = proto_item_add_subtree(subheader_ti, ett_mac_nr_subheader);
2083
2084
2085
0
        bool F, fixed_len;
2086
0
        uint32_t SDU_length=0;
2087
2088
        /* 1st bit is always reserved */
2089
        /* 2nd bit depends upon LCID */
2090
0
        uint8_t lcid = tvb_get_uint8(tvb, offset) & 0x3f;
2091
0
        int32_t elcid= -1;
2092
0
        switch (lcid) {
2093
0
            case TWO_OCTET_ELCID_FIELD:
2094
0
                elcid = tvb_get_uint16(tvb, offset+1, ENC_BIG_ENDIAN);
2095
0
                fixed_len = true;
2096
0
                break;
2097
0
            case ONE_OCTET_ELCID_FIELD:
2098
0
                elcid = tvb_get_uint8(tvb, offset+1);
2099
0
                fixed_len = is_fixed_sized_elcid(elcid, p_mac_nr_info->direction);
2100
0
            default:
2101
0
                break;
2102
0
        }
2103
0
        if (elcid == -1) {
2104
            /* No elcid present */
2105
0
            fixed_len = is_fixed_sized_lcid(lcid, p_mac_nr_info->direction);
2106
0
        }
2107
0
        if (fixed_len) {
2108
0
            proto_tree_add_bits_item(subheader_tree, hf_mac_nr_subheader_reserved, tvb, offset<<3, 2, ENC_BIG_ENDIAN);
2109
0
        }
2110
0
        else {
2111
0
            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
0
            proto_tree_add_item_ret_boolean(subheader_tree, hf_mac_nr_subheader_f, tvb, offset, 1, ENC_BIG_ENDIAN, &F);
2114
0
        }
2115
2116
        /* LCID (UL or DL) */
2117
0
        proto_tree_add_uint(subheader_tree,
2118
0
                            (p_mac_nr_info->direction == DIRECTION_UPLINK) ?
2119
0
                                  hf_mac_nr_ulsch_lcid : hf_mac_nr_dlsch_lcid,
2120
0
                            tvb, offset, 1, lcid);
2121
        /* Also add LCID as a hidden, direction-less field */
2122
0
        proto_item *bi_di_lcid = proto_tree_add_uint(subheader_tree, hf_mac_nr_lcid, tvb, offset, 1, lcid);
2123
0
        proto_item_set_hidden(bi_di_lcid);
2124
0
        offset++;
2125
2126
        /* Show eLCID, if present */
2127
0
        switch (lcid) {
2128
0
            case TWO_OCTET_ELCID_FIELD:
2129
0
                elcid = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
2130
0
                proto_tree_add_uint(subheader_tree,
2131
0
                    (p_mac_nr_info->direction == DIRECTION_UPLINK) ?
2132
0
                    hf_mac_nr_ulsch_elcid_2oct : hf_mac_nr_dlsch_elcid_2oct,
2133
0
                    tvb, offset, 2, elcid);
2134
0
                offset += 2;
2135
0
                break;
2136
0
            case ONE_OCTET_ELCID_FIELD:
2137
0
                elcid = tvb_get_uint8(tvb, offset);
2138
0
                proto_tree_add_uint(subheader_tree,
2139
0
                    (p_mac_nr_info->direction == DIRECTION_UPLINK) ?
2140
0
                    hf_mac_nr_ulsch_elcid_1oct : hf_mac_nr_dlsch_elcid_1oct,
2141
0
                    tvb, offset, 1, elcid);
2142
0
                offset += 1;
2143
0
                break;
2144
2145
0
            default:
2146
0
                break;
2147
0
        }
2148
2149
        /* Show length */
2150
0
        if (!fixed_len) {
2151
0
            if (F) {
2152
                /* Long length */
2153
0
                proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_subheader_length_2_bytes, tvb, offset, 2, ENC_BIG_ENDIAN, &SDU_length);
2154
0
                offset += 2;
2155
0
            }
2156
0
            else {
2157
                /* Short length */
2158
0
                proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_subheader_length_1_byte, tvb, offset, 1, ENC_BIG_ENDIAN, &SDU_length);
2159
0
                offset++;
2160
0
            }
2161
0
        }
2162
2163
0
        if (lcid <= 32 || (p_mac_nr_info->direction == DIRECTION_UPLINK &&
2164
0
                           (lcid == 35 || lcid == 36 || lcid == CCCH_48_BITS_LCID))) {
2165
0
            proto_item *sch_pdu_ti;
2166
2167
            /* Note whether this sub-pdu gets dissected by RLC/RRC */
2168
0
            bool dissected_by_upper_layer = false;
2169
2170
            /* Add SDU, for now just as hex data */
2171
0
            if (p_mac_nr_info->direction == DIRECTION_UPLINK) {
2172
                /* UL.  Check various CCCH LCIDs */
2173
0
                if ((lcid == CCCH_LCID) || (lcid == 36)) {
2174
0
                    SDU_length = 8;
2175
0
                } else if ((lcid == CCCH_48_BITS_LCID) || (lcid == 35)) {
2176
0
                    SDU_length = 6;
2177
0
                }
2178
0
                sch_pdu_ti = proto_tree_add_item(subheader_tree, hf_mac_nr_ulsch_sdu,
2179
0
                                                 tvb, offset, SDU_length, ENC_NA);
2180
0
            }
2181
0
            else {
2182
                /* DL */
2183
0
                sch_pdu_ti = proto_tree_add_item(subheader_tree, hf_mac_nr_dlsch_sdu,
2184
0
                                                 tvb, offset, SDU_length, ENC_NA);
2185
0
            }
2186
2187
0
            bool is_srb = false;
2188
0
            if (lcid == 3 || lcid == 4) {
2189
                /* Work out whether we are to assume that we are dealing with SRB-3 or SRB-4 */
2190
0
                rlc_bearer_type_t rlc_bearer_type;
2191
0
                uint8_t seqnum_length;
2192
0
                int drb_id;
2193
2194
0
                lookup_rlc_bearer_from_lcid(p_mac_nr_info->ueid,
2195
0
                                            lcid,
2196
0
                                            p_mac_nr_info->direction,
2197
0
                                            &rlc_bearer_type,
2198
0
                                            &seqnum_length,
2199
0
                                            &drb_id,
2200
0
                                            &is_srb);
2201
0
            }
2202
2203
            /* Might also call RLC if configured to do so for this SDU */
2204
0
            if ((lcid >= 3) && (lcid <= 32) && !is_srb) {
2205
                /* Look for DRB mapping for this LCID to drb channel set by UAT table */
2206
0
                rlc_bearer_type_t rlc_bearer_type;
2207
0
                uint8_t seqnum_length;
2208
0
                int drb_id;
2209
2210
0
                tap_info->sdus_for_lcid[lcid]++;
2211
0
                tap_info->bytes_for_lcid[lcid] += SDU_length;
2212
2213
                // TODO: priority not set.
2214
0
                uint8_t priority = 0;
2215
0
                lookup_rlc_bearer_from_lcid(p_mac_nr_info->ueid,
2216
0
                                            lcid,
2217
0
                                            p_mac_nr_info->direction,
2218
0
                                            &rlc_bearer_type,
2219
0
                                            &seqnum_length,
2220
0
                                            &drb_id,
2221
0
                                            &is_srb);
2222
2223
                /* Dissect according to channel type */
2224
0
                switch (rlc_bearer_type) {
2225
0
                    case rlcUM6:
2226
0
                    case rlcUM12:
2227
0
                        call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, SDU_length,
2228
0
                                           RLC_UM_MODE, p_mac_nr_info->direction, p_mac_nr_info->ueid,
2229
0
                                           BEARER_TYPE_DRB, drb_id, seqnum_length,
2230
0
                                           priority);
2231
0
                        dissected_by_upper_layer = true;
2232
0
                        break;
2233
0
                    case rlcAM12:
2234
0
                    case rlcAM18:
2235
0
                        call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, SDU_length,
2236
0
                                           RLC_AM_MODE, p_mac_nr_info->direction, p_mac_nr_info->ueid,
2237
0
                                           BEARER_TYPE_DRB, drb_id, seqnum_length,
2238
0
                                           priority);
2239
0
                        dissected_by_upper_layer = true;
2240
0
                        break;
2241
0
                    case rlcTM:
2242
0
                        call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, SDU_length,
2243
0
                                           RLC_TM_MODE, p_mac_nr_info->direction, p_mac_nr_info->ueid,
2244
0
                                           BEARER_TYPE_DRB, drb_id, 0,
2245
0
                                           priority);
2246
0
                        dissected_by_upper_layer = true;
2247
0
                        break;
2248
0
                    case rlcRaw:
2249
                        /* Nothing to do! */
2250
0
                        break;
2251
0
                }
2252
0
            } else if ((lcid >= 1 && lcid <= 2) || ((lcid==3 || lcid==4) && is_srb)) {
2253
                /* SRB */
2254
0
                tap_info->sdus_for_lcid[lcid]++;
2255
0
                tap_info->bytes_for_lcid[lcid] += SDU_length;
2256
2257
0
                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
0
                    call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, SDU_length,
2261
0
                                       RLC_AM_MODE, p_mac_nr_info->direction, p_mac_nr_info->ueid,
2262
0
                                       BEARER_TYPE_SRB, lcid, 12,
2263
0
                                       (lcid == 2) ? 3 : 1);
2264
0
                    dissected_by_upper_layer = true;
2265
0
                }
2266
0
            } else if (global_mac_nr_attempt_rrc_decode) {
2267
0
                dissector_handle_t protocol_handle;
2268
0
                tvbuff_t *rrc_tvb = tvb_new_subset_length(tvb, offset, SDU_length);
2269
2270
0
                if (p_mac_nr_info->direction == DIRECTION_UPLINK) {
2271
0
                    protocol_handle = ((lcid == CCCH_LCID) || (lcid == 36)) ?
2272
0
                                            nr_rrc_ul_ccch1_handle :
2273
0
                                            nr_rrc_ul_ccch_handle;
2274
0
                } else {
2275
0
                    protocol_handle = nr_rrc_dl_ccch_handle;
2276
0
                }
2277
                /* Hide raw view of bytes */
2278
0
                proto_item_set_hidden(sch_pdu_ti);
2279
0
                call_with_catch_all(protocol_handle, rrc_tvb, pinfo, tree);
2280
0
                dissected_by_upper_layer = true;
2281
0
            }
2282
2283
            /* Only write summary to Info column if didn't send to upper_layer dissector */
2284
0
            write_pdu_label_and_info(pdu_ti, subheader_ti, dissected_by_upper_layer ? NULL : pinfo,
2285
0
                                     "(LCID:%u %u bytes) ", lcid, SDU_length);
2286
2287
0
            offset += SDU_length;
2288
2289
2290
0
            if (p_mac_nr_info->direction == DIRECTION_UPLINK) {
2291
0
                if (ces_seen) {
2292
0
                    expert_add_info_format(pinfo, subheader_ti, &ei_mac_nr_ul_sch_control_subheader_before_data_subheader,
2293
0
                                           "UL-SCH: should not have Data SDUs after Control Elements");
2294
0
                }
2295
0
            }
2296
0
            data_seen = true;
2297
0
        }
2298
0
        else {
2299
            /* UL Control Elements */
2300
2301
            /* Add some space to info column between entries */
2302
0
            if (data_seen || ces_seen) {
2303
0
                col_append_str(pinfo->cinfo, COL_INFO, "  ");
2304
0
            }
2305
2306
0
            if (lcid != PADDING_LCID) {
2307
0
                ces_seen = true;
2308
0
            }
2309
2310
0
            if (p_mac_nr_info->direction == DIRECTION_UPLINK) {
2311
0
                uint32_t phr_ph, phr_pcmax_f_c, c_rnti, lcg_id, bs, br_lcid, bit_rate;
2312
0
                bool dir;
2313
2314
0
                switch (lcid) {
2315
0
                case TWO_OCTET_ELCID_FIELD:
2316
0
                    write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo, "(Identity of the logical channel %u) ", elcid);
2317
0
                    break;
2318
0
                case ONE_OCTET_ELCID_FIELD:
2319
0
                    switch (elcid) {
2320
0
                    case ENHANCED_MULTIPLE_ENTRY_PHR_FOR_MULTIPLE_TRP_FOUR_OCTETS_CI:
2321
                        /* It has a variable size, */
2322
0
                        offset += SDU_length;
2323
0
                        break;
2324
0
                    case ENHANCED_MULTIPLE_ENTRY_PHR_FOR_MULTIPLE_TRP_ONE_OCTETS_CI:
2325
                        /* It has a variable size, */
2326
0
                        offset += SDU_length;
2327
0
                        break;
2328
0
                    case ENHANCED_SINGLE_ENTRY_PHR_FOR_MULTIPLE_TRP:
2329
                        /* It has a fixed size and consists of three octets */
2330
0
                        offset += 3;
2331
0
                        break;
2332
0
                    case ENHANCED_MULTIPLE_ENTRY_PHR_FOUR_OCTETS_CI:
2333
                        /* has a variable size */
2334
0
                        offset += SDU_length;
2335
0
                        break;
2336
0
                    case ENHANCED_MULTIPLE_ENTRY_PHR_ONE_OCTETS_CI:
2337
0
                        offset += SDU_length;
2338
0
                        break;
2339
0
                    case ENHANCED_SINGLE_ENTRY_PHR:
2340
                        /* has a variable size */
2341
0
                        offset += SDU_length;
2342
0
                        break;
2343
0
                    case ENHANCED_BFR_ONE_OCTET_CI:
2344
                        /* have a variable size */
2345
0
                        offset += SDU_length;
2346
0
                        break;
2347
0
                    case ENHANCED_BFR_FOUR_OCTET_CI:
2348
                        /* have a variable size*/
2349
0
                        offset += SDU_length;
2350
0
                        break;
2351
0
                    case TRUNCATED_ENHANCED_BFR_FOUR_OCTET_CI:
2352
                        /* have a variable size*/
2353
0
                        offset += SDU_length;
2354
0
                        break;
2355
0
                    case POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_REQUEST:
2356
                        /* It has a fixed size of zero bits */
2357
0
                        break;
2358
0
                    case IAB_MT_RECOMMENDED_BEAM_INDICATION:
2359
                        /* It has a variable size */
2360
0
                        offset += SDU_length;
2361
0
                        break;
2362
0
                    case DESIRED_IAB_MT_PSD_RANGE:
2363
0
                        break;
2364
0
                    case DESIRED_DL_TX_POWER_ADJUSTMENT:
2365
0
                        break;
2366
0
                    case CASE_6_TIMING_REQUEST:
2367
0
                        break;
2368
0
                    case DESIRED_GUARD_SYMBOLS_FOR_CASE_6_TIMING:
2369
0
                        break;
2370
0
                    case DESIRED_GUARD_SYMBOLS_FOR_CASE_7_TIMING:
2371
0
                        break;
2372
0
                    case EXTENDED_SHORT_TRUNCATED_BSR:
2373
0
                        break;
2374
0
                    case EXTENDED_LONG_TRUNCATED_BSR:
2375
0
                        break;
2376
0
                    case EXTENDED_SHORT_BSR:
2377
0
                        break;
2378
0
                    case EXTENDED_LONG_BSR:
2379
0
                        break;
2380
0
                    case EXTENDED_PRE_EMPTIVE_BSR:
2381
0
                        break;
2382
0
                    case BFR_FOUR_OCTETS_CI:
2383
0
                        break;
2384
0
                    case TRUNCATED_BFR_FOUR_OCTETS_CI:
2385
0
                        break;
2386
0
                    case MULTIPLE_ENTRY_CONFIGURED_GRANT_CONFIRMATION:
2387
0
                        break;
2388
0
                    case SIDELINK_CONFIGURED_GRANT_CONFIRMATION:
2389
0
                        break;
2390
0
                    case DESIRED_GUARD_SYMBOLS:
2391
0
                        break;
2392
0
                    case PRE_EMPTIVE_BSR:
2393
0
                        break;
2394
0
                    default:
2395
0
                        break;
2396
0
                    }
2397
0
                    break;
2398
0
                case TRUNCATED_ENHANCED_BFR_LCID:
2399
                    /* variable size */
2400
0
                    offset += SDU_length;
2401
0
                    break;
2402
0
                case TIMING_ADVANCE_REPORT_LCID:
2403
0
                {
2404
                    /* Reserved (2 bits) */
2405
0
                    proto_tree_add_item(subheader_tree, hf_mac_nr_control_timing_advance_report_reserved,
2406
0
                        tvb, offset, 1, ENC_BIG_ENDIAN);
2407
                    /* Timing  Advance */
2408
0
                    uint32_t ta;
2409
0
                    proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_timing_advance_report_ta,
2410
0
                        tvb, offset, 2, ENC_BIG_ENDIAN, &ta);
2411
0
                    write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo, "(Timing Advance Report TA=%u) ", ta);
2412
2413
0
                    offset += 2;
2414
0
                    break;
2415
0
                }
2416
0
                case TRUNCATED_SIDELINK_BSR_LCID:
2417
                    /* No description? */
2418
0
                    break;
2419
0
                case SIDELINK_BSR_LCID:
2420
                    /* No description? */
2421
0
                    break;
2422
0
                case LBT_FAILURE_4_OCTETS_LCID:
2423
0
                    offset += 4;
2424
0
                    break;
2425
0
                case LBT_FAILURE_1_OCTET_LCID:
2426
0
                    offset += 1;
2427
0
                    break;
2428
0
                case BFR_LCID:
2429
                    /* variable size */
2430
0
                    offset += SDU_length;
2431
0
                    break;
2432
0
                case TRUNCATED_BFR_LCID:
2433
0
                    offset += SDU_length;
2434
0
                    break;
2435
                    /* CCCH_48_BITS_LCID Handled above*/
2436
0
                case RECOMMENDED_BIT_RATE_QUERY_LCID:
2437
0
                    proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_recommended_bit_rate_query_lcid,
2438
0
                        tvb, offset, 1, ENC_BIG_ENDIAN, &br_lcid);
2439
0
                    proto_tree_add_item_ret_boolean(subheader_tree, hf_mac_nr_control_recommended_bit_rate_query_dir,
2440
0
                        tvb, offset, 1, ENC_BIG_ENDIAN, &dir);
2441
0
                    proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_recommended_bit_rate_query_bit_rate,
2442
0
                        tvb, offset, 2, ENC_BIG_ENDIAN, &bit_rate);
2443
0
                    proto_tree_add_item(subheader_tree, hf_mac_nr_control_recommended_bit_rate_query_reserved,
2444
0
                        tvb, offset + 1, 1, ENC_BIG_ENDIAN);
2445
0
                    write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
2446
0
                        "(Recommended BR Query LCID=%u Dir=%s BR=%s) ", br_lcid, dir ? "UL" : "DL",
2447
0
                        val_to_str_ext_const(bit_rate, &bit_rate_vals_ext, "Unknown"));
2448
0
                    offset += 2;
2449
0
                    break;
2450
0
                case CONFIGURED_GRANT_CONFIGURATION_LCID:
2451
                    /* Fixed size of zero bits */
2452
0
                    write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
2453
0
                        "(Configured Grant Config) ");
2454
0
                    break;
2455
0
                case MULTIPLE_ENTRY_PHR_1_LCID:
2456
0
                case MULTIPLE_ENTRY_PHR_4_LCID:
2457
0
                {
2458
0
                    static int* const me_phr_byte1_flags[] = {
2459
0
                        &hf_mac_nr_control_me_phr_c7_flag,
2460
0
                        &hf_mac_nr_control_me_phr_c6_flag,
2461
0
                        &hf_mac_nr_control_me_phr_c5_flag,
2462
0
                        &hf_mac_nr_control_me_phr_c4_flag,
2463
0
                        &hf_mac_nr_control_me_phr_c3_flag,
2464
0
                        &hf_mac_nr_control_me_phr_c2_flag,
2465
0
                        &hf_mac_nr_control_me_phr_c1_flag,
2466
0
                        &hf_mac_nr_control_me_phr_reserved,
2467
0
                        NULL
2468
0
                    };
2469
0
                    static int* const me_phr_byte2_flags[] = {
2470
0
                        &hf_mac_nr_control_me_phr_c15_flag,
2471
0
                        &hf_mac_nr_control_me_phr_c14_flag,
2472
0
                        &hf_mac_nr_control_me_phr_c13_flag,
2473
0
                        &hf_mac_nr_control_me_phr_c12_flag,
2474
0
                        &hf_mac_nr_control_me_phr_c11_flag,
2475
0
                        &hf_mac_nr_control_me_phr_c10_flag,
2476
0
                        &hf_mac_nr_control_me_phr_c9_flag,
2477
0
                        &hf_mac_nr_control_me_phr_c8_flag,
2478
0
                        NULL
2479
0
                    };
2480
0
                    static int* const me_phr_byte3_flags[] = {
2481
0
                        &hf_mac_nr_control_me_phr_c23_flag,
2482
0
                        &hf_mac_nr_control_me_phr_c22_flag,
2483
0
                        &hf_mac_nr_control_me_phr_c21_flag,
2484
0
                        &hf_mac_nr_control_me_phr_c20_flag,
2485
0
                        &hf_mac_nr_control_me_phr_c19_flag,
2486
0
                        &hf_mac_nr_control_me_phr_c18_flag,
2487
0
                        &hf_mac_nr_control_me_phr_c17_flag,
2488
0
                        &hf_mac_nr_control_me_phr_c16_flag,
2489
0
                        NULL
2490
0
                    };
2491
0
                    static int* const me_phr_byte4_flags[] = {
2492
0
                        &hf_mac_nr_control_me_phr_c31_flag,
2493
0
                        &hf_mac_nr_control_me_phr_c30_flag,
2494
0
                        &hf_mac_nr_control_me_phr_c29_flag,
2495
0
                        &hf_mac_nr_control_me_phr_c28_flag,
2496
0
                        &hf_mac_nr_control_me_phr_c27_flag,
2497
0
                        &hf_mac_nr_control_me_phr_c26_flag,
2498
0
                        &hf_mac_nr_control_me_phr_c25_flag,
2499
0
                        &hf_mac_nr_control_me_phr_c24_flag,
2500
0
                        NULL
2501
0
                    };
2502
0
                    uint32_t start_offset = offset;
2503
0
                    uint8_t scell_bitmap1;
2504
0
                    uint32_t scell_bitmap2_3_4 = 0;
2505
0
                    proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, me_phr_byte1_flags, ENC_NA);
2506
0
                    scell_bitmap1 = tvb_get_uint8(tvb, offset);
2507
0
                    offset++;
2508
0
                    if (lcid == MULTIPLE_ENTRY_PHR_4_LCID) {
2509
0
                        proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, me_phr_byte2_flags, ENC_NA);
2510
0
                        proto_tree_add_bitmask_list(subheader_tree, tvb, offset + 1, 1, me_phr_byte3_flags, ENC_NA);
2511
0
                        proto_tree_add_bitmask_list(subheader_tree, tvb, offset + 2, 1, me_phr_byte4_flags, ENC_NA);
2512
0
                        scell_bitmap2_3_4 = tvb_get_letoh24(tvb, offset); /* read them in little endian on purpose */
2513
0
                        offset += 3;
2514
0
                    }
2515
2516
0
                    static const int*  ph_fields1[] = {
2517
0
                        &hf_mac_nr_control_me_phr_ph_c1,
2518
0
                        &hf_mac_nr_control_me_phr_ph_c2,
2519
0
                        &hf_mac_nr_control_me_phr_ph_c3,
2520
0
                        &hf_mac_nr_control_me_phr_ph_c4,
2521
0
                        &hf_mac_nr_control_me_phr_ph_c5,
2522
0
                        &hf_mac_nr_control_me_phr_ph_c6,
2523
0
                        &hf_mac_nr_control_me_phr_ph_c7,
2524
0
                    };
2525
0
                    static const int* ph_fields2_3_4[] = {
2526
0
                        &hf_mac_nr_control_me_phr_ph_c8,
2527
0
                        &hf_mac_nr_control_me_phr_ph_c9,
2528
0
                        &hf_mac_nr_control_me_phr_ph_c10,
2529
0
                        &hf_mac_nr_control_me_phr_ph_c11,
2530
0
                        &hf_mac_nr_control_me_phr_ph_c12,
2531
0
                        &hf_mac_nr_control_me_phr_ph_c13,
2532
0
                        &hf_mac_nr_control_me_phr_ph_c14,
2533
0
                        &hf_mac_nr_control_me_phr_ph_c15,
2534
0
                        &hf_mac_nr_control_me_phr_ph_c16,
2535
0
                        &hf_mac_nr_control_me_phr_ph_c17,
2536
0
                        &hf_mac_nr_control_me_phr_ph_c18,
2537
0
                        &hf_mac_nr_control_me_phr_ph_c19,
2538
0
                        &hf_mac_nr_control_me_phr_ph_c20,
2539
0
                        &hf_mac_nr_control_me_phr_ph_c21,
2540
0
                        &hf_mac_nr_control_me_phr_ph_c22,
2541
0
                        &hf_mac_nr_control_me_phr_ph_c23,
2542
0
                        &hf_mac_nr_control_me_phr_ph_c24,
2543
0
                        &hf_mac_nr_control_me_phr_ph_c25,
2544
0
                        &hf_mac_nr_control_me_phr_ph_c26,
2545
0
                        &hf_mac_nr_control_me_phr_ph_c27,
2546
0
                        &hf_mac_nr_control_me_phr_ph_c28,
2547
0
                        &hf_mac_nr_control_me_phr_ph_c29,
2548
0
                        &hf_mac_nr_control_me_phr_ph_c30,
2549
0
                        &hf_mac_nr_control_me_phr_ph_c31,
2550
0
                    };
2551
2552
                    /* PCell entries */
2553
0
                    uint32_t PH;
2554
0
                    proto_item* entry_ti;
2555
0
                    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
0
                        entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, hf_mac_nr_control_me_phr_ph_type2_spcell,
2558
0
                            hf_mac_nr_control_me_phr_pcmax_f_c_type2_spcell, &PH, &offset);
2559
0
                        proto_item_append_text(entry_ti, " (Type2, SpCell PH=%u)", PH);
2560
0
                    }
2561
0
                    entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, hf_mac_nr_control_me_phr_ph_type1_pcell,
2562
0
                        hf_mac_nr_control_me_phr_pcmax_f_c_type1_pcell, &PH, &offset);
2563
0
                    proto_item_append_text(entry_ti, " (Type1, PCell PH=%u)", PH);
2564
2565
2566
                    /* SCell entries */
2567
                    /* The PH and PCMAX,f,c fields can be either for a LTE or NR cell */
2568
0
                    for (int n = 1; n <= 7; n++) {
2569
0
                        if (scell_bitmap1 & (1 << n)) {
2570
0
                            entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, *ph_fields1[n - 1],
2571
0
                                hf_mac_nr_control_me_phr_pcmax_f_c_typeX, &PH, &offset);
2572
0
                            proto_item_append_text(entry_ti, " (SCellIndex %d PH=%u)", n, PH);
2573
0
                        }
2574
0
                    }
2575
0
                    if (lcid == MULTIPLE_ENTRY_PHR_4_LCID) {
2576
0
                        for (int n = 0; n <= 23; n++) {
2577
0
                            if (scell_bitmap2_3_4 & (1 << n)) {
2578
0
                                entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, *ph_fields2_3_4[n],
2579
0
                                    hf_mac_nr_control_me_phr_pcmax_f_c_typeX, &PH, &offset);
2580
0
                                proto_item_append_text(entry_ti, " (SCellIndex %d PH=%u)", n + 8, PH);
2581
0
                            }
2582
0
                        }
2583
0
                    }
2584
2585
0
                    write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
2586
0
                        "(Multi-entry PHR) ");
2587
2588
                    /* Make sure dissected length matches signalled length */
2589
0
                    if (offset != start_offset + SDU_length) {
2590
0
                        proto_tree_add_expert_format(subheader_tree, pinfo, &ei_mac_nr_sdu_length_different_from_dissected,
2591
0
                            tvb, start_offset, offset - start_offset,
2592
0
                            "A Multiple-Entry PHR subheader has a length field of %u bytes, but "
2593
0
                            "dissected %u bytes", SDU_length, offset - start_offset);
2594
                        /* Assume length was correct, so at least can dissect further subheaders */
2595
0
                        offset = start_offset + SDU_length;
2596
0
                    }
2597
0
                    break;
2598
0
                }
2599
0
                case SINGLE_ENTRY_PHR_LCID:
2600
                    /* R R PH (6 bits) */
2601
0
                    proto_tree_add_item(subheader_tree, hf_mac_nr_control_se_phr_reserved,
2602
0
                        tvb, offset, 1, ENC_NA);
2603
0
                    proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_se_phr_ph,
2604
0
                        tvb, offset, 1, ENC_BIG_ENDIAN, &phr_ph);
2605
0
                    offset++;
2606
2607
                    /* R R PCMAX_f_c (6 bits) */
2608
0
                    proto_tree_add_item(subheader_tree, hf_mac_nr_control_se_phr_reserved,
2609
0
                        tvb, offset, 1, ENC_NA);
2610
0
                    proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_se_phr_pcmax_f_c,
2611
0
                        tvb, offset, 1, ENC_NA, &phr_pcmax_f_c);
2612
0
                    offset++;
2613
0
                    write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
2614
0
                        "(PHR PH=%u PCMAX_f_c=%u) ", phr_ph, phr_pcmax_f_c);
2615
0
                    break;
2616
0
                case C_RNTI_LCID:
2617
0
                    proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_crnti,
2618
0
                        tvb, offset, 2, ENC_BIG_ENDIAN, &c_rnti);
2619
0
                    write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
2620
0
                        "(C-RNTI=%u) ", c_rnti);
2621
0
                    offset += 2;
2622
0
                    break;
2623
0
                case SHORT_TRUNCATED_BSR_LCID:
2624
0
                case SHORT_BSR_LCID:
2625
0
                {
2626
0
                    static const int* hf_mac_nr_control_bsr_short_bs_lcg[] = {
2627
0
                        &hf_mac_nr_control_bsr_short_bs_lcg0,
2628
0
                        &hf_mac_nr_control_bsr_short_bs_lcg1,
2629
0
                        &hf_mac_nr_control_bsr_short_bs_lcg2,
2630
0
                        &hf_mac_nr_control_bsr_short_bs_lcg3,
2631
0
                        &hf_mac_nr_control_bsr_short_bs_lcg4,
2632
0
                        &hf_mac_nr_control_bsr_short_bs_lcg5,
2633
0
                        &hf_mac_nr_control_bsr_short_bs_lcg6,
2634
0
                        &hf_mac_nr_control_bsr_short_bs_lcg7
2635
0
                    };
2636
2637
0
                    proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_bsr_short_lcg,
2638
0
                        tvb, offset, 1, ENC_BIG_ENDIAN, &lcg_id);
2639
0
                    proto_tree_add_item_ret_uint(subheader_tree, *hf_mac_nr_control_bsr_short_bs_lcg[lcg_id],
2640
0
                        tvb, offset, 1, ENC_BIG_ENDIAN, &bs);
2641
0
                    write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
2642
0
                        "(Short %sBSR LCG ID=%u BS=%u) ",
2643
0
                        lcid == SHORT_BSR_LCID ? "" : "Truncated ", lcg_id, bs);
2644
0
                    offset++;
2645
0
                }
2646
0
                break;
2647
0
                case LONG_TRUNCATED_BSR_LCID:
2648
0
                {
2649
0
                    static int* const long_bsr_flags[] = {
2650
0
                        &hf_mac_nr_control_bsr_long_lcg7,
2651
0
                        &hf_mac_nr_control_bsr_long_lcg6,
2652
0
                        &hf_mac_nr_control_bsr_long_lcg5,
2653
0
                        &hf_mac_nr_control_bsr_long_lcg4,
2654
0
                        &hf_mac_nr_control_bsr_long_lcg3,
2655
0
                        &hf_mac_nr_control_bsr_long_lcg2,
2656
0
                        &hf_mac_nr_control_bsr_long_lcg1,
2657
0
                        &hf_mac_nr_control_bsr_long_lcg0,
2658
0
                        NULL
2659
0
                    };
2660
2661
0
                    proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, long_bsr_flags, ENC_NA);
2662
0
                    unsigned CE_start = offset;
2663
0
                    offset++;
2664
2665
0
                    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);
2666
2667
                    /* TODO: show in string here how many BSs were seen */
2668
0
                    write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
2669
0
                        "(Long Truncated BSR) ");
2670
2671
0
                    if (SDU_length > 7) {
2672
0
                        proto_tree_add_expert_format(subheader_tree, pinfo, &ei_mac_nr_sdu_length_different_from_dissected,
2673
0
                            tvb, CE_start, SDU_length,
2674
0
                            "A Long Truncated BSR subheader should have a length field up to 7 bytes, but "
2675
0
                            "is set to %u bytes", SDU_length);
2676
0
                    }
2677
0
                }
2678
0
                break;
2679
0
                case LONG_BSR_LCID:
2680
0
                {
2681
0
                    static int* const long_bsr_flags[] = {
2682
0
                        &hf_mac_nr_control_bsr_long_lcg7,
2683
0
                        &hf_mac_nr_control_bsr_long_lcg6,
2684
0
                        &hf_mac_nr_control_bsr_long_lcg5,
2685
0
                        &hf_mac_nr_control_bsr_long_lcg4,
2686
0
                        &hf_mac_nr_control_bsr_long_lcg3,
2687
0
                        &hf_mac_nr_control_bsr_long_lcg2,
2688
0
                        &hf_mac_nr_control_bsr_long_lcg1,
2689
0
                        &hf_mac_nr_control_bsr_long_lcg0,
2690
0
                        NULL
2691
0
                    };
2692
2693
0
                    uint8_t flags = tvb_get_uint8(tvb, offset);
2694
0
                    proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, long_bsr_flags, ENC_NA);
2695
0
                    unsigned CE_start = offset;
2696
0
                    offset++;
2697
2698
                    /* Show BSR values. */
2699
0
                    if (flags & 0x01) proto_tree_add_item(subheader_tree, hf_mac_nr_control_bsr_long_bs_lcg0, tvb, offset++, 1, ENC_NA);
2700
0
                    if (flags & 0x02) proto_tree_add_item(subheader_tree, hf_mac_nr_control_bsr_long_bs_lcg1, tvb, offset++, 1, ENC_NA);
2701
0
                    if (flags & 0x04) proto_tree_add_item(subheader_tree, hf_mac_nr_control_bsr_long_bs_lcg2, tvb, offset++, 1, ENC_NA);
2702
0
                    if (flags & 0x08) proto_tree_add_item(subheader_tree, hf_mac_nr_control_bsr_long_bs_lcg3, tvb, offset++, 1, ENC_NA);
2703
0
                    if (flags & 0x10) proto_tree_add_item(subheader_tree, hf_mac_nr_control_bsr_long_bs_lcg4, tvb, offset++, 1, ENC_NA);
2704
0
                    if (flags & 0x20) proto_tree_add_item(subheader_tree, hf_mac_nr_control_bsr_long_bs_lcg5, tvb, offset++, 1, ENC_NA);
2705
0
                    if (flags & 0x40) proto_tree_add_item(subheader_tree, hf_mac_nr_control_bsr_long_bs_lcg6, tvb, offset++, 1, ENC_NA);
2706
0
                    if (flags & 0x80) proto_tree_add_item(subheader_tree, hf_mac_nr_control_bsr_long_bs_lcg7, tvb, offset++, 1, ENC_NA);
2707
2708
                    /* TODO: show in string here how many BSs were seen */
2709
0
                    write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
2710
0
                        "(Long BSR) ");
2711
2712
2713
                    /* Make sure dissected length matches signalled length */
2714
0
                    if ((offset - CE_start) != SDU_length) {
2715
0
                        proto_tree_add_expert_format(subheader_tree, pinfo, &ei_mac_nr_sdu_length_different_from_dissected,
2716
0
                            tvb, CE_start, offset - CE_start,
2717
0
                            "A Long BSR subheader has a length field of %u bytes, but "
2718
0
                            "dissected %u bytes", SDU_length, offset - CE_start);
2719
                        /* Assume length was correct, so at least can dissect further subheaders */
2720
0
                        offset = CE_start + SDU_length;
2721
0
                    }
2722
0
                }
2723
0
                break;
2724
0
                case PADDING_LCID:
2725
0
                {
2726
                    /* The rest of the PDU is padding */
2727
0
                    int pad_len = tvb_reported_length_remaining(tvb, offset);
2728
0
                    if (pad_len > 0)
2729
0
                        proto_tree_add_item(subheader_tree, hf_mac_nr_padding, tvb, offset, -1, ENC_NA);
2730
0
                    write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo, "(Padding %u bytes) ", pad_len);
2731
                    /* Move to the end of the frame */
2732
0
                    offset = tvb_reported_length(tvb);
2733
0
                }
2734
0
                break;
2735
0
                }
2736
0
            }
2737
0
            else {
2738
                /* Downlink control elements */
2739
0
                uint32_t ta_tag_id, ta_ta, br_lcid, bit_rate;
2740
0
                bool dir;
2741
2742
0
                if (lcid != PADDING_LCID) {
2743
0
                    if (data_seen) {
2744
0
                        expert_add_info_format(pinfo, subheader_ti, &ei_mac_nr_dl_sch_control_subheader_after_data_subheader,
2745
0
                                               "DL-SCH: should not have Control Elements after Data SDUs");
2746
0
                    }
2747
0
                }
2748
0
                switch (lcid) {
2749
0
                    case TWO_OCTET_ELCID_FIELD:
2750
                        /* Error */
2751
0
                        break;
2752
0
                    case ONE_OCTET_ELCID_FIELD:
2753
0
                        switch (elcid) {
2754
0
                        case SERVING_CELL_SET_BASED_SRS_TCI_STATE_INDICATIONS_ELCD:
2755
0
                            break;
2756
0
                        case SP_AP_SRS_TCI_STATE_INDICATION_ELCD:
2757
0
                            break;
2758
0
                        case BFD_RS_INDICATION_ELCD:
2759
0
                            break;
2760
0
                        case DIFFERENTIAL_KOFFSET_ELCD:
2761
0
                        {
2762
0
                            uint32_t koffset;
2763
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_differential_koffset_reserved,
2764
0
                                tvb, offset, 1, ENC_BIG_ENDIAN);
2765
0
                            proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_differential_koffset,
2766
0
                                tvb, offset, 1, ENC_BIG_ENDIAN, &koffset);
2767
0
                            offset += 1;
2768
0
                            write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
2769
0
                                "(Differential Koffset %u) ", koffset);
2770
0
                        }
2771
0
                            break;
2772
0
                        case ENHANCED_SCELL_ACTIVATION_DEACTIVATION_MAC_CE_WITH_ONE_OCTET_CI_FIELD_ELCD:
2773
0
                            break;
2774
0
                        case ENHANCED_SCELL_ACTIVATION_DEACTIVATION_MAC_CE_WITH_FOUR_OCTET_CI_FIELD_ELCD:
2775
0
                            break;
2776
0
                        case UNIFIED_TCI_STATES_ACTIVATION_DEACTIVATION_ELCD:
2777
0
                            break;
2778
0
                        case PUCCH_POWER_CONTROL_SET_UPDATE_FOR_MULTIPLE_TRP_PUCCH_REPETITION__ELCD:
2779
0
                            break;
2780
0
                        case PUCCH_SPATIAL_RELATION_ACTIVATION_DEACTIVATION_FOR_MULTIPLE_TRP_PUCCH_REPETITION_ELCD:
2781
0
                            break;
2782
0
                        case ENHANCED_TCI_STATES_INDICATION_FOR_UE_SPECIFIC_PDCCH_ELCD:
2783
0
                            break;
2784
0
                        case POSITIONING_MEASUREMENT_GAP_ACTIVATION_DEACTIVATION_COMMAND_ELCD:
2785
0
                            break;
2786
0
                        case PPW_ACTIVATION_DEACTIVATION_COMMAND_ELCD:
2787
0
                            break;
2788
0
                        case DL_TX_POWER_ADJUSTMENT_ELCD:
2789
0
                            break;
2790
0
                        case TIMING_CASE_INDICATION_ELCD:
2791
0
                            break;
2792
0
                        case CHILD_IAB_DU_RESTRICTED_BEAM_INDICATION_ELCD:
2793
0
                            break;
2794
0
                        case CASE_7_TIMING_ADVANCE_OFFSET_ELCD:
2795
0
                            break;
2796
0
                        case PROVIDED_GUARD_SYMBOLS_FOR_CASE_6_TIMING_ELCD:
2797
0
                            break;
2798
0
                        case PROVIDED_GUARD_SYMBOLS_FOR_CASE_7_TIMING_ELCD:
2799
0
                            break;
2800
0
                        case SERVING_CELL_SET_BASED_SRS_SPATIAL_RELATION_INDICATION_ELCD:
2801
0
                            break;
2802
0
                        case PUSCH_PATHLOSS_REFERENCE_RS_UPDATE_ELCD:
2803
0
                            break;
2804
0
                        case SRS_PATHLOSS_REFERENCE_RS_UPDATE_ELCD:
2805
0
                            break;
2806
0
                        case ENHANCED_SP_AP_SRS_SPATIAL_RELATION_INDICATION_ELCD:
2807
0
                            break;
2808
0
                        case ENHANCED_PUCCH_SPATIAL_RELATION_ACTIVATION_DEACTIVATION_ELCD:
2809
0
                            break;
2810
0
                        case ENHANCED_TCI_STATES_ACTIVATION_DEACTIVATION_FOR_UE_SPECIFIC_PDSCH_ELCD:
2811
0
                            break;
2812
0
                        case DUPLICATION_RLC_ACTIVATION_DEACTIVATION_ELCD:
2813
                            /* 251 */
2814
0
                            break;
2815
0
                        case ABSOLUTE_TIMING_ADVANCE_COMMAND_ELCD:
2816
0
                            break;
2817
0
                        case SP_POSITIONING_SRS_ACTIVATION_DEACTIVATION_ELCD:
2818
0
                            break;
2819
0
                        case PROVIDED_GUARD_SYMBOLS_ELCD:
2820
0
                            break;
2821
0
                        case TIMING_DELTA_ELCD:
2822
0
                            break;
2823
0
                        default:
2824
0
                            break;
2825
0
                        }
2826
0
                        break;
2827
0
                    case RECOMMENDED_BIT_RATE_LCID:
2828
0
                        proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_recommended_bit_rate_lcid,
2829
0
                                            tvb, offset, 1, ENC_BIG_ENDIAN, &br_lcid);
2830
0
                        proto_tree_add_item_ret_boolean(subheader_tree, hf_mac_nr_control_recommended_bit_rate_dir,
2831
0
                                                        tvb, offset, 1, ENC_BIG_ENDIAN, &dir);
2832
0
                        proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_recommended_bit_rate_bit_rate,
2833
0
                                                     tvb, offset, 2, ENC_BIG_ENDIAN, &bit_rate);
2834
0
                        proto_tree_add_item(subheader_tree, hf_mac_nr_control_recommended_bit_rate_reserved,
2835
0
                                            tvb, offset+1, 1, ENC_BIG_ENDIAN);
2836
0
                        offset += 2;
2837
0
                        write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
2838
0
                                                 "(Recommended BR LCID=%u Dir=%s BR=%s) ", br_lcid, dir ? "UL" : "DL",
2839
0
                                                 val_to_str_ext_const(bit_rate, &bit_rate_vals_ext, "Unknown"));
2840
0
                        break;
2841
0
                    case SP_ZP_CSI_RS_RESOURCE_SET_ACT_DEACT_LCID:
2842
0
                        proto_tree_add_item(subheader_tree, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_ad,
2843
0
                                            tvb, offset, 1, ENC_NA);
2844
0
                        proto_tree_add_item(subheader_tree, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_serving_cell_id,
2845
0
                                            tvb, offset, 1, ENC_NA);
2846
0
                        proto_tree_add_item(subheader_tree, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_bwp_id,
2847
0
                                            tvb, offset, 1, ENC_NA);
2848
0
                        offset++;
2849
0
                        proto_tree_add_item(subheader_tree, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_reserved_2,
2850
0
                                            tvb, offset, 1, ENC_NA);
2851
0
                        proto_tree_add_item(subheader_tree, hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_sp_zp_rs_resource_set_id,
2852
0
                                            tvb, offset, 1, ENC_NA);
2853
0
                        offset++;
2854
0
                        write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
2855
0
                                                         "(SP ZP CSI-RS Res Set Act/Deact) ");
2856
0
                        break;
2857
0
                    case PUCCH_SPATIAL_REL_ACT_DEACT_LCID:
2858
0
                        {
2859
0
                            static int * const pucch_spatial_rel_act_deact_flags[] = {
2860
0
                                &hf_mac_nr_control_pucch_spatial_rel_act_deact_s8,
2861
0
                                &hf_mac_nr_control_pucch_spatial_rel_act_deact_s7,
2862
0
                                &hf_mac_nr_control_pucch_spatial_rel_act_deact_s6,
2863
0
                                &hf_mac_nr_control_pucch_spatial_rel_act_deact_s5,
2864
0
                                &hf_mac_nr_control_pucch_spatial_rel_act_deact_s4,
2865
0
                                &hf_mac_nr_control_pucch_spatial_rel_act_deact_s3,
2866
0
                                &hf_mac_nr_control_pucch_spatial_rel_act_deact_s2,
2867
0
                                &hf_mac_nr_control_pucch_spatial_rel_act_deact_s1,
2868
0
                                NULL
2869
0
                            };
2870
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_pucch_spatial_rel_act_deact_reserved,
2871
0
                                                tvb, offset, 1, ENC_NA);
2872
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_pucch_spatial_rel_act_deact_serving_cell_id,
2873
0
                                                tvb, offset, 1, ENC_NA);
2874
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_pucch_spatial_rel_act_deact_bwp_id,
2875
0
                                                tvb, offset, 1, ENC_NA);
2876
0
                            offset++;
2877
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_pucch_spatial_rel_act_deact_reserved,
2878
0
                                                tvb, offset, 1, ENC_NA);
2879
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_pucch_spatial_rel_act_deact_pucch_resource_id,
2880
0
                                                tvb, offset, 1, ENC_NA);
2881
0
                            offset++;
2882
0
                            proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, pucch_spatial_rel_act_deact_flags, ENC_NA);
2883
0
                            offset++;
2884
0
                            write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
2885
0
                                                             "(PUCCH Spatial Rel Act/Deact) ");
2886
0
                        }
2887
0
                        break;
2888
0
                    case SP_SRS_ACT_DEACT_LCID:
2889
0
                        {
2890
0
                            bool ad, c;
2891
0
                            uint32_t start_offset = offset;
2892
0
                            unsigned resources = 0;
2893
2894
                            /* Header */
2895
0
                            proto_tree_add_item_ret_boolean(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_ad,
2896
0
                                                            tvb, offset, 1, ENC_NA, &ad);
2897
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_cell_id,
2898
0
                                                tvb, offset, 1, ENC_NA);
2899
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_bwp_id,
2900
0
                                                tvb, offset, 1, ENC_NA);
2901
0
                            offset++;
2902
2903
0
                            proto_tree_add_bits_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_reserved,
2904
0
                                                     tvb, offset<<3, 2, ENC_NA);
2905
0
                            proto_tree_add_item_ret_boolean(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_c,
2906
0
                                                            tvb, offset, 1, ENC_NA, &c);
2907
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_sul,
2908
0
                                                tvb, offset, 1, ENC_NA);
2909
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_sp_srs_resource_set_id,
2910
0
                                                tvb, offset, 1, ENC_NA);
2911
0
                            offset++;
2912
2913
0
                            if (ad) {
2914
                                /* Activating - show info for resources */
2915
0
                                unsigned length = c ? (SDU_length-2) / 2 + 2: SDU_length;
2916
0
                                while (offset - start_offset < length) {
2917
0
                                    bool f;
2918
0
                                    proto_tree_add_item_ret_boolean(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_f,
2919
0
                                                        tvb, offset, 1, ENC_NA, &f);
2920
0
                                    uint32_t resource_id = tvb_get_uint8(tvb, offset) & 0x7f;
2921
0
                                    proto_item *resource_id_ti;
2922
0
                                    if (!f && (resource_id & 0x40)) {
2923
                                        /* SSB case - first bit just indicates type */
2924
0
                                        resource_id_ti = proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_resource_id_ssb,
2925
0
                                                                             tvb, offset, 1, ENC_NA);
2926
0
                                        proto_item_append_text(resource_id_ti, " (SSB)");
2927
0
                                    }
2928
0
                                    else {
2929
0
                                        resource_id_ti = proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_resource_id,
2930
0
                                                                             tvb, offset, 1, ENC_NA);
2931
0
                                        if (f) {
2932
0
                                            proto_item_append_text(resource_id_ti, " (NZP-CSI-RS)");
2933
0
                                        }
2934
0
                                        else {
2935
0
                                            proto_item_append_text(resource_id_ti, " (SRS)");
2936
0
                                        }
2937
0
                                    }
2938
0
                                    offset++;
2939
0
                                    resources++;
2940
0
                                }
2941
2942
0
                            }
2943
0
                            if (c) {
2944
                                /* Deactivating (no resources) */
2945
0
                                while (offset - start_offset < SDU_length) {
2946
0
                                    proto_tree_add_bits_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_reserved,
2947
0
                                                             tvb, offset<<3, 1, ENC_NA);
2948
0
                                    proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_resource_serving_cell_id,
2949
0
                                                        tvb, offset, 1, ENC_NA);
2950
0
                                    proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_srs_act_deact_resource_bwp_id,
2951
0
                                                        tvb, offset, 1, ENC_NA);
2952
0
                                    offset++;
2953
0
                                }
2954
0
                            }
2955
2956
                            /* Add summary to Info column */
2957
0
                            if (ad) {
2958
0
                                write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo, "(SP SRS Act/Deact Activate %d resources)", resources);
2959
0
                            }
2960
0
                            else {
2961
0
                                write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo, "(SP SRS Act/Deact Deactivate)");
2962
0
                            }
2963
0
                        }
2964
0
                        break;
2965
0
                    case SP_CSI_REPORT_ON_PUCCH_ACT_DEACT_LCID:
2966
0
                        {
2967
0
                            static int * const sp_csi_report_on_pucch_act_deact_flags[] = {
2968
0
                                &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s7,
2969
0
                                &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s6,
2970
0
                                &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s5,
2971
0
                                &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s4,
2972
0
                                &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s3,
2973
0
                                &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s2,
2974
0
                                &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s1,
2975
0
                                &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s0,
2976
0
                                NULL
2977
0
                            };
2978
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_reserved,
2979
0
                                                tvb, offset, 1, ENC_NA);
2980
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_serving_cell_id,
2981
0
                                                tvb, offset, 1, ENC_NA);
2982
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_bwp_id,
2983
0
                                                tvb, offset, 1, ENC_NA);
2984
0
                            offset++;
2985
0
                            proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, sp_csi_report_on_pucch_act_deact_flags, ENC_NA);
2986
0
                            offset++;
2987
0
                            write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
2988
0
                                                             "(SP CSI Report on PUCCH Act/Deact) ");
2989
0
                        }
2990
0
                        break;
2991
0
                    case TCI_STATE_IND_FOR_UE_SPEC_PDCCH_LCID:
2992
0
                        proto_tree_add_item(subheader_tree, hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_serving_cell_id,
2993
0
                                            tvb, offset, 1, ENC_NA);
2994
0
                        proto_tree_add_item(subheader_tree, hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_coreset_id,
2995
0
                                            tvb, offset, 2, ENC_BIG_ENDIAN);
2996
0
                        offset++;
2997
0
                        proto_tree_add_item(subheader_tree, hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_tci_state_id,
2998
0
                                            tvb, offset, 1, ENC_NA);
2999
0
                        offset++;
3000
0
                        write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
3001
0
                                                             "(TCI State Ind PDCCH) ");
3002
0
                        break;
3003
0
                    case TCI_STATES_ACT_DEACT_FOR_UE_SPEC_PDSCH_LCID:
3004
0
                        {
3005
0
                            uint32_t start_offset = offset;
3006
0
                            static int * const tci_states_act_deact_for_ue_spec_pdsc_flags[] = {
3007
0
                                &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t7,
3008
0
                                &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t6,
3009
0
                                &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t5,
3010
0
                                &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t4,
3011
0
                                &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t3,
3012
0
                                &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t2,
3013
0
                                &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t1,
3014
0
                                &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t0,
3015
0
                                NULL
3016
0
                            };
3017
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_reserved,
3018
0
                                                tvb, offset, 1, ENC_NA);
3019
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_serving_cell_id,
3020
0
                                                tvb, offset, 1, ENC_NA);
3021
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_bwp_id,
3022
0
                                                tvb, offset, 1, ENC_NA);
3023
0
                            offset++;
3024
0
                            while (offset - start_offset < SDU_length) {
3025
0
                                proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, tci_states_act_deact_for_ue_spec_pdsc_flags, ENC_NA);
3026
0
                                offset++;
3027
0
                            }
3028
0
                            write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
3029
0
                                                             "(TCI States Act Deact PDSCH) ");
3030
0
                        }
3031
0
                        break;
3032
0
                    case APER_CSI_TRIGGER_STATE_SUBSELECT_LCID:
3033
0
                        {
3034
0
                            uint32_t start_offset = offset;
3035
0
                            static int * const aper_csi_trigger_state_subselect_flags[] = {
3036
0
                                &hf_mac_nr_control_aper_csi_trigger_state_subselect_t7,
3037
0
                                &hf_mac_nr_control_aper_csi_trigger_state_subselect_t6,
3038
0
                                &hf_mac_nr_control_aper_csi_trigger_state_subselect_t5,
3039
0
                                &hf_mac_nr_control_aper_csi_trigger_state_subselect_t4,
3040
0
                                &hf_mac_nr_control_aper_csi_trigger_state_subselect_t3,
3041
0
                                &hf_mac_nr_control_aper_csi_trigger_state_subselect_t2,
3042
0
                                &hf_mac_nr_control_aper_csi_trigger_state_subselect_t1,
3043
0
                                &hf_mac_nr_control_aper_csi_trigger_state_subselect_t0,
3044
0
                                NULL
3045
0
                            };
3046
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_aper_csi_trigger_state_subselect_reserved,
3047
0
                                                tvb, offset, 1, ENC_NA);
3048
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_aper_csi_trigger_state_subselect_serving_cell_id,
3049
0
                                                tvb, offset, 1, ENC_NA);
3050
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_aper_csi_trigger_state_subselect_bwp_id,
3051
0
                                                tvb, offset, 1, ENC_NA);
3052
0
                            offset++;
3053
0
                            while (offset - start_offset < SDU_length) {
3054
0
                                proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, aper_csi_trigger_state_subselect_flags, ENC_NA);
3055
0
                                offset++;
3056
0
                            }
3057
0
                            write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
3058
0
                                                             "(Aperiodic CSI Trigger State Subselection) ");
3059
0
                        }
3060
0
                        break;
3061
0
                    case SP_CSI_RS_CSI_IM_RES_SET_ACT_DEACT_LCID:
3062
0
                        {
3063
0
                            bool ad;
3064
0
                            uint32_t start_offset = offset;
3065
0
                            static int * const sp_csi_rs_csi_im_res_set_act_deact_flags[] = {
3066
0
                                &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved3,
3067
0
                                &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_tci_state_id,
3068
0
                                NULL
3069
0
                            };
3070
0
                            proto_tree_add_item_ret_boolean(subheader_tree, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_ad,
3071
0
                                                            tvb, offset, 1, ENC_NA, &ad);
3072
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_serving_cell_id,
3073
0
                                                tvb, offset, 1, ENC_NA);
3074
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_bwp_id,
3075
0
                                                tvb, offset, 1, ENC_NA);
3076
0
                            offset++;
3077
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved,
3078
0
                                            tvb, offset, 1, ENC_NA);
3079
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_im,
3080
0
                                                tvb, offset, 1, ENC_NA);
3081
0
                            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
0
                                                tvb, offset, 1, ENC_NA);
3083
0
                            offset++;
3084
0
                            proto_tree_add_item(subheader_tree, hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved2,
3085
0
                                            tvb, offset, 1, ENC_NA);
3086
0
                            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
0
                                                tvb, offset, 1, ENC_NA);
3088
0
                            offset++;
3089
0
                            if (ad) {
3090
0
                                while (offset - start_offset < SDU_length) {
3091
0
                                    proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, sp_csi_rs_csi_im_res_set_act_deact_flags, ENC_NA);
3092
0
                                    offset++;
3093
0
                                }
3094
0
                            }
3095
0
                            write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
3096
0
                                                             "(SP CSI-RS/CSI-IM Res Set Act/Deact) ");
3097
0
                        }
3098
0
                        break;
3099
0
                    case DUPLICATION_ACTIVATION_DEACTIVATION_LCID:
3100
0
                        {
3101
0
                            static int * const dupl_act_deact_flags[] = {
3102
0
                                &hf_mac_nr_control_dupl_act_deact_drb7,
3103
0
                                &hf_mac_nr_control_dupl_act_deact_drb6,
3104
0
                                &hf_mac_nr_control_dupl_act_deact_drb5,
3105
0
                                &hf_mac_nr_control_dupl_act_deact_drb4,
3106
0
                                &hf_mac_nr_control_dupl_act_deact_drb3,
3107
0
                                &hf_mac_nr_control_dupl_act_deact_drb2,
3108
0
                                &hf_mac_nr_control_dupl_act_deact_drb1,
3109
0
                                &hf_mac_nr_control_dupl_act_deact_reserved,
3110
0
                                NULL
3111
0
                            };
3112
0
                            proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, dupl_act_deact_flags, ENC_NA);
3113
0
                            offset++;
3114
0
                            write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
3115
0
                                                             "(Dupl Act/Deact) ");
3116
0
                        }
3117
0
                        break;
3118
0
                    case SCELL_ACTIVATION_DEACTIVATION_4_LCID:
3119
0
                        {
3120
0
                            static int * const scell_act_deact_1_flags[] = {
3121
0
                                &hf_mac_nr_control_scell_act_deact_cell7,
3122
0
                                &hf_mac_nr_control_scell_act_deact_cell6,
3123
0
                                &hf_mac_nr_control_scell_act_deact_cell5,
3124
0
                                &hf_mac_nr_control_scell_act_deact_cell4,
3125
0
                                &hf_mac_nr_control_scell_act_deact_cell3,
3126
0
                                &hf_mac_nr_control_scell_act_deact_cell2,
3127
0
                                &hf_mac_nr_control_scell_act_deact_cell1,
3128
0
                                &hf_mac_nr_control_scell_act_deact_reserved,
3129
0
                                NULL
3130
0
                            };
3131
0
                            static int * const scell_act_deact_2_flags[] = {
3132
0
                                &hf_mac_nr_control_scell_act_deact_cell15,
3133
0
                                &hf_mac_nr_control_scell_act_deact_cell14,
3134
0
                                &hf_mac_nr_control_scell_act_deact_cell13,
3135
0
                                &hf_mac_nr_control_scell_act_deact_cell12,
3136
0
                                &hf_mac_nr_control_scell_act_deact_cell11,
3137
0
                                &hf_mac_nr_control_scell_act_deact_cell10,
3138
0
                                &hf_mac_nr_control_scell_act_deact_cell9,
3139
0
                                &hf_mac_nr_control_scell_act_deact_cell8,
3140
0
                                NULL
3141
0
                            };
3142
0
                            static int * const scell_act_deact_3_flags[] = {
3143
0
                                &hf_mac_nr_control_scell_act_deact_cell23,
3144
0
                                &hf_mac_nr_control_scell_act_deact_cell22,
3145
0
                                &hf_mac_nr_control_scell_act_deact_cell21,
3146
0
                                &hf_mac_nr_control_scell_act_deact_cell20,
3147
0
                                &hf_mac_nr_control_scell_act_deact_cell19,
3148
0
                                &hf_mac_nr_control_scell_act_deact_cell18,
3149
0
                                &hf_mac_nr_control_scell_act_deact_cell17,
3150
0
                                &hf_mac_nr_control_scell_act_deact_cell16,
3151
0
                                NULL
3152
0
                            };
3153
0
                            static int * const scell_act_deact_4_flags[] = {
3154
0
                                &hf_mac_nr_control_scell_act_deact_cell31,
3155
0
                                &hf_mac_nr_control_scell_act_deact_cell30,
3156
0
                                &hf_mac_nr_control_scell_act_deact_cell29,
3157
0
                                &hf_mac_nr_control_scell_act_deact_cell28,
3158
0
                                &hf_mac_nr_control_scell_act_deact_cell27,
3159
0
                                &hf_mac_nr_control_scell_act_deact_cell26,
3160
0
                                &hf_mac_nr_control_scell_act_deact_cell25,
3161
0
                                &hf_mac_nr_control_scell_act_deact_cell24,
3162
0
                                NULL
3163
0
                            };
3164
0
                            proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, scell_act_deact_1_flags, ENC_NA);
3165
0
                            offset++;
3166
0
                            proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, scell_act_deact_2_flags, ENC_NA);
3167
0
                            offset++;
3168
0
                            proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, scell_act_deact_3_flags, ENC_NA);
3169
0
                            offset++;
3170
0
                            proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, scell_act_deact_4_flags, ENC_NA);
3171
0
                            offset++;
3172
3173
0
                            write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo,
3174
0
                                                             "(SCell Act/Deact 4) ");
3175
0
                        }
3176
0
                        break;
3177
0
                    case SCELL_ACTIVATION_DEACTIVATION_1_LCID:
3178
0
                        {
3179
0
                            static int * const scell_act_deact_1_flags[] = {
3180
0
                                &hf_mac_nr_control_scell_act_deact_cell7,
3181
0
                                &hf_mac_nr_control_scell_act_deact_cell6,
3182
0
                                &hf_mac_nr_control_scell_act_deact_cell5,
3183
0
                                &hf_mac_nr_control_scell_act_deact_cell4,
3184
0
                                &hf_mac_nr_control_scell_act_deact_cell3,
3185
0
                                &hf_mac_nr_control_scell_act_deact_cell2,
3186
0
                                &hf_mac_nr_control_scell_act_deact_cell1,
3187
0
                                &hf_mac_nr_control_scell_act_deact_reserved,
3188
0
                                NULL
3189
0
                            };
3190
0
                            proto_tree_add_bitmask_list(subheader_tree, tvb, offset, 1, scell_act_deact_1_flags, ENC_NA);
3191
0
                            offset++;
3192
3193
0
                            write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo, "(SCell Act/Deact 1) ");
3194
0
                        }
3195
0
                        break;
3196
0
                    case LONG_DRX_COMMAND_LCID:
3197
                        /* Fixed size of zero bits */
3198
0
                        write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo, "(Long DRX) ");
3199
0
                        break;
3200
0
                    case DRX_COMMAND_LCID:
3201
0
                        write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo, "(DRX) ");
3202
0
                        break;
3203
0
                    case TIMING_ADVANCE_COMMAND_LCID:
3204
                        /* TAG ID (2 bits) */
3205
0
                        proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_timing_advance_tagid,
3206
0
                                                     tvb, offset, 1, ENC_BIG_ENDIAN, &ta_tag_id);
3207
3208
                        /* Timing Advance Command (6 bits) */
3209
0
                        proto_tree_add_item_ret_uint(subheader_tree, hf_mac_nr_control_timing_advance_command,
3210
0
                                                     tvb, offset, 1, ENC_BIG_ENDIAN, &ta_ta);
3211
0
                        offset++;
3212
3213
0
                        write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo,
3214
0
                                                 "(TAG=%u TA=%u) ", ta_tag_id, ta_ta);
3215
0
                        break;
3216
0
                    case UE_CONTENTION_RESOLUTION_IDENTITY_LCID:
3217
0
                        proto_tree_add_item(subheader_tree, hf_mac_nr_control_ue_contention_resolution_identity,
3218
0
                                            tvb, offset, 6, ENC_NA);
3219
0
                        offset += 6;
3220
0
                        write_pdu_label_and_info_literal(pdu_ti, subheader_ti, pinfo, "(Contention Resolution) ");
3221
0
                        break;
3222
0
                    case PADDING_LCID:
3223
0
                        {
3224
                            /* The rest of the PDU is padding */
3225
0
                            int pad_len = tvb_reported_length_remaining(tvb, offset);
3226
0
                            if (pad_len > 0)
3227
0
                                proto_tree_add_item(subheader_tree, hf_mac_nr_padding, tvb, offset, -1, ENC_NA);
3228
0
                            write_pdu_label_and_info(pdu_ti, subheader_ti, pinfo, "(Padding %u bytes) ", pad_len);
3229
                            /* Move to the end of the frame */
3230
0
                            offset = tvb_reported_length(tvb);
3231
0
                        }
3232
0
                        break;
3233
0
                }
3234
0
            }
3235
0
        }
3236
3237
        /* Set subheader extent here */
3238
0
        proto_item_set_end(subheader_ti, tvb, offset);
3239
3240
0
    } while (tvb_reported_length_remaining(tvb, offset));
3241
3242
0
    return offset;
3243
0
}
3244
3245
3246
/*****************************/
3247
/* Main dissection function. */
3248
static int dissect_mac_nr(tvbuff_t *tvb, packet_info *pinfo,
3249
                          proto_tree *tree, void* data _U_)
3250
0
{
3251
0
    proto_tree          *mac_nr_tree;
3252
0
    proto_item          *pdu_ti;
3253
0
    proto_tree          *context_tree;
3254
0
    proto_item          *context_ti, *ti;
3255
0
    int                  offset = 0;
3256
0
    struct mac_nr_info *p_mac_nr_info;
3257
3258
    /* Allocate and zero tap struct */
3259
0
    mac_3gpp_tap_info *tap_info = wmem_new0(wmem_file_scope(), mac_3gpp_tap_info);
3260
0
    tap_info->rat = MAC_RAT_NR;
3261
3262
    /* Set protocol name */
3263
0
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC-NR");
3264
3265
    /* Create protocol tree */
3266
0
    pdu_ti = proto_tree_add_item(tree, proto_mac_nr, tvb, offset, tvb_reported_length(tvb), ENC_NA);
3267
0
    proto_item_append_text(pdu_ti, " ");
3268
0
    mac_nr_tree = proto_item_add_subtree(pdu_ti, ett_mac_nr);
3269
3270
    /* Look for packet info! */
3271
0
    p_mac_nr_info = (mac_nr_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_mac_nr, 0);
3272
3273
    /* Can't dissect anything without it... */
3274
0
    if (p_mac_nr_info == NULL) {
3275
0
        proto_tree_add_expert_remaining(mac_nr_tree, pinfo, &ei_mac_nr_no_per_frame_data, tvb, offset);
3276
0
        return 0;
3277
0
    }
3278
3279
    /* Clear info column */
3280
0
    col_clear(pinfo->cinfo, COL_INFO);
3281
3282
    /* Restart this count */
3283
0
    s_number_of_rlc_pdus_shown = 0;
3284
3285
3286
    /*****************************************/
3287
    /* Show context information              */
3288
3289
    /* Create context root */
3290
0
    context_ti = proto_tree_add_string_format(mac_nr_tree, hf_mac_nr_context,
3291
0
                                              tvb, offset, 0, "", "Context");
3292
0
    context_tree = proto_item_add_subtree(context_ti, ett_mac_nr_context);
3293
0
    proto_item_set_generated(context_ti);
3294
3295
    /* Radio type */
3296
0
    ti = proto_tree_add_uint(context_tree, hf_mac_nr_context_radio_type,
3297
0
                             tvb, 0, 0, p_mac_nr_info->radioType);
3298
0
    proto_item_set_generated(ti);
3299
3300
    /* Direction */
3301
0
    ti = proto_tree_add_uint(context_tree, hf_mac_nr_context_direction,
3302
0
                             tvb, 0, 0, p_mac_nr_info->direction);
3303
0
    proto_item_set_generated(ti);
3304
3305
    /* RNTI type and value */
3306
0
    if (p_mac_nr_info->rntiType != NO_RNTI) {
3307
0
        ti = proto_tree_add_uint(context_tree, hf_mac_nr_context_rnti,
3308
0
                                 tvb, 0, 0, p_mac_nr_info->rnti);
3309
0
        proto_item_set_generated(ti);
3310
0
        proto_item_append_text(context_ti, " (RNTI=%u)", p_mac_nr_info->rnti);
3311
0
    }
3312
3313
0
    ti = proto_tree_add_uint(context_tree, hf_mac_nr_context_rnti_type,
3314
0
                             tvb, 0, 0, p_mac_nr_info->rntiType);
3315
0
    proto_item_set_generated(ti);
3316
3317
    /* UEId */
3318
0
    if (p_mac_nr_info->ueid != 0) {
3319
0
        ti = proto_tree_add_uint(context_tree, hf_mac_nr_context_ueid,
3320
0
                                 tvb, 0, 0, p_mac_nr_info->ueid);
3321
0
        proto_item_set_generated(ti);
3322
0
    }
3323
3324
0
    if (p_mac_nr_info->sfnSlotInfoPresent) {
3325
0
        ti = proto_tree_add_uint(context_tree, hf_mac_nr_context_sysframe_number,
3326
0
                                 tvb, 0, 0, p_mac_nr_info->sysframeNumber);
3327
0
        proto_item_set_generated(ti);
3328
0
        ti = proto_tree_add_uint(context_tree, hf_mac_nr_context_slot_number,
3329
0
                                 tvb, 0, 0, p_mac_nr_info->slotNumber);
3330
0
        proto_item_set_generated(ti);
3331
0
    }
3332
3333
0
    if (p_mac_nr_info->rntiType == C_RNTI || p_mac_nr_info->rntiType == CS_RNTI) {
3334
        /* Harqid */
3335
0
        ti = proto_tree_add_uint(context_tree, hf_mac_nr_context_harqid,
3336
0
                                tvb, 0, 0, p_mac_nr_info->harqid);
3337
0
        proto_item_set_generated(ti);
3338
3339
0
        if (p_mac_nr_info->direction == DIRECTION_UPLINK) {
3340
            /* Type 2 other */
3341
0
            ti = proto_tree_add_boolean(context_tree, hf_mac_nr_context_phr_type2_othercell,
3342
0
                                        tvb, 0, 0, p_mac_nr_info->phr_type2_othercell);
3343
0
            proto_item_set_generated(ti);
3344
0
        }
3345
0
    }
3346
3347
    /* Set context-info parts of tap struct */
3348
0
    tap_info->rnti = p_mac_nr_info->rnti;
3349
0
    tap_info->ueid = p_mac_nr_info->ueid;
3350
0
    tap_info->rntiType = p_mac_nr_info->rntiType;
3351
0
    tap_info->isPredefinedData = false;
3352
0
    tap_info->isPHYRetx =      false;  /* don't really know */
3353
0
    tap_info->crcStatusValid = false;  /* don't really know */
3354
0
    tap_info->direction = p_mac_nr_info->direction;
3355
3356
0
    tap_info->mac_time = pinfo->abs_ts;
3357
0
    tap_info->single_number_of_bytes = tvb_reported_length_remaining(tvb, offset);
3358
3359
    /* Dissect the MAC PDU itself. Format depends upon RNTI type. */
3360
0
    switch (p_mac_nr_info->rntiType) {
3361
3362
0
        case P_RNTI:
3363
            /* PCCH PDU */
3364
0
            dissect_pcch(tvb, pinfo, mac_nr_tree, pdu_ti, offset, p_mac_nr_info, tap_info);
3365
0
            break;
3366
3367
0
        case RA_RNTI:
3368
            /* RAR PDU */
3369
0
            dissect_rar(tvb, pinfo, mac_nr_tree, pdu_ti, offset, p_mac_nr_info, tap_info);
3370
0
            break;
3371
3372
0
        case MSGB_RNTI:
3373
            /* MSGB PDU */
3374
0
            dissect_msgb(tvb, pinfo, mac_nr_tree, pdu_ti, offset, p_mac_nr_info, tap_info);
3375
0
            break;
3376
3377
0
        case C_RNTI:
3378
0
        case CS_RNTI:
3379
            /* Can be UL-SCH or DL-SCH */
3380
0
            dissect_ulsch_or_dlsch(tvb, pinfo, mac_nr_tree, pdu_ti, offset,
3381
0
                                   p_mac_nr_info, tap_info);
3382
0
            break;
3383
3384
0
        case SI_RNTI:
3385
            /* BCCH over DL-SCH */
3386
0
            dissect_bcch(tvb, pinfo, mac_nr_tree, pdu_ti, offset,
3387
0
                         p_mac_nr_info, tap_info);
3388
0
            break;
3389
3390
0
        case NO_RNTI:
3391
            /* Must be BCCH over BCH... */
3392
0
            dissect_bcch(tvb, pinfo, mac_nr_tree, pdu_ti, offset,
3393
0
                         p_mac_nr_info, tap_info);
3394
0
            break;
3395
3396
0
        default:
3397
0
            break;
3398
0
    }
3399
3400
0
    tap_queue_packet(mac_nr_tap, pinfo, tap_info);
3401
3402
0
    return -1;
3403
0
}
3404
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_)
3408
0
{
3409
0
    unsigned     offset = 0;
3410
0
    mac_nr_info *p_mac_nr_info;
3411
0
    tvbuff_t    *mac_tvb;
3412
3413
    /* Needs to be at least as long as:
3414
       - the signature string
3415
       - fixed header bytes
3416
       - tag for data
3417
       - at least one byte of MAC PDU payload */
3418
0
    if (tvb_captured_length_remaining(tvb, offset) < (int)(strlen(MAC_NR_START_STRING)+3+2)) {
3419
0
        return false;
3420
0
    }
3421
3422
    /* OK, compare with signature string */
3423
0
    if (tvb_strneql(tvb, offset, MAC_NR_START_STRING, strlen(MAC_NR_START_STRING)) != 0) {
3424
0
        return false;
3425
0
    }
3426
0
    offset += (unsigned)strlen(MAC_NR_START_STRING);
3427
3428
    /* If redissecting, use previous info struct (if available) */
3429
0
    p_mac_nr_info = (mac_nr_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_mac_nr, 0);
3430
0
    if (p_mac_nr_info == NULL) {
3431
        /* Allocate new info struct for this frame */
3432
0
        p_mac_nr_info = wmem_new0(wmem_file_scope(), mac_nr_info);
3433
        /* Dissect the fields to populate p_mac_nr */
3434
0
        if(!dissect_mac_nr_context_fields(p_mac_nr_info, tvb, pinfo, tree, &offset)){
3435
0
            return true;
3436
0
        }
3437
        /* Store info in packet */
3438
0
        p_add_proto_data(wmem_file_scope(), pinfo, proto_mac_nr, 0, p_mac_nr_info);
3439
0
    }
3440
0
    else {
3441
0
        offset = tvb_reported_length(tvb) - p_mac_nr_info->length;
3442
0
    }
3443
3444
    /**************************************/
3445
    /* OK, now dissect as MAC NR          */
3446
3447
    /* Create tvb that starts at actual MAC PDU */
3448
0
    mac_tvb = tvb_new_subset_remaining(tvb, offset);
3449
0
    dissect_mac_nr(mac_tvb, pinfo, tree, NULL);
3450
3451
0
    return true;
3452
0
}
3453
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, unsigned *p_offset)
3458
0
{
3459
0
    unsigned offset = *p_offset;
3460
0
    uint8_t  tag = 0;
3461
3462
    /* Read fixed fields */
3463
0
    p_mac_nr_info->radioType = tvb_get_uint8(tvb, offset++);
3464
0
    p_mac_nr_info->direction = tvb_get_uint8(tvb, offset++);
3465
0
    p_mac_nr_info->rntiType = tvb_get_uint8(tvb, offset++);
3466
3467
    /* Read optional fields */
3468
0
    do {
3469
        /* Process next tag */
3470
0
        tag = tvb_get_uint8(tvb, offset++);
3471
0
        switch (tag) {
3472
0
            case MAC_NR_RNTI_TAG:
3473
0
                p_mac_nr_info->rnti = tvb_get_ntohs(tvb, offset);
3474
0
                offset += 2;
3475
0
                break;
3476
0
            case MAC_NR_UEID_TAG:
3477
0
                p_mac_nr_info->ueid = tvb_get_ntohs(tvb, offset);
3478
0
                offset += 2;
3479
0
                break;
3480
0
            case MAC_NR_HARQID:
3481
0
                p_mac_nr_info->harqid = tvb_get_uint8(tvb, offset);
3482
0
                offset++;
3483
0
                break;
3484
0
            case MAC_NR_FRAME_SUBFRAME_TAG:
3485
                /* deprecated */
3486
0
                offset += 2;
3487
0
                break;
3488
0
            case MAC_NR_PHR_TYPE2_OTHERCELL_TAG:
3489
0
                p_mac_nr_info->phr_type2_othercell = tvb_get_uint8(tvb, offset);
3490
0
                offset++;
3491
0
                break;
3492
0
            case MAC_NR_FRAME_SLOT_TAG:
3493
0
                p_mac_nr_info->sfnSlotInfoPresent = true;
3494
0
                p_mac_nr_info->sysframeNumber = tvb_get_ntohs(tvb, offset);
3495
0
                p_mac_nr_info->slotNumber = tvb_get_ntohs(tvb, offset+2);
3496
0
                offset += 4;
3497
0
                break;
3498
0
            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
0
                p_mac_nr_info->length = tvb_reported_length_remaining(tvb, offset);
3502
0
                continue;
3503
0
            default:
3504
                /* It must be a recognised tag */
3505
0
                {
3506
0
                    proto_item *ti;
3507
0
                    proto_tree *subtree;
3508
3509
0
                    col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC-NR");
3510
0
                    col_clear(pinfo->cinfo, COL_INFO);
3511
0
                    ti = proto_tree_add_item(tree, proto_mac_nr, tvb, offset, tvb_reported_length(tvb), ENC_NA);
3512
0
                    subtree = proto_item_add_subtree(ti, ett_mac_nr);
3513
0
                    proto_tree_add_expert(subtree, pinfo, &ei_mac_nr_unknown_udp_framing_tag,
3514
0
                                          tvb, offset-1, 1);
3515
0
                }
3516
0
                wmem_free(wmem_file_scope(), p_mac_nr_info);
3517
0
                return true;
3518
0
        }
3519
0
    } while (tag != MAC_NR_PAYLOAD_TAG);
3520
3521
    /* Pass out where offset is now */
3522
0
    *p_offset = offset;
3523
3524
0
    return true;
3525
0
}
3526
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_)
3529
0
{
3530
0
    const lcid_drb_mapping_t *o = (const lcid_drb_mapping_t *)orig;
3531
0
    lcid_drb_mapping_t       *d = (lcid_drb_mapping_t *)dest;
3532
3533
    /* Copy all items over */
3534
0
    d->lcid  = o->lcid;
3535
0
    d->drbid = o->drbid;
3536
0
    d->bearer_type_ul = o->bearer_type_ul;
3537
0
    d->bearer_type_dl = o->bearer_type_dl;
3538
3539
0
    return d;
3540
0
}
3541
3542
static void set_bearer_type(dynamic_lcid_drb_mapping_t *mapping, uint8_t rlcMode, uint8_t rlcSnLength, uint8_t direction)
3543
0
{
3544
    /* Point to field for appropriate direction */
3545
0
    rlc_bearer_type_t *type_var = (direction == DIRECTION_UPLINK) ?
3546
0
                                   &mapping->bearer_type_ul :
3547
0
                                   &mapping->bearer_type_dl;
3548
3549
0
    switch (rlcMode) {
3550
0
        case RLC_AM_MODE:
3551
0
            switch (rlcSnLength) {
3552
0
                case 12:
3553
0
                    *type_var = rlcAM12;
3554
0
                    break;
3555
0
                case 18:
3556
0
                    *type_var = rlcAM18;
3557
0
                    break;
3558
3559
0
                default:
3560
0
                    break;
3561
0
            }
3562
0
            break;
3563
0
        case RLC_UM_MODE:
3564
0
            switch (rlcSnLength) {
3565
0
                case 6:
3566
0
                    *type_var = rlcUM6;
3567
0
                    break;
3568
0
                case 12:
3569
0
                    *type_var = rlcUM12;
3570
0
                    break;
3571
3572
0
                default:
3573
0
                    break;
3574
0
            }
3575
0
            break;
3576
3577
0
        default:
3578
0
            break;
3579
0
    }
3580
0
}
3581
3582
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)
3585
0
{
3586
0
    ue_dynamic_drb_mappings_t *ue_mappings;
3587
0
    uint8_t lcid = 0;
3588
3589
    /* Check lcid range */
3590
0
    if (drb_mapping->lcid_present) {
3591
0
        lcid = drb_mapping->lcid;
3592
3593
        /* Ignore if LCID is out of range.  */
3594
0
        if ((lcid < 3) || (lcid > 32)) {
3595
0
            return;
3596
0
        }
3597
0
    }
3598
3599
    /* Look for existing UE entry */
3600
0
    ue_mappings = (ue_dynamic_drb_mappings_t *)g_hash_table_lookup(mac_nr_ue_bearers_hash,
3601
0
                                                                   GUINT_TO_POINTER((unsigned)drb_mapping->ueid));
3602
0
    if (!ue_mappings) {
3603
        /* If not found, create & add to table */
3604
0
        ue_mappings = wmem_new0(wmem_file_scope(), ue_dynamic_drb_mappings_t);
3605
0
        g_hash_table_insert(mac_nr_ue_bearers_hash,
3606
0
                            GUINT_TO_POINTER((unsigned)drb_mapping->ueid),
3607
0
                            ue_mappings);
3608
0
    }
3609
3610
    /* If lcid wasn't supplied, need to try to look up from drbid */
3611
0
    if ((lcid == 0) && (drb_mapping->rbid <= 32)) {
3612
0
        lcid = ue_mappings->drb_to_lcid_mappings[drb_mapping->rbid];
3613
0
    }
3614
0
    if (lcid == 0) {
3615
        /* Still no lcid - give up */
3616
0
        return;
3617
0
    }
3618
3619
    /* Set array entry */
3620
0
    ue_mappings->mapping[lcid].valid = true;
3621
0
    ue_mappings->mapping[lcid].drbid = drb_mapping->rbid;
3622
0
    ue_mappings->drb_to_lcid_mappings[drb_mapping->rbid] = lcid;
3623
3624
    /* Fill in available RLC info */
3625
0
    if (drb_mapping->rlcMode_present) {
3626
0
        if (drb_mapping->rlcUlSnLength_present) {
3627
0
            set_bearer_type(&ue_mappings->mapping[lcid], drb_mapping->rlcMode, drb_mapping->rlcUlSnLength, DIRECTION_UPLINK);
3628
0
        }
3629
0
        if (drb_mapping->rlcDlSnLength_present) {
3630
0
            set_bearer_type(&ue_mappings->mapping[lcid], drb_mapping->rlcMode, drb_mapping->rlcDlSnLength, DIRECTION_DOWNLINK);
3631
0
        }
3632
0
    }
3633
0
}
3634
3635
void set_mac_nr_srb3_in_use(uint16_t ueid)
3636
0
{
3637
0
    ue_dynamic_drb_mappings_t *ue_mappings;
3638
3639
    /* Look for existing UE entry */
3640
0
    ue_mappings = (ue_dynamic_drb_mappings_t *)g_hash_table_lookup(mac_nr_ue_bearers_hash,
3641
0
                                                                   GUINT_TO_POINTER(ueid));
3642
0
    if (!ue_mappings) {
3643
        /* If not found, create & add to table */
3644
0
        ue_mappings = wmem_new0(wmem_file_scope(), ue_dynamic_drb_mappings_t);
3645
0
        g_hash_table_insert(mac_nr_ue_bearers_hash,
3646
0
                            GUINT_TO_POINTER(ueid),
3647
0
                            ue_mappings);
3648
0
    }
3649
0
    ue_mappings->srb3_set = true;
3650
0
}
3651
3652
void set_mac_nr_srb4_in_use(uint16_t ueid)
3653
0
{
3654
0
    ue_dynamic_drb_mappings_t *ue_mappings;
3655
3656
    /* Look for existing UE entry */
3657
0
    ue_mappings = (ue_dynamic_drb_mappings_t *)g_hash_table_lookup(mac_nr_ue_bearers_hash,
3658
0
                                                                   GUINT_TO_POINTER(ueid));
3659
0
    if (!ue_mappings) {
3660
        /* If not found, create & add to table */
3661
0
        ue_mappings = wmem_new0(wmem_file_scope(), ue_dynamic_drb_mappings_t);
3662
0
        g_hash_table_insert(mac_nr_ue_bearers_hash,
3663
0
                            GUINT_TO_POINTER(ueid),
3664
0
                            ue_mappings);
3665
0
    }
3666
0
    ue_mappings->srb4_set = true;
3667
0
}
3668
3669
3670
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)
3673
0
{
3674
0
    return (mac_nr_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_mac_nr, 0);
3675
0
}
3676
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)
3679
0
{
3680
0
    p_add_proto_data(wmem_file_scope(), pinfo, proto_mac_nr, 0, p_mac_nr_info);
3681
0
}
3682
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)
3686
16
{
3687
16
    mac_nr_ue_bearers_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
3688
16
}
3689
3690
static void mac_nr_cleanup_protocol(void)
3691
0
{
3692
0
    g_hash_table_destroy(mac_nr_ue_bearers_hash);
3693
0
}
3694
3695
3696
3697
void proto_register_mac_nr(void)
3698
16
{
3699
16
    static hf_register_info hf[] =
3700
16
    {
3701
        /**********************************/
3702
        /* Items for decoding context     */
3703
16
        { &hf_mac_nr_context,
3704
16
            { "Context",
3705
16
              "mac-nr.context", FT_STRING, BASE_NONE, NULL, 0x0,
3706
16
              NULL, HFILL
3707
16
            }
3708
16
        },
3709
16
        { &hf_mac_nr_context_radio_type,
3710
16
            { "Radio Type",
3711
16
              "mac-nr.radio-type", FT_UINT8, BASE_DEC, VALS(radio_type_vals), 0x0,
3712
16
              NULL, HFILL
3713
16
            }
3714
16
        },
3715
16
        { &hf_mac_nr_context_direction,
3716
16
            { "Direction",
3717
16
              "mac-nr.direction", FT_UINT8, BASE_DEC, VALS(direction_vals), 0x0,
3718
16
              "Direction of message", HFILL
3719
16
            }
3720
16
        },
3721
16
        { &hf_mac_nr_context_rnti,
3722
16
            { "RNTI",
3723
16
              "mac-nr.rnti", FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3724
16
              "RNTI associated with message", HFILL
3725
16
            }
3726
16
        },
3727
16
        { &hf_mac_nr_context_rnti_type,
3728
16
            { "RNTI Type",
3729
16
              "mac-nr.rnti-type", FT_UINT8, BASE_DEC, VALS(rnti_type_vals), 0x0,
3730
16
              "Type of RNTI associated with message", HFILL
3731
16
            }
3732
16
        },
3733
16
        { &hf_mac_nr_context_ueid,
3734
16
            { "UEId",
3735
16
              "mac-nr.ueid", FT_UINT16, BASE_DEC, NULL, 0x0,
3736
16
              "User Equipment Identifier associated with message", HFILL
3737
16
            }
3738
16
        },
3739
16
        { &hf_mac_nr_context_sysframe_number,
3740
16
            { "System Frame Number",
3741
16
              "mac-nr.sfn", FT_UINT16, BASE_DEC, NULL, 0x0,
3742
16
              "System Frame Number associated with message", HFILL
3743
16
            }
3744
16
        },
3745
16
        { &hf_mac_nr_context_slot_number,
3746
16
            { "Slot",
3747
16
              "mac-nr.slot", FT_UINT16, BASE_DEC, NULL, 0x0,
3748
16
              "Slot number associated with message", HFILL
3749
16
            }
3750
16
        },
3751
16
        { &hf_mac_nr_context_harqid,
3752
16
            { "HarqId",
3753
16
              "mac-nr.harqid", FT_UINT8, BASE_DEC, NULL, 0x0,
3754
16
              "HARQ Identifier", HFILL
3755
16
            }
3756
16
        },
3757
16
        { &hf_mac_nr_context_bcch_transport_channel,
3758
16
            { "Transport channel",
3759
16
              "mac-nr.bcch-transport-channel", FT_UINT8, BASE_DEC, VALS(bcch_transport_channel_vals), 0x0,
3760
16
              "Transport channel BCCH data was carried on", HFILL
3761
16
            }
3762
16
        },
3763
16
        { &hf_mac_nr_context_phr_type2_othercell,
3764
16
            { "PHR Type2 other cell PHR",
3765
16
              "mac-nr.type2-other-cell", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3766
16
              NULL, HFILL
3767
16
            }
3768
16
        },
3769
3770
16
        { &hf_mac_nr_subheader,
3771
16
            { "Subheader",
3772
16
              "mac-nr.subheader", FT_STRING, BASE_NONE, NULL, 0x0,
3773
16
              NULL, HFILL
3774
16
            }
3775
16
        },
3776
16
        { &hf_mac_nr_subheader_reserved,
3777
16
            { "Reserved",
3778
16
              "mac-nr.subheader.reserved", FT_UINT8, BASE_HEX, NULL, 0x0,
3779
16
              NULL, HFILL
3780
16
            }
3781
16
        },
3782
16
        { &hf_mac_nr_subheader_f,
3783
16
            { "Format",
3784
16
              "mac-nr.subheader.f", FT_BOOLEAN, 8, TFS(&subheader_f_vals), 0x40,
3785
16
              "Format of subheader length field", HFILL
3786
16
            }
3787
16
        },
3788
16
        { &hf_mac_nr_subheader_length_1_byte,
3789
16
            { "SDU Length",
3790
16
              "mac-nr.subheader.sdu-length", FT_UINT8, BASE_DEC, NULL, 0x0,
3791
16
              NULL, HFILL
3792
16
            }
3793
16
        },
3794
16
        { &hf_mac_nr_subheader_length_2_bytes,
3795
16
            { "SDU Length",
3796
16
              "mac-nr.subheader.sdu-length", FT_UINT16, BASE_DEC, NULL, 0x0,
3797
16
              NULL, HFILL
3798
16
            }
3799
16
        },
3800
        /* Will be hidden, but useful for bi-directional filtering */
3801
16
        { &hf_mac_nr_lcid,
3802
16
            { "LCID",
3803
16
              "mac-nr.lcid", FT_UINT8, BASE_HEX, NULL, 0x3f,
3804
16
              "Logical Channel Identifier", HFILL
3805
16
            }
3806
16
        },
3807
16
        { &hf_mac_nr_ulsch_lcid,
3808
16
            { "LCID",
3809
16
              "mac-nr.ulsch.lcid", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &ulsch_lcid_vals_ext, 0x3f,
3810
16
              "UL-SCH Logical Channel Identifier", HFILL
3811
16
            }
3812
16
        },
3813
16
        { &hf_mac_nr_dlsch_lcid,
3814
16
            { "LCID",
3815
16
              "mac-nr.dlsch.lcid", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &dlsch_lcid_vals_ext, 0x3f,
3816
16
              "DL-SCH Logical Channel Identifier", HFILL
3817
16
            }
3818
16
        },
3819
16
        { &hf_mac_nr_dlsch_elcid_2oct,
3820
16
            { "eLCID2oct",
3821
16
              "mac-nr.dlsch.elcid-2oct", FT_UINT16, BASE_DEC, NULL, 0x0,
3822
16
              NULL, HFILL
3823
16
            }
3824
16
        },
3825
16
        { &hf_mac_nr_ulsch_elcid_2oct,
3826
16
            { "eLCID2oct",
3827
16
              "mac-nr.dlsch.elcid-2oct", FT_UINT16, BASE_DEC, NULL, 0x0,
3828
16
              NULL, HFILL
3829
16
            }
3830
16
        },
3831
16
        { &hf_mac_nr_dlsch_elcid_1oct,
3832
16
            { "eLCID",
3833
16
              "mac-nr.dlsch.elcid-1oct", FT_UINT8,BASE_DEC|BASE_EXT_STRING,&dlsch_elcid_vals_ext, 0x0,
3834
16
              NULL, HFILL
3835
16
            }
3836
16
        },
3837
16
        { &hf_mac_nr_ulsch_elcid_1oct,
3838
16
            { "eLCID",
3839
16
              "mac-nr.dlsch.elcid-1oct", FT_UINT8,BASE_DEC|BASE_EXT_STRING,&ulsch_elcid_vals_ext, 0x0,
3840
16
              NULL, HFILL
3841
16
            }
3842
16
        },
3843
16
        { &hf_mac_nr_ulsch_sdu,
3844
16
            { "UL-SCH SDU",
3845
16
              "mac-nr.ulsch.sdu", FT_BYTES, BASE_NONE, NULL, 0x0,
3846
16
              NULL, HFILL
3847
16
            }
3848
16
        },
3849
16
        { &hf_mac_nr_dlsch_sdu,
3850
16
            { "DL-SCH SDU",
3851
16
              "mac-nr.dlsch.sdu", FT_BYTES, BASE_NONE, NULL, 0x0,
3852
16
              NULL, HFILL
3853
16
            }
3854
16
        },
3855
16
        { &hf_mac_nr_bcch_pdu,
3856
16
            { "BCCH PDU",
3857
16
              "mac-nr.bcch.pdu", FT_BYTES, BASE_NONE, NULL, 0x0,
3858
16
              NULL, HFILL
3859
16
            }
3860
16
        },
3861
16
        { &hf_mac_nr_pcch_pdu,
3862
16
            { "PCCH PDU",
3863
16
              "mac-nr.pcch.pdu", FT_BYTES, BASE_NONE, NULL, 0x0,
3864
16
              NULL, HFILL
3865
16
            }
3866
16
        },
3867
3868
3869
        /*********************************/
3870
        /* RAR fields                    */
3871
16
        { &hf_mac_nr_rar,
3872
16
            { "RAR",
3873
16
              "mac-nr.rar", FT_NONE, BASE_NONE, NULL, 0x0,
3874
16
              NULL, HFILL
3875
16
            }
3876
16
        },
3877
16
        { &hf_mac_nr_rar_e,
3878
16
            { "Extension",
3879
16
              "mac-nr.rar.e", FT_BOOLEAN, 8, TFS(&rar_ext_vals), 0x80,
3880
16
              NULL, HFILL
3881
16
            }
3882
16
        },
3883
16
        { &hf_mac_nr_rar_t,
3884
16
            { "Type",
3885
16
              "mac-nr.rar.t", FT_BOOLEAN, 8, TFS(&rar_type_vals), 0x40,
3886
16
              NULL, HFILL
3887
16
            }
3888
16
        },
3889
16
        { &hf_mac_nr_rar_reserved,
3890
16
            { "Reserved",
3891
16
              "mac-nr.rar.reserved", FT_UINT8, BASE_DEC, NULL, 0x30,
3892
16
              NULL, HFILL
3893
16
            }
3894
16
        },
3895
16
        { &hf_mac_nr_rar_reserved1,
3896
16
            { "Reserved",
3897
16
              "mac-nr.rar.reserved", FT_UINT8, BASE_DEC, NULL, 0x80,
3898
16
              NULL, HFILL
3899
16
            }
3900
16
        },
3901
3902
16
        { &hf_mac_nr_rar_subheader,
3903
16
            { "Subheader",
3904
16
              "mac-nr.rar.subheader", FT_STRING, BASE_NONE, NULL, 0x0,
3905
16
              NULL, HFILL
3906
16
            }
3907
16
        },
3908
16
        { &hf_mac_nr_rar_bi,
3909
16
            { "Backoff Indicator",
3910
16
              "mac-nr.rar.bi", FT_UINT8, BASE_DEC, VALS(rar_bi_vals), 0x0f,
3911
16
              NULL, HFILL
3912
16
            }
3913
16
        },
3914
16
        { &hf_mac_nr_rar_rapid,
3915
16
            { "RAPID",
3916
16
              "mac-nr.rar.rapid", FT_UINT8, BASE_DEC, NULL, 0x3f,
3917
16
              NULL, HFILL
3918
16
            }
3919
16
        },
3920
16
        { &hf_mac_nr_rar_ta,
3921
16
            { "Timing Advance",
3922
16
              "mac-nr.rar.ta", FT_UINT16, BASE_DEC, NULL, 0x7ff8,
3923
16
              NULL, HFILL
3924
16
            }
3925
16
        },
3926
3927
16
        { &hf_mac_nr_rar_grant,
3928
16
            { "Grant",
3929
16
              "mac-nr.rar.grant", FT_UINT32, BASE_HEX, NULL, 0x07ffffff,
3930
16
              "UL Grant details", HFILL
3931
16
            }
3932
16
        },
3933
16
        { &hf_mac_nr_rar_grant_hopping,
3934
16
            { "Frequency hopping flag",
3935
16
              "mac-nr.rar.grant.hopping", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x04000000,
3936
16
              NULL, HFILL
3937
16
            }
3938
16
        },
3939
16
        { &hf_mac_nr_rar_grant_fra,
3940
16
            { "Msg3 PUSCH frequency resource allocation",
3941
16
              "mac-nr.rar.grant.fra", FT_UINT32, BASE_DEC, NULL, 0x03fff000,
3942
16
              NULL, HFILL
3943
16
            }
3944
16
        },
3945
16
        { &hf_mac_nr_rar_grant_tsa,
3946
16
            { "Msg3 PUSCH time resource allocation",
3947
16
              "mac-nr.rar.grant.tsa", FT_UINT32, BASE_DEC, NULL, 0x00000f00,
3948
16
              NULL, HFILL
3949
16
            }
3950
16
        },
3951
16
        { &hf_mac_nr_rar_grant_mcs,
3952
16
            { "MCS",
3953
16
              "mac-nr.rar.grant.mcs", FT_UINT32, BASE_DEC, NULL, 0x000000f0,
3954
16
              NULL, HFILL
3955
16
            }
3956
16
        },
3957
16
        { &hf_mac_nr_rar_grant_tcsp,
3958
16
            { "TPC command for Msg3 PUSCH",
3959
16
              "mac-nr.rar.grant.tcsp", FT_UINT32, BASE_DEC, VALS(tpc_command_vals), 0x0000000e,
3960
16
              NULL, HFILL
3961
16
            }
3962
16
        },
3963
16
        { &hf_mac_nr_rar_grant_csi,
3964
16
            { "CSI request",
3965
16
              "mac-nr.rar.grant.csi", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
3966
16
              NULL, HFILL
3967
16
            }
3968
16
        },
3969
16
        { &hf_mac_nr_rar_temp_crnti,
3970
16
            { "Temporary C-RNTI",
3971
16
              "mac-nr.rar.temp_crnti", FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3972
16
              NULL, HFILL
3973
16
            }
3974
16
        },
3975
3976
        /* MSGB */
3977
16
        { &hf_mac_nr_msgb,
3978
16
            { "MSGB",
3979
16
              "mac-nr.msgb", FT_NONE, BASE_NONE, NULL, 0x0,
3980
16
              NULL, HFILL
3981
16
            }
3982
16
        },
3983
16
        { &hf_mac_nr_msgb_subheader,
3984
16
            { "Subheader",
3985
16
              "mac-nr.msgb.subheader", FT_STRING, BASE_NONE, NULL, 0x0,
3986
16
              NULL, HFILL
3987
16
            }
3988
16
        },
3989
16
        { &hf_mac_nr_msgb_e,
3990
16
            { "Extension",
3991
16
              "mac-nr.msgb.e", FT_BOOLEAN, 8, TFS(&rar_ext_vals), 0x80,
3992
16
              NULL, HFILL
3993
16
            }
3994
16
        },
3995
16
        { &hf_mac_nr_msgb_t1,
3996
16
            { "t1",
3997
16
              "mac-nr.msgb.t1", FT_BOOLEAN, 8, TFS(&msgb_t1_vals), 0x40,
3998
16
              NULL, HFILL
3999
16
            }
4000
16
        },
4001
16
        { &hf_mac_nr_msgb_t2,
4002
16
            { "t2",
4003
16
              "mac-nr.msgb.t2", FT_BOOLEAN, 8, TFS(&msgb_t2_vals), 0x20,
4004
16
              NULL, HFILL
4005
16
            }
4006
16
        },
4007
16
        { &hf_mac_nr_msgb_s,
4008
16
            { "s",
4009
16
              "mac-nr.msgb.s", FT_BOOLEAN, 8, TFS(&msgb_s_vals), 0x10,
4010
16
              "MAC SDU indicator", HFILL
4011
16
            }
4012
16
        },
4013
4014
16
        { &hf_mac_nr_msgb_reserved,
4015
16
            { "Reserved",
4016
16
              "mac-nr.msgb.reserved", FT_UINT8, BASE_DEC, NULL, 0x10,
4017
16
              NULL, HFILL
4018
16
            }
4019
16
        },
4020
16
        { &hf_mac_nr_msgb_reserved2,
4021
16
            { "Reserved",
4022
16
              "mac-nr.msgb.reserved", FT_UINT8, BASE_DEC, NULL, 0x0f,
4023
16
              NULL, HFILL
4024
16
            }
4025
16
        },
4026
16
        { &hf_mac_nr_msgb_reserved3,
4027
16
            { "Reserved",
4028
16
              "mac-nr.msgb.reserved", FT_UINT8, BASE_DEC, NULL, 0x80,
4029
16
              NULL, HFILL
4030
16
            }
4031
16
        },
4032
16
        { &hf_mac_nr_msgb_ta_command,
4033
16
            { "Timing Advance Command",
4034
16
              "mac-nr.msgb.ta-command", FT_UINT16, BASE_DEC, NULL, 0x0fff,
4035
16
              NULL, HFILL
4036
16
            }
4037
16
        },
4038
        /* TODO: vals from 38.213 [6] */
4039
16
        { &hf_mac_nr_msgb_channelaccess_cpext,
4040
16
            { "ChannelAccess-CPext",
4041
16
              "mac-nr.msgb.channelaccess-cpext", FT_UINT8, BASE_DEC, NULL, 0x60,
4042
16
              NULL, HFILL
4043
16
            }
4044
16
        },
4045
        /* TODO: vals from 38.213 [6] */
4046
16
        { &hf_mac_nr_msgb_tpc,
4047
16
            { "TPC",
4048
16
              "mac-nr.msgb.tpc", FT_UINT8, BASE_DEC, NULL, 0x18,
4049
16
              "TPC command for the PUCCH resource containing HARQ feedback for MSGB", HFILL
4050
16
            }
4051
16
        },
4052
16
        { &hf_mac_nr_msgb_harq_feedback_timing_indicator,
4053
16
            { "HARQ Feedback Timing Indicator",
4054
16
              "mac-nr.msgb.harq-feedback-timing-indicator", FT_UINT8, BASE_DEC, NULL, 0x07,
4055
16
              NULL, HFILL
4056
16
            }
4057
16
        },
4058
16
        { &hf_mac_nr_msgb_pucch_resource_indicator,
4059
16
            { "PUCCH Resource Indicator",
4060
16
              "mac-nr.msgb.pucch-resource-indicator", FT_UINT8, BASE_DEC, NULL, 0xf0,
4061
16
              NULL, HFILL
4062
16
            }
4063
16
        },
4064
4065
16
        { &hf_mac_nr_padding,
4066
16
            { "Padding",
4067
16
              "mac-nr.padding", FT_BYTES, BASE_NONE, NULL, 0x0,
4068
16
              NULL, HFILL
4069
16
            }
4070
16
        },
4071
4072
16
        { &hf_mac_nr_control_crnti,
4073
16
            { "C-RNTI",
4074
16
              "mac-nr.control.crnti", FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
4075
16
              NULL, HFILL
4076
16
            }
4077
16
        },
4078
16
        { &hf_mac_nr_control_ue_contention_resolution_identity,
4079
16
            { "UE Contention Resolution Identity",
4080
16
              "mac-nr.control.ue-contention-resolution.identity", FT_BYTES, BASE_NONE, NULL, 0x0,
4081
16
              NULL, HFILL
4082
16
            }
4083
16
        },
4084
16
        { &hf_mac_nr_control_timing_advance_tagid,
4085
16
            { "TAG ID",
4086
16
              "mac-nr.control.timing-advance.tag-id", FT_UINT8, BASE_DEC, NULL, 0xc0,
4087
16
              NULL, HFILL
4088
16
            }
4089
16
        },
4090
16
        { &hf_mac_nr_control_timing_advance_command,
4091
16
            { "Timing Advance Command",
4092
16
              "mac-nr.control.timing-advance.command", FT_UINT8, BASE_DEC, NULL, 0x3f,
4093
16
              NULL, HFILL
4094
16
            }
4095
16
        },
4096
16
        { &hf_mac_nr_control_se_phr_reserved,
4097
16
            { "Reserved",
4098
16
              "mac-nr.control.se-phr.reserved", FT_UINT8, BASE_HEX, NULL, 0xc0,
4099
16
              NULL, HFILL
4100
16
            }
4101
16
        },
4102
16
        { &hf_mac_nr_control_se_phr_ph,
4103
16
            { "Power Headroom",
4104
16
              "mac-nr.control.se-phr.ph", FT_UINT8, BASE_CUSTOM, CF_FUNC(mac_nr_phr_fmt), 0x3f,
4105
16
              NULL, HFILL
4106
16
            }
4107
16
        },
4108
16
        { &hf_mac_nr_control_se_phr_pcmax_f_c,
4109
16
            { "Pcmax,c,f",
4110
16
              "mac-nr.control.se-phr.pcmax_f_c", FT_UINT8, BASE_CUSTOM, CF_FUNC(mac_nr_pcmax_f_c_fmt), 0x3f,
4111
16
              NULL, HFILL
4112
16
            }
4113
16
        },
4114
4115
16
        { &hf_mac_nr_control_recommended_bit_rate_query_lcid,
4116
16
            { "LCID",
4117
16
              "mac-nr.control.recommended-bit-rate-query.lcid", FT_UINT8, BASE_DEC, NULL, 0xfc,
4118
16
              NULL, HFILL
4119
16
            }
4120
16
        },
4121
16
        { &hf_mac_nr_control_recommended_bit_rate_query_dir,
4122
16
            { "Direction",
4123
16
              "mac-nr.control.recommended-bit-rate-query.dir", FT_BOOLEAN, 8, TFS(&tfs_uplink_downlink), 0x02,
4124
16
              NULL, HFILL
4125
16
            }
4126
16
        },
4127
16
        { &hf_mac_nr_control_recommended_bit_rate_query_bit_rate,
4128
16
            { "Bit Rate",
4129
16
              "mac-nr.control.recommended-bit-rate-query.bit-rate", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &bit_rate_vals_ext, 0x01f8,
4130
16
              NULL, HFILL
4131
16
            }
4132
16
        },
4133
16
        { &hf_mac_nr_control_recommended_bit_rate_query_reserved,
4134
16
            { "Reserved",
4135
16
              "mac-nr.control.recommended-bit-rate-query.reserved", FT_UINT8, BASE_DEC, NULL, 0x07,
4136
16
              NULL, HFILL
4137
16
            }
4138
16
        },
4139
4140
16
        { &hf_mac_nr_control_me_phr_c7_flag,
4141
16
            { "C7",
4142
16
              "mac-nr.control.me-phr.c7", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
4143
16
              "SCellIndex 7 PHR report flag", HFILL
4144
16
            }
4145
16
        },
4146
16
        { &hf_mac_nr_control_me_phr_c6_flag,
4147
16
            { "C6",
4148
16
              "mac-nr.control.me-phr.c6", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
4149
16
              "SCellIndex 6 PHR report flag", HFILL
4150
16
            }
4151
16
        },
4152
16
        { &hf_mac_nr_control_me_phr_c5_flag,
4153
16
            { "C5",
4154
16
              "mac-nr.control.me-phr.c5", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
4155
16
              "SCellIndex 5 PHR report flag", HFILL
4156
16
            }
4157
16
        },
4158
16
        { &hf_mac_nr_control_me_phr_c4_flag,
4159
16
            { "C4",
4160
16
              "mac-nr.control.me-phr.c4", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
4161
16
              "SCellIndex 4 PHR report flag", HFILL
4162
16
            }
4163
16
        },
4164
16
        { &hf_mac_nr_control_me_phr_c3_flag,
4165
16
            { "C3",
4166
16
              "mac-nr.control.me-phr.c3", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
4167
16
              "SCellIndex 3 PHR report flag", HFILL
4168
16
            }
4169
16
        },
4170
16
        { &hf_mac_nr_control_me_phr_c2_flag,
4171
16
            { "C2",
4172
16
              "mac-nr.control.me-phr.c2", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
4173
16
              "SCellIndex 2 PHR report flag", HFILL
4174
16
            }
4175
16
        },
4176
16
        { &hf_mac_nr_control_me_phr_c1_flag,
4177
16
            { "C1",
4178
16
              "mac-nr.control.me-phr.c1", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
4179
16
              "SCellIndex 1 PHR report flag", HFILL
4180
16
            }
4181
16
        },
4182
16
        { &hf_mac_nr_control_me_phr_c15_flag,
4183
16
            { "C15",
4184
16
              "mac-nr.control.me-phr.c15", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
4185
16
              "SCellIndex 15 PHR report flag", HFILL
4186
16
            }
4187
16
        },
4188
16
        { &hf_mac_nr_control_me_phr_c14_flag,
4189
16
            { "C14",
4190
16
              "mac-nr.control.me-phr.c14", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
4191
16
              "SCellIndex 14 PHR report flag", HFILL
4192
16
            }
4193
16
        },
4194
16
        { &hf_mac_nr_control_me_phr_c13_flag,
4195
16
            { "C13",
4196
16
              "mac-nr.control.me-phr.c13", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
4197
16
              "SCellIndex 13 PHR report flag", HFILL
4198
16
            }
4199
16
        },
4200
16
        { &hf_mac_nr_control_me_phr_c12_flag,
4201
16
            { "C12",
4202
16
              "mac-nr.control.me-phr.c12", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
4203
16
              "SCellIndex 12 PHR report flag", HFILL
4204
16
            }
4205
16
        },
4206
16
        { &hf_mac_nr_control_me_phr_c11_flag,
4207
16
            { "C11",
4208
16
              "mac-nr.control.me-phr.c11", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
4209
16
              "SCellIndex 11 PHR report flag", HFILL
4210
16
            }
4211
16
        },
4212
16
        { &hf_mac_nr_control_me_phr_c10_flag,
4213
16
            { "C10",
4214
16
              "mac-nr.control.me-phr.c10", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
4215
16
              "SCellIndex 10 PHR report flag", HFILL
4216
16
            }
4217
16
        },
4218
16
        { &hf_mac_nr_control_me_phr_c9_flag,
4219
16
            { "C9",
4220
16
              "mac-nr.control.me-phr.c9", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
4221
16
              "SCellIndex 9 PHR report flag", HFILL
4222
16
            }
4223
16
        },
4224
16
        { &hf_mac_nr_control_me_phr_c8_flag,
4225
16
            { "C8",
4226
16
              "mac-nr.control.me-phr.c8", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
4227
16
              "SCellIndex 8 PHR report flag", HFILL
4228
16
            }
4229
16
        },
4230
16
        { &hf_mac_nr_control_me_phr_c23_flag,
4231
16
            { "C23",
4232
16
              "mac-nr.control.me-phr.c23", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
4233
16
              "SCellIndex 23 PHR report flag", HFILL
4234
16
            }
4235
16
        },
4236
16
        { &hf_mac_nr_control_me_phr_c22_flag,
4237
16
            { "C22",
4238
16
              "mac-nr.control.me-phr.c22", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
4239
16
              "SCellIndex 22 PHR report flag", HFILL
4240
16
            }
4241
16
        },
4242
16
        { &hf_mac_nr_control_me_phr_c21_flag,
4243
16
            { "C21",
4244
16
              "mac-nr.control.me-phr.c21", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
4245
16
              "SCellIndex 21 PHR report flag", HFILL
4246
16
            }
4247
16
        },
4248
16
        { &hf_mac_nr_control_me_phr_c20_flag,
4249
16
            { "C20",
4250
16
              "mac-nr.control.me-phr.c20", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
4251
16
              "SCellIndex 20 PHR report flag", HFILL
4252
16
            }
4253
16
        },
4254
16
        { &hf_mac_nr_control_me_phr_c19_flag,
4255
16
            { "C19",
4256
16
              "mac-nr.control.me-phr.c19", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
4257
16
              "SCellIndex 19 PHR report flag", HFILL
4258
16
            }
4259
16
        },
4260
16
        { &hf_mac_nr_control_me_phr_c18_flag,
4261
16
            { "C18",
4262
16
              "mac-nr.control.me-phr.c18", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
4263
16
              "SCellIndex 18 PHR report flag", HFILL
4264
16
            }
4265
16
        },
4266
16
        { &hf_mac_nr_control_me_phr_c17_flag,
4267
16
            { "C17",
4268
16
              "mac-nr.control.me-phr.c17", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
4269
16
              "SCellIndex 17 PHR report flag", HFILL
4270
16
            }
4271
16
        },
4272
16
        { &hf_mac_nr_control_me_phr_c16_flag,
4273
16
            { "C16",
4274
16
              "mac-nr.control.me-phr.c16", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
4275
16
              "SCellIndex 16 PHR report flag", HFILL
4276
16
            }
4277
16
        },
4278
16
        { &hf_mac_nr_control_me_phr_c31_flag,
4279
16
            { "C31",
4280
16
              "mac-nr.control.me-phr.c31", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
4281
16
              "SCellIndex 31 PHR report flag", HFILL
4282
16
            }
4283
16
        },
4284
16
        { &hf_mac_nr_control_me_phr_c30_flag,
4285
16
            { "C30",
4286
16
              "mac-nr.control.me-phr.c30", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
4287
16
              "SCellIndex 30 PHR report flag", HFILL
4288
16
            }
4289
16
        },
4290
16
        { &hf_mac_nr_control_me_phr_c29_flag,
4291
16
            { "C29",
4292
16
              "mac-nr.control.me-phr.c29", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
4293
16
              "SCellIndex 29 PHR report flag", HFILL
4294
16
            }
4295
16
        },
4296
16
        { &hf_mac_nr_control_me_phr_c28_flag,
4297
16
            { "C28",
4298
16
              "mac-nr.control.me-phr.c28", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
4299
16
              "SCellIndex 28 PHR report flag", HFILL
4300
16
            }
4301
16
        },
4302
16
        { &hf_mac_nr_control_me_phr_c27_flag,
4303
16
            { "C27",
4304
16
              "mac-nr.control.me-phr.c27", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
4305
16
              "SCellIndex 27 PHR report flag", HFILL
4306
16
            }
4307
16
        },
4308
16
        { &hf_mac_nr_control_me_phr_c26_flag,
4309
16
            { "C26",
4310
16
              "mac-nr.control.me-phr.c26", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
4311
16
              "SCellIndex 26 PHR report flag", HFILL
4312
16
            }
4313
16
        },
4314
16
        { &hf_mac_nr_control_me_phr_c25_flag,
4315
16
            { "C25",
4316
16
              "mac-nr.control.me-phr.c25", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
4317
16
              "SCellIndex 25 PHR report flag", HFILL
4318
16
            }
4319
16
        },
4320
16
        { &hf_mac_nr_control_me_phr_c24_flag,
4321
16
            { "C24",
4322
16
              "mac-nr.control.me-phr.c24", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
4323
16
              "SCellIndex 24 PHR report flag", HFILL
4324
16
            }
4325
16
        },
4326
16
        { &hf_mac_nr_control_me_phr_entry,
4327
16
            { "Entry",
4328
16
              "mac-nr.control.me.phr.entry", FT_STRING, BASE_NONE, NULL, 0x0,
4329
16
              NULL, HFILL
4330
16
            }
4331
16
        },
4332
16
        { &hf_mac_nr_control_me_phr_reserved,
4333
16
            { "Reserved",
4334
16
              "mac-nr.control.me-phr.reserved", FT_BOOLEAN, 8, NULL, 0x01,
4335
16
              NULL, HFILL
4336
16
            }
4337
16
        },
4338
16
        { &hf_mac_nr_control_me_phr_p,
4339
16
            { "P",
4340
16
              "mac-nr.control.me-phr.p", FT_BOOLEAN, 8, TFS(&power_backoff_affects_power_management_vals), 0x80,
4341
16
              NULL, HFILL
4342
16
            }
4343
16
        },
4344
16
        { &hf_mac_nr_control_me_phr_v,
4345
16
            { "V",
4346
16
              "mac-nr.control.me-phr.v", FT_BOOLEAN, 8, TFS(&phr_source_vals), 0x40,
4347
16
              NULL, HFILL
4348
16
            }
4349
16
        },
4350
16
        { &hf_mac_nr_control_me_phr_ph_type2_spcell,
4351
16
            { "Power Headroom, (Type2, SpCell)",
4352
16
              "mac-nr.control.me-phr.ph", FT_UINT8, BASE_DEC, NULL, 0x3f,
4353
16
              NULL, HFILL
4354
16
            }
4355
16
        },
4356
16
        { &hf_mac_nr_control_me_phr_ph_type1_pcell,
4357
16
            { "Power Headroom (Type1, PCell)",
4358
16
              "mac-nr.control.me-phr.ph.type1-pcell", FT_UINT8, BASE_CUSTOM, CF_FUNC(mac_nr_phr_fmt), 0x3f,
4359
16
              NULL, HFILL
4360
16
            }
4361
16
        },
4362
4363
16
        { &hf_mac_nr_control_me_phr_ph_c31,
4364
16
            { "PH for SCellIndex 31",
4365
16
              "mac-nr.control.me-phr.ph.c31", FT_UINT8, BASE_DEC, NULL, 0x3f,
4366
16
              NULL, HFILL
4367
16
            }
4368
16
        },
4369
16
        { &hf_mac_nr_control_me_phr_ph_c30,
4370
16
            { "PH for SCellIndex 30",
4371
16
              "mac-nr.control.me-phr.ph.c30", FT_UINT8, BASE_DEC, NULL, 0x3f,
4372
16
              NULL, HFILL
4373
16
            }
4374
16
        },
4375
16
        { &hf_mac_nr_control_me_phr_ph_c29,
4376
16
            { "PH for SCellIndex 29",
4377
16
              "mac-nr.control.me-phr.ph.c29", FT_UINT8, BASE_DEC, NULL, 0x3f,
4378
16
              NULL, HFILL
4379
16
            }
4380
16
        },
4381
16
        { &hf_mac_nr_control_me_phr_ph_c28,
4382
16
            { "PH for SCellIndex 28",
4383
16
              "mac-nr.control.me-phr.ph.c28", FT_UINT8, BASE_DEC, NULL, 0x3f,
4384
16
              NULL, HFILL
4385
16
            }
4386
16
        },
4387
16
        { &hf_mac_nr_control_me_phr_ph_c27,
4388
16
            { "PH for SCellIndex 27",
4389
16
              "mac-nr.control.me-phr.ph.c27", FT_UINT8, BASE_DEC, NULL, 0x3f,
4390
16
              NULL, HFILL
4391
16
            }
4392
16
        },
4393
16
        { &hf_mac_nr_control_me_phr_ph_c26,
4394
16
            { "PH for SCellIndex 26",
4395
16
              "mac-nr.control.me-phr.ph.c26", FT_UINT8, BASE_DEC, NULL, 0x3f,
4396
16
              NULL, HFILL
4397
16
            }
4398
16
        },
4399
16
        { &hf_mac_nr_control_me_phr_ph_c25,
4400
16
            { "PH for SCellIndex 25",
4401
16
              "mac-nr.control.me-phr.ph.c25", FT_UINT8, BASE_DEC, NULL, 0x3f,
4402
16
              NULL, HFILL
4403
16
            }
4404
16
        },
4405
16
        { &hf_mac_nr_control_me_phr_ph_c24,
4406
16
            { "PH for SCellIndex 24",
4407
16
              "mac-nr.control.me-phr.ph.c24", FT_UINT8, BASE_DEC, NULL, 0x3f,
4408
16
              NULL, HFILL
4409
16
            }
4410
16
        },
4411
16
        { &hf_mac_nr_control_me_phr_ph_c23,
4412
16
            { "PH for SCellIndex 23",
4413
16
              "mac-nr.control.me-phr.ph.c23", FT_UINT8, BASE_DEC, NULL, 0x3f,
4414
16
              NULL, HFILL
4415
16
            }
4416
16
        },
4417
16
        { &hf_mac_nr_control_me_phr_ph_c22,
4418
16
            { "PH for SCellIndex 22",
4419
16
              "mac-nr.control.me-phr.ph.c22", FT_UINT8, BASE_DEC, NULL, 0x3f,
4420
16
              NULL, HFILL
4421
16
            }
4422
16
        },
4423
16
        { &hf_mac_nr_control_me_phr_ph_c21,
4424
16
            { "PH for SCellIndex 21",
4425
16
              "mac-nr.control.me-phr.ph.c21", FT_UINT8, BASE_DEC, NULL, 0x3f,
4426
16
              NULL, HFILL
4427
16
            }
4428
16
        },
4429
16
        { &hf_mac_nr_control_me_phr_ph_c20,
4430
16
            { "PH for SCellIndex 20",
4431
16
              "mac-nr.control.me-phr.ph.c20", FT_UINT8, BASE_DEC, NULL, 0x3f,
4432
16
              NULL, HFILL
4433
16
            }
4434
16
        },
4435
16
        { &hf_mac_nr_control_me_phr_ph_c19,
4436
16
            { "PH for SCellIndex 19",
4437
16
              "mac-nr.control.me-phr.ph.c19", FT_UINT8, BASE_DEC, NULL, 0x3f,
4438
16
              NULL, HFILL
4439
16
            }
4440
16
        },
4441
16
        { &hf_mac_nr_control_me_phr_ph_c18,
4442
16
            { "PH for SCellIndex 18",
4443
16
              "mac-nr.control.me-phr.ph.c18", FT_UINT8, BASE_DEC, NULL, 0x3f,
4444
16
              NULL, HFILL
4445
16
            }
4446
16
        },
4447
16
        { &hf_mac_nr_control_me_phr_ph_c17,
4448
16
            { "PH for SCellIndex 17",
4449
16
              "mac-nr.control.me-phr.ph.c17", FT_UINT8, BASE_DEC, NULL, 0x3f,
4450
16
              NULL, HFILL
4451
16
            }
4452
16
        },
4453
16
        { &hf_mac_nr_control_me_phr_ph_c16,
4454
16
            { "PH for SCellIndex 16",
4455
16
              "mac-nr.control.me-phr.ph.c16", FT_UINT8, BASE_DEC, NULL, 0x3f,
4456
16
              NULL, HFILL
4457
16
            }
4458
16
        },
4459
16
        { &hf_mac_nr_control_me_phr_ph_c15,
4460
16
            { "PH for SCellIndex 15",
4461
16
              "mac-nr.control.me-phr.ph.c15", FT_UINT8, BASE_DEC, NULL, 0x3f,
4462
16
              NULL, HFILL
4463
16
            }
4464
16
        },
4465
16
        { &hf_mac_nr_control_me_phr_ph_c14,
4466
16
            { "PH for SCellIndex 14",
4467
16
              "mac-nr.control.me-phr.ph.c14", FT_UINT8, BASE_DEC, NULL, 0x3f,
4468
16
              NULL, HFILL
4469
16
            }
4470
16
        },
4471
16
        { &hf_mac_nr_control_me_phr_ph_c13,
4472
16
            { "PH for SCellIndex 13",
4473
16
              "mac-nr.control.me-phr.ph.c13", FT_UINT8, BASE_DEC, NULL, 0x3f,
4474
16
              NULL, HFILL
4475
16
            }
4476
16
        },
4477
16
        { &hf_mac_nr_control_me_phr_ph_c12,
4478
16
            { "PH for SCellIndex 12",
4479
16
              "mac-nr.control.me-phr.ph.c12", FT_UINT8, BASE_DEC, NULL, 0x3f,
4480
16
              NULL, HFILL
4481
16
            }
4482
16
        },
4483
16
        { &hf_mac_nr_control_me_phr_ph_c11,
4484
16
            { "PH for SCellIndex 11",
4485
16
              "mac-nr.control.me-phr.ph.c11", FT_UINT8, BASE_DEC, NULL, 0x3f,
4486
16
              NULL, HFILL
4487
16
            }
4488
16
        },
4489
16
        { &hf_mac_nr_control_me_phr_ph_c10,
4490
16
            { "PH for SCellIndex 10",
4491
16
              "mac-nr.control.me-phr.ph.c10", FT_UINT8, BASE_DEC, NULL, 0x3f,
4492
16
              NULL, HFILL
4493
16
            }
4494
16
        },
4495
16
        { &hf_mac_nr_control_me_phr_ph_c9,
4496
16
            { "PH for SCellIndex 9",
4497
16
              "mac-nr.control.me-phr.ph.c9", FT_UINT8, BASE_DEC, NULL, 0x3f,
4498
16
              NULL, HFILL
4499
16
            }
4500
16
        },
4501
16
        { &hf_mac_nr_control_me_phr_ph_c8,
4502
16
            { "PH for SCellIndex 8",
4503
16
              "mac-nr.control.me-phr.ph.c8", FT_UINT8, BASE_DEC, NULL, 0x3f,
4504
16
              NULL, HFILL
4505
16
            }
4506
16
        },
4507
16
        { &hf_mac_nr_control_me_phr_ph_c7,
4508
16
            { "PH for SCellIndex 7",
4509
16
              "mac-nr.control.me-phr.ph.c7", FT_UINT8, BASE_DEC, NULL, 0x3f,
4510
16
              NULL, HFILL
4511
16
            }
4512
16
        },
4513
16
        { &hf_mac_nr_control_me_phr_ph_c6,
4514
16
            { "PH for SCellIndex 6",
4515
16
              "mac-nr.control.me-phr.ph.c6", FT_UINT8, BASE_DEC, NULL, 0x3f,
4516
16
              NULL, HFILL
4517
16
            }
4518
16
        },
4519
16
        { &hf_mac_nr_control_me_phr_ph_c5,
4520
16
            { "PH for SCellIndex 5",
4521
16
              "mac-nr.control.me-phr.ph.c5", FT_UINT8, BASE_DEC, NULL, 0x3f,
4522
16
              NULL, HFILL
4523
16
            }
4524
16
        },
4525
16
        { &hf_mac_nr_control_me_phr_ph_c4,
4526
16
            { "PH for SCellIndex 4",
4527
16
              "mac-nr.control.me-phr.ph.c4", FT_UINT8, BASE_DEC, NULL, 0x3f,
4528
16
              NULL, HFILL
4529
16
            }
4530
16
        },
4531
16
        { &hf_mac_nr_control_me_phr_ph_c3,
4532
16
            { "PH for SCellIndex 3",
4533
16
              "mac-nr.control.me-phr.ph.c3", FT_UINT8, BASE_DEC, NULL, 0x3f,
4534
16
              NULL, HFILL
4535
16
            }
4536
16
        },
4537
16
        { &hf_mac_nr_control_me_phr_ph_c2,
4538
16
            { "PH for SCellIndex 2",
4539
16
              "mac-nr.control.me-phr.ph.c2", FT_UINT8, BASE_DEC, NULL, 0x3f,
4540
16
              NULL, HFILL
4541
16
            }
4542
16
        },
4543
16
        { &hf_mac_nr_control_me_phr_ph_c1,
4544
16
            { "PH for SCellIndex 1",
4545
16
              "mac-nr.control.me-phr.ph.c1", FT_UINT8, BASE_DEC, NULL, 0x3f,
4546
16
              NULL, HFILL
4547
16
            }
4548
16
        },
4549
16
        { &hf_mac_nr_control_me_phr_reserved_2,
4550
16
            { "Reserved",
4551
16
              "mac-nr.control.me-phr.reserved", FT_BOOLEAN, 8, NULL, 0xc0,
4552
16
              NULL, HFILL
4553
16
            }
4554
16
        },
4555
16
        { &hf_mac_nr_control_me_phr_pcmax_f_c_type2_spcell,
4556
16
            { "Pcmax,f,c",
4557
16
              "mac-nr.control.me-phr.type2-spcell", FT_UINT8, BASE_DEC, NULL, 0x3f,
4558
16
              NULL, HFILL
4559
16
            }
4560
16
        },
4561
16
        { &hf_mac_nr_control_me_phr_pcmax_f_c_type1_pcell,
4562
16
            { "Pcmax,f,c",
4563
16
              "mac-nr.control.me-phr.type1-pcell", FT_UINT8, BASE_CUSTOM, CF_FUNC(mac_nr_pcmax_f_c_fmt), 0x3f,
4564
16
              NULL, HFILL
4565
16
            }
4566
16
        },
4567
16
        { &hf_mac_nr_control_me_phr_pcmax_f_c_typeX,
4568
16
            { "Pcmax,f,c",
4569
16
              "mac-nr.control.me-phr.typeX", FT_UINT8, BASE_DEC, NULL, 0x3f,
4570
16
              NULL, HFILL
4571
16
            }
4572
16
        },
4573
4574
16
        { &hf_mac_nr_control_recommended_bit_rate_lcid,
4575
16
            { "LCID",
4576
16
              "mac-nr.control.recommended-bit-rate.lcid", FT_UINT8, BASE_DEC, NULL, 0xfc,
4577
16
              NULL, HFILL
4578
16
            }
4579
16
        },
4580
16
        { &hf_mac_nr_control_recommended_bit_rate_dir,
4581
16
            { "Direction",
4582
16
              "mac-nr.control.recommended-bit-rate.dir", FT_BOOLEAN, 8, TFS(&tfs_uplink_downlink), 0x02,
4583
16
              NULL, HFILL
4584
16
            }
4585
16
        },
4586
16
        { &hf_mac_nr_control_recommended_bit_rate_bit_rate,
4587
16
            { "Bit Rate",
4588
16
              "mac-nr.control.recommended-bit-rate.bit-rate", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &bit_rate_vals_ext, 0x01f8,
4589
16
              NULL, HFILL
4590
16
            }
4591
16
        },
4592
16
        { &hf_mac_nr_control_recommended_bit_rate_reserved,
4593
16
            { "Reserved",
4594
16
              "mac-nr.control.recommended-bit-rate.reserved", FT_UINT8, BASE_DEC, NULL, 0x07,
4595
16
              NULL, HFILL
4596
16
            }
4597
16
        },
4598
4599
16
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_ad,
4600
16
            { "Reserved",
4601
16
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.ad", FT_BOOLEAN, 8, TFS(&activation_deactivation_vals), 0x80,
4602
16
              NULL, HFILL
4603
16
            }
4604
16
        },
4605
16
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_serving_cell_id,
4606
16
            { "Serving Cell ID",
4607
16
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4608
16
              NULL, HFILL
4609
16
            }
4610
16
        },
4611
16
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_bwp_id,
4612
16
            { "BWP ID",
4613
16
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4614
16
              NULL, HFILL
4615
16
            }
4616
16
        },
4617
16
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_reserved_2,
4618
16
            { "Reserved",
4619
16
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0xf0,
4620
16
              NULL, HFILL
4621
16
            }
4622
16
        },
4623
16
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_sp_zp_rs_resource_set_id,
4624
16
            { "SP ZP CSI-RS resource set ID",
4625
16
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.sp-zp-rs-resource-set-id", FT_UINT8, BASE_DEC, NULL, 0x0f,
4626
16
              NULL, HFILL
4627
16
            }
4628
16
        },
4629
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_reserved,
4630
16
            { "Reserved",
4631
16
              "mac-nr.control.pucch-spatial-rel-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
4632
16
              NULL, HFILL
4633
16
            }
4634
16
        },
4635
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_serving_cell_id,
4636
16
            { "Serving Cell ID",
4637
16
              "mac-nr.control.pucch-spatial-rel-act-deact.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4638
16
              NULL, HFILL
4639
16
            }
4640
16
        },
4641
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_bwp_id,
4642
16
            { "BWP ID",
4643
16
              "mac-nr.control.pucch-spatial-rel-act-deact.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4644
16
              NULL, HFILL
4645
16
            }
4646
16
        },
4647
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_pucch_resource_id,
4648
16
            { "PUCCH Resource ID",
4649
16
              "mac-nr.control.pucch-spatial-rel-act-deact.pucch-resource-id", FT_UINT8, BASE_DEC, NULL, 0x7f,
4650
16
              NULL, HFILL
4651
16
            }
4652
16
        },
4653
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s8,
4654
16
            { "PUCCH Spatial Relation Info 8",
4655
16
              "mac-nr.control.pucch-spatial-rel-act-deact.s8", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
4656
16
              NULL, HFILL
4657
16
            }
4658
16
        },
4659
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s7,
4660
16
            { "PUCCH Spatial Relation Info 7",
4661
16
              "mac-nr.control.pucch-spatial-rel-act-deact.s7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
4662
16
              NULL, HFILL
4663
16
            }
4664
16
        },
4665
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s6,
4666
16
            { "PUCCH Spatial Relation Info 6",
4667
16
              "mac-nr.control.pucch-spatial-rel-act-deact.s6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
4668
16
              NULL, HFILL
4669
16
            }
4670
16
        },
4671
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s5,
4672
16
            { "PUCCH Spatial Relation Info 5",
4673
16
              "mac-nr.control.pucch-spatial-rel-act-deact.s5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
4674
16
              NULL, HFILL
4675
16
            }
4676
16
        },
4677
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s4,
4678
16
            { "PUCCH Spatial Relation Info 4",
4679
16
              "mac-nr.control.pucch-spatial-rel-act-deact.s4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
4680
16
              NULL, HFILL
4681
16
            }
4682
16
        },
4683
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s3,
4684
16
            { "PUCCH Spatial Relation Info 3",
4685
16
              "mac-nr.control.pucch-spatial-rel-act-deact.s3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
4686
16
              NULL, HFILL
4687
16
            }
4688
16
        },
4689
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s2,
4690
16
            { "PUCCH Spatial Relation Info 2",
4691
16
              "mac-nr.control.pucch-spatial-rel-act-deact.s2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
4692
16
              NULL, HFILL
4693
16
            }
4694
16
        },
4695
16
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s1,
4696
16
            { "PUCCH Spatial Relation Info 1",
4697
16
              "mac-nr.control.pucch-spatial-rel-act-deact.s1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
4698
16
              NULL, HFILL
4699
16
            }
4700
16
        },
4701
16
        { &hf_mac_nr_control_sp_srs_act_deact_ad,
4702
16
            { "A/D",
4703
16
              "mac-nr.control.sp-srs-act-deact.ad", FT_BOOLEAN, 8, TFS(&activation_deactivation_vals), 0x80,
4704
16
              NULL, HFILL
4705
16
            }
4706
16
        },
4707
16
        { &hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_cell_id,
4708
16
            { "SRS Resource Set's Cell ID",
4709
16
              "mac-nr.control.sp-srs-act-deact.srs-resource-set-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4710
16
              NULL, HFILL
4711
16
            }
4712
16
        },
4713
16
        { &hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_bwp_id,
4714
16
            { "SRS Resource Set's BWP ID",
4715
16
              "mac-nr.control.sp-srs-act-deact.srs-resource-set-bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4716
16
              NULL, HFILL
4717
16
            }
4718
16
        },
4719
16
        { &hf_mac_nr_control_sp_srs_act_deact_reserved,
4720
16
            { "Reserved",
4721
16
              "mac-nr.control.sp-srs-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x00,
4722
16
              NULL, HFILL
4723
16
            }
4724
16
        },
4725
16
        { &hf_mac_nr_control_sp_srs_act_deact_c,
4726
16
            { "C",
4727
16
              "mac-nr.control.sp-srs-act-deact.c", FT_BOOLEAN, 8, TFS(&c_vals), 0x20,
4728
16
              NULL, HFILL
4729
16
            }
4730
16
        },
4731
16
        { &hf_mac_nr_control_sp_srs_act_deact_sul,
4732
16
            { "SUL",
4733
16
              "mac-nr.control.sp-srs-act-deact.sul", FT_BOOLEAN, 8, TFS(&sul_vals), 0x10,
4734
16
              NULL, HFILL
4735
16
            }
4736
16
        },
4737
16
        { &hf_mac_nr_control_sp_srs_act_deact_sp_srs_resource_set_id,
4738
16
            { "SP SRS Resource Set ID",
4739
16
              "mac-nr.control.sp-srs-act-deact.sp-srs-resource-set-id", FT_UINT8, BASE_DEC, NULL, 0x0f,
4740
16
              NULL, HFILL
4741
16
            }
4742
16
        },
4743
16
        { &hf_mac_nr_control_sp_srs_act_deact_f,
4744
16
            { "F",
4745
16
              "mac-nr.control.sp-srs-act-deact.f", FT_BOOLEAN, 8, TFS(&sp_srs_act_deact_f_vals), 0x80,
4746
16
              NULL, HFILL
4747
16
            }
4748
16
        },
4749
16
        { &hf_mac_nr_control_sp_srs_act_deact_resource_id,
4750
16
            { "Resource ID",
4751
16
              "mac-nr.control.sp-srs-act-deact.resource-id", FT_UINT8, BASE_DEC, NULL, 0x7f,
4752
16
              NULL, HFILL
4753
16
            }
4754
16
        },
4755
16
        { &hf_mac_nr_control_sp_srs_act_deact_resource_id_ssb,
4756
16
            { "Resource ID",
4757
16
              "mac-nr.control.sp-srs-act-deact.resource-id", FT_UINT8, BASE_DEC, NULL, 0x3f,
4758
16
              NULL, HFILL
4759
16
            }
4760
16
        },
4761
4762
16
        { &hf_mac_nr_control_sp_srs_act_deact_resource_serving_cell_id,
4763
16
            { "Resource Serving Cell ID",
4764
16
              "mac-nr.control.sp-srs-act-deact.resource-serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4765
16
              NULL, HFILL
4766
16
            }
4767
16
        },
4768
16
        { &hf_mac_nr_control_sp_srs_act_deact_resource_bwp_id,
4769
16
            { "Resource BWP ID",
4770
16
              "mac-nr.control.sp-srs-act-deact.resource-bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4771
16
              NULL, HFILL
4772
16
            }
4773
16
        },
4774
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_reserved,
4775
16
            { "Reserved",
4776
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
4777
16
              NULL, HFILL
4778
16
            }
4779
16
        },
4780
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_serving_cell_id,
4781
16
            { "Serving Cell ID",
4782
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4783
16
              NULL, HFILL
4784
16
            }
4785
16
        },
4786
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_bwp_id,
4787
16
            { "BWP ID",
4788
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4789
16
              NULL, HFILL
4790
16
            }
4791
16
        },
4792
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s7,
4793
16
            { "Semi-Persistent CSI report configuration 7",
4794
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
4795
16
              NULL, HFILL
4796
16
            }
4797
16
        },
4798
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s6,
4799
16
            { "Semi-Persistent CSI report configuration 6",
4800
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
4801
16
              NULL, HFILL
4802
16
            }
4803
16
        },
4804
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s5,
4805
16
            { "Semi-Persistent CSI report configuration 5",
4806
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
4807
16
              NULL, HFILL
4808
16
            }
4809
16
        },
4810
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s4,
4811
16
            { "Semi-Persistent CSI report configuration 4",
4812
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
4813
16
              NULL, HFILL
4814
16
            }
4815
16
        },
4816
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s3,
4817
16
            { "Semi-Persistent CSI report configuration 3",
4818
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
4819
16
              NULL, HFILL
4820
16
            }
4821
16
        },
4822
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s2,
4823
16
            { "Semi-Persistent CSI report configuration 2",
4824
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
4825
16
              NULL, HFILL
4826
16
            }
4827
16
        },
4828
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s1,
4829
16
            { "Semi-Persistent CSI report configuration 1",
4830
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
4831
16
              NULL, HFILL
4832
16
            }
4833
16
        },
4834
16
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s0,
4835
16
            { "Semi-Persistent CSI report configuration 0",
4836
16
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s0", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
4837
16
              NULL, HFILL
4838
16
            }
4839
16
        },
4840
16
        { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_serving_cell_id,
4841
16
            { "Serving Cell ID",
4842
16
              "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0xf8,
4843
16
              NULL, HFILL
4844
16
            }
4845
16
        },
4846
16
        { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_coreset_id,
4847
16
            { "CORESET ID",
4848
16
              "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.coreset-id", FT_UINT16, BASE_DEC, NULL, 0x0780,
4849
16
              NULL, HFILL
4850
16
            }
4851
16
        },
4852
16
        { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_tci_state_id,
4853
16
            { "TCI State ID",
4854
16
              "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.tci-state-id", FT_UINT8, BASE_DEC, NULL, 0x7f,
4855
16
              NULL, HFILL
4856
16
            }
4857
16
        },
4858
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_reserved,
4859
16
            { "Reserved",
4860
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
4861
16
              NULL, HFILL
4862
16
            }
4863
16
        },
4864
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_serving_cell_id,
4865
16
            { "Serving Cell ID",
4866
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4867
16
              NULL, HFILL
4868
16
            }
4869
16
        },
4870
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_bwp_id,
4871
16
            { "BWP ID",
4872
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4873
16
              NULL, HFILL
4874
16
            }
4875
16
        },
4876
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t7,
4877
16
            { "TCI state N+7",
4878
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
4879
16
              NULL, HFILL
4880
16
            }
4881
16
        },
4882
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t6,
4883
16
            { "TCI state N+6",
4884
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
4885
16
              NULL, HFILL
4886
16
            }
4887
16
        },
4888
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t5,
4889
16
            { "TCI state N+5",
4890
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
4891
16
              NULL, HFILL
4892
16
            }
4893
16
        },
4894
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t4,
4895
16
            { "TCI state N+4",
4896
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
4897
16
              NULL, HFILL
4898
16
            }
4899
16
        },
4900
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t3,
4901
16
            { "TCI state N+3",
4902
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
4903
16
              NULL, HFILL
4904
16
            }
4905
16
        },
4906
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t2,
4907
16
            { "TCI state N+2",
4908
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
4909
16
              NULL, HFILL
4910
16
            }
4911
16
        },
4912
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t1,
4913
16
            { "TCI state N+1",
4914
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
4915
16
              NULL, HFILL
4916
16
            }
4917
16
        },
4918
16
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t0,
4919
16
            { "TCI state N",
4920
16
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t0", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
4921
16
              NULL, HFILL
4922
16
            }
4923
16
        },
4924
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_reserved,
4925
16
            { "Reserved",
4926
16
              "mac-nr.control.aper-csi-trigger-state-subselect.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
4927
16
              NULL, HFILL
4928
16
            }
4929
16
        },
4930
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_serving_cell_id,
4931
16
            { "Serving Cell ID",
4932
16
              "mac-nr.control.aper-csi-trigger-state-subselect.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4933
16
              NULL, HFILL
4934
16
            }
4935
16
        },
4936
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_bwp_id,
4937
16
            { "BWP ID",
4938
16
              "mac-nr.control.aper-csi-trigger-state-subselect.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4939
16
              NULL, HFILL
4940
16
            }
4941
16
        },
4942
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t7,
4943
16
            { "Aperiodic trigger state N+7",
4944
16
              "mac-nr.control.aper-csi-trigger-state-subselect.t7", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x80,
4945
16
              NULL, HFILL
4946
16
            }
4947
16
        },
4948
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t6,
4949
16
            { "Aperiodic trigger state N+6",
4950
16
              "mac-nr.control.aper-csi-trigger-state-subselect.t6", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x40,
4951
16
              NULL, HFILL
4952
16
            }
4953
16
        },
4954
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t5,
4955
16
            { "Aperiodic trigger state N+5",
4956
16
              "mac-nr.control.aper-csi-trigger-state-subselect.t5", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x20,
4957
16
              NULL, HFILL
4958
16
            }
4959
16
        },
4960
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t4,
4961
16
            { "Aperiodic trigger state N+4",
4962
16
              "mac-nr.control.aper-csi-trigger-state-subselect.t4", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x10,
4963
16
              NULL, HFILL
4964
16
            }
4965
16
        },
4966
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t3,
4967
16
            { "Aperiodic trigger state N+3",
4968
16
              "mac-nr.control.aper-csi-trigger-state-subselect.t3", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x08,
4969
16
              NULL, HFILL
4970
16
            }
4971
16
        },
4972
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t2,
4973
16
            { "Aperiodic trigger state N+2",
4974
16
              "mac-nr.control.aper-csi-trigger-state-subselect.t2", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x04,
4975
16
              NULL, HFILL
4976
16
            }
4977
16
        },
4978
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t1,
4979
16
            { "Aperiodic trigger state N+1",
4980
16
              "mac-nr.control.aper-csi-trigger-state-subselect.t1", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x02,
4981
16
              NULL, HFILL
4982
16
            }
4983
16
        },
4984
16
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t0,
4985
16
            { "Aperiodic trigger state N",
4986
16
              "mac-nr.control.aper-csi-trigger-state-subselect.t0", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x01,
4987
16
              NULL, HFILL
4988
16
            }
4989
16
        },
4990
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_ad,
4991
16
            { "A/D",
4992
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.ad", FT_BOOLEAN, 8, TFS(&activation_deactivation_vals), 0x80,
4993
16
              NULL, HFILL
4994
16
            }
4995
16
        },
4996
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_serving_cell_id,
4997
16
            { "Serving Cell ID",
4998
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4999
16
              NULL, HFILL
5000
16
            }
5001
16
        },
5002
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_bwp_id,
5003
16
            { "BWP ID",
5004
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
5005
16
              NULL, HFILL
5006
16
            }
5007
16
        },
5008
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved,
5009
16
            { "Reserved",
5010
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0xe0,
5011
16
              NULL, HFILL
5012
16
            }
5013
16
        },
5014
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_im,
5015
16
            { "IM",
5016
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.im", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5017
16
              NULL, HFILL
5018
16
            }
5019
16
        },
5020
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_rs_res_set_id,
5021
16
            { "SP CSI-RS resource set ID",
5022
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.sp-csi-rs-res-set-id", FT_UINT8, BASE_DEC, NULL, 0x0f,
5023
16
              NULL, HFILL
5024
16
            }
5025
16
        },
5026
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved2,
5027
16
            { "Reserved",
5028
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0xf0,
5029
16
              NULL, HFILL
5030
16
            }
5031
16
        },
5032
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_im_res_set_id,
5033
16
            { "SP CSI-IM resource set ID",
5034
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.sp-csi-im-res-set-id", FT_UINT8, BASE_DEC, NULL, 0x0f,
5035
16
              NULL, HFILL
5036
16
            }
5037
16
        },
5038
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved3,
5039
16
            { "Reserved",
5040
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
5041
16
              NULL, HFILL
5042
16
            }
5043
16
        },
5044
16
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_tci_state_id,
5045
16
            { "TCI State ID",
5046
16
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.tci-state-id", FT_UINT8, BASE_DEC, NULL, 0x7f,
5047
16
              NULL, HFILL
5048
16
            }
5049
16
        },
5050
16
        { &hf_mac_nr_control_dupl_act_deact_drb7,
5051
16
            { "DRB 7",
5052
16
              "mac-nr.control.dupl-act-deact.drb7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5053
16
              NULL, HFILL
5054
16
            }
5055
16
        },
5056
16
        { &hf_mac_nr_control_dupl_act_deact_drb6,
5057
16
            { "DRB 6",
5058
16
              "mac-nr.control.dupl-act-deact.drb6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5059
16
              NULL, HFILL
5060
16
            }
5061
16
        },
5062
16
        { &hf_mac_nr_control_dupl_act_deact_drb5,
5063
16
            { "DRB 5",
5064
16
              "mac-nr.control.dupl-act-deact.drb5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5065
16
              NULL, HFILL
5066
16
            }
5067
16
        },
5068
16
        { &hf_mac_nr_control_dupl_act_deact_drb4,
5069
16
            { "DRB 4",
5070
16
              "mac-nr.control.dupl-act-deact.drb4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5071
16
              NULL, HFILL
5072
16
            }
5073
16
        },
5074
16
        { &hf_mac_nr_control_dupl_act_deact_drb3,
5075
16
            { "DRB 3",
5076
16
              "mac-nr.control.dupl-act-deact.drb3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5077
16
              NULL, HFILL
5078
16
            }
5079
16
        },
5080
16
        { &hf_mac_nr_control_dupl_act_deact_drb2,
5081
16
            { "DRB 2",
5082
16
              "mac-nr.control.dupl-act-deact.drb2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5083
16
              NULL, HFILL
5084
16
            }
5085
16
        },
5086
16
        { &hf_mac_nr_control_dupl_act_deact_drb1,
5087
16
            { "DRB 1",
5088
16
              "mac-nr.control.dupl-act-deact.drb1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5089
16
              NULL, HFILL
5090
16
            }
5091
16
        },
5092
16
        { &hf_mac_nr_control_dupl_act_deact_reserved,
5093
16
            { "Reserved",
5094
16
              "mac-nr.control.dupl-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x01,
5095
16
              NULL, HFILL
5096
16
            }
5097
16
        },
5098
16
        { &hf_mac_nr_control_scell_act_deact_cell7,
5099
16
            { "Cell 7",
5100
16
              "mac-nr.control.scell-act-deact.cell7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5101
16
              NULL, HFILL
5102
16
            }
5103
16
        },
5104
16
        { &hf_mac_nr_control_scell_act_deact_cell6,
5105
16
            { "Cell 6",
5106
16
              "mac-nr.control.scell-act-deact.cell6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5107
16
              NULL, HFILL
5108
16
            }
5109
16
        },
5110
16
        { &hf_mac_nr_control_scell_act_deact_cell5,
5111
16
            { "Cell 5",
5112
16
              "mac-nr.control.scell-act-deact.cell5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5113
16
              NULL, HFILL
5114
16
            }
5115
16
        },
5116
16
        { &hf_mac_nr_control_scell_act_deact_cell4,
5117
16
            { "Cell 4",
5118
16
              "mac-nr.control.scell-act-deact.cell4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5119
16
              NULL, HFILL
5120
16
            }
5121
16
        },
5122
16
        { &hf_mac_nr_control_scell_act_deact_cell3,
5123
16
            { "Cell 3",
5124
16
              "mac-nr.control.scell-act-deact.cell3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5125
16
              NULL, HFILL
5126
16
            }
5127
16
        },
5128
16
        { &hf_mac_nr_control_scell_act_deact_cell2,
5129
16
            { "Cell 2",
5130
16
              "mac-nr.control.scell-act-deact.cell2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5131
16
              NULL, HFILL
5132
16
            }
5133
16
        },
5134
16
        { &hf_mac_nr_control_scell_act_deact_cell1,
5135
16
            { "Cell 1",
5136
16
              "mac-nr.control.scell-act-deact.cell1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5137
16
              NULL, HFILL
5138
16
            }
5139
16
        },
5140
16
        { &hf_mac_nr_control_scell_act_deact_reserved,
5141
16
            { "Reserved",
5142
16
              "mac-nr.control.scell-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x01,
5143
16
              NULL, HFILL
5144
16
            }
5145
16
        },
5146
16
        { &hf_mac_nr_control_scell_act_deact_cell15,
5147
16
            { "Cell 15",
5148
16
              "mac-nr.control.scell-act-deact.cell15", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5149
16
              NULL, HFILL
5150
16
            }
5151
16
        },
5152
16
        { &hf_mac_nr_control_scell_act_deact_cell14,
5153
16
            { "Cell 14",
5154
16
              "mac-nr.control.scell-act-deact.cell14", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5155
16
              NULL, HFILL
5156
16
            }
5157
16
        },
5158
16
        { &hf_mac_nr_control_scell_act_deact_cell13,
5159
16
            { "Cell 13",
5160
16
              "mac-nr.control.scell-act-deact.cell13", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5161
16
              NULL, HFILL
5162
16
            }
5163
16
        },
5164
16
        { &hf_mac_nr_control_scell_act_deact_cell12,
5165
16
            { "Cell 12",
5166
16
              "mac-nr.control.scell-act-deact.cell12", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5167
16
              NULL, HFILL
5168
16
            }
5169
16
        },
5170
16
        { &hf_mac_nr_control_scell_act_deact_cell11,
5171
16
            { "Cell 11",
5172
16
              "mac-nr.control.scell-act-deact.cell11", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5173
16
              NULL, HFILL
5174
16
            }
5175
16
        },
5176
16
        { &hf_mac_nr_control_scell_act_deact_cell10,
5177
16
            { "Cell 10",
5178
16
              "mac-nr.control.scell-act-deact.cell10", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5179
16
              NULL, HFILL
5180
16
            }
5181
16
        },
5182
16
        { &hf_mac_nr_control_scell_act_deact_cell9,
5183
16
            { "Cell 9",
5184
16
              "mac-nr.control.scell-act-deact.cell9", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5185
16
              NULL, HFILL
5186
16
            }
5187
16
        },
5188
16
        { &hf_mac_nr_control_scell_act_deact_cell8,
5189
16
            { "Cell 8",
5190
16
              "mac-nr.control.scell-act-deact.cell8", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
5191
16
              NULL, HFILL
5192
16
            }
5193
16
        },
5194
16
        { &hf_mac_nr_control_scell_act_deact_cell23,
5195
16
            { "Cell 23",
5196
16
              "mac-nr.control.scell-act-deact.cell23", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5197
16
              NULL, HFILL
5198
16
            }
5199
16
        },
5200
16
        { &hf_mac_nr_control_scell_act_deact_cell22,
5201
16
            { "Cell 22",
5202
16
              "mac-nr.control.scell-act-deact.cell22", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5203
16
              NULL, HFILL
5204
16
            }
5205
16
        },
5206
16
        { &hf_mac_nr_control_scell_act_deact_cell21,
5207
16
            { "Cell 21",
5208
16
              "mac-nr.control.scell-act-deact.cell21", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5209
16
              NULL, HFILL
5210
16
            }
5211
16
        },
5212
16
        { &hf_mac_nr_control_scell_act_deact_cell20,
5213
16
            { "Cell 20",
5214
16
              "mac-nr.control.scell-act-deact.cell20", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5215
16
              NULL, HFILL
5216
16
            }
5217
16
        },
5218
16
        { &hf_mac_nr_control_scell_act_deact_cell19,
5219
16
            { "Cell 19",
5220
16
              "mac-nr.control.scell-act-deact.cell19", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5221
16
              NULL, HFILL
5222
16
            }
5223
16
        },
5224
16
        { &hf_mac_nr_control_scell_act_deact_cell18,
5225
16
            { "Cell 18",
5226
16
              "mac-nr.control.scell-act-deact.cell18", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5227
16
              NULL, HFILL
5228
16
            }
5229
16
        },
5230
16
        { &hf_mac_nr_control_scell_act_deact_cell17,
5231
16
            { "Cell 17",
5232
16
              "mac-nr.control.scell-act-deact.cell17", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5233
16
              NULL, HFILL
5234
16
            }
5235
16
        },
5236
16
        { &hf_mac_nr_control_scell_act_deact_cell16,
5237
16
            { "Cell 16",
5238
16
              "mac-nr.control.scell-act-deact.cell16", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
5239
16
              NULL, HFILL
5240
16
            }
5241
16
        },
5242
16
        { &hf_mac_nr_control_scell_act_deact_cell31,
5243
16
            { "Cell 31",
5244
16
              "mac-nr.control.scell-act-deact.cell31", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5245
16
              NULL, HFILL
5246
16
            }
5247
16
        },
5248
16
        { &hf_mac_nr_control_scell_act_deact_cell30,
5249
16
            { "Cell 30",
5250
16
              "mac-nr.control.scell-act-deact.cell30", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5251
16
              NULL, HFILL
5252
16
            }
5253
16
        },
5254
16
        { &hf_mac_nr_control_scell_act_deact_cell29,
5255
16
            { "Cell 29",
5256
16
              "mac-nr.control.scell-act-deact.cell29", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5257
16
              NULL, HFILL
5258
16
            }
5259
16
        },
5260
16
        { &hf_mac_nr_control_scell_act_deact_cell28,
5261
16
            { "Cell 28",
5262
16
              "mac-nr.control.scell-act-deact.cell28", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5263
16
              NULL, HFILL
5264
16
            }
5265
16
        },
5266
16
        { &hf_mac_nr_control_scell_act_deact_cell27,
5267
16
            { "Cell 27",
5268
16
              "mac-nr.control.scell-act-deact.cell27", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5269
16
              NULL, HFILL
5270
16
            }
5271
16
        },
5272
16
        { &hf_mac_nr_control_scell_act_deact_cell26,
5273
16
            { "Cell 26",
5274
16
              "mac-nr.control.scell-act-deact.cell26", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5275
16
              NULL, HFILL
5276
16
            }
5277
16
        },
5278
16
        { &hf_mac_nr_control_scell_act_deact_cell25,
5279
16
            { "Cell 25",
5280
16
              "mac-nr.control.scell-act-deact.cell25", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5281
16
              NULL, HFILL
5282
16
            }
5283
16
        },
5284
16
        { &hf_mac_nr_control_scell_act_deact_cell24,
5285
16
            { "Cell 24",
5286
16
              "mac-nr.control.scell-act-deact.cell24", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
5287
16
              NULL, HFILL
5288
16
            }
5289
16
        },
5290
16
        { &hf_mac_nr_control_bsr_short_lcg,
5291
16
            { "LCG",
5292
16
              "mac-nr.control.bsr.short.lcg", FT_UINT8, BASE_DEC, NULL, 0xe0,
5293
16
              "Logical Channel Group", HFILL
5294
16
            }
5295
16
        },
5296
16
        { &hf_mac_nr_control_bsr_short_bs_lcg0,
5297
16
            { "Buffer Size for LCG0",
5298
16
              "mac-nr.control.bsr.bs-lcg0", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5299
16
              NULL, HFILL
5300
16
            }
5301
16
        },
5302
16
        { &hf_mac_nr_control_bsr_short_bs_lcg1,
5303
16
            { "Buffer Size for LCG1",
5304
16
              "mac-nr.control.bsr.bs-lcg1", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5305
16
              NULL, HFILL
5306
16
            }
5307
16
        },
5308
16
        { &hf_mac_nr_control_bsr_short_bs_lcg2,
5309
16
            { "Buffer Size for LCG2",
5310
16
              "mac-nr.control.bsr.bs-lcg2", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5311
16
              NULL, HFILL
5312
16
            }
5313
16
        },
5314
16
        { &hf_mac_nr_control_bsr_short_bs_lcg3,
5315
16
            { "Buffer Size for LCG3",
5316
16
              "mac-nr.control.bsr.bs-lcg3", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5317
16
              NULL, HFILL
5318
16
            }
5319
16
        },
5320
16
        { &hf_mac_nr_control_bsr_short_bs_lcg4,
5321
16
            { "Buffer Size for LCG4",
5322
16
              "mac-nr.control.bsr.bs-lcg4", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5323
16
              NULL, HFILL
5324
16
            }
5325
16
        },
5326
16
        { &hf_mac_nr_control_bsr_short_bs_lcg5,
5327
16
            { "Buffer Size for LCG5",
5328
16
              "mac-nr.control.bsr.bs-lcg5", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5329
16
              NULL, HFILL
5330
16
            }
5331
16
        },
5332
16
        { &hf_mac_nr_control_bsr_short_bs_lcg6,
5333
16
            { "Buffer Size for LCG6",
5334
16
              "mac-nr.control.bsr.bs-lcg6", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5335
16
              NULL, HFILL
5336
16
            }
5337
16
        },
5338
16
        { &hf_mac_nr_control_bsr_short_bs_lcg7,
5339
16
            { "Buffer Size for LCG7",
5340
16
              "mac-nr.control.bsr.bs-lcg7", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5341
16
              NULL, HFILL
5342
16
            }
5343
16
        },
5344
16
        { &hf_mac_nr_control_bsr_long_lcg7,
5345
16
            { "LCG7",
5346
16
              "mac-nr.control.bsr.long.lcg7", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
5347
16
              "Logical Channel Group 7", HFILL
5348
16
            }
5349
16
        },
5350
16
        { &hf_mac_nr_control_bsr_long_lcg6,
5351
16
            { "LCG6",
5352
16
              "mac-nr.control.bsr.long.lcg6", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
5353
16
              "Logical Channel Group 6", HFILL
5354
16
            }
5355
16
        },
5356
16
        { &hf_mac_nr_control_bsr_long_lcg5,
5357
16
            { "LCG5",
5358
16
              "mac-nr.control.bsr.long.lcg5", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
5359
16
              "Logical Channel Group 5", HFILL
5360
16
            }
5361
16
        },
5362
16
        { &hf_mac_nr_control_bsr_long_lcg4,
5363
16
            { "LCG4",
5364
16
              "mac-nr.control.bsr.long.lcg4", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
5365
16
              "Logical Channel Group 4", HFILL
5366
16
            }
5367
16
        },
5368
16
        { &hf_mac_nr_control_bsr_long_lcg3,
5369
16
            { "LCG3",
5370
16
              "mac-nr.control.bsr.long.lcg3", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
5371
16
              "Logical Channel Group 3", HFILL
5372
16
            }
5373
16
        },
5374
16
        { &hf_mac_nr_control_bsr_long_lcg2,
5375
16
            { "LCG2",
5376
16
              "mac-nr.control.bsr.long.lcg2", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
5377
16
              "Logical Channel Group 2", HFILL
5378
16
            }
5379
16
        },
5380
16
        { &hf_mac_nr_control_bsr_long_lcg1,
5381
16
            { "LCG1",
5382
16
              "mac-nr.control.bsr.long.lcg1", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
5383
16
              "Logical Channel Group 1", HFILL
5384
16
            }
5385
16
        },
5386
16
        { &hf_mac_nr_control_bsr_long_lcg0,
5387
16
            { "LCG0",
5388
16
              "mac-nr.control.bsr.long.lcg0", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
5389
16
              "Logical Channel Group 0", HFILL
5390
16
            }
5391
16
        },
5392
16
        { &hf_mac_nr_control_bsr_trunc_long_bs,
5393
16
            { "Buffer Size",
5394
16
              "mac-nr.control.bsr.trunc-bs", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5395
16
              NULL, HFILL
5396
16
            }
5397
16
        },
5398
16
        { &hf_mac_nr_control_bsr_long_bs_lcg7,
5399
16
            { "Buffer Size for LCG7",
5400
16
              "mac-nr.control.bsr.bs-lcg7", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5401
16
              NULL, HFILL
5402
16
            }
5403
16
        },
5404
16
        { &hf_mac_nr_control_bsr_long_bs_lcg6,
5405
16
            { "Buffer Size for LCG6",
5406
16
              "mac-nr.control.bsr.bs-lcg6", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5407
16
              NULL, HFILL
5408
16
            }
5409
16
        },
5410
16
        { &hf_mac_nr_control_bsr_long_bs_lcg5,
5411
16
            { "Buffer Size for LCG5",
5412
16
              "mac-nr.control.bsr.bs-lcg5", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5413
16
              NULL, HFILL
5414
16
            }
5415
16
        },
5416
16
        { &hf_mac_nr_control_bsr_long_bs_lcg4,
5417
16
            { "Buffer Size for LCG4",
5418
16
              "mac-nr.control.bsr.bs-lcg4", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5419
16
              NULL, HFILL
5420
16
            }
5421
16
        },
5422
16
        { &hf_mac_nr_control_bsr_long_bs_lcg3,
5423
16
            { "Buffer Size for LCG3",
5424
16
              "mac-nr.control.bsr.bs-lcg3", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5425
16
              NULL, HFILL
5426
16
            }
5427
16
        },
5428
16
        { &hf_mac_nr_control_bsr_long_bs_lcg2,
5429
16
            { "Buffer Size for LCG2",
5430
16
              "mac-nr.control.bsr.bs-lcg2", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5431
16
              NULL, HFILL
5432
16
            }
5433
16
        },
5434
16
        { &hf_mac_nr_control_bsr_long_bs_lcg1,
5435
16
            { "Buffer Size for LCG1",
5436
16
              "mac-nr.control.bsr.bs-lcg1", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5437
16
              NULL, HFILL
5438
16
            }
5439
16
        },
5440
16
        { &hf_mac_nr_control_bsr_long_bs_lcg0,
5441
16
            { "Buffer Size for LCG0",
5442
16
              "mac-nr.control.bsr.bs-lcg0", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5443
16
              NULL, HFILL
5444
16
            }
5445
16
        },
5446
16
        { &hf_mac_nr_control_timing_advance_report_reserved,
5447
16
            { "Reserved",
5448
16
              "mac-nr.control.ta-command.reserved", FT_UINT8, BASE_HEX, NULL, 0xc0,
5449
16
              NULL, HFILL
5450
16
            }
5451
16
        },
5452
16
        { &hf_mac_nr_control_timing_advance_report_ta,
5453
16
            { "Timing Advance",
5454
16
              "mac-nr.control.ta-command.ta", FT_UINT16, BASE_DEC, NULL, 0x3f,
5455
16
              NULL, HFILL
5456
16
            }
5457
16
        },
5458
16
        { &hf_mac_nr_differential_koffset,
5459
16
            { "Differential Koffset",
5460
16
              "mac-nr.differential_koffset", FT_UINT8, BASE_DEC, NULL, 0x3f,
5461
16
              NULL, HFILL
5462
16
            }
5463
16
        },
5464
16
        { &hf_mac_nr_differential_koffset_reserved,
5465
16
            { "Reserved",
5466
16
              "mac-nr.differential_koffset.reserved", FT_UINT8, BASE_DEC, NULL, 0xc0,
5467
16
              NULL, HFILL
5468
16
            }
5469
16
        }, };
5470
5471
16
    static int *ett[] =
5472
16
    {
5473
16
        &ett_mac_nr,
5474
16
        &ett_mac_nr_context,
5475
16
        &ett_mac_nr_subheader,
5476
16
        &ett_mac_nr_rar_subheader,
5477
16
        &ett_mac_nr_rar_grant,
5478
16
        &ett_mac_nr_me_phr_entry
5479
16
    };
5480
5481
16
    static ei_register_info ei[] = {
5482
16
        { &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
16
        { &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
16
        { &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
16
        { &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
16
        { &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 }}
5487
16
    };
5488
5489
16
    module_t *mac_nr_module;
5490
16
    expert_module_t* expert_mac_nr;
5491
5492
16
    static const enum_val_t show_info_col_vals[] = {
5493
16
        {"show-phy", "PHY Info", ShowPHYLayer},
5494
16
        {"show-mac", "MAC Info", ShowMACLayer},
5495
16
        {"show-rlc", "RLC Info", ShowRLCLayer},
5496
16
        {NULL, NULL, -1}
5497
16
    };
5498
5499
16
    static const enum_val_t lcid_drb_source_vals[] = {
5500
16
        {"from-static-stable",          "From static table",           FromStaticTable},
5501
16
        {"from-configuration-protocol", "From configuration protocol", FromConfigurationProtocol},
5502
16
        {NULL, NULL, -1}
5503
16
    };
5504
5505
16
    static uat_field_t lcid_drb_mapping_flds[] = {
5506
16
        UAT_FLD_VS(lcid_drb_mappings, lcid, "LCID (3-32)", drb_lcid_vals,
5507
16
                   "The MAC LCID.  Note that under NR-DC, LCID 3 may be SRB-3. "
5508
16
                   "LCID 4 may also be LCID4"),
5509
16
        UAT_FLD_DEC(lcid_drb_mappings, drbid,"DRBID id (1-32)", "Identifier of logical data channel"),
5510
16
        UAT_FLD_VS(lcid_drb_mappings, bearer_type_ul, "UL RLC Bearer Type", rlc_bearer_type_vals, "UL Bearer Mode"),
5511
16
        UAT_FLD_VS(lcid_drb_mappings, bearer_type_dl, "DL RLC Bearer Type", rlc_bearer_type_vals, "DL Bearer Mode"),
5512
16
        UAT_END_FIELDS
5513
16
    };
5514
5515
    /* Register protocol. */
5516
16
    proto_mac_nr = proto_register_protocol("MAC-NR", "MAC-NR", "mac-nr");
5517
16
    proto_register_field_array(proto_mac_nr, hf, array_length(hf));
5518
16
    proto_register_subtree_array(ett, array_length(ett));
5519
16
    expert_mac_nr = expert_register_protocol(proto_mac_nr);
5520
16
    expert_register_field_array(expert_mac_nr, ei, array_length(ei));
5521
5522
    /* Allow other dissectors to find this one by name. */
5523
16
    register_dissector("mac-nr", dissect_mac_nr, proto_mac_nr);
5524
5525
    /* Register the tap name. */
5526
16
    mac_nr_tap = register_tap("mac-3gpp");
5527
5528
    /* Preferences */
5529
16
    mac_nr_module = prefs_register_protocol(proto_mac_nr, NULL);
5530
5531
16
    prefs_register_bool_preference(mac_nr_module, "attempt_rrc_decode",
5532
16
        "Attempt to decode BCCH, PCCH and CCCH data using NR RRC dissector",
5533
16
        "Attempt to decode BCCH, PCCH and CCCH data using NR RRC dissector",
5534
16
        &global_mac_nr_attempt_rrc_decode);
5535
5536
16
    prefs_register_bool_preference(mac_nr_module, "attempt_to_dissect_srb_sdus",
5537
16
        "Attempt to dissect LCID 1-4 as srb1-4",
5538
16
        "Will call NR RLC dissector with standard settings as per RRC spec, unless "
5539
16
        "LCID 3,4 are being used for user-plane",
5540
16
        &global_mac_nr_attempt_srb_decode);
5541
5542
16
    prefs_register_enum_preference(mac_nr_module, "lcid_to_drb_mapping_source",
5543
16
        "Source of LCID -> drb channel settings",
5544
16
        "Set whether LCID -> drb Table is taken from static table (below) or from "
5545
16
        "info learned from control protocol (i.e. RRC)",
5546
16
        &global_mac_nr_lcid_drb_source, lcid_drb_source_vals, false);
5547
5548
16
    lcid_drb_mappings_uat = uat_new("Static LCID -> drb Table",
5549
16
                                    sizeof(lcid_drb_mapping_t),
5550
16
                                    "drb_bearerconfig",
5551
16
                                    true,
5552
16
                                    &lcid_drb_mappings,
5553
16
                                    &num_lcid_drb_mappings,
5554
16
                                    UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
5555
16
                                    "",  /* TODO: is this ref to help manual? */
5556
16
                                    lcid_drb_mapping_copy_cb,
5557
16
                                    NULL,
5558
16
                                    NULL,
5559
16
                                    NULL,
5560
16
                                    NULL,
5561
16
                                    lcid_drb_mapping_flds);
5562
5563
16
    prefs_register_uat_preference(mac_nr_module,
5564
16
                                  "drb_table",
5565
16
                                  "LCID -> DRB Mappings Table",
5566
16
                                  "A table that maps from configurable lcids -> RLC bearer configs",
5567
16
                                  lcid_drb_mappings_uat);
5568
5569
16
    prefs_register_enum_preference(mac_nr_module, "layer_to_show",
5570
16
        "Which layer info to show in Info column",
5571
16
        "Can show PHY, MAC or RLC layer info in Info column",
5572
16
        &global_mac_nr_layer_to_show, show_info_col_vals, false);
5573
5574
16
    register_init_routine(&mac_nr_init_protocol);
5575
16
    register_cleanup_routine(&mac_nr_cleanup_protocol);
5576
16
}
5577
5578
void proto_reg_handoff_mac_nr(void)
5579
16
{
5580
    /* Add as a heuristic UDP dissector */
5581
16
    heur_dissector_add("udp", dissect_mac_nr_heur, "MAC-NR over UDP", "mac_nr_udp", proto_mac_nr, HEURISTIC_DISABLE);
5582
5583
16
    rlc_nr_handle = find_dissector_add_dependency("rlc-nr", proto_mac_nr);
5584
16
    nr_rrc_bcch_bch_handle = find_dissector_add_dependency("nr-rrc.bcch.bch", proto_mac_nr);
5585
16
    nr_rrc_bcch_dl_sch_handle = find_dissector_add_dependency("nr-rrc.bcch.dl.sch", proto_mac_nr);
5586
16
    nr_rrc_pcch_handle = find_dissector_add_dependency("nr-rrc.pcch", proto_mac_nr);
5587
16
    nr_rrc_dl_ccch_handle = find_dissector_add_dependency("nr-rrc.dl.ccch", proto_mac_nr);
5588
16
    nr_rrc_ul_ccch_handle = find_dissector_add_dependency("nr-rrc.ul.ccch", proto_mac_nr);
5589
16
    nr_rrc_ul_ccch1_handle = find_dissector_add_dependency("nr-rrc.ul.ccch1", proto_mac_nr);
5590
5591
16
    proto_rlc_nr = proto_get_id_by_filter_name("rlc-nr");
5592
16
}
5593
5594
5595
/*
5596
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
5597
 *
5598
 * Local variables:
5599
 * c-basic-offset: 4
5600
 * tab-width: 8
5601
 * indent-tabs-mode: nil
5602
 * End:
5603
 *
5604
 * vi: set shiftwidth=4 tabstop=8 expandtab:
5605
 * :indentSize=4:tabSize=8:noTabs=true:
5606
 */