1 /* packet-mbim.c
2 * Routines for MBIM dissection
3 * Copyright 2013-2016, Pascal Quantin <pascal@wireshark.org>
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 /* Dissector based on MBIM specification 1.0 Errata-1 and MBIM extended version 2.0
13 * http://www.usb.org/developers/devclass_docs/MBIM10Errata1_073013.zip
14 * http://compliance.usb.org/mbim/
15 * http://www.usb.org/developers/docs/devclass_docs/MBIMMultiflow10.zip
16 *
17 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/host-shutdown-device-service
18 *
19 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-provisioned-context-operations
20 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-network-blacklist-operations
21 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-lte-attach-operations
22 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-multi-sim-operations
23 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-protocol-configuration-options-pco-operations
24 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-modem-reset-operations
25 *
26 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-sar-platform-support
27 *
28 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-low-level-uicc-access
29 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-uicc-application-and-file-system-access
30 *
31 * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/mb-5g-data-class-support
32 * https://download.microsoft.com/download/8/3/a/83a64106-a1f4-4a03-811f-4dbef2e3bf7a/MBIM extensions for 5G.docx
33 */
34
35 #include "config.h"
36
37 #include <epan/packet.h>
38 #include <epan/expert.h>
39 #include <epan/asn1.h>
40 #include <epan/prefs.h>
41 #include <epan/reassemble.h>
42 #include <epan/to_str.h>
43 #include <epan/strutil.h>
44
45 #include "packet-gsm_a_common.h"
46 #include "packet-gsm_map.h"
47 #include "packet-usb.h"
48 #include "packet-mbim.h"
49
50 void proto_register_mbim(void);
51 void proto_reg_handoff_mbim(void);
52
53 /* Initialize the protocol and registered fields */
54 static int proto_mbim = -1;
55 static int hf_mbim_control = -1;
56 static int hf_mbim_header_message_type = -1;
57 static int hf_mbim_header_message_length = -1;
58 static int hf_mbim_header_transaction_id = -1;
59 static int hf_mbim_fragment_total = -1;
60 static int hf_mbim_fragment_current = -1;
61 static int hf_mbim_max_ctrl_transfer = -1;
62 static int hf_mbim_device_service_id = -1;
63 static int hf_mbim_uuid_basic_connect_cid = -1;
64 static int hf_mbim_uuid_sms_cid = -1;
65 static int hf_mbim_uuid_ussd_cid = -1;
66 static int hf_mbim_uuid_phonebook_cid = -1;
67 static int hf_mbim_uuid_stk_cid = -1;
68 static int hf_mbim_uuid_auth_cid = -1;
69 static int hf_mbim_uuid_dss_cid = -1;
70 static int hf_mbim_uuid_multicarrier_cid = -1;
71 static int hf_mbim_uuid_ms_hostshutdown_cid = -1;
72 static int hf_mbim_uuid_msfwid_cid = -1;
73 static int hf_mbim_uuid_qmi_cid = -1;
74 static int hf_mbim_uuid_intel_fwusvc_cid = -1;
75 static int hf_mbim_uuid_intel_dptf_cid = -1;
76 static int hf_mbim_uuid_intel_sar_cid = -1;
77 static int hf_mbim_uuid_intel_act_cid = -1;
78 static int hf_mbim_uuid_intel_trcsvc_cid = -1;
79 static int hf_mbim_uuid_intel_nrtc_cid = -1;
80 static int hf_mbim_uuid_intel_usb_profile_cid = -1;
81 static int hf_mbim_uuid_intel_ciq_cid = -1;
82 static int hf_mbim_uuid_atds_cid = -1;
83 static int hf_mbim_uuid_multiflow_cid = -1;
84 static int hf_mbim_uuid_basic_connect_extensions_cid = -1;
85 static int hf_mbim_uuid_ms_sarcontrol_cid = -1;
86 static int hf_mbim_uuid_ms_uicc_low_level_cid = -1;
87 static int hf_mbim_cid = -1;
88 static int hf_mbim_command_type = -1;
89 static int hf_mbim_info_buffer_len = -1;
90 static int hf_mbim_info_buffer = -1;
91 static int hf_mbim_error_status_code = -1;
92 static int hf_mbim_status = -1;
93 static int hf_mbim_tlv_ie_type = -1;
94 static int hf_mbim_tlv_ie_reserved = -1;
95 static int hf_mbim_tlv_ie_padding_length = -1;
96 static int hf_mbim_tlv_ie_data_length = -1;
97 static int hf_mbim_tlv_ie_unnamed_data = -1;
98 static int hf_mbim_tlv_ie_data_wchar_str = -1;
99 static int hf_mbim_tlv_ie_padding = -1;
100 static int hf_mbim_device_caps_info_device_type = -1;
101 static int hf_mbim_device_caps_info_cellular_class = -1;
102 static int hf_mbim_device_caps_info_voice_class = -1;
103 static int hf_mbim_device_caps_info_sim_class = -1;
104 static int hf_mbim_device_caps_info_sim_class_logical = -1;
105 static int hf_mbim_device_caps_info_sim_class_removable = -1;
106 static int hf_mbim_device_caps_info_data_class = -1;
107 static int hf_mbim_data_class_gprs = -1;
108 static int hf_mbim_data_class_edge = -1;
109 static int hf_mbim_data_class_umts = -1;
110 static int hf_mbim_data_class_hsdpa = -1;
111 static int hf_mbim_data_class_hsupa = -1;
112 static int hf_mbim_data_class_lte = -1;
113 static int hf_mbim_data_class_5g = -1;
114 static int hf_mbim_data_class_reserved_gsm = -1;
115 static int hf_mbim_data_class_1xrtt = -1;
116 static int hf_mbim_data_class_1xevdo = -1;
117 static int hf_mbim_data_class_1xevdoreva = -1;
118 static int hf_mbim_data_class_1xevdv = -1;
119 static int hf_mbim_data_class_3xrtt = -1;
120 static int hf_mbim_data_class_1xevdorevb = -1;
121 static int hf_mbim_data_class_umb = -1;
122 static int hf_mbim_data_class_reserved_cdma = -1;
123 static int hf_mbim_data_class_custom = -1;
124 static int hf_mbim_device_caps_info_sms_caps = -1;
125 static int hf_mbim_device_caps_info_sms_caps_pdu_receive = -1;
126 static int hf_mbim_device_caps_info_sms_caps_pdu_send = -1;
127 static int hf_mbim_device_caps_info_sms_caps_text_receive = -1;
128 static int hf_mbim_device_caps_info_sms_caps_text_send = -1;
129 static int hf_mbim_device_caps_info_control_caps = -1;
130 static int hf_mbim_device_caps_info_control_caps_reg_manual = -1;
131 static int hf_mbim_device_caps_info_control_caps_hw_radio_switch = -1;
132 static int hf_mbim_device_caps_info_control_caps_cdma_mobile_ip = -1;
133 static int hf_mbim_device_caps_info_control_caps_cdma_simple_ip = -1;
134 static int hf_mbim_device_caps_info_control_caps_multi_carrier = -1;
135 static int hf_mbim_device_caps_info_control_caps_esim = -1;
136 static int hf_mbim_device_caps_info_control_caps_ue_policy_route_selection = -1;
137 static int hf_mbim_device_caps_info_control_caps_sim_hot_swap_capable = -1;
138 static int hf_mbim_device_caps_info_data_subclass = -1;
139 static int hf_mbim_data_subclass_5gendc = -1;
140 static int hf_mbim_data_subclass_5gnr = -1;
141 static int hf_mbim_data_subclass_5gnedc = -1;
142 static int hf_mbim_data_subclass_5gelte = -1;
143 static int hf_mbim_data_subclass_5gngendc = -1;
144 static int hf_mbim_device_caps_info_max_sessions = -1;
145 static int hf_mbim_device_caps_info_wcdma_band_class = -1;
146 static int hf_mbim_device_caps_info_custom_data_class_offset = -1;
147 static int hf_mbim_device_caps_info_custom_data_class_size = -1;
148 static int hf_mbim_device_caps_info_device_id_offset = -1;
149 static int hf_mbim_device_caps_info_device_id_size = -1;
150 static int hf_mbim_device_caps_info_fw_info_offset = -1;
151 static int hf_mbim_device_caps_info_fw_info_size = -1;
152 static int hf_mbim_device_caps_info_hw_info_offset = -1;
153 static int hf_mbim_device_caps_info_hw_info_size = -1;
154 static int hf_mbim_device_caps_info_custom_data_class = -1;
155 static int hf_mbim_device_caps_info_device_id = -1;
156 static int hf_mbim_device_caps_info_fw_info = -1;
157 static int hf_mbim_device_caps_info_hw_info = -1;
158 static int hf_mbim_device_caps_info_v2_executor_index = -1;
159 static int hf_mbim_subscr_ready_status_ready_state = -1;
160 static int hf_mbim_subscr_ready_status_flags = -1;
161 static int hf_mbim_subscr_ready_status_flag_esim = -1;
162 static int hf_mbim_subscr_ready_status_flag_sim_removability_known = -1;
163 static int hf_mbim_subscr_ready_status_flag_sim_removable = -1;
164 static int hf_mbim_subscr_ready_status_susbcr_id_offset = -1;
165 static int hf_mbim_subscr_ready_status_susbcr_id_size = -1;
166 static int hf_mbim_subscr_ready_status_sim_icc_id_offset = -1;
167 static int hf_mbim_subscr_ready_status_sim_icc_id_size = -1;
168 static int hf_mbim_subscr_ready_status_ready_info = -1;
169 static int hf_mbim_subscr_ready_status_elem_count = -1;
170 static int hf_mbim_subscr_ready_status_tel_nb_offset = -1;
171 static int hf_mbim_subscr_ready_status_tel_nb_size = -1;
172 static int hf_mbim_subscr_ready_status_susbcr_id = -1;
173 static int hf_mbim_subscr_ready_status_sim_icc_id = -1;
174 static int hf_mbim_subscr_ready_status_tel_nb = -1;
175 static int hf_mbim_radio_state_set = -1;
176 static int hf_mbim_radio_state_hw_radio_state = -1;
177 static int hf_mbim_radio_state_sw_radio_state = -1;
178 static int hf_mbim_set_pin_pin_type = -1;
179 static int hf_mbim_set_pin_pin_pin_operation = -1;
180 static int hf_mbim_set_pin_pin_pin_offset = -1;
181 static int hf_mbim_set_pin_pin_pin_size = -1;
182 static int hf_mbim_set_pin_new_pin_offset = -1;
183 static int hf_mbim_set_pin_new_pin_size = -1;
184 static int hf_mbim_set_pin_pin = -1;
185 static int hf_mbim_set_pin_new_pin = -1;
186 static int hf_mbim_pin_info_pin_type = -1;
187 static int hf_mbim_pin_info_pin_state = -1;
188 static int hf_mbim_pin_info_remaining_attempts = -1;
189 static int hf_mbim_pin_list_pin_mode = -1;
190 static int hf_mbim_pin_list_pin_format = -1;
191 static int hf_mbim_pin_list_pin_length_min = -1;
192 static int hf_mbim_pin_list_pin_length_max = -1;
193 static int hf_mbim_provider_state = -1;
194 static int hf_mbim_provider_state_home = -1;
195 static int hf_mbim_provider_state_forbidden = -1;
196 static int hf_mbim_provider_state_preferred = -1;
197 static int hf_mbim_provider_state_visible = -1;
198 static int hf_mbim_provider_state_registered = -1;
199 static int hf_mbim_provider_state_preferred_multicarrier = -1;
200 static int hf_mbim_provider_provider_id_offset = -1;
201 static int hf_mbim_provider_provider_id_size = -1;
202 static int hf_mbim_provider_provider_name_offset = -1;
203 static int hf_mbim_provider_provider_name_size = -1;
204 static int hf_mbim_provider_cellular_class = -1;
205 static int hf_mbim_provider_rssi = -1;
206 static int hf_mbim_provider_error_rate = -1;
207 static int hf_mbim_provider_provider_id = -1;
208 static int hf_mbim_provider_provider_name = -1;
209 static int hf_mbim_providers_elem_count = -1;
210 static int hf_mbim_providers_provider_offset = -1;
211 static int hf_mbim_providers_provider_size = -1;
212 static int hf_mbim_visible_providers_req_action = -1;
213 static int hf_mbim_set_register_state_provider_id_offset = -1;
214 static int hf_mbim_set_register_state_provider_id_size = -1;
215 static int hf_mbim_set_register_state_register_action = -1;
216 static int hf_mbim_register_state_data_class = -1;
217 static int hf_mbim_set_register_state_provider_id = -1;
218 static int hf_mbim_registration_state_info_nw_error = -1;
219 static int hf_mbim_registration_state_info_register_state = -1;
220 static int hf_mbim_registration_state_info_register_mode = -1;
221 static int hf_mbim_registration_state_info_available_data_classes = -1;
222 static int hf_mbim_registration_state_info_current_cellular_class = -1;
223 static int hf_mbim_registration_state_info_provider_id_offset = -1;
224 static int hf_mbim_registration_state_info_provider_id_size = -1;
225 static int hf_mbim_registration_state_info_provider_name_offset = -1;
226 static int hf_mbim_registration_state_info_provider_name_size = -1;
227 static int hf_mbim_registration_state_info_roaming_text_offset = -1;
228 static int hf_mbim_registration_state_info_roaming_text_size = -1;
229 static int hf_mbim_registration_state_info_registration_flags = -1;
230 static int hf_mbim_registration_state_info_registration_flags_manual_selection_not_available = -1;
231 static int hf_mbim_registration_state_info_registration_flags_packet_service_auto_attach = -1;
232 static int hf_mbim_registration_state_info_preferred_data_class = -1;
233 static int hf_mbim_registration_state_info_provider_id = -1;
234 static int hf_mbim_registration_state_info_provider_name = -1;
235 static int hf_mbim_registration_state_info_roaming_text = -1;
236 static int hf_mbim_set_packet_service_action = -1;
237 static int hf_mbim_ms_plmn_mcc = -1;
238 static int hf_mbim_ms_plmn_mnc = -1;
239 static int hf_mbim_ms_tai_tac = -1;
240 static int hf_mbim_ms_tai_list_type = -1;
241 static int hf_mbim_ms_tai_list_single_plmn_tac_element = -1;
242 static int hf_mbim_ms_tai_list_multi_plmn_tai_element = -1;
243 static int hf_mbim_packet_service_info_nw_error = -1;
244 static int hf_mbim_packet_service_info_packet_service_state = -1;
245 static int hf_mbim_packet_service_info_highest_available_data_class = -1;
246 static int hf_mbim_packet_service_info_current_data_class = -1;
247 static int hf_mbim_packet_service_info_uplink_speed = -1;
248 static int hf_mbim_packet_service_info_downlink_speed = -1;
249 static int hf_mbim_packet_service_info_frequency_range = -1;
250 static int hf_mbim_packet_service_info_data_subclass = -1;
251 static int hf_mbim_set_signal_state_signal_strength_interval = -1;
252 static int hf_mbim_set_signal_state_rssi_threshold = -1;
253 static int hf_mbim_set_signal_state_error_rate_threshold = -1;
254 static int hf_mbim_signal_state_element_rsrp = -1;
255 static int hf_mbim_signal_state_element_snr = -1;
256 static int hf_mbim_signal_state_element_rsrp_threshold = -1;
257 static int hf_mbim_signal_state_element_snr_threshold = -1;
258 static int hf_mbim_signal_state_element_system_type = -1;
259 static int hf_mbim_signal_state_info_rssi = -1;
260 static int hf_mbim_signal_state_info_error_rate = -1;
261 static int hf_mbim_signal_state_info_signal_strength_interval = -1;
262 static int hf_mbim_signal_state_info_rssi_threshold = -1;
263 static int hf_mbim_signal_state_info_error_rate_threshold = -1;
264 static int hf_mbim_signal_state_info_rsrp_snr_offset = -1;
265 static int hf_mbim_signal_state_info_rsrp_snr_size = -1;
266 static int hf_mbim_signal_state_info_elem_count = -1;
267 static int hf_mbim_context_type = -1;
268 static int hf_mbim_set_connect_session_id = -1;
269 static int hf_mbim_set_connect_activation_command = -1;
270 static int hf_mbim_set_connect_access_string_offset = -1;
271 static int hf_mbim_set_connect_access_string_size = -1;
272 static int hf_mbim_set_connect_user_name_offset = -1;
273 static int hf_mbim_set_connect_user_name_size = -1;
274 static int hf_mbim_set_connect_password_offset = -1;
275 static int hf_mbim_set_connect_password_size = -1;
276 static int hf_mbim_set_connect_compression = -1;
277 static int hf_mbim_set_connect_auth_protocol = -1;
278 static int hf_mbim_set_connect_ip_type = -1;
279 static int hf_mbim_set_connect_access_string = -1;
280 static int hf_mbim_set_connect_user_name = -1;
281 static int hf_mbim_set_connect_password = -1;
282 static int hf_mbim_set_connect_media_preference = -1;
283 static int hf_mbim_connect_info_session_id = -1;
284 static int hf_mbim_connect_info_activation_state = -1;
285 static int hf_mbim_connect_info_voice_call_state = -1;
286 static int hf_mbim_connect_info_ip_type = -1;
287 static int hf_mbim_connect_info_nw_error = -1;
288 static int hf_mbim_connect_info_access_media = -1;
289 static int hf_mbim_context_context_id = -1;
290 static int hf_mbim_context_access_string_offset = -1;
291 static int hf_mbim_context_access_string_size = -1;
292 static int hf_mbim_context_user_name_offset = -1;
293 static int hf_mbim_context_user_name_size = -1;
294 static int hf_mbim_context_password_offset = -1;
295 static int hf_mbim_context_password_size = -1;
296 static int hf_mbim_context_compression = -1;
297 static int hf_mbim_context_auth_protocol = -1;
298 static int hf_mbim_context_provider_id_offset = -1;
299 static int hf_mbim_context_provider_id_size = -1;
300 static int hf_mbim_context_provider_id = -1;
301 static int hf_mbim_context_access_string = -1;
302 static int hf_mbim_context_user_name = -1;
303 static int hf_mbim_context_password = -1;
304 static int hf_mbim_provisioned_contexts_info_elem_count = -1;
305 static int hf_mbim_provisioned_contexts_info_provisioned_context_offset = -1;
306 static int hf_mbim_provisioned_contexts_info_provisioned_context_size = -1;
307 static int hf_mbim_set_service_activation_data_buffer = -1;
308 static int hf_mbim_service_activation_info_nw_error = -1;
309 static int hf_mbim_service_activation_info_data_buffer = -1;
310 static int hf_mbim_ipv4_element_on_link_prefix_length = -1;
311 static int hf_mbim_ipv4_element_ipv4_address = -1;
312 static int hf_mbim_ipv6_element_on_link_prefix_length = -1;
313 static int hf_mbim_ipv6_element_ipv6_address = -1;
314 static int hf_mbim_ip_configuration_info_session_id = -1;
315 static int hf_mbim_ip_configuration_info_ipv4_configuration_available = -1;
316 static int hf_mbim_ip_configuration_info_ipv4_configuration_available_address = -1;
317 static int hf_mbim_ip_configuration_info_ipv4_configuration_available_gateway = -1;
318 static int hf_mbim_ip_configuration_info_ipv4_configuration_available_dns = -1;
319 static int hf_mbim_ip_configuration_info_ipv4_configuration_available_mtu = -1;
320 static int hf_mbim_ip_configuration_info_ipv6_configuration_available = -1;
321 static int hf_mbim_ip_configuration_info_ipv6_configuration_available_address = -1;
322 static int hf_mbim_ip_configuration_info_ipv6_configuration_available_gateway = -1;
323 static int hf_mbim_ip_configuration_info_ipv6_configuration_available_dns = -1;
324 static int hf_mbim_ip_configuration_info_ipv6_configuration_available_mtu = -1;
325 static int hf_mbim_ip_configuration_info_ipv4_address_count = -1;
326 static int hf_mbim_ip_configuration_info_ipv4_address_offset = -1;
327 static int hf_mbim_ip_configuration_info_ipv6_address_count = -1;
328 static int hf_mbim_ip_configuration_info_ipv6_address_offset = -1;
329 static int hf_mbim_ip_configuration_info_ipv4_gateway_offset = -1;
330 static int hf_mbim_ip_configuration_info_ipv6_gateway_offset = -1;
331 static int hf_mbim_ip_configuration_info_ipv4_dns_count = -1;
332 static int hf_mbim_ip_configuration_info_ipv4_dns_offset = -1;
333 static int hf_mbim_ip_configuration_info_ipv6_dns_count = -1;
334 static int hf_mbim_ip_configuration_info_ipv6_dns_offset = -1;
335 static int hf_mbim_ip_configuration_info_ipv4_mtu = -1;
336 static int hf_mbim_ip_configuration_info_ipv6_mtu = -1;
337 static int hf_mbim_ip_configuration_info_ipv4_gateway = -1;
338 static int hf_mbim_ip_configuration_info_ipv6_gateway = -1;
339 static int hf_mbim_ip_configuration_info_ipv4_dns = -1;
340 static int hf_mbim_ip_configuration_info_ipv6_dns = -1;
341 static int hf_mbim_device_service_element_device_service_id = -1;
342 static int hf_mbim_device_service_element_dss_payload = -1;
343 static int hf_mbim_device_service_element_dss_payload_host_device = -1;
344 static int hf_mbim_device_service_element_dss_payload_device_host = -1;
345 static int hf_mbim_device_service_element_max_dss_instances = -1;
346 static int hf_mbim_device_service_element_cid_count = -1;
347 static int hf_mbim_device_service_element_cid = -1;
348 static int hf_mbim_device_services_info_device_services_count = -1;
349 static int hf_mbim_device_services_info_max_dss_sessions = -1;
350 static int hf_mbim_device_services_info_device_services_offset = -1;
351 static int hf_mbim_device_services_info_device_services_size = -1;
352 static int hf_mbim_event_entry_device_service_id = -1;
353 static int hf_mbim_event_entry_cid_count = -1;
354 static int hf_mbim_event_entry_cid = -1;
355 static int hf_mbim_device_service_subscribe_element_count = -1;
356 static int hf_mbim_device_service_subscribe_device_service_offset = -1;
357 static int hf_mbim_device_service_subscribe_device_service_size = -1;
358 static int hf_mbim_packet_statistics_info_in_discards = -1;
359 static int hf_mbim_packet_statistics_info_in_errors = -1;
360 static int hf_mbim_packet_statistics_info_in_octets = -1;
361 static int hf_mbim_packet_statistics_info_in_packets = -1;
362 static int hf_mbim_packet_statistics_info_out_octets = -1;
363 static int hf_mbim_packet_statistics_info_out_packets = -1;
364 static int hf_mbim_packet_statistics_info_out_errors = -1;
365 static int hf_mbim_packet_statistics_info_out_discards = -1;
366 static int hf_mbim_network_idle_hint_state = -1;
367 static int hf_mbim_emergency_mode_info_emergency_mode = -1;
368 static int hf_mbim_single_packet_filter_filter_size = -1;
369 static int hf_mbim_single_packet_filter_packet_filter_offset = -1;
370 static int hf_mbim_single_packet_filter_packet_mask_offset = -1;
371 static int hf_mbim_single_packet_filter_filter_id = -1;
372 static int hf_mbim_single_packet_filter_packet_filter = -1;
373 static int hf_mbim_single_packet_filter_packet_mask = -1;
374 static int hf_mbim_packet_filters_session_id = -1;
375 static int hf_mbim_packet_filters_packet_filters_count = -1;
376 static int hf_mbim_packet_filters_packet_filters_packet_filter_offset = -1;
377 static int hf_mbim_packet_filters_packet_filters_packet_filter_size = -1;
378 static int hf_mbim_set_sms_configuration_format = -1;
379 static int hf_mbim_set_sms_configuration_sc_address_offset = -1;
380 static int hf_mbim_set_sms_configuration_sc_address_size = -1;
381 static int hf_mbim_set_sms_configuration_sc_address = -1;
382 static int hf_mbim_sms_configuration_info_sms_storage_state = -1;
383 static int hf_mbim_sms_configuration_info_format = -1;
384 static int hf_mbim_sms_configuration_info_max_messages = -1;
385 static int hf_mbim_sms_configuration_info_cdma_short_message_size = -1;
386 static int hf_mbim_sms_configuration_info_sc_address_offset = -1;
387 static int hf_mbim_sms_configuration_info_sc_address_size = -1;
388 static int hf_mbim_sms_configuration_info_sc_address = -1;
389 static int hf_mbim_sms_pdu_record_message_index = -1;
390 static int hf_mbim_sms_pdu_record_message_status = -1;
391 static int hf_mbim_sms_pdu_record_pdu_data_offset = -1;
392 static int hf_mbim_sms_pdu_record_pdu_data_size = -1;
393 static int hf_mbim_sms_pdu_record_pdu_data = -1;
394 static int hf_mbim_sms_pdu_record_pdu_data_sc_address_size = -1;
395 static int hf_mbim_sms_cdma_record_message_index = -1;
396 static int hf_mbim_sms_cdma_record_message_status = -1;
397 static int hf_mbim_sms_cdma_record_address_offset = -1;
398 static int hf_mbim_sms_cdma_record_address_size = -1;
399 static int hf_mbim_sms_cdma_record_timestamp_offset = -1;
400 static int hf_mbim_sms_cdma_record_timestamp_size = -1;
401 static int hf_mbim_sms_cdma_record_encoding_id = -1;
402 static int hf_mbim_sms_cdma_record_language_id = -1;
403 static int hf_mbim_sms_cdma_record_encoded_message_offset = -1;
404 static int hf_mbim_sms_cdma_record_size_in_bytes = -1;
405 static int hf_mbim_sms_cdma_record_size_in_characters = -1;
406 static int hf_mbim_sms_cdma_record_address = -1;
407 static int hf_mbim_sms_cdma_record_timestamp = -1;
408 static int hf_mbim_sms_cdma_record_encoded_message = -1;
409 static int hf_mbim_sms_cdma_record_encoded_message_text = -1;
410 static int hf_mbim_sms_read_req_format = -1;
411 static int hf_mbim_sms_read_req_flag = -1;
412 static int hf_mbim_sms_read_req_message_index = -1;
413 static int hf_mbim_sms_read_info_format = -1;
414 static int hf_mbim_sms_read_info_element_count = -1;
415 static int hf_mbim_sms_read_info_sms_offset = -1;
416 static int hf_mbim_sms_read_info_sms_size = -1;
417 static int hf_mbim_sms_send_pdu_pdu_data_offset = -1;
418 static int hf_mbim_sms_send_pdu_pdu_data_size = -1;
419 static int hf_mbim_sms_send_pdu_pdu_data = -1;
420 static int hf_mbim_sms_send_pdu_pdu_data_sc_address_size = -1;
421 static int hf_mbim_sms_send_cdma_encoding_id = -1;
422 static int hf_mbim_sms_send_cdma_language_id = -1;
423 static int hf_mbim_sms_send_cdma_address_offset = -1;
424 static int hf_mbim_sms_send_cdma_address_size = -1;
425 static int hf_mbim_sms_send_cdma_encoded_message_offset = -1;
426 static int hf_mbim_sms_send_cdma_size_in_bytes = -1;
427 static int hf_mbim_sms_send_cdma_size_in_characters = -1;
428 static int hf_mbim_sms_send_cdma_address = -1;
429 static int hf_mbim_sms_send_cdma_encoded_message = -1;
430 static int hf_mbim_sms_send_cdma_encoded_message_text = -1;
431 static int hf_mbim_set_sms_send_format = -1;
432 static int hf_mbim_sms_send_info_message_reference = -1;
433 static int hf_mbim_set_sms_delete_flag = -1;
434 static int hf_mbim_set_sms_delete_message_index = -1;
435 static int hf_mbim_sms_status_info_flags = -1;
436 static int hf_mbim_sms_status_info_flags_message_store_full = -1;
437 static int hf_mbim_sms_status_info_flags_new_message = -1;
438 static int hf_mbim_sms_status_info_message_index = -1;
439 static int hf_mbim_set_ussd_ussd_action = -1;
440 static int hf_mbim_set_ussd_ussd_data_coding_scheme = -1;
441 static int hf_mbim_set_ussd_ussd_payload_offset = -1;
442 static int hf_mbim_set_ussd_ussd_payload_length = -1;
443 static int hf_mbim_set_ussd_ussd_payload = -1;
444 static int hf_mbim_set_ussd_ussd_payload_text = -1;
445 static int hf_mbim_ussd_info_ussd_response = -1;
446 static int hf_mbim_ussd_info_ussd_session_state = -1;
447 static int hf_mbim_ussd_info_ussd_data_coding_scheme = -1;
448 static int hf_mbim_ussd_info_ussd_payload_offset = -1;
449 static int hf_mbim_ussd_info_ussd_payload_length = -1;
450 static int hf_mbim_ussd_info_ussd_payload = -1;
451 static int hf_mbim_ussd_info_ussd_payload_text = -1;
452 static int hf_mbim_phonebook_configuration_info_phonebook_state = -1;
453 static int hf_mbim_phonebook_configuration_info_total_nb_of_entries = -1;
454 static int hf_mbim_phonebook_configuration_info_used_entries = -1;
455 static int hf_mbim_phonebook_configuration_info_max_number_length = -1;
456 static int hf_mbim_phonebook_configuration_info_max_name_length = -1;
457 static int hf_mbim_phonebook_entry_entry_index = -1;
458 static int hf_mbim_phonebook_entry_number_offset = -1;
459 static int hf_mbim_phonebook_entry_number_length = -1;
460 static int hf_mbim_phonebook_entry_name_offset = -1;
461 static int hf_mbim_phonebook_entry_name_length = -1;
462 static int hf_mbim_phonebook_entry_number = -1;
463 static int hf_mbim_phonebook_entry_name = -1;
464 static int hf_mbim_phonebook_read_req_filter_flag = -1;
465 static int hf_mbim_phonebook_read_req_filter_message_index = -1;
466 static int hf_mbim_phonebook_read_info_element_count = -1;
467 static int hf_mbim_phonebook_read_info_phonebook_offset = -1;
468 static int hf_mbim_phonebook_read_info_phonebook_size = -1;
469 static int hf_mbim_set_phonebook_delete_filter_flag = -1;
470 static int hf_mbim_set_phonebook_delete_filter_message_index = -1;
471 static int hf_mbim_set_phonebook_write_save_flag = -1;
472 static int hf_mbim_set_phonebook_write_save_index = -1;
473 static int hf_mbim_set_phonebook_write_number_offset = -1;
474 static int hf_mbim_set_phonebook_write_number_length = -1;
475 static int hf_mbim_set_phonebook_write_name_offset = -1;
476 static int hf_mbim_set_phonebook_write_name_length = -1;
477 static int hf_mbim_set_phonebook_write_number = -1;
478 static int hf_mbim_set_phonebook_write_name = -1;
479 static int hf_mbim_set_stk_pac_pac_host_control = -1;
480 static int hf_mbim_set_stk_pac_pac_host_control_refresh = -1;
481 static int hf_mbim_set_stk_pac_pac_host_control_more_time = -1;
482 static int hf_mbim_set_stk_pac_pac_host_control_poll_interval = -1;
483 static int hf_mbim_set_stk_pac_pac_host_control_polling_off = -1;
484 static int hf_mbim_set_stk_pac_pac_host_control_set_up_evt_list = -1;
485 static int hf_mbim_set_stk_pac_pac_host_control_set_up_call = -1;
486 static int hf_mbim_set_stk_pac_pac_host_control_send_ss = -1;
487 static int hf_mbim_set_stk_pac_pac_host_control_send_ussd = -1;
488 static int hf_mbim_set_stk_pac_pac_host_control_send_short_msg = -1;
489 static int hf_mbim_set_stk_pac_pac_host_control_send_dtmf = -1;
490 static int hf_mbim_set_stk_pac_pac_host_control_launch_browser = -1;
491 static int hf_mbim_set_stk_pac_pac_host_control_geo_loc_req = -1;
492 static int hf_mbim_set_stk_pac_pac_host_control_play_tone = -1;
493 static int hf_mbim_set_stk_pac_pac_host_control_display_text = -1;
494 static int hf_mbim_set_stk_pac_pac_host_control_get_inkey = -1;
495 static int hf_mbim_set_stk_pac_pac_host_control_get_input = -1;
496 static int hf_mbim_set_stk_pac_pac_host_control_select_item = -1;
497 static int hf_mbim_set_stk_pac_pac_host_control_set_up_menu = -1;
498 static int hf_mbim_set_stk_pac_pac_host_control_prov_local_info = -1;
499 static int hf_mbim_set_stk_pac_pac_host_control_timer_management = -1;
500 static int hf_mbim_set_stk_pac_pac_host_control_set_up_idle_mode_text = -1;
501 static int hf_mbim_set_stk_pac_pac_host_control_perform_card_apdu = -1;
502 static int hf_mbim_set_stk_pac_pac_host_control_power_on_card = -1;
503 static int hf_mbim_set_stk_pac_pac_host_control_power_off_card = -1;
504 static int hf_mbim_set_stk_pac_pac_host_control_get_reader_status = -1;
505 static int hf_mbim_set_stk_pac_pac_host_control_run_at_cmd = -1;
506 static int hf_mbim_set_stk_pac_pac_host_control_lang_notif = -1;
507 static int hf_mbim_set_stk_pac_pac_host_control_open_channel = -1;
508 static int hf_mbim_set_stk_pac_pac_host_control_close_channel = -1;
509 static int hf_mbim_set_stk_pac_pac_host_control_receive_data = -1;
510 static int hf_mbim_set_stk_pac_pac_host_control_send_data = -1;
511 static int hf_mbim_set_stk_pac_pac_host_control_get_channel_status = -1;
512 static int hf_mbim_set_stk_pac_pac_host_control_service_search = -1;
513 static int hf_mbim_set_stk_pac_pac_host_control_get_service_info = -1;
514 static int hf_mbim_set_stk_pac_pac_host_control_declare_service = -1;
515 static int hf_mbim_set_stk_pac_pac_host_control_set_frames = -1;
516 static int hf_mbim_set_stk_pac_pac_host_control_get_frames_status = -1;
517 static int hf_mbim_set_stk_pac_pac_host_control_retrieve_multimedia_msg = -1;
518 static int hf_mbim_set_stk_pac_pac_host_control_submit_multimedia_msg = -1;
519 static int hf_mbim_set_stk_pac_pac_host_control_display_multimedia_msg = -1;
520 static int hf_mbim_set_stk_pac_pac_host_control_activate = -1;
521 static int hf_mbim_set_stk_pac_pac_host_control_contactless_state_changed = -1;
522 static int hf_mbim_set_stk_pac_pac_host_control_cmd_container = -1;
523 static int hf_mbim_set_stk_pac_pac_host_control_encapsulated_session_ctrl = -1;
524 static int hf_mbim_set_stk_pac_pac_host_control_end_proact_session = -1;
525 static int hf_mbim_stk_pac_info_pac_support = -1;
526 static int hf_mbim_stk_pac_info_pac_support_refresh = -1;
527 static int hf_mbim_stk_pac_info_pac_support_more_time = -1;
528 static int hf_mbim_stk_pac_info_pac_support_poll_interval = -1;
529 static int hf_mbim_stk_pac_info_pac_support_polling_off = -1;
530 static int hf_mbim_stk_pac_info_pac_support_set_up_evt_list = -1;
531 static int hf_mbim_stk_pac_info_pac_support_set_up_call = -1;
532 static int hf_mbim_stk_pac_info_pac_support_send_ss = -1;
533 static int hf_mbim_stk_pac_info_pac_support_send_ussd = -1;
534 static int hf_mbim_stk_pac_info_pac_support_send_short_msg = -1;
535 static int hf_mbim_stk_pac_info_pac_support_send_dtmf = -1;
536 static int hf_mbim_stk_pac_info_pac_support_launch_browser = -1;
537 static int hf_mbim_stk_pac_info_pac_support_geo_loc_req = -1;
538 static int hf_mbim_stk_pac_info_pac_support_play_tone = -1;
539 static int hf_mbim_stk_pac_info_pac_support_display_text = -1;
540 static int hf_mbim_stk_pac_info_pac_support_get_inkey = -1;
541 static int hf_mbim_stk_pac_info_pac_support_get_input = -1;
542 static int hf_mbim_stk_pac_info_pac_support_select_item = -1;
543 static int hf_mbim_stk_pac_info_pac_support_set_up_menu = -1;
544 static int hf_mbim_stk_pac_info_pac_support_prov_local_info = -1;
545 static int hf_mbim_stk_pac_info_pac_support_timer_management = -1;
546 static int hf_mbim_stk_pac_info_pac_support_set_up_idle_mode_text = -1;
547 static int hf_mbim_stk_pac_info_pac_support_perform_card_apdu = -1;
548 static int hf_mbim_stk_pac_info_pac_support_power_on_card = -1;
549 static int hf_mbim_stk_pac_info_pac_support_power_off_card = -1;
550 static int hf_mbim_stk_pac_info_pac_support_get_reader_status = -1;
551 static int hf_mbim_stk_pac_info_pac_support_run_at_cmd = -1;
552 static int hf_mbim_stk_pac_info_pac_support_lang_notif = -1;
553 static int hf_mbim_stk_pac_info_pac_support_open_channel = -1;
554 static int hf_mbim_stk_pac_info_pac_support_close_channel = -1;
555 static int hf_mbim_stk_pac_info_pac_support_receive_data = -1;
556 static int hf_mbim_stk_pac_info_pac_support_send_data = -1;
557 static int hf_mbim_stk_pac_info_pac_support_get_channel_status = -1;
558 static int hf_mbim_stk_pac_info_pac_support_service_search = -1;
559 static int hf_mbim_stk_pac_info_pac_support_get_service_info = -1;
560 static int hf_mbim_stk_pac_info_pac_support_declare_service = -1;
561 static int hf_mbim_stk_pac_info_pac_support_set_frames = -1;
562 static int hf_mbim_stk_pac_info_pac_support_get_frames_status = -1;
563 static int hf_mbim_stk_pac_info_pac_support_retrieve_multimedia_msg = -1;
564 static int hf_mbim_stk_pac_info_pac_support_submit_multimedia_msg = -1;
565 static int hf_mbim_stk_pac_info_pac_support_display_multimedia_msg = -1;
566 static int hf_mbim_stk_pac_info_pac_support_activate = -1;
567 static int hf_mbim_stk_pac_info_pac_support_contactless_state_changed = -1;
568 static int hf_mbim_stk_pac_info_pac_support_cmd_container = -1;
569 static int hf_mbim_stk_pac_info_pac_support_encapsulated_session_ctrl = -1;
570 static int hf_mbim_stk_pac_info_pac_support_end_proact_session = -1;
571 static int hf_mbim_stk_pac_pac_type = -1;
572 static int hf_mbim_stk_pac_pac = -1;
573 static int hf_mbim_set_stk_terminal_response_response_length = -1;
574 static int hf_mbim_set_stk_terminal_response_data_buffer = -1;
575 static int hf_mbim_stk_terminal_response_info_result_data_string_offset = -1;
576 static int hf_mbim_stk_terminal_response_info_result_data_string_length = -1;
577 static int hf_mbim_stk_terminal_response_info_status_word = -1;
578 static int hf_mbim_stk_terminal_response_info_result_data_string = -1;
579 static int hf_mbim_set_stk_envelope_data_buffer = -1;
580 static int hf_mbim_stk_envelope_info_envelope_support = -1;
581 static int hf_mbim_aka_auth_req_rand = -1;
582 static int hf_mbim_aka_auth_req_autn = -1;
583 static int hf_mbim_aka_auth_info_res = -1;
584 static int hf_mbim_aka_auth_info_res_length = -1;
585 static int hf_mbim_aka_auth_info_ik = -1;
586 static int hf_mbim_aka_auth_info_ck = -1;
587 static int hf_mbim_aka_auth_info_auts = -1;
588 static int hf_mbim_akap_auth_req_rand = -1;
589 static int hf_mbim_akap_auth_req_autn = -1;
590 static int hf_mbim_akap_auth_req_network_name_offset = -1;
591 static int hf_mbim_akap_auth_req_network_name_length = -1;
592 static int hf_mbim_akap_auth_req_network_name = -1;
593 static int hf_mbim_akap_auth_info_res = -1;
594 static int hf_mbim_akap_auth_info_res_length = -1;
595 static int hf_mbim_akap_auth_info_ik = -1;
596 static int hf_mbim_akap_auth_info_ck = -1;
597 static int hf_mbim_akap_auth_info_auts = -1;
598 static int hf_mbim_sim_auth_req_rand1 = -1;
599 static int hf_mbim_sim_auth_req_rand2 = -1;
600 static int hf_mbim_sim_auth_req_rand3 = -1;
601 static int hf_mbim_sim_auth_req_n = -1;
602 static int hf_mbim_sim_auth_info_sres1 = -1;
603 static int hf_mbim_sim_auth_info_kc1 = -1;
604 static int hf_mbim_sim_auth_info_sres2 = -1;
605 static int hf_mbim_sim_auth_info_kc2 = -1;
606 static int hf_mbim_sim_auth_info_sres3 = -1;
607 static int hf_mbim_sim_auth_info_kc3 = -1;
608 static int hf_mbim_sim_auth_info_n = -1;
609 static int hf_mbim_set_dss_connect_device_service_id = -1;
610 static int hf_mbim_set_dss_connect_dss_session_id = -1;
611 static int hf_mbim_set_dss_connect_dss_link_state = -1;
612 static int hf_mbim_multicarrier_capabilities_info_capabilities = -1;
613 static int hf_mbim_multicarrier_capabilities_info_capabilities_static_scan = -1;
614 static int hf_mbim_multicarrier_capabilities_info_capabilities_fw_requires_reboot = -1;
615 static int hf_mbim_location_info_country = -1;
616 static int hf_mbim_multicarrier_current_cid_list_req_uuid = -1;
617 static int hf_mbim_multicarrier_current_cid_list_info_cid_count = -1;
618 static int hf_mbim_multicarrier_current_cid_list_info_cid = -1;
619 static int hf_mbim_msfwid_firmwareid_info_firmware_id = -1;
620 static int hf_mbim_qmi_buffer = -1;
621 static int hf_mbim_thermal_config_enable = -1;
622 static int hf_mbim_thermal_config_temp_sensor_id = -1;
623 static int hf_mbim_thermal_config_alarm_id = -1;
624 static int hf_mbim_thermal_config_threshold_value = -1;
625 static int hf_mbim_thermal_config_hyst_value = -1;
626 static int hf_mbim_thermal_config_sampling_period = -1;
627 static int hf_mbim_query_thermal_state_temp_sensor_id = -1;
628 static int hf_mbim_thermal_state_info_current_temp_value = -1;
629 static int hf_mbim_thermal_state_info_enable = -1;
630 static int hf_mbim_thermal_state_info_temp_sensor_id = -1;
631 static int hf_mbim_thermal_state_info_alarm_id = -1;
632 static int hf_mbim_thermal_state_info_threshold_value = -1;
633 static int hf_mbim_thermal_state_info_hyst_value = -1;
634 static int hf_mbim_thermal_state_info_sampling_period = -1;
635 static int hf_mbim_sar_config_sar_status = -1;
636 static int hf_mbim_sar_config_level = -1;
637 static int hf_mbim_adpclk_activate_state = -1;
638 static int hf_mbim_adpclk_freq_info_elem_count = -1;
639 static int hf_mbim_adpclk_freq_info_adpclk_freq_value_offset = -1;
640 static int hf_mbim_adpclk_freq_info_adpclk_freq_value_size = -1;
641 static int hf_mbim_adpclk_freq_info_adpclk_freq_value_center_freq = -1;
642 static int hf_mbim_adpclk_freq_info_adpclk_freq_value_freq_spread = -1;
643 static int hf_mbim_adpclk_freq_info_adpclk_freq_value_noise_power = -1;
644 static int hf_mbim_adpclk_freq_info_adpclk_freq_value_rssi = -1;
645 static int hf_mbim_adpclk_freq_info_adpclk_freq_value_connect_status = -1;
646 static int hf_mbim_trace_config_config = -1;
647 static int hf_mbim_nrtc_app_info_period = -1;
648 static int hf_mbim_nrtc_app_info_duration = -1;
649 static int hf_mbim_nrtcws_config_mode = -1;
650 static int hf_mbim_nrtcws_config_wlan_active = -1;
651 static int hf_mbim_nrtcws_config_wlan_safe_rx = -1;
652 static int hf_mbim_nrtcws_config_wlan_bandwidth = -1;
653 static int hf_mbim_nrtcws_config_bt_active = -1;
654 static int hf_mbim_nrtcws_config_bt_safe_rx = -1;
655 static int hf_mbim_nrtcws_info_lte_active = -1;
656 static int hf_mbim_nrtcws_info_wlan_safe_rx_min = -1;
657 static int hf_mbim_nrtcws_info_wlan_safe_rx_max = -1;
658 static int hf_mbim_nrtcws_info_bt_safe_rx_min = -1;
659 static int hf_mbim_nrtcws_info_bt_safe_rx_max = -1;
660 static int hf_mbim_nrtcws_info_lte_sps_period = -1;
661 static int hf_mbim_nrtcws_info_lte_sps_duration = -1;
662 static int hf_mbim_nrtcws_info_lte_sps_initial_offset = -1;
663 static int hf_mbim_usbprofile_cmd_length = -1;
664 static int hf_mbim_usbprofile_cmd_buffer = -1;
665 static int hf_mbim_usbprofile_rsp_length = -1;
666 static int hf_mbim_usbprofile_rsp_buffer = -1;
667 static int hf_mbim_ciq_set_mode = -1;
668 static int hf_mbim_ciq_set_debug_info_size = -1;
669 static int hf_mbim_ciq_set_debug_info = -1;
670 static int hf_mbim_ciq_info_mode = -1;
671 static int hf_mbim_atds_signal_info_rssi = -1;
672 static int hf_mbim_atds_signal_info_ber = -1;
673 static int hf_mbim_atds_signal_info_rscp = -1;
674 static int hf_mbim_atds_signal_info_ecno = -1;
675 static int hf_mbim_atds_signal_info_rsrq = -1;
676 static int hf_mbim_atds_signal_info_rsrp = -1;
677 static int hf_mbim_atds_signal_info_rssnr = -1;
678 static int hf_mbim_atds_location_info_lac = -1;
679 static int hf_mbim_atds_location_info_tac = -1;
680 static int hf_mbim_atds_location_info_cellid = -1;
681 static int hf_mbim_atds_operator_provider_id_offset = -1;
682 static int hf_mbim_atds_operator_provider_id_size = -1;
683 static int hf_mbim_atds_operator_provider_state = -1;
684 static int hf_mbim_atds_operator_provider_name_offset = -1;
685 static int hf_mbim_atds_operator_provider_name_size = -1;
686 static int hf_mbim_atds_operator_plmn_mode = -1;
687 static int hf_mbim_atds_operator_rssi = -1;
688 static int hf_mbim_atds_operator_error_rate = -1;
689 static int hf_mbim_atds_operator_provider_id = -1;
690 static int hf_mbim_atds_operator_provider_name = -1;
691 static int hf_mbim_atds_operators_elem_count = -1;
692 static int hf_mbim_atds_operators_operator_offset = -1;
693 static int hf_mbim_atds_operators_operator_size = -1;
694 static int hf_mbim_atds_rat_info_mode = -1;
695 static int hf_mbim_atds_projection_table_type = -1;
696 static int hf_mbim_atds_projection_table_bar5min = -1;
697 static int hf_mbim_atds_projection_table_a5 = -1;
698 static int hf_mbim_atds_projection_table_b5 = -1;
699 static int hf_mbim_atds_projection_table_bar4min = -1;
700 static int hf_mbim_atds_projection_table_a4 = -1;
701 static int hf_mbim_atds_projection_table_b4 = -1;
702 static int hf_mbim_atds_projection_table_bar3min = -1;
703 static int hf_mbim_atds_projection_table_a3 = -1;
704 static int hf_mbim_atds_projection_table_b3 = -1;
705 static int hf_mbim_atds_projection_table_bar2min = -1;
706 static int hf_mbim_atds_projection_table_a2 = -1;
707 static int hf_mbim_atds_projection_table_b2 = -1;
708 static int hf_mbim_atds_projection_table_bar1min = -1;
709 static int hf_mbim_atds_projection_table_a1 = -1;
710 static int hf_mbim_atds_projection_table_b1 = -1;
711 static int hf_mbim_atds_projection_table_bar0min = -1;
712 static int hf_mbim_atds_projection_table_a0 = -1;
713 static int hf_mbim_atds_projection_table_b0 = -1;
714 static int hf_mbim_atds_projection_tables_elem_count = -1;
715 static int hf_mbim_atds_projection_tables_projection_table_offset = -1;
716 static int hf_mbim_atds_projection_tables_projection_table_size = -1;
717 static int hf_mbim_multiflow_caps_info_control_caps = -1;
718 static int hf_mbim_multiflow_caps_info_control_caps_uplink = -1;
719 static int hf_mbim_multiflow_caps_info_control_caps_downlink = -1;
720 static int hf_mbim_set_multiflow_state_state = -1;
721 static int hf_mbim_multiflow_state_info_state = -1;
722 static int hf_mbim_multiflow_tft_info_session_id = -1;
723 static int hf_mbim_multiflow_tft_info_elem_count = -1;
724 static int hf_mbim_multiflow_tft_info_tft_list_offset = -1;
725 static int hf_mbim_multiflow_tft_info_tft_list_size = -1;
726 static int hf_mbim_version = -1;
727 static int hf_mbim_extended_version = -1;
728 static int hf_mbim_set_ms_provisioned_context_v2_operation = -1;
729 static int hf_mbim_set_ms_provisioned_context_v2_ip_type = -1;
730 static int hf_mbim_set_ms_provisioned_context_v2_enable = -1;
731 static int hf_mbim_set_ms_provisioned_context_v2_roaming = -1;
732 static int hf_mbim_set_ms_provisioned_context_v2_media_type = -1;
733 static int hf_mbim_set_ms_provisioned_context_v2_source = -1;
734 static int hf_mbim_set_ms_provisioned_context_v2_access_string = -1;
735 static int hf_mbim_set_ms_provisioned_context_v2_access_string_offset = -1;
736 static int hf_mbim_set_ms_provisioned_context_v2_access_string_size = -1;
737 static int hf_mbim_set_ms_provisioned_context_v2_user_name = -1;
738 static int hf_mbim_set_ms_provisioned_context_v2_user_name_offset = -1;
739 static int hf_mbim_set_ms_provisioned_context_v2_user_name_size = -1;
740 static int hf_mbim_set_ms_provisioned_context_v2_password = -1;
741 static int hf_mbim_set_ms_provisioned_context_v2_password_offset = -1;
742 static int hf_mbim_set_ms_provisioned_context_v2_password_size = -1;
743 static int hf_mbim_set_ms_provisioned_context_v2_compression = -1;
744 static int hf_mbim_set_ms_provisioned_context_v2_auth_protocol = -1;
745 static int hf_mbim_ms_provisioned_context_info_v2_elem_count = -1;
746 static int hf_mbim_ms_provisioned_context_info_v2_list_offset = -1;
747 static int hf_mbim_ms_provisioned_context_info_v2_list_size = -1;
748 static int hf_mbim_ms_provisioned_context_info_v2_context_id = -1;
749 static int hf_mbim_ms_network_blacklist_info_blacklist_state = -1;
750 static int hf_mbim_ms_network_blacklist_state_sim_provider_actuated = -1;
751 static int hf_mbim_ms_network_blacklist_state_network_provider_actuated = -1;
752 static int hf_mbim_ms_network_blacklist_info_elem_count = -1;
753 static int hf_mbim_ms_network_blacklist_info_list_offset = -1;
754 static int hf_mbim_ms_network_blacklist_info_list_size = -1;
755 static int hf_mbim_ms_network_blacklist_provider_mcc = -1;
756 static int hf_mbim_ms_network_blacklist_provider_mnc = -1;
757 static int hf_mbim_ms_network_blacklist_provider_type = -1;
758 static int hf_mbim_sys_caps_info_number_of_executors = -1;
759 static int hf_mbim_sys_caps_info_number_of_slots = -1;
760 static int hf_mbim_sys_caps_info_concurrency = -1;
761 static int hf_mbim_sys_caps_info_modem_id = -1;
762 static int hf_mbim_ms_device_slot_mapping_info_map_count = -1;
763 static int hf_mbim_ms_device_slot_mapping_info_map_offset = -1;
764 static int hf_mbim_ms_device_slot_mapping_info_map_size = -1;
765 static int hf_mbim_ms_device_slot_mapping_info_executor_slot_index = -1;
766 static int hf_mbim_ms_slot_info_req_slot_index = -1;
767 static int hf_mbim_ms_slot_info_slot_index = -1;
768 static int hf_mbim_ms_slot_info_state = -1;
769 static int hf_mbim_ms_modem_config_config_status = -1;
770 static int hf_mbim_ms_registration_params_info_mico_mode = -1;
771 static int hf_mbim_ms_registration_params_info_drx_params = -1;
772 static int hf_mbim_ms_registration_params_info_ladn_info = -1;
773 static int hf_mbim_ms_registration_params_info_default_pdu_hint = -1;
774 static int hf_mbim_ms_registration_params_info_re_register_if_needed = -1;
775 static int hf_mbim_ms_wake_reason_wake_type = -1;
776 static int hf_mbim_ms_wake_reason_session_id = -1;
777 static int hf_mbim_ms_wake_reason_command_payload_offset = -1;
778 static int hf_mbim_ms_wake_reason_command_payload_size = -1;
779 static int hf_mbim_ms_wake_reason_command_payload = -1;
780 static int hf_mbim_ms_wake_reason_packet_original_size = -1;
781 static int hf_mbim_ms_wake_reason_packet_saved_offset = -1;
782 static int hf_mbim_ms_wake_reason_packet_saved_size = -1;
783 static int hf_mbim_ms_wake_reason_packet_saved_data = -1;
784 static int hf_mbim_ms_atr_info_atr_offset = -1;
785 static int hf_mbim_ms_atr_info_atr_size = -1;
786 static int hf_mbim_ms_app_info_app_type = -1;
787 static int hf_mbim_ms_app_info_app_id_size = -1;
788 static int hf_mbim_ms_app_info_app_id = -1;
789 static int hf_mbim_ms_app_info_app_name_length = -1;
790 static int hf_mbim_ms_app_info_app_name = -1;
791 static int hf_mbim_ms_app_info_num_pins = -1;
792 static int hf_mbim_ms_app_info_pin_ref = -1;
793 static int hf_mbim_ms_app_list_version = -1;
794 static int hf_mbim_ms_app_list_app_count = -1;
795 static int hf_mbim_ms_app_list_active_app_index = -1;
796 static int hf_mbim_ms_app_list_app_list_offset = -1;
797 static int hf_mbim_ms_app_list_app_list_size = -1;
798 static int hf_mbim_ms_file_path_version = -1;
799 static int hf_mbim_ms_file_path_app_id_offset = -1;
800 static int hf_mbim_ms_file_path_app_id_size = -1;
801 static int hf_mbim_ms_file_path_file_path_offset = -1;
802 static int hf_mbim_ms_file_path_file_path_size = -1;
803 static int hf_mbim_ms_file_path_app_id = -1;
804 static int hf_mbim_ms_file_path_file_path = -1;
805 static int hf_mbim_ms_file_status_version = -1;
806 static int hf_mbim_ms_file_status_status_word_1 = -1;
807 static int hf_mbim_ms_file_status_status_word_2 = -1;
808 static int hf_mbim_ms_file_status_file_accessibility = -1;
809 static int hf_mbim_ms_file_status_file_type = -1;
810 static int hf_mbim_ms_file_status_file_structure = -1;
811 static int hf_mbim_ms_file_status_item_count = -1;
812 static int hf_mbim_ms_file_status_size = -1;
813 static int hf_mbim_ms_file_status_file_lock_status = -1;
814 static int hf_mbim_ms_response_version = -1;
815 static int hf_mbim_ms_response_status_word_1 = -1;
816 static int hf_mbim_ms_response_status_word_2 = -1;
817 static int hf_mbim_ms_response_response_data_offset = -1;
818 static int hf_mbim_ms_response_response_data_size = -1;
819 static int hf_mbim_ms_response_response_data = -1;
820 static int hf_mbim_ms_access_binary_version = -1;
821 static int hf_mbim_ms_access_binary_app_id_offset = -1;
822 static int hf_mbim_ms_access_binary_app_id_size = -1;
823 static int hf_mbim_ms_access_binary_file_path_offset = -1;
824 static int hf_mbim_ms_access_binary_file_path_size = -1;
825 static int hf_mbim_ms_access_binary_file_offset = -1;
826 static int hf_mbim_ms_access_binary_number_of_bytes = -1;
827 static int hf_mbim_ms_access_binary_local_pin_offset = -1;
828 static int hf_mbim_ms_access_binary_local_pin_size = -1;
829 static int hf_mbim_ms_access_binary_binary_data_offset = -1;
830 static int hf_mbim_ms_access_binary_binary_data_size = -1;
831 static int hf_mbim_ms_access_binary_app_id = -1;
832 static int hf_mbim_ms_access_binary_file_path = -1;
833 static int hf_mbim_ms_access_binary_local_pin = -1;
834 static int hf_mbim_ms_access_binary_binary_data = -1;
835 static int hf_mbim_ms_access_record_version = -1;
836 static int hf_mbim_ms_access_record_app_id_offset = -1;
837 static int hf_mbim_ms_access_record_app_id_size = -1;
838 static int hf_mbim_ms_access_record_file_path_offset = -1;
839 static int hf_mbim_ms_access_record_file_path_size = -1;
840 static int hf_mbim_ms_access_record_record_number = -1;
841 static int hf_mbim_ms_access_record_local_pin_offset = -1;
842 static int hf_mbim_ms_access_record_local_pin_size = -1;
843 static int hf_mbim_ms_access_record_record_data_offset = -1;
844 static int hf_mbim_ms_access_record_record_data_size = -1;
845 static int hf_mbim_ms_access_record_app_id = -1;
846 static int hf_mbim_ms_access_record_file_path = -1;
847 static int hf_mbim_ms_access_record_local_pin = -1;
848 static int hf_mbim_ms_access_record_record_data = -1;
849 static int hf_mbim_fragmented_payload = -1;
850 static int hf_mbim_request_in = -1;
851 static int hf_mbim_response_in = -1;
852 static int hf_mbim_descriptor = -1;
853 static int hf_mbim_descriptor_version = -1;
854 static int hf_mbim_descriptor_max_control_message = -1;
855 static int hf_mbim_descriptor_number_filters = -1;
856 static int hf_mbim_descriptor_max_filter_size = -1;
857 static int hf_mbim_descriptor_max_segment_size = -1;
858 static int hf_mbim_descriptor_network_capabilities = -1;
859 static int hf_mbim_descriptor_network_capabilities_max_datagram_size = -1;
860 static int hf_mbim_descriptor_network_capabilities_ntb_input_size = -1;
861 static int hf_mbim_descriptor_extended_version = -1;
862 static int hf_mbim_descriptor_max_outstanding_command_messages = -1;
863 static int hf_mbim_descriptor_mtu = -1;
864 static int hf_mbim_bulk = -1;
865 static int hf_mbim_bulk_nth_signature = -1;
866 static int hf_mbim_bulk_nth_header_length = -1;
867 static int hf_mbim_bulk_nth_sequence_number = -1;
868 static int hf_mbim_bulk_nth_block_length = -1;
869 static int hf_mbim_bulk_nth_block_length_32 = -1;
870 static int hf_mbim_bulk_nth_ndp_index = -1;
871 static int hf_mbim_bulk_nth_ndp_index_32 = -1;
872 static int hf_mbim_bulk_ndp_signature = -1;
873 static int hf_mbim_bulk_ndp_signature_ips_session_id = -1;
874 static int hf_mbim_bulk_ndp_signature_ipc_session_id = -1;
875 static int hf_mbim_bulk_ndp_signature_dss_session_id = -1;
876 static int hf_mbim_bulk_ndp_signature_dsc_session_id = -1;
877 static int hf_mbim_bulk_ndp_length = -1;
878 static int hf_mbim_bulk_ndp_next_ndp_index = -1;
879 static int hf_mbim_bulk_ndp_next_ndp_index_32 = -1;
880 static int hf_mbim_bulk_ndp_reserved = -1;
881 static int hf_mbim_bulk_ndp_reserved2 = -1;
882 static int hf_mbim_bulk_ndp_datagram_index = -1;
883 static int hf_mbim_bulk_ndp_datagram_index_32 = -1;
884 static int hf_mbim_bulk_ndp_datagram_length = -1;
885 static int hf_mbim_bulk_ndp_datagram_length_32 = -1;
886 static int hf_mbim_bulk_ndp_datagram = -1;
887 static int hf_mbim_bulk_ndp_nb_datagrams = -1;
888 static int hf_mbim_bulk_total_nb_datagrams = -1;
889 static int hf_mbim_bulk_ndp_ctrl = -1;
890 static int hf_mbim_bulk_ndp_ctrl_message_type = -1;
891 static int hf_mbim_bulk_ndp_ctrl_message_length = -1;
892 static int hf_mbim_bulk_ndp_ctrl_multiflow_status = -1;
893 static int hf_mbim_bulk_ndp_ctrl_multiflow_watermark = -1;
894 static int hf_mbim_bulk_ndp_ctrl_message_payload = -1;
895 static int hf_mbim_fragments = -1;
896 static int hf_mbim_fragment = -1;
897 static int hf_mbim_fragment_overlap = -1;
898 static int hf_mbim_fragment_overlap_conflict = -1;
899 static int hf_mbim_fragment_multiple_tails = -1;
900 static int hf_mbim_fragment_too_long_fragment = -1;
901 static int hf_mbim_fragment_error = -1;
902 static int hf_mbim_fragment_count = -1;
903 static int hf_mbim_reassembled_in = -1;
904 static int hf_mbim_reassembled_length = -1;
905 static int hf_mbim_reassembled_data = -1;
906
907 static expert_field ei_mbim_max_ctrl_transfer = EI_INIT;
908 static expert_field ei_mbim_unexpected_msg = EI_INIT;
909 static expert_field ei_mbim_unexpected_info_buffer = EI_INIT;
910 static expert_field ei_mbim_illegal_on_link_prefix_length = EI_INIT;
911 static expert_field ei_mbim_unknown_sms_format = EI_INIT;
912 static expert_field ei_mbim_unexpected_uuid_value = EI_INIT;
913 static expert_field ei_mbim_too_many_items = EI_INIT;
914 static expert_field ei_mbim_alignment_error = EI_INIT;
915 static expert_field ei_mbim_invalid_block_len = EI_INIT;
916 static expert_field ei_mbim_out_of_bounds_index = EI_INIT;
917 static expert_field ei_mbim_oversized_string = EI_INIT;
918 static expert_field ei_mbim_oversized_pdu = EI_INIT;
919
920 /* Initialize the subtree pointers */
921 static gint ett_mbim = -1;
922 static gint ett_mbim_msg_header = -1;
923 static gint ett_mbim_frag_header = -1;
924 static gint ett_mbim_info_buffer = -1;
925 static gint ett_mbim_bitmap = -1;
926 static gint ett_mbim_pair_list = -1;
927 static gint ett_mbim_pin = -1;
928 static gint ett_mbim_buffer = -1;
929 static gint ett_mbim_sc_address = -1;
930 static gint ett_mbim_pac = -1;
931 static gint ett_mbim_thermal_threshold_setting = -1;
932 static gint ett_mbim_fragment = -1;
933 static gint ett_mbim_fragments = -1;
934 static gint ett_mbim_bulk_ndp_ctrl = -1;
935
936 static dissector_table_t dss_dissector_table;
937 static dissector_handle_t bertlv_handle;
938 static dissector_handle_t etsi_cat_handle;
939 static dissector_handle_t gsm_sms_handle;
940 static dissector_handle_t cdma_sms_handle;
941 static dissector_handle_t eth_handle;
942 static dissector_handle_t eth_fcs_handle;
943 static dissector_handle_t ip_handle;
944 static dissector_handle_t data_handle;
945 static dissector_handle_t bulk_ndp_ctrl_handle;
946 static dissector_handle_t mbim_control_handle;
947 static dissector_handle_t iso7816_atr_handle;
948
949 static gboolean mbim_control_decode_unknown_itf = FALSE;
950
951 enum {
952 SMS_PDU_AUTOMATIC,
953 SMS_PDU_3GPP,
954 SMS_PDU_3GPP2
955 };
956
957 static const enum_val_t mbim_sms_pdu_format_vals[] = {
958 {"automatic", "Automatic", SMS_PDU_AUTOMATIC},
959 {"3GPP", "3GPP", SMS_PDU_3GPP},
960 {"3GPP2","3GPP2", SMS_PDU_3GPP2},
961 {NULL, NULL, -1}
962 };
963 static gint mbim_sms_pdu_format = SMS_PDU_AUTOMATIC;
964
965 enum mbim_extended_version_vals {
966 MBIM_Extended_Version_Unknown,
967 MBIM_Extended_Version_1,
968 MBIM_Extended_Version_2,
969 MBIM_Extended_Version_3
970 };
971
972 static const enum_val_t preferred_mbim_extended_version_vals[] = {
973 {"1.0", "1.0", MBIM_Extended_Version_1},
974 {"2.0", "2.0", MBIM_Extended_Version_2},
975 {"3.0", "3.0", MBIM_Extended_Version_3},
976 {NULL, NULL, -1}
977 };
978 static gint preferred_mbim_extended_version = MBIM_Extended_Version_1;
979
980 #define SHOULD_MBIM_EX2_BE_APPLIED(mbim_conv) \
981 (mbim_conv->mbim_extended_version == MBIM_Extended_Version_2 || \
982 (mbim_conv->mbim_extended_version == MBIM_Extended_Version_Unknown && preferred_mbim_extended_version == MBIM_Extended_Version_2)) ? 1 : 0
983
984 #define SHOULD_MBIM_EX3_BE_APPLIED(mbim_conv) \
985 (mbim_conv->mbim_extended_version == MBIM_Extended_Version_3 || \
986 (mbim_conv->mbim_extended_version == MBIM_Extended_Version_Unknown && preferred_mbim_extended_version == MBIM_Extended_Version_3)) ? 1 : 0
987
988 #define SHOULD_MBIM_EX2_AND_HIGHER_BE_APPLIED(mbim_conv) \
989 (mbim_conv->mbim_extended_version >= MBIM_Extended_Version_2 || \
990 (mbim_conv->mbim_extended_version == MBIM_Extended_Version_Unknown && preferred_mbim_extended_version >= MBIM_Extended_Version_2)) ? 1 : 0
991
992 static reassembly_table mbim_reassembly_table;
993
994 static wmem_map_t *mbim_uuid_ext_hash = NULL;
995
996 static const fragment_items mbim_frag_items = {
997 &ett_mbim_fragment,
998 &ett_mbim_fragments,
999 &hf_mbim_fragments,
1000 &hf_mbim_fragment,
1001 &hf_mbim_fragment_overlap,
1002 &hf_mbim_fragment_overlap_conflict,
1003 &hf_mbim_fragment_multiple_tails,
1004 &hf_mbim_fragment_too_long_fragment,
1005 &hf_mbim_fragment_error,
1006 &hf_mbim_fragment_count,
1007 &hf_mbim_reassembled_in,
1008 &hf_mbim_reassembled_length,
1009 &hf_mbim_reassembled_data,
1010 "MBIM fragments"
1011 };
1012
1013 struct mbim_conv_info {
1014 wmem_map_t *trans;
1015 wmem_tree_t *open;
1016 guint32 open_count;
1017 guint32 cellular_class;
1018 enum mbim_extended_version_vals mbim_extended_version;
1019 };
1020
1021 struct mbim_pair_list {
1022 guint32 offset;
1023 guint32 size;
1024 };
1025
1026 #define MBIM_MAX_ITEMS 1000
1027
1028 #define MBIM_OPEN_MSG 0x00000001
1029 #define MBIM_CLOSE_MSG 0x00000002
1030 #define MBIM_COMMAND_MSG 0x00000003
1031 #define MBIM_HOST_ERROR_MSG 0x00000004
1032 #define MBIM_OPEN_DONE 0x80000001
1033 #define MBIM_CLOSE_DONE 0x80000002
1034 #define MBIM_COMMAND_DONE 0x80000003
1035 #define MBIM_FUNCTION_ERROR_MSG 0x80000004
1036 #define MBIM_INDICATE_STATUS_MSG 0x80000007
1037
1038 static const value_string mbim_msg_type_vals[] = {
1039 { MBIM_OPEN_MSG, "OPEN_MSG"},
1040 { MBIM_CLOSE_MSG, "CLOSE_MSG"},
1041 { MBIM_COMMAND_MSG, "COMMAND_MSG"},
1042 { MBIM_HOST_ERROR_MSG, "HOST_ERROR_MSG"},
1043 { MBIM_OPEN_DONE, "OPEN_DONE"},
1044 { MBIM_CLOSE_DONE, "CLOSE_DONE"},
1045 { MBIM_COMMAND_DONE, "COMMAND_DONE"},
1046 { MBIM_FUNCTION_ERROR_MSG, "FUNCTION_ERROR_MSG"},
1047 { MBIM_INDICATE_STATUS_MSG, "INDICATE_STATUS_MSG"},
1048 { 0, NULL}
1049 };
1050
1051 static const value_string mbim_command_type_vals[] = {
1052 { MBIM_COMMAND_QUERY, "Query"},
1053 { MBIM_COMMAND_SET, "Set"},
1054 { 0, NULL}
1055 };
1056
1057 static const value_string mbim_error_status_code_vals[] = {
1058 { 1, "TIMEOUT_FRAGMENT"},
1059 { 2, "FRAGMENT_OUT_OF_SEQUENCE"},
1060 { 3, "LENGTH_MISMATCH"},
1061 { 4, "DUPLICATED_TID"},
1062 { 5, "NOT_OPENED"},
1063 { 6, "UNKNOWN"},
1064 { 7, "CANCEL"},
1065 { 8, "MAX_TRANSFER"},
1066 { 0, NULL}
1067 };
1068
1069 static const value_string mbim_status_code_vals[] = {
1070 { 0, "SUCCESS"},
1071 { 1, "BUSY"},
1072 { 2, "FAILURE"},
1073 { 3, "SIM_NOT_INSERTED"},
1074 { 4, "BAD_SIM"},
1075 { 5, "PIN_REQUIRED"},
1076 { 6, "PIN_DISABLED"},
1077 { 7, "NOT_REGISTERED"},
1078 { 8, "PROVIDERS_NOT_FOUND"},
1079 { 9, "NO_DEVICE_SUPPORT"},
1080 { 10, "PROVIDER_NOT_VISIBLE"},
1081 { 11, "DATA_CLASS_NOT_AVAILABLE"},
1082 { 12, "PACKET_SERVICE_DETACHED"},
1083 { 13, "MAX_ACTIVATED_CONTEXTS"},
1084 { 14, "NOT_INITIALIZED"},
1085 { 15, "VOICE_CALL_IN_PROGRESS"},
1086 { 16, "CONTEXT_NOT_ACTIVATED"},
1087 { 17, "SERVICE_NOT_ACTIVATED"},
1088 { 18, "INVALID_ACCESS_STRING"},
1089 { 19, "INVALID_USER_NAME_PWD"},
1090 { 20, "RADIO_POWER_OFF"},
1091 { 21, "INVALID_PARAMETERS"},
1092 { 22, "READ_FAILURE"},
1093 { 23, "WRITE_FAILURE"},
1094 { 24, "Reserved"},
1095 { 25, "NO_PHONEBOOK"},
1096 { 26, "PARAMETER_TOO_LONG"},
1097 { 27, "STK_BUSY"},
1098 { 28, "OPERATION_NOT_ALLOWED"},
1099 { 29, "MEMORY_FAILURE"},
1100 { 30, "INVALID_MEMORY_INDEX"},
1101 { 31, "MEMORY_FULL"},
1102 { 32, "FILTER_NOT_SUPPORTED"},
1103 { 33, "DSS_INSTANCE_LIMIT"},
1104 { 34, "INVALID_DEVICE_SERVICE_OPERATION"},
1105 { 35, "AUTH_INCORRECT_AUTN"},
1106 { 36, "AUTH_SYNC_FAILURE"},
1107 { 37, "AUTH_AMF_NOT_SET"},
1108 { 38, "CONTEXT_NOT_SUPPORTED"},
1109 { 100, "SMS_UNKNOWN_SMSC_ADDRESS"},
1110 { 101, "SMS_NETWORK_TIMEOUT"},
1111 { 102, "SMS_LANG_NOT_SUPPORTED"},
1112 { 103, "SMS_ENCODING_NOT_SUPPORTED"},
1113 { 104, "SMS_FORMAT_NOT_SUPPORTED"},
1114 { 0, NULL}
1115 };
1116 static value_string_ext mbim_status_code_vals_ext = VALUE_STRING_EXT_INIT(mbim_status_code_vals);
1117
1118 struct mbim_uuid {
1119 guint8 service_idx;
1120 e_guid_t uuid;
1121 };
1122
1123 #define UUID_BASIC_CONNECT 0
1124 #define UUID_SMS 1
1125 #define UUID_USSD 2
1126 #define UUID_PHONEBOOK 3
1127 #define UUID_STK 4
1128 #define UUID_AUTH 5
1129 #define UUID_DSS 6
1130 #define UUID_MULTICARRIER 7
1131 #define UUID_MS_HOSTSHUTDOWN 8
1132 #define UUID_MSFWID 9
1133 #define UUID_QMI 10 /* Qualcomm proprietary UUID */
1134 #define UUID_INTEL_FWUSVC 11 /* Intel firmware update service proprietary UUID */
1135 #define UUID_INTEL_DPTF 12 /* Intel proprietary UUID */
1136 #define UUID_INTEL_SAR 13 /* Intel proprietary UUID */
1137 #define UUID_INTEL_ACT 14 /* Intel adaptive clocking proprietary UUID */
1138 #define UUID_INTEL_TRCSVC 15 /* Intel trace service proprietary UUID */
1139 #define UUID_INTEL_NRTC 16 /* Intel proprietary UUID */
1140 #define UUID_INTEL_USB_PROFILE 17 /* Intel USB profile proprietary UUID */
1141 #define UUID_INTEL_CIQ 18 /* Intel proprietary UUID */
1142 #define UUID_ATDS 19 /* AT&T extensions proprietary UUID */
1143 #define UUID_MULTIFLOW 20
1144 #define UUID_BASIC_CONNECT_EXTENSIONS 21 /* Microsoft */
1145 #define UUID_MS_SARCONTROL 22 /* Microsoft */
1146 #define UUID_MS_UICC_LOW_LEVEL 23
1147 #define UUID_MAX 24
1148 #define UUID_EXT_IDX 255
1149
1150 static const struct mbim_uuid mbim_uuid_service_id_vals[UUID_MAX] = {
1151 { UUID_BASIC_CONNECT, {0xa289cc33, 0xbcbb, 0x8b4f, { 0xb6, 0xb0, 0x13, 0x3e, 0xc2, 0xaa, 0xe6, 0xdf}}},
1152 { UUID_SMS, {0x533fbeeb, 0x14fe, 0x4467, {0x9f, 0x90, 0x33, 0xa2, 0x23, 0xe5, 0x6c, 0x3f}}},
1153 { UUID_USSD, {0xe550a0c8, 0x5e82, 0x479e, {0x82, 0xf7, 0x10, 0xab, 0xf4, 0xc3, 0x35, 0x1f}}},
1154 { UUID_PHONEBOOK, {0x4bf38476, 0x1e6a, 0x41db, {0xb1, 0xd8, 0xbe, 0xd2, 0x89, 0xc2, 0x5b, 0xdb}}},
1155 { UUID_STK, {0xd8f20131, 0xfcb5, 0x4e17, {0x86, 0x02, 0xd6, 0xed, 0x38, 0x16, 0x16, 0x4c}}},
1156 { UUID_AUTH, {0x1d2b5ff7, 0x0aa1, 0x48b2, {0xaa, 0x52, 0x50, 0xf1, 0x57, 0x67, 0x17, 0x4e}}},
1157 { UUID_DSS, {0xc08a26dd, 0x7718, 0x4382, {0x84, 0x82, 0x6e, 0x0d, 0x58, 0x3c, 0x4d, 0x0e}}},
1158 { UUID_MULTICARRIER, {0x8b569648, 0x628d, 0x4653, {0x9b, 0x9f, 0x10, 0x25, 0x40, 0x44, 0x24, 0xe1}}},
1159 { UUID_MS_HOSTSHUTDOWN, {0x883b7c26, 0x985f, 0x43fa, {0x98, 0x04, 0x27, 0xd7, 0xfb, 0x80, 0x95, 0x9c}}},
1160 { UUID_MSFWID, {0xe9f7dea2, 0xfeaf, 0x4009, {0x93, 0xce, 0x90, 0xa3, 0x69, 0x41, 0x03, 0xb6}}},
1161 { UUID_QMI, {0xd1a30bc2, 0xf97a, 0x6e43, {0xbf, 0x65, 0xc7, 0xe2, 0x4f, 0xb0, 0xf0, 0xd3}}},
1162 { UUID_INTEL_FWUSVC, {0x0ed374cb, 0xf835, 0x4474, {0xbc, 0x11, 0x3b, 0x3f, 0xd7, 0x6f, 0x56, 0x41}}},
1163 { UUID_INTEL_DPTF, {0xfdc22af2, 0xf441, 0x4d46, {0xaf, 0x8d, 0x25, 0x9f, 0xcd, 0xde, 0x46, 0x35}}},
1164 { UUID_INTEL_SAR, {0x10e40d69, 0x375a, 0x42ce, {0xa2, 0x97, 0x90, 0x61, 0x64, 0xf2, 0x75, 0x4c}}},
1165 { UUID_INTEL_ACT, {0xed19555d, 0xa6ac, 0x4327, {0x8e, 0xb1, 0xfc, 0x02, 0x2e, 0x5e, 0x23, 0x88}}},
1166 { UUID_INTEL_TRCSVC, {0x59a7f323, 0xfe5a, 0x4301, {0xb1, 0x85, 0xb8, 0xea, 0x9e, 0x61, 0x67, 0xb7}}},
1167 { UUID_INTEL_NRTC, {0x2b6d8c5a, 0x0ca9, 0x418f, {0x8a, 0xac, 0x1a, 0x9d, 0xc8, 0xe3, 0x28, 0x66}}},
1168 { UUID_INTEL_USB_PROFILE, {0xfa142322, 0x166b, 0x4fd9, {0x89, 0xf0, 0x99, 0xbe, 0x90, 0xae, 0x8e, 0x3d}}},
1169 { UUID_INTEL_CIQ, {0x6A2A8150, 0xABCA, 0x4b11, {0xA4, 0xE2, 0xF2, 0xFC, 0x87, 0x9F, 0x54, 0x81}}},
1170 { UUID_ATDS, {0x5967bdcc, 0x7fd2, 0x49a2, {0x9f, 0x5c, 0xb2, 0xe7, 0x0e, 0x52, 0x7d, 0xb3}}},
1171 { UUID_MULTIFLOW, {0x8d8f32d9, 0xf7c2, 0x4419, {0xb2, 0x8b, 0xde, 0xdc, 0xde, 0x20, 0x5e, 0xd8}}},
1172 { UUID_BASIC_CONNECT_EXTENSIONS, {0x3d01dcc5, 0xfef5, 0x4d05, {0x0d, 0x3a, 0xbe, 0xf7, 0x05, 0x8e, 0x9a, 0xaf}}},
1173 { UUID_MS_SARCONTROL, {0x68223d04, 0x9f6c, 0x4e0f, {0x82, 0x2d, 0x28, 0x44, 0x1f, 0xb7, 0x23, 0x40}}},
1174 { UUID_MS_UICC_LOW_LEVEL, {0xc2f6588e, 0xf037, 0x4bc9, {0x86, 0x65, 0xf4, 0xd4, 0x4b, 0xd0, 0x93, 0x67}}}
1175 };
1176
1177 static const value_string mbim_service_id_vals[] = {
1178 { UUID_BASIC_CONNECT, "UUID_BASIC_CONNECT"},
1179 { UUID_SMS, "UUID_SMS"},
1180 { UUID_USSD, "UUID_USSD"},
1181 { UUID_PHONEBOOK, "UUID_PHONEBOOK"},
1182 { UUID_STK, "UUID_STK"},
1183 { UUID_AUTH, "UUID_AUTH"},
1184 { UUID_DSS, "UUID_DSS"},
1185 { UUID_MULTICARRIER, "UUID_MULTICARRIER"},
1186 { UUID_MS_HOSTSHUTDOWN, "UUID_MS_HOSTSHUTDOWN"},
1187 { UUID_MSFWID, "UUID_MSFWID"},
1188 { UUID_QMI, "UUID_QMI"},
1189 { UUID_INTEL_FWUSVC, "UUID_INTEL_FWUSVC"},
1190 { UUID_INTEL_DPTF, "UUID_INTEL_DPTF"},
1191 { UUID_INTEL_SAR, "UUID_INTEL_SAR"},
1192 { UUID_INTEL_ACT, "UUID_INTEL_ACT"},
1193 { UUID_INTEL_TRCSVC, "UUID_INTEL_TRCSVC"},
1194 { UUID_INTEL_NRTC, "UUID_INTEL_NRTC"},
1195 { UUID_INTEL_USB_PROFILE, "UUID_INTEL_USB_PROFILE"},
1196 { UUID_INTEL_CIQ, "UUID_INTEL_CIQ"},
1197 { UUID_ATDS, "UUID_ATDS"},
1198 { UUID_MULTIFLOW, "UUID_MULTIFLOW"},
1199 { UUID_BASIC_CONNECT_EXTENSIONS, "UUID_BASIC_CONNECT_EXTENSIONS"},
1200 { UUID_MS_SARCONTROL, "UUID_MS_SARCONTROL"},
1201 { UUID_MS_UICC_LOW_LEVEL, "UUID_MS_UICC_LOW_LEVEL"},
1202 { 0, NULL}
1203 };
1204 static value_string_ext mbim_service_id_vals_ext = VALUE_STRING_EXT_INIT(mbim_service_id_vals);
1205
1206 #define MBIM_CID_DEVICE_CAPS 1
1207 #define MBIM_CID_SUBSCRIBER_READY_STATUS 2
1208 #define MBIM_CID_RADIO_STATE 3
1209 #define MBIM_CID_PIN 4
1210 #define MBIM_CID_PIN_LIST 5
1211 #define MBIM_CID_HOME_PROVIDER 6
1212 #define MBIM_CID_PREFERRED_PROVIDERS 7
1213 #define MBIM_CID_VISIBLE_PROVIDERS 8
1214 #define MBIM_CID_REGISTER_STATE 9
1215 #define MBIM_CID_PACKET_SERVICE 10
1216 #define MBIM_CID_SIGNAL_STATE 11
1217 #define MBIM_CID_CONNECT 12
1218 #define MBIM_CID_PROVISIONED_CONTEXTS 13
1219 #define MBIM_CID_SERVICE_ACTIVATION 14
1220 #define MBIM_CID_IP_CONFIGURATION 15
1221 #define MBIM_CID_DEVICE_SERVICES 16
1222 #define MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST 19
1223 #define MBIM_CID_PACKET_STATISTICS 20
1224 #define MBIM_CID_NETWORK_IDLE_HINT 21
1225 #define MBIM_CID_EMERGENCY_MODE 22
1226 #define MBIM_CID_IP_PACKET_FILTERS 23
1227 #define MBIM_CID_MULTICARRIER_PROVIDERS 24
1228
1229 static const value_string mbim_uuid_basic_connect_cid_vals[] = {
1230 { MBIM_CID_DEVICE_CAPS, "DEVICE_CAPS"},
1231 { MBIM_CID_SUBSCRIBER_READY_STATUS, "SUBSCRIBER_READY_STATUS"},
1232 { MBIM_CID_RADIO_STATE, "RADIO_STATE"},
1233 { MBIM_CID_PIN, "PIN"},
1234 { MBIM_CID_PIN_LIST, "PIN_LIST"},
1235 { MBIM_CID_HOME_PROVIDER, "HOME_PROVIDER"},
1236 { MBIM_CID_PREFERRED_PROVIDERS, "PREFERRED_PROVIDERS"},
1237 { MBIM_CID_VISIBLE_PROVIDERS, "VISIBLE_PROVIDERS"},
1238 { MBIM_CID_REGISTER_STATE, "REGISTER_STATE"},
1239 { MBIM_CID_PACKET_SERVICE, "PACKET_SERVICE"},
1240 { MBIM_CID_SIGNAL_STATE, "SIGNAL_STATE"},
1241 { MBIM_CID_CONNECT, "CONNECT"},
1242 { MBIM_CID_PROVISIONED_CONTEXTS, "PROVISIONED_CONTEXTS"},
1243 { MBIM_CID_SERVICE_ACTIVATION, "SERVICE_ACTIVATION"},
1244 { MBIM_CID_IP_CONFIGURATION, "IP_CONFIGURATION"},
1245 { MBIM_CID_DEVICE_SERVICES, "DEVICE_SERVICES"},
1246 { MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST, "DEVICE_SERVICE_SUBSCRIBE_LIST"},
1247 { MBIM_CID_PACKET_STATISTICS, "PACKET_STATISTICS"},
1248 { MBIM_CID_NETWORK_IDLE_HINT, "NETWORK_IDLE_HINT"},
1249 { MBIM_CID_EMERGENCY_MODE, "EMERGENCY_MODE"},
1250 { MBIM_CID_IP_PACKET_FILTERS, "IP_PACKET_FILTERS"},
1251 { MBIM_CID_MULTICARRIER_PROVIDERS, "MULTICARRIER_PROVIDERS"},
1252 { 0, NULL}
1253 };
1254 static value_string_ext mbim_uuid_basic_connect_cid_vals_ext = VALUE_STRING_EXT_INIT(mbim_uuid_basic_connect_cid_vals);
1255
1256 #define MBIM_CID_SMS_CONFIGURATION 1
1257 #define MBIM_CID_SMS_READ 2
1258 #define MBIM_CID_SMS_SEND 3
1259 #define MBIM_CID_SMS_DELETE 4
1260 #define MBIM_CID_SMS_MESSAGE_STORE_STATUS 5
1261
1262 static const value_string mbim_uuid_sms_cid_vals[] = {
1263 { MBIM_CID_SMS_CONFIGURATION, "SMS_CONFIGURATION"},
1264 { MBIM_CID_SMS_READ, "SMS_READ"},
1265 { MBIM_CID_SMS_SEND, "SMS_SEND"},
1266 { MBIM_CID_SMS_DELETE, "SMS_DELETE"},
1267 { MBIM_CID_SMS_MESSAGE_STORE_STATUS, "SMS_MESSAGE_STORE_STATUS"},
1268 { 0, NULL}
1269 };
1270
1271 #define MBIM_CID_USSD 1
1272
1273 static const value_string mbim_uuid_ussd_cid_vals[] = {
1274 { MBIM_CID_USSD, "USSD"},
1275 { 0, NULL}
1276 };
1277
1278 #define MBIM_CID_PHONEBOOK_CONFIGURATION 1
1279 #define MBIM_CID_PHONEBOOK_READ 2
1280 #define MBIM_CID_PHONEBOOK_DELETE 3
1281 #define MBIM_CID_PHONEBOOK_WRITE 4
1282
1283 static const value_string mbim_uuid_phonebook_cid_vals[] = {
1284 { MBIM_CID_PHONEBOOK_CONFIGURATION, "PHONEBOOK_CONFIGURATION"},
1285 { MBIM_CID_PHONEBOOK_READ, "PHONEBOOK_READ"},
1286 { MBIM_CID_PHONEBOOK_DELETE, "PHONEBOOK_DELETE"},
1287 { MBIM_CID_PHONEBOOK_WRITE, "PHONEBOOK_WRITE"},
1288 { 0, NULL}
1289 };
1290
1291 #define MBIM_CID_STK_PAC 1
1292 #define MBIM_CID_STK_TERMINAL_RESPONSE 2
1293 #define MBIM_CID_STK_ENVELOPE 3
1294
1295 static const value_string mbim_uuid_stk_cid_vals[] = {
1296 { MBIM_CID_STK_PAC, "STK_PAC"},
1297 { MBIM_CID_STK_TERMINAL_RESPONSE, "STK_TERMINAL_RESPONSE"},
1298 { MBIM_CID_STK_ENVELOPE, "STK_ENVELOPE"},
1299 { 0, NULL}
1300 };
1301
1302 #define MBIM_CID_AKA_AUTH 1
1303 #define MBIM_CID_AKAP_AUTH 2
1304 #define MBIM_CID_SIM_AUTH 3
1305
1306 static const value_string mbim_uuid_auth_cid_vals[] = {
1307 { MBIM_CID_AKA_AUTH, "AKA_AUTH"},
1308 { MBIM_CID_AKAP_AUTH, "AKAP_AUTH"},
1309 { MBIM_CID_SIM_AUTH, "SIM_AUTH"},
1310 { 0, NULL}
1311 };
1312
1313 #define MBIM_CID_DSS_CONNECT 1
1314
1315 static const value_string mbim_uuid_dss_cid_vals[] = {
1316 { MBIM_CID_DSS_CONNECT, "DSS_CONNECT"},
1317 { 0, NULL}
1318 };
1319
1320 #define MBIM_CID_MULTICARRIER_CAPABILITIES 1
1321 #define MBIM_CID_LOCATION_INFO 2
1322 #define MBIM_CID_MULTICARRIER_CURRENT_CID_LIST 3
1323
1324 static const value_string mbim_uuid_multicarrier_cid_vals[] = {
1325 { MBIM_CID_MULTICARRIER_CAPABILITIES, "MULTICARRIER_CAPABILITIES"},
1326 { MBIM_CID_LOCATION_INFO, "LOCATION_INFO"},
1327 { MBIM_CID_MULTICARRIER_CURRENT_CID_LIST, "MULTICARRIER_CURRENT_CID_LIST"},
1328 { 0, NULL}
1329 };
1330
1331 #define MBIM_CID_MS_HOSTSHUTDOWN 1
1332 #define MBIM_CID_MS_HOSTPRESHUTDOWN 2
1333
1334 static const value_string mbim_uuid_ms_hostshutdown_cid_vals[] = {
1335 { MBIM_CID_MS_HOSTSHUTDOWN, "MS_HOSTSHUTDOWN"},
1336 { MBIM_CID_MS_HOSTPRESHUTDOWN, "MS_HOSTPRESHUTDOWN"},
1337 { 0, NULL}
1338 };
1339
1340 #define MBIM_CID_MSFWID_FIRMWAREID 1
1341
1342 static const value_string mbim_uuid_msfwid_cid_vals[] = {
1343 { MBIM_CID_MSFWID_FIRMWAREID, "MSFWID_FIRMWAREID"},
1344 { 0, NULL}
1345 };
1346
1347 #define MBIM_CID_QMI_QMI 1
1348
1349 static const value_string mbim_uuid_qmi_cid_vals[] = {
1350 { MBIM_CID_QMI_QMI, "QMI"},
1351 { 0, NULL}
1352 };
1353
1354 #define MBIM_CID_INTC_MODEM_REBOOT 1
1355
1356 static const value_string mbim_uuid_intel_fwusvc_cid_vals[] = {
1357 { MBIM_CID_INTC_MODEM_REBOOT, "INTC_MODEM_REBOOT"},
1358 { 0, NULL}
1359 };
1360
1361 #define MBIM_CID_INTC_THERMAL_STATE 0x02000100
1362
1363 static const value_string mbim_uuid_intel_dptf_cid_vals[] = {
1364 { MBIM_CID_INTC_THERMAL_STATE, "INTC_THERMAL_STATE"},
1365 { 0, NULL}
1366 };
1367
1368 #define MBIM_CID_INTC_SAR_CONFIG 1
1369
1370 static const value_string mbim_uuid_intel_sar_cid_vals[] = {
1371 { MBIM_CID_INTC_SAR_CONFIG, "INTC_SAR_CONFIG"},
1372 { 0, NULL}
1373 };
1374
1375 #define MBIM_CID_INTC_ADPCLK_MODE 0x02000010
1376
1377 static const value_string mbim_uuid_intel_act_cid_vals[] = {
1378 { MBIM_CID_INTC_ADPCLK_MODE, "INTC_ADPCLK_MODE"},
1379 { 0, NULL}
1380 };
1381
1382 #define MBIM_CID_INTC_TRACE 1
1383 #define MBIM_CID_INTC_TRACE_DATA 2
1384
1385 static const value_string mbim_uuid_intel_trcsvc_cid_vals[] = {
1386 { MBIM_CID_INTC_TRACE, "INTC_TRACE"},
1387 { MBIM_CID_INTC_TRACE_DATA, "INTC_TRACE_DATA"},
1388 { 0, NULL}
1389 };
1390
1391 #define MBIM_CID_INTC_NRTAPP 1
1392 #define MBIM_CID_INTC_NRTCWS 2
1393
1394 static const value_string mbim_uuid_intel_nrtc_cid_vals[] = {
1395 { MBIM_CID_INTC_NRTAPP, "INTC_NRTAPP"},
1396 { MBIM_CID_INTC_NRTCWS, "INTC_NRTCWS"},
1397 { 0, NULL}
1398 };
1399
1400 #define MBIM_CID_INTC_USBPROFILE 1
1401
1402 static const value_string mbim_uuid_intel_usb_profile_cid_vals[] = {
1403 { MBIM_CID_INTC_USBPROFILE, "INTC_USBPROFILE"},
1404 { 0, NULL}
1405 };
1406
1407 #define MBIM_CID_INTC_CIQ 1
1408
1409 static const value_string mbim_uuid_intel_ciq_cid_vals[] = {
1410 { MBIM_CID_INTC_CIQ, "INTC_CIQ"},
1411 { 0, NULL}
1412 };
1413
1414 #define MBIM_CID_ATDS_SIGNAL 1
1415 #define MBIM_CID_ATDS_LOCATION 2
1416 #define MBIM_CID_ATDS_OPERATORS 3
1417 #define MBIM_CID_ATDS_RAT 4
1418 #define MBIM_CID_ATDS_REGISTER_STATE 9
1419 #define MBIM_CID_ATDS_SET_PROJECTION_TABLES 10
1420
1421 static const value_string mbim_uuid_atds_cid_vals[] = {
1422 { MBIM_CID_ATDS_SIGNAL, "ATDS_SIGNAL"},
1423 { MBIM_CID_ATDS_LOCATION, "ATDS_LOCATION"},
1424 { MBIM_CID_ATDS_OPERATORS, "ATDS_OPERATORS"},
1425 { MBIM_CID_ATDS_RAT, "ATDS_RAT"},
1426 { MBIM_CID_ATDS_REGISTER_STATE, "ATDS_REGISTER_STATE"},
1427 { MBIM_CID_ATDS_SET_PROJECTION_TABLES, "ATDS_SET_PROJECTION_TABLES"},
1428 { 0, NULL}
1429 };
1430
1431 #define MBIM_CID_MULTIFLOW_CAPS 1
1432 #define MBIM_CID_MULTIFLOW_UPLINK 2
1433 #define MBIM_CID_MULTIFLOW_DOWNLINK 3
1434 #define MBIM_CID_MULTIFLOW_TFT 4
1435
1436 static const value_string mbim_uuid_multiflow_cid_vals[] = {
1437 { MBIM_CID_MULTIFLOW_CAPS, "MULTIFLOW_CAPS"},
1438 { MBIM_CID_MULTIFLOW_UPLINK, "MULTIFLOW_UPLINK"},
1439 { MBIM_CID_MULTIFLOW_DOWNLINK, "MULTIFLOW_DOWNLINK"},
1440 { MBIM_CID_MULTIFLOW_TFT, "MULTIFLOW_TFT"},
1441 { 0, NULL}
1442 };
1443
1444 #define MBIM_CID_MS_PROVISIONED_CONTEXT_V2 1
1445 #define MBIM_CID_MS_NETWORK_BLACKLIST 2
1446 #define MBIM_CID_MS_LTE_ATTACH_CONFIG 3
1447 #define MBIM_CID_MS_LTE_ATTACH_STATUS 4
1448 #define MBIM_CID_MS_SYS_CAPS 5
1449 #define MBIM_CID_MS_DEVICE_CAPS_V2 6
1450 #define MBIM_CID_MS_DEVICE_SLOT_MAPPINGS 7
1451 #define MBIM_CID_MS_SLOT_INFO_STATUS 8
1452 #define MBIM_CID_PCO 9
1453 #define MBIM_CID_MS_DEVICE_RESET 10
1454 #define MBIM_CID_BASE_STATIONS_INFO 11
1455 #define MBIM_CID_LOCATION_INFO_STATUS 12
1456 #define MBIM_CID_MS_MODEM_LOGGING_CONFIG 13
1457 #define MBIM_CID_MS_PIN_INFO_EX2 14
1458 #define MBIM_CID_VERSION 15
1459 #define MBIM_CID_MS_MODEM_CONFIG 16
1460 #define MBIM_CID_MS_REGISTRATION_PARAMS 17
1461 #define MBIM_CID_MS_NETWORK_PARAMS 18
1462 #define MBIM_CID_MS_WAKE_REASON 19
1463
1464 static const value_string mbim_uuid_basic_connect_extensions_cid_vals[] = {
1465 { MBIM_CID_MS_PROVISIONED_CONTEXT_V2, "MS_PROVISIONED_CONTEXT_V2"},
1466 { MBIM_CID_MS_NETWORK_BLACKLIST, "MS_NETWORK_BLACKLIST"},
1467 { MBIM_CID_MS_LTE_ATTACH_CONFIG, "MS_LTE_ATTACH_CONFIG"},
1468 { MBIM_CID_MS_LTE_ATTACH_STATUS, "MS_LTE_ATTACH_STATUS"},
1469 { MBIM_CID_MS_SYS_CAPS, "MS_SYS_CAPS"},
1470 { MBIM_CID_MS_DEVICE_CAPS_V2, "MS_DEVICE_CAPS_V2"},
1471 { MBIM_CID_MS_DEVICE_SLOT_MAPPINGS, "MS_DEVICE_SLOT_MAPPINGS"},
1472 { MBIM_CID_MS_SLOT_INFO_STATUS, "MS_SLOT_INFO_STATUS"},
1473 { MBIM_CID_PCO, "PCO"},
1474 { MBIM_CID_MS_DEVICE_RESET, "MS_DEVICE_RESET"},
1475 { MBIM_CID_BASE_STATIONS_INFO, "BASE_STATIONS_INFO"},
1476 { MBIM_CID_LOCATION_INFO_STATUS, "LOCATION_INFO_STATUS"},
1477 { MBIM_CID_MS_MODEM_LOGGING_CONFIG, "MS_MODEM_LOGGING_CONFIG"},
1478 { MBIM_CID_MS_PIN_INFO_EX2, "MS_PIN_INFO_EX2"},
1479 { MBIM_CID_VERSION, "VERSION"},
1480 { MBIM_CID_MS_MODEM_CONFIG, "MS_MODEM_CONFIG"},
1481 { MBIM_CID_MS_REGISTRATION_PARAMS, "MS_REGISTRATION_PARAMS"},
1482 { MBIM_CID_MS_NETWORK_PARAMS, "MS_NETWORK_PARAMS"},
1483 { MBIM_CID_MS_WAKE_REASON, "MS_WAKE_REASON"},
1484 { 0, NULL}
1485 };
1486
1487 #define MBIM_CID_MS_SAR_CONFIG 1
1488 #define MBIM_CID_MS_TRANSMISSION_STATUS 2
1489
1490 static const value_string mbim_uuid_ms_sarcontrol_cid_vals[] = {
1491 { MBIM_CID_MS_SAR_CONFIG, "MS_SAR_CONFIG"},
1492 { MBIM_CID_MS_TRANSMISSION_STATUS, "MS_TRANSMISSION_STATUS"},
1493 { 0, NULL}
1494 };
1495
1496 #define MBIM_CID_MS_UICC_ATR 1
1497 #define MBIM_CID_MS_UICC_OPEN_CHANNEL 2
1498 #define MBIM_CID_MS_UICC_CLOSE_CHANNEL 3
1499 #define MBIM_CID_MS_UICC_APDU 4
1500 #define MBIM_CID_MS_UICC_TERMINAL_CAPABILITY 5
1501 #define MBIM_CID_MS_UICC_RESET 6
1502 #define MBIM_CID_MS_UICC_APP_LIST 7
1503 #define MBIM_CID_MS_UICC_FILE_STATUS 8
1504 #define MBIM_CID_MS_UICC_ACCESS_BINARY 9
1505 #define MBIM_CID_MS_UICC_ACCESS_RECORD 10
1506
1507 static const value_string mbim_uuid_ms_uicc_low_level_cid_vals[] = {
1508 { MBIM_CID_MS_UICC_ATR, "MS_UICC_ATR" },
1509 { MBIM_CID_MS_UICC_OPEN_CHANNEL, "MS_UICC_OPEN_CHANNEL" },
1510 { MBIM_CID_MS_UICC_CLOSE_CHANNEL, "MS_UICC_CLOSE_CHANNEL" },
1511 { MBIM_CID_MS_UICC_APDU, "MS_UICC_APDU" },
1512 { MBIM_CID_MS_UICC_TERMINAL_CAPABILITY, "MS_UICC_TERMINAL_CAPABILITY" },
1513 { MBIM_CID_MS_UICC_RESET, "MS_UICC_RESET" },
1514 { MBIM_CID_MS_UICC_APP_LIST, "MS_UICC_APP_LIST" },
1515 { MBIM_CID_MS_UICC_FILE_STATUS, "MS_UICC_FILE_STATUS" },
1516 { MBIM_CID_MS_UICC_ACCESS_BINARY, "MS_UICC_ACCESS_BINARY" },
1517 { MBIM_CID_MS_UICC_ACCESS_RECORD, "MS_UICC_ACCESS_RECORD" },
1518 { 0, NULL}
1519 };
1520
1521 struct mbim_uuid_info_ {
1522 int *hf_entry;
1523 const value_string *cid_list;
1524 value_string_ext *cid_list_ext;
1525 };
1526
1527 static const struct mbim_uuid_info_ mbim_uuid_info[UUID_MAX] = {
1528 { &hf_mbim_uuid_basic_connect_cid, NULL, &mbim_uuid_basic_connect_cid_vals_ext}, /* UUID_BASIC_CONNECT */
1529 { &hf_mbim_uuid_sms_cid, mbim_uuid_sms_cid_vals, NULL}, /* UUID_SMS */
1530 { &hf_mbim_uuid_ussd_cid, mbim_uuid_ussd_cid_vals, NULL}, /* UUID_USSD */
1531 { &hf_mbim_uuid_phonebook_cid, mbim_uuid_phonebook_cid_vals, NULL}, /* UUID_PHONEBOOK */
1532 { &hf_mbim_uuid_stk_cid, mbim_uuid_stk_cid_vals, NULL}, /* UUID_STK */
1533 { &hf_mbim_uuid_auth_cid, mbim_uuid_auth_cid_vals, NULL}, /* UUID_AUTH */
1534 { &hf_mbim_uuid_dss_cid, mbim_uuid_dss_cid_vals, NULL}, /* UUID_DSS */
1535 { &hf_mbim_uuid_multicarrier_cid, mbim_uuid_multicarrier_cid_vals, NULL}, /* UUID_MULTICARRIER */
1536 { &hf_mbim_uuid_ms_hostshutdown_cid, mbim_uuid_ms_hostshutdown_cid_vals, NULL}, /* UUID_MS_HOSTSHUTDOWN */
1537 { &hf_mbim_uuid_msfwid_cid, mbim_uuid_msfwid_cid_vals, NULL}, /* UUID_MSFWID */
1538 { &hf_mbim_uuid_qmi_cid, mbim_uuid_qmi_cid_vals, NULL}, /* UUID_QMI */
1539 { &hf_mbim_uuid_intel_fwusvc_cid, mbim_uuid_intel_fwusvc_cid_vals, NULL}, /* UUID_INTEL_FWUSVC */
1540 { &hf_mbim_uuid_intel_dptf_cid, mbim_uuid_intel_dptf_cid_vals, NULL}, /* UUID_INTEL_DPTF */
1541 { &hf_mbim_uuid_intel_sar_cid, mbim_uuid_intel_sar_cid_vals, NULL}, /* UUID_INTEL_SAR */
1542 { &hf_mbim_uuid_intel_act_cid, mbim_uuid_intel_act_cid_vals, NULL}, /* UUID_INTEL_ACT */
1543 { &hf_mbim_uuid_intel_trcsvc_cid, mbim_uuid_intel_trcsvc_cid_vals, NULL}, /* UUID_INTEL_TRCSVC */
1544 { &hf_mbim_uuid_intel_nrtc_cid, mbim_uuid_intel_nrtc_cid_vals, NULL}, /* UUID_INTEL_NRTC */
1545 { &hf_mbim_uuid_intel_usb_profile_cid, mbim_uuid_intel_usb_profile_cid_vals, NULL}, /* UUID_INTEL_USB_PROFILE */
1546 { &hf_mbim_uuid_intel_ciq_cid, mbim_uuid_intel_ciq_cid_vals, NULL}, /* UUID_INTEL_CIQ */
1547 { &hf_mbim_uuid_atds_cid, mbim_uuid_atds_cid_vals, NULL}, /* UUID_ATDS */
1548 { &hf_mbim_uuid_multiflow_cid, mbim_uuid_multiflow_cid_vals, NULL}, /* UUID_MULTIFLOW */
1549 { &hf_mbim_uuid_basic_connect_extensions_cid, mbim_uuid_basic_connect_extensions_cid_vals, NULL}, /* UUID_BASIC_CONNECT_EXTENSIONS */
1550 { &hf_mbim_uuid_ms_sarcontrol_cid, mbim_uuid_ms_sarcontrol_cid_vals, NULL}, /* UUID_MS_SARCONTROL */
1551 { &hf_mbim_uuid_ms_uicc_low_level_cid, mbim_uuid_ms_uicc_low_level_cid_vals, NULL} /* UUID_MS_UICC_LOW_LEVEL */
1552 };
1553
1554 static const value_string mbim_device_caps_info_device_type_vals[] = {
1555 { 0, "Unknown"},
1556 { 1, "Embedded"},
1557 { 2, "Removable"},
1558 { 3, "Remote"},
1559 { 0, NULL}
1560 };
1561
1562 #define MBIM_CELLULAR_CLASS_GSM 1
1563 #define MBIM_CELLULAR_CLASS_CDMA 2
1564
1565 static const value_string mbim_cellular_class_vals[] = {
1566 { MBIM_CELLULAR_CLASS_GSM, "GSM"},
1567 { MBIM_CELLULAR_CLASS_CDMA, "CDMA"},
1568 { 0, NULL}
1569 };
1570
1571 static const value_string mbim_device_caps_info_voice_class_vals[] = {
1572 { 0, "Unknown"},
1573 { 1, "No Voice"},
1574 { 2, "Separate Voice Data"},
1575 { 3, "Simultaneous Voice Data"},
1576 { 0, NULL}
1577 };
1578
1579 static const value_string mbim_packet_service_info_frequency_range_vals[] = {
1580 { 0, "Unknown"},
1581 { 1, "Range1"},
1582 { 2, "Range2"},
1583 { 3, "Range1AndRange2"},
1584 { 0, NULL}
1585 };
1586
1587 static int * const mbim_device_caps_info_sim_class_fields[] = {
1588 &hf_mbim_device_caps_info_sim_class_logical,
1589 &hf_mbim_device_caps_info_sim_class_removable,
1590 NULL
1591 };
1592
1593 static int * const mbim_data_class_fields[] = {
1594 &hf_mbim_data_class_gprs,
1595 &hf_mbim_data_class_edge,
1596 &hf_mbim_data_class_umts,
1597 &hf_mbim_data_class_hsdpa,
1598 &hf_mbim_data_class_hsupa,
1599 &hf_mbim_data_class_lte,
1600 &hf_mbim_data_class_5g,
1601 &hf_mbim_data_class_reserved_gsm,
1602 &hf_mbim_data_class_1xrtt,
1603 &hf_mbim_data_class_1xevdo,
1604 &hf_mbim_data_class_1xevdoreva,
1605 &hf_mbim_data_class_1xevdv,
1606 &hf_mbim_data_class_3xrtt,
1607 &hf_mbim_data_class_1xevdorevb,
1608 &hf_mbim_data_class_umb,
1609 &hf_mbim_data_class_reserved_cdma,
1610 &hf_mbim_data_class_custom,
1611 NULL
1612 };
1613
1614 static int * const mbim_device_caps_info_sms_caps_fields[] = {
1615 &hf_mbim_device_caps_info_sms_caps_pdu_receive,
1616 &hf_mbim_device_caps_info_sms_caps_pdu_send,
1617 &hf_mbim_device_caps_info_sms_caps_text_receive,
1618 &hf_mbim_device_caps_info_sms_caps_text_send,
1619 NULL
1620 };
1621
1622 static int * const mbim_device_caps_info_control_caps_fields[] = {
1623 &hf_mbim_device_caps_info_control_caps_reg_manual,
1624 &hf_mbim_device_caps_info_control_caps_hw_radio_switch,
1625 &hf_mbim_device_caps_info_control_caps_cdma_mobile_ip,
1626 &hf_mbim_device_caps_info_control_caps_cdma_simple_ip,
1627 &hf_mbim_device_caps_info_control_caps_multi_carrier,
1628 &hf_mbim_device_caps_info_control_caps_esim,
1629 &hf_mbim_device_caps_info_control_caps_ue_policy_route_selection,
1630 &hf_mbim_device_caps_info_control_caps_sim_hot_swap_capable,
1631 NULL
1632 };
1633
1634 static int * const mbim_data_subclass_fields[] = {
1635 &hf_mbim_data_subclass_5gendc,
1636 &hf_mbim_data_subclass_5gnr,
1637 &hf_mbim_data_subclass_5gnedc,
1638 &hf_mbim_data_subclass_5gelte,
1639 &hf_mbim_data_subclass_5gngendc,
1640 NULL
1641 };
1642
1643 static const value_string mbim_subscr_ready_status_ready_state_vals[] = {
1644 { 0, "Not Initialized"},
1645 { 1, "Initialized"},
1646 { 2, "SIM Not Inserted"},
1647 { 3, "Bad SIM"},
1648 { 4, "Failure"},
1649 { 5, "Not Activated"},
1650 { 6, "Device Locked"},
1651 { 0, NULL}
1652 };
1653
1654 static int * const mbim_subscr_ready_status_flags_fields[] = {
1655 &hf_mbim_subscr_ready_status_flag_esim,
1656 &hf_mbim_subscr_ready_status_flag_sim_removability_known,
1657 &hf_mbim_subscr_ready_status_flag_sim_removable,
1658 NULL
1659 };
1660
1661 static const value_string mbim_subscr_ready_status_ready_info_vals[] = {
1662 { 0, "None"},
1663 { 1, "Protect Unique ID"},
1664 { 0, NULL}
1665 };
1666
1667 static const value_string mbim_radio_state_vals[] = {
1668 { 0, "Radio Off"},
1669 { 1, "Radio On"},
1670 { 0, NULL}
1671 };
1672
1673 static const value_string mbim_pin_type_vals[] = {
1674 { 0, "None"},
1675 { 1, "Custom"},
1676 { 2, "PIN 1"},
1677 { 3, "PIN 2"},
1678 { 4, "Device SIM PIN"},
1679 { 5, "Device First SIM PIN"},
1680 { 6, "Network PIN"},
1681 { 7, "Network Subset PIN"},
1682 { 8, "Service Provider PIN"},
1683 { 9, "Corporate PIN"},
1684 { 10, "Subsidy Lock"},
1685 { 11, "PUK 1"},
1686 { 12, "PUK 2"},
1687 { 13, "Device First SIM PUK"},
1688 { 14, "Network PUK"},
1689 { 15, "Network Subset PUK"},
1690 { 16, "Service Provider PUK"},
1691 { 17, "Corporate PUK"},
1692 { 18, "Corporate NEV"},
1693 { 19, "Corporate ADM"},
1694 { 0, NULL}
1695 };
1696
1697 static const value_string mbim_pin_operation_vals[] = {
1698 { 0, "Enter"},
1699 { 1, "Enable"},
1700 { 2, "Disable"},
1701 { 3, "Change"},
1702 { 0, NULL}
1703 };
1704
1705 static const value_string mbim_pin_state_vals[] = {
1706 { 0, "Unlocked"},
1707 { 1, "Locked"},
1708 { 0, NULL}
1709 };
1710
1711 static const value_string mbim_pin_mode_vals[] = {
1712 { 0, "Not Supported"},
1713 { 1, "Enabled"},
1714 { 2, "Disabled"},
1715 { 0, NULL}
1716 };
1717
1718 static const value_string mbim_pin_format_vals[] = {
1719 { 0, "Unknown"},
1720 { 1, "Numeric"},
1721 { 2, "Alpha Numeric"},
1722 { 0, NULL}
1723 };
1724
1725 static const value_string mbim_ms_modem_config_status_vals[] = {
1726 { 0, "Unknown"},
1727 { 1, "Started"},
1728 { 2, "Completed"},
1729 { 0, NULL}
1730 };
1731
1732 static const value_string mbim_ms_mico_mode_vals[] = {
1733 { 0, "Disabled"},
1734 { 1, "Enabled"},
1735 { 2, "Unsupported"},
1736 { 3, "Default"},
1737 { 0, NULL}
1738 };
1739
1740 static const value_string mbim_ms_default_pdu_hint_vals[] = {
1741 { 0, "Activation Unlikely"},
1742 { 1, "Activation Likely"},
1743 { 0, NULL}
1744 };
1745
1746 static const value_string mbim_ms_ladn_ind_vals[] = {
1747 { 0, "Info Not Needed"},
1748 { 1, "Info Requested"},
1749 { 0, NULL}
1750 };
1751
1752 static const value_string mbim_ms_drx_params_vals[] = {
1753 { 0, "Not Specified"},
1754 { 1, "Not Supported"},
1755 { 2, "Cycle32"},
1756 { 3, "Cycle64"},
1757 { 4, "Cycle128"},
1758 { 5, "Cycle256"},
1759 { 0, NULL}
1760 };
1761
1762 static const value_string hf_mbim_ms_wake_reason_wake_type_vals[] = {
1763 { 0, "CID Response"},
1764 { 1, "CID Indication"},
1765 { 2, "Packet"},
1766 { 0, NULL}
1767 };
1768
1769 #define TLV_TYPE_UNKNOWN 0
1770 #define TLV_TYPE_UE_POLICIES 1
1771 #define TLV_TYPE_SINGLE_NSSAI 2
1772 #define TLV_TYPE_ALLOWED_NSSAI 3
1773 #define TLV_TYPE_CFG_NSSAI 4
1774 #define TLV_TYPE_DFLT_CFG_NSSAI 5
1775 #define TLV_TYPE_PRECFG_DFLT_CFG_NSSAI 6
1776 #define TLV_TYPE_REJ_NSSAI 7
1777 #define TLV_TYPE_LADN 8
1778 #define TLV_TYPE_TAI 9
1779 #define TLV_TYPE_WCHAR_STR 10
1780 #define TLV_TYPE_UINT16_TBL 11
1781 #define TLV_TYPE_EAP_PACKET 12
1782 #define TLV_TYPE_PCO 13
1783 #define TLV_TYPE_ROUTE_SELECTION_DESCRIPTORS 14
1784 #define TLV_TYPE_TRAFFIC_PARAMETERS 15
1785 #define TLV_TYPE_WAKE_COMMAND 16
1786 #define TLV_TYPE_WAKE_PACKET 17
1787
1788 static const value_string mbim_tlv_type_vals[] = {
1789 { TLV_TYPE_UNKNOWN, "UNKNOWN"},
1790 { TLV_TYPE_UE_POLICIES, "UE_POLICIES"},
1791 { TLV_TYPE_SINGLE_NSSAI, "SINGLE_NSSAI"},
1792 { TLV_TYPE_ALLOWED_NSSAI, "ALLOWED_NSSAI"},
1793 { TLV_TYPE_CFG_NSSAI, "CFG_NSSAI"},
1794 { TLV_TYPE_DFLT_CFG_NSSAI, "DFLT_CFG_NSSAI"},
1795 { TLV_TYPE_PRECFG_DFLT_CFG_NSSAI, "PRECFG_DFLT_CFG_NSSAI"},
1796 { TLV_TYPE_REJ_NSSAI, "REJ_NSSAI"},
1797 { TLV_TYPE_LADN, "LADN"},
1798 { TLV_TYPE_TAI, "TAI"},
1799 { TLV_TYPE_WCHAR_STR, "WCHAR_STR"},
1800 { TLV_TYPE_UINT16_TBL, "UINT16_TBL"},
1801 { TLV_TYPE_EAP_PACKET, "EAP_PACKET"},
1802 { TLV_TYPE_PCO, "PCO"},
1803 { TLV_TYPE_ROUTE_SELECTION_DESCRIPTORS, "ROUTE_SELECTION_DESCRIPTORS"},
1804 { TLV_TYPE_TRAFFIC_PARAMETERS, "TRAFFIC_PARAMETERS"},
1805 { TLV_TYPE_WAKE_COMMAND, "WAKE_COMMAND"},
1806 { TLV_TYPE_WAKE_PACKET, "WAKE_PACKET"},
1807 { 0, NULL}
1808 };
1809
1810 static int * const mbim_provider_state_fields[] = {
1811 &hf_mbim_provider_state_home,
1812 &hf_mbim_provider_state_forbidden,
1813 &hf_mbim_provider_state_preferred,
1814 &hf_mbim_provider_state_visible,
1815 &hf_mbim_provider_state_registered,
1816 &hf_mbim_provider_state_preferred_multicarrier,
1817 NULL
1818 };
1819
1820 static void
mbim_rssi_fmt(gchar * s,guint32 val)1821 mbim_rssi_fmt(gchar *s, guint32 val)
1822 {
1823 if (val == 0) {
1824 g_snprintf(s, ITEM_LABEL_LENGTH, "-113 or less dBm (0)");
1825 } else if (val < 31) {
1826 g_snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -113 + 2*val, val);
1827 } else if (val == 31) {
1828 g_snprintf(s, ITEM_LABEL_LENGTH, "-51 or greater dBm (31)");
1829 } else if (val == 99) {
1830 g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (99)");
1831 } else {
1832 g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val);
1833 }
1834 }
1835
1836 static const value_string mbim_error_rate_vals[] = {
1837 { 0, "Frame error rate < 0.01%%"},
1838 { 1, "Frame error rate 0.01-0.1%%"},
1839 { 2, "Frame error rate 0.1-0.5%%"},
1840 { 3, "Frame error rate 0.5-1.0%%"},
1841 { 4, "Frame error rate 1.0-2.0%%"},
1842 { 5, "Frame error rate 2.0-4.0%%"},
1843 { 6, "Frame error rate 4.0-8.0%%"},
1844 { 7, "Frame error rate > 8.0%%"},
1845 { 99, "Unknown or undetectable"},
1846 { 0, NULL}
1847 };
1848
1849 static const value_string mbim_visible_providers_action_vals[] = {
1850 { 0, "Full Scan"},
1851 { 1, "Restricted Scan"},
1852 {0, NULL}
1853 };
1854
1855 static const value_string mbim_register_action_vals[] = {
1856 { 0, "Automatic"},
1857 { 1, "Manual"},
1858 { 0, NULL}
1859 };
1860
1861 static const value_string mbim_register_state_vals[] = {
1862 { 0, "Unknown"},
1863 { 1, "Deregistered"},
1864 { 2, "Searching"},
1865 { 3, "Home"},
1866 { 4, "Roaming"},
1867 { 5, "Partner"},
1868 { 6, "Denied"},
1869 { 0, NULL}
1870 };
1871
1872 static const value_string mbim_register_mode_vals[] = {
1873 { 0, "Unknown"},
1874 { 1, "Automatic"},
1875 { 2, "Manual"},
1876 { 0, NULL}
1877 };
1878
1879 static int * const mbim_registration_state_info_registration_flags_fields[] = {
1880 &hf_mbim_registration_state_info_registration_flags_manual_selection_not_available,
1881 &hf_mbim_registration_state_info_registration_flags_packet_service_auto_attach,
1882 NULL
1883 };
1884
1885 static const value_string mbim_packet_service_action_vals[] = {
1886 { 0, "Attach"},
1887 { 1, "Detach"},
1888 { 0, NULL}
1889 };
1890
1891 static const value_string mbim_packet_service_state_vals[] = {
1892 { 0, "Unknown"},
1893 { 1, "Attaching"},
1894 { 2, "Attached"},
1895 { 3, "Detaching"},
1896 { 4, "Detached"},
1897 { 0, NULL},
1898 };
1899
1900 static const value_string mbim_activation_command_vals[] = {
1901 { 0, "Deactivate"},
1902 { 1, "Activate"},
1903 { 0, NULL}
1904 };
1905
1906 static const value_string mbim_compression_vals[] = {
1907 { 0, "None"},
1908 { 1, "Enable"},
1909 { 0, NULL}
1910 };
1911
1912 static const value_string mbim_auth_protocol_vals[]= {
1913 { 0, "None"},
1914 { 1, "PAP"},
1915 { 2, "CHAP"},
1916 { 3, "MS CHAPv2"},
1917 { 0, NULL}
1918 };
1919
1920 static const value_string mbim_context_ip_type_vals[] = {
1921 { 0, "Default"},
1922 { 1, "IPv4"},
1923 { 2, "IPv6"},
1924 { 3, "IPv4v6"},
1925 { 4, "IPv4 and IPv6"},
1926 { 0, NULL}
1927 };
1928
1929 static const value_string mbim_activation_state_vals[] = {
1930 { 0, "Unknown"},
1931 { 1, "Activated"},
1932 { 2, "Activating"},
1933 { 3, "Deactivated"},
1934 { 4, "Deactivating"},
1935 { 0, NULL}
1936 };
1937
1938 static const value_string mbim_voice_call_state_vals[] = {
1939 { 0, "None"},
1940 { 1, "In Progress"},
1941 { 2, "Hang Up"},
1942 { 0, NULL}
1943 };
1944
1945 #define UUID_CONTEXT_NONE 0
1946 #define UUID_CONTEXT_INTERNET 1
1947 #define UUID_CONTEXT_VPN 2
1948 #define UUID_CONTEXT_VOICE 3
1949 #define UUID_CONTEXT_VIDEO_SHARE 4
1950 #define UUID_CONTEXT_PURCHASE 5
1951 #define UUID_CONTEXT_IMS 6
1952 #define UUID_CONTEXT_MMS 7
1953 #define UUID_CONTEXT_LOCAL 8
1954 #define UUID_CONTEXT_MS_ADMIN 9
1955 #define UUID_CONTEXT_MS_APP 10
1956 #define UUID_CONTEXT_MS_XCAP 11
1957 #define UUID_CONTEXT_MS_TETHERING 12
1958 #define UUID_CONTEXT_MS_EMERGENCY_CALLING 13
1959
1960 static const struct mbim_uuid mbim_uuid_context_type_vals[] = {
1961 { UUID_CONTEXT_NONE, {0xb43f758c, 0xa560, 0x4b46, {0xb3, 0x5e, 0xc5, 0x86, 0x96, 0x41, 0xfb, 0x54}}},
1962 { UUID_CONTEXT_INTERNET, {0x7e5e2a7e, 0x4e6f, 0x7272, {0x73, 0x6b, 0x65, 0x6e, 0x7e, 0x5e, 0x2a, 0x7e}}},
1963 { UUID_CONTEXT_VPN, {0x9b9f7bbe, 0x8952, 0x44b7, {0x83, 0xac, 0xca, 0x41, 0x31, 0x8d, 0xf7, 0xa0}}},
1964 { UUID_CONTEXT_VOICE, {0x88918294, 0x0ef4, 0x4396, {0x8c, 0xca, 0xa8, 0x58, 0x8f, 0xbc, 0x02, 0xb2}}},
1965 { UUID_CONTEXT_VIDEO_SHARE, {0x05a2a716, 0x7c34, 0x4b4d, {0x9a, 0x91, 0xc5, 0xef, 0x0c, 0x7a, 0xaa, 0xcc}}},
1966 { UUID_CONTEXT_PURCHASE, {0xb3272496, 0xac6c, 0x422b, {0xa8, 0xc0, 0xac, 0xf6, 0x87, 0xa2, 0x72, 0x17}}},
1967 { UUID_CONTEXT_IMS, {0x21610D01, 0x3074, 0x4BCE, {0x94, 0x25, 0xB5, 0x3A, 0x07, 0xD6, 0x97, 0xD6}}},
1968 { UUID_CONTEXT_MMS, {0x46726664, 0x7269, 0x6bc6, {0x96, 0x24, 0xd1, 0xd3, 0x53, 0x89, 0xac, 0xa9}}},
1969 { UUID_CONTEXT_LOCAL, {0xa57a9afc, 0xb09f, 0x45d7, {0xbb, 0x40, 0x03, 0x3c, 0x39, 0xf6, 0x0d, 0xb9}}},
1970 { UUID_CONTEXT_MS_ADMIN, {0x5f7e4c2e, 0xe80b, 0x40a9, {0xa2, 0x39, 0xf0, 0xab, 0xcf, 0xd1, 0x1f, 0x4b}}},
1971 { UUID_CONTEXT_MS_APP, {0x74d88a3d, 0xdfbd, 0x4799, {0x9a, 0x8c, 0x73, 0x10, 0xa3, 0x7b, 0xb2, 0xee}}},
1972 { UUID_CONTEXT_MS_XCAP, {0x50d378a7, 0xbaa5, 0x4a50, {0xb8, 0x72, 0x3f, 0xe5, 0xbb, 0x46, 0x34, 0x11}}},
1973 { UUID_CONTEXT_MS_TETHERING, {0x5e4e0601, 0x48dc, 0x4e2b, {0xac, 0xb8, 0x08, 0xb4, 0x01, 0x6b, 0xba, 0xac}}},
1974 { UUID_CONTEXT_MS_EMERGENCY_CALLING, {0x5f41adb8, 0x204e, 0x4d31, {0x9d, 0xa8, 0xb3, 0xc9, 0x70, 0xe3, 0x60, 0xf2}}}
1975 };
1976
1977 static const value_string mbim_context_type_vals[] = {
1978 { UUID_CONTEXT_NONE, "None"},
1979 { UUID_CONTEXT_INTERNET, "Internet"},
1980 { UUID_CONTEXT_VPN, "VPN"},
1981 { UUID_CONTEXT_VOICE, "Voice"},
1982 { UUID_CONTEXT_VIDEO_SHARE, "Video Share"},
1983 { UUID_CONTEXT_PURCHASE, "Purchase"},
1984 { UUID_CONTEXT_IMS, "IMS"},
1985 { UUID_CONTEXT_MMS, "MMS"},
1986 { UUID_CONTEXT_LOCAL, "Local"},
1987 { UUID_CONTEXT_MS_ADMIN, "MS Administrative Purposes"},
1988 { UUID_CONTEXT_MS_APP, "MS Operator App"},
1989 { UUID_CONTEXT_MS_XCAP, "MS XCAP Provisioning for IMS"},
1990 { UUID_CONTEXT_MS_TETHERING, "MS Mobile Hotspot Tethering"},
1991 { UUID_CONTEXT_MS_EMERGENCY_CALLING, "MS IMS Emergency Calling"},
1992 { 0, NULL}
1993 };
1994
1995 static int * const mbim_ip_configuration_info_ipv4_configuration_available_fields[] = {
1996 &hf_mbim_ip_configuration_info_ipv4_configuration_available_address,
1997 &hf_mbim_ip_configuration_info_ipv4_configuration_available_gateway,
1998 &hf_mbim_ip_configuration_info_ipv4_configuration_available_dns,
1999 &hf_mbim_ip_configuration_info_ipv4_configuration_available_mtu,
2000 NULL
2001 };
2002
2003 static int * const mbim_ip_configuration_info_ipv6_configuration_available_fields[] = {
2004 &hf_mbim_ip_configuration_info_ipv6_configuration_available_address,
2005 &hf_mbim_ip_configuration_info_ipv6_configuration_available_gateway,
2006 &hf_mbim_ip_configuration_info_ipv6_configuration_available_dns,
2007 &hf_mbim_ip_configuration_info_ipv6_configuration_available_mtu,
2008 NULL
2009 };
2010
2011 static int * const mbim_device_service_element_dss_payload_fields[] = {
2012 &hf_mbim_device_service_element_dss_payload_host_device,
2013 &hf_mbim_device_service_element_dss_payload_device_host,
2014 NULL
2015 };
2016
2017 static const value_string mbim_network_idle_hint_states_vals[] = {
2018 { 0, "Disabled"},
2019 { 1, "Enabled"},
2020 { 0, NULL}
2021 };
2022
2023 static const value_string mbim_emergency_mode_states_vals[] = {
2024 { 0, "Off"},
2025 { 1, "On"},
2026 { 0, NULL}
2027 };
2028
2029 static const value_string mbim_sms_storage_state_vals[] = {
2030 { 0, "Not Initialized"},
2031 { 1, "Initialized"},
2032 { 0, NULL}
2033 };
2034
2035 #define MBIM_SMS_FORMAT_PDU 0
2036 #define MBIM_SMS_FORMAT_CDMA 1
2037
2038 static const value_string mbim_sms_format_vals[] = {
2039 { MBIM_SMS_FORMAT_PDU, "PDU"},
2040 { MBIM_SMS_FORMAT_CDMA, "CDMA"},
2041 { 0, NULL}
2042 };
2043
2044 static const value_string mbim_sms_flag_vals[] = {
2045 { 0, "All"},
2046 { 1, "Index"},
2047 { 2, "New"},
2048 { 3, "Old"},
2049 { 4, "Sent"},
2050 { 5, "Draft"},
2051 { 0, NULL}
2052 };
2053
2054 static const value_string mbim_sms_cdma_lang_vals[] = {
2055 { 0, "Unknown"},
2056 { 1, "English"},
2057 { 2, "French"},
2058 { 3, "Spanish"},
2059 { 4, "Japanese"},
2060 { 5, "Korean"},
2061 { 6, "Chinese"},
2062 { 7, "Hebrew"},
2063 { 0, NULL}
2064 };
2065
2066 #define MBIM_ENCODING_OCTET 0
2067 #define MBIM_ENCODING_EPM 1
2068 #define MBIM_ENCODING_7BIT_ASCII 2
2069 #define MBIM_ENCODING_IA5 3
2070 #define MBIM_ENCODING_UNICODE 4
2071 #define MBIM_ENCODING_SHIFT_JIS 5
2072 #define MBIM_ENCODING_KOREAN 6
2073 #define MBIM_ENCODING_LATIN_HEBREW 7
2074 #define MBIM_ENCODING_LATIN 8
2075 #define MBIM_ENCODING_GSM_7BIT 9
2076
2077 static const value_string mbim_sms_cdma_encoding_vals[] = {
2078 { MBIM_ENCODING_OCTET, "Octet"},
2079 { MBIM_ENCODING_EPM, "EPM"},
2080 { MBIM_ENCODING_7BIT_ASCII, "7 Bit ASCII"},
2081 { MBIM_ENCODING_IA5, "IA5"},
2082 { MBIM_ENCODING_UNICODE, "Unicode"},
2083 { MBIM_ENCODING_SHIFT_JIS, "Shift-JIS"},
2084 { MBIM_ENCODING_KOREAN, "Korean"},
2085 { MBIM_ENCODING_LATIN_HEBREW, "Latin Hebrew"},
2086 { MBIM_ENCODING_LATIN, "Latin"},
2087 { MBIM_ENCODING_GSM_7BIT, "GSM 7 Bit"},
2088 { 0, NULL}
2089 };
2090
2091 static const value_string mbim_sms_message_status_vals[] = {
2092 { 0, "New"},
2093 { 1, "Old"},
2094 { 2, "Draft"},
2095 { 3, "Sent"},
2096 { 0, NULL}
2097 };
2098
2099 static int * const mbim_sms_status_info_flags_fields[] = {
2100 &hf_mbim_sms_status_info_flags_message_store_full,
2101 &hf_mbim_sms_status_info_flags_new_message,
2102 NULL
2103 };
2104
2105 static const value_string mbim_ussd_action_vals[] = {
2106 { 0, "Initiate"},
2107 { 1, "Continue"},
2108 { 2, "Cancel"},
2109 { 0, NULL}
2110 };
2111
2112 static const value_string mbim_ussd_response_vals[] = {
2113 { 0, "No Action Required"},
2114 { 1, "Action Required"},
2115 { 2, "Terminated By NW"},
2116 { 3, "Other Local Client"},
2117 { 4, "Operation Not Supported"},
2118 { 5, "Network Time Out"},
2119 { 0, NULL}
2120 };
2121
2122 static const value_string mbim_ussd_session_state_vals[] = {
2123 { 0, "New Session"},
2124 { 1, "Existing Session"},
2125 { 0, NULL}
2126 };
2127
2128 static const value_string mbim_phonebook_state_vals[] = {
2129 { 0, "Not Initialized"},
2130 { 1, "Initialized"},
2131 { 0, NULL}
2132 };
2133
2134 static const value_string mbim_phonebook_flag_vals[] = {
2135 { 0, "All"},
2136 { 1, "Index"},
2137 { 0, NULL}
2138 };
2139
2140 static const value_string mbim_phonebook_write_flag_vals[] = {
2141 { 0, "Unused"},
2142 { 1, "Index"},
2143 { 0, NULL}
2144 };
2145
2146 static const true_false_string mbim_pac_host_control_val = {
2147 "Host wants to handle command",
2148 "Host does not want to handle command"
2149 };
2150
2151 static const value_string mbim_stk_pac_profile_vals[] = {
2152 { 0, "Not Handled By Function Cannot Be Handled By Host"},
2153 { 1, "Not Handled By Function May Be Handled By Host"},
2154 { 2, "Handled By Function Only Transparent To Host"},
2155 { 3, "Handled By Function Notification To Host Possible"},
2156 { 4, "Handled By Function Notification To Host Enabled"},
2157 { 5, "Handled By Function Can Be Overridden By Host"},
2158 { 6, "Handled By Host Function Not Able To Handle"},
2159 { 7, "Handled By Host Function Able To Handle"},
2160 { 0, NULL}
2161 };
2162
2163 static const value_string mbim_stk_pac_type_vals[] = {
2164 { 0, "Proactive Command"},
2165 { 1, "Notification"},
2166 { 0, NULL}
2167 };
2168
2169 static const value_string mbim_dss_link_state_vals[] = {
2170 { 0, "Deactivate"},
2171 { 1, "Activate"},
2172 { 0, NULL}
2173 };
2174
2175 static int * const mbim_multicarrier_capabilities_fields[] = {
2176 &hf_mbim_multicarrier_capabilities_info_capabilities_static_scan,
2177 &hf_mbim_multicarrier_capabilities_info_capabilities_fw_requires_reboot,
2178 NULL
2179 };
2180
2181 static const value_string mbim_geoid_vals[] = {
2182 { 0x2, "Antigua and Barbuda"},
2183 { 0x3, "Afghanistan"},
2184 { 0x4, "Algeria"},
2185 { 0x5, "Azerbaijan"},
2186 { 0x6, "Albania"},
2187 { 0x7, "Armenia"},
2188 { 0x8, "Andorra"},
2189 { 0x9, "Angola"},
2190 { 0xA, "American Samoa"},
2191 { 0xB, "Argentina"},
2192 { 0xC, "Australia"},
2193 { 0xE, "Austria"},
2194 { 0x11, "Bahrain"},
2195 { 0x12, "Barbados"},
2196 { 0x13, "Botswana"},
2197 { 0x14, "Bermuda"},
2198 { 0x15, "Belgium"},
2199 { 0x16, "Bahamas, The"},
2200 { 0x17, "Bangladesh"},
2201 { 0x18, "Belize"},
2202 { 0x19, "Bosnia and Herzegovina"},
2203 { 0x1A, "Bolivia"},
2204 { 0x1B, "Myanmar"},
2205 { 0x1C, "Benin"},
2206 { 0x1D, "Belarus"},
2207 { 0x1E, "Solomon Islands"},
2208 { 0x20, "Brazil"},
2209 { 0x22, "Bhutan"},
2210 { 0x23, "Bulgaria"},
2211 { 0x25, "Brunei"},
2212 { 0x26, "Burundi"},
2213 { 0x27, "Canada"},
2214 { 0x28, "Cambodia"},
2215 { 0x29, "Chad"},
2216 { 0x2A, "Sri Lanka"},
2217 { 0x2B, "Congo"},
2218 { 0x2C, "Congo (DRC)"},
2219 { 0x2D, "China"},
2220 { 0x2E, "Chile"},
2221 { 0x31, "Cameroon"},
2222 { 0x32, "Comoros"},
2223 { 0x33, "Colombia"},
2224 { 0x36, "Costa Rica"},
2225 { 0x37, "Central African Republic"},
2226 { 0x38, "Cuba"},
2227 { 0x39, "Cape Verde"},
2228 { 0x3B, "Cyprus"},
2229 { 0x3D, "Denmark"},
2230 { 0x3E, "Djibouti"},
2231 { 0x3F, "Dominica"},
2232 { 0x41, "Dominican Republic"},
2233 { 0x42, "Ecuador"},
2234 { 0x43, "Egypt"},
2235 { 0x44, "Ireland"},
2236 { 0x45, "Equatorial Guinea"},
2237 { 0x46, "Estonia"},
2238 { 0x47, "Eritrea"},
2239 { 0x48, "El Salvador"},
2240 { 0x49, "Ethiopia"},
2241 { 0x4B, "Czech Republic"},
2242 { 0x4D, "Finland"},
2243 { 0x4E, "Fiji Islands"},
2244 { 0x50, "Micronesia"},
2245 { 0x51, "Faroe Islands"},
2246 { 0x54, "France"},
2247 { 0x56, "Gambia, The"},
2248 { 0x57, "Gabon"},
2249 { 0x58, "Georgia"},
2250 { 0x59, "Ghana"},
2251 { 0x5A, "Gibraltar"},
2252 { 0x5B, "Grenada"},
2253 { 0x5D, "Greenland"},
2254 { 0x5E, "Germany"},
2255 { 0x62, "Greece"},
2256 { 0x63, "Guatemala"},
2257 { 0x64, "Guinea"},
2258 { 0x65, "Guyana"},
2259 { 0x67, "Haiti"},
2260 { 0x68, "Hong Kong S.A.R."},
2261 { 0x6A, "Honduras"},
2262 { 0x6C, "Croatia"},
2263 { 0x6D, "Hungary"},
2264 { 0x6E, "Iceland"},
2265 { 0x6F, "Indonesia"},
2266 { 0x71, "India"},
2267 { 0x72, "British Indian Ocean Territory"},
2268 { 0x74, "Iran"},
2269 { 0x75, "Israel"},
2270 { 0x76, "Italy"},
2271 { 0x77, "Cote d'Ivoire"},
2272 { 0x79, "Iraq"},
2273 { 0x7A, "Japan"},
2274 { 0x7C, "Jamaica"},
2275 { 0x7D, "Jan Mayen"},
2276 { 0x7E, "Jordan"},
2277 { 0x7F, "Johnston Atoll"},
2278 { 0x81, "Kenya"},
2279 { 0x82, "Kyrgyzstan"},
2280 { 0x83, "North Korea"},
2281 { 0x85, "Kiribati"},
2282 { 0x86, "Korea"},
2283 { 0x88, "Kuwait"},
2284 { 0x89, "Kazakhstan"},
2285 { 0x8A, "Laos"},
2286 { 0x8B, "Lebanon"},
2287 { 0x8C, "Latvia"},
2288 { 0x8D, "Lithuania"},
2289 { 0x8E, "Liberia"},
2290 { 0x8F, "Slovakia"},
2291 { 0x91, "Liechtenstein"},
2292 { 0x92, "Lesotho"},
2293 { 0x93, "Luxembourg"},
2294 { 0x94, "Libya"},
2295 { 0x95, "Madagascar"},
2296 { 0x97, "Macao S.A.R."},
2297 { 0x98, "Moldova"},
2298 { 0x9A, "Mongolia"},
2299 { 0x9C, "Malawi"},
2300 { 0x9D, "Mali"},
2301 { 0x9E, "Monaco"},
2302 { 0x9F, "Morocco"},
2303 { 0xA0, "Mauritius"},
2304 { 0xA2, "Mauritania"},
2305 { 0xA3, "Malta"},
2306 { 0xA4, "Oman"},
2307 { 0xA5, "Maldives"},
2308 { 0xA6, "Mexico"},
2309 { 0xA7, "Malaysia"},
2310 { 0xA8, "Mozambique"},
2311 { 0xAD, "Niger"},
2312 { 0xAE, "Vanuatu"},
2313 { 0xAF, "Nigeria"},
2314 { 0xB0, "Netherlands"},
2315 { 0xB1, "Norway"},
2316 { 0xB2, "Nepal"},
2317 { 0xB4, "Nauru"},
2318 { 0xB5, "Suriname"},
2319 { 0xB6, "Nicaragua"},
2320 { 0xB7, "New Zealand"},
2321 { 0xB8, "Palestinian Authority"},
2322 { 0xB9, "Paraguay"},
2323 { 0xBB, "Peru"},
2324 { 0xBE, "Pakistan"},
2325 { 0xBF, "Poland"},
2326 { 0xC0, "Panama"},
2327 { 0xC1, "Portugal"},
2328 { 0xC2, "Papua New Guinea"},
2329 { 0xC3, "Palau"},
2330 { 0xC4, "Guinea-Bissau"},
2331 { 0xC5, "Qatar"},
2332 { 0xC6, "Reunion"},
2333 { 0xC7, "Marshall Islands"},
2334 { 0xC8, "Romania"},
2335 { 0xC9, "Philippines"},
2336 { 0xCA, "Puerto Rico"},
2337 { 0xCB, "Russia"},
2338 { 0xCC, "Rwanda"},
2339 { 0xCD, "Saudi Arabia"},
2340 { 0xCE, "St. Pierre and Miquelon"},
2341 { 0xCF, "St. Kitts and Nevis"},
2342 { 0xD0, "Seychelles"},
2343 { 0xD1, "South Africa"},
2344 { 0xD2, "Senegal"},
2345 { 0xD4, "Slovenia"},
2346 { 0xD5, "Sierra Leone"},
2347 { 0xD6, "San Marino"},
2348 { 0xD7, "Singapore"},
2349 { 0xD8, "Somalia"},
2350 { 0xD9, "Spain"},
2351 { 0xDA, "St. Lucia"},
2352 { 0xDB, "Sudan"},
2353 { 0xDC, "Svalbard"},
2354 { 0xDD, "Sweden"},
2355 { 0xDE, "Syria"},
2356 { 0xDF, "Switzerland"},
2357 { 0xE0, "United Arab Emirates"},
2358 { 0xE1, "Trinidad and Tobago"},
2359 { 0xE3, "Thailand"},
2360 { 0xE4, "Tajikistan"},
2361 { 0xE7, "Tonga"},
2362 { 0xE8, "Togo"},
2363 { 0xE9, "Sao Tome and Principe"},
2364 { 0xEA, "Tunisia"},
2365 { 0xEB, "Turkey"},
2366 { 0xEC, "Tuvalu"},
2367 { 0xED, "Taiwan"},
2368 { 0xEE, "Turkmenistan"},
2369 { 0xEF, "Tanzania"},
2370 { 0xF0, "Uganda"},
2371 { 0xF1, "Ukraine"},
2372 { 0xF2, "United Kingdom"},
2373 { 0xF4, "United States"},
2374 { 0xF5, "Burkina Faso"},
2375 { 0xF6, "Uruguay"},
2376 { 0xF7, "Uzbekistan"},
2377 { 0xF8, "St. Vincent and the Grenadines"},
2378 { 0xF9, "Venezuela"},
2379 { 0xFB, "Vietnam"},
2380 { 0xFC, "Virgin Islands"},
2381 { 0xFD, "Vatican City"},
2382 { 0xFE, "Namibia"},
2383 { 0x101, "Western Sahara (disputed)"},
2384 { 0x102, "Wake Island"},
2385 { 0x103, "Samoa"},
2386 { 0x104, "Swaziland"},
2387 { 0x105, "Yemen"},
2388 { 0x107, "Zambia"},
2389 { 0x108, "Zimbabwe"},
2390 { 0x10D, "Serbia and Montenegro (Former)"},
2391 { 0x10E, "Montenegro"},
2392 { 0x10F, "Serbia"},
2393 { 0x111, "Curacao"},
2394 { 0x114, "South Sudan"},
2395 { 0x12C, "Anguilla"},
2396 { 0x12D, "Antarctica"},
2397 { 0x12E, "Aruba"},
2398 { 0x12F, "Ascension Island"},
2399 { 0x130, "Ashmore and Cartier Islands"},
2400 { 0x131, "Baker Island"},
2401 { 0x132, "Bouvet Island"},
2402 { 0x133, "Cayman Islands"},
2403 { 0x135, "Christmas Island"},
2404 { 0x136, "Clipperton Island"},
2405 { 0x137, "Cocos (Keeling) Islands"},
2406 { 0x138, "Cook Islands"},
2407 { 0x139, "Coral Sea Islands"},
2408 { 0x13A, "Diego Garcia"},
2409 { 0x13B, "Falkland Islands (Islas Malvinas)"},
2410 { 0x13D, "French Guiana"},
2411 { 0x13E, "French Polynesia"},
2412 { 0x13F, "French Southern and Antarctic Lands"},
2413 { 0x141, "Guadeloupe"},
2414 { 0x142, "Guam"},
2415 { 0x143, "Guantanamo Bay"},
2416 { 0x144, "Guernsey"},
2417 { 0x145, "Heard Island and McDonald Islands"},
2418 { 0x146, "Howland Island"},
2419 { 0x147, "Jarvis Island"},
2420 { 0x148, "Jersey"},
2421 { 0x149, "Kingman Reef"},
2422 { 0x14A, "Martinique"},
2423 { 0x14B, "Mayotte"},
2424 { 0x14C, "Montserrat"},
2425 { 0x14E, "New Caledonia"},
2426 { 0x14F, "Niue"},
2427 { 0x150, "Norfolk Island"},
2428 { 0x151, "Northern Mariana Islands"},
2429 { 0x152, "Palmyra Atoll"},
2430 { 0x153, "Pitcairn Islands"},
2431 { 0x154, "Rota Island"},
2432 { 0x155, "Saipan"},
2433 { 0x156, "South Georgia and the South Sandwich Islands"},
2434 { 0x157, "St. Helena"},
2435 { 0x15A, "Tinian Island"},
2436 { 0x15B, "Tokelau"},
2437 { 0x15C, "Tristan da Cunha"},
2438 { 0x15D, "Turks and Caicos Islands"},
2439 { 0x15F, "Virgin Islands, British"},
2440 { 0x160, "Wallis and Futuna"},
2441 { 0x3B16, "Man, Isle of"},
2442 { 0x4CA2, "Macedonia, Former Yugoslav Republic of"},
2443 { 0x52FA, "Midway Islands"},
2444 { 0x78F7, "Sint Maarten (Dutch part)"},
2445 { 0x7BDA, "Saint Martin (French part)"},
2446 { 0x6F60E7, "Democratic Republic of Timor-Leste"},
2447 { 0x9906F5, "Aland Islands"},
2448 { 0x9A55C4F, "Saint Barthelemy"},
2449 { 0x9A55D40, "U.S. Minor Outlying Islands"},
2450 { 0x9A55D42, "Bonaire, Saint Eustatius and Saba"},
2451 { 0, NULL}
2452 };
2453 static value_string_ext mbim_geoid_vals_ext = VALUE_STRING_EXT_INIT(mbim_geoid_vals);
2454
2455 static int * const mbim_descriptor_network_capabilities_fields[] = {
2456 &hf_mbim_descriptor_network_capabilities_max_datagram_size,
2457 &hf_mbim_descriptor_network_capabilities_ntb_input_size,
2458 NULL
2459 };
2460
2461 static const value_string mbim_thermal_config_enable_vals[] = {
2462 { 0, "Disable"},
2463 { 1, "Enable"},
2464 { 0, NULL}
2465 };
2466
2467 static const value_string mbim_sar_status_vals[] = {
2468 { 0, "Disabled"},
2469 { 1, "Enabled"},
2470 { 0, NULL}
2471 };
2472
2473 static void
mbim_degrees_fmt(gchar * s,guint32 v)2474 mbim_degrees_fmt(gchar *s, guint32 v)
2475 {
2476 g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f Degrees Celsius (%u)", (float)v/10.0, v);
2477 }
2478
2479 static const value_string mbim_adpclk_activate_state_vals[] = {
2480 { 0, "Deactivate"},
2481 { 1, "Activate"},
2482 { 0, NULL}
2483 };
2484
2485 static const value_string mbim_connect_status_vals[] = {
2486 { 0, "Disconnected from the Base Station"},
2487 { 1, "Connected to the Base Station"},
2488 { 0, NULL}
2489 };
2490
2491 static const value_string mbim_trace_config_vals[] = {
2492 { 0, "Tracing disabled"},
2493 { 1, "Default configuration for tracing"},
2494 { 0, NULL}
2495 };
2496
2497 static const value_string mbim_ber_vals[] = {
2498 { 0, "BER < 0,2%%"},
2499 { 1, "0,2%% < BER < 0,4%%"},
2500 { 2, "0,4%% < BER < 0,8%%"},
2501 { 3, "0,8%% < BER < 1,6%%"},
2502 { 4, "1,6%% < BER < 3,2%%"},
2503 { 5, "3,2%% < BER < 6,4%%"},
2504 { 6, "6,4%% < BER < 12,8%%"},
2505 { 7, "12,8%% < BER"},
2506 { 99, "Unknown or undetectable"},
2507 { 0, NULL}
2508 };
2509
2510 static void
mbim_rscp_fmt(gchar * s,guint32 val)2511 mbim_rscp_fmt(gchar *s, guint32 val)
2512 {
2513 if (val == 0) {
2514 g_snprintf(s, ITEM_LABEL_LENGTH, "-120 or less dBm (0)");
2515 } else if (val < 96) {
2516 g_snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -120 + val, val);
2517 } else if (val == 96) {
2518 g_snprintf(s, ITEM_LABEL_LENGTH, "-24 or greater dBm (96)");
2519 } else if (val == 255) {
2520 g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)");
2521 } else {
2522 g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val);
2523 }
2524 }
2525
2526 static void
mbim_ecno_fmt(gchar * s,guint32 val)2527 mbim_ecno_fmt(gchar *s, guint32 val)
2528 {
2529 if (val == 0) {
2530 g_snprintf(s, ITEM_LABEL_LENGTH, "-24 or less dBm (0)");
2531 } else if (val < 49) {
2532 g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f dBm (%u)", -24 + ((float)val/2), val);
2533 } else if (val == 49) {
2534 g_snprintf(s, ITEM_LABEL_LENGTH, "0.5 or greater dBm (49)");
2535 } else if (val == 255) {
2536 g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)");
2537 } else {
2538 g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val);
2539 }
2540 }
2541
2542 static void
mbim_rsrq_fmt(gchar * s,guint32 val)2543 mbim_rsrq_fmt(gchar *s, guint32 val)
2544 {
2545 if (val == 0) {
2546 g_snprintf(s, ITEM_LABEL_LENGTH, "-19.5 or less dBm (0)");
2547 } else if (val < 34) {
2548 g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f dBm (%u)", -19.5 + ((float)val/2), val);
2549 } else if (val == 34) {
2550 g_snprintf(s, ITEM_LABEL_LENGTH, "-2.5 or greater dBm (34)");
2551 } else if (val == 255) {
2552 g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)");
2553 } else {
2554 g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val);
2555 }
2556 }
2557
2558 static void
mbim_rsrp_fmt(gchar * s,guint32 val)2559 mbim_rsrp_fmt(gchar *s, guint32 val)
2560 {
2561 if (val == 0) {
2562 g_snprintf(s, ITEM_LABEL_LENGTH, "-140 or less dBm (0)");
2563 } else if (val < 97) {
2564 g_snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -140 + val, val);
2565 } else if (val == 97) {
2566 g_snprintf(s, ITEM_LABEL_LENGTH, "-43 or greater dBm (97)");
2567 } else if (val == 255) {
2568 g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)");
2569 } else {
2570 g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val);
2571 }
2572 }
2573
2574 static void
mbim_rssnr_fmt(gchar * s,guint32 val)2575 mbim_rssnr_fmt(gchar *s, guint32 val)
2576 {
2577 if (val == 0) {
2578 g_snprintf(s, ITEM_LABEL_LENGTH, "-5 or less dB (0)");
2579 } else if (val < 35) {
2580 g_snprintf(s, ITEM_LABEL_LENGTH, "%d dB (%u)", -5 + val, val);
2581 } else if (val == 35) {
2582 g_snprintf(s, ITEM_LABEL_LENGTH, "30 or greater dB (35)");
2583 } else if (val == 255) {
2584 g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)");
2585 } else {
2586 g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val);
2587 }
2588 }
2589
2590 static void
mbim_rsrp_signal_state_fmt(gchar * s,guint32 val)2591 mbim_rsrp_signal_state_fmt(gchar *s, guint32 val)
2592 {
2593 if (val == 0) {
2594 g_snprintf(s, ITEM_LABEL_LENGTH, "SS-RSRP < -156dBm (0)");
2595 } else if (val < 126) {
2596 g_snprintf(s, ITEM_LABEL_LENGTH, "%ddBm <= SS-RSRP < %ddBm (%u)", val - 157, val - 156, val);
2597 } else if (val == 126) {
2598 g_snprintf(s, ITEM_LABEL_LENGTH, "-31dBm <= SS-RSRP (126)");
2599 } else {
2600 g_snprintf(s, ITEM_LABEL_LENGTH, "invalid (127)");
2601 }
2602 }
2603
2604 static void
mbim_snr_signal_state_fmt(gchar * s,guint32 val)2605 mbim_snr_signal_state_fmt(gchar *s, guint32 val)
2606 {
2607 if (val == 0) {
2608 g_snprintf(s, ITEM_LABEL_LENGTH, "SS-SINR < -23dB (0)");
2609 } else if (val < 127) {
2610 g_snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB <= SS-SINR < %.1fdB (%u)", (((float)val - 1) / 2) - 23, ((float)val / 2) - 23, val);
2611 } else if (val == 127){
2612 g_snprintf(s, ITEM_LABEL_LENGTH, "40dB <= SS-SINR (127)");
2613 } else {
2614 g_snprintf(s, ITEM_LABEL_LENGTH, "invalid (128)");
2615 }
2616 }
2617
2618 static void
mbim_version_fmt(gchar * s,guint32 val)2619 mbim_version_fmt(gchar* s, guint32 val)
2620 {
2621 g_snprintf(s, ITEM_LABEL_LENGTH, "%u.%u", val / 256, val % 256);
2622 }
2623
2624 static const value_string mbim_atds_operator_plmn_mode_vals[] = {
2625 { 0, "GSM"},
2626 { 6, "UTRAN"},
2627 { 7, "LTE"},
2628 { 0, NULL}
2629 };
2630
2631 static const value_string mbim_adts_rat_info_mode_vals[]= {
2632 { 0, "Automatic"},
2633 { 1, "2G only"},
2634 { 2, "3G only"},
2635 { 3, "4G only"},
2636 { 0, NULL}
2637 };
2638
2639 static const value_string mbim_adts_projection_table_type_vals[]= {
2640 { 0, "RSSI"},
2641 { 1, "RSCP"},
2642 { 2, "Ec/No"},
2643 { 3, "RSRP"},
2644 { 7, "RS SNR"},
2645 { 0, NULL}
2646 };
2647
2648 static void
mbim_projection_table_coeff_fmt(gchar * s,guint32 val)2649 mbim_projection_table_coeff_fmt(gchar *s, guint32 val)
2650 {
2651 gint32 coeff = (gint32)val;
2652
2653 g_snprintf(s, ITEM_LABEL_LENGTH, "%.3f (%d)", ((float)coeff)/1000, coeff);
2654 }
2655
2656 #define MBIM_NDP_CTRL_MULTIFLOW_STATUS 0
2657
2658 static const value_string mbim_ndp_ctrl_msg_type_vals[] = {
2659 { MBIM_NDP_CTRL_MULTIFLOW_STATUS, "MULTIFLOW_STATUS"},
2660 { 0, NULL}
2661 };
2662
2663 static const value_string mbim_ndp_ctrl_multiflow_status_vals[] = {
2664 { 0, "OK"},
2665 { 1, "High Watermark"},
2666 { 2, "Low Watermark"},
2667 { 0, NULL}
2668 };
2669
2670 static int * const mbim_multiflow_caps_info_control_caps_fields[] = {
2671 &hf_mbim_multiflow_caps_info_control_caps_uplink,
2672 &hf_mbim_multiflow_caps_info_control_caps_downlink,
2673 NULL
2674 };
2675
2676 static const value_string mbim_multiflow_state_vals[] = {
2677 { 0, "Off"},
2678 { 1, "On"},
2679 { 0, NULL}
2680 };
2681
2682 static const value_string mbim_ms_context_roaming_control_vals[] = {
2683 { 0, "HomeOnly"},
2684 { 1, "PartnerOnly"},
2685 { 2, "NonPartnerOnly"},
2686 { 3, "HomeAndPartner"},
2687 { 4, "HomeAndNonPartner"},
2688 { 5, "PartnerAndNonPartner"},
2689 { 6, "AllowAll"},
2690 { 0, NULL}
2691 };
2692
2693 static const value_string mbim_ms_context_media_type_vals[] = {
2694 { 0, "CellularOnly"},
2695 { 1, "WifiOnly"},
2696 { 2, "All"},
2697 { 0, NULL}
2698 };
2699
2700 static const value_string mbim_ms_context_enable_vals[] = {
2701 { 0, "Disabled"},
2702 { 1, "Enabled"},
2703 { 0, NULL}
2704 };
2705
2706 static const value_string mbim_ms_context_source_vals[] = {
2707 { 0, "Admin"},
2708 { 1, "User"},
2709 { 2, "Operator"},
2710 { 3, "Modem"},
2711 { 4, "Device"},
2712 { 0, NULL}
2713 };
2714
2715 static const value_string mbim_ms_context_operations_vals[] = {
2716 { 0, "Default"},
2717 { 1, "Delete"},
2718 { 2, "RestoreFactory"},
2719 { 0, NULL}
2720 };
2721
2722 static int * const mbim_ms_network_blacklist_state_fields[] = {
2723 &hf_mbim_ms_network_blacklist_state_sim_provider_actuated,
2724 &hf_mbim_ms_network_blacklist_state_network_provider_actuated,
2725 NULL
2726 };
2727
2728 static const value_string mbim_ms_network_blacklist_type_vals[] = {
2729 { 0, "SIM"},
2730 { 1, "Network"},
2731 { 0, NULL}
2732 };
2733
2734 static const value_string mbim_ms_uiccslot_state_vals[] = {
2735 { 0, "Unknown"},
2736 { 1, "OffEmpty"},
2737 { 2, "Off"},
2738 { 3, "Empty"},
2739 { 4, "NotReady"},
2740 { 5, "Active"},
2741 { 6, "Error"},
2742 { 7, "ActiveEsim"},
2743 { 8, "ActiveEsimNoProfiles"},
2744 { 0, NULL}
2745 };
2746
2747 static const value_string mbim_ms_uicc_app_type_vals[] = {
2748 { 0, "Unknown"},
2749 { 1, "Mf"},
2750 { 2, "SIM"},
2751 { 3, "RUIM"},
2752 { 4, "USIM"},
2753 { 5, "CSIM"},
2754 { 6, "ISIM"},
2755 { 0, NULL}
2756 };
2757
2758 static const value_string mbim_uicc_file_accessibility_vals[] = {
2759 { 0, "Unknown"},
2760 { 1, "NotShareable"},
2761 { 2, "Shareable"},
2762 { 0, NULL}
2763 };
2764
2765 static const value_string mbim_uicc_file_type_vals[] = {
2766 { 0, "Unknown"},
2767 { 1, "WorkingEf"},
2768 { 2, "InternalEf"},
2769 { 3, "DfOrAdf"},
2770 { 0, NULL}
2771 };
2772
2773 static const value_string mbim_uicc_file_structure_vals[] = {
2774 { 0, "Unknown"},
2775 { 1, "Transparent"},
2776 { 2, "Cyclic"},
2777 { 3, "Linear"},
2778 { 4, "BerTLV"},
2779 { 0, NULL}
2780 };
2781
2782 static guint8
mbim_dissect_service_id_uuid(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint hf,gint * offset,struct mbim_uuid_ext ** uuid_ext_info,gboolean is_net_guid)2783 mbim_dissect_service_id_uuid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint hf,
2784 gint *offset, struct mbim_uuid_ext **uuid_ext_info, gboolean is_net_guid)
2785 {
2786 e_guid_t uuid;
2787 guint i;
2788 guint32 uuid_ext[4];
2789
2790 if (is_net_guid)
2791 {
2792 tvb_get_ntohguid(tvb, *offset, &uuid);
2793 }
2794 else
2795 {
2796 tvb_get_letohguid(tvb, *offset, &uuid);
2797 }
2798 for (i = 0; i < UUID_MAX; i++) {
2799 if (memcmp(&uuid, &(mbim_uuid_service_id_vals[i].uuid), sizeof(e_guid_t)) == 0) {
2800 break;
2801 }
2802 }
2803
2804 if ((i == UUID_MAX) && mbim_uuid_ext_hash && uuid_ext_info) {
2805 /* Let's check if UUID is known in extension table */
2806 uuid_ext[0] = tvb_get_ntohl(tvb, *offset);
2807 uuid_ext[1] = tvb_get_ntohl(tvb, *offset + 4);
2808 uuid_ext[2] = tvb_get_ntohl(tvb, *offset + 8);
2809 uuid_ext[3] = tvb_get_ntohl(tvb, *offset + 12);
2810
2811 *uuid_ext_info = (struct mbim_uuid_ext *)wmem_map_lookup(mbim_uuid_ext_hash, uuid_ext);
2812 if (*uuid_ext_info) {
2813 proto_tree_add_guid_format_value(tree, hf, tvb, *offset, 16, &uuid, "%s (%s)",
2814 (*uuid_ext_info)->uuid_name, guid_to_str(pinfo->pool, &uuid));
2815 *offset += 16;
2816 return UUID_EXT_IDX;
2817 }
2818 }
2819
2820 proto_tree_add_guid_format_value(tree, hf, tvb, *offset, 16, &uuid, "%s (%s)",
2821 val_to_str_ext_const(i, &mbim_service_id_vals_ext, "Unknown"),
2822 guid_to_str(pinfo->pool, &uuid));
2823 *offset += 16;
2824
2825 return i;
2826 }
2827
2828 static guint32
mbim_dissect_cid(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint * offset,guint8 uuid_idx,struct mbim_uuid_ext * uuid_ext_info)2829 mbim_dissect_cid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset, guint8 uuid_idx,
2830 struct mbim_uuid_ext *uuid_ext_info)
2831 {
2832 guint32 cid;
2833
2834 cid = tvb_get_letohl(tvb, *offset);
2835 if (uuid_idx < UUID_MAX) {
2836 proto_tree_add_uint(tree, *mbim_uuid_info[uuid_idx].hf_entry, tvb, *offset, 4, cid);
2837 if (mbim_uuid_info[uuid_idx].cid_list_ext) {
2838 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
2839 val_to_str_ext_const(cid, mbim_uuid_info[uuid_idx].cid_list_ext, "Unknown"));
2840 } else {
2841 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_info[uuid_idx].cid_list, "Unknown"));
2842 }
2843 } else if (uuid_idx == UUID_EXT_IDX) {
2844 const gchar* cid_string = val_to_str_const(cid, uuid_ext_info->uuid_cid_list, "Unknown");
2845
2846 proto_tree_add_uint_format_value(tree, hf_mbim_cid, tvb, *offset, 4, cid, "%s (%u)", cid_string , cid);
2847 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", cid_string);
2848 } else {
2849 proto_tree_add_uint(tree, hf_mbim_cid, tvb, *offset, 4, cid);
2850 col_append_str(pinfo->cinfo, COL_INFO, ": Unknown");
2851 }
2852 *offset += 4;
2853 return cid;
2854 }
2855
2856 static void
mbim_dissect_ms_plmn(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)2857 mbim_dissect_ms_plmn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2858 {
2859 gint16 mnc;
2860 proto_tree_add_item(tree, hf_mbim_ms_plmn_mcc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2861 offset += 2;
2862 mnc = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN);
2863 if (mnc & 0x8000)
2864 {
2865 proto_tree_add_uint_format_value(tree, hf_mbim_ms_plmn_mnc, tvb, offset, 2, mnc, "%02u", mnc & 0x7fff);
2866 }
2867 else
2868 {
2869 proto_tree_add_uint_format_value(tree, hf_mbim_ms_plmn_mnc, tvb, offset, 2, mnc, "%03u", mnc & 0x7fff);
2870 }
2871 /* offset += 2; */
2872 }
2873
2874 static void
mbim_dissect_ms_tai_list_single_plmn(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint * offset)2875 mbim_dissect_ms_tai_list_single_plmn(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint* offset)
2876 {
2877 guint32 tac_element, i;
2878 mbim_dissect_ms_plmn(tvb, pinfo, tree, *offset);
2879 *offset += 4;
2880 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_tai_list_single_plmn_tac_element, tvb, *offset, 1, ENC_LITTLE_ENDIAN, &tac_element);
2881 *offset += 1;
2882 for (i = 0; i < tac_element; i++)
2883 {
2884 proto_tree_add_item(tree, hf_mbim_ms_tai_tac, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
2885 *offset += 4;
2886 }
2887 }
2888
2889 static void
mbim_dissect_ms_tai_list_multi_plmn(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint * offset)2890 mbim_dissect_ms_tai_list_multi_plmn(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint* offset)
2891 {
2892 proto_tree* subtree;
2893 guint32 tai_element, i;
2894 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_tai_list_multi_plmn_tai_element, tvb, *offset, 1, ENC_LITTLE_ENDIAN, &tai_element);
2895 *offset += 1;
2896 for (i = 0; i < tai_element; i++)
2897 {
2898 subtree = proto_tree_add_subtree_format(tree, tvb, *offset, 0, ett_mbim_pair_list, NULL, "TAI #%u", i + 1);
2899 mbim_dissect_ms_plmn(tvb, pinfo, subtree, *offset);
2900 *offset += 4;
2901 proto_tree_add_item(subtree, hf_mbim_ms_tai_tac, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
2902 *offset += 4;
2903 }
2904 }
2905
2906 static void
mbim_dissect_ms_tai(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,guint32 data_len)2907 mbim_dissect_ms_tai(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, guint32 data_len)
2908 {
2909 proto_tree* subtree;
2910 gint32 base_offset = offset;
2911 gint32 tai_list_info_element_pos = 1;
2912 guint32 tai_list_type;
2913 while ((guint32)offset - base_offset < data_len)
2914 {
2915 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "TAI List Info #%u", tai_list_info_element_pos);
2916 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_tai_list_type, tvb, offset, 1, ENC_LITTLE_ENDIAN, &tai_list_type);
2917 offset += 1;
2918 switch (tai_list_type)
2919 {
2920 case 0:
2921 case 1:
2922 mbim_dissect_ms_tai_list_single_plmn(tvb, pinfo, subtree, &offset);
2923 break;
2924 case 2:
2925 mbim_dissect_ms_tai_list_multi_plmn(tvb, pinfo, subtree, &offset);
2926 break;
2927 default:
2928 return;
2929 }
2930 tai_list_info_element_pos++;
2931 }
2932 }
2933
2934 static void
mbim_dissect_ms_wake_command(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)2935 mbim_dissect_ms_wake_command(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset)
2936 {
2937 guint8 uuid_idx;
2938 struct mbim_uuid_ext *uuid_ext_info = NULL;
2939 guint payload_offset;
2940 guint32 payload_size;
2941 proto_tree *wake_command_tree;
2942
2943 gint begin_offset = offset;
2944
2945 wake_command_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Wake Command");
2946
2947 uuid_idx = mbim_dissect_service_id_uuid(tvb, pinfo, wake_command_tree, hf_mbim_device_service_id, &offset, &uuid_ext_info, TRUE);
2948 mbim_dissect_cid(tvb, pinfo, wake_command_tree, &offset, uuid_idx, uuid_ext_info);
2949 proto_tree_add_item_ret_uint(wake_command_tree, hf_mbim_ms_wake_reason_command_payload_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &payload_offset);
2950 offset += 4;
2951 proto_tree_add_item_ret_uint(wake_command_tree, hf_mbim_ms_wake_reason_command_payload_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &payload_size);
2952 offset += 4;
2953 if (payload_offset && payload_size)
2954 {
2955 proto_tree_add_bytes_format(wake_command_tree, hf_mbim_ms_wake_reason_command_payload, tvb, begin_offset + payload_offset, payload_size, NULL, "Payload");
2956 }
2957 }
2958
2959 static void
mbim_dissect_ms_wake_packet(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)2960 mbim_dissect_ms_wake_packet(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset)
2961 {
2962 guint packet_offset;
2963 guint packet_size;
2964 proto_tree *wake_packet_tree;
2965 gint begin_offset = offset;
2966
2967 wake_packet_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Wake Packet");
2968
2969 proto_tree_add_item(wake_packet_tree, hf_mbim_single_packet_filter_filter_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2970 offset += 4;
2971 proto_tree_add_item(wake_packet_tree, hf_mbim_ms_wake_reason_packet_original_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2972 offset += 4;
2973 proto_tree_add_item_ret_uint(wake_packet_tree, hf_mbim_ms_wake_reason_packet_saved_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &packet_offset);
2974 offset += 4;
2975 proto_tree_add_item_ret_uint(wake_packet_tree, hf_mbim_ms_wake_reason_packet_saved_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &packet_size);
2976 /* offset += 4; */
2977 if (packet_offset && packet_size)
2978 {
2979 proto_tree_add_bytes_format(wake_packet_tree, hf_mbim_ms_wake_reason_packet_saved_data, tvb, begin_offset + packet_offset, packet_size, NULL, "Saved Packet Data");
2980 }
2981 }
2982
2983 static void
mbim_dissect_tlv_ie(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint * offset)2984 mbim_dissect_tlv_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint *offset)
2985 {
2986 guint padding_length;
2987 guint data_length;
2988 guint tlv_type = TLV_TYPE_UNKNOWN;
2989
2990 proto_tree_add_item_ret_uint(tree, hf_mbim_tlv_ie_type, tvb, *offset, 2, ENC_LITTLE_ENDIAN, &tlv_type);
2991 *offset += 2;
2992 proto_tree_add_item(tree, hf_mbim_tlv_ie_reserved, tvb, *offset, 1, ENC_LITTLE_ENDIAN);
2993 *offset += 1;
2994 proto_tree_add_item_ret_uint(tree, hf_mbim_tlv_ie_padding_length, tvb, *offset, 1, ENC_LITTLE_ENDIAN, &padding_length);
2995 *offset += 1;
2996 proto_tree_add_item_ret_uint(tree, hf_mbim_tlv_ie_data_length, tvb, *offset, 4, ENC_LITTLE_ENDIAN, &data_length);
2997 *offset += 4;
2998 if (data_length) {
2999 // New TLV types will be added here
3000 switch (tlv_type) {
3001 case TLV_TYPE_TAI:
3002 mbim_dissect_ms_tai(tvb, pinfo, tree, *offset, data_length);
3003 break;
3004 case TLV_TYPE_WCHAR_STR:
3005 proto_tree_add_item(tree, hf_mbim_tlv_ie_data_wchar_str, tvb, *offset, data_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3006 break;
3007 case TLV_TYPE_WAKE_COMMAND:
3008 mbim_dissect_ms_wake_command(tvb, pinfo, tree, *offset);
3009 break;
3010 case TLV_TYPE_WAKE_PACKET:
3011 mbim_dissect_ms_wake_packet(tvb, pinfo, tree, *offset);
3012 break;
3013 default:
3014 proto_tree_add_item(tree, hf_mbim_tlv_ie_unnamed_data, tvb, *offset, data_length, ENC_NA);
3015 break;
3016 }
3017 *offset += data_length;
3018 }
3019 if (padding_length) {
3020 proto_tree_add_item(tree, hf_mbim_tlv_ie_padding, tvb, *offset, padding_length, ENC_LITTLE_ENDIAN);
3021 *offset += padding_length;
3022 }
3023 }
3024
3025 static void
mbim_dissect_device_caps_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)3026 mbim_dissect_device_caps_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset,
3027 struct mbim_conv_info *mbim_conv)
3028 {
3029 gint base_offset;
3030 guint32 custom_class_offset, custom_class_size, device_id_offset, device_id_size,
3031 fw_info_offset, fw_info_size, hw_info_offset, hw_info_size;
3032 proto_item *it;
3033
3034 base_offset = offset;
3035 proto_tree_add_item(tree, hf_mbim_device_caps_info_device_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3036 offset += 4;
3037 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_cellular_class, tvb, offset, 4,
3038 ENC_LITTLE_ENDIAN, &mbim_conv->cellular_class);
3039 offset += 4;
3040 proto_tree_add_item(tree, hf_mbim_device_caps_info_voice_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3041 offset += 4;
3042 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_sim_class, ett_mbim_bitmap,
3043 mbim_device_caps_info_sim_class_fields, ENC_LITTLE_ENDIAN);
3044 offset += 4;
3045 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_data_class, ett_mbim_bitmap,
3046 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
3047 offset += 4;
3048 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_sms_caps, ett_mbim_bitmap,
3049 mbim_device_caps_info_sms_caps_fields, ENC_LITTLE_ENDIAN);
3050 offset += 4;
3051 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_control_caps, ett_mbim_bitmap,
3052 mbim_device_caps_info_control_caps_fields, ENC_LITTLE_ENDIAN);
3053 offset += 4;
3054 proto_tree_add_item(tree, hf_mbim_device_caps_info_max_sessions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3055 offset += 4;
3056 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_custom_data_class_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &custom_class_offset);
3057 offset += 4;
3058 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_custom_data_class_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &custom_class_size);
3059 offset += 4;
3060 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_device_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &device_id_offset);
3061 offset += 4;
3062 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_device_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &device_id_size);
3063 offset += 4;
3064 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_fw_info_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &fw_info_offset);
3065 offset += 4;
3066 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_fw_info_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &fw_info_size);
3067 offset += 4;
3068 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_hw_info_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &hw_info_offset);
3069 offset += 4;
3070 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_hw_info_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &hw_info_size);
3071 /*offset += 4;*/
3072 if (custom_class_offset && custom_class_size) {
3073 it = proto_tree_add_item(tree, hf_mbim_device_caps_info_custom_data_class, tvb, base_offset + custom_class_offset,
3074 custom_class_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3075 if (custom_class_size > 22) {
3076 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3077 }
3078 }
3079 if (device_id_offset && device_id_size) {
3080 it = proto_tree_add_item(tree, hf_mbim_device_caps_info_device_id, tvb, base_offset + device_id_offset,
3081 device_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3082 if ((mbim_conv->cellular_class == MBIM_CELLULAR_CLASS_GSM) && (device_id_size > 30)) {
3083 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3084 } else if (device_id_size > 36) {
3085 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3086 }
3087 }
3088 if (fw_info_offset && fw_info_size) {
3089 it = proto_tree_add_item(tree, hf_mbim_device_caps_info_fw_info, tvb, base_offset + fw_info_offset,
3090 fw_info_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3091 if (fw_info_size > 60) {
3092 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3093 }
3094 }
3095 if (hw_info_offset && hw_info_size) {
3096 it = proto_tree_add_item(tree, hf_mbim_device_caps_info_hw_info, tvb, base_offset + hw_info_offset,
3097 hw_info_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3098 if (hw_info_size > 60) {
3099 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3100 }
3101 }
3102 }
3103
3104 static void
mbim_dissect_subscriber_ready_status(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)3105 mbim_dissect_subscriber_ready_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
3106 struct mbim_conv_info *mbim_conv)
3107 {
3108 proto_tree *subtree;
3109 gint base_offset;
3110 guint32 i, subscriber_id_offset, subscriber_id_size, sim_icc_id_offset, sim_icc_id_size, elem_count;
3111 proto_item *it;
3112 wmem_array_t *pair_list = NULL;
3113 struct mbim_pair_list pair_list_item, *p_pair_list_item;
3114
3115 base_offset = offset;
3116 proto_tree_add_item(tree, hf_mbim_subscr_ready_status_ready_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3117 offset += 4;
3118 if (SHOULD_MBIM_EX3_BE_APPLIED(mbim_conv)) {
3119 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_subscr_ready_status_flags, ett_mbim_bitmap,
3120 mbim_subscr_ready_status_flags_fields, ENC_LITTLE_ENDIAN);
3121 offset += 4;
3122 }
3123 proto_tree_add_item_ret_uint(tree, hf_mbim_subscr_ready_status_susbcr_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &subscriber_id_offset);
3124 offset += 4;
3125 proto_tree_add_item_ret_uint(tree, hf_mbim_subscr_ready_status_susbcr_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &subscriber_id_size);
3126 offset += 4;
3127 proto_tree_add_item_ret_uint(tree, hf_mbim_subscr_ready_status_sim_icc_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &sim_icc_id_offset);
3128 offset += 4;
3129 proto_tree_add_item_ret_uint(tree, hf_mbim_subscr_ready_status_sim_icc_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &sim_icc_id_size);
3130 offset += 4;
3131 proto_tree_add_item(tree, hf_mbim_subscr_ready_status_ready_info, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3132 offset += 4;
3133 proto_tree_add_item_ret_uint(tree, hf_mbim_subscr_ready_status_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
3134 offset += 4;
3135 if (elem_count) {
3136 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
3137 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Telephone Numbers Ref List");
3138 for (i = 0; i < elem_count; i++) {
3139 proto_tree_add_item_ret_uint(subtree, hf_mbim_subscr_ready_status_tel_nb_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
3140 offset += 4;
3141 proto_tree_add_item_ret_uint(subtree, hf_mbim_subscr_ready_status_tel_nb_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
3142 offset += 4;
3143 wmem_array_append_one(pair_list, pair_list_item);
3144 }
3145 }
3146 if (subscriber_id_offset && subscriber_id_size) {
3147 it = proto_tree_add_item(tree, hf_mbim_subscr_ready_status_susbcr_id, tvb, base_offset + subscriber_id_offset,
3148 subscriber_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3149 if ((mbim_conv->cellular_class == MBIM_CELLULAR_CLASS_CDMA) && (subscriber_id_size > 20)) {
3150 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3151 } else if (subscriber_id_size > 30) {
3152 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3153 }
3154 }
3155 if (sim_icc_id_offset && sim_icc_id_size) {
3156 it = proto_tree_add_item(tree, hf_mbim_subscr_ready_status_sim_icc_id, tvb, base_offset + sim_icc_id_offset,
3157 sim_icc_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3158 if (sim_icc_id_size > 40) {
3159 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3160 }
3161 }
3162 for (i = 0; i < elem_count; i++) {
3163 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
3164 if (p_pair_list_item->offset && p_pair_list_item->size) {
3165 it = proto_tree_add_item(tree, hf_mbim_subscr_ready_status_tel_nb, tvb, base_offset + p_pair_list_item->offset,
3166 p_pair_list_item->size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3167 if (p_pair_list_item->size > 44) {
3168 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3169 }
3170 }
3171 }
3172 }
3173
3174 static void
mbim_dissect_set_pin(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)3175 mbim_dissect_set_pin(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3176 {
3177 gint base_offset;
3178 guint32 pin_offset, pin_size, new_pin_offset, new_pin_size;
3179 proto_item *it;
3180
3181 base_offset = offset;
3182 proto_tree_add_item(tree, hf_mbim_set_pin_pin_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3183 offset += 4;
3184 proto_tree_add_item(tree, hf_mbim_set_pin_pin_pin_operation, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3185 offset += 4;
3186 proto_tree_add_item_ret_uint(tree, hf_mbim_set_pin_pin_pin_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pin_offset);
3187 offset += 4;
3188 proto_tree_add_item_ret_uint(tree, hf_mbim_set_pin_pin_pin_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pin_size);
3189 offset += 4;
3190 proto_tree_add_item_ret_uint(tree, hf_mbim_set_pin_new_pin_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &new_pin_offset);
3191 offset += 4;
3192 proto_tree_add_item_ret_uint(tree, hf_mbim_set_pin_new_pin_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &new_pin_size);
3193 /*offset += 4;*/
3194 if (pin_offset && pin_size) {
3195 it = proto_tree_add_item(tree, hf_mbim_set_pin_pin, tvb, base_offset + pin_offset,
3196 pin_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3197 if (pin_size > 32) {
3198 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3199 }
3200 }
3201 if (new_pin_offset && new_pin_size) {
3202 it = proto_tree_add_item(tree, hf_mbim_set_pin_new_pin, tvb, base_offset + new_pin_offset,
3203 new_pin_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3204 if (new_pin_size > 32) {
3205 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3206 }
3207 }
3208 }
3209
3210 static void
mbim_dissect_pin_list_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)3211 mbim_dissect_pin_list_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3212 {
3213 const char *pin_list[10] = { "PIN 1", "PIN 2", "Device SIM PIN", "Device First SIM PIN", "Network PIN",
3214 "Network Subset PIN", "Service Provider PIN", "Corporate PIN", "Subsidy Lock",
3215 "Custom"};
3216 guint i;
3217 guint32 length;
3218 proto_tree *subtree;
3219
3220 for (i = 0; i < 10; i++) {
3221 subtree = proto_tree_add_subtree(tree, tvb, offset, 16, ett_mbim_pin, NULL, pin_list[i]);
3222 proto_tree_add_item(subtree, hf_mbim_pin_list_pin_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3223 offset += 4;
3224 proto_tree_add_item(subtree, hf_mbim_pin_list_pin_format, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3225 offset += 4;
3226 length = tvb_get_letohl(tvb, offset);
3227 if (length == 0xffffffff) {
3228 proto_tree_add_uint_format_value(subtree, hf_mbim_pin_list_pin_length_min, tvb, offset, 4,
3229 length, "Not available (0xffffffff)");
3230 } else {
3231 proto_tree_add_uint(subtree, hf_mbim_pin_list_pin_length_min, tvb, offset, 4, length);
3232 }
3233 offset += 4;
3234 length = tvb_get_letohl(tvb, offset);
3235 if (length == 0xffffffff) {
3236 proto_tree_add_uint_format_value(subtree, hf_mbim_pin_list_pin_length_max, tvb, offset, 4,
3237 length, "Not available (0xffffffff)");
3238 } else {
3239 proto_tree_add_uint(subtree, hf_mbim_pin_list_pin_length_max, tvb, offset, 4, length);
3240 }
3241 offset += 4;
3242 }
3243 }
3244
3245 static void
mbim_dissect_provider(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)3246 mbim_dissect_provider(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3247 {
3248 gint base_offset;
3249 guint32 provider_id_offset, provider_id_size, provider_name_offset, provider_name_size;
3250 proto_item *it;
3251
3252 base_offset = offset;
3253 proto_tree_add_item_ret_uint(tree, hf_mbim_provider_provider_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_offset);
3254 offset += 4;
3255 proto_tree_add_item_ret_uint(tree, hf_mbim_provider_provider_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_size);
3256 offset += 4;
3257 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_provider_state, ett_mbim_bitmap,
3258 mbim_provider_state_fields, ENC_LITTLE_ENDIAN);
3259 offset += 4;
3260 proto_tree_add_item_ret_uint(tree, hf_mbim_provider_provider_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_name_offset);
3261 offset += 4;
3262 proto_tree_add_item_ret_uint(tree, hf_mbim_provider_provider_name_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_name_size);
3263 offset += 4;
3264 proto_tree_add_item (tree, hf_mbim_provider_cellular_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3265 offset += 4;
3266 proto_tree_add_item (tree, hf_mbim_provider_rssi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3267 offset += 4;
3268 proto_tree_add_item (tree, hf_mbim_provider_error_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3269 /*offset += 4;*/
3270 if (provider_id_offset && provider_id_size) {
3271 it = proto_tree_add_item(tree, hf_mbim_provider_provider_id, tvb, base_offset + provider_id_offset,
3272 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3273 if (provider_id_size > 12) {
3274 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3275 }
3276 }
3277 if (provider_name_offset && provider_name_size) {
3278 it = proto_tree_add_item(tree, hf_mbim_provider_provider_name, tvb, base_offset + provider_name_offset,
3279 provider_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3280 if (provider_name_size > 40) {
3281 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3282 }
3283 }
3284 }
3285
3286 static void
mbim_dissect_providers(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)3287 mbim_dissect_providers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3288 {
3289 proto_tree *subtree;
3290 gint base_offset;
3291 guint32 i, elem_count;
3292 wmem_array_t *pair_list;
3293 struct mbim_pair_list pair_list_item, *p_pair_list_item;
3294
3295 base_offset = offset;
3296 proto_tree_add_item_ret_uint(tree, hf_mbim_providers_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
3297 offset += 4;
3298 if (elem_count) {
3299 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
3300 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Providers Ref List");
3301 for (i = 0; i < elem_count; i++) {
3302 proto_tree_add_item_ret_uint(subtree, hf_mbim_providers_provider_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
3303 offset += 4;
3304 proto_tree_add_item_ret_uint(subtree, hf_mbim_providers_provider_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
3305 offset += 4;
3306 wmem_array_append_one(pair_list, pair_list_item);
3307 }
3308 for (i = 0; i < elem_count; i++) {
3309 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
3310 if (p_pair_list_item->offset && p_pair_list_item->size) {
3311 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size,
3312 ett_mbim_pair_list, NULL, "Provider #%u", i+1);
3313 mbim_dissect_provider(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset);
3314 }
3315 }
3316 }
3317 }
3318
3319 static void
mbim_dissect_set_register_state(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)3320 mbim_dissect_set_register_state(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3321 {
3322 gint base_offset;
3323 guint32 provider_id_offset, provider_id_size;
3324 proto_item *it;
3325
3326 base_offset = offset;
3327 proto_tree_add_item_ret_uint(tree, hf_mbim_set_register_state_provider_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_offset);
3328 offset += 4;
3329 proto_tree_add_item_ret_uint(tree, hf_mbim_set_register_state_provider_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_size);
3330 offset += 4;
3331 proto_tree_add_item(tree, hf_mbim_set_register_state_register_action, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3332 offset += 4;
3333 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_register_state_data_class, ett_mbim_bitmap,
3334 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
3335 /*offset += 4;*/
3336 if (provider_id_offset && provider_id_size) {
3337 it = proto_tree_add_item(tree, hf_mbim_set_register_state_provider_id, tvb, base_offset + provider_id_offset,
3338 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3339 if (provider_id_size > 12) {
3340 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3341 }
3342 }
3343 }
3344
3345 static void
mbim_dissect_registration_state_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)3346 mbim_dissect_registration_state_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, struct mbim_conv_info* mbim_conv)
3347 {
3348 gint base_offset;
3349 guint32 provider_id_offset, provider_id_size, provider_name_offset, provider_name_size,
3350 roaming_text_offset, roaming_text_size, nw_error;
3351 proto_item *it;
3352
3353 base_offset = offset;
3354 nw_error = tvb_get_letohl(tvb, offset);
3355 if (nw_error == 0) {
3356 proto_tree_add_uint_format_value(tree, hf_mbim_registration_state_info_nw_error, tvb, offset, 4, nw_error, "Success (0)");
3357 } else {
3358 proto_tree_add_uint(tree, hf_mbim_registration_state_info_nw_error, tvb, offset, 4, nw_error);
3359 }
3360 offset += 4;
3361 proto_tree_add_item(tree, hf_mbim_registration_state_info_register_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3362 offset += 4;
3363 proto_tree_add_item(tree, hf_mbim_registration_state_info_register_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3364 offset += 4;
3365 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_registration_state_info_available_data_classes, ett_mbim_bitmap,
3366 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
3367 offset += 4;
3368 proto_tree_add_item(tree, hf_mbim_registration_state_info_current_cellular_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3369 offset += 4;
3370 proto_tree_add_item_ret_uint(tree, hf_mbim_registration_state_info_provider_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_offset);
3371 offset += 4;
3372 proto_tree_add_item_ret_uint(tree, hf_mbim_registration_state_info_provider_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_size);
3373 offset += 4;
3374 proto_tree_add_item_ret_uint(tree, hf_mbim_registration_state_info_provider_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_name_offset);
3375 offset += 4;
3376 proto_tree_add_item_ret_uint(tree, hf_mbim_registration_state_info_provider_name_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_name_size);
3377 offset += 4;
3378 proto_tree_add_item_ret_uint(tree, hf_mbim_registration_state_info_roaming_text_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &roaming_text_offset);
3379 offset += 4;
3380 proto_tree_add_item_ret_uint(tree, hf_mbim_registration_state_info_roaming_text_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &roaming_text_size);
3381 offset += 4;
3382 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_registration_state_info_registration_flags, ett_mbim_bitmap,
3383 mbim_registration_state_info_registration_flags_fields, ENC_LITTLE_ENDIAN);
3384 if (SHOULD_MBIM_EX2_AND_HIGHER_BE_APPLIED(mbim_conv)) {
3385 offset += 4;
3386 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_registration_state_info_preferred_data_class, ett_mbim_bitmap,
3387 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
3388 }
3389 /*offset += 4;*/
3390 if (provider_id_offset && provider_id_size) {
3391 it = proto_tree_add_item(tree, hf_mbim_registration_state_info_provider_id, tvb, base_offset + provider_id_offset,
3392 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3393 if (provider_id_size > 12) {
3394 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3395 }
3396 }
3397 if (provider_name_offset && provider_name_size) {
3398 it = proto_tree_add_item(tree, hf_mbim_registration_state_info_provider_name, tvb, base_offset + provider_name_offset,
3399 provider_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3400 if (provider_name_size > 40) {
3401 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3402 }
3403 }
3404 if (roaming_text_offset && roaming_text_size) {
3405 it = proto_tree_add_item(tree, hf_mbim_registration_state_info_roaming_text, tvb, base_offset + roaming_text_offset,
3406 roaming_text_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3407 if (roaming_text_size > 126) {
3408 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3409 }
3410 }
3411 }
3412
3413 static void
mbim_dissect_packet_service_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv,guint32 buffer_len)3414 mbim_dissect_packet_service_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, struct mbim_conv_info* mbim_conv, guint32 buffer_len)
3415 {
3416 proto_tree *tai_ie, *unnamed_ies;
3417 guint32 nw_error;
3418
3419 nw_error = tvb_get_letohl(tvb, offset);
3420 if (nw_error == 0) {
3421 proto_tree_add_uint_format_value(tree, hf_mbim_packet_service_info_nw_error, tvb, offset, 4, nw_error, "Success (0)");
3422 } else {
3423 proto_tree_add_uint(tree, hf_mbim_packet_service_info_nw_error, tvb, offset, 4, nw_error);
3424 }
3425 offset += 4;
3426 proto_tree_add_item(tree, hf_mbim_packet_service_info_packet_service_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3427 offset += 4;
3428 if (SHOULD_MBIM_EX2_AND_HIGHER_BE_APPLIED(mbim_conv)) {
3429 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_packet_service_info_current_data_class, ett_mbim_bitmap,
3430 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
3431 } else {
3432 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_packet_service_info_highest_available_data_class, ett_mbim_bitmap,
3433 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
3434 }
3435 offset += 4;
3436 proto_tree_add_item(tree, hf_mbim_packet_service_info_uplink_speed, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3437 offset += 8;
3438 proto_tree_add_item(tree, hf_mbim_packet_service_info_downlink_speed, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3439 offset += 8;
3440 if (SHOULD_MBIM_EX2_AND_HIGHER_BE_APPLIED(mbim_conv)) {
3441 proto_tree_add_item(tree, hf_mbim_packet_service_info_frequency_range, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3442 }
3443 if (SHOULD_MBIM_EX3_BE_APPLIED(mbim_conv)) {
3444 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_packet_service_info_data_subclass, ett_mbim_bitmap,
3445 mbim_data_subclass_fields, ENC_LITTLE_ENDIAN);
3446 offset += 4;
3447 tai_ie = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Tracking Area Identity");
3448 mbim_dissect_tlv_ie(tvb, pinfo, tai_ie, &offset);
3449 while ((guint32)offset < buffer_len) {
3450 unnamed_ies = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Unnamed IE's");
3451 mbim_dissect_tlv_ie(tvb, pinfo, unnamed_ies, &offset);
3452 }
3453 }
3454 }
3455
3456 static void
mbim_dissect_set_signal_state(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)3457 mbim_dissect_set_signal_state(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3458 {
3459 guint32 error_rate_threshold;
3460
3461 proto_tree_add_item(tree, hf_mbim_set_signal_state_signal_strength_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3462 offset += 4;
3463 proto_tree_add_item(tree, hf_mbim_set_signal_state_rssi_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3464 offset += 4;
3465 error_rate_threshold = tvb_get_letohl(tvb, offset);
3466 if (error_rate_threshold == 0xffffffff) {
3467 proto_tree_add_uint_format_value(tree, hf_mbim_set_signal_state_error_rate_threshold, tvb, offset, 4,
3468 error_rate_threshold, "No report (0xffffffff)");
3469 } else {
3470 proto_tree_add_item(tree, hf_mbim_set_signal_state_error_rate_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3471 }
3472 }
3473
3474 static void
mbim_dissect_signal_state_element(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)3475 mbim_dissect_signal_state_element(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3476 {
3477 proto_tree_add_item(tree, hf_mbim_signal_state_element_rsrp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3478 offset += 4;
3479 proto_tree_add_item(tree, hf_mbim_signal_state_element_snr, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3480 offset += 4;
3481 proto_tree_add_item(tree, hf_mbim_signal_state_element_rsrp_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3482 offset += 4;
3483 proto_tree_add_item(tree, hf_mbim_signal_state_element_snr_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3484 offset += 4;
3485 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_signal_state_element_system_type, ett_mbim_bitmap,
3486 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
3487 }
3488
3489 static void
mbim_dissect_signal_state_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)3490 mbim_dissect_signal_state_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, struct mbim_conv_info* mbim_conv)
3491 {
3492 proto_tree *subtree;
3493 gint base_offset;
3494 guint32 error_rate_threshold, rsrp_snr_offset, rsrp_snr_size, elem_count, i;
3495 const gint signal_state_elem_size = 20;
3496 base_offset = offset;
3497 proto_tree_add_item(tree, hf_mbim_signal_state_info_rssi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3498 offset += 4;
3499 proto_tree_add_item(tree, hf_mbim_signal_state_info_error_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3500 offset += 4;
3501 proto_tree_add_item(tree, hf_mbim_signal_state_info_signal_strength_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3502 offset += 4;
3503 proto_tree_add_item(tree, hf_mbim_signal_state_info_rssi_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3504 offset += 4;
3505 error_rate_threshold = tvb_get_letohl(tvb, offset);
3506 if (error_rate_threshold == 0xffffffff) {
3507 proto_tree_add_uint_format_value(tree, hf_mbim_signal_state_info_error_rate_threshold, tvb, offset, 4,
3508 error_rate_threshold, "No report (0xffffffff)");
3509 } else {
3510 proto_tree_add_item(tree, hf_mbim_signal_state_info_error_rate_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3511 }
3512 offset += 4;
3513 if (SHOULD_MBIM_EX2_AND_HIGHER_BE_APPLIED(mbim_conv)) {
3514 proto_tree_add_item_ret_uint(tree, hf_mbim_signal_state_info_rsrp_snr_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &rsrp_snr_offset);
3515 offset += 4;
3516 proto_tree_add_item_ret_uint(tree, hf_mbim_signal_state_info_rsrp_snr_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &rsrp_snr_size);
3517 if (rsrp_snr_offset && rsrp_snr_size) {
3518 offset += 4;
3519 proto_tree_add_item_ret_uint(tree, hf_mbim_signal_state_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
3520 offset = base_offset + rsrp_snr_offset;
3521 for (i = 0; i < elem_count; i++) {
3522 offset += signal_state_elem_size * i;
3523 subtree = proto_tree_add_subtree_format(tree, tvb, offset, signal_state_elem_size, ett_mbim_pair_list, NULL, "RSRP SNR Info #%u", i + 1);
3524 mbim_dissect_signal_state_element(tvb, pinfo, subtree, offset);
3525 }
3526 }
3527 }
3528 }
3529
3530 static guint8
mbim_dissect_context_type_uuid(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint * offset)3531 mbim_dissect_context_type_uuid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset)
3532 {
3533 e_guid_t uuid;
3534 guint i;
3535
3536 tvb_get_ntohguid(tvb, *offset, &uuid);
3537
3538 for (i = 0; i < array_length(mbim_uuid_context_type_vals); i++) {
3539 if (memcmp(&uuid, &(mbim_uuid_context_type_vals[i].uuid), sizeof(e_guid_t)) == 0) {
3540 break;
3541 }
3542 }
3543 proto_tree_add_guid_format_value(tree, hf_mbim_context_type, tvb, *offset, 16, &uuid, "%s (%s)",
3544 val_to_str_const(i, mbim_context_type_vals, "Unknown"), guid_to_str(pinfo->pool, &uuid));
3545 *offset += 16;
3546
3547 return i;
3548 }
3549
3550 static void
mbim_dissect_set_connect(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)3551 mbim_dissect_set_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3552 {
3553 gint base_offset;
3554 guint32 access_string_offset, access_string_size, user_name_offset, user_name_size,
3555 password_offset, password_size;
3556 proto_item *it;
3557
3558 base_offset = offset;
3559 proto_tree_add_item(tree, hf_mbim_set_connect_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3560 offset += 4;
3561 proto_tree_add_item(tree, hf_mbim_set_connect_activation_command, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3562 offset += 4;
3563 proto_tree_add_item_ret_uint(tree, hf_mbim_set_connect_access_string_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &access_string_offset);
3564 offset += 4;
3565 proto_tree_add_item_ret_uint(tree, hf_mbim_set_connect_access_string_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &access_string_size);
3566 offset += 4;
3567 proto_tree_add_item_ret_uint(tree, hf_mbim_set_connect_user_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &user_name_offset);
3568 offset += 4;
3569 proto_tree_add_item_ret_uint(tree, hf_mbim_set_connect_user_name_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &user_name_size);
3570 offset += 4;
3571 proto_tree_add_item_ret_uint(tree, hf_mbim_set_connect_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &password_offset);
3572 offset += 4;
3573 proto_tree_add_item_ret_uint(tree, hf_mbim_set_connect_password_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &password_size);
3574 offset += 4;
3575 proto_tree_add_item(tree, hf_mbim_set_connect_compression, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3576 offset += 4;
3577 proto_tree_add_item(tree, hf_mbim_set_connect_auth_protocol, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3578 offset += 4;
3579 proto_tree_add_item(tree, hf_mbim_set_connect_ip_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3580 offset += 4;
3581 mbim_dissect_context_type_uuid(tvb, pinfo, tree, &offset);
3582 if (access_string_offset && access_string_size) {
3583 it = proto_tree_add_item(tree, hf_mbim_set_connect_access_string, tvb, base_offset + access_string_offset,
3584 access_string_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3585 if (access_string_size > 200) {
3586 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3587 }
3588 }
3589 if (user_name_offset && user_name_size) {
3590 it = proto_tree_add_item(tree, hf_mbim_set_connect_user_name, tvb, base_offset + user_name_offset,
3591 user_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3592 if (user_name_size > 510) {
3593 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3594 }
3595 }
3596 if (password_offset && password_size) {
3597 it = proto_tree_add_item(tree, hf_mbim_set_connect_password, tvb, base_offset + password_offset,
3598 password_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3599 if (password_size > 510) {
3600 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3601 }
3602 }
3603 }
3604
3605 static void
mbim_dissect_set_connect_v3(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,guint32 buffer_len)3606 mbim_dissect_set_connect_v3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, guint32 buffer_len)
3607 {
3608 proto_tree *access_string, *user_name, *password, *unnamed_ies;
3609
3610 proto_tree_add_item(tree, hf_mbim_set_connect_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3611 offset += 4;
3612 proto_tree_add_item(tree, hf_mbim_set_connect_activation_command, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3613 offset += 4;
3614 proto_tree_add_item(tree, hf_mbim_set_connect_compression, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3615 offset += 4;
3616 proto_tree_add_item(tree, hf_mbim_set_connect_auth_protocol, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3617 offset += 4;
3618 proto_tree_add_item(tree, hf_mbim_set_connect_ip_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3619 offset += 4;
3620 mbim_dissect_context_type_uuid(tvb, pinfo, tree, &offset);
3621 proto_tree_add_item(tree, hf_mbim_set_connect_media_preference, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3622 offset += 4;
3623 access_string = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Access String");
3624 mbim_dissect_tlv_ie(tvb, pinfo, access_string, &offset);
3625 user_name = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "User Name");
3626 mbim_dissect_tlv_ie(tvb, pinfo, user_name, &offset);
3627 password = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Password");
3628 mbim_dissect_tlv_ie(tvb, pinfo, password, &offset);
3629 while ((guint32)offset < buffer_len) {
3630 unnamed_ies = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Unnamed IE's");
3631 mbim_dissect_tlv_ie(tvb, pinfo, unnamed_ies, &offset);
3632 }
3633 }
3634
3635 static void
mbim_dissect_connect_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv,guint32 buffer_len)3636 mbim_dissect_connect_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, struct mbim_conv_info* mbim_conv, guint32 buffer_len)
3637 {
3638 proto_tree *access_string, *unnamed_ies;
3639 guint32 nw_error;
3640
3641 proto_tree_add_item(tree, hf_mbim_connect_info_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3642 offset += 4;
3643 proto_tree_add_item(tree, hf_mbim_connect_info_activation_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3644 offset += 4;
3645 proto_tree_add_item(tree, hf_mbim_connect_info_voice_call_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3646 offset += 4;
3647 proto_tree_add_item(tree, hf_mbim_connect_info_ip_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3648 offset += 4;
3649 mbim_dissect_context_type_uuid(tvb, pinfo, tree, &offset);
3650 nw_error = tvb_get_letohl(tvb, offset);
3651 if (nw_error == 0) {
3652 proto_tree_add_uint_format_value(tree, hf_mbim_connect_info_nw_error, tvb, offset, 4, nw_error, "Success (0)");
3653 } else {
3654 proto_tree_add_uint(tree, hf_mbim_connect_info_nw_error, tvb, offset, 4, nw_error);
3655 }
3656 if (SHOULD_MBIM_EX3_BE_APPLIED(mbim_conv)) {
3657 offset += 4;
3658 proto_tree_add_item(tree, hf_mbim_connect_info_access_media, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3659 offset += 4;
3660 access_string = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Access String");
3661 mbim_dissect_tlv_ie(tvb, pinfo, access_string, &offset);
3662 while ((guint32)offset < buffer_len) {
3663 unnamed_ies = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Unnamed IE's");
3664 mbim_dissect_tlv_ie(tvb, pinfo, unnamed_ies, &offset);
3665 }
3666 }
3667 }
3668
3669 static void
mbim_dissect_context(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,gboolean is_set)3670 mbim_dissect_context(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, gboolean is_set)
3671 {
3672 gint base_offset;
3673 guint32 access_string_offset, access_string_size, user_name_offset, user_name_size,
3674 password_offset, password_size, provider_id_offset = 0, provider_id_size = 0;
3675 proto_item *it;
3676
3677 base_offset = offset;
3678 proto_tree_add_item(tree, hf_mbim_context_context_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3679 offset += 4;
3680 mbim_dissect_context_type_uuid(tvb, pinfo, tree, &offset);
3681 proto_tree_add_item_ret_uint(tree, hf_mbim_context_access_string_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &access_string_offset);
3682 offset += 4;
3683 proto_tree_add_item_ret_uint(tree, hf_mbim_context_access_string_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &access_string_size);
3684 offset += 4;
3685 proto_tree_add_item_ret_uint(tree, hf_mbim_context_user_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &user_name_offset);
3686 offset += 4;
3687 proto_tree_add_item_ret_uint(tree, hf_mbim_context_user_name_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &user_name_size);
3688 offset += 4;
3689 proto_tree_add_item_ret_uint(tree, hf_mbim_context_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &password_offset);
3690 offset += 4;
3691 proto_tree_add_item_ret_uint(tree, hf_mbim_context_password_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &password_size);
3692 offset += 4;
3693 proto_tree_add_item(tree, hf_mbim_context_compression, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3694 offset += 4;
3695 proto_tree_add_item(tree, hf_mbim_context_auth_protocol, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3696 offset += 4;
3697 if (is_set) {
3698 proto_tree_add_item_ret_uint(tree, hf_mbim_context_provider_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_offset);
3699 offset += 4;
3700 proto_tree_add_item_ret_uint(tree, hf_mbim_context_provider_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_size);
3701 offset += 4;
3702 }
3703 if (access_string_offset && access_string_size) {
3704 it = proto_tree_add_item(tree, hf_mbim_context_access_string, tvb, base_offset + access_string_offset,
3705 access_string_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3706 if (access_string_size > 200) {
3707 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3708 }
3709 }
3710 if (user_name_offset && user_name_size) {
3711 it = proto_tree_add_item(tree, hf_mbim_context_user_name, tvb, base_offset + user_name_offset,
3712 user_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3713 if (user_name_size > 510) {
3714 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3715 }
3716 }
3717 if (password_offset && password_size) {
3718 it = proto_tree_add_item(tree, hf_mbim_context_password, tvb, base_offset + password_offset,
3719 password_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3720 if (password_size > 510) {
3721 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3722 }
3723 }
3724 if (provider_id_offset && provider_id_size) {
3725 it = proto_tree_add_item(tree, hf_mbim_context_provider_id, tvb, base_offset + provider_id_offset,
3726 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3727 if (provider_id_size > 12) {
3728 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
3729 }
3730 }
3731 }
3732
3733 static void
mbim_dissect_provisioned_contexts_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)3734 mbim_dissect_provisioned_contexts_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3735 {
3736 proto_tree *subtree;
3737 gint base_offset;
3738 guint32 i, elem_count;
3739 wmem_array_t *pair_list;
3740 struct mbim_pair_list pair_list_item, *p_pair_list_item;
3741
3742 base_offset = offset;
3743 proto_tree_add_item_ret_uint(tree, hf_mbim_provisioned_contexts_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
3744 offset += 4;
3745 if (elem_count) {
3746 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
3747 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Provisioned Context Ref List");
3748 for (i = 0; i < elem_count; i++) {
3749 proto_tree_add_item_ret_uint(subtree, hf_mbim_provisioned_contexts_info_provisioned_context_offset,
3750 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
3751 offset += 4;
3752 proto_tree_add_item_ret_uint(subtree, hf_mbim_provisioned_contexts_info_provisioned_context_size,
3753 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
3754 offset += 4;
3755 wmem_array_append_one(pair_list, pair_list_item);
3756 }
3757 for (i = 0; i < elem_count; i++) {
3758 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
3759 if (p_pair_list_item->offset && p_pair_list_item->size) {
3760 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset,
3761 p_pair_list_item->size, ett_mbim_pair_list, NULL, "Provisioned Context #%u", i+1);
3762 mbim_dissect_context(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset, FALSE);
3763 }
3764 }
3765 }
3766 }
3767
3768 static void
mbim_dissect_ipv4_element(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint * offset)3769 mbim_dissect_ipv4_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset)
3770 {
3771 guint32 on_link_prefix_length;
3772 proto_item *ti;
3773
3774 ti = proto_tree_add_item_ret_uint(tree, hf_mbim_ipv4_element_on_link_prefix_length,
3775 tvb, *offset, 4, ENC_LITTLE_ENDIAN, &on_link_prefix_length);
3776 *offset += 4;
3777 if (on_link_prefix_length > 32) {
3778 expert_add_info_format(pinfo, ti, &ei_mbim_illegal_on_link_prefix_length,
3779 "Illegal On Link Prefix Length %u (max is 32)", on_link_prefix_length);
3780 }
3781 proto_tree_add_item(tree, hf_mbim_ipv4_element_ipv4_address, tvb, *offset, 4, ENC_NA);
3782 *offset += 4;
3783 }
3784
3785 static void
mbim_dissect_ipv6_element(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint * offset)3786 mbim_dissect_ipv6_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset)
3787 {
3788 guint32 on_link_prefix_length;
3789 proto_item *ti;
3790
3791 ti = proto_tree_add_item_ret_uint(tree, hf_mbim_ipv6_element_on_link_prefix_length, tvb,
3792 *offset, 4, ENC_LITTLE_ENDIAN, &on_link_prefix_length);
3793 *offset += 4;
3794 if (on_link_prefix_length > 128) {
3795 expert_add_info_format(pinfo, ti, &ei_mbim_illegal_on_link_prefix_length,
3796 "Illegal On Link Prefix Length %u (max is 128)", on_link_prefix_length);
3797 }
3798 proto_tree_add_item(tree, hf_mbim_ipv6_element_ipv6_address, tvb, *offset, 16, ENC_NA);
3799 *offset += 16;
3800 }
3801
3802 static void
mbim_dissect_ip_configuration_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)3803 mbim_dissect_ip_configuration_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3804 {
3805 gint base_offset;
3806 guint32 i, ipv4_address_count, ipv4_address_offset, ipv6_address_count, ipv6_address_offset,
3807 ipv4_gateway_offset, ipv6_gateway_offset, ipv4_dns_count, ipv4_dns_offset,
3808 ipv6_dns_count, ipv6_dns_offset;
3809
3810 base_offset = offset;
3811 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3812 offset += 4;
3813 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_ip_configuration_info_ipv4_configuration_available,
3814 ett_mbim_bitmap, mbim_ip_configuration_info_ipv4_configuration_available_fields, ENC_LITTLE_ENDIAN);
3815 offset += 4;
3816 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_ip_configuration_info_ipv6_configuration_available,
3817 ett_mbim_bitmap, mbim_ip_configuration_info_ipv6_configuration_available_fields, ENC_LITTLE_ENDIAN);
3818 offset += 4;
3819 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv4_address_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv4_address_count);
3820 offset += 4;
3821 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv4_address_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv4_address_offset);
3822 offset += 4;
3823 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv6_address_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv6_address_count);
3824 offset += 4;
3825 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv6_address_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv6_address_offset);
3826 offset += 4;
3827 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv4_gateway_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv4_gateway_offset);
3828 offset += 4;
3829 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv6_gateway_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv6_gateway_offset);
3830 offset += 4;
3831 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv4_dns_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv4_dns_count);
3832 offset += 4;
3833 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv4_dns_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv4_dns_offset);
3834 offset += 4;
3835 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv6_dns_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv6_dns_count);
3836 offset += 4;
3837 proto_tree_add_item_ret_uint(tree, hf_mbim_ip_configuration_info_ipv6_dns_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ipv6_dns_offset);
3838 offset += 4;
3839 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv4_mtu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3840 offset += 4;
3841 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv6_mtu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3842 offset += 4;
3843 if (ipv4_address_count && ipv4_address_offset) {
3844 offset = base_offset + ipv4_address_offset;
3845 for (i = 0; i < ipv4_address_count; i++) {
3846 mbim_dissect_ipv4_element(tvb, pinfo, tree, &offset);
3847 }
3848 }
3849 if (ipv6_address_count && ipv6_address_offset) {
3850 offset = base_offset + ipv6_address_offset;
3851 for (i = 0; i < ipv6_address_count; i++) {
3852 mbim_dissect_ipv6_element(tvb, pinfo, tree, &offset);
3853 }
3854 }
3855 if (ipv4_gateway_offset) {
3856 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv4_gateway,
3857 tvb, base_offset + ipv4_gateway_offset, 4, ENC_NA);
3858 }
3859 if (ipv6_gateway_offset) {
3860 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv6_gateway,
3861 tvb, base_offset + ipv6_gateway_offset, 16, ENC_NA);
3862 }
3863 if (ipv4_dns_count && ipv4_dns_offset) {
3864 offset = base_offset + ipv4_dns_offset;
3865 for (i = 0; i < ipv4_dns_count; i++) {
3866 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv4_dns,
3867 tvb, offset, 4, ENC_NA);
3868 offset += 4;
3869 }
3870 }
3871 if (ipv6_dns_count && ipv6_dns_offset) {
3872 offset = base_offset + ipv6_dns_offset;
3873 for (i = 0; i < ipv6_dns_count; i++) {
3874 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv6_dns,
3875 tvb, offset, 16, ENC_NA);
3876 offset += 16;
3877 }
3878 }
3879 }
3880
3881 static void
mbim_dissect_device_service_element(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)3882 mbim_dissect_device_service_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3883 {
3884 guint8 uuid_idx;
3885 guint32 i, cid_count, cid;
3886 struct mbim_uuid_ext *uuid_ext_info = NULL;
3887
3888 uuid_idx = mbim_dissect_service_id_uuid(tvb, pinfo, tree, hf_mbim_device_service_element_device_service_id, &offset, &uuid_ext_info, TRUE);
3889 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_service_element_dss_payload,
3890 ett_mbim_bitmap, mbim_device_service_element_dss_payload_fields, ENC_LITTLE_ENDIAN);
3891 offset += 4;
3892 proto_tree_add_item(tree, hf_mbim_device_service_element_max_dss_instances, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3893 offset += 4;
3894 proto_tree_add_item_ret_uint(tree, hf_mbim_device_service_element_cid_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &cid_count);
3895 offset += 4;
3896 for (i = 0; i < cid_count; i++) {
3897 cid = tvb_get_letohl(tvb, offset);
3898 if (uuid_idx < UUID_MAX) {
3899 if (mbim_uuid_info[uuid_idx].cid_list_ext) {
3900 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
3901 val_to_str_ext_const(cid, mbim_uuid_info[uuid_idx].cid_list_ext, "Unknown"), cid);
3902 } else {
3903 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
3904 val_to_str_const(cid, mbim_uuid_info[uuid_idx].cid_list, "Unknown"), cid);
3905 }
3906 } else if (uuid_idx == UUID_EXT_IDX) {
3907 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
3908 val_to_str_const(cid, uuid_ext_info->uuid_cid_list, "Unknown"), cid);
3909 } else {
3910 proto_tree_add_uint(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid);
3911 }
3912 offset += 4;
3913 }
3914 }
3915
3916 static void
mbim_dissect_device_services_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)3917 mbim_dissect_device_services_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3918 {
3919 proto_tree *subtree;
3920 gint base_offset;
3921 guint32 i, device_services_count;
3922 wmem_array_t *pair_list;
3923 struct mbim_pair_list pair_list_item, *p_pair_list_item;
3924
3925 base_offset = offset;
3926 proto_tree_add_item_ret_uint(tree, hf_mbim_device_services_info_device_services_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &device_services_count);
3927 offset += 4;
3928 proto_tree_add_item(tree, hf_mbim_device_services_info_max_dss_sessions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3929 offset += 4;
3930 if (device_services_count) {
3931 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
3932 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*device_services_count, ett_mbim_pair_list, NULL, "Device Services Ref List");
3933 for (i = 0; i < device_services_count; i++) {
3934 proto_tree_add_item_ret_uint(subtree, hf_mbim_device_services_info_device_services_offset,
3935 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
3936 offset += 4;
3937 proto_tree_add_item_ret_uint(subtree, hf_mbim_device_services_info_device_services_size,
3938 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
3939 offset += 4;
3940 wmem_array_append_one(pair_list, pair_list_item);
3941 }
3942 for (i = 0; i < device_services_count; i++) {
3943 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
3944 if (p_pair_list_item->offset && p_pair_list_item->size) {
3945 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset,
3946 p_pair_list_item->size, ett_mbim_pair_list, NULL, "Device Service Element #%u", i+1);
3947 mbim_dissect_device_service_element(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset);
3948 }
3949 }
3950 }
3951 }
3952
3953 static void
mbim_dissect_event_entry(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)3954 mbim_dissect_event_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3955 {
3956 guint8 uuid_idx;
3957 guint32 i, cid_count, cid;
3958 struct mbim_uuid_ext *uuid_ext_info = NULL;
3959
3960 uuid_idx = mbim_dissect_service_id_uuid(tvb, pinfo, tree, hf_mbim_event_entry_device_service_id, &offset, &uuid_ext_info, TRUE);
3961 proto_tree_add_item_ret_uint(tree, hf_mbim_event_entry_cid_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &cid_count);
3962 offset += 4;
3963 for (i = 0; i < cid_count; i++) {
3964 cid = tvb_get_letohl(tvb, offset);
3965 if (uuid_idx < UUID_MAX) {
3966 if (mbim_uuid_info[uuid_idx].cid_list_ext) {
3967 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
3968 val_to_str_ext_const(cid, mbim_uuid_info[uuid_idx].cid_list_ext, "Unknown"), cid);
3969 } else {
3970 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
3971 val_to_str_const(cid, mbim_uuid_info[uuid_idx].cid_list, "Unknown"), cid);
3972 }
3973 } else if (uuid_idx == UUID_EXT_IDX) {
3974 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
3975 val_to_str_const(cid, uuid_ext_info->uuid_cid_list, "Unknown"), cid);
3976 } else {
3977 proto_tree_add_uint(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid);
3978 }
3979 offset += 4;
3980 }
3981 }
3982
3983 static void
mbim_dissect_device_service_subscribe_list(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)3984 mbim_dissect_device_service_subscribe_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3985 {
3986 proto_tree *subtree;
3987 gint base_offset;
3988 guint32 i, element_count;
3989 wmem_array_t *pair_list;
3990 struct mbim_pair_list pair_list_item, *p_pair_list_item;
3991
3992 base_offset = offset;
3993 proto_tree_add_item_ret_uint(tree, hf_mbim_device_service_subscribe_element_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &element_count);
3994 offset += 4;
3995 if (element_count) {
3996 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
3997 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*element_count, ett_mbim_pair_list, NULL, "Device Service Subscribe Ref List");
3998 for (i = 0; i < element_count; i++) {
3999 proto_tree_add_item_ret_uint(subtree, hf_mbim_device_service_subscribe_device_service_offset,
4000 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
4001 offset += 4;
4002 proto_tree_add_item_ret_uint(subtree, hf_mbim_device_service_subscribe_device_service_size,
4003 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
4004 offset += 4;
4005 wmem_array_append_one(pair_list, pair_list_item);
4006 }
4007 for (i = 0; i < element_count; i++) {
4008 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
4009 if (p_pair_list_item->offset && p_pair_list_item->size) {
4010 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset,
4011 p_pair_list_item->size, ett_mbim_pair_list, NULL, "Device Service Element #%u", i+1);
4012 mbim_dissect_event_entry(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset);
4013 }
4014 }
4015 }
4016 }
4017
4018 static void
mbim_dissect_packet_statistics_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4019 mbim_dissect_packet_statistics_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4020 {
4021 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_in_discards, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4022 offset += 4;
4023 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_in_errors, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4024 offset += 4;
4025 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_in_octets, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4026 offset += 8;
4027 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_in_packets, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4028 offset += 8;
4029 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_out_octets, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4030 offset += 8;
4031 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_out_packets, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4032 offset += 8;
4033 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_out_errors, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4034 offset += 4;
4035 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_out_discards, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4036 }
4037
4038 static void
mbim_dissect_single_packet_filter(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)4039 mbim_dissect_single_packet_filter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, struct mbim_conv_info* mbim_conv)
4040 {
4041 gint base_offset;
4042 guint32 filter_size, packet_filter_offset, packet_mask_offset;
4043
4044 base_offset = offset;
4045 proto_tree_add_item_ret_uint(tree, hf_mbim_single_packet_filter_filter_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &filter_size);
4046 offset += 4;
4047 proto_tree_add_item_ret_uint(tree, hf_mbim_single_packet_filter_packet_filter_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &packet_filter_offset);
4048 offset += 4;
4049 proto_tree_add_item_ret_uint(tree, hf_mbim_single_packet_filter_packet_mask_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &packet_mask_offset);
4050 offset += 4;
4051 if (SHOULD_MBIM_EX3_BE_APPLIED(mbim_conv)) {
4052 proto_tree_add_item(tree, hf_mbim_single_packet_filter_filter_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4053 /* offset += 4; */
4054 }
4055 if (filter_size) {
4056 if (packet_filter_offset) {
4057 proto_tree_add_item(tree, hf_mbim_single_packet_filter_packet_filter, tvb, base_offset + packet_filter_offset,
4058 filter_size, ENC_NA);
4059 }
4060 if (packet_mask_offset) {
4061 proto_tree_add_item(tree, hf_mbim_single_packet_filter_packet_mask, tvb, base_offset + packet_mask_offset,
4062 filter_size, ENC_NA);
4063 }
4064 }
4065 }
4066
4067 static void
mbim_dissect_packet_filters(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)4068 mbim_dissect_packet_filters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, struct mbim_conv_info* mbim_conv)
4069 {
4070 proto_tree *subtree;
4071 gint base_offset;
4072 guint32 i, packet_filters_count;
4073 wmem_array_t *pair_list;
4074 struct mbim_pair_list pair_list_item, *p_pair_list_item;
4075
4076 base_offset = offset;
4077 proto_tree_add_item(tree, hf_mbim_packet_filters_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4078 offset += 4;
4079 proto_tree_add_item_ret_uint(tree, hf_mbim_packet_filters_packet_filters_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &packet_filters_count);
4080 offset += 4;
4081 if (packet_filters_count) {
4082 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
4083 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*packet_filters_count, ett_mbim_pair_list, NULL, "Packet Filter Ref List");
4084 for (i = 0; i < packet_filters_count; i++) {
4085 proto_tree_add_item_ret_uint(subtree, hf_mbim_packet_filters_packet_filters_packet_filter_offset,
4086 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
4087 offset += 4;
4088 proto_tree_add_item_ret_uint(subtree, hf_mbim_packet_filters_packet_filters_packet_filter_size,
4089 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
4090 offset += 4;
4091 wmem_array_append_one(pair_list, pair_list_item);
4092 }
4093 for (i = 0; i < packet_filters_count; i++) {
4094 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
4095 if (p_pair_list_item->offset && p_pair_list_item->size) {
4096 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset,
4097 p_pair_list_item->size, ett_mbim_pair_list, NULL, "Packet Filter Element #%u", i+1);
4098 mbim_dissect_single_packet_filter(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset, mbim_conv);
4099 }
4100 }
4101 }
4102 }
4103
4104 static void
mbim_dissect_set_sms_configuration(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4105 mbim_dissect_set_sms_configuration(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4106 {
4107 gint base_offset;
4108 guint32 sc_address_offset, sc_address_size;
4109 proto_item *it;
4110
4111 base_offset = offset;
4112 proto_tree_add_item(tree, hf_mbim_set_sms_configuration_format, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4113 offset += 4;
4114 proto_tree_add_item_ret_uint(tree, hf_mbim_set_sms_configuration_sc_address_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &sc_address_offset);
4115 offset += 4;
4116 proto_tree_add_item_ret_uint(tree, hf_mbim_set_sms_configuration_sc_address_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &sc_address_size);
4117 /*offset += 4;*/
4118 if (sc_address_offset && sc_address_size) {
4119 it = proto_tree_add_item(tree, hf_mbim_set_sms_configuration_sc_address, tvb, base_offset + sc_address_offset,
4120 sc_address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4121 if (sc_address_size > 40) {
4122 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
4123 }
4124 }
4125 }
4126
4127 static void
mbim_dissect_sms_configuration_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4128 mbim_dissect_sms_configuration_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4129 {
4130 gint base_offset;
4131 guint32 sc_address_offset, sc_address_size;
4132 proto_item *it;
4133
4134 base_offset = offset;
4135 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_sms_storage_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4136 offset += 4;
4137 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_format, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4138 offset += 4;
4139 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_max_messages, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4140 offset += 4;
4141 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_cdma_short_message_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4142 offset += 4;
4143 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_configuration_info_sc_address_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &sc_address_offset);
4144 offset += 4;
4145 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_configuration_info_sc_address_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &sc_address_size);
4146 /*offset += 4;*/
4147 if (sc_address_offset && sc_address_size) {
4148 it = proto_tree_add_item(tree, hf_mbim_sms_configuration_info_sc_address, tvb, base_offset + sc_address_offset,
4149 sc_address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4150 if (sc_address_size > 40) {
4151 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
4152 }
4153 }
4154 }
4155
4156 static void
mbim_dissect_sms_pdu_record(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)4157 mbim_dissect_sms_pdu_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
4158 struct mbim_conv_info *mbim_conv)
4159 {
4160 gint base_offset;
4161 guint32 message_status, pdu_data_offset, pdu_data_size;
4162 tvbuff_t *sms_tvb;
4163 proto_item *ti;
4164 proto_tree *subtree, *sc_tree;
4165 guint8 sc_address_size;
4166
4167 base_offset = offset;
4168 proto_tree_add_item(tree, hf_mbim_sms_pdu_record_message_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4169 offset += 4;
4170 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_pdu_record_message_status, tvb, offset, 4, ENC_LITTLE_ENDIAN, &message_status);
4171 offset += 4;
4172 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_pdu_record_pdu_data_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pdu_data_offset);
4173 offset += 4;
4174 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_pdu_record_pdu_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pdu_data_size);
4175 /*offset += 4;*/
4176 if (pdu_data_offset && pdu_data_size) {
4177 if ((((mbim_sms_pdu_format == SMS_PDU_AUTOMATIC) && (mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_GSM)) ||
4178 (mbim_sms_pdu_format == SMS_PDU_3GPP)) && gsm_sms_handle) {
4179 ti = proto_tree_add_item(tree, hf_mbim_sms_pdu_record_pdu_data, tvb, base_offset + pdu_data_offset,
4180 pdu_data_size, ENC_NA);
4181 if (pdu_data_size > 183) {
4182 expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu);
4183 }
4184 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4185 sc_address_size = tvb_get_guint8(tvb, base_offset + pdu_data_offset);
4186 sc_tree = proto_tree_add_subtree(subtree, tvb, base_offset + pdu_data_offset, 1 + sc_address_size,
4187 ett_mbim_sc_address, NULL, "Service Center Address");
4188 proto_tree_add_uint(sc_tree, hf_mbim_sms_pdu_record_pdu_data_sc_address_size, tvb,
4189 base_offset + pdu_data_offset, 1, sc_address_size);
4190 if (sc_address_size) {
4191 de_cld_party_bcd_num(tvb, sc_tree, pinfo, base_offset + pdu_data_offset + 1,
4192 sc_address_size, NULL, 0);
4193 }
4194 if (pdu_data_size > (guint32)(sc_address_size + 1)) {
4195 pdu_data_size -= sc_address_size + 1;
4196 sms_tvb = tvb_new_subset_length(tvb, base_offset + pdu_data_offset + 1 + sc_address_size,
4197 pdu_data_size);
4198 pinfo->p2p_dir = (message_status < 2) ? P2P_DIR_SENT : P2P_DIR_RECV;
4199 call_dissector(gsm_sms_handle, sms_tvb, pinfo, subtree);
4200 }
4201 } else {
4202 ti = proto_tree_add_item(tree, hf_mbim_sms_pdu_record_pdu_data, tvb, base_offset + pdu_data_offset,
4203 pdu_data_size, ENC_NA);
4204 if (pdu_data_size > 255) {
4205 expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu);
4206 }
4207 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4208 if ((((mbim_sms_pdu_format == SMS_PDU_AUTOMATIC) && (mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_CDMA)) ||
4209 (mbim_sms_pdu_format == SMS_PDU_3GPP2)) && cdma_sms_handle) {
4210 sms_tvb = tvb_new_subset_length(tvb, base_offset + pdu_data_offset, pdu_data_size);
4211 call_dissector(cdma_sms_handle, sms_tvb, pinfo, subtree);
4212 }
4213 }
4214 }
4215 }
4216
mbim_decode_sms_cdma_text(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,const int hfindex,gint offset,guint32 encoding_id,guint32 size_in_bytes,guint32 size_in_chars)4217 static void mbim_decode_sms_cdma_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const int hfindex, gint offset,
4218 guint32 encoding_id, guint32 size_in_bytes, guint32 size_in_chars)
4219 {
4220 unsigned char *src, *dest;
4221
4222 switch (encoding_id) {
4223 case MBIM_ENCODING_7BIT_ASCII:
4224 proto_tree_add_ascii_7bits_item(tree, hfindex, tvb, (offset << 3), size_in_chars);
4225 break;
4226 case MBIM_ENCODING_IA5:
4227 src = (unsigned char*)tvb_get_ascii_7bits_string(pinfo->pool, tvb, (offset << 3), size_in_chars);
4228 dest = (unsigned char*)wmem_alloc(pinfo->pool, (const size_t)size_in_chars + 1);
4229 IA5_7BIT_decode(dest, src, size_in_chars);
4230 proto_tree_add_string(tree, hfindex, tvb, offset, size_in_bytes, (const char*)dest);
4231 break;
4232 case MBIM_ENCODING_UNICODE:
4233 proto_tree_add_item(tree, hfindex, tvb, offset, size_in_bytes, ENC_UCS_2|ENC_BIG_ENDIAN);
4234 break;
4235 case MBIM_ENCODING_LATIN_HEBREW:
4236 proto_tree_add_item(tree, hfindex, tvb, offset, size_in_bytes, ENC_ISO_8859_8|ENC_NA);
4237 break;
4238 case MBIM_ENCODING_LATIN:
4239 proto_tree_add_item(tree, hfindex, tvb, offset, size_in_bytes, ENC_ISO_8859_1|ENC_NA);
4240 break;
4241 case MBIM_ENCODING_GSM_7BIT:
4242 proto_tree_add_ts_23_038_7bits_packed_item(tree, hfindex, tvb, (offset << 3), size_in_chars);
4243 break;
4244 default:
4245 break;
4246 }
4247 }
4248
4249 static void
mbim_dissect_sms_cdma_record(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4250 mbim_dissect_sms_cdma_record(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4251 {
4252 gint base_offset;
4253 guint32 address_offset, address_size, timestamp_offset, timestamp_size, encoding_id,
4254 encoded_message_offset, size_in_bytes, size_in_chars;
4255 proto_item *ti;
4256 proto_tree *subtree;
4257 proto_item *it;
4258
4259 base_offset = offset;
4260 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_message_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4261 offset += 4;
4262 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_message_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4263 offset += 4;
4264 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_cdma_record_address_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &address_offset);
4265 offset += 4;
4266 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_cdma_record_address_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &address_size);
4267 offset += 4;
4268 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_cdma_record_timestamp_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, ×tamp_offset);
4269 offset += 4;
4270 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_cdma_record_timestamp_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, ×tamp_size);
4271 offset += 4;
4272 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_cdma_record_encoding_id, tvb, offset, 4, ENC_LITTLE_ENDIAN, &encoding_id);
4273 offset += 4;
4274 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_language_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4275 offset += 4;
4276 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_cdma_record_encoded_message_offset, tvb, offset, 4,
4277 ENC_LITTLE_ENDIAN, &encoded_message_offset);
4278 offset += 4;
4279 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_cdma_record_size_in_bytes, tvb, offset, 4, ENC_LITTLE_ENDIAN, &size_in_bytes);
4280 offset += 4;
4281 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_cdma_record_size_in_characters, tvb, offset, 4, ENC_LITTLE_ENDIAN, &size_in_chars);
4282 /*offset += 4;*/
4283 if (address_offset && address_size) {
4284 it = proto_tree_add_item(tree, hf_mbim_sms_cdma_record_address, tvb, base_offset + address_offset,
4285 address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4286 if (address_size > 40) {
4287 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
4288 }
4289 }
4290 if (timestamp_offset && timestamp_size) {
4291 it = proto_tree_add_item(tree, hf_mbim_sms_cdma_record_timestamp, tvb, base_offset + timestamp_offset,
4292 timestamp_size, ENC_NA|ENC_ASCII);
4293 if (timestamp_size > 21) {
4294 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
4295 }
4296 }
4297 if (encoded_message_offset && size_in_bytes) {
4298 ti = proto_tree_add_item(tree, hf_mbim_sms_cdma_record_encoded_message, tvb, base_offset + encoded_message_offset,
4299 size_in_bytes, ENC_NA);
4300 if (size_in_bytes > 160) {
4301 expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu);
4302 }
4303 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4304 mbim_decode_sms_cdma_text(tvb, pinfo, subtree, hf_mbim_sms_cdma_record_encoded_message_text,
4305 (base_offset + encoded_message_offset), encoding_id, size_in_bytes, size_in_chars);
4306 }
4307 }
4308
4309 static void
mbim_dissect_sms_read_req(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4310 mbim_dissect_sms_read_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4311 {
4312 proto_tree_add_item(tree, hf_mbim_sms_read_req_format, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4313 offset += 4;
4314 proto_tree_add_item(tree, hf_mbim_sms_read_req_flag, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4315 offset += 4;
4316 proto_tree_add_item(tree, hf_mbim_sms_read_req_message_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4317 }
4318
4319 static void
mbim_dissect_sms_read_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)4320 mbim_dissect_sms_read_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
4321 struct mbim_conv_info *mbim_conv)
4322 {
4323 proto_tree *subtree;
4324 gint base_offset;
4325 guint32 i, format, element_count;
4326 wmem_array_t *pair_list;
4327 struct mbim_pair_list pair_list_item, *p_pair_list_item;
4328
4329 base_offset = offset;
4330 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_read_info_format, tvb, offset, 4, ENC_LITTLE_ENDIAN, &format);
4331 offset += 4;
4332 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_read_info_element_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &element_count);
4333 offset += 4;
4334 if (element_count) {
4335 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
4336 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*element_count, ett_mbim_pair_list, NULL, "SMS Ref List");
4337 for (i = 0; i < element_count; i++) {
4338 proto_tree_add_item_ret_uint(subtree, hf_mbim_sms_read_info_sms_offset,
4339 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
4340 offset += 4;
4341 proto_tree_add_item_ret_uint(subtree, hf_mbim_sms_read_info_sms_size,
4342 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
4343 offset += 4;
4344 wmem_array_append_one(pair_list, pair_list_item);
4345 }
4346 for (i = 0; i < element_count; i++) {
4347 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
4348 if (p_pair_list_item->offset && p_pair_list_item->size) {
4349 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset,
4350 p_pair_list_item->size, ett_mbim_pair_list, NULL, "SMS Element #%u", i+1);
4351 if (format == MBIM_SMS_FORMAT_PDU) {
4352 mbim_dissect_sms_pdu_record(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset, mbim_conv);
4353 } else if (format == MBIM_SMS_FORMAT_CDMA) {
4354 mbim_dissect_sms_cdma_record(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset);
4355 } else {
4356 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unknown_sms_format, tvb,
4357 base_offset + p_pair_list_item->offset, p_pair_list_item->size);
4358 }
4359 }
4360 }
4361 }
4362 }
4363
4364 static void
mbim_dissect_sms_send_pdu(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)4365 mbim_dissect_sms_send_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
4366 struct mbim_conv_info *mbim_conv)
4367 {
4368 gint base_offset;
4369 guint32 pdu_data_offset, pdu_data_size;
4370 tvbuff_t *sms_tvb;
4371 proto_item *ti;
4372 proto_tree *subtree, *sc_tree;
4373 guint8 sc_address_size;
4374
4375 base_offset = offset;
4376 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_send_pdu_pdu_data_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pdu_data_offset);
4377 offset += 4;
4378 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_send_pdu_pdu_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pdu_data_size);
4379 /*offset += 4;*/
4380 if (pdu_data_offset && pdu_data_size) {
4381 if ((((mbim_sms_pdu_format == SMS_PDU_AUTOMATIC) && (mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_GSM)) ||
4382 (mbim_sms_pdu_format == SMS_PDU_3GPP)) && gsm_sms_handle) {
4383 ti = proto_tree_add_item(tree, hf_mbim_sms_send_pdu_pdu_data, tvb, base_offset + pdu_data_offset,
4384 pdu_data_size, ENC_NA);
4385 if (pdu_data_size > 183) {
4386 expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu);
4387 }
4388 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4389 sc_address_size = tvb_get_guint8(tvb, base_offset + pdu_data_offset);
4390 sc_tree = proto_tree_add_subtree(subtree, tvb, base_offset + pdu_data_offset, 1 + sc_address_size,
4391 ett_mbim_sc_address, NULL, "Service Center Address");
4392 proto_tree_add_uint(sc_tree, hf_mbim_sms_send_pdu_pdu_data_sc_address_size, tvb,
4393 base_offset + pdu_data_offset, 1, sc_address_size);
4394 if (sc_address_size) {
4395 de_cld_party_bcd_num(tvb, sc_tree, pinfo, base_offset + pdu_data_offset + 1,
4396 sc_address_size, NULL, 0);
4397 }
4398 if (pdu_data_size > (guint32)(sc_address_size + 1)) {
4399 pdu_data_size -= sc_address_size + 1;
4400 sms_tvb = tvb_new_subset_length(tvb, base_offset + pdu_data_offset + 1 + sc_address_size,
4401 pdu_data_size);
4402 pinfo->p2p_dir = P2P_DIR_RECV;
4403 call_dissector(gsm_sms_handle, sms_tvb, pinfo, subtree);
4404 }
4405 } else {
4406 ti = proto_tree_add_item(tree, hf_mbim_sms_send_pdu_pdu_data, tvb, base_offset + pdu_data_offset,
4407 pdu_data_size, ENC_NA);
4408 if (pdu_data_size > 255) {
4409 expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu);
4410 }
4411 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4412 if ((((mbim_sms_pdu_format == SMS_PDU_AUTOMATIC) && (mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_CDMA)) ||
4413 (mbim_sms_pdu_format == SMS_PDU_3GPP2)) && cdma_sms_handle) {
4414 sms_tvb = tvb_new_subset_length(tvb, base_offset + pdu_data_offset, pdu_data_size);
4415 call_dissector(cdma_sms_handle, sms_tvb, pinfo, subtree);
4416 }
4417 }
4418 }
4419 }
4420
4421 static void
mbim_dissect_sms_send_cdma(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)4422 mbim_dissect_sms_send_cdma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
4423 {
4424 gint base_offset;
4425 guint32 encoding_id, address_offset, address_size, encoded_message_offset,
4426 size_in_bytes, size_in_chars;
4427 proto_item *ti;
4428 proto_tree *subtree;
4429
4430 base_offset = offset;
4431 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_send_cdma_encoding_id, tvb, offset, 4, ENC_LITTLE_ENDIAN, &encoding_id);
4432 offset += 4;
4433 proto_tree_add_item(tree, hf_mbim_sms_send_cdma_language_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4434 offset += 4;
4435 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_send_cdma_address_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &address_offset);
4436 offset += 4;
4437 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_send_cdma_address_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &address_size);
4438 offset += 4;
4439 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_send_cdma_encoded_message_offset, tvb, offset, 4,
4440 ENC_LITTLE_ENDIAN, &encoded_message_offset);
4441 offset += 4;
4442 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_send_cdma_size_in_bytes, tvb, offset, 4, ENC_LITTLE_ENDIAN, &size_in_bytes);
4443 offset += 4;
4444 proto_tree_add_item_ret_uint(tree, hf_mbim_sms_send_cdma_size_in_characters, tvb, offset, 4, ENC_LITTLE_ENDIAN, &size_in_chars);
4445 /*offset += 4;*/
4446 if (address_offset && address_size) {
4447 ti = proto_tree_add_item(tree, hf_mbim_sms_send_cdma_address, tvb, base_offset + address_offset,
4448 address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4449 if (address_size > 40) {
4450 expert_add_info(pinfo, ti, &ei_mbim_oversized_string);
4451 }
4452 }
4453 if (encoded_message_offset && size_in_bytes) {
4454 ti = proto_tree_add_item(tree, hf_mbim_sms_send_cdma_encoded_message, tvb, base_offset + encoded_message_offset,
4455 size_in_bytes, ENC_NA);
4456 if (size_in_bytes > 160) {
4457 expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu);
4458 }
4459 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4460 mbim_decode_sms_cdma_text(tvb, pinfo, subtree, hf_mbim_sms_send_cdma_encoded_message_text,
4461 (base_offset + encoded_message_offset), encoding_id, size_in_bytes, size_in_chars);
4462 }
4463 }
4464
4465 static void
mbim_dissect_set_sms_send(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)4466 mbim_dissect_set_sms_send(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
4467 struct mbim_conv_info *mbim_conv)
4468 {
4469 guint32 format;
4470
4471 proto_tree_add_item_ret_uint(tree, hf_mbim_set_sms_send_format, tvb, offset, 4, ENC_LITTLE_ENDIAN, &format);
4472 offset += 4;
4473 if (format == MBIM_SMS_FORMAT_PDU) {
4474 mbim_dissect_sms_send_pdu(tvb, pinfo, tree, offset, mbim_conv);
4475 } else if (format == MBIM_SMS_FORMAT_CDMA) {
4476 mbim_dissect_sms_send_cdma(tvb, pinfo, tree, offset);
4477 } else {
4478 proto_tree_add_expert(tree, pinfo, &ei_mbim_unknown_sms_format, tvb, offset, -1);
4479 }
4480 }
4481
4482 static void
mbim_dissect_set_ussd(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)4483 mbim_dissect_set_ussd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
4484 {
4485 proto_item *ti;
4486 proto_tree *subtree;
4487 gint base_offset;
4488 guint32 ussd_payload_offset, ussd_payload_length;
4489 guint8 encoding;
4490 tvbuff_t *ussd_tvb;
4491
4492 base_offset = offset;
4493 proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_action, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4494 offset += 4;
4495 ti = proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_data_coding_scheme, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4496 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4497 encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, subtree, offset);
4498 offset += 4;
4499 proto_tree_add_item_ret_uint(tree, hf_mbim_set_ussd_ussd_payload_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ussd_payload_offset);
4500 offset += 4;
4501 proto_tree_add_item_ret_uint(tree, hf_mbim_set_ussd_ussd_payload_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ussd_payload_length);
4502 /*offset += 4;*/
4503 if (ussd_payload_offset && ussd_payload_length) {
4504 ti = proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_payload, tvb, base_offset + ussd_payload_offset,
4505 ussd_payload_length, ENC_NA);
4506 if (ussd_payload_length > 160) {
4507 expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu);
4508 }
4509 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4510 ussd_tvb = tvb_new_subset_length(tvb, base_offset + ussd_payload_offset, ussd_payload_length);
4511 switch (encoding) {
4512 case SMS_ENCODING_7BIT:
4513 case SMS_ENCODING_7BIT_LANG:
4514 proto_tree_add_item(subtree, hf_mbim_set_ussd_ussd_payload_text,
4515 ussd_tvb, 0, ussd_payload_length, ENC_3GPP_TS_23_038_7BITS|ENC_NA);
4516 break;
4517 case SMS_ENCODING_8BIT:
4518 /* XXX - ASCII, or some extended ASCII? */
4519 proto_tree_add_item(subtree, hf_mbim_set_ussd_ussd_payload_text,
4520 ussd_tvb , 0, ussd_payload_length, ENC_ASCII|ENC_NA);
4521 break;
4522 case SMS_ENCODING_UCS2:
4523 case SMS_ENCODING_UCS2_LANG:
4524 proto_tree_add_item(subtree, hf_mbim_set_ussd_ussd_payload_text,
4525 ussd_tvb , 0, ussd_payload_length, ENC_UCS_2|ENC_BIG_ENDIAN);
4526 break;
4527 default:
4528 break;
4529 }
4530 }
4531 }
4532
4533 static void
mbim_dissect_ussd_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)4534 mbim_dissect_ussd_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
4535 {
4536 proto_item *ti;
4537 proto_tree *subtree;
4538 gint base_offset;
4539 guint32 ussd_payload_offset, ussd_payload_length;
4540 guint8 encoding;
4541 tvbuff_t *ussd_tvb;
4542
4543 base_offset = offset;
4544 proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_response, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4545 offset += 4;
4546 proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_session_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4547 offset += 4;
4548 ti = proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_data_coding_scheme, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4549 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4550 encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, subtree, offset);
4551 offset += 4;
4552 proto_tree_add_item_ret_uint(tree, hf_mbim_ussd_info_ussd_payload_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ussd_payload_offset);
4553 offset += 4;
4554 proto_tree_add_item_ret_uint(tree, hf_mbim_ussd_info_ussd_payload_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ussd_payload_length);
4555 /*offset += 4;*/
4556 if (ussd_payload_offset && ussd_payload_length) {
4557 ti = proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_payload, tvb, base_offset + ussd_payload_offset,
4558 ussd_payload_length, ENC_NA);
4559 if (ussd_payload_length > 160) {
4560 expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu);
4561 }
4562 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4563 ussd_tvb = tvb_new_subset_length(tvb, base_offset + ussd_payload_offset, ussd_payload_length);
4564 switch (encoding) {
4565 case SMS_ENCODING_7BIT:
4566 case SMS_ENCODING_7BIT_LANG:
4567 proto_tree_add_item(subtree, hf_mbim_ussd_info_ussd_payload_text,
4568 ussd_tvb, 0, ussd_payload_length, ENC_3GPP_TS_23_038_7BITS|ENC_NA);
4569 break;
4570 case SMS_ENCODING_8BIT:
4571 /* XXX - ASCII, or some extended ASCII? */
4572 proto_tree_add_item(subtree, hf_mbim_ussd_info_ussd_payload_text,
4573 ussd_tvb , 0, ussd_payload_length, ENC_ASCII|ENC_NA);
4574 break;
4575 case SMS_ENCODING_UCS2:
4576 case SMS_ENCODING_UCS2_LANG:
4577 proto_tree_add_item(subtree, hf_mbim_ussd_info_ussd_payload_text,
4578 ussd_tvb , 0, ussd_payload_length, ENC_UCS_2|ENC_BIG_ENDIAN);
4579 break;
4580 default:
4581 break;
4582 }
4583 }
4584 }
4585
4586 static void
mbim_dissect_phonebook_configuration_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4587 mbim_dissect_phonebook_configuration_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4588 {
4589 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_phonebook_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4590 offset += 4;
4591 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_total_nb_of_entries, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4592 offset += 4;
4593 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_used_entries, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4594 offset += 4;
4595 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_max_number_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4596 offset += 4;
4597 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_max_name_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4598 }
4599
4600 static void
mbim_dissect_phonebook_entry(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4601 mbim_dissect_phonebook_entry(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4602 {
4603 gint base_offset;
4604 guint32 number_offset, number_length, name_offset, name_length;
4605
4606 base_offset = offset;
4607 proto_tree_add_item(tree, hf_mbim_phonebook_entry_entry_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4608 offset += 4;
4609 proto_tree_add_item_ret_uint(tree, hf_mbim_phonebook_entry_number_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &number_offset);
4610 offset += 4;
4611 proto_tree_add_item_ret_uint(tree, hf_mbim_phonebook_entry_number_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &number_length);
4612 offset += 4;
4613 proto_tree_add_item_ret_uint(tree, hf_mbim_phonebook_entry_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &name_offset);
4614 offset += 4;
4615 proto_tree_add_item_ret_uint(tree, hf_mbim_phonebook_entry_name_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &name_length);
4616 /*offset += 4;*/
4617 if (number_offset && number_length) {
4618 proto_tree_add_item(tree, hf_mbim_phonebook_entry_number, tvb, base_offset + number_offset,
4619 number_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4620 }
4621 if (name_offset && name_length) {
4622 proto_tree_add_item(tree, hf_mbim_phonebook_entry_name, tvb, base_offset + name_offset,
4623 name_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4624 }
4625 }
4626
4627 static void
mbim_dissect_phonebook_read_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)4628 mbim_dissect_phonebook_read_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
4629 {
4630 proto_tree *subtree;
4631 gint base_offset;
4632 guint32 i, element_count;
4633 wmem_array_t *pair_list;
4634 struct mbim_pair_list pair_list_item, *p_pair_list_item;
4635
4636 base_offset = offset;
4637 proto_tree_add_item_ret_uint(tree, hf_mbim_phonebook_read_info_element_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &element_count);
4638 offset += 4;
4639 if (element_count) {
4640 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
4641 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*element_count, ett_mbim_pair_list, NULL, "Phonebook Ref List");
4642 for (i = 0; i < element_count; i++) {
4643 proto_tree_add_item_ret_uint(subtree, hf_mbim_phonebook_read_info_phonebook_offset,
4644 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
4645 offset += 4;
4646 proto_tree_add_item_ret_uint(subtree, hf_mbim_phonebook_read_info_phonebook_size,
4647 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
4648 offset += 4;
4649 wmem_array_append_one(pair_list, pair_list_item);
4650 }
4651 for (i = 0; i < element_count; i++) {
4652 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
4653 if (p_pair_list_item->offset && p_pair_list_item->size) {
4654 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset,
4655 p_pair_list_item->size, ett_mbim_pair_list, NULL, "Phonebook Element #%u", i+1);
4656 mbim_dissect_phonebook_entry(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset);
4657 }
4658 }
4659 }
4660 }
4661
4662 static void
mbim_dissect_set_phonebook_write(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4663 mbim_dissect_set_phonebook_write(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4664 {
4665 gint base_offset;
4666 guint32 number_offset, number_length, name_offset, name_length;
4667
4668 base_offset = offset;
4669 proto_tree_add_item(tree, hf_mbim_set_phonebook_write_save_flag, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4670 offset += 4;
4671 proto_tree_add_item(tree, hf_mbim_set_phonebook_write_save_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4672 offset += 4;
4673 proto_tree_add_item_ret_uint(tree, hf_mbim_set_phonebook_write_number_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &number_offset);
4674 offset += 4;
4675 proto_tree_add_item_ret_uint(tree, hf_mbim_set_phonebook_write_number_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &number_length);
4676 offset += 4;
4677 proto_tree_add_item_ret_uint(tree, hf_mbim_set_phonebook_write_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &name_offset);
4678 offset += 4;
4679 proto_tree_add_item_ret_uint(tree, hf_mbim_set_phonebook_write_name_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &name_length);
4680 /*offset += 4;*/
4681 if (number_offset && number_length) {
4682 proto_tree_add_item(tree, hf_mbim_set_phonebook_write_number, tvb, base_offset + number_offset,
4683 number_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4684 }
4685 if (name_offset && name_length) {
4686 proto_tree_add_item(tree, hf_mbim_set_phonebook_write_name, tvb, base_offset + name_offset,
4687 name_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4688 }
4689 }
4690
4691 static void
mbim_dissect_set_stk_pac(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4692 mbim_dissect_set_stk_pac(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4693 {
4694 proto_item *ti;
4695 proto_tree *subtree;
4696
4697 ti = proto_tree_add_item(tree, hf_mbim_set_stk_pac_pac_host_control, tvb, offset, 32, ENC_NA);
4698 subtree = proto_item_add_subtree(ti, ett_mbim_pac);
4699 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_refresh, tvb, offset, 1, ENC_NA);
4700 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_more_time, tvb, offset, 1, ENC_NA);
4701 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_poll_interval, tvb, offset, 1, ENC_NA);
4702 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_polling_off, tvb, offset, 1, ENC_NA);
4703 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_set_up_evt_list, tvb, offset, 1, ENC_NA);
4704 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_set_up_call, tvb, offset+1, 1, ENC_NA);
4705 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_send_ss, tvb, offset+1, 1, ENC_NA);
4706 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_send_ussd, tvb, offset+1, 1, ENC_NA);
4707 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_send_short_msg, tvb, offset+1, 1, ENC_NA);
4708 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_send_dtmf, tvb, offset+1, 1, ENC_NA);
4709 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_launch_browser, tvb, offset+1, 1, ENC_NA);
4710 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_geo_loc_req, tvb, offset+2, 1, ENC_NA);
4711 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_play_tone, tvb, offset+2, 1, ENC_NA);
4712 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_display_text, tvb, offset+2, 1, ENC_NA);
4713 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_get_inkey, tvb, offset+2, 1, ENC_NA);
4714 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_get_input, tvb, offset+2, 1, ENC_NA);
4715 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_select_item, tvb, offset+3, 1, ENC_NA);
4716 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_set_up_menu, tvb, offset+3, 1, ENC_NA);
4717 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_prov_local_info, tvb, offset+3, 1, ENC_NA);
4718 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_timer_management, tvb, offset+3, 1, ENC_NA);
4719 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_set_up_idle_mode_text, tvb, offset+3, 1, ENC_NA);
4720 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_perform_card_apdu, tvb, offset+3, 1, ENC_NA);
4721 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_power_on_card, tvb, offset+3, 1, ENC_NA);
4722 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_power_off_card, tvb, offset+4, 1, ENC_NA);
4723 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_get_reader_status, tvb, offset+4, 1, ENC_NA);
4724 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_run_at_cmd, tvb, offset+4, 1, ENC_NA);
4725 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_lang_notif, tvb, offset+4, 1, ENC_NA);
4726 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_open_channel, tvb, offset+5, 1, ENC_NA);
4727 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_close_channel, tvb, offset+5, 1, ENC_NA);
4728 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_receive_data, tvb, offset+5, 1, ENC_NA);
4729 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_send_data, tvb, offset+5, 1, ENC_NA);
4730 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_get_channel_status, tvb, offset+5, 1, ENC_NA);
4731 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_service_search, tvb, offset+5, 1, ENC_NA);
4732 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_get_service_info, tvb, offset+5, 1, ENC_NA);
4733 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_declare_service, tvb, offset+5, 1, ENC_NA);
4734 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_set_frames, tvb, offset+6, 1, ENC_NA);
4735 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_get_frames_status, tvb, offset+6, 1, ENC_NA);
4736 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_retrieve_multimedia_msg, tvb, offset+7, 1, ENC_NA);
4737 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_submit_multimedia_msg, tvb, offset+7, 1, ENC_NA);
4738 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_display_multimedia_msg, tvb, offset+7, 1, ENC_NA);
4739 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_activate, tvb, offset+8, 1, ENC_NA);
4740 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_contactless_state_changed, tvb, offset+8, 1, ENC_NA);
4741 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_cmd_container, tvb, offset+9, 1, ENC_NA);
4742 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_encapsulated_session_ctrl, tvb, offset+9, 1, ENC_NA);
4743 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control_end_proact_session, tvb, offset+10, 1, ENC_NA);
4744 }
4745
4746 static void
mbim_dissect_stk_pac_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4747 mbim_dissect_stk_pac_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4748 {
4749 proto_item *ti;
4750 proto_tree *subtree;
4751
4752 ti = proto_tree_add_item(tree, hf_mbim_stk_pac_info_pac_support, tvb, offset, 256, ENC_NA);
4753 subtree = proto_item_add_subtree(ti, ett_mbim_pac);
4754 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_refresh, tvb, offset+1, 1, ENC_NA);
4755 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_more_time, tvb, offset+2, 1, ENC_NA);
4756 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_poll_interval, tvb, offset+3, 1, ENC_NA);
4757 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_polling_off, tvb, offset+4, 1, ENC_NA);
4758 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_set_up_evt_list, tvb, offset+5, 1, ENC_NA);
4759 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_set_up_call, tvb, offset+10, 1, ENC_NA);
4760 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_send_ss, tvb, offset+11, 1, ENC_NA);
4761 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_send_ussd, tvb, offset+12, 1, ENC_NA);
4762 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_send_short_msg, tvb, offset+13, 1, ENC_NA);
4763 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_send_dtmf, tvb, offset+14, 1, ENC_NA);
4764 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_launch_browser, tvb, offset+15, 1, ENC_NA);
4765 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_geo_loc_req, tvb, offset+16, 1, ENC_NA);
4766 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_play_tone, tvb, offset+20, 1, ENC_NA);
4767 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_display_text, tvb, offset+21, 1, ENC_NA);
4768 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_get_inkey, tvb, offset+22, 1, ENC_NA);
4769 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_get_input, tvb, offset+23, 1, ENC_NA);
4770 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_select_item, tvb, offset+24, 1, ENC_NA);
4771 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_set_up_menu, tvb, offset+25, 1, ENC_NA);
4772 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_prov_local_info, tvb, offset+26, 1, ENC_NA);
4773 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_timer_management, tvb, offset+27, 1, ENC_NA);
4774 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_set_up_idle_mode_text, tvb, offset+28, 1, ENC_NA);
4775 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_perform_card_apdu, tvb, offset+30, 1, ENC_NA);
4776 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_power_on_card, tvb, offset+31, 1, ENC_NA);
4777 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_power_off_card, tvb, offset+32, 1, ENC_NA);
4778 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_get_reader_status, tvb, offset+33, 1, ENC_NA);
4779 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_run_at_cmd, tvb, offset+34, 1, ENC_NA);
4780 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_lang_notif, tvb, offset+35, 1, ENC_NA);
4781 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_open_channel, tvb, offset+40, 1, ENC_NA);
4782 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_close_channel, tvb, offset+41, 1, ENC_NA);
4783 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_receive_data, tvb, offset+42, 1, ENC_NA);
4784 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_send_data, tvb, offset+43, 1, ENC_NA);
4785 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_get_channel_status, tvb, offset+44, 1, ENC_NA);
4786 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_service_search, tvb, offset+45, 1, ENC_NA);
4787 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_get_service_info, tvb, offset+46, 1, ENC_NA);
4788 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_declare_service, tvb, offset+47, 1, ENC_NA);
4789 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_set_frames, tvb, offset+50, 1, ENC_NA);
4790 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_get_frames_status, tvb, offset+51, 1, ENC_NA);
4791 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_retrieve_multimedia_msg, tvb, offset+60, 1, ENC_NA);
4792 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_submit_multimedia_msg, tvb, offset+61, 1, ENC_NA);
4793 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_display_multimedia_msg, tvb, offset+62, 1, ENC_NA);
4794 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_activate, tvb, offset+70, 1, ENC_NA);
4795 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_contactless_state_changed, tvb, offset+71, 1, ENC_NA);
4796 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_cmd_container, tvb, offset+72, 1, ENC_NA);
4797 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_encapsulated_session_ctrl, tvb, offset+73, 1, ENC_NA);
4798 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support_end_proact_session, tvb, offset+81, 1, ENC_NA);
4799 }
4800
4801 static void
mbim_dissect_set_stk_terminal_response(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)4802 mbim_dissect_set_stk_terminal_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
4803 {
4804 tvbuff_t *pac_tvb;
4805 guint32 response_length;
4806 proto_item *ti;
4807 proto_tree *subtree;
4808
4809 proto_tree_add_item_ret_uint(tree, hf_mbim_set_stk_terminal_response_response_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &response_length);
4810 offset += 4;
4811 ti = proto_tree_add_item(tree, hf_mbim_set_stk_terminal_response_data_buffer, tvb, offset, response_length, ENC_NA);
4812 if (etsi_cat_handle) {
4813 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
4814 pac_tvb = tvb_new_subset_length(tvb, offset, response_length);
4815 call_dissector(etsi_cat_handle, pac_tvb, pinfo, subtree);
4816 }
4817 }
4818
4819 static void
mbim_dissect_stk_terminal_response_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4820 mbim_dissect_stk_terminal_response_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4821 {
4822 gint base_offset;
4823 guint32 result_data_string_offset, result_data_string_length;
4824
4825 base_offset = offset;
4826 proto_tree_add_item_ret_uint(tree, hf_mbim_stk_terminal_response_info_result_data_string_offset,
4827 tvb, offset, 4, ENC_LITTLE_ENDIAN, &result_data_string_offset);
4828 offset += 4;
4829 proto_tree_add_item_ret_uint(tree, hf_mbim_stk_terminal_response_info_result_data_string_length,
4830 tvb, offset, 4, ENC_LITTLE_ENDIAN, &result_data_string_length);
4831 offset += 4;
4832 proto_tree_add_item(tree, hf_mbim_stk_terminal_response_info_status_word, tvb, offset,
4833 4, ENC_LITTLE_ENDIAN);
4834 if (result_data_string_offset && result_data_string_length) {
4835 proto_tree_add_item(tree, hf_mbim_stk_terminal_response_info_result_data_string, tvb,
4836 base_offset + result_data_string_offset, result_data_string_length, ENC_NA);
4837 }
4838 }
4839
4840 static void
mbim_dissect_aka_auth_req(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4841 mbim_dissect_aka_auth_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4842 {
4843 proto_tree_add_item(tree, hf_mbim_aka_auth_req_rand, tvb, offset, 16, ENC_NA);
4844 offset += 16;
4845 proto_tree_add_item(tree, hf_mbim_aka_auth_req_autn, tvb, offset, 16, ENC_NA);
4846 }
4847
4848 static void
mbim_dissect_aka_auth_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4849 mbim_dissect_aka_auth_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4850 {
4851 proto_tree_add_item(tree, hf_mbim_aka_auth_info_res, tvb, offset, 16, ENC_NA);
4852 offset += 16;
4853 proto_tree_add_item(tree, hf_mbim_aka_auth_info_res_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4854 offset += 4;
4855 proto_tree_add_item(tree, hf_mbim_aka_auth_info_ik, tvb, offset, 16, ENC_NA);
4856 offset += 16;
4857 proto_tree_add_item(tree, hf_mbim_aka_auth_info_ck, tvb, offset, 16, ENC_NA);
4858 offset += 16;
4859 proto_tree_add_item(tree, hf_mbim_aka_auth_info_auts, tvb, offset, 14, ENC_NA);
4860 }
4861
4862 static void
mbim_dissect_akap_auth_req(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4863 mbim_dissect_akap_auth_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4864 {
4865 gint base_offset;
4866 guint32 network_name_offset, network_name_length;
4867
4868 base_offset = offset;
4869 proto_tree_add_item(tree, hf_mbim_akap_auth_req_rand, tvb, offset, 16, ENC_NA);
4870 offset += 16;
4871 proto_tree_add_item(tree, hf_mbim_akap_auth_req_autn, tvb, offset, 16, ENC_NA);
4872 offset += 16;
4873 proto_tree_add_item_ret_uint(tree, hf_mbim_akap_auth_req_network_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &network_name_offset);
4874 offset += 4;
4875 proto_tree_add_item_ret_uint(tree, hf_mbim_akap_auth_req_network_name_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &network_name_length);
4876 /*offset += 4;*/
4877 if (network_name_offset && network_name_length) {
4878 proto_tree_add_item(tree, hf_mbim_akap_auth_req_network_name, tvb, base_offset + network_name_offset,
4879 network_name_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
4880 }
4881 }
4882
4883 static void
mbim_dissect_akap_auth_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4884 mbim_dissect_akap_auth_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4885 {
4886 proto_tree_add_item(tree, hf_mbim_akap_auth_info_res, tvb, offset, 16, ENC_NA);
4887 offset += 16;
4888 proto_tree_add_item(tree, hf_mbim_akap_auth_info_res_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4889 offset += 4;
4890 proto_tree_add_item(tree, hf_mbim_akap_auth_info_ik, tvb, offset, 16, ENC_NA);
4891 offset += 16;
4892 proto_tree_add_item(tree, hf_mbim_akap_auth_info_ck, tvb, offset, 16, ENC_NA);
4893 offset += 16;
4894 proto_tree_add_item(tree, hf_mbim_akap_auth_info_auts, tvb, offset, 14, ENC_NA);
4895 }
4896
4897 static void
mbim_dissect_sim_auth_req(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4898 mbim_dissect_sim_auth_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4899 {
4900 proto_tree_add_item(tree, hf_mbim_sim_auth_req_rand1, tvb, offset, 16, ENC_NA);
4901 offset += 16;
4902 proto_tree_add_item(tree, hf_mbim_sim_auth_req_rand2, tvb, offset, 16, ENC_NA);
4903 offset += 16;
4904 proto_tree_add_item(tree, hf_mbim_sim_auth_req_rand3, tvb, offset, 16, ENC_NA);
4905 offset += 16;
4906 proto_tree_add_item(tree, hf_mbim_sim_auth_req_n, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4907 }
4908
4909 static void
mbim_dissect_sim_auth_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4910 mbim_dissect_sim_auth_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4911 {
4912 proto_tree_add_item(tree, hf_mbim_sim_auth_info_sres1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4913 offset += 4;
4914 proto_tree_add_item(tree, hf_mbim_sim_auth_info_kc1, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4915 offset += 8;
4916 proto_tree_add_item(tree, hf_mbim_sim_auth_info_sres2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4917 offset += 4;
4918 proto_tree_add_item(tree, hf_mbim_sim_auth_info_kc2, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4919 offset += 8;
4920 proto_tree_add_item(tree, hf_mbim_sim_auth_info_sres3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4921 offset += 4;
4922 proto_tree_add_item(tree, hf_mbim_sim_auth_info_kc3, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4923 offset += 8;
4924 proto_tree_add_item(tree, hf_mbim_sim_auth_info_n, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4925 }
4926
4927 static void
mbim_dissect_set_dss_connect(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4928 mbim_dissect_set_dss_connect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4929 {
4930 guint32 dss_session_id;
4931 struct mbim_uuid_ext *uuid_ext_info = NULL;
4932
4933 mbim_dissect_service_id_uuid(tvb, pinfo, tree, hf_mbim_set_dss_connect_device_service_id, &offset, &uuid_ext_info, TRUE);
4934 dss_session_id = tvb_get_letohl(tvb, offset);
4935 dissector_delete_uint("mbim.dss_session_id", dss_session_id, NULL);
4936 if ((dss_session_id <= 255) && uuid_ext_info && uuid_ext_info->dss_handle) {
4937 dissector_add_uint("mbim.dss_session_id", dss_session_id, uuid_ext_info->dss_handle);
4938 }
4939 proto_tree_add_uint(tree, hf_mbim_set_dss_connect_dss_session_id, tvb, offset, 4, dss_session_id);
4940 offset += 4;
4941 proto_tree_add_item(tree, hf_mbim_set_dss_connect_dss_link_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4942 }
4943
4944 static void
mbim_dissect_muticarrier_current_cid_list_req(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4945 mbim_dissect_muticarrier_current_cid_list_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4946 {
4947 guint8 service_idx;
4948
4949 service_idx = mbim_dissect_service_id_uuid(tvb, pinfo, tree, hf_mbim_multicarrier_current_cid_list_req_uuid, &offset, NULL, TRUE);
4950 if (service_idx != UUID_MULTICARRIER) {
4951 expert_add_info_format(pinfo, NULL, &ei_mbim_unexpected_uuid_value,
4952 "Unexpected UUID value, should be UUID_MULTICARRIER");
4953 }
4954 }
4955
4956 static void
mbim_dissect_muticarrier_current_cid_list_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4957 mbim_dissect_muticarrier_current_cid_list_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4958 {
4959 guint32 i, cid_count;
4960
4961 proto_tree_add_item_ret_uint(tree, hf_mbim_multicarrier_current_cid_list_info_cid_count,
4962 tvb, offset, 4, ENC_LITTLE_ENDIAN, &cid_count);
4963 offset += 4;
4964 for (i = 0; i < cid_count; i++) {
4965 proto_tree_add_item(tree, hf_mbim_multicarrier_current_cid_list_info_cid,
4966 tvb, offset, 4, ENC_LITTLE_ENDIAN);
4967 offset += 4;
4968 }
4969 }
4970
4971 static void
mbim_dissect_thermal_config(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4972 mbim_dissect_thermal_config(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4973 {
4974 int i;
4975 proto_tree *subtree;
4976
4977 for (i = 0; i < 4; i++) {
4978 subtree = proto_tree_add_subtree_format(tree, tvb, offset, 24, ett_mbim_thermal_threshold_setting, NULL, "Threshold %u", i);
4979 proto_tree_add_item(subtree, hf_mbim_thermal_config_enable, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4980 offset += 4;
4981 proto_tree_add_item(subtree, hf_mbim_thermal_config_temp_sensor_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4982 offset += 4;
4983 proto_tree_add_item(subtree, hf_mbim_thermal_config_alarm_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4984 offset += 4;
4985 proto_tree_add_item(subtree, hf_mbim_thermal_config_threshold_value, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4986 offset += 4;
4987 proto_tree_add_item(subtree, hf_mbim_thermal_config_hyst_value, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4988 offset += 4;
4989 proto_tree_add_item(subtree, hf_mbim_thermal_config_sampling_period, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4990 offset += 4;
4991 }
4992 }
4993
4994 static void
mbim_dissect_thermal_state_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)4995 mbim_dissect_thermal_state_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
4996 {
4997 proto_tree_add_item(tree, hf_mbim_thermal_state_info_current_temp_value, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4998 offset += 4;
4999 proto_tree_add_item(tree, hf_mbim_thermal_state_info_enable, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5000 offset += 4;
5001 proto_tree_add_item(tree, hf_mbim_thermal_state_info_temp_sensor_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5002 offset += 4;
5003 proto_tree_add_item(tree, hf_mbim_thermal_state_info_alarm_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5004 offset += 4;
5005 proto_tree_add_item(tree, hf_mbim_thermal_state_info_threshold_value, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5006 offset += 4;
5007 proto_tree_add_item(tree, hf_mbim_thermal_state_info_hyst_value, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5008 offset += 4;
5009 proto_tree_add_item(tree, hf_mbim_thermal_state_info_sampling_period, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5010 }
5011
5012 static void
mbim_dissect_sar_config(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,guint32 buffer_len)5013 mbim_dissect_sar_config(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, guint32 buffer_len)
5014 {
5015 proto_tree_add_item(tree, hf_mbim_sar_config_sar_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5016 offset += 4;
5017 if (buffer_len > 4) {
5018 proto_tree_add_item(tree, hf_mbim_sar_config_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5019 }
5020 }
5021
5022 static void
mbim_dissect_adpclk_freq_value(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,guint32 buffer_len)5023 mbim_dissect_adpclk_freq_value(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, guint32 buffer_len)
5024 {
5025 proto_tree_add_item(tree, hf_mbim_adpclk_freq_info_adpclk_freq_value_center_freq, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5026 offset += 4;
5027 proto_tree_add_item(tree, hf_mbim_adpclk_freq_info_adpclk_freq_value_freq_spread, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5028 offset += 4;
5029 if (buffer_len > 8) {
5030 proto_tree_add_item(tree, hf_mbim_adpclk_freq_info_adpclk_freq_value_noise_power, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5031 offset += 4;
5032 if (buffer_len > 12) {
5033 proto_tree_add_item(tree, hf_mbim_adpclk_freq_info_adpclk_freq_value_rssi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5034 offset += 4;
5035 if (buffer_len > 16) {
5036 proto_tree_add_item(tree, hf_mbim_adpclk_freq_info_adpclk_freq_value_connect_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5037 }
5038 }
5039 }
5040 }
5041
5042 static void
mbim_dissect_adpclk_freq_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)5043 mbim_dissect_adpclk_freq_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
5044 {
5045 proto_tree *subtree;
5046 gint base_offset;
5047 guint32 i, elem_count;
5048 wmem_array_t *pair_list;
5049 struct mbim_pair_list pair_list_item, *p_pair_list_item;
5050
5051 base_offset = offset;
5052 proto_tree_add_item_ret_uint(tree, hf_mbim_adpclk_freq_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
5053 offset += 4;
5054 if (elem_count) {
5055 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
5056 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Element Offset Length Pair");
5057 for (i = 0; i < elem_count; i++) {
5058 proto_tree_add_item_ret_uint(subtree, hf_mbim_adpclk_freq_info_adpclk_freq_value_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
5059 offset += 4;
5060 proto_tree_add_item_ret_uint(subtree, hf_mbim_adpclk_freq_info_adpclk_freq_value_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
5061 offset += 4;
5062 wmem_array_append_one(pair_list, pair_list_item);
5063 }
5064 for (i = 0; i < elem_count; i++) {
5065 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
5066 if (p_pair_list_item->offset && p_pair_list_item->size) {
5067 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size,
5068 ett_mbim_pair_list, NULL, "ADPCLK Freq Value #%u", i+1);
5069 mbim_dissect_adpclk_freq_value(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset, p_pair_list_item->size);
5070 }
5071 }
5072 }
5073 }
5074
5075 static void
mbim_dissect_nrtcws_config(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,guint32 buffer_len)5076 mbim_dissect_nrtcws_config(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, guint32 buffer_len)
5077 {
5078 proto_tree_add_item(tree, hf_mbim_nrtcws_config_mode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5079 offset += 2;
5080 if (buffer_len > 2) {
5081 proto_tree_add_item(tree, hf_mbim_nrtcws_config_wlan_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5082 offset += 2;
5083 proto_tree_add_item(tree, hf_mbim_nrtcws_config_wlan_safe_rx, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5084 offset += 2;
5085 proto_tree_add_item(tree, hf_mbim_nrtcws_config_wlan_bandwidth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5086 offset += 2;
5087 proto_tree_add_item(tree, hf_mbim_nrtcws_config_bt_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5088 offset += 2;
5089 proto_tree_add_item(tree, hf_mbim_nrtcws_config_bt_safe_rx, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5090 }
5091 }
5092
5093 static void
mbim_dissect_nrtcws_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5094 mbim_dissect_nrtcws_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
5095 {
5096 proto_tree_add_item(tree, hf_mbim_nrtcws_info_lte_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5097 offset += 2;
5098 proto_tree_add_item(tree, hf_mbim_nrtcws_info_wlan_safe_rx_min, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5099 offset += 2;
5100 proto_tree_add_item(tree, hf_mbim_nrtcws_info_wlan_safe_rx_max, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5101 offset += 2;
5102 proto_tree_add_item(tree, hf_mbim_nrtcws_info_bt_safe_rx_min, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5103 offset += 2;
5104 proto_tree_add_item(tree, hf_mbim_nrtcws_info_bt_safe_rx_max, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5105 offset += 2;
5106 proto_tree_add_item(tree, hf_mbim_nrtcws_info_lte_sps_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5107 offset += 2;
5108 proto_tree_add_item(tree, hf_mbim_nrtcws_info_lte_sps_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5109 offset += 2;
5110 proto_tree_add_item(tree, hf_mbim_nrtcws_info_lte_sps_initial_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5111 }
5112
5113 static void
mbim_dissect_atds_signal_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5114 mbim_dissect_atds_signal_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
5115 {
5116 proto_tree_add_item(tree, hf_mbim_atds_signal_info_rssi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5117 offset += 4;
5118 proto_tree_add_item(tree, hf_mbim_atds_signal_info_ber, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5119 offset += 4;
5120 proto_tree_add_item(tree, hf_mbim_atds_signal_info_rscp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5121 offset += 4;
5122 proto_tree_add_item(tree, hf_mbim_atds_signal_info_ecno, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5123 offset += 4;
5124 proto_tree_add_item(tree, hf_mbim_atds_signal_info_rsrq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5125 offset += 4;
5126 proto_tree_add_item(tree, hf_mbim_atds_signal_info_rsrp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5127 offset += 4;
5128 proto_tree_add_item(tree, hf_mbim_atds_signal_info_rssnr, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5129 }
5130
5131 static void
mbim_dissect_atds_operator(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5132 mbim_dissect_atds_operator(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
5133 {
5134 gint base_offset;
5135 guint32 provider_id_offset, provider_id_size, provider_name_offset, provider_name_size;
5136 proto_item *it;
5137
5138 base_offset = offset;
5139 proto_tree_add_item_ret_uint(tree, hf_mbim_atds_operator_provider_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_offset);
5140 offset += 4;
5141 proto_tree_add_item_ret_uint(tree, hf_mbim_atds_operator_provider_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_id_size);
5142 offset += 4;
5143 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_atds_operator_provider_state, ett_mbim_bitmap,
5144 mbim_provider_state_fields, ENC_LITTLE_ENDIAN);
5145 offset += 4;
5146 proto_tree_add_item_ret_uint(tree, hf_mbim_atds_operator_provider_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_name_offset);
5147 offset += 4;
5148 proto_tree_add_item_ret_uint(tree, hf_mbim_atds_operator_provider_name_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &provider_name_size);
5149 offset += 4;
5150 proto_tree_add_item (tree, hf_mbim_atds_operator_plmn_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5151 offset += 4;
5152 proto_tree_add_item (tree, hf_mbim_atds_operator_rssi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5153 offset += 4;
5154 proto_tree_add_item (tree, hf_mbim_atds_operator_error_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5155 if (provider_id_offset && provider_id_size) {
5156 it = proto_tree_add_item(tree, hf_mbim_atds_operator_provider_id, tvb, base_offset + provider_id_offset,
5157 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5158 if (provider_id_size > 12) {
5159 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5160 }
5161 }
5162 if (provider_name_offset && provider_name_size) {
5163 it = proto_tree_add_item(tree, hf_mbim_atds_operator_provider_name, tvb, base_offset + provider_name_offset,
5164 provider_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5165 if (provider_name_size > 40) {
5166 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5167 }
5168 }
5169 }
5170
5171 static void
mbim_dissect_atds_operators(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)5172 mbim_dissect_atds_operators(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
5173 {
5174 proto_tree *subtree;
5175 gint base_offset;
5176 guint32 i, elem_count;
5177 wmem_array_t *pair_list;
5178 struct mbim_pair_list pair_list_item, *p_pair_list_item;
5179
5180 base_offset = offset;
5181 proto_tree_add_item_ret_uint(tree, hf_mbim_atds_operators_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
5182 offset += 4;
5183 if (elem_count) {
5184 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
5185 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Operators List");
5186 for (i = 0; i < elem_count; i++) {
5187 proto_tree_add_item_ret_uint(subtree, hf_mbim_atds_operators_operator_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
5188 offset += 4;
5189 proto_tree_add_item_ret_uint(subtree, hf_mbim_atds_operators_operator_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
5190 offset += 4;
5191 wmem_array_append_one(pair_list, pair_list_item);
5192 }
5193 for (i = 0; i < elem_count; i++) {
5194 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
5195 if (p_pair_list_item->offset && p_pair_list_item->size) {
5196 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size,
5197 ett_mbim_pair_list, NULL, "Operator #%u", i+1);
5198 mbim_dissect_atds_operator(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset);
5199 }
5200 }
5201 }
5202 }
5203
5204 static void
mbim_dissect_atds_projection_table(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5205 mbim_dissect_atds_projection_table(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
5206 {
5207 proto_tree_add_item(tree, hf_mbim_atds_projection_table_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5208 offset += 4;
5209 proto_tree_add_item(tree, hf_mbim_atds_projection_table_bar5min, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5210 offset += 4;
5211 proto_tree_add_item(tree, hf_mbim_atds_projection_table_a5, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5212 offset += 4;
5213 proto_tree_add_item(tree, hf_mbim_atds_projection_table_b5, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5214 offset += 4;
5215 proto_tree_add_item(tree, hf_mbim_atds_projection_table_bar4min, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5216 offset += 4;
5217 proto_tree_add_item(tree, hf_mbim_atds_projection_table_a4, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5218 offset += 4;
5219 proto_tree_add_item(tree, hf_mbim_atds_projection_table_b4, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5220 offset += 4;
5221 proto_tree_add_item(tree, hf_mbim_atds_projection_table_bar3min, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5222 offset += 4;
5223 proto_tree_add_item(tree, hf_mbim_atds_projection_table_a3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5224 offset += 4;
5225 proto_tree_add_item(tree, hf_mbim_atds_projection_table_b3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5226 offset += 4;
5227 proto_tree_add_item(tree, hf_mbim_atds_projection_table_bar2min, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5228 offset += 4;
5229 proto_tree_add_item(tree, hf_mbim_atds_projection_table_a2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5230 offset += 4;
5231 proto_tree_add_item(tree, hf_mbim_atds_projection_table_b2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5232 offset += 4;
5233 proto_tree_add_item(tree, hf_mbim_atds_projection_table_bar1min, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5234 offset += 4;
5235 proto_tree_add_item(tree, hf_mbim_atds_projection_table_a1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5236 offset += 4;
5237 proto_tree_add_item(tree, hf_mbim_atds_projection_table_b1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5238 offset += 4;
5239 proto_tree_add_item(tree, hf_mbim_atds_projection_table_bar0min, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5240 offset += 4;
5241 proto_tree_add_item(tree, hf_mbim_atds_projection_table_a0, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5242 offset += 4;
5243 proto_tree_add_item(tree, hf_mbim_atds_projection_table_b0, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5244 }
5245
5246 static void
mbim_dissect_atds_projection_tables(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)5247 mbim_dissect_atds_projection_tables(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
5248 {
5249 proto_tree *subtree;
5250 gint base_offset;
5251 guint32 i, elem_count;
5252 wmem_array_t *pair_list;
5253 struct mbim_pair_list pair_list_item, *p_pair_list_item;
5254
5255 base_offset = offset;
5256 proto_tree_add_item_ret_uint(tree, hf_mbim_atds_projection_tables_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
5257 offset += 4;
5258 if (elem_count) {
5259 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
5260 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Projection Tables List");
5261 for (i = 0; i < elem_count; i++) {
5262 proto_tree_add_item_ret_uint(subtree, hf_mbim_atds_projection_tables_projection_table_offset,
5263 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
5264 offset += 4;
5265 proto_tree_add_item_ret_uint(subtree, hf_mbim_atds_projection_tables_projection_table_size,
5266 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
5267 offset += 4;
5268 wmem_array_append_one(pair_list, pair_list_item);
5269 }
5270 for (i = 0; i < elem_count; i++) {
5271 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
5272 if (p_pair_list_item->offset && p_pair_list_item->size) {
5273 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size,
5274 ett_mbim_pair_list, NULL, "Projection Table #%u", i+1);
5275 mbim_dissect_atds_projection_table(tvb, pinfo, subtree, base_offset + p_pair_list_item->offset);
5276 }
5277 }
5278 }
5279 }
5280
5281 static void
mbim_dissect_multiflow_tft_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)5282 mbim_dissect_multiflow_tft_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
5283 {
5284 proto_tree *subtree;
5285 gint base_offset;
5286 guint32 i, elem_count;
5287 wmem_array_t *pair_list;
5288 struct mbim_pair_list pair_list_item, *p_pair_list_item;
5289
5290 base_offset = offset;
5291 proto_tree_add_item(tree, hf_mbim_multiflow_tft_info_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5292 offset += 4;
5293 proto_tree_add_item_ret_uint(tree, hf_mbim_multiflow_tft_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
5294 offset += 4;
5295 if (elem_count) {
5296 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
5297 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "TFT List");
5298 for (i = 0; i < elem_count; i++) {
5299 proto_tree_add_item_ret_uint(subtree, hf_mbim_multiflow_tft_info_tft_list_offset,
5300 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
5301 offset += 4;
5302 proto_tree_add_item_ret_uint(subtree, hf_mbim_multiflow_tft_info_tft_list_size,
5303 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
5304 offset += 4;
5305 wmem_array_append_one(pair_list, pair_list_item);
5306 }
5307 for (i = 0; i < elem_count; i++) {
5308 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
5309 if (p_pair_list_item->offset && p_pair_list_item->size) {
5310 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size,
5311 ett_mbim_pair_list, NULL, "TFT #%u", i+1);
5312 de_sm_tflow_temp(tvb, subtree, pinfo, base_offset + p_pair_list_item->offset, p_pair_list_item->size, NULL, 0);
5313 }
5314 }
5315 }
5316 }
5317
5318 static void
mbim_dissect_ms_context_v2_base(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint * offset,gint base_offset)5319 mbim_dissect_ms_context_v2_base(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset, gint base_offset)
5320 {
5321 guint32 access_string_offset, access_string_size, user_name_offset, user_name_size, password_offset, password_size;
5322 proto_item *it;
5323
5324 mbim_dissect_context_type_uuid(tvb, pinfo, tree, offset);
5325 proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_ip_type, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
5326 *offset += 4;
5327 proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_enable, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
5328 *offset += 4;
5329 proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_roaming, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
5330 *offset += 4;
5331 proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_media_type, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
5332 *offset += 4;
5333 proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_source, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
5334 *offset += 4;
5335 proto_tree_add_item_ret_uint(tree, hf_mbim_set_ms_provisioned_context_v2_access_string_offset, tvb, *offset, 4, ENC_LITTLE_ENDIAN, &access_string_offset);
5336 *offset += 4;
5337 proto_tree_add_item_ret_uint(tree, hf_mbim_set_ms_provisioned_context_v2_access_string_size, tvb, *offset, 4, ENC_LITTLE_ENDIAN, &access_string_size);
5338 *offset += 4;
5339 proto_tree_add_item_ret_uint(tree, hf_mbim_set_ms_provisioned_context_v2_user_name_offset, tvb, *offset, 4, ENC_LITTLE_ENDIAN, &user_name_offset);
5340 *offset += 4;
5341 proto_tree_add_item_ret_uint(tree, hf_mbim_set_ms_provisioned_context_v2_user_name_size, tvb, *offset, 4, ENC_LITTLE_ENDIAN, &user_name_size);
5342 *offset += 4;
5343 proto_tree_add_item_ret_uint(tree, hf_mbim_set_ms_provisioned_context_v2_password_offset, tvb, *offset, 4, ENC_LITTLE_ENDIAN, &password_offset);
5344 *offset += 4;
5345 proto_tree_add_item_ret_uint(tree, hf_mbim_set_ms_provisioned_context_v2_password_size, tvb, *offset, 4, ENC_LITTLE_ENDIAN, &password_size);
5346 *offset += 4;
5347 proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_compression, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
5348 *offset += 4;
5349 proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_auth_protocol, tvb, *offset, 4, ENC_LITTLE_ENDIAN);
5350 *offset += 4;
5351 if (access_string_offset && access_string_size) {
5352 it = proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_access_string, tvb,
5353 base_offset + access_string_offset, access_string_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5354 if (access_string_size > 200) {
5355 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5356 }
5357 }
5358 if (user_name_offset && user_name_size) {
5359 it = proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_user_name, tvb,
5360 base_offset + user_name_offset, user_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5361 if (user_name_size > 510) {
5362 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5363 }
5364 }
5365 if (password_offset && password_size) {
5366 it = proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_password, tvb,
5367 base_offset + password_offset, password_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5368 if (password_size > 510) {
5369 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5370 }
5371 }
5372 }
5373
5374 static void
mbim_dissect_set_ms_provisioned_context_v2(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)5375 mbim_dissect_set_ms_provisioned_context_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
5376 {
5377 gint base_offset;
5378
5379 base_offset = offset;
5380 proto_tree_add_item(tree, hf_mbim_set_ms_provisioned_context_v2_operation, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5381 offset += 4;
5382 mbim_dissect_ms_context_v2_base(tvb, pinfo, tree, &offset, base_offset);
5383 }
5384
5385 static void
mbim_dissect_ms_provisioned_context_info_v2(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)5386 mbim_dissect_ms_provisioned_context_info_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
5387 {
5388 proto_tree *subtree;
5389 gint base_offset, item_offset, base_item_offset;
5390 guint32 i, elem_count;
5391 wmem_array_t *pair_list;
5392 struct mbim_pair_list pair_list_item, *p_pair_list_item;
5393
5394 base_offset = offset;
5395 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_provisioned_context_info_v2_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
5396 offset += 4;
5397 if (elem_count) {
5398 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
5399 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Provisioned Contexts Ref List");
5400 for (i = 0; i < elem_count; i++) {
5401 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_provisioned_context_info_v2_list_offset,
5402 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
5403 offset += 4;
5404 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_provisioned_context_info_v2_list_size,
5405 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
5406 offset += 4;
5407 wmem_array_append_one(pair_list, pair_list_item);
5408 }
5409 for (i = 0; i < elem_count; i++) {
5410 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
5411 if (p_pair_list_item->offset && p_pair_list_item->size) {
5412 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size,
5413 ett_mbim_pair_list, NULL, "Context #%u", i+1);
5414 item_offset = base_offset + p_pair_list_item->offset;
5415 base_item_offset = item_offset;
5416 proto_tree_add_item(subtree, hf_mbim_ms_provisioned_context_info_v2_context_id, tvb, item_offset, 4, ENC_LITTLE_ENDIAN);
5417 item_offset += 4;
5418 mbim_dissect_ms_context_v2_base(tvb, pinfo, subtree, &item_offset, base_item_offset);
5419 }
5420 }
5421 }
5422 }
5423
5424 static void
mbim_dissect_ms_network_blacklist_info(packet_info * pinfo,tvbuff_t * tvb,proto_tree * tree,gint offset)5425 mbim_dissect_ms_network_blacklist_info(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, gint offset)
5426 {
5427 proto_tree *subtree;
5428 gint base_offset, item_offset;
5429 guint32 i, elem_count;
5430 wmem_array_t *pair_list;
5431 struct mbim_pair_list pair_list_item, *p_pair_list_item;
5432
5433 base_offset = offset;
5434 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_ms_network_blacklist_info_blacklist_state,
5435 ett_mbim_bitmap, mbim_ms_network_blacklist_state_fields, ENC_LITTLE_ENDIAN);
5436
5437 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_network_blacklist_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
5438 offset += 4;
5439 if (elem_count) {
5440 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
5441 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Provider Blacklist Ref List");
5442 for (i = 0; i < elem_count; i++) {
5443 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_network_blacklist_info_list_offset,
5444 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
5445 offset += 4;
5446 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_network_blacklist_info_list_size,
5447 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
5448 offset += 4;
5449 wmem_array_append_one(pair_list, pair_list_item);
5450 }
5451 for (i = 0; i < elem_count; i++) {
5452 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
5453 if (p_pair_list_item->offset && p_pair_list_item->size) {
5454 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size,
5455 ett_mbim_pair_list, NULL, "Blacklisted Provider #%u", i+1);
5456 item_offset = base_offset + p_pair_list_item->offset;
5457 proto_tree_add_item(subtree, hf_mbim_ms_network_blacklist_provider_mcc, tvb, item_offset, 4, ENC_LITTLE_ENDIAN);
5458 item_offset += 4;
5459 proto_tree_add_item(subtree, hf_mbim_ms_network_blacklist_provider_mnc, tvb, item_offset, 4, ENC_LITTLE_ENDIAN);
5460 item_offset += 4;
5461 proto_tree_add_item(subtree, hf_mbim_ms_network_blacklist_provider_type, tvb, item_offset, 4, ENC_LITTLE_ENDIAN);
5462 }
5463 }
5464 }
5465 }
5466
5467 static void
mbim_dissect_sys_caps_info(tvbuff_t * tvb,proto_tree * tree,gint offset)5468 mbim_dissect_sys_caps_info(tvbuff_t *tvb, proto_tree *tree, gint offset)
5469 {
5470 proto_tree_add_item(tree, hf_mbim_sys_caps_info_number_of_executors, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5471 offset += 4;
5472 proto_tree_add_item(tree, hf_mbim_sys_caps_info_number_of_slots, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5473 offset += 4;
5474 proto_tree_add_item(tree, hf_mbim_sys_caps_info_concurrency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5475 offset += 4;
5476 proto_tree_add_item(tree, hf_mbim_sys_caps_info_modem_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5477 }
5478
5479 static void
mbim_dissect_device_caps_v2_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)5480 mbim_dissect_device_caps_v2_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset,
5481 struct mbim_conv_info *mbim_conv)
5482 {
5483 gint base_offset;
5484 guint32 custom_class_offset, custom_class_size, device_id_offset, device_id_size,
5485 fw_info_offset, fw_info_size, hw_info_offset, hw_info_size;
5486 proto_item *it;
5487
5488 base_offset = offset;
5489 proto_tree_add_item(tree, hf_mbim_device_caps_info_device_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5490 offset += 4;
5491 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_cellular_class, tvb, offset, 4,
5492 ENC_LITTLE_ENDIAN, &mbim_conv->cellular_class);
5493 offset += 4;
5494 proto_tree_add_item(tree, hf_mbim_device_caps_info_voice_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5495 offset += 4;
5496 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_sim_class, ett_mbim_bitmap,
5497 mbim_device_caps_info_sim_class_fields, ENC_LITTLE_ENDIAN);
5498 offset += 4;
5499 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_data_class, ett_mbim_bitmap,
5500 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
5501 offset += 4;
5502 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_sms_caps, ett_mbim_bitmap,
5503 mbim_device_caps_info_sms_caps_fields, ENC_LITTLE_ENDIAN);
5504 offset += 4;
5505 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_control_caps, ett_mbim_bitmap,
5506 mbim_device_caps_info_control_caps_fields, ENC_LITTLE_ENDIAN);
5507 offset += 4;
5508 proto_tree_add_item(tree, hf_mbim_device_caps_info_max_sessions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5509 offset += 4;
5510 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_custom_data_class_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &custom_class_offset);
5511 offset += 4;
5512 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_custom_data_class_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &custom_class_size);
5513 offset += 4;
5514 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_device_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &device_id_offset);
5515 offset += 4;
5516 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_device_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &device_id_size);
5517 offset += 4;
5518 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_fw_info_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &fw_info_offset);
5519 offset += 4;
5520 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_fw_info_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &fw_info_size);
5521 offset += 4;
5522 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_hw_info_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &hw_info_offset);
5523 offset += 4;
5524 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_hw_info_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &hw_info_size);
5525 offset += 4;
5526 proto_tree_add_item(tree, hf_mbim_device_caps_info_v2_executor_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5527 if (custom_class_offset && custom_class_size) {
5528 it = proto_tree_add_item(tree, hf_mbim_device_caps_info_custom_data_class, tvb, base_offset + custom_class_offset,
5529 custom_class_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5530 if (custom_class_size > 22) {
5531 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5532 }
5533 }
5534 if (device_id_offset && device_id_size) {
5535 it = proto_tree_add_item(tree, hf_mbim_device_caps_info_device_id, tvb, base_offset + device_id_offset,
5536 device_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5537 if ((mbim_conv->cellular_class == MBIM_CELLULAR_CLASS_GSM) && (device_id_size > 30)) {
5538 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5539 } else if (device_id_size > 36) {
5540 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5541 }
5542 }
5543 if (fw_info_offset && fw_info_size) {
5544 it = proto_tree_add_item(tree, hf_mbim_device_caps_info_fw_info, tvb, base_offset + fw_info_offset,
5545 fw_info_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5546 if (fw_info_size > 60) {
5547 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5548 }
5549 }
5550 if (hw_info_offset && hw_info_size) {
5551 it = proto_tree_add_item(tree, hf_mbim_device_caps_info_hw_info, tvb, base_offset + hw_info_offset,
5552 hw_info_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
5553 if (hw_info_size > 60) {
5554 expert_add_info(pinfo, it, &ei_mbim_oversized_string);
5555 }
5556 }
5557 }
5558
5559 static void
mbim_dissect_device_caps_v3_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)5560 mbim_dissect_device_caps_v3_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset,
5561 struct mbim_conv_info *mbim_conv)
5562 {
5563 proto_tree *lte_band_class, *nr_band_class, *custom_data_class, *device_id, *firmware_info, *hardware_info;
5564
5565 proto_tree_add_item(tree, hf_mbim_device_caps_info_device_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5566 offset += 4;
5567 proto_tree_add_item_ret_uint(tree, hf_mbim_device_caps_info_cellular_class, tvb, offset, 4,
5568 ENC_LITTLE_ENDIAN, &mbim_conv->cellular_class);
5569 offset += 4;
5570 proto_tree_add_item(tree, hf_mbim_device_caps_info_voice_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5571 offset += 4;
5572 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_sim_class, ett_mbim_bitmap,
5573 mbim_device_caps_info_sim_class_fields, ENC_LITTLE_ENDIAN);
5574 offset += 4;
5575 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_data_class, ett_mbim_bitmap,
5576 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
5577 offset += 4;
5578 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_sms_caps, ett_mbim_bitmap,
5579 mbim_device_caps_info_sms_caps_fields, ENC_LITTLE_ENDIAN);
5580 offset += 4;
5581 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_control_caps, ett_mbim_bitmap,
5582 mbim_device_caps_info_control_caps_fields, ENC_LITTLE_ENDIAN);
5583 offset += 4;
5584 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_data_subclass, ett_mbim_bitmap,
5585 mbim_data_subclass_fields, ENC_LITTLE_ENDIAN);
5586 offset += 8;
5587 proto_tree_add_item(tree, hf_mbim_device_caps_info_max_sessions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5588 offset += 4;
5589 proto_tree_add_item(tree, hf_mbim_device_caps_info_v2_executor_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5590 offset += 4;
5591 proto_tree_add_item(tree, hf_mbim_device_caps_info_wcdma_band_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5592 offset += 4;
5593
5594 lte_band_class = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "LTE Band Class");
5595 mbim_dissect_tlv_ie(tvb, pinfo, lte_band_class, &offset);
5596
5597 nr_band_class = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "NR Band Class");
5598 mbim_dissect_tlv_ie(tvb, pinfo, nr_band_class, &offset);
5599
5600 custom_data_class = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Custom Data Class");
5601 mbim_dissect_tlv_ie(tvb, pinfo, custom_data_class, &offset);
5602
5603 device_id = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Device ID");
5604 mbim_dissect_tlv_ie(tvb, pinfo, device_id, &offset);
5605
5606 firmware_info = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Firmware Info");
5607 mbim_dissect_tlv_ie(tvb, pinfo, firmware_info, &offset);
5608
5609 hardware_info = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Hardware Info");
5610 mbim_dissect_tlv_ie(tvb, pinfo, hardware_info, &offset);
5611 }
5612
5613 static void
mbim_dissect_ms_device_slot_mapping_info(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,gint offset)5614 mbim_dissect_ms_device_slot_mapping_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
5615 {
5616 proto_tree_add_item(tree, hf_mbim_ms_device_slot_mapping_info_map_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5617 offset += 4;
5618
5619 proto_tree *subtree;
5620 gint base_offset;
5621 guint32 i, elem_count;
5622 wmem_array_t *pair_list;
5623 struct mbim_pair_list pair_list_item, *p_pair_list_item;
5624
5625 base_offset = offset;
5626 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_device_slot_mapping_info_map_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count);
5627 offset += 4;
5628 if (elem_count) {
5629 pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list));
5630 subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Slot Map List");
5631 for (i = 0; i < elem_count; i++) {
5632 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_device_slot_mapping_info_map_offset,
5633 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset);
5634 offset += 4;
5635 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_device_slot_mapping_info_map_size,
5636 tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.size);
5637 offset += 4;
5638 wmem_array_append_one(pair_list, pair_list_item);
5639 }
5640 for (i = 0; i < elem_count; i++) {
5641 p_pair_list_item = (struct mbim_pair_list*)wmem_array_index(pair_list, i);
5642 if (p_pair_list_item->offset && p_pair_list_item->size) {
5643 subtree = proto_tree_add_subtree_format(tree, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size,
5644 ett_mbim_pair_list, NULL, "Device #%u", i+1);
5645 proto_tree_add_item(subtree, hf_mbim_ms_device_slot_mapping_info_executor_slot_index, tvb, base_offset + p_pair_list_item->offset, p_pair_list_item->size, ENC_LITTLE_ENDIAN);
5646 }
5647 }
5648 }
5649 }
5650
5651 static void
mbim_dissect_version(tvbuff_t * tvb,proto_tree * tree,gint offset,struct mbim_conv_info * mbim_conv)5652 mbim_dissect_version(tvbuff_t* tvb, proto_tree* tree, gint offset, struct mbim_conv_info* mbim_conv)
5653 {
5654 guint32 extended_version;
5655
5656 proto_tree_add_item(tree, hf_mbim_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5657 offset += 2;
5658 proto_tree_add_item_ret_uint(tree, hf_mbim_extended_version, tvb, offset, 2, ENC_LITTLE_ENDIAN, &extended_version);
5659 switch (extended_version)
5660 {
5661 case 0x0100:
5662 mbim_conv->mbim_extended_version = MBIM_Extended_Version_1;
5663 break;
5664 case 0x0200:
5665 mbim_conv->mbim_extended_version = MBIM_Extended_Version_2;
5666 break;
5667 case 0x0300:
5668 mbim_conv->mbim_extended_version = MBIM_Extended_Version_3;
5669 break;
5670 default:
5671 mbim_conv->mbim_extended_version = MBIM_Extended_Version_Unknown;
5672 break;
5673 }
5674 }
5675
5676 static void
mbim_dissect_ms_modem_config_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,guint32 buffer_len)5677 mbim_dissect_ms_modem_config_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, guint32 buffer_len)
5678 {
5679 proto_tree *config_name, *unnamed_ies;
5680 guint32 base_offset;
5681
5682 base_offset = offset;
5683 proto_tree_add_item(tree, hf_mbim_ms_modem_config_config_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5684 offset += 4;
5685 config_name = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Config Name");
5686 mbim_dissect_tlv_ie(tvb, pinfo, config_name, &offset);
5687 while ((guint32)offset - base_offset < buffer_len) {
5688 unnamed_ies = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Unnamed IE's");
5689 mbim_dissect_tlv_ie(tvb, pinfo, unnamed_ies, &offset);
5690 }
5691 }
5692
5693 static void
mbim_dissect_ms_registration_params_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,guint32 buffer_len)5694 mbim_dissect_ms_registration_params_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, guint32 buffer_len)
5695 {
5696 proto_tree *unnamed_ies;
5697 guint32 base_offset;
5698
5699 base_offset = offset;
5700 proto_tree_add_item(tree, hf_mbim_ms_registration_params_info_mico_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5701 offset += 4;
5702 proto_tree_add_item(tree, hf_mbim_ms_registration_params_info_drx_params, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5703 offset += 4;
5704 proto_tree_add_item(tree, hf_mbim_ms_registration_params_info_ladn_info, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5705 offset += 4;
5706 proto_tree_add_item(tree, hf_mbim_ms_registration_params_info_default_pdu_hint, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5707 offset += 4;
5708 proto_tree_add_item(tree, hf_mbim_ms_registration_params_info_re_register_if_needed, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5709 offset += 4;
5710 while ((guint32)offset - base_offset < buffer_len) {
5711 unnamed_ies = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Unnamed IE's");
5712 mbim_dissect_tlv_ie(tvb, pinfo, unnamed_ies, &offset);
5713 }
5714 }
5715
5716 static void
mbim_dissect_ms_wake_reason(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5717 mbim_dissect_ms_wake_reason(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
5718 {
5719 proto_tree *wake_reason_tree;
5720 proto_tree_add_item(tree, hf_mbim_ms_wake_reason_wake_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5721 offset += 4;
5722 proto_tree_add_item(tree, hf_mbim_ms_wake_reason_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5723 offset += 4;
5724 wake_reason_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0, ett_mbim_pair_list, NULL, "Wake Reason");
5725 mbim_dissect_tlv_ie(tvb, pinfo, wake_reason_tree, &offset);
5726 }
5727
5728 static void
mbim_dissect_ms_atr_info(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5729 mbim_dissect_ms_atr_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
5730 {
5731 gint base_offset;
5732 guint32 atr_offset, atr_size;
5733 tvbuff_t *next_tvb;
5734
5735 base_offset = offset;
5736 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_atr_info_atr_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &atr_size);
5737 offset += 4;
5738 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_atr_info_atr_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &atr_offset);
5739
5740 if (atr_offset && atr_size) {
5741 if (iso7816_atr_handle) {
5742 next_tvb = tvb_new_subset_length(tvb, base_offset + atr_offset, atr_size);
5743 call_dissector(iso7816_atr_handle, next_tvb, pinfo, tree);
5744 } else {
5745 proto_tree_add_item(tree, hf_mbim_info_buffer, tvb, base_offset + atr_offset, atr_size, ENC_NA);
5746 }
5747
5748 // TODO: check atr_size <= 33
5749 }
5750 }
5751
5752 static void
mbim_dissect_ms_app_info_elements(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset,guint32 app_count)5753 mbim_dissect_ms_app_info_elements(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset, guint32 app_count)
5754 {
5755 guint32 app_name_length, i;
5756 guint32 app_id_size, num_pins;
5757 proto_tree* subtree;
5758 const gint app_info_size = 296;
5759
5760 for (i = 0; i < app_count; i++) {
5761 subtree = proto_tree_add_subtree_format(tree, tvb, offset, app_info_size, ett_mbim_pair_list, NULL, "App Info #%u", i + 1);
5762 proto_tree_add_item(subtree, hf_mbim_ms_app_info_app_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5763 offset += 4;
5764 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_app_info_app_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_id_size);
5765 offset += 4;
5766 proto_tree_add_item(subtree, hf_mbim_ms_app_info_app_id, tvb, offset, app_id_size, ENC_NA);
5767 offset += 16;
5768 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_app_info_app_name_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_name_length);
5769 offset += 4;
5770 proto_tree_add_item(subtree, hf_mbim_ms_app_info_app_name, tvb, offset, app_name_length, ENC_UTF_8|ENC_NA);
5771 offset += 256;
5772 proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_app_info_num_pins, tvb, offset, 4, ENC_LITTLE_ENDIAN, &num_pins);
5773 offset += 4;
5774 if (num_pins) {
5775 proto_tree_add_item(subtree, hf_mbim_ms_app_info_pin_ref, tvb, offset, num_pins, ENC_NA);
5776 }
5777 }
5778 }
5779
5780 static void
mbim_dissect_ms_app_list(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5781 mbim_dissect_ms_app_list(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset)
5782 {
5783 gint base_offset;
5784 guint32 app_count, app_list_offset;
5785
5786 base_offset = offset;
5787 proto_tree_add_item(tree, hf_mbim_ms_app_list_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5788 offset += 4;
5789 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_app_list_app_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_count);
5790 offset += 4;
5791 proto_tree_add_item(tree, hf_mbim_ms_app_list_active_app_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5792 offset += 4;
5793 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_app_list_app_list_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_list_offset);
5794 offset += 4;
5795 proto_tree_add_item(tree, hf_mbim_ms_app_list_app_list_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5796 /*offset += 4;*/
5797 if (app_count && app_list_offset) {
5798 offset = base_offset + app_list_offset;
5799 mbim_dissect_ms_app_info_elements(tvb, pinfo, tree, offset, app_count);
5800 }
5801 }
5802
5803 static void
mbim_dissect_ms_file_path(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5804 mbim_dissect_ms_file_path(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset)
5805 {
5806 gint base_offset;
5807 guint32 app_id_offset, app_id_size, file_path_offset, file_path_size;
5808
5809 base_offset = offset;
5810 proto_tree_add_item(tree, hf_mbim_ms_file_path_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5811 offset += 4;
5812 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_file_path_app_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_id_offset);
5813 offset += 4;
5814 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_file_path_app_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_id_size);
5815 offset += 4;
5816 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_file_path_file_path_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &file_path_offset);
5817 offset += 4;
5818 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_file_path_file_path_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &file_path_size);
5819 if (app_id_offset && app_id_size) {
5820 proto_tree_add_item(tree, hf_mbim_ms_file_path_app_id, tvb, base_offset + app_id_offset,
5821 app_id_size, ENC_NA);
5822 }
5823 if (file_path_offset && file_path_size) {
5824 proto_tree_add_item(tree, hf_mbim_ms_file_path_file_path, tvb, base_offset + file_path_offset,
5825 file_path_size, ENC_NA);
5826 }
5827 }
5828
5829 static void
mbim_dissect_ms_file_status(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5830 mbim_dissect_ms_file_status(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset)
5831 {
5832 guint32 i;
5833
5834 proto_tree_add_item(tree, hf_mbim_ms_file_status_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5835 offset += 4;
5836 proto_tree_add_item(tree, hf_mbim_ms_file_status_status_word_1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5837 offset += 4;
5838 proto_tree_add_item(tree, hf_mbim_ms_file_status_status_word_2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5839 offset += 4;
5840 proto_tree_add_item(tree, hf_mbim_ms_file_status_file_accessibility, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5841 offset += 4;
5842 proto_tree_add_item(tree, hf_mbim_ms_file_status_file_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5843 offset += 4;
5844 proto_tree_add_item(tree, hf_mbim_ms_file_status_file_structure, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5845 offset += 4;
5846 proto_tree_add_item(tree, hf_mbim_ms_file_status_item_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5847 offset += 4;
5848 proto_tree_add_item(tree, hf_mbim_ms_file_status_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5849 for (i = 0; i < 4; i++) {
5850 offset += 4;
5851 proto_tree_add_item(tree, hf_mbim_ms_file_status_file_lock_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5852 }
5853 }
5854
5855 static void
mbim_dissect_ms_response(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5856 mbim_dissect_ms_response(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset)
5857 {
5858 gint base_offset;
5859 guint32 response_data_offset, response_data_size;
5860
5861 base_offset = offset;
5862 proto_tree_add_item(tree, hf_mbim_ms_response_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5863 offset += 4;
5864 proto_tree_add_item(tree, hf_mbim_ms_response_status_word_1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5865 offset += 4;
5866 proto_tree_add_item(tree, hf_mbim_ms_response_status_word_2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5867 offset += 4;
5868 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_response_response_data_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &response_data_offset);
5869 offset += 4;
5870 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_response_response_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &response_data_size);
5871 if (response_data_offset && response_data_size) {
5872 proto_tree_add_item(tree, hf_mbim_ms_response_response_data, tvb, base_offset + response_data_offset,
5873 response_data_size, ENC_NA);
5874 }
5875 }
5876
5877 static void
mbim_dissect_ms_access_binary(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5878 mbim_dissect_ms_access_binary(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset)
5879 {
5880 gint base_offset;
5881 guint32 app_id_offset, app_id_size, file_path_offset, file_path_size, local_pin_offset, local_pin_size, binary_data_offset, binary_data_size;
5882
5883 base_offset = offset;
5884 proto_tree_add_item(tree, hf_mbim_ms_access_binary_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5885 offset += 4;
5886 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_binary_app_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_id_offset);
5887 offset += 4;
5888 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_binary_app_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_id_size);
5889 offset += 4;
5890 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_binary_file_path_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &file_path_offset);
5891 offset += 4;
5892 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_binary_file_path_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &file_path_size);
5893 offset += 4;
5894 proto_tree_add_item(tree, hf_mbim_ms_access_binary_file_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5895 offset += 4;
5896 proto_tree_add_item(tree, hf_mbim_ms_access_binary_number_of_bytes, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5897 offset += 4;
5898 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_binary_local_pin_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &local_pin_offset);
5899 offset += 4;
5900 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_binary_local_pin_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &local_pin_size);
5901 offset += 4;
5902 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_binary_binary_data_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &binary_data_offset);
5903 offset += 4;
5904 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_binary_binary_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &binary_data_size);
5905 if (app_id_offset && app_id_size) {
5906 proto_tree_add_item(tree, hf_mbim_ms_access_binary_app_id, tvb, base_offset + app_id_offset,
5907 app_id_size, ENC_NA);
5908 }
5909 if (file_path_offset && file_path_size) {
5910 proto_tree_add_item(tree, hf_mbim_ms_access_binary_file_path, tvb, base_offset + file_path_offset,
5911 file_path_size, ENC_NA);
5912 }
5913 if (local_pin_offset && local_pin_size) {
5914 proto_tree_add_item(tree, hf_mbim_ms_access_binary_local_pin, tvb, base_offset + local_pin_offset,
5915 local_pin_size, ENC_UTF_8 | ENC_NA);
5916 }
5917 if (binary_data_offset && binary_data_size) {
5918 proto_tree_add_item(tree, hf_mbim_ms_access_binary_binary_data, tvb, base_offset + binary_data_offset,
5919 binary_data_size, ENC_NA);
5920 }
5921 }
5922
5923 static void
mbim_dissect_ms_access_record(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,gint offset)5924 mbim_dissect_ms_access_record(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, gint offset)
5925 {
5926 gint base_offset;
5927 guint32 app_id_offset, app_id_size, file_path_offset, file_path_size, local_pin_offset, local_pin_size, record_data_offset, record_data_size;
5928
5929 base_offset = offset;
5930 proto_tree_add_item(tree, hf_mbim_ms_access_record_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5931 offset += 4;
5932 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_record_app_id_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_id_offset);
5933 offset += 4;
5934 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_record_app_id_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &app_id_size);
5935 offset += 4;
5936 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_record_file_path_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &file_path_offset);
5937 offset += 4;
5938 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_record_file_path_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &file_path_size);
5939 offset += 4;
5940 proto_tree_add_item(tree, hf_mbim_ms_access_record_record_number, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5941 offset += 4;
5942 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_record_local_pin_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &local_pin_offset);
5943 offset += 4;
5944 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_record_local_pin_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &local_pin_size);
5945 offset += 4;
5946 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_record_record_data_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &record_data_offset);
5947 offset += 4;
5948 proto_tree_add_item_ret_uint(tree, hf_mbim_ms_access_record_record_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN, &record_data_size);
5949 if (app_id_offset && app_id_size) {
5950 proto_tree_add_item(tree, hf_mbim_ms_access_record_app_id, tvb, base_offset + app_id_offset,
5951 app_id_size, ENC_NA);
5952 }
5953 if (file_path_offset && file_path_size) {
5954 proto_tree_add_item(tree, hf_mbim_ms_access_record_file_path, tvb, base_offset + file_path_offset,
5955 file_path_size, ENC_NA);
5956 }
5957 if (local_pin_offset && local_pin_size) {
5958 proto_tree_add_item(tree, hf_mbim_ms_access_record_local_pin, tvb, base_offset + local_pin_offset,
5959 local_pin_size, ENC_LITTLE_ENDIAN | ENC_UTF_8);
5960 }
5961 if (record_data_offset && record_data_size) {
5962 proto_tree_add_item(tree, hf_mbim_ms_access_record_record_data, tvb, base_offset + record_data_offset,
5963 record_data_size, ENC_NA);
5964 }
5965 }
5966
5967 static int
dissect_mbim_control(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data)5968 dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5969 {
5970 proto_item *ti;
5971 proto_tree *mbim_tree, *header_tree, *subtree;
5972 gint offset = 0;
5973 guint32 msg_type, trans_id, open_count;
5974 guint64 trans_id_key, *p_trans_id_key;
5975 conversation_t *conversation;
5976 struct mbim_conv_info *mbim_conv;
5977 struct mbim_info *mbim_info = NULL;
5978
5979 if (data) {
5980 usb_trans_info_t *usb_trans_info = ((usb_conv_info_t *)data)->usb_trans_info;
5981 if (usb_trans_info && (usb_trans_info->setup.request == 0x00)) {
5982 tree = proto_tree_get_parent_tree(tree);
5983 }
5984 }
5985
5986 if (mbim_control_decode_unknown_itf && (tvb_reported_length_remaining(tvb, offset) < 12)) {
5987 return 0;
5988 }
5989
5990 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MBIM");
5991 col_clear(pinfo->cinfo, COL_INFO);
5992
5993 conversation = find_or_create_conversation(pinfo);
5994 mbim_conv = (struct mbim_conv_info *)conversation_get_proto_data(conversation, proto_mbim);
5995 if (!mbim_conv) {
5996 mbim_conv = wmem_new(wmem_file_scope(), struct mbim_conv_info);
5997 mbim_conv->trans = wmem_map_new(wmem_file_scope(), wmem_int64_hash, g_int64_equal);
5998 mbim_conv->open = wmem_tree_new(wmem_file_scope());
5999 mbim_conv->cellular_class = 0;
6000 mbim_conv->mbim_extended_version = MBIM_Extended_Version_Unknown;
6001 mbim_conv->open_count = 0;
6002 wmem_tree_insert32(mbim_conv->open, pinfo->num, GUINT_TO_POINTER(mbim_conv->open_count));
6003 conversation_add_proto_data(conversation, proto_mbim, mbim_conv);
6004 }
6005
6006 ti = proto_tree_add_item(tree, proto_mbim, tvb, offset, -1, ENC_NA);
6007 mbim_tree = proto_item_add_subtree(ti, ett_mbim);
6008 ti = proto_tree_add_item(mbim_tree, hf_mbim_control, tvb, offset, 0, ENC_NA);
6009 proto_item_set_hidden(ti);
6010
6011 header_tree = proto_tree_add_subtree(mbim_tree, tvb, offset, 12, ett_mbim_msg_header, NULL, "Message Header");
6012 proto_tree_add_item_ret_uint(header_tree, hf_mbim_header_message_type, tvb, offset, 4, ENC_LITTLE_ENDIAN, &msg_type);
6013 col_add_fstr(pinfo->cinfo, COL_INFO, "%-19s", val_to_str_const(msg_type, mbim_msg_type_vals, "Unknown"));
6014 offset += 4;
6015 proto_tree_add_item(header_tree, hf_mbim_header_message_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6016 offset += 4;
6017 proto_tree_add_item_ret_uint(header_tree, hf_mbim_header_transaction_id, tvb, offset, 4, ENC_LITTLE_ENDIAN, &trans_id);
6018 offset += 4;
6019
6020 switch (msg_type) {
6021 case MBIM_OPEN_MSG:
6022 {
6023 guint32 max_ctrl_transfer;
6024
6025 if (!PINFO_FD_VISITED(pinfo)) {
6026 mbim_conv->open_count++;
6027 wmem_tree_insert32(mbim_conv->open, pinfo->num, GUINT_TO_POINTER(mbim_conv->open_count));
6028 }
6029 max_ctrl_transfer = tvb_get_letohl(tvb, offset);
6030 if (max_ctrl_transfer == 8) {
6031 proto_tree_add_uint_format_value(mbim_tree, hf_mbim_max_ctrl_transfer, tvb, offset, 4, max_ctrl_transfer, "MBIM_ERROR_MAX_TRANSFER (%d)", max_ctrl_transfer);
6032 } else {
6033 ti = proto_tree_add_uint(mbim_tree, hf_mbim_max_ctrl_transfer, tvb, offset, 4, max_ctrl_transfer);
6034 if (max_ctrl_transfer < 64) {
6035 expert_add_info(pinfo, ti, &ei_mbim_max_ctrl_transfer);
6036 }
6037 }
6038 }
6039 break;
6040 case MBIM_CLOSE_MSG:
6041 break;
6042 case MBIM_COMMAND_MSG:
6043 {
6044 guint32 info_buff_len, current_frag, total_frag, cid, cmd_type;
6045 guint8 uuid_idx;
6046 fragment_head *frag_data;
6047 tvbuff_t *frag_tvb;
6048 struct mbim_uuid_ext *uuid_ext_info = NULL;
6049
6050 subtree = proto_tree_add_subtree(mbim_tree, tvb, offset, 8, ett_mbim_frag_header, NULL, "Fragment Header");
6051 proto_tree_add_item_ret_uint(subtree, hf_mbim_fragment_total, tvb, offset, 4, ENC_LITTLE_ENDIAN, &total_frag);
6052 offset += 4;
6053 proto_tree_add_item_ret_uint(subtree, hf_mbim_fragment_current, tvb, offset, 4, ENC_LITTLE_ENDIAN, ¤t_frag);
6054 offset += 4;
6055 if (total_frag > 1) {
6056 frag_data = fragment_add_seq_check(&mbim_reassembly_table, tvb, offset, pinfo,
6057 trans_id, mbim_conv, current_frag,
6058 tvb_reported_length_remaining(tvb, offset),
6059 (current_frag != (total_frag-1)));
6060 frag_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled MBIM control message",
6061 frag_data, &mbim_frag_items, NULL, subtree);
6062 if (!frag_tvb) {
6063 /* Fragmentation reassembly not performed yet */
6064 proto_tree_add_item(mbim_tree, hf_mbim_fragmented_payload, tvb, offset, -1, ENC_NA);
6065 col_append_fstr(pinfo->cinfo, COL_INFO, ": [Fragment #%u out of %u]", current_frag+1, total_frag);
6066 break;
6067 }
6068 offset = 0;
6069 } else {
6070 frag_tvb = tvb;
6071 }
6072
6073 open_count = GPOINTER_TO_UINT(wmem_tree_lookup32_le(mbim_conv->open, pinfo->num));
6074 trans_id_key = ((guint64)open_count << 32) | trans_id;
6075 if (!PINFO_FD_VISITED(pinfo)) {
6076 p_trans_id_key = wmem_new(wmem_file_scope(), guint64);
6077 *p_trans_id_key = trans_id_key;
6078 mbim_info = wmem_new(wmem_file_scope(), struct mbim_info);
6079 mbim_info->req_frame = pinfo->num;
6080 mbim_info->resp_frame = 0;
6081 wmem_map_insert(mbim_conv->trans, p_trans_id_key, mbim_info);
6082 } else {
6083 mbim_info = (struct mbim_info *)wmem_map_lookup(mbim_conv->trans, &trans_id_key);
6084 if (mbim_info && mbim_info->resp_frame) {
6085 proto_item *resp_it;
6086
6087 resp_it = proto_tree_add_uint(header_tree, hf_mbim_response_in, tvb, 0, 0, mbim_info->resp_frame);
6088 proto_item_set_generated(resp_it);
6089 }
6090 }
6091
6092 uuid_idx = mbim_dissect_service_id_uuid(frag_tvb, pinfo, mbim_tree, hf_mbim_device_service_id, &offset, &uuid_ext_info, pinfo->rec->rec_header.packet_header.pkt_encap != WTAP_ENCAP_ETW);
6093 cid = mbim_dissect_cid(frag_tvb, pinfo, mbim_tree, &offset, uuid_idx, uuid_ext_info);
6094 proto_tree_add_item_ret_uint(mbim_tree, hf_mbim_command_type, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN, &cmd_type);
6095 if (mbim_info) {
6096 mbim_info->cmd_type = cmd_type;
6097 }
6098 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", val_to_str_const(cmd_type, mbim_command_type_vals, "Unknown"));
6099 offset += 4;
6100 proto_tree_add_item_ret_uint(mbim_tree, hf_mbim_info_buffer_len, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN, &info_buff_len);
6101 offset += 4;
6102 subtree = mbim_tree;
6103 if (info_buff_len) {
6104 subtree = proto_tree_add_subtree(mbim_tree, frag_tvb, offset, info_buff_len, ett_mbim_info_buffer, NULL, "Information Buffer");
6105 }
6106 switch (uuid_idx) {
6107 case UUID_BASIC_CONNECT:
6108 switch (cid) {
6109 case MBIM_CID_DEVICE_CAPS:
6110 if (cmd_type == MBIM_COMMAND_SET) {
6111 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6112 } else if (info_buff_len) {
6113 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6114 }
6115 break;
6116 case MBIM_CID_SUBSCRIBER_READY_STATUS:
6117 if (cmd_type == MBIM_COMMAND_SET) {
6118 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6119 } else if (info_buff_len) {
6120 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6121 }
6122 break;
6123 case MBIM_CID_RADIO_STATE:
6124 if (cmd_type == MBIM_COMMAND_SET) {
6125 proto_tree_add_item(subtree, hf_mbim_radio_state_set, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6126 } else if (info_buff_len) {
6127 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6128 }
6129 break;
6130 case MBIM_CID_PIN:
6131 if (cmd_type == MBIM_COMMAND_SET) {
6132 mbim_dissect_set_pin(frag_tvb, pinfo, subtree, offset);
6133 } else if (info_buff_len) {
6134 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6135 }
6136 break;
6137 case MBIM_CID_PIN_LIST:
6138 if (cmd_type == MBIM_COMMAND_SET) {
6139 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6140 } else if (info_buff_len) {
6141 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6142 }
6143 break;
6144 case MBIM_CID_HOME_PROVIDER:
6145 if (cmd_type == MBIM_COMMAND_SET) {
6146 mbim_dissect_provider(frag_tvb, pinfo, subtree, offset);
6147 } else if (info_buff_len) {
6148 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6149 }
6150 break;
6151 case MBIM_CID_PREFERRED_PROVIDERS:
6152 if (cmd_type == MBIM_COMMAND_SET) {
6153 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
6154 } else if (info_buff_len) {
6155 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6156 }
6157 break;
6158 case MBIM_CID_VISIBLE_PROVIDERS:
6159 if (cmd_type == MBIM_COMMAND_SET) {
6160 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6161 } else {
6162 proto_tree_add_item(subtree, hf_mbim_visible_providers_req_action, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6163 }
6164 break;
6165 case MBIM_CID_REGISTER_STATE:
6166 if (cmd_type == MBIM_COMMAND_SET) {
6167 mbim_dissect_set_register_state(frag_tvb, pinfo, subtree, offset);
6168 } else if (info_buff_len) {
6169 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6170 }
6171 break;
6172 case MBIM_CID_PACKET_SERVICE:
6173 if (cmd_type == MBIM_COMMAND_SET) {
6174 proto_tree_add_item(subtree, hf_mbim_set_packet_service_action,
6175 frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6176 } else if (info_buff_len) {
6177 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6178 }
6179 break;
6180 case MBIM_CID_SIGNAL_STATE:
6181 if (cmd_type == MBIM_COMMAND_SET) {
6182 mbim_dissect_set_signal_state(frag_tvb, pinfo, subtree, offset);
6183 } else if (info_buff_len) {
6184 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6185 }
6186 break;
6187 case MBIM_CID_CONNECT:
6188 if (cmd_type == MBIM_COMMAND_SET) {
6189 if (SHOULD_MBIM_EX3_BE_APPLIED(mbim_conv)) {
6190 mbim_dissect_set_connect_v3(frag_tvb, pinfo, subtree, offset, info_buff_len);
6191 } else {
6192 mbim_dissect_set_connect(frag_tvb, pinfo, subtree, offset);
6193 }
6194 } else {
6195 proto_tree_add_item(subtree, hf_mbim_connect_info_session_id, frag_tvb,
6196 offset, 4, ENC_LITTLE_ENDIAN);
6197 }
6198 break;
6199 case MBIM_CID_PROVISIONED_CONTEXTS:
6200 if (cmd_type == MBIM_COMMAND_SET) {
6201 mbim_dissect_context(frag_tvb, pinfo, subtree, offset, TRUE);
6202 } else if (info_buff_len) {
6203 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6204 }
6205 break;
6206 case MBIM_CID_SERVICE_ACTIVATION:
6207 if (cmd_type == MBIM_COMMAND_SET) {
6208 proto_tree_add_item(subtree, hf_mbim_set_service_activation_data_buffer,
6209 frag_tvb, offset, info_buff_len, ENC_NA);
6210 } else {
6211 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6212 }
6213 break;
6214 case MBIM_CID_IP_CONFIGURATION:
6215 if (cmd_type == MBIM_COMMAND_SET) {
6216 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6217 } else {
6218 proto_tree_add_item(subtree, hf_mbim_ip_configuration_info_session_id, frag_tvb,
6219 offset, 4, ENC_LITTLE_ENDIAN);
6220 }
6221 break;
6222 case MBIM_CID_DEVICE_SERVICES:
6223 if (cmd_type == MBIM_COMMAND_SET) {
6224 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6225 } else if (info_buff_len) {
6226 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6227 }
6228 break;
6229 case MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST:
6230 if (cmd_type == MBIM_COMMAND_SET) {
6231 mbim_dissect_device_service_subscribe_list(frag_tvb, pinfo, subtree, offset);
6232 } else {
6233 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6234 }
6235 break;
6236 case MBIM_CID_PACKET_STATISTICS:
6237 if (cmd_type == MBIM_COMMAND_SET) {
6238 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6239 } else if (info_buff_len) {
6240 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6241 }
6242 break;
6243 case MBIM_CID_NETWORK_IDLE_HINT:
6244 if (cmd_type == MBIM_COMMAND_SET) {
6245 proto_tree_add_item(subtree, hf_mbim_network_idle_hint_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6246 } else if (info_buff_len) {
6247 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6248 }
6249 break;
6250 case MBIM_CID_EMERGENCY_MODE:
6251 if (cmd_type == MBIM_COMMAND_SET) {
6252 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6253 } else if (info_buff_len) {
6254 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6255 }
6256 break;
6257 case MBIM_CID_IP_PACKET_FILTERS:
6258 mbim_dissect_packet_filters(frag_tvb, pinfo, subtree, offset, mbim_conv);
6259 break;
6260 case MBIM_CID_MULTICARRIER_PROVIDERS:
6261 if (cmd_type == MBIM_COMMAND_SET) {
6262 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
6263 } else if (info_buff_len) {
6264 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6265 }
6266 break;
6267 default:
6268 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6269 break;
6270 }
6271 break;
6272 case UUID_SMS:
6273 switch (cid) {
6274 case MBIM_CID_SMS_CONFIGURATION:
6275 if (cmd_type == MBIM_COMMAND_SET) {
6276 mbim_dissect_set_sms_configuration(frag_tvb, pinfo, subtree, offset);
6277 } else if (info_buff_len) {
6278 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6279 }
6280 break;
6281 case MBIM_CID_SMS_READ:
6282 if (cmd_type == MBIM_COMMAND_SET) {
6283 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6284 } else {
6285 mbim_dissect_sms_read_req(frag_tvb, pinfo, subtree, offset);
6286 }
6287 break;
6288 case MBIM_CID_SMS_SEND:
6289 if (cmd_type == MBIM_COMMAND_SET) {
6290 mbim_dissect_set_sms_send(frag_tvb, pinfo, subtree, offset, mbim_conv);
6291 } else {
6292 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6293 }
6294 break;
6295 case MBIM_CID_SMS_DELETE:
6296 if (cmd_type == MBIM_COMMAND_SET) {
6297 proto_tree_add_item(subtree, hf_mbim_set_sms_delete_flag,
6298 frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6299 offset += 4;
6300 proto_tree_add_item(subtree, hf_mbim_set_sms_delete_message_index,
6301 frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6302 } else {
6303 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6304 }
6305 break;
6306 case MBIM_CID_SMS_MESSAGE_STORE_STATUS:
6307 if (cmd_type == MBIM_COMMAND_SET) {
6308 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6309 } else if (info_buff_len) {
6310 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6311 }
6312 break;
6313 default:
6314 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6315 break;
6316 }
6317 break;
6318 case UUID_USSD:
6319 switch (cid) {
6320 case MBIM_CID_USSD:
6321 if (cmd_type == MBIM_COMMAND_SET) {
6322 mbim_dissect_set_ussd(frag_tvb, pinfo, subtree, offset);
6323 } else {
6324 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6325 }
6326 break;
6327 default:
6328 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6329 break;
6330 }
6331 break;
6332 case UUID_PHONEBOOK:
6333 switch (cid) {
6334 case MBIM_CID_PHONEBOOK_CONFIGURATION:
6335 if (cmd_type == MBIM_COMMAND_SET) {
6336 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6337 } else if (info_buff_len) {
6338 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6339 }
6340 break;
6341 case MBIM_CID_PHONEBOOK_READ:
6342 if (cmd_type == MBIM_COMMAND_SET) {
6343 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6344 } else {
6345 proto_tree_add_item(subtree, hf_mbim_phonebook_read_req_filter_flag, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6346 offset += 4;
6347 proto_tree_add_item(subtree, hf_mbim_phonebook_read_req_filter_message_index, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6348 }
6349 break;
6350 case MBIM_CID_PHONEBOOK_DELETE:
6351 if (cmd_type == MBIM_COMMAND_SET) {
6352 proto_tree_add_item(subtree, hf_mbim_set_phonebook_delete_filter_flag, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6353 offset += 4;
6354 proto_tree_add_item(subtree, hf_mbim_set_phonebook_delete_filter_message_index, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6355 } else {
6356 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6357 }
6358 break;
6359 case MBIM_CID_PHONEBOOK_WRITE:
6360 if (cmd_type == MBIM_COMMAND_SET) {
6361 mbim_dissect_set_phonebook_write(frag_tvb, pinfo, subtree, offset);
6362 } else {
6363 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6364 }
6365 break;
6366 default:
6367 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6368 break;
6369 }
6370 break;
6371 case UUID_STK:
6372 switch (cid) {
6373 case MBIM_CID_STK_PAC:
6374 if (cmd_type == MBIM_COMMAND_SET) {
6375 mbim_dissect_set_stk_pac(frag_tvb, pinfo, subtree, offset);
6376 } else {
6377 if (info_buff_len) {
6378 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6379 }
6380 }
6381 break;
6382 case MBIM_CID_STK_TERMINAL_RESPONSE:
6383 if (cmd_type == MBIM_COMMAND_SET) {
6384 mbim_dissect_set_stk_terminal_response(frag_tvb, pinfo, subtree, offset);
6385 } else {
6386 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6387 }
6388 break;
6389 case MBIM_CID_STK_ENVELOPE:
6390 if (cmd_type == MBIM_COMMAND_SET) {
6391 tvbuff_t *env_tvb;
6392 proto_tree *env_tree;
6393
6394 ti = proto_tree_add_item(subtree, hf_mbim_set_stk_envelope_data_buffer,
6395 frag_tvb, offset, info_buff_len, ENC_NA);
6396 if (bertlv_handle) {
6397 env_tree = proto_item_add_subtree(ti, ett_mbim_buffer);
6398 env_tvb = tvb_new_subset_length(frag_tvb, offset, info_buff_len);
6399 call_dissector(bertlv_handle, env_tvb, pinfo, env_tree);
6400 }
6401 } else if (info_buff_len) {
6402 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6403 }
6404 break;
6405 default:
6406 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6407 break;
6408 }
6409 break;
6410 case UUID_AUTH:
6411 switch (cid) {
6412 case MBIM_CID_AKA_AUTH:
6413 if (cmd_type == MBIM_COMMAND_SET) {
6414 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6415 } else {
6416 mbim_dissect_aka_auth_req(frag_tvb, pinfo, subtree, offset);
6417 }
6418 break;
6419 case MBIM_CID_AKAP_AUTH:
6420 if (cmd_type == MBIM_COMMAND_SET) {
6421 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6422 } else {
6423 mbim_dissect_akap_auth_req(frag_tvb, pinfo, subtree, offset);
6424 }
6425 break;
6426 case MBIM_CID_SIM_AUTH:
6427 if (cmd_type == MBIM_COMMAND_SET) {
6428 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6429 } else {
6430 mbim_dissect_sim_auth_req(frag_tvb, pinfo, subtree, offset);
6431 }
6432 break;
6433 default:
6434 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6435 break;
6436 }
6437 break;
6438 case UUID_DSS:
6439 switch (cid) {
6440 case MBIM_CID_DSS_CONNECT:
6441 if (cmd_type == MBIM_COMMAND_SET) {
6442 mbim_dissect_set_dss_connect(frag_tvb, pinfo, subtree, offset);
6443 } else {
6444 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6445 }
6446 break;
6447 default:
6448 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6449 break;
6450 }
6451 break;
6452 case UUID_MULTICARRIER:
6453 switch (cid) {
6454 case MBIM_CID_MULTICARRIER_CAPABILITIES:
6455 if (cmd_type == MBIM_COMMAND_SET) {
6456 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6457 } else if (info_buff_len) {
6458 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6459 }
6460 break;
6461 case MBIM_CID_LOCATION_INFO:
6462 if (cmd_type == MBIM_COMMAND_SET) {
6463 proto_tree_add_item(subtree, hf_mbim_location_info_country, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6464 } else if (info_buff_len) {
6465 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6466 }
6467 break;
6468 case MBIM_CID_MULTICARRIER_CURRENT_CID_LIST:
6469 if (cmd_type == MBIM_COMMAND_SET) {
6470 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, info_buff_len);
6471 } else {
6472 mbim_dissect_muticarrier_current_cid_list_req(frag_tvb, pinfo, subtree, offset);
6473 }
6474 break;
6475 default:
6476 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6477 break;
6478 }
6479 break;
6480 case UUID_MS_HOSTSHUTDOWN:
6481 switch (cid) {
6482 case MBIM_CID_MS_HOSTSHUTDOWN:
6483 case MBIM_CID_MS_HOSTPRESHUTDOWN:
6484 if (cmd_type == MBIM_COMMAND_SET) {
6485 if (info_buff_len) {
6486 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6487 }
6488 } else {
6489 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6490 }
6491 break;
6492 default:
6493 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6494 break;
6495 }
6496 break;
6497 case UUID_MSFWID:
6498 switch (cid) {
6499 case MBIM_CID_MSFWID_FIRMWAREID:
6500 if (cmd_type == MBIM_COMMAND_SET) {
6501 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6502 } else if (info_buff_len) {
6503 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6504 }
6505 break;
6506 default:
6507 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6508 break;
6509 }
6510 break;
6511 case UUID_QMI:
6512 switch (cid) {
6513 case MBIM_CID_QMI_QMI:
6514 if (info_buff_len) {
6515 proto_tree_add_item(subtree, hf_mbim_qmi_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
6516 }
6517 break;
6518 default:
6519 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6520 break;
6521 }
6522 break;
6523 case UUID_INTEL_FWUSVC:
6524 switch (cid) {
6525 case MBIM_CID_INTC_MODEM_REBOOT:
6526 if (cmd_type == MBIM_COMMAND_SET) {
6527 if (info_buff_len) {
6528 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6529 }
6530 } else {
6531 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6532 }
6533 break;
6534 default:
6535 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6536 break;
6537 }
6538 break;
6539 case UUID_INTEL_DPTF:
6540 switch (cid) {
6541 case MBIM_CID_INTC_THERMAL_STATE:
6542 if (cmd_type == MBIM_COMMAND_SET) {
6543 mbim_dissect_thermal_config(frag_tvb, pinfo, subtree, offset);
6544 } else {
6545 proto_tree_add_item(subtree, hf_mbim_query_thermal_state_temp_sensor_id, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6546 }
6547 break;
6548 default:
6549 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6550 break;
6551 }
6552 break;
6553 case UUID_INTEL_SAR:
6554 switch (cid) {
6555 case MBIM_CID_INTC_SAR_CONFIG:
6556 if (cmd_type == MBIM_COMMAND_SET) {
6557 mbim_dissect_sar_config(frag_tvb, pinfo, subtree, offset, info_buff_len);
6558 } else if (info_buff_len) {
6559 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6560 }
6561 break;
6562 default:
6563 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6564 break;
6565 }
6566 break;
6567 case UUID_INTEL_ACT:
6568 switch (cid) {
6569 case MBIM_CID_INTC_ADPCLK_MODE:
6570 if (cmd_type == MBIM_COMMAND_SET) {
6571 proto_tree_add_item(subtree, hf_mbim_adpclk_activate_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6572 } else if (info_buff_len) {
6573 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6574 }
6575 break;
6576 default:
6577 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6578 break;
6579 }
6580 break;
6581 case UUID_INTEL_TRCSVC:
6582 switch (cid) {
6583 case MBIM_CID_INTC_TRACE:
6584 if (cmd_type == MBIM_COMMAND_SET) {
6585 proto_tree_add_item(subtree, hf_mbim_trace_config_config, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6586 } else if (info_buff_len) {
6587 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6588 }
6589 break;
6590 case MBIM_CID_INTC_TRACE_DATA:
6591 if (cmd_type == MBIM_COMMAND_SET) {
6592 proto_tree_add_item(subtree, hf_mbim_trace_config_config, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6593 } else if (info_buff_len) {
6594 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6595 }
6596 break;
6597 default:
6598 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6599 break;
6600 }
6601 break;
6602 case UUID_INTEL_NRTC:
6603 switch (cid) {
6604 case MBIM_CID_INTC_NRTAPP:
6605 if (cmd_type == MBIM_COMMAND_SET) {
6606 proto_tree_add_item(subtree, hf_mbim_nrtc_app_info_period, frag_tvb, offset, 2, ENC_LITTLE_ENDIAN);
6607 offset += 2;
6608 proto_tree_add_item(subtree, hf_mbim_nrtc_app_info_duration, frag_tvb, offset, 2, ENC_LITTLE_ENDIAN);
6609 } else if (info_buff_len) {
6610 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6611 }
6612 break;
6613 case MBIM_CID_INTC_NRTCWS:
6614 if (cmd_type == MBIM_COMMAND_SET) {
6615 mbim_dissect_nrtcws_config(frag_tvb, pinfo, subtree, offset, info_buff_len);
6616 } else if (info_buff_len) {
6617 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6618 }
6619 break;
6620 default:
6621 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6622 break;
6623 }
6624 break;
6625 case UUID_INTEL_USB_PROFILE:
6626 switch (cid) {
6627 case MBIM_CID_INTC_USBPROFILE:
6628 if (cmd_type == MBIM_COMMAND_SET) {
6629 guint32 at_len;
6630
6631 proto_tree_add_item_ret_uint(subtree, hf_mbim_usbprofile_cmd_length, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN, &at_len);
6632 offset += 4;
6633 proto_tree_add_item(subtree, hf_mbim_usbprofile_cmd_buffer, frag_tvb, offset, at_len, ENC_LITTLE_ENDIAN|ENC_UTF_16);
6634 } else {
6635 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6636 }
6637 break;
6638 default:
6639 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6640 break;
6641 }
6642 break;
6643 case UUID_INTEL_CIQ:
6644 switch (cid) {
6645 case MBIM_CID_INTC_CIQ:
6646 if (cmd_type == MBIM_COMMAND_SET) {
6647 guint32 size;
6648
6649 proto_tree_add_item(subtree, hf_mbim_ciq_set_mode, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6650 offset += 4;
6651 proto_tree_add_item_ret_uint(subtree, hf_mbim_ciq_set_debug_info_size, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN, &size);
6652 offset += 4;
6653 proto_tree_add_item(subtree, hf_mbim_ciq_set_debug_info, frag_tvb, offset, size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
6654 } else if (info_buff_len) {
6655 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6656 }
6657 break;
6658 default:
6659 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6660 break;
6661 }
6662 break;
6663 case UUID_ATDS:
6664 switch (cid) {
6665 case MBIM_CID_ATDS_SIGNAL:
6666 if (cmd_type == MBIM_COMMAND_SET) {
6667 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6668 } else if (info_buff_len) {
6669 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6670 }
6671 break;
6672 case MBIM_CID_ATDS_LOCATION:
6673 if (cmd_type == MBIM_COMMAND_SET) {
6674 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6675 } else if (info_buff_len) {
6676 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6677 }
6678 break;
6679 case MBIM_CID_ATDS_OPERATORS:
6680 if (cmd_type == MBIM_COMMAND_SET) {
6681 mbim_dissect_atds_operators(frag_tvb, pinfo, subtree, offset);
6682 } else if (info_buff_len) {
6683 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6684 }
6685 break;
6686 case MBIM_CID_ATDS_RAT:
6687 if (cmd_type == MBIM_COMMAND_SET) {
6688 proto_tree_add_item(subtree, hf_mbim_atds_rat_info_mode, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6689 } else if (info_buff_len) {
6690 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6691 }
6692 break;
6693 case MBIM_CID_ATDS_REGISTER_STATE:
6694 if (cmd_type == MBIM_COMMAND_SET) {
6695 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6696 } else if (info_buff_len) {
6697 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6698 }
6699 break;
6700 case MBIM_CID_ATDS_SET_PROJECTION_TABLES:
6701 if (cmd_type == MBIM_COMMAND_SET) {
6702 mbim_dissect_atds_projection_tables(frag_tvb, pinfo, subtree, offset);
6703 } else if (info_buff_len) {
6704 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6705 }
6706 break;
6707 default:
6708 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6709 break;
6710 }
6711 break;
6712 case UUID_MULTIFLOW:
6713 switch (cid) {
6714 case MBIM_CID_MULTIFLOW_CAPS:
6715 if (cmd_type == MBIM_COMMAND_SET) {
6716 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6717 } else if (info_buff_len) {
6718 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6719 }
6720 break;
6721 case MBIM_CID_MULTIFLOW_UPLINK:
6722 case MBIM_CID_MULTIFLOW_DOWNLINK:
6723 if (cmd_type == MBIM_COMMAND_SET) {
6724 proto_tree_add_item(subtree, hf_mbim_set_multiflow_state_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6725 } else if (info_buff_len) {
6726 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6727 }
6728 break;
6729 case MBIM_CID_MULTIFLOW_TFT:
6730 if (cmd_type == MBIM_COMMAND_SET) {
6731 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6732 } else if (info_buff_len) {
6733 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6734 }
6735 break;
6736 default:
6737 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6738 break;
6739 }
6740 break;
6741 case UUID_BASIC_CONNECT_EXTENSIONS:
6742 switch (cid) {
6743 case MBIM_CID_MS_PROVISIONED_CONTEXT_V2:
6744 if (cmd_type == MBIM_COMMAND_SET) {
6745 mbim_dissect_set_ms_provisioned_context_v2(frag_tvb, pinfo, subtree, offset);
6746 } else if (info_buff_len) {
6747 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6748 }
6749 break;
6750 case MBIM_CID_MS_NETWORK_BLACKLIST:
6751 if (cmd_type == MBIM_COMMAND_SET) {
6752 mbim_dissect_ms_network_blacklist_info(pinfo, frag_tvb, subtree, offset);
6753 } else if (info_buff_len) {
6754 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6755 }
6756 break;
6757 case MBIM_CID_MS_LTE_ATTACH_CONFIG:
6758 case MBIM_CID_MS_LTE_ATTACH_STATUS:
6759 if (info_buff_len) {
6760 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
6761 }
6762 break;
6763 case MBIM_CID_MS_SYS_CAPS:
6764 case MBIM_CID_MS_DEVICE_CAPS_V2:
6765 if (cmd_type == MBIM_COMMAND_SET) {
6766 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6767 } else if (info_buff_len) {
6768 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6769 }
6770 break;
6771 case MBIM_CID_MS_DEVICE_SLOT_MAPPINGS:
6772 if (cmd_type == MBIM_COMMAND_SET) {
6773 mbim_dissect_ms_device_slot_mapping_info(frag_tvb, pinfo, subtree, offset);
6774 } else if (info_buff_len) {
6775 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6776 }
6777 break;
6778 case MBIM_CID_MS_SLOT_INFO_STATUS:
6779 if (cmd_type == MBIM_COMMAND_QUERY) {
6780 proto_tree_add_item(subtree, hf_mbim_ms_slot_info_req_slot_index, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
6781 } else {
6782 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6783 }
6784 break;
6785 case MBIM_CID_PCO:
6786 if (info_buff_len) {
6787 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
6788 }
6789 break;
6790 case MBIM_CID_MS_DEVICE_RESET:
6791 if (cmd_type == MBIM_COMMAND_SET) {
6792 if (info_buff_len) {
6793 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6794 }
6795 } else {
6796 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6797 }
6798 break;
6799 case MBIM_CID_BASE_STATIONS_INFO:
6800 if (cmd_type == MBIM_COMMAND_SET) {
6801 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6802 } else if (info_buff_len) {
6803 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
6804 }
6805 break;
6806 case MBIM_CID_LOCATION_INFO_STATUS:
6807 if (cmd_type == MBIM_COMMAND_SET) {
6808 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6809 } else if (info_buff_len) {
6810 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6811 }
6812 break;
6813 case MBIM_CID_MS_PIN_INFO_EX2:
6814 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6815 break;
6816 case MBIM_CID_VERSION:
6817 if (cmd_type == MBIM_COMMAND_SET) {
6818 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6819 } else if (info_buff_len) {
6820 mbim_dissect_version(frag_tvb, subtree, offset, mbim_conv);
6821 }
6822 break;
6823 case MBIM_CID_MS_MODEM_CONFIG:
6824 if (cmd_type == MBIM_COMMAND_SET) {
6825 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6826 } else if (info_buff_len) {
6827 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6828 }
6829 break;
6830 case MBIM_CID_MS_REGISTRATION_PARAMS:
6831 mbim_dissect_ms_registration_params_info(frag_tvb, pinfo, subtree, offset, info_buff_len);
6832 break;
6833 case MBIM_CID_MS_WAKE_REASON:
6834 if (cmd_type == MBIM_COMMAND_SET) {
6835 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6836 } else if (info_buff_len) {
6837 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6838 }
6839 break;
6840 default:
6841 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6842 break;
6843 }
6844 break;
6845 case UUID_MS_SARCONTROL:
6846 switch (cid) {
6847 case MBIM_CID_MS_SAR_CONFIG:
6848 case MBIM_CID_MS_TRANSMISSION_STATUS:
6849 if (info_buff_len) {
6850 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
6851 }
6852 break;
6853 default:
6854 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6855 break;
6856 }
6857 break;
6858 case UUID_MS_UICC_LOW_LEVEL:
6859 switch (cid) {
6860 case MBIM_CID_MS_UICC_ATR:
6861 if (cmd_type == MBIM_COMMAND_SET) {
6862 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6863 } else if (info_buff_len) {
6864 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6865 }
6866 break;
6867 case MBIM_CID_MS_UICC_OPEN_CHANNEL:
6868 case MBIM_CID_MS_UICC_CLOSE_CHANNEL:
6869 case MBIM_CID_MS_UICC_APDU:
6870 case MBIM_CID_MS_UICC_TERMINAL_CAPABILITY:
6871 case MBIM_CID_MS_UICC_RESET:
6872 if (info_buff_len) {
6873 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
6874 }
6875 break;
6876 case MBIM_CID_MS_UICC_APP_LIST:
6877 if (cmd_type == MBIM_COMMAND_SET) {
6878 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6879 } else if (info_buff_len) {
6880 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6881 }
6882 break;
6883 case MBIM_CID_MS_UICC_ACCESS_BINARY:
6884 mbim_dissect_ms_access_binary(frag_tvb, pinfo, subtree, offset);
6885 break;
6886 case MBIM_CID_MS_UICC_ACCESS_RECORD:
6887 mbim_dissect_ms_access_record(frag_tvb, pinfo, subtree, offset);
6888 break;
6889 case MBIM_CID_MS_UICC_FILE_STATUS:
6890 if (cmd_type == MBIM_COMMAND_SET) {
6891 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6892 } else if (info_buff_len) {
6893 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6894 } else {
6895 mbim_dissect_ms_file_path(frag_tvb, pinfo, subtree, offset);
6896 }
6897 break;
6898 default:
6899 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6900 break;
6901 }
6902 break;
6903 case UUID_EXT_IDX:
6904 {
6905 gint cid_idx;
6906 mbim_dissect_fct dissect_cid;
6907
6908 try_val_to_str_idx(cid, uuid_ext_info->uuid_cid_list, &cid_idx);
6909 if (cid_idx != -1) {
6910 dissect_cid = (cmd_type == MBIM_COMMAND_SET) ? uuid_ext_info->uuid_fct_list[cid_idx].cmd_set :
6911 uuid_ext_info->uuid_fct_list[cid_idx].cmd_query;
6912 if (dissect_cid) {
6913 dissect_cid(frag_tvb, pinfo, subtree, offset, mbim_info);
6914 } else if (info_buff_len) {
6915 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
6916 }
6917 } else {
6918 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
6919 }
6920 }
6921 break;
6922 default:
6923 if (info_buff_len) {
6924 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
6925 }
6926 break;
6927 }
6928 }
6929 break;
6930 case MBIM_FUNCTION_ERROR_MSG:
6931 open_count = GPOINTER_TO_UINT(wmem_tree_lookup32_le(mbim_conv->open, pinfo->num));
6932 trans_id_key = ((guint64)open_count << 32) | trans_id;
6933 mbim_info = (struct mbim_info *)wmem_map_lookup(mbim_conv->trans, &trans_id_key);
6934 if (!PINFO_FD_VISITED(pinfo)) {
6935 if (mbim_info) {
6936 mbim_info->resp_frame = pinfo->num;
6937 }
6938 } else {
6939 if (mbim_info && mbim_info->req_frame) {
6940 proto_item *req_it;
6941
6942 req_it = proto_tree_add_uint(header_tree, hf_mbim_request_in, tvb, 0, 0, mbim_info->req_frame);
6943 proto_item_set_generated(req_it);
6944 }
6945 }
6946 /* FALLTHROUGH */
6947 case MBIM_HOST_ERROR_MSG:
6948 proto_tree_add_item(mbim_tree, hf_mbim_error_status_code, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6949 break;
6950 case MBIM_OPEN_DONE:
6951 case MBIM_CLOSE_DONE:
6952 proto_tree_add_item(mbim_tree, hf_mbim_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6953 break;
6954 case MBIM_COMMAND_DONE:
6955 case MBIM_INDICATE_STATUS_MSG:
6956 {
6957 guint32 info_buff_len, current_frag, total_frag, cid;
6958 guint8 uuid_idx;
6959 fragment_head *frag_data;
6960 tvbuff_t *frag_tvb;
6961 struct mbim_uuid_ext *uuid_ext_info = NULL;
6962
6963 subtree = proto_tree_add_subtree(mbim_tree, tvb, offset, 8, ett_mbim_frag_header, NULL, "Fragment Header");
6964 proto_tree_add_item_ret_uint(subtree, hf_mbim_fragment_total, tvb, offset, 4, ENC_LITTLE_ENDIAN, &total_frag);
6965 offset += 4;
6966 proto_tree_add_item_ret_uint(subtree, hf_mbim_fragment_current, tvb, offset, 4, ENC_LITTLE_ENDIAN, ¤t_frag);
6967 offset += 4;
6968 if (total_frag > 1) {
6969 frag_data = fragment_add_seq_check(&mbim_reassembly_table, tvb, offset, pinfo,
6970 trans_id, mbim_conv, current_frag,
6971 tvb_reported_length_remaining(tvb, offset),
6972 (current_frag != (total_frag-1)));
6973 frag_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled MBIM control message",
6974 frag_data, &mbim_frag_items, NULL, subtree);
6975 if (!frag_tvb) {
6976 /* Fragmentation reassembly not performed yet */
6977 proto_tree_add_item(mbim_tree, hf_mbim_fragmented_payload, tvb, offset, -1, ENC_NA);
6978 col_append_fstr(pinfo->cinfo, COL_INFO, ": [Fragment #%u out of %u]", current_frag+1, total_frag);
6979 break;
6980 }
6981 offset = 0;
6982 } else {
6983 frag_tvb = tvb;
6984 }
6985
6986 if (msg_type == MBIM_COMMAND_DONE) {
6987 open_count = GPOINTER_TO_UINT(wmem_tree_lookup32_le(mbim_conv->open, pinfo->num));
6988 trans_id_key = ((guint64)open_count << 32) | trans_id;
6989 mbim_info = (struct mbim_info *)wmem_map_lookup(mbim_conv->trans, &trans_id_key);
6990 if (!PINFO_FD_VISITED(pinfo)) {
6991 if (mbim_info) {
6992 mbim_info->resp_frame = pinfo->num;
6993 }
6994 } else {
6995 if (mbim_info && mbim_info->req_frame) {
6996 proto_item *req_it;
6997
6998 req_it = proto_tree_add_uint(header_tree, hf_mbim_request_in, tvb, 0, 0, mbim_info->req_frame);
6999 proto_item_set_generated(req_it);
7000 }
7001 }
7002 }
7003
7004 uuid_idx = mbim_dissect_service_id_uuid(frag_tvb, pinfo, mbim_tree, hf_mbim_device_service_id, &offset, &uuid_ext_info, pinfo->rec->rec_header.packet_header.pkt_encap != WTAP_ENCAP_ETW);
7005 cid = mbim_dissect_cid(frag_tvb, pinfo, mbim_tree, &offset, uuid_idx, uuid_ext_info);
7006 if (msg_type == MBIM_COMMAND_DONE) {
7007 proto_tree_add_item(mbim_tree, hf_mbim_status, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7008 offset += 4;
7009 }
7010 proto_tree_add_item_ret_uint(mbim_tree, hf_mbim_info_buffer_len, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN, &info_buff_len);
7011 offset += 4;
7012 if (info_buff_len == 0) {
7013 break;
7014 }
7015 subtree = proto_tree_add_subtree(mbim_tree, frag_tvb, offset, info_buff_len, ett_mbim_info_buffer, NULL, "Information Buffer");
7016 switch (uuid_idx) {
7017 case UUID_BASIC_CONNECT:
7018 switch (cid) {
7019 case MBIM_CID_DEVICE_CAPS:
7020 if (msg_type == MBIM_COMMAND_DONE) {
7021 mbim_dissect_device_caps_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
7022 } else {
7023 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7024 }
7025 break;
7026 case MBIM_CID_SUBSCRIBER_READY_STATUS:
7027 mbim_dissect_subscriber_ready_status(frag_tvb, pinfo, subtree, offset, mbim_conv);
7028 break;
7029 case MBIM_CID_RADIO_STATE:
7030 proto_tree_add_item(subtree, hf_mbim_radio_state_hw_radio_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7031 offset += 4;
7032 proto_tree_add_item(subtree, hf_mbim_radio_state_sw_radio_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7033 break;
7034 case MBIM_CID_PIN:
7035 if (msg_type == MBIM_COMMAND_DONE) {
7036 guint32 attempts;
7037
7038 proto_tree_add_item(subtree, hf_mbim_pin_info_pin_type, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7039 offset += 4;
7040 proto_tree_add_item(subtree, hf_mbim_pin_info_pin_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7041 offset += 4;
7042 attempts = tvb_get_letohl(frag_tvb, offset);
7043 if (attempts == 0xffffffff) {
7044 proto_tree_add_uint_format(subtree, hf_mbim_pin_info_remaining_attempts, frag_tvb, offset, 4,
7045 attempts, "Not supported (0xffffffff)");
7046 } else {
7047 proto_tree_add_uint(subtree, hf_mbim_pin_info_remaining_attempts, frag_tvb, offset, 4, attempts);
7048 }
7049 } else {
7050 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7051 }
7052 break;
7053 case MBIM_CID_PIN_LIST:
7054 if (msg_type == MBIM_COMMAND_DONE) {
7055 mbim_dissect_pin_list_info(frag_tvb, pinfo, subtree, offset);
7056 } else {
7057 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7058 }
7059 break;
7060 case MBIM_CID_HOME_PROVIDER:
7061 if (msg_type == MBIM_COMMAND_DONE) {
7062 mbim_dissect_provider(frag_tvb, pinfo, subtree, offset);
7063 } else {
7064 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7065 }
7066 break;
7067 case MBIM_CID_PREFERRED_PROVIDERS:
7068 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
7069 break;
7070 case MBIM_CID_VISIBLE_PROVIDERS:
7071 if (msg_type == MBIM_COMMAND_DONE) {
7072 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
7073 } else {
7074 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7075 }
7076 break;
7077 case MBIM_CID_REGISTER_STATE:
7078 mbim_dissect_registration_state_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
7079 break;
7080 case MBIM_CID_PACKET_SERVICE:
7081 mbim_dissect_packet_service_info(frag_tvb, pinfo, subtree, offset, mbim_conv, info_buff_len);
7082 break;
7083 case MBIM_CID_SIGNAL_STATE:
7084 mbim_dissect_signal_state_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
7085 break;
7086 case MBIM_CID_CONNECT:
7087 mbim_dissect_connect_info(frag_tvb, pinfo, subtree, offset, mbim_conv, info_buff_len);
7088 break;
7089 case MBIM_CID_PROVISIONED_CONTEXTS:
7090 mbim_dissect_provisioned_contexts_info(frag_tvb, pinfo, subtree, offset);
7091 break;
7092 case MBIM_CID_SERVICE_ACTIVATION:
7093 if (msg_type == MBIM_COMMAND_DONE) {
7094 guint32 nw_error;
7095
7096 nw_error = tvb_get_letohl(frag_tvb, offset);
7097 if (nw_error == 0) {
7098 proto_tree_add_uint_format_value(subtree, hf_mbim_service_activation_info_nw_error,
7099 frag_tvb, offset, 4, nw_error, "Success (0)");
7100 } else {
7101 proto_tree_add_uint(subtree, hf_mbim_service_activation_info_nw_error,
7102 frag_tvb, offset, 4, nw_error);
7103 }
7104 proto_tree_add_item(subtree, hf_mbim_service_activation_info_data_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7105 } else {
7106 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7107 }
7108 break;
7109 case MBIM_CID_IP_CONFIGURATION:
7110 mbim_dissect_ip_configuration_info(frag_tvb, pinfo, subtree, offset);
7111 break;
7112 case MBIM_CID_DEVICE_SERVICES:
7113 if (msg_type == MBIM_COMMAND_DONE) {
7114 mbim_dissect_device_services_info(frag_tvb, pinfo, subtree, offset);
7115 } else {
7116 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7117 }
7118 break;
7119 case MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST:
7120 if (msg_type == MBIM_COMMAND_DONE) {
7121 mbim_dissect_device_service_subscribe_list(frag_tvb, pinfo, subtree, offset);
7122 } else {
7123 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7124 }
7125 break;
7126 case MBIM_CID_PACKET_STATISTICS:
7127 if (msg_type == MBIM_COMMAND_DONE) {
7128 mbim_dissect_packet_statistics_info(frag_tvb, pinfo, subtree, offset);
7129 } else {
7130 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7131 }
7132 break;
7133 case MBIM_CID_NETWORK_IDLE_HINT:
7134 if (msg_type == MBIM_COMMAND_DONE) {
7135 proto_tree_add_item(subtree, hf_mbim_network_idle_hint_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7136 } else {
7137 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7138 }
7139 break;
7140 case MBIM_CID_EMERGENCY_MODE:
7141 proto_tree_add_item(subtree, hf_mbim_emergency_mode_info_emergency_mode, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7142 break;
7143 case MBIM_CID_IP_PACKET_FILTERS:
7144 if (msg_type == MBIM_COMMAND_DONE) {
7145 mbim_dissect_packet_filters(frag_tvb, pinfo, subtree, offset, mbim_conv);
7146 } else {
7147 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7148 }
7149 break;
7150 case MBIM_CID_MULTICARRIER_PROVIDERS:
7151 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
7152 break;
7153 default:
7154 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7155 break;
7156 }
7157 break;
7158 case UUID_SMS:
7159 switch (cid) {
7160 case MBIM_CID_SMS_CONFIGURATION:
7161 mbim_dissect_sms_configuration_info(frag_tvb, pinfo, subtree, offset);
7162 break;
7163 case MBIM_CID_SMS_READ:
7164 mbim_dissect_sms_read_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
7165 break;
7166 case MBIM_CID_SMS_SEND:
7167 if (msg_type == MBIM_COMMAND_DONE) {
7168 proto_tree_add_item(subtree, hf_mbim_sms_send_info_message_reference, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7169 } else {
7170 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7171 }
7172 break;
7173 case MBIM_CID_SMS_DELETE:
7174 if (msg_type == MBIM_COMMAND_DONE) {
7175 if (info_buff_len) {
7176 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7177 }
7178 } else {
7179 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7180 }
7181 break;
7182 case MBIM_CID_SMS_MESSAGE_STORE_STATUS:
7183 proto_tree_add_bitmask(subtree, frag_tvb, offset, hf_mbim_sms_status_info_flags, ett_mbim_bitmap,
7184 mbim_sms_status_info_flags_fields, ENC_LITTLE_ENDIAN);
7185 offset += 4;
7186 proto_tree_add_item(subtree, hf_mbim_sms_status_info_message_index, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7187 break;
7188 default:
7189 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7190 break;
7191 }
7192 break;
7193 case UUID_USSD:
7194 switch (cid) {
7195 case MBIM_CID_USSD:
7196 mbim_dissect_ussd_info(frag_tvb, pinfo, subtree, offset);
7197 break;
7198 default:
7199 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7200 break;
7201 }
7202 break;
7203 case UUID_PHONEBOOK:
7204 switch (cid) {
7205 case MBIM_CID_PHONEBOOK_CONFIGURATION:
7206 mbim_dissect_phonebook_configuration_info(frag_tvb, pinfo, subtree, offset);
7207 break;
7208 case MBIM_CID_PHONEBOOK_READ:
7209 if (msg_type == MBIM_COMMAND_DONE) {
7210 mbim_dissect_phonebook_read_info(frag_tvb, pinfo, subtree, offset);
7211 } else {
7212 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7213 }
7214 break;
7215 case MBIM_CID_PHONEBOOK_DELETE:
7216 case MBIM_CID_PHONEBOOK_WRITE:
7217 if (msg_type == MBIM_COMMAND_DONE) {
7218 if (info_buff_len) {
7219 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7220 }
7221 } else {
7222 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7223 }
7224 break;
7225 default:
7226 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7227 break;
7228 }
7229 break;
7230 case UUID_STK:
7231 switch (cid) {
7232 case MBIM_CID_STK_PAC:
7233 if (msg_type == MBIM_COMMAND_DONE) {
7234 mbim_dissect_stk_pac_info(frag_tvb, pinfo, subtree, offset);
7235 } else {
7236 tvbuff_t *pac_tvb;
7237 gint pac_length;
7238 proto_tree *pac_tree;
7239
7240 proto_tree_add_item(subtree, hf_mbim_stk_pac_pac_type, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7241 offset += 4;
7242 pac_length = info_buff_len - 4;
7243 ti = proto_tree_add_item(subtree, hf_mbim_stk_pac_pac, frag_tvb, offset, pac_length, ENC_NA);
7244 if (bertlv_handle) {
7245 pac_tree = proto_item_add_subtree(ti, ett_mbim_buffer);
7246 pac_tvb = tvb_new_subset_length(frag_tvb, offset, pac_length);
7247 call_dissector(bertlv_handle, pac_tvb, pinfo, pac_tree);
7248 }
7249 }
7250 break;
7251 case MBIM_CID_STK_TERMINAL_RESPONSE:
7252 if (msg_type == MBIM_COMMAND_DONE) {
7253 mbim_dissect_stk_terminal_response_info(frag_tvb, pinfo, subtree, offset);
7254 } else {
7255 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7256 }
7257 break;
7258 case MBIM_CID_STK_ENVELOPE:
7259 if (msg_type == MBIM_COMMAND_DONE) {
7260 proto_tree_add_item(subtree, hf_mbim_stk_envelope_info_envelope_support,
7261 frag_tvb, offset, 32, ENC_NA);
7262 } else {
7263 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7264 }
7265 break;
7266 default:
7267 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7268 break;
7269 }
7270 break;
7271 case UUID_AUTH:
7272 switch (cid) {
7273 case MBIM_CID_AKA_AUTH:
7274 if (msg_type == MBIM_COMMAND_DONE) {
7275 mbim_dissect_aka_auth_info(frag_tvb, pinfo, subtree, offset);
7276 } else {
7277 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7278 }
7279 break;
7280 case MBIM_CID_AKAP_AUTH:
7281 if (msg_type == MBIM_COMMAND_DONE) {
7282 mbim_dissect_akap_auth_info(frag_tvb, pinfo, subtree, offset);
7283 } else {
7284 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7285 }
7286 break;
7287 case MBIM_CID_SIM_AUTH:
7288 if (msg_type == MBIM_COMMAND_DONE) {
7289 mbim_dissect_sim_auth_info(frag_tvb, pinfo, subtree, offset);
7290 } else {
7291 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7292 }
7293 break;
7294 default:
7295 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7296 break;
7297 }
7298 break;
7299 case UUID_DSS:
7300 switch (cid) {
7301 case MBIM_CID_DSS_CONNECT:
7302 if (msg_type == MBIM_COMMAND_DONE) {
7303 if (info_buff_len) {
7304 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7305 }
7306 } else {
7307 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7308 }
7309 break;
7310 default:
7311 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7312 break;
7313 }
7314 break;
7315 case UUID_MULTICARRIER:
7316 switch (cid) {
7317 case MBIM_CID_MULTICARRIER_CAPABILITIES:
7318 if (msg_type == MBIM_COMMAND_DONE) {
7319 proto_tree_add_bitmask(subtree, frag_tvb, offset, hf_mbim_multicarrier_capabilities_info_capabilities,
7320 ett_mbim_bitmap, mbim_multicarrier_capabilities_fields, ENC_LITTLE_ENDIAN);
7321 } else {
7322 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7323 }
7324 break;
7325 case MBIM_CID_LOCATION_INFO:
7326 if (msg_type == MBIM_COMMAND_DONE) {
7327 proto_tree_add_item(subtree, hf_mbim_location_info_country, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7328 } else if (info_buff_len) {
7329 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7330 }
7331 break;
7332 case MBIM_CID_MULTICARRIER_CURRENT_CID_LIST:
7333 if (msg_type == MBIM_COMMAND_DONE) {
7334 mbim_dissect_muticarrier_current_cid_list_info(frag_tvb, pinfo, subtree, offset);
7335 } else {
7336 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7337 }
7338 break;
7339 default:
7340 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7341 break;
7342 }
7343 break;
7344 case UUID_MS_HOSTSHUTDOWN:
7345 switch (cid) {
7346 case MBIM_CID_MS_HOSTSHUTDOWN:
7347 case MBIM_CID_MS_HOSTPRESHUTDOWN:
7348 if (msg_type == MBIM_COMMAND_DONE) {
7349 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_QUERY)) {
7350 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7351 } else if (info_buff_len) {
7352 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7353 }
7354 } else {
7355 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7356 }
7357 break;
7358 default:
7359 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7360 break;
7361 }
7362 break;
7363 case UUID_MSFWID:
7364 switch (cid) {
7365 case MBIM_CID_MSFWID_FIRMWAREID:
7366 if (msg_type == MBIM_COMMAND_DONE) {
7367 proto_tree_add_item(subtree, hf_mbim_msfwid_firmwareid_info_firmware_id, frag_tvb, offset, 16, ENC_NA);
7368 } else if (info_buff_len) {
7369 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7370 }
7371 break;
7372 default:
7373 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7374 break;
7375 }
7376 break;
7377 case UUID_QMI:
7378 switch (cid) {
7379 case MBIM_CID_QMI_QMI:
7380 if (info_buff_len) {
7381 proto_tree_add_item(subtree, hf_mbim_qmi_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7382 }
7383 break;
7384 default:
7385 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7386 break;
7387 }
7388 break;
7389 case UUID_INTEL_FWUSVC:
7390 switch (cid) {
7391 case MBIM_CID_INTC_MODEM_REBOOT:
7392 if (msg_type == MBIM_COMMAND_DONE) {
7393 if (info_buff_len) {
7394 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7395 }
7396 } else {
7397 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7398 }
7399 break;
7400 default:
7401 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7402 break;
7403 }
7404 break;
7405 case UUID_INTEL_DPTF:
7406 switch (cid) {
7407 case MBIM_CID_INTC_THERMAL_STATE:
7408 if ((msg_type == MBIM_COMMAND_DONE) && mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7409 mbim_dissect_thermal_config(frag_tvb, pinfo, subtree, offset);
7410 } else {
7411 mbim_dissect_thermal_state_info(frag_tvb, pinfo, subtree, offset);
7412 }
7413 break;
7414 default:
7415 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7416 break;
7417 }
7418 break;
7419 case UUID_INTEL_SAR:
7420 switch (cid) {
7421 case MBIM_CID_INTC_SAR_CONFIG:
7422 if (msg_type == MBIM_COMMAND_DONE) {
7423 mbim_dissect_sar_config(frag_tvb, pinfo, subtree, offset, info_buff_len);
7424 } else {
7425 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7426 }
7427 break;
7428 default:
7429 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7430 break;
7431 }
7432 break;
7433 case UUID_INTEL_ACT:
7434 switch (cid) {
7435 case MBIM_CID_INTC_ADPCLK_MODE:
7436 if ((msg_type == MBIM_COMMAND_DONE) && info_buff_len &&
7437 mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7438 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7439 } else {
7440 mbim_dissect_adpclk_freq_info(frag_tvb, pinfo, subtree, offset);
7441 }
7442 break;
7443 default:
7444 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7445 break;
7446 }
7447 break;
7448 case UUID_INTEL_TRCSVC:
7449 switch (cid) {
7450 case MBIM_CID_INTC_TRACE:
7451 if (msg_type == MBIM_COMMAND_DONE) {
7452 proto_tree_add_item(subtree, hf_mbim_trace_config_config, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7453 } else {
7454 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7455 }
7456 break;
7457 case MBIM_CID_INTC_TRACE_DATA:
7458 if (msg_type == MBIM_COMMAND_DONE) {
7459 proto_tree_add_item(subtree, hf_mbim_trace_config_config, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7460 } else {
7461 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7462 }
7463 break;
7464 default:
7465 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7466 break;
7467 }
7468 break;
7469 case UUID_INTEL_NRTC:
7470 switch (cid) {
7471 case MBIM_CID_INTC_NRTAPP:
7472 if (msg_type == MBIM_COMMAND_DONE) {
7473 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET) && info_buff_len) {
7474 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7475 } else if ((mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_QUERY)) || info_buff_len) {
7476 proto_tree_add_item(subtree, hf_mbim_nrtc_app_info_period, frag_tvb, offset, 2, ENC_LITTLE_ENDIAN);
7477 offset += 2;
7478 proto_tree_add_item(subtree, hf_mbim_nrtc_app_info_duration, frag_tvb, offset, 2, ENC_LITTLE_ENDIAN);
7479 }
7480 } else {
7481 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7482 }
7483 break;
7484 case MBIM_CID_INTC_NRTCWS:
7485 if (msg_type == MBIM_COMMAND_DONE) {
7486 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET) && info_buff_len) {
7487 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7488 } else if ((mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_QUERY)) || info_buff_len) {
7489 mbim_dissect_nrtcws_config(frag_tvb, pinfo, subtree, offset, info_buff_len);
7490 }
7491 } else {
7492 mbim_dissect_nrtcws_info(frag_tvb, pinfo, subtree, offset);
7493 }
7494 break;
7495 default:
7496 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7497 break;
7498 }
7499 break;
7500 case UUID_INTEL_USB_PROFILE:
7501 switch (cid) {
7502 case MBIM_CID_INTC_USBPROFILE:
7503 if ((msg_type == MBIM_COMMAND_DONE) && ((mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) || info_buff_len)) {
7504 guint32 at_len;
7505
7506 proto_tree_add_item_ret_uint(subtree, hf_mbim_usbprofile_rsp_length, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN, &at_len);
7507 offset += 4;
7508 proto_tree_add_item(subtree, hf_mbim_usbprofile_rsp_buffer, frag_tvb, offset, at_len, ENC_LITTLE_ENDIAN|ENC_UTF_16);
7509 } else {
7510 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7511 }
7512 break;
7513 default:
7514 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7515 break;
7516 }
7517 break;
7518 case UUID_INTEL_CIQ:
7519 switch (cid) {
7520 case MBIM_CID_INTC_CIQ:
7521 if (msg_type == MBIM_COMMAND_DONE) {
7522 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET) && info_buff_len) {
7523 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7524 } else if ((mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_QUERY)) || info_buff_len) {
7525 proto_tree_add_item(subtree, hf_mbim_ciq_info_mode, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7526 }
7527 } else {
7528 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7529 }
7530 break;
7531 default:
7532 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7533 break;
7534 }
7535 break;
7536 case UUID_ATDS:
7537 switch (cid) {
7538 case MBIM_CID_ATDS_SIGNAL:
7539 if (msg_type == MBIM_COMMAND_DONE) {
7540 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7541 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7542 } else {
7543 mbim_dissect_atds_signal_info(frag_tvb, pinfo, subtree, offset);
7544 }
7545 } else {
7546 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7547 }
7548 break;
7549 case MBIM_CID_ATDS_LOCATION:
7550 if (msg_type == MBIM_COMMAND_DONE) {
7551 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7552 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7553 } else {
7554 proto_tree_add_item(subtree, hf_mbim_atds_location_info_lac, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7555 offset += 4;
7556 proto_tree_add_item(subtree, hf_mbim_atds_location_info_tac, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7557 offset += 4;
7558 proto_tree_add_item(subtree, hf_mbim_atds_location_info_cellid, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7559 }
7560 } else {
7561 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7562 }
7563 break;
7564 case MBIM_CID_ATDS_OPERATORS:
7565 if (msg_type == MBIM_COMMAND_DONE) {
7566 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET) && info_buff_len) {
7567 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7568 } else if ((mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_QUERY)) || info_buff_len) {
7569 mbim_dissect_atds_operators(frag_tvb, pinfo, subtree, offset);
7570 }
7571 } else {
7572 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7573 }
7574 break;
7575 case MBIM_CID_ATDS_RAT:
7576 if (msg_type == MBIM_COMMAND_DONE) {
7577 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET) && info_buff_len) {
7578 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7579 } else if ((mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_QUERY)) || info_buff_len) {
7580 proto_tree_add_item(subtree, hf_mbim_atds_rat_info_mode, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7581 }
7582 } else {
7583 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7584 }
7585 break;
7586 case MBIM_CID_ATDS_REGISTER_STATE:
7587 if (msg_type == MBIM_COMMAND_DONE) {
7588 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7589 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7590 } else {
7591 mbim_dissect_registration_state_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
7592 }
7593 } else {
7594 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7595 }
7596 break;
7597 case MBIM_CID_ATDS_SET_PROJECTION_TABLES:
7598 if (msg_type == MBIM_COMMAND_DONE) {
7599 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET) && info_buff_len) {
7600 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7601 } else if ((mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_QUERY)) || info_buff_len) {
7602 mbim_dissect_atds_projection_tables(frag_tvb, pinfo, subtree, offset);
7603 }
7604 } else {
7605 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7606 }
7607 break;
7608 default:
7609 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7610 break;
7611 }
7612 break;
7613 case UUID_MULTIFLOW:
7614 switch (cid) {
7615 case MBIM_CID_MULTIFLOW_CAPS:
7616 if (msg_type == MBIM_COMMAND_DONE) {
7617 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7618 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7619 } else {
7620 proto_tree_add_bitmask(subtree, frag_tvb, offset, hf_mbim_multiflow_caps_info_control_caps,
7621 ett_mbim_bitmap, mbim_multiflow_caps_info_control_caps_fields, ENC_LITTLE_ENDIAN);
7622 }
7623 } else {
7624 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, info_buff_len);
7625 }
7626 break;
7627 case MBIM_CID_MULTIFLOW_UPLINK:
7628 case MBIM_CID_MULTIFLOW_DOWNLINK:
7629 if (msg_type == MBIM_COMMAND_DONE) {
7630 proto_tree_add_item(subtree, hf_mbim_multiflow_state_info_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7631 } else {
7632 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, info_buff_len);
7633 }
7634 break;
7635 case MBIM_CID_MULTIFLOW_TFT:
7636 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7637 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7638 } else {
7639 mbim_dissect_multiflow_tft_info(frag_tvb, pinfo, subtree, offset);
7640 }
7641 break;
7642 default:
7643 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7644 break;
7645 }
7646 break;
7647 case UUID_BASIC_CONNECT_EXTENSIONS:
7648 switch (cid) {
7649 case MBIM_CID_MS_PROVISIONED_CONTEXT_V2:
7650 mbim_dissect_ms_provisioned_context_info_v2(frag_tvb, pinfo, subtree, offset);
7651 break;
7652 case MBIM_CID_MS_NETWORK_BLACKLIST:
7653 mbim_dissect_ms_network_blacklist_info(pinfo, frag_tvb, subtree, offset);
7654 break;
7655 case MBIM_CID_MS_LTE_ATTACH_CONFIG:
7656 case MBIM_CID_MS_LTE_ATTACH_STATUS:
7657 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7658 break;
7659 case MBIM_CID_MS_SYS_CAPS:
7660 if (msg_type == MBIM_COMMAND_DONE) {
7661 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7662 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7663 } else {
7664 mbim_dissect_sys_caps_info(frag_tvb, subtree, offset);
7665 }
7666 } else {
7667 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7668 }
7669 break;
7670 case MBIM_CID_MS_DEVICE_CAPS_V2:
7671 if (msg_type == MBIM_COMMAND_DONE) {
7672 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7673 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7674 } else {
7675 if (SHOULD_MBIM_EX3_BE_APPLIED(mbim_conv)) {
7676 mbim_dissect_device_caps_v3_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
7677 } else {
7678 mbim_dissect_device_caps_v2_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
7679 }
7680 }
7681 } else {
7682 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7683 }
7684 break;
7685 case MBIM_CID_MS_DEVICE_SLOT_MAPPINGS:
7686 if (msg_type == MBIM_COMMAND_DONE) {
7687 mbim_dissect_ms_device_slot_mapping_info(frag_tvb, pinfo, subtree, offset);
7688 } else {
7689 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7690 }
7691 break;
7692 case MBIM_CID_MS_SLOT_INFO_STATUS:
7693 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7694 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7695 } else {
7696 proto_tree_add_item(subtree, hf_mbim_ms_slot_info_slot_index, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7697 offset += 4;
7698 proto_tree_add_item(subtree, hf_mbim_ms_slot_info_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
7699 }
7700 break;
7701 case MBIM_CID_PCO:
7702 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7703 break;
7704 case MBIM_CID_MS_DEVICE_RESET:
7705 if (msg_type == MBIM_COMMAND_DONE) {
7706 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_QUERY)) {
7707 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7708 } else if (info_buff_len) {
7709 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7710 }
7711 } else {
7712 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7713 }
7714 break;
7715 case MBIM_CID_BASE_STATIONS_INFO:
7716 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7717 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7718 } else {
7719 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7720 }
7721 break;
7722 case MBIM_CID_LOCATION_INFO_STATUS:
7723 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7724 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7725 } else {
7726 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7727 }
7728 break;
7729 case MBIM_CID_MS_PIN_INFO_EX2:
7730 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7731 break;
7732 case MBIM_CID_VERSION:
7733 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7734 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7735 }
7736 else if (info_buff_len) {
7737 mbim_dissect_version(frag_tvb, subtree, offset, mbim_conv);
7738 }
7739 break;
7740 case MBIM_CID_MS_MODEM_CONFIG:
7741 mbim_dissect_ms_modem_config_info(frag_tvb, pinfo, subtree, offset, info_buff_len);
7742 break;
7743 case MBIM_CID_MS_REGISTRATION_PARAMS:
7744 mbim_dissect_ms_registration_params_info(frag_tvb, pinfo, subtree, offset, info_buff_len);
7745 break;
7746 case MBIM_CID_MS_WAKE_REASON:
7747 mbim_dissect_ms_wake_reason(frag_tvb, pinfo, subtree, offset);
7748 break;
7749 default:
7750 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7751 break;
7752 }
7753 break;
7754 case UUID_MS_SARCONTROL:
7755 switch (cid) {
7756 case MBIM_CID_MS_SAR_CONFIG:
7757 case MBIM_CID_MS_TRANSMISSION_STATUS:
7758 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7759 break;
7760 default:
7761 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7762 break;
7763 }
7764 break;
7765 case UUID_MS_UICC_LOW_LEVEL:
7766 switch (cid) {
7767 case MBIM_CID_MS_UICC_ATR:
7768 if (msg_type == MBIM_COMMAND_DONE) {
7769 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7770 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7771 } else {
7772 mbim_dissect_ms_atr_info(frag_tvb, pinfo, subtree, offset);
7773 }
7774 } else {
7775 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7776 }
7777 break;
7778 case MBIM_CID_MS_UICC_OPEN_CHANNEL:
7779 case MBIM_CID_MS_UICC_CLOSE_CHANNEL:
7780 case MBIM_CID_MS_UICC_APDU:
7781 case MBIM_CID_MS_UICC_TERMINAL_CAPABILITY:
7782 case MBIM_CID_MS_UICC_RESET:
7783 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7784 break;
7785 case MBIM_CID_MS_UICC_APP_LIST:
7786 if (msg_type == MBIM_COMMAND_DONE) {
7787 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7788 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7789 } else {
7790 mbim_dissect_ms_app_list(frag_tvb, pinfo, subtree, offset);
7791 }
7792 } else {
7793 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7794 }
7795 break;
7796 case MBIM_CID_MS_UICC_ACCESS_BINARY:
7797 mbim_dissect_ms_response(frag_tvb, pinfo, subtree, offset);
7798 break;
7799 case MBIM_CID_MS_UICC_ACCESS_RECORD:
7800 mbim_dissect_ms_response(frag_tvb, pinfo, subtree, offset);
7801 break;
7802 case MBIM_CID_MS_UICC_FILE_STATUS:
7803 if (msg_type == MBIM_COMMAND_DONE) {
7804 if (mbim_info && (mbim_info->cmd_type == MBIM_COMMAND_SET)) {
7805 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7806 } else {
7807 mbim_dissect_ms_file_status(frag_tvb, pinfo, subtree, offset);
7808 }
7809 } else {
7810 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7811 }
7812 break;
7813 default:
7814 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7815 break;
7816 }
7817 break;
7818 case UUID_EXT_IDX:
7819 {
7820 gint cid_idx;
7821 mbim_dissect_fct dissect_cid;
7822
7823 try_val_to_str_idx(cid, uuid_ext_info->uuid_cid_list, &cid_idx);
7824 if (cid_idx != -1) {
7825 dissect_cid = (msg_type == MBIM_COMMAND_DONE) ? uuid_ext_info->uuid_fct_list[cid_idx].cmd_done :
7826 uuid_ext_info->uuid_fct_list[cid_idx].ind_status;
7827 if (dissect_cid) {
7828 dissect_cid(frag_tvb, pinfo, subtree, offset, mbim_info);
7829 } else if (info_buff_len) {
7830 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
7831 }
7832 } else {
7833 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
7834 }
7835 }
7836 break;
7837 default:
7838 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
7839 break;
7840 }
7841 }
7842 break;
7843 default:
7844 break;
7845 }
7846
7847 return tvb_captured_length(tvb);
7848 }
7849
7850 static int
dissect_mbim_descriptor(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,void * data _U_)7851 dissect_mbim_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
7852 {
7853 proto_item *ti;
7854 guint8 length, type, subtype;
7855
7856 length = tvb_get_guint8(tvb, 0);
7857 type = tvb_get_guint8(tvb, 1);
7858 subtype = tvb_get_guint8(tvb, 2);
7859
7860 if ((type != 0x24) ||
7861 !(((subtype == 0x1b) && (length == 12)) || ((subtype == 0x1c) && (length == 8)))){
7862 return 0;
7863 }
7864
7865 ti = proto_tree_add_item(tree, hf_mbim_descriptor, tvb, 0, 0, ENC_NA);
7866 proto_item_set_hidden(ti);
7867
7868 if (subtype == 0x1b) {
7869 proto_tree_add_item(tree, hf_mbim_descriptor_version, tvb, 3, 2, ENC_LITTLE_ENDIAN);
7870 proto_tree_add_item(tree, hf_mbim_descriptor_max_control_message, tvb, 5, 2, ENC_LITTLE_ENDIAN);
7871 proto_tree_add_item(tree, hf_mbim_descriptor_number_filters, tvb, 7, 1, ENC_NA);
7872 proto_tree_add_item(tree, hf_mbim_descriptor_max_filter_size, tvb, 8, 1, ENC_NA);
7873 proto_tree_add_item(tree, hf_mbim_descriptor_max_segment_size, tvb, 9, 2, ENC_LITTLE_ENDIAN);
7874 proto_tree_add_bitmask(tree, tvb, 11, hf_mbim_descriptor_network_capabilities, ett_mbim_bitmap,
7875 mbim_descriptor_network_capabilities_fields, ENC_NA);
7876 } else {
7877 proto_tree_add_item(tree, hf_mbim_descriptor_extended_version, tvb, 3, 2, ENC_LITTLE_ENDIAN);
7878 proto_tree_add_item(tree, hf_mbim_descriptor_max_outstanding_command_messages, tvb, 5, 1, ENC_NA);
7879 proto_tree_add_item(tree, hf_mbim_descriptor_mtu, tvb, 6, 2, ENC_LITTLE_ENDIAN);
7880 }
7881
7882 return length;
7883 }
7884
7885 static int
dissect_mbim_bulk(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data _U_)7886 dissect_mbim_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
7887 {
7888 proto_item *ti, *sig_ti, *pi;
7889 proto_tree *mbim_tree, *subtree, *sig_tree;
7890 gboolean is_32bits;
7891 guint32 nth_sig, length, next_index, base_offset, offset, datagram_index, datagram_length,
7892 nb, total = 0, ndp = 0, block_len, dss_session_id;
7893 const char *signature;
7894 dissector_handle_t dissector;
7895 tvbuff_t *datagram_tvb;
7896 const guint32 NTH16 = 0x484D434E;
7897 const guint32 NTH32 = 0x686D636E;
7898 guint reported_length;
7899
7900 if (tvb_captured_length(tvb) < 12) {
7901 return 0;
7902 }
7903
7904 nth_sig = tvb_get_letohl(tvb, 0);
7905 if (nth_sig == NTH16) {
7906 is_32bits = FALSE;
7907 } else if (nth_sig == NTH32) {
7908 is_32bits = TRUE;
7909 } else {
7910 return 0;
7911 }
7912
7913 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MBIM");
7914 col_clear(pinfo->cinfo, COL_INFO);
7915
7916 ti = proto_tree_add_item(tree, proto_mbim, tvb, 0, -1, ENC_NA);
7917 mbim_tree = proto_item_add_subtree(ti, ett_mbim);
7918 ti =proto_tree_add_item(mbim_tree, hf_mbim_bulk, tvb, 0, 0, ENC_NA);
7919 proto_item_set_hidden(ti);
7920
7921 subtree = proto_tree_add_subtree(mbim_tree, tvb, 0, 0, ett_mbim_msg_header, NULL, "NCM Transfer Header");
7922 proto_tree_add_item(subtree, hf_mbim_bulk_nth_signature, tvb, 0, 4, ENC_ASCII|ENC_NA);
7923 proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_nth_header_length, tvb, 4, 2, ENC_LITTLE_ENDIAN, &length);
7924 proto_item_set_len(ti, length);
7925 proto_tree_add_item(subtree, hf_mbim_bulk_nth_sequence_number, tvb, 6, 2, ENC_LITTLE_ENDIAN);
7926 if (!is_32bits) {
7927 ti = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_nth_block_length, tvb, 8, 2, ENC_LITTLE_ENDIAN, &block_len);
7928 pi = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_nth_ndp_index, tvb, 10, 2, ENC_LITTLE_ENDIAN, &next_index);
7929 } else {
7930 ti = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_nth_block_length_32, tvb, 8, 4, ENC_LITTLE_ENDIAN, &block_len);
7931 pi = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_nth_ndp_index_32, tvb, 12, 4, ENC_LITTLE_ENDIAN, &next_index);
7932 }
7933 reported_length = tvb_reported_length(tvb);
7934 if (block_len != reported_length) {
7935 expert_add_info(pinfo, ti, &ei_mbim_invalid_block_len);
7936 }
7937 if (next_index % 4) {
7938 expert_add_info_format(pinfo, pi, &ei_mbim_alignment_error,
7939 "NDP Index is not a multiple of 4 bytes");
7940 return tvb_captured_length(tvb);
7941 }
7942 if (next_index > reported_length) {
7943 expert_add_info(pinfo, pi, &ei_mbim_out_of_bounds_index);
7944 return tvb_captured_length(tvb);
7945 }
7946
7947 while (next_index) {
7948 base_offset = offset = next_index;
7949 nb = 0;
7950 subtree = proto_tree_add_subtree(mbim_tree, tvb, offset, 0, ett_mbim_msg_header, NULL, "NCM Datagram Pointer");
7951 signature = (const char*)tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII);
7952 if ((!is_32bits && !strncmp(signature, "IPS", 3)) ||
7953 (is_32bits && !strncmp(signature, "ips", 3))) {
7954 sig_ti = proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset,
7955 4, tvb_get_letohl(tvb, offset), "%c%c%c%u", signature[0],
7956 signature[1], signature[2], signature[3]);
7957 sig_tree = proto_item_add_subtree(sig_ti, ett_mbim_msg_header);
7958 proto_tree_add_item(sig_tree, hf_mbim_bulk_ndp_signature_ips_session_id, tvb, offset+3, 1, ENC_NA);
7959 col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%c%c%c%u", signature[0], signature[1],
7960 signature[2], signature[3]);
7961 dissector = ip_handle;
7962 } else if ((!is_32bits && !strncmp(signature, "IPC", 3)) ||
7963 (is_32bits && !strncmp(signature, "ipc", 3))) {
7964 sig_ti = proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset,
7965 4, tvb_get_letohl(tvb, offset), "%c%c%c%u", signature[0],
7966 signature[1], signature[2], signature[3]);
7967 sig_tree = proto_item_add_subtree(sig_ti, ett_mbim_msg_header);
7968 proto_tree_add_item(sig_tree, hf_mbim_bulk_ndp_signature_ipc_session_id, tvb, offset+3, 1, ENC_NA);
7969 col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%c%c%c%u", signature[0], signature[1],
7970 signature[2], signature[3]);
7971 dissector = bulk_ndp_ctrl_handle;
7972 } else if ((!is_32bits && !strncmp(signature, "DSS", 3)) ||
7973 (is_32bits && !strncmp(signature, "dss", 3))) {
7974 sig_ti = proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset,
7975 4, tvb_get_letohl(tvb, offset), "%c%c%c%u", signature[0],
7976 signature[1], signature[2], signature[3]);
7977 sig_tree = proto_item_add_subtree(sig_ti, ett_mbim_msg_header);
7978 proto_tree_add_item_ret_uint(sig_tree, hf_mbim_bulk_ndp_signature_dss_session_id,
7979 tvb, offset+3, 1, ENC_LITTLE_ENDIAN, &dss_session_id);
7980 col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%c%c%c%u", signature[0], signature[1],
7981 signature[2], signature[3]);
7982 dissector = dissector_get_uint_handle(dss_dissector_table, dss_session_id);
7983 if (dissector == NULL) {
7984 dissector = data_handle;
7985 }
7986 } else if ((!is_32bits && !strncmp(signature, "DSC", 3)) ||
7987 (is_32bits && !strncmp(signature, "dsc", 3))) {
7988 sig_ti = proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset,
7989 4, tvb_get_letohl(tvb, offset), "%c%c%c%u", signature[0],
7990 signature[1], signature[2], signature[3]);
7991 sig_tree = proto_item_add_subtree(sig_ti, ett_mbim_msg_header);
7992 proto_tree_add_item(sig_tree, hf_mbim_bulk_ndp_signature_dsc_session_id, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
7993 col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%c%c%c%u", signature[0], signature[1],
7994 signature[2], signature[3]);
7995 dissector = bulk_ndp_ctrl_handle;
7996 } else if ((!is_32bits && !strcmp(signature, "NCM0")) ||
7997 (is_32bits && !strcmp(signature, "ncm0"))) {
7998 proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset, 4,
7999 tvb_get_letohl(tvb, offset), "%s", signature);
8000 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, signature);
8001 dissector = eth_handle;
8002 } else if ((!is_32bits && !strcmp(signature, "NCM1")) ||
8003 (is_32bits && !strcmp(signature, "ncm1"))) {
8004 proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset, 4,
8005 tvb_get_letohl(tvb, offset), "%s", signature);
8006 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, signature);
8007 dissector = eth_fcs_handle;
8008 } else {
8009 proto_tree_add_item(subtree, hf_mbim_bulk_ndp_signature, tvb, offset, 4, ENC_BIG_ENDIAN);
8010 col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "0x%08X", tvb_get_ntohl(tvb, offset));
8011 dissector = data_handle;
8012 }
8013 offset += 4;
8014 pi = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_ndp_length, tvb, offset, 2, ENC_LITTLE_ENDIAN, &length);
8015 if (length % (is_32bits ? 8 : 4)) {
8016 expert_add_info_format(pinfo, pi, &ei_mbim_alignment_error, "Length is not a multiple of %u bytes",
8017 is_32bits ? 8 : 4);
8018 return tvb_captured_length(tvb);
8019 }
8020 proto_item_set_len(ti, length);
8021 offset += 2;
8022 if (!is_32bits) {
8023 pi = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_ndp_next_ndp_index, tvb,
8024 offset, 2, ENC_LITTLE_ENDIAN, &next_index);
8025 offset += 2;
8026 } else {
8027 proto_tree_add_item(subtree, hf_mbim_bulk_ndp_reserved, tvb,
8028 offset, 2, ENC_LITTLE_ENDIAN);
8029 offset += 2;
8030 pi = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_ndp_next_ndp_index_32,
8031 tvb, offset, 4, ENC_LITTLE_ENDIAN, &next_index);
8032 offset += 4;
8033 proto_tree_add_item(subtree, hf_mbim_bulk_ndp_reserved2, tvb,
8034 offset, 4, ENC_LITTLE_ENDIAN);
8035 offset += 4;
8036 }
8037 if (next_index % 4) {
8038 expert_add_info_format(pinfo, pi, &ei_mbim_alignment_error,
8039 "NDP Index is not a multiple of 4 bytes");
8040 return tvb_captured_length(tvb);
8041 }
8042 if (next_index > reported_length) {
8043 expert_add_info(pinfo, pi, &ei_mbim_out_of_bounds_index);
8044 return tvb_captured_length(tvb);
8045 }
8046 while ((offset - base_offset) < length) {
8047 if (!is_32bits) {
8048 pi = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_ndp_datagram_index, tvb,
8049 offset, 2, ENC_LITTLE_ENDIAN, &datagram_index);
8050 offset += 2;
8051 proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_ndp_datagram_length, tvb,
8052 offset, 2, ENC_LITTLE_ENDIAN, &datagram_length);
8053 offset += 2;
8054 } else {
8055 pi = proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_ndp_datagram_index_32, tvb,
8056 offset, 4, ENC_LITTLE_ENDIAN, &datagram_index);
8057 offset += 4;
8058 proto_tree_add_item_ret_uint(subtree, hf_mbim_bulk_ndp_datagram_length_32, tvb,
8059 offset, 4, ENC_LITTLE_ENDIAN, &datagram_length);
8060 offset += 4;
8061 }
8062 if (next_index > reported_length) {
8063 expert_add_info(pinfo, pi, &ei_mbim_out_of_bounds_index);
8064 return tvb_captured_length(tvb);
8065 }
8066 if (datagram_index && datagram_length) {
8067 proto_tree_add_item(subtree, hf_mbim_bulk_ndp_datagram, tvb,
8068 datagram_index, datagram_length, ENC_NA);
8069 datagram_tvb = tvb_new_subset_length(tvb, datagram_index, datagram_length);
8070 if (dissector) {
8071 if (total) {
8072 col_set_str(pinfo->cinfo, COL_PROTOCOL, "/");
8073 col_set_fence(pinfo->cinfo, COL_PROTOCOL);
8074 col_set_str(pinfo->cinfo, COL_INFO, " | ");
8075 col_set_fence(pinfo->cinfo, COL_INFO);
8076 }
8077 call_dissector(dissector, datagram_tvb, pinfo, tree);
8078 }
8079 col_set_fence(pinfo->cinfo, COL_PROTOCOL);
8080 col_set_fence(pinfo->cinfo, COL_INFO);
8081 nb++;
8082 if (++total > MBIM_MAX_ITEMS) {
8083 expert_add_info_format(pinfo, NULL, &ei_mbim_too_many_items,
8084 "More than %u datagrams, dissection seems suspicious",
8085 MBIM_MAX_ITEMS);
8086 return tvb_captured_length(tvb);
8087 }
8088 }
8089 }
8090 ti = proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_nb_datagrams, tvb, 0, 0, nb);
8091 proto_item_set_generated(ti);
8092 if (++ndp > MBIM_MAX_ITEMS) {
8093 expert_add_info_format(pinfo, NULL, &ei_mbim_too_many_items,
8094 "More than %u NCM Datagram Pointers, dissection seems suspicious",
8095 MBIM_MAX_ITEMS);
8096 return tvb_captured_length(tvb);
8097 }
8098 }
8099 ti = proto_tree_add_uint(mbim_tree, hf_mbim_bulk_total_nb_datagrams, tvb, 0, 0, total);
8100 proto_item_set_generated(ti);
8101
8102 return tvb_captured_length(tvb);
8103 }
8104
8105 static gboolean
dissect_mbim_bulk_heur(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data)8106 dissect_mbim_bulk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
8107 {
8108 usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data;
8109
8110 if ((usb_conv_info == NULL) ||
8111 ((usb_conv_info->interfaceClass != IF_CLASS_CDC_DATA) &&
8112 (usb_conv_info->interfaceClass != IF_CLASS_UNKNOWN))) {
8113 return FALSE;
8114 }
8115
8116 if (dissect_mbim_bulk(tvb, pinfo, tree, usb_conv_info)) {
8117 return TRUE;
8118 }
8119 return FALSE;
8120 }
8121
8122 static int
dissect_mbim_decode_as(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data)8123 dissect_mbim_decode_as(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
8124 {
8125 usb_conv_info_t *usb_conv_info;
8126 usb_trans_info_t *usb_trans_info;
8127
8128 if (!data || (tvb_reported_length(tvb) == 0)) {
8129 return 0;
8130 }
8131
8132 usb_conv_info = (usb_conv_info_t *)data;
8133 usb_trans_info = usb_conv_info->usb_trans_info;
8134
8135 switch (usb_conv_info->transfer_type) {
8136 case URB_CONTROL:
8137 if (!usb_trans_info) {
8138 return dissect_mbim_control(tvb, pinfo, tree, usb_conv_info);
8139 } else if ((usb_trans_info->setup.request == 0x00) && (pinfo->srcport == NO_ENDPOINT)) {
8140 /* Skip Send Encapsulated Command header */
8141 tvbuff_t *mbim_tvb = tvb_new_subset_remaining(tvb, 7);
8142 return dissect_mbim_control(mbim_tvb, pinfo, tree, usb_conv_info);
8143 } else if ((usb_trans_info->setup.request == 0x01) && (pinfo->srcport != NO_ENDPOINT)) {
8144 return dissect_mbim_control(tvb, pinfo, tree, usb_conv_info);
8145 }
8146 break;
8147 case URB_BULK:
8148 return dissect_mbim_bulk(tvb, pinfo, tree, usb_conv_info);
8149 default:
8150 break;
8151 }
8152 return 0;
8153 }
8154
8155 static int
dissect_mbim_bulk_ndp_ctrl(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data _U_)8156 dissect_mbim_bulk_ndp_ctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
8157 {
8158 proto_tree *ndp_ctrl_tree;
8159 proto_item *ti;
8160 gint offset = 0;
8161 guint32 msg_type, msg_len;
8162
8163 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MBIM NDP Control");
8164 col_clear(pinfo->cinfo, COL_INFO);
8165
8166 ti = proto_tree_add_protocol_format(tree, proto_mbim, tvb, 0, -1, "MBIM NDP Control");
8167 ndp_ctrl_tree = proto_item_add_subtree(ti, ett_mbim_bulk_ndp_ctrl);
8168 ti = proto_tree_add_item(ndp_ctrl_tree, hf_mbim_bulk_ndp_ctrl, tvb, offset, 0, ENC_NA);
8169 proto_item_set_hidden(ti);
8170
8171 proto_tree_add_item_ret_uint(ndp_ctrl_tree, hf_mbim_bulk_ndp_ctrl_message_type, tvb, offset, 2, ENC_LITTLE_ENDIAN, &msg_type);
8172 offset += 2;
8173 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(msg_type, mbim_ndp_ctrl_msg_type_vals, "Unknown"));
8174 proto_tree_add_item_ret_uint(ndp_ctrl_tree, hf_mbim_bulk_ndp_ctrl_message_length, tvb, offset, 2, ENC_LITTLE_ENDIAN, &msg_len);
8175 offset += 2;
8176
8177 switch (msg_type) {
8178 case MBIM_NDP_CTRL_MULTIFLOW_STATUS:
8179 {
8180 guint32 watermark;
8181
8182 proto_tree_add_item(ndp_ctrl_tree, hf_mbim_bulk_ndp_ctrl_multiflow_status, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8183 offset += 2;
8184 watermark = tvb_get_letohl(tvb, offset);
8185 if (watermark == 0xffffffff) {
8186 proto_tree_add_uint_format_value(ndp_ctrl_tree, hf_mbim_bulk_ndp_ctrl_multiflow_watermark, tvb, offset, 4,
8187 watermark, "Not reported (0xffffffff)");
8188 } else {
8189 proto_tree_add_uint_format_value(ndp_ctrl_tree, hf_mbim_bulk_ndp_ctrl_multiflow_watermark, tvb, offset, 4,
8190 watermark, "%u payload bytes", watermark);
8191 }
8192 }
8193 break;
8194 default:
8195 proto_tree_add_item(ndp_ctrl_tree, hf_mbim_bulk_ndp_ctrl_message_payload, tvb, offset, msg_len-4, ENC_NA);
8196 break;
8197 }
8198 return tvb_captured_length(tvb);
8199 }
8200
8201 static guint
mbim_uuid_hash(gconstpointer key)8202 mbim_uuid_hash(gconstpointer key)
8203 {
8204 return wmem_strong_hash((const guint8 *)key, 4*sizeof(guint32));
8205 }
8206
8207 static gboolean
mbim_uuid_equal(gconstpointer v1,gconstpointer v2)8208 mbim_uuid_equal(gconstpointer v1, gconstpointer v2)
8209 {
8210 const guint32 *uuid1 = (const guint32*)v1;
8211 const guint32 *uuid2 = (const guint32*)v2;
8212
8213 return ((uuid1[0] == uuid2[0]) &&
8214 (uuid1[1] == uuid2[1]) &&
8215 (uuid1[2] == uuid2[2]) &&
8216 (uuid1[3] == uuid2[3]));
8217 }
8218
mbim_register_uuid_ext(struct mbim_uuid_ext * uuid_ext)8219 void mbim_register_uuid_ext(struct mbim_uuid_ext *uuid_ext)
8220 {
8221 guint32 *uuid_key;
8222
8223 if (!mbim_uuid_ext_hash) {
8224 mbim_uuid_ext_hash = wmem_map_new(wmem_epan_scope(), mbim_uuid_hash, mbim_uuid_equal);
8225 }
8226
8227 uuid_key = (guint32 *)wmem_alloc(wmem_epan_scope(), 4*sizeof(guint32));
8228 memcpy(uuid_key, uuid_ext->uuid, 4*sizeof(guint32));
8229 wmem_map_insert(mbim_uuid_ext_hash, uuid_key, uuid_ext);
8230 }
8231
8232 void
proto_register_mbim(void)8233 proto_register_mbim(void)
8234 {
8235 module_t *mbim_module;
8236 expert_module_t* expert_mbim;
8237
8238 static hf_register_info hf[] = {
8239 { &hf_mbim_control,
8240 { "Control", "mbim.control",
8241 FT_NONE, BASE_NONE, NULL, 0,
8242 NULL, HFILL }
8243 },
8244 { &hf_mbim_header_message_type,
8245 { "Message Type", "mbim.control.header.message_type",
8246 FT_UINT32, BASE_HEX, VALS(mbim_msg_type_vals), 0,
8247 NULL, HFILL }
8248 },
8249 { &hf_mbim_header_message_length,
8250 { "Message Length", "mbim.control.header.message_length",
8251 FT_UINT32, BASE_DEC, NULL, 0,
8252 NULL, HFILL }
8253 },
8254 { &hf_mbim_header_transaction_id,
8255 { "Transaction Id", "mbim.control.header.transaction_id",
8256 FT_UINT32, BASE_DEC, NULL, 0,
8257 NULL, HFILL }
8258 },
8259 { &hf_mbim_fragment_total,
8260 { "Total Fragments", "mbim.control.fragment.total",
8261 FT_UINT32, BASE_DEC, NULL, 0,
8262 NULL, HFILL }
8263 },
8264 { &hf_mbim_fragment_current,
8265 { "Current Fragment", "mbim.control.fragment.current",
8266 FT_UINT32, BASE_DEC, NULL, 0,
8267 NULL, HFILL }
8268 },
8269 { &hf_mbim_max_ctrl_transfer,
8270 { "Max Control Transfer", "mbim.control.max_control_transfer",
8271 FT_UINT32, BASE_DEC, NULL, 0,
8272 NULL, HFILL }
8273 },
8274 { &hf_mbim_device_service_id,
8275 { "Device Service Id", "mbim.control.device_service_id",
8276 FT_GUID, BASE_NONE, NULL, 0,
8277 NULL, HFILL }
8278 },
8279 { &hf_mbim_uuid_basic_connect_cid,
8280 { "CID", "mbim.control.cid",
8281 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &mbim_uuid_basic_connect_cid_vals_ext, 0,
8282 NULL, HFILL }
8283 },
8284 { &hf_mbim_uuid_sms_cid,
8285 { "CID", "mbim.control.cid",
8286 FT_UINT32, BASE_DEC, VALS(mbim_uuid_sms_cid_vals), 0,
8287 NULL, HFILL }
8288 },
8289 { &hf_mbim_uuid_ussd_cid,
8290 { "CID", "mbim.control.cid",
8291 FT_UINT32, BASE_DEC, VALS(mbim_uuid_ussd_cid_vals), 0,
8292 NULL, HFILL }
8293 },
8294 { &hf_mbim_uuid_phonebook_cid,
8295 { "CID", "mbim.control.cid",
8296 FT_UINT32, BASE_DEC, VALS(mbim_uuid_phonebook_cid_vals), 0,
8297 NULL, HFILL }
8298 },
8299 { &hf_mbim_uuid_stk_cid,
8300 { "CID", "mbim.control.cid",
8301 FT_UINT32, BASE_DEC, VALS(mbim_uuid_stk_cid_vals), 0,
8302 NULL, HFILL }
8303 },
8304 { &hf_mbim_uuid_auth_cid,
8305 { "CID", "mbim.control.cid",
8306 FT_UINT32, BASE_DEC, VALS(mbim_uuid_auth_cid_vals), 0,
8307 NULL, HFILL }
8308 },
8309 { &hf_mbim_uuid_dss_cid,
8310 { "CID", "mbim.control.cid",
8311 FT_UINT32, BASE_DEC, VALS(mbim_uuid_dss_cid_vals), 0,
8312 NULL, HFILL }
8313 },
8314 { &hf_mbim_uuid_multicarrier_cid,
8315 { "CID", "mbim.control.cid",
8316 FT_UINT32, BASE_DEC, VALS(mbim_uuid_multicarrier_cid_vals), 0,
8317 NULL, HFILL }
8318 },
8319 { &hf_mbim_uuid_ms_hostshutdown_cid,
8320 { "CID", "mbim.control.cid",
8321 FT_UINT32, BASE_DEC, VALS(mbim_uuid_ms_hostshutdown_cid_vals), 0,
8322 NULL, HFILL }
8323 },
8324 { &hf_mbim_uuid_msfwid_cid,
8325 { "CID", "mbim.control.cid",
8326 FT_UINT32, BASE_DEC, VALS(mbim_uuid_msfwid_cid_vals), 0,
8327 NULL, HFILL }
8328 },
8329 { &hf_mbim_uuid_qmi_cid,
8330 { "CID", "mbim.control.cid",
8331 FT_UINT32, BASE_DEC, VALS(mbim_uuid_qmi_cid_vals), 0,
8332 NULL, HFILL }
8333 },
8334 { &hf_mbim_uuid_intel_fwusvc_cid,
8335 { "CID", "mbim.control.cid",
8336 FT_UINT32, BASE_DEC, VALS(mbim_uuid_intel_fwusvc_cid_vals), 0,
8337 NULL, HFILL }
8338 },
8339 { &hf_mbim_uuid_intel_dptf_cid,
8340 { "CID", "mbim.control.cid",
8341 FT_UINT32, BASE_DEC, VALS(mbim_uuid_intel_dptf_cid_vals), 0,
8342 NULL, HFILL }
8343 },
8344 { &hf_mbim_uuid_intel_sar_cid,
8345 { "CID", "mbim.control.cid",
8346 FT_UINT32, BASE_DEC, VALS(mbim_uuid_intel_sar_cid_vals), 0,
8347 NULL, HFILL }
8348 },
8349 { &hf_mbim_uuid_intel_act_cid,
8350 { "CID", "mbim.control.cid",
8351 FT_UINT32, BASE_DEC, VALS(mbim_uuid_intel_act_cid_vals), 0,
8352 NULL, HFILL }
8353 },
8354 { &hf_mbim_uuid_intel_trcsvc_cid,
8355 { "CID", "mbim.control.cid",
8356 FT_UINT32, BASE_DEC, VALS(mbim_uuid_intel_trcsvc_cid_vals), 0,
8357 NULL, HFILL }
8358 },
8359 { &hf_mbim_uuid_intel_nrtc_cid,
8360 { "CID", "mbim.control.cid",
8361 FT_UINT32, BASE_DEC, VALS(mbim_uuid_intel_nrtc_cid_vals), 0,
8362 NULL, HFILL }
8363 },
8364 { &hf_mbim_uuid_intel_usb_profile_cid,
8365 { "CID", "mbim.control.cid",
8366 FT_UINT32, BASE_DEC, VALS(mbim_uuid_intel_usb_profile_cid_vals), 0,
8367 NULL, HFILL }
8368 },
8369 { &hf_mbim_uuid_intel_ciq_cid,
8370 { "CID", "mbim.control.cid",
8371 FT_UINT32, BASE_DEC, VALS(mbim_uuid_intel_ciq_cid_vals), 0,
8372 NULL, HFILL }
8373 },
8374 { &hf_mbim_uuid_atds_cid,
8375 { "CID", "mbim.control.cid",
8376 FT_UINT32, BASE_DEC, VALS(mbim_uuid_atds_cid_vals), 0,
8377 NULL, HFILL }
8378 },
8379 { &hf_mbim_uuid_multiflow_cid,
8380 { "CID", "mbim.control.cid",
8381 FT_UINT32, BASE_DEC, VALS(mbim_uuid_multiflow_cid_vals), 0,
8382 NULL, HFILL }
8383 },
8384 { &hf_mbim_uuid_basic_connect_extensions_cid,
8385 { "CID", "mbim.control.cid",
8386 FT_UINT32, BASE_DEC, VALS(mbim_uuid_basic_connect_extensions_cid_vals), 0,
8387 NULL, HFILL }
8388 },
8389 { &hf_mbim_uuid_ms_sarcontrol_cid,
8390 { "CID", "mbim.control.cid",
8391 FT_UINT32, BASE_DEC, VALS(mbim_uuid_ms_sarcontrol_cid_vals), 0,
8392 NULL, HFILL }
8393 },
8394 { &hf_mbim_uuid_ms_uicc_low_level_cid,
8395 { "CID", "mbim.control.cid",
8396 FT_UINT32, BASE_DEC, VALS(mbim_uuid_ms_uicc_low_level_cid_vals), 0,
8397 NULL, HFILL }
8398 },
8399 { &hf_mbim_cid,
8400 { "CID", "mbim.control.cid",
8401 FT_UINT32, BASE_DEC, NULL, 0,
8402 NULL, HFILL }
8403 },
8404 { &hf_mbim_command_type,
8405 { "Command Type", "mbim.control.command_type",
8406 FT_UINT32, BASE_DEC, VALS(mbim_command_type_vals), 0,
8407 NULL, HFILL }
8408 },
8409 { &hf_mbim_info_buffer_len,
8410 { "Information Buffer Length", "mbim.control.info_buffer_len",
8411 FT_UINT32, BASE_DEC, NULL, 0,
8412 NULL, HFILL }
8413 },
8414 { &hf_mbim_info_buffer,
8415 { "Information Buffer", "mbim.control.info_buffer",
8416 FT_BYTES, BASE_NONE, NULL, 0,
8417 NULL, HFILL }
8418 },
8419 { &hf_mbim_error_status_code,
8420 { "Error Status Code", "mbim.control.error_status_code",
8421 FT_UINT32, BASE_DEC, VALS(mbim_error_status_code_vals), 0,
8422 NULL, HFILL }
8423 },
8424 { &hf_mbim_status,
8425 { "Status", "mbim.control.status",
8426 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &mbim_status_code_vals_ext, 0,
8427 NULL, HFILL }
8428 },
8429 { &hf_mbim_tlv_ie_type,
8430 { "Type", "mbim.control.tlv_ie.type",
8431 FT_UINT16, BASE_DEC, VALS(mbim_tlv_type_vals), 0,
8432 NULL, HFILL }
8433 },
8434 { &hf_mbim_tlv_ie_reserved,
8435 { "Reserved", "mbim.control.tlv_ie.reserved",
8436 FT_UINT8, BASE_DEC, NULL, 0,
8437 NULL, HFILL }
8438 },
8439 { &hf_mbim_tlv_ie_padding_length,
8440 { "Padding Length", "mbim.control.tlv_ie.padding_length",
8441 FT_UINT8, BASE_DEC, NULL, 0,
8442 NULL, HFILL }
8443 },
8444 { &hf_mbim_tlv_ie_data_length,
8445 { "Data Length", "mbim.control.tlv_ie.data_length",
8446 FT_UINT32, BASE_DEC, NULL, 0,
8447 NULL, HFILL }
8448 },
8449 { &hf_mbim_tlv_ie_unnamed_data,
8450 { "Data", "mbim.control.tlv_ie.unnamed_data",
8451 FT_BYTES, BASE_NONE, NULL, 0,
8452 NULL, HFILL }
8453 },
8454 { &hf_mbim_tlv_ie_data_wchar_str,
8455 { "Data", "mbim.control.tlv_ie.wchar_str_data",
8456 FT_STRING, BASE_NONE, NULL, 0,
8457 NULL, HFILL }
8458 },
8459 { &hf_mbim_tlv_ie_padding,
8460 { "Padding", "mbim.control.tlv_ie.padding",
8461 FT_UINT8, BASE_DEC, NULL, 0,
8462 NULL, HFILL }
8463 },
8464 { &hf_mbim_device_caps_info_device_type,
8465 { "Device Type", "mbim.control.device_caps_info.device_type",
8466 FT_UINT32, BASE_DEC, VALS(mbim_device_caps_info_device_type_vals), 0,
8467 NULL, HFILL }
8468 },
8469 { &hf_mbim_device_caps_info_cellular_class,
8470 { "Cellular Class", "mbim.control.device_caps_info.cellular_class",
8471 FT_UINT32, BASE_DEC, VALS(mbim_cellular_class_vals), 0,
8472 NULL, HFILL }
8473 },
8474 { &hf_mbim_device_caps_info_voice_class,
8475 { "Voice Class", "mbim.control.device_caps_info.voice_class",
8476 FT_UINT32, BASE_DEC, VALS(mbim_device_caps_info_voice_class_vals), 0,
8477 NULL, HFILL }
8478 },
8479 { &hf_mbim_device_caps_info_sim_class,
8480 { "SIM Class", "mbim.control.device_caps_info.sim_class",
8481 FT_UINT32, BASE_HEX, NULL, 0,
8482 NULL, HFILL }
8483 },
8484 { &hf_mbim_device_caps_info_sim_class_logical,
8485 { "Logical", "mbim.control.device_caps_info.sim_class.logical",
8486 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
8487 NULL, HFILL }
8488 },
8489 { &hf_mbim_device_caps_info_sim_class_removable,
8490 { "Removable", "mbim.control.device_caps_info.sim_class.removable",
8491 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
8492 NULL, HFILL }
8493 },
8494 { &hf_mbim_device_caps_info_data_class,
8495 { "Data Class", "mbim.control.device_caps_info.data_class",
8496 FT_UINT32, BASE_HEX, NULL, 0,
8497 NULL, HFILL }
8498 },
8499 { &hf_mbim_data_class_gprs,
8500 { "GPRS", "mbim.control.data_class.gprs",
8501 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
8502 NULL, HFILL }
8503 },
8504 { &hf_mbim_data_class_edge,
8505 { "EDGE", "mbim.control.data_class.edge",
8506 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
8507 NULL, HFILL }
8508 },
8509 { &hf_mbim_data_class_umts,
8510 { "UMTS", "mbim.control.data_class.umts",
8511 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
8512 NULL, HFILL }
8513 },
8514 { &hf_mbim_data_class_hsdpa,
8515 { "HSDPA", "mbim.control.data_class.hsdpa",
8516 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
8517 NULL, HFILL }
8518 },
8519 { &hf_mbim_data_class_hsupa,
8520 { "HSUPA", "mbim.control.data_class.hsupa",
8521 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
8522 NULL, HFILL }
8523 },
8524 { &hf_mbim_data_class_lte,
8525 { "LTE", "mbim.control.data_class.lte",
8526 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
8527 NULL, HFILL }
8528 },
8529 { &hf_mbim_data_class_5g,
8530 { "5G", "mbim.control.data_class.5g",
8531 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
8532 NULL, HFILL }
8533 },
8534 { &hf_mbim_data_class_reserved_gsm,
8535 { "Reserved for future GSM classes", "mbim.control.data_class.reserved_gsm",
8536 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x0000ff80,
8537 NULL, HFILL }
8538 },
8539 { &hf_mbim_data_class_1xrtt,
8540 { "1xRTT", "mbim.control.data_class.1xrtt",
8541 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
8542 NULL, HFILL }
8543 },
8544 { &hf_mbim_data_class_1xevdo,
8545 { "1xEV-DO", "mbim.control.data_class.1xevdo",
8546 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
8547 NULL, HFILL }
8548 },
8549 { &hf_mbim_data_class_1xevdoreva,
8550 { "1xEV-DO RevA", "mbim.control.data_class.1xevdoreva",
8551 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
8552 NULL, HFILL }
8553 },
8554 { &hf_mbim_data_class_1xevdv,
8555 { "1xEVDV", "mbim.control.data_class.1xevdv",
8556 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
8557 NULL, HFILL }
8558 },
8559 { &hf_mbim_data_class_3xrtt,
8560 { "3xRTT", "mbim.control.data_class.3xrtt",
8561 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
8562 NULL, HFILL }
8563 },
8564 { &hf_mbim_data_class_1xevdorevb,
8565 { "1xEV-DO RevB", "mbim.control.data_class.1xevdorevb",
8566 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
8567 NULL, HFILL }
8568 },
8569 { &hf_mbim_data_class_umb,
8570 { "UMB", "mbim.control.data_class.umb",
8571 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
8572 NULL, HFILL }
8573 },
8574 { &hf_mbim_data_class_reserved_cdma,
8575 { "Reserved for future CDMA classes", "mbim.control.data_class.reserved_cdma",
8576 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x7f800000,
8577 NULL, HFILL }
8578 },
8579 { &hf_mbim_data_class_custom,
8580 { "Custom", "mbim.control.data_class.custom",
8581 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x80000000,
8582 NULL, HFILL }
8583 },
8584 { &hf_mbim_device_caps_info_sms_caps,
8585 { "SMS Caps", "mbim.control.device_caps_info.sms_caps",
8586 FT_UINT32, BASE_HEX, NULL, 0,
8587 NULL, HFILL }
8588 },
8589 { &hf_mbim_device_caps_info_sms_caps_pdu_receive,
8590 { "PDU Receive", "mbim.control.device_caps_info.sms_caps.pdu_receive",
8591 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
8592 NULL, HFILL }
8593 },
8594 { &hf_mbim_device_caps_info_sms_caps_pdu_send,
8595 { "PDU Send", "mbim.control.device_caps_info.sms_caps.pdu_send",
8596 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
8597 NULL, HFILL }
8598 },
8599 { &hf_mbim_device_caps_info_sms_caps_text_receive,
8600 { "Text Receive", "mbim.control.device_caps_info.sms_caps.text_receive",
8601 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
8602 NULL, HFILL }
8603 },
8604 { &hf_mbim_device_caps_info_sms_caps_text_send,
8605 { "Text Send", "mbim.control.device_caps_info.sms_caps.text_send",
8606 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
8607 NULL, HFILL }
8608 },
8609 { &hf_mbim_device_caps_info_control_caps,
8610 { "Control Caps", "mbim.control.device_caps_info.control_caps",
8611 FT_UINT32, BASE_HEX, NULL, 0,
8612 NULL, HFILL }
8613 },
8614 { &hf_mbim_device_caps_info_control_caps_reg_manual,
8615 { "Reg Manual", "mbim.control.device_caps_info.control_caps.reg_manual",
8616 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
8617 NULL, HFILL }
8618 },
8619 { &hf_mbim_device_caps_info_control_caps_hw_radio_switch,
8620 { "HW Radio Switch", "mbim.control.device_caps_info.control_caps.hw_radio_switch",
8621 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
8622 NULL, HFILL }
8623 },
8624 { &hf_mbim_device_caps_info_control_caps_cdma_mobile_ip,
8625 { "CDMA Mobile IP", "mbim.control.device_caps_info.control_caps.cdma_mobile_ip",
8626 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
8627 NULL, HFILL }
8628 },
8629 { &hf_mbim_device_caps_info_control_caps_cdma_simple_ip,
8630 { "CDMA Simple IP", "mbim.control.device_caps_info.control_caps.cdma_simple_ip",
8631 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
8632 NULL, HFILL }
8633 },
8634 { &hf_mbim_device_caps_info_control_caps_multi_carrier,
8635 { "Multi Carrier", "mbim.control.device_caps_info.control_caps.multi_carrier",
8636 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
8637 NULL, HFILL }
8638 },
8639 { &hf_mbim_device_caps_info_control_caps_esim,
8640 { "ESIM", "mbim.control.device_caps_info.control_caps.esim",
8641 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
8642 NULL, HFILL }
8643 },
8644 { &hf_mbim_device_caps_info_control_caps_ue_policy_route_selection,
8645 { "UE Policy Route Selection", "mbim.control.device_caps_info.control_caps.ue_policy_route_selection",
8646 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
8647 NULL, HFILL }
8648 },
8649 { &hf_mbim_device_caps_info_control_caps_sim_hot_swap_capable,
8650 { "Hot Swap Capable", "mbim.control.device_caps_info.control_caps.hot_swap_capable",
8651 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
8652 NULL, HFILL }
8653 },
8654 { &hf_mbim_device_caps_info_max_sessions,
8655 { "Max Sessions", "mbim.control.device_caps_info.max_sessions",
8656 FT_UINT32, BASE_DEC, NULL, 0,
8657 NULL, HFILL }
8658 },
8659 { &hf_mbim_device_caps_info_data_subclass,
8660 { "Data Subclass", "mbim.control.device_caps_info.data_subclass",
8661 FT_UINT64, BASE_HEX, NULL, 0,
8662 NULL, HFILL }
8663 },
8664 { &hf_mbim_data_subclass_5gendc,
8665 { "5G EN-DC", "mbim.control.data_subclass.5gendc",
8666 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
8667 NULL, HFILL }
8668 },
8669 { &hf_mbim_data_subclass_5gnr,
8670 { "5G NR", "mbim.control.data_subclass.5gnr",
8671 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
8672 NULL, HFILL }
8673 },
8674 { &hf_mbim_data_subclass_5gnedc,
8675 { "5G NE-DC", "mbim.control.data_subclass.5gnedc",
8676 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x0000004,
8677 NULL, HFILL }
8678 },
8679 { &hf_mbim_data_subclass_5gelte,
8680 { "5G eLTE", "mbim.control.data_subclass.5gelte",
8681 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
8682 NULL, HFILL }
8683 },
8684 { &hf_mbim_data_subclass_5gngendc,
8685 { "5G NG-EN-DC", "mbim.control.data_subclass.5gngendc",
8686 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
8687 NULL, HFILL }
8688 },
8689 { &hf_mbim_device_caps_info_wcdma_band_class,
8690 { "WCDMA Band Class", "mbim.control.device_caps_info.wcdma_band_class",
8691 FT_UINT32, BASE_DEC, NULL, 0,
8692 NULL, HFILL }
8693 },
8694 { &hf_mbim_device_caps_info_custom_data_class_offset,
8695 { "Custom Data Class Offset", "mbim.control.device_caps_info.custom_data_class.offset",
8696 FT_UINT32, BASE_DEC, NULL, 0,
8697 NULL, HFILL }
8698 },
8699 { &hf_mbim_device_caps_info_custom_data_class_size,
8700 { "Custom Data Class Size", "mbim.control.device_caps_info.custom_data_class.size",
8701 FT_UINT32, BASE_DEC, NULL, 0,
8702 NULL, HFILL }
8703 },
8704 { &hf_mbim_device_caps_info_device_id_offset,
8705 { "Device Id Offset", "mbim.control.device_caps_info.device_id.offset",
8706 FT_UINT32, BASE_DEC, NULL, 0,
8707 NULL, HFILL }
8708 },
8709 { &hf_mbim_device_caps_info_device_id_size,
8710 { "Device Id Size", "mbim.control.device_caps_info.device_id.size",
8711 FT_UINT32, BASE_DEC, NULL, 0,
8712 NULL, HFILL }
8713 },
8714 { &hf_mbim_device_caps_info_fw_info_offset,
8715 { "FW Info Offset", "mbim.control.device_caps_info.fw_info.offset",
8716 FT_UINT32, BASE_DEC, NULL, 0,
8717 NULL, HFILL }
8718 },
8719 { &hf_mbim_device_caps_info_fw_info_size,
8720 { "FW Info Size", "mbim.control.device_caps_info.fw_info.size",
8721 FT_UINT32, BASE_DEC, NULL, 0,
8722 NULL, HFILL }
8723 },
8724 { &hf_mbim_device_caps_info_hw_info_offset,
8725 { "HW Info Offset", "mbim.control.device_caps_info.hw_info.offset",
8726 FT_UINT32, BASE_DEC, NULL, 0,
8727 NULL, HFILL }
8728 },
8729 { &hf_mbim_device_caps_info_hw_info_size,
8730 { "HW Info Size", "mbim.control.device_caps_info.hw_info.size",
8731 FT_UINT32, BASE_DEC, NULL, 0,
8732 NULL, HFILL }
8733 },
8734 { &hf_mbim_device_caps_info_custom_data_class,
8735 { "Custom Data Class", "mbim.control.device_caps_info.custom_data_class",
8736 FT_STRING, BASE_NONE, NULL, 0,
8737 NULL, HFILL }
8738 },
8739 { &hf_mbim_device_caps_info_device_id,
8740 { "Device Id", "mbim.control.device_caps_info.device_id",
8741 FT_STRING, BASE_NONE, NULL, 0,
8742 NULL, HFILL }
8743 },
8744 { &hf_mbim_device_caps_info_fw_info,
8745 { "FW Info", "mbim.control.device_caps_info.fw_info",
8746 FT_STRING, BASE_NONE, NULL, 0,
8747 NULL, HFILL }
8748 },
8749 { &hf_mbim_device_caps_info_hw_info,
8750 { "HW Info", "mbim.control.device_caps_info.hw_info",
8751 FT_STRING, BASE_NONE, NULL, 0,
8752 NULL, HFILL }
8753 },
8754 { &hf_mbim_device_caps_info_v2_executor_index,
8755 { "Executor Index", "mbim.control.device_caps_info.executor_index",
8756 FT_UINT32, BASE_DEC, NULL, 0,
8757 NULL, HFILL }
8758 },
8759 { &hf_mbim_subscr_ready_status_ready_state,
8760 { "Ready State", "mbim.control.subscriber_ready_status.ready_state",
8761 FT_UINT32, BASE_DEC, VALS(mbim_subscr_ready_status_ready_state_vals), 0,
8762 NULL, HFILL }
8763 },
8764 { &hf_mbim_subscr_ready_status_flags,
8765 { "Flags", "mbim.control.subscriber_ready_status.flags",
8766 FT_UINT32, BASE_HEX, NULL, 0,
8767 NULL, HFILL }
8768 },
8769 { &hf_mbim_subscr_ready_status_flag_esim,
8770 { "ESIM", "mbim.control.subscriber_ready_status.flags.esim",
8771 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
8772 NULL, HFILL }
8773 },
8774 { &hf_mbim_subscr_ready_status_flag_sim_removability_known,
8775 { "SIM Removability Known", "mbim.control.subscriber_ready_status.flags.sim_removability_known",
8776 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
8777 NULL, HFILL }
8778 },
8779 { &hf_mbim_subscr_ready_status_flag_sim_removable,
8780 { "SIM Removable", "mbim.control.subscriber_ready_status.flags.sim_removable",
8781 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
8782 NULL, HFILL }
8783 },
8784 { &hf_mbim_subscr_ready_status_susbcr_id_offset,
8785 { "Subscriber Id Offset", "mbim.control.subscriber_ready_status.subscriber_id.offset",
8786 FT_UINT32, BASE_DEC, NULL, 0,
8787 NULL, HFILL }
8788 },
8789 { &hf_mbim_subscr_ready_status_susbcr_id_size,
8790 { "Subscriber Id Size", "mbim.control.subscriber_ready_status.subscriber_id.size",
8791 FT_UINT32, BASE_DEC, NULL, 0,
8792 NULL, HFILL }
8793 },
8794 { &hf_mbim_subscr_ready_status_sim_icc_id_offset,
8795 { "SIM ICC Id Offset", "mbim.control.subscriber_ready_status.sim_icc_id.offset",
8796 FT_UINT32, BASE_DEC, NULL, 0,
8797 NULL, HFILL }
8798 },
8799 { &hf_mbim_subscr_ready_status_sim_icc_id_size,
8800 { "SIM ICC Id Size", "mbim.control.subscriber_ready_status.sim_icc_id.size",
8801 FT_UINT32, BASE_DEC, NULL, 0,
8802 NULL, HFILL }
8803 },
8804 { &hf_mbim_subscr_ready_status_ready_info,
8805 { "Ready Info", "mbim.control.subscriber_ready_status.ready_info",
8806 FT_UINT32, BASE_DEC, VALS(mbim_subscr_ready_status_ready_info_vals), 0,
8807 NULL, HFILL }
8808 },
8809 { &hf_mbim_subscr_ready_status_elem_count,
8810 { "Element Count", "mbim.control.subscriber_ready_status.element_count",
8811 FT_UINT32, BASE_DEC, NULL, 0,
8812 NULL, HFILL }
8813 },
8814 { &hf_mbim_subscr_ready_status_tel_nb_offset,
8815 { "Telephone Number Offset", "mbim.control.subscriber_ready_status.tel_nb.offset",
8816 FT_UINT32, BASE_DEC, NULL, 0,
8817 NULL, HFILL }
8818 },
8819 { &hf_mbim_subscr_ready_status_tel_nb_size,
8820 { "Telephone Number Size", "mbim.control.subscriber_ready_status.tel_nb.size",
8821 FT_UINT32, BASE_DEC, NULL, 0,
8822 NULL, HFILL }
8823 },
8824 { &hf_mbim_subscr_ready_status_susbcr_id,
8825 { "Subscriber Id", "mbim.control.device_caps_info.subscriber_ready_status.subscriber_id",
8826 FT_STRING, BASE_NONE, NULL, 0,
8827 NULL, HFILL }
8828 },
8829 { &hf_mbim_subscr_ready_status_sim_icc_id,
8830 { "SIM ICC Id", "mbim.control.device_caps_info.subscriber_ready_status.sim_icc_id",
8831 FT_STRING, BASE_NONE, NULL, 0,
8832 NULL, HFILL }
8833 },
8834 { &hf_mbim_subscr_ready_status_tel_nb,
8835 { "Telephone Number", "mbim.control.device_caps_info.subscriber_ready_status.tel_nb",
8836 FT_STRING, BASE_NONE, NULL, 0,
8837 NULL, HFILL }
8838 },
8839 { &hf_mbim_radio_state_set,
8840 { "Radio Set", "mbim.control.radio_state.set",
8841 FT_UINT32, BASE_DEC, VALS(mbim_radio_state_vals), 0,
8842 NULL, HFILL }
8843 },
8844 { &hf_mbim_radio_state_hw_radio_state,
8845 { "HW Radio State", "mbim.control.radio_state.hw_radio_state",
8846 FT_UINT32, BASE_DEC, VALS(mbim_radio_state_vals), 0,
8847 NULL, HFILL }
8848 },
8849 { &hf_mbim_radio_state_sw_radio_state,
8850 { "SW Radio State", "mbim.control.radio_state.sw_radio_stat",
8851 FT_UINT32, BASE_DEC, VALS(mbim_radio_state_vals), 0,
8852 NULL, HFILL }
8853 },
8854 { &hf_mbim_set_pin_pin_type,
8855 { "PIN Type", "mbim.control.set_pin.pin_type",
8856 FT_UINT32, BASE_DEC, VALS(mbim_pin_type_vals), 0,
8857 NULL, HFILL }
8858 },
8859 { &hf_mbim_set_pin_pin_pin_operation,
8860 { "PIN Operation", "mbim.control.set_pin.pin_operation",
8861 FT_UINT32, BASE_DEC, VALS(mbim_pin_operation_vals), 0,
8862 NULL, HFILL }
8863 },
8864 { &hf_mbim_set_pin_pin_pin_offset,
8865 { "PIN Offset", "mbim.control.set_pin.pin.offset",
8866 FT_UINT32, BASE_DEC, NULL, 0,
8867 NULL, HFILL }
8868 },
8869 { &hf_mbim_set_pin_pin_pin_size,
8870 { "PIN Size", "mbim.control.set_pin.pin.size",
8871 FT_UINT32, BASE_DEC, NULL, 0,
8872 NULL, HFILL }
8873 },
8874 { &hf_mbim_set_pin_new_pin_offset,
8875 { "New PIN Offset", "mbim.control.set_pin.new_pin.offset",
8876 FT_UINT32, BASE_DEC, NULL, 0,
8877 NULL, HFILL }
8878 },
8879 { &hf_mbim_set_pin_new_pin_size,
8880 { "New PIN Size", "mbim.control.set_pin.new_pin.size",
8881 FT_UINT32, BASE_DEC, NULL, 0,
8882 NULL, HFILL }
8883 },
8884 { &hf_mbim_set_pin_pin,
8885 { "PIN", "mbim.control.set_pin.pin",
8886 FT_STRING, BASE_NONE, NULL, 0,
8887 NULL, HFILL }
8888 },
8889 { &hf_mbim_set_pin_new_pin,
8890 { "New PIN", "mbim.control.set_pin.new_pin",
8891 FT_STRING, BASE_NONE, NULL, 0,
8892 NULL, HFILL }
8893 },
8894 { &hf_mbim_pin_info_pin_type,
8895 { "PIN Type", "mbim.control.pin_info.pin_type",
8896 FT_UINT32, BASE_DEC, VALS(mbim_pin_type_vals), 0,
8897 NULL, HFILL }
8898 },
8899 { &hf_mbim_pin_info_pin_state,
8900 { "PIN State", "mbim.control.pin_info.pin_state",
8901 FT_UINT32, BASE_DEC, VALS(mbim_pin_state_vals), 0,
8902 NULL, HFILL }
8903 },
8904 { &hf_mbim_pin_info_remaining_attempts,
8905 { "Remaining Attempts", "mbim.control.pin_info.remaining_attempts",
8906 FT_UINT32, BASE_DEC, NULL, 0,
8907 NULL, HFILL }
8908 },
8909 { &hf_mbim_pin_list_pin_mode,
8910 { "PIN Mode", "mbim.control.pin_list.pin_mode",
8911 FT_UINT32, BASE_DEC, VALS(mbim_pin_mode_vals), 0,
8912 NULL, HFILL }
8913 },
8914 { &hf_mbim_pin_list_pin_format,
8915 { "PIN Format", "mbim.control.pin_list.pin_format",
8916 FT_UINT32, BASE_DEC, VALS(mbim_pin_format_vals), 0,
8917 NULL, HFILL }
8918 },
8919 { &hf_mbim_pin_list_pin_length_min,
8920 { "PIN Length Min", "mbim.control.pin_list.pin_length_min",
8921 FT_UINT32, BASE_DEC, NULL, 0,
8922 NULL, HFILL }
8923 },
8924 { &hf_mbim_pin_list_pin_length_max,
8925 { "PIN Length Max", "mbim.control.pin_list.pin_length_max",
8926 FT_UINT32, BASE_DEC, NULL, 0,
8927 NULL, HFILL }
8928 },
8929 { &hf_mbim_provider_state,
8930 { "Provider State", "mbim.control.provider_state",
8931 FT_UINT32, BASE_HEX, NULL, 0,
8932 NULL, HFILL }
8933 },
8934 { &hf_mbim_provider_state_home,
8935 { "Home", "mbim.control.provider_state.home",
8936 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
8937 NULL, HFILL }
8938 },
8939 { &hf_mbim_provider_state_forbidden,
8940 { "Forbidden", "mbim.control.provider_state.forbidden",
8941 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
8942 NULL, HFILL }
8943 },
8944 { &hf_mbim_provider_state_preferred,
8945 { "Preferred", "mbim.control.provider_state.preferred",
8946 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000004,
8947 NULL, HFILL }
8948 },
8949 { &hf_mbim_provider_state_visible,
8950 { "Visible", "mbim.control.provider_state.visible",
8951 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000008,
8952 NULL, HFILL }
8953 },
8954 { &hf_mbim_provider_state_registered,
8955 { "Registered", "mbim.control.provider_state.registered",
8956 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000010,
8957 NULL, HFILL }
8958 },
8959 { &hf_mbim_provider_state_preferred_multicarrier,
8960 { "Preferred Multicarrier", "mbim.control.provider_state.preferred_multicarrier",
8961 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000020,
8962 NULL, HFILL }
8963 },
8964 { &hf_mbim_provider_provider_id_offset,
8965 { "Provider Id Offset", "mbim.control.provider.provider_id_offset",
8966 FT_UINT32, BASE_DEC, NULL, 0,
8967 NULL, HFILL }
8968 },
8969 { &hf_mbim_provider_provider_id_size,
8970 { "Provider Id Size", "mbim.control.provider.provider_id_size",
8971 FT_UINT32, BASE_DEC, NULL, 0,
8972 NULL, HFILL }
8973 },
8974 { &hf_mbim_provider_provider_name_offset,
8975 { "Provider Name Offset", "mbim.control.provider.provider_name_offset",
8976 FT_UINT32, BASE_DEC, NULL, 0,
8977 NULL, HFILL }
8978 },
8979 { &hf_mbim_provider_provider_name_size,
8980 { "Provider Name Size", "mbim.control.provider.provider_name_size",
8981 FT_UINT32, BASE_DEC, NULL, 0,
8982 NULL, HFILL }
8983 },
8984 { &hf_mbim_provider_cellular_class,
8985 { "Cellular Class", "mbim.control.provider.cellular_class",
8986 FT_UINT32, BASE_DEC, VALS(mbim_cellular_class_vals), 0,
8987 NULL, HFILL }
8988 },
8989 { &hf_mbim_provider_rssi,
8990 { "RSSI", "mbim.control.provider.rssi",
8991 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rssi_fmt), 0,
8992 NULL, HFILL }
8993 },
8994 { &hf_mbim_provider_error_rate,
8995 { "Error Rate", "mbim.control.provider.error_rate",
8996 FT_UINT32, BASE_DEC, VALS(mbim_error_rate_vals), 0,
8997 NULL, HFILL }
8998 },
8999 { &hf_mbim_provider_provider_id,
9000 { "Provider Id", "mbim.control.provider.provider_id",
9001 FT_STRING, BASE_NONE, NULL, 0,
9002 NULL, HFILL }
9003 },
9004 { &hf_mbim_provider_provider_name,
9005 { "Provider Name", "mbim.control.provider.provider_name",
9006 FT_STRING, BASE_NONE, NULL, 0,
9007 NULL, HFILL }
9008 },
9009 { &hf_mbim_providers_elem_count,
9010 { "Element Count", "mbim.control.providers.elem_count",
9011 FT_UINT32, BASE_DEC, NULL, 0,
9012 NULL, HFILL }
9013 },
9014 { &hf_mbim_providers_provider_offset,
9015 { "Provider Offset", "mbim.control.providers.provider_offset",
9016 FT_UINT32, BASE_DEC, NULL, 0,
9017 NULL, HFILL }
9018 },
9019 { &hf_mbim_providers_provider_size,
9020 { "Provider Size", "mbim.control.providers.provider_size",
9021 FT_UINT32, BASE_DEC, NULL, 0,
9022 NULL, HFILL }
9023 },
9024 { &hf_mbim_visible_providers_req_action,
9025 { "Action", "mbim.control.visible_providers_req.action",
9026 FT_UINT32, BASE_DEC, VALS(mbim_visible_providers_action_vals), 0,
9027 NULL, HFILL }
9028 },
9029 { &hf_mbim_set_register_state_provider_id_offset,
9030 { "Provider Id Offset", "mbim.control.set_register_state.provider_id.offset",
9031 FT_UINT32, BASE_DEC, NULL, 0,
9032 NULL, HFILL }
9033 },
9034 { &hf_mbim_set_register_state_provider_id_size,
9035 { "Provider Id Size", "mbim.control.set_register_state.provider_id.size",
9036 FT_UINT32, BASE_DEC, NULL, 0,
9037 NULL, HFILL }
9038 },
9039 { &hf_mbim_set_register_state_register_action,
9040 { "Register Action", "mbim.control.set_register_state.register_action",
9041 FT_UINT32, BASE_DEC, VALS(mbim_register_action_vals), 0,
9042 NULL, HFILL }
9043 },
9044 { &hf_mbim_register_state_data_class,
9045 { "Data Class", "mbim.control.set_register_state.data_class",
9046 FT_UINT32, BASE_HEX, NULL, 0,
9047 NULL, HFILL }
9048 },
9049 { &hf_mbim_set_register_state_provider_id,
9050 { "Provider Id", "mbim.control.set_register_state.provider_id",
9051 FT_STRING, BASE_NONE, NULL, 0,
9052 NULL, HFILL }
9053 },
9054 { &hf_mbim_registration_state_info_nw_error,
9055 { "Network Error", "mbim.control.registration_state_info.nw_error",
9056 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0,
9057 NULL, HFILL }
9058 },
9059 { &hf_mbim_registration_state_info_register_state,
9060 { "Register State", "mbim.control.registration_state_info.register_state",
9061 FT_UINT32, BASE_DEC, VALS(mbim_register_state_vals), 0,
9062 NULL, HFILL }
9063 },
9064 { &hf_mbim_registration_state_info_register_mode,
9065 { "Register Mode", "mbim.control.registration_state_info.register_mode",
9066 FT_UINT32, BASE_DEC, VALS(mbim_register_mode_vals), 0,
9067 NULL, HFILL }
9068 },
9069 { &hf_mbim_registration_state_info_available_data_classes,
9070 { "Available Data Classes", "mbim.control.registration_state_info.available_data_classes",
9071 FT_UINT32, BASE_HEX, NULL, 0,
9072 NULL, HFILL }
9073 },
9074 { &hf_mbim_registration_state_info_current_cellular_class,
9075 { "Current Cellular Class", "mbim.control.registration_state_info.current_cellular_class",
9076 FT_UINT32, BASE_DEC, VALS(mbim_cellular_class_vals), 0,
9077 NULL, HFILL }
9078 },
9079 { &hf_mbim_registration_state_info_provider_id_offset,
9080 { "Provider Id Offset", "mbim.control.registration_state_info.provider_id.offset",
9081 FT_UINT32, BASE_DEC, NULL, 0,
9082 NULL, HFILL }
9083 },
9084 { &hf_mbim_registration_state_info_provider_id_size,
9085 { "Provider Id Size", "mbim.control.registration_state_info.provider_id.size",
9086 FT_UINT32, BASE_DEC, NULL, 0,
9087 NULL, HFILL }
9088 },
9089 { &hf_mbim_registration_state_info_provider_name_offset,
9090 { "Provider Name Offset", "mbim.control.registration_state_info.provider_name.offset",
9091 FT_UINT32, BASE_DEC, NULL, 0,
9092 NULL, HFILL }
9093 },
9094 { &hf_mbim_registration_state_info_provider_name_size,
9095 { "Provider Name Size", "mbim.control.registration_state_info.provider_name.size",
9096 FT_UINT32, BASE_DEC, NULL, 0,
9097 NULL, HFILL }
9098 },
9099 { &hf_mbim_registration_state_info_roaming_text_offset,
9100 { "Roaming Text Offset", "mbim.control.registration_state_info.roaming_text.offset",
9101 FT_UINT32, BASE_DEC, NULL, 0,
9102 NULL, HFILL }
9103 },
9104 { &hf_mbim_registration_state_info_roaming_text_size,
9105 { "Roaming Text Size", "mbim.control.registration_state_info.roaming_text.size",
9106 FT_UINT32, BASE_DEC, NULL, 0,
9107 NULL, HFILL }
9108 },
9109 { &hf_mbim_registration_state_info_registration_flags,
9110 { "Registration Flags", "mbim.control.registration_state_info.registration_flags",
9111 FT_UINT32, BASE_HEX, NULL, 0,
9112 NULL, HFILL }
9113 },
9114 { &hf_mbim_registration_state_info_registration_flags_manual_selection_not_available,
9115 { "Manual Selection Not Available", "mbim.control.registration_state_info.registration_flags.manual_selection_not_available",
9116 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
9117 NULL, HFILL }
9118 },
9119 { &hf_mbim_registration_state_info_registration_flags_packet_service_auto_attach,
9120 { "Packet Service Auto Attach", "mbim.control.registration_state_info.registration_flags.packet_service_auto_attach",
9121 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
9122 NULL, HFILL }
9123 },
9124 { &hf_mbim_registration_state_info_preferred_data_class,
9125 { "Preferred Data Class", "mbim.control.registration_state_info.preferred_data_class",
9126 FT_UINT32, BASE_DEC, NULL, 0,
9127 NULL, HFILL }
9128 },
9129 { &hf_mbim_registration_state_info_provider_id,
9130 { "Provider Id", "mbim.control.registration_state_info.provider_id",
9131 FT_STRING, BASE_NONE, NULL, 0,
9132 NULL, HFILL }
9133 },
9134 { &hf_mbim_registration_state_info_provider_name,
9135 { "Provider Name", "mbim.control.registration_state_info.provider_name",
9136 FT_STRING, BASE_NONE, NULL, 0,
9137 NULL, HFILL }
9138 },
9139 { &hf_mbim_registration_state_info_roaming_text,
9140 { "Roaming Text", "mbim.control.registration_state_info.roaming_text",
9141 FT_STRING, BASE_NONE, NULL, 0,
9142 NULL, HFILL }
9143 },
9144 { &hf_mbim_set_packet_service_action,
9145 { "Action", "mbim.control.set_packet_service.action",
9146 FT_UINT32, BASE_DEC, VALS(mbim_packet_service_action_vals), 0,
9147 NULL, HFILL }
9148 },
9149 { &hf_mbim_ms_plmn_mcc,
9150 { "Mobile Country Code", "mbim.control.ms_plmn.mcc",
9151 FT_UINT16, BASE_DEC, NULL, 0,
9152 NULL, HFILL }
9153 },
9154 { &hf_mbim_ms_plmn_mnc,
9155 { "Mobile Network Code", "mbim.control.ms_plmn.mnc",
9156 FT_UINT16, BASE_DEC, NULL, 0,
9157 NULL, HFILL }
9158 },
9159 { &hf_mbim_ms_tai_tac,
9160 { "Tracking Area Code", "mbim.control.ms_tai.tac",
9161 FT_UINT32, BASE_DEC, NULL, 0,
9162 NULL, HFILL }
9163 },
9164 { &hf_mbim_ms_tai_list_type,
9165 { "TAI List Type", "mbim.control.ms_tai.list_type",
9166 FT_UINT8, BASE_DEC, NULL, 0,
9167 NULL, HFILL }
9168 },
9169 { &hf_mbim_ms_tai_list_single_plmn_tac_element,
9170 { "TAC Element", "mbim.control.ms_tai.tac_element",
9171 FT_UINT8, BASE_DEC, NULL, 0,
9172 NULL, HFILL }
9173 },
9174 { &hf_mbim_ms_tai_list_multi_plmn_tai_element,
9175 { "TAI Element", "mbim.control.ms_tai.tai_element",
9176 FT_UINT8, BASE_DEC, NULL, 0,
9177 NULL, HFILL }
9178 },
9179 { &hf_mbim_packet_service_info_nw_error,
9180 { "Network Error", "mbim.control.packet_service_info.nw_error",
9181 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0,
9182 NULL, HFILL }
9183 },
9184 { &hf_mbim_packet_service_info_packet_service_state,
9185 { "Packet Service State", "mbim.control.packet_service_info.packet_service_state",
9186 FT_UINT32, BASE_DEC, VALS(mbim_packet_service_state_vals), 0,
9187 NULL, HFILL }
9188 },
9189 { &hf_mbim_packet_service_info_highest_available_data_class,
9190 { "Highest Available Data Class", "mbim.control.packet_service_info.highest_available_data_class",
9191 FT_UINT32, BASE_HEX, NULL, 0,
9192 NULL, HFILL }
9193 },
9194 { &hf_mbim_packet_service_info_current_data_class,
9195 { "Current Data Class", "mbim.control.packet_service_info.current_data_class",
9196 FT_UINT32, BASE_HEX, NULL, 0,
9197 NULL, HFILL }
9198 },
9199 { &hf_mbim_packet_service_info_uplink_speed,
9200 { "Uplink Speed", "mbim.control.packet_service_info.uplink_speed",
9201 FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0,
9202 NULL, HFILL }
9203 },
9204 { &hf_mbim_packet_service_info_downlink_speed,
9205 { "Downlink Speed", "mbim.control.packet_service_info.downlink_speed",
9206 FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_bit_sec, 0,
9207 NULL, HFILL }
9208 },
9209 { &hf_mbim_packet_service_info_frequency_range,
9210 { "Frequency Range", "mbim.control.packet_service_info.frequency_range",
9211 FT_UINT32, BASE_DEC, VALS(mbim_packet_service_info_frequency_range_vals), 0,
9212 NULL, HFILL }
9213 },
9214 { &hf_mbim_packet_service_info_data_subclass,
9215 { "Data Subclass", "mbim.control.packet_service_info.data_subclass",
9216 FT_UINT32, BASE_HEX, NULL, 0,
9217 NULL, HFILL }
9218 },
9219 { &hf_mbim_set_signal_state_signal_strength_interval,
9220 { "Signal Strength Interval", "mbim.control.set_signal_state.signal_strength_interval",
9221 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0,
9222 NULL, HFILL }
9223 },
9224 { &hf_mbim_set_signal_state_rssi_threshold,
9225 { "RSSI Threshold", "mbim.control.set_signal_state.rssi_threshold",
9226 FT_UINT32, BASE_DEC, NULL, 0,
9227 NULL, HFILL }
9228 },
9229 { &hf_mbim_set_signal_state_error_rate_threshold,
9230 { "Error Rate Threshold", "mbim.control.set_signal_state.error_rate_threshold",
9231 FT_UINT32, BASE_DEC, NULL, 0,
9232 NULL, HFILL }
9233 },
9234 { &hf_mbim_signal_state_element_rsrp,
9235 { "RSRP", "mbim.control.signal_state_element.rsrp",
9236 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rsrp_signal_state_fmt), 0,
9237 NULL, HFILL }
9238 },
9239 { &hf_mbim_signal_state_element_snr,
9240 { "SNR", "mbim.control.signal_state_element.snr",
9241 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_snr_signal_state_fmt), 0,
9242 NULL, HFILL }
9243 },
9244 { &hf_mbim_signal_state_element_rsrp_threshold,
9245 { "RSRP Threshold", "mbim.control.signal_state_element.rsrp_threshold",
9246 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
9247 NULL, HFILL }
9248 },
9249 { &hf_mbim_signal_state_element_snr_threshold,
9250 { "SNR Threshold", "mbim.control.signal_state_element.snr_threshold",
9251 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_decibels, 0,
9252 NULL, HFILL }
9253 },
9254 { &hf_mbim_signal_state_element_system_type,
9255 { "System Type", "mbim.control.signal_state_element.system_type",
9256 FT_UINT32, BASE_HEX, NULL, 0,
9257 NULL, HFILL }
9258 },
9259 { &hf_mbim_signal_state_info_rssi,
9260 { "RSSI", "mbim.control.signal_state_info.rssi",
9261 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rssi_fmt), 0,
9262 NULL, HFILL }
9263 },
9264 { &hf_mbim_signal_state_info_error_rate,
9265 { "Error Rate", "mbim.control.signal_state_info.error_rate",
9266 FT_UINT32, BASE_DEC, VALS(mbim_error_rate_vals), 0,
9267 NULL, HFILL }
9268 },
9269 { &hf_mbim_signal_state_info_signal_strength_interval,
9270 { "Signal Strength Interval", "mbim.control.signal_state_info.signal_strength_interval",
9271 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0,
9272 NULL, HFILL }
9273 },
9274 { &hf_mbim_signal_state_info_rssi_threshold,
9275 { "RSSI Threshold", "mbim.control.signal_state_info.rssi_threshold",
9276 FT_UINT32, BASE_DEC, NULL, 0,
9277 NULL, HFILL }
9278 },
9279 { &hf_mbim_signal_state_info_error_rate_threshold,
9280 { "Error Rate Threshold", "mbim.control.signal_state_info.error_rate_threshold",
9281 FT_UINT32, BASE_DEC, NULL, 0,
9282 NULL, HFILL }
9283 },
9284 { &hf_mbim_signal_state_info_rsrp_snr_offset,
9285 { "Rsrp Snr Offset", "mbim.control.signal_state_info.rsrp_snr_offset",
9286 FT_UINT32, BASE_DEC, NULL, 0,
9287 NULL, HFILL }
9288 },
9289 { &hf_mbim_signal_state_info_rsrp_snr_size,
9290 { "Rsrp Snr Size", "mbim.control.signal_state_info.rsrp_snr_size",
9291 FT_UINT32, BASE_DEC, NULL, 0,
9292 NULL, HFILL }
9293 },
9294 { &hf_mbim_signal_state_info_elem_count,
9295 { "Element Count", "mbim.control.signal_state_info.elem_count",
9296 FT_UINT32, BASE_DEC, NULL, 0,
9297 NULL, HFILL }
9298 },
9299 { &hf_mbim_context_type,
9300 { "Context Type", "mbim.control.context_type",
9301 FT_GUID, BASE_NONE, NULL, 0,
9302 NULL, HFILL }
9303 },
9304 { &hf_mbim_set_connect_session_id,
9305 { "Session Id", "mbim.control.set_connect.session_id",
9306 FT_UINT32, BASE_DEC, NULL, 0,
9307 NULL, HFILL }
9308 },
9309 { &hf_mbim_set_connect_activation_command,
9310 { "Activation Command", "mbim.control.set_connect.activation_command",
9311 FT_UINT32, BASE_DEC, VALS(mbim_activation_command_vals), 0,
9312 NULL, HFILL }
9313 },
9314 { &hf_mbim_set_connect_access_string_offset,
9315 { "Access String Offset", "mbim.control.set_connect.access_string_offset",
9316 FT_UINT32, BASE_DEC, NULL, 0,
9317 NULL, HFILL }
9318 },
9319 { &hf_mbim_set_connect_access_string_size,
9320 { "Access String Size", "mbim.control.set_connect.access_string_size",
9321 FT_UINT32, BASE_DEC, NULL, 0,
9322 NULL, HFILL }
9323 },
9324 { &hf_mbim_set_connect_user_name_offset,
9325 { "User Name Offset", "mbim.control.set_connect.user_name_offset",
9326 FT_UINT32, BASE_DEC, NULL, 0,
9327 NULL, HFILL }
9328 },
9329 { &hf_mbim_set_connect_user_name_size,
9330 { "User Name Size", "mbim.control.set_connect.user_name_size",
9331 FT_UINT32, BASE_DEC, NULL, 0,
9332 NULL, HFILL }
9333 },
9334 { &hf_mbim_set_connect_password_offset,
9335 { "Password Offset", "mbim.control.set_connect.password_offset",
9336 FT_UINT32, BASE_DEC, NULL, 0,
9337 NULL, HFILL }
9338 },
9339 { &hf_mbim_set_connect_password_size,
9340 { "Password Size", "mbim.control.set_connect.password_size",
9341 FT_UINT32, BASE_DEC, NULL, 0,
9342 NULL, HFILL }
9343 },
9344 { &hf_mbim_set_connect_compression,
9345 { "Compression", "mbim.control.set_connect.compression",
9346 FT_UINT32, BASE_DEC, VALS(mbim_compression_vals), 0,
9347 NULL, HFILL }
9348 },
9349 { &hf_mbim_set_connect_auth_protocol,
9350 { "Authentication Protocol", "mbim.control.set_connect.auth_protocol",
9351 FT_UINT32, BASE_DEC, VALS(mbim_auth_protocol_vals), 0,
9352 NULL, HFILL }
9353 },
9354 { &hf_mbim_set_connect_ip_type,
9355 { "IP Type", "mbim.control.set_connect.ip_type",
9356 FT_UINT32, BASE_DEC, VALS(mbim_context_ip_type_vals), 0,
9357 NULL, HFILL }
9358 },
9359 { &hf_mbim_set_connect_access_string,
9360 { "Access String", "mbim.control.set_connect.access_string",
9361 FT_STRING, BASE_NONE, NULL, 0,
9362 NULL, HFILL }
9363 },
9364 { &hf_mbim_set_connect_user_name,
9365 { "User Name", "mbim.control.set_connect.user_name",
9366 FT_STRING, BASE_NONE, NULL, 0,
9367 NULL, HFILL }
9368 },
9369 { &hf_mbim_set_connect_password,
9370 { "Password", "mbim.control.set_connect.password",
9371 FT_STRING, BASE_NONE, NULL, 0,
9372 NULL, HFILL }
9373 },
9374 { &hf_mbim_set_connect_media_preference,
9375 { "Media Preference", "mbim.control.set_connect.media_preference",
9376 FT_UINT32, BASE_DEC, NULL, 0,
9377 NULL, HFILL }
9378 },
9379 { &hf_mbim_connect_info_session_id,
9380 { "Session Id", "mbim.control.connect_info.session_id",
9381 FT_UINT32, BASE_DEC, NULL, 0,
9382 NULL, HFILL }
9383 },
9384 { &hf_mbim_connect_info_activation_state,
9385 { "Activation State", "mbim.control.connect_info.activation_state",
9386 FT_UINT32, BASE_DEC, VALS(mbim_activation_state_vals), 0,
9387 NULL, HFILL }
9388 },
9389 { &hf_mbim_connect_info_voice_call_state,
9390 { "Voice Call State", "mbim.control.connect_info.voice_call_state",
9391 FT_UINT32, BASE_DEC, VALS(mbim_voice_call_state_vals), 0,
9392 NULL, HFILL }
9393 },
9394 { &hf_mbim_connect_info_ip_type,
9395 { "IP Type", "mbim.control.connect_info.ip_type",
9396 FT_UINT32, BASE_DEC, VALS(mbim_context_ip_type_vals), 0,
9397 NULL, HFILL }
9398 },
9399 { &hf_mbim_connect_info_nw_error,
9400 { "Network Error", "mbim.control.connect_info.nw_error",
9401 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0,
9402 NULL, HFILL }
9403 },
9404 { &hf_mbim_connect_info_access_media,
9405 { "Access Media", "mbim.control.connect_info.access_media",
9406 FT_UINT32, BASE_DEC, NULL, 0,
9407 NULL, HFILL }
9408 },
9409 { &hf_mbim_context_context_id,
9410 { "Context Id", "mbim.control.context.context_id",
9411 FT_UINT32, BASE_DEC, NULL, 0,
9412 NULL, HFILL }
9413 },
9414 { &hf_mbim_context_access_string_offset,
9415 { "Access String Offset", "mbim.control.context.access_string_offset",
9416 FT_UINT32, BASE_DEC, NULL, 0,
9417 NULL, HFILL }
9418 },
9419 { &hf_mbim_context_access_string_size,
9420 { "Access String Size", "mbim.control.context.access_string_size",
9421 FT_UINT32, BASE_DEC, NULL, 0,
9422 NULL, HFILL }
9423 },
9424 { &hf_mbim_context_user_name_offset,
9425 { "User Name Offset", "mbim.control.context.user_name_offset",
9426 FT_UINT32, BASE_DEC, NULL, 0,
9427 NULL, HFILL }
9428 },
9429 { &hf_mbim_context_user_name_size,
9430 { "User Name Size", "mbim.control.context.user_name_size",
9431 FT_UINT32, BASE_DEC, NULL, 0,
9432 NULL, HFILL }
9433 },
9434 { &hf_mbim_context_password_offset,
9435 { "Password Offset", "mbim.control.context.password_offset",
9436 FT_UINT32, BASE_DEC, NULL, 0,
9437 NULL, HFILL }
9438 },
9439 { &hf_mbim_context_password_size,
9440 { "Password Size", "mbim.control.context.password_size",
9441 FT_UINT32, BASE_DEC, NULL, 0,
9442 NULL, HFILL }
9443 },
9444 { &hf_mbim_context_compression,
9445 { "Compression", "mbim.control.context.compression",
9446 FT_UINT32, BASE_DEC, VALS(mbim_compression_vals), 0,
9447 NULL, HFILL }
9448 },
9449 { &hf_mbim_context_auth_protocol,
9450 { "Authentication Protocol", "mbim.control.context.auth_protocol",
9451 FT_UINT32, BASE_DEC, VALS(mbim_auth_protocol_vals), 0,
9452 NULL, HFILL }
9453 },
9454 { &hf_mbim_context_provider_id_offset,
9455 { "Provider Id Offset", "mbim.control.context.provider_id_offset",
9456 FT_UINT32, BASE_DEC, NULL, 0,
9457 NULL, HFILL }
9458 },
9459 { &hf_mbim_context_provider_id_size,
9460 { "Provider Id Size", "mbim.control.context.provider_id_size",
9461 FT_UINT32, BASE_DEC, NULL, 0,
9462 NULL, HFILL }
9463 },
9464 { &hf_mbim_context_access_string,
9465 { "Access String", "mbim.control.context.access_string",
9466 FT_STRING, BASE_NONE, NULL, 0,
9467 NULL, HFILL }
9468 },
9469 { &hf_mbim_context_user_name,
9470 { "User Name", "mbim.control.context.user_name",
9471 FT_STRING, BASE_NONE, NULL, 0,
9472 NULL, HFILL }
9473 },
9474 { &hf_mbim_context_password,
9475 { "Password", "mbim.control.context.password",
9476 FT_STRING, BASE_NONE, NULL, 0,
9477 NULL, HFILL }
9478 },
9479 { &hf_mbim_context_provider_id,
9480 { "Provider Id", "mbim.control.context.provider_id",
9481 FT_STRING, BASE_NONE, NULL, 0,
9482 NULL, HFILL }
9483 },
9484 { &hf_mbim_provisioned_contexts_info_elem_count,
9485 { "Element Count", "mbim.control.context.provisioned_contexts_info.elem_count",
9486 FT_UINT32, BASE_DEC, NULL, 0,
9487 NULL, HFILL }
9488 },
9489 { &hf_mbim_provisioned_contexts_info_provisioned_context_offset,
9490 { "Provisioned Context Offset", "mbim.control.context.provisioned_contexts_info.provisioned_context_offset",
9491 FT_UINT32, BASE_DEC, NULL, 0,
9492 NULL, HFILL }
9493 },
9494 { &hf_mbim_provisioned_contexts_info_provisioned_context_size,
9495 { "Provisioned Context Size", "mbim.control.context.provisioned_contexts_info.provisioned_context_size",
9496 FT_UINT32, BASE_DEC, NULL, 0,
9497 NULL, HFILL }
9498 },
9499 { &hf_mbim_set_service_activation_data_buffer,
9500 { "Data Buffer", "mbim.control.set_service_activation.data_buffer",
9501 FT_BYTES, BASE_NONE, NULL, 0,
9502 NULL, HFILL }
9503 },
9504 { &hf_mbim_service_activation_info_nw_error,
9505 { "Network Error", "mbim.control.service_activation_info.nw_error",
9506 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0,
9507 NULL, HFILL }
9508 },
9509 { &hf_mbim_service_activation_info_data_buffer,
9510 { "Data Buffer", "mbim.control.service_activation_info.data_buffer",
9511 FT_BYTES, BASE_NONE, NULL, 0,
9512 NULL, HFILL }
9513 },
9514 { &hf_mbim_ipv4_element_on_link_prefix_length,
9515 { "On Link Prefix Length", "mbim.control.ipv4_element.on_link_prefix_length",
9516 FT_UINT32, BASE_DEC, NULL, 0,
9517 NULL, HFILL }
9518 },
9519 { &hf_mbim_ipv4_element_ipv4_address,
9520 { "IPv4 Address", "mbim.control.ipv4_element.ipv4_address",
9521 FT_IPv4, BASE_NONE, NULL, 0,
9522 NULL, HFILL }
9523 },
9524 { &hf_mbim_ipv6_element_on_link_prefix_length,
9525 { "On Link Prefix Length", "mbim.control.ipv6_element.on_link_prefix_length",
9526 FT_UINT32, BASE_DEC, NULL, 0,
9527 NULL, HFILL }
9528 },
9529 { &hf_mbim_ipv6_element_ipv6_address,
9530 { "IPv6 Address", "mbim.control.ipv6_element.ipv6_address",
9531 FT_IPv6, BASE_NONE, NULL, 0,
9532 NULL, HFILL }
9533 },
9534 { &hf_mbim_ip_configuration_info_session_id,
9535 { "Session Id", "mbim.control.ip_configuration_info.session_id",
9536 FT_UINT32, BASE_DEC, NULL, 0,
9537 NULL, HFILL }
9538 },
9539 { &hf_mbim_ip_configuration_info_ipv4_configuration_available,
9540 { "IPv4 Configuration Available", "mbim.control.ip_configuration_info.ipv4_configuration_available",
9541 FT_UINT32, BASE_HEX, NULL, 0,
9542 NULL, HFILL }
9543 },
9544 { &hf_mbim_ip_configuration_info_ipv4_configuration_available_address,
9545 { "Address", "mbim.control.ip_configuration_info.control_caps.ipv4_configuration_available.address",
9546 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000001,
9547 NULL, HFILL }
9548 },
9549 { &hf_mbim_ip_configuration_info_ipv4_configuration_available_gateway,
9550 { "Gateway", "mbim.control.ip_configuration_info.control_caps.ipv4_configuration_available.gateway",
9551 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000002,
9552 NULL, HFILL }
9553 },
9554 { &hf_mbim_ip_configuration_info_ipv4_configuration_available_dns,
9555 { "DNS Server", "mbim.control.ip_configuration_info.control_caps.ipv4_configuration_available.dns",
9556 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000004,
9557 NULL, HFILL }
9558 },
9559 { &hf_mbim_ip_configuration_info_ipv4_configuration_available_mtu,
9560 { "MTU", "mbim.control.ip_configuration_info.control_caps.ipv4_configuration_available.mtu",
9561 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000008,
9562 NULL, HFILL }
9563 },
9564 { &hf_mbim_ip_configuration_info_ipv6_configuration_available,
9565 { "IPv6 Configuration Available", "mbim.control.ip_configuration_info.ipv6_configuration_available",
9566 FT_UINT32, BASE_HEX, NULL, 0,
9567 NULL, HFILL }
9568 },
9569 { &hf_mbim_ip_configuration_info_ipv6_configuration_available_address,
9570 { "Address", "mbim.control.ip_configuration_info.control_caps.ipv6_configuration_available.address",
9571 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000001,
9572 NULL, HFILL }
9573 },
9574 { &hf_mbim_ip_configuration_info_ipv6_configuration_available_gateway,
9575 { "Gateway", "mbim.control.ip_configuration_info.control_caps.ipv6_configuration_available.gateway",
9576 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000002,
9577 NULL, HFILL }
9578 },
9579 { &hf_mbim_ip_configuration_info_ipv6_configuration_available_dns,
9580 { "DNS Server", "mbim.control.ip_configuration_info.control_caps.ipv6_configuration_available.dns",
9581 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000004,
9582 NULL, HFILL }
9583 },
9584 { &hf_mbim_ip_configuration_info_ipv6_configuration_available_mtu,
9585 { "MTU", "mbim.control.ip_configuration_info.control_caps.ipv6_configuration_available.mtu",
9586 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000008,
9587 NULL, HFILL }
9588 },
9589 { &hf_mbim_ip_configuration_info_ipv4_address_count,
9590 { "IPv4 Address Count", "mbim.control.ip_configuration_info.ipv4_address.count",
9591 FT_UINT32, BASE_DEC, NULL, 0,
9592 NULL, HFILL }
9593 },
9594 { &hf_mbim_ip_configuration_info_ipv4_address_offset,
9595 { "IPv4 Address Offset", "mbim.control.ip_configuration_info.ipv4_address.offset",
9596 FT_UINT32, BASE_DEC, NULL, 0,
9597 NULL, HFILL }
9598 },
9599 { &hf_mbim_ip_configuration_info_ipv6_address_count,
9600 { "IPv6 Address Count", "mbim.control.ip_configuration_info.ipv6_address.count",
9601 FT_UINT32, BASE_DEC, NULL, 0,
9602 NULL, HFILL }
9603 },
9604 { &hf_mbim_ip_configuration_info_ipv6_address_offset,
9605 { "IPv6 Address Offset", "mbim.control.ip_configuration_info.ipv6_address.offset",
9606 FT_UINT32, BASE_DEC, NULL, 0,
9607 NULL, HFILL }
9608 },
9609 { &hf_mbim_ip_configuration_info_ipv4_gateway_offset,
9610 { "IPv4 Gateway Offset", "mbim.control.ip_configuration_info.ipv4_gateway.offset",
9611 FT_UINT32, BASE_DEC, NULL, 0,
9612 NULL, HFILL }
9613 },
9614 { &hf_mbim_ip_configuration_info_ipv6_gateway_offset,
9615 { "IPv6 Gateway Offset", "mbim.control.ip_configuration_info.ipv6_gateway.offset",
9616 FT_UINT32, BASE_DEC, NULL, 0,
9617 NULL, HFILL }
9618 },
9619 { &hf_mbim_ip_configuration_info_ipv4_dns_count,
9620 { "IPv4 DNS Server Count", "mbim.control.ip_configuration_info.ipv4_dns.count",
9621 FT_UINT32, BASE_DEC, NULL, 0,
9622 NULL, HFILL }
9623 },
9624 { &hf_mbim_ip_configuration_info_ipv4_dns_offset,
9625 { "IPv4 DNS Server Offset", "mbim.control.ip_configuration_info.ipv4_dns.offset",
9626 FT_UINT32, BASE_DEC, NULL, 0,
9627 NULL, HFILL }
9628 },
9629 { &hf_mbim_ip_configuration_info_ipv6_dns_count,
9630 { "IPv6 DNS Server Count", "mbim.control.ip_configuration_info.ipv6_dns.count",
9631 FT_UINT32, BASE_DEC, NULL, 0,
9632 NULL, HFILL }
9633 },
9634 { &hf_mbim_ip_configuration_info_ipv6_dns_offset,
9635 { "IPv6 DNS Server Offset", "mbim.control.ip_configuration_info.ipv6_dns.offset",
9636 FT_UINT32, BASE_DEC, NULL, 0,
9637 NULL, HFILL }
9638 },
9639 { &hf_mbim_ip_configuration_info_ipv4_mtu,
9640 { "IPv4 MTU", "mbim.control.ip_configuration_info.ipv4_mtu",
9641 FT_UINT32, BASE_DEC, NULL, 0,
9642 NULL, HFILL }
9643 },
9644 { &hf_mbim_ip_configuration_info_ipv6_mtu,
9645 { "IPv6 MTU", "mbim.control.ip_configuration_info.ipv6_mtu",
9646 FT_UINT32, BASE_DEC, NULL, 0,
9647 NULL, HFILL }
9648 },
9649 { &hf_mbim_ip_configuration_info_ipv4_gateway,
9650 { "IPv4 Gateway", "mbim.control.ip_configuration_info.ipv4_gateway",
9651 FT_IPv4, BASE_NONE, NULL, 0,
9652 NULL, HFILL }
9653 },
9654 { &hf_mbim_ip_configuration_info_ipv6_gateway,
9655 { "IPv6 Gateway", "mbim.control.ip_configuration_info.ipv6_gateway",
9656 FT_IPv6, BASE_NONE, NULL, 0,
9657 NULL, HFILL }
9658 },
9659 { &hf_mbim_ip_configuration_info_ipv4_dns,
9660 { "IPv4 DNS Server", "mbim.control.ip_configuration_info.ipv4_dns",
9661 FT_IPv4, BASE_NONE, NULL, 0,
9662 NULL, HFILL }
9663 },
9664 { &hf_mbim_ip_configuration_info_ipv6_dns,
9665 { "IPv6 DNS Server", "mbim.control.ip_configuration_info.ipv6_dns",
9666 FT_IPv6, BASE_NONE, NULL, 0,
9667 NULL, HFILL }
9668 },
9669 { &hf_mbim_device_service_element_device_service_id,
9670 { "Device Service Id", "mbim.control.device_service_element.device_service_id",
9671 FT_GUID, BASE_NONE, NULL, 0,
9672 NULL, HFILL }
9673 },
9674 { &hf_mbim_device_service_element_dss_payload,
9675 { "DSS Payload", "mbim.control.device_service_element.dss_payload",
9676 FT_UINT32, BASE_HEX, NULL, 0,
9677 NULL, HFILL }
9678 },
9679 { &hf_mbim_device_service_element_dss_payload_host_device,
9680 { "Host To Device", "mbim.control.device_service_element.dss_payload.host_device",
9681 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
9682 NULL, HFILL }
9683 },
9684 { &hf_mbim_device_service_element_dss_payload_device_host,
9685 { "Device To Host", "mbim.control.device_service_element.dss_payload.device_host",
9686 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
9687 NULL, HFILL }
9688 },
9689 { &hf_mbim_device_service_element_max_dss_instances,
9690 { "Max DSS Instances", "mbim.control.device_service_element.max_dss_instances",
9691 FT_UINT32, BASE_DEC, NULL, 0,
9692 NULL, HFILL }
9693 },
9694 { &hf_mbim_device_service_element_cid_count,
9695 { "CID Count", "mbim.control.device_service_element.cid.count",
9696 FT_UINT32, BASE_DEC, NULL, 0,
9697 NULL, HFILL }
9698 },
9699 { &hf_mbim_device_service_element_cid,
9700 { "CID", "mbim.control.device_service_element.cid",
9701 FT_UINT32, BASE_DEC, NULL, 0,
9702 NULL, HFILL }
9703 },
9704 { &hf_mbim_device_services_info_device_services_count,
9705 { "Device Services Count", "mbim.control.device_services_info.device_services_count",
9706 FT_UINT32, BASE_DEC, NULL, 0,
9707 NULL, HFILL }
9708 },
9709 { &hf_mbim_device_services_info_max_dss_sessions,
9710 { "Max DSS Sessions", "mbim.control.device_services_info.max_dss_sessions",
9711 FT_UINT32, BASE_DEC, NULL, 0,
9712 NULL, HFILL }
9713 },
9714 { &hf_mbim_device_services_info_device_services_offset,
9715 { "Device Services Offset", "mbim.control.device_services_info.device_services.offset",
9716 FT_UINT32, BASE_DEC, NULL, 0,
9717 NULL, HFILL }
9718 },
9719 { &hf_mbim_device_services_info_device_services_size,
9720 { "Device Services Size", "mbim.control.device_services_info.device_services.size",
9721 FT_UINT32, BASE_DEC, NULL, 0,
9722 NULL, HFILL }
9723 },
9724 { &hf_mbim_event_entry_device_service_id,
9725 { "Device Service Id", "mbim.control.event_entry.device_service_id",
9726 FT_GUID, BASE_NONE, NULL, 0,
9727 NULL, HFILL }
9728 },
9729 { &hf_mbim_event_entry_cid_count,
9730 { "CID Count", "mbim.control.event_entry.cid.count",
9731 FT_UINT32, BASE_DEC, NULL, 0,
9732 NULL, HFILL }
9733 },
9734 { &hf_mbim_event_entry_cid,
9735 { "CID", "mbim.control.event_entry.cid",
9736 FT_UINT32, BASE_DEC, NULL, 0,
9737 NULL, HFILL }
9738 },
9739 { &hf_mbim_device_service_subscribe_element_count,
9740 { "Element Count", "mbim.control.device_service_subscribe.element_count",
9741 FT_UINT32, BASE_DEC, NULL, 0,
9742 NULL, HFILL }
9743 },
9744 { &hf_mbim_device_service_subscribe_device_service_offset,
9745 { "Device Service Offset", "mbim.control.device_service_subscribe.device_service.offset",
9746 FT_UINT32, BASE_DEC, NULL, 0,
9747 NULL, HFILL }
9748 },
9749 { &hf_mbim_device_service_subscribe_device_service_size,
9750 { "Device Service Size", "mbim.control.device_service_subscribe.device_service.size",
9751 FT_UINT32, BASE_DEC, NULL, 0,
9752 NULL, HFILL }
9753 },
9754 { &hf_mbim_packet_statistics_info_in_discards,
9755 { "In Discards", "mbim.control.packet_statistics_info.in_discards",
9756 FT_UINT32, BASE_DEC, NULL, 0,
9757 NULL, HFILL }
9758 },
9759 { &hf_mbim_packet_statistics_info_in_errors,
9760 { "In Errors", "mbim.control.packet_statistics_info.in_errors",
9761 FT_UINT32, BASE_DEC, NULL, 0,
9762 NULL, HFILL }
9763 },
9764 { &hf_mbim_packet_statistics_info_in_octets,
9765 { "In Octets", "mbim.control.packet_statistics_info.in_octets",
9766 FT_UINT64, BASE_DEC, NULL, 0,
9767 NULL, HFILL }
9768 },
9769 { &hf_mbim_packet_statistics_info_in_packets,
9770 { "In Packets", "mbim.control.packet_statistics_info.in_packets",
9771 FT_UINT64, BASE_DEC, NULL, 0,
9772 NULL, HFILL }
9773 },
9774 { &hf_mbim_packet_statistics_info_out_octets,
9775 { "Out Octets", "mbim.control.packet_statistics_info.out_octets",
9776 FT_UINT64, BASE_DEC, NULL, 0,
9777 NULL, HFILL }
9778 },
9779 { &hf_mbim_packet_statistics_info_out_packets,
9780 { "Out Packets", "mbim.control.packet_statistics_info.out_packets",
9781 FT_UINT64, BASE_DEC, NULL, 0,
9782 NULL, HFILL }
9783 },
9784 { &hf_mbim_packet_statistics_info_out_errors,
9785 { "Out Errors", "mbim.control.packet_statistics_info.out_errors",
9786 FT_UINT32, BASE_DEC, NULL, 0,
9787 NULL, HFILL }
9788 },
9789 { &hf_mbim_packet_statistics_info_out_discards,
9790 { "Out Discards", "mbim.control.packet_statistics_info.out_discards",
9791 FT_UINT32, BASE_DEC, NULL, 0,
9792 NULL, HFILL }
9793 },
9794 { &hf_mbim_network_idle_hint_state,
9795 { "Network Idle Hint State", "mbim.control.network_idle_hint.state",
9796 FT_UINT32, BASE_DEC, VALS(mbim_network_idle_hint_states_vals), 0,
9797 NULL, HFILL }
9798 },
9799 { &hf_mbim_emergency_mode_info_emergency_mode,
9800 { "Emergency Mode", "mbim.control.emergency_mode_info.mode",
9801 FT_UINT32, BASE_DEC, VALS(mbim_emergency_mode_states_vals), 0,
9802 NULL, HFILL }
9803 },
9804 { &hf_mbim_single_packet_filter_filter_size,
9805 { "Filter Size", "mbim.control.single_packet_filter.filter_size",
9806 FT_UINT32, BASE_DEC, NULL, 0,
9807 NULL, HFILL }
9808 },
9809 { &hf_mbim_single_packet_filter_packet_filter_offset,
9810 { "Packet Filter Offset", "mbim.control.single_packet_filter.packet_filter.offset",
9811 FT_UINT32, BASE_DEC, NULL, 0,
9812 NULL, HFILL }
9813 },
9814 { &hf_mbim_single_packet_filter_packet_mask_offset,
9815 { "Packet Mask Offset", "mbim.control.single_packet_filter.packet_mask.offset",
9816 FT_UINT32, BASE_DEC, NULL, 0,
9817 NULL, HFILL }
9818 },
9819 { &hf_mbim_single_packet_filter_filter_id,
9820 { "Filter ID", "mbim.control.single_packet_filter.filter_id",
9821 FT_UINT32, BASE_DEC, NULL, 0,
9822 NULL, HFILL }
9823 },
9824 { &hf_mbim_single_packet_filter_packet_filter,
9825 { "Packet Filter", "mbim.control.single_packet_filter.packet_filter",
9826 FT_BYTES, BASE_NONE, NULL, 0,
9827 NULL, HFILL }
9828 },
9829 { &hf_mbim_single_packet_filter_packet_mask,
9830 { "Packet Mask", "mbim.control.single_packet_filter.packet_mask",
9831 FT_BYTES, BASE_NONE, NULL, 0,
9832 NULL, HFILL }
9833 },
9834 { &hf_mbim_packet_filters_session_id,
9835 { "Session Id", "mbim.control.packet_filters.session_id",
9836 FT_UINT32, BASE_DEC, NULL, 0,
9837 NULL, HFILL }
9838 },
9839 { &hf_mbim_packet_filters_packet_filters_count,
9840 { "Packet Filters Count", "mbim.control.packet_filters.packet_filters_count",
9841 FT_UINT32, BASE_DEC, NULL, 0,
9842 NULL, HFILL }
9843 },
9844 { &hf_mbim_packet_filters_packet_filters_packet_filter_offset,
9845 { "Packet Filter Offset", "mbim.control.packet_filters.packet_filter.offset",
9846 FT_UINT32, BASE_DEC, NULL, 0,
9847 NULL, HFILL }
9848 },
9849 { &hf_mbim_packet_filters_packet_filters_packet_filter_size,
9850 { "Packet Filters Size", "mbim.control.packet_filters.packet_filter.size",
9851 FT_UINT32, BASE_DEC, NULL, 0,
9852 NULL, HFILL }
9853 },
9854 { &hf_mbim_set_sms_configuration_format,
9855 { "Format", "mbim.control.set_sms_configuration.format",
9856 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
9857 NULL, HFILL }
9858 },
9859 { &hf_mbim_set_sms_configuration_sc_address_offset,
9860 { "Service Center Address Offset", "mbim.control.set_sms_configuration.sc_address.offset",
9861 FT_UINT32, BASE_DEC, NULL, 0,
9862 NULL, HFILL }
9863 },
9864 { &hf_mbim_set_sms_configuration_sc_address_size,
9865 { "Service Center Address Size", "mbim.control.set_sms_configuration.sc_address.size",
9866 FT_UINT32, BASE_DEC, NULL, 0,
9867 NULL, HFILL }
9868 },
9869 { &hf_mbim_set_sms_configuration_sc_address,
9870 { "Service Center Address", "mbim.control.set_sms_configuration.sc_address",
9871 FT_STRING, BASE_NONE, NULL, 0,
9872 NULL, HFILL }
9873 },
9874 { &hf_mbim_sms_configuration_info_sms_storage_state,
9875 { "SMS Storage State", "mbim.control.sms_configuration_info.sms_storage_state",
9876 FT_UINT32, BASE_DEC, VALS(mbim_sms_storage_state_vals), 0,
9877 NULL, HFILL }
9878 },
9879 { &hf_mbim_sms_configuration_info_format,
9880 { "Format", "mbim.control.sms_configuration_info.format",
9881 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
9882 NULL, HFILL }
9883 },
9884 { &hf_mbim_sms_configuration_info_max_messages,
9885 { "Max Messages", "mbim.control.sms_configuration_info.max_messages",
9886 FT_UINT32, BASE_DEC, NULL, 0,
9887 NULL, HFILL }
9888 },
9889 { &hf_mbim_sms_configuration_info_cdma_short_message_size,
9890 { "CDMA Short Message Size", "mbim.control.sms_configuration_info.cdma_short_message_size",
9891 FT_UINT32, BASE_DEC, NULL, 0,
9892 NULL, HFILL }
9893 },
9894 { &hf_mbim_sms_configuration_info_sc_address_offset,
9895 { "Service Center Address Offset", "mbim.control.sms_configuration_info.sc_address.offset",
9896 FT_UINT32, BASE_DEC, NULL, 0,
9897 NULL, HFILL }
9898 },
9899 { &hf_mbim_sms_configuration_info_sc_address_size,
9900 { "Service Center Address Size", "mbim.control.sms_configuration_info.sc_address.size",
9901 FT_UINT32, BASE_DEC, NULL, 0,
9902 NULL, HFILL }
9903 },
9904 { &hf_mbim_sms_configuration_info_sc_address,
9905 { "Service Center Address Size", "mbim.control.sms_configuration_info.sc_address",
9906 FT_STRING, BASE_NONE, NULL, 0,
9907 NULL, HFILL }
9908 },
9909 { &hf_mbim_sms_pdu_record_message_index,
9910 { "Message Index", "mbim.control.sms_pdu_record.message_index",
9911 FT_UINT32, BASE_DEC, NULL, 0,
9912 NULL, HFILL }
9913 },
9914 { &hf_mbim_sms_pdu_record_message_status,
9915 { "Message Status", "mbim.control.sms_pdu_record.message_status",
9916 FT_UINT32, BASE_DEC, VALS(mbim_sms_message_status_vals), 0,
9917 NULL, HFILL }
9918 },
9919 { &hf_mbim_sms_pdu_record_pdu_data_offset,
9920 { "PDU Data Offset", "mbim.control.sms_pdu_record.pdu_data.offset",
9921 FT_UINT32, BASE_DEC, NULL, 0,
9922 NULL, HFILL }
9923 },
9924 { &hf_mbim_sms_pdu_record_pdu_data_size,
9925 { "PDU Data Size", "mbim.control.sms_pdu_record.pdu_data.size",
9926 FT_UINT32, BASE_DEC, NULL, 0,
9927 NULL, HFILL }
9928 },
9929 { &hf_mbim_sms_pdu_record_pdu_data,
9930 { "PDU Data", "mbim.control.sms_pdu_record.pdu_data",
9931 FT_BYTES, BASE_NONE, NULL, 0,
9932 NULL, HFILL }
9933 },
9934 { &hf_mbim_sms_pdu_record_pdu_data_sc_address_size,
9935 { "Size", "mbim.control.sms_pdu_record.pdu_data.sc_address_size",
9936 FT_UINT8, BASE_DEC, NULL, 0,
9937 NULL, HFILL }
9938 },
9939 { &hf_mbim_sms_cdma_record_message_index,
9940 { "Message Index", "mbim.control.sms_cdma_record.message_index",
9941 FT_UINT32, BASE_DEC, NULL, 0,
9942 NULL, HFILL }
9943 },
9944 { &hf_mbim_sms_cdma_record_message_status,
9945 { "Message Status", "mbim.control.sms_cdma_record.message_status",
9946 FT_UINT32, BASE_DEC, VALS(mbim_sms_message_status_vals), 0,
9947 NULL, HFILL }
9948 },
9949 { &hf_mbim_sms_cdma_record_address_offset,
9950 { "Address Offset", "mbim.control.sms_cdma_record.address.offset",
9951 FT_UINT32, BASE_DEC, NULL, 0,
9952 NULL, HFILL }
9953 },
9954 { &hf_mbim_sms_cdma_record_address_size,
9955 { "Address Size", "mbim.control.sms_cdma_record.address.size",
9956 FT_UINT32, BASE_DEC, NULL, 0,
9957 NULL, HFILL }
9958 },
9959 { &hf_mbim_sms_cdma_record_timestamp_offset,
9960 { "Timestamp Offset", "mbim.control.sms_cdma_record.timestamp.offset",
9961 FT_UINT32, BASE_DEC, NULL, 0,
9962 NULL, HFILL }
9963 },
9964 { &hf_mbim_sms_cdma_record_timestamp_size,
9965 { "Timestamp Size", "mbim.control.sms_cdma_record.timestamp.size",
9966 FT_UINT32, BASE_DEC, NULL, 0,
9967 NULL, HFILL }
9968 },
9969 { &hf_mbim_sms_cdma_record_encoding_id,
9970 { "Encoding Id", "mbim.control.sms_cdma_record.encoding_id",
9971 FT_UINT32, BASE_DEC, VALS(mbim_sms_cdma_encoding_vals), 0,
9972 NULL, HFILL }
9973 },
9974 { &hf_mbim_sms_cdma_record_language_id,
9975 { "Language Id", "mbim.control.sms_cdma_record.language_id",
9976 FT_UINT32, BASE_DEC, VALS(mbim_sms_cdma_lang_vals), 0,
9977 NULL, HFILL }
9978 },
9979 { &hf_mbim_sms_cdma_record_encoded_message_offset,
9980 { "Encoded Message Offset", "mbim.control.sms_cdma_record.encoded_message.offset",
9981 FT_UINT32, BASE_DEC, NULL, 0,
9982 NULL, HFILL }
9983 },
9984 { &hf_mbim_sms_cdma_record_size_in_bytes,
9985 { "Size In Bytes", "mbim.control.sms_cdma_record.size_in_bytes",
9986 FT_UINT32, BASE_DEC, NULL, 0,
9987 NULL, HFILL }
9988 },
9989 { &hf_mbim_sms_cdma_record_size_in_characters,
9990 { "Size In Characters", "mbim.control.sms_cdma_record.size_in_characters",
9991 FT_UINT32, BASE_DEC, NULL, 0,
9992 NULL, HFILL }
9993 },
9994 { &hf_mbim_sms_cdma_record_address,
9995 { "Address", "mbim.control.sms_cdma_record.address",
9996 FT_STRING, BASE_NONE, NULL, 0,
9997 NULL, HFILL }
9998 },
9999 { &hf_mbim_sms_cdma_record_timestamp,
10000 { "Timestamp", "mbim.control.sms_cdma_record.timestamp",
10001 FT_STRING, BASE_NONE, NULL, 0,
10002 NULL, HFILL }
10003 },
10004 { &hf_mbim_sms_cdma_record_encoded_message,
10005 { "Encoded Message", "mbim.control.sms_cdma_record.encoded_message",
10006 FT_BYTES, BASE_NONE, NULL, 0,
10007 NULL, HFILL }
10008 },
10009 { &hf_mbim_sms_cdma_record_encoded_message_text,
10010 { "Text", "mbim.control.sms_cdma_record.encoded_message.text",
10011 FT_STRING, STR_UNICODE, NULL, 0,
10012 NULL, HFILL }
10013 },
10014 { &hf_mbim_sms_read_req_format,
10015 { "Format", "mbim.control.sms_read_req.format",
10016 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
10017 NULL, HFILL }
10018 },
10019 { &hf_mbim_sms_read_req_flag,
10020 { "Flag", "mbim.control.sms_read_req.flag",
10021 FT_UINT32, BASE_DEC, VALS(mbim_sms_flag_vals), 0,
10022 NULL, HFILL }
10023 },
10024 { &hf_mbim_sms_read_req_message_index,
10025 { "Message Index", "mbim.control.sms_read_req.message_index",
10026 FT_UINT32, BASE_DEC, NULL, 0,
10027 NULL, HFILL }
10028 },
10029 { &hf_mbim_sms_read_info_format,
10030 { "Format", "mbim.control.sms_read_info.format",
10031 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
10032 NULL, HFILL }
10033 },
10034 { &hf_mbim_sms_read_info_element_count,
10035 { "Element Count", "mbim.control.sms_read_info.element_count",
10036 FT_UINT32, BASE_DEC, NULL, 0,
10037 NULL, HFILL }
10038 },
10039 { &hf_mbim_sms_read_info_sms_offset,
10040 { "SMS Offset", "mbim.control.sms_read_info.sms.offset",
10041 FT_UINT32, BASE_DEC, NULL, 0,
10042 NULL, HFILL }
10043 },
10044 { &hf_mbim_sms_read_info_sms_size,
10045 { "SMS Size", "mbim.control.sms_read_info.sms.size",
10046 FT_UINT32, BASE_DEC, NULL, 0,
10047 NULL, HFILL }
10048 },
10049 { &hf_mbim_sms_send_pdu_pdu_data_offset,
10050 { "PDU Data Offset", "mbim.control.sms_send_pdu.pdu_data.offset",
10051 FT_UINT32, BASE_DEC, NULL, 0,
10052 NULL, HFILL }
10053 },
10054 { &hf_mbim_sms_send_pdu_pdu_data_size,
10055 { "PDU Data Size", "mbim.control.sms_send_pdu.pdu_data.size",
10056 FT_UINT32, BASE_DEC, NULL, 0,
10057 NULL, HFILL }
10058 },
10059 { &hf_mbim_sms_send_pdu_pdu_data,
10060 { "PDU Data", "mbim.control.sms_send_pdu.pdu_data",
10061 FT_BYTES, BASE_NONE, NULL, 0,
10062 NULL, HFILL }
10063 },
10064 { &hf_mbim_sms_send_pdu_pdu_data_sc_address_size,
10065 { "Size", "mbim.control.sms_send_pdu.pdu_data.sc_address_size",
10066 FT_UINT8, BASE_DEC, NULL, 0,
10067 NULL, HFILL }
10068 },
10069 { &hf_mbim_sms_send_cdma_encoding_id,
10070 { "Encoding Id", "mbim.control.sms_send_cdma.encoding_id",
10071 FT_UINT32, BASE_DEC, VALS(mbim_sms_cdma_encoding_vals), 0,
10072 NULL, HFILL }
10073 },
10074 { &hf_mbim_sms_send_cdma_language_id,
10075 { "Language Id", "mbim.control.sms_send_cdma.language_id",
10076 FT_UINT32, BASE_DEC, VALS(mbim_sms_cdma_lang_vals), 0,
10077 NULL, HFILL }
10078 },
10079 { &hf_mbim_sms_send_cdma_address_offset,
10080 { "Address Offset", "mbim.control.sms_send_cdma.address.offset",
10081 FT_UINT32, BASE_DEC, NULL, 0,
10082 NULL, HFILL }
10083 },
10084 { &hf_mbim_sms_send_cdma_address_size,
10085 { "Address Size", "mbim.control.sms_send_cdma.address.size",
10086 FT_UINT32, BASE_DEC, NULL, 0,
10087 NULL, HFILL }
10088 },
10089 { &hf_mbim_sms_send_cdma_encoded_message_offset,
10090 { "Encoded Message Offset", "mbim.control.sms_send_cdma.encoded_message.offset",
10091 FT_UINT32, BASE_DEC, NULL, 0,
10092 NULL, HFILL }
10093 },
10094 { &hf_mbim_sms_send_cdma_size_in_bytes,
10095 { "Size In Bytes", "mbim.control.sms_send_cdma.size_in_bytes",
10096 FT_UINT32, BASE_DEC, NULL, 0,
10097 NULL, HFILL }
10098 },
10099 { &hf_mbim_sms_send_cdma_size_in_characters,
10100 { "Size In Characters", "mbim.control.sms_send_cdma.size_in_characters",
10101 FT_UINT32, BASE_DEC, NULL, 0,
10102 NULL, HFILL }
10103 },
10104 { &hf_mbim_sms_send_cdma_address,
10105 { "Address", "mbim.control.sms_send_cdma.address",
10106 FT_STRING, BASE_NONE, NULL, 0,
10107 NULL, HFILL }
10108 },
10109 { &hf_mbim_sms_send_cdma_encoded_message,
10110 { "Encoded Message", "mbim.control.sms_send_cdma.encoded_message",
10111 FT_BYTES, BASE_NONE, NULL, 0,
10112 NULL, HFILL }
10113 },
10114 { &hf_mbim_sms_send_cdma_encoded_message_text,
10115 { "Text", "mbim.control.sms_send_cdma.encoded_message.text",
10116 FT_STRING, STR_UNICODE, NULL, 0,
10117 NULL, HFILL }
10118 },
10119 { &hf_mbim_set_sms_send_format,
10120 { "Format", "mbim.control.set_sms_send.format",
10121 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
10122 NULL, HFILL }
10123 },
10124 { &hf_mbim_sms_send_info_message_reference,
10125 { "Message Reference", "mbim.control.sms_send_info.message_reference",
10126 FT_UINT32, BASE_DEC, NULL, 0,
10127 NULL, HFILL }
10128 },
10129 { &hf_mbim_set_sms_delete_flag,
10130 { "Flag", "mbim.control.set_sms_delete.flag",
10131 FT_UINT32, BASE_DEC, VALS(mbim_sms_flag_vals), 0,
10132 NULL, HFILL }
10133 },
10134 { &hf_mbim_set_sms_delete_message_index,
10135 { "Message Index", "mbim.control.set_sms_delete.message_index",
10136 FT_UINT32, BASE_DEC, NULL, 0,
10137 NULL, HFILL }
10138 },
10139 { &hf_mbim_sms_status_info_flags,
10140 { "Flags", "mbim.control.sms_status_info.flags",
10141 FT_UINT32, BASE_HEX, NULL, 0,
10142 NULL, HFILL }
10143 },
10144 { &hf_mbim_sms_status_info_flags_message_store_full,
10145 { "Message Store Full", "mbim.control.sms_status_info.flags.message_store_full",
10146 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
10147 NULL, HFILL }
10148 },
10149 { &hf_mbim_sms_status_info_flags_new_message,
10150 { "New Message", "mbim.control.sms_status_info.flags.new_message",
10151 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
10152 NULL, HFILL }
10153 },
10154 { &hf_mbim_sms_status_info_message_index,
10155 { "Message Index", "mbim.control.sms_status_info.message_index",
10156 FT_UINT32, BASE_DEC, NULL, 0,
10157 NULL, HFILL }
10158 },
10159 { &hf_mbim_set_ussd_ussd_action,
10160 { "USSD Action", "mbim.control.set_ussd.ussd_action",
10161 FT_UINT32, BASE_DEC, VALS(mbim_ussd_action_vals), 0,
10162 NULL, HFILL }
10163 },
10164 { &hf_mbim_set_ussd_ussd_data_coding_scheme,
10165 { "USSD Data Coding Scheme", "mbim.control.set_ussd.ussd_data_coding_scheme",
10166 FT_UINT32, BASE_HEX, NULL, 0,
10167 NULL, HFILL }
10168 },
10169 { &hf_mbim_set_ussd_ussd_payload_offset,
10170 { "USSD Payload Offset", "mbim.control.set_ussd.ussd_payload.offset",
10171 FT_UINT32, BASE_DEC, NULL, 0,
10172 NULL, HFILL }
10173 },
10174 { &hf_mbim_set_ussd_ussd_payload_length,
10175 { "USSD Payload Length", "mbim.control.set_ussd.ussd_payload.length",
10176 FT_UINT32, BASE_DEC, NULL, 0,
10177 NULL, HFILL }
10178 },
10179 { &hf_mbim_set_ussd_ussd_payload,
10180 { "USSD Payload", "mbim.control.set_ussd.ussd_payload",
10181 FT_BYTES, BASE_NONE, NULL, 0,
10182 NULL, HFILL }
10183 },
10184 { &hf_mbim_set_ussd_ussd_payload_text,
10185 { "USSD Payload Text", "mbim.control.set_ussd.ussd_payload.text",
10186 FT_STRING, STR_UNICODE, NULL, 0,
10187 NULL, HFILL }
10188 },
10189 { &hf_mbim_ussd_info_ussd_response,
10190 { "USSD Response", "mbim.control.info_ussd.ussd_response",
10191 FT_UINT32, BASE_DEC, VALS(mbim_ussd_response_vals), 0,
10192 NULL, HFILL }
10193 },
10194 { &hf_mbim_ussd_info_ussd_session_state,
10195 { "USSD Session State", "mbim.control.info_ussd.ussd_session_state",
10196 FT_UINT32, BASE_DEC, VALS(mbim_ussd_session_state_vals), 0,
10197 NULL, HFILL }
10198 },
10199 { &hf_mbim_ussd_info_ussd_data_coding_scheme,
10200 { "USSD Data Coding Scheme", "mbim.control.ussd_info.ussd_data_coding_scheme",
10201 FT_UINT32, BASE_HEX, NULL, 0,
10202 NULL, HFILL }
10203 },
10204 { &hf_mbim_ussd_info_ussd_payload_offset,
10205 { "USSD Payload Offset", "mbim.control.ussd_info.ussd_payload.offset",
10206 FT_UINT32, BASE_DEC, NULL, 0,
10207 NULL, HFILL }
10208 },
10209 { &hf_mbim_ussd_info_ussd_payload_length,
10210 { "USSD Payload Length", "mbim.control.ussd_info.ussd_payload.length",
10211 FT_UINT32, BASE_DEC, NULL, 0,
10212 NULL, HFILL }
10213 },
10214 { &hf_mbim_ussd_info_ussd_payload,
10215 { "USSD Payload", "mbim.control.ussd_info.ussd_payload",
10216 FT_BYTES, BASE_NONE, NULL, 0,
10217 NULL, HFILL }
10218 },
10219 { &hf_mbim_ussd_info_ussd_payload_text,
10220 { "USSD Payload Text", "mbim.control.ussd_info.ussd_payload.text",
10221 FT_STRING, STR_UNICODE, NULL, 0,
10222 NULL, HFILL }
10223 },
10224 { &hf_mbim_phonebook_configuration_info_phonebook_state,
10225 { "Phonebook State", "mbim.control.phonebook_configuration_info.phonebook_state",
10226 FT_UINT32, BASE_DEC, VALS(mbim_phonebook_state_vals), 0,
10227 NULL, HFILL }
10228 },
10229 { &hf_mbim_phonebook_configuration_info_total_nb_of_entries,
10230 { "Total Number Of Entries", "mbim.control.phonebook_configuration_info.total_nb_of_entries",
10231 FT_UINT32, BASE_DEC, NULL, 0,
10232 NULL, HFILL }
10233 },
10234 { &hf_mbim_phonebook_configuration_info_used_entries,
10235 { "Used Entries", "mbim.control.phonebook_configuration_info.used_entries",
10236 FT_UINT32, BASE_DEC, NULL, 0,
10237 NULL, HFILL }
10238 },
10239 { &hf_mbim_phonebook_configuration_info_max_number_length,
10240 { "Max Number Length", "mbim.control.phonebook_configuration_info.max_number_length",
10241 FT_UINT32, BASE_DEC, NULL, 0,
10242 NULL, HFILL }
10243 },
10244 { &hf_mbim_phonebook_configuration_info_max_name_length,
10245 { "Max Name Length", "mbim.control.phonebook_configuration_info.max_name_length",
10246 FT_UINT32, BASE_DEC, NULL, 0,
10247 NULL, HFILL }
10248 },
10249 { &hf_mbim_phonebook_entry_entry_index,
10250 { "Entry Index", "mbim.control.phonebook_entry.entry_index",
10251 FT_UINT32, BASE_DEC, NULL, 0,
10252 NULL, HFILL }
10253 },
10254 { &hf_mbim_phonebook_entry_number_offset,
10255 { "Number Offset", "mbim.control.phonebook_entry.number.offset",
10256 FT_UINT32, BASE_DEC, NULL, 0,
10257 NULL, HFILL }
10258 },
10259 { &hf_mbim_phonebook_entry_number_length,
10260 { "Number Length", "mbim.control.phonebook_entry.number.length",
10261 FT_UINT32, BASE_DEC, NULL, 0,
10262 NULL, HFILL }
10263 },
10264 { &hf_mbim_phonebook_entry_name_offset,
10265 { "Name Offset", "mbim.control.phonebook_entry.name.offset",
10266 FT_UINT32, BASE_DEC, NULL, 0,
10267 NULL, HFILL }
10268 },
10269 { &hf_mbim_phonebook_entry_name_length,
10270 { "Name Length", "mbim.control.phonebook_entry.name.length",
10271 FT_UINT32, BASE_DEC, NULL, 0,
10272 NULL, HFILL }
10273 },
10274 { &hf_mbim_phonebook_entry_number,
10275 { "Number", "mbim.control.phonebook_entry.number",
10276 FT_STRING, BASE_NONE, NULL, 0,
10277 NULL, HFILL }
10278 },
10279 { &hf_mbim_phonebook_entry_name,
10280 { "Name", "mbim.control.phonebook_entry.name",
10281 FT_STRING, BASE_NONE, NULL, 0,
10282 NULL, HFILL }
10283 },
10284 { &hf_mbim_phonebook_read_req_filter_flag,
10285 { "Filter Flag", "mbim.control.phonebook_read_req.filter_flag",
10286 FT_UINT32, BASE_DEC, VALS(mbim_phonebook_flag_vals), 0,
10287 NULL, HFILL }
10288 },
10289 { &hf_mbim_phonebook_read_req_filter_message_index,
10290 { "Filter Message Index", "mbim.control.phonebook_read_req.filter_message_index",
10291 FT_UINT32, BASE_DEC, NULL, 0,
10292 NULL, HFILL }
10293 },
10294 { &hf_mbim_phonebook_read_info_element_count,
10295 { "Element Count", "mbim.control.phonebook_read_info.element_count",
10296 FT_UINT32, BASE_DEC, NULL, 0,
10297 NULL, HFILL }
10298 },
10299 { &hf_mbim_phonebook_read_info_phonebook_offset,
10300 { "Phonebook Offset", "mbim.control.phonebook_read_info.phonebook.offset",
10301 FT_UINT32, BASE_DEC, NULL, 0,
10302 NULL, HFILL }
10303 },
10304 { &hf_mbim_phonebook_read_info_phonebook_size,
10305 { "Phonebook Size", "mbim.control.phonebook_read_info.phonebook.size",
10306 FT_UINT32, BASE_DEC, NULL, 0,
10307 NULL, HFILL }
10308 },
10309 { &hf_mbim_set_phonebook_delete_filter_flag,
10310 { "Filter Flag", "mbim.control.set_phonebook_delete.filter_flag",
10311 FT_UINT32, BASE_DEC, VALS(mbim_phonebook_flag_vals), 0,
10312 NULL, HFILL }
10313 },
10314 { &hf_mbim_set_phonebook_delete_filter_message_index,
10315 { "Filter Message Index", "mbim.control.set_phonebook_delete.filter_message_index",
10316 FT_UINT32, BASE_DEC, NULL, 0,
10317 NULL, HFILL }
10318 },
10319 { &hf_mbim_set_phonebook_write_save_flag,
10320 { "Save Flag", "mbim.control.set_phonebook_write.save_flag",
10321 FT_UINT32, BASE_DEC, VALS(mbim_phonebook_write_flag_vals), 0,
10322 NULL, HFILL }
10323 },
10324 { &hf_mbim_set_phonebook_write_save_index,
10325 { "Save Index", "mbim.control.set_phonebook_write.save_index",
10326 FT_UINT32, BASE_DEC, NULL, 0,
10327 NULL, HFILL }
10328 },
10329 { &hf_mbim_set_phonebook_write_number_offset,
10330 { "Number Offset", "mbim.control.set_phonebook_write.number.offset",
10331 FT_UINT32, BASE_DEC, NULL, 0,
10332 NULL, HFILL }
10333 },
10334 { &hf_mbim_set_phonebook_write_number_length,
10335 { "Number Length", "mbim.control.set_phonebook_write.number.length",
10336 FT_UINT32, BASE_DEC, NULL, 0,
10337 NULL, HFILL }
10338 },
10339 { &hf_mbim_set_phonebook_write_name_offset,
10340 { "Name Offset", "mbim.control.set_phonebook_write.name.offset",
10341 FT_UINT32, BASE_DEC, NULL, 0,
10342 NULL, HFILL }
10343 },
10344 { &hf_mbim_set_phonebook_write_name_length,
10345 { "Name Length", "mbim.control.set_phonebook_write.name.length",
10346 FT_UINT32, BASE_DEC, NULL, 0,
10347 NULL, HFILL }
10348 },
10349 { &hf_mbim_set_phonebook_write_number,
10350 { "Number", "mbim.control.set_phonebook_write.number",
10351 FT_STRING, BASE_NONE, NULL, 0,
10352 NULL, HFILL }
10353 },
10354 { &hf_mbim_set_phonebook_write_name,
10355 { "Name", "mbim.control.set_phonebook_write.name",
10356 FT_STRING, BASE_NONE, NULL, 0,
10357 NULL, HFILL }
10358 },
10359 { &hf_mbim_set_stk_pac_pac_host_control,
10360 { "PAC Host Control", "mbim.control.set_stk_pac.pac_host_control",
10361 FT_BYTES, BASE_NONE, NULL, 0,
10362 NULL, HFILL }
10363 },
10364 { &hf_mbim_set_stk_pac_pac_host_control_refresh,
10365 { "Refresh", "mbim.control.set_stk_pac.pac_host_control.refresh",
10366 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x02,
10367 NULL, HFILL }
10368 },
10369 { &hf_mbim_set_stk_pac_pac_host_control_more_time,
10370 { "More Time", "mbim.control.set_stk_pac.pac_host_control.more_time",
10371 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x04,
10372 NULL, HFILL }
10373 },
10374 { &hf_mbim_set_stk_pac_pac_host_control_poll_interval,
10375 { "Poll Interval", "mbim.control.set_stk_pac.pac_host_control.poll_interval",
10376 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x08,
10377 NULL, HFILL }
10378 },
10379 { &hf_mbim_set_stk_pac_pac_host_control_polling_off,
10380 { "Polling Off", "mbim.control.set_stk_pac.pac_host_control.polling_off",
10381 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x10,
10382 NULL, HFILL }
10383 },
10384 { &hf_mbim_set_stk_pac_pac_host_control_set_up_evt_list,
10385 { "Set Up Event List", "mbim.control.set_stk_pac.pac_host_control.set_up_evt_list",
10386 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x20,
10387 NULL, HFILL }
10388 },
10389 { &hf_mbim_set_stk_pac_pac_host_control_set_up_call,
10390 { "Set Up Call", "mbim.control.set_stk_pac.pac_host_control.set_up_call",
10391 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x04,
10392 NULL, HFILL }
10393 },
10394 { &hf_mbim_set_stk_pac_pac_host_control_send_ss,
10395 { "Send SS", "mbim.control.set_stk_pac.pac_host_control.send_ss",
10396 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x08,
10397 NULL, HFILL }
10398 },
10399 { &hf_mbim_set_stk_pac_pac_host_control_send_ussd,
10400 { "Send USSD", "mbim.control.set_stk_pac.pac_host_control.send_ussd",
10401 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x10,
10402 NULL, HFILL }
10403 },
10404 { &hf_mbim_set_stk_pac_pac_host_control_send_short_msg,
10405 { "Send Short Message", "mbim.control.set_stk_pac.pac_host_control.send_short_msg",
10406 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x20,
10407 NULL, HFILL }
10408 },
10409 { &hf_mbim_set_stk_pac_pac_host_control_send_dtmf,
10410 { "Send DTMF", "mbim.control.set_stk_pac.pac_host_control.send_dtmf",
10411 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x40,
10412 NULL, HFILL }
10413 },
10414 { &hf_mbim_set_stk_pac_pac_host_control_launch_browser,
10415 { "Launch Browser", "mbim.control.set_stk_pac.pac_host_control.launch_browser",
10416 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x80,
10417 NULL, HFILL }
10418 },
10419 { &hf_mbim_set_stk_pac_pac_host_control_geo_loc_req,
10420 { "Geographical Location Request", "mbim.control.set_stk_pac.pac_host_control.geo_loc_req",
10421 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x01,
10422 NULL, HFILL }
10423 },
10424 { &hf_mbim_set_stk_pac_pac_host_control_play_tone,
10425 { "Play Tone", "mbim.control.set_stk_pac.pac_host_control.play_tone",
10426 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x10,
10427 NULL, HFILL }
10428 },
10429 { &hf_mbim_set_stk_pac_pac_host_control_display_text,
10430 { "Display Text", "mbim.control.set_stk_pac.pac_host_control.display_text",
10431 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x20,
10432 NULL, HFILL }
10433 },
10434 { &hf_mbim_set_stk_pac_pac_host_control_get_inkey,
10435 { "Get Inkey", "mbim.control.set_stk_pac.pac_host_control.get_inkey",
10436 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x40,
10437 NULL, HFILL }
10438 },
10439 { &hf_mbim_set_stk_pac_pac_host_control_get_input,
10440 { "Get Input", "mbim.control.set_stk_pac.pac_host_control.get_input",
10441 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x80,
10442 NULL, HFILL }
10443 },
10444 { &hf_mbim_set_stk_pac_pac_host_control_select_item,
10445 { "Select Item", "mbim.control.set_stk_pac.pac_host_control.select_item",
10446 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x01,
10447 NULL, HFILL }
10448 },
10449 { &hf_mbim_set_stk_pac_pac_host_control_set_up_menu,
10450 { "Set Up Menu", "mbim.control.set_stk_pac.pac_host_control.set_up_menu",
10451 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x02,
10452 NULL, HFILL }
10453 },
10454 { &hf_mbim_set_stk_pac_pac_host_control_prov_local_info,
10455 { "Provide Local Information", "mbim.control.set_stk_pac.pac_host_control.prov_local_info",
10456 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x04,
10457 NULL, HFILL }
10458 },
10459 { &hf_mbim_set_stk_pac_pac_host_control_timer_management,
10460 { "Timer Management", "mbim.control.set_stk_pac.pac_host_control.timer_management",
10461 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x08,
10462 NULL, HFILL }
10463 },
10464 { &hf_mbim_set_stk_pac_pac_host_control_set_up_idle_mode_text,
10465 { "Set Up Idle Mode Text", "mbim.control.set_stk_pac.pac_host_control.set_up_idle_mode_text",
10466 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x10,
10467 NULL, HFILL }
10468 },
10469 { &hf_mbim_set_stk_pac_pac_host_control_perform_card_apdu,
10470 { "Perform Card APDU", "mbim.control.set_stk_pac.pac_host_control.perform_card_apdu",
10471 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x40,
10472 NULL, HFILL }
10473 },
10474 { &hf_mbim_set_stk_pac_pac_host_control_power_on_card,
10475 { "Power On Card", "mbim.control.set_stk_pac.pac_host_control.power_on_card",
10476 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x80,
10477 NULL, HFILL }
10478 },
10479 { &hf_mbim_set_stk_pac_pac_host_control_power_off_card,
10480 { "Power Off Card", "mbim.control.set_stk_pac.pac_host_control.power_off_card",
10481 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x01,
10482 NULL, HFILL }
10483 },
10484 { &hf_mbim_set_stk_pac_pac_host_control_get_reader_status,
10485 { "Get Reader Status", "mbim.control.set_stk_pac.pac_host_control.get_reader_status",
10486 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x02,
10487 NULL, HFILL }
10488 },
10489 { &hf_mbim_set_stk_pac_pac_host_control_run_at_cmd,
10490 { "Run AT Command", "mbim.control.set_stk_pac.pac_host_control.run_at_cmd",
10491 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x04,
10492 NULL, HFILL }
10493 },
10494 { &hf_mbim_set_stk_pac_pac_host_control_lang_notif,
10495 { "Language Notification", "mbim.control.set_stk_pac.pac_host_control.lang_notif",
10496 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x08,
10497 NULL, HFILL }
10498 },
10499 { &hf_mbim_set_stk_pac_pac_host_control_open_channel,
10500 { "Open Channel", "mbim.control.set_stk_pac.pac_host_control.open_channel",
10501 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x01,
10502 NULL, HFILL }
10503 },
10504 { &hf_mbim_set_stk_pac_pac_host_control_close_channel,
10505 { "Close Channel", "mbim.control.set_stk_pac.pac_host_control.close_channel",
10506 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x02,
10507 NULL, HFILL }
10508 },
10509 { &hf_mbim_set_stk_pac_pac_host_control_receive_data,
10510 { "Receive Data", "mbim.control.set_stk_pac.pac_host_control.receive_data",
10511 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x04,
10512 NULL, HFILL }
10513 },
10514 { &hf_mbim_set_stk_pac_pac_host_control_send_data,
10515 { "Send Data", "mbim.control.set_stk_pac.pac_host_control.send_data",
10516 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x08,
10517 NULL, HFILL }
10518 },
10519 { &hf_mbim_set_stk_pac_pac_host_control_get_channel_status,
10520 { "Get Channel Status", "mbim.control.set_stk_pac.pac_host_control.get_channel_status",
10521 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x10,
10522 NULL, HFILL }
10523 },
10524 { &hf_mbim_set_stk_pac_pac_host_control_service_search,
10525 { "Service Search", "mbim.control.set_stk_pac.pac_host_control.service_search",
10526 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x20,
10527 NULL, HFILL }
10528 },
10529 { &hf_mbim_set_stk_pac_pac_host_control_get_service_info,
10530 { "Get Service Information", "mbim.control.set_stk_pac.pac_host_control.get_service_info",
10531 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x40,
10532 NULL, HFILL }
10533 },
10534 { &hf_mbim_set_stk_pac_pac_host_control_declare_service,
10535 { "Declare Service", "mbim.control.set_stk_pac.pac_host_control.declare_service",
10536 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x80,
10537 NULL, HFILL }
10538 },
10539 { &hf_mbim_set_stk_pac_pac_host_control_set_frames,
10540 { "Set Frames", "mbim.control.set_stk_pac.pac_host_control.set_frames",
10541 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x04,
10542 NULL, HFILL }
10543 },
10544 { &hf_mbim_set_stk_pac_pac_host_control_get_frames_status,
10545 { "Get Frames Status", "mbim.control.set_stk_pac.pac_host_control.get_frames_status",
10546 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x08,
10547 NULL, HFILL }
10548 },
10549 { &hf_mbim_set_stk_pac_pac_host_control_retrieve_multimedia_msg,
10550 { "Retrieve Multimedia Message", "mbim.control.set_stk_pac.pac_host_control.retrieve_multimedia_msg",
10551 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x10,
10552 NULL, HFILL }
10553 },
10554 { &hf_mbim_set_stk_pac_pac_host_control_submit_multimedia_msg,
10555 { "Submit Multimedia Message", "mbim.control.set_stk_pac.pac_host_control.submit_multimedia_msg",
10556 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x20,
10557 NULL, HFILL }
10558 },
10559 { &hf_mbim_set_stk_pac_pac_host_control_display_multimedia_msg,
10560 { "Display Multimedia Message", "mbim.control.set_stk_pac.pac_host_control.display_multimedia_msg",
10561 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x40,
10562 NULL, HFILL }
10563 },
10564 { &hf_mbim_set_stk_pac_pac_host_control_activate,
10565 { "Activate", "mbim.control.set_stk_pac.pac_host_control.activate",
10566 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x40,
10567 NULL, HFILL }
10568 },
10569 { &hf_mbim_set_stk_pac_pac_host_control_contactless_state_changed,
10570 { "Contactless State Changed", "mbim.control.set_stk_pac.pac_host_control.contactless_state_changed",
10571 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x80,
10572 NULL, HFILL }
10573 },
10574 { &hf_mbim_set_stk_pac_pac_host_control_cmd_container,
10575 { "Command Container", "mbim.control.set_stk_pac.pac_host_control.cmd_container",
10576 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x01,
10577 NULL, HFILL }
10578 },
10579 { &hf_mbim_set_stk_pac_pac_host_control_encapsulated_session_ctrl,
10580 { "Encapsulated Session Control", "mbim.control.set_stk_pac.pac_host_control.encapsulated_session_ctrl",
10581 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x02,
10582 NULL, HFILL }
10583 },
10584 { &hf_mbim_set_stk_pac_pac_host_control_end_proact_session,
10585 { "End Proactive Session", "mbim.control.set_stk_pac.pac_host_control.end_proact_session",
10586 FT_BOOLEAN, 8, TFS(&mbim_pac_host_control_val), 0x02,
10587 NULL, HFILL }
10588 },
10589 { &hf_mbim_stk_pac_info_pac_support,
10590 { "PAC Host Control", "mbim.control.stk_pac_info.pac_support",
10591 FT_BYTES, BASE_NONE, NULL, 0,
10592 NULL, HFILL }
10593 },
10594 { &hf_mbim_stk_pac_info_pac_support_refresh,
10595 { "Refresh", "mbim.control.stk_pac_info.pac_support.refresh",
10596 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10597 NULL, HFILL }
10598 },
10599 { &hf_mbim_stk_pac_info_pac_support_more_time,
10600 { "More Time", "mbim.control.stk_pac_info.pac_support.more_time",
10601 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10602 NULL, HFILL }
10603 },
10604 { &hf_mbim_stk_pac_info_pac_support_poll_interval,
10605 { "Poll Interval", "mbim.control.stk_pac_info.pac_support.poll_interval",
10606 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10607 NULL, HFILL }
10608 },
10609 { &hf_mbim_stk_pac_info_pac_support_polling_off,
10610 { "Polling Off", "mbim.control.stk_pac_info.pac_support.polling_off",
10611 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10612 NULL, HFILL }
10613 },
10614 { &hf_mbim_stk_pac_info_pac_support_set_up_evt_list,
10615 { "Set Up Event List", "mbim.control.stk_pac_info.pac_support.set_up_evt_list",
10616 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10617 NULL, HFILL }
10618 },
10619 { &hf_mbim_stk_pac_info_pac_support_set_up_call,
10620 { "Set Up Call", "mbim.control.stk_pac_info.pac_support.set_up_call",
10621 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10622 NULL, HFILL }
10623 },
10624 { &hf_mbim_stk_pac_info_pac_support_send_ss,
10625 { "Send SS", "mbim.control.stk_pac_info.pac_support.send_ss",
10626 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10627 NULL, HFILL }
10628 },
10629 { &hf_mbim_stk_pac_info_pac_support_send_ussd,
10630 { "Send USSD", "mbim.control.stk_pac_info.pac_support.send_ussd",
10631 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10632 NULL, HFILL }
10633 },
10634 { &hf_mbim_stk_pac_info_pac_support_send_short_msg,
10635 { "Send Short Message", "mbim.control.stk_pac_info.pac_support.send_short_msg",
10636 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10637 NULL, HFILL }
10638 },
10639 { &hf_mbim_stk_pac_info_pac_support_send_dtmf,
10640 { "Send DTMF", "mbim.control.stk_pac_info.pac_support.send_dtmf",
10641 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10642 NULL, HFILL }
10643 },
10644 { &hf_mbim_stk_pac_info_pac_support_launch_browser,
10645 { "Launch Browser", "mbim.control.stk_pac_info.pac_support.launch_browser",
10646 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10647 NULL, HFILL }
10648 },
10649 { &hf_mbim_stk_pac_info_pac_support_geo_loc_req,
10650 { "Geographical Location Request", "mbim.control.stk_pac_info.pac_support.geo_loc_req",
10651 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10652 NULL, HFILL }
10653 },
10654 { &hf_mbim_stk_pac_info_pac_support_play_tone,
10655 { "Play Tone", "mbim.control.stk_pac_info.pac_support.play_tone",
10656 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10657 NULL, HFILL }
10658 },
10659 { &hf_mbim_stk_pac_info_pac_support_display_text,
10660 { "Display Text", "mbim.control.stk_pac_info.pac_support.display_text",
10661 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10662 NULL, HFILL }
10663 },
10664 { &hf_mbim_stk_pac_info_pac_support_get_inkey,
10665 { "Get Inkey", "mbim.control.stk_pac_info.pac_support.get_inkey",
10666 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10667 NULL, HFILL }
10668 },
10669 { &hf_mbim_stk_pac_info_pac_support_get_input,
10670 { "Get Input", "mbim.control.stk_pac_info.pac_support.get_input",
10671 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10672 NULL, HFILL }
10673 },
10674 { &hf_mbim_stk_pac_info_pac_support_select_item,
10675 { "Select Item", "mbim.control.stk_pac_info.pac_support.select_item",
10676 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10677 NULL, HFILL }
10678 },
10679 { &hf_mbim_stk_pac_info_pac_support_set_up_menu,
10680 { "Set Up Menu", "mbim.control.stk_pac_info.pac_support.set_up_menu",
10681 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10682 NULL, HFILL }
10683 },
10684 { &hf_mbim_stk_pac_info_pac_support_prov_local_info,
10685 { "Provide Local Information", "mbim.control.stk_pac_info.pac_support.prov_local_info",
10686 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10687 NULL, HFILL }
10688 },
10689 { &hf_mbim_stk_pac_info_pac_support_timer_management,
10690 { "Timer Management", "mbim.control.stk_pac_info.pac_support.timer_management",
10691 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10692 NULL, HFILL }
10693 },
10694 { &hf_mbim_stk_pac_info_pac_support_set_up_idle_mode_text,
10695 { "Set Up Idle Mode Text", "mbim.control.stk_pac_info.pac_support.set_up_idle_mode_text",
10696 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10697 NULL, HFILL }
10698 },
10699 { &hf_mbim_stk_pac_info_pac_support_perform_card_apdu,
10700 { "Perform Card APDU", "mbim.control.stk_pac_info.pac_support.perform_card_apdu",
10701 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10702 NULL, HFILL }
10703 },
10704 { &hf_mbim_stk_pac_info_pac_support_power_on_card,
10705 { "Power On Card", "mbim.control.stk_pac_info.pac_support.power_on_card",
10706 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10707 NULL, HFILL }
10708 },
10709 { &hf_mbim_stk_pac_info_pac_support_power_off_card,
10710 { "Power Off Card", "mbim.control.stk_pac_info.pac_support.power_off_card",
10711 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10712 NULL, HFILL }
10713 },
10714 { &hf_mbim_stk_pac_info_pac_support_get_reader_status,
10715 { "Get Reader Status", "mbim.control.stk_pac_info.pac_support.get_reader_status",
10716 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10717 NULL, HFILL }
10718 },
10719 { &hf_mbim_stk_pac_info_pac_support_run_at_cmd,
10720 { "Run AT Command", "mbim.control.stk_pac_info.pac_support.run_at_cmd",
10721 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10722 NULL, HFILL }
10723 },
10724 { &hf_mbim_stk_pac_info_pac_support_lang_notif,
10725 { "Language Notification", "mbim.control.stk_pac_info.pac_support.lang_notif",
10726 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10727 NULL, HFILL }
10728 },
10729 { &hf_mbim_stk_pac_info_pac_support_open_channel,
10730 { "Open Channel", "mbim.control.stk_pac_info.pac_support.open_channel",
10731 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10732 NULL, HFILL }
10733 },
10734 { &hf_mbim_stk_pac_info_pac_support_close_channel,
10735 { "Close Channel", "mbim.control.stk_pac_info.pac_support.close_channel",
10736 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10737 NULL, HFILL }
10738 },
10739 { &hf_mbim_stk_pac_info_pac_support_receive_data,
10740 { "Receive Data", "mbim.control.stk_pac_info.pac_support.receive_data",
10741 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10742 NULL, HFILL }
10743 },
10744 { &hf_mbim_stk_pac_info_pac_support_send_data,
10745 { "Send Data", "mbim.control.stk_pac_info.pac_support.send_data",
10746 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10747 NULL, HFILL }
10748 },
10749 { &hf_mbim_stk_pac_info_pac_support_get_channel_status,
10750 { "Get Channel Status", "mbim.control.stk_pac_info.pac_support.get_channel_status",
10751 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10752 NULL, HFILL }
10753 },
10754 { &hf_mbim_stk_pac_info_pac_support_service_search,
10755 { "Service Search", "mbim.control.stk_pac_info.pac_support.service_search",
10756 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10757 NULL, HFILL }
10758 },
10759 { &hf_mbim_stk_pac_info_pac_support_get_service_info,
10760 { "Get Service Information", "mbim.control.stk_pac_info.pac_support.get_service_info",
10761 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10762 NULL, HFILL }
10763 },
10764 { &hf_mbim_stk_pac_info_pac_support_declare_service,
10765 { "Declare Service", "mbim.control.stk_pac_info.pac_support.declare_service",
10766 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10767 NULL, HFILL }
10768 },
10769 { &hf_mbim_stk_pac_info_pac_support_set_frames,
10770 { "Set Frames", "mbim.control.stk_pac_info.pac_support.set_frames",
10771 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10772 NULL, HFILL }
10773 },
10774 { &hf_mbim_stk_pac_info_pac_support_get_frames_status,
10775 { "Get Frames Status", "mbim.control.stk_pac_info.pac_support.get_frames_status",
10776 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10777 NULL, HFILL }
10778 },
10779 { &hf_mbim_stk_pac_info_pac_support_retrieve_multimedia_msg,
10780 { "Retrieve Multimedia Message", "mbim.control.stk_pac_info.pac_support.retrieve_multimedia_msg",
10781 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10782 NULL, HFILL }
10783 },
10784 { &hf_mbim_stk_pac_info_pac_support_submit_multimedia_msg,
10785 { "Submit Multimedia Message", "mbim.control.stk_pac_info.pac_support.submit_multimedia_msg",
10786 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10787 NULL, HFILL }
10788 },
10789 { &hf_mbim_stk_pac_info_pac_support_display_multimedia_msg,
10790 { "Display Multimedia Message", "mbim.control.stk_pac_info.pac_support.display_multimedia_msg",
10791 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10792 NULL, HFILL }
10793 },
10794 { &hf_mbim_stk_pac_info_pac_support_activate,
10795 { "Activate", "mbim.control.stk_pac_info.pac_support.activate",
10796 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10797 NULL, HFILL }
10798 },
10799 { &hf_mbim_stk_pac_info_pac_support_contactless_state_changed,
10800 { "Contactless State Changed", "mbim.control.stk_pac_info.pac_support.contactless_state_changed",
10801 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10802 NULL, HFILL }
10803 },
10804 { &hf_mbim_stk_pac_info_pac_support_cmd_container,
10805 { "Command Container", "mbim.control.stk_pac_info.pac_support.cmd_container",
10806 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10807 NULL, HFILL }
10808 },
10809 { &hf_mbim_stk_pac_info_pac_support_encapsulated_session_ctrl,
10810 { "Encapsulated Session Control", "mbim.control.stk_pac_info.pac_support.encapsulated_session_ctrl",
10811 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10812 NULL, HFILL }
10813 },
10814 { &hf_mbim_stk_pac_info_pac_support_end_proact_session,
10815 { "End Proactive Session", "mbim.control.stk_pac_info.pac_support.end_proact_session",
10816 FT_UINT8, BASE_DEC, VALS(mbim_stk_pac_profile_vals), 0,
10817 NULL, HFILL }
10818 },
10819 { &hf_mbim_stk_pac_pac_type,
10820 { "PAC Type", "mbim.control.stk_pac.pac_type",
10821 FT_UINT32, BASE_DEC, VALS(mbim_stk_pac_type_vals), 0,
10822 NULL, HFILL }
10823 },
10824 { &hf_mbim_stk_pac_pac,
10825 { "PAC", "mbim.control.stk_pac.pac",
10826 FT_BYTES, BASE_NONE, NULL, 0,
10827 NULL, HFILL }
10828 },
10829 { &hf_mbim_set_stk_terminal_response_response_length,
10830 { "Response Length", "mbim.control.set_stk_terminal_response.response_length",
10831 FT_UINT32, BASE_DEC, NULL, 0,
10832 NULL, HFILL }
10833 },
10834 { &hf_mbim_set_stk_terminal_response_data_buffer,
10835 { "Data Buffer", "mbim.control.set_stk_terminal_response.data_buffer",
10836 FT_BYTES, BASE_NONE, NULL, 0,
10837 NULL, HFILL }
10838 },
10839 { &hf_mbim_stk_terminal_response_info_result_data_string_offset,
10840 { "Result Data String Offset", "mbim.control.stk_terminal_response_info.result_data_string.offset",
10841 FT_UINT32, BASE_DEC, NULL, 0,
10842 NULL, HFILL }
10843 },
10844 { &hf_mbim_stk_terminal_response_info_result_data_string_length,
10845 { "Result Data String Length", "mbim.control.stk_terminal_response_info.result_data_string.length",
10846 FT_UINT32, BASE_DEC, NULL, 0,
10847 NULL, HFILL }
10848 },
10849 { &hf_mbim_stk_terminal_response_info_status_word,
10850 { "Status Word", "mbim.control.stk_terminal_response_info.status_word",
10851 FT_UINT32, BASE_HEX, NULL, 0,
10852 NULL, HFILL }
10853 },
10854 { &hf_mbim_stk_terminal_response_info_result_data_string,
10855 { "Result Data String", "mbim.control.stk_terminal_response_info.result_data_string",
10856 FT_BYTES, BASE_NONE, NULL, 0,
10857 NULL, HFILL }
10858 },
10859 { &hf_mbim_set_stk_envelope_data_buffer,
10860 { "Data Buffer", "mbim.control.set_stk_envelope.data_buffer",
10861 FT_BYTES, BASE_NONE, NULL, 0,
10862 NULL, HFILL }
10863 },
10864 { &hf_mbim_stk_envelope_info_envelope_support,
10865 { "Envelope Support", "mbim.control.stk_envelope_info.envelope_support",
10866 FT_BYTES, BASE_NONE, NULL, 0,
10867 NULL, HFILL }
10868 },
10869 { &hf_mbim_aka_auth_req_rand,
10870 { "RAND", "mbim.control.aka_auth_req.rand",
10871 FT_BYTES, BASE_NONE, NULL, 0,
10872 NULL, HFILL }
10873 },
10874 { &hf_mbim_aka_auth_req_autn,
10875 { "AUTN", "mbim.control.aka_auth_req.autn",
10876 FT_BYTES, BASE_NONE, NULL, 0,
10877 NULL, HFILL }
10878 },
10879 { &hf_mbim_aka_auth_info_res,
10880 { "RES", "mbim.control.aka_auth_info.res",
10881 FT_BYTES, BASE_NONE, NULL, 0,
10882 NULL, HFILL }
10883 },
10884 { &hf_mbim_aka_auth_info_res_length,
10885 { "RES Length", "mbim.control.aka_auth_info.res_length",
10886 FT_UINT32, BASE_DEC, NULL, 0,
10887 NULL, HFILL }
10888 },
10889 { &hf_mbim_aka_auth_info_ik,
10890 { "IK", "mbim.control.aka_auth_info.ik",
10891 FT_BYTES, BASE_NONE, NULL, 0,
10892 NULL, HFILL }
10893 },
10894 { &hf_mbim_aka_auth_info_ck,
10895 { "CK", "mbim.control.aka_auth_info.ck",
10896 FT_BYTES, BASE_NONE, NULL, 0,
10897 NULL, HFILL }
10898 },
10899 { &hf_mbim_aka_auth_info_auts,
10900 { "AUTS", "mbim.control.aka_auth_info.auts",
10901 FT_BYTES, BASE_NONE, NULL, 0,
10902 NULL, HFILL }
10903 },
10904 { &hf_mbim_akap_auth_req_rand,
10905 { "RAND", "mbim.control.akap_auth_req.rand",
10906 FT_BYTES, BASE_NONE, NULL, 0,
10907 NULL, HFILL }
10908 },
10909 { &hf_mbim_akap_auth_req_autn,
10910 { "AUTN", "mbim.control.akap_auth_req.autn",
10911 FT_BYTES, BASE_NONE, NULL, 0,
10912 NULL, HFILL }
10913 },
10914 { &hf_mbim_akap_auth_req_network_name_offset,
10915 { "Network Name Offset", "mbim.control.akap_auth_req.network_name.offset",
10916 FT_UINT32, BASE_DEC, NULL, 0,
10917 NULL, HFILL }
10918 },
10919 { &hf_mbim_akap_auth_req_network_name_length,
10920 { "Network Name Length", "mbim.control.akap_auth_req.network_name.length",
10921 FT_UINT32, BASE_DEC, NULL, 0,
10922 NULL, HFILL }
10923 },
10924 { &hf_mbim_akap_auth_req_network_name,
10925 { "Network Name", "mbim.control.akap_auth_req.network_name",
10926 FT_STRING, BASE_NONE, NULL, 0,
10927 NULL, HFILL }
10928 },
10929 { &hf_mbim_akap_auth_info_res,
10930 { "RES", "mbim.control.akap_auth_info.res",
10931 FT_BYTES, BASE_NONE, NULL, 0,
10932 NULL, HFILL }
10933 },
10934 { &hf_mbim_akap_auth_info_res_length,
10935 { "RES Length", "mbim.control.akap_auth_info.res_length",
10936 FT_UINT32, BASE_DEC, NULL, 0,
10937 NULL, HFILL }
10938 },
10939 { &hf_mbim_akap_auth_info_ik,
10940 { "IK", "mbim.control.akap_auth_info.ik",
10941 FT_BYTES, BASE_NONE, NULL, 0,
10942 NULL, HFILL }
10943 },
10944 { &hf_mbim_akap_auth_info_ck,
10945 { "CK", "mbim.control.akap_auth_info.ck",
10946 FT_BYTES, BASE_NONE, NULL, 0,
10947 NULL, HFILL }
10948 },
10949 { &hf_mbim_akap_auth_info_auts,
10950 { "AUTS", "mbim.control.akap_auth_info.auts",
10951 FT_BYTES, BASE_NONE, NULL, 0,
10952 NULL, HFILL }
10953 },
10954 { &hf_mbim_sim_auth_req_rand1,
10955 { "RAND1", "mbim.control.sim_auth_req.rand1",
10956 FT_BYTES, BASE_NONE, NULL, 0,
10957 NULL, HFILL }
10958 },
10959 { &hf_mbim_sim_auth_req_rand2,
10960 { "RAND2", "mbim.control.sim_auth_req.rand2",
10961 FT_BYTES, BASE_NONE, NULL, 0,
10962 NULL, HFILL }
10963 },
10964 { &hf_mbim_sim_auth_req_rand3,
10965 { "RAND3", "mbim.control.sim_auth_req.rand3",
10966 FT_BYTES, BASE_NONE, NULL, 0,
10967 NULL, HFILL }
10968 },
10969 { &hf_mbim_sim_auth_req_n,
10970 { "n", "mbim.control.sim_auth_req.n",
10971 FT_UINT32, BASE_DEC, NULL, 0,
10972 NULL, HFILL }
10973 },
10974 { &hf_mbim_sim_auth_info_sres1,
10975 { "SRES1", "mbim.control.sim_auth_info.sres1",
10976 FT_UINT32, BASE_HEX, NULL, 0,
10977 NULL, HFILL }
10978 },
10979 { &hf_mbim_sim_auth_info_kc1,
10980 { "KC1", "mbim.control.sim_auth_info.kc1",
10981 FT_UINT64, BASE_HEX, NULL, 0,
10982 NULL, HFILL }
10983 },
10984 { &hf_mbim_sim_auth_info_sres2,
10985 { "SRES2", "mbim.control.sim_auth_info.sres2",
10986 FT_UINT32, BASE_HEX, NULL, 0,
10987 NULL, HFILL }
10988 },
10989 { &hf_mbim_sim_auth_info_kc2,
10990 { "KC2", "mbim.control.sim_auth_info.kc2",
10991 FT_UINT64, BASE_HEX, NULL, 0,
10992 NULL, HFILL }
10993 },
10994 { &hf_mbim_sim_auth_info_sres3,
10995 { "SRES3", "mbim.control.sim_auth_info.sres3",
10996 FT_UINT32, BASE_HEX, NULL, 0,
10997 NULL, HFILL }
10998 },
10999 { &hf_mbim_sim_auth_info_kc3,
11000 { "KC3", "mbim.control.sim_auth_info.kc3",
11001 FT_UINT64, BASE_HEX, NULL, 0,
11002 NULL, HFILL }
11003 },
11004 { &hf_mbim_sim_auth_info_n,
11005 { "n", "mbim.control.sim_auth_info.n",
11006 FT_UINT32, BASE_DEC, NULL, 0,
11007 NULL, HFILL }
11008 },
11009 { &hf_mbim_set_dss_connect_device_service_id,
11010 { "Device Service Id", "mbim.control.set_dss_connect.device_service_id",
11011 FT_GUID, BASE_NONE, NULL, 0,
11012 NULL, HFILL }
11013 },
11014 { &hf_mbim_set_dss_connect_dss_session_id,
11015 { "DSS Session Id", "mbim.control.set_dss_connect.dss_session_id",
11016 FT_UINT32, BASE_DEC, NULL, 0,
11017 NULL, HFILL }
11018 },
11019 { &hf_mbim_set_dss_connect_dss_link_state,
11020 { "DSS Link State", "mbim.control.set_dss_connect.dss_link_state",
11021 FT_UINT32, BASE_DEC, VALS(mbim_dss_link_state_vals), 0,
11022 NULL, HFILL }
11023 },
11024 { &hf_mbim_multicarrier_capabilities_info_capabilities,
11025 { "Capabilities", "mbim.control.multicarrier_capabilities_info.capabilities",
11026 FT_UINT32, BASE_HEX, NULL, 0,
11027 NULL, HFILL }
11028 },
11029 { &hf_mbim_multicarrier_capabilities_info_capabilities_static_scan,
11030 { "Static Scan", "mbim.control.multicarrier_capabilities_info.capabilities.static_scan",
11031 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
11032 NULL, HFILL }
11033 },
11034 { &hf_mbim_multicarrier_capabilities_info_capabilities_fw_requires_reboot,
11035 { "FW Requires Reboot", "mbim.control.multicarrier_capabilities_info.capabilities.fw_requires_reboot",
11036 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
11037 NULL, HFILL }
11038 },
11039 { &hf_mbim_location_info_country,
11040 { "Country", "mbim.control.location_info.country",
11041 FT_UINT32, BASE_HEX|BASE_EXT_STRING, &mbim_geoid_vals_ext, 0,
11042 NULL, HFILL }
11043 },
11044 { &hf_mbim_multicarrier_current_cid_list_req_uuid,
11045 { "UUID", "mbim.control.multicarrier_current_cid_list_req.uuid",
11046 FT_GUID, BASE_NONE, NULL, 0,
11047 NULL, HFILL }
11048 },
11049 { &hf_mbim_multicarrier_current_cid_list_info_cid_count,
11050 { "CID Count", "mbim.control.multicarrier_current_cid_list_info.cid_count",
11051 FT_UINT32, BASE_DEC, NULL, 0,
11052 NULL, HFILL }
11053 },
11054 { &hf_mbim_multicarrier_current_cid_list_info_cid,
11055 { "CID", "mbim.control.multicarrier_current_cid_list_info.cid",
11056 FT_UINT32, BASE_DEC, VALS(mbim_uuid_multicarrier_cid_vals), 0,
11057 NULL, HFILL }
11058 },
11059 { &hf_mbim_msfwid_firmwareid_info_firmware_id,
11060 { "Firmware Id", "mbim.control.msfwid_firmwareid_info.firmware_id",
11061 FT_GUID, BASE_NONE, NULL, 0,
11062 NULL, HFILL }
11063 },
11064 { &hf_mbim_qmi_buffer,
11065 { "Buffer", "mbim.control.qmi.buffer",
11066 FT_BYTES, BASE_NONE, NULL, 0,
11067 NULL, HFILL }
11068 },
11069 { &hf_mbim_thermal_config_enable,
11070 { "Enable", "mbim.control.thermal_config.enable",
11071 FT_UINT32, BASE_DEC, VALS(mbim_thermal_config_enable_vals), 0,
11072 NULL, HFILL }
11073 },
11074 { &hf_mbim_thermal_config_temp_sensor_id,
11075 { "Temperature Sensor ID", "mbim.control.thermal_config.temp_sensor_id",
11076 FT_UINT32, BASE_DEC, NULL, 0,
11077 NULL, HFILL }
11078 },
11079 { &hf_mbim_thermal_config_alarm_id,
11080 { "Alarm ID", "mbim.control.thermal_config.alarm_id",
11081 FT_UINT32, BASE_DEC, NULL, 0,
11082 NULL, HFILL }
11083 },
11084 { &hf_mbim_thermal_config_threshold_value,
11085 { "Threshold Value", "mbim.control.thermal_config.threshold_value",
11086 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_degrees_fmt), 0,
11087 NULL, HFILL }
11088 },
11089 { &hf_mbim_thermal_config_hyst_value,
11090 { "Hysteresis Value", "mbim.control.thermal_config.hyst_value",
11091 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_degrees_fmt), 0,
11092 NULL, HFILL }
11093 },
11094 { &hf_mbim_thermal_config_sampling_period,
11095 { "Sampling Period", "mbim.control.thermal_config.sampling_period",
11096 FT_UINT32, BASE_DEC, NULL, 0,
11097 NULL, HFILL }
11098 },
11099 { &hf_mbim_query_thermal_state_temp_sensor_id,
11100 { "Temperature Sensor ID", "mbim.control.query_thermal_state.temp_sensor_id",
11101 FT_UINT32, BASE_DEC, NULL, 0,
11102 NULL, HFILL }
11103 },
11104 { &hf_mbim_thermal_state_info_current_temp_value,
11105 { "Current Temperature Value", "mbim.control.thermal_state_info.current_temp_value",
11106 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_degrees_fmt), 0,
11107 NULL, HFILL }
11108 },
11109 { &hf_mbim_thermal_state_info_enable,
11110 { "Enable", "mbim.control.thermal_state_info.enable",
11111 FT_UINT32, BASE_DEC, VALS(mbim_thermal_config_enable_vals), 0,
11112 NULL, HFILL }
11113 },
11114 { &hf_mbim_thermal_state_info_temp_sensor_id,
11115 { "Temperature Sensor ID", "mbim.control.thermal_state_info.temp_sensor_id",
11116 FT_UINT32, BASE_DEC, NULL, 0,
11117 NULL, HFILL }
11118 },
11119 { &hf_mbim_thermal_state_info_alarm_id,
11120 { "Alarm ID", "mbim.control.thermal_state_info.alarm_id",
11121 FT_UINT32, BASE_DEC, NULL, 0,
11122 NULL, HFILL }
11123 },
11124 { &hf_mbim_thermal_state_info_threshold_value,
11125 { "Threshold Value", "mbim.control.thermal_state_info.threshold_value",
11126 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_degrees_fmt), 0,
11127 NULL, HFILL }
11128 },
11129 { &hf_mbim_thermal_state_info_hyst_value,
11130 { "Hysteresis Value", "mbim.control.thermal_state_info.hyst_value",
11131 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_degrees_fmt), 0,
11132 NULL, HFILL }
11133 },
11134 { &hf_mbim_thermal_state_info_sampling_period,
11135 { "Sampling Period", "mbim.control.thermal_state_info.sampling_period",
11136 FT_UINT32, BASE_DEC, NULL, 0,
11137 NULL, HFILL }
11138 },
11139 { &hf_mbim_sar_config_sar_status,
11140 { "SAR Status", "mbim.control.sar_config.sar_status",
11141 FT_UINT32, BASE_DEC, VALS(mbim_sar_status_vals), 0,
11142 NULL, HFILL }
11143 },
11144 { &hf_mbim_sar_config_level,
11145 { "Level", "mbim.control.sar_config.level",
11146 FT_UINT32, BASE_DEC, NULL, 0,
11147 NULL, HFILL }
11148 },
11149 { &hf_mbim_adpclk_activate_state,
11150 { "State", "mbim.control.adpclk_activate.state",
11151 FT_UINT32, BASE_DEC, VALS(mbim_adpclk_activate_state_vals), 0,
11152 NULL, HFILL }
11153 },
11154 { &hf_mbim_adpclk_freq_info_elem_count,
11155 { "Element Count", "mbim.control.adpclk_freq_info.elem_count",
11156 FT_UINT32, BASE_DEC, NULL, 0,
11157 NULL, HFILL }
11158 },
11159 { &hf_mbim_adpclk_freq_info_adpclk_freq_value_offset,
11160 { "ADPCLK Freq Value Offset", "mbim.control.adpclk_freq_info.adpclk_freq_value.offset",
11161 FT_UINT32, BASE_DEC, NULL, 0,
11162 NULL, HFILL }
11163 },
11164 { &hf_mbim_adpclk_freq_info_adpclk_freq_value_size,
11165 { "ADPCLK Freq Value Size", "mbim.control.adpclk_freq_info.adpclk_freq_value.size",
11166 FT_UINT32, BASE_DEC, NULL, 0,
11167 NULL, HFILL }
11168 },
11169 { &hf_mbim_adpclk_freq_info_adpclk_freq_value_center_freq,
11170 { "Center Frequency", "mbim.control.adpclk_freq_info.adpclk_freq_value.center_freq",
11171 FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_hz, 0,
11172 NULL, HFILL }
11173 },
11174 { &hf_mbim_adpclk_freq_info_adpclk_freq_value_freq_spread,
11175 { "Frequency Spread", "mbim.control.adpclk_freq_info.adpclk_freq_value.freq_spread",
11176 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_hz, 0,
11177 NULL, HFILL }
11178 },
11179 { &hf_mbim_adpclk_freq_info_adpclk_freq_value_noise_power,
11180 { "Noise Power", "mbim.control.adpclk_freq_info.adpclk_freq_value.noise_power",
11181 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
11182 NULL, HFILL }
11183 },
11184 { &hf_mbim_adpclk_freq_info_adpclk_freq_value_rssi,
11185 { "Relative Signal Strength Indication", "mbim.control.adpclk_freq_info.adpclk_freq_value.rssi",
11186 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
11187 NULL, HFILL }
11188 },
11189 { &hf_mbim_adpclk_freq_info_adpclk_freq_value_connect_status,
11190 { "Connect Status", "mbim.control.adpclk_freq_info.adpclk_freq_value.connect_status",
11191 FT_UINT32, BASE_DEC, VALS(mbim_connect_status_vals), 0,
11192 NULL, HFILL }
11193 },
11194 { &hf_mbim_trace_config_config,
11195 { "Configuration", "mbim.control.trace_config.config",
11196 FT_UINT32, BASE_DEC, VALS(mbim_trace_config_vals), 0,
11197 NULL, HFILL }
11198 },
11199 { &hf_mbim_nrtc_app_info_period,
11200 { "Period", "mbim.control.nrtc_app_info.period",
11201 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0,
11202 NULL, HFILL }
11203 },
11204 { &hf_mbim_nrtc_app_info_duration,
11205 { "Duration", "mbim.control.nrtc_app_info.duration",
11206 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0,
11207 NULL, HFILL }
11208 },
11209 { &hf_mbim_nrtcws_config_mode,
11210 { "Mode", "mbim.control.nrtcws_config.mode",
11211 FT_UINT16, BASE_DEC, NULL, 0,
11212 NULL, HFILL }
11213 },
11214 { &hf_mbim_nrtcws_config_wlan_active,
11215 { "WLAN Active", "mbim.control.nrtcws_config.wlan_active",
11216 FT_UINT16, BASE_DEC, NULL, 0,
11217 NULL, HFILL }
11218 },
11219 { &hf_mbim_nrtcws_config_wlan_safe_rx,
11220 { "WLAN Safe Rx", "mbim.control.nrtcws_config.wlan_safe_rx",
11221 FT_UINT16, BASE_DEC, NULL, 0,
11222 NULL, HFILL }
11223 },
11224 { &hf_mbim_nrtcws_config_wlan_bandwidth,
11225 { "WLAN Bandwidth", "mbim.control.nrtcws_config.wlan_bandwidth",
11226 FT_UINT16, BASE_DEC, NULL, 0,
11227 NULL, HFILL }
11228 },
11229 { &hf_mbim_nrtcws_config_bt_active,
11230 { "BT Active", "mbim.control.nrtcws_config.bt_active",
11231 FT_UINT16, BASE_DEC, NULL, 0,
11232 NULL, HFILL }
11233 },
11234 { &hf_mbim_nrtcws_config_bt_safe_rx,
11235 { "BT Safe Rx", "mbim.control.nrtcws_config.bt_safe_rx",
11236 FT_UINT16, BASE_DEC, NULL, 0,
11237 NULL, HFILL }
11238 },
11239 { &hf_mbim_nrtcws_info_lte_active,
11240 { "LTE Active", "mbim.control.nrtcws_info.lte_active",
11241 FT_UINT16, BASE_DEC, NULL, 0,
11242 NULL, HFILL }
11243 },
11244 { &hf_mbim_nrtcws_info_wlan_safe_rx_min,
11245 { "WLAN Safe Rx Min", "mbim.control.nrtcws_info.wlan_safe_rx_min",
11246 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_mhz, 0,
11247 NULL, HFILL }
11248 },
11249 { &hf_mbim_nrtcws_info_wlan_safe_rx_max,
11250 { "WLAN Safe Rx Max", "mbim.control.nrtcws_info.wlan_safe_rx_max",
11251 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_mhz, 0,
11252 NULL, HFILL }
11253 },
11254 { &hf_mbim_nrtcws_info_bt_safe_rx_min,
11255 { "BT Safe Rx Min", "mbim.control.nrtcws_info.bt_safe_rx_min",
11256 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_mhz, 0,
11257 NULL, HFILL }
11258 },
11259 { &hf_mbim_nrtcws_info_bt_safe_rx_max,
11260 { "BT Safe Rx Max", "mbim.control.nrtcws_info.bt_safe_rx_max",
11261 FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_mhz, 0,
11262 NULL, HFILL }
11263 },
11264 { &hf_mbim_nrtcws_info_lte_sps_period,
11265 { "LTE SPS Periodicity", "mbim.control.nrtcws_info.lte_sps_period",
11266 FT_UINT16, BASE_DEC, NULL, 0,
11267 NULL, HFILL }
11268 },
11269 { &hf_mbim_nrtcws_info_lte_sps_duration,
11270 { "LTE SPS Duration", "mbim.control.nrtcws_info.lte_sps_duration",
11271 FT_UINT16, BASE_DEC, NULL, 0,
11272 NULL, HFILL }
11273 },
11274 { &hf_mbim_nrtcws_info_lte_sps_initial_offset,
11275 { "LTE SPS Initial Offset", "mbim.control.nrtcws_info.lte_sps_initial_offset",
11276 FT_UINT16, BASE_DEC, NULL, 0,
11277 NULL, HFILL }
11278 },
11279 { &hf_mbim_usbprofile_cmd_length,
11280 { "Length", "mbim.control.usbprofile_cmd.length",
11281 FT_UINT32, BASE_DEC, NULL, 0,
11282 NULL, HFILL }
11283 },
11284 { &hf_mbim_usbprofile_cmd_buffer,
11285 { "Buffer", "mbim.control.usbprofile_cmd.buffer",
11286 FT_STRING, BASE_NONE, NULL, 0,
11287 NULL, HFILL }
11288 },
11289 { &hf_mbim_usbprofile_rsp_length,
11290 { "Length", "mbim.control.usbprofile_rsp.length",
11291 FT_UINT32, BASE_DEC, NULL, 0,
11292 NULL, HFILL }
11293 },
11294 { &hf_mbim_usbprofile_rsp_buffer,
11295 { "Buffer", "mbim.control.usbprofile_rsp.buffer",
11296 FT_STRING, BASE_NONE, NULL, 0,
11297 NULL, HFILL }
11298 },
11299 { &hf_mbim_ciq_set_mode,
11300 { "Mode", "mbim.control.ciq_set.mode",
11301 FT_UINT32, BASE_DEC, NULL, 0,
11302 NULL, HFILL }
11303 },
11304 { &hf_mbim_ciq_set_debug_info_size,
11305 { "Debug Info Size", "mbim.control.ciq_set.debug_info.size",
11306 FT_UINT32, BASE_DEC, NULL, 0,
11307 NULL, HFILL }
11308 },
11309 { &hf_mbim_ciq_set_debug_info,
11310 { "Debug Info", "mbim.control.ciq_set.debug_info",
11311 FT_STRING, BASE_NONE, NULL, 0,
11312 NULL, HFILL }
11313 },
11314 { &hf_mbim_ciq_info_mode,
11315 { "Mode", "mbim.control.ciq_info.mode",
11316 FT_UINT32, BASE_DEC, NULL, 0,
11317 NULL, HFILL }
11318 },
11319 { &hf_mbim_atds_signal_info_rssi,
11320 { "RSSI", "mbim.control.atds_signal_info.rssi",
11321 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rssi_fmt), 0,
11322 NULL, HFILL }
11323 },
11324 { &hf_mbim_atds_signal_info_ber,
11325 { "BER", "mbim.control.atds_signal_info.ber",
11326 FT_UINT32, BASE_DEC, VALS(mbim_ber_vals), 0,
11327 NULL, HFILL }
11328 },
11329 { &hf_mbim_atds_signal_info_rscp,
11330 { "RSCP", "mbim.control.atds_signal_info.rscp",
11331 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rscp_fmt), 0,
11332 NULL, HFILL }
11333 },
11334 { &hf_mbim_atds_signal_info_ecno,
11335 { "Ec/No", "mbim.control.atds_signal_info.ecno",
11336 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_ecno_fmt), 0,
11337 NULL, HFILL }
11338 },
11339 { &hf_mbim_atds_signal_info_rsrq,
11340 { "RSRQ", "mbim.control.atds_signal_info.rsrq",
11341 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rsrq_fmt), 0,
11342 NULL, HFILL }
11343 },
11344 { &hf_mbim_atds_signal_info_rsrp,
11345 { "RSRP", "mbim.control.atds_signal_info.rsrp",
11346 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rsrp_fmt), 0,
11347 NULL, HFILL }
11348 },
11349 { &hf_mbim_atds_signal_info_rssnr,
11350 { "RS SNR", "mbim.control.atds_signal_info.rssnr",
11351 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rssnr_fmt), 0,
11352 NULL, HFILL }
11353 },
11354 { &hf_mbim_atds_location_info_lac,
11355 { "Location Area Code", "mbim.control.atds_location_info.lac",
11356 FT_UINT32, BASE_HEX_DEC, NULL, 0,
11357 NULL, HFILL }
11358 },
11359 { &hf_mbim_atds_location_info_tac,
11360 { "Tracking Area Code", "mbim.control.atds_location_info.tac",
11361 FT_UINT32, BASE_HEX_DEC, NULL, 0,
11362 NULL, HFILL }
11363 },
11364 { &hf_mbim_atds_location_info_cellid,
11365 { "Cell Identity", "mbim.control.atds_location_info.cellid",
11366 FT_UINT32, BASE_HEX_DEC, NULL, 0,
11367 NULL, HFILL }
11368 },
11369 { &hf_mbim_atds_operator_provider_id_offset,
11370 { "Provider Id Offset", "mbim.control.atds_operator.provider_id_offset",
11371 FT_UINT32, BASE_DEC, NULL, 0,
11372 NULL, HFILL }
11373 },
11374 { &hf_mbim_atds_operator_provider_id_size,
11375 { "Provider Id Size", "mbim.control.atds_operator.provider_id_size",
11376 FT_UINT32, BASE_DEC, NULL, 0,
11377 NULL, HFILL }
11378 },
11379 { &hf_mbim_atds_operator_provider_state,
11380 { "Provider State", "mbim.control.atds_operator.provider_state",
11381 FT_UINT32, BASE_HEX, NULL, 0,
11382 NULL, HFILL }
11383 },
11384 { &hf_mbim_atds_operator_provider_name_offset,
11385 { "Provider Name Offset", "mbim.control.atds_operator.provider_name_offset",
11386 FT_UINT32, BASE_DEC, NULL, 0,
11387 NULL, HFILL }
11388 },
11389 { &hf_mbim_atds_operator_provider_name_size,
11390 { "Provider Name Size", "mbim.control.atds_operator.provider_name_size",
11391 FT_UINT32, BASE_DEC, NULL, 0,
11392 NULL, HFILL }
11393 },
11394 { &hf_mbim_atds_operator_plmn_mode,
11395 { "PLMN Mode", "mbim.control.atds_operator.plmn_mode",
11396 FT_UINT32, BASE_DEC, VALS(mbim_atds_operator_plmn_mode_vals), 0,
11397 NULL, HFILL }
11398 },
11399 { &hf_mbim_atds_operator_rssi,
11400 { "RSSI", "mbim.control.atds_operator.rssi",
11401 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_rssi_fmt), 0,
11402 NULL, HFILL }
11403 },
11404 { &hf_mbim_atds_operator_error_rate,
11405 { "Error Rate", "mbim.control.atds_operator.error_rate",
11406 FT_UINT32, BASE_DEC, VALS(mbim_error_rate_vals), 0,
11407 NULL, HFILL }
11408 },
11409 { &hf_mbim_atds_operator_provider_id,
11410 { "Provider Id", "mbim.control.atds_operator.provider_id",
11411 FT_STRING, BASE_NONE, NULL, 0,
11412 NULL, HFILL }
11413 },
11414 { &hf_mbim_atds_operator_provider_name,
11415 { "Provider Name", "mbim.control.atds_operator.provider_name",
11416 FT_STRING, BASE_NONE, NULL, 0,
11417 NULL, HFILL }
11418 },
11419 { &hf_mbim_atds_operators_elem_count,
11420 { "Element Count", "mbim.control.atds_operators.elem_count",
11421 FT_UINT32, BASE_DEC, NULL, 0,
11422 NULL, HFILL }
11423 },
11424 { &hf_mbim_atds_operators_operator_offset,
11425 { "Provider Offset", "mbim.control.atds_operators.provider_offset",
11426 FT_UINT32, BASE_DEC, NULL, 0,
11427 NULL, HFILL }
11428 },
11429 { &hf_mbim_atds_operators_operator_size,
11430 { "Provider Size", "mbim.control.atds_operators.provider_size",
11431 FT_UINT32, BASE_DEC, NULL, 0,
11432 NULL, HFILL }
11433 },
11434 { &hf_mbim_atds_rat_info_mode,
11435 { "Mode", "mbim.control.atds_rat_info.mode",
11436 FT_UINT32, BASE_DEC, VALS(mbim_adts_rat_info_mode_vals), 0,
11437 NULL, HFILL }
11438 },
11439 { &hf_mbim_atds_projection_table_type,
11440 { "Type", "mbim.control.atds_projection_table.type",
11441 FT_UINT32, BASE_DEC, VALS(mbim_adts_projection_table_type_vals), 0,
11442 NULL, HFILL }
11443 },
11444 { &hf_mbim_atds_projection_table_bar5min,
11445 { "Bar5 Min", "mbim.control.atds_projection_table.bar5min",
11446 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
11447 NULL, HFILL }
11448 },
11449 { &hf_mbim_atds_projection_table_a5,
11450 { "A5", "mbim.control.atds_projection_table.a5",
11451 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11452 NULL, HFILL }
11453 },
11454 { &hf_mbim_atds_projection_table_b5,
11455 { "B5", "mbim.control.atds_projection_table.b5",
11456 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11457 NULL, HFILL }
11458 },
11459 { &hf_mbim_atds_projection_table_bar4min,
11460 { "Bar4 Min", "mbim.control.atds_projection_table.bar4min",
11461 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
11462 NULL, HFILL }
11463 },
11464 { &hf_mbim_atds_projection_table_a4,
11465 { "A4", "mbim.control.atds_projection_table.a4",
11466 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11467 NULL, HFILL }
11468 },
11469 { &hf_mbim_atds_projection_table_b4,
11470 { "B4", "mbim.control.atds_projection_table.b4",
11471 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11472 NULL, HFILL }
11473 },
11474 { &hf_mbim_atds_projection_table_bar3min,
11475 { "Bar3 Min", "mbim.control.atds_projection_table.bar3min",
11476 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
11477 NULL, HFILL }
11478 },
11479 { &hf_mbim_atds_projection_table_a3,
11480 { "A3", "mbim.control.atds_projection_table.a3",
11481 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11482 NULL, HFILL }
11483 },
11484 { &hf_mbim_atds_projection_table_b3,
11485 { "B3", "mbim.control.atds_projection_table.b3",
11486 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11487 NULL, HFILL }
11488 },
11489 { &hf_mbim_atds_projection_table_bar2min,
11490 { "Bar2 Min", "mbim.control.atds_projection_table.bar2min",
11491 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
11492 NULL, HFILL }
11493 },
11494 { &hf_mbim_atds_projection_table_a2,
11495 { "A2", "mbim.control.atds_projection_table.a2",
11496 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11497 NULL, HFILL }
11498 },
11499 { &hf_mbim_atds_projection_table_b2,
11500 { "B2", "mbim.control.atds_projection_table.b2",
11501 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11502 NULL, HFILL }
11503 },
11504 { &hf_mbim_atds_projection_table_bar1min,
11505 { "Bar1 Min", "mbim.control.atds_projection_table.bar1min",
11506 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
11507 NULL, HFILL }
11508 },
11509 { &hf_mbim_atds_projection_table_a1,
11510 { "A1", "mbim.control.atds_projection_table.a1",
11511 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11512 NULL, HFILL }
11513 },
11514 { &hf_mbim_atds_projection_table_b1,
11515 { "B1", "mbim.control.atds_projection_table.b1",
11516 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11517 NULL, HFILL }
11518 },
11519 { &hf_mbim_atds_projection_table_bar0min,
11520 { "Bar0 Min", "mbim.control.atds_projection_table.bar0min",
11521 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
11522 NULL, HFILL }
11523 },
11524 { &hf_mbim_atds_projection_table_a0,
11525 { "A0", "mbim.control.atds_projection_table.a0",
11526 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11527 NULL, HFILL }
11528 },
11529 { &hf_mbim_atds_projection_table_b0,
11530 { "B0", "mbim.control.atds_projection_table.b0",
11531 FT_UINT32, BASE_CUSTOM, CF_FUNC(mbim_projection_table_coeff_fmt), 0,
11532 NULL, HFILL }
11533 },
11534 { &hf_mbim_atds_projection_tables_elem_count,
11535 { "Element Count", "mbim.control.atds_projection_tables.elem_count",
11536 FT_UINT32, BASE_DEC, NULL, 0,
11537 NULL, HFILL }
11538 },
11539 { &hf_mbim_atds_projection_tables_projection_table_offset,
11540 { "Projection Table Offset", "mbim.control.atds_projection_tables.projection_table_offset",
11541 FT_UINT32, BASE_DEC, NULL, 0,
11542 NULL, HFILL }
11543 },
11544 { &hf_mbim_atds_projection_tables_projection_table_size,
11545 { "Projection Table Size", "mbim.control.atds_projection_tables.projection_table_size",
11546 FT_UINT32, BASE_DEC, NULL, 0,
11547 NULL, HFILL }
11548 },
11549 { &hf_mbim_multiflow_caps_info_control_caps,
11550 { "Control Caps", "mbim.control.multiflow_caps_info.control_caps",
11551 FT_UINT32, BASE_HEX, NULL, 0,
11552 NULL, HFILL }
11553 },
11554 { &hf_mbim_multiflow_caps_info_control_caps_uplink,
11555 { "Uplink", "mbim.control.multiflow_caps_info.control_caps.uplink",
11556 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
11557 NULL, HFILL }
11558 },
11559 { &hf_mbim_multiflow_caps_info_control_caps_downlink,
11560 { "Downlink", "mbim.control.multiflow_caps_info.control_caps.downlink",
11561 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
11562 NULL, HFILL }
11563 },
11564 { &hf_mbim_set_multiflow_state_state,
11565 { "State", "mbim.control.set_multiflow_state.state",
11566 FT_UINT32, BASE_DEC, VALS(mbim_multiflow_state_vals), 0,
11567 NULL, HFILL }
11568 },
11569 { &hf_mbim_multiflow_state_info_state,
11570 { "State", "mbim.control.multiflow_state_info.state",
11571 FT_UINT32, BASE_DEC, VALS(mbim_multiflow_state_vals), 0,
11572 NULL, HFILL }
11573 },
11574 { &hf_mbim_multiflow_tft_info_session_id,
11575 { "Session Id", "mbim.control.multiflow_tft_info.session_id",
11576 FT_UINT32, BASE_DEC, NULL, 0,
11577 NULL, HFILL }
11578 },
11579 { &hf_mbim_multiflow_tft_info_elem_count,
11580 { "Element Count", "mbim.control.multiflow_tft_info.elem_count",
11581 FT_UINT32, BASE_DEC, NULL, 0,
11582 NULL, HFILL }
11583 },
11584 { &hf_mbim_multiflow_tft_info_tft_list_offset,
11585 { "TFT List Offset", "mbim.control.multiflow_tft_info.tft_list_offset",
11586 FT_UINT32, BASE_DEC, NULL, 0,
11587 NULL, HFILL }
11588 },
11589 { &hf_mbim_multiflow_tft_info_tft_list_size,
11590 { "TFT List Size", "mbim.control.multiflow_tft_info.tft_list_size",
11591 FT_UINT32, BASE_DEC, NULL, 0,
11592 NULL, HFILL }
11593 },
11594 { &hf_mbim_set_ms_provisioned_context_v2_operation,
11595 { "Operation", "mbim.control.set_ms_provisioned_context_v2.operation",
11596 FT_UINT32, BASE_DEC, VALS(mbim_ms_context_operations_vals), 0,
11597 NULL, HFILL }
11598 },
11599 { &hf_mbim_set_ms_provisioned_context_v2_ip_type,
11600 { "IP Type", "mbim.control.set_ms_provisioned_context_v2.ip_type",
11601 FT_UINT32, BASE_DEC, VALS(mbim_context_ip_type_vals), 0,
11602 NULL, HFILL }
11603 },
11604 { &hf_mbim_set_ms_provisioned_context_v2_enable,
11605 { "Enable", "mbim.control.set_ms_provisioned_context_v2.enable",
11606 FT_UINT32, BASE_DEC, VALS(mbim_ms_context_enable_vals), 0,
11607 NULL, HFILL }
11608 },
11609 { &hf_mbim_set_ms_provisioned_context_v2_roaming,
11610 { "Roaming", "mbim.control.set_ms_provisioned_context_v2.roaming",
11611 FT_UINT32, BASE_DEC, VALS(mbim_ms_context_roaming_control_vals), 0,
11612 NULL, HFILL }
11613 },
11614 { &hf_mbim_set_ms_provisioned_context_v2_media_type,
11615 { "Media Type", "mbim.control.set_ms_provisioned_context_v2.media_type",
11616 FT_UINT32, BASE_DEC, VALS(mbim_ms_context_media_type_vals), 0,
11617 NULL, HFILL }
11618 },
11619 { &hf_mbim_set_ms_provisioned_context_v2_source,
11620 { "Source", "mbim.control.set_ms_provisioned_context_v2.source",
11621 FT_UINT32, BASE_DEC, VALS(mbim_ms_context_source_vals), 0,
11622 NULL, HFILL }
11623 },
11624 { &hf_mbim_set_ms_provisioned_context_v2_access_string,
11625 { "Access String", "mbim.control.set_ms_provisioned_context_v2.access_string",
11626 FT_STRING, BASE_NONE, NULL, 0,
11627 NULL, HFILL }
11628 },
11629 { &hf_mbim_set_ms_provisioned_context_v2_access_string_offset,
11630 { "Access String Offset", "mbim.control.set_ms_provisioned_context_v2.access_string_offset",
11631 FT_UINT32, BASE_DEC, NULL, 0,
11632 NULL, HFILL }
11633 },
11634 { &hf_mbim_set_ms_provisioned_context_v2_access_string_size,
11635 { "Access String Size", "mbim.control.set_ms_provisioned_context_v2.access_string_size",
11636 FT_UINT32, BASE_DEC, NULL, 0,
11637 NULL, HFILL }
11638 },
11639 { &hf_mbim_set_ms_provisioned_context_v2_user_name,
11640 { "User Name", "mbim.control.set_ms_provisioned_context_v2.user_name",
11641 FT_STRING, BASE_NONE, NULL, 0,
11642 NULL, HFILL }
11643 },
11644 { &hf_mbim_set_ms_provisioned_context_v2_user_name_offset,
11645 { "User Name Offset", "mbim.control.set_ms_provisioned_context_v2.user_name_offset",
11646 FT_UINT32, BASE_DEC, NULL, 0,
11647 NULL, HFILL }
11648 },
11649 { &hf_mbim_set_ms_provisioned_context_v2_user_name_size,
11650 { "User Name Size", "mbim.control.set_ms_provisioned_context_v2.user_name_size",
11651 FT_UINT32, BASE_DEC, NULL, 0,
11652 NULL, HFILL }
11653 },
11654 { &hf_mbim_set_ms_provisioned_context_v2_password,
11655 { "Password", "mbim.control.set_ms_provisioned_context_v2.password",
11656 FT_STRING, BASE_NONE, NULL, 0,
11657 NULL, HFILL }
11658 },
11659 { &hf_mbim_set_ms_provisioned_context_v2_password_offset,
11660 { "Password Offset", "mbim.control.set_ms_provisioned_context_v2.password_offset",
11661 FT_UINT32, BASE_DEC, NULL, 0,
11662 NULL, HFILL }
11663 },
11664 { &hf_mbim_set_ms_provisioned_context_v2_password_size,
11665 { "Password Size", "mbim.control.set_ms_provisioned_context_v2.password_size",
11666 FT_UINT32, BASE_DEC, NULL, 0,
11667 NULL, HFILL }
11668 },
11669 { &hf_mbim_set_ms_provisioned_context_v2_compression,
11670 { "Compression", "mbim.control.set_ms_provisioned_context_v2.compression",
11671 FT_UINT32, BASE_DEC, VALS(mbim_compression_vals), 0,
11672 NULL, HFILL }
11673 },
11674 { &hf_mbim_set_ms_provisioned_context_v2_auth_protocol,
11675 { "Auth Protocol", "mbim.control.set_ms_provisioned_context_v2.auth_protocol",
11676 FT_UINT32, BASE_DEC, VALS(mbim_auth_protocol_vals), 0,
11677 NULL, HFILL }
11678 },
11679 { &hf_mbim_ms_provisioned_context_info_v2_elem_count,
11680 { "Element Count", "mbim.control.ms_provisioned_context_info_v2.auth_protocol",
11681 FT_UINT32, BASE_DEC, NULL, 0,
11682 NULL, HFILL }
11683 },
11684 { &hf_mbim_ms_provisioned_context_info_v2_list_offset,
11685 { "Item Offset", "mbim.control.ms_provisioned_context_info_v2.list_offset",
11686 FT_UINT32, BASE_DEC, NULL, 0,
11687 NULL, HFILL }
11688 },
11689 { &hf_mbim_ms_provisioned_context_info_v2_list_size,
11690 { "Item Size", "mbim.control.ms_provisioned_context_info_v2.list_size",
11691 FT_UINT32, BASE_DEC, NULL, 0,
11692 NULL, HFILL }
11693 },
11694 { &hf_mbim_ms_provisioned_context_info_v2_context_id,
11695 { "Context ID", "mbim.control.ms_provisioned_context_info_v2.context_id",
11696 FT_UINT32, BASE_DEC, NULL, 0,
11697 NULL, HFILL }
11698 },
11699 { &hf_mbim_ms_network_blacklist_state_sim_provider_actuated,
11700 { "SIM Provide Actuated", "mbim.control.ms_provisioned_context_info_v2.sim_provider_actuated",
11701 FT_BOOLEAN, 32, TFS(&tfs_activated_deactivated), 0x00000001,
11702 NULL, HFILL }
11703 },
11704 { &hf_mbim_ms_network_blacklist_state_network_provider_actuated,
11705 { "Network Provider Actuated", "mbim.control.ms_provisioned_context_info_v2.network_provider_actuated",
11706 FT_BOOLEAN, 32, TFS(&tfs_activated_deactivated), 0x00000002,
11707 NULL, HFILL }
11708 },
11709 { &hf_mbim_ms_network_blacklist_info_blacklist_state,
11710 { "Blacklist State", "mbim.control.mbim_ms_network_blacklist_info.blacklist_state",
11711 FT_UINT32, BASE_DEC, NULL, 0,
11712 NULL, HFILL }
11713 },
11714 { &hf_mbim_ms_network_blacklist_info_elem_count,
11715 { "Element Count", "mbim.control.mbim_ms_network_blacklist_info.elem_count",
11716 FT_UINT32, BASE_DEC, NULL, 0,
11717 NULL, HFILL }
11718 },
11719 { &hf_mbim_ms_network_blacklist_info_list_offset,
11720 { "Provider Blacklist Offset", "mbim.control.mbim_ms_network_blacklist_info.item_offset",
11721 FT_UINT32, BASE_DEC, NULL, 0,
11722 NULL, HFILL }
11723 },
11724 { &hf_mbim_ms_network_blacklist_info_list_size,
11725 { "Provider Blacklist Size", "mbim.control.mbim_ms_network_blacklist_info.item_size",
11726 FT_UINT32, BASE_DEC, NULL, 0,
11727 NULL, HFILL }
11728 },
11729 { &hf_mbim_ms_network_blacklist_provider_mcc,
11730 { "MCC", "mbim.control.ms_network_blacklist_provider.mcc",
11731 FT_UINT32, BASE_DEC, NULL, 0,
11732 NULL, HFILL }
11733 },
11734 { &hf_mbim_ms_network_blacklist_provider_mnc,
11735 { "MNC", "mbim.control.ms_network_blacklist_provider.mnc",
11736 FT_UINT32, BASE_DEC, NULL, 0,
11737 NULL, HFILL }
11738 },
11739 { &hf_mbim_ms_network_blacklist_provider_type,
11740 { "Blacklist Type", "mbim.control.ms_network_blacklist_provider.blacklist_type",
11741 FT_UINT32, BASE_DEC, VALS(mbim_ms_network_blacklist_type_vals), 0,
11742 NULL, HFILL }
11743 },
11744 { &hf_mbim_sys_caps_info_number_of_executors,
11745 { "Number of Executors", "mbim.control.sys_caps_info.number_of_executors",
11746 FT_UINT32, BASE_DEC, NULL, 0,
11747 NULL, HFILL }
11748 },
11749 { &hf_mbim_sys_caps_info_number_of_slots,
11750 { "Number of Slots", "mbim.control.sys_caps_info.number_of_slots",
11751 FT_UINT32, BASE_DEC, NULL, 0,
11752 NULL, HFILL }
11753 },
11754 { &hf_mbim_sys_caps_info_concurrency,
11755 { "Concurrency", "mbim.control.sys_caps_info.concurrency",
11756 FT_UINT32, BASE_DEC, NULL, 0,
11757 NULL, HFILL }
11758 },
11759 { &hf_mbim_sys_caps_info_modem_id,
11760 { "Modem Id", "mbim.control.sys_caps_info.modem_id",
11761 FT_UINT64, BASE_HEX, NULL, 0,
11762 NULL, HFILL }
11763 },
11764 { &hf_mbim_ms_device_slot_mapping_info_map_count,
11765 { "Map Count", "mbim.control.ms_device_slot_mapping_info.map_count",
11766 FT_UINT32, BASE_DEC, NULL, 0,
11767 NULL, HFILL }
11768 },
11769 { &hf_mbim_ms_device_slot_mapping_info_map_offset,
11770 { "Slot Map Offset", "mbim.control.ms_device_slot_mapping_info.map_offset",
11771 FT_UINT32, BASE_DEC, NULL, 0,
11772 NULL, HFILL }
11773 },
11774 { &hf_mbim_ms_device_slot_mapping_info_map_size,
11775 { "Slot Map Size", "mbim.control.ms_device_slot_mapping_info.map_size",
11776 FT_UINT32, BASE_DEC, NULL, 0,
11777 NULL, HFILL }
11778 },
11779 { &hf_mbim_ms_device_slot_mapping_info_executor_slot_index,
11780 { "Slot Index", "mbim.control.ms_device_slot_mapping_info.slot_index",
11781 FT_UINT32, BASE_DEC, NULL, 0,
11782 NULL, HFILL }
11783 },
11784 { &hf_mbim_ms_slot_info_req_slot_index,
11785 { "Slot Index", "mbim.control.ms_slot_info_req.slot_index",
11786 FT_UINT32, BASE_DEC, NULL, 0,
11787 NULL, HFILL }
11788 },
11789 { &hf_mbim_ms_slot_info_slot_index,
11790 { "Slot Index", "mbim.control.ms_slot_info.slot_index",
11791 FT_UINT32, BASE_DEC, NULL, 0,
11792 NULL, HFILL }
11793 },
11794 { &hf_mbim_ms_slot_info_state,
11795 { "State", "mbim.control.ms_slot_info.state",
11796 FT_UINT32, BASE_DEC, VALS(mbim_ms_uiccslot_state_vals), 0,
11797 NULL, HFILL }
11798 },
11799 { &hf_mbim_version,
11800 { "MBIM Version", "mbim.control.bcd_mbim_version",
11801 FT_UINT16, BASE_CUSTOM, CF_FUNC(mbim_version_fmt), 0,
11802 NULL, HFILL }
11803 },
11804 { &hf_mbim_extended_version,
11805 { "MBIM Extended Version", "mbim.control.bcd_mbim_extended_version",
11806 FT_UINT16, BASE_CUSTOM, CF_FUNC(mbim_version_fmt), 0,
11807 NULL, HFILL }
11808 },
11809 { &hf_mbim_ms_modem_config_config_status,
11810 { "Config Status", "mbim.control.ms_modem_config.config_status",
11811 FT_UINT32, BASE_DEC, VALS(mbim_ms_modem_config_status_vals), 0,
11812 NULL, HFILL }
11813 },
11814 { &hf_mbim_ms_registration_params_info_mico_mode,
11815 { "Mico Mode", "mbim.control.ms_registration_params_info.mico_mode",
11816 FT_UINT32, BASE_DEC, VALS(mbim_ms_mico_mode_vals), 0,
11817 NULL, HFILL }
11818 },
11819 { &hf_mbim_ms_registration_params_info_drx_params,
11820 { "DRX Params", "mbim.control.ms_registration_params_info.drx_params",
11821 FT_UINT32, BASE_DEC, VALS(mbim_ms_drx_params_vals), 0,
11822 NULL, HFILL }
11823 },
11824 { &hf_mbim_ms_registration_params_info_ladn_info,
11825 { "LADN Info", "mbim.control.ms_registration_params_info.ladn_info",
11826 FT_UINT32, BASE_DEC, VALS(mbim_ms_ladn_ind_vals), 0,
11827 NULL, HFILL }
11828 },
11829 { &hf_mbim_ms_registration_params_info_default_pdu_hint,
11830 { "Default PDU Hint", "mbim.control.ms_registration_params_info.default_pdu_hint",
11831 FT_UINT32, BASE_DEC, VALS(mbim_ms_default_pdu_hint_vals), 0,
11832 NULL, HFILL }
11833 },
11834 { &hf_mbim_ms_registration_params_info_re_register_if_needed,
11835 { "Reregister If Needed", "mbim.control.ms_registration_params_info.re_register_if_needed",
11836 FT_UINT32, BASE_DEC, NULL, 0,
11837 NULL, HFILL }
11838 },
11839 { &hf_mbim_ms_wake_reason_wake_type,
11840 { "Wake Type", "mbim.control.ms_wake_reason.wake_type",
11841 FT_UINT32, BASE_DEC, VALS(hf_mbim_ms_wake_reason_wake_type_vals), 0,
11842 NULL, HFILL }
11843 },
11844 { &hf_mbim_ms_wake_reason_session_id,
11845 { "Session ID", "mbim.control.ms_wake_reason.session_id",
11846 FT_UINT32, BASE_DEC, NULL, 0,
11847 NULL, HFILL }
11848 },
11849 { &hf_mbim_ms_wake_reason_command_payload_offset,
11850 { "Payload Offset", "mbim.control.ms_wake_reason.command_payload_offset",
11851 FT_UINT32, BASE_DEC, NULL, 0,
11852 NULL, HFILL }
11853 },
11854 { &hf_mbim_ms_wake_reason_command_payload_size,
11855 { "Payload Size", "mbim.control.ms_wake_reason.command_payload_size",
11856 FT_UINT32, BASE_DEC, NULL, 0,
11857 NULL, HFILL }
11858 },
11859 { &hf_mbim_ms_wake_reason_command_payload,
11860 { "Payload", "mbim.control.ms_wake_reason.command_payload",
11861 FT_BYTES, BASE_NONE, NULL, 0,
11862 NULL, HFILL }
11863 },
11864 { &hf_mbim_ms_wake_reason_packet_original_size,
11865 { "Original Size", "mbim.control.ms_wake_reason.packet_original_size",
11866 FT_UINT32, BASE_DEC, NULL, 0,
11867 NULL, HFILL }
11868 },
11869 { &hf_mbim_ms_wake_reason_packet_saved_offset,
11870 { "Saved Offset", "mbim.control.ms_wake_reason.packet_saved_offset",
11871 FT_UINT32, BASE_DEC, NULL, 0,
11872 NULL, HFILL }
11873 },
11874 { &hf_mbim_ms_wake_reason_packet_saved_size,
11875 { "Saved Size", "mbim.control.ms_wake_reason.packet_saved_size",
11876 FT_UINT32, BASE_DEC, NULL, 0,
11877 NULL, HFILL }
11878 },
11879 { &hf_mbim_ms_wake_reason_packet_saved_data,
11880 { "Saved Data", "mbim.control.ms_wake_reason.packet_saved_data",
11881 FT_BYTES, BASE_NONE, NULL, 0,
11882 NULL, HFILL }
11883 },
11884 { &hf_mbim_ms_atr_info_atr_offset,
11885 { "ATR Offset", "mbim.control.ms_atr_info.atr_offset",
11886 FT_UINT32, BASE_DEC, NULL, 0,
11887 NULL, HFILL }
11888 },
11889 { &hf_mbim_ms_atr_info_atr_size,
11890 { "ATR Size", "mbim.control.ms_atr_info.atr_size",
11891 FT_UINT32, BASE_DEC, NULL, 0,
11892 NULL, HFILL }
11893 },
11894 { &hf_mbim_ms_app_info_app_type,
11895 { "App Type", "mbim.control.ms_app_info.app_type",
11896 FT_UINT32, BASE_DEC, VALS(mbim_ms_uicc_app_type_vals), 0,
11897 NULL, HFILL }
11898 },
11899 { &hf_mbim_ms_app_info_app_id_size,
11900 { "App ID Size", "mbim.control.ms_app_info.app_id_size",
11901 FT_UINT32, BASE_DEC, NULL, 0,
11902 NULL, HFILL }
11903 },
11904 { &hf_mbim_ms_app_info_app_id,
11905 { "App ID", "mbim.control.ms_app_info.app_id",
11906 FT_BYTES, BASE_NONE, NULL, 0,
11907 NULL, HFILL }
11908 },
11909 { &hf_mbim_ms_app_info_app_name_length,
11910 { "App Name Length", "mbim.control.ms_app_info.app_name_length",
11911 FT_UINT32, BASE_DEC, NULL, 0,
11912 NULL, HFILL }
11913 },
11914 { &hf_mbim_ms_app_info_app_name,
11915 { "App Name", "mbim.control.ms_app_info.app_name",
11916 FT_STRING, BASE_NONE, NULL, 0,
11917 NULL, HFILL }
11918 },
11919 { &hf_mbim_ms_app_info_num_pins,
11920 { "Num Pins", "mbim.control.ms_app_info.num_pins",
11921 FT_UINT32, BASE_DEC, NULL, 0,
11922 NULL, HFILL }
11923 },
11924 { &hf_mbim_ms_app_info_pin_ref,
11925 { "Pin Ref", "mbim.control.ms_app_info.pin_ref",
11926 FT_BYTES, BASE_NONE, NULL, 0,
11927 NULL, HFILL }
11928 },
11929 { &hf_mbim_ms_app_list_version,
11930 { "Version", "mbim.control.ms_app_list.version",
11931 FT_UINT32, BASE_DEC, NULL, 0,
11932 NULL, HFILL }
11933 },
11934 { &hf_mbim_ms_app_list_app_count,
11935 { "App Count", "mbim.control.ms_app_list.app_count",
11936 FT_UINT32, BASE_DEC, NULL, 0,
11937 NULL, HFILL }
11938 },
11939 { &hf_mbim_ms_app_list_active_app_index,
11940 { "Active App Index", "mbim.control.ms_app_list.active_app_index",
11941 FT_UINT32, BASE_DEC, NULL, 0,
11942 NULL, HFILL }
11943 },
11944 { &hf_mbim_ms_app_list_app_list_offset,
11945 { "App List Offset", "mbim.control.ms_app_list.app_list_offset",
11946 FT_UINT32, BASE_DEC, NULL, 0,
11947 NULL, HFILL }
11948 },
11949 { &hf_mbim_ms_app_list_app_list_size,
11950 { "App List Size", "mbim.control.ms_app_list.app_list_size",
11951 FT_UINT32, BASE_DEC, NULL, 0,
11952 NULL, HFILL }
11953 },
11954 { &hf_mbim_ms_file_path_version,
11955 { "Version", "mbim.control.ms_file_path.version",
11956 FT_UINT32, BASE_DEC, NULL, 0,
11957 NULL, HFILL }
11958 },
11959 { &hf_mbim_ms_file_path_app_id_offset,
11960 { "App ID Offset", "mbim.control.ms_file_path.app_id_offset",
11961 FT_UINT32, BASE_DEC, NULL, 0,
11962 NULL, HFILL }
11963 },
11964 { &hf_mbim_ms_file_path_app_id_size,
11965 { "App ID Size", "mbim.control.ms_file_path.app_id_size",
11966 FT_UINT32, BASE_DEC, NULL, 0,
11967 NULL, HFILL }
11968 },
11969 { &hf_mbim_ms_file_path_file_path_offset,
11970 { "File Path Offset", "mbim.control.ms_file_path.file_path_offset",
11971 FT_UINT32, BASE_DEC, NULL, 0,
11972 NULL, HFILL }
11973 },
11974 { &hf_mbim_ms_file_path_file_path_size,
11975 { "File Path Size", "mbim.control.ms_file_path.file_path_size",
11976 FT_UINT32, BASE_DEC, NULL, 0,
11977 NULL, HFILL }
11978 },
11979 { &hf_mbim_ms_file_path_app_id,
11980 { "App ID", "mbim.control.ms_file_path.app_id",
11981 FT_BYTES, BASE_NONE, NULL, 0,
11982 NULL, HFILL }
11983 },
11984 { &hf_mbim_ms_file_path_file_path,
11985 { "File Path", "mbim.control.ms_file_path.file_path",
11986 FT_BYTES, BASE_NONE, NULL, 0,
11987 NULL, HFILL }
11988 },
11989 { &hf_mbim_ms_file_status_version,
11990 { "Version", "mbim.control.ms_file_status.version",
11991 FT_UINT32, BASE_DEC, NULL, 0,
11992 NULL, HFILL }
11993 },
11994 { &hf_mbim_ms_file_status_status_word_1,
11995 { "Status Word 1", "mbim.control.ms_file_status.status_word_1",
11996 FT_UINT32, BASE_DEC, NULL, 0,
11997 NULL, HFILL }
11998 },
11999 { &hf_mbim_ms_file_status_status_word_2,
12000 { "Status Word 2", "mbim.control.ms_file_status.status_word_2",
12001 FT_UINT32, BASE_DEC, NULL, 0,
12002 NULL, HFILL }
12003 },
12004 { &hf_mbim_ms_file_status_file_accessibility,
12005 { "File Accessibility", "mbim.control.ms_file_status.file_accessibility",
12006 FT_UINT32, BASE_DEC, VALS(mbim_uicc_file_accessibility_vals), 0,
12007 NULL, HFILL }
12008 },
12009 { &hf_mbim_ms_file_status_file_type,
12010 { "File Type", "mbim.control.ms_file_status.file_type",
12011 FT_UINT32, BASE_DEC, VALS(mbim_uicc_file_type_vals), 0,
12012 NULL, HFILL }
12013 },
12014 { &hf_mbim_ms_file_status_file_structure,
12015 { "File Structure", "mbim.control.ms_file_status.file_structure",
12016 FT_UINT32, BASE_DEC, VALS(mbim_uicc_file_structure_vals), 0,
12017 NULL, HFILL }
12018 },
12019 { &hf_mbim_ms_file_status_item_count,
12020 { "Item Count", "mbim.control.ms_file_status.item_count",
12021 FT_UINT32, BASE_DEC, NULL, 0,
12022 NULL, HFILL }
12023 },
12024 { &hf_mbim_ms_file_status_size,
12025 { "Size", "mbim.control.ms_file_status.size",
12026 FT_UINT32, BASE_DEC, NULL, 0,
12027 NULL, HFILL }
12028 },
12029 { &hf_mbim_ms_file_status_file_lock_status,
12030 { "File Lock Status", "mbim.control.ms_file_status.file_lock_status",
12031 FT_UINT32, BASE_DEC, NULL, 0,
12032 NULL, HFILL }
12033 },
12034 { &hf_mbim_ms_response_version,
12035 { "Version", "mbim.control.ms_response.version",
12036 FT_UINT32, BASE_DEC, NULL, 0,
12037 NULL, HFILL }
12038 },
12039 { &hf_mbim_ms_response_status_word_1,
12040 { "Status Word 1", "mbim.control.ms_response.status_word_1",
12041 FT_UINT32, BASE_DEC, NULL, 0,
12042 NULL, HFILL }
12043 },
12044 { &hf_mbim_ms_response_status_word_2,
12045 { "Status Word 2", "mbim.control.ms_response.status_word_2",
12046 FT_UINT32, BASE_DEC, NULL, 0,
12047 NULL, HFILL }
12048 },
12049 { &hf_mbim_ms_response_response_data_offset,
12050 { "Data Offset", "mbim.control.ms_response.response_data_offset",
12051 FT_UINT32, BASE_DEC, NULL, 0,
12052 NULL, HFILL }
12053 },
12054 { &hf_mbim_ms_response_response_data_size,
12055 { "Data Size", "mbim.control.ms_response.response_data_size",
12056 FT_UINT32, BASE_DEC, NULL, 0,
12057 NULL, HFILL }
12058 },
12059 { &hf_mbim_ms_response_response_data,
12060 { "Response Data", "mbim.control.ms_response.response_data",
12061 FT_BYTES, BASE_NONE, NULL, 0,
12062 NULL, HFILL }
12063 },
12064 { &hf_mbim_ms_access_binary_version,
12065 { "Version", "mbim.control.ms_access_binary.version",
12066 FT_UINT32, BASE_DEC, NULL, 0,
12067 NULL, HFILL }
12068 },
12069 { &hf_mbim_ms_access_binary_app_id_offset,
12070 { "App ID Offset", "mbim.control.ms_access_binary.app_id_offset",
12071 FT_UINT32, BASE_DEC, NULL, 0,
12072 NULL, HFILL }
12073 },
12074 { &hf_mbim_ms_access_binary_app_id_size,
12075 { "App ID Size", "mbim.control.ms_access_binary.app_id_size",
12076 FT_UINT32, BASE_DEC, NULL, 0,
12077 NULL, HFILL }
12078 },
12079 { &hf_mbim_ms_access_binary_file_path_offset,
12080 { "File Path Offset", "mbim.control.ms_access_binary.file_path_offset",
12081 FT_UINT32, BASE_DEC, NULL, 0,
12082 NULL, HFILL }
12083 },
12084 { &hf_mbim_ms_access_binary_file_path_size,
12085 { "File Path Size", "mbim.control.ms_access_binary.file_path_size",
12086 FT_UINT32, BASE_DEC, NULL, 0,
12087 NULL, HFILL }
12088 },
12089 { &hf_mbim_ms_access_binary_file_offset,
12090 { "File Offset", "mbim.control.ms_access_binary.file_offset",
12091 FT_UINT32, BASE_DEC, NULL, 0,
12092 NULL, HFILL }
12093 },
12094 { &hf_mbim_ms_access_binary_number_of_bytes,
12095 { "Number of Bytes", "mbim.control.ms_access_binary.number_of_bytes",
12096 FT_UINT32, BASE_DEC, NULL, 0,
12097 NULL, HFILL }
12098 },
12099 { &hf_mbim_ms_access_binary_local_pin_offset,
12100 { "Local Pin Offset", "mbim.control.ms_access_binary.local_pin_offset",
12101 FT_UINT32, BASE_DEC, NULL, 0,
12102 NULL, HFILL }
12103 },
12104 { &hf_mbim_ms_access_binary_local_pin_size,
12105 { "Local Pin Size", "mbim.control.ms_access_binary.local_pin_size",
12106 FT_UINT32, BASE_DEC, NULL, 0,
12107 NULL, HFILL }
12108 },
12109 { &hf_mbim_ms_access_binary_binary_data_offset,
12110 { "Binary Data Offset", "mbim.control.ms_access_binary.binary_data_offset",
12111 FT_UINT32, BASE_DEC, NULL, 0,
12112 NULL, HFILL }
12113 },
12114 { &hf_mbim_ms_access_binary_binary_data_size,
12115 { "Binary Data Size", "mbim.control.ms_access_binary.binary_data_size",
12116 FT_UINT32, BASE_DEC, NULL, 0,
12117 NULL, HFILL }
12118 },
12119 { &hf_mbim_ms_access_binary_app_id,
12120 { "App ID", "mbim.control.ms_access_binary.app_id",
12121 FT_BYTES, BASE_NONE, NULL, 0,
12122 NULL, HFILL }
12123 },
12124 { &hf_mbim_ms_access_binary_file_path,
12125 { "File Path", "mbim.control.ms_access_binary.file_path",
12126 FT_BYTES, BASE_NONE, NULL, 0,
12127 NULL, HFILL }
12128 },
12129 { &hf_mbim_ms_access_binary_local_pin,
12130 { "Local Pin", "mbim.control.ms_access_binary.local_pin",
12131 FT_STRING, BASE_NONE, NULL, 0,
12132 NULL, HFILL }
12133 },
12134 { &hf_mbim_ms_access_binary_binary_data,
12135 { "Binary Data", "mbim.control.ms_access_binary.binary_data",
12136 FT_BYTES, BASE_NONE, NULL, 0,
12137 NULL, HFILL }
12138 },
12139 { &hf_mbim_ms_access_record_version,
12140 { "Version", "mbim.control.ms_access_record.version",
12141 FT_UINT32, BASE_DEC, NULL, 0,
12142 NULL, HFILL }
12143 },
12144 { &hf_mbim_ms_access_record_app_id_offset,
12145 { "App ID Offset", "mbim.control.ms_access_record.app_id_offset",
12146 FT_UINT32, BASE_DEC, NULL, 0,
12147 NULL, HFILL }
12148 },
12149 { &hf_mbim_ms_access_record_app_id_size,
12150 { "App ID Size", "mbim.control.ms_access_record.app_id_size",
12151 FT_UINT32, BASE_DEC, NULL, 0,
12152 NULL, HFILL }
12153 },
12154 { &hf_mbim_ms_access_record_file_path_offset,
12155 { "File Path Offset", "mbim.control.ms_access_record.file_path_offset",
12156 FT_UINT32, BASE_DEC, NULL, 0,
12157 NULL, HFILL }
12158 },
12159 { &hf_mbim_ms_access_record_file_path_size,
12160 { "File Path Size", "mbim.control.ms_access_record.file_path_size",
12161 FT_UINT32, BASE_DEC, NULL, 0,
12162 NULL, HFILL }
12163 },
12164 { &hf_mbim_ms_access_record_record_number,
12165 { "Record Number", "mbim.control.ms_access_record.record_number",
12166 FT_UINT32, BASE_DEC, NULL, 0,
12167 NULL, HFILL }
12168 },
12169 { &hf_mbim_ms_access_record_local_pin_offset,
12170 { "Local Pin Offset", "mbim.control.ms_access_record.local_pin_offset",
12171 FT_UINT32, BASE_DEC, NULL, 0,
12172 NULL, HFILL }
12173 },
12174 { &hf_mbim_ms_access_record_local_pin_size,
12175 { "Local Pin Size", "mbim.control.ms_access_record.local_pin_size",
12176 FT_UINT32, BASE_DEC, NULL, 0,
12177 NULL, HFILL }
12178 },
12179 { &hf_mbim_ms_access_record_record_data_offset,
12180 { "Record Data Offset", "mbim.control.ms_access_record.record_data_offset",
12181 FT_UINT32, BASE_DEC, NULL, 0,
12182 NULL, HFILL }
12183 },
12184 { &hf_mbim_ms_access_record_record_data_size,
12185 { "Record Data Size", "mbim.control.ms_access_record.record_data_size",
12186 FT_UINT32, BASE_DEC, NULL, 0,
12187 NULL, HFILL }
12188 },
12189 { &hf_mbim_ms_access_record_app_id,
12190 { "App ID", "mbim.control.ms_access_record.app_id",
12191 FT_BYTES, BASE_NONE, NULL, 0,
12192 NULL, HFILL }
12193 },
12194 { &hf_mbim_ms_access_record_file_path,
12195 { "File Path", "mbim.control.ms_access_record.file_path",
12196 FT_BYTES, BASE_NONE, NULL, 0,
12197 NULL, HFILL }
12198 },
12199 { &hf_mbim_ms_access_record_local_pin,
12200 { "Local Pin", "mbim.control.ms_access_record.local_pin",
12201 FT_STRING, BASE_NONE, NULL, 0,
12202 NULL, HFILL }
12203 },
12204 { &hf_mbim_ms_access_record_record_data,
12205 { "Record_Data", "mbim.control.ms_access_record.record_data",
12206 FT_BYTES, BASE_NONE, NULL, 0,
12207 NULL, HFILL }
12208 },
12209 { &hf_mbim_fragmented_payload,
12210 { "Fragmented Payload", "mbim.control.fragmented_payload",
12211 FT_BYTES, BASE_NONE, NULL, 0,
12212 NULL, HFILL }
12213 },
12214 { &hf_mbim_request_in,
12215 { "Request In", "mbim.control.request_in",
12216 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0,
12217 NULL, HFILL }
12218 },
12219 { &hf_mbim_response_in,
12220 { "Response In", "mbim.control.response_in",
12221 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0,
12222 NULL, HFILL }
12223 },
12224 { &hf_mbim_descriptor,
12225 { "Descriptor", "mbim.descriptor",
12226 FT_NONE, BASE_NONE, NULL, 0,
12227 NULL, HFILL }
12228 },
12229 { &hf_mbim_descriptor_version,
12230 { "bcdMBIMVersion", "mbim.descriptor.version",
12231 FT_UINT16, BASE_HEX, NULL, 0,
12232 "MBIM Version", HFILL }
12233 },
12234 { &hf_mbim_descriptor_max_control_message,
12235 { "wMaxControlMessage", "mbim.descriptor.max_control_message",
12236 FT_UINT16, BASE_DEC, NULL, 0,
12237 "Max Control Message", HFILL }
12238 },
12239 { &hf_mbim_descriptor_number_filters,
12240 { "bNumberFilters", "mbim.descriptor.number_filters",
12241 FT_UINT8, BASE_DEC, NULL, 0,
12242 "Number Of Packet Filters", HFILL }
12243 },
12244 { &hf_mbim_descriptor_max_filter_size,
12245 { "bMaxFilterSize", "mbim.descriptor.max_filter_size",
12246 FT_UINT8, BASE_DEC, NULL, 0,
12247 "Max Packet Filter Size", HFILL }
12248 },
12249 { &hf_mbim_descriptor_max_segment_size,
12250 { "wMaxSegmentSize", "mbim.descriptor.max_segment_size",
12251 FT_UINT16, BASE_DEC, NULL, 0,
12252 "Max Segment Size", HFILL }
12253 },
12254 { &hf_mbim_descriptor_network_capabilities,
12255 { "bmNetworkCapabilities", "mbim.descriptor.network_capabilities",
12256 FT_UINT8, BASE_HEX, NULL, 0,
12257 "Network Capabilities", HFILL }
12258 },
12259 { &hf_mbim_descriptor_network_capabilities_max_datagram_size,
12260 { "SetMaxDatagramSize/GetMaxDatagramSize", "mbim.descriptor.network_capabilities.max_datagram_size",
12261 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
12262 NULL, HFILL }
12263 },
12264 { &hf_mbim_descriptor_network_capabilities_ntb_input_size,
12265 { "8-byte GetNtbInputSize/SetNtbInputSize", "mbim.descriptor.network_capabilities.ntb_input_size",
12266 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
12267 NULL, HFILL }
12268 },
12269 { &hf_mbim_descriptor_extended_version,
12270 { "bcdMBIMExtendedVersion", "mbim.descriptor.extended_version",
12271 FT_UINT16, BASE_HEX, NULL, 0,
12272 "MBIM Extended Version", HFILL }
12273 },
12274 { &hf_mbim_descriptor_max_outstanding_command_messages,
12275 { "bMaxOutstandingCommandMessages", "mbim.descriptor.max_outstanding_command_messages",
12276 FT_UINT8, BASE_DEC, NULL, 0,
12277 "Max Outstanding Messages", HFILL }
12278 },
12279 { &hf_mbim_descriptor_mtu,
12280 { "wMTU", "mbim.descriptor.mtu",
12281 FT_UINT16, BASE_DEC, NULL, 0,
12282 "MTU", HFILL }
12283 },
12284 { &hf_mbim_bulk,
12285 { "Bulk", "mbim.bulk",
12286 FT_NONE, BASE_NONE, NULL, 0,
12287 NULL, HFILL }
12288 },
12289 { &hf_mbim_bulk_nth_signature,
12290 { "Signature", "mbim.bulk.nth.signature",
12291 FT_STRING, BASE_NONE, NULL, 0,
12292 NULL, HFILL }
12293 },
12294 { &hf_mbim_bulk_nth_header_length,
12295 { "Header Length", "mbim.bulk.nth.header_length",
12296 FT_UINT16, BASE_DEC, NULL, 0,
12297 NULL, HFILL }
12298 },
12299 { &hf_mbim_bulk_nth_sequence_number,
12300 { "Sequence Number", "mbim.bulk.nth.sequence_number",
12301 FT_UINT16, BASE_DEC, NULL, 0,
12302 NULL, HFILL }
12303 },
12304 { &hf_mbim_bulk_nth_block_length,
12305 { "Block Length", "mbim.bulk.nth.block_length",
12306 FT_UINT16, BASE_DEC, NULL, 0,
12307 NULL, HFILL }
12308 },
12309 { &hf_mbim_bulk_nth_block_length_32,
12310 { "Block Length", "mbim.bulk.nth.block_length",
12311 FT_UINT32, BASE_DEC, NULL, 0,
12312 NULL, HFILL }
12313 },
12314 { &hf_mbim_bulk_nth_ndp_index,
12315 { "NDP Index", "mbim.bulk.nth.ndp_index",
12316 FT_UINT16, BASE_DEC, NULL, 0,
12317 NULL, HFILL }
12318 },
12319 { &hf_mbim_bulk_nth_ndp_index_32,
12320 { "NDP Index", "mbim.bulk.nth.ndp_index",
12321 FT_UINT32, BASE_DEC, NULL, 0,
12322 NULL, HFILL }
12323 },
12324 { &hf_mbim_bulk_ndp_signature,
12325 { "Signature", "mbim.bulk.ndp.signature",
12326 FT_UINT32, BASE_HEX, NULL, 0,
12327 NULL, HFILL }
12328 },
12329 { &hf_mbim_bulk_ndp_signature_ips_session_id,
12330 { "IPS Session Id", "mbim.bulk.ndp.signature.ips_session_id",
12331 FT_UINT8, BASE_DEC, NULL, 0,
12332 NULL, HFILL }
12333 },
12334 { &hf_mbim_bulk_ndp_signature_ipc_session_id,
12335 { "IPC Session Id", "mbim.bulk.ndp.signature.ipc_session_id",
12336 FT_UINT8, BASE_DEC, NULL, 0,
12337 NULL, HFILL }
12338 },
12339 { &hf_mbim_bulk_ndp_signature_dss_session_id,
12340 { "DSS Session Id", "mbim.bulk.ndp.signature.dss_session_id",
12341 FT_UINT8, BASE_DEC, NULL, 0,
12342 NULL, HFILL }
12343 },
12344 { &hf_mbim_bulk_ndp_signature_dsc_session_id,
12345 { "DSC Session Id", "mbim.bulk.ndp.signature.dsc_session_id",
12346 FT_UINT8, BASE_DEC, NULL, 0,
12347 NULL, HFILL }
12348 },
12349 { &hf_mbim_bulk_ndp_length,
12350 { "Length", "mbim.bulk.ndp.length",
12351 FT_UINT16, BASE_DEC, NULL, 0,
12352 NULL, HFILL }
12353 },
12354 { &hf_mbim_bulk_ndp_next_ndp_index,
12355 { "Next NDP Index", "mbim.bulk.ndp.next_ndp_index",
12356 FT_UINT16, BASE_DEC, NULL, 0,
12357 NULL, HFILL }
12358 },
12359 { &hf_mbim_bulk_ndp_next_ndp_index_32,
12360 { "Next NDP Index", "mbim.bulk.ndp.next_ndp_index",
12361 FT_UINT32, BASE_DEC, NULL, 0,
12362 NULL, HFILL }
12363 },
12364 { &hf_mbim_bulk_ndp_reserved,
12365 { "Reserved", "mbim.bulk.ndp.reserved",
12366 FT_UINT16, BASE_HEX, NULL, 0,
12367 NULL, HFILL }
12368 },
12369 { &hf_mbim_bulk_ndp_reserved2,
12370 { "Reserved", "mbim.bulk.ndp.reserved",
12371 FT_UINT32, BASE_HEX, NULL, 0,
12372 NULL, HFILL }
12373 },
12374 { &hf_mbim_bulk_ndp_datagram_index,
12375 { "Datagram Index", "mbim.bulk.ndp.datagram.index",
12376 FT_UINT16, BASE_DEC, NULL, 0,
12377 NULL, HFILL }
12378 },
12379 { &hf_mbim_bulk_ndp_datagram_index_32,
12380 { "Datagram Index", "mbim.bulk.ndp.datagram.index",
12381 FT_UINT32, BASE_DEC, NULL, 0,
12382 NULL, HFILL }
12383 },
12384 { &hf_mbim_bulk_ndp_datagram_length,
12385 { "Datagram Length", "mbim.bulk.ndp.datagram.length",
12386 FT_UINT16, BASE_DEC, NULL, 0,
12387 NULL, HFILL }
12388 },
12389 { &hf_mbim_bulk_ndp_datagram_length_32,
12390 { "Datagram Length", "mbim.bulk.ndp.datagram.length",
12391 FT_UINT32, BASE_DEC, NULL, 0,
12392 NULL, HFILL }
12393 },
12394 { &hf_mbim_bulk_ndp_datagram,
12395 { "Datagram", "mbim.bulk.ndp.datagram",
12396 FT_BYTES, BASE_NONE, NULL, 0,
12397 NULL, HFILL }
12398 },
12399 { &hf_mbim_bulk_ndp_nb_datagrams,
12400 { "Number Of Datagrams", "mbim.bulk.ndp.nb_datagrams",
12401 FT_UINT32, BASE_DEC, NULL, 0,
12402 NULL, HFILL }
12403 },
12404 { &hf_mbim_bulk_total_nb_datagrams,
12405 { "Total Number Of Datagrams", "mbim.bulk.total_nb_datagrams",
12406 FT_UINT32, BASE_DEC, NULL, 0,
12407 NULL, HFILL }
12408 },
12409 { &hf_mbim_bulk_ndp_ctrl,
12410 { "NDP Control", "mbim.bulk.ndp_control",
12411 FT_NONE, BASE_NONE, NULL, 0,
12412 NULL, HFILL }
12413 },
12414 { &hf_mbim_bulk_ndp_ctrl_message_type,
12415 { "Message Type", "mbim.bulk.ndp_control.message_type",
12416 FT_UINT16, BASE_HEX, VALS(mbim_ndp_ctrl_msg_type_vals), 0,
12417 NULL, HFILL }
12418 },
12419 { &hf_mbim_bulk_ndp_ctrl_message_length,
12420 { "Message Length", "mbim.bulk.ndp_control.message_length",
12421 FT_UINT16, BASE_DEC, NULL, 0,
12422 NULL, HFILL }
12423 },
12424 { &hf_mbim_bulk_ndp_ctrl_multiflow_status,
12425 { "Multiflow Status", "mbim.bulk.ndp_control.multiflow.status",
12426 FT_UINT16, BASE_DEC, VALS(mbim_ndp_ctrl_multiflow_status_vals), 0,
12427 NULL, HFILL }
12428 },
12429 { &hf_mbim_bulk_ndp_ctrl_multiflow_watermark,
12430 { "Multiflow Watermark", "mbim.bulk.ndp_control.multiflow.watermark",
12431 FT_UINT32, BASE_DEC, NULL, 0,
12432 NULL, HFILL }
12433 },
12434 { &hf_mbim_bulk_ndp_ctrl_message_payload,
12435 { "Message Payload", "mbim.bulk.ndp_control.message_payload",
12436 FT_BYTES, BASE_NONE, NULL, 0,
12437 NULL, HFILL }
12438 },
12439 { &hf_mbim_fragments,
12440 { "Fragments", "mbim.control.fragments",
12441 FT_NONE, BASE_NONE, NULL, 0,
12442 NULL, HFILL }
12443 },
12444 { &hf_mbim_fragment,
12445 { "Fragment", "mbim.control.fragment",
12446 FT_FRAMENUM, BASE_NONE, NULL, 0,
12447 NULL, HFILL }
12448 },
12449 { &hf_mbim_fragment_overlap,
12450 { "Fragment Overlap", "mbim.control.fragment_overlap",
12451 FT_BOOLEAN, BASE_NONE, NULL, 0,
12452 NULL, HFILL }
12453 },
12454 { &hf_mbim_fragment_overlap_conflict,
12455 { "Fragment Overlap Conflict", "mbim.control.fragment_overlap_conflict",
12456 FT_BOOLEAN, BASE_NONE, NULL, 0,
12457 NULL, HFILL }
12458 },
12459 { &hf_mbim_fragment_multiple_tails,
12460 { "Fragment Multiple Tails", "mbim.control.fragment_multiple_tails",
12461 FT_BOOLEAN, BASE_NONE, NULL, 0,
12462 NULL, HFILL }
12463 },
12464 { &hf_mbim_fragment_too_long_fragment,
12465 { "Too Long Fragment", "mbim.control.fragment_too_long_fragment",
12466 FT_BOOLEAN, BASE_NONE, NULL, 0,
12467 NULL, HFILL }
12468 },
12469 { &hf_mbim_fragment_error,
12470 { "Fragment Error", "mbim.control.fragment_error",
12471 FT_FRAMENUM, BASE_NONE, NULL, 0,
12472 NULL, HFILL }
12473 },
12474 { &hf_mbim_fragment_count,
12475 { "Fragment Count", "mbim.control.fragment_count",
12476 FT_UINT32, BASE_DEC, NULL, 0,
12477 NULL, HFILL }
12478 },
12479 { &hf_mbim_reassembled_in,
12480 { "Reassembled In", "mbim.control.reassembled_in",
12481 FT_FRAMENUM, BASE_NONE, NULL, 0,
12482 NULL, HFILL }
12483 },
12484 { &hf_mbim_reassembled_length,
12485 { "Reassembled Length", "mbim.control.reassembled_length",
12486 FT_UINT32, BASE_DEC, NULL, 0,
12487 NULL, HFILL }
12488 },
12489 { &hf_mbim_reassembled_data,
12490 { "Reassembled Data", "mbim.control.reassembled_data",
12491 FT_BYTES, BASE_NONE, NULL, 0,
12492 NULL, HFILL }
12493 }
12494 };
12495
12496 static gint *ett[] = {
12497 &ett_mbim,
12498 &ett_mbim_msg_header,
12499 &ett_mbim_frag_header,
12500 &ett_mbim_info_buffer,
12501 &ett_mbim_bitmap,
12502 &ett_mbim_pair_list,
12503 &ett_mbim_pin,
12504 &ett_mbim_buffer,
12505 &ett_mbim_sc_address,
12506 &ett_mbim_pac,
12507 &ett_mbim_thermal_threshold_setting,
12508 &ett_mbim_fragment,
12509 &ett_mbim_fragments,
12510 &ett_mbim_bulk_ndp_ctrl
12511 };
12512
12513 static ei_register_info ei[] = {
12514 { &ei_mbim_max_ctrl_transfer,
12515 { "mbim.max_control_transfer_too_small", PI_MALFORMED, PI_ERROR,
12516 "Max Control Transfer is less than 64 bytes", EXPFILL }},
12517 { &ei_mbim_unexpected_msg,
12518 { "mbim.unexpected_msg", PI_MALFORMED, PI_ERROR,
12519 "Unexpected message", EXPFILL }},
12520 { &ei_mbim_unexpected_info_buffer,
12521 { "mbim.unexpected_info_buffer", PI_MALFORMED, PI_WARN,
12522 "Unexpected Information Buffer", EXPFILL }},
12523 { &ei_mbim_illegal_on_link_prefix_length,
12524 { "mbim.illegal_on_link_prefix_length", PI_MALFORMED, PI_WARN,
12525 "Illegal On Link Prefix Length", EXPFILL }},
12526 { &ei_mbim_unknown_sms_format,
12527 { "mbim.unknown_sms_format", PI_PROTOCOL, PI_WARN,
12528 "Unknown SMS format", EXPFILL }},
12529 { &ei_mbim_unexpected_uuid_value,
12530 { "mbim.unexpected_uuid_value", PI_PROTOCOL, PI_WARN,
12531 "Unexpected UUID value", EXPFILL }},
12532 { &ei_mbim_too_many_items,
12533 { "mbim.too_many_items", PI_PROTOCOL, PI_WARN,
12534 "Too many items", EXPFILL }},
12535 { &ei_mbim_alignment_error,
12536 { "mbim.alignment_error", PI_MALFORMED, PI_ERROR,
12537 "Alignment error", EXPFILL }},
12538 { &ei_mbim_invalid_block_len,
12539 { "mbim.invalid_block_len", PI_PROTOCOL, PI_WARN,
12540 "NTH Block Length does not match packet length", EXPFILL }},
12541 { &ei_mbim_out_of_bounds_index,
12542 { "mbim.out_of_bounds_index", PI_MALFORMED, PI_ERROR,
12543 "Index is out of bounds", EXPFILL }},
12544 { &ei_mbim_oversized_string,
12545 { "mbim.oversized_string", PI_PROTOCOL, PI_WARN,
12546 "String exceeds maximum size allowed", EXPFILL }},
12547 { &ei_mbim_oversized_pdu,
12548 { "mbim.oversized_pdu", PI_PROTOCOL, PI_WARN,
12549 "PDU exceeds maximum size allowed", EXPFILL }}
12550 };
12551
12552 proto_mbim = proto_register_protocol("Mobile Broadband Interface Model",
12553 "MBIM", "mbim");
12554
12555 proto_register_field_array(proto_mbim, hf, array_length(hf));
12556 proto_register_subtree_array(ett, array_length(ett));
12557 expert_mbim = expert_register_protocol(proto_mbim);
12558 expert_register_field_array(expert_mbim, ei, array_length(ei));
12559
12560 reassembly_table_register(&mbim_reassembly_table,
12561 &addresses_reassembly_table_functions);
12562
12563 mbim_control_handle = register_dissector("mbim.control", dissect_mbim_control, proto_mbim);
12564 register_dissector("mbim.descriptor", dissect_mbim_descriptor, proto_mbim);
12565 register_dissector("mbim.bulk", dissect_mbim_bulk, proto_mbim);
12566 dss_dissector_table = register_dissector_table("mbim.dss_session_id",
12567 "MBIM DSS Session Id", proto_mbim, FT_UINT8, BASE_DEC);
12568
12569 mbim_module = prefs_register_protocol(proto_mbim, proto_reg_handoff_mbim);
12570 prefs_register_obsolete_preference(mbim_module, "bulk_heuristic");
12571 prefs_register_bool_preference(mbim_module, "control_decode_unknown_itf",
12572 "Force decoding of unknown USB control data as MBIM",
12573 "Decode control data received on \"usb.control\" with an "
12574 "unknown interface class as MBIM",
12575 &mbim_control_decode_unknown_itf);
12576 prefs_register_enum_preference(mbim_module, "sms_pdu_format",
12577 "SMS PDU format",
12578 "Format used for SMS PDU decoding",
12579 &mbim_sms_pdu_format, mbim_sms_pdu_format_vals, FALSE);
12580
12581 prefs_register_enum_preference(mbim_module, "extended_version",
12582 "Preferred MBIM Extended Version for decoding when MBIM_CID_VERSION not captured",
12583 NULL,
12584 &preferred_mbim_extended_version, preferred_mbim_extended_version_vals, FALSE);
12585 }
12586
12587 void
proto_reg_handoff_mbim(void)12588 proto_reg_handoff_mbim(void)
12589 {
12590 static gboolean initialized = FALSE, mbim_control_decode_unknown_itf_prev = FALSE;
12591
12592 if (!initialized) {
12593 dissector_handle_t mbim_decode_as_handle = create_dissector_handle(dissect_mbim_decode_as, proto_mbim);
12594 bertlv_handle = find_dissector_add_dependency("gsm_sim.bertlv", proto_mbim);
12595 etsi_cat_handle = find_dissector_add_dependency("etsi_cat", proto_mbim);
12596 gsm_sms_handle = find_dissector_add_dependency("gsm_sms", proto_mbim);
12597 cdma_sms_handle = find_dissector_add_dependency("ansi_637_trans", proto_mbim);
12598 eth_handle = find_dissector_add_dependency("eth_withoutfcs", proto_mbim);
12599 eth_fcs_handle = find_dissector_add_dependency("eth_withfcs", proto_mbim);
12600 ip_handle = find_dissector_add_dependency("ip", proto_mbim);
12601 iso7816_atr_handle = find_dissector_add_dependency("iso7816.atr", proto_mbim);
12602 data_handle = find_dissector("data");
12603 bulk_ndp_ctrl_handle = create_dissector_handle(dissect_mbim_bulk_ndp_ctrl, proto_mbim);
12604 heur_dissector_add("usb.bulk", dissect_mbim_bulk_heur, "MBIM USB bulk endpoint", "mbim_usb_bulk", proto_mbim, HEURISTIC_ENABLE);
12605 dissector_add_for_decode_as("usb.device", mbim_decode_as_handle);
12606 dissector_add_for_decode_as("usb.product", mbim_decode_as_handle);
12607 dissector_add_for_decode_as("usb.protocol", mbim_decode_as_handle);
12608 initialized = TRUE;
12609 }
12610 if (mbim_control_decode_unknown_itf != mbim_control_decode_unknown_itf_prev) {
12611 if (mbim_control_decode_unknown_itf) {
12612 dissector_add_uint("usb.control", IF_CLASS_UNKNOWN, mbim_control_handle);
12613 } else {
12614 dissector_delete_uint("usb.control", IF_CLASS_UNKNOWN, mbim_control_handle);
12615 }
12616 mbim_control_decode_unknown_itf_prev = mbim_control_decode_unknown_itf;
12617 }
12618 }
12619
12620 /*
12621 * Editor modelines - https://www.wireshark.org/tools/modelines.html
12622 *
12623 * Local variables:
12624 * c-basic-offset: 4
12625 * tab-width: 8
12626 * indent-tabs-mode: nil
12627 * End:
12628 *
12629 * vi: set shiftwidth=4 tabstop=8 expandtab:
12630 * :indentSize=4:tabSize=8:noTabs=true:
12631 */
12632