Coverage Report

Created: 2025-02-15 06:25

/src/wireshark/epan/dissectors/packet-mac-nr.c
Line
Count
Source (jump to first uncovered line)
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
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
UAT_VS_DEF(lcid_drb_mappings, lcid, lcid_drb_mapping_t, uint8_t, 3, "LCID 3")
462
UAT_DEC_CB_DEF(lcid_drb_mappings, drbid, lcid_drb_mapping_t)
463
UAT_VS_DEF(lcid_drb_mappings, bearer_type_ul, lcid_drb_mapping_t, rlc_bearer_type_t, rlcAM12, "AM")
464
UAT_VS_DEF(lcid_drb_mappings, bearer_type_dl, lcid_drb_mapping_t, rlc_bearer_type_t, rlcAM12, "AM")
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
extern 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 int dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1324
                                  proto_item *pdu_ti, uint32_t offset,
1325
                                  mac_nr_info *p_mac_nr_info,
1326
                                  mac_3gpp_tap_info *tap_info);
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
                         int 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, int 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 int dissect_fallbackrar(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
1474
                               proto_item *ti, proto_item *pdu_ti, uint32_t rapid)
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
                               int offset, uint16_t data_length,
1976
                               uint8_t mode, uint8_t direction, uint16_t ueid,
1977
                               uint8_t bearerType, uint8_t bearerId,
1978
                               uint8_t sequenceNumberLength,
1979
                               uint8_t priority _U_)
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 int dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2062
                                  proto_item *pdu_ti, uint32_t offset,
2063
                                  mac_nr_info *p_mac_nr_info,
2064
                                  mac_3gpp_tap_info *tap_info)
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 int* const 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 int* const 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 int* const 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_NA);
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(mac_nr_tree, pinfo, &ei_mac_nr_no_per_frame_data, tvb, offset, -1);
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
    int         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 += (int)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, int *p_offset)
3458
0
{
3459
0
    int     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
14
{
3687
14
    mac_nr_ue_bearers_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
3688
14
}
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
14
{
3699
14
    static hf_register_info hf[] =
3700
14
    {
3701
        /**********************************/
3702
        /* Items for decoding context     */
3703
14
        { &hf_mac_nr_context,
3704
14
            { "Context",
3705
14
              "mac-nr.context", FT_STRING, BASE_NONE, NULL, 0x0,
3706
14
              NULL, HFILL
3707
14
            }
3708
14
        },
3709
14
        { &hf_mac_nr_context_radio_type,
3710
14
            { "Radio Type",
3711
14
              "mac-nr.radio-type", FT_UINT8, BASE_DEC, VALS(radio_type_vals), 0x0,
3712
14
              NULL, HFILL
3713
14
            }
3714
14
        },
3715
14
        { &hf_mac_nr_context_direction,
3716
14
            { "Direction",
3717
14
              "mac-nr.direction", FT_UINT8, BASE_DEC, VALS(direction_vals), 0x0,
3718
14
              "Direction of message", HFILL
3719
14
            }
3720
14
        },
3721
14
        { &hf_mac_nr_context_rnti,
3722
14
            { "RNTI",
3723
14
              "mac-nr.rnti", FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3724
14
              "RNTI associated with message", HFILL
3725
14
            }
3726
14
        },
3727
14
        { &hf_mac_nr_context_rnti_type,
3728
14
            { "RNTI Type",
3729
14
              "mac-nr.rnti-type", FT_UINT8, BASE_DEC, VALS(rnti_type_vals), 0x0,
3730
14
              "Type of RNTI associated with message", HFILL
3731
14
            }
3732
14
        },
3733
14
        { &hf_mac_nr_context_ueid,
3734
14
            { "UEId",
3735
14
              "mac-nr.ueid", FT_UINT16, BASE_DEC, NULL, 0x0,
3736
14
              "User Equipment Identifier associated with message", HFILL
3737
14
            }
3738
14
        },
3739
14
        { &hf_mac_nr_context_sysframe_number,
3740
14
            { "System Frame Number",
3741
14
              "mac-nr.sfn", FT_UINT16, BASE_DEC, NULL, 0x0,
3742
14
              "System Frame Number associated with message", HFILL
3743
14
            }
3744
14
        },
3745
14
        { &hf_mac_nr_context_slot_number,
3746
14
            { "Slot",
3747
14
              "mac-nr.slot", FT_UINT16, BASE_DEC, NULL, 0x0,
3748
14
              "Slot number associated with message", HFILL
3749
14
            }
3750
14
        },
3751
14
        { &hf_mac_nr_context_harqid,
3752
14
            { "HarqId",
3753
14
              "mac-nr.harqid", FT_UINT8, BASE_DEC, NULL, 0x0,
3754
14
              "HARQ Identifier", HFILL
3755
14
            }
3756
14
        },
3757
14
        { &hf_mac_nr_context_bcch_transport_channel,
3758
14
            { "Transport channel",
3759
14
              "mac-nr.bcch-transport-channel", FT_UINT8, BASE_DEC, VALS(bcch_transport_channel_vals), 0x0,
3760
14
              "Transport channel BCCH data was carried on", HFILL
3761
14
            }
3762
14
        },
3763
14
        { &hf_mac_nr_context_phr_type2_othercell,
3764
14
            { "PHR Type2 other cell PHR",
3765
14
              "mac-nr.type2-other-cell", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3766
14
              NULL, HFILL
3767
14
            }
3768
14
        },
3769
3770
14
        { &hf_mac_nr_subheader,
3771
14
            { "Subheader",
3772
14
              "mac-nr.subheader", FT_STRING, BASE_NONE, NULL, 0x0,
3773
14
              NULL, HFILL
3774
14
            }
3775
14
        },
3776
14
        { &hf_mac_nr_subheader_reserved,
3777
14
            { "Reserved",
3778
14
              "mac-nr.subheader.reserved", FT_UINT8, BASE_HEX, NULL, 0x0,
3779
14
              NULL, HFILL
3780
14
            }
3781
14
        },
3782
14
        { &hf_mac_nr_subheader_f,
3783
14
            { "Format",
3784
14
              "mac-nr.subheader.f", FT_BOOLEAN, 8, TFS(&subheader_f_vals), 0x40,
3785
14
              "Format of subheader length field", HFILL
3786
14
            }
3787
14
        },
3788
14
        { &hf_mac_nr_subheader_length_1_byte,
3789
14
            { "SDU Length",
3790
14
              "mac-nr.subheader.sdu-length", FT_UINT8, BASE_DEC, NULL, 0x0,
3791
14
              NULL, HFILL
3792
14
            }
3793
14
        },
3794
14
        { &hf_mac_nr_subheader_length_2_bytes,
3795
14
            { "SDU Length",
3796
14
              "mac-nr.subheader.sdu-length", FT_UINT16, BASE_DEC, NULL, 0x0,
3797
14
              NULL, HFILL
3798
14
            }
3799
14
        },
3800
        /* Will be hidden, but useful for bi-directional filtering */
3801
14
        { &hf_mac_nr_lcid,
3802
14
            { "LCID",
3803
14
              "mac-nr.lcid", FT_UINT8, BASE_HEX, NULL, 0x3f,
3804
14
              "Logical Channel Identifier", HFILL
3805
14
            }
3806
14
        },
3807
14
        { &hf_mac_nr_ulsch_lcid,
3808
14
            { "LCID",
3809
14
              "mac-nr.ulsch.lcid", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &ulsch_lcid_vals_ext, 0x3f,
3810
14
              "UL-SCH Logical Channel Identifier", HFILL
3811
14
            }
3812
14
        },
3813
14
        { &hf_mac_nr_dlsch_lcid,
3814
14
            { "LCID",
3815
14
              "mac-nr.dlsch.lcid", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &dlsch_lcid_vals_ext, 0x3f,
3816
14
              "DL-SCH Logical Channel Identifier", HFILL
3817
14
            }
3818
14
        },
3819
14
        { &hf_mac_nr_dlsch_elcid_2oct,
3820
14
            { "eLCID2oct",
3821
14
              "mac-nr.dlsch.elcid-2oct", FT_UINT16, BASE_DEC, NULL, 0x0,
3822
14
              NULL, HFILL
3823
14
            }
3824
14
        },
3825
14
        { &hf_mac_nr_ulsch_elcid_2oct,
3826
14
            { "eLCID2oct",
3827
14
              "mac-nr.dlsch.elcid-2oct", FT_UINT16, BASE_DEC, NULL, 0x0,
3828
14
              NULL, HFILL
3829
14
            }
3830
14
        },
3831
14
        { &hf_mac_nr_dlsch_elcid_1oct,
3832
14
            { "eLCID",
3833
14
              "mac-nr.dlsch.elcid-1oct", FT_UINT8,BASE_DEC|BASE_EXT_STRING,&dlsch_elcid_vals_ext, 0x0,
3834
14
              NULL, HFILL
3835
14
            }
3836
14
        },
3837
14
        { &hf_mac_nr_ulsch_elcid_1oct,
3838
14
            { "eLCID",
3839
14
              "mac-nr.dlsch.elcid-1oct", FT_UINT8,BASE_DEC|BASE_EXT_STRING,&ulsch_elcid_vals_ext, 0x0,
3840
14
              NULL, HFILL
3841
14
            }
3842
14
        },
3843
14
        { &hf_mac_nr_ulsch_sdu,
3844
14
            { "UL-SCH SDU",
3845
14
              "mac-nr.ulsch.sdu", FT_BYTES, BASE_NONE, NULL, 0x0,
3846
14
              NULL, HFILL
3847
14
            }
3848
14
        },
3849
14
        { &hf_mac_nr_dlsch_sdu,
3850
14
            { "DL-SCH SDU",
3851
14
              "mac-nr.dlsch.sdu", FT_BYTES, BASE_NONE, NULL, 0x0,
3852
14
              NULL, HFILL
3853
14
            }
3854
14
        },
3855
14
        { &hf_mac_nr_bcch_pdu,
3856
14
            { "BCCH PDU",
3857
14
              "mac-nr.bcch.pdu", FT_BYTES, BASE_NONE, NULL, 0x0,
3858
14
              NULL, HFILL
3859
14
            }
3860
14
        },
3861
14
        { &hf_mac_nr_pcch_pdu,
3862
14
            { "PCCH PDU",
3863
14
              "mac-nr.pcch.pdu", FT_BYTES, BASE_NONE, NULL, 0x0,
3864
14
              NULL, HFILL
3865
14
            }
3866
14
        },
3867
3868
3869
        /*********************************/
3870
        /* RAR fields                    */
3871
14
        { &hf_mac_nr_rar,
3872
14
            { "RAR",
3873
14
              "mac-nr.rar", FT_NONE, BASE_NONE, NULL, 0x0,
3874
14
              NULL, HFILL
3875
14
            }
3876
14
        },
3877
14
        { &hf_mac_nr_rar_e,
3878
14
            { "Extension",
3879
14
              "mac-nr.rar.e", FT_BOOLEAN, 8, TFS(&rar_ext_vals), 0x80,
3880
14
              NULL, HFILL
3881
14
            }
3882
14
        },
3883
14
        { &hf_mac_nr_rar_t,
3884
14
            { "Type",
3885
14
              "mac-nr.rar.t", FT_BOOLEAN, 8, TFS(&rar_type_vals), 0x40,
3886
14
              NULL, HFILL
3887
14
            }
3888
14
        },
3889
14
        { &hf_mac_nr_rar_reserved,
3890
14
            { "Reserved",
3891
14
              "mac-nr.rar.reserved", FT_UINT8, BASE_DEC, NULL, 0x30,
3892
14
              NULL, HFILL
3893
14
            }
3894
14
        },
3895
14
        { &hf_mac_nr_rar_reserved1,
3896
14
            { "Reserved",
3897
14
              "mac-nr.rar.reserved", FT_UINT8, BASE_DEC, NULL, 0x80,
3898
14
              NULL, HFILL
3899
14
            }
3900
14
        },
3901
3902
14
        { &hf_mac_nr_rar_subheader,
3903
14
            { "Subheader",
3904
14
              "mac-nr.rar.subheader", FT_STRING, BASE_NONE, NULL, 0x0,
3905
14
              NULL, HFILL
3906
14
            }
3907
14
        },
3908
14
        { &hf_mac_nr_rar_bi,
3909
14
            { "Backoff Indicator",
3910
14
              "mac-nr.rar.bi", FT_UINT8, BASE_DEC, VALS(rar_bi_vals), 0x0f,
3911
14
              NULL, HFILL
3912
14
            }
3913
14
        },
3914
14
        { &hf_mac_nr_rar_rapid,
3915
14
            { "RAPID",
3916
14
              "mac-nr.rar.rapid", FT_UINT8, BASE_DEC, NULL, 0x3f,
3917
14
              NULL, HFILL
3918
14
            }
3919
14
        },
3920
14
        { &hf_mac_nr_rar_ta,
3921
14
            { "Timing Advance",
3922
14
              "mac-nr.rar.ta", FT_UINT16, BASE_DEC, NULL, 0x7ff8,
3923
14
              NULL, HFILL
3924
14
            }
3925
14
        },
3926
3927
14
        { &hf_mac_nr_rar_grant,
3928
14
            { "Grant",
3929
14
              "mac-nr.rar.grant", FT_UINT32, BASE_HEX, NULL, 0x07ffffff,
3930
14
              "UL Grant details", HFILL
3931
14
            }
3932
14
        },
3933
14
        { &hf_mac_nr_rar_grant_hopping,
3934
14
            { "Frequency hopping flag",
3935
14
              "mac-nr.rar.grant.hopping", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x04000000,
3936
14
              NULL, HFILL
3937
14
            }
3938
14
        },
3939
14
        { &hf_mac_nr_rar_grant_fra,
3940
14
            { "Msg3 PUSCH frequency resource allocation",
3941
14
              "mac-nr.rar.grant.fra", FT_UINT32, BASE_DEC, NULL, 0x03fff000,
3942
14
              NULL, HFILL
3943
14
            }
3944
14
        },
3945
14
        { &hf_mac_nr_rar_grant_tsa,
3946
14
            { "Msg3 PUSCH time resource allocation",
3947
14
              "mac-nr.rar.grant.tsa", FT_UINT32, BASE_DEC, NULL, 0x00000f00,
3948
14
              NULL, HFILL
3949
14
            }
3950
14
        },
3951
14
        { &hf_mac_nr_rar_grant_mcs,
3952
14
            { "MCS",
3953
14
              "mac-nr.rar.grant.mcs", FT_UINT32, BASE_DEC, NULL, 0x000000f0,
3954
14
              NULL, HFILL
3955
14
            }
3956
14
        },
3957
14
        { &hf_mac_nr_rar_grant_tcsp,
3958
14
            { "TPC command for Msg3 PUSCH",
3959
14
              "mac-nr.rar.grant.tcsp", FT_UINT32, BASE_DEC, VALS(tpc_command_vals), 0x0000000e,
3960
14
              NULL, HFILL
3961
14
            }
3962
14
        },
3963
14
        { &hf_mac_nr_rar_grant_csi,
3964
14
            { "CSI request",
3965
14
              "mac-nr.rar.grant.csi", FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
3966
14
              NULL, HFILL
3967
14
            }
3968
14
        },
3969
14
        { &hf_mac_nr_rar_temp_crnti,
3970
14
            { "Temporary C-RNTI",
3971
14
              "mac-nr.rar.temp_crnti", FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
3972
14
              NULL, HFILL
3973
14
            }
3974
14
        },
3975
3976
        /* MSGB */
3977
14
        { &hf_mac_nr_msgb,
3978
14
            { "MSGB",
3979
14
              "mac-nr.msgb", FT_NONE, BASE_NONE, NULL, 0x0,
3980
14
              NULL, HFILL
3981
14
            }
3982
14
        },
3983
14
        { &hf_mac_nr_msgb_subheader,
3984
14
            { "Subheader",
3985
14
              "mac-nr.msgb.subheader", FT_STRING, BASE_NONE, NULL, 0x0,
3986
14
              NULL, HFILL
3987
14
            }
3988
14
        },
3989
14
        { &hf_mac_nr_msgb_e,
3990
14
            { "Extension",
3991
14
              "mac-nr.msgb.e", FT_BOOLEAN, 8, TFS(&rar_ext_vals), 0x80,
3992
14
              NULL, HFILL
3993
14
            }
3994
14
        },
3995
14
        { &hf_mac_nr_msgb_t1,
3996
14
            { "t1",
3997
14
              "mac-nr.msgb.t1", FT_BOOLEAN, 8, TFS(&msgb_t1_vals), 0x40,
3998
14
              NULL, HFILL
3999
14
            }
4000
14
        },
4001
14
        { &hf_mac_nr_msgb_t2,
4002
14
            { "t2",
4003
14
              "mac-nr.msgb.t2", FT_BOOLEAN, 8, TFS(&msgb_t2_vals), 0x20,
4004
14
              NULL, HFILL
4005
14
            }
4006
14
        },
4007
14
        { &hf_mac_nr_msgb_s,
4008
14
            { "s",
4009
14
              "mac-nr.msgb.s", FT_BOOLEAN, 8, TFS(&msgb_s_vals), 0x10,
4010
14
              "MAC SDU indicator", HFILL
4011
14
            }
4012
14
        },
4013
4014
14
        { &hf_mac_nr_msgb_reserved,
4015
14
            { "Reserved",
4016
14
              "mac-nr.msgb.reserved", FT_UINT8, BASE_DEC, NULL, 0x10,
4017
14
              NULL, HFILL
4018
14
            }
4019
14
        },
4020
14
        { &hf_mac_nr_msgb_reserved2,
4021
14
            { "Reserved",
4022
14
              "mac-nr.msgb.reserved", FT_UINT8, BASE_DEC, NULL, 0x0f,
4023
14
              NULL, HFILL
4024
14
            }
4025
14
        },
4026
14
        { &hf_mac_nr_msgb_reserved3,
4027
14
            { "Reserved",
4028
14
              "mac-nr.msgb.reserved", FT_UINT8, BASE_DEC, NULL, 0x80,
4029
14
              NULL, HFILL
4030
14
            }
4031
14
        },
4032
14
        { &hf_mac_nr_msgb_ta_command,
4033
14
            { "Timing Advance Command",
4034
14
              "mac-nr.msgb.ta-command", FT_UINT16, BASE_DEC, NULL, 0x0fff,
4035
14
              NULL, HFILL
4036
14
            }
4037
14
        },
4038
        /* TODO: vals from 38.213 [6] */
4039
14
        { &hf_mac_nr_msgb_channelaccess_cpext,
4040
14
            { "ChannelAccess-CPext",
4041
14
              "mac-nr.msgb.channelaccess-cpext", FT_UINT8, BASE_DEC, NULL, 0x60,
4042
14
              NULL, HFILL
4043
14
            }
4044
14
        },
4045
        /* TODO: vals from 38.213 [6] */
4046
14
        { &hf_mac_nr_msgb_tpc,
4047
14
            { "TPC",
4048
14
              "mac-nr.msgb.tpc", FT_UINT8, BASE_DEC, NULL, 0x18,
4049
14
              "TPC command for the PUCCH resource containing HARQ feedback for MSGB", HFILL
4050
14
            }
4051
14
        },
4052
14
        { &hf_mac_nr_msgb_harq_feedback_timing_indicator,
4053
14
            { "HARQ Feedback Timing Indicator",
4054
14
              "mac-nr.msgb.harq-feedback-timing-indicator", FT_UINT8, BASE_DEC, NULL, 0x07,
4055
14
              NULL, HFILL
4056
14
            }
4057
14
        },
4058
14
        { &hf_mac_nr_msgb_pucch_resource_indicator,
4059
14
            { "PUCCH Resource Indicator",
4060
14
              "mac-nr.msgb.pucch-resource-indicator", FT_UINT8, BASE_DEC, NULL, 0xf0,
4061
14
              NULL, HFILL
4062
14
            }
4063
14
        },
4064
4065
14
        { &hf_mac_nr_padding,
4066
14
            { "Padding",
4067
14
              "mac-nr.padding", FT_BYTES, BASE_NONE, NULL, 0x0,
4068
14
              NULL, HFILL
4069
14
            }
4070
14
        },
4071
4072
14
        { &hf_mac_nr_control_crnti,
4073
14
            { "C-RNTI",
4074
14
              "mac-nr.control.crnti", FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
4075
14
              NULL, HFILL
4076
14
            }
4077
14
        },
4078
14
        { &hf_mac_nr_control_ue_contention_resolution_identity,
4079
14
            { "UE Contention Resolution Identity",
4080
14
              "mac-nr.control.ue-contention-resolution.identity", FT_BYTES, BASE_NONE, NULL, 0x0,
4081
14
              NULL, HFILL
4082
14
            }
4083
14
        },
4084
14
        { &hf_mac_nr_control_timing_advance_tagid,
4085
14
            { "TAG ID",
4086
14
              "mac-nr.control.timing-advance.tag-id", FT_UINT8, BASE_DEC, NULL, 0xc0,
4087
14
              NULL, HFILL
4088
14
            }
4089
14
        },
4090
14
        { &hf_mac_nr_control_timing_advance_command,
4091
14
            { "Timing Advance Command",
4092
14
              "mac-nr.control.timing-advance.command", FT_UINT8, BASE_DEC, NULL, 0x3f,
4093
14
              NULL, HFILL
4094
14
            }
4095
14
        },
4096
14
        { &hf_mac_nr_control_se_phr_reserved,
4097
14
            { "Reserved",
4098
14
              "mac-nr.control.se-phr.reserved", FT_UINT8, BASE_HEX, NULL, 0xc0,
4099
14
              NULL, HFILL
4100
14
            }
4101
14
        },
4102
14
        { &hf_mac_nr_control_se_phr_ph,
4103
14
            { "Power Headroom",
4104
14
              "mac-nr.control.se-phr.ph", FT_UINT8, BASE_CUSTOM, CF_FUNC(mac_nr_phr_fmt), 0x3f,
4105
14
              NULL, HFILL
4106
14
            }
4107
14
        },
4108
14
        { &hf_mac_nr_control_se_phr_pcmax_f_c,
4109
14
            { "Pcmax,c,f",
4110
14
              "mac-nr.control.se-phr.pcmax_f_c", FT_UINT8, BASE_CUSTOM, CF_FUNC(mac_nr_pcmax_f_c_fmt), 0x3f,
4111
14
              NULL, HFILL
4112
14
            }
4113
14
        },
4114
4115
14
        { &hf_mac_nr_control_recommended_bit_rate_query_lcid,
4116
14
            { "LCID",
4117
14
              "mac-nr.control.recommended-bit-rate-query.lcid", FT_UINT8, BASE_DEC, NULL, 0xfc,
4118
14
              NULL, HFILL
4119
14
            }
4120
14
        },
4121
14
        { &hf_mac_nr_control_recommended_bit_rate_query_dir,
4122
14
            { "Direction",
4123
14
              "mac-nr.control.recommended-bit-rate-query.dir", FT_BOOLEAN, 8, TFS(&tfs_uplink_downlink), 0x02,
4124
14
              NULL, HFILL
4125
14
            }
4126
14
        },
4127
14
        { &hf_mac_nr_control_recommended_bit_rate_query_bit_rate,
4128
14
            { "Bit Rate",
4129
14
              "mac-nr.control.recommended-bit-rate-query.bit-rate", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &bit_rate_vals_ext, 0x01f8,
4130
14
              NULL, HFILL
4131
14
            }
4132
14
        },
4133
14
        { &hf_mac_nr_control_recommended_bit_rate_query_reserved,
4134
14
            { "Reserved",
4135
14
              "mac-nr.control.recommended-bit-rate-query.reserved", FT_UINT8, BASE_DEC, NULL, 0x07,
4136
14
              NULL, HFILL
4137
14
            }
4138
14
        },
4139
4140
14
        { &hf_mac_nr_control_me_phr_c7_flag,
4141
14
            { "C7",
4142
14
              "mac-nr.control.me-phr.c7", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
4143
14
              "SCellIndex 7 PHR report flag", HFILL
4144
14
            }
4145
14
        },
4146
14
        { &hf_mac_nr_control_me_phr_c6_flag,
4147
14
            { "C6",
4148
14
              "mac-nr.control.me-phr.c6", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
4149
14
              "SCellIndex 6 PHR report flag", HFILL
4150
14
            }
4151
14
        },
4152
14
        { &hf_mac_nr_control_me_phr_c5_flag,
4153
14
            { "C5",
4154
14
              "mac-nr.control.me-phr.c5", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
4155
14
              "SCellIndex 5 PHR report flag", HFILL
4156
14
            }
4157
14
        },
4158
14
        { &hf_mac_nr_control_me_phr_c4_flag,
4159
14
            { "C4",
4160
14
              "mac-nr.control.me-phr.c4", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
4161
14
              "SCellIndex 4 PHR report flag", HFILL
4162
14
            }
4163
14
        },
4164
14
        { &hf_mac_nr_control_me_phr_c3_flag,
4165
14
            { "C3",
4166
14
              "mac-nr.control.me-phr.c3", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
4167
14
              "SCellIndex 3 PHR report flag", HFILL
4168
14
            }
4169
14
        },
4170
14
        { &hf_mac_nr_control_me_phr_c2_flag,
4171
14
            { "C2",
4172
14
              "mac-nr.control.me-phr.c2", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
4173
14
              "SCellIndex 2 PHR report flag", HFILL
4174
14
            }
4175
14
        },
4176
14
        { &hf_mac_nr_control_me_phr_c1_flag,
4177
14
            { "C1",
4178
14
              "mac-nr.control.me-phr.c1", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
4179
14
              "SCellIndex 1 PHR report flag", HFILL
4180
14
            }
4181
14
        },
4182
14
        { &hf_mac_nr_control_me_phr_c15_flag,
4183
14
            { "C15",
4184
14
              "mac-nr.control.me-phr.c15", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
4185
14
              "SCellIndex 15 PHR report flag", HFILL
4186
14
            }
4187
14
        },
4188
14
        { &hf_mac_nr_control_me_phr_c14_flag,
4189
14
            { "C14",
4190
14
              "mac-nr.control.me-phr.c14", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
4191
14
              "SCellIndex 14 PHR report flag", HFILL
4192
14
            }
4193
14
        },
4194
14
        { &hf_mac_nr_control_me_phr_c13_flag,
4195
14
            { "C13",
4196
14
              "mac-nr.control.me-phr.c13", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
4197
14
              "SCellIndex 13 PHR report flag", HFILL
4198
14
            }
4199
14
        },
4200
14
        { &hf_mac_nr_control_me_phr_c12_flag,
4201
14
            { "C12",
4202
14
              "mac-nr.control.me-phr.c12", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
4203
14
              "SCellIndex 12 PHR report flag", HFILL
4204
14
            }
4205
14
        },
4206
14
        { &hf_mac_nr_control_me_phr_c11_flag,
4207
14
            { "C11",
4208
14
              "mac-nr.control.me-phr.c11", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
4209
14
              "SCellIndex 11 PHR report flag", HFILL
4210
14
            }
4211
14
        },
4212
14
        { &hf_mac_nr_control_me_phr_c10_flag,
4213
14
            { "C10",
4214
14
              "mac-nr.control.me-phr.c10", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
4215
14
              "SCellIndex 10 PHR report flag", HFILL
4216
14
            }
4217
14
        },
4218
14
        { &hf_mac_nr_control_me_phr_c9_flag,
4219
14
            { "C9",
4220
14
              "mac-nr.control.me-phr.c9", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
4221
14
              "SCellIndex 9 PHR report flag", HFILL
4222
14
            }
4223
14
        },
4224
14
        { &hf_mac_nr_control_me_phr_c8_flag,
4225
14
            { "C8",
4226
14
              "mac-nr.control.me-phr.c8", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
4227
14
              "SCellIndex 8 PHR report flag", HFILL
4228
14
            }
4229
14
        },
4230
14
        { &hf_mac_nr_control_me_phr_c23_flag,
4231
14
            { "C23",
4232
14
              "mac-nr.control.me-phr.c23", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
4233
14
              "SCellIndex 23 PHR report flag", HFILL
4234
14
            }
4235
14
        },
4236
14
        { &hf_mac_nr_control_me_phr_c22_flag,
4237
14
            { "C22",
4238
14
              "mac-nr.control.me-phr.c22", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
4239
14
              "SCellIndex 22 PHR report flag", HFILL
4240
14
            }
4241
14
        },
4242
14
        { &hf_mac_nr_control_me_phr_c21_flag,
4243
14
            { "C21",
4244
14
              "mac-nr.control.me-phr.c21", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
4245
14
              "SCellIndex 21 PHR report flag", HFILL
4246
14
            }
4247
14
        },
4248
14
        { &hf_mac_nr_control_me_phr_c20_flag,
4249
14
            { "C20",
4250
14
              "mac-nr.control.me-phr.c20", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
4251
14
              "SCellIndex 20 PHR report flag", HFILL
4252
14
            }
4253
14
        },
4254
14
        { &hf_mac_nr_control_me_phr_c19_flag,
4255
14
            { "C19",
4256
14
              "mac-nr.control.me-phr.c19", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
4257
14
              "SCellIndex 19 PHR report flag", HFILL
4258
14
            }
4259
14
        },
4260
14
        { &hf_mac_nr_control_me_phr_c18_flag,
4261
14
            { "C18",
4262
14
              "mac-nr.control.me-phr.c18", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
4263
14
              "SCellIndex 18 PHR report flag", HFILL
4264
14
            }
4265
14
        },
4266
14
        { &hf_mac_nr_control_me_phr_c17_flag,
4267
14
            { "C17",
4268
14
              "mac-nr.control.me-phr.c17", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
4269
14
              "SCellIndex 17 PHR report flag", HFILL
4270
14
            }
4271
14
        },
4272
14
        { &hf_mac_nr_control_me_phr_c16_flag,
4273
14
            { "C16",
4274
14
              "mac-nr.control.me-phr.c16", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
4275
14
              "SCellIndex 16 PHR report flag", HFILL
4276
14
            }
4277
14
        },
4278
14
        { &hf_mac_nr_control_me_phr_c31_flag,
4279
14
            { "C31",
4280
14
              "mac-nr.control.me-phr.c31", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
4281
14
              "SCellIndex 31 PHR report flag", HFILL
4282
14
            }
4283
14
        },
4284
14
        { &hf_mac_nr_control_me_phr_c30_flag,
4285
14
            { "C30",
4286
14
              "mac-nr.control.me-phr.c30", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
4287
14
              "SCellIndex 30 PHR report flag", HFILL
4288
14
            }
4289
14
        },
4290
14
        { &hf_mac_nr_control_me_phr_c29_flag,
4291
14
            { "C29",
4292
14
              "mac-nr.control.me-phr.c29", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
4293
14
              "SCellIndex 29 PHR report flag", HFILL
4294
14
            }
4295
14
        },
4296
14
        { &hf_mac_nr_control_me_phr_c28_flag,
4297
14
            { "C28",
4298
14
              "mac-nr.control.me-phr.c28", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
4299
14
              "SCellIndex 28 PHR report flag", HFILL
4300
14
            }
4301
14
        },
4302
14
        { &hf_mac_nr_control_me_phr_c27_flag,
4303
14
            { "C27",
4304
14
              "mac-nr.control.me-phr.c27", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
4305
14
              "SCellIndex 27 PHR report flag", HFILL
4306
14
            }
4307
14
        },
4308
14
        { &hf_mac_nr_control_me_phr_c26_flag,
4309
14
            { "C26",
4310
14
              "mac-nr.control.me-phr.c26", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
4311
14
              "SCellIndex 26 PHR report flag", HFILL
4312
14
            }
4313
14
        },
4314
14
        { &hf_mac_nr_control_me_phr_c25_flag,
4315
14
            { "C25",
4316
14
              "mac-nr.control.me-phr.c25", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
4317
14
              "SCellIndex 25 PHR report flag", HFILL
4318
14
            }
4319
14
        },
4320
14
        { &hf_mac_nr_control_me_phr_c24_flag,
4321
14
            { "C24",
4322
14
              "mac-nr.control.me-phr.c24", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
4323
14
              "SCellIndex 24 PHR report flag", HFILL
4324
14
            }
4325
14
        },
4326
14
        { &hf_mac_nr_control_me_phr_entry,
4327
14
            { "Entry",
4328
14
              "mac-nr.control.me.phr.entry", FT_STRING, BASE_NONE, NULL, 0x0,
4329
14
              NULL, HFILL
4330
14
            }
4331
14
        },
4332
14
        { &hf_mac_nr_control_me_phr_reserved,
4333
14
            { "Reserved",
4334
14
              "mac-nr.control.me-phr.reserved", FT_BOOLEAN, 8, NULL, 0x01,
4335
14
              NULL, HFILL
4336
14
            }
4337
14
        },
4338
14
        { &hf_mac_nr_control_me_phr_p,
4339
14
            { "P",
4340
14
              "mac-nr.control.me-phr.p", FT_BOOLEAN, 8, TFS(&power_backoff_affects_power_management_vals), 0x80,
4341
14
              NULL, HFILL
4342
14
            }
4343
14
        },
4344
14
        { &hf_mac_nr_control_me_phr_v,
4345
14
            { "V",
4346
14
              "mac-nr.control.me-phr.v", FT_BOOLEAN, 8, TFS(&phr_source_vals), 0x40,
4347
14
              NULL, HFILL
4348
14
            }
4349
14
        },
4350
14
        { &hf_mac_nr_control_me_phr_ph_type2_spcell,
4351
14
            { "Power Headroom, (Type2, SpCell)",
4352
14
              "mac-nr.control.me-phr.ph", FT_UINT8, BASE_DEC, NULL, 0x3f,
4353
14
              NULL, HFILL
4354
14
            }
4355
14
        },
4356
14
        { &hf_mac_nr_control_me_phr_ph_type1_pcell,
4357
14
            { "Power Headroom (Type1, PCell)",
4358
14
              "mac-nr.control.me-phr.ph.type1-pcell", FT_UINT8, BASE_CUSTOM, CF_FUNC(mac_nr_phr_fmt), 0x3f,
4359
14
              NULL, HFILL
4360
14
            }
4361
14
        },
4362
4363
14
        { &hf_mac_nr_control_me_phr_ph_c31,
4364
14
            { "PH for SCellIndex 31",
4365
14
              "mac-nr.control.me-phr.ph.c31", FT_UINT8, BASE_DEC, NULL, 0x3f,
4366
14
              NULL, HFILL
4367
14
            }
4368
14
        },
4369
14
        { &hf_mac_nr_control_me_phr_ph_c30,
4370
14
            { "PH for SCellIndex 30",
4371
14
              "mac-nr.control.me-phr.ph.c30", FT_UINT8, BASE_DEC, NULL, 0x3f,
4372
14
              NULL, HFILL
4373
14
            }
4374
14
        },
4375
14
        { &hf_mac_nr_control_me_phr_ph_c29,
4376
14
            { "PH for SCellIndex 29",
4377
14
              "mac-nr.control.me-phr.ph.c29", FT_UINT8, BASE_DEC, NULL, 0x3f,
4378
14
              NULL, HFILL
4379
14
            }
4380
14
        },
4381
14
        { &hf_mac_nr_control_me_phr_ph_c28,
4382
14
            { "PH for SCellIndex 28",
4383
14
              "mac-nr.control.me-phr.ph.c28", FT_UINT8, BASE_DEC, NULL, 0x3f,
4384
14
              NULL, HFILL
4385
14
            }
4386
14
        },
4387
14
        { &hf_mac_nr_control_me_phr_ph_c27,
4388
14
            { "PH for SCellIndex 27",
4389
14
              "mac-nr.control.me-phr.ph.c27", FT_UINT8, BASE_DEC, NULL, 0x3f,
4390
14
              NULL, HFILL
4391
14
            }
4392
14
        },
4393
14
        { &hf_mac_nr_control_me_phr_ph_c26,
4394
14
            { "PH for SCellIndex 26",
4395
14
              "mac-nr.control.me-phr.ph.c26", FT_UINT8, BASE_DEC, NULL, 0x3f,
4396
14
              NULL, HFILL
4397
14
            }
4398
14
        },
4399
14
        { &hf_mac_nr_control_me_phr_ph_c25,
4400
14
            { "PH for SCellIndex 25",
4401
14
              "mac-nr.control.me-phr.ph.c25", FT_UINT8, BASE_DEC, NULL, 0x3f,
4402
14
              NULL, HFILL
4403
14
            }
4404
14
        },
4405
14
        { &hf_mac_nr_control_me_phr_ph_c24,
4406
14
            { "PH for SCellIndex 24",
4407
14
              "mac-nr.control.me-phr.ph.c24", FT_UINT8, BASE_DEC, NULL, 0x3f,
4408
14
              NULL, HFILL
4409
14
            }
4410
14
        },
4411
14
        { &hf_mac_nr_control_me_phr_ph_c23,
4412
14
            { "PH for SCellIndex 23",
4413
14
              "mac-nr.control.me-phr.ph.c23", FT_UINT8, BASE_DEC, NULL, 0x3f,
4414
14
              NULL, HFILL
4415
14
            }
4416
14
        },
4417
14
        { &hf_mac_nr_control_me_phr_ph_c22,
4418
14
            { "PH for SCellIndex 22",
4419
14
              "mac-nr.control.me-phr.ph.c22", FT_UINT8, BASE_DEC, NULL, 0x3f,
4420
14
              NULL, HFILL
4421
14
            }
4422
14
        },
4423
14
        { &hf_mac_nr_control_me_phr_ph_c21,
4424
14
            { "PH for SCellIndex 21",
4425
14
              "mac-nr.control.me-phr.ph.c21", FT_UINT8, BASE_DEC, NULL, 0x3f,
4426
14
              NULL, HFILL
4427
14
            }
4428
14
        },
4429
14
        { &hf_mac_nr_control_me_phr_ph_c20,
4430
14
            { "PH for SCellIndex 20",
4431
14
              "mac-nr.control.me-phr.ph.c20", FT_UINT8, BASE_DEC, NULL, 0x3f,
4432
14
              NULL, HFILL
4433
14
            }
4434
14
        },
4435
14
        { &hf_mac_nr_control_me_phr_ph_c19,
4436
14
            { "PH for SCellIndex 19",
4437
14
              "mac-nr.control.me-phr.ph.c19", FT_UINT8, BASE_DEC, NULL, 0x3f,
4438
14
              NULL, HFILL
4439
14
            }
4440
14
        },
4441
14
        { &hf_mac_nr_control_me_phr_ph_c18,
4442
14
            { "PH for SCellIndex 18",
4443
14
              "mac-nr.control.me-phr.ph.c18", FT_UINT8, BASE_DEC, NULL, 0x3f,
4444
14
              NULL, HFILL
4445
14
            }
4446
14
        },
4447
14
        { &hf_mac_nr_control_me_phr_ph_c17,
4448
14
            { "PH for SCellIndex 17",
4449
14
              "mac-nr.control.me-phr.ph.c17", FT_UINT8, BASE_DEC, NULL, 0x3f,
4450
14
              NULL, HFILL
4451
14
            }
4452
14
        },
4453
14
        { &hf_mac_nr_control_me_phr_ph_c16,
4454
14
            { "PH for SCellIndex 16",
4455
14
              "mac-nr.control.me-phr.ph.c16", FT_UINT8, BASE_DEC, NULL, 0x3f,
4456
14
              NULL, HFILL
4457
14
            }
4458
14
        },
4459
14
        { &hf_mac_nr_control_me_phr_ph_c15,
4460
14
            { "PH for SCellIndex 15",
4461
14
              "mac-nr.control.me-phr.ph.c15", FT_UINT8, BASE_DEC, NULL, 0x3f,
4462
14
              NULL, HFILL
4463
14
            }
4464
14
        },
4465
14
        { &hf_mac_nr_control_me_phr_ph_c14,
4466
14
            { "PH for SCellIndex 14",
4467
14
              "mac-nr.control.me-phr.ph.c14", FT_UINT8, BASE_DEC, NULL, 0x3f,
4468
14
              NULL, HFILL
4469
14
            }
4470
14
        },
4471
14
        { &hf_mac_nr_control_me_phr_ph_c13,
4472
14
            { "PH for SCellIndex 13",
4473
14
              "mac-nr.control.me-phr.ph.c13", FT_UINT8, BASE_DEC, NULL, 0x3f,
4474
14
              NULL, HFILL
4475
14
            }
4476
14
        },
4477
14
        { &hf_mac_nr_control_me_phr_ph_c12,
4478
14
            { "PH for SCellIndex 12",
4479
14
              "mac-nr.control.me-phr.ph.c12", FT_UINT8, BASE_DEC, NULL, 0x3f,
4480
14
              NULL, HFILL
4481
14
            }
4482
14
        },
4483
14
        { &hf_mac_nr_control_me_phr_ph_c11,
4484
14
            { "PH for SCellIndex 11",
4485
14
              "mac-nr.control.me-phr.ph.c11", FT_UINT8, BASE_DEC, NULL, 0x3f,
4486
14
              NULL, HFILL
4487
14
            }
4488
14
        },
4489
14
        { &hf_mac_nr_control_me_phr_ph_c10,
4490
14
            { "PH for SCellIndex 10",
4491
14
              "mac-nr.control.me-phr.ph.c10", FT_UINT8, BASE_DEC, NULL, 0x3f,
4492
14
              NULL, HFILL
4493
14
            }
4494
14
        },
4495
14
        { &hf_mac_nr_control_me_phr_ph_c9,
4496
14
            { "PH for SCellIndex 9",
4497
14
              "mac-nr.control.me-phr.ph.c9", FT_UINT8, BASE_DEC, NULL, 0x3f,
4498
14
              NULL, HFILL
4499
14
            }
4500
14
        },
4501
14
        { &hf_mac_nr_control_me_phr_ph_c8,
4502
14
            { "PH for SCellIndex 8",
4503
14
              "mac-nr.control.me-phr.ph.c8", FT_UINT8, BASE_DEC, NULL, 0x3f,
4504
14
              NULL, HFILL
4505
14
            }
4506
14
        },
4507
14
        { &hf_mac_nr_control_me_phr_ph_c7,
4508
14
            { "PH for SCellIndex 7",
4509
14
              "mac-nr.control.me-phr.ph.c7", FT_UINT8, BASE_DEC, NULL, 0x3f,
4510
14
              NULL, HFILL
4511
14
            }
4512
14
        },
4513
14
        { &hf_mac_nr_control_me_phr_ph_c6,
4514
14
            { "PH for SCellIndex 6",
4515
14
              "mac-nr.control.me-phr.ph.c6", FT_UINT8, BASE_DEC, NULL, 0x3f,
4516
14
              NULL, HFILL
4517
14
            }
4518
14
        },
4519
14
        { &hf_mac_nr_control_me_phr_ph_c5,
4520
14
            { "PH for SCellIndex 5",
4521
14
              "mac-nr.control.me-phr.ph.c5", FT_UINT8, BASE_DEC, NULL, 0x3f,
4522
14
              NULL, HFILL
4523
14
            }
4524
14
        },
4525
14
        { &hf_mac_nr_control_me_phr_ph_c4,
4526
14
            { "PH for SCellIndex 4",
4527
14
              "mac-nr.control.me-phr.ph.c4", FT_UINT8, BASE_DEC, NULL, 0x3f,
4528
14
              NULL, HFILL
4529
14
            }
4530
14
        },
4531
14
        { &hf_mac_nr_control_me_phr_ph_c3,
4532
14
            { "PH for SCellIndex 3",
4533
14
              "mac-nr.control.me-phr.ph.c3", FT_UINT8, BASE_DEC, NULL, 0x3f,
4534
14
              NULL, HFILL
4535
14
            }
4536
14
        },
4537
14
        { &hf_mac_nr_control_me_phr_ph_c2,
4538
14
            { "PH for SCellIndex 2",
4539
14
              "mac-nr.control.me-phr.ph.c2", FT_UINT8, BASE_DEC, NULL, 0x3f,
4540
14
              NULL, HFILL
4541
14
            }
4542
14
        },
4543
14
        { &hf_mac_nr_control_me_phr_ph_c1,
4544
14
            { "PH for SCellIndex 1",
4545
14
              "mac-nr.control.me-phr.ph.c1", FT_UINT8, BASE_DEC, NULL, 0x3f,
4546
14
              NULL, HFILL
4547
14
            }
4548
14
        },
4549
14
        { &hf_mac_nr_control_me_phr_reserved_2,
4550
14
            { "Reserved",
4551
14
              "mac-nr.control.me-phr.reserved", FT_BOOLEAN, 8, NULL, 0xc0,
4552
14
              NULL, HFILL
4553
14
            }
4554
14
        },
4555
14
        { &hf_mac_nr_control_me_phr_pcmax_f_c_type2_spcell,
4556
14
            { "Pcmax,f,c",
4557
14
              "mac-nr.control.me-phr.type2-spcell", FT_UINT8, BASE_DEC, NULL, 0x3f,
4558
14
              NULL, HFILL
4559
14
            }
4560
14
        },
4561
14
        { &hf_mac_nr_control_me_phr_pcmax_f_c_type1_pcell,
4562
14
            { "Pcmax,f,c",
4563
14
              "mac-nr.control.me-phr.type1-pcell", FT_UINT8, BASE_CUSTOM, CF_FUNC(mac_nr_pcmax_f_c_fmt), 0x3f,
4564
14
              NULL, HFILL
4565
14
            }
4566
14
        },
4567
14
        { &hf_mac_nr_control_me_phr_pcmax_f_c_typeX,
4568
14
            { "Pcmax,f,c",
4569
14
              "mac-nr.control.me-phr.typeX", FT_UINT8, BASE_DEC, NULL, 0x3f,
4570
14
              NULL, HFILL
4571
14
            }
4572
14
        },
4573
4574
14
        { &hf_mac_nr_control_recommended_bit_rate_lcid,
4575
14
            { "LCID",
4576
14
              "mac-nr.control.recommended-bit-rate.lcid", FT_UINT8, BASE_DEC, NULL, 0xfc,
4577
14
              NULL, HFILL
4578
14
            }
4579
14
        },
4580
14
        { &hf_mac_nr_control_recommended_bit_rate_dir,
4581
14
            { "Direction",
4582
14
              "mac-nr.control.recommended-bit-rate.dir", FT_BOOLEAN, 8, TFS(&tfs_uplink_downlink), 0x02,
4583
14
              NULL, HFILL
4584
14
            }
4585
14
        },
4586
14
        { &hf_mac_nr_control_recommended_bit_rate_bit_rate,
4587
14
            { "Bit Rate",
4588
14
              "mac-nr.control.recommended-bit-rate.bit-rate", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &bit_rate_vals_ext, 0x01f8,
4589
14
              NULL, HFILL
4590
14
            }
4591
14
        },
4592
14
        { &hf_mac_nr_control_recommended_bit_rate_reserved,
4593
14
            { "Reserved",
4594
14
              "mac-nr.control.recommended-bit-rate.reserved", FT_UINT8, BASE_DEC, NULL, 0x07,
4595
14
              NULL, HFILL
4596
14
            }
4597
14
        },
4598
4599
14
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_ad,
4600
14
            { "Reserved",
4601
14
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.ad", FT_BOOLEAN, 8, TFS(&activation_deactivation_vals), 0x80,
4602
14
              NULL, HFILL
4603
14
            }
4604
14
        },
4605
14
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_serving_cell_id,
4606
14
            { "Serving Cell ID",
4607
14
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4608
14
              NULL, HFILL
4609
14
            }
4610
14
        },
4611
14
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_bwp_id,
4612
14
            { "BWP ID",
4613
14
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4614
14
              NULL, HFILL
4615
14
            }
4616
14
        },
4617
14
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_reserved_2,
4618
14
            { "Reserved",
4619
14
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0xf0,
4620
14
              NULL, HFILL
4621
14
            }
4622
14
        },
4623
14
        { &hf_mac_control_sp_zp_csi_rs_resource_set_act_deact_sp_zp_rs_resource_set_id,
4624
14
            { "SP ZP CSI-RS resource set ID",
4625
14
              "mac-nr.control.sp-zp-csi-rs-resource-set-act-deact.sp-zp-rs-resource-set-id", FT_UINT8, BASE_DEC, NULL, 0x0f,
4626
14
              NULL, HFILL
4627
14
            }
4628
14
        },
4629
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_reserved,
4630
14
            { "Reserved",
4631
14
              "mac-nr.control.pucch-spatial-rel-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
4632
14
              NULL, HFILL
4633
14
            }
4634
14
        },
4635
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_serving_cell_id,
4636
14
            { "Serving Cell ID",
4637
14
              "mac-nr.control.pucch-spatial-rel-act-deact.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4638
14
              NULL, HFILL
4639
14
            }
4640
14
        },
4641
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_bwp_id,
4642
14
            { "BWP ID",
4643
14
              "mac-nr.control.pucch-spatial-rel-act-deact.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4644
14
              NULL, HFILL
4645
14
            }
4646
14
        },
4647
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_pucch_resource_id,
4648
14
            { "PUCCH Resource ID",
4649
14
              "mac-nr.control.pucch-spatial-rel-act-deact.pucch-resource-id", FT_UINT8, BASE_DEC, NULL, 0x7f,
4650
14
              NULL, HFILL
4651
14
            }
4652
14
        },
4653
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s8,
4654
14
            { "PUCCH Spatial Relation Info 8",
4655
14
              "mac-nr.control.pucch-spatial-rel-act-deact.s8", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
4656
14
              NULL, HFILL
4657
14
            }
4658
14
        },
4659
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s7,
4660
14
            { "PUCCH Spatial Relation Info 7",
4661
14
              "mac-nr.control.pucch-spatial-rel-act-deact.s7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
4662
14
              NULL, HFILL
4663
14
            }
4664
14
        },
4665
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s6,
4666
14
            { "PUCCH Spatial Relation Info 6",
4667
14
              "mac-nr.control.pucch-spatial-rel-act-deact.s6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
4668
14
              NULL, HFILL
4669
14
            }
4670
14
        },
4671
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s5,
4672
14
            { "PUCCH Spatial Relation Info 5",
4673
14
              "mac-nr.control.pucch-spatial-rel-act-deact.s5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
4674
14
              NULL, HFILL
4675
14
            }
4676
14
        },
4677
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s4,
4678
14
            { "PUCCH Spatial Relation Info 4",
4679
14
              "mac-nr.control.pucch-spatial-rel-act-deact.s4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
4680
14
              NULL, HFILL
4681
14
            }
4682
14
        },
4683
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s3,
4684
14
            { "PUCCH Spatial Relation Info 3",
4685
14
              "mac-nr.control.pucch-spatial-rel-act-deact.s3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
4686
14
              NULL, HFILL
4687
14
            }
4688
14
        },
4689
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s2,
4690
14
            { "PUCCH Spatial Relation Info 2",
4691
14
              "mac-nr.control.pucch-spatial-rel-act-deact.s2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
4692
14
              NULL, HFILL
4693
14
            }
4694
14
        },
4695
14
        { &hf_mac_nr_control_pucch_spatial_rel_act_deact_s1,
4696
14
            { "PUCCH Spatial Relation Info 1",
4697
14
              "mac-nr.control.pucch-spatial-rel-act-deact.s1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
4698
14
              NULL, HFILL
4699
14
            }
4700
14
        },
4701
14
        { &hf_mac_nr_control_sp_srs_act_deact_ad,
4702
14
            { "A/D",
4703
14
              "mac-nr.control.sp-srs-act-deact.ad", FT_BOOLEAN, 8, TFS(&activation_deactivation_vals), 0x80,
4704
14
              NULL, HFILL
4705
14
            }
4706
14
        },
4707
14
        { &hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_cell_id,
4708
14
            { "SRS Resource Set's Cell ID",
4709
14
              "mac-nr.control.sp-srs-act-deact.srs-resource-set-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4710
14
              NULL, HFILL
4711
14
            }
4712
14
        },
4713
14
        { &hf_mac_nr_control_sp_srs_act_deact_srs_resource_set_bwp_id,
4714
14
            { "SRS Resource Set's BWP ID",
4715
14
              "mac-nr.control.sp-srs-act-deact.srs-resource-set-bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4716
14
              NULL, HFILL
4717
14
            }
4718
14
        },
4719
14
        { &hf_mac_nr_control_sp_srs_act_deact_reserved,
4720
14
            { "Reserved",
4721
14
              "mac-nr.control.sp-srs-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x00,
4722
14
              NULL, HFILL
4723
14
            }
4724
14
        },
4725
14
        { &hf_mac_nr_control_sp_srs_act_deact_c,
4726
14
            { "C",
4727
14
              "mac-nr.control.sp-srs-act-deact.c", FT_BOOLEAN, 8, TFS(&c_vals), 0x20,
4728
14
              NULL, HFILL
4729
14
            }
4730
14
        },
4731
14
        { &hf_mac_nr_control_sp_srs_act_deact_sul,
4732
14
            { "SUL",
4733
14
              "mac-nr.control.sp-srs-act-deact.sul", FT_BOOLEAN, 8, TFS(&sul_vals), 0x10,
4734
14
              NULL, HFILL
4735
14
            }
4736
14
        },
4737
14
        { &hf_mac_nr_control_sp_srs_act_deact_sp_srs_resource_set_id,
4738
14
            { "SP SRS Resource Set ID",
4739
14
              "mac-nr.control.sp-srs-act-deact.sp-srs-resource-set-id", FT_UINT8, BASE_DEC, NULL, 0x0f,
4740
14
              NULL, HFILL
4741
14
            }
4742
14
        },
4743
14
        { &hf_mac_nr_control_sp_srs_act_deact_f,
4744
14
            { "F",
4745
14
              "mac-nr.control.sp-srs-act-deact.f", FT_BOOLEAN, 8, TFS(&sp_srs_act_deact_f_vals), 0x80,
4746
14
              NULL, HFILL
4747
14
            }
4748
14
        },
4749
14
        { &hf_mac_nr_control_sp_srs_act_deact_resource_id,
4750
14
            { "Resource ID",
4751
14
              "mac-nr.control.sp-srs-act-deact.resource-id", FT_UINT8, BASE_DEC, NULL, 0x7f,
4752
14
              NULL, HFILL
4753
14
            }
4754
14
        },
4755
14
        { &hf_mac_nr_control_sp_srs_act_deact_resource_id_ssb,
4756
14
            { "Resource ID",
4757
14
              "mac-nr.control.sp-srs-act-deact.resource-id", FT_UINT8, BASE_DEC, NULL, 0x3f,
4758
14
              NULL, HFILL
4759
14
            }
4760
14
        },
4761
4762
14
        { &hf_mac_nr_control_sp_srs_act_deact_resource_serving_cell_id,
4763
14
            { "Resource Serving Cell ID",
4764
14
              "mac-nr.control.sp-srs-act-deact.resource-serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4765
14
              NULL, HFILL
4766
14
            }
4767
14
        },
4768
14
        { &hf_mac_nr_control_sp_srs_act_deact_resource_bwp_id,
4769
14
            { "Resource BWP ID",
4770
14
              "mac-nr.control.sp-srs-act-deact.resource-bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4771
14
              NULL, HFILL
4772
14
            }
4773
14
        },
4774
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_reserved,
4775
14
            { "Reserved",
4776
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
4777
14
              NULL, HFILL
4778
14
            }
4779
14
        },
4780
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_serving_cell_id,
4781
14
            { "Serving Cell ID",
4782
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4783
14
              NULL, HFILL
4784
14
            }
4785
14
        },
4786
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_bwp_id,
4787
14
            { "BWP ID",
4788
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4789
14
              NULL, HFILL
4790
14
            }
4791
14
        },
4792
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s7,
4793
14
            { "Semi-Persistent CSI report configuration 7",
4794
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
4795
14
              NULL, HFILL
4796
14
            }
4797
14
        },
4798
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s6,
4799
14
            { "Semi-Persistent CSI report configuration 6",
4800
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
4801
14
              NULL, HFILL
4802
14
            }
4803
14
        },
4804
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s5,
4805
14
            { "Semi-Persistent CSI report configuration 5",
4806
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
4807
14
              NULL, HFILL
4808
14
            }
4809
14
        },
4810
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s4,
4811
14
            { "Semi-Persistent CSI report configuration 4",
4812
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
4813
14
              NULL, HFILL
4814
14
            }
4815
14
        },
4816
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s3,
4817
14
            { "Semi-Persistent CSI report configuration 3",
4818
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
4819
14
              NULL, HFILL
4820
14
            }
4821
14
        },
4822
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s2,
4823
14
            { "Semi-Persistent CSI report configuration 2",
4824
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
4825
14
              NULL, HFILL
4826
14
            }
4827
14
        },
4828
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s1,
4829
14
            { "Semi-Persistent CSI report configuration 1",
4830
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
4831
14
              NULL, HFILL
4832
14
            }
4833
14
        },
4834
14
        { &hf_mac_nr_control_sp_csi_report_on_pucch_act_deact_s0,
4835
14
            { "Semi-Persistent CSI report configuration 0",
4836
14
              "mac-nr.control.sp-csi-report-on-pucch-act-deact.s0", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
4837
14
              NULL, HFILL
4838
14
            }
4839
14
        },
4840
14
        { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_serving_cell_id,
4841
14
            { "Serving Cell ID",
4842
14
              "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0xf8,
4843
14
              NULL, HFILL
4844
14
            }
4845
14
        },
4846
14
        { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_coreset_id,
4847
14
            { "CORESET ID",
4848
14
              "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.coreset-id", FT_UINT16, BASE_DEC, NULL, 0x0780,
4849
14
              NULL, HFILL
4850
14
            }
4851
14
        },
4852
14
        { &hf_mac_nr_control_tci_state_ind_for_ue_spec_pdcch_tci_state_id,
4853
14
            { "TCI State ID",
4854
14
              "mac-nr.control.tci-state-ind-for-ue-spec-pdcch.tci-state-id", FT_UINT8, BASE_DEC, NULL, 0x7f,
4855
14
              NULL, HFILL
4856
14
            }
4857
14
        },
4858
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_reserved,
4859
14
            { "Reserved",
4860
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
4861
14
              NULL, HFILL
4862
14
            }
4863
14
        },
4864
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_serving_cell_id,
4865
14
            { "Serving Cell ID",
4866
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4867
14
              NULL, HFILL
4868
14
            }
4869
14
        },
4870
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_bwp_id,
4871
14
            { "BWP ID",
4872
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4873
14
              NULL, HFILL
4874
14
            }
4875
14
        },
4876
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t7,
4877
14
            { "TCI state N+7",
4878
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
4879
14
              NULL, HFILL
4880
14
            }
4881
14
        },
4882
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t6,
4883
14
            { "TCI state N+6",
4884
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
4885
14
              NULL, HFILL
4886
14
            }
4887
14
        },
4888
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t5,
4889
14
            { "TCI state N+5",
4890
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
4891
14
              NULL, HFILL
4892
14
            }
4893
14
        },
4894
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t4,
4895
14
            { "TCI state N+4",
4896
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
4897
14
              NULL, HFILL
4898
14
            }
4899
14
        },
4900
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t3,
4901
14
            { "TCI state N+3",
4902
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
4903
14
              NULL, HFILL
4904
14
            }
4905
14
        },
4906
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t2,
4907
14
            { "TCI state N+2",
4908
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
4909
14
              NULL, HFILL
4910
14
            }
4911
14
        },
4912
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t1,
4913
14
            { "TCI state N+1",
4914
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
4915
14
              NULL, HFILL
4916
14
            }
4917
14
        },
4918
14
        { &hf_mac_nr_control_tci_states_act_deact_for_ue_spec_pdsch_t0,
4919
14
            { "TCI state N",
4920
14
              "mac-nr.control.tci-states-act-deact-for-ue-spec-pdsch.t0", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
4921
14
              NULL, HFILL
4922
14
            }
4923
14
        },
4924
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_reserved,
4925
14
            { "Reserved",
4926
14
              "mac-nr.control.aper-csi-trigger-state-subselect.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
4927
14
              NULL, HFILL
4928
14
            }
4929
14
        },
4930
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_serving_cell_id,
4931
14
            { "Serving Cell ID",
4932
14
              "mac-nr.control.aper-csi-trigger-state-subselect.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4933
14
              NULL, HFILL
4934
14
            }
4935
14
        },
4936
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_bwp_id,
4937
14
            { "BWP ID",
4938
14
              "mac-nr.control.aper-csi-trigger-state-subselect.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
4939
14
              NULL, HFILL
4940
14
            }
4941
14
        },
4942
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t7,
4943
14
            { "Aperiodic trigger state N+7",
4944
14
              "mac-nr.control.aper-csi-trigger-state-subselect.t7", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x80,
4945
14
              NULL, HFILL
4946
14
            }
4947
14
        },
4948
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t6,
4949
14
            { "Aperiodic trigger state N+6",
4950
14
              "mac-nr.control.aper-csi-trigger-state-subselect.t6", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x40,
4951
14
              NULL, HFILL
4952
14
            }
4953
14
        },
4954
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t5,
4955
14
            { "Aperiodic trigger state N+5",
4956
14
              "mac-nr.control.aper-csi-trigger-state-subselect.t5", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x20,
4957
14
              NULL, HFILL
4958
14
            }
4959
14
        },
4960
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t4,
4961
14
            { "Aperiodic trigger state N+4",
4962
14
              "mac-nr.control.aper-csi-trigger-state-subselect.t4", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x10,
4963
14
              NULL, HFILL
4964
14
            }
4965
14
        },
4966
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t3,
4967
14
            { "Aperiodic trigger state N+3",
4968
14
              "mac-nr.control.aper-csi-trigger-state-subselect.t3", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x08,
4969
14
              NULL, HFILL
4970
14
            }
4971
14
        },
4972
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t2,
4973
14
            { "Aperiodic trigger state N+2",
4974
14
              "mac-nr.control.aper-csi-trigger-state-subselect.t2", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x04,
4975
14
              NULL, HFILL
4976
14
            }
4977
14
        },
4978
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t1,
4979
14
            { "Aperiodic trigger state N+1",
4980
14
              "mac-nr.control.aper-csi-trigger-state-subselect.t1", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x02,
4981
14
              NULL, HFILL
4982
14
            }
4983
14
        },
4984
14
        { &hf_mac_nr_control_aper_csi_trigger_state_subselect_t0,
4985
14
            { "Aperiodic trigger state N",
4986
14
              "mac-nr.control.aper-csi-trigger-state-subselect.t0", FT_BOOLEAN, 8, TFS(&aper_csi_trigger_state_t_vals), 0x01,
4987
14
              NULL, HFILL
4988
14
            }
4989
14
        },
4990
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_ad,
4991
14
            { "A/D",
4992
14
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.ad", FT_BOOLEAN, 8, TFS(&activation_deactivation_vals), 0x80,
4993
14
              NULL, HFILL
4994
14
            }
4995
14
        },
4996
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_serving_cell_id,
4997
14
            { "Serving Cell ID",
4998
14
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.serving-cell-id", FT_UINT8, BASE_DEC, NULL, 0x7c,
4999
14
              NULL, HFILL
5000
14
            }
5001
14
        },
5002
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_bwp_id,
5003
14
            { "BWP ID",
5004
14
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.bwp-id", FT_UINT8, BASE_DEC, NULL, 0x03,
5005
14
              NULL, HFILL
5006
14
            }
5007
14
        },
5008
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved,
5009
14
            { "Reserved",
5010
14
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0xe0,
5011
14
              NULL, HFILL
5012
14
            }
5013
14
        },
5014
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_im,
5015
14
            { "IM",
5016
14
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.im", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5017
14
              NULL, HFILL
5018
14
            }
5019
14
        },
5020
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_rs_res_set_id,
5021
14
            { "SP CSI-RS resource set ID",
5022
14
              "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
14
              NULL, HFILL
5024
14
            }
5025
14
        },
5026
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved2,
5027
14
            { "Reserved",
5028
14
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0xf0,
5029
14
              NULL, HFILL
5030
14
            }
5031
14
        },
5032
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_sp_csi_im_res_set_id,
5033
14
            { "SP CSI-IM resource set ID",
5034
14
              "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
14
              NULL, HFILL
5036
14
            }
5037
14
        },
5038
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_reserved3,
5039
14
            { "Reserved",
5040
14
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x80,
5041
14
              NULL, HFILL
5042
14
            }
5043
14
        },
5044
14
        { &hf_mac_nr_control_sp_csi_rs_csi_im_res_set_act_deact_tci_state_id,
5045
14
            { "TCI State ID",
5046
14
              "mac-nr.control.sp-csi-rs-cs-im-res-set-act-deact.tci-state-id", FT_UINT8, BASE_DEC, NULL, 0x7f,
5047
14
              NULL, HFILL
5048
14
            }
5049
14
        },
5050
14
        { &hf_mac_nr_control_dupl_act_deact_drb7,
5051
14
            { "DRB 7",
5052
14
              "mac-nr.control.dupl-act-deact.drb7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5053
14
              NULL, HFILL
5054
14
            }
5055
14
        },
5056
14
        { &hf_mac_nr_control_dupl_act_deact_drb6,
5057
14
            { "DRB 6",
5058
14
              "mac-nr.control.dupl-act-deact.drb6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5059
14
              NULL, HFILL
5060
14
            }
5061
14
        },
5062
14
        { &hf_mac_nr_control_dupl_act_deact_drb5,
5063
14
            { "DRB 5",
5064
14
              "mac-nr.control.dupl-act-deact.drb5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5065
14
              NULL, HFILL
5066
14
            }
5067
14
        },
5068
14
        { &hf_mac_nr_control_dupl_act_deact_drb4,
5069
14
            { "DRB 4",
5070
14
              "mac-nr.control.dupl-act-deact.drb4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5071
14
              NULL, HFILL
5072
14
            }
5073
14
        },
5074
14
        { &hf_mac_nr_control_dupl_act_deact_drb3,
5075
14
            { "DRB 3",
5076
14
              "mac-nr.control.dupl-act-deact.drb3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5077
14
              NULL, HFILL
5078
14
            }
5079
14
        },
5080
14
        { &hf_mac_nr_control_dupl_act_deact_drb2,
5081
14
            { "DRB 2",
5082
14
              "mac-nr.control.dupl-act-deact.drb2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5083
14
              NULL, HFILL
5084
14
            }
5085
14
        },
5086
14
        { &hf_mac_nr_control_dupl_act_deact_drb1,
5087
14
            { "DRB 1",
5088
14
              "mac-nr.control.dupl-act-deact.drb1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5089
14
              NULL, HFILL
5090
14
            }
5091
14
        },
5092
14
        { &hf_mac_nr_control_dupl_act_deact_reserved,
5093
14
            { "Reserved",
5094
14
              "mac-nr.control.dupl-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x01,
5095
14
              NULL, HFILL
5096
14
            }
5097
14
        },
5098
14
        { &hf_mac_nr_control_scell_act_deact_cell7,
5099
14
            { "Cell 7",
5100
14
              "mac-nr.control.scell-act-deact.cell7", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5101
14
              NULL, HFILL
5102
14
            }
5103
14
        },
5104
14
        { &hf_mac_nr_control_scell_act_deact_cell6,
5105
14
            { "Cell 6",
5106
14
              "mac-nr.control.scell-act-deact.cell6", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5107
14
              NULL, HFILL
5108
14
            }
5109
14
        },
5110
14
        { &hf_mac_nr_control_scell_act_deact_cell5,
5111
14
            { "Cell 5",
5112
14
              "mac-nr.control.scell-act-deact.cell5", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5113
14
              NULL, HFILL
5114
14
            }
5115
14
        },
5116
14
        { &hf_mac_nr_control_scell_act_deact_cell4,
5117
14
            { "Cell 4",
5118
14
              "mac-nr.control.scell-act-deact.cell4", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5119
14
              NULL, HFILL
5120
14
            }
5121
14
        },
5122
14
        { &hf_mac_nr_control_scell_act_deact_cell3,
5123
14
            { "Cell 3",
5124
14
              "mac-nr.control.scell-act-deact.cell3", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5125
14
              NULL, HFILL
5126
14
            }
5127
14
        },
5128
14
        { &hf_mac_nr_control_scell_act_deact_cell2,
5129
14
            { "Cell 2",
5130
14
              "mac-nr.control.scell-act-deact.cell2", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5131
14
              NULL, HFILL
5132
14
            }
5133
14
        },
5134
14
        { &hf_mac_nr_control_scell_act_deact_cell1,
5135
14
            { "Cell 1",
5136
14
              "mac-nr.control.scell-act-deact.cell1", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5137
14
              NULL, HFILL
5138
14
            }
5139
14
        },
5140
14
        { &hf_mac_nr_control_scell_act_deact_reserved,
5141
14
            { "Reserved",
5142
14
              "mac-nr.control.scell-act-deact.reserved", FT_UINT8, BASE_HEX, NULL, 0x01,
5143
14
              NULL, HFILL
5144
14
            }
5145
14
        },
5146
14
        { &hf_mac_nr_control_scell_act_deact_cell15,
5147
14
            { "Cell 15",
5148
14
              "mac-nr.control.scell-act-deact.cell15", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5149
14
              NULL, HFILL
5150
14
            }
5151
14
        },
5152
14
        { &hf_mac_nr_control_scell_act_deact_cell14,
5153
14
            { "Cell 14",
5154
14
              "mac-nr.control.scell-act-deact.cell14", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5155
14
              NULL, HFILL
5156
14
            }
5157
14
        },
5158
14
        { &hf_mac_nr_control_scell_act_deact_cell13,
5159
14
            { "Cell 13",
5160
14
              "mac-nr.control.scell-act-deact.cell13", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5161
14
              NULL, HFILL
5162
14
            }
5163
14
        },
5164
14
        { &hf_mac_nr_control_scell_act_deact_cell12,
5165
14
            { "Cell 12",
5166
14
              "mac-nr.control.scell-act-deact.cell12", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5167
14
              NULL, HFILL
5168
14
            }
5169
14
        },
5170
14
        { &hf_mac_nr_control_scell_act_deact_cell11,
5171
14
            { "Cell 11",
5172
14
              "mac-nr.control.scell-act-deact.cell11", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5173
14
              NULL, HFILL
5174
14
            }
5175
14
        },
5176
14
        { &hf_mac_nr_control_scell_act_deact_cell10,
5177
14
            { "Cell 10",
5178
14
              "mac-nr.control.scell-act-deact.cell10", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5179
14
              NULL, HFILL
5180
14
            }
5181
14
        },
5182
14
        { &hf_mac_nr_control_scell_act_deact_cell9,
5183
14
            { "Cell 9",
5184
14
              "mac-nr.control.scell-act-deact.cell9", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5185
14
              NULL, HFILL
5186
14
            }
5187
14
        },
5188
14
        { &hf_mac_nr_control_scell_act_deact_cell8,
5189
14
            { "Cell 8",
5190
14
              "mac-nr.control.scell-act-deact.cell8", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
5191
14
              NULL, HFILL
5192
14
            }
5193
14
        },
5194
14
        { &hf_mac_nr_control_scell_act_deact_cell23,
5195
14
            { "Cell 23",
5196
14
              "mac-nr.control.scell-act-deact.cell23", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5197
14
              NULL, HFILL
5198
14
            }
5199
14
        },
5200
14
        { &hf_mac_nr_control_scell_act_deact_cell22,
5201
14
            { "Cell 22",
5202
14
              "mac-nr.control.scell-act-deact.cell22", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5203
14
              NULL, HFILL
5204
14
            }
5205
14
        },
5206
14
        { &hf_mac_nr_control_scell_act_deact_cell21,
5207
14
            { "Cell 21",
5208
14
              "mac-nr.control.scell-act-deact.cell21", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5209
14
              NULL, HFILL
5210
14
            }
5211
14
        },
5212
14
        { &hf_mac_nr_control_scell_act_deact_cell20,
5213
14
            { "Cell 20",
5214
14
              "mac-nr.control.scell-act-deact.cell20", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5215
14
              NULL, HFILL
5216
14
            }
5217
14
        },
5218
14
        { &hf_mac_nr_control_scell_act_deact_cell19,
5219
14
            { "Cell 19",
5220
14
              "mac-nr.control.scell-act-deact.cell19", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5221
14
              NULL, HFILL
5222
14
            }
5223
14
        },
5224
14
        { &hf_mac_nr_control_scell_act_deact_cell18,
5225
14
            { "Cell 18",
5226
14
              "mac-nr.control.scell-act-deact.cell18", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5227
14
              NULL, HFILL
5228
14
            }
5229
14
        },
5230
14
        { &hf_mac_nr_control_scell_act_deact_cell17,
5231
14
            { "Cell 17",
5232
14
              "mac-nr.control.scell-act-deact.cell17", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5233
14
              NULL, HFILL
5234
14
            }
5235
14
        },
5236
14
        { &hf_mac_nr_control_scell_act_deact_cell16,
5237
14
            { "Cell 16",
5238
14
              "mac-nr.control.scell-act-deact.cell16", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
5239
14
              NULL, HFILL
5240
14
            }
5241
14
        },
5242
14
        { &hf_mac_nr_control_scell_act_deact_cell31,
5243
14
            { "Cell 31",
5244
14
              "mac-nr.control.scell-act-deact.cell31", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
5245
14
              NULL, HFILL
5246
14
            }
5247
14
        },
5248
14
        { &hf_mac_nr_control_scell_act_deact_cell30,
5249
14
            { "Cell 30",
5250
14
              "mac-nr.control.scell-act-deact.cell30", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
5251
14
              NULL, HFILL
5252
14
            }
5253
14
        },
5254
14
        { &hf_mac_nr_control_scell_act_deact_cell29,
5255
14
            { "Cell 29",
5256
14
              "mac-nr.control.scell-act-deact.cell29", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
5257
14
              NULL, HFILL
5258
14
            }
5259
14
        },
5260
14
        { &hf_mac_nr_control_scell_act_deact_cell28,
5261
14
            { "Cell 28",
5262
14
              "mac-nr.control.scell-act-deact.cell28", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
5263
14
              NULL, HFILL
5264
14
            }
5265
14
        },
5266
14
        { &hf_mac_nr_control_scell_act_deact_cell27,
5267
14
            { "Cell 27",
5268
14
              "mac-nr.control.scell-act-deact.cell27", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
5269
14
              NULL, HFILL
5270
14
            }
5271
14
        },
5272
14
        { &hf_mac_nr_control_scell_act_deact_cell26,
5273
14
            { "Cell 26",
5274
14
              "mac-nr.control.scell-act-deact.cell26", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
5275
14
              NULL, HFILL
5276
14
            }
5277
14
        },
5278
14
        { &hf_mac_nr_control_scell_act_deact_cell25,
5279
14
            { "Cell 25",
5280
14
              "mac-nr.control.scell-act-deact.cell25", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
5281
14
              NULL, HFILL
5282
14
            }
5283
14
        },
5284
14
        { &hf_mac_nr_control_scell_act_deact_cell24,
5285
14
            { "Cell 24",
5286
14
              "mac-nr.control.scell-act-deact.cell24", FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x01,
5287
14
              NULL, HFILL
5288
14
            }
5289
14
        },
5290
14
        { &hf_mac_nr_control_bsr_short_lcg,
5291
14
            { "LCG",
5292
14
              "mac-nr.control.bsr.short.lcg", FT_UINT8, BASE_DEC, NULL, 0xe0,
5293
14
              "Logical Channel Group", HFILL
5294
14
            }
5295
14
        },
5296
14
        { &hf_mac_nr_control_bsr_short_bs_lcg0,
5297
14
            { "Buffer Size for LCG0",
5298
14
              "mac-nr.control.bsr.bs-lcg0", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5299
14
              NULL, HFILL
5300
14
            }
5301
14
        },
5302
14
        { &hf_mac_nr_control_bsr_short_bs_lcg1,
5303
14
            { "Buffer Size for LCG1",
5304
14
              "mac-nr.control.bsr.bs-lcg1", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5305
14
              NULL, HFILL
5306
14
            }
5307
14
        },
5308
14
        { &hf_mac_nr_control_bsr_short_bs_lcg2,
5309
14
            { "Buffer Size for LCG2",
5310
14
              "mac-nr.control.bsr.bs-lcg2", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5311
14
              NULL, HFILL
5312
14
            }
5313
14
        },
5314
14
        { &hf_mac_nr_control_bsr_short_bs_lcg3,
5315
14
            { "Buffer Size for LCG3",
5316
14
              "mac-nr.control.bsr.bs-lcg3", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5317
14
              NULL, HFILL
5318
14
            }
5319
14
        },
5320
14
        { &hf_mac_nr_control_bsr_short_bs_lcg4,
5321
14
            { "Buffer Size for LCG4",
5322
14
              "mac-nr.control.bsr.bs-lcg4", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5323
14
              NULL, HFILL
5324
14
            }
5325
14
        },
5326
14
        { &hf_mac_nr_control_bsr_short_bs_lcg5,
5327
14
            { "Buffer Size for LCG5",
5328
14
              "mac-nr.control.bsr.bs-lcg5", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5329
14
              NULL, HFILL
5330
14
            }
5331
14
        },
5332
14
        { &hf_mac_nr_control_bsr_short_bs_lcg6,
5333
14
            { "Buffer Size for LCG6",
5334
14
              "mac-nr.control.bsr.bs-lcg6", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5335
14
              NULL, HFILL
5336
14
            }
5337
14
        },
5338
14
        { &hf_mac_nr_control_bsr_short_bs_lcg7,
5339
14
            { "Buffer Size for LCG7",
5340
14
              "mac-nr.control.bsr.bs-lcg7", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_5bits_vals_ext, 0x1f,
5341
14
              NULL, HFILL
5342
14
            }
5343
14
        },
5344
14
        { &hf_mac_nr_control_bsr_long_lcg7,
5345
14
            { "LCG7",
5346
14
              "mac-nr.control.bsr.long.lcg7", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
5347
14
              "Logical Channel Group 7", HFILL
5348
14
            }
5349
14
        },
5350
14
        { &hf_mac_nr_control_bsr_long_lcg6,
5351
14
            { "LCG6",
5352
14
              "mac-nr.control.bsr.long.lcg6", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
5353
14
              "Logical Channel Group 6", HFILL
5354
14
            }
5355
14
        },
5356
14
        { &hf_mac_nr_control_bsr_long_lcg5,
5357
14
            { "LCG5",
5358
14
              "mac-nr.control.bsr.long.lcg5", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
5359
14
              "Logical Channel Group 5", HFILL
5360
14
            }
5361
14
        },
5362
14
        { &hf_mac_nr_control_bsr_long_lcg4,
5363
14
            { "LCG4",
5364
14
              "mac-nr.control.bsr.long.lcg4", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
5365
14
              "Logical Channel Group 4", HFILL
5366
14
            }
5367
14
        },
5368
14
        { &hf_mac_nr_control_bsr_long_lcg3,
5369
14
            { "LCG3",
5370
14
              "mac-nr.control.bsr.long.lcg3", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
5371
14
              "Logical Channel Group 3", HFILL
5372
14
            }
5373
14
        },
5374
14
        { &hf_mac_nr_control_bsr_long_lcg2,
5375
14
            { "LCG2",
5376
14
              "mac-nr.control.bsr.long.lcg2", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
5377
14
              "Logical Channel Group 2", HFILL
5378
14
            }
5379
14
        },
5380
14
        { &hf_mac_nr_control_bsr_long_lcg1,
5381
14
            { "LCG1",
5382
14
              "mac-nr.control.bsr.long.lcg1", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
5383
14
              "Logical Channel Group 1", HFILL
5384
14
            }
5385
14
        },
5386
14
        { &hf_mac_nr_control_bsr_long_lcg0,
5387
14
            { "LCG0",
5388
14
              "mac-nr.control.bsr.long.lcg0", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
5389
14
              "Logical Channel Group 0", HFILL
5390
14
            }
5391
14
        },
5392
14
        { &hf_mac_nr_control_bsr_trunc_long_bs,
5393
14
            { "Buffer Size",
5394
14
              "mac-nr.control.bsr.trunc-bs", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5395
14
              NULL, HFILL
5396
14
            }
5397
14
        },
5398
14
        { &hf_mac_nr_control_bsr_long_bs_lcg7,
5399
14
            { "Buffer Size for LCG7",
5400
14
              "mac-nr.control.bsr.bs-lcg7", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5401
14
              NULL, HFILL
5402
14
            }
5403
14
        },
5404
14
        { &hf_mac_nr_control_bsr_long_bs_lcg6,
5405
14
            { "Buffer Size for LCG6",
5406
14
              "mac-nr.control.bsr.bs-lcg6", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5407
14
              NULL, HFILL
5408
14
            }
5409
14
        },
5410
14
        { &hf_mac_nr_control_bsr_long_bs_lcg5,
5411
14
            { "Buffer Size for LCG5",
5412
14
              "mac-nr.control.bsr.bs-lcg5", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5413
14
              NULL, HFILL
5414
14
            }
5415
14
        },
5416
14
        { &hf_mac_nr_control_bsr_long_bs_lcg4,
5417
14
            { "Buffer Size for LCG4",
5418
14
              "mac-nr.control.bsr.bs-lcg4", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5419
14
              NULL, HFILL
5420
14
            }
5421
14
        },
5422
14
        { &hf_mac_nr_control_bsr_long_bs_lcg3,
5423
14
            { "Buffer Size for LCG3",
5424
14
              "mac-nr.control.bsr.bs-lcg3", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5425
14
              NULL, HFILL
5426
14
            }
5427
14
        },
5428
14
        { &hf_mac_nr_control_bsr_long_bs_lcg2,
5429
14
            { "Buffer Size for LCG2",
5430
14
              "mac-nr.control.bsr.bs-lcg2", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5431
14
              NULL, HFILL
5432
14
            }
5433
14
        },
5434
14
        { &hf_mac_nr_control_bsr_long_bs_lcg1,
5435
14
            { "Buffer Size for LCG1",
5436
14
              "mac-nr.control.bsr.bs-lcg1", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5437
14
              NULL, HFILL
5438
14
            }
5439
14
        },
5440
14
        { &hf_mac_nr_control_bsr_long_bs_lcg0,
5441
14
            { "Buffer Size for LCG0",
5442
14
              "mac-nr.control.bsr.bs-lcg0", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &buffer_size_8bits_vals_ext, 0x0,
5443
14
              NULL, HFILL
5444
14
            }
5445
14
        },
5446
14
        { &hf_mac_nr_control_timing_advance_report_reserved,
5447
14
            { "Reserved",
5448
14
              "mac-nr.control.ta-command.reserved", FT_UINT8, BASE_HEX, NULL, 0xc0,
5449
14
              NULL, HFILL
5450
14
            }
5451
14
        },
5452
14
        { &hf_mac_nr_control_timing_advance_report_ta,
5453
14
            { "Timing Advance",
5454
14
              "mac-nr.control.ta-command.ta", FT_UINT16, BASE_DEC, NULL, 0x3f,
5455
14
              NULL, HFILL
5456
14
            }
5457
14
        },
5458
14
        { &hf_mac_nr_differential_koffset,
5459
14
            { "Differential Koffset",
5460
14
              "mac-nr.differential_koffset", FT_UINT8, BASE_DEC, NULL, 0x3f,
5461
14
              NULL, HFILL
5462
14
            }
5463
14
        },
5464
14
        { &hf_mac_nr_differential_koffset_reserved,
5465
14
            { "Reserved",
5466
14
              "mac-nr.differential_koffset.reserved", FT_UINT8, BASE_DEC, NULL, 0xc0,
5467
14
              NULL, HFILL
5468
14
            }
5469
14
        }, };
5470
5471
14
    static int *ett[] =
5472
14
    {
5473
14
        &ett_mac_nr,
5474
14
        &ett_mac_nr_context,
5475
14
        &ett_mac_nr_subheader,
5476
14
        &ett_mac_nr_rar_subheader,
5477
14
        &ett_mac_nr_rar_grant,
5478
14
        &ett_mac_nr_me_phr_entry
5479
14
    };
5480
5481
14
    static ei_register_info ei[] = {
5482
14
        { &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
14
        { &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
14
        { &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
14
        { &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
14
        { &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
14
    };
5488
5489
14
    module_t *mac_nr_module;
5490
14
    expert_module_t* expert_mac_nr;
5491
5492
14
    static const enum_val_t lcid_drb_source_vals[] = {
5493
14
        {"from-static-stable",          "From static table",           FromStaticTable},
5494
14
        {"from-configuration-protocol", "From configuration protocol", FromConfigurationProtocol},
5495
14
        {NULL, NULL, -1}
5496
14
    };
5497
5498
14
    static uat_field_t lcid_drb_mapping_flds[] = {
5499
14
        UAT_FLD_VS(lcid_drb_mappings, lcid, "LCID (3-32)", drb_lcid_vals,
5500
14
                   "The MAC LCID.  Note that under NR-DC, LCID 3 may be SRB-3. "
5501
14
                   "LCID 4 may also be LCID4"),
5502
14
        UAT_FLD_DEC(lcid_drb_mappings, drbid,"DRBID id (1-32)", "Identifier of logical data channel"),
5503
14
        UAT_FLD_VS(lcid_drb_mappings, bearer_type_ul, "UL RLC Bearer Type", rlc_bearer_type_vals, "UL Bearer Mode"),
5504
14
        UAT_FLD_VS(lcid_drb_mappings, bearer_type_dl, "DL RLC Bearer Type", rlc_bearer_type_vals, "DL Bearer Mode"),
5505
14
        UAT_END_FIELDS
5506
14
    };
5507
5508
    /* Register protocol. */
5509
14
    proto_mac_nr = proto_register_protocol("MAC-NR", "MAC-NR", "mac-nr");
5510
14
    proto_register_field_array(proto_mac_nr, hf, array_length(hf));
5511
14
    proto_register_subtree_array(ett, array_length(ett));
5512
14
    expert_mac_nr = expert_register_protocol(proto_mac_nr);
5513
14
    expert_register_field_array(expert_mac_nr, ei, array_length(ei));
5514
5515
    /* Allow other dissectors to find this one by name. */
5516
14
    register_dissector("mac-nr", dissect_mac_nr, proto_mac_nr);
5517
5518
    /* Register the tap name. */
5519
14
    mac_nr_tap = register_tap("mac-3gpp");
5520
5521
    /* Preferences */
5522
14
    mac_nr_module = prefs_register_protocol(proto_mac_nr, NULL);
5523
5524
14
    prefs_register_bool_preference(mac_nr_module, "attempt_rrc_decode",
5525
14
        "Attempt to decode BCCH, PCCH and CCCH data using NR RRC dissector",
5526
14
        "Attempt to decode BCCH, PCCH and CCCH data using NR RRC dissector",
5527
14
        &global_mac_nr_attempt_rrc_decode);
5528
5529
14
    prefs_register_bool_preference(mac_nr_module, "attempt_to_dissect_srb_sdus",
5530
14
        "Attempt to dissect LCID 1-4 as srb1-4",
5531
14
        "Will call NR RLC dissector with standard settings as per RRC spec, unless "
5532
14
        "LCID 3,4 are being used for user-plane",
5533
14
        &global_mac_nr_attempt_srb_decode);
5534
5535
14
    prefs_register_enum_preference(mac_nr_module, "lcid_to_drb_mapping_source",
5536
14
        "Source of LCID -> drb channel settings",
5537
14
        "Set whether LCID -> drb Table is taken from static table (below) or from "
5538
14
        "info learned from control protocol (i.e. RRC)",
5539
14
        &global_mac_nr_lcid_drb_source, lcid_drb_source_vals, false);
5540
5541
14
    lcid_drb_mappings_uat = uat_new("Static LCID -> drb Table",
5542
14
                                    sizeof(lcid_drb_mapping_t),
5543
14
                                    "drb_bearerconfig",
5544
14
                                    true,
5545
14
                                    &lcid_drb_mappings,
5546
14
                                    &num_lcid_drb_mappings,
5547
14
                                    UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
5548
14
                                    "",  /* TODO: is this ref to help manual? */
5549
14
                                    lcid_drb_mapping_copy_cb,
5550
14
                                    NULL,
5551
14
                                    NULL,
5552
14
                                    NULL,
5553
14
                                    NULL,
5554
14
                                    lcid_drb_mapping_flds);
5555
5556
14
    prefs_register_uat_preference(mac_nr_module,
5557
14
                                  "drb_table",
5558
14
                                  "LCID -> DRB Mappings Table",
5559
14
                                  "A table that maps from configurable lcids -> RLC bearer configs",
5560
14
                                  lcid_drb_mappings_uat);
5561
5562
14
    register_init_routine(&mac_nr_init_protocol);
5563
14
    register_cleanup_routine(&mac_nr_cleanup_protocol);
5564
14
}
5565
5566
void proto_reg_handoff_mac_nr(void)
5567
14
{
5568
    /* Add as a heuristic UDP dissector */
5569
14
    heur_dissector_add("udp", dissect_mac_nr_heur, "MAC-NR over UDP", "mac_nr_udp", proto_mac_nr, HEURISTIC_DISABLE);
5570
5571
14
    rlc_nr_handle = find_dissector_add_dependency("rlc-nr", proto_mac_nr);
5572
14
    nr_rrc_bcch_bch_handle = find_dissector_add_dependency("nr-rrc.bcch.bch", proto_mac_nr);
5573
14
    nr_rrc_bcch_dl_sch_handle = find_dissector_add_dependency("nr-rrc.bcch.dl.sch", proto_mac_nr);
5574
14
    nr_rrc_pcch_handle = find_dissector_add_dependency("nr-rrc.pcch", proto_mac_nr);
5575
14
    nr_rrc_dl_ccch_handle = find_dissector_add_dependency("nr-rrc.dl.ccch", proto_mac_nr);
5576
14
    nr_rrc_ul_ccch_handle = find_dissector_add_dependency("nr-rrc.ul.ccch", proto_mac_nr);
5577
14
    nr_rrc_ul_ccch1_handle = find_dissector_add_dependency("nr-rrc.ul.ccch1", proto_mac_nr);
5578
14
}
5579
5580
5581
/*
5582
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
5583
 *
5584
 * Local variables:
5585
 * c-basic-offset: 4
5586
 * tab-width: 8
5587
 * indent-tabs-mode: nil
5588
 * End:
5589
 *
5590
 * vi: set shiftwidth=4 tabstop=8 expandtab:
5591
 * :indentSize=4:tabSize=8:noTabs=true:
5592
 */