TODO netlogon_user_flags_ntlmv2_enabled
[wireshark-sm.git] / epan / dissectors / asn1 / ngap / packet-ngap-template.c
blob70d037834a0f8eebfa7dd472fe3a2a319b8d4580
1 /* packet-ngap.c
2 * Routines for NG-RAN NG Application Protocol (NGAP) packet dissection
3 * Copyright 2018, Anders Broman <anders.broman@ericsson.com>
4 * Copyright 2018-2024, Pascal Quantin <pascal@wireshark.org>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
12 * References: 3GPP TS 38.413 v18.4.0 (2024-09)
15 #include "config.h"
16 #include <stdio.h>
18 #include <epan/packet.h>
19 #include <epan/strutil.h>
20 #include <epan/asn1.h>
21 #include <epan/prefs.h>
22 #include <epan/sctpppids.h>
23 #include <epan/expert.h>
24 #include <epan/proto_data.h>
25 #include <epan/conversation.h>
26 #include <epan/exceptions.h>
27 #include <epan/show_exception.h>
28 #include <epan/tap.h>
29 #include <epan/stats_tree.h>
30 #include <epan/tfs.h>
31 #include <epan/unit_strings.h>
32 #include <wsutil/wsjson.h>
33 #include <wsutil/array.h>
35 #include "packet-ngap.h"
36 #include "packet-per.h"
37 #include "packet-e212.h"
38 #include "packet-s1ap.h"
39 #include "packet-ranap.h"
40 #include "packet-rrc.h"
41 #include "packet-lte-rrc.h"
42 #include "packet-nr-rrc.h"
43 #include "packet-gsm_map.h"
44 #include "packet-cell_broadcast.h"
45 #include "packet-ntp.h"
46 #include "packet-gsm_a_common.h"
47 #include "packet-media-type.h"
49 #define PNAME "NG Application Protocol"
50 #define PSNAME "NGAP"
51 #define PFNAME "ngap"
53 /* Dissector will use SCTP PPID 18 or SCTP port. IANA assigned port = 36412 */
54 #define SCTP_PORT_NGAP 38412
56 void proto_register_ngap(void);
57 void proto_reg_handoff_ngap(void);
59 static dissector_handle_t ngap_handle;
60 static dissector_handle_t ngap_media_type_handle;
61 static dissector_handle_t nas_5gs_handle;
62 static dissector_handle_t nr_rrc_ue_radio_paging_info_handle;
63 static dissector_handle_t nr_rrc_ue_radio_access_cap_info_handle;
64 static dissector_handle_t lte_rrc_ue_radio_paging_info_handle;
65 static dissector_handle_t lte_rrc_ue_radio_access_cap_info_handle;
66 static dissector_handle_t lte_rrc_ue_radio_paging_info_nb_handle;
67 static dissector_handle_t lte_rrc_ue_radio_access_cap_info_nb_handle;
68 static dissector_handle_t nrppa_handle;
70 static int proto_json;
72 #include "packet-ngap-val.h"
74 /* Initialize the protocol and registered fields */
75 static int proto_ngap;
76 static int hf_ngap_transportLayerAddressIPv4;
77 static int hf_ngap_transportLayerAddressIPv6;
78 static int hf_ngap_SerialNumber_gs;
79 static int hf_ngap_SerialNumber_msg_code;
80 static int hf_ngap_SerialNumber_upd_nb;
81 static int hf_ngap_WarningType_value;
82 static int hf_ngap_WarningType_emergency_user_alert;
83 static int hf_ngap_WarningType_popup;
84 static int hf_ngap_WarningMessageContents_nb_pages;
85 static int hf_ngap_WarningMessageContents_decoded_page;
86 static int hf_ngap_NGRANTraceID_TraceID;
87 static int hf_ngap_NGRANTraceID_TraceRecordingSessionReference;
88 static int hf_ngap_InterfacesToTrace_NG_C;
89 static int hf_ngap_InterfacesToTrace_Xn_C;
90 static int hf_ngap_InterfacesToTrace_Uu;
91 static int hf_ngap_InterfacesToTrace_F1_C;
92 static int hf_ngap_InterfacesToTrace_E1;
93 static int hf_ngap_InterfacesToTrace_reserved;
94 static int hf_ngap_RATRestrictionInformation_e_UTRA;
95 static int hf_ngap_RATRestrictionInformation_nR;
96 static int hf_ngap_RATRestrictionInformation_nR_unlicensed;
97 static int hf_ngap_RATRestrictionInformation_reserved;
98 static int hf_ngap_primaryRATRestriction_e_UTRA;
99 static int hf_ngap_primaryRATRestriction_nR;
100 static int hf_ngap_primaryRATRestriction_nR_unlicensed;
101 static int hf_ngap_primaryRATRestriction_nR_LEO;
102 static int hf_ngap_primaryRATRestriction_nR_MEO;
103 static int hf_ngap_primaryRATRestriction_nR_GEO;
104 static int hf_ngap_primaryRATRestriction_nR_OTHERSAT;
105 static int hf_ngap_primaryRATRestriction_e_UTRA_LEO;
106 static int hf_ngap_primaryRATRestriction_e_UTRA_MEO;
107 static int hf_ngap_primaryRATRestriction_e_UTRA_GEO;
108 static int hf_ngap_primaryRATRestriction_e_UTRA_OTHERSAT;
109 static int hf_ngap_primaryRATRestriction_reserved;
110 static int hf_ngap_secondaryRATRestriction_e_UTRA;
111 static int hf_ngap_secondaryRATRestriction_nR;
112 static int hf_ngap_secondaryRATRestriction_e_UTRA_unlicensed;
113 static int hf_ngap_secondaryRATRestriction_nR_unlicensed;
114 static int hf_ngap_secondaryRATRestriction_reserved;
115 static int hf_ngap_NrencryptionAlgorithms_nea1;
116 static int hf_ngap_NrencryptionAlgorithms_nea2;
117 static int hf_ngap_NrencryptionAlgorithms_nea3;
118 static int hf_ngap_NrencryptionAlgorithms_reserved;
119 static int hf_ngap_NrintegrityProtectionAlgorithms_nia1;
120 static int hf_ngap_NrintegrityProtectionAlgorithms_nia2;
121 static int hf_ngap_NrintegrityProtectionAlgorithms_nia3;
122 static int hf_ngap_NrintegrityProtectionAlgorithms_reserved;
123 static int hf_ngap_EUTRAencryptionAlgorithms_eea1;
124 static int hf_ngap_EUTRAencryptionAlgorithms_eea2;
125 static int hf_ngap_EUTRAencryptionAlgorithms_eea3;
126 static int hf_ngap_EUTRAencryptionAlgorithms_reserved;
127 static int hf_ngap_EUTRAintegrityProtectionAlgorithms_eia1;
128 static int hf_ngap_EUTRAintegrityProtectionAlgorithms_eia2;
129 static int hf_ngap_EUTRAintegrityProtectionAlgorithms_eia3;
130 static int hf_ngap_EUTRAintegrityProtectionAlgorithms_eia7;
131 static int hf_ngap_EUTRAintegrityProtectionAlgorithms_reserved;
132 static int hf_ngap_MeasurementsToActivate_M1;
133 static int hf_ngap_MeasurementsToActivate_M2;
134 static int hf_ngap_MeasurementsToActivate_M4;
135 static int hf_ngap_MeasurementsToActivate_M5;
136 static int hf_ngap_MeasurementsToActivate_M6;
137 static int hf_ngap_MeasurementsToActivate_M7;
138 static int hf_ngap_MeasurementsToActivate_M1_from_event;
139 static int hf_ngap_MeasurementsToActivate_reserved;
140 static int hf_ngap_MDT_Location_Information_GNSS;
141 static int hf_ngap_MDT_Location_Information_reserved;
142 static int hf_ngap_GlobalCable_ID_str;
143 static int hf_ngap_UpdateFeedback_CN_PDB_DL;
144 static int hf_ngap_UpdateFeedback_CN_PDB_UL;
145 static int hf_ngap_UpdateFeedback_reserved;
146 static int hf_ngap_extensionValue_data;
147 #include "packet-ngap-hf.c"
149 /* Initialize the subtree pointers */
150 static int ett_ngap;
151 static int ett_ngap_TransportLayerAddress;
152 static int ett_ngap_DataCodingScheme;
153 static int ett_ngap_SerialNumber;
154 static int ett_ngap_WarningType;
155 static int ett_ngap_WarningMessageContents;
156 static int ett_ngap_PLMNIdentity;
157 static int ett_ngap_NGAP_Message;
158 static int ett_ngap_NGRANTraceID;
159 static int ett_ngap_InterfacesToTrace;
160 static int ett_ngap_SourceToTarget_TransparentContainer;
161 static int ett_ngap_TargetToSource_TransparentContainer;
162 static int ett_ngap_RRCContainer;
163 static int ett_ngap_RATRestrictionInformation;
164 static int ett_ngap_primaryRATRestriction;
165 static int ett_ngap_secondaryRATRestriction;
166 static int ett_ngap_NrencryptionAlgorithms;
167 static int ett_ngap_NrintegrityProtectionAlgorithms;
168 static int ett_ngap_EUTRAencryptionAlgorithms;
169 static int ett_ngap_EUTRAintegrityProtectionAlgorithms;
170 static int ett_ngap_UERadioCapabilityForPagingOfNR;
171 static int ett_ngap_UERadioCapabilityForPagingOfEUTRA;
172 static int ett_ngap_UERadioCapability;
173 static int ett_ngap_LastVisitedEUTRANCellInformation;
174 static int ett_ngap_LastVisitedUTRANCellInformation;
175 static int ett_ngap_LastVisitedGERANCellInformation;
176 static int ett_ngap_NASSecurityParametersFromNGRAN;
177 static int ett_ngap_NASC;
178 static int ett_ngap_NAS_PDU;
179 static int ett_ngap_EN_DCSONConfigurationTransfer;
180 static int ett_ngap_BurstArrivalTime;
181 static int ett_ngap_CoverageEnhancementLevel;
182 static int ett_ngap_MDTModeEutra;
183 static int ett_ngap_MeasurementsToActivate;
184 static int ett_ngap_MDT_Location_Information;
185 static int ett_ngap_NRMobilityHistoryReport;
186 static int ett_ngap_LTEUERLFReportContainer;
187 static int ett_ngap_NRUERLFReportContainer;
188 static int ett_ngap_TargettoSource_Failure_TransparentContainer;
189 static int ett_ngap_UERadioCapabilityForPagingOfNB_IoT;
190 static int ett_ngap_GlobalCable_ID;
191 static int ett_ngap_UpdateFeedback;
192 static int ett_ngap_successfulHOReportContainer;
193 static int ett_ngap_successfulPSCellChangeReportContainer;
194 #include "packet-ngap-ett.c"
196 static expert_field ei_ngap_number_pages_le15;
197 static expert_field ei_ngap_disable_nrppa_encapsulation;
199 enum{
200 INITIATING_MESSAGE,
201 SUCCESSFUL_OUTCOME,
202 UNSUCCESSFUL_OUTCOME
205 /* NGAP stats - Tap interface */
207 static void set_stats_message_type(packet_info *pinfo, int type);
209 static const uint8_t *st_str_packets = "Total Packets";
210 static const uint8_t *st_str_packet_types = "NGAP Packet Types";
212 static int st_node_packets = -1;
213 static int st_node_packet_types = -1;
214 static int ngap_tap;
216 struct ngap_tap_t {
217 int ngap_mtype;
220 #define MTYPE_AMF_CONFIGURATION_UPDATE 1
221 #define MTYPE_AMF_CONFIGURATION_UPDATE_ACK 2
222 #define MTYPE_AMF_CONFIGURATION_UPDATE_FAILURE 3
223 #define MTYPE_AMF_CP_RELOCATION_IND 4
224 #define MTYPE_AMF_STATUS_IND 5
225 #define MTYPE_BROADCAST_SESSION_MODIFICATION_REQUEST 6
226 #define MTYPE_BROADCAST_SESSION_MODIFICATION_RESPONSE 7
227 #define MTYPE_BROADCAST_SESSION_MODIFICATION_FAILURE 8
228 #define MTYPE_BROADCAST_SESSION_RELEASE_REQUEST 9
229 #define MTYPE_BROADCAST_SESSION_RELEASE_RESPONSE 10
230 #define MTYPE_BROADCAST_SESSION_RELEASE_REQUIRED 11
231 #define MTYPE_BROADCAST_SESSION_SETUP_REQUEST 12
232 #define MTYPE_BROADCAST_SESSION_SETUP_RESPONSE 13
233 #define MTYPE_BROADCAST_SESSION_SETUP_FAILURE 14
234 #define MTYPE_BROADCAST_SESSION_TRANSPORT_REQUEST 15
235 #define MTYPE_BROADCAST_SESSION_TRANSPORT_RESPONSE 16
236 #define MTYPE_BROADCAST_SESSION_TRANSPORT_FAILURE 17
237 #define MTYPE_CELL_TRAFFIC_TRACE 18
238 #define MTYPE_CONNECTION_ESTAB_IND 19
239 #define MTYPE_DEACTIVATE_TRACE 20
240 #define MTYPE_DISTRIBUTION_SETUP_REQUEST 21
241 #define MTYPE_DISTRIBUTION_SETUP_RESPONSE 22
242 #define MTYPE_DISTRIBUTION_SETUP_FAILURE 23
243 #define MTYPE_DISTRIBUTION_RELEASE_REQUEST 24
244 #define MTYPE_DISTRIBUTION_RELEASE_RESPONSE 25
245 #define MTYPE_DOWNLINK_NAS_TRANSPORT 26
246 #define MTYPE_DOWNLINK_NON_UE_ASSOCIATED_NR_PPA_TRANSPORT 27
247 #define MTYPE_DOWNLINK_RAN_CONFIGURATION_TRANSFER 28
248 #define MTYPE_DOWNLINK_RAN_EARLY_STATUS_TRANSFER 29
249 #define MTYPE_DOWNLINK_RAN_STATUS_TRANSFER 30
250 #define MTYPE_DOWNLINK_UE_ASSOCIATED_NR_PPA_TRANSPORT 31
251 #define MTYPE_ERROR_INDICATION 32
252 #define MTYPE_HANDOVER_CANCEL 33
253 #define MTYPE_HANDOVER_CANCEL_ACK 34
254 #define MTYPE_HANDOVER_NOTIFY 35
255 #define MTYPE_HANDOVER_REQUIRED 36
256 #define MTYPE_HANDOVER_COMMAND 37
257 #define MTYPE_HANDOVER_PREPARATION_FAILURE 38
258 #define MTYPE_HANDOVER_REQUEST 39
259 #define MTYPE_HANDOVER_REQUEST_ACK 40
260 #define MTYPE_HANDOVER_FAILURE 41
261 #define MTYPE_HANDOVER_SUCCESS 42
262 #define MTYPE_INITIAL_CONTEXT_SETUP_REQUEST 43
263 #define MTYPE_INITIAL_CONTEXT_SETUP_RESPONSE 44
264 #define MTYPE_INITIAL_CONTEXT_SETUP_FAILURE 45
265 #define MTYPE_INITIAL_UE_MESSAGE 46
266 #define MTYPE_LOCATION_REPORT 47
267 #define MTYPE_LOCATION_REPORTING_CONTROL 48
268 #define MTYPE_LOCATION_REPORTING_FAILURE_IND 49
269 #define MTYPE_MT_COMMUNICATION_HANDLING_REQUEST 50
270 #define MTYPE_MT_COMMUNICATION_HANDLING_RESPONSE 51
271 #define MTYPE_MT_COMMUNICATION_HANDLING_FAILURE 52
272 #define MTYPE_MULTICAST_SESSION_ACTIVATION_REQUEST 53
273 #define MTYPE_MULTICAST_SESSION_ACTIVATION_RESPONSE 54
274 #define MTYPE_MULTICAST_SESSION_ACTIVATION_FAILURE 55
275 #define MTYPE_MULTICAST_SESSION_DEACTIVATION_REQUEST 56
276 #define MTYPE_MULTICAST_SESSION_DEACTIVATION_RESPONSE 57
277 #define MTYPE_MULTICAST_SESSION_UPDATE_REQUEST 58
278 #define MTYPE_MULTICAST_SESSION_UPDATE_RESPONSE 59
279 #define MTYPE_MULTICAST_SESSION_UPDATE_FAILURE 60
280 #define MTYPE_MULTICAST_GROUP_PAGING 61
281 #define MTYPE_NAS_NON_DELIVERY_IND 62
282 #define MTYPE_NG_RESET 63
283 #define MTYPE_NG_RESET_ACK 64
284 #define MTYPE_NG_SETUP_REQUEST 65
285 #define MTYPE_NG_SETUP_RESPONSE 66
286 #define MTYPE_NG_SETUP_FAILURE 67
287 #define MTYPE_OVERLOAD_START 68
288 #define MTYPE_OVERLOAD_STOP 69
289 #define MTYPE_PAGING 70
290 #define MTYPE_PATH_SWITCH_REQUEST 71
291 #define MTYPE_PATH_SWITCH_REQUEST_ACK 72
292 #define MTYPE_PATH_SWITCH_REQUEST_FAILURE 73
293 #define MTYPE_PDU_SESSION_RESOURCE_MODIFY_REQUEST 74
294 #define MTYPE_PDU_SESSION_RESOURCE_MODIFY_RESPONSE 75
295 #define MTYPE_PDU_SESSION_RESOURCE_MODIFY_IND 76
296 #define MTYPE_PDU_SESSION_RESOURCE_MODIFY_CONFIRM 77
297 #define MTYPE_PDU_SESSION_RESOURCE_NOTIFY 78
298 #define MTYPE_PDU_SESSION_RESOURCE_RELEASE_COMMAND 79
299 #define MTYPE_PDU_SESSION_RESOURCE_RELEASE_RESPONSE 80
300 #define MTYPE_PDU_SESSION_RESOURCE_SETUP_REQUEST 81
301 #define MTYPE_PDU_SESSION_RESOURCE_SETUP_RESPONSE 82
302 #define MTYPE_PRIVATE_MESSAGE 83
303 #define MTYPE_PWS_CANCEL_REQUEST 84
304 #define MTYPE_PWS_CANCEL_RESPONSE 85
305 #define MTYPE_PWS_FAILURE_INDICATION 86
306 #define MTYPE_PWS_RESTART_INDICATION 87
307 #define MTYPE_RAN_CONFIGURATION_UPDATE 88
308 #define MTYPE_RAN_CONFIGURATION_UPDATE_ACK 89
309 #define MTYPE_RAN_CONFIGURATION_UPDATE_FAILURE 90
310 #define MTYPE_RAN_CP_RELOCATION_IND 91
311 #define MTYPE_RAN_PAGING_REQUEST 92
312 #define MTYPE_REROUTE_NAS_REQUEST 93
313 #define MTYPE_RETRIEVE_UE_INFORMATION 94
314 #define MTYPE_RRC_INACTIVE_TRANSITION_REPORT 95
315 #define MTYPE_SECONDARY_RAT_DATA_USAGE_REPORT 96
316 #define MTYPE_TIMING_SYNCHRONISATION_STATUS_REQUEST 97
317 #define MTYPE_TIMING_SYNCHRONISATION_STATUS_RESPONSE 98
318 #define MTYPE_TIMING_SYNCHRONISATION_STATUS_FAILURE 99
319 #define MTYPE_TIMING_SYNCHRONISATION_STATUS_REPORT 100
320 #define MTYPE_TRACE_FAILURE_IND 101
321 #define MTYPE_TRACE_START 102
322 #define MTYPE_UE_CONTEXT_MODIFICATION_REQUEST 103
323 #define MTYPE_UE_CONTEXT_MODIFICATION_RESPONSE 104
324 #define MTYPE_UE_CONTEXT_MODIFICATION_FAILURE 105
325 #define MTYPE_UE_CONTEXT_RELEASE_COMMAND 106
326 #define MTYPE_UE_CONTEXT_RELEASE_COMPLETE 107
327 #define MTYPE_UE_CONTEXT_RELEASE_REQUEST 108
328 #define MTYPE_UE_CONTEXT_RESUME_REQUEST 109
329 #define MTYPE_UE_CONTEXT_RESUME_RESPONSE 110
330 #define MTYPE_UE_CONTEXT_RESUME_FAILURE 111
331 #define MTYPE_UE_CONTEXT_SUSPEND_REQUEST 112
332 #define MTYPE_UE_CONTEXT_SUSPEND_RESPONSE 113
333 #define MTYPE_UE_CONTEXT_SUSPEND_FAILURE 114
334 #define MTYPE_UE_INFORMATION_TRANSFER 115
335 #define MTYPE_UE_RADIO_CAPABILITY_CHECK_REQUEST 116
336 #define MTYPE_UE_RADIO_CAPABILITY_CHECK_RESPONSE 117
337 #define MTYPE_UE_RADIO_CAPABILITY_ID_MAPPING_REQUEST 118
338 #define MTYPE_UE_RADIO_CAPABILITY_ID_MAPPING_RESPONSE 119
339 #define MTYPE_UE_RADIO_CAPABILITY_INFO_IND 120
340 #define MTYPE_UE_TN_LAB_BINDING_RELEASE_REQUEST 121
341 #define MTYPE_UPLINK_NAS_TRANSPORT 122
342 #define MTYPE_UPLINK_NON_UE_ASSOCIATED_NR_PPA_TRANSPORT 123
343 #define MTYPE_UPLINK_RAN_CONFIGURATION_TRANSFER 124
344 #define MTYPE_UPLINK_RAN_EARLY_STATUS_TRANSFER 125
345 #define MTYPE_UPLINK_RAN_STATUS_TRANSFER 126
346 #define MTYPE_UPLINK_UE_ASSOCIATED_NR_PPA_TRANSPORT 127
347 #define MTYPE_WRITE_REPLACE_WARNING_REQUEST 128
348 #define MTYPE_WRITE_REPLACE_WARNING_RESPONSE 129
349 #define MTYPE_UPLINK_RIM_INFORMATION_TRANSFER 130
350 #define MTYPE_DOWNLINK_RIM_INFORMATION_TRANSFER 131
353 /* Value Strings. TODO: ext? */
354 static const value_string mtype_names[] = {
355 { MTYPE_AMF_CONFIGURATION_UPDATE, "AMFConfigurationUpdate" },
356 { MTYPE_AMF_CONFIGURATION_UPDATE_ACK, "AMFConfigurationUpdateAcknowledge" },
357 { MTYPE_AMF_CONFIGURATION_UPDATE_FAILURE, "AMFConfigurationUpdateFailure" },
358 { MTYPE_AMF_CP_RELOCATION_IND, "AMFCPRelocationIndication" },
359 { MTYPE_AMF_STATUS_IND, "AMFStatusIndication" },
360 { MTYPE_BROADCAST_SESSION_MODIFICATION_REQUEST, "BroadcastSessionModificationRequest" },
361 { MTYPE_BROADCAST_SESSION_MODIFICATION_RESPONSE, "BroadcastSessionModificationResponse" },
362 { MTYPE_BROADCAST_SESSION_MODIFICATION_FAILURE, "BroadcastSessionModificationFailure" },
363 { MTYPE_BROADCAST_SESSION_RELEASE_REQUEST, "BroadcastSessionReleaseRequest" },
364 { MTYPE_BROADCAST_SESSION_RELEASE_RESPONSE, "BroadcastSessionReleaseResponse" },
365 { MTYPE_BROADCAST_SESSION_RELEASE_REQUIRED, "BroadcastSessionReleaseRequired" },
366 { MTYPE_BROADCAST_SESSION_SETUP_REQUEST, "BroadcastSessionSetupRequest" },
367 { MTYPE_BROADCAST_SESSION_SETUP_RESPONSE, "BroadcastSessionSetupResponse" },
368 { MTYPE_BROADCAST_SESSION_SETUP_FAILURE, "BroadcastSessionSetupFailure" },
369 { MTYPE_BROADCAST_SESSION_TRANSPORT_REQUEST, "BroadcastSessionTransportRequest" },
370 { MTYPE_BROADCAST_SESSION_TRANSPORT_RESPONSE, "BroadcastSessionTransportResponse" },
371 { MTYPE_BROADCAST_SESSION_TRANSPORT_FAILURE, "BroadcastSessionTransportFailure" },
372 { MTYPE_CELL_TRAFFIC_TRACE, "CellTrafficTrace" },
373 { MTYPE_CONNECTION_ESTAB_IND, "ConnectionEstablishmentIndication" },
374 { MTYPE_DEACTIVATE_TRACE, "DeactivateTrace" },
375 { MTYPE_DISTRIBUTION_SETUP_REQUEST, "DistributionSetupRequest" },
376 { MTYPE_DISTRIBUTION_SETUP_RESPONSE, "DistributionSetupResponse" },
377 { MTYPE_DISTRIBUTION_SETUP_FAILURE, "DistributionSetupFailure" },
378 { MTYPE_DISTRIBUTION_RELEASE_REQUEST, "DistributionReleaseRequest" },
379 { MTYPE_DISTRIBUTION_RELEASE_RESPONSE, "DistributionReleaseResponse" },
380 { MTYPE_DOWNLINK_NAS_TRANSPORT, "DownlinkNASTransport" },
381 { MTYPE_DOWNLINK_NON_UE_ASSOCIATED_NR_PPA_TRANSPORT, "DownlinkNonUEAssociatedNRPPaTransport" },
382 { MTYPE_DOWNLINK_RAN_CONFIGURATION_TRANSFER, "DownlinkRANConfigurationTransfer" },
383 { MTYPE_DOWNLINK_RAN_EARLY_STATUS_TRANSFER, "DownlinkRANEarlyStatusTransfer" },
384 { MTYPE_DOWNLINK_RAN_STATUS_TRANSFER, "DownlinkRANStatusTransfer" },
385 { MTYPE_DOWNLINK_UE_ASSOCIATED_NR_PPA_TRANSPORT, "DownlinkUEAssociatedNRPPaTransport" },
386 { MTYPE_ERROR_INDICATION, "ErrorIndication" },
387 { MTYPE_HANDOVER_CANCEL, "HandoverCancel" },
388 { MTYPE_HANDOVER_CANCEL_ACK, "HandoverCancelAcknowledge" },
389 { MTYPE_HANDOVER_NOTIFY, "HandoverNotify" },
390 { MTYPE_HANDOVER_REQUIRED, "HandoverRequired" },
391 { MTYPE_HANDOVER_COMMAND, "HandoverCommand" },
392 { MTYPE_HANDOVER_PREPARATION_FAILURE, "HandoverPreparationFailure" },
393 { MTYPE_HANDOVER_REQUEST, "HandoverRequest" },
394 { MTYPE_HANDOVER_REQUEST_ACK, "HandoverRequestAcknowledge" },
395 { MTYPE_HANDOVER_FAILURE, "HandoverFailure" },
396 { MTYPE_HANDOVER_SUCCESS, "HandoverSuccess" },
397 { MTYPE_INITIAL_CONTEXT_SETUP_REQUEST, "InitialContextSetupRequest" },
398 { MTYPE_INITIAL_CONTEXT_SETUP_RESPONSE, "InitialContextSetupResponse" },
399 { MTYPE_INITIAL_CONTEXT_SETUP_FAILURE, "InitialContextSetupFailure" },
400 { MTYPE_INITIAL_UE_MESSAGE, "InitialUEMessage" },
401 { MTYPE_LOCATION_REPORT, "LocationReport" },
402 { MTYPE_LOCATION_REPORTING_CONTROL, "LocationReportingControl" },
403 { MTYPE_LOCATION_REPORTING_FAILURE_IND, "LocationReportingFailureIndication" },
404 { MTYPE_MT_COMMUNICATION_HANDLING_REQUEST, "MTCommunicationHandlingRequest" },
405 { MTYPE_MT_COMMUNICATION_HANDLING_RESPONSE, "MTCommunicationHandlingResponse" },
406 { MTYPE_MT_COMMUNICATION_HANDLING_FAILURE, "MTCommunicationHandlingFailure" },
407 { MTYPE_MULTICAST_SESSION_ACTIVATION_REQUEST, "MulticastSessionActivationRequest" },
408 { MTYPE_MULTICAST_SESSION_ACTIVATION_RESPONSE, "MulticastSessionActivationResponse" },
409 { MTYPE_MULTICAST_SESSION_ACTIVATION_FAILURE, "MulticastSessionActivationFailure" },
410 { MTYPE_MULTICAST_SESSION_DEACTIVATION_REQUEST, "MulticastSessionDeactivationRequest" },
411 { MTYPE_MULTICAST_SESSION_DEACTIVATION_RESPONSE, "MulticastSessionDeactivationResponse" },
412 { MTYPE_MULTICAST_SESSION_UPDATE_REQUEST, "MulticastSessionUpdateRequest" },
413 { MTYPE_MULTICAST_SESSION_UPDATE_RESPONSE, "MulticastSessionUpdateResponse" },
414 { MTYPE_MULTICAST_SESSION_UPDATE_FAILURE, "MulticastSessionUpdateFailure" },
415 { MTYPE_MULTICAST_GROUP_PAGING, "MulticastGroupPaging" },
416 { MTYPE_NAS_NON_DELIVERY_IND, "NASNonDeliveryIndication" },
417 { MTYPE_NG_RESET, "NGReset" },
418 { MTYPE_NG_RESET_ACK, "NGResetAcknowledge" },
419 { MTYPE_NG_SETUP_REQUEST, "NGSetupRequest" },
420 { MTYPE_NG_SETUP_RESPONSE, "NGSetupResponse" },
421 { MTYPE_NG_SETUP_FAILURE, "NGSetupFailure" },
422 { MTYPE_OVERLOAD_START, "OverloadStart" },
423 { MTYPE_OVERLOAD_STOP, "OverloadStop" },
424 { MTYPE_PAGING, "Paging" },
425 { MTYPE_PATH_SWITCH_REQUEST, "PathSwitchRequest" },
426 { MTYPE_PATH_SWITCH_REQUEST_ACK, "PathSwitchRequestAcknowledge" },
427 { MTYPE_PATH_SWITCH_REQUEST_FAILURE, "PathSwitchRequestFailure" },
428 { MTYPE_PDU_SESSION_RESOURCE_MODIFY_REQUEST, "PDUSessionResourceModifyRequest" },
429 { MTYPE_PDU_SESSION_RESOURCE_MODIFY_RESPONSE, "PDUSessionResourceModifyResponse" },
430 { MTYPE_PDU_SESSION_RESOURCE_MODIFY_IND, "PDUSessionResourceModifyIndication" },
431 { MTYPE_PDU_SESSION_RESOURCE_MODIFY_CONFIRM, "PDUSessionResourceModifyConfirm" },
432 { MTYPE_PDU_SESSION_RESOURCE_NOTIFY, "PDUSessionResourceNotify" },
433 { MTYPE_PDU_SESSION_RESOURCE_RELEASE_COMMAND, "PDUSessionResourceReleaseCommand" },
434 { MTYPE_PDU_SESSION_RESOURCE_RELEASE_RESPONSE, "PDUSessionResourceReleaseResponse" },
435 { MTYPE_PDU_SESSION_RESOURCE_SETUP_REQUEST, "PDUSessionResourceSetupRequest" },
436 { MTYPE_PDU_SESSION_RESOURCE_SETUP_RESPONSE, "PDUSessionResourceSetupResponse" },
437 { MTYPE_PRIVATE_MESSAGE, "PrivateMessage" },
438 { MTYPE_PWS_CANCEL_REQUEST, "PWSCancelRequest" },
439 { MTYPE_PWS_CANCEL_RESPONSE, "PWSCancelResponse" },
440 { MTYPE_PWS_FAILURE_INDICATION, "PWSFailureIndication" },
441 { MTYPE_PWS_RESTART_INDICATION, "PWSRestartIndication" },
442 { MTYPE_RAN_CONFIGURATION_UPDATE, "RANConfigurationUpdate" },
443 { MTYPE_RAN_CONFIGURATION_UPDATE_ACK, "RANConfigurationUpdateAcknowledge" },
444 { MTYPE_RAN_CONFIGURATION_UPDATE_FAILURE, "RANConfigurationUpdateFailure" },
445 { MTYPE_RAN_CP_RELOCATION_IND, "RANCPRelocationIndication" },
446 { MTYPE_RAN_PAGING_REQUEST, "RANPagingRequest" },
447 { MTYPE_REROUTE_NAS_REQUEST, "RerouteNASRequest" },
448 { MTYPE_RETRIEVE_UE_INFORMATION, "RetrieveUEInformation" },
449 { MTYPE_RRC_INACTIVE_TRANSITION_REPORT, "RRCInactiveTransitionReport" },
450 { MTYPE_SECONDARY_RAT_DATA_USAGE_REPORT, "SecondaryRATDataUsageReport" },
451 { MTYPE_TIMING_SYNCHRONISATION_STATUS_REQUEST, "TimingSynchronisationStatusRequest" },
452 { MTYPE_TIMING_SYNCHRONISATION_STATUS_RESPONSE, "TimingSynchronisationStatusResponse" },
453 { MTYPE_TIMING_SYNCHRONISATION_STATUS_FAILURE, "TimingSynchronisationStatusFailure" },
454 { MTYPE_TIMING_SYNCHRONISATION_STATUS_REPORT, "TimingSynchronisationStatusReport" },
455 { MTYPE_TRACE_FAILURE_IND, "TraceFailureIndication" },
456 { MTYPE_TRACE_START, "TraceStart" },
457 { MTYPE_UE_CONTEXT_MODIFICATION_REQUEST, "UEContextModificationRequest" },
458 { MTYPE_UE_CONTEXT_MODIFICATION_RESPONSE, "UEContextModificationResponse" },
459 { MTYPE_UE_CONTEXT_MODIFICATION_FAILURE, "UEContextModificationFailure" },
460 { MTYPE_UE_CONTEXT_RELEASE_COMMAND, "UEContextReleaseCommand" },
461 { MTYPE_UE_CONTEXT_RELEASE_COMPLETE, "UEContextReleaseComplete" },
462 { MTYPE_UE_CONTEXT_RELEASE_REQUEST, "UEContextReleaseRequest" },
463 { MTYPE_UE_CONTEXT_RESUME_REQUEST, "UEContextResumeRequest" },
464 { MTYPE_UE_CONTEXT_RESUME_RESPONSE, "UEContextResumeResponse" },
465 { MTYPE_UE_CONTEXT_RESUME_FAILURE, "UEContextResumeFailure" },
466 { MTYPE_UE_CONTEXT_SUSPEND_REQUEST, "UEContextSuspendRequest" },
467 { MTYPE_UE_CONTEXT_SUSPEND_RESPONSE, "UEContextSuspendResponse" },
468 { MTYPE_UE_CONTEXT_SUSPEND_FAILURE, "UEContextSuspendFailure" },
469 { MTYPE_UE_INFORMATION_TRANSFER, "UEInformationTransfer" },
470 { MTYPE_UE_RADIO_CAPABILITY_CHECK_REQUEST, "UERadioCapabilityCheckRequest" },
471 { MTYPE_UE_RADIO_CAPABILITY_CHECK_RESPONSE, "UERadioCapabilityCheckResponse" },
472 { MTYPE_UE_RADIO_CAPABILITY_ID_MAPPING_REQUEST, "UERadioCapabilityIDMappingRequest" },
473 { MTYPE_UE_RADIO_CAPABILITY_ID_MAPPING_RESPONSE, "UERadioCapabilityIDMappingResponse" },
474 { MTYPE_UE_RADIO_CAPABILITY_INFO_IND, "UERadioCapabilityInfoIndication" },
475 { MTYPE_UE_TN_LAB_BINDING_RELEASE_REQUEST, "UETNLABindingReleaseRequest" },
476 { MTYPE_UPLINK_NAS_TRANSPORT, "UplinkNASTransport" },
477 { MTYPE_UPLINK_NON_UE_ASSOCIATED_NR_PPA_TRANSPORT, "UplinkNonUEAssociatedNRPPaTransport" },
478 { MTYPE_UPLINK_RAN_CONFIGURATION_TRANSFER, "UplinkRANConfigurationTransfer" },
479 { MTYPE_UPLINK_RAN_EARLY_STATUS_TRANSFER, "UplinkRANEarlyStatusTransfer" },
480 { MTYPE_UPLINK_RAN_STATUS_TRANSFER, "UplinkRANStatusTransfer" },
481 { MTYPE_UPLINK_UE_ASSOCIATED_NR_PPA_TRANSPORT, "UplinkUEAssociatedNRPPaTransport" },
482 { MTYPE_WRITE_REPLACE_WARNING_REQUEST, "WriteReplaceWarningRequest" },
483 { MTYPE_WRITE_REPLACE_WARNING_RESPONSE, "WriteReplaceWarningResponse" },
484 { MTYPE_UPLINK_RIM_INFORMATION_TRANSFER, "UplinkRIMInformationTransfer" },
485 { MTYPE_DOWNLINK_RIM_INFORMATION_TRANSFER, "DownlinkRIMInformationTransfer" },
486 { 0, NULL }
490 typedef struct _ngap_ctx_t {
491 uint32_t message_type;
492 uint32_t ProcedureCode;
493 uint32_t ProtocolIE_ID;
494 uint32_t ProtocolExtensionID;
495 } ngap_ctx_t;
497 struct ngap_conv_info {
498 address addr_a;
499 uint32_t port_a;
500 GlobalRANNodeID_enum ranmode_id_a;
501 address addr_b;
502 uint32_t port_b;
503 GlobalRANNodeID_enum ranmode_id_b;
504 wmem_map_t *nbiot_ta;
505 wmem_tree_t *nbiot_ran_ue_ngap_id;
508 enum {
509 SOURCE_TO_TARGET_TRANSPARENT_CONTAINER = 1,
510 TARGET_TO_SOURCE_TRANSPARENT_CONTAINER
513 struct ngap_supported_ta {
514 uint32_t tac;
515 wmem_array_t *plmn;
518 struct ngap_tai {
519 uint32_t plmn;
520 uint32_t tac;
523 struct ngap_private_data {
524 struct ngap_conv_info *ngap_conv;
525 uint32_t procedure_code;
526 uint32_t protocol_ie_id;
527 uint32_t protocol_extension_id;
528 uint32_t message_type;
529 uint32_t handover_type_value;
530 uint8_t data_coding_scheme;
531 uint8_t transparent_container_type;
532 bool is_qos_flow_notify;
533 struct ngap_supported_ta *supported_ta;
534 struct ngap_tai *tai;
535 uint32_t ran_ue_ngap_id;
536 e212_number_type_t number_type;
537 int8_t qos_flow_add_info_rel_type;
538 struct ngap_tap_t *stats_tap;
541 enum {
542 NGAP_NG_RAN_CONTAINER_AUTOMATIC,
543 NGAP_NG_RAN_CONTAINER_GNB,
544 NGAP_NG_RAN_CONTAINER_NG_ENB
547 static const enum_val_t ngap_target_ng_ran_container_vals[] = {
548 {"automatic", "automatic", NGAP_NG_RAN_CONTAINER_AUTOMATIC},
549 {"gnb", "gNB", NGAP_NG_RAN_CONTAINER_GNB},
550 {"ng-enb","ng-eNB", NGAP_NG_RAN_CONTAINER_NG_ENB},
551 {NULL, NULL, -1}
554 enum {
555 NGAP_LTE_CONTAINER_AUTOMATIC,
556 NGAP_LTE_CONTAINER_LEGACY,
557 NGAP_LTE_CONTAINER_NBIOT
560 static const enum_val_t ngap_lte_container_vals[] = {
561 {"automatic", "Automatic", NGAP_LTE_CONTAINER_AUTOMATIC},
562 {"legacy", "Legacy LTE", NGAP_LTE_CONTAINER_LEGACY},
563 {"nb-iot","NB-IoT", NGAP_LTE_CONTAINER_NBIOT},
564 {NULL, NULL, -1}
567 /* Global variables */
568 static range_t *gbl_ngapSctpRange;
569 static bool ngap_dissect_container = true;
570 static bool ngap_disable_nrppa_encapsulation = false;
571 static int ngap_dissect_target_ng_ran_container_as = NGAP_NG_RAN_CONTAINER_AUTOMATIC;
572 static int ngap_dissect_lte_container_as = NGAP_LTE_CONTAINER_AUTOMATIC;
574 /* Dissector tables */
575 static dissector_table_t ngap_ies_dissector_table;
576 static dissector_table_t ngap_ies_p1_dissector_table;
577 static dissector_table_t ngap_ies_p2_dissector_table;
578 static dissector_table_t ngap_extension_dissector_table;
579 static dissector_table_t ngap_proc_imsg_dissector_table;
580 static dissector_table_t ngap_proc_sout_dissector_table;
581 static dissector_table_t ngap_proc_uout_dissector_table;
582 static dissector_table_t ngap_n2_ie_type_dissector_table;
584 static proto_tree *top_tree;
586 static void set_message_label(asn1_ctx_t *actx, int type)
588 const char *label = val_to_str_const(type, mtype_names, "Unknown");
589 col_append_sep_str(actx->pinfo->cinfo, COL_INFO, NULL, label);
590 /* N.B. would like to be able to use actx->subTree.top_tree, but not easy to set.. */
591 proto_item_append_text(top_tree, " (%s)", label);
595 static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
596 /* Currently not used
597 static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
598 static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
600 static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
601 static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
602 static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
603 static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
605 static int dissect_InitialUEMessage_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data);
606 static int dissect_PDUSessionResourceReleaseResponseTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
607 static int dissect_HandoverRequestAcknowledgeTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
608 static int dissect_PDUSessionResourceModifyUnsuccessfulTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
609 static int dissect_PDUSessionResourceSetupUnsuccessfulTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
610 static int dissect_HandoverResourceAllocationUnsuccessfulTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
611 static int dissect_PathSwitchRequestSetupFailedTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
612 static int dissect_HandoverCommandTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
613 static int dissect_HandoverRequiredTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
614 static int dissect_PDUSessionResourceModifyConfirmTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
615 static int dissect_PDUSessionResourceModifyIndicationTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
616 static int dissect_PDUSessionResourceModifyRequestTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
617 static int dissect_PDUSessionResourceModifyResponseTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
618 static int dissect_PDUSessionResourceNotifyTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
619 static int dissect_PDUSessionResourceNotifyReleasedTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
620 static int dissect_PathSwitchRequestUnsuccessfulTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
621 static int dissect_PDUSessionResourceSetupRequestTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
622 static int dissect_PDUSessionResourceSetupResponseTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
623 static int dissect_PathSwitchRequestAcknowledgeTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
624 static int dissect_PathSwitchRequestTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
625 static int dissect_HandoverPreparationUnsuccessfulTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
626 static int dissect_PDUSessionResourceReleaseCommandTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
627 static int dissect_TargetNGRANNode_ToSourceNGRANNode_FailureTransparentContainer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
628 static int dissect_SecondaryRATDataUsageReportTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
629 static int dissect_PDUSessionResourceModifyIndicationUnsuccessfulTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
630 static int dissect_ngap_AlternativeQoSParaSetNotifyIndex(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
631 static int dissect_UEContextResumeRequestTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
632 static int dissect_UEContextResumeResponseTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
633 static int dissect_UEContextSuspendRequestTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
634 static int dissect_MBSSessionSetupOrModRequestTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
635 static int dissect_MBSSessionSetupOrModResponseTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
636 static int dissect_MBSSessionSetupOrModFailureTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
637 static int dissect_MBSSessionReleaseResponseTransfer_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
639 static const value_string ngap_serialNumber_gs_vals[] = {
640 { 0, "Display mode immediate, cell wide"},
641 { 1, "Display mode normal, PLMN wide"},
642 { 2, "Display mode normal, tracking area wide"},
643 { 3, "Display mode normal, cell wide"},
644 { 0, NULL},
647 static const value_string ngap_warningType_vals[] = {
648 { 0, "Earthquake"},
649 { 1, "Tsunami"},
650 { 2, "Earthquake and Tsunami"},
651 { 3, "Test"},
652 { 4, "Other"},
653 { 0, NULL},
656 static void
657 dissect_ngap_warningMessageContents(tvbuff_t *warning_msg_tvb, proto_tree *tree, packet_info *pinfo, uint8_t dcs, int hf_nb_pages, int hf_decoded_page)
659 uint32_t offset;
660 uint8_t nb_of_pages, length, *str;
661 proto_item *ti;
662 tvbuff_t *cb_data_page_tvb, *cb_data_tvb;
663 int i;
665 nb_of_pages = tvb_get_uint8(warning_msg_tvb, 0);
666 ti = proto_tree_add_uint(tree, hf_nb_pages, warning_msg_tvb, 0, 1, nb_of_pages);
667 if (nb_of_pages > 15) {
668 expert_add_info_format(pinfo, ti, &ei_ngap_number_pages_le15,
669 "Number of pages should be <=15 (found %u)", nb_of_pages);
670 nb_of_pages = 15;
672 for (i = 0, offset = 1; i < nb_of_pages; i++) {
673 length = tvb_get_uint8(warning_msg_tvb, offset+82);
674 cb_data_page_tvb = tvb_new_subset_length(warning_msg_tvb, offset, length);
675 cb_data_tvb = dissect_cbs_data(dcs, cb_data_page_tvb, tree, pinfo, 0);
676 if (cb_data_tvb) {
677 str = tvb_get_string_enc(pinfo->pool, cb_data_tvb, 0, tvb_reported_length(cb_data_tvb), ENC_UTF_8|ENC_NA);
678 proto_tree_add_string_format(tree, hf_decoded_page, warning_msg_tvb, offset, 83,
679 str, "Decoded Page %u: %s", i+1, str);
681 offset += 83;
685 static void
686 ngap_PacketLossRate_fmt(char *s, uint32_t v)
688 snprintf(s, ITEM_LABEL_LENGTH, "%.1f%% (%u)", (float)v/10, v);
691 static void
692 ngap_PacketDelayBudget_fmt(char *s, uint32_t v)
694 snprintf(s, ITEM_LABEL_LENGTH, "%.1fms (%u)", (float)v/2, v);
697 static void
698 ngap_TimeUEStayedInCellEnhancedGranularity_fmt(char *s, uint32_t v)
700 snprintf(s, ITEM_LABEL_LENGTH, "%.1fs", ((float)v)/10);
703 static void
704 ngap_PeriodicRegistrationUpdateTimer_fmt(char *s, uint32_t v)
706 uint32_t val = v & 0x1f;
708 switch (v>>5) {
709 case 0:
710 snprintf(s, ITEM_LABEL_LENGTH, "%u min (%u)", val * 10, v);
711 break;
712 case 1:
713 default:
714 snprintf(s, ITEM_LABEL_LENGTH, "%u hr (%u)", val, v);
715 break;
716 case 2:
717 snprintf(s, ITEM_LABEL_LENGTH, "%u hr (%u)", val * 10, v);
718 break;
719 case 3:
720 snprintf(s, ITEM_LABEL_LENGTH, "%u sec (%u)", val * 2, v);
721 break;
722 case 4:
723 snprintf(s, ITEM_LABEL_LENGTH, "%u sec (%u)", val * 30, v);
724 break;
725 case 5:
726 snprintf(s, ITEM_LABEL_LENGTH, "%u min (%u)", val, v);
727 break;
728 case 7:
729 snprintf(s, ITEM_LABEL_LENGTH, "deactivated (%u)", v);
730 break;
734 static void
735 ngap_ExtendedPacketDelayBudget_fmt(char *s, uint32_t v)
737 snprintf(s, ITEM_LABEL_LENGTH, "%.2fms (%u)", (float)v/100, v);
740 static void
741 ngap_Threshold_RSRP_fmt(char *s, uint32_t v)
743 snprintf(s, ITEM_LABEL_LENGTH, "%ddBm (%u)", (int32_t)v-156, v);
746 static void
747 ngap_Threshold_RSRQ_fmt(char *s, uint32_t v)
749 snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB (%u)", ((float)v/2)-43, v);
752 static void
753 ngap_Threshold_SINR_fmt(char *s, uint32_t v)
755 snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB (%u)", ((float)v/2)-23, v);
758 static void
759 ngap_N6Jitter_fmt(char *s, uint32_t v)
761 snprintf(s, ITEM_LABEL_LENGTH, "%.1fms (%d)", (float)v/2, (int32_t)v);
764 static struct ngap_private_data*
765 ngap_get_private_data(packet_info *pinfo)
767 struct ngap_private_data *ngap_data = (struct ngap_private_data*)p_get_proto_data(pinfo->pool, pinfo, proto_ngap, 0);
768 if (!ngap_data) {
769 ngap_data = wmem_new0(pinfo->pool, struct ngap_private_data);
770 ngap_data->handover_type_value = -1;
771 ngap_data->qos_flow_add_info_rel_type = -1;
772 p_add_proto_data(pinfo->pool, pinfo, proto_ngap, 0, ngap_data);
774 return ngap_data;
777 static GlobalRANNodeID_enum
778 ngap_get_ranmode_id(address *addr, uint32_t port, packet_info *pinfo)
780 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
781 GlobalRANNodeID_enum ranmode_id = (GlobalRANNodeID_enum)-1;
783 if (ngap_data->ngap_conv) {
784 if (addresses_equal(addr, &ngap_data->ngap_conv->addr_a) && port == ngap_data->ngap_conv->port_a) {
785 ranmode_id = ngap_data->ngap_conv->ranmode_id_a;
786 } else if (addresses_equal(addr, &ngap_data->ngap_conv->addr_b) && port == ngap_data->ngap_conv->port_b) {
787 ranmode_id = ngap_data->ngap_conv->ranmode_id_b;
790 return ranmode_id;
793 static bool
794 ngap_is_nbiot_ue(packet_info *pinfo)
796 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
798 if (ngap_data->ngap_conv) {
799 wmem_tree_key_t tree_key[3];
800 uint32_t *id;
802 tree_key[0].length = 1;
803 tree_key[0].key = &ngap_data->ran_ue_ngap_id;
804 tree_key[1].length = 1;
805 tree_key[1].key = &pinfo->num;
806 tree_key[2].length = 0;
807 tree_key[2].key = NULL;
808 id = (uint32_t*)wmem_tree_lookup32_array_le(ngap_data->ngap_conv->nbiot_ran_ue_ngap_id, tree_key);
809 if (id && (*id == ngap_data->ran_ue_ngap_id)) {
810 return true;
813 return false;
816 static const true_false_string ngap_not_updated_updated = {
817 "Not updated",
818 "Updated"
821 #include "packet-ngap-fn.c"
823 static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
825 ngap_ctx_t ngap_ctx;
826 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
828 ngap_ctx.message_type = ngap_data->message_type;
829 ngap_ctx.ProcedureCode = ngap_data->procedure_code;
830 ngap_ctx.ProtocolIE_ID = ngap_data->protocol_ie_id;
831 ngap_ctx.ProtocolExtensionID = ngap_data->protocol_extension_id;
833 return (dissector_try_uint_with_data(ngap_ies_dissector_table, ngap_data->protocol_ie_id, tvb, pinfo, tree, false, &ngap_ctx)) ? tvb_captured_length(tvb) : 0;
835 /* Currently not used
836 static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
838 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
840 return (dissector_try_uint(ngap_ies_p1_dissector_table, ngap_data->protocol_ie_id, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
843 static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
845 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
847 return (dissector_try_uint(ngap_ies_p2_dissector_table, ngap_data->protocol_ie_id, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
851 static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
853 ngap_ctx_t ngap_ctx;
854 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
856 ngap_ctx.message_type = ngap_data->message_type;
857 ngap_ctx.ProcedureCode = ngap_data->procedure_code;
858 ngap_ctx.ProtocolIE_ID = ngap_data->protocol_ie_id;
859 ngap_ctx.ProtocolExtensionID = ngap_data->protocol_extension_id;
861 if (!dissector_try_uint_with_data(ngap_extension_dissector_table, ngap_data->protocol_extension_id, tvb, pinfo, tree, true, &ngap_ctx))
862 proto_tree_add_item(tree, hf_ngap_extensionValue_data, tvb, 0, -1, ENC_NA);
863 return tvb_captured_length(tvb);
866 static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
868 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
870 return (dissector_try_uint_with_data(ngap_proc_imsg_dissector_table, ngap_data->procedure_code, tvb, pinfo, tree, true, data)) ? tvb_captured_length(tvb) : 0;
873 static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
875 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
877 return (dissector_try_uint_with_data(ngap_proc_sout_dissector_table, ngap_data->procedure_code, tvb, pinfo, tree, true, data)) ? tvb_captured_length(tvb) : 0;
880 static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
882 struct ngap_private_data *ngap_data = ngap_get_private_data(pinfo);
884 return (dissector_try_uint_with_data(ngap_proc_uout_dissector_table, ngap_data->procedure_code, tvb, pinfo, tree, true, data)) ? tvb_captured_length(tvb) : 0;
887 static int dissect_QosFlowAdditionalInfoListRel_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
889 if (ngap_get_private_data(pinfo)->qos_flow_add_info_rel_type == 0)
890 return dissect_QosFlowAdditionalInfoListRelCom_PDU(tvb, pinfo, tree, data);
891 else
892 return dissect_QosFlowAdditionalInfoListRelRes_PDU(tvb, pinfo, tree, data);
895 static void
896 ngap_stats_tree_init(stats_tree *st)
898 st_node_packets = stats_tree_create_node(st, st_str_packets, 0, STAT_DT_INT, true);
899 st_node_packet_types = stats_tree_create_pivot(st, st_str_packet_types, st_node_packets);
902 static tap_packet_status
903 ngap_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_,
904 epan_dissect_t* edt _U_ , const void* p, tap_flags_t flags _U_)
906 const struct ngap_tap_t *pi = (const struct ngap_tap_t *) p;
908 tick_stat_node(st, st_str_packets, 0, false);
909 stats_tree_tick_pivot(st, st_node_packet_types,
910 val_to_str(pi->ngap_mtype, mtype_names,
911 "Unknown packet type (%d)"));
912 return TAP_PACKET_REDRAW;
915 static void set_stats_message_type(packet_info *pinfo, int type)
917 struct ngap_private_data* priv_data = ngap_get_private_data(pinfo);
918 priv_data->stats_tap->ngap_mtype = type;
922 static int
923 dissect_ngap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
925 proto_item *ngap_item = NULL;
926 proto_tree *ngap_tree = NULL;
927 conversation_t *conversation;
928 struct ngap_private_data *ngap_data;
929 struct ngap_tap_t *ngap_info;
931 /* make entry in the Protocol column on summary display */
932 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NGAP");
933 col_clear(pinfo->cinfo, COL_INFO);
935 ngap_info = wmem_new(pinfo->pool, struct ngap_tap_t);
936 ngap_info->ngap_mtype = 0; /* unknown/invalid */
938 /* create the ngap protocol tree */
939 ngap_item = proto_tree_add_item(tree, proto_ngap, tvb, 0, -1, ENC_NA);
940 ngap_tree = proto_item_add_subtree(ngap_item, ett_ngap);
942 /* Store top-level tree */
943 top_tree = ngap_tree;
945 /* Add stats tap to private struct */
946 struct ngap_private_data *priv_data = ngap_get_private_data(pinfo);
947 priv_data->stats_tap = ngap_info;
949 ngap_data = ngap_get_private_data(pinfo);
950 conversation = find_or_create_conversation(pinfo);
951 ngap_data->ngap_conv = (struct ngap_conv_info *)conversation_get_proto_data(conversation, proto_ngap);
952 if (!ngap_data->ngap_conv) {
953 ngap_data->ngap_conv = wmem_new0(wmem_file_scope(), struct ngap_conv_info);
954 copy_address_wmem(wmem_file_scope(), &ngap_data->ngap_conv->addr_a, &pinfo->src);
955 ngap_data->ngap_conv->port_a = pinfo->srcport;
956 ngap_data->ngap_conv->ranmode_id_a = (GlobalRANNodeID_enum)-1;
957 copy_address_wmem(wmem_file_scope(), &ngap_data->ngap_conv->addr_b, &pinfo->dst);
958 ngap_data->ngap_conv->port_b = pinfo->destport;
959 ngap_data->ngap_conv->ranmode_id_b = (GlobalRANNodeID_enum)-1;
960 ngap_data->ngap_conv->nbiot_ta = wmem_map_new(wmem_file_scope(), wmem_int64_hash, g_int64_equal);
961 ngap_data->ngap_conv->nbiot_ran_ue_ngap_id = wmem_tree_new(wmem_file_scope());
962 conversation_add_proto_data(conversation, proto_ngap, ngap_data->ngap_conv);
965 dissect_NGAP_PDU_PDU(tvb, pinfo, ngap_tree, NULL);
967 tap_queue_packet(ngap_tap, pinfo, ngap_info);
968 return tvb_captured_length(tvb);
971 static bool
972 find_n2_info_content(char *json_data, jsmntok_t *token, const char *n2_info_content,
973 const char *content_id, dissector_handle_t *subdissector)
975 jsmntok_t *n2_info_content_token, *ngap_data_token;
976 char *str;
977 double ngap_msg_type;
979 n2_info_content_token = json_get_object(json_data, token, n2_info_content);
980 if (!n2_info_content_token)
981 return false;
982 ngap_data_token = json_get_object(json_data, n2_info_content_token, "ngapData");
983 if (!ngap_data_token)
984 return false;
985 str = json_get_string(json_data, ngap_data_token, "contentId");
986 if (!str || strcmp(str, content_id))
987 return false;
988 str = json_get_string(json_data, n2_info_content_token, "ngapIeType");
989 if (str) {
990 if (!strcmp(str, "NRPPA_PDU") && ngap_disable_nrppa_encapsulation) {
991 *subdissector = nrppa_handle;
992 } else {
993 *subdissector = dissector_get_string_handle(ngap_n2_ie_type_dissector_table, str);
995 } else if (json_get_double(json_data, n2_info_content_token,
996 "ngapMessageType", &ngap_msg_type)) {
997 *subdissector = ngap_handle;
998 } else {
999 *subdissector = NULL;
1001 return true;
1004 /* 3GPP TS 29.502 chapter 6.1.6.4.3 and 29.518 chapter 6.1.6.4.3 */
1005 static int
1006 dissect_ngap_media_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
1008 int ret;
1009 char *json_data;
1010 const char *n2_info_class;
1011 jsmntok_t *tokens, *cur_tok;
1012 dissector_handle_t subdissector = NULL;
1013 tvbuff_t* json_tvb = (tvbuff_t*)p_get_proto_data(pinfo->pool, pinfo, proto_json, 0);
1014 media_content_info_t *content_info = (media_content_info_t *)data;
1016 if (!json_tvb || !content_info || !content_info->content_id)
1017 return 0;
1019 json_data = tvb_get_string_enc(pinfo->pool, json_tvb, 0, tvb_reported_length(json_tvb), ENC_UTF_8|ENC_NA);
1020 ret = json_parse(json_data, NULL, 0);
1021 if (ret <= 0)
1022 return 0;
1023 tokens = wmem_alloc_array(pinfo->pool, jsmntok_t, ret);
1024 if (json_parse(json_data, tokens, ret) <= 0)
1025 return 0;
1026 cur_tok = json_get_object(json_data, tokens, "n2InfoContainer");
1027 if (!cur_tok) {
1028 /* look for n2Information too*/
1029 cur_tok = json_get_object(json_data, tokens, "n2Information");
1031 if (cur_tok) {
1032 n2_info_class = json_get_string(json_data, cur_tok, "n2InformationClass");
1033 if (n2_info_class) {
1034 if (!strcmp(n2_info_class, "SM")) {
1035 cur_tok = json_get_object(json_data, cur_tok, "smInfo");
1036 if (cur_tok && find_n2_info_content(json_data, cur_tok, "n2InfoContent",
1037 content_info->content_id, &subdissector))
1038 goto found;
1040 if (!strcmp(n2_info_class, "RAN")) {
1041 cur_tok = json_get_object(json_data, cur_tok, "ranInfo");
1042 if (cur_tok && find_n2_info_content(json_data, cur_tok, "n2InfoContent",
1043 content_info->content_id, &subdissector))
1044 goto found;
1046 if (!strcmp(n2_info_class, "NRPPa")) {
1047 cur_tok = json_get_object(json_data, cur_tok, "nrppaInfo");
1048 if (cur_tok && find_n2_info_content(json_data, cur_tok, "nrppaPdu",
1049 content_info->content_id, &subdissector))
1050 goto found;
1052 if (!strcmp(n2_info_class, "PWS") ||
1053 !strcmp(n2_info_class, "PWS-BCAL") ||
1054 !strcmp(n2_info_class, "PWS-RF")) {
1055 cur_tok = json_get_object(json_data, cur_tok, "pwsInfo");
1056 if (cur_tok && find_n2_info_content(json_data, cur_tok, "pwsContainer",
1057 content_info->content_id, &subdissector))
1058 goto found;
1062 cur_tok = json_get_object(json_data, tokens, "n2SmInfo");
1063 if (cur_tok) {
1064 const char *content_id_str = json_get_string(json_data, cur_tok, "contentId");
1065 if (content_id_str && !strcmp(content_id_str, content_info->content_id)) {
1066 const char *str = json_get_string(json_data, tokens, "n2SmInfoType");
1067 if (str)
1068 subdissector = dissector_get_string_handle(ngap_n2_ie_type_dissector_table, str);
1069 else
1070 subdissector = NULL;
1071 goto found;
1074 if (find_n2_info_content(json_data, tokens, "n2MbsSmInfo",
1075 content_info->content_id, &subdissector))
1076 goto found;
1077 cur_tok = json_get_array(json_data, tokens, "pduSessionList");
1078 if (cur_tok) {
1079 int i, count;
1080 count = json_get_array_len(cur_tok);
1081 for (i = 0; i < count; i++) {
1082 jsmntok_t *array_tok = json_get_array_index(cur_tok, i);
1083 if (find_n2_info_content(json_data, array_tok, "n2InfoContent",
1084 content_info->content_id, &subdissector))
1085 goto found;
1088 if (find_n2_info_content(json_data, tokens, "sourceToTargetData",
1089 content_info->content_id, &subdissector))
1090 goto found;
1091 if (find_n2_info_content(json_data, tokens, "targetToSourceData",
1092 content_info->content_id, &subdissector))
1093 goto found;
1094 if (find_n2_info_content(json_data, tokens, "targetToSourceFailureData",
1095 content_info->content_id, &subdissector))
1096 goto found;
1097 if (find_n2_info_content(json_data, tokens, "ueRadioCapability",
1098 content_info->content_id, &subdissector))
1099 goto found;
1101 found:
1102 if (subdissector) {
1103 proto_item *ngap_item;
1104 proto_tree *ngap_tree;
1105 bool save_writable;
1107 col_append_sep_str(pinfo->cinfo, COL_PROTOCOL, "/", "NGAP");
1108 if (subdissector != ngap_handle) {
1109 ngap_item = proto_tree_add_item(tree, proto_ngap, tvb, 0, -1, ENC_NA);
1110 ngap_tree = proto_item_add_subtree(ngap_item, ett_ngap);
1111 if (ngap_disable_nrppa_encapsulation && subdissector == nrppa_handle) {
1112 expert_add_info_format(pinfo, ngap_item,
1113 &ei_ngap_disable_nrppa_encapsulation,
1114 "Encapsulation of NRPPa in NGAP is disabled");
1116 } else {
1117 ngap_tree = tree;
1119 save_writable = col_get_writable(pinfo->cinfo, COL_PROTOCOL);
1120 col_set_writable(pinfo->cinfo, COL_PROTOCOL, false);
1121 call_dissector_with_data(subdissector, tvb, pinfo, ngap_tree, NULL);
1122 col_set_writable(pinfo->cinfo, COL_PROTOCOL, save_writable);
1123 return tvb_captured_length(tvb);
1124 } else {
1125 return 0;
1129 static void
1130 apply_ngap_prefs(void)
1132 gbl_ngapSctpRange = prefs_get_range_value("ngap", "sctp.port");
1135 /*--- proto_reg_handoff_ngap ---------------------------------------*/
1136 void
1137 proto_reg_handoff_ngap(void)
1139 nas_5gs_handle = find_dissector_add_dependency("nas-5gs", proto_ngap);
1140 nr_rrc_ue_radio_paging_info_handle = find_dissector_add_dependency("nr-rrc.ue_radio_paging_info", proto_ngap);
1141 nr_rrc_ue_radio_access_cap_info_handle = find_dissector_add_dependency("nr-rrc.ue_radio_access_cap_info", proto_ngap);
1142 lte_rrc_ue_radio_paging_info_handle = find_dissector_add_dependency("lte-rrc.ue_radio_paging_info", proto_ngap);
1143 lte_rrc_ue_radio_access_cap_info_handle = find_dissector_add_dependency("lte-rrc.ue_radio_access_cap_info", proto_ngap);
1144 lte_rrc_ue_radio_paging_info_nb_handle = find_dissector_add_dependency("lte-rrc.ue_radio_paging_info.nb", proto_ngap);
1145 lte_rrc_ue_radio_access_cap_info_nb_handle = find_dissector_add_dependency("lte-rrc.ue_radio_access_cap_info.nb", proto_ngap);
1146 dissector_add_uint("sctp.ppi", NGAP_PROTOCOL_ID, ngap_handle);
1147 dissector_add_uint("ngap.extension", id_QosFlowAdditionalInfoList, create_dissector_handle(dissect_QosFlowAdditionalInfoListRel_PDU, proto_ngap));
1148 #include "packet-ngap-dis-tab.c"
1150 dissector_add_string("media_type", "application/vnd.3gpp.ngap", ngap_media_type_handle);
1152 nrppa_handle = find_dissector_add_dependency("nrppa", proto_ngap);
1153 proto_json = proto_get_id_by_filter_name("json");
1155 dissector_add_uint_with_preference("sctp.port", SCTP_PORT_NGAP, ngap_handle);
1157 stats_tree_register("ngap", "ngap", "NGAP", 0,
1158 ngap_stats_tree_packet, ngap_stats_tree_init, NULL);
1159 apply_ngap_prefs();
1162 /*--- proto_register_ngap -------------------------------------------*/
1163 void proto_register_ngap(void) {
1165 /* List of fields */
1167 static hf_register_info hf[] = {
1168 { &hf_ngap_transportLayerAddressIPv4,
1169 { "TransportLayerAddress (IPv4)", "ngap.TransportLayerAddressIPv4",
1170 FT_IPv4, BASE_NONE, NULL, 0,
1171 NULL, HFILL }},
1172 { &hf_ngap_transportLayerAddressIPv6,
1173 { "TransportLayerAddress (IPv6)", "ngap.TransportLayerAddressIPv6",
1174 FT_IPv6, BASE_NONE, NULL, 0,
1175 NULL, HFILL }},
1176 { &hf_ngap_WarningMessageContents_nb_pages,
1177 { "Number of Pages", "ngap.WarningMessageContents.nb_pages",
1178 FT_UINT8, BASE_DEC, NULL, 0,
1179 NULL, HFILL }},
1180 { &hf_ngap_SerialNumber_gs,
1181 { "Geographical Scope", "ngap.SerialNumber.gs",
1182 FT_UINT16, BASE_DEC, VALS(ngap_serialNumber_gs_vals), 0xc000,
1183 NULL, HFILL }},
1184 { &hf_ngap_SerialNumber_msg_code,
1185 { "Message Code", "ngap.SerialNumber.msg_code",
1186 FT_UINT16, BASE_DEC, NULL, 0x3ff0,
1187 NULL, HFILL }},
1188 { &hf_ngap_SerialNumber_upd_nb,
1189 { "Update Number", "ngap.SerialNumber.upd_nb",
1190 FT_UINT16, BASE_DEC, NULL, 0x000f,
1191 NULL, HFILL }},
1192 { &hf_ngap_WarningType_value,
1193 { "Warning Type Value", "ngap.WarningType.value",
1194 FT_UINT16, BASE_DEC, VALS(ngap_warningType_vals), 0xfe00,
1195 NULL, HFILL }},
1196 { &hf_ngap_WarningType_emergency_user_alert,
1197 { "Emergency User Alert", "ngap.WarningType.emergency_user_alert",
1198 FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0100,
1199 NULL, HFILL }},
1200 { &hf_ngap_WarningType_popup,
1201 { "Popup", "ngap.WarningType.popup",
1202 FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0080,
1203 NULL, HFILL }},
1204 { &hf_ngap_WarningMessageContents_decoded_page,
1205 { "Decoded Page", "ngap.WarningMessageContents.decoded_page",
1206 FT_STRING, BASE_NONE, NULL, 0,
1207 NULL, HFILL }},
1208 { &hf_ngap_NGRANTraceID_TraceID,
1209 { "TraceID", "ngap.NGRANTraceID.TraceID",
1210 FT_UINT24, BASE_HEX, NULL, 0,
1211 NULL, HFILL }},
1212 { &hf_ngap_NGRANTraceID_TraceRecordingSessionReference,
1213 { "TraceRecordingSessionReference", "ngap.NGRANTraceID.TraceRecordingSessionReference",
1214 FT_UINT16, BASE_HEX, NULL, 0,
1215 NULL, HFILL }},
1216 { &hf_ngap_InterfacesToTrace_NG_C,
1217 { "NG-C", "ngap.InterfacesToTrace.NG_C",
1218 FT_BOOLEAN, 8, NULL, 0x80,
1219 NULL, HFILL }},
1220 { &hf_ngap_InterfacesToTrace_Xn_C,
1221 { "Xn-C", "ngap.InterfacesToTrace.Xn_C",
1222 FT_BOOLEAN, 8, NULL, 0x40,
1223 NULL, HFILL }},
1224 { &hf_ngap_InterfacesToTrace_Uu,
1225 { "Uu", "ngap.InterfacesToTrace.Uu",
1226 FT_BOOLEAN, 8, NULL, 0x20,
1227 NULL, HFILL }},
1228 { &hf_ngap_InterfacesToTrace_F1_C,
1229 { "F1-C", "ngap.InterfacesToTrace.F1_C",
1230 FT_BOOLEAN, 8, NULL, 0x10,
1231 NULL, HFILL }},
1232 { &hf_ngap_InterfacesToTrace_E1,
1233 { "E1", "ngap.InterfacesToTrace.E1",
1234 FT_BOOLEAN, 8, NULL, 0x08,
1235 NULL, HFILL }},
1236 { &hf_ngap_InterfacesToTrace_reserved,
1237 { "Reserved", "ngap.InterfacesToTrace.reserved",
1238 FT_UINT8, BASE_HEX, NULL, 0x07,
1239 NULL, HFILL }},
1240 { &hf_ngap_RATRestrictionInformation_e_UTRA,
1241 { "e-UTRA", "ngap.RATRestrictionInformation.e_UTRA",
1242 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x80,
1243 NULL, HFILL }},
1244 { &hf_ngap_RATRestrictionInformation_nR,
1245 { "nR", "ngap.RATRestrictionInformation.nR",
1246 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x40,
1247 NULL, HFILL }},
1248 { &hf_ngap_RATRestrictionInformation_nR_unlicensed,
1249 { "nR-unlicensed", "ngap.RATRestrictionInformation.nR_unlicensed",
1250 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x20,
1251 NULL, HFILL }},
1252 { &hf_ngap_RATRestrictionInformation_reserved,
1253 { "reserved", "ngap.RATRestrictionInformation.reserved",
1254 FT_UINT8, BASE_HEX, NULL, 0x1f,
1255 NULL, HFILL }},
1256 { &hf_ngap_primaryRATRestriction_e_UTRA,
1257 { "e-UTRA", "ngap.primaryRATRestriction.e_UTRA",
1258 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x80,
1259 NULL, HFILL }},
1260 { &hf_ngap_primaryRATRestriction_nR,
1261 { "nR", "ngap.primaryRATRestriction.nR",
1262 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x40,
1263 NULL, HFILL }},
1264 { &hf_ngap_primaryRATRestriction_nR_unlicensed,
1265 { "nR-unlicensed", "ngap.primaryRATRestriction.nR_unlicensed",
1266 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x20,
1267 NULL, HFILL }},
1268 { &hf_ngap_primaryRATRestriction_nR_LEO,
1269 { "nR-LEO", "ngap.primaryRATRestriction.nR_LEO",
1270 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x10,
1271 NULL, HFILL }},
1272 { &hf_ngap_primaryRATRestriction_nR_MEO,
1273 { "nR-MEO", "ngap.primaryRATRestriction.nR_MEO",
1274 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x08,
1275 NULL, HFILL }},
1276 { &hf_ngap_primaryRATRestriction_nR_GEO,
1277 { "nR-GEO", "ngap.primaryRATRestriction.nR_GEO",
1278 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x04,
1279 NULL, HFILL }},
1280 { &hf_ngap_primaryRATRestriction_nR_OTHERSAT,
1281 { "nR-OTHERSAT", "ngap.primaryRATRestriction.nR_OTHERSAT",
1282 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x02,
1283 NULL, HFILL }},
1284 { &hf_ngap_primaryRATRestriction_e_UTRA_LEO,
1285 { "e-UTRA-LEO", "ngap.primaryRATRestriction.e_UTRA_LEO",
1286 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x01,
1287 NULL, HFILL }},
1288 { &hf_ngap_primaryRATRestriction_e_UTRA_MEO,
1289 { "e-UTRA-MEO", "ngap.primaryRATRestriction.e_UTRA_MEO",
1290 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x80,
1291 NULL, HFILL }},
1292 { &hf_ngap_primaryRATRestriction_e_UTRA_GEO,
1293 { "e-UTRA-GEO", "ngap.primaryRATRestriction.e_UTRA_GEO",
1294 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x40,
1295 NULL, HFILL }},
1296 { &hf_ngap_primaryRATRestriction_e_UTRA_OTHERSAT,
1297 { "e-UTRA-OTHERSAT", "ngap.primaryRATRestriction.e_UTRA_OTHERSAT",
1298 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x20,
1299 NULL, HFILL }},
1300 { &hf_ngap_primaryRATRestriction_reserved,
1301 { "reserved", "ngap.primaryRATRestriction.reserved",
1302 FT_UINT8, BASE_HEX, NULL, 0x1f,
1303 NULL, HFILL }},
1304 { &hf_ngap_secondaryRATRestriction_e_UTRA,
1305 { "e-UTRA", "ngap.secondaryRATRestriction.e_UTRA",
1306 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x80,
1307 NULL, HFILL }},
1308 { &hf_ngap_secondaryRATRestriction_nR,
1309 { "nR", "ngap.secondaryRATRestriction.nR",
1310 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x40,
1311 NULL, HFILL }},
1312 { &hf_ngap_secondaryRATRestriction_e_UTRA_unlicensed,
1313 { "e-UTRA-unlicensed", "ngap.secondaryRATRestriction.e_UTRA_unlicensed",
1314 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x20,
1315 NULL, HFILL }},
1316 { &hf_ngap_secondaryRATRestriction_nR_unlicensed,
1317 { "nR-unlicensed", "ngap.secondaryRATRestriction.nR_unlicensed",
1318 FT_BOOLEAN, 8, TFS(&tfs_restricted_not_restricted), 0x10,
1319 NULL, HFILL }},
1320 { &hf_ngap_secondaryRATRestriction_reserved,
1321 { "reserved", "ngap.secondaryRATRestriction.reserved",
1322 FT_UINT8, BASE_HEX, NULL, 0x0f,
1323 NULL, HFILL }},
1324 { &hf_ngap_NrencryptionAlgorithms_nea1,
1325 { "128-NEA1", "ngap.NrencryptionAlgorithms.nea1",
1326 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000,
1327 NULL, HFILL }},
1328 { &hf_ngap_NrencryptionAlgorithms_nea2,
1329 { "128-NEA2", "ngap.NrencryptionAlgorithms.nea2",
1330 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000,
1331 NULL, HFILL }},
1332 { &hf_ngap_NrencryptionAlgorithms_nea3,
1333 { "128-NEA3", "ngap.NrencryptionAlgorithms.nea3",
1334 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000,
1335 NULL, HFILL }},
1336 { &hf_ngap_NrencryptionAlgorithms_reserved,
1337 { "Reserved", "ngap.NrencryptionAlgorithms.reserved",
1338 FT_UINT16, BASE_HEX, NULL, 0x1fff,
1339 NULL, HFILL }},
1340 { &hf_ngap_NrintegrityProtectionAlgorithms_nia1,
1341 { "128-NIA1", "ngap.NrintegrityProtectionAlgorithms.nia1",
1342 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000,
1343 NULL, HFILL }},
1344 { &hf_ngap_NrintegrityProtectionAlgorithms_nia2,
1345 { "128-NIA2", "ngap.NrintegrityProtectionAlgorithms.nia2",
1346 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000,
1347 NULL, HFILL }},
1348 { &hf_ngap_NrintegrityProtectionAlgorithms_nia3,
1349 { "128-NIA3", "ngap.NrintegrityProtectionAlgorithms.nia3",
1350 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000,
1351 NULL, HFILL }},
1352 { &hf_ngap_NrintegrityProtectionAlgorithms_reserved,
1353 { "Reserved", "ngap.NrintegrityProtectionAlgorithms.reserved",
1354 FT_UINT16, BASE_HEX, NULL, 0x1fff,
1355 NULL, HFILL }},
1356 { &hf_ngap_EUTRAencryptionAlgorithms_eea1,
1357 { "128-EEA1", "ngap.EUTRAencryptionAlgorithms.eea1",
1358 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000,
1359 NULL, HFILL }},
1360 { &hf_ngap_EUTRAencryptionAlgorithms_eea2,
1361 { "128-EEA2", "ngap.EUTRAencryptionAlgorithms.eea2",
1362 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000,
1363 NULL, HFILL }},
1364 { &hf_ngap_EUTRAencryptionAlgorithms_eea3,
1365 { "128-EEA3", "ngap.EUTRAencryptionAlgorithms.eea3",
1366 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000,
1367 NULL, HFILL }},
1368 { &hf_ngap_EUTRAencryptionAlgorithms_reserved,
1369 { "Reserved", "ngap.EUTRAencryptionAlgorithms.reserved",
1370 FT_UINT16, BASE_HEX, NULL, 0x1fff,
1371 NULL, HFILL }},
1372 { &hf_ngap_EUTRAintegrityProtectionAlgorithms_eia1,
1373 { "128-EIA1", "ngap.EUTRAintegrityProtectionAlgorithms.eia1",
1374 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000,
1375 NULL, HFILL }},
1376 { &hf_ngap_EUTRAintegrityProtectionAlgorithms_eia2,
1377 { "128-EIA2", "ngap.EUTRAintegrityProtectionAlgorithms.eia2",
1378 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000,
1379 NULL, HFILL }},
1380 { &hf_ngap_EUTRAintegrityProtectionAlgorithms_eia3,
1381 { "128-EIA3", "ngap.EUTRAintegrityProtectionAlgorithms.eia3",
1382 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000,
1383 NULL, HFILL }},
1384 { &hf_ngap_EUTRAintegrityProtectionAlgorithms_eia7,
1385 { "EIA7", "ngap.EUTRAintegrityProtectionAlgorithms.eia7",
1386 FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200,
1387 NULL, HFILL }},
1388 { &hf_ngap_EUTRAintegrityProtectionAlgorithms_reserved,
1389 { "Reserved", "ngap.EUTRAintegrityProtectionAlgorithms.reserved",
1390 FT_UINT16, BASE_HEX, NULL, 0x1dff,
1391 NULL, HFILL }},
1392 { &hf_ngap_MeasurementsToActivate_M1,
1393 { "M1", "ngap.MeasurementsToActivate.M1",
1394 FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
1395 NULL, HFILL }},
1396 { &hf_ngap_MeasurementsToActivate_M2,
1397 { "M2", "ngap.MeasurementsToActivate.M2",
1398 FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x40,
1399 NULL, HFILL }},
1400 { &hf_ngap_MeasurementsToActivate_M4,
1401 { "M4", "ngap.MeasurementsToActivate.M4",
1402 FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x20,
1403 NULL, HFILL }},
1404 { &hf_ngap_MeasurementsToActivate_M5,
1405 { "M5", "ngap.MeasurementsToActivate.M5",
1406 FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x10,
1407 NULL, HFILL }},
1408 { &hf_ngap_MeasurementsToActivate_M6,
1409 { "M6", "ngap.MeasurementsToActivate.M6",
1410 FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x08,
1411 NULL, HFILL }},
1412 { &hf_ngap_MeasurementsToActivate_M7,
1413 { "M7", "ngap.MeasurementsToActivate.M7",
1414 FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x04,
1415 NULL, HFILL }},
1416 { &hf_ngap_MeasurementsToActivate_M1_from_event,
1417 { "M1 from event", "ngap.MeasurementsToActivate.M1_from_event",
1418 FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x02,
1419 NULL, HFILL }},
1420 { &hf_ngap_MeasurementsToActivate_reserved,
1421 { "Reserved", "ngap.MeasurementsToActivate.reserved",
1422 FT_BOOLEAN, 8, NULL, 0x01,
1423 NULL, HFILL }},
1424 { &hf_ngap_MDT_Location_Information_GNSS,
1425 { "GNSS", "ngap.MDT_Location_Information.GNSS",
1426 FT_BOOLEAN, 8, TFS(&tfs_activated_deactivated), 0x80,
1427 NULL, HFILL }},
1428 { &hf_ngap_MDT_Location_Information_reserved,
1429 { "Reserved", "ngap.MDT_Location_Information.reserved",
1430 FT_UINT8, BASE_HEX, NULL, 0x7f,
1431 NULL, HFILL }},
1432 { &hf_ngap_GlobalCable_ID_str,
1433 { "GlobalCable-ID", "ngap.GlobalCable_ID.str",
1434 FT_STRING, BASE_NONE, NULL, 0,
1435 NULL, HFILL }},
1436 { &hf_ngap_UpdateFeedback_CN_PDB_DL,
1437 { "CN PDB DL", "ngap.UpdateFeedback.CN_PDB_DL",
1438 FT_BOOLEAN, 8, TFS(&ngap_not_updated_updated), 0x80,
1439 NULL, HFILL }},
1440 { &hf_ngap_UpdateFeedback_CN_PDB_UL,
1441 { "CN PDB UL", "ngap.UpdateFeedback.CN_PDB_UL",
1442 FT_BOOLEAN, 8, TFS(&ngap_not_updated_updated), 0x40,
1443 NULL, HFILL }},
1444 { &hf_ngap_UpdateFeedback_reserved,
1445 { "Reserved", "ngap.UpdateFeedback.reserved",
1446 FT_UINT8, BASE_HEX, NULL, 0x3f,
1447 NULL, HFILL }},
1448 { &hf_ngap_extensionValue_data,
1449 { "Data", "ngap.extensionValue.data",
1450 FT_BYTES, BASE_NONE|BASE_ALLOW_ZERO, NULL, 0,
1451 NULL, HFILL }},
1452 #include "packet-ngap-hfarr.c"
1455 /* List of subtrees */
1456 static int *ett[] = {
1457 &ett_ngap,
1458 &ett_ngap_TransportLayerAddress,
1459 &ett_ngap_DataCodingScheme,
1460 &ett_ngap_SerialNumber,
1461 &ett_ngap_WarningType,
1462 &ett_ngap_WarningMessageContents,
1463 &ett_ngap_PLMNIdentity,
1464 &ett_ngap_NGAP_Message,
1465 &ett_ngap_NGRANTraceID,
1466 &ett_ngap_InterfacesToTrace,
1467 &ett_ngap_SourceToTarget_TransparentContainer,
1468 &ett_ngap_TargetToSource_TransparentContainer,
1469 &ett_ngap_RRCContainer,
1470 &ett_ngap_RATRestrictionInformation,
1471 &ett_ngap_primaryRATRestriction,
1472 &ett_ngap_secondaryRATRestriction,
1473 &ett_ngap_NrencryptionAlgorithms,
1474 &ett_ngap_NrintegrityProtectionAlgorithms,
1475 &ett_ngap_EUTRAencryptionAlgorithms,
1476 &ett_ngap_EUTRAintegrityProtectionAlgorithms,
1477 &ett_ngap_UERadioCapabilityForPagingOfNR,
1478 &ett_ngap_UERadioCapabilityForPagingOfEUTRA,
1479 &ett_ngap_UERadioCapability,
1480 &ett_ngap_LastVisitedEUTRANCellInformation,
1481 &ett_ngap_LastVisitedUTRANCellInformation,
1482 &ett_ngap_LastVisitedGERANCellInformation,
1483 &ett_ngap_NASSecurityParametersFromNGRAN,
1484 &ett_ngap_NASC,
1485 &ett_ngap_NAS_PDU,
1486 &ett_ngap_EN_DCSONConfigurationTransfer,
1487 &ett_ngap_BurstArrivalTime,
1488 &ett_ngap_CoverageEnhancementLevel,
1489 &ett_ngap_MDTModeEutra,
1490 &ett_ngap_MeasurementsToActivate,
1491 &ett_ngap_MDT_Location_Information,
1492 &ett_ngap_NRMobilityHistoryReport,
1493 &ett_ngap_LTEUERLFReportContainer,
1494 &ett_ngap_NRUERLFReportContainer,
1495 &ett_ngap_TargettoSource_Failure_TransparentContainer,
1496 &ett_ngap_UERadioCapabilityForPagingOfNB_IoT,
1497 &ett_ngap_GlobalCable_ID,
1498 &ett_ngap_UpdateFeedback,
1499 &ett_ngap_successfulHOReportContainer,
1500 &ett_ngap_successfulPSCellChangeReportContainer,
1501 #include "packet-ngap-ettarr.c"
1504 static ei_register_info ei[] = {
1505 { &ei_ngap_number_pages_le15, { "ngap.number_pages_le15", PI_MALFORMED, PI_ERROR, "Number of pages should be <=15", EXPFILL }},
1506 { &ei_ngap_disable_nrppa_encapsulation,
1507 { "ngap.disable_nrppa_encapsulation", PI_PROTOCOL, PI_CHAT, "Encapsulation of NRPPa in NGAP is disabled", EXPFILL }
1511 module_t *ngap_module;
1512 expert_module_t* expert_ngap;
1514 /* Register protocol */
1515 proto_ngap = proto_register_protocol(PNAME, PSNAME, PFNAME);
1516 /* Register fields and subtrees */
1517 proto_register_field_array(proto_ngap, hf, array_length(hf));
1518 proto_register_subtree_array(ett, array_length(ett));
1519 expert_ngap = expert_register_protocol(proto_ngap);
1520 expert_register_field_array(expert_ngap, ei, array_length(ei));
1522 /* Register dissector */
1523 ngap_handle = register_dissector("ngap", dissect_ngap, proto_ngap);
1524 ngap_media_type_handle = register_dissector("ngap_media_type", dissect_ngap_media_type, proto_ngap);
1526 /* Register dissector tables */
1527 ngap_ies_dissector_table = register_dissector_table("ngap.ies", "NGAP-PROTOCOL-IES", proto_ngap, FT_UINT32, BASE_DEC);
1528 ngap_ies_p1_dissector_table = register_dissector_table("ngap.ies.pair.first", "NGAP-PROTOCOL-IES-PAIR FirstValue", proto_ngap, FT_UINT32, BASE_DEC);
1529 ngap_ies_p2_dissector_table = register_dissector_table("ngap.ies.pair.second", "NGAP-PROTOCOL-IES-PAIR SecondValue", proto_ngap, FT_UINT32, BASE_DEC);
1530 ngap_extension_dissector_table = register_dissector_table("ngap.extension", "NGAP-PROTOCOL-EXTENSION", proto_ngap, FT_UINT32, BASE_DEC);
1531 ngap_proc_imsg_dissector_table = register_dissector_table("ngap.proc.imsg", "NGAP-ELEMENTARY-PROCEDURE InitiatingMessage", proto_ngap, FT_UINT32, BASE_DEC);
1532 ngap_proc_sout_dissector_table = register_dissector_table("ngap.proc.sout", "NGAP-ELEMENTARY-PROCEDURE SuccessfulOutcome", proto_ngap, FT_UINT32, BASE_DEC);
1533 ngap_proc_uout_dissector_table = register_dissector_table("ngap.proc.uout", "NGAP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", proto_ngap, FT_UINT32, BASE_DEC);
1534 ngap_n2_ie_type_dissector_table = register_dissector_table("ngap.n2_ie_type", "NGAP N2 IE Type", proto_ngap, FT_STRING, STRING_CASE_SENSITIVE);
1536 /* Register configuration options for ports */
1537 ngap_module = prefs_register_protocol(proto_ngap, apply_ngap_prefs);
1539 prefs_register_bool_preference(ngap_module, "dissect_container",
1540 "Dissect TransparentContainer",
1541 "Dissect TransparentContainers that are opaque to NGAP",
1542 &ngap_dissect_container);
1543 prefs_register_bool_preference(ngap_module, "disable_nrppa_encapsulation",
1544 "Disable encapsulation of NRPPa in NGAP",
1545 "The standard indicates that NRPPa PDU must "
1546 "be encapsulated in ngap.NRPPa-PDU ASN1 type. "
1547 "However, Huawei AMF use the NRPPa ASN1 type "
1548 "directly.",
1549 &ngap_disable_nrppa_encapsulation);
1550 prefs_register_enum_preference(ngap_module, "dissect_target_ng_ran_container_as",
1551 "Dissect target NG-RAN container as",
1552 "Select whether target NG-RAN container should be decoded automatically"
1553 " (based on NG Setup procedure) or manually",
1554 &ngap_dissect_target_ng_ran_container_as, ngap_target_ng_ran_container_vals, false);
1555 prefs_register_enum_preference(ngap_module, "dissect_lte_container_as", "Dissect LTE container as",
1556 "Select whether LTE container should be dissected as NB-IOT or legacy LTE",
1557 &ngap_dissect_lte_container_as, ngap_lte_container_vals, false);
1559 ngap_tap = register_tap("ngap");
1563 * Editor modelines
1565 * Local Variables:
1566 * c-basic-offset: 2
1567 * tab-width: 8
1568 * indent-tabs-mode: nil
1569 * End:
1571 * ex: set shiftwidth=2 tabstop=8 expandtab:
1572 * :indentSize=2:tabSize=8:noTabs=true: