MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-mbim.c
blobc51101bbd0f34c9c7c57a1b29db4daec4a72a3f8
1 /* packet-mbim.c
2 * Routines for MBIM dissection
3 * Copyright 2013, Pascal Quantin <pascal.quantin@gmail.com>
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 /* Dissector based on MBIM specification 1.0 Errata-1
27 * http://www.usb.org/developers/devclass_docs/MBIM10Errata1_073013.zip
28 * http://compliance.usb.org/mbim/
31 #include "config.h"
33 #include <epan/packet.h>
34 #include <epan/expert.h>
35 #include <epan/asn1.h>
36 #include <epan/wmem/wmem.h>
37 #include <epan/conversation.h>
38 #include <epan/prefs.h>
39 #include <epan/reassemble.h>
41 #include "packet-gsm_a_common.h"
42 #include "packet-gsm_map.h"
43 #include "packet-gsm_sms.h"
44 #include "packet-usb.h"
46 void proto_reg_handoff_mbim(void);
48 /* Initialize the protocol and registered fields */
49 static int proto_mbim = -1;
50 static int hf_mbim_control = -1;
51 static int hf_mbim_header_message_type = -1;
52 static int hf_mbim_header_message_length = -1;
53 static int hf_mbim_header_transaction_id = -1;
54 static int hf_mbim_fragment_total = -1;
55 static int hf_mbim_fragment_current = -1;
56 static int hf_mbim_max_ctrl_transfer = -1;
57 static int hf_mbim_device_service_id = -1;
58 static int hf_mbim_uuid_basic_connect_cid = -1;
59 static int hf_mbim_uuid_sms_cid = -1;
60 static int hf_mbim_uuid_ussd_cid = -1;
61 static int hf_mbim_uuid_phonebook_cid = -1;
62 static int hf_mbim_uuid_stk_cid = -1;
63 static int hf_mbim_uuid_auth_cid = -1;
64 static int hf_mbim_uuid_dss_cid = -1;
65 static int hf_mbim_uuid_multicarrier_cid = -1;
66 static int hf_mbim_uuid_ms_hostshutdown_cid = -1;
67 static int hf_mbim_uuid_msfwid_cid = -1;
68 static int hf_mbim_cid = -1;
69 static int hf_mbim_command_type = -1;
70 static int hf_mbim_info_buffer_len = -1;
71 static int hf_mbim_info_buffer = -1;
72 static int hf_mbim_error_status_code = -1;
73 static int hf_mbim_status = -1;
74 static int hf_mbim_device_caps_info_device_type = -1;
75 static int hf_mbim_device_caps_info_cellular_class = -1;
76 static int hf_mbim_device_caps_info_voice_class = -1;
77 static int hf_mbim_device_caps_info_sim_class = -1;
78 static int hf_mbim_device_caps_info_sim_class_logical = -1;
79 static int hf_mbim_device_caps_info_sim_class_removable = -1;
80 static int hf_mbim_device_caps_info_data_class = -1;
81 static int hf_mbim_data_class_gprs = -1;
82 static int hf_mbim_data_class_edge = -1;
83 static int hf_mbim_data_class_umts = -1;
84 static int hf_mbim_data_class_hsdpa = -1;
85 static int hf_mbim_data_class_hsupa = -1;
86 static int hf_mbim_data_class_lte = -1;
87 static int hf_mbim_data_class_reserved_gsm = -1;
88 static int hf_mbim_data_class_1xrtt = -1;
89 static int hf_mbim_data_class_1xevdo = -1;
90 static int hf_mbim_data_class_1xevdoreva = -1;
91 static int hf_mbim_data_class_1xevdv = -1;
92 static int hf_mbim_data_class_3xrtt = -1;
93 static int hf_mbim_data_class_1xevdorevb = -1;
94 static int hf_mbim_data_class_umb = -1;
95 static int hf_mbim_data_class_reserved_cdma = -1;
96 static int hf_mbim_data_class_custom = -1;
97 static int hf_mbim_device_caps_info_sms_caps = -1;
98 static int hf_mbim_device_caps_info_sms_caps_pdu_receive = -1;
99 static int hf_mbim_device_caps_info_sms_caps_pdu_send = -1;
100 static int hf_mbim_device_caps_info_sms_caps_text_receive = -1;
101 static int hf_mbim_device_caps_info_sms_caps_text_send = -1;
102 static int hf_mbim_device_caps_info_control_caps = -1;
103 static int hf_mbim_device_caps_info_control_caps_reg_manual = -1;
104 static int hf_mbim_device_caps_info_control_caps_hw_radio_switch = -1;
105 static int hf_mbim_device_caps_info_control_caps_cdma_mobile_ip = -1;
106 static int hf_mbim_device_caps_info_control_caps_cdma_simple_ip = -1;
107 static int hf_mbim_device_caps_info_control_caps_multi_carrier = -1;
108 static int hf_mbim_device_caps_info_max_sessions = -1;
109 static int hf_mbim_device_caps_info_custom_data_class_offset = -1;
110 static int hf_mbim_device_caps_info_custom_data_class_size = -1;
111 static int hf_mbim_device_caps_info_device_id_offset = -1;
112 static int hf_mbim_device_caps_info_device_id_size = -1;
113 static int hf_mbim_device_caps_info_fw_info_offset = -1;
114 static int hf_mbim_device_caps_info_fw_info_size = -1;
115 static int hf_mbim_device_caps_info_hw_info_offset = -1;
116 static int hf_mbim_device_caps_info_hw_info_size = -1;
117 static int hf_mbim_device_caps_info_custom_data_class = -1;
118 static int hf_mbim_device_caps_info_device_id = -1;
119 static int hf_mbim_device_caps_info_fw_info = -1;
120 static int hf_mbim_device_caps_info_hw_info = -1;
121 static int hf_mbim_subscr_ready_status_ready_state = -1;
122 static int hf_mbim_subscr_ready_status_susbcr_id_offset = -1;
123 static int hf_mbim_subscr_ready_status_susbcr_id_size = -1;
124 static int hf_mbim_subscr_ready_status_sim_icc_id_offset = -1;
125 static int hf_mbim_subscr_ready_status_sim_icc_id_size = -1;
126 static int hf_mbim_subscr_ready_status_ready_info = -1;
127 static int hf_mbim_subscr_ready_status_elem_count = -1;
128 static int hf_mbim_subscr_ready_status_tel_nb_offset = -1;
129 static int hf_mbim_subscr_ready_status_tel_nb_size = -1;
130 static int hf_mbim_subscr_ready_status_susbcr_id = -1;
131 static int hf_mbim_subscr_ready_status_sim_icc_id = -1;
132 static int hf_mbim_subscr_ready_status_tel_nb = -1;
133 static int hf_mbim_radio_state_set = -1;
134 static int hf_mbim_radio_state_hw_radio_state = -1;
135 static int hf_mbim_radio_state_sw_radio_state = -1;
136 static int hf_mbim_set_pin_pin_type = -1;
137 static int hf_mbim_set_pin_pin_pin_operation = -1;
138 static int hf_mbim_set_pin_pin_pin_offset = -1;
139 static int hf_mbim_set_pin_pin_pin_size = -1;
140 static int hf_mbim_set_pin_new_pin_offset = -1;
141 static int hf_mbim_set_pin_new_pin_size = -1;
142 static int hf_mbim_set_pin_pin = -1;
143 static int hf_mbim_set_pin_new_pin = -1;
144 static int hf_mbim_pin_info_pin_type = -1;
145 static int hf_mbim_pin_info_pin_state = -1;
146 static int hf_mbim_pin_info_remaining_attempts = -1;
147 static int hf_mbim_pin_list_pin_mode = -1;
148 static int hf_mbim_pin_list_pin_format = -1;
149 static int hf_mbim_pin_list_pin_length_min = -1;
150 static int hf_mbim_pin_list_pin_length_max = -1;
151 static int hf_mbim_provider_state = -1;
152 static int hf_mbim_provider_state_home = -1;
153 static int hf_mbim_provider_state_forbidden = -1;
154 static int hf_mbim_provider_state_preferred = -1;
155 static int hf_mbim_provider_state_visible = -1;
156 static int hf_mbim_provider_state_registered = -1;
157 static int hf_mbim_provider_state_preferred_multicarrier = -1;
158 static int hf_mbim_provider_provider_id_offset = -1;
159 static int hf_mbim_provider_provider_id_size = -1;
160 static int hf_mbim_provider_provider_name_offset = -1;
161 static int hf_mbim_provider_provider_name_size = -1;
162 static int hf_mbim_provider_cellular_class = -1;
163 static int hf_mbim_provider_rssi = -1;
164 static int hf_mbim_provider_error_rate = -1;
165 static int hf_mbim_provider_provider_id = -1;
166 static int hf_mbim_provider_provider_name = -1;
167 static int hf_mbim_providers_elem_count = -1;
168 static int hf_mbim_providers_provider_offset = -1;
169 static int hf_mbim_providers_provider_size = -1;
170 static int hf_mbim_visible_providers_req_action = -1;
171 static int hf_mbim_set_register_state_provider_id_offset = -1;
172 static int hf_mbim_set_register_state_provider_id_size = -1;
173 static int hf_mbim_set_register_state_register_action = -1;
174 static int hf_mbim_register_state_data_class = -1;
175 static int hf_mbim_set_register_state_provider_id = -1;
176 static int hf_mbim_registration_state_info_nw_error = -1;
177 static int hf_mbim_registration_state_info_register_state = -1;
178 static int hf_mbim_registration_state_info_register_mode = -1;
179 static int hf_mbim_registration_state_info_available_data_classes = -1;
180 static int hf_mbim_registration_state_info_current_cellular_class = -1;
181 static int hf_mbim_registration_state_info_provider_id_offset = -1;
182 static int hf_mbim_registration_state_info_provider_id_size = -1;
183 static int hf_mbim_registration_state_info_provider_name_offset = -1;
184 static int hf_mbim_registration_state_info_provider_name_size = -1;
185 static int hf_mbim_registration_state_info_roaming_text_offset = -1;
186 static int hf_mbim_registration_state_info_roaming_text_size = -1;
187 static int hf_mbim_registration_state_info_registration_flags = -1;
188 static int hf_mbim_registration_state_info_registration_flags_manual_selection_not_available = -1;
189 static int hf_mbim_registration_state_info_registration_flags_packet_service_auto_attach = -1;
190 static int hf_mbim_registration_state_info_provider_id = -1;
191 static int hf_mbim_registration_state_info_provider_name = -1;
192 static int hf_mbim_registration_state_info_roaming_text = -1;
193 static int hf_mbim_set_packet_service_action = -1;
194 static int hf_mbim_packet_service_info_nw_error = -1;
195 static int hf_mbim_packet_service_info_packet_service_state = -1;
196 static int hf_mbim_packet_service_info_highest_available_data_class = -1;
197 static int hf_mbim_packet_service_info_uplink_speed = -1;
198 static int hf_mbim_packet_service_info_downlink_speed = -1;
199 static int hf_mbim_set_signal_state_signal_strength_interval = -1;
200 static int hf_mbim_set_signal_state_rssi_threshold = -1;
201 static int hf_mbim_set_signal_state_error_rate_threshold = -1;
202 static int hf_mbim_signal_state_info_rssi = -1;
203 static int hf_mbim_signal_state_info_error_rate = -1;
204 static int hf_mbim_signal_state_info_signal_strength_interval = -1;
205 static int hf_mbim_signal_state_info_rssi_threshold = -1;
206 static int hf_mbim_signal_state_info_error_rate_threshold = -1;
207 static int hf_mbim_context_type = -1;
208 static int hf_mbim_set_connect_session_id = -1;
209 static int hf_mbim_set_connect_activation_command = -1;
210 static int hf_mbim_set_connect_access_string_offset = -1;
211 static int hf_mbim_set_connect_access_string_size = -1;
212 static int hf_mbim_set_connect_user_name_offset = -1;
213 static int hf_mbim_set_connect_user_name_size = -1;
214 static int hf_mbim_set_connect_password_offset = -1;
215 static int hf_mbim_set_connect_password_size = -1;
216 static int hf_mbim_set_connect_compression = -1;
217 static int hf_mbim_set_connect_auth_protocol = -1;
218 static int hf_mbim_set_connect_ip_type = -1;
219 static int hf_mbim_set_connect_access_string = -1;
220 static int hf_mbim_set_connect_user_name = -1;
221 static int hf_mbim_set_connect_password = -1;
222 static int hf_mbim_connect_info_session_id = -1;
223 static int hf_mbim_connect_info_activation_state = -1;
224 static int hf_mbim_connect_info_voice_call_state = -1;
225 static int hf_mbim_connect_info_ip_type = -1;
226 static int hf_mbim_connect_info_nw_error = -1;
227 static int hf_mbim_context_context_id = -1;
228 static int hf_mbim_context_access_string_offset = -1;
229 static int hf_mbim_context_access_string_size = -1;
230 static int hf_mbim_context_user_name_offset = -1;
231 static int hf_mbim_context_user_name_size = -1;
232 static int hf_mbim_context_password_offset = -1;
233 static int hf_mbim_context_password_size = -1;
234 static int hf_mbim_context_compression = -1;
235 static int hf_mbim_context_auth_protocol = -1;
236 static int hf_mbim_context_provider_id_offset = -1;
237 static int hf_mbim_context_provider_id_size = -1;
238 static int hf_mbim_context_provider_id = -1;
239 static int hf_mbim_context_access_string = -1;
240 static int hf_mbim_context_user_name = -1;
241 static int hf_mbim_context_password = -1;
242 static int hf_mbim_provisioned_contexts_info_elem_count = -1;
243 static int hf_mbim_provisioned_contexts_info_provisioned_context_offset = -1;
244 static int hf_mbim_provisioned_contexts_info_provisioned_context_size = -1;
245 static int hf_mbim_set_service_activation_data_buffer = -1;
246 static int hf_mbim_service_activation_info_nw_error = -1;
247 static int hf_mbim_service_activation_info_data_buffer = -1;
248 static int hf_mbim_ipv4_element_on_link_prefix_length = -1;
249 static int hf_mbim_ipv4_element_ipv4_address = -1;
250 static int hf_mbim_ipv6_element_on_link_prefix_length = -1;
251 static int hf_mbim_ipv6_element_ipv6_address = -1;
252 static int hf_mbim_ip_configuration_info_session_id = -1;
253 static int hf_mbim_ip_configuration_info_ipv4_configuration_available = -1;
254 static int hf_mbim_ip_configuration_info_ipv4_configuration_available_address = -1;
255 static int hf_mbim_ip_configuration_info_ipv4_configuration_available_gateway = -1;
256 static int hf_mbim_ip_configuration_info_ipv4_configuration_available_dns = -1;
257 static int hf_mbim_ip_configuration_info_ipv4_configuration_available_mtu = -1;
258 static int hf_mbim_ip_configuration_info_ipv6_configuration_available = -1;
259 static int hf_mbim_ip_configuration_info_ipv6_configuration_available_address = -1;
260 static int hf_mbim_ip_configuration_info_ipv6_configuration_available_gateway = -1;
261 static int hf_mbim_ip_configuration_info_ipv6_configuration_available_dns = -1;
262 static int hf_mbim_ip_configuration_info_ipv6_configuration_available_mtu = -1;
263 static int hf_mbim_ip_configuration_info_ipv4_address_count = -1;
264 static int hf_mbim_ip_configuration_info_ipv4_address_offset = -1;
265 static int hf_mbim_ip_configuration_info_ipv6_address_count = -1;
266 static int hf_mbim_ip_configuration_info_ipv6_address_offset = -1;
267 static int hf_mbim_ip_configuration_info_ipv4_gateway_offset = -1;
268 static int hf_mbim_ip_configuration_info_ipv6_gateway_offset = -1;
269 static int hf_mbim_ip_configuration_info_ipv4_dns_count = -1;
270 static int hf_mbim_ip_configuration_info_ipv4_dns_offset = -1;
271 static int hf_mbim_ip_configuration_info_ipv6_dns_count = -1;
272 static int hf_mbim_ip_configuration_info_ipv6_dns_offset = -1;
273 static int hf_mbim_ip_configuration_info_ipv4_mtu = -1;
274 static int hf_mbim_ip_configuration_info_ipv6_mtu = -1;
275 static int hf_mbim_ip_configuration_info_ipv4_gateway = -1;
276 static int hf_mbim_ip_configuration_info_ipv6_gateway = -1;
277 static int hf_mbim_ip_configuration_info_ipv4_dns = -1;
278 static int hf_mbim_ip_configuration_info_ipv6_dns = -1;
279 static int hf_mbim_device_service_element_device_service_id = -1;
280 static int hf_mbim_device_service_element_dss_payload = -1;
281 static int hf_mbim_device_service_element_dss_payload_host_device = -1;
282 static int hf_mbim_device_service_element_dss_payload_device_host = -1;
283 static int hf_mbim_device_service_element_max_dss_instances = -1;
284 static int hf_mbim_device_service_element_cid_count = -1;
285 static int hf_mbim_device_service_element_cid = -1;
286 static int hf_mbim_device_services_info_device_services_count = -1;
287 static int hf_mbim_device_services_info_max_dss_sessions = -1;
288 static int hf_mbim_device_services_info_device_services_offset = -1;
289 static int hf_mbim_device_services_info_device_services_size = -1;
290 static int hf_mbim_event_entry_device_service_id = -1;
291 static int hf_mbim_event_entry_cid_count = -1;
292 static int hf_mbim_event_entry_cid = -1;
293 static int hf_mbim_device_service_subscribe_element_count = -1;
294 static int hf_mbim_device_service_subscribe_device_service_offset = -1;
295 static int hf_mbim_device_service_subscribe_device_service_size = -1;
296 static int hf_mbim_packet_statistics_info_in_discards = -1;
297 static int hf_mbim_packet_statistics_info_in_errors = -1;
298 static int hf_mbim_packet_statistics_info_in_octets = -1;
299 static int hf_mbim_packet_statistics_info_in_packets = -1;
300 static int hf_mbim_packet_statistics_info_out_octets = -1;
301 static int hf_mbim_packet_statistics_info_out_packets = -1;
302 static int hf_mbim_packet_statistics_info_out_errors = -1;
303 static int hf_mbim_packet_statistics_info_out_discards = -1;
304 static int hf_mbim_network_idle_hint_state = -1;
305 static int hf_mbim_emergency_mode_info_emergency_mode = -1;
306 static int hf_mbim_single_packet_filter_filter_size = -1;
307 static int hf_mbim_single_packet_filter_packet_filter_offset = -1;
308 static int hf_mbim_single_packet_filter_packet_mask_offset = -1;
309 static int hf_mbim_single_packet_filter_packet_filter = -1;
310 static int hf_mbim_single_packet_filter_packet_mask = -1;
311 static int hf_mbim_packet_filters_session_id = -1;
312 static int hf_mbim_packet_filters_packet_filters_count = -1;
313 static int hf_mbim_packet_filters_packet_filters_packet_filter_offset = -1;
314 static int hf_mbim_packet_filters_packet_filters_packet_filter_size = -1;
315 static int hf_mbim_set_sms_configuration_format = -1;
316 static int hf_mbim_set_sms_configuration_sc_address_offset = -1;
317 static int hf_mbim_set_sms_configuration_sc_address_size = -1;
318 static int hf_mbim_set_sms_configuration_sc_address = -1;
319 static int hf_mbim_sms_configuration_info_sms_storage_state = -1;
320 static int hf_mbim_sms_configuration_info_format = -1;
321 static int hf_mbim_sms_configuration_info_max_messages = -1;
322 static int hf_mbim_sms_configuration_info_cdma_short_message_size = -1;
323 static int hf_mbim_sms_configuration_info_sc_address_offset = -1;
324 static int hf_mbim_sms_configuration_info_sc_address_size = -1;
325 static int hf_mbim_sms_configuration_info_sc_address = -1;
326 static int hf_mbim_sms_pdu_record_message_index = -1;
327 static int hf_mbim_sms_pdu_record_message_status = -1;
328 static int hf_mbim_sms_pdu_record_pdu_data_offset = -1;
329 static int hf_mbim_sms_pdu_record_pdu_data_size = -1;
330 static int hf_mbim_sms_pdu_record_pdu_data = -1;
331 static int hf_mbim_sms_cdma_record_message_index = -1;
332 static int hf_mbim_sms_cdma_record_message_status = -1;
333 static int hf_mbim_sms_cdma_record_address_offset = -1;
334 static int hf_mbim_sms_cdma_record_address_size = -1;
335 static int hf_mbim_sms_cdma_record_timestamp_offset = -1;
336 static int hf_mbim_sms_cdma_record_timestamp_size = -1;
337 static int hf_mbim_sms_cdma_record_encoding_id = -1;
338 static int hf_mbim_sms_cdma_record_language_id = -1;
339 static int hf_mbim_sms_cdma_record_encoded_message_offset = -1;
340 static int hf_mbim_sms_cdma_record_size_in_bytes = -1;
341 static int hf_mbim_sms_cdma_record_size_in_characters = -1;
342 static int hf_mbim_sms_cdma_record_address = -1;
343 static int hf_mbim_sms_cdma_record_timestamp = -1;
344 static int hf_mbim_sms_cdma_record_encoded_message = -1;
345 static int hf_mbim_sms_read_req_format = -1;
346 static int hf_mbim_sms_read_req_flag = -1;
347 static int hf_mbim_sms_read_req_message_index = -1;
348 static int hf_mbim_sms_read_info_format = -1;
349 static int hf_mbim_sms_read_info_element_count = -1;
350 static int hf_mbim_sms_read_info_sms_offset = -1;
351 static int hf_mbim_sms_read_info_sms_size = -1;
352 static int hf_mbim_sms_send_pdu_pdu_data_offset = -1;
353 static int hf_mbim_sms_send_pdu_pdu_data_size = -1;
354 static int hf_mbim_sms_send_pdu_pdu_data = -1;
355 static int hf_mbim_sms_send_cdma_encoding_id = -1;
356 static int hf_mbim_sms_send_cdma_language_id = -1;
357 static int hf_mbim_sms_send_cdma_address_offset = -1;
358 static int hf_mbim_sms_send_cdma_address_size = -1;
359 static int hf_mbim_sms_send_cdma_encoded_message_offset = -1;
360 static int hf_mbim_sms_send_cdma_size_in_bytes = -1;
361 static int hf_mbim_sms_send_cdma_size_in_characters = -1;
362 static int hf_mbim_sms_send_cdma_address = -1;
363 static int hf_mbim_sms_send_cdma_encoded_message = -1;
364 static int hf_mbim_set_sms_send_format = -1;
365 static int hf_mbim_sms_send_info_message_reference = -1;
366 static int hf_mbim_set_sms_delete_flag = -1;
367 static int hf_mbim_set_sms_delete_message_index = -1;
368 static int hf_mbim_sms_status_info_flags = -1;
369 static int hf_mbim_sms_status_info_flags_message_store_full = -1;
370 static int hf_mbim_sms_status_info_flags_new_message = -1;
371 static int hf_mbim_sms_status_info_message_index = -1;
372 static int hf_mbim_set_ussd_ussd_action = -1;
373 static int hf_mbim_set_ussd_ussd_data_coding_scheme = -1;
374 static int hf_mbim_set_ussd_ussd_ussd_payload_offset = -1;
375 static int hf_mbim_set_ussd_ussd_ussd_payload_length = -1;
376 static int hf_mbim_set_ussd_ussd_ussd_payload = -1;
377 static int hf_mbim_ussd_info_ussd_response = -1;
378 static int hf_mbim_ussd_info_ussd_session_state = -1;
379 static int hf_mbim_ussd_info_ussd_data_coding_scheme = -1;
380 static int hf_mbim_ussd_info_ussd_payload_offset = -1;
381 static int hf_mbim_ussd_info_ussd_payload_length = -1;
382 static int hf_mbim_ussd_info_ussd_payload = -1;
383 static int hf_mbim_phonebook_configuration_info_phonebook_state = -1;
384 static int hf_mbim_phonebook_configuration_info_total_nb_of_entries = -1;
385 static int hf_mbim_phonebook_configuration_info_used_entries = -1;
386 static int hf_mbim_phonebook_configuration_info_max_number_length = -1;
387 static int hf_mbim_phonebook_configuration_info_max_name_length = -1;
388 static int hf_mbim_phonebook_entry_entry_index = -1;
389 static int hf_mbim_phonebook_entry_number_offset = -1;
390 static int hf_mbim_phonebook_entry_number_length = -1;
391 static int hf_mbim_phonebook_entry_name_offset = -1;
392 static int hf_mbim_phonebook_entry_name_length = -1;
393 static int hf_mbim_phonebook_entry_number = -1;
394 static int hf_mbim_phonebook_entry_name = -1;
395 static int hf_mbim_phonebook_read_req_filter_flag = -1;
396 static int hf_mbim_phonebook_read_req_filter_message_index = -1;
397 static int hf_mbim_phonebook_read_info_element_count = -1;
398 static int hf_mbim_phonebook_read_info_phonebook_offset = -1;
399 static int hf_mbim_phonebook_read_info_phonebook_size = -1;
400 static int hf_mbim_set_phonebook_delete_filter_flag = -1;
401 static int hf_mbim_set_phonebook_delete_filter_message_index = -1;
402 static int hf_mbim_set_phonebook_write_save_flag = -1;
403 static int hf_mbim_set_phonebook_write_save_index = -1;
404 static int hf_mbim_set_phonebook_write_number_offset = -1;
405 static int hf_mbim_set_phonebook_write_number_length = -1;
406 static int hf_mbim_set_phonebook_write_name_offset = -1;
407 static int hf_mbim_set_phonebook_write_name_length = -1;
408 static int hf_mbim_set_phonebook_write_number = -1;
409 static int hf_mbim_set_phonebook_write_name = -1;
410 static int hf_mbim_set_stk_pac_pac_host_control = -1;
411 static int hf_mbim_stk_pac_info_pac_support = -1;
412 static int hf_mbim_stk_pac_pac_type = -1;
413 static int hf_mbim_stk_pac_pac = -1;
414 static int hf_mbim_set_stk_terminal_response_response_length = -1;
415 static int hf_mbim_set_stk_terminal_response_data_buffer = -1;
416 static int hf_mbim_stk_terminal_response_info_result_data_string_offset = -1;
417 static int hf_mbim_stk_terminal_response_info_result_data_string_length = -1;
418 static int hf_mbim_stk_terminal_response_info_status_word = -1;
419 static int hf_mbim_stk_terminal_response_info_result_data_string = -1;
420 static int hf_mbim_set_stk_envelope_data_buffer = -1;
421 static int hf_mbim_stk_envelope_info_envelope_support = -1;
422 static int hf_mbim_aka_auth_req_rand = -1;
423 static int hf_mbim_aka_auth_req_autn = -1;
424 static int hf_mbim_aka_auth_info_res = -1;
425 static int hf_mbim_aka_auth_info_res_length = -1;
426 static int hf_mbim_aka_auth_info_ik = -1;
427 static int hf_mbim_aka_auth_info_ck = -1;
428 static int hf_mbim_aka_auth_info_auts = -1;
429 static int hf_mbim_akap_auth_req_rand = -1;
430 static int hf_mbim_akap_auth_req_autn = -1;
431 static int hf_mbim_akap_auth_req_network_name_offset = -1;
432 static int hf_mbim_akap_auth_req_network_name_length = -1;
433 static int hf_mbim_akap_auth_req_network_name = -1;
434 static int hf_mbim_akap_auth_info_res = -1;
435 static int hf_mbim_akap_auth_info_res_length = -1;
436 static int hf_mbim_akap_auth_info_ik = -1;
437 static int hf_mbim_akap_auth_info_ck = -1;
438 static int hf_mbim_akap_auth_info_auts = -1;
439 static int hf_mbim_sim_auth_req_rand1 = -1;
440 static int hf_mbim_sim_auth_req_rand2 = -1;
441 static int hf_mbim_sim_auth_req_rand3 = -1;
442 static int hf_mbim_sim_auth_req_n = -1;
443 static int hf_mbim_sim_auth_info_sres1 = -1;
444 static int hf_mbim_sim_auth_info_kc1 = -1;
445 static int hf_mbim_sim_auth_info_sres2 = -1;
446 static int hf_mbim_sim_auth_info_kc2 = -1;
447 static int hf_mbim_sim_auth_info_sres3 = -1;
448 static int hf_mbim_sim_auth_info_kc3 = -1;
449 static int hf_mbim_sim_auth_info_n = -1;
450 static int hf_mbim_set_dss_connect_device_service_id = -1;
451 static int hf_mbim_set_dss_connect_dss_session_id = -1;
452 static int hf_mbim_set_dss_connect_dss_link_state = -1;
453 static int hf_mbim_multicarrier_capabilities_info_capabilities = -1;
454 static int hf_mbim_multicarrier_capabilities_info_capabilities_static_scan = -1;
455 static int hf_mbim_multicarrier_capabilities_info_capabilities_fw_requires_reboot = -1;
456 static int hf_mbim_location_info_country = -1;
457 static int hf_mbim_multicarrier_current_cid_list_req_uuid = -1;
458 static int hf_mbim_multicarrier_current_cid_list_info_cid_count = -1;
459 static int hf_mbim_multicarrier_current_cid_list_info_cid = -1;
460 static int hf_mbim_msfwid_firmwareid_info_firmware_id = -1;
461 static int hf_mbim_fragmented_payload = -1;
462 static int hf_mbim_request_in = -1;
463 static int hf_mbim_response_in = -1;
464 static int hf_mbim_descriptor = -1;
465 static int hf_mbim_descriptor_version = -1;
466 static int hf_mbim_descriptor_max_control_message = -1;
467 static int hf_mbim_descriptor_number_filters = -1;
468 static int hf_mbim_descriptor_max_filter_size = -1;
469 static int hf_mbim_descriptor_max_segment_size = -1;
470 static int hf_mbim_descriptor_network_capabilities = -1;
471 static int hf_mbim_descriptor_network_capabilities_max_datagram_size = -1;
472 static int hf_mbim_descriptor_network_capabilities_ntb_input_size = -1;
473 static int hf_mbim_descriptor_extended_version = -1;
474 static int hf_mbim_descriptor_max_outstanding_command_messages = -1;
475 static int hf_mbim_descriptor_mtu = -1;
476 static int hf_mbim_bulk = -1;
477 static int hf_mbim_bulk_nth_signature = -1;
478 static int hf_mbim_bulk_nth_header_length = -1;
479 static int hf_mbim_bulk_nth_sequence_number = -1;
480 static int hf_mbim_bulk_nth_block_length = -1;
481 static int hf_mbim_bulk_nth_block_length_32 = -1;
482 static int hf_mbim_bulk_nth_ndp_index = -1;
483 static int hf_mbim_bulk_nth_ndp_index_32 = -1;
484 static int hf_mbim_bulk_ndp_signature = -1;
485 static int hf_mbim_bulk_ndp_signature_ips_session_id = -1;
486 static int hf_mbim_bulk_ndp_signature_dss_session_id = -1;
487 static int hf_mbim_bulk_ndp_length = -1;
488 static int hf_mbim_bulk_ndp_next_ndp_index = -1;
489 static int hf_mbim_bulk_ndp_next_ndp_index_32 = -1;
490 static int hf_mbim_bulk_ndp_reserved = -1;
491 static int hf_mbim_bulk_ndp_reserved2 = -1;
492 static int hf_mbim_bulk_ndp_datagram_index = -1;
493 static int hf_mbim_bulk_ndp_datagram_index_32 = -1;
494 static int hf_mbim_bulk_ndp_datagram_length = -1;
495 static int hf_mbim_bulk_ndp_datagram_length_32 = -1;
496 static int hf_mbim_bulk_ndp_datagram = -1;
497 static int hf_mbim_bulk_ndp_nb_datagrams = -1;
498 static int hf_mbim_bulk_total_nb_datagrams = -1;
499 static int hf_mbim_fragments = -1;
500 static int hf_mbim_fragment = -1;
501 static int hf_mbim_fragment_overlap = -1;
502 static int hf_mbim_fragment_overlap_conflict = -1;
503 static int hf_mbim_fragment_multiple_tails = -1;
504 static int hf_mbim_fragment_too_long_fragment = -1;
505 static int hf_mbim_fragment_error = -1;
506 static int hf_mbim_fragment_count = -1;
507 static int hf_mbim_reassembled_in = -1;
508 static int hf_mbim_reassembled_length = -1;
509 static int hf_mbim_reassembled_data = -1;
511 static expert_field ei_mbim_max_ctrl_transfer = EI_INIT;
512 static expert_field ei_mbim_unexpected_msg = EI_INIT;
513 static expert_field ei_mbim_unexpected_info_buffer = EI_INIT;
514 static expert_field ei_mbim_illegal_on_link_prefix_length = EI_INIT;
515 static expert_field ei_mbim_unknown_sms_format = EI_INIT;
516 static expert_field ei_mbim_unexpected_uuid_value = EI_INIT;
517 static expert_field ei_mbim_too_many_items = EI_INIT;
518 static expert_field ei_mbim_alignment_error = EI_INIT;
520 /* Initialize the subtree pointers */
521 static gint ett_mbim = -1;
522 static gint ett_mbim_msg_header = -1;
523 static gint ett_mbim_frag_header = -1;
524 static gint ett_mbim_info_buffer = -1;
525 static gint ett_mbim_bitmap = -1;
526 static gint ett_mbim_pair_list = -1;
527 static gint ett_mbim_pin = -1;
528 static gint ett_mbim_buffer = -1;
529 static gint ett_mbim_fragment = -1;
530 static gint ett_mbim_fragments = -1;
532 static dissector_handle_t proactive_handle;
533 static dissector_handle_t etsi_cat_handle;
534 static dissector_handle_t gsm_sms_handle;
535 static dissector_handle_t cdma_sms_handle;
536 static dissector_handle_t eth_handle;
537 static dissector_handle_t eth_fcs_handle;
538 static dissector_handle_t ip_handle;
539 static dissector_handle_t data_handle;
541 static gboolean mbim_bulk_heuristic = TRUE;
542 static gboolean mbim_control_decode_unknown_itf = FALSE;
544 static reassembly_table mbim_reassembly_table;
546 static const fragment_items mbim_frag_items = {
547 &ett_mbim_fragment,
548 &ett_mbim_fragments,
549 &hf_mbim_fragments,
550 &hf_mbim_fragment,
551 &hf_mbim_fragment_overlap,
552 &hf_mbim_fragment_overlap_conflict,
553 &hf_mbim_fragment_multiple_tails,
554 &hf_mbim_fragment_too_long_fragment,
555 &hf_mbim_fragment_error,
556 &hf_mbim_fragment_count,
557 &hf_mbim_reassembled_in,
558 &hf_mbim_reassembled_length,
559 &hf_mbim_reassembled_data,
560 "MBIM fragments"
563 struct mbim_info {
564 guint32 req_frame;
565 guint32 resp_frame;
568 struct mbim_conv_info {
569 wmem_tree_t *trans;
570 guint32 cellular_class;
573 #define MBIM_MAX_ITEMS 1000
575 #define MBIM_OPEN_MSG 0x00000001
576 #define MBIM_CLOSE_MSG 0x00000002
577 #define MBIM_COMMAND_MSG 0x00000003
578 #define MBIM_HOST_ERROR_MSG 0x00000004
579 #define MBIM_OPEN_DONE 0x80000001
580 #define MBIM_CLOSE_DONE 0x80000002
581 #define MBIM_COMMAND_DONE 0x80000003
582 #define MBIM_FUNCTION_ERROR_MSG 0x80000004
583 #define MBIM_INDICATE_STATUS_MSG 0x80000007
585 static const value_string mbim_msg_type_vals[] = {
586 { MBIM_OPEN_MSG, "OPEN_MSG"},
587 { MBIM_CLOSE_MSG, "CLOSE_MSG"},
588 { MBIM_COMMAND_MSG, "COMMAND_MSG"},
589 { MBIM_HOST_ERROR_MSG, "HOST_ERROR_MSG"},
590 { MBIM_OPEN_DONE, "OPEN_DONE"},
591 { MBIM_CLOSE_DONE, "CLOSE_DONE"},
592 { MBIM_COMMAND_DONE, "COMMAND_DONE"},
593 { MBIM_FUNCTION_ERROR_MSG, "FUNCTION_ERROR_MSG"},
594 { MBIM_INDICATE_STATUS_MSG, "INDICATE_STATUS_MSG"},
595 { 0, NULL}
598 #define MBIM_COMMAND_QUERY 0
599 #define MBIM_COMMAND_SET 1
601 static const value_string mbim_command_type_vals[] = {
602 { MBIM_COMMAND_QUERY, "Query"},
603 { MBIM_COMMAND_SET, "Set"},
604 { 0, NULL}
607 static const value_string mbim_error_status_code_vals[] = {
608 { 1, "TIMEOUT_FRAGMENT"},
609 { 2, "FRAGMENT_OUT_OF_SEQUENCE"},
610 { 3, "LENGTH_MISMATCH"},
611 { 4, "DUPLICATED_TID"},
612 { 5, "NOT_OPENED"},
613 { 6, "UNKNOWN"},
614 { 7, "CANCEL"},
615 { 8, "MAX_TRANSFER"},
616 { 0, NULL}
619 static const value_string mbim_status_code_vals[] = {
620 { 0, "SUCCESS"},
621 { 1, "BUSY"},
622 { 2, "FAILURE"},
623 { 3, "SIM_NOT_INSERTED"},
624 { 4, "BAD_SIM"},
625 { 5, "PIN_REQUIRED"},
626 { 6, "PIN_DISABLED"},
627 { 7, "NOT_REGISTERED"},
628 { 8, "PROVIDERS_NOT_FOUND"},
629 { 9, "NO_DEVICE_SUPPORT"},
630 { 10, "PROVIDER_NOT_VISIBLE"},
631 { 11, "DATA_CLASS_NOT_AVAILABLE"},
632 { 12, "PACKET_SERVICE_DETACHED"},
633 { 13, "MAX_ACTIVATED_CONTEXTS"},
634 { 14, "NOT_INITIALIZED"},
635 { 15, "VOICE_CALL_IN_PROGRESS"},
636 { 16, "CONTEXT_NOT_ACTIVATED"},
637 { 17, "SERVICE_NOT_ACTIVATED"},
638 { 18, "INVALID_ACCESS_STRING"},
639 { 19, "INVALID_USER_NAME_PWD"},
640 { 20, "RADIO_POWER_OFF"},
641 { 21, "INVALID_PARAMETERS"},
642 { 22, "READ_FAILURE"},
643 { 23, "WRITE_FAILURE"},
644 { 24, "Reserved"},
645 { 25, "NO_PHONEBOOK"},
646 { 26, "PARAMETER_TOO_LONG"},
647 { 27, "STK_BUSY"},
648 { 28, "OPERATION_NOT_ALLOWED"},
649 { 29, "MEMORY_FAILURE"},
650 { 30, "INVALID_MEMORY_INDEX"},
651 { 31, "MEMORY_FULL"},
652 { 32, "FILTER_NOT_SUPPORTED"},
653 { 33, "DSS_INSTANCE_LIMIT"},
654 { 34, "INVALID_DEVICE_SERVICE_OPERATION"},
655 { 35, "AUTH_INCORRECT_AUTN"},
656 { 36, "AUTH_SYNC_FAILURE"},
657 { 37, "AUTH_AMF_NOT_SET"},
658 { 38, "CONTEXT_NOT_SUPPORTED"},
659 { 100, "SMS_UNKNOWN_SMSC_ADDRESS"},
660 { 101, "SMS_NETWORK_TIMEOUT"},
661 { 102, "SMS_LANG_NOT_SUPPORTED"},
662 { 103, "SMS_ENCODING_NOT_SUPPORTED"},
663 { 104, "SMS_FORMAT_NOT_SUPPORTED"},
664 { 0, NULL}
666 static value_string_ext mbim_status_code_vals_ext = VALUE_STRING_EXT_INIT(mbim_status_code_vals);
668 struct mbim_uuid {
669 guint8 service_idx;
670 e_guid_t uuid;
673 #define UUID_BASIC_CONNECT 0
674 #define UUID_SMS 1
675 #define UUID_USSD 2
676 #define UUID_PHONEBOOK 3
677 #define UUID_STK 4
678 #define UUID_AUTH 5
679 #define UUID_DSS 6
680 #define UUID_MULTICARRIER 7
681 #define UUID_MS_HOSTSHUTDOWN 8
682 #define UUID_MSFWID 9
684 static const struct mbim_uuid mbim_uuid_service_id_vals[] = {
685 { UUID_BASIC_CONNECT, {0xa289cc33, 0xbcbb, 0x8b4f, { 0xb6, 0xb0, 0x13, 0x3e, 0xc2, 0xaa, 0xe6, 0xdf}}},
686 { UUID_SMS, {0x533fbeeb, 0x14fe, 0x4467, {0x9f, 0x90, 0x33, 0xa2, 0x23, 0xe5, 0x6c, 0x3f}}},
687 { UUID_USSD, {0xe550a0c8, 0x5e82, 0x479e, {0x82, 0xf7, 0x10, 0xab, 0xf4, 0xc3, 0x35, 0x1f}}},
688 { UUID_PHONEBOOK, {0x4bf38476, 0x1e6a, 0x41db, {0xb1, 0xd8, 0xbe, 0xd2, 0x89, 0xc2, 0x5b, 0xdb}}},
689 { UUID_STK, {0xd8f20131, 0xfcb5, 0x4e17, {0x86, 0x02, 0xd6, 0xed, 0x38, 0x16, 0x16, 0x4c}}},
690 { UUID_AUTH, {0x1d2b5ff7, 0x0aa1, 0x48b2, {0xaa, 0x52, 0x50, 0xf1, 0x57, 0x67, 0x17, 0x4e}}},
691 { UUID_DSS, {0xc08a26dd, 0x7718, 0x4382, {0x84, 0x82, 0x6e, 0x0d, 0x58, 0x3c, 0x4d, 0x0e}}},
692 { UUID_MULTICARRIER, {0x8b569648, 0x628d, 0x4653, {0x9b, 0x9f, 0x10, 0x25, 0x40, 0x44, 0x24, 0xe1}}},
693 { UUID_MS_HOSTSHUTDOWN, {0x883b7c26, 0x985f, 0x43fa, {0x98, 0x04, 0x27, 0xd7, 0xfb, 0x80, 0x95, 0x9c}}},
694 { UUID_MSFWID, {0xe9f7dea2, 0xfeaf, 0x4009, {0x93, 0xce, 0x90, 0xa3, 0x69, 0x41, 0x03, 0xb6}}}
697 static const value_string mbim_service_id_vals[] = {
698 { 0, "UUID_BASIC_CONNECT"},
699 { 1, "UUID_SMS"},
700 { 2, "UUID_USSD"},
701 { 3, "UUID_PHONEBOOK"},
702 { 4, "UUID_STK"},
703 { 5, "UUID_AUTH"},
704 { 6, "UUID_DSS"},
705 { 7, "UUID_MULTICARRIER"},
706 { 8, "UUID_MS_HOSTSHUTDOWN"},
707 { 9, "UUID_MSFWID"},
708 { 0, NULL}
711 #define MBIM_CID_DEVICE_CAPS 1
712 #define MBIM_CID_SUBSCRIBER_READY_STATUS 2
713 #define MBIM_CID_RADIO_STATE 3
714 #define MBIM_CID_PIN 4
715 #define MBIM_CID_PIN_LIST 5
716 #define MBIM_CID_HOME_PROVIDER 6
717 #define MBIM_CID_PREFERRED_PROVIDERS 7
718 #define MBIM_CID_VISIBLE_PROVIDERS 8
719 #define MBIM_CID_REGISTER_STATE 9
720 #define MBIM_CID_PACKET_SERVICE 10
721 #define MBIM_CID_SIGNAL_STATE 11
722 #define MBIM_CID_CONNECT 12
723 #define MBIM_CID_PROVISIONED_CONTEXTS 13
724 #define MBIM_CID_SERVICE_ACTIVATION 14
725 #define MBIM_CID_IP_CONFIGURATION 15
726 #define MBIM_CID_DEVICE_SERVICES 16
727 #define MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST 19
728 #define MBIM_CID_PACKET_STATISTICS 20
729 #define MBIM_CID_NETWORK_IDLE_HINT 21
730 #define MBIM_CID_EMERGENCY_MODE 22
731 #define MBIM_CID_IP_PACKET_FILTERS 23
732 #define MBIM_CID_MULTICARRIER_PROVIDERS 24
734 static const value_string mbim_uuid_basic_connect_cid_vals[] = {
735 { MBIM_CID_DEVICE_CAPS, "DEVICE_CAPS"},
736 { MBIM_CID_SUBSCRIBER_READY_STATUS, "SUBSCRIBER_READY_STATUS"},
737 { MBIM_CID_RADIO_STATE, "RADIO_STATE"},
738 { MBIM_CID_PIN, "PIN"},
739 { MBIM_CID_PIN_LIST, "PIN_LIST"},
740 { MBIM_CID_HOME_PROVIDER, "HOME_PROVIDER"},
741 { MBIM_CID_PREFERRED_PROVIDERS, "PREFERRED_PROVIDERS"},
742 { MBIM_CID_VISIBLE_PROVIDERS, "VISIBLE_PROVIDERS"},
743 { MBIM_CID_REGISTER_STATE, "REGISTER_STATE"},
744 { MBIM_CID_PACKET_SERVICE, "PACKET_SERVICE"},
745 { MBIM_CID_SIGNAL_STATE, "SIGNAL_STATE"},
746 { MBIM_CID_CONNECT, "CONNECT"},
747 { MBIM_CID_PROVISIONED_CONTEXTS, "PROVISIONED_CONTEXTS"},
748 { MBIM_CID_SERVICE_ACTIVATION, "SERVICE_ACTIVATION"},
749 { MBIM_CID_IP_CONFIGURATION, "IP_CONFIGURATION"},
750 { MBIM_CID_DEVICE_SERVICES, "DEVICE_SERVICES"},
751 { MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST, "DEVICE_SERVICE_SUBSCRIBE_LIST"},
752 { MBIM_CID_PACKET_STATISTICS, "PACKET_STATISTICS"},
753 { MBIM_CID_NETWORK_IDLE_HINT, "NETWORK_IDLE_HINT"},
754 { MBIM_CID_EMERGENCY_MODE, "EMERGENCY_MODE"},
755 { MBIM_CID_IP_PACKET_FILTERS, "IP_PACKET_FILTERS"},
756 { MBIM_CID_MULTICARRIER_PROVIDERS, "MULTICARRIER_PROVIDERS"},
757 { 0, NULL}
759 static value_string_ext mbim_uuid_basic_connect_cid_vals_ext = VALUE_STRING_EXT_INIT(mbim_uuid_basic_connect_cid_vals);
761 #define MBIM_CID_SMS_CONFIGURATION 1
762 #define MBIM_CID_SMS_READ 2
763 #define MBIM_CID_SMS_SEND 3
764 #define MBIM_CID_SMS_DELETE 4
765 #define MBIM_CID_SMS_MESSAGE_STORE_STATUS 5
767 static const value_string mbim_uuid_sms_cid_vals[] = {
768 { MBIM_CID_SMS_CONFIGURATION, "SMS_CONFIGURATION"},
769 { MBIM_CID_SMS_READ, "SMS_READ"},
770 { MBIM_CID_SMS_SEND, "SMS_SEND"},
771 { MBIM_CID_SMS_DELETE, "SMS_DELETE"},
772 { MBIM_CID_SMS_MESSAGE_STORE_STATUS, "SMS_MESSAGE_STORE_STATUS"},
773 { 0, NULL}
776 #define MBIM_CID_USSD 1
778 static const value_string mbim_uuid_ussd_cid_vals[] = {
779 { MBIM_CID_USSD, "USSD"},
780 { 0, NULL}
783 #define MBIM_CID_PHONEBOOK_CONFIGURATION 1
784 #define MBIM_CID_PHONEBOOK_READ 2
785 #define MBIM_CID_PHONEBOOK_DELETE 3
786 #define MBIM_CID_PHONEBOOK_WRITE 4
788 static const value_string mbim_uuid_phonebook_cid_vals[] = {
789 { MBIM_CID_PHONEBOOK_CONFIGURATION, "PHONEBOOK_CONFIGURATION"},
790 { MBIM_CID_PHONEBOOK_READ, "PHONEBOOK_READ"},
791 { MBIM_CID_PHONEBOOK_DELETE, "PHONEBOOK_DELETE"},
792 { MBIM_CID_PHONEBOOK_WRITE, "PHONEBOOK_WRITE"},
793 { 0, NULL}
796 #define MBIM_CID_STK_PAC 1
797 #define MBIM_CID_STK_TERMINAL_RESPONSE 2
798 #define MBIM_CID_STK_ENVELOPE 3
800 static const value_string mbim_uuid_stk_cid_vals[] = {
801 { MBIM_CID_STK_PAC, "STK_PAC"},
802 { MBIM_CID_STK_TERMINAL_RESPONSE, "STK_TERMINAL_RESPONSE"},
803 { MBIM_CID_STK_ENVELOPE, "STK_ENVELOPE"},
804 { 0, NULL}
807 #define MBIM_CID_AKA_AUTH 1
808 #define MBIM_CID_AKAP_AUTH 2
809 #define MBIM_CID_SIM_AUTH 3
811 static const value_string mbim_uuid_auth_cid_vals[] = {
812 { MBIM_CID_AKA_AUTH, "AKA_AUTH"},
813 { MBIM_CID_AKAP_AUTH, "AKAP_AUTH"},
814 { MBIM_CID_SIM_AUTH, "SIM_AUTH"},
815 { 0, NULL}
818 #define MBIM_CID_DSS_CONNECT 1
820 static const value_string mbim_uuid_dss_cid_vals[] = {
821 { MBIM_CID_DSS_CONNECT, "DSS_CONNECT"},
822 { 0, NULL}
825 #define MBIM_CID_MULTICARRIER_CAPABILITIES 1
826 #define MBIM_CID_LOCATION_INFO 2
827 #define MBIM_CID_MULTICARRIER_CURRENT_CID_LIST 3
829 static const value_string mbim_uuid_multicarrier_cid_vals[] = {
830 { MBIM_CID_MULTICARRIER_CAPABILITIES, "MULTICARRIER_CAPABILITIES"},
831 { MBIM_CID_LOCATION_INFO, "LOCATION_INFO"},
832 { MBIM_CID_MULTICARRIER_CURRENT_CID_LIST, "MULTICARRIER_CURRENT_CID_LIST"},
833 { 0, NULL}
836 #define MBIM_CID_MS_HOSTSHUTDOWN 1
838 static const value_string mbim_uuid_ms_hostshutdown_cid_vals[] = {
839 { MBIM_CID_MS_HOSTSHUTDOWN, "MS_HOSTSHUTDOWN"},
840 { 0, NULL}
843 #define MBIM_CID_MSFWID_FIRMWAREID 1
845 static const value_string mbim_uuid_msfwid_cid_vals[] = {
846 { MBIM_CID_MSFWID_FIRMWAREID, "MSFWID_FIRMWAREID"},
847 { 0, NULL}
850 static const value_string mbim_device_caps_info_device_type_vals[] = {
851 { 0, "Unknown"},
852 { 1, "Embedded"},
853 { 2, "Removable"},
854 { 3, "Remote"},
855 { 0, NULL}
858 #define MBIM_CELLULAR_CLASS_GSM 1
859 #define MBIM_CELLULAR_CLASS_CDMA 2
861 static const value_string mbim_cellular_class_vals[] = {
862 { MBIM_CELLULAR_CLASS_GSM, "GSM"},
863 { MBIM_CELLULAR_CLASS_CDMA, "CDMA"},
864 { 0, NULL}
867 static const value_string mbim_device_caps_info_voice_class_vals[] = {
868 { 0, "Unknown"},
869 { 1, "No Voice"},
870 { 2, "Separate Voice Data"},
871 { 3, "Simultaneous Voice Data"},
872 { 0, NULL}
875 static const int *mbim_device_caps_info_sim_class_fields[] = {
876 &hf_mbim_device_caps_info_sim_class_logical,
877 &hf_mbim_device_caps_info_sim_class_removable,
878 NULL
881 static const int *mbim_data_class_fields[] = {
882 &hf_mbim_data_class_gprs,
883 &hf_mbim_data_class_edge,
884 &hf_mbim_data_class_umts,
885 &hf_mbim_data_class_hsdpa,
886 &hf_mbim_data_class_hsupa,
887 &hf_mbim_data_class_lte,
888 &hf_mbim_data_class_reserved_gsm,
889 &hf_mbim_data_class_1xrtt,
890 &hf_mbim_data_class_1xevdo,
891 &hf_mbim_data_class_1xevdoreva,
892 &hf_mbim_data_class_1xevdv,
893 &hf_mbim_data_class_3xrtt,
894 &hf_mbim_data_class_1xevdorevb,
895 &hf_mbim_data_class_umb,
896 &hf_mbim_data_class_reserved_cdma,
897 &hf_mbim_data_class_custom,
898 NULL
901 static const int *mbim_device_caps_info_sms_caps_fields[] = {
902 &hf_mbim_device_caps_info_sms_caps_pdu_receive,
903 &hf_mbim_device_caps_info_sms_caps_pdu_send,
904 &hf_mbim_device_caps_info_sms_caps_text_receive,
905 &hf_mbim_device_caps_info_sms_caps_text_send,
906 NULL
909 static const int *mbim_device_caps_info_control_caps_fields[] = {
910 &hf_mbim_device_caps_info_control_caps_reg_manual,
911 &hf_mbim_device_caps_info_control_caps_hw_radio_switch,
912 &hf_mbim_device_caps_info_control_caps_cdma_mobile_ip,
913 &hf_mbim_device_caps_info_control_caps_cdma_simple_ip,
914 &hf_mbim_device_caps_info_control_caps_multi_carrier,
915 NULL
918 static const value_string mbim_subscr_ready_status_ready_state_vals[] = {
919 { 0, "Not Initialized"},
920 { 1, "Initialized"},
921 { 2, "SIM Not Inserted"},
922 { 3, "Bad SIM"},
923 { 4, "Failure"},
924 { 5, "Not Activated"},
925 { 6, "Device Locked"},
926 { 0, NULL}
929 static const value_string mbim_subscr_ready_status_ready_info_vals[] = {
930 { 0, "None"},
931 { 1, "Protect Unique ID"},
932 { 0, NULL}
935 static const value_string mbim_radio_state_vals[] = {
936 { 0, "Radio Off"},
937 { 1, "Radio On"},
938 { 0, NULL}
941 static const value_string mbim_pin_type_vals[] = {
942 { 0, "None"},
943 { 1, "Custom"},
944 { 2, "PIN 1"},
945 { 3, "PIN 2"},
946 { 4, "Device SIM PIN"},
947 { 5, "Device First SIM PIN"},
948 { 6, "Network PIN"},
949 { 7, "Network Subset PIN"},
950 { 8, "Service Provider PIN"},
951 { 9, "Corporate PIN"},
952 { 10, "Subsidy Lock"},
953 { 11, "PUK 1"},
954 { 12, "PUK 2"},
955 { 13, "Device First SIM PUK"},
956 { 14, "Network PUK"},
957 { 15, "Network Subset PUK"},
958 { 16, "Service Provider PUK"},
959 { 17, "Corporate PUK"},
960 { 0, NULL}
963 static const value_string mbim_pin_operation_vals[] = {
964 { 0, "Enter"},
965 { 1, "Enable"},
966 { 2, "Disable"},
967 { 3, "Change"},
968 { 0, NULL}
971 static const value_string mbim_pin_state_vals[] = {
972 { 0, "Unlocked"},
973 { 1, "Locked"},
974 { 0, NULL}
977 static const value_string mbim_pin_mode_vals[] = {
978 { 0, "Not Supported"},
979 { 1, "Enabled"},
980 { 2, "Disabled"},
981 { 0, NULL}
984 static const value_string mbim_pin_format_vals[] = {
985 { 0, "Unknown"},
986 { 1, "Numeric"},
987 { 2, "Alpha Numeric"},
988 { 0, NULL}
991 static const int *mbim_provider_state_fields[] = {
992 &hf_mbim_provider_state_home,
993 &hf_mbim_provider_state_forbidden,
994 &hf_mbim_provider_state_preferred,
995 &hf_mbim_provider_state_visible,
996 &hf_mbim_provider_state_registered,
997 &hf_mbim_provider_state_preferred_multicarrier,
998 NULL
1001 static void
1002 mbim_rssi_fmt(gchar *s, guint32 val)
1004 if (val == 0) {
1005 g_snprintf(s, ITEM_LABEL_LENGTH, "-113 or less dBm (0)");
1006 } else if (val < 31) {
1007 g_snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -113 + 2*val, val);
1008 } else if (val == 31) {
1009 g_snprintf(s, ITEM_LABEL_LENGTH, "-51 or greater dBm (31)");
1010 } else if (val == 99) {
1011 g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (99)");
1012 } else {
1013 g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val);
1017 static const value_string mbim_error_rate_vals[] = {
1018 { 0, "Frame error rate < 0.01%"},
1019 { 1, "Frame error rate 0.01-0.1%"},
1020 { 2, "Frame error rate 0.1-0.5%"},
1021 { 3, "Frame error rate 0.5-1.0%"},
1022 { 4, "Frame error rate 1.0-2.0%"},
1023 { 5, "Frame error rate 2.0-4.0%"},
1024 { 6, "Frame error rate 4.0-8.0%"},
1025 { 7, "Frame error rate > 8.0%"},
1026 { 99, "Unknown or undetectable"},
1027 { 0, NULL}
1030 static const value_string mbim_visible_providers_action_vals[] = {
1031 { 0, "Full Scan"},
1032 { 1, "Restricted Scan"},
1033 {0, NULL}
1036 static const value_string mbim_register_action_vals[] = {
1037 { 0, "Automatic"},
1038 { 1, "Manual"},
1039 { 0, NULL}
1042 static const value_string mbim_register_state_vals[] = {
1043 { 0, "Unknown"},
1044 { 1, "Deregistered"},
1045 { 2, "Searching"},
1046 { 3, "Home"},
1047 { 4, "Roaming"},
1048 { 5, "Partner"},
1049 { 6, "Denied"},
1050 { 0, NULL}
1053 static const value_string mbim_register_mode_vals[] = {
1054 { 0, "Unknown"},
1055 { 1, "Automatic"},
1056 { 2, "Manual"},
1057 { 0, NULL}
1060 static const int *mbim_registration_state_info_registration_flags_fields[] = {
1061 &hf_mbim_registration_state_info_registration_flags_manual_selection_not_available,
1062 &hf_mbim_registration_state_info_registration_flags_packet_service_auto_attach,
1063 NULL
1066 static const value_string mbim_packet_service_action_vals[] = {
1067 { 0, "Attach"},
1068 { 1, "Detach"},
1069 { 0, NULL}
1072 static const value_string mbim_packet_service_state_vals[] = {
1073 { 0, "Unknown"},
1074 { 1, "Attaching"},
1075 { 2, "Attached"},
1076 { 3, "Detaching"},
1077 { 4, "Detached"},
1078 { 0, NULL},
1081 static const value_string mbim_activation_command_vals[] = {
1082 { 0, "Deactivate"},
1083 { 1, "Activate"},
1084 { 0, NULL}
1087 static const value_string mbim_compression_vals[] = {
1088 { 0, "None"},
1089 { 1, "Enable"},
1090 { 0, NULL}
1093 static const value_string mbim_auth_protocol_vals[]= {
1094 { 0, "None"},
1095 { 1, "PAP"},
1096 { 2, "CHAP"},
1097 { 3, "MS CHAPv2"},
1098 { 0, NULL}
1101 static const value_string mbim_context_ip_type_vals[] = {
1102 { 0, "Default"},
1103 { 1, "IPv4"},
1104 { 2, "IPv6"},
1105 { 3, "IPv4v6"},
1106 { 4, "IPv4 and IPv6"},
1107 { 0, NULL}
1110 static const value_string mbim_activation_state_vals[] = {
1111 { 0, "Unknown"},
1112 { 1, "Activated"},
1113 { 2, "Activating"},
1114 { 3, "Deactivated"},
1115 { 4, "Deactivating"},
1116 { 0, NULL}
1119 static const value_string mbim_voice_call_state_vals[] = {
1120 { 0, "None"},
1121 { 1, "In Progress"},
1122 { 2, "Hang Up"},
1123 { 0, NULL}
1126 #define UUID_CONTEXT_NONE 0
1127 #define UUID_CONTEXT_INTERNET 1
1128 #define UUID_CONTEXT_VPN 2
1129 #define UUID_CONTEXT_VOICE 3
1130 #define UUID_CONTEXT_VIDEO_SHARE 4
1131 #define UUID_CONTEXT_PURCHASE 5
1132 #define UUID_CONTEXT_IMS 6
1133 #define UUID_CONTEXT_MMS 7
1134 #define UUID_CONTEXT_LOCAL 8
1136 static const struct mbim_uuid mbim_uuid_context_type_vals[] = {
1137 { UUID_CONTEXT_NONE, {0xb43f758c, 0xa560, 0x4b46, {0xb3, 0x5e, 0xc5, 0x86, 0x96, 0x41, 0xfb, 0x54}}},
1138 { UUID_CONTEXT_INTERNET, {0x7e5e2a7e, 0x4e6f, 0x7272, {0x73, 0x6b, 0x65, 0x6e, 0x7e, 0x5e, 0x2a, 0x7e}}},
1139 { UUID_CONTEXT_VPN, {0x9b9f7bbe, 0x8952, 0x44b7, {0x83, 0xac, 0xca, 0x41, 0x31, 0x8d, 0xf7, 0xa0}}},
1140 { UUID_CONTEXT_VOICE, {0x88918294, 0x0ef4, 0x4396, {0x8c, 0xca, 0xa8, 0x58, 0x8f, 0xbc, 0x02, 0xb2}}},
1141 { UUID_CONTEXT_VIDEO_SHARE, {0x05a2a716, 0x7c34, 0x4b4d, {0x9a, 0x91, 0xc5, 0xef, 0x0c, 0x7a, 0xaa, 0xcc}}},
1142 { UUID_CONTEXT_PURCHASE, {0xb3272496, 0xac6c, 0x422b, {0xa8, 0xc0, 0xac, 0xf6, 0x87, 0xa2, 0x72, 0x17}}},
1143 { UUID_CONTEXT_IMS, {0x21610D01, 0x3074, 0x4BCE, {0x94, 0x25, 0xB5, 0x3A, 0x07, 0xD6, 0x97, 0xD6}}},
1144 { UUID_CONTEXT_MMS, {0x46726664, 0x7269, 0x6bc6, {0x96, 0x24, 0xd1, 0xd3, 0x53, 0x89, 0xac, 0xa9}}},
1145 { UUID_CONTEXT_LOCAL, {0xa57a9afc, 0xb09f, 0x45d7, {0xbb, 0x40, 0x03, 0x3c, 0x39, 0xf6, 0x0d, 0xb9}}}
1148 static const value_string mbim_context_type_vals[] = {
1149 { UUID_CONTEXT_NONE, "None"},
1150 { UUID_CONTEXT_INTERNET, "Internet"},
1151 { UUID_CONTEXT_VPN, "VPN"},
1152 { UUID_CONTEXT_VOICE, "Voice"},
1153 { UUID_CONTEXT_VIDEO_SHARE, "Video Share"},
1154 { UUID_CONTEXT_PURCHASE, "Purchase"},
1155 { UUID_CONTEXT_IMS, "IMS"},
1156 { UUID_CONTEXT_MMS, "MMS"},
1157 { UUID_CONTEXT_LOCAL, "Local"},
1158 { 0, NULL}
1161 static const int *mbim_ip_configuration_info_ipv4_configuration_available_fields[] = {
1162 &hf_mbim_ip_configuration_info_ipv4_configuration_available_address,
1163 &hf_mbim_ip_configuration_info_ipv4_configuration_available_gateway,
1164 &hf_mbim_ip_configuration_info_ipv4_configuration_available_dns,
1165 &hf_mbim_ip_configuration_info_ipv4_configuration_available_mtu,
1166 NULL
1169 static const int *mbim_ip_configuration_info_ipv6_configuration_available_fields[] = {
1170 &hf_mbim_ip_configuration_info_ipv6_configuration_available_address,
1171 &hf_mbim_ip_configuration_info_ipv6_configuration_available_gateway,
1172 &hf_mbim_ip_configuration_info_ipv6_configuration_available_dns,
1173 &hf_mbim_ip_configuration_info_ipv6_configuration_available_mtu,
1174 NULL
1177 static const int *mbim_device_service_element_dss_payload_fields[] = {
1178 &hf_mbim_device_service_element_dss_payload_host_device,
1179 &hf_mbim_device_service_element_dss_payload_device_host,
1180 NULL
1183 static const value_string mbim_network_idle_hint_states_vals[] = {
1184 { 0, "Disabled"},
1185 { 1, "Enabled"},
1186 { 0, NULL}
1189 static const value_string mbim_emergency_mode_states_vals[] = {
1190 { 0, "Off"},
1191 { 1, "On"},
1192 { 0, NULL}
1195 static const value_string mbim_sms_storage_state_vals[] = {
1196 { 0, "Not Initialized"},
1197 { 1, "Initialized"},
1198 { 0, NULL}
1201 #define MBIM_SMS_FORMAT_PDU 0
1202 #define MBIM_SMS_FORMAT_CDMA 1
1204 static const value_string mbim_sms_format_vals[] = {
1205 { MBIM_SMS_FORMAT_PDU, "PDU"},
1206 { MBIM_SMS_FORMAT_CDMA, "CDMA"},
1207 { 0, NULL}
1210 static const value_string mbim_sms_flag_vals[] = {
1211 { 0, "All"},
1212 { 1, "Index"},
1213 { 2, "New"},
1214 { 3, "Old"},
1215 { 4, "Sent"},
1216 { 5, "Draft"},
1217 { 0, NULL}
1220 static const value_string mbim_sms_cdma_lang_vals[] = {
1221 { 0, "Unknown"},
1222 { 1, "English"},
1223 { 2, "French"},
1224 { 3, "Spanish"},
1225 { 4, "Japanese"},
1226 { 5, "Korean"},
1227 { 6, "Chinese"},
1228 { 7, "Hebrew"},
1229 { 0, NULL}
1232 static const value_string mbim_sms_cdma_encoding_vals[] = {
1233 { 0, "Octet"},
1234 { 1, "EPM"},
1235 { 2, "7 Bit ASCII"},
1236 { 3, "IA5"},
1237 { 4, "Unicode"},
1238 { 5, "Shift-JIS"},
1239 { 6, "Korean"},
1240 { 7, "Latin Hebrew"},
1241 { 8, "Latin"},
1242 { 9, "GSM 7 Bit"},
1243 { 0, NULL}
1246 static const value_string mbim_sms_message_status_vals[] = {
1247 { 0, "New"},
1248 { 1, "Old"},
1249 { 2, "Draft"},
1250 { 3, "Sent"},
1251 { 0, NULL}
1254 static const int *mbim_sms_status_info_flags_fields[] = {
1255 &hf_mbim_sms_status_info_flags_message_store_full,
1256 &hf_mbim_sms_status_info_flags_new_message,
1257 NULL
1260 static const value_string mbim_ussd_action_vals[] = {
1261 { 0, "Initiate"},
1262 { 1, "Continue"},
1263 { 2, "Cancel"},
1264 { 0, NULL}
1267 static const value_string mbim_ussd_response_vals[] = {
1268 { 0, "No Action Required"},
1269 { 1, "Action Required"},
1270 { 2, "Terminated By NW"},
1271 { 3, "Other Local Client"},
1272 { 4, "Operation Not Supported"},
1273 { 5, "Network Time Out"},
1274 { 0, NULL}
1277 static const value_string mbim_ussd_session_state_vals[] = {
1278 { 0, "New Session"},
1279 { 1, "Existing Session"},
1280 { 0, NULL}
1283 static const value_string mbim_phonebook_state_vals[] = {
1284 { 0, "Not Initialized"},
1285 { 1, "Initialized"},
1286 { 0, NULL}
1289 static const value_string mbim_phonebook_flag_vals[] = {
1290 { 0, "All"},
1291 { 1, "Index"},
1292 { 0, NULL}
1295 static const value_string mbim_phonebook_write_flag_vals[] = {
1296 { 0, "Unused"},
1297 { 1, "Index"},
1298 { 0, NULL}
1301 #if 0
1302 static const value_string mbim_stk_pac_profile_vals[] = {
1303 { 0, "Not Handled By Function Cannot Be Handled By Host"},
1304 { 1, "Not Handled By Function May Be Handled By Host"},
1305 { 2, "Handled By Function Only Transparent To Host"},
1306 { 3, "Handled By Function Notification To Host Possible"},
1307 { 4, "Handled By Function Notification To Host Enabled"},
1308 { 5, "Handled By Function Can Be Overridden By Host"},
1309 { 6, "Handled ByHostFunction Not Able To Handle"},
1310 { 7, "Handled ByHostFunction Able To Handle"},
1311 { 0, NULL}
1313 #endif
1315 static const value_string mbim_stk_pac_type_vals[] = {
1316 { 0, "Proactive Command"},
1317 { 1, "Notification"},
1318 { 0, NULL}
1321 static const value_string mbim_dss_link_state_vals[] = {
1322 { 0, "Deactivate"},
1323 { 1, "Activate"},
1324 { 0, NULL}
1327 static const int *mbim_multicarrier_capabilities_fields[] = {
1328 &hf_mbim_multicarrier_capabilities_info_capabilities_static_scan,
1329 &hf_mbim_multicarrier_capabilities_info_capabilities_fw_requires_reboot,
1330 NULL
1333 static const value_string mbim_geoid_vals[] = {
1334 { 0x2, "Antigua and Barbuda"},
1335 { 0x3, "Afghanistan"},
1336 { 0x4, "Algeria"},
1337 { 0x5, "Azerbaijan"},
1338 { 0x6, "Albania"},
1339 { 0x7, "Armenia"},
1340 { 0x8, "Andorra"},
1341 { 0x9, "Angola"},
1342 { 0xA, "American Samoa"},
1343 { 0xB, "Argentina"},
1344 { 0xC, "Australia"},
1345 { 0xE, "Austria"},
1346 { 0x11, "Bahrain"},
1347 { 0x12, "Barbados"},
1348 { 0x13, "Botswana"},
1349 { 0x14, "Bermuda"},
1350 { 0x15, "Belgium"},
1351 { 0x16, "Bahamas, The"},
1352 { 0x17, "Bangladesh"},
1353 { 0x18, "Belize"},
1354 { 0x19, "Bosnia and Herzegovina"},
1355 { 0x1A, "Bolivia"},
1356 { 0x1B, "Myanmar"},
1357 { 0x1C, "Benin"},
1358 { 0x1D, "Belarus"},
1359 { 0x1E, "Solomon Islands"},
1360 { 0x20, "Brazil"},
1361 { 0x22, "Bhutan"},
1362 { 0x23, "Bulgaria"},
1363 { 0x25, "Brunei"},
1364 { 0x26, "Burundi"},
1365 { 0x27, "Canada"},
1366 { 0x28, "Cambodia"},
1367 { 0x29, "Chad"},
1368 { 0x2A, "Sri Lanka"},
1369 { 0x2B, "Congo"},
1370 { 0x2C, "Congo (DRC)"},
1371 { 0x2D, "China"},
1372 { 0x2E, "Chile"},
1373 { 0x31, "Cameroon"},
1374 { 0x32, "Comoros"},
1375 { 0x33, "Colombia"},
1376 { 0x36, "Costa Rica"},
1377 { 0x37, "Central African Republic"},
1378 { 0x38, "Cuba"},
1379 { 0x39, "Cape Verde"},
1380 { 0x3B, "Cyprus"},
1381 { 0x3D, "Denmark"},
1382 { 0x3E, "Djibouti"},
1383 { 0x3F, "Dominica"},
1384 { 0x41, "Dominican Republic"},
1385 { 0x42, "Ecuador"},
1386 { 0x43, "Egypt"},
1387 { 0x44, "Ireland"},
1388 { 0x45, "Equatorial Guinea"},
1389 { 0x46, "Estonia"},
1390 { 0x47, "Eritrea"},
1391 { 0x48, "El Salvador"},
1392 { 0x49, "Ethiopia"},
1393 { 0x4B, "Czech Republic"},
1394 { 0x4D, "Finland"},
1395 { 0x4E, "Fiji Islands"},
1396 { 0x50, "Micronesia"},
1397 { 0x51, "Faroe Islands"},
1398 { 0x54, "France"},
1399 { 0x56, "Gambia, The"},
1400 { 0x57, "Gabon"},
1401 { 0x58, "Georgia"},
1402 { 0x59, "Ghana"},
1403 { 0x5A, "Gibraltar"},
1404 { 0x5B, "Grenada"},
1405 { 0x5D, "Greenland"},
1406 { 0x5E, "Germany"},
1407 { 0x62, "Greece"},
1408 { 0x63, "Guatemala"},
1409 { 0x64, "Guinea"},
1410 { 0x65, "Guyana"},
1411 { 0x67, "Haiti"},
1412 { 0x68, "Hong Kong S.A.R."},
1413 { 0x6A, "Honduras"},
1414 { 0x6C, "Croatia"},
1415 { 0x6D, "Hungary"},
1416 { 0x6E, "Iceland"},
1417 { 0x6F, "Indonesia"},
1418 { 0x71, "India"},
1419 { 0x72, "British Indian Ocean Territory"},
1420 { 0x74, "Iran"},
1421 { 0x75, "Israel"},
1422 { 0x76, "Italy"},
1423 { 0x77, "Cote d'Ivoire"},
1424 { 0x79, "Iraq"},
1425 { 0x7A, "Japan"},
1426 { 0x7C, "Jamaica"},
1427 { 0x7D, "Jan Mayen"},
1428 { 0x7E, "Jordan"},
1429 { 0x7F, "Johnston Atoll"},
1430 { 0x81, "Kenya"},
1431 { 0x82, "Kyrgyzstan"},
1432 { 0x83, "North Korea"},
1433 { 0x85, "Kiribati"},
1434 { 0x86, "Korea"},
1435 { 0x88, "Kuwait"},
1436 { 0x89, "Kazakhstan"},
1437 { 0x8A, "Laos"},
1438 { 0x8B, "Lebanon"},
1439 { 0x8C, "Latvia"},
1440 { 0x8D, "Lithuania"},
1441 { 0x8E, "Liberia"},
1442 { 0x8F, "Slovakia"},
1443 { 0x91, "Liechtenstein"},
1444 { 0x92, "Lesotho"},
1445 { 0x93, "Luxembourg"},
1446 { 0x94, "Libya"},
1447 { 0x95, "Madagascar"},
1448 { 0x97, "Macao S.A.R."},
1449 { 0x98, "Moldova"},
1450 { 0x9A, "Mongolia"},
1451 { 0x9C, "Malawi"},
1452 { 0x9D, "Mali"},
1453 { 0x9E, "Monaco"},
1454 { 0x9F, "Morocco"},
1455 { 0xA0, "Mauritius"},
1456 { 0xA2, "Mauritania"},
1457 { 0xA3, "Malta"},
1458 { 0xA4, "Oman"},
1459 { 0xA5, "Maldives"},
1460 { 0xA6, "Mexico"},
1461 { 0xA7, "Malaysia"},
1462 { 0xA8, "Mozambique"},
1463 { 0xAD, "Niger"},
1464 { 0xAE, "Vanuatu"},
1465 { 0xAF, "Nigeria"},
1466 { 0xB0, "Netherlands"},
1467 { 0xB1, "Norway"},
1468 { 0xB2, "Nepal"},
1469 { 0xB4, "Nauru"},
1470 { 0xB5, "Suriname"},
1471 { 0xB6, "Nicaragua"},
1472 { 0xB7, "New Zealand"},
1473 { 0xB8, "Palestinian Authority"},
1474 { 0xB9, "Paraguay"},
1475 { 0xBB, "Peru"},
1476 { 0xBE, "Pakistan"},
1477 { 0xBF, "Poland"},
1478 { 0xC0, "Panama"},
1479 { 0xC1, "Portugal"},
1480 { 0xC2, "Papua New Guinea"},
1481 { 0xC3, "Palau"},
1482 { 0xC4, "Guinea-Bissau"},
1483 { 0xC5, "Qatar"},
1484 { 0xC6, "Reunion"},
1485 { 0xC7, "Marshall Islands"},
1486 { 0xC8, "Romania"},
1487 { 0xC9, "Philippines"},
1488 { 0xCA, "Puerto Rico"},
1489 { 0xCB, "Russia"},
1490 { 0xCC, "Rwanda"},
1491 { 0xCD, "Saudi Arabia"},
1492 { 0xCE, "St. Pierre and Miquelon"},
1493 { 0xCF, "St. Kitts and Nevis"},
1494 { 0xD0, "Seychelles"},
1495 { 0xD1, "South Africa"},
1496 { 0xD2, "Senegal"},
1497 { 0xD4, "Slovenia"},
1498 { 0xD5, "Sierra Leone"},
1499 { 0xD6, "San Marino"},
1500 { 0xD7, "Singapore"},
1501 { 0xD8, "Somalia"},
1502 { 0xD9, "Spain"},
1503 { 0xDA, "St. Lucia"},
1504 { 0xDB, "Sudan"},
1505 { 0xDC, "Svalbard"},
1506 { 0xDD, "Sweden"},
1507 { 0xDE, "Syria"},
1508 { 0xDF, "Switzerland"},
1509 { 0xE0, "United Arab Emirates"},
1510 { 0xE1, "Trinidad and Tobago"},
1511 { 0xE3, "Thailand"},
1512 { 0xE4, "Tajikistan"},
1513 { 0xE7, "Tonga"},
1514 { 0xE8, "Togo"},
1515 { 0xE9, "Sao Tome and Principe"},
1516 { 0xEA, "Tunisia"},
1517 { 0xEB, "Turkey"},
1518 { 0xEC, "Tuvalu"},
1519 { 0xED, "Taiwan"},
1520 { 0xEE, "Turkmenistan"},
1521 { 0xEF, "Tanzania"},
1522 { 0xF0, "Uganda"},
1523 { 0xF1, "Ukraine"},
1524 { 0xF2, "United Kingdom"},
1525 { 0xF4, "United States"},
1526 { 0xF5, "Burkina Faso"},
1527 { 0xF6, "Uruguay"},
1528 { 0xF7, "Uzbekistan"},
1529 { 0xF8, "St. Vincent and the Grenadines"},
1530 { 0xF9, "Venezuela"},
1531 { 0xFB, "Vietnam"},
1532 { 0xFC, "Virgin Islands"},
1533 { 0xFD, "Vatican City"},
1534 { 0xFE, "Namibia"},
1535 { 0x101, "Western Sahara (disputed)"},
1536 { 0x102, "Wake Island"},
1537 { 0x103, "Samoa"},
1538 { 0x104, "Swaziland"},
1539 { 0x105, "Yemen"},
1540 { 0x107, "Zambia"},
1541 { 0x108, "Zimbabwe"},
1542 { 0x10D, "Serbia and Montenegro (Former)"},
1543 { 0x10E, "Montenegro"},
1544 { 0x10F, "Serbia"},
1545 { 0x111, "Curacao"},
1546 { 0x114, "South Sudan"},
1547 { 0x12C, "Anguilla"},
1548 { 0x12D, "Antarctica"},
1549 { 0x12E, "Aruba"},
1550 { 0x12F, "Ascension Island"},
1551 { 0x130, "Ashmore and Cartier Islands"},
1552 { 0x131, "Baker Island"},
1553 { 0x132, "Bouvet Island"},
1554 { 0x133, "Cayman Islands"},
1555 { 0x135, "Christmas Island"},
1556 { 0x136, "Clipperton Island"},
1557 { 0x137, "Cocos (Keeling) Islands"},
1558 { 0x138, "Cook Islands"},
1559 { 0x139, "Coral Sea Islands"},
1560 { 0x13A, "Diego Garcia"},
1561 { 0x13B, "Falkland Islands (Islas Malvinas)"},
1562 { 0x13D, "French Guiana"},
1563 { 0x13E, "French Polynesia"},
1564 { 0x13F, "French Southern and Antarctic Lands"},
1565 { 0x141, "Guadeloupe"},
1566 { 0x142, "Guam"},
1567 { 0x143, "Guantanamo Bay"},
1568 { 0x144, "Guernsey"},
1569 { 0x145, "Heard Island and McDonald Islands"},
1570 { 0x146, "Howland Island"},
1571 { 0x147, "Jarvis Island"},
1572 { 0x148, "Jersey"},
1573 { 0x149, "Kingman Reef"},
1574 { 0x14A, "Martinique"},
1575 { 0x14B, "Mayotte"},
1576 { 0x14C, "Montserrat"},
1577 { 0x14E, "New Caledonia"},
1578 { 0x14F, "Niue"},
1579 { 0x150, "Norfolk Island"},
1580 { 0x151, "Northern Mariana Islands"},
1581 { 0x152, "Palmyra Atoll"},
1582 { 0x153, "Pitcairn Islands"},
1583 { 0x154, "Rota Island"},
1584 { 0x155, "Saipan"},
1585 { 0x156, "South Georgia and the South Sandwich Islands"},
1586 { 0x157, "St. Helena"},
1587 { 0x15A, "Tinian Island"},
1588 { 0x15B, "Tokelau"},
1589 { 0x15C, "Tristan da Cunha"},
1590 { 0x15D, "Turks and Caicos Islands"},
1591 { 0x15F, "Virgin Islands, British"},
1592 { 0x160, "Wallis and Futuna"},
1593 { 0x3B16, "Man, Isle of"},
1594 { 0x4CA2, "Macedonia, Former Yugoslav Republic of"},
1595 { 0x52FA, "Midway Islands"},
1596 { 0x78F7, "Sint Maarten (Dutch part)"},
1597 { 0x7BDA, "Saint Martin (French part)"},
1598 { 0x6F60E7, "Democratic Republic of Timor-Leste"},
1599 { 0x9906F5, "Aland Islands"},
1600 { 0x9A55C4F, "Saint Barthelemy"},
1601 { 0x9A55D40, "U.S. Minor Outlying Islands"},
1602 { 0x9A55D42, "Bonaire, Saint Eustatius and Saba"},
1603 {0, NULL}
1605 static value_string_ext mbim_geoid_vals_ext = VALUE_STRING_EXT_INIT(mbim_geoid_vals);
1607 static const int *mbim_descriptor_network_capabilities_fields[] = {
1608 &hf_mbim_descriptor_network_capabilities_max_datagram_size,
1609 &hf_mbim_descriptor_network_capabilities_ntb_input_size,
1610 NULL
1613 static guint8
1614 mbim_dissect_service_id_uuid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint hf, gint *offset)
1616 e_guid_t uuid;
1617 guint i;
1619 tvb_get_ntohguid(tvb, *offset, &uuid);
1621 for (i = 0; i < array_length(mbim_uuid_service_id_vals); i++) {
1622 if (memcmp(&uuid, &(mbim_uuid_service_id_vals[i].uuid), sizeof(e_guid_t)) == 0) {
1623 break;
1626 proto_tree_add_guid_format_value(tree, hf, tvb, *offset, 16, &uuid, "%s (%s)",
1627 val_to_str_const(i, mbim_service_id_vals, "Unknown"), guid_to_str(&uuid));
1628 *offset += 16;
1630 return i;
1633 static guint32
1634 mbim_dissect_cid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset, guint8 uuid_idx)
1636 guint32 cid;
1638 cid = tvb_get_letohl(tvb, *offset);
1639 switch (uuid_idx) {
1640 case UUID_BASIC_CONNECT:
1641 proto_tree_add_uint(tree, hf_mbim_uuid_basic_connect_cid, tvb, *offset, 4, cid);
1642 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
1643 val_to_str_ext_const(cid, &mbim_uuid_basic_connect_cid_vals_ext, "Unknown"));
1644 break;
1645 case UUID_SMS:
1646 proto_tree_add_uint(tree, hf_mbim_uuid_sms_cid, tvb, *offset, 4, cid);
1647 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_sms_cid_vals, "Unknown"));
1648 break;
1649 case UUID_USSD:
1650 proto_tree_add_uint(tree, hf_mbim_uuid_ussd_cid, tvb, *offset, 4, cid);
1651 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_ussd_cid_vals, "Unknown"));
1652 break;
1653 case UUID_PHONEBOOK:
1654 proto_tree_add_uint(tree, hf_mbim_uuid_phonebook_cid, tvb, *offset, 4, cid);
1655 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_phonebook_cid_vals, "Unknown"));
1656 break;
1657 case UUID_STK:
1658 proto_tree_add_uint(tree, hf_mbim_uuid_stk_cid, tvb, *offset, 4, cid);
1659 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_stk_cid_vals, "Unknown"));
1660 break;
1661 case UUID_AUTH:
1662 proto_tree_add_uint(tree, hf_mbim_uuid_auth_cid, tvb, *offset, 4, cid);
1663 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_auth_cid_vals, "Unknown"));
1664 break;
1665 case UUID_DSS:
1666 proto_tree_add_uint(tree, hf_mbim_uuid_dss_cid, tvb, *offset, 4, cid);
1667 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_dss_cid_vals, "Unknown"));
1668 break;
1669 case UUID_MULTICARRIER:
1670 proto_tree_add_uint(tree, hf_mbim_uuid_multicarrier_cid, tvb, *offset, 4, cid);
1671 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_multicarrier_cid_vals, "Unknown"));
1672 break;
1673 case UUID_MS_HOSTSHUTDOWN:
1674 proto_tree_add_uint(tree, hf_mbim_uuid_ms_hostshutdown_cid, tvb, *offset, 4, cid);
1675 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_ms_hostshutdown_cid_vals, "Unknown"));
1676 break;
1677 case UUID_MSFWID:
1678 proto_tree_add_uint(tree, hf_mbim_uuid_msfwid_cid, tvb, *offset, 4, cid);
1679 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(cid, mbim_uuid_msfwid_cid_vals, "Unknown"));
1680 break;
1681 default:
1682 proto_tree_add_uint(tree, hf_mbim_cid, tvb, *offset, 4, cid);
1683 break;
1685 *offset += 4;
1686 return cid;
1689 static void
1690 mbim_dissect_device_caps_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset,
1691 struct mbim_conv_info *mbim_conv)
1693 gint base_offset;
1694 guint32 custom_class_offset, custom_class_size, device_id_offset, device_id_size,
1695 fw_info_offset, fw_info_size, hw_info_offset, hw_info_size;
1697 base_offset = offset;
1698 proto_tree_add_item(tree, hf_mbim_device_caps_info_device_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1699 offset += 4;
1700 mbim_conv->cellular_class = tvb_get_letohl(tvb, offset);
1701 proto_tree_add_uint(tree, hf_mbim_device_caps_info_cellular_class, tvb, offset, 4,
1702 mbim_conv->cellular_class);
1703 offset += 4;
1704 proto_tree_add_item(tree, hf_mbim_device_caps_info_voice_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1705 offset += 4;
1706 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_sim_class, ett_mbim_bitmap,
1707 mbim_device_caps_info_sim_class_fields, ENC_LITTLE_ENDIAN);
1708 offset += 4;
1709 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_data_class, ett_mbim_bitmap,
1710 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
1711 offset += 4;
1712 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_sms_caps, ett_mbim_bitmap,
1713 mbim_device_caps_info_sms_caps_fields, ENC_LITTLE_ENDIAN);
1714 offset += 4;
1715 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_caps_info_control_caps, ett_mbim_bitmap,
1716 mbim_device_caps_info_control_caps_fields, ENC_LITTLE_ENDIAN);
1717 offset += 4;
1718 proto_tree_add_item(tree, hf_mbim_device_caps_info_max_sessions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1719 offset += 4;
1720 custom_class_offset = tvb_get_letohl(tvb, offset);
1721 proto_tree_add_uint(tree, hf_mbim_device_caps_info_custom_data_class_offset, tvb, offset, 4, custom_class_offset);
1722 offset += 4;
1723 custom_class_size = tvb_get_letohl(tvb, offset);
1724 proto_tree_add_uint(tree, hf_mbim_device_caps_info_custom_data_class_size, tvb, offset, 4, custom_class_size);
1725 offset += 4;
1726 device_id_offset = tvb_get_letohl(tvb, offset);
1727 proto_tree_add_uint(tree, hf_mbim_device_caps_info_device_id_offset, tvb, offset, 4, device_id_offset);
1728 offset += 4;
1729 device_id_size = tvb_get_letohl(tvb, offset);
1730 proto_tree_add_uint(tree, hf_mbim_device_caps_info_device_id_size, tvb, offset, 4, device_id_size);
1731 offset += 4;
1732 fw_info_offset = tvb_get_letohl(tvb, offset);
1733 proto_tree_add_uint(tree, hf_mbim_device_caps_info_fw_info_offset, tvb, offset, 4, fw_info_offset);
1734 offset += 4;
1735 fw_info_size = tvb_get_letohl(tvb, offset);
1736 proto_tree_add_uint(tree, hf_mbim_device_caps_info_fw_info_size, tvb, offset, 4, fw_info_size);
1737 offset += 4;
1738 hw_info_offset = tvb_get_letohl(tvb, offset);
1739 proto_tree_add_uint(tree, hf_mbim_device_caps_info_hw_info_offset, tvb, offset, 4, hw_info_offset);
1740 offset += 4;
1741 hw_info_size = tvb_get_letohl(tvb, offset);
1742 proto_tree_add_uint(tree, hf_mbim_device_caps_info_hw_info_size, tvb, offset, 4, hw_info_size);
1743 /*offset += 4;*/
1744 if (custom_class_offset && custom_class_size) {
1745 proto_tree_add_item(tree, hf_mbim_device_caps_info_custom_data_class, tvb, base_offset + custom_class_offset,
1746 custom_class_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1748 if (device_id_offset && device_id_size) {
1749 proto_tree_add_item(tree, hf_mbim_device_caps_info_device_id, tvb, base_offset + device_id_offset,
1750 device_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1752 if (fw_info_offset && fw_info_size) {
1753 proto_tree_add_item(tree, hf_mbim_device_caps_info_fw_info, tvb, base_offset + fw_info_offset,
1754 fw_info_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1756 if (hw_info_offset && hw_info_size) {
1757 proto_tree_add_item(tree, hf_mbim_device_caps_info_hw_info, tvb, base_offset + hw_info_offset,
1758 hw_info_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1762 static void
1763 mbim_dissect_subscriber_ready_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1765 proto_item *ti;
1766 proto_tree *subtree;
1767 gint base_offset, tel_nb_ref_list_offset = 0;
1768 guint32 i, subscriber_id_offset, subscriber_id_size, sim_icc_id_offset, sim_icc_id_size, elem_count,
1769 tel_nb_offset, tel_nb_size;
1771 base_offset = offset;
1772 proto_tree_add_item(tree, hf_mbim_subscr_ready_status_ready_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1773 offset += 4;
1774 subscriber_id_offset = tvb_get_letohl(tvb, offset);
1775 proto_tree_add_uint(tree, hf_mbim_subscr_ready_status_susbcr_id_offset, tvb, offset, 4, subscriber_id_offset);
1776 offset += 4;
1777 subscriber_id_size = tvb_get_letohl(tvb, offset);
1778 proto_tree_add_uint(tree, hf_mbim_subscr_ready_status_susbcr_id_size, tvb, offset, 4, subscriber_id_size);
1779 offset += 4;
1780 sim_icc_id_offset = tvb_get_letohl(tvb, offset);
1781 proto_tree_add_uint(tree, hf_mbim_subscr_ready_status_sim_icc_id_offset, tvb, offset, 4, sim_icc_id_offset);
1782 offset += 4;
1783 sim_icc_id_size = tvb_get_letohl(tvb, offset);
1784 proto_tree_add_uint(tree, hf_mbim_subscr_ready_status_sim_icc_id_size, tvb, offset, 4, sim_icc_id_size);
1785 offset += 4;
1786 proto_tree_add_item(tree, hf_mbim_subscr_ready_status_ready_info, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1787 offset += 4;
1788 elem_count = tvb_get_letohl(tvb, offset);
1789 proto_tree_add_uint(tree, hf_mbim_subscr_ready_status_elem_count, tvb, offset, 4, elem_count);
1790 offset += 4;
1791 if (elem_count) {
1792 tel_nb_ref_list_offset = offset;
1793 ti = proto_tree_add_text(tree, tvb, offset, 8*elem_count, "Telephone Numbers Ref List");
1794 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
1795 for (i = 0; i < elem_count; i++) {
1796 proto_tree_add_item(subtree, hf_mbim_subscr_ready_status_tel_nb_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1797 offset += 4;
1798 proto_tree_add_item(subtree, hf_mbim_subscr_ready_status_tel_nb_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1799 offset += 4;
1802 if (subscriber_id_offset && subscriber_id_size) {
1803 proto_tree_add_item(tree, hf_mbim_subscr_ready_status_susbcr_id, tvb, base_offset + subscriber_id_offset,
1804 subscriber_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1806 if (sim_icc_id_offset && sim_icc_id_size) {
1807 proto_tree_add_item(tree, hf_mbim_subscr_ready_status_sim_icc_id, tvb, base_offset + sim_icc_id_offset,
1808 sim_icc_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1810 for (i = 0; i < elem_count; i++) {
1811 tel_nb_offset = tvb_get_letohl(tvb, tel_nb_ref_list_offset + 8*i);
1812 tel_nb_size = tvb_get_letohl(tvb, tel_nb_ref_list_offset + 8*i + 4);
1813 if (tel_nb_offset && tel_nb_size) {
1814 proto_tree_add_item(tree, hf_mbim_subscr_ready_status_tel_nb, tvb, base_offset + tel_nb_offset,
1815 tel_nb_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1820 static void
1821 mbim_dissect_set_pin(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1823 gint base_offset;
1824 guint32 pin_offset, pin_size, new_pin_offset, new_pin_size;
1826 base_offset = offset;
1827 proto_tree_add_item(tree, hf_mbim_set_pin_pin_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1828 offset += 4;
1829 proto_tree_add_item(tree, hf_mbim_set_pin_pin_pin_operation, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1830 offset += 4;
1831 pin_offset = tvb_get_letohl(tvb, offset);
1832 proto_tree_add_uint(tree, hf_mbim_set_pin_pin_pin_offset, tvb, offset, 4, pin_offset);
1833 offset += 4;
1834 pin_size = tvb_get_letohl(tvb, offset);
1835 proto_tree_add_uint(tree, hf_mbim_set_pin_pin_pin_size, tvb, offset, 4, pin_size);
1836 offset += 4;
1837 new_pin_offset = tvb_get_letohl(tvb, offset);
1838 proto_tree_add_uint(tree, hf_mbim_set_pin_new_pin_offset, tvb, offset, 4, new_pin_offset);
1839 offset += 4;
1840 new_pin_size = tvb_get_letohl(tvb, offset);
1841 proto_tree_add_uint(tree, hf_mbim_set_pin_new_pin_size, tvb, offset, 4, new_pin_size);
1842 /*offset += 4;*/
1843 if (pin_offset && pin_size) {
1844 proto_tree_add_item(tree, hf_mbim_set_pin_pin, tvb, base_offset + pin_offset,
1845 pin_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1847 if (new_pin_offset && new_pin_size) {
1848 proto_tree_add_item(tree, hf_mbim_set_pin_new_pin, tvb, base_offset + new_pin_offset,
1849 new_pin_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1853 static void
1854 mbim_dissect_pin_list_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1856 const char *pin_list[10] = { "PIN 1", "PIN 2", "Device SIM PIN", "Device First SIM PIN", "Network PIN",
1857 "Network Subset PIN", "Service Provider PIN", "Corporate PIN", "Subsidy Lock",
1858 "Custom"};
1859 guint i;
1860 guint32 length;
1861 proto_item *ti;
1862 proto_tree *subtree;
1864 for (i = 0; i < 10; i++) {
1865 ti = proto_tree_add_text(tree, tvb, offset, 16, "%s", pin_list[i]);
1866 subtree = proto_item_add_subtree(ti, ett_mbim_pin);
1867 proto_tree_add_item(subtree, hf_mbim_pin_list_pin_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1868 offset += 4;
1869 proto_tree_add_item(subtree, hf_mbim_pin_list_pin_format, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1870 offset += 4;
1871 length = tvb_get_letohl(tvb, offset);
1872 if (length == 0xffffffff) {
1873 proto_tree_add_uint_format_value(subtree, hf_mbim_pin_list_pin_length_min, tvb, offset, 4,
1874 length, "Not available (0xffffffff)");
1875 } else {
1876 proto_tree_add_uint(subtree, hf_mbim_pin_list_pin_length_min, tvb, offset, 4, length);
1878 offset += 4;
1879 length = tvb_get_letohl(tvb, offset);
1880 if (length == 0xffffffff) {
1881 proto_tree_add_uint_format_value(subtree, hf_mbim_pin_list_pin_length_max, tvb, offset, 4,
1882 length, "Not available (0xffffffff)");
1883 } else {
1884 proto_tree_add_uint(subtree, hf_mbim_pin_list_pin_length_max, tvb, offset, 4, length);
1886 offset += 4;
1890 static void
1891 mbim_dissect_provider(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1893 gint base_offset;
1894 guint32 provider_id_offset, provider_id_size, provider_name_offset, provider_name_size;
1896 base_offset = offset;
1897 provider_id_offset = tvb_get_letohl(tvb, offset);
1898 proto_tree_add_uint(tree, hf_mbim_provider_provider_id_offset, tvb, offset, 4, provider_id_offset);
1899 offset += 4;
1900 provider_id_size = tvb_get_letohl(tvb, offset);
1901 proto_tree_add_uint(tree, hf_mbim_provider_provider_id_size, tvb, offset, 4, provider_id_size);
1902 offset += 4;
1903 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_provider_state, ett_mbim_bitmap,
1904 mbim_provider_state_fields, ENC_LITTLE_ENDIAN);
1905 offset += 4;
1906 provider_name_offset = tvb_get_letohl(tvb, offset);
1907 proto_tree_add_uint(tree, hf_mbim_provider_provider_name_offset, tvb, offset, 4, provider_name_offset);
1908 offset += 4;
1909 provider_name_size = tvb_get_letohl(tvb, offset);
1910 proto_tree_add_uint(tree, hf_mbim_provider_provider_name_size, tvb, offset, 4, provider_name_size);
1911 offset += 4;
1912 proto_tree_add_item (tree, hf_mbim_provider_cellular_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1913 offset += 4;
1914 proto_tree_add_item (tree, hf_mbim_provider_rssi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1915 offset += 4;
1916 proto_tree_add_item (tree, hf_mbim_provider_error_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1917 /*offset += 4;*/
1918 if (provider_id_offset && provider_id_size) {
1919 proto_tree_add_item(tree, hf_mbim_provider_provider_id, tvb, base_offset + provider_id_offset,
1920 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1922 if (provider_name_offset && provider_name_size) {
1923 proto_tree_add_item(tree, hf_mbim_provider_provider_name, tvb, base_offset + provider_name_offset,
1924 provider_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1928 static void
1929 mbim_dissect_providers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
1931 proto_item *ti;
1932 proto_tree *subtree;
1933 gint base_offset;
1934 guint32 i, elem_count, providers_list_offset, provider_offset, provider_size;
1937 base_offset = offset;
1938 elem_count = tvb_get_letohl(tvb, offset);
1939 proto_tree_add_uint(tree, hf_mbim_providers_elem_count, tvb, offset, 4, elem_count);
1940 offset += 4;
1941 if (elem_count) {
1942 providers_list_offset = offset;
1943 ti = proto_tree_add_text(tree, tvb, offset, 8*elem_count, "Providers Ref List");
1944 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
1945 for (i = 0; i < elem_count; i++) {
1946 proto_tree_add_item(subtree, hf_mbim_providers_provider_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1947 offset += 4;
1948 proto_tree_add_item(subtree, hf_mbim_providers_provider_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1949 offset += 4;
1951 for (i = 0; i < elem_count; i++) {
1952 provider_offset = tvb_get_letohl(tvb, providers_list_offset + 8*i);
1953 provider_size = tvb_get_letohl(tvb, providers_list_offset + 8*i + 4);
1954 if (provider_offset && provider_size) {
1955 ti = proto_tree_add_text(tree, tvb, base_offset + provider_offset, provider_size, "Provider #%u", i+1);
1956 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
1957 mbim_dissect_provider(tvb, pinfo, subtree, base_offset + provider_offset);
1963 static void
1964 mbim_dissect_set_register_state(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1966 gint base_offset;
1967 guint32 provider_id_offset, provider_id_size;
1969 base_offset = offset;
1970 provider_id_offset = tvb_get_letohl(tvb, offset);
1971 proto_tree_add_uint(tree, hf_mbim_set_register_state_provider_id_offset, tvb, offset, 4, provider_id_offset);
1972 offset += 4;
1973 provider_id_size = tvb_get_letohl(tvb, offset);
1974 proto_tree_add_uint(tree, hf_mbim_set_register_state_provider_id_size, tvb, offset, 4, provider_id_size);
1975 offset += 4;
1976 proto_tree_add_item(tree, hf_mbim_set_register_state_register_action, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1977 offset += 4;
1978 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_register_state_data_class, ett_mbim_bitmap,
1979 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
1980 /*offset += 4;*/
1981 if (provider_id_offset && provider_id_size) {
1982 proto_tree_add_item(tree, hf_mbim_set_register_state_provider_id, tvb, base_offset + provider_id_offset,
1983 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
1987 static void
1988 mbim_dissect_registration_state_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1990 gint base_offset;
1991 guint32 provider_id_offset, provider_id_size, provider_name_offset, provider_name_size,
1992 roaming_text_offset, roaming_text_size, nw_error;
1994 base_offset = offset;
1995 nw_error = tvb_get_letohl(tvb, offset);
1996 if (nw_error == 0) {
1997 proto_tree_add_uint_format_value(tree, hf_mbim_registration_state_info_nw_error, tvb, offset, 4, nw_error, "Success (0)");
1998 } else {
1999 proto_tree_add_uint(tree, hf_mbim_registration_state_info_nw_error, tvb, offset, 4, nw_error);
2001 offset += 4;
2002 proto_tree_add_item(tree, hf_mbim_registration_state_info_register_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2003 offset += 4;
2004 proto_tree_add_item(tree, hf_mbim_registration_state_info_register_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2005 offset += 4;
2006 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_registration_state_info_available_data_classes, ett_mbim_bitmap,
2007 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
2008 offset += 4;
2009 proto_tree_add_item(tree, hf_mbim_registration_state_info_current_cellular_class, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2010 offset += 4;
2011 provider_id_offset = tvb_get_letohl(tvb, offset);
2012 proto_tree_add_uint(tree, hf_mbim_registration_state_info_provider_id_offset, tvb, offset, 4, provider_id_offset);
2013 offset += 4;
2014 provider_id_size = tvb_get_letohl(tvb, offset);
2015 proto_tree_add_uint(tree, hf_mbim_registration_state_info_provider_id_size, tvb, offset, 4, provider_id_size);
2016 offset += 4;
2017 provider_name_offset = tvb_get_letohl(tvb, offset);
2018 proto_tree_add_uint(tree, hf_mbim_registration_state_info_provider_name_offset, tvb, offset, 4, provider_name_offset);
2019 offset += 4;
2020 provider_name_size = tvb_get_letohl(tvb, offset);
2021 proto_tree_add_uint(tree, hf_mbim_registration_state_info_provider_name_size, tvb, offset, 4, provider_name_size);
2022 offset += 4;
2023 roaming_text_offset = tvb_get_letohl(tvb, offset);
2024 proto_tree_add_uint(tree, hf_mbim_registration_state_info_roaming_text_offset, tvb, offset, 4, roaming_text_offset);
2025 offset += 4;
2026 roaming_text_size = tvb_get_letohl(tvb, offset);
2027 proto_tree_add_uint(tree, hf_mbim_registration_state_info_roaming_text_size, tvb, offset, 4, roaming_text_size);
2028 offset += 4;
2029 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_registration_state_info_registration_flags, ett_mbim_bitmap,
2030 mbim_registration_state_info_registration_flags_fields, ENC_LITTLE_ENDIAN);
2031 /*offset += 4;*/
2032 if (provider_id_offset && provider_id_size) {
2033 proto_tree_add_item(tree, hf_mbim_registration_state_info_provider_id, tvb, base_offset + provider_id_offset,
2034 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2036 if (provider_name_offset && provider_name_size) {
2037 proto_tree_add_item(tree, hf_mbim_registration_state_info_provider_name, tvb, base_offset + provider_name_offset,
2038 provider_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2040 if (roaming_text_offset && roaming_text_size) {
2041 proto_tree_add_item(tree, hf_mbim_registration_state_info_roaming_text, tvb, base_offset + roaming_text_offset,
2042 roaming_text_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2046 static void
2047 mbim_dissect_packet_service_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2049 proto_item *ti;
2050 guint32 nw_error;
2052 nw_error = tvb_get_letohl(tvb, offset);
2053 if (nw_error == 0) {
2054 proto_tree_add_uint_format_value(tree, hf_mbim_packet_service_info_nw_error, tvb, offset, 4, nw_error, "Success (0)");
2055 } else {
2056 proto_tree_add_uint(tree, hf_mbim_packet_service_info_nw_error, tvb, offset, 4, nw_error);
2058 offset += 4;
2059 proto_tree_add_item(tree, hf_mbim_packet_service_info_packet_service_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2060 offset += 4;
2061 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_packet_service_info_highest_available_data_class, ett_mbim_bitmap,
2062 mbim_data_class_fields, ENC_LITTLE_ENDIAN);
2063 offset += 4;
2064 ti = proto_tree_add_item(tree, hf_mbim_packet_service_info_uplink_speed, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2065 proto_item_append_text(ti, " b/s");
2066 offset += 8;
2067 ti = proto_tree_add_item(tree, hf_mbim_packet_service_info_downlink_speed, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2068 proto_item_append_text(ti, " b/s");
2069 /*offset += 8;*/
2072 static void
2073 mbim_dissect_set_signal_state(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2075 proto_item *ti;
2076 guint32 error_rate_threshold;
2078 ti = proto_tree_add_item(tree, hf_mbim_set_signal_state_signal_strength_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2079 proto_item_append_text(ti, " s");
2080 offset += 4;
2081 proto_tree_add_item(tree, hf_mbim_set_signal_state_rssi_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2082 offset += 4;
2083 error_rate_threshold = tvb_get_letohl(tvb, offset);
2084 if (error_rate_threshold == 0xffffffff) {
2085 proto_tree_add_uint_format_value(tree, hf_mbim_set_signal_state_error_rate_threshold, tvb, offset, 4,
2086 error_rate_threshold, "No report (0xffffffff)");
2087 } else {
2088 proto_tree_add_item(tree, hf_mbim_set_signal_state_error_rate_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2092 static void
2093 mbim_dissect_signal_state_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2095 proto_item *ti;
2096 guint32 error_rate_threshold;
2098 proto_tree_add_item(tree, hf_mbim_signal_state_info_rssi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2099 offset += 4;
2100 proto_tree_add_item(tree, hf_mbim_signal_state_info_error_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2101 offset += 4;
2102 ti = proto_tree_add_item(tree, hf_mbim_signal_state_info_signal_strength_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2103 proto_item_append_text(ti, " s");
2104 offset += 4;
2105 proto_tree_add_item(tree, hf_mbim_signal_state_info_rssi_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2106 offset += 4;
2107 error_rate_threshold = tvb_get_letohl(tvb, offset);
2108 if (error_rate_threshold == 0xffffffff) {
2109 proto_tree_add_uint_format_value(tree, hf_mbim_signal_state_info_error_rate_threshold, tvb, offset, 4,
2110 error_rate_threshold, "No report (0xffffffff)");
2111 } else {
2112 proto_tree_add_item(tree, hf_mbim_signal_state_info_error_rate_threshold, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2116 static guint8
2117 mbim_dissect_context_type_uuid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint *offset)
2119 e_guid_t uuid;
2120 guint i;
2122 tvb_get_ntohguid(tvb, *offset, &uuid);
2124 for (i = 0; i < array_length(mbim_uuid_context_type_vals); i++) {
2125 if (memcmp(&uuid, &(mbim_uuid_context_type_vals[i].uuid), sizeof(e_guid_t)) == 0) {
2126 break;
2129 proto_tree_add_guid_format_value(tree, hf_mbim_context_type, tvb, *offset, 16, &uuid, "%s (%s)",
2130 val_to_str_const(i, mbim_context_type_vals, "Unknown"), guid_to_str(&uuid));
2131 *offset += 16;
2133 return i;
2136 static void
2137 mbim_dissect_set_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2139 gint base_offset;
2140 guint32 access_string_offset, access_string_size, user_name_offset, user_name_size,
2141 password_offset, password_size;
2143 base_offset = offset;
2144 proto_tree_add_item(tree, hf_mbim_set_connect_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2145 offset += 4;
2146 proto_tree_add_item(tree, hf_mbim_set_connect_activation_command, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2147 offset += 4;
2148 access_string_offset = tvb_get_letohl(tvb, offset);
2149 proto_tree_add_uint(tree, hf_mbim_set_connect_access_string_offset, tvb, offset, 4, access_string_offset);
2150 offset += 4;
2151 access_string_size = tvb_get_letohl(tvb, offset);
2152 proto_tree_add_uint(tree, hf_mbim_set_connect_access_string_size, tvb, offset, 4, access_string_size);
2153 offset += 4;
2154 user_name_offset = tvb_get_letohl(tvb, offset);
2155 proto_tree_add_uint(tree, hf_mbim_set_connect_user_name_offset, tvb, offset, 4, user_name_offset);
2156 offset += 4;
2157 user_name_size = tvb_get_letohl(tvb, offset);
2158 proto_tree_add_uint(tree, hf_mbim_set_connect_user_name_size, tvb, offset, 4, user_name_size);
2159 offset += 4;
2160 password_offset = tvb_get_letohl(tvb, offset);
2161 proto_tree_add_uint(tree, hf_mbim_set_connect_password_offset, tvb, offset, 4, password_offset);
2162 offset += 4;
2163 password_size = tvb_get_letohl(tvb, offset);
2164 proto_tree_add_uint(tree, hf_mbim_set_connect_password_size, tvb, offset, 4, password_size);
2165 offset += 4;
2166 proto_tree_add_item(tree, hf_mbim_set_connect_compression, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2167 offset += 4;
2168 proto_tree_add_item(tree, hf_mbim_set_connect_auth_protocol, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2169 offset += 4;
2170 proto_tree_add_item(tree, hf_mbim_set_connect_ip_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2171 offset += 4;
2172 mbim_dissect_context_type_uuid(tvb, pinfo, tree, &offset);
2173 if (access_string_offset && access_string_size) {
2174 proto_tree_add_item(tree, hf_mbim_set_connect_access_string, tvb, base_offset + access_string_offset,
2175 access_string_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2177 if (user_name_offset && user_name_size) {
2178 proto_tree_add_item(tree, hf_mbim_set_connect_user_name, tvb, base_offset + user_name_offset,
2179 user_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2181 if (password_offset && password_size) {
2182 proto_tree_add_item(tree, hf_mbim_set_connect_password, tvb, base_offset + password_offset,
2183 password_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2187 static void
2188 mbim_dissect_connect_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2190 guint32 nw_error;
2192 proto_tree_add_item(tree, hf_mbim_connect_info_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2193 offset += 4;
2194 proto_tree_add_item(tree, hf_mbim_connect_info_activation_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2195 offset += 4;
2196 proto_tree_add_item(tree, hf_mbim_connect_info_voice_call_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2197 offset += 4;
2198 proto_tree_add_item(tree, hf_mbim_connect_info_ip_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2199 offset += 4;
2200 mbim_dissect_context_type_uuid(tvb, pinfo, tree, &offset);
2201 nw_error = tvb_get_letohl(tvb, offset);
2202 if (nw_error == 0) {
2203 proto_tree_add_uint_format_value(tree, hf_mbim_connect_info_nw_error, tvb, offset, 4, nw_error, "Success (0)");
2204 } else {
2205 proto_tree_add_uint(tree, hf_mbim_connect_info_nw_error, tvb, offset, 4, nw_error);
2209 static void
2210 mbim_dissect_context(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, gboolean is_set)
2212 gint base_offset;
2213 guint32 access_string_offset, access_string_size, user_name_offset, user_name_size,
2214 password_offset, password_size, provider_id_offset = 0, provider_id_size = 0;;
2216 base_offset = offset;
2217 proto_tree_add_item(tree, hf_mbim_context_context_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2218 offset += 4;
2219 mbim_dissect_context_type_uuid(tvb, pinfo, tree, &offset);
2220 access_string_offset = tvb_get_letohl(tvb, offset);
2221 proto_tree_add_uint(tree, hf_mbim_context_access_string_offset, tvb, offset, 4, access_string_offset);
2222 offset += 4;
2223 access_string_size = tvb_get_letohl(tvb, offset);
2224 proto_tree_add_uint(tree, hf_mbim_context_access_string_size, tvb, offset, 4, access_string_size);
2225 offset += 4;
2226 user_name_offset = tvb_get_letohl(tvb, offset);
2227 proto_tree_add_uint(tree, hf_mbim_context_user_name_offset, tvb, offset, 4, user_name_offset);
2228 offset += 4;
2229 user_name_size = tvb_get_letohl(tvb, offset);
2230 proto_tree_add_uint(tree, hf_mbim_context_user_name_size, tvb, offset, 4, user_name_size);
2231 offset += 4;
2232 password_offset = tvb_get_letohl(tvb, offset);
2233 proto_tree_add_uint(tree, hf_mbim_context_password_offset, tvb, offset, 4, password_offset);
2234 offset += 4;
2235 password_size = tvb_get_letohl(tvb, offset);
2236 proto_tree_add_uint(tree, hf_mbim_context_password_size, tvb, offset, 4, password_size);
2237 offset += 4;
2238 proto_tree_add_item(tree, hf_mbim_context_compression, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2239 offset += 4;
2240 proto_tree_add_item(tree, hf_mbim_context_auth_protocol, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2241 offset += 4;
2242 if (is_set) {
2243 provider_id_offset = tvb_get_letohl(tvb, offset);
2244 proto_tree_add_uint(tree, hf_mbim_context_provider_id_offset, tvb, offset, 4, provider_id_offset);
2245 offset += 4;
2246 provider_id_size = tvb_get_letohl(tvb, offset);
2247 proto_tree_add_uint(tree, hf_mbim_context_provider_id_size, tvb, offset, 4, provider_id_size);
2248 offset += 4;
2250 if (access_string_offset && access_string_size) {
2251 proto_tree_add_item(tree, hf_mbim_context_access_string, tvb, base_offset + access_string_offset,
2252 access_string_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2254 if (user_name_offset && user_name_size) {
2255 proto_tree_add_item(tree, hf_mbim_context_user_name, tvb, base_offset + user_name_offset,
2256 user_name_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2258 if (password_offset && password_size) {
2259 proto_tree_add_item(tree, hf_mbim_context_password, tvb, base_offset + password_offset,
2260 password_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2262 if (provider_id_offset && provider_id_size) {
2263 proto_tree_add_item(tree, hf_mbim_context_provider_id, tvb, base_offset + provider_id_offset,
2264 provider_id_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2268 static void
2269 mbim_dissect_provisioned_contexts_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2271 proto_item *ti;
2272 proto_tree *subtree;
2273 gint base_offset;
2274 guint32 i, elem_count, provisioned_contexts_list_offset, provisioned_context_offset, provisioned_context_size;
2276 base_offset = offset;
2277 elem_count = tvb_get_letohl(tvb, offset);
2278 proto_tree_add_uint(tree, hf_mbim_provisioned_contexts_info_elem_count, tvb, offset, 4, elem_count);
2279 offset += 4;
2280 if (elem_count) {
2281 provisioned_contexts_list_offset = offset;
2282 ti = proto_tree_add_text(tree, tvb, offset, 8*elem_count, "Provisioned Context Ref List");
2283 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2284 for (i = 0; i < elem_count; i++) {
2285 proto_tree_add_item(subtree, hf_mbim_provisioned_contexts_info_provisioned_context_offset,
2286 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2287 offset += 4;
2288 proto_tree_add_item(subtree, hf_mbim_provisioned_contexts_info_provisioned_context_size,
2289 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2290 offset += 4;
2292 for (i = 0; i < elem_count; i++) {
2293 provisioned_context_offset = tvb_get_letohl(tvb, provisioned_contexts_list_offset + 8*i);
2294 provisioned_context_size = tvb_get_letohl(tvb, provisioned_contexts_list_offset + 8*i + 4);
2295 if (provisioned_context_offset && provisioned_context_size) {
2296 ti = proto_tree_add_text(tree, tvb, base_offset + provisioned_context_offset,
2297 provisioned_context_size, "Provisioned Context #%u", i+1);
2298 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2299 mbim_dissect_context(tvb, pinfo, subtree, base_offset + provisioned_context_offset, FALSE);
2305 static void
2306 mbim_dissect_ipv4_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset)
2308 guint32 on_link_prefix_length;
2309 proto_item *ti;
2311 on_link_prefix_length = tvb_get_letohl(tvb, *offset);
2312 ti = proto_tree_add_uint(tree, hf_mbim_ipv4_element_on_link_prefix_length, tvb, *offset, 4, on_link_prefix_length);
2313 *offset += 4;
2314 if (on_link_prefix_length > 32) {
2315 expert_add_info_format(pinfo, ti, &ei_mbim_illegal_on_link_prefix_length,
2316 "Illegal On Link Prefix Length %u (max is 32)", on_link_prefix_length);
2318 proto_tree_add_item(tree, hf_mbim_ipv4_element_ipv4_address, tvb, *offset, 4, ENC_NA);
2319 *offset += 4;
2322 static void
2323 mbim_dissect_ipv6_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset)
2325 guint32 on_link_prefix_length;
2326 proto_item *ti;
2328 on_link_prefix_length = tvb_get_letohl(tvb, *offset);
2329 ti = proto_tree_add_uint(tree, hf_mbim_ipv6_element_on_link_prefix_length, tvb, *offset, 4, on_link_prefix_length);
2330 *offset += 4;
2331 if (on_link_prefix_length > 128) {
2332 expert_add_info_format(pinfo, ti, &ei_mbim_illegal_on_link_prefix_length,
2333 "Illegal On Link Prefix Length %u (max is 128)", on_link_prefix_length);
2335 proto_tree_add_item(tree, hf_mbim_ipv6_element_ipv6_address, tvb, *offset, 16, ENC_NA);
2336 *offset += 16;
2339 static void
2340 mbim_dissect_ip_configuration_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2342 gint base_offset;
2343 guint32 i, ipv4_address_count, ipv4_address_offset, ipv6_address_count, ipv6_address_offset,
2344 ipv4_gateway_offset, ipv6_gateway_offset, ipv4_dns_count, ipv4_dns_offset,
2345 ipv6_dns_count, ipv6_dns_offset;
2347 base_offset = offset;
2348 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2349 offset += 4;
2350 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_ip_configuration_info_ipv4_configuration_available,
2351 ett_mbim_bitmap, mbim_ip_configuration_info_ipv4_configuration_available_fields, ENC_LITTLE_ENDIAN);
2352 offset += 4;
2353 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_ip_configuration_info_ipv6_configuration_available,
2354 ett_mbim_bitmap, mbim_ip_configuration_info_ipv6_configuration_available_fields, ENC_LITTLE_ENDIAN);
2355 offset += 4;
2356 ipv4_address_count = tvb_get_letohl(tvb, offset);
2357 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv4_address_count, tvb, offset, 4, ipv4_address_count);
2358 offset += 4;
2359 ipv4_address_offset = tvb_get_letohl(tvb, offset);
2360 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv4_address_offset, tvb, offset, 4, ipv4_address_offset);
2361 offset += 4;
2362 ipv6_address_count = tvb_get_letohl(tvb, offset);
2363 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv6_address_count, tvb, offset, 4, ipv6_address_count);
2364 offset += 4;
2365 ipv6_address_offset = tvb_get_letohl(tvb, offset);
2366 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv6_address_offset, tvb, offset, 4, ipv6_address_offset);
2367 offset += 4;
2368 ipv4_gateway_offset = tvb_get_letohl(tvb, offset);
2369 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv4_gateway_offset, tvb, offset, 4, ipv4_gateway_offset);
2370 offset += 4;
2371 ipv6_gateway_offset = tvb_get_letohl(tvb, offset);
2372 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv6_gateway_offset, tvb, offset, 4, ipv6_gateway_offset);
2373 offset += 4;
2374 ipv4_dns_count = tvb_get_letohl(tvb, offset);
2375 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv4_dns_count, tvb, offset, 4, ipv4_dns_count);
2376 offset += 4;
2377 ipv4_dns_offset = tvb_get_letohl(tvb, offset);
2378 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv4_dns_offset, tvb, offset, 4, ipv4_dns_offset);
2379 offset += 4;
2380 ipv6_dns_count = tvb_get_letohl(tvb, offset);
2381 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv6_dns_count, tvb, offset, 4, ipv6_dns_count);
2382 offset += 4;
2383 ipv6_dns_offset = tvb_get_letohl(tvb, offset);
2384 proto_tree_add_uint(tree, hf_mbim_ip_configuration_info_ipv6_dns_offset, tvb, offset, 4, ipv6_dns_offset);
2385 offset += 4;
2386 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv4_mtu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2387 offset += 4;
2388 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv6_mtu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2389 offset += 4;
2390 if (ipv4_address_count && ipv4_address_offset) {
2391 offset = base_offset + ipv4_address_offset;
2392 for (i = 0; i < ipv4_address_count; i++) {
2393 mbim_dissect_ipv4_element(tvb, pinfo, tree, &offset);
2396 if (ipv6_address_count && ipv6_address_offset) {
2397 offset = base_offset + ipv6_address_offset;
2398 for (i = 0; i < ipv6_address_count; i++) {
2399 mbim_dissect_ipv6_element(tvb, pinfo, tree, &offset);
2402 if (ipv4_gateway_offset) {
2403 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv4_gateway,
2404 tvb, base_offset + ipv4_gateway_offset, 4, ENC_NA);
2406 if (ipv6_gateway_offset) {
2407 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv6_gateway,
2408 tvb, base_offset + ipv6_gateway_offset, 16, ENC_NA);
2410 if (ipv4_dns_count && ipv4_dns_offset) {
2411 offset = base_offset + ipv4_dns_offset;
2412 for (i = 0; i < ipv4_dns_count; i++) {
2413 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv4_dns,
2414 tvb, offset, 4, ENC_NA);
2415 offset += 4;
2418 if (ipv6_dns_count && ipv6_dns_offset) {
2419 offset = base_offset + ipv6_dns_offset;
2420 for (i = 0; i < ipv6_dns_count; i++) {
2421 proto_tree_add_item(tree, hf_mbim_ip_configuration_info_ipv6_dns,
2422 tvb, offset, 16, ENC_NA);
2423 offset += 16;
2428 static void
2429 mbim_dissect_device_service_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2431 guint8 uuid_idx;
2432 guint32 i, cid_count, cid;
2434 uuid_idx = mbim_dissect_service_id_uuid(tvb, pinfo, tree, hf_mbim_device_service_element_device_service_id, &offset);
2435 proto_tree_add_bitmask(tree, tvb, offset, hf_mbim_device_service_element_dss_payload,
2436 ett_mbim_bitmap, mbim_device_service_element_dss_payload_fields, ENC_LITTLE_ENDIAN);
2437 offset += 4;
2438 proto_tree_add_item(tree, hf_mbim_device_service_element_max_dss_instances, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2439 offset += 4;
2440 cid_count = tvb_get_letohl(tvb, offset);
2441 proto_tree_add_uint(tree, hf_mbim_device_service_element_cid_count, tvb, offset, 4, cid_count);
2442 offset += 4;
2443 for (i = 0; i < cid_count; i++) {
2444 cid = tvb_get_letohl(tvb, offset);
2445 switch (uuid_idx) {
2446 case UUID_BASIC_CONNECT:
2447 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2448 val_to_str_ext_const(cid, &mbim_uuid_basic_connect_cid_vals_ext, "Unknown"), cid);
2449 break;
2450 case UUID_SMS:
2451 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2452 val_to_str_const(cid, mbim_uuid_sms_cid_vals, "Unknown"), cid);
2453 break;
2454 case UUID_USSD:
2455 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2456 val_to_str_const(cid, mbim_uuid_ussd_cid_vals, "Unknown"), cid);
2457 break;
2458 case UUID_PHONEBOOK:
2459 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2460 val_to_str_const(cid, mbim_uuid_phonebook_cid_vals, "Unknown"), cid);
2461 break;
2462 case UUID_STK:
2463 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2464 val_to_str_const(cid, mbim_uuid_stk_cid_vals, "Unknown"), cid);
2465 break;
2466 case UUID_AUTH:
2467 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2468 val_to_str_const(cid, mbim_uuid_auth_cid_vals, "Unknown"), cid);
2469 break;
2470 case UUID_DSS:
2471 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2472 val_to_str_const(cid, mbim_uuid_dss_cid_vals, "Unknown"), cid);
2473 break;
2474 case UUID_MULTICARRIER:
2475 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2476 val_to_str_const(cid, mbim_uuid_multicarrier_cid_vals, "Unknown"), cid);
2477 break;
2478 case UUID_MS_HOSTSHUTDOWN:
2479 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2480 val_to_str_const(cid, mbim_uuid_ms_hostshutdown_cid_vals, "Unknown"), cid);
2481 break;
2482 case UUID_MSFWID:
2483 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2484 val_to_str_const(cid, mbim_uuid_msfwid_cid_vals, "Unknown"), cid);
2485 break;
2486 default:
2487 proto_tree_add_uint(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid);
2488 break;
2490 offset += 4;
2494 static void
2495 mbim_dissect_device_services_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2497 proto_item *ti;
2498 proto_tree *subtree;
2499 gint base_offset;
2500 guint32 i, device_services_count, device_services_ref_list_base, device_service_elem_offset,
2501 device_service_elem_size;
2503 base_offset = offset;
2504 device_services_count = tvb_get_letohl(tvb, offset);
2505 proto_tree_add_uint(tree, hf_mbim_device_services_info_device_services_count, tvb, offset, 4, device_services_count);
2506 offset += 4;
2507 proto_tree_add_item(tree, hf_mbim_device_services_info_max_dss_sessions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2508 offset += 4;
2509 if (device_services_count) {
2510 device_services_ref_list_base = offset;
2511 ti = proto_tree_add_text(tree, tvb, offset, 8*device_services_count, "Device Services Ref List");
2512 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2513 for (i = 0; i < device_services_count; i++) {
2514 proto_tree_add_item(subtree, hf_mbim_device_services_info_device_services_offset,
2515 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2516 offset += 4;
2517 proto_tree_add_item(subtree, hf_mbim_device_services_info_device_services_size,
2518 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2519 offset += 4;
2521 for (i = 0; i < device_services_count; i++) {
2522 device_service_elem_offset = tvb_get_letohl(tvb, device_services_ref_list_base + 8*i);
2523 device_service_elem_size = tvb_get_letohl(tvb, device_services_ref_list_base + 8*i + 4);
2524 if (device_service_elem_offset && device_service_elem_size) {
2525 ti = proto_tree_add_text(tree, tvb, base_offset + device_service_elem_offset,
2526 device_service_elem_size, "Device Service Element #%u", i+1);
2527 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2528 mbim_dissect_device_service_element(tvb, pinfo, subtree, base_offset + device_service_elem_offset);
2534 static void
2535 mbim_dissect_event_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2537 guint8 uuid_idx;
2538 guint32 i, cid_count, cid;
2540 uuid_idx = mbim_dissect_service_id_uuid(tvb, pinfo, tree, hf_mbim_event_entry_device_service_id, &offset);
2541 cid_count = tvb_get_letohl(tvb, offset);
2542 proto_tree_add_uint(tree, hf_mbim_event_entry_cid_count, tvb, offset, 4, cid_count);
2543 offset += 4;
2544 for (i = 0; i < cid_count; i++) {
2545 cid = tvb_get_letohl(tvb, offset);
2546 switch (uuid_idx) {
2547 case UUID_BASIC_CONNECT:
2548 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
2549 val_to_str_ext_const(cid, &mbim_uuid_basic_connect_cid_vals_ext, "Unknown"), cid);
2550 break;
2551 case UUID_SMS:
2552 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
2553 val_to_str_const(cid, mbim_uuid_sms_cid_vals, "Unknown"), cid);
2554 break;
2555 case UUID_USSD:
2556 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
2557 val_to_str_const(cid, mbim_uuid_ussd_cid_vals, "Unknown"), cid);
2558 break;
2559 case UUID_PHONEBOOK:
2560 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
2561 val_to_str_const(cid, mbim_uuid_phonebook_cid_vals, "Unknown"), cid);
2562 break;
2563 case UUID_STK:
2564 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
2565 val_to_str_const(cid, mbim_uuid_stk_cid_vals, "Unknown"), cid);
2566 break;
2567 case UUID_AUTH:
2568 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
2569 val_to_str_const(cid, mbim_uuid_auth_cid_vals, "Unknown"), cid);
2570 break;
2571 case UUID_DSS:
2572 proto_tree_add_uint_format_value(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid, "%s (%u)",
2573 val_to_str_const(cid, mbim_uuid_dss_cid_vals, "Unknown"), cid);
2574 break;
2575 case UUID_MULTICARRIER:
2576 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2577 val_to_str_const(cid, mbim_uuid_multicarrier_cid_vals, "Unknown"), cid);
2578 break;
2579 case UUID_MS_HOSTSHUTDOWN:
2580 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2581 val_to_str_const(cid, mbim_uuid_ms_hostshutdown_cid_vals, "Unknown"), cid);
2582 break;
2583 case UUID_MSFWID:
2584 proto_tree_add_uint_format_value(tree, hf_mbim_device_service_element_cid, tvb, offset, 4, cid, "%s (%u)",
2585 val_to_str_const(cid, mbim_uuid_msfwid_cid_vals, "Unknown"), cid);
2586 break;
2587 default:
2588 proto_tree_add_uint(tree, hf_mbim_event_entry_cid, tvb, offset, 4, cid);
2589 break;
2591 offset += 4;
2595 static void
2596 mbim_dissect_device_service_subscribe_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2598 proto_item *ti;
2599 proto_tree *subtree;
2600 gint base_offset;
2601 guint32 i, element_count, device_service_subscribe_ref_list_base, device_service_elem_offset,
2602 device_service_elem_size;
2604 base_offset = offset;
2605 element_count = tvb_get_letohl(tvb, offset);
2606 proto_tree_add_uint(tree, hf_mbim_device_service_subscribe_element_count, tvb, offset, 4, element_count);
2607 offset += 4;
2608 if (element_count) {
2609 device_service_subscribe_ref_list_base = offset;
2610 ti = proto_tree_add_text(tree, tvb, offset, 8*element_count, "Device Service Subscribe Ref List");
2611 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2612 for (i = 0; i < element_count; i++) {
2613 proto_tree_add_item(subtree, hf_mbim_device_service_subscribe_device_service_offset,
2614 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2615 offset += 4;
2616 proto_tree_add_item(subtree, hf_mbim_device_service_subscribe_device_service_size,
2617 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2618 offset += 4;
2620 for (i = 0; i < element_count; i++) {
2621 device_service_elem_offset = tvb_get_letohl(tvb, device_service_subscribe_ref_list_base + 8*i);
2622 device_service_elem_size = tvb_get_letohl(tvb, device_service_subscribe_ref_list_base + 8*i + 4);
2623 if (device_service_elem_offset && device_service_elem_size) {
2624 ti = proto_tree_add_text(tree, tvb, base_offset + device_service_elem_offset,
2625 device_service_elem_size, "Device Service Element #%u", i+1);
2626 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2627 mbim_dissect_event_entry(tvb, pinfo, subtree, base_offset + device_service_elem_offset);
2633 static void
2634 mbim_dissect_packet_statistics_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2636 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_in_discards, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2637 offset += 4;
2638 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_in_errors, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2639 offset += 4;
2640 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_in_octets, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2641 offset += 8;
2642 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_in_packets, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2643 offset += 8;
2644 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_out_octets, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2645 offset += 8;
2646 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_out_packets, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2647 offset += 8;
2648 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_out_errors, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2649 offset += 4;
2650 proto_tree_add_item(tree, hf_mbim_packet_statistics_info_out_discards, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2653 static void
2654 mbim_dissect_single_packet_filter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2656 gint base_offset;
2657 guint32 filter_size, packet_filter_offset, packet_mask_offset;
2659 base_offset = offset;
2660 filter_size = tvb_get_letohl(tvb, offset);
2661 proto_tree_add_uint(tree, hf_mbim_single_packet_filter_filter_size, tvb, offset, 4, filter_size);
2662 offset += 4;
2663 packet_filter_offset = tvb_get_letohl(tvb, offset);
2664 proto_tree_add_uint(tree, hf_mbim_single_packet_filter_packet_filter_offset, tvb, offset, 4, packet_filter_offset);
2665 offset += 4;
2666 packet_mask_offset = tvb_get_letohl(tvb, offset);
2667 proto_tree_add_uint(tree, hf_mbim_single_packet_filter_packet_mask_offset, tvb, offset, 4, packet_mask_offset);
2668 /*offset += 4;*/
2669 if (filter_size) {
2670 if (packet_filter_offset) {
2671 proto_tree_add_item(tree, hf_mbim_single_packet_filter_packet_filter, tvb, base_offset + packet_filter_offset,
2672 filter_size, ENC_NA);
2674 if (packet_mask_offset) {
2675 proto_tree_add_item(tree, hf_mbim_single_packet_filter_packet_mask, tvb, base_offset + packet_mask_offset,
2676 filter_size, ENC_NA);
2681 static void
2682 mbim_dissect_packet_filters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2684 proto_item *ti;
2685 proto_tree *subtree;
2686 gint base_offset;
2687 guint32 i, packet_filters_count, packet_filter_ref_list_base, packet_filter_offset, packet_filter_size;
2689 base_offset = offset;
2690 proto_tree_add_item(tree, hf_mbim_packet_filters_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2691 offset += 4;
2692 packet_filters_count = tvb_get_letohl(tvb, offset);
2693 proto_tree_add_uint(tree, hf_mbim_packet_filters_packet_filters_count, tvb, offset, 4, packet_filters_count);
2694 offset += 4;
2695 if (packet_filters_count) {
2696 packet_filter_ref_list_base = offset;
2697 ti = proto_tree_add_text(tree, tvb, offset, 8*packet_filters_count, "Packet Filter Ref List");
2698 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2699 for (i = 0; i < packet_filters_count; i++) {
2700 proto_tree_add_item(subtree, hf_mbim_packet_filters_packet_filters_packet_filter_offset,
2701 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2702 offset += 4;
2703 proto_tree_add_item(subtree, hf_mbim_packet_filters_packet_filters_packet_filter_size,
2704 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2705 offset += 4;
2707 for (i = 0; i < packet_filters_count; i++) {
2708 packet_filter_offset = tvb_get_letohl(tvb, packet_filter_ref_list_base + 8*i);
2709 packet_filter_size = tvb_get_letohl(tvb, packet_filter_ref_list_base + 8*i + 4);
2710 if (packet_filter_offset && packet_filter_size) {
2711 ti = proto_tree_add_text(tree, tvb, base_offset + packet_filter_offset,
2712 packet_filter_size, "Packet Filter Element #%u", i+1);
2713 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2714 mbim_dissect_single_packet_filter(tvb, pinfo, subtree, base_offset + packet_filter_offset);
2720 static void
2721 mbim_dissect_set_sms_configuration(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2723 gint base_offset;
2724 guint32 sc_address_offset, sc_address_size;
2726 base_offset = offset;
2727 proto_tree_add_item(tree, hf_mbim_set_sms_configuration_format, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2728 offset += 4;
2729 sc_address_offset = tvb_get_letohl(tvb, offset);
2730 proto_tree_add_uint(tree, hf_mbim_set_sms_configuration_sc_address_offset, tvb, offset, 4, sc_address_offset);
2731 offset += 4;
2732 sc_address_size = tvb_get_letohl(tvb, offset);
2733 proto_tree_add_uint(tree, hf_mbim_set_sms_configuration_sc_address_size, tvb, offset, 4, sc_address_size);
2734 /*offset += 4;*/
2735 if (sc_address_offset && sc_address_size) {
2736 proto_tree_add_item(tree, hf_mbim_set_sms_configuration_sc_address, tvb, base_offset + sc_address_offset,
2737 sc_address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2741 static void
2742 mbim_dissect_sms_configuration_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2744 gint base_offset;
2745 guint32 sc_address_offset, sc_address_size;
2747 base_offset = offset;
2748 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_sms_storage_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2749 offset += 4;
2750 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_format, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2751 offset += 4;
2752 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_max_messages, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2753 offset += 4;
2754 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_cdma_short_message_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2755 offset += 4;
2756 sc_address_offset = tvb_get_letohl(tvb, offset);
2757 proto_tree_add_uint(tree, hf_mbim_sms_configuration_info_sc_address_offset, tvb, offset, 4, sc_address_offset);
2758 offset += 4;
2759 sc_address_size = tvb_get_letohl(tvb, offset);
2760 proto_tree_add_uint(tree, hf_mbim_sms_configuration_info_sc_address_size, tvb, offset, 4, sc_address_size);
2761 /*offset += 4;*/
2762 if (sc_address_offset && sc_address_size) {
2763 proto_tree_add_item(tree, hf_mbim_sms_configuration_info_sc_address, tvb, base_offset + sc_address_offset,
2764 sc_address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2768 static void
2769 mbim_dissect_sms_pdu_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
2770 struct mbim_conv_info *mbim_conv)
2772 gint base_offset;
2773 guint32 pdu_data_offset, pdu_data_size;
2774 tvbuff_t *sms_tvb;
2775 proto_item *ti;
2776 proto_tree *subtree;
2778 base_offset = offset;
2779 proto_tree_add_item(tree, hf_mbim_sms_pdu_record_message_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2780 offset += 4;
2781 proto_tree_add_item(tree, hf_mbim_sms_pdu_record_message_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2782 offset += 4;
2783 pdu_data_offset = tvb_get_letohl(tvb, offset);
2784 proto_tree_add_uint(tree, hf_mbim_sms_pdu_record_pdu_data_offset, tvb, offset, 4, pdu_data_offset);
2785 offset += 4;
2786 pdu_data_size = tvb_get_letohl(tvb, offset);
2787 proto_tree_add_uint(tree, hf_mbim_sms_pdu_record_pdu_data_size, tvb, offset, 4, pdu_data_size);
2788 /*offset += 4;*/
2789 if (pdu_data_offset && pdu_data_size) {
2790 ti = proto_tree_add_item(tree, hf_mbim_sms_pdu_record_pdu_data, tvb, base_offset + pdu_data_offset,
2791 pdu_data_size, ENC_NA);
2792 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
2793 sms_tvb = tvb_new_subset(tvb, base_offset + pdu_data_offset, pdu_data_size, pdu_data_size);
2794 if (mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_GSM) {
2795 call_dissector(gsm_sms_handle, sms_tvb, pinfo, subtree);
2796 } else if (mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_CDMA) {
2797 call_dissector(cdma_sms_handle, sms_tvb, pinfo, subtree);
2802 static void
2803 mbim_dissect_sms_cdma_record(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2805 gint base_offset;
2806 guint32 address_offset, address_size, timestamp_offset, timestamp_size, encoded_message_offset,
2807 size_in_bytes;
2809 base_offset = offset;
2810 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_message_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2811 offset += 4;
2812 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_message_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2813 offset += 4;
2814 address_offset = tvb_get_letohl(tvb, offset);
2815 proto_tree_add_uint(tree, hf_mbim_sms_cdma_record_address_offset, tvb, offset, 4, address_offset);
2816 offset += 4;
2817 address_size = tvb_get_letohl(tvb, offset);
2818 proto_tree_add_uint(tree, hf_mbim_sms_cdma_record_address_size, tvb, offset, 4, address_size);
2819 offset += 4;
2820 timestamp_offset = tvb_get_letohl(tvb, offset);
2821 proto_tree_add_uint(tree, hf_mbim_sms_cdma_record_timestamp_offset, tvb, offset, 4, timestamp_offset);
2822 offset += 4;
2823 timestamp_size = tvb_get_letohl(tvb, offset);
2824 proto_tree_add_uint(tree, hf_mbim_sms_cdma_record_timestamp_size, tvb, offset, 4, timestamp_size);
2825 offset += 4;
2826 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_encoding_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2827 offset += 4;
2828 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_language_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2829 offset += 4;
2830 encoded_message_offset = tvb_get_letohl(tvb, offset);
2831 proto_tree_add_uint(tree, hf_mbim_sms_cdma_record_encoded_message_offset, tvb, offset, 4,
2832 encoded_message_offset);
2833 offset += 4;
2834 size_in_bytes = tvb_get_letohl(tvb, offset);
2835 proto_tree_add_uint(tree, hf_mbim_sms_cdma_record_size_in_bytes, tvb, offset, 4, size_in_bytes);
2836 offset += 4;
2837 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_size_in_characters, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2838 /*offset += 4;*/
2839 if (address_offset && address_size) {
2840 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_address, tvb, base_offset + address_offset,
2841 address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2843 if (timestamp_offset && timestamp_size) {
2844 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_timestamp, tvb, base_offset + timestamp_offset,
2845 timestamp_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2847 if (encoded_message_offset && size_in_bytes) {
2848 proto_tree_add_item(tree, hf_mbim_sms_cdma_record_encoded_message, tvb, base_offset + encoded_message_offset,
2849 size_in_bytes, ENC_NA);
2853 static void
2854 mbim_dissect_sms_read_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2856 proto_tree_add_item(tree, hf_mbim_sms_read_req_format, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2857 offset += 4;
2858 proto_tree_add_item(tree, hf_mbim_sms_read_req_flag, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2859 offset += 4;
2860 proto_tree_add_item(tree, hf_mbim_sms_read_req_message_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2863 static void
2864 mbim_dissect_sms_read_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
2865 struct mbim_conv_info *mbim_conv)
2867 proto_item *ti;
2868 proto_tree *subtree;
2869 gint base_offset;
2870 guint32 i, format, element_count, sms_ref_list_base, sms_offset, sms_size;
2872 base_offset = offset;
2873 format = tvb_get_letohl(tvb, offset);
2874 proto_tree_add_uint(tree, hf_mbim_sms_read_info_format, tvb, offset, 4, format);
2875 offset += 4;
2876 element_count = tvb_get_letohl(tvb, offset);
2877 proto_tree_add_uint(tree, hf_mbim_sms_read_info_element_count, tvb, offset, 4, element_count);
2878 offset += 4;
2879 if (element_count) {
2880 sms_ref_list_base = offset;
2881 ti = proto_tree_add_text(tree, tvb, offset, 8*element_count, "SMS Ref List");
2882 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2883 for (i = 0; i < element_count; i++) {
2884 proto_tree_add_item(subtree, hf_mbim_sms_read_info_sms_offset,
2885 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2886 offset += 4;
2887 proto_tree_add_item(subtree, hf_mbim_sms_read_info_sms_size,
2888 tvb, offset, 4, ENC_LITTLE_ENDIAN);
2889 offset += 4;
2891 for (i = 0; i < element_count; i++) {
2892 sms_offset = tvb_get_letohl(tvb, sms_ref_list_base + 8*i);
2893 sms_size = tvb_get_letohl(tvb, sms_ref_list_base + 8*i + 4);
2894 if (sms_offset && sms_size) {
2895 ti = proto_tree_add_text(tree, tvb, base_offset + sms_offset,
2896 sms_size, "SMS Element #%u", i+1);
2897 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
2898 if (format == MBIM_SMS_FORMAT_PDU) {
2899 mbim_dissect_sms_pdu_record(tvb, pinfo, subtree, base_offset + sms_offset, mbim_conv);
2900 } else if (format == MBIM_SMS_FORMAT_CDMA) {
2901 mbim_dissect_sms_cdma_record(tvb, pinfo, subtree, base_offset + sms_offset);
2902 } else {
2903 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unknown_sms_format, tvb,
2904 base_offset + sms_offset, sms_size);
2911 static void
2912 mbim_dissect_sms_send_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
2913 struct mbim_conv_info *mbim_conv)
2915 gint base_offset;
2916 guint32 pdu_data_offset, pdu_data_size;
2917 tvbuff_t *sms_tvb;
2918 proto_item *ti;
2919 proto_tree *subtree;
2921 base_offset = offset;
2922 pdu_data_offset = tvb_get_letohl(tvb, offset);
2923 proto_tree_add_uint(tree, hf_mbim_sms_send_pdu_pdu_data_offset, tvb, offset, 4, pdu_data_offset);
2924 offset += 4;
2925 pdu_data_size = tvb_get_letohl(tvb, offset);
2926 proto_tree_add_uint(tree, hf_mbim_sms_send_pdu_pdu_data_size, tvb, offset, 4, pdu_data_size);
2927 /*offset += 4;*/
2928 if (pdu_data_offset && pdu_data_size) {
2929 ti = proto_tree_add_item(tree, hf_mbim_sms_send_pdu_pdu_data, tvb, base_offset + pdu_data_offset,
2930 pdu_data_size, ENC_NA);
2931 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
2932 sms_tvb = tvb_new_subset(tvb, base_offset + pdu_data_offset, pdu_data_size, pdu_data_size);
2933 if (mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_GSM) {
2934 call_dissector(gsm_sms_handle, sms_tvb, pinfo, subtree);
2935 } else if (mbim_conv->cellular_class & MBIM_CELLULAR_CLASS_CDMA) {
2936 call_dissector(cdma_sms_handle, sms_tvb, pinfo, subtree);
2941 static void
2942 mbim_dissect_sms_send_cdma(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2944 gint base_offset;
2945 guint32 address_offset, address_size, encoded_message_offset, size_in_bytes;
2947 base_offset = offset;
2948 proto_tree_add_item(tree, hf_mbim_sms_send_cdma_encoding_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2949 offset += 4;
2950 proto_tree_add_item(tree, hf_mbim_sms_send_cdma_language_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2951 offset += 4;
2952 address_offset = tvb_get_letohl(tvb, offset);
2953 proto_tree_add_uint(tree, hf_mbim_sms_send_cdma_address_offset, tvb, offset, 4, address_offset);
2954 offset += 4;
2955 address_size = tvb_get_letohl(tvb, offset);
2956 proto_tree_add_uint(tree, hf_mbim_sms_send_cdma_address_size, tvb, offset, 4, address_size);
2957 offset += 4;
2958 encoded_message_offset = tvb_get_letohl(tvb, offset);
2959 proto_tree_add_uint(tree, hf_mbim_sms_send_cdma_encoded_message_offset, tvb, offset, 4,
2960 encoded_message_offset);
2961 offset += 4;
2962 size_in_bytes = tvb_get_letohl(tvb, offset);
2963 proto_tree_add_uint(tree, hf_mbim_sms_send_cdma_size_in_bytes, tvb, offset, 4, size_in_bytes);
2964 offset += 4;
2965 proto_tree_add_item(tree, hf_mbim_sms_send_cdma_size_in_characters, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2966 /*offset += 4;*/
2967 if (address_offset && address_size) {
2968 proto_tree_add_item(tree, hf_mbim_sms_send_cdma_address, tvb, base_offset + address_offset,
2969 address_size, ENC_LITTLE_ENDIAN|ENC_UTF_16);
2971 if (encoded_message_offset && size_in_bytes) {
2972 proto_tree_add_item(tree, hf_mbim_sms_send_cdma_encoded_message, tvb, base_offset + encoded_message_offset,
2973 size_in_bytes, ENC_NA);
2977 static void
2978 mbim_dissect_set_sms_send(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
2979 struct mbim_conv_info *mbim_conv)
2981 guint32 format;
2983 format = tvb_get_letohl(tvb, offset);
2984 proto_tree_add_uint(tree, hf_mbim_set_sms_send_format, tvb, offset, 4, format);
2985 offset += 4;
2986 if (format == MBIM_SMS_FORMAT_PDU) {
2987 mbim_dissect_sms_send_pdu(tvb, pinfo, tree, offset, mbim_conv);
2988 } else if (format == MBIM_SMS_FORMAT_CDMA) {
2989 mbim_dissect_sms_send_cdma(tvb, pinfo, tree, offset);
2990 } else {
2991 proto_tree_add_expert(tree, pinfo, &ei_mbim_unknown_sms_format, tvb, offset, -1);
2995 static void
2996 mbim_dissect_set_ussd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2998 proto_item *ti;
2999 proto_tree *subtree;
3000 gint base_offset;
3001 guint32 ussd_payload_offset, ussd_payload_length;
3002 guint8 encoding, *ussd;
3003 tvbuff_t *ussd_tvb;
3004 int out_len;
3005 gchar *utf8_text;
3006 GIConv cd;
3007 GError *l_conv_error;
3009 base_offset = offset;
3010 proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_action, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3011 offset += 4;
3012 ti = proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_data_coding_scheme, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3013 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
3014 encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, subtree, offset);
3015 offset += 4;
3016 ussd_payload_offset = tvb_get_letohl(tvb, offset);
3017 proto_tree_add_uint(tree, hf_mbim_set_ussd_ussd_ussd_payload_offset, tvb, offset, 4, ussd_payload_offset);
3018 offset += 4;
3019 ussd_payload_length = tvb_get_letohl(tvb, offset);
3020 proto_tree_add_uint(tree, hf_mbim_set_ussd_ussd_ussd_payload_length, tvb, offset, 4, ussd_payload_length);
3021 /*offset += 4;*/
3022 if (ussd_payload_offset && ussd_payload_length) {
3023 ti = proto_tree_add_item(tree, hf_mbim_set_ussd_ussd_ussd_payload, tvb, base_offset + ussd_payload_offset,
3024 ussd_payload_length, ENC_NA);
3025 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
3026 ussd_tvb = tvb_new_subset(tvb, base_offset + ussd_payload_offset, ussd_payload_length, ussd_payload_length);
3027 switch (encoding) {
3028 case SMS_ENCODING_7BIT:
3029 case SMS_ENCODING_7BIT_LANG:
3030 ussd = (guint8*)wmem_alloc(wmem_packet_scope(), ussd_payload_length);
3031 out_len = gsm_sms_char_7bit_unpack(0, ussd_payload_length, ussd_payload_length,
3032 tvb_get_ptr(ussd_tvb, 0, ussd_payload_length), ussd);
3033 ussd[out_len] = '\0';
3034 utf8_text = gsm_sms_chars_to_utf8(ussd, out_len);
3035 proto_tree_add_text(subtree, ussd_tvb, 0, ussd_payload_length, "%s", utf8_text);
3036 break;
3037 case SMS_ENCODING_8BIT:
3038 proto_tree_add_text(subtree, ussd_tvb , 0, ussd_payload_length, "%s",
3039 tvb_get_string(wmem_packet_scope(), ussd_tvb, 0, ussd_payload_length));
3040 break;
3041 case SMS_ENCODING_UCS2:
3042 case SMS_ENCODING_UCS2_LANG:
3043 if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) {
3044 utf8_text = g_convert_with_iconv(tvb_get_ptr(ussd_tvb, 0, ussd_payload_length),
3045 ussd_payload_length, cd, NULL, NULL, &l_conv_error);
3046 if (!l_conv_error) {
3047 proto_tree_add_text(subtree, ussd_tvb, 0, ussd_payload_length, "%s", utf8_text);
3049 g_free(utf8_text);
3050 g_iconv_close(cd);
3052 break;
3053 default:
3054 break;
3059 static void
3060 mbim_dissect_ussd_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3062 proto_item *ti;
3063 proto_tree *subtree;
3064 gint base_offset;
3065 guint32 ussd_payload_offset, ussd_payload_length;
3066 guint8 encoding, *ussd;
3067 tvbuff_t *ussd_tvb;
3068 int out_len;
3069 gchar *utf8_text;
3070 GIConv cd;
3071 GError *l_conv_error;
3073 base_offset = offset;
3074 proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_response, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3075 offset += 4;
3076 proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_session_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3077 offset += 4;
3078 ti = proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_data_coding_scheme, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3079 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
3080 encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, subtree, offset);
3081 offset += 4;
3082 ussd_payload_offset = tvb_get_letohl(tvb, offset);
3083 proto_tree_add_uint(tree, hf_mbim_ussd_info_ussd_payload_offset, tvb, offset, 4, ussd_payload_offset);
3084 offset += 4;
3085 ussd_payload_length = tvb_get_letohl(tvb, offset);
3086 proto_tree_add_uint(tree, hf_mbim_ussd_info_ussd_payload_length, tvb, offset, 4, ussd_payload_length);
3087 /*offset += 4;*/
3088 if (ussd_payload_offset && ussd_payload_length) {
3089 ti = proto_tree_add_item(tree, hf_mbim_ussd_info_ussd_payload, tvb, base_offset + ussd_payload_offset,
3090 ussd_payload_length, ENC_NA);
3091 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
3092 ussd_tvb = tvb_new_subset(tvb, base_offset + ussd_payload_offset, ussd_payload_length, ussd_payload_length);
3093 switch (encoding) {
3094 case SMS_ENCODING_7BIT:
3095 case SMS_ENCODING_7BIT_LANG:
3096 ussd = (guint8*)wmem_alloc(wmem_packet_scope(), ussd_payload_length);
3097 out_len = gsm_sms_char_7bit_unpack(0, ussd_payload_length, ussd_payload_length,
3098 tvb_get_ptr(ussd_tvb, 0, ussd_payload_length), ussd);
3099 ussd[out_len] = '\0';
3100 utf8_text = gsm_sms_chars_to_utf8(ussd, out_len);
3101 proto_tree_add_text(subtree, ussd_tvb, 0, ussd_payload_length, "%s", utf8_text);
3102 break;
3103 case SMS_ENCODING_8BIT:
3104 proto_tree_add_text(subtree, ussd_tvb , 0, ussd_payload_length, "%s",
3105 tvb_get_string(wmem_packet_scope(), ussd_tvb, 0, ussd_payload_length));
3106 break;
3107 case SMS_ENCODING_UCS2:
3108 case SMS_ENCODING_UCS2_LANG:
3109 if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) {
3110 utf8_text = g_convert_with_iconv(tvb_get_ptr(ussd_tvb, 0, ussd_payload_length),
3111 ussd_payload_length, cd, NULL, NULL, &l_conv_error);
3112 if (!l_conv_error) {
3113 proto_tree_add_text(subtree, ussd_tvb, 0, ussd_payload_length, "%s", utf8_text);
3115 g_free(utf8_text);
3116 g_iconv_close(cd);
3118 break;
3119 default:
3120 break;
3125 static void
3126 mbim_dissect_phonebook_configuration_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3128 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_phonebook_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3129 offset += 4;
3130 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_total_nb_of_entries, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3131 offset += 4;
3132 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_used_entries, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3133 offset += 4;
3134 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_max_number_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3135 offset += 4;
3136 proto_tree_add_item(tree, hf_mbim_phonebook_configuration_info_max_name_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3139 static void
3140 mbim_dissect_phonebook_entry(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3142 gint base_offset;
3143 guint32 number_offset, number_length, name_offset, name_length;
3145 base_offset = offset;
3146 proto_tree_add_item(tree, hf_mbim_phonebook_entry_entry_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3147 offset += 4;
3148 number_offset = tvb_get_letohl(tvb, offset);
3149 proto_tree_add_uint(tree, hf_mbim_phonebook_entry_number_offset, tvb, offset, 4, number_offset);
3150 offset += 4;
3151 number_length = tvb_get_letohl(tvb, offset);
3152 proto_tree_add_uint(tree, hf_mbim_phonebook_entry_number_length, tvb, offset, 4, number_length);
3153 offset += 4;
3154 name_offset = tvb_get_letohl(tvb, offset);
3155 proto_tree_add_uint(tree, hf_mbim_phonebook_entry_name_offset, tvb, offset, 4, name_offset);
3156 offset += 4;
3157 name_length = tvb_get_letohl(tvb, offset);
3158 proto_tree_add_uint(tree, hf_mbim_phonebook_entry_name_length, tvb, offset, 4, name_length);
3159 /*offset += 4;*/
3160 if (number_offset && number_length) {
3161 proto_tree_add_item(tree, hf_mbim_phonebook_entry_number, tvb, base_offset + number_offset,
3162 number_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3164 if (name_offset && name_length) {
3165 proto_tree_add_item(tree, hf_mbim_phonebook_entry_name, tvb, base_offset + name_offset,
3166 name_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3170 static void
3171 mbim_dissect_phonebook_read_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3173 proto_item *ti;
3174 proto_tree *subtree;
3175 gint base_offset;
3176 guint32 i, element_count, phonebook_ref_list_base, phonebook_offset, phonebook_size;
3178 base_offset = offset;
3179 element_count = tvb_get_letohl(tvb, offset);
3180 proto_tree_add_uint(tree, hf_mbim_phonebook_read_info_element_count, tvb, offset, 4, element_count);
3181 offset += 4;
3182 if (element_count) {
3183 phonebook_ref_list_base = offset;
3184 ti = proto_tree_add_text(tree, tvb, offset, 8*element_count, "Phonebook Ref List");
3185 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
3186 for (i = 0; i < element_count; i++) {
3187 proto_tree_add_item(subtree, hf_mbim_phonebook_read_info_phonebook_offset,
3188 tvb, offset, 4, ENC_LITTLE_ENDIAN);
3189 offset += 4;
3190 proto_tree_add_item(subtree, hf_mbim_phonebook_read_info_phonebook_size,
3191 tvb, offset, 4, ENC_LITTLE_ENDIAN);
3192 offset += 4;
3194 for (i = 0; i < element_count; i++) {
3195 phonebook_offset = tvb_get_letohl(tvb, phonebook_ref_list_base + 8*i);
3196 phonebook_size = tvb_get_letohl(tvb, phonebook_ref_list_base + 8*i + 4);
3197 if (phonebook_offset && phonebook_size) {
3198 ti = proto_tree_add_text(tree, tvb, base_offset + phonebook_offset,
3199 phonebook_size, "Phonebook Element #%u", i+1);
3200 subtree = proto_item_add_subtree(ti, ett_mbim_pair_list);
3201 mbim_dissect_phonebook_entry(tvb, pinfo, subtree, base_offset + phonebook_offset);
3207 static void
3208 mbim_dissect_set_phonebook_write(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3210 gint base_offset;
3211 guint32 number_offset, number_length, name_offset, name_length;
3213 base_offset = offset;
3214 proto_tree_add_item(tree, hf_mbim_set_phonebook_write_save_flag, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3215 offset += 4;
3216 proto_tree_add_item(tree, hf_mbim_set_phonebook_write_save_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3217 offset += 4;
3218 number_offset = tvb_get_letohl(tvb, offset);
3219 proto_tree_add_uint(tree, hf_mbim_set_phonebook_write_number_offset, tvb, offset, 4, number_offset);
3220 offset += 4;
3221 number_length = tvb_get_letohl(tvb, offset);
3222 proto_tree_add_uint(tree, hf_mbim_set_phonebook_write_number_length, tvb, offset, 4, number_length);
3223 offset += 4;
3224 name_offset = tvb_get_letohl(tvb, offset);
3225 proto_tree_add_uint(tree, hf_mbim_set_phonebook_write_name_offset, tvb, offset, 4, name_offset);
3226 offset += 4;
3227 name_length = tvb_get_letohl(tvb, offset);
3228 proto_tree_add_uint(tree, hf_mbim_set_phonebook_write_name_length, tvb, offset, 4, name_length);
3229 /*offset += 4;*/
3230 if (number_offset && number_length) {
3231 proto_tree_add_item(tree, hf_mbim_set_phonebook_write_number, tvb, base_offset + number_offset,
3232 number_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3234 if (name_offset && name_length) {
3235 proto_tree_add_item(tree, hf_mbim_set_phonebook_write_name, tvb, base_offset + name_offset,
3236 name_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3240 static void
3241 mbim_dissect_set_stk_terminal_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3243 tvbuff_t *pac_tvb;
3244 guint32 response_length;
3245 proto_item *ti;
3246 proto_tree *subtree;
3248 response_length = tvb_get_letohl(tvb, offset);
3249 proto_tree_add_uint(tree, hf_mbim_set_stk_terminal_response_response_length, tvb, offset, 4, response_length);
3250 offset += 4;
3251 ti = proto_tree_add_item(tree, hf_mbim_set_stk_terminal_response_data_buffer, tvb, offset, response_length, ENC_NA);
3252 if (etsi_cat_handle) {
3253 subtree = proto_item_add_subtree(ti, ett_mbim_buffer);
3254 pac_tvb = tvb_new_subset(tvb, offset, response_length, response_length);
3255 call_dissector(etsi_cat_handle, pac_tvb, pinfo, subtree);
3259 static void
3260 mbim_dissect_stk_terminal_response_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3262 gint base_offset;
3263 guint32 result_data_string_offset, result_data_string_length;
3265 base_offset = offset;
3266 result_data_string_offset = tvb_get_letohl(tvb, offset);
3267 proto_tree_add_uint(tree, hf_mbim_stk_terminal_response_info_result_data_string_offset,
3268 tvb, offset, 4, result_data_string_offset);
3269 offset += 4;
3270 result_data_string_length = tvb_get_letohl(tvb, offset);
3271 proto_tree_add_uint(tree, hf_mbim_stk_terminal_response_info_result_data_string_length,
3272 tvb, offset, 4, result_data_string_length);
3273 offset += 4;
3274 proto_tree_add_item(tree, hf_mbim_stk_terminal_response_info_status_word, tvb, offset,
3275 4, ENC_LITTLE_ENDIAN);
3276 if (result_data_string_offset && result_data_string_length) {
3277 proto_tree_add_item(tree, hf_mbim_stk_terminal_response_info_result_data_string, tvb,
3278 base_offset + result_data_string_offset, result_data_string_length, ENC_NA);
3282 static void
3283 mbim_dissect_aka_auth_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3285 proto_tree_add_item(tree, hf_mbim_aka_auth_req_rand, tvb, offset, 16, ENC_NA);
3286 offset += 16;
3287 proto_tree_add_item(tree, hf_mbim_aka_auth_req_autn, tvb, offset, 16, ENC_NA);
3290 static void
3291 mbim_dissect_aka_auth_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3293 proto_tree_add_item(tree, hf_mbim_aka_auth_info_res, tvb, offset, 16, ENC_NA);
3294 offset += 16;
3295 proto_tree_add_item(tree, hf_mbim_aka_auth_info_res_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3296 offset += 4;
3297 proto_tree_add_item(tree, hf_mbim_aka_auth_info_ik, tvb, offset, 16, ENC_NA);
3298 offset += 16;
3299 proto_tree_add_item(tree, hf_mbim_aka_auth_info_ck, tvb, offset, 16, ENC_NA);
3300 offset += 16;
3301 proto_tree_add_item(tree, hf_mbim_aka_auth_info_auts, tvb, offset, 14, ENC_NA);
3304 static void
3305 mbim_dissect_akap_auth_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3307 gint base_offset;
3308 guint32 network_name_offset, network_name_length;
3310 base_offset = offset;
3311 proto_tree_add_item(tree, hf_mbim_akap_auth_req_rand, tvb, offset, 16, ENC_NA);
3312 offset += 16;
3313 proto_tree_add_item(tree, hf_mbim_akap_auth_req_autn, tvb, offset, 16, ENC_NA);
3314 offset += 16;
3315 network_name_offset = tvb_get_letohl(tvb, offset);
3316 proto_tree_add_uint(tree, hf_mbim_akap_auth_req_network_name_offset, tvb, offset, 4, network_name_offset);
3317 offset += 4;
3318 network_name_length = tvb_get_letohl(tvb, offset);
3319 proto_tree_add_uint(tree, hf_mbim_akap_auth_req_network_name_length, tvb, offset, 4, network_name_length);
3320 /*offset += 4;*/
3321 if (network_name_offset && network_name_length) {
3322 proto_tree_add_item(tree, hf_mbim_akap_auth_req_network_name, tvb, base_offset + network_name_offset,
3323 network_name_length, ENC_LITTLE_ENDIAN|ENC_UTF_16);
3327 static void
3328 mbim_dissect_akap_auth_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3330 proto_tree_add_item(tree, hf_mbim_akap_auth_info_res, tvb, offset, 16, ENC_NA);
3331 offset += 16;
3332 proto_tree_add_item(tree, hf_mbim_akap_auth_info_res_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3333 offset += 4;
3334 proto_tree_add_item(tree, hf_mbim_akap_auth_info_ik, tvb, offset, 16, ENC_NA);
3335 offset += 16;
3336 proto_tree_add_item(tree, hf_mbim_akap_auth_info_ck, tvb, offset, 16, ENC_NA);
3337 offset += 16;
3338 proto_tree_add_item(tree, hf_mbim_akap_auth_info_auts, tvb, offset, 14, ENC_NA);
3341 static void
3342 mbim_dissect_sim_auth_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3344 proto_tree_add_item(tree, hf_mbim_sim_auth_req_rand1, tvb, offset, 16, ENC_NA);
3345 offset += 16;
3346 proto_tree_add_item(tree, hf_mbim_sim_auth_req_rand2, tvb, offset, 16, ENC_NA);
3347 offset += 16;
3348 proto_tree_add_item(tree, hf_mbim_sim_auth_req_rand3, tvb, offset, 16, ENC_NA);
3349 offset += 16;
3350 proto_tree_add_item(tree, hf_mbim_sim_auth_req_n, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3353 static void
3354 mbim_dissect_sim_auth_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3356 proto_tree_add_item(tree, hf_mbim_sim_auth_info_sres1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3357 offset += 4;
3358 proto_tree_add_item(tree, hf_mbim_sim_auth_info_kc1, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3359 offset += 8;
3360 proto_tree_add_item(tree, hf_mbim_sim_auth_info_sres2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3361 offset += 4;
3362 proto_tree_add_item(tree, hf_mbim_sim_auth_info_kc2, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3363 offset += 8;
3364 proto_tree_add_item(tree, hf_mbim_sim_auth_info_sres3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3365 offset += 4;
3366 proto_tree_add_item(tree, hf_mbim_sim_auth_info_kc3, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3367 offset += 8;
3368 proto_tree_add_item(tree, hf_mbim_sim_auth_info_n, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3371 static void
3372 mbim_dissect_set_dss_connect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3374 proto_tree_add_item(tree, hf_mbim_set_dss_connect_device_service_id, tvb, offset, 16, ENC_NA);
3375 offset += 16;
3376 proto_tree_add_item(tree, hf_mbim_set_dss_connect_dss_session_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3377 offset += 4;
3378 proto_tree_add_item(tree, hf_mbim_set_dss_connect_dss_link_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3381 static void
3382 mbim_dissect_muticarrier_current_cid_list_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3384 guint8 service_idx;
3386 service_idx = mbim_dissect_service_id_uuid(tvb, pinfo, tree, hf_mbim_multicarrier_current_cid_list_req_uuid, &offset);
3387 if (service_idx != UUID_MULTICARRIER) {
3388 expert_add_info_format(pinfo, NULL, &ei_mbim_unexpected_uuid_value,
3389 "Unexpected UUID value, should be UUID_MULTICARRIER");
3393 static void
3394 mbim_dissect_muticarrier_current_cid_list_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3396 guint32 i, cid_count;
3398 cid_count = tvb_get_letohl(tvb, offset);
3399 proto_tree_add_item(tree, hf_mbim_multicarrier_current_cid_list_info_cid_count,
3400 tvb, offset, 4, ENC_LITTLE_ENDIAN);
3401 offset += 4;
3402 for (i = 0; i < cid_count; i++) {
3403 proto_tree_add_item(tree, hf_mbim_multicarrier_current_cid_list_info_cid,
3404 tvb, offset, 4, ENC_LITTLE_ENDIAN);
3405 offset += 4;
3409 static int
3410 dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
3412 proto_item *ti;
3413 proto_tree *mbim_tree, *header_tree, *subtree;
3414 gint offset = 0;
3415 guint32 msg_type, msg_length, trans_id;
3416 conversation_t *conversation;
3417 struct mbim_conv_info *mbim_conv;
3418 struct mbim_info *mbim_info;
3420 if (tvb_length(tvb) < 12) {
3421 return 0;
3424 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MBIM");
3425 col_clear(pinfo->cinfo, COL_INFO);
3427 conversation = find_or_create_conversation(pinfo);
3428 mbim_conv = (struct mbim_conv_info *)conversation_get_proto_data(conversation, proto_mbim);
3429 if (!mbim_conv) {
3430 mbim_conv = wmem_new(wmem_file_scope(), struct mbim_conv_info);
3431 mbim_conv->trans = wmem_tree_new(wmem_file_scope());
3432 mbim_conv->cellular_class = 0;
3433 conversation_add_proto_data(conversation, proto_mbim, mbim_conv);
3436 ti = proto_tree_add_item(tree, proto_mbim, tvb, 0, -1, ENC_NA);
3437 mbim_tree = proto_item_add_subtree(ti, ett_mbim);
3438 ti = proto_tree_add_item(mbim_tree, hf_mbim_control, tvb, 0, 0, ENC_NA);
3439 PROTO_ITEM_SET_HIDDEN(ti);
3441 ti = proto_tree_add_text(mbim_tree, tvb, offset, 12, "Message Header");
3442 header_tree = proto_item_add_subtree(ti, ett_mbim_msg_header);
3443 msg_type = tvb_get_letohl(tvb, offset);
3444 col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(msg_type, mbim_msg_type_vals, "Unknown"));
3445 proto_tree_add_uint(header_tree, hf_mbim_header_message_type, tvb, offset, 4, msg_type);
3446 offset += 4;
3447 msg_length = tvb_get_letohl(tvb, offset);
3448 proto_tree_add_uint(header_tree, hf_mbim_header_message_length, tvb, offset, 4, msg_length);
3449 offset += 4;
3450 trans_id = tvb_get_letohl(tvb, offset);
3451 proto_tree_add_uint(header_tree, hf_mbim_header_transaction_id, tvb, offset, 4, trans_id);
3452 offset += 4;
3454 switch(msg_type) {
3455 case MBIM_OPEN_MSG:
3457 guint32 max_ctrl_transfer;
3459 max_ctrl_transfer = tvb_get_letohl(tvb, offset);
3460 if (max_ctrl_transfer == 8) {
3461 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);
3462 } else {
3463 ti = proto_tree_add_uint(mbim_tree, hf_mbim_max_ctrl_transfer, tvb, offset, 4, max_ctrl_transfer);
3464 if (max_ctrl_transfer < 64) {
3465 expert_add_info(pinfo, ti, &ei_mbim_max_ctrl_transfer);
3469 break;
3470 case MBIM_CLOSE_MSG:
3471 break;
3472 case MBIM_COMMAND_MSG:
3474 guint32 info_buff_len, current_frag, total_frag, cid, cmd_type;
3475 guint8 uuid_idx;
3476 fragment_head *frag_data;
3477 tvbuff_t *frag_tvb;
3479 ti = proto_tree_add_text(mbim_tree, tvb, offset, 8, "Fragment Header");
3480 subtree = proto_item_add_subtree(ti, ett_mbim_frag_header);
3481 total_frag = tvb_get_letohl(tvb, offset);
3482 proto_tree_add_uint(subtree, hf_mbim_fragment_total, tvb, offset, 4, total_frag);
3483 offset += 4;
3484 current_frag = tvb_get_letohl(tvb, offset);
3485 proto_tree_add_uint(subtree, hf_mbim_fragment_current, tvb, offset, 4, current_frag);
3486 offset += 4;
3487 if (total_frag > 1) {
3488 frag_data = fragment_add_seq_check(&mbim_reassembly_table, tvb, offset, pinfo,
3489 trans_id, NULL, current_frag,
3490 tvb_reported_length_remaining(tvb, offset),
3491 (current_frag != (total_frag-1)));
3492 frag_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled MBIM control message",
3493 frag_data, &mbim_frag_items, NULL, subtree);
3494 if (!frag_tvb) {
3495 /* Fragmentation reassembly not performed yet */
3496 proto_tree_add_item(mbim_tree, hf_mbim_fragmented_payload, tvb, offset, -1, ENC_NA);
3497 offset = tvb_length(tvb);
3498 break;
3500 offset = 0;
3501 } else {
3502 frag_tvb = tvb;
3505 if (!PINFO_FD_VISITED(pinfo)) {
3506 mbim_info = wmem_new(wmem_file_scope(), struct mbim_info);
3507 mbim_info->req_frame = PINFO_FD_NUM(pinfo);
3508 mbim_info->resp_frame = 0;
3509 wmem_tree_insert32(mbim_conv->trans, trans_id, mbim_info);
3510 } else {
3511 mbim_info = (struct mbim_info *)wmem_tree_lookup32(mbim_conv->trans, trans_id);
3512 if (mbim_info && mbim_info->resp_frame) {
3513 proto_item *resp_it;
3515 resp_it = proto_tree_add_uint(header_tree, hf_mbim_response_in, tvb, 0, 0, mbim_info->resp_frame);
3516 PROTO_ITEM_SET_GENERATED(resp_it);
3520 uuid_idx = mbim_dissect_service_id_uuid(frag_tvb, pinfo, mbim_tree, hf_mbim_device_service_id, &offset);
3521 cid = mbim_dissect_cid(frag_tvb, pinfo, mbim_tree, &offset, uuid_idx);
3522 cmd_type = tvb_get_letohl(frag_tvb, offset);
3523 proto_tree_add_uint(mbim_tree, hf_mbim_command_type, frag_tvb, offset, 4, cmd_type);
3524 offset += 4;
3525 info_buff_len = tvb_get_letohl(frag_tvb, offset);
3526 proto_tree_add_uint(mbim_tree, hf_mbim_info_buffer_len, frag_tvb, offset, 4, info_buff_len);
3527 offset += 4;
3528 subtree = mbim_tree;
3529 if (info_buff_len) {
3530 ti = proto_tree_add_text(mbim_tree, frag_tvb, offset, info_buff_len, "Information Buffer");
3531 subtree = proto_item_add_subtree(ti, ett_mbim_info_buffer);
3533 switch (uuid_idx) {
3534 case UUID_BASIC_CONNECT:
3535 switch (cid) {
3536 case MBIM_CID_DEVICE_CAPS:
3537 if (cmd_type == MBIM_COMMAND_SET) {
3538 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3539 } else if (info_buff_len) {
3540 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3542 break;
3543 case MBIM_CID_SUBSCRIBER_READY_STATUS:
3544 if (cmd_type == MBIM_COMMAND_SET) {
3545 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3546 } else if (info_buff_len) {
3547 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3549 break;
3550 case MBIM_CID_RADIO_STATE:
3551 if (cmd_type == MBIM_COMMAND_SET) {
3552 proto_tree_add_item(subtree, hf_mbim_radio_state_set, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3553 } else if (info_buff_len) {
3554 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3556 break;
3557 case MBIM_CID_PIN:
3558 if (cmd_type == MBIM_COMMAND_SET) {
3559 mbim_dissect_set_pin(frag_tvb, pinfo, subtree, offset);
3560 } else if (info_buff_len) {
3561 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3563 break;
3564 case MBIM_CID_PIN_LIST:
3565 if (cmd_type == MBIM_COMMAND_SET) {
3566 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3567 } else if (info_buff_len) {
3568 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3570 break;
3571 case MBIM_CID_HOME_PROVIDER:
3572 if (cmd_type == MBIM_COMMAND_SET) {
3573 mbim_dissect_provider(frag_tvb, pinfo, subtree, offset);
3574 } else if (info_buff_len) {
3575 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3577 break;
3578 case MBIM_CID_PREFERRED_PROVIDERS:
3579 if (cmd_type == MBIM_COMMAND_SET) {
3580 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
3581 } else if (info_buff_len) {
3582 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3584 break;
3585 case MBIM_CID_VISIBLE_PROVIDERS:
3586 if (cmd_type == MBIM_COMMAND_SET) {
3587 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3588 } else {
3589 proto_tree_add_item(subtree, hf_mbim_visible_providers_req_action, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3591 break;
3592 case MBIM_CID_REGISTER_STATE:
3593 if (cmd_type == MBIM_COMMAND_SET) {
3594 mbim_dissect_set_register_state(frag_tvb, pinfo, subtree, offset);
3595 } else if (info_buff_len) {
3596 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3598 break;
3599 case MBIM_CID_PACKET_SERVICE:
3600 if (cmd_type == MBIM_COMMAND_SET) {
3601 proto_tree_add_item(subtree, hf_mbim_set_packet_service_action,
3602 frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3603 } else if (info_buff_len) {
3604 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3606 break;
3607 case MBIM_CID_SIGNAL_STATE:
3608 if (cmd_type == MBIM_COMMAND_SET) {
3609 mbim_dissect_set_signal_state(frag_tvb, pinfo, subtree, offset);
3610 } else if (info_buff_len) {
3611 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3613 break;
3614 case MBIM_CID_CONNECT:
3615 if (cmd_type == MBIM_COMMAND_SET) {
3616 mbim_dissect_set_connect(frag_tvb, pinfo, subtree, offset);
3617 } else {
3618 proto_tree_add_item(subtree, hf_mbim_connect_info_session_id, frag_tvb,
3619 offset, 4, ENC_LITTLE_ENDIAN);
3621 break;
3622 case MBIM_CID_PROVISIONED_CONTEXTS:
3623 if (cmd_type == MBIM_COMMAND_SET) {
3624 mbim_dissect_context(frag_tvb, pinfo, subtree, offset, TRUE);
3625 } else if (info_buff_len) {
3626 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3628 break;
3629 case MBIM_CID_SERVICE_ACTIVATION:
3630 if (cmd_type == MBIM_COMMAND_SET) {
3631 proto_tree_add_item(subtree, hf_mbim_set_service_activation_data_buffer,
3632 frag_tvb, offset, info_buff_len, ENC_NA);
3633 } else {
3634 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3636 break;
3637 case MBIM_CID_IP_CONFIGURATION:
3638 if (cmd_type == MBIM_COMMAND_SET) {
3639 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3640 } else {
3641 proto_tree_add_item(subtree, hf_mbim_ip_configuration_info_session_id, frag_tvb,
3642 offset, 4, ENC_LITTLE_ENDIAN);
3644 break;
3645 case MBIM_CID_DEVICE_SERVICES:
3646 if (cmd_type == MBIM_COMMAND_SET) {
3647 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3648 } else if (info_buff_len) {
3649 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3651 break;
3652 case MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST:
3653 if (cmd_type == MBIM_COMMAND_SET) {
3654 mbim_dissect_device_service_subscribe_list(frag_tvb, pinfo, subtree, offset);
3655 } else {
3656 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3658 break;
3659 case MBIM_CID_PACKET_STATISTICS:
3660 if (cmd_type == MBIM_COMMAND_SET) {
3661 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3662 } else if (info_buff_len) {
3663 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3665 break;
3666 case MBIM_CID_NETWORK_IDLE_HINT:
3667 if (cmd_type == MBIM_COMMAND_SET) {
3668 proto_tree_add_item(subtree, hf_mbim_network_idle_hint_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3669 } else if (info_buff_len) {
3670 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3672 break;
3673 case MBIM_CID_EMERGENCY_MODE:
3674 if (cmd_type == MBIM_COMMAND_SET) {
3675 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3676 } else if (info_buff_len) {
3677 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3679 break;
3680 case MBIM_CID_IP_PACKET_FILTERS:
3681 mbim_dissect_packet_filters(frag_tvb, pinfo, subtree, offset);
3682 break;
3683 case MBIM_CID_MULTICARRIER_PROVIDERS:
3684 if (cmd_type == MBIM_COMMAND_SET) {
3685 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
3686 } else if (info_buff_len) {
3687 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3689 break;
3690 default:
3691 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3692 break;
3694 break;
3695 case UUID_SMS:
3696 switch (cid) {
3697 case MBIM_CID_SMS_CONFIGURATION:
3698 if (cmd_type == MBIM_COMMAND_SET) {
3699 mbim_dissect_set_sms_configuration(frag_tvb, pinfo, subtree, offset);
3700 } else if (info_buff_len) {
3701 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3703 break;
3704 case MBIM_CID_SMS_READ:
3705 if (cmd_type == MBIM_COMMAND_SET) {
3706 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3707 } else {
3708 mbim_dissect_sms_read_req(frag_tvb, pinfo, subtree, offset);
3710 break;
3711 case MBIM_CID_SMS_SEND:
3712 if (cmd_type == MBIM_COMMAND_SET) {
3713 mbim_dissect_set_sms_send(frag_tvb, pinfo, subtree, offset, mbim_conv);
3714 } else {
3715 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3717 break;
3718 case MBIM_CID_SMS_DELETE:
3719 if (cmd_type == MBIM_COMMAND_SET) {
3720 proto_tree_add_item(subtree, hf_mbim_set_sms_delete_flag,
3721 frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3722 offset += 4;
3723 proto_tree_add_item(subtree, hf_mbim_set_sms_delete_message_index,
3724 frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3725 } else {
3726 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3728 break;
3729 case MBIM_CID_SMS_MESSAGE_STORE_STATUS:
3730 if (cmd_type == MBIM_COMMAND_SET) {
3731 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3732 } else if (info_buff_len) {
3733 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3735 break;
3736 default:
3737 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3738 break;
3740 break;
3741 case UUID_USSD:
3742 switch (cid) {
3743 case MBIM_CID_USSD:
3744 if (cmd_type == MBIM_COMMAND_SET) {
3745 mbim_dissect_set_ussd(frag_tvb, pinfo, subtree, offset);
3746 } else {
3747 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3749 break;
3750 default:
3751 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3752 break;
3754 break;
3755 case UUID_PHONEBOOK:
3756 switch (cid) {
3757 case MBIM_CID_PHONEBOOK_CONFIGURATION:
3758 if (cmd_type == MBIM_COMMAND_SET) {
3759 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3760 } else if (info_buff_len) {
3761 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3763 break;
3764 case MBIM_CID_PHONEBOOK_READ:
3765 if (cmd_type == MBIM_COMMAND_SET) {
3766 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3767 } else {
3768 proto_tree_add_item(subtree, hf_mbim_phonebook_read_req_filter_flag, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3769 offset += 4;
3770 proto_tree_add_item(subtree, hf_mbim_phonebook_read_req_filter_message_index, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3772 break;
3773 case MBIM_CID_PHONEBOOK_DELETE:
3774 if (cmd_type == MBIM_COMMAND_SET) {
3775 proto_tree_add_item(subtree, hf_mbim_set_phonebook_delete_filter_flag, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3776 offset += 4;
3777 proto_tree_add_item(subtree, hf_mbim_set_phonebook_delete_filter_message_index, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3778 } else {
3779 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3781 break;
3782 case MBIM_CID_PHONEBOOK_WRITE:
3783 if (cmd_type == MBIM_COMMAND_SET) {
3784 mbim_dissect_set_phonebook_write(frag_tvb, pinfo, tree, offset);
3785 } else {
3786 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3788 break;
3789 default:
3790 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3791 break;
3793 break;
3794 case UUID_STK:
3795 switch (cid) {
3796 case MBIM_CID_STK_PAC:
3797 if (cmd_type == MBIM_COMMAND_SET) {
3798 proto_tree_add_item(subtree, hf_mbim_set_stk_pac_pac_host_control, frag_tvb, offset, 32, ENC_NA);
3799 } else {
3800 if (info_buff_len) {
3801 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3804 break;
3805 case MBIM_CID_STK_TERMINAL_RESPONSE:
3806 if (cmd_type == MBIM_COMMAND_SET) {
3807 mbim_dissect_set_stk_terminal_response(frag_tvb, pinfo, tree, offset);
3808 } else {
3809 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3811 break;
3812 case MBIM_CID_STK_ENVELOPE:
3813 if (cmd_type == MBIM_COMMAND_SET) {
3814 tvbuff_t *env_tvb;
3815 proto_tree *env_tree;
3817 ti = proto_tree_add_item(subtree, hf_mbim_set_stk_envelope_data_buffer,
3818 frag_tvb, offset, info_buff_len, ENC_NA);
3819 if (etsi_cat_handle) {
3820 env_tree = proto_item_add_subtree(ti, ett_mbim_buffer);
3821 env_tvb = tvb_new_subset(frag_tvb, offset, info_buff_len, info_buff_len);
3822 call_dissector(etsi_cat_handle, env_tvb, pinfo, env_tree);
3824 } else if (info_buff_len) {
3825 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3827 break;
3828 default:
3829 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3830 break;
3832 break;
3833 case UUID_AUTH:
3834 switch (cid) {
3835 case MBIM_CID_AKA_AUTH:
3836 if (cmd_type == MBIM_COMMAND_SET) {
3837 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3838 } else {
3839 mbim_dissect_aka_auth_req(frag_tvb, pinfo, subtree, offset);
3841 break;
3842 case MBIM_CID_AKAP_AUTH:
3843 if (cmd_type == MBIM_COMMAND_SET) {
3844 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3845 } else {
3846 mbim_dissect_akap_auth_req(frag_tvb, pinfo, subtree, offset);
3848 break;
3849 case MBIM_CID_SIM_AUTH:
3850 if (cmd_type == MBIM_COMMAND_SET) {
3851 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3852 } else {
3853 mbim_dissect_sim_auth_req(frag_tvb, pinfo, subtree, offset);
3855 break;
3856 default:
3857 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3858 break;
3860 break;
3861 case UUID_DSS:
3862 switch (cid) {
3863 case MBIM_CID_DSS_CONNECT:
3864 if (cmd_type == MBIM_COMMAND_SET) {
3865 mbim_dissect_set_dss_connect(frag_tvb, pinfo, subtree, offset);
3866 } else {
3867 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3869 break;
3870 default:
3871 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3872 break;
3874 break;
3875 case UUID_MULTICARRIER:
3876 switch (cid) {
3877 case MBIM_CID_MULTICARRIER_CAPABILITIES:
3878 if (cmd_type == MBIM_COMMAND_SET) {
3879 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3880 } else if (info_buff_len) {
3881 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3883 break;
3884 case MBIM_CID_LOCATION_INFO:
3885 if (cmd_type == MBIM_COMMAND_SET) {
3886 proto_tree_add_item(subtree, hf_mbim_location_info_country, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
3887 } else if (info_buff_len) {
3888 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3890 break;
3891 case MBIM_CID_MULTICARRIER_CURRENT_CID_LIST:
3892 if (cmd_type == MBIM_COMMAND_SET) {
3893 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, info_buff_len);
3894 } else {
3895 mbim_dissect_muticarrier_current_cid_list_req(frag_tvb, pinfo, subtree, offset);
3897 break;
3898 default:
3899 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3900 break;
3902 break;
3903 case UUID_MS_HOSTSHUTDOWN:
3904 switch (cid) {
3905 case MBIM_CID_MS_HOSTSHUTDOWN:
3906 if (cmd_type == MBIM_COMMAND_SET) {
3907 if (info_buff_len) {
3908 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3910 } else {
3911 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3913 break;
3914 default:
3915 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3916 break;
3918 break;
3919 case UUID_MSFWID:
3920 switch (cid) {
3921 case MBIM_CID_MSFWID_FIRMWAREID:
3922 if (cmd_type == MBIM_COMMAND_SET) {
3923 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3924 } else if (info_buff_len) {
3925 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
3927 break;
3928 default:
3929 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
3930 break;
3932 break;
3933 default:
3934 if (info_buff_len) {
3935 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
3937 break;
3940 break;
3941 case MBIM_HOST_ERROR_MSG:
3942 case MBIM_FUNCTION_ERROR_MSG:
3943 proto_tree_add_item(mbim_tree, hf_mbim_error_status_code, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3944 break;
3945 case MBIM_OPEN_DONE:
3946 case MBIM_CLOSE_DONE:
3947 proto_tree_add_item(mbim_tree, hf_mbim_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3948 break;
3949 case MBIM_COMMAND_DONE:
3950 case MBIM_INDICATE_STATUS_MSG:
3952 guint32 info_buff_len, current_frag, total_frag, cid;
3953 guint8 uuid_idx;
3954 fragment_head *frag_data;
3955 tvbuff_t *frag_tvb;
3957 ti = proto_tree_add_text(mbim_tree, tvb, offset, 8, "Fragment Header");
3958 subtree = proto_item_add_subtree(ti, ett_mbim_frag_header);
3959 total_frag = tvb_get_letohl(tvb, offset);
3960 proto_tree_add_uint(subtree, hf_mbim_fragment_total, tvb, offset, 4, total_frag);
3961 offset += 4;
3962 current_frag = tvb_get_letohl(tvb, offset);
3963 proto_tree_add_uint(subtree, hf_mbim_fragment_current, tvb, offset, 4, current_frag);
3964 offset += 4;
3965 if (total_frag > 1) {
3966 frag_data = fragment_add_seq_check(&mbim_reassembly_table, tvb, offset, pinfo,
3967 trans_id, NULL, current_frag,
3968 tvb_reported_length_remaining(tvb, offset),
3969 (current_frag != (total_frag-1)));
3970 frag_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled MBIM control message",
3971 frag_data, &mbim_frag_items, NULL, subtree);
3972 if (!frag_tvb) {
3973 /* Fragmentation reassembly not performed yet */
3974 proto_tree_add_item(mbim_tree, hf_mbim_fragmented_payload, tvb, offset, -1, ENC_NA);
3975 offset = tvb_length(tvb);
3976 break;
3978 offset = 0;
3979 } else {
3980 frag_tvb = tvb;
3983 if (msg_type == MBIM_COMMAND_DONE) {
3984 if (!PINFO_FD_VISITED(pinfo)) {
3985 mbim_info = (struct mbim_info *)wmem_tree_lookup32(mbim_conv->trans, trans_id);
3986 if (mbim_info) {
3987 mbim_info->resp_frame = PINFO_FD_NUM(pinfo);
3989 } else {
3990 mbim_info = (struct mbim_info *)wmem_tree_lookup32(mbim_conv->trans, trans_id);
3991 if (mbim_info && mbim_info->req_frame) {
3992 proto_item *req_it;
3994 req_it = proto_tree_add_uint(header_tree, hf_mbim_request_in, tvb, 0, 0, mbim_info->req_frame);
3995 PROTO_ITEM_SET_GENERATED(req_it);
4000 uuid_idx = mbim_dissect_service_id_uuid(frag_tvb, pinfo, mbim_tree, hf_mbim_device_service_id, &offset);
4001 cid = mbim_dissect_cid(frag_tvb, pinfo, mbim_tree, &offset, uuid_idx);
4002 if (msg_type == MBIM_COMMAND_DONE) {
4003 proto_tree_add_item(mbim_tree, hf_mbim_status, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4004 offset += 4;
4006 info_buff_len = tvb_get_letohl(frag_tvb, offset);
4007 proto_tree_add_uint(mbim_tree, hf_mbim_info_buffer_len, frag_tvb, offset, 4, info_buff_len);
4008 offset += 4;
4009 if (info_buff_len == 0) {
4010 break;
4012 ti = proto_tree_add_text(mbim_tree, frag_tvb, offset, info_buff_len, "Information Buffer");
4013 subtree = proto_item_add_subtree(ti, ett_mbim_info_buffer);
4014 switch (uuid_idx) {
4015 case UUID_BASIC_CONNECT:
4016 switch (cid) {
4017 case MBIM_CID_DEVICE_CAPS:
4018 if (msg_type == MBIM_COMMAND_DONE) {
4019 mbim_dissect_device_caps_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
4020 } else {
4021 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4023 break;
4024 case MBIM_CID_SUBSCRIBER_READY_STATUS:
4025 mbim_dissect_subscriber_ready_status(frag_tvb, pinfo, subtree, offset);
4026 break;
4027 case MBIM_CID_RADIO_STATE:
4028 proto_tree_add_item(subtree, hf_mbim_radio_state_hw_radio_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4029 offset += 4;
4030 proto_tree_add_item(subtree, hf_mbim_radio_state_sw_radio_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4031 break;
4032 case MBIM_CID_PIN:
4033 if (msg_type == MBIM_COMMAND_DONE) {
4034 guint32 attempts;
4036 proto_tree_add_item(subtree, hf_mbim_pin_info_pin_type, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4037 offset += 4;
4038 proto_tree_add_item(subtree, hf_mbim_pin_info_pin_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4039 offset += 4;
4040 attempts = tvb_get_letohl(frag_tvb, offset);
4041 if (attempts == 0xffffffff) {
4042 proto_tree_add_uint_format(subtree, hf_mbim_pin_info_remaining_attempts, frag_tvb, offset, 4,
4043 attempts, "Not supported (0xffffffff)");
4044 } else {
4045 proto_tree_add_uint(subtree, hf_mbim_pin_info_remaining_attempts, frag_tvb, offset, 4, attempts);
4047 } else {
4048 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4050 break;
4051 case MBIM_CID_PIN_LIST:
4052 if (msg_type == MBIM_COMMAND_DONE) {
4053 mbim_dissect_pin_list_info(frag_tvb, pinfo, subtree, offset);
4054 } else {
4055 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4057 break;
4058 case MBIM_CID_HOME_PROVIDER:
4059 if (msg_type == MBIM_COMMAND_DONE) {
4060 mbim_dissect_provider(frag_tvb, pinfo, subtree, offset);
4061 } else {
4062 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4064 break;
4065 case MBIM_CID_PREFERRED_PROVIDERS:
4066 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
4067 break;
4068 case MBIM_CID_VISIBLE_PROVIDERS:
4069 if (msg_type == MBIM_COMMAND_DONE) {
4070 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
4071 } else {
4072 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4074 break;
4075 case MBIM_CID_REGISTER_STATE:
4076 mbim_dissect_registration_state_info(frag_tvb, pinfo, subtree, offset);
4077 break;
4078 case MBIM_CID_PACKET_SERVICE:
4079 mbim_dissect_packet_service_info(frag_tvb, pinfo, subtree, offset);
4080 break;
4081 case MBIM_CID_SIGNAL_STATE:
4082 mbim_dissect_signal_state_info(frag_tvb, pinfo, subtree, offset);
4083 break;
4084 case MBIM_CID_CONNECT:
4085 mbim_dissect_connect_info(frag_tvb, pinfo, subtree, offset);
4086 break;
4087 case MBIM_CID_PROVISIONED_CONTEXTS:
4088 mbim_dissect_provisioned_contexts_info(frag_tvb, pinfo, subtree, offset);
4089 break;
4090 case MBIM_CID_SERVICE_ACTIVATION:
4091 if (msg_type == MBIM_COMMAND_DONE) {
4092 guint32 nw_error;
4094 nw_error = tvb_get_letohl(frag_tvb, offset);
4095 if (nw_error == 0) {
4096 proto_tree_add_uint_format_value(subtree, hf_mbim_service_activation_info_nw_error,
4097 frag_tvb, offset, 4, nw_error, "Success (0)");
4098 } else {
4099 proto_tree_add_uint(subtree, hf_mbim_service_activation_info_nw_error,
4100 frag_tvb, offset, 4, nw_error);
4102 proto_tree_add_item(subtree, hf_mbim_service_activation_info_data_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
4103 } else {
4104 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4106 break;
4107 case MBIM_CID_IP_CONFIGURATION:
4108 mbim_dissect_ip_configuration_info(frag_tvb, pinfo, subtree, offset);
4109 break;
4110 case MBIM_CID_DEVICE_SERVICES:
4111 if (msg_type == MBIM_COMMAND_DONE) {
4112 mbim_dissect_device_services_info(frag_tvb, pinfo, subtree, offset);
4113 } else {
4114 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4116 break;
4117 case MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST:
4118 if (msg_type == MBIM_COMMAND_DONE) {
4119 mbim_dissect_device_service_subscribe_list(frag_tvb, pinfo, subtree, offset);
4120 } else {
4121 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4123 break;
4124 case MBIM_CID_PACKET_STATISTICS:
4125 if (msg_type == MBIM_COMMAND_DONE) {
4126 mbim_dissect_packet_statistics_info(frag_tvb, pinfo, subtree, offset);
4127 } else {
4128 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4130 break;
4131 case MBIM_CID_NETWORK_IDLE_HINT:
4132 if (msg_type == MBIM_COMMAND_DONE) {
4133 proto_tree_add_item(subtree, hf_mbim_network_idle_hint_state, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4134 } else {
4135 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4137 break;
4138 case MBIM_CID_EMERGENCY_MODE:
4139 proto_tree_add_item(subtree, hf_mbim_emergency_mode_info_emergency_mode, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4140 break;
4141 case MBIM_CID_IP_PACKET_FILTERS:
4142 if (msg_type == MBIM_COMMAND_DONE) {
4143 mbim_dissect_packet_filters(frag_tvb, pinfo, subtree, offset);
4144 } else {
4145 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4147 break;
4148 case MBIM_CID_MULTICARRIER_PROVIDERS:
4149 mbim_dissect_providers(frag_tvb, pinfo, subtree, offset);
4150 break;
4151 default:
4152 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4153 break;
4155 break;
4156 case UUID_SMS:
4157 switch (cid) {
4158 case MBIM_CID_SMS_CONFIGURATION:
4159 mbim_dissect_sms_configuration_info(frag_tvb, pinfo, subtree, offset);
4160 break;
4161 case MBIM_CID_SMS_READ:
4162 mbim_dissect_sms_read_info(frag_tvb, pinfo, subtree, offset, mbim_conv);
4163 break;
4164 case MBIM_CID_SMS_SEND:
4165 if (msg_type == MBIM_COMMAND_DONE) {
4166 proto_tree_add_item(subtree, hf_mbim_sms_send_info_message_reference, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4167 } else {
4168 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4170 break;
4171 case MBIM_CID_SMS_DELETE:
4172 if (msg_type == MBIM_COMMAND_DONE) {
4173 if (info_buff_len) {
4174 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
4176 } else {
4177 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4179 break;
4180 case MBIM_CID_SMS_MESSAGE_STORE_STATUS:
4181 proto_tree_add_bitmask(subtree, frag_tvb, offset, hf_mbim_sms_status_info_flags, ett_mbim_bitmap,
4182 mbim_sms_status_info_flags_fields, ENC_LITTLE_ENDIAN);
4183 offset += 4;
4184 proto_tree_add_item(subtree, hf_mbim_sms_status_info_message_index, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4185 break;
4186 default:
4187 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4188 break;
4190 break;
4191 case UUID_USSD:
4192 switch (cid) {
4193 case MBIM_CID_USSD:
4194 mbim_dissect_ussd_info(frag_tvb, pinfo, subtree, offset);
4195 break;
4196 default:
4197 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4198 break;
4200 break;
4201 case UUID_PHONEBOOK:
4202 switch (cid) {
4203 case MBIM_CID_PHONEBOOK_CONFIGURATION:
4204 mbim_dissect_phonebook_configuration_info(frag_tvb, pinfo, subtree, offset);
4205 break;
4206 case MBIM_CID_PHONEBOOK_READ:
4207 if (msg_type == MBIM_COMMAND_DONE) {
4208 mbim_dissect_phonebook_read_info(frag_tvb, pinfo, subtree, offset);
4209 } else {
4210 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4212 break;
4213 case MBIM_CID_PHONEBOOK_DELETE:
4214 case MBIM_CID_PHONEBOOK_WRITE:
4215 if (msg_type == MBIM_COMMAND_DONE) {
4216 if (info_buff_len) {
4217 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
4219 } else {
4220 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4222 break;
4223 default:
4224 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4225 break;
4227 break;
4228 case UUID_STK:
4229 switch (cid) {
4230 case MBIM_CID_STK_PAC:
4231 if (msg_type == MBIM_COMMAND_DONE) {
4232 proto_tree_add_item(subtree, hf_mbim_stk_pac_info_pac_support, frag_tvb, offset, 256, ENC_NA);
4233 } else {
4234 tvbuff_t *pac_tvb;
4235 gint pac_length;
4236 proto_tree *pac_tree;
4238 proto_tree_add_item(subtree, hf_mbim_stk_pac_pac_type, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4239 offset += 4;
4240 pac_length = info_buff_len - 4;
4241 ti = proto_tree_add_item(subtree, hf_mbim_stk_pac_pac, frag_tvb, offset, pac_length, ENC_NA);
4242 if (proactive_handle) {
4243 pac_tree = proto_item_add_subtree(ti, ett_mbim_buffer);
4244 pac_tvb = tvb_new_subset(frag_tvb, offset, pac_length, pac_length);
4245 call_dissector(proactive_handle, pac_tvb, pinfo, pac_tree);
4248 break;
4249 case MBIM_CID_STK_TERMINAL_RESPONSE:
4250 if (msg_type == MBIM_COMMAND_DONE) {
4251 mbim_dissect_stk_terminal_response_info(frag_tvb, pinfo, subtree, offset);
4252 } else {
4253 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4255 break;
4256 case MBIM_CID_STK_ENVELOPE:
4257 if (msg_type == MBIM_COMMAND_DONE) {
4258 proto_tree_add_item(subtree, hf_mbim_stk_envelope_info_envelope_support,
4259 frag_tvb, offset, 32, ENC_NA);
4260 } else {
4261 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4263 break;
4264 default:
4265 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4266 break;
4268 break;
4269 case UUID_AUTH:
4270 switch (cid) {
4271 case MBIM_CID_AKA_AUTH:
4272 if (msg_type == MBIM_COMMAND_DONE) {
4273 mbim_dissect_aka_auth_info(frag_tvb, pinfo, subtree, offset);
4274 } else {
4275 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4277 break;
4278 case MBIM_CID_AKAP_AUTH:
4279 if (msg_type == MBIM_COMMAND_DONE) {
4280 mbim_dissect_akap_auth_info(frag_tvb, pinfo, subtree, offset);
4281 } else {
4282 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4284 break;
4285 case MBIM_CID_SIM_AUTH:
4286 if (msg_type == MBIM_COMMAND_DONE) {
4287 mbim_dissect_sim_auth_info(frag_tvb, pinfo, subtree, offset);
4288 } else {
4289 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4291 break;
4292 default:
4293 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4294 break;
4296 break;
4297 case UUID_DSS:
4298 switch (cid) {
4299 case MBIM_CID_DSS_CONNECT:
4300 if (msg_type == MBIM_COMMAND_DONE) {
4301 if (info_buff_len) {
4302 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
4304 } else {
4305 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4307 break;
4308 default:
4309 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4310 break;
4312 break;
4313 case UUID_MULTICARRIER:
4314 switch (cid) {
4315 case MBIM_CID_MULTICARRIER_CAPABILITIES:
4316 if (msg_type == MBIM_COMMAND_DONE) {
4317 proto_tree_add_bitmask(subtree, frag_tvb, offset, hf_mbim_multicarrier_capabilities_info_capabilities,
4318 ett_mbim_bitmap, mbim_multicarrier_capabilities_fields, ENC_LITTLE_ENDIAN);
4319 } else {
4320 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4322 break;
4323 case MBIM_CID_LOCATION_INFO:
4324 if (msg_type == MBIM_COMMAND_DONE) {
4325 proto_tree_add_item(subtree, hf_mbim_location_info_country, frag_tvb, offset, 4, ENC_LITTLE_ENDIAN);
4326 } else if (info_buff_len) {
4327 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
4329 break;
4330 case MBIM_CID_MULTICARRIER_CURRENT_CID_LIST:
4331 if (msg_type == MBIM_COMMAND_DONE) {
4332 mbim_dissect_muticarrier_current_cid_list_info(frag_tvb, pinfo, subtree, offset);
4333 } else {
4334 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
4336 break;
4337 default:
4338 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4339 break;
4341 break;
4342 case UUID_MS_HOSTSHUTDOWN:
4343 switch (cid) {
4344 case MBIM_CID_MS_HOSTSHUTDOWN:
4345 if (msg_type == MBIM_COMMAND_DONE) {
4346 if (info_buff_len) {
4347 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
4349 } else {
4350 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4352 break;
4353 default:
4354 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4355 break;
4357 break;
4358 case UUID_MSFWID:
4359 switch (cid) {
4360 case MBIM_CID_MSFWID_FIRMWAREID:
4361 if (msg_type == MBIM_COMMAND_DONE) {
4362 proto_tree_add_item(subtree, hf_mbim_msfwid_firmwareid_info_firmware_id, frag_tvb, offset, 16, ENC_NA);
4363 } else if (info_buff_len) {
4364 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len);
4366 break;
4367 default:
4368 proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1);
4369 break;
4371 break;
4372 default:
4373 proto_tree_add_item(subtree, hf_mbim_info_buffer, frag_tvb, offset, info_buff_len, ENC_NA);
4374 break;
4377 break;
4378 default:
4379 break;
4382 return tvb_length(tvb);
4385 static int
4386 dissect_mbim_descriptor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
4388 proto_item *ti;
4389 guint8 length, type, subtype;
4391 length = tvb_get_guint8(tvb, 0);
4392 type = tvb_get_guint8(tvb, 1);
4393 subtype = tvb_get_guint8(tvb, 2);
4395 if ((type != 0x24) ||
4396 !(((subtype == 0x1b) && (length == 12)) || ((subtype == 0x1c) && (length == 8)))){
4397 return 0;
4400 ti = proto_tree_add_item(tree, hf_mbim_descriptor, tvb, 0, 0, ENC_NA);
4401 PROTO_ITEM_SET_HIDDEN(ti);
4403 if (subtype == 0x1b) {
4404 proto_tree_add_item(tree, hf_mbim_descriptor_version, tvb, 3, 2, ENC_LITTLE_ENDIAN);
4405 proto_tree_add_item(tree, hf_mbim_descriptor_max_control_message, tvb, 5, 2, ENC_LITTLE_ENDIAN);
4406 proto_tree_add_item(tree, hf_mbim_descriptor_number_filters, tvb, 7, 1, ENC_NA);
4407 proto_tree_add_item(tree, hf_mbim_descriptor_max_filter_size, tvb, 8, 1, ENC_NA);
4408 proto_tree_add_item(tree, hf_mbim_descriptor_max_segment_size, tvb, 9, 2, ENC_LITTLE_ENDIAN);
4409 proto_tree_add_bitmask(tree, tvb, 11, hf_mbim_descriptor_network_capabilities, ett_mbim_bitmap,
4410 mbim_descriptor_network_capabilities_fields, ENC_NA);
4411 } else {
4412 proto_tree_add_item(tree, hf_mbim_descriptor_extended_version, tvb, 3, 2, ENC_LITTLE_ENDIAN);
4413 proto_tree_add_item(tree, hf_mbim_descriptor_max_outstanding_command_messages, tvb, 5, 1, ENC_NA);
4414 proto_tree_add_item(tree, hf_mbim_descriptor_mtu, tvb, 6, 2, ENC_LITTLE_ENDIAN);
4417 return length;
4420 static int
4421 dissect_mbim_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
4423 proto_item *ti, *sig_ti, *pi;
4424 proto_tree *mbim_tree, *subtree, *sig_tree;
4425 gboolean is_32bits;
4426 guint32 nth_sig, length, next_index, base_offset, offset, datagram_index, datagram_length,
4427 nb, total = 0, ndp = 0;
4428 guint8 *signature;
4429 dissector_handle_t dissector;
4430 tvbuff_t *datagram_tvb;
4431 const guint32 NTH16 = 0x484D434E;
4432 const guint32 NTH32 = 0x686D636E;
4434 if (tvb_length(tvb) < 12) {
4435 return 0;
4438 nth_sig = tvb_get_letohl(tvb, 0);
4439 if (nth_sig == NTH16) {
4440 is_32bits = FALSE;
4441 } else if (nth_sig == NTH32) {
4442 is_32bits = TRUE;
4443 } else {
4444 return 0;
4447 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MBIM");
4448 col_clear(pinfo->cinfo, COL_INFO);
4450 ti = proto_tree_add_item(tree, proto_mbim, tvb, 0, -1, ENC_NA);
4451 mbim_tree = proto_item_add_subtree(ti, ett_mbim);
4452 ti =proto_tree_add_item(mbim_tree, hf_mbim_bulk, tvb, 0, 0, ENC_NA);
4453 PROTO_ITEM_SET_HIDDEN(ti);
4455 ti = proto_tree_add_text(mbim_tree, tvb, 0, 0, "NCM Transfer Header");
4456 subtree = proto_item_add_subtree(ti, ett_mbim_msg_header);
4457 proto_tree_add_item(subtree, hf_mbim_bulk_nth_signature, tvb, 0, 4, ENC_ASCII|ENC_NA);
4458 length = tvb_get_letohs(tvb, 4);
4459 proto_tree_add_uint(subtree, hf_mbim_bulk_nth_header_length, tvb, 4, 2, length);
4460 proto_item_set_len(ti, length);
4461 proto_tree_add_item(subtree, hf_mbim_bulk_nth_sequence_number, tvb, 6, 2, ENC_LITTLE_ENDIAN);
4462 if (!is_32bits) {
4463 proto_tree_add_item(subtree, hf_mbim_bulk_nth_block_length, tvb, 8, 2, ENC_LITTLE_ENDIAN);
4464 next_index = tvb_get_letohs(tvb, 10);
4465 pi = proto_tree_add_uint(subtree, hf_mbim_bulk_nth_ndp_index, tvb, 10, 2, next_index);
4466 } else {
4467 proto_tree_add_item(subtree, hf_mbim_bulk_nth_block_length_32, tvb, 8, 4, ENC_LITTLE_ENDIAN);
4468 next_index = tvb_get_letohl(tvb, 12);
4469 pi = proto_tree_add_uint(subtree, hf_mbim_bulk_nth_ndp_index_32, tvb, 12, 4, next_index);
4471 if (next_index % 4) {
4472 expert_add_info_format(pinfo, pi, &ei_mbim_alignment_error,
4473 "NDP Index is not a multiple of 4 bytes");
4474 return tvb_length(tvb);
4477 while (next_index) {
4478 base_offset = offset = next_index;
4479 nb = 0;
4480 ti = proto_tree_add_text(mbim_tree, tvb, offset, 0, "NCM Datagram Pointer");
4481 subtree = proto_item_add_subtree(ti, ett_mbim_msg_header);
4482 signature = tvb_get_string(wmem_packet_scope(), tvb, offset, 4);
4483 if ((!is_32bits && !strcmp(signature, "IPS")) ||
4484 (is_32bits && !strcmp(signature, "ips"))) {
4485 sig_ti = proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset,
4486 4, tvb_get_letohl(tvb, offset), "%c%c%c%u", signature[0],
4487 signature[1], signature[2], signature[3]);
4488 sig_tree = proto_item_add_subtree(sig_ti, ett_mbim_msg_header);
4489 proto_tree_add_item(sig_tree, hf_mbim_bulk_ndp_signature_ips_session_id, tvb, offset+3, 1, ENC_NA);
4490 col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%c%c%c%u", signature[0], signature[1],
4491 signature[2], signature[3]);
4492 dissector = ip_handle;
4493 } else if ((!is_32bits && !strcmp(signature, "DSS")) ||
4494 (is_32bits && !strcmp(signature, "dss"))) {
4495 sig_ti = proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset,
4496 4, tvb_get_letohl(tvb, offset), "%c%c%c%u", signature[0],
4497 signature[1], signature[2], signature[3]);
4498 sig_tree = proto_item_add_subtree(sig_ti, ett_mbim_msg_header);
4499 proto_tree_add_item(sig_tree, hf_mbim_bulk_ndp_signature_dss_session_id, tvb, offset+3, 1, ENC_NA);
4500 col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%c%c%c%u", signature[0], signature[1],
4501 signature[2], signature[3]);
4502 dissector = data_handle;
4503 } else if ((!is_32bits && !strcmp(signature, "NCM0")) ||
4504 (is_32bits && !strcmp(signature, "ncm0"))) {
4505 proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset, 4,
4506 tvb_get_letohl(tvb, offset), "%s", signature);
4507 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, signature);
4508 dissector = eth_handle;
4509 } else if ((!is_32bits && !strcmp(signature, "NCM1")) ||
4510 (is_32bits && !strcmp(signature, "ncm1"))) {
4511 proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset, 4,
4512 tvb_get_letohl(tvb, offset), "%s", signature);
4513 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, signature);
4514 dissector = eth_fcs_handle;
4515 } else {
4516 proto_tree_add_item(subtree, hf_mbim_bulk_ndp_signature, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4517 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, signature);
4518 dissector = data_handle;
4520 offset += 4;
4521 length = tvb_get_letohs(tvb, offset);
4522 pi = proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_length, tvb, offset, 2, length);
4523 if (length % (is_32bits ? 8 : 4)) {
4524 expert_add_info_format(pinfo, pi, &ei_mbim_alignment_error, "Length is not a multiple of %u bytes",
4525 is_32bits ? 8 : 4);
4526 return tvb_length(tvb);
4528 proto_item_set_len(ti, length);
4529 offset += 2;
4530 if (!is_32bits) {
4531 next_index = tvb_get_letohs(tvb, offset);
4532 pi = proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_next_ndp_index, tvb,
4533 offset, 2, next_index);
4534 offset += 2;
4535 } else {
4536 proto_tree_add_item(subtree, hf_mbim_bulk_ndp_reserved, tvb,
4537 offset, 2, ENC_LITTLE_ENDIAN);
4538 offset += 2;
4539 next_index = tvb_get_letohl(tvb, offset);
4540 pi = proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_next_ndp_index_32,
4541 tvb, offset, 4, next_index);
4542 offset += 4;
4543 proto_tree_add_item(subtree, hf_mbim_bulk_ndp_reserved2, tvb,
4544 offset, 4, ENC_LITTLE_ENDIAN);
4545 offset += 4;
4547 if (next_index % 4) {
4548 expert_add_info_format(pinfo, pi, &ei_mbim_alignment_error,
4549 "NDP Index is not a multiple of 4 bytes");
4550 return tvb_length(tvb);
4552 while ((offset - base_offset) < length) {
4553 if (!is_32bits) {
4554 datagram_index = tvb_get_letohs(tvb, offset);
4555 proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_datagram_index,
4556 tvb, offset, 2, datagram_index);
4557 offset += 2;
4558 datagram_length = tvb_get_letohs(tvb, offset);
4559 proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_datagram_length,
4560 tvb, offset, 2, datagram_length);
4561 offset += 2;
4562 } else {
4563 datagram_index = tvb_get_letohl(tvb, offset);
4564 proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_datagram_index_32,
4565 tvb, offset, 4, datagram_index);
4566 offset += 4;
4567 datagram_length = tvb_get_letohl(tvb, offset);
4568 proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_datagram_length_32,
4569 tvb, offset, 3, datagram_length);
4570 offset += 4;
4572 if (datagram_index && datagram_length) {
4573 proto_tree_add_item(subtree, hf_mbim_bulk_ndp_datagram, tvb,
4574 datagram_index, datagram_length, ENC_NA);
4575 datagram_tvb = tvb_new_subset_length(tvb, datagram_index, datagram_length);
4576 if (total) {
4577 col_set_str(pinfo->cinfo, COL_PROTOCOL, "|");
4578 col_set_fence(pinfo->cinfo, COL_PROTOCOL);
4579 col_set_str(pinfo->cinfo, COL_INFO, " | ");
4580 col_set_fence(pinfo->cinfo, COL_INFO);
4582 call_dissector(dissector, datagram_tvb, pinfo, tree);
4583 col_set_fence(pinfo->cinfo, COL_PROTOCOL);
4584 col_set_fence(pinfo->cinfo, COL_INFO);
4585 nb++;
4586 if (++total > MBIM_MAX_ITEMS) {
4587 expert_add_info_format(pinfo, NULL, &ei_mbim_too_many_items,
4588 "More than %u datagrams, dissection seems suspicious",
4589 MBIM_MAX_ITEMS);
4590 return tvb_length(tvb);
4594 ti = proto_tree_add_uint(subtree, hf_mbim_bulk_ndp_nb_datagrams, tvb, 0, 0, nb);
4595 PROTO_ITEM_SET_GENERATED(ti);
4596 if (++ndp > MBIM_MAX_ITEMS) {
4597 expert_add_info_format(pinfo, NULL, &ei_mbim_too_many_items,
4598 "More than %u NCM Datagram Pointers, dissection seems suspicious",
4599 MBIM_MAX_ITEMS);
4600 return tvb_length(tvb);
4603 ti = proto_tree_add_uint(mbim_tree, hf_mbim_bulk_total_nb_datagrams, tvb, 0, 0, total);
4604 PROTO_ITEM_SET_GENERATED(ti);
4606 return tvb_length(tvb);
4609 static gboolean
4610 dissect_mbim_bulk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4612 usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data;
4614 if ((usb_conv_info == NULL) ||
4615 ((usb_conv_info->interfaceClass != IF_CLASS_CDC_DATA) &&
4616 (usb_conv_info->interfaceClass != IF_CLASS_UNKNOWN))) {
4617 return FALSE;
4620 if (dissect_mbim_bulk(tvb, pinfo, tree, usb_conv_info)) {
4621 return TRUE;
4623 return FALSE;
4626 static void
4627 mbim_reassembly_init(void)
4629 reassembly_table_init(&mbim_reassembly_table,
4630 &addresses_reassembly_table_functions);
4633 void
4634 proto_register_mbim(void)
4636 module_t *mbim_module;
4637 expert_module_t* expert_mbim;
4639 static hf_register_info hf[] = {
4640 { &hf_mbim_control,
4641 { "Control", "mbim.control",
4642 FT_NONE, BASE_NONE, NULL, 0,
4643 NULL, HFILL }
4645 { &hf_mbim_header_message_type,
4646 { "Message Type", "mbim.control.header.message_type",
4647 FT_UINT32, BASE_HEX, VALS(mbim_msg_type_vals), 0,
4648 NULL, HFILL }
4650 { &hf_mbim_header_message_length,
4651 { "Message Length", "mbim.control.header.message_length",
4652 FT_UINT32, BASE_DEC, NULL, 0,
4653 NULL, HFILL }
4655 { &hf_mbim_header_transaction_id,
4656 { "Transaction Id", "mbim.control.header.transaction_id",
4657 FT_UINT32, BASE_DEC, NULL, 0,
4658 NULL, HFILL }
4660 { &hf_mbim_fragment_total,
4661 { "Total Fragments", "mbim.control.fragment.total",
4662 FT_UINT32, BASE_DEC, NULL, 0,
4663 NULL, HFILL }
4665 { &hf_mbim_fragment_current,
4666 { "Current Fragment", "mbim.control.fragment.current",
4667 FT_UINT32, BASE_DEC, NULL, 0,
4668 NULL, HFILL }
4670 { &hf_mbim_max_ctrl_transfer,
4671 { "Max Control Transfer", "mbim.control.max_control_transfer",
4672 FT_UINT32, BASE_DEC, NULL, 0,
4673 NULL, HFILL }
4675 { &hf_mbim_device_service_id,
4676 { "Device Service Id", "mbim.control.device_service_id",
4677 FT_GUID, BASE_NONE, NULL, 0,
4678 NULL, HFILL }
4680 { &hf_mbim_uuid_basic_connect_cid,
4681 { "CID", "mbim.control.cid",
4682 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &mbim_uuid_basic_connect_cid_vals_ext, 0,
4683 NULL, HFILL }
4685 { &hf_mbim_uuid_sms_cid,
4686 { "CID", "mbim.control.cid",
4687 FT_UINT32, BASE_DEC, VALS(mbim_uuid_sms_cid_vals), 0,
4688 NULL, HFILL }
4690 { &hf_mbim_uuid_ussd_cid,
4691 { "CID", "mbim.control.cid",
4692 FT_UINT32, BASE_DEC, VALS(mbim_uuid_ussd_cid_vals), 0,
4693 NULL, HFILL }
4695 { &hf_mbim_uuid_phonebook_cid,
4696 { "CID", "mbim.control.cid",
4697 FT_UINT32, BASE_DEC, VALS(mbim_uuid_phonebook_cid_vals), 0,
4698 NULL, HFILL }
4700 { &hf_mbim_uuid_stk_cid,
4701 { "CID", "mbim.control.cid",
4702 FT_UINT32, BASE_DEC, VALS(mbim_uuid_stk_cid_vals), 0,
4703 NULL, HFILL }
4705 { &hf_mbim_uuid_auth_cid,
4706 { "CID", "mbim.control.cid",
4707 FT_UINT32, BASE_DEC, VALS(mbim_uuid_auth_cid_vals), 0,
4708 NULL, HFILL }
4710 { &hf_mbim_uuid_dss_cid,
4711 { "CID", "mbim.control.cid",
4712 FT_UINT32, BASE_DEC, VALS(mbim_uuid_dss_cid_vals), 0,
4713 NULL, HFILL }
4715 { &hf_mbim_uuid_multicarrier_cid,
4716 { "CID", "mbim.control.cid",
4717 FT_UINT32, BASE_DEC, VALS(mbim_uuid_multicarrier_cid_vals), 0,
4718 NULL, HFILL }
4720 { &hf_mbim_uuid_ms_hostshutdown_cid,
4721 { "CID", "mbim.control.cid",
4722 FT_UINT32, BASE_DEC, VALS(mbim_uuid_ms_hostshutdown_cid_vals), 0,
4723 NULL, HFILL }
4725 { &hf_mbim_uuid_msfwid_cid,
4726 { "CID", "mbim.control.cid",
4727 FT_UINT32, BASE_DEC, VALS(mbim_uuid_msfwid_cid_vals), 0,
4728 NULL, HFILL }
4730 { &hf_mbim_cid,
4731 { "CID", "mbim.control.cid",
4732 FT_UINT32, BASE_DEC, NULL, 0,
4733 NULL, HFILL }
4735 { &hf_mbim_command_type,
4736 { "Command Type", "mbim.control.command_type",
4737 FT_UINT32, BASE_DEC, VALS(mbim_command_type_vals), 0,
4738 NULL, HFILL }
4740 { &hf_mbim_info_buffer_len,
4741 { "Information Buffer Length", "mbim.control.info_buffer_len",
4742 FT_UINT32, BASE_DEC, NULL, 0,
4743 NULL, HFILL }
4745 { &hf_mbim_info_buffer,
4746 { "Information Buffer", "mbim.control.info_buffer",
4747 FT_BYTES, BASE_NONE, NULL, 0,
4748 NULL, HFILL }
4750 { &hf_mbim_error_status_code,
4751 { "Error Status Code", "mbim.control.error_status_code",
4752 FT_UINT32, BASE_DEC, VALS(mbim_error_status_code_vals), 0,
4753 NULL, HFILL }
4755 { &hf_mbim_status,
4756 { "Status", "mbim.control.status",
4757 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &mbim_status_code_vals_ext, 0,
4758 NULL, HFILL }
4760 { &hf_mbim_device_caps_info_device_type,
4761 { "Device Type", "mbim.control.device_caps_info.device_type",
4762 FT_UINT32, BASE_DEC, VALS(mbim_device_caps_info_device_type_vals), 0,
4763 NULL, HFILL }
4765 { &hf_mbim_device_caps_info_cellular_class,
4766 { "Cellular Class", "mbim.control.device_caps_info.cellular_class",
4767 FT_UINT32, BASE_DEC, VALS(mbim_cellular_class_vals), 0,
4768 NULL, HFILL }
4770 { &hf_mbim_device_caps_info_voice_class,
4771 { "Voice Class", "mbim.control.device_caps_info.voice_class",
4772 FT_UINT32, BASE_DEC, VALS(mbim_device_caps_info_voice_class_vals), 0,
4773 NULL, HFILL }
4775 { &hf_mbim_device_caps_info_sim_class,
4776 { "SIM Class", "mbim.control.device_caps_info.sim_class",
4777 FT_UINT32, BASE_HEX, NULL, 0,
4778 NULL, HFILL }
4780 { &hf_mbim_device_caps_info_sim_class_logical,
4781 { "Logical", "mbim.control.device_caps_info.sim_class.logical",
4782 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
4783 NULL, HFILL }
4785 { &hf_mbim_device_caps_info_sim_class_removable,
4786 { "Removable", "mbim.control.device_caps_info.sim_class.removable",
4787 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
4788 NULL, HFILL }
4790 { &hf_mbim_device_caps_info_data_class,
4791 { "Data Class", "mbim.control.device_caps_info.data_class",
4792 FT_UINT32, BASE_HEX, NULL, 0,
4793 NULL, HFILL }
4795 { &hf_mbim_data_class_gprs,
4796 { "GPRS", "mbim.control.data_class.gprs",
4797 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
4798 NULL, HFILL }
4800 { &hf_mbim_data_class_edge,
4801 { "EDGE", "mbim.control.data_class.edge",
4802 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
4803 NULL, HFILL }
4805 { &hf_mbim_data_class_umts,
4806 { "EDGE", "mbim.control.data_class.umts",
4807 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
4808 NULL, HFILL }
4810 { &hf_mbim_data_class_hsdpa,
4811 { "HSDPA", "mbim.control.data_class.hsdpa",
4812 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
4813 NULL, HFILL }
4815 { &hf_mbim_data_class_hsupa,
4816 { "HSUPA", "mbim.control.data_class.hsupa",
4817 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
4818 NULL, HFILL }
4820 { &hf_mbim_data_class_lte,
4821 { "LTE", "mbim.control.data_class.lte",
4822 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
4823 NULL, HFILL }
4825 { &hf_mbim_data_class_reserved_gsm,
4826 { "Reserved for future GSM classes", "mbim.control.data_class.reserved_gsm",
4827 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x0000ffc0,
4828 NULL, HFILL }
4830 { &hf_mbim_data_class_1xrtt,
4831 { "1xRTT", "mbim.control.data_class.1xrtt",
4832 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
4833 NULL, HFILL }
4835 { &hf_mbim_data_class_1xevdo,
4836 { "1xEV-DO", "mbim.control.data_class.1xevdo",
4837 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
4838 NULL, HFILL }
4840 { &hf_mbim_data_class_1xevdoreva,
4841 { "1xEV-DO RevA", "mbim.control.data_class.1xevdoreva",
4842 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
4843 NULL, HFILL }
4845 { &hf_mbim_data_class_1xevdv,
4846 { "1xEVDV", "mbim.control.data_class.1xevdv",
4847 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
4848 NULL, HFILL }
4850 { &hf_mbim_data_class_3xrtt,
4851 { "3xRTT", "mbim.control.data_class.3xrtt",
4852 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
4853 NULL, HFILL }
4855 { &hf_mbim_data_class_1xevdorevb,
4856 { "1xEV-DO RevB", "mbim.control.data_class.1xevdorevb",
4857 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
4858 NULL, HFILL }
4860 { &hf_mbim_data_class_umb,
4861 { "UMB", "mbim.control.data_class.umb",
4862 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
4863 NULL, HFILL }
4865 { &hf_mbim_data_class_reserved_cdma,
4866 { "Reserved for future CDMA classes", "mbim.control.data_class.reserved_cdma",
4867 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x7f800000,
4868 NULL, HFILL }
4870 { &hf_mbim_data_class_custom,
4871 { "Custom", "mbim.control.data_class.custom",
4872 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x80000000,
4873 NULL, HFILL }
4875 { &hf_mbim_device_caps_info_sms_caps,
4876 { "SMS Caps", "mbim.control.device_caps_info.sms_caps",
4877 FT_UINT32, BASE_HEX, NULL, 0,
4878 NULL, HFILL }
4880 { &hf_mbim_device_caps_info_sms_caps_pdu_receive,
4881 { "PDU Receive", "mbim.control.device_caps_info.sms_caps.pdu_receive",
4882 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
4883 NULL, HFILL }
4885 { &hf_mbim_device_caps_info_sms_caps_pdu_send,
4886 { "PDU Send", "mbim.control.device_caps_info.sms_caps.pdu_send",
4887 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
4888 NULL, HFILL }
4890 { &hf_mbim_device_caps_info_sms_caps_text_receive,
4891 { "Text Receive", "mbim.control.device_caps_info.sms_caps.text_receive",
4892 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
4893 NULL, HFILL }
4895 { &hf_mbim_device_caps_info_sms_caps_text_send,
4896 { "Text Send", "mbim.control.device_caps_info.sms_caps.text_send",
4897 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
4898 NULL, HFILL }
4900 { &hf_mbim_device_caps_info_control_caps,
4901 { "Control Caps", "mbim.control.device_caps_info.control_caps",
4902 FT_UINT32, BASE_HEX, NULL, 0,
4903 NULL, HFILL }
4905 { &hf_mbim_device_caps_info_control_caps_reg_manual,
4906 { "Reg Manual", "mbim.control.device_caps_info.control_caps.reg_manual",
4907 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
4908 NULL, HFILL }
4910 { &hf_mbim_device_caps_info_control_caps_hw_radio_switch,
4911 { "HW Radio Switch", "mbim.control.device_caps_info.control_caps.hw_radio_switch",
4912 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
4913 NULL, HFILL }
4915 { &hf_mbim_device_caps_info_control_caps_cdma_mobile_ip,
4916 { "CDMA Mobile IP", "mbim.control.device_caps_info.control_caps.cdma_mobile_ip",
4917 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
4918 NULL, HFILL }
4920 { &hf_mbim_device_caps_info_control_caps_cdma_simple_ip,
4921 { "CDMA Simple IP", "mbim.control.device_caps_info.control_caps.cdma_simple_ip",
4922 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
4923 NULL, HFILL }
4925 { &hf_mbim_device_caps_info_control_caps_multi_carrier,
4926 { "Multi Carrier", "mbim.control.device_caps_info.control_caps.multi_carrier",
4927 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
4928 NULL, HFILL }
4930 { &hf_mbim_device_caps_info_max_sessions,
4931 { "Max Sessions", "mbim.control.device_caps_info.max_sessions",
4932 FT_UINT32, BASE_DEC, NULL, 0,
4933 NULL, HFILL }
4935 { &hf_mbim_device_caps_info_custom_data_class_offset,
4936 { "Custom Data Class Offset", "mbim.control.device_caps_info.custom_data_class.offset",
4937 FT_UINT32, BASE_DEC, NULL, 0,
4938 NULL, HFILL }
4940 { &hf_mbim_device_caps_info_custom_data_class_size,
4941 { "Custom Data Class Size", "mbim.control.device_caps_info.custom_data_class.size",
4942 FT_UINT32, BASE_DEC, NULL, 0,
4943 NULL, HFILL }
4945 { &hf_mbim_device_caps_info_device_id_offset,
4946 { "Device Id Offset", "mbim.control.device_caps_info.device_id.offset",
4947 FT_UINT32, BASE_DEC, NULL, 0,
4948 NULL, HFILL }
4950 { &hf_mbim_device_caps_info_device_id_size,
4951 { "Device Id Size", "mbim.control.device_caps_info.device_id.size",
4952 FT_UINT32, BASE_DEC, NULL, 0,
4953 NULL, HFILL }
4955 { &hf_mbim_device_caps_info_fw_info_offset,
4956 { "FW Info Offset", "mbim.control.device_caps_info.fw_info.offset",
4957 FT_UINT32, BASE_DEC, NULL, 0,
4958 NULL, HFILL }
4960 { &hf_mbim_device_caps_info_fw_info_size,
4961 { "FW Info Size", "mbim.control.device_caps_info.fw_info.size",
4962 FT_UINT32, BASE_DEC, NULL, 0,
4963 NULL, HFILL }
4965 { &hf_mbim_device_caps_info_hw_info_offset,
4966 { "HW Info Offset", "mbim.control.device_caps_info.hw_info.offset",
4967 FT_UINT32, BASE_DEC, NULL, 0,
4968 NULL, HFILL }
4970 { &hf_mbim_device_caps_info_hw_info_size,
4971 { "HW Info Size", "mbim.control.device_caps_info.hw_info.size",
4972 FT_UINT32, BASE_DEC, NULL, 0,
4973 NULL, HFILL }
4975 { &hf_mbim_device_caps_info_custom_data_class,
4976 { "Custom Data Class", "mbim.control.device_caps_info.custom_data_class",
4977 FT_STRING, BASE_NONE, NULL, 0,
4978 NULL, HFILL }
4980 { &hf_mbim_device_caps_info_device_id,
4981 { "Device Id", "mbim.control.device_caps_info.device_id",
4982 FT_STRING, BASE_NONE, NULL, 0,
4983 NULL, HFILL }
4985 { &hf_mbim_device_caps_info_fw_info,
4986 { "FW Info", "mbim.control.device_caps_info.fw_info",
4987 FT_STRING, BASE_NONE, NULL, 0,
4988 NULL, HFILL }
4990 { &hf_mbim_device_caps_info_hw_info,
4991 { "HW Info", "mbim.control.device_caps_info.hw_info",
4992 FT_STRING, BASE_NONE, NULL, 0,
4993 NULL, HFILL }
4995 { &hf_mbim_subscr_ready_status_ready_state,
4996 { "Ready State", "mbim.control.subscriber_ready_status.ready_state",
4997 FT_UINT32, BASE_DEC, VALS(mbim_subscr_ready_status_ready_state_vals), 0,
4998 NULL, HFILL }
5000 { &hf_mbim_subscr_ready_status_susbcr_id_offset,
5001 { "Subscriber Id Offset", "mbim.control.subscriber_ready_status.susbcriber_id.offset",
5002 FT_UINT32, BASE_DEC, NULL, 0,
5003 NULL, HFILL }
5005 { &hf_mbim_subscr_ready_status_susbcr_id_size,
5006 { "Subscriber Id Size", "mbim.control.subscriber_ready_status.susbcriber_id.size",
5007 FT_UINT32, BASE_DEC, NULL, 0,
5008 NULL, HFILL }
5010 { &hf_mbim_subscr_ready_status_sim_icc_id_offset,
5011 { "SIM ICC Id Offset", "mbim.control.subscriber_ready_status.sim_icc_id.offset",
5012 FT_UINT32, BASE_DEC, NULL, 0,
5013 NULL, HFILL }
5015 { &hf_mbim_subscr_ready_status_sim_icc_id_size,
5016 { "SIM ICC Id Size", "mbim.control.subscriber_ready_status.sim_icc_id.size",
5017 FT_UINT32, BASE_DEC, NULL, 0,
5018 NULL, HFILL }
5020 { &hf_mbim_subscr_ready_status_ready_info,
5021 { "Ready Info", "mbim.control.subscriber_ready_status.ready_info",
5022 FT_UINT32, BASE_DEC, VALS(mbim_subscr_ready_status_ready_info_vals), 0,
5023 NULL, HFILL }
5025 { &hf_mbim_subscr_ready_status_elem_count,
5026 { "Element Count", "mbim.control.subscriber_ready_status.element_count",
5027 FT_UINT32, BASE_DEC, NULL, 0,
5028 NULL, HFILL }
5030 { &hf_mbim_subscr_ready_status_tel_nb_offset,
5031 { "Telephone Number Offset", "mbim.control.subscriber_ready_status.tel_nb.offset",
5032 FT_UINT32, BASE_DEC, NULL, 0,
5033 NULL, HFILL }
5035 { &hf_mbim_subscr_ready_status_tel_nb_size,
5036 { "Telephone Number Size", "mbim.control.subscriber_ready_status.tel_nb.size",
5037 FT_UINT32, BASE_DEC, NULL, 0,
5038 NULL, HFILL }
5040 { &hf_mbim_subscr_ready_status_susbcr_id,
5041 { "Subscriber Id", "mbim.control.device_caps_info.subscriber_ready_status.susbcriber_id",
5042 FT_STRING, BASE_NONE, NULL, 0,
5043 NULL, HFILL }
5045 { &hf_mbim_subscr_ready_status_sim_icc_id,
5046 { "SIM ICC Id", "mbim.control.device_caps_info.subscriber_ready_status.sim_icc_id",
5047 FT_STRING, BASE_NONE, NULL, 0,
5048 NULL, HFILL }
5050 { &hf_mbim_subscr_ready_status_tel_nb,
5051 { "Telephone Number", "mbim.control.device_caps_info.subscriber_ready_status.tel_nb",
5052 FT_STRING, BASE_NONE, NULL, 0,
5053 NULL, HFILL }
5055 { &hf_mbim_radio_state_set,
5056 { "Radio Set", "mbim.control.radio_state.set",
5057 FT_UINT32, BASE_DEC, VALS(mbim_radio_state_vals), 0,
5058 NULL, HFILL }
5060 { &hf_mbim_radio_state_hw_radio_state,
5061 { "HW Radio State", "mbim.control.radio_state.hw_radio_state",
5062 FT_UINT32, BASE_DEC, VALS(mbim_radio_state_vals), 0,
5063 NULL, HFILL }
5065 { &hf_mbim_radio_state_sw_radio_state,
5066 { "SW Radio State", "mbim.control.radio_state.sw_radio_stat",
5067 FT_UINT32, BASE_DEC, VALS(mbim_radio_state_vals), 0,
5068 NULL, HFILL }
5070 { &hf_mbim_set_pin_pin_type,
5071 { "PIN Type", "mbim.control.set_pin.pin_type",
5072 FT_UINT32, BASE_DEC, VALS(mbim_pin_type_vals), 0,
5073 NULL, HFILL }
5075 { &hf_mbim_set_pin_pin_pin_operation,
5076 { "PIN Operation", "mbim.control.set_pin.pin_operation",
5077 FT_UINT32, BASE_DEC, VALS(mbim_pin_operation_vals), 0,
5078 NULL, HFILL }
5080 { &hf_mbim_set_pin_pin_pin_offset,
5081 { "PIN Offset", "mbim.control.set_pin.pin.offset",
5082 FT_UINT32, BASE_DEC, NULL, 0,
5083 NULL, HFILL }
5085 { &hf_mbim_set_pin_pin_pin_size,
5086 { "PIN Size", "mbim.control.set_pin.pin.size",
5087 FT_UINT32, BASE_DEC, NULL, 0,
5088 NULL, HFILL }
5090 { &hf_mbim_set_pin_new_pin_offset,
5091 { "New PIN Offset", "mbim.control.set_pin.new_pin.offset",
5092 FT_UINT32, BASE_DEC, NULL, 0,
5093 NULL, HFILL }
5095 { &hf_mbim_set_pin_new_pin_size,
5096 { "New PIN Size", "mbim.control.set_pin.new_pin.size",
5097 FT_UINT32, BASE_DEC, NULL, 0,
5098 NULL, HFILL }
5100 { &hf_mbim_set_pin_pin,
5101 { "PIN", "mbim.control.set_pin.pin",
5102 FT_STRING, BASE_NONE, NULL, 0,
5103 NULL, HFILL }
5105 { &hf_mbim_set_pin_new_pin,
5106 { "New PIN", "mbim.control.set_pin.new_pin",
5107 FT_STRING, BASE_NONE, NULL, 0,
5108 NULL, HFILL }
5110 { &hf_mbim_pin_info_pin_type,
5111 { "PIN Type", "mbim.control.pin_info.pin_type",
5112 FT_UINT32, BASE_DEC, VALS(mbim_pin_type_vals), 0,
5113 NULL, HFILL }
5115 { &hf_mbim_pin_info_pin_state,
5116 { "PIN State", "mbim.control.pin_info.pin_state",
5117 FT_UINT32, BASE_DEC, VALS(mbim_pin_state_vals), 0,
5118 NULL, HFILL }
5120 { &hf_mbim_pin_info_remaining_attempts,
5121 { "Remaining Attempts", "mbim.control.pin_info.remaining_attempts",
5122 FT_UINT32, BASE_DEC, NULL, 0,
5123 NULL, HFILL }
5125 { &hf_mbim_pin_list_pin_mode,
5126 { "PIN Mode", "mbim.control.pin_list.pin_mode",
5127 FT_UINT32, BASE_DEC, VALS(mbim_pin_mode_vals), 0,
5128 NULL, HFILL }
5130 { &hf_mbim_pin_list_pin_format,
5131 { "PIN Format", "mbim.control.pin_list.pin_format",
5132 FT_UINT32, BASE_DEC, VALS(mbim_pin_format_vals), 0,
5133 NULL, HFILL }
5135 { &hf_mbim_pin_list_pin_length_min,
5136 { "PIN Length Min", "mbim.control.pin_list.pin_length_min",
5137 FT_UINT32, BASE_DEC, NULL, 0,
5138 NULL, HFILL }
5140 { &hf_mbim_pin_list_pin_length_max,
5141 { "PIN Length Max", "mbim.control.pin_list.pin_length_max",
5142 FT_UINT32, BASE_DEC, NULL, 0,
5143 NULL, HFILL }
5145 { &hf_mbim_provider_state,
5146 { "Provider State", "mbim.control.provider_state",
5147 FT_UINT32, BASE_HEX, NULL, 0,
5148 NULL, HFILL }
5150 { &hf_mbim_provider_state_home,
5151 { "Home", "mbim.control.provider_state.home",
5152 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
5153 NULL, HFILL }
5155 { &hf_mbim_provider_state_forbidden,
5156 { "Forbidden", "mbim.control.provider_state.forbidden",
5157 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
5158 NULL, HFILL }
5160 { &hf_mbim_provider_state_preferred,
5161 { "Preferred", "mbim.control.provider_state.preferred",
5162 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000004,
5163 NULL, HFILL }
5165 { &hf_mbim_provider_state_visible,
5166 { "Visible", "mbim.control.provider_state.visible",
5167 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000008,
5168 NULL, HFILL }
5170 { &hf_mbim_provider_state_registered,
5171 { "Registered", "mbim.control.provider_state.registered",
5172 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000010,
5173 NULL, HFILL }
5175 { &hf_mbim_provider_state_preferred_multicarrier,
5176 { "Preferred Multicarrier", "mbim.control.provider_state.preferred_multicarrier",
5177 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000020,
5178 NULL, HFILL }
5180 { &hf_mbim_provider_provider_id_offset,
5181 { "Provider Id Offset", "mbim.control.provider.provider_id_offset",
5182 FT_UINT32, BASE_DEC, NULL, 0,
5183 NULL, HFILL }
5185 { &hf_mbim_provider_provider_id_size,
5186 { "Provider Id Size", "mbim.control.provider.provider_id_size",
5187 FT_UINT32, BASE_DEC, NULL, 0,
5188 NULL, HFILL }
5190 { &hf_mbim_provider_provider_name_offset,
5191 { "Provider Name Offset", "mbim.control.provider.provider_name_offset",
5192 FT_UINT32, BASE_DEC, NULL, 0,
5193 NULL, HFILL }
5195 { &hf_mbim_provider_provider_name_size,
5196 { "Provider Name Size", "mbim.control.provider.provider_name_size",
5197 FT_UINT32, BASE_DEC, NULL, 0,
5198 NULL, HFILL }
5200 { &hf_mbim_provider_cellular_class,
5201 { "Cellular Class", "mbim.control.provider.cellular_class",
5202 FT_UINT32, BASE_DEC, VALS(mbim_cellular_class_vals), 0,
5203 NULL, HFILL }
5205 { &hf_mbim_provider_rssi,
5206 { "RSSI", "mbim.control.provider.rssi",
5207 FT_UINT32, BASE_CUSTOM, mbim_rssi_fmt, 0,
5208 NULL, HFILL }
5210 { &hf_mbim_provider_error_rate,
5211 { "Error Rate", "mbim.control.provider.error_rate",
5212 FT_UINT32, BASE_DEC, VALS(mbim_error_rate_vals), 0,
5213 NULL, HFILL }
5215 { &hf_mbim_provider_provider_id,
5216 { "Provider Id", "mbim.control.provider.provider_id",
5217 FT_STRING, BASE_NONE, NULL, 0,
5218 NULL, HFILL }
5220 { &hf_mbim_provider_provider_name,
5221 { "Provider Name", "mbim.control.provider.provider_name",
5222 FT_STRING, BASE_NONE, NULL, 0,
5223 NULL, HFILL }
5225 { &hf_mbim_providers_elem_count,
5226 { "Element Count", "mbim.control.providers.elem_count",
5227 FT_UINT32, BASE_DEC, NULL, 0,
5228 NULL, HFILL }
5230 { &hf_mbim_providers_provider_offset,
5231 { "Provider Offset", "mbim.control.providers.provider_offset",
5232 FT_UINT32, BASE_DEC, NULL, 0,
5233 NULL, HFILL }
5235 { &hf_mbim_providers_provider_size,
5236 { "Provider Size", "mbim.control.providers.provider_size",
5237 FT_UINT32, BASE_DEC, NULL, 0,
5238 NULL, HFILL }
5240 { &hf_mbim_visible_providers_req_action,
5241 { "Action", "mbim.control.visible_providers_req.action",
5242 FT_UINT32, BASE_DEC, VALS(mbim_visible_providers_action_vals), 0,
5243 NULL, HFILL }
5245 { &hf_mbim_set_register_state_provider_id_offset,
5246 { "Provider Id Offset", "mbim.control.set_register_state.provider_id.offset",
5247 FT_UINT32, BASE_DEC, NULL, 0,
5248 NULL, HFILL }
5250 { &hf_mbim_set_register_state_provider_id_size,
5251 { "Provider Id Size", "mbim.control.set_register_state.provider_id.size",
5252 FT_UINT32, BASE_DEC, NULL, 0,
5253 NULL, HFILL }
5255 { &hf_mbim_set_register_state_register_action,
5256 { "Register Action", "mbim.control.set_register_state.register_action",
5257 FT_UINT32, BASE_DEC, VALS(mbim_register_action_vals), 0,
5258 NULL, HFILL }
5260 { &hf_mbim_register_state_data_class,
5261 { "Data Class", "mbim.control.set_register_state.data_class",
5262 FT_UINT32, BASE_HEX, NULL, 0,
5263 NULL, HFILL }
5265 { &hf_mbim_set_register_state_provider_id,
5266 { "Provider Id", "mbim.control.set_register_state.provider_id",
5267 FT_STRING, BASE_NONE, NULL, 0,
5268 NULL, HFILL }
5270 { &hf_mbim_registration_state_info_nw_error,
5271 { "Network Error", "mbim.control.registration_state_info.nw_error",
5272 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0,
5273 NULL, HFILL }
5275 { &hf_mbim_registration_state_info_register_state,
5276 { "Register State", "mbim.control.registration_state_info.register_state",
5277 FT_UINT32, BASE_DEC, VALS(mbim_register_state_vals), 0,
5278 NULL, HFILL }
5280 { &hf_mbim_registration_state_info_register_mode,
5281 { "Register Mode", "mbim.control.registration_state_info.register_mode",
5282 FT_UINT32, BASE_DEC, VALS(mbim_register_mode_vals), 0,
5283 NULL, HFILL }
5285 { &hf_mbim_registration_state_info_available_data_classes,
5286 { "Available Data Classes", "mbim.control.registration_state_info.available_data_classes",
5287 FT_UINT32, BASE_HEX, NULL, 0,
5288 NULL, HFILL }
5290 { &hf_mbim_registration_state_info_current_cellular_class,
5291 { "Current Cellular Class", "mbim.control.registration_state_info.current_cellular_class",
5292 FT_UINT32, BASE_DEC, VALS(mbim_cellular_class_vals), 0,
5293 NULL, HFILL }
5295 { &hf_mbim_registration_state_info_provider_id_offset,
5296 { "Provider Id Offset", "mbim.control.registration_state_info.provider_id.offset",
5297 FT_UINT32, BASE_DEC, NULL, 0,
5298 NULL, HFILL }
5300 { &hf_mbim_registration_state_info_provider_id_size,
5301 { "Provider Id Size", "mbim.control.registration_state_info.provider_id.size",
5302 FT_UINT32, BASE_DEC, NULL, 0,
5303 NULL, HFILL }
5305 { &hf_mbim_registration_state_info_provider_name_offset,
5306 { "Provider Name Offset", "mbim.control.registration_state_info.provider_name.offset",
5307 FT_UINT32, BASE_DEC, NULL, 0,
5308 NULL, HFILL }
5310 { &hf_mbim_registration_state_info_provider_name_size,
5311 { "Provider Name Size", "mbim.control.registration_state_info.provider_name.size",
5312 FT_UINT32, BASE_DEC, NULL, 0,
5313 NULL, HFILL }
5315 { &hf_mbim_registration_state_info_roaming_text_offset,
5316 { "Roaming Text Offset", "mbim.control.registration_state_info.roaming_text.offset",
5317 FT_UINT32, BASE_DEC, NULL, 0,
5318 NULL, HFILL }
5320 { &hf_mbim_registration_state_info_roaming_text_size,
5321 { "Roaming Text Size", "mbim.control.registration_state_info.roaming_text.size",
5322 FT_UINT32, BASE_DEC, NULL, 0,
5323 NULL, HFILL }
5325 { &hf_mbim_registration_state_info_registration_flags,
5326 { "Registration Flags", "mbim.control.registration_state_info.registration_flags",
5327 FT_UINT32, BASE_HEX, NULL, 0,
5328 NULL, HFILL }
5330 { &hf_mbim_registration_state_info_registration_flags_manual_selection_not_available,
5331 { "Manual Selection Not Available", "mbim.control.registration_state_info.registration_flags.manual_selection_not_available",
5332 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
5333 NULL, HFILL }
5335 { &hf_mbim_registration_state_info_registration_flags_packet_service_auto_attach,
5336 { "Packet Service Auto Attach", "mbim.control.registration_state_info.registration_flags.packet_service_auto_attach",
5337 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
5338 NULL, HFILL }
5340 { &hf_mbim_registration_state_info_provider_id,
5341 { "Provider Id", "mbim.control.registration_state_info.provider_id",
5342 FT_STRING, BASE_NONE, NULL, 0,
5343 NULL, HFILL }
5345 { &hf_mbim_registration_state_info_provider_name,
5346 { "Provider Name", "mbim.control.registration_state_info.provider_name",
5347 FT_STRING, BASE_NONE, NULL, 0,
5348 NULL, HFILL }
5350 { &hf_mbim_registration_state_info_roaming_text,
5351 { "Roaming Text", "mbim.control.registration_state_info.roaming_text",
5352 FT_STRING, BASE_NONE, NULL, 0,
5353 NULL, HFILL }
5355 { &hf_mbim_set_packet_service_action,
5356 { "Action", "mbim.control.set_packet_service.action",
5357 FT_UINT32, BASE_DEC, VALS(mbim_packet_service_action_vals), 0,
5358 NULL, HFILL }
5360 { &hf_mbim_packet_service_info_nw_error,
5361 { "Network Error", "mbim.control.packet_service_info.nw_error",
5362 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0,
5363 NULL, HFILL }
5365 { &hf_mbim_packet_service_info_packet_service_state,
5366 { "Packet Service State", "mbim.control.packet_service_info.packet_service_state",
5367 FT_UINT32, BASE_DEC, VALS(mbim_packet_service_state_vals), 0,
5368 NULL, HFILL }
5370 { &hf_mbim_packet_service_info_highest_available_data_class,
5371 { "Highest Available Data Class", "mbim.control.packet_service_info.highest_available_data_class",
5372 FT_UINT32, BASE_HEX, NULL, 0,
5373 NULL, HFILL }
5375 { &hf_mbim_packet_service_info_uplink_speed,
5376 { "Uplink Speed", "mbim.control.packet_service_info.uplink_speed",
5377 FT_UINT64, BASE_DEC, NULL, 0,
5378 NULL, HFILL }
5380 { &hf_mbim_packet_service_info_downlink_speed,
5381 { "Downlink Speed", "mbim.control.packet_service_info.downlink_speed",
5382 FT_UINT64, BASE_DEC, NULL, 0,
5383 NULL, HFILL }
5385 { &hf_mbim_set_signal_state_signal_strength_interval,
5386 { "Signal Strength Interval", "mbim.control.set_signal_state.signal_strength_interval",
5387 FT_UINT32, BASE_DEC, NULL, 0,
5388 NULL, HFILL }
5390 { &hf_mbim_set_signal_state_rssi_threshold,
5391 { "RSSI Threshold", "mbim.control.set_signal_state.rssi_threshold",
5392 FT_UINT32, BASE_DEC, NULL, 0,
5393 NULL, HFILL }
5395 { &hf_mbim_set_signal_state_error_rate_threshold,
5396 { "Error Rate Threshold", "mbim.control.set_signal_state.error_rate_threshold",
5397 FT_UINT32, BASE_DEC, NULL, 0,
5398 NULL, HFILL }
5400 { &hf_mbim_signal_state_info_rssi,
5401 { "RSSI", "mbim.control.signal_state_info.rssi",
5402 FT_UINT32, BASE_CUSTOM, mbim_rssi_fmt, 0,
5403 NULL, HFILL }
5405 { &hf_mbim_signal_state_info_error_rate,
5406 { "Error Rate", "mbim.control.signal_state_info.error_rate",
5407 FT_UINT32, BASE_DEC, VALS(mbim_error_rate_vals), 0,
5408 NULL, HFILL }
5410 { &hf_mbim_signal_state_info_signal_strength_interval,
5411 { "Signal Strength Interval", "mbim.control.signal_state_info.signal_strength_interval",
5412 FT_UINT32, BASE_DEC, NULL, 0,
5413 NULL, HFILL }
5415 { &hf_mbim_signal_state_info_rssi_threshold,
5416 { "RSSI Threshold", "mbim.control.signal_state_info.rssi_threshold",
5417 FT_UINT32, BASE_DEC, NULL, 0,
5418 NULL, HFILL }
5420 { &hf_mbim_signal_state_info_error_rate_threshold,
5421 { "Error Rate Threshold", "mbim.control.signal_state_info.error_rate_threshold",
5422 FT_UINT32, BASE_DEC, NULL, 0,
5423 NULL, HFILL }
5425 { &hf_mbim_context_type,
5426 { "Context Type", "mbim.control.context_type",
5427 FT_GUID, BASE_NONE, NULL, 0,
5428 NULL, HFILL }
5430 { &hf_mbim_set_connect_session_id,
5431 { "Session Id", "mbim.control.set_connect.session_id",
5432 FT_UINT32, BASE_DEC, NULL, 0,
5433 NULL, HFILL }
5435 { &hf_mbim_set_connect_activation_command,
5436 { "Activation Command", "mbim.control.set_connect.activation_command",
5437 FT_UINT32, BASE_DEC, VALS(mbim_activation_command_vals), 0,
5438 NULL, HFILL }
5440 { &hf_mbim_set_connect_access_string_offset,
5441 { "Access String Offset", "mbim.control.set_connect.access_string_offset",
5442 FT_UINT32, BASE_DEC, NULL, 0,
5443 NULL, HFILL }
5445 { &hf_mbim_set_connect_access_string_size,
5446 { "Access String Size", "mbim.control.set_connect.access_string_size",
5447 FT_UINT32, BASE_DEC, NULL, 0,
5448 NULL, HFILL }
5450 { &hf_mbim_set_connect_user_name_offset,
5451 { "User Name Offset", "mbim.control.set_connect.user_name_offset",
5452 FT_UINT32, BASE_DEC, NULL, 0,
5453 NULL, HFILL }
5455 { &hf_mbim_set_connect_user_name_size,
5456 { "User Name Size", "mbim.control.set_connect.user_name_size",
5457 FT_UINT32, BASE_DEC, NULL, 0,
5458 NULL, HFILL }
5460 { &hf_mbim_set_connect_password_offset,
5461 { "Password Offset", "mbim.control.set_connect.password_offset",
5462 FT_UINT32, BASE_DEC, NULL, 0,
5463 NULL, HFILL }
5465 { &hf_mbim_set_connect_password_size,
5466 { "Password Size", "mbim.control.set_connect.password_size",
5467 FT_UINT32, BASE_DEC, NULL, 0,
5468 NULL, HFILL }
5470 { &hf_mbim_set_connect_compression,
5471 { "Compression", "mbim.control.set_connect.compression",
5472 FT_UINT32, BASE_DEC, VALS(mbim_compression_vals), 0,
5473 NULL, HFILL }
5475 { &hf_mbim_set_connect_auth_protocol,
5476 { "Authentication Protocol", "mbim.control.set_connect.auth_protocol",
5477 FT_UINT32, BASE_DEC, VALS(mbim_auth_protocol_vals), 0,
5478 NULL, HFILL }
5480 { &hf_mbim_set_connect_ip_type,
5481 { "IP Type", "mbim.control.set_connect.ip_type",
5482 FT_UINT32, BASE_DEC, VALS(mbim_context_ip_type_vals), 0,
5483 NULL, HFILL }
5485 { &hf_mbim_set_connect_access_string,
5486 { "Access String", "mbim.control.set_connect.access_string",
5487 FT_STRING, BASE_NONE, NULL, 0,
5488 NULL, HFILL }
5490 { &hf_mbim_set_connect_user_name,
5491 { "User Name", "mbim.control.set_connect.user_name",
5492 FT_STRING, BASE_NONE, NULL, 0,
5493 NULL, HFILL }
5495 { &hf_mbim_set_connect_password,
5496 { "Password", "mbim.control.set_connect.password",
5497 FT_STRING, BASE_NONE, NULL, 0,
5498 NULL, HFILL }
5500 { &hf_mbim_connect_info_session_id,
5501 { "Session Id", "mbim.control.connect_info.session_id",
5502 FT_UINT32, BASE_DEC, NULL, 0,
5503 NULL, HFILL }
5505 { &hf_mbim_connect_info_activation_state,
5506 { "Activation State", "mbim.control.connect_info.activation_state",
5507 FT_UINT32, BASE_DEC, VALS(mbim_activation_state_vals), 0,
5508 NULL, HFILL }
5510 { &hf_mbim_connect_info_voice_call_state,
5511 { "Voice Call State", "mbim.control.connect_info.voice_call_state",
5512 FT_UINT32, BASE_DEC, VALS(mbim_voice_call_state_vals), 0,
5513 NULL, HFILL }
5515 { &hf_mbim_connect_info_ip_type,
5516 { "IP Type", "mbim.control.connect_info.ip_type",
5517 FT_UINT32, BASE_DEC, VALS(mbim_context_ip_type_vals), 0,
5518 NULL, HFILL }
5520 { &hf_mbim_connect_info_nw_error,
5521 { "Network Error", "mbim.control.connect_info.nw_error",
5522 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0,
5523 NULL, HFILL }
5525 { &hf_mbim_context_context_id,
5526 { "Context Id", "mbim.control.context.context_id",
5527 FT_UINT32, BASE_DEC, NULL, 0,
5528 NULL, HFILL }
5530 { &hf_mbim_context_access_string_offset,
5531 { "Access String Offset", "mbim.control.context.access_string_offset",
5532 FT_UINT32, BASE_DEC, NULL, 0,
5533 NULL, HFILL }
5535 { &hf_mbim_context_access_string_size,
5536 { "Access String Size", "mbim.control.context.access_string_size",
5537 FT_UINT32, BASE_DEC, NULL, 0,
5538 NULL, HFILL }
5540 { &hf_mbim_context_user_name_offset,
5541 { "User Name Offset", "mbim.control.context.user_name_offset",
5542 FT_UINT32, BASE_DEC, NULL, 0,
5543 NULL, HFILL }
5545 { &hf_mbim_context_user_name_size,
5546 { "User Name Size", "mbim.control.context.user_name_size",
5547 FT_UINT32, BASE_DEC, NULL, 0,
5548 NULL, HFILL }
5550 { &hf_mbim_context_password_offset,
5551 { "Password Offset", "mbim.control.context.password_offset",
5552 FT_UINT32, BASE_DEC, NULL, 0,
5553 NULL, HFILL }
5555 { &hf_mbim_context_password_size,
5556 { "Password Size", "mbim.control.context.password_size",
5557 FT_UINT32, BASE_DEC, NULL, 0,
5558 NULL, HFILL }
5560 { &hf_mbim_context_compression,
5561 { "Compression", "mbim.control.context.compression",
5562 FT_UINT32, BASE_DEC, VALS(mbim_compression_vals), 0,
5563 NULL, HFILL }
5565 { &hf_mbim_context_auth_protocol,
5566 { "Authentication Protocol", "mbim.control.context.auth_protocol",
5567 FT_UINT32, BASE_DEC, VALS(mbim_auth_protocol_vals), 0,
5568 NULL, HFILL }
5570 { &hf_mbim_context_provider_id_offset,
5571 { "Provider Id Offset", "mbim.control.context.provider_id_offset",
5572 FT_UINT32, BASE_DEC, NULL, 0,
5573 NULL, HFILL }
5575 { &hf_mbim_context_provider_id_size,
5576 { "Provider Id Size", "mbim.control.context.provider_id_size",
5577 FT_UINT32, BASE_DEC, NULL, 0,
5578 NULL, HFILL }
5580 { &hf_mbim_context_access_string,
5581 { "Access String", "mbim.control.context.access_string",
5582 FT_STRING, BASE_NONE, NULL, 0,
5583 NULL, HFILL }
5585 { &hf_mbim_context_user_name,
5586 { "User Name", "mbim.control.context.user_name",
5587 FT_STRING, BASE_NONE, NULL, 0,
5588 NULL, HFILL }
5590 { &hf_mbim_context_password,
5591 { "Password", "mbim.control.context.password",
5592 FT_STRING, BASE_NONE, NULL, 0,
5593 NULL, HFILL }
5595 { &hf_mbim_context_provider_id,
5596 { "Provider Id", "mbim.control.context.provider_id",
5597 FT_STRING, BASE_NONE, NULL, 0,
5598 NULL, HFILL }
5600 { &hf_mbim_provisioned_contexts_info_elem_count,
5601 { "UElement Count", "mbim.control.context.provisioned_contexts_info.elem_count",
5602 FT_UINT32, BASE_DEC, NULL, 0,
5603 NULL, HFILL }
5605 { &hf_mbim_provisioned_contexts_info_provisioned_context_offset,
5606 { "Provisioned Context Offset", "mbim.control.context.provisioned_contexts_info.provisioned_context_offset",
5607 FT_UINT32, BASE_DEC, NULL, 0,
5608 NULL, HFILL }
5610 { &hf_mbim_provisioned_contexts_info_provisioned_context_size,
5611 { "Provisioned Context Size", "mbim.control.context.provisioned_contexts_info.provisioned_context_size",
5612 FT_UINT32, BASE_DEC, NULL, 0,
5613 NULL, HFILL }
5615 { &hf_mbim_set_service_activation_data_buffer,
5616 { "Data Buffer", "mbim.control.set_service_activation.data_buffer",
5617 FT_BYTES, BASE_NONE, NULL, 0,
5618 NULL, HFILL }
5620 { &hf_mbim_service_activation_info_nw_error,
5621 { "Network Error", "mbim.control.service_activation_info.nw_error",
5622 FT_UINT32, BASE_DEC|BASE_EXT_STRING, &nas_eps_emm_cause_values_ext, 0,
5623 NULL, HFILL }
5625 { &hf_mbim_service_activation_info_data_buffer,
5626 { "Data Buffer", "mbim.control.service_activation_info.data_buffer",
5627 FT_BYTES, BASE_NONE, NULL, 0,
5628 NULL, HFILL }
5630 { &hf_mbim_ipv4_element_on_link_prefix_length,
5631 { "On Link Prefix Length", "mbim.control.ipv4_element.on_link_prefix_length",
5632 FT_UINT32, BASE_DEC, NULL, 0,
5633 NULL, HFILL }
5635 { &hf_mbim_ipv4_element_ipv4_address,
5636 { "IPv4 Address", "mbim.control.ipv4_element.ipv4_address",
5637 FT_IPv4, BASE_NONE, NULL, 0,
5638 NULL, HFILL }
5640 { &hf_mbim_ipv6_element_on_link_prefix_length,
5641 { "On Link Prefix Length", "mbim.control.ipv6_element.on_link_prefix_length",
5642 FT_UINT32, BASE_DEC, NULL, 0,
5643 NULL, HFILL }
5645 { &hf_mbim_ipv6_element_ipv6_address,
5646 { "IPv6 Address", "mbim.control.ipv6_element.ipv6_address",
5647 FT_IPv6, BASE_NONE, NULL, 0,
5648 NULL, HFILL }
5650 { &hf_mbim_ip_configuration_info_session_id,
5651 { "Session Id", "mbim.control.ip_configuration_info.session_id",
5652 FT_UINT32, BASE_DEC, NULL, 0,
5653 NULL, HFILL }
5655 { &hf_mbim_ip_configuration_info_ipv4_configuration_available,
5656 { "IPv4 Configuration Available", "mbim.control.ip_configuration_info.ipv4_configuration_available",
5657 FT_UINT32, BASE_HEX, NULL, 0,
5658 NULL, HFILL }
5660 { &hf_mbim_ip_configuration_info_ipv4_configuration_available_address,
5661 { "Address", "mbim.control.ip_configuration_info.control_caps.ipv4_configuration_available.address",
5662 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000001,
5663 NULL, HFILL }
5665 { &hf_mbim_ip_configuration_info_ipv4_configuration_available_gateway,
5666 { "Gateway", "mbim.control.ip_configuration_info.control_caps.ipv4_configuration_available.gateway",
5667 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000002,
5668 NULL, HFILL }
5670 { &hf_mbim_ip_configuration_info_ipv4_configuration_available_dns,
5671 { "DNS Server", "mbim.control.ip_configuration_info.control_caps.ipv4_configuration_available.dns",
5672 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000004,
5673 NULL, HFILL }
5675 { &hf_mbim_ip_configuration_info_ipv4_configuration_available_mtu,
5676 { "MTU", "mbim.control.ip_configuration_info.control_caps.ipv4_configuration_available.mtu",
5677 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000008,
5678 NULL, HFILL }
5680 { &hf_mbim_ip_configuration_info_ipv6_configuration_available,
5681 { "IPv6 Configuration Available", "mbim.control.ip_configuration_info.ipv6_configuration_available",
5682 FT_UINT32, BASE_HEX, NULL, 0,
5683 NULL, HFILL }
5685 { &hf_mbim_ip_configuration_info_ipv6_configuration_available_address,
5686 { "Address", "mbim.control.ip_configuration_info.control_caps.ipv6_configuration_available.address",
5687 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000001,
5688 NULL, HFILL }
5690 { &hf_mbim_ip_configuration_info_ipv6_configuration_available_gateway,
5691 { "Gateway", "mbim.control.ip_configuration_info.control_caps.ipv6_configuration_available.gateway",
5692 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000002,
5693 NULL, HFILL }
5695 { &hf_mbim_ip_configuration_info_ipv6_configuration_available_dns,
5696 { "DNS Server", "mbim.control.ip_configuration_info.control_caps.ipv6_configuration_available.dns",
5697 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000004,
5698 NULL, HFILL }
5700 { &hf_mbim_ip_configuration_info_ipv6_configuration_available_mtu,
5701 { "MTU", "mbim.control.ip_configuration_info.control_caps.ipv6_configuration_available.mtu",
5702 FT_BOOLEAN, 32, TFS(&tfs_available_not_available), 0x00000008,
5703 NULL, HFILL }
5705 { &hf_mbim_ip_configuration_info_ipv4_address_count,
5706 { "IPv4 Address Count", "mbim.control.ip_configuration_info.ipv4_address.count",
5707 FT_UINT32, BASE_DEC, NULL, 0,
5708 NULL, HFILL }
5710 { &hf_mbim_ip_configuration_info_ipv4_address_offset,
5711 { "IPv4 Address Offset", "mbim.control.ip_configuration_info.ipv4_address.offset",
5712 FT_UINT32, BASE_DEC, NULL, 0,
5713 NULL, HFILL }
5715 { &hf_mbim_ip_configuration_info_ipv6_address_count,
5716 { "IPv6 Address Count", "mbim.control.ip_configuration_info.ipv6_address.count",
5717 FT_UINT32, BASE_DEC, NULL, 0,
5718 NULL, HFILL }
5720 { &hf_mbim_ip_configuration_info_ipv6_address_offset,
5721 { "IPv6 Address Offset", "mbim.control.ip_configuration_info.ipv6_address.offset",
5722 FT_UINT32, BASE_DEC, NULL, 0,
5723 NULL, HFILL }
5725 { &hf_mbim_ip_configuration_info_ipv4_gateway_offset,
5726 { "IPv4 Gateway Offset", "mbim.control.ip_configuration_info.ipv4_gateway.offset",
5727 FT_UINT32, BASE_DEC, NULL, 0,
5728 NULL, HFILL }
5730 { &hf_mbim_ip_configuration_info_ipv6_gateway_offset,
5731 { "IPv6 Gateway Offset", "mbim.control.ip_configuration_info.ipv6_gateway.offset",
5732 FT_UINT32, BASE_DEC, NULL, 0,
5733 NULL, HFILL }
5735 { &hf_mbim_ip_configuration_info_ipv4_dns_count,
5736 { "IPv4 DNS Server Count", "mbim.control.ip_configuration_info.ipv4_dns.count",
5737 FT_UINT32, BASE_DEC, NULL, 0,
5738 NULL, HFILL }
5740 { &hf_mbim_ip_configuration_info_ipv4_dns_offset,
5741 { "IPv4 DNS Server Offset", "mbim.control.ip_configuration_info.ipv4_dns.offset",
5742 FT_UINT32, BASE_DEC, NULL, 0,
5743 NULL, HFILL }
5745 { &hf_mbim_ip_configuration_info_ipv6_dns_count,
5746 { "IPv6 DNS Server Count", "mbim.control.ip_configuration_info.ipv6_dns.count",
5747 FT_UINT32, BASE_DEC, NULL, 0,
5748 NULL, HFILL }
5750 { &hf_mbim_ip_configuration_info_ipv6_dns_offset,
5751 { "IPv6 DNS Server Offset", "mbim.control.ip_configuration_info.ipv6_dns.offset",
5752 FT_UINT32, BASE_DEC, NULL, 0,
5753 NULL, HFILL }
5755 { &hf_mbim_ip_configuration_info_ipv4_mtu,
5756 { "IPv4 MTU", "mbim.control.ip_configuration_info.ipv4_mtu",
5757 FT_UINT32, BASE_DEC, NULL, 0,
5758 NULL, HFILL }
5760 { &hf_mbim_ip_configuration_info_ipv6_mtu,
5761 { "IPv6 MTU", "mbim.control.ip_configuration_info.ipv6_mtu",
5762 FT_UINT32, BASE_DEC, NULL, 0,
5763 NULL, HFILL }
5765 { &hf_mbim_ip_configuration_info_ipv4_gateway,
5766 { "IPv4 Gateway", "mbim.control.ip_configuration_info.ipv4_gateway",
5767 FT_IPv4, BASE_NONE, NULL, 0,
5768 NULL, HFILL }
5770 { &hf_mbim_ip_configuration_info_ipv6_gateway,
5771 { "IPv6 Gateway", "mbim.control.ip_configuration_info.ipv6_gateway",
5772 FT_IPv6, BASE_NONE, NULL, 0,
5773 NULL, HFILL }
5775 { &hf_mbim_ip_configuration_info_ipv4_dns,
5776 { "IPv4 DNS Server", "mbim.control.ip_configuration_info.ipv4_dns",
5777 FT_IPv4, BASE_NONE, NULL, 0,
5778 NULL, HFILL }
5780 { &hf_mbim_ip_configuration_info_ipv6_dns,
5781 { "IPv6 DNS Server", "mbim.control.ip_configuration_info.ipv6_dns",
5782 FT_IPv6, BASE_NONE, NULL, 0,
5783 NULL, HFILL }
5785 { &hf_mbim_device_service_element_device_service_id,
5786 { "Device Service Id", "mbim.control.device_service_element.device_service_id",
5787 FT_GUID, BASE_NONE, NULL, 0,
5788 NULL, HFILL }
5790 { &hf_mbim_device_service_element_dss_payload,
5791 { "DSS Payload", "mbim.control.device_service_element.dss_payload",
5792 FT_UINT32, BASE_HEX, NULL, 0,
5793 NULL, HFILL }
5795 { &hf_mbim_device_service_element_dss_payload_host_device,
5796 { "Host To Device", "mbim.control.device_service_element.dss_payload.host_device",
5797 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
5798 NULL, HFILL }
5800 { &hf_mbim_device_service_element_dss_payload_device_host,
5801 { "Device To Host", "mbim.control.device_service_element.dss_payload.device_host",
5802 FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
5803 NULL, HFILL }
5805 { &hf_mbim_device_service_element_max_dss_instances,
5806 { "Max DSS Instances", "mbim.control.device_service_element.max_dss_instances",
5807 FT_UINT32, BASE_DEC, NULL, 0,
5808 NULL, HFILL }
5810 { &hf_mbim_device_service_element_cid_count,
5811 { "CID Count", "mbim.control.device_service_element.cid.count",
5812 FT_UINT32, BASE_DEC, NULL, 0,
5813 NULL, HFILL }
5815 { &hf_mbim_device_service_element_cid,
5816 { "CID", "mbim.control.device_service_element.cid",
5817 FT_UINT32, BASE_DEC, NULL, 0,
5818 NULL, HFILL }
5820 { &hf_mbim_device_services_info_device_services_count,
5821 { "Device Services Count", "mbim.control.device_services_info.device_services_count",
5822 FT_UINT32, BASE_DEC, NULL, 0,
5823 NULL, HFILL }
5825 { &hf_mbim_device_services_info_max_dss_sessions,
5826 { "Max DSS Sessions", "mbim.control.device_services_info.max_dss_sessions",
5827 FT_UINT32, BASE_DEC, NULL, 0,
5828 NULL, HFILL }
5830 { &hf_mbim_device_services_info_device_services_offset,
5831 { "Device Services Offset", "mbim.control.device_services_info.device_services.offset",
5832 FT_UINT32, BASE_DEC, NULL, 0,
5833 NULL, HFILL }
5835 { &hf_mbim_device_services_info_device_services_size,
5836 { "Device Services Size", "mbim.control.device_services_info.device_services.size",
5837 FT_UINT32, BASE_DEC, NULL, 0,
5838 NULL, HFILL }
5840 { &hf_mbim_event_entry_device_service_id,
5841 { "Device Service Id", "mbim.control.event_entry.device_service_id",
5842 FT_GUID, BASE_NONE, NULL, 0,
5843 NULL, HFILL }
5845 { &hf_mbim_event_entry_cid_count,
5846 { "CID Count", "mbim.control.event_entry.cid.count",
5847 FT_UINT32, BASE_DEC, NULL, 0,
5848 NULL, HFILL }
5850 { &hf_mbim_event_entry_cid,
5851 { "CID", "mbim.control.event_entry.cid",
5852 FT_UINT32, BASE_DEC, NULL, 0,
5853 NULL, HFILL }
5855 { &hf_mbim_device_service_subscribe_element_count,
5856 { "Element Count", "mbim.control.device_service_subscribe.element_count",
5857 FT_UINT32, BASE_DEC, NULL, 0,
5858 NULL, HFILL }
5860 { &hf_mbim_device_service_subscribe_device_service_offset,
5861 { "Device Service Offset", "mbim.control.device_service_subscribe.device_service.offset",
5862 FT_UINT32, BASE_DEC, NULL, 0,
5863 NULL, HFILL }
5865 { &hf_mbim_device_service_subscribe_device_service_size,
5866 { "Device Service Size", "mbim.control.device_service_subscribe.device_service.size",
5867 FT_UINT32, BASE_DEC, NULL, 0,
5868 NULL, HFILL }
5870 { &hf_mbim_packet_statistics_info_in_discards,
5871 { "In Discards", "mbim.control.packet_statistics_info.in_discards",
5872 FT_UINT32, BASE_DEC, NULL, 0,
5873 NULL, HFILL }
5875 { &hf_mbim_packet_statistics_info_in_errors,
5876 { "In Errors", "mbim.control.packet_statistics_info.in_errors",
5877 FT_UINT32, BASE_DEC, NULL, 0,
5878 NULL, HFILL }
5880 { &hf_mbim_packet_statistics_info_in_octets,
5881 { "In Octets", "mbim.control.packet_statistics_info.in_octets",
5882 FT_UINT64, BASE_DEC, NULL, 0,
5883 NULL, HFILL }
5885 { &hf_mbim_packet_statistics_info_in_packets,
5886 { "In Packets", "mbim.control.packet_statistics_info.in_packets",
5887 FT_UINT64, BASE_DEC, NULL, 0,
5888 NULL, HFILL }
5890 { &hf_mbim_packet_statistics_info_out_octets,
5891 { "Out Octets", "mbim.control.packet_statistics_info.out_octets",
5892 FT_UINT64, BASE_DEC, NULL, 0,
5893 NULL, HFILL }
5895 { &hf_mbim_packet_statistics_info_out_packets,
5896 { "Out Packets", "mbim.control.packet_statistics_info.out_packets",
5897 FT_UINT64, BASE_DEC, NULL, 0,
5898 NULL, HFILL }
5900 { &hf_mbim_packet_statistics_info_out_errors,
5901 { "Out Errors", "mbim.control.packet_statistics_info.out_errors",
5902 FT_UINT32, BASE_DEC, NULL, 0,
5903 NULL, HFILL }
5905 { &hf_mbim_packet_statistics_info_out_discards,
5906 { "Out Discards", "mbim.control.packet_statistics_info.out_discards",
5907 FT_UINT32, BASE_DEC, NULL, 0,
5908 NULL, HFILL }
5910 { &hf_mbim_network_idle_hint_state,
5911 { "Network Idle Hint State", "mbim.control.network_idle_hint.state",
5912 FT_UINT32, BASE_DEC, VALS(mbim_network_idle_hint_states_vals), 0,
5913 NULL, HFILL }
5915 { &hf_mbim_emergency_mode_info_emergency_mode,
5916 { "Emergency Mode", "mbim.control.emergency_mode_info.mode",
5917 FT_UINT32, BASE_DEC, VALS(mbim_emergency_mode_states_vals), 0,
5918 NULL, HFILL }
5920 { &hf_mbim_single_packet_filter_filter_size,
5921 { "Filter Size", "mbim.control.single_packet_filter.filter_size",
5922 FT_UINT32, BASE_DEC, NULL, 0,
5923 NULL, HFILL }
5925 { &hf_mbim_single_packet_filter_packet_filter_offset,
5926 { "Packet Filter Offset", "mbim.control.single_packet_filter.packet_filter.offset",
5927 FT_UINT32, BASE_DEC, NULL, 0,
5928 NULL, HFILL }
5930 { &hf_mbim_single_packet_filter_packet_mask_offset,
5931 { "Packet Mask Offset", "mbim.control.single_packet_filter.packet_mask.offset",
5932 FT_UINT32, BASE_DEC, NULL, 0,
5933 NULL, HFILL }
5935 { &hf_mbim_single_packet_filter_packet_filter,
5936 { "Packet Filter", "mbim.control.single_packet_filter.packet_filter",
5937 FT_BYTES, BASE_NONE, NULL, 0,
5938 NULL, HFILL }
5940 { &hf_mbim_single_packet_filter_packet_mask,
5941 { "Packet Mask", "mbim.control.single_packet_filter.packet_mask",
5942 FT_BYTES, BASE_NONE, NULL, 0,
5943 NULL, HFILL }
5945 { &hf_mbim_packet_filters_session_id,
5946 { "Session Id", "mbim.control.packet_filters.session_id",
5947 FT_UINT32, BASE_DEC, NULL, 0,
5948 NULL, HFILL }
5950 { &hf_mbim_packet_filters_packet_filters_count,
5951 { "Packet Filters Count", "mbim.control.packet_filters.packet_filters_count",
5952 FT_UINT32, BASE_DEC, NULL, 0,
5953 NULL, HFILL }
5955 { &hf_mbim_packet_filters_packet_filters_packet_filter_offset,
5956 { "Packet Filter Offset", "mbim.control.packet_filters.packet_filter.offset",
5957 FT_UINT32, BASE_DEC, NULL, 0,
5958 NULL, HFILL }
5960 { &hf_mbim_packet_filters_packet_filters_packet_filter_size,
5961 { "Packet Filters Size", "mbim.control.packet_filters.packet_filter.size",
5962 FT_UINT32, BASE_DEC, NULL, 0,
5963 NULL, HFILL }
5965 { &hf_mbim_set_sms_configuration_format,
5966 { "Format", "mbim.control.set_sms_configuration.format",
5967 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
5968 NULL, HFILL }
5970 { &hf_mbim_set_sms_configuration_sc_address_offset,
5971 { "Service Center Address Offset", "mbim.control.set_sms_configuration.sc_address.offset",
5972 FT_UINT32, BASE_DEC, NULL, 0,
5973 NULL, HFILL }
5975 { &hf_mbim_set_sms_configuration_sc_address_size,
5976 { "Service Center Address Size", "mbim.control.set_sms_configuration.sc_address.size",
5977 FT_UINT32, BASE_DEC, NULL, 0,
5978 NULL, HFILL }
5980 { &hf_mbim_set_sms_configuration_sc_address,
5981 { "Service Center Address", "mbim.control.set_sms_configuration.sc_address.size",
5982 FT_STRING, BASE_NONE, NULL, 0,
5983 NULL, HFILL }
5985 { &hf_mbim_sms_configuration_info_sms_storage_state,
5986 { "SMS Storage State", "mbim.control.sms_configuration_info.sms_storage_state",
5987 FT_UINT32, BASE_DEC, VALS(mbim_sms_storage_state_vals), 0,
5988 NULL, HFILL }
5990 { &hf_mbim_sms_configuration_info_format,
5991 { "Format", "mbim.control.sms_configuration_info.format",
5992 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
5993 NULL, HFILL }
5995 { &hf_mbim_sms_configuration_info_max_messages,
5996 { "Max Messages", "mbim.control.sms_configuration_info.max_messages",
5997 FT_UINT32, BASE_DEC, NULL, 0,
5998 NULL, HFILL }
6000 { &hf_mbim_sms_configuration_info_cdma_short_message_size,
6001 { "CDMA Short Message Size", "mbim.control.sms_configuration_info.cdma_short_message_size",
6002 FT_UINT32, BASE_DEC, NULL, 0,
6003 NULL, HFILL }
6005 { &hf_mbim_sms_configuration_info_sc_address_offset,
6006 { "Service Center Address Offset", "mbim.control.sms_configuration_info.sc_address.offset",
6007 FT_UINT32, BASE_DEC, NULL, 0,
6008 NULL, HFILL }
6010 { &hf_mbim_sms_configuration_info_sc_address_size,
6011 { "Service Center Address Size", "mbim.control.sms_configuration_info.sc_address.size",
6012 FT_UINT32, BASE_DEC, NULL, 0,
6013 NULL, HFILL }
6015 { &hf_mbim_sms_configuration_info_sc_address,
6016 { "Service Center Address Size", "mbim.control.sms_configuration_info.sc_address",
6017 FT_STRING, BASE_NONE, NULL, 0,
6018 NULL, HFILL }
6020 { &hf_mbim_sms_pdu_record_message_index,
6021 { "Message Index", "mbim.control.sms_pdu_record.message_index",
6022 FT_UINT32, BASE_DEC, NULL, 0,
6023 NULL, HFILL }
6025 { &hf_mbim_sms_pdu_record_message_status,
6026 { "Message Status", "mbim.control.sms_pdu_record.message_status",
6027 FT_UINT32, BASE_DEC, VALS(mbim_sms_message_status_vals), 0,
6028 NULL, HFILL }
6030 { &hf_mbim_sms_pdu_record_pdu_data_offset,
6031 { "PDU Data Offset", "mbim.control.sms_pdu_record.pdu_data.offset",
6032 FT_UINT32, BASE_DEC, NULL, 0,
6033 NULL, HFILL }
6035 { &hf_mbim_sms_pdu_record_pdu_data_size,
6036 { "PDU Data Size", "mbim.control.sms_pdu_record.pdu_data.size",
6037 FT_UINT32, BASE_DEC, NULL, 0,
6038 NULL, HFILL }
6040 { &hf_mbim_sms_pdu_record_pdu_data,
6041 { "PDU Data", "mbim.control.sms_pdu_record.pdu_data",
6042 FT_BYTES, BASE_NONE, NULL, 0,
6043 NULL, HFILL }
6045 { &hf_mbim_sms_cdma_record_message_index,
6046 { "Message Index", "mbim.control.sms_cdma_record.message_index",
6047 FT_UINT32, BASE_DEC, NULL, 0,
6048 NULL, HFILL }
6050 { &hf_mbim_sms_cdma_record_message_status,
6051 { "Message Status", "mbim.control.sms_cdma_record.message_status",
6052 FT_UINT32, BASE_DEC, VALS(mbim_sms_message_status_vals), 0,
6053 NULL, HFILL }
6055 { &hf_mbim_sms_cdma_record_address_offset,
6056 { "Address Offset", "mbim.control.sms_cdma_record.address.offset",
6057 FT_UINT32, BASE_DEC, NULL, 0,
6058 NULL, HFILL }
6060 { &hf_mbim_sms_cdma_record_address_size,
6061 { "Address Size", "mbim.control.sms_cdma_record.address.size",
6062 FT_UINT32, BASE_DEC, NULL, 0,
6063 NULL, HFILL }
6065 { &hf_mbim_sms_cdma_record_timestamp_offset,
6066 { "Timestamp Offset", "mbim.control.sms_cdma_record.timestamp.offset",
6067 FT_UINT32, BASE_DEC, NULL, 0,
6068 NULL, HFILL }
6070 { &hf_mbim_sms_cdma_record_timestamp_size,
6071 { "Timestamp Size", "mbim.control.sms_cdma_record.timestamp.size",
6072 FT_UINT32, BASE_DEC, NULL, 0,
6073 NULL, HFILL }
6075 { &hf_mbim_sms_cdma_record_encoding_id,
6076 { "Encoding Id", "mbim.control.sms_cdma_record.encoding_id",
6077 FT_UINT32, BASE_DEC, VALS(mbim_sms_cdma_encoding_vals), 0,
6078 NULL, HFILL }
6080 { &hf_mbim_sms_cdma_record_language_id,
6081 { "Language Id", "mbim.control.sms_cdma_record.language_id",
6082 FT_UINT32, BASE_DEC, VALS(mbim_sms_cdma_lang_vals), 0,
6083 NULL, HFILL }
6085 { &hf_mbim_sms_cdma_record_encoded_message_offset,
6086 { "Encoded Message Offset", "mbim.control.sms_cdma_record.encoded_message.offset",
6087 FT_UINT32, BASE_DEC, NULL, 0,
6088 NULL, HFILL }
6090 { &hf_mbim_sms_cdma_record_size_in_bytes,
6091 { "Size In Bytes", "mbim.control.sms_cdma_record.size_in_bytes",
6092 FT_UINT32, BASE_DEC, NULL, 0,
6093 NULL, HFILL }
6095 { &hf_mbim_sms_cdma_record_size_in_characters,
6096 { "Size In Characters", "mbim.control.sms_cdma_record.size_in_characters",
6097 FT_UINT32, BASE_DEC, NULL, 0,
6098 NULL, HFILL }
6100 { &hf_mbim_sms_cdma_record_address,
6101 { "Address", "mbim.control.sms_cdma_record.address",
6102 FT_STRING, BASE_NONE, NULL, 0,
6103 NULL, HFILL }
6105 { &hf_mbim_sms_cdma_record_timestamp,
6106 { "Timestamp", "mbim.control.sms_cdma_record.timestamp",
6107 FT_STRING, BASE_NONE, NULL, 0,
6108 NULL, HFILL }
6110 { &hf_mbim_sms_cdma_record_encoded_message,
6111 { "Encoded Message", "mbim.control.sms_cdma_record.encoded_message",
6112 FT_BYTES, BASE_NONE, NULL, 0,
6113 NULL, HFILL }
6115 { &hf_mbim_sms_read_req_format,
6116 { "Format", "mbim.control.sms_read_req.format",
6117 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
6118 NULL, HFILL }
6120 { &hf_mbim_sms_read_req_flag,
6121 { "Flag", "mbim.control.sms_read_req.flag",
6122 FT_UINT32, BASE_DEC, VALS(mbim_sms_flag_vals), 0,
6123 NULL, HFILL }
6125 { &hf_mbim_sms_read_req_message_index,
6126 { "Message Index", "mbim.control.sms_read_req.message_index",
6127 FT_UINT32, BASE_DEC, NULL, 0,
6128 NULL, HFILL }
6130 { &hf_mbim_sms_read_info_format,
6131 { "Format", "mbim.control.sms_read_info.format",
6132 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
6133 NULL, HFILL }
6135 { &hf_mbim_sms_read_info_element_count,
6136 { "Element Count", "mbim.control.sms_read_info.element_count",
6137 FT_UINT32, BASE_DEC, NULL, 0,
6138 NULL, HFILL }
6140 { &hf_mbim_sms_read_info_sms_offset,
6141 { "SMS Offset", "mbim.control.sms_read_info.sms.offset",
6142 FT_UINT32, BASE_DEC, NULL, 0,
6143 NULL, HFILL }
6145 { &hf_mbim_sms_read_info_sms_size,
6146 { "SMS Size", "mbim.control.sms_read_info.sms.size",
6147 FT_UINT32, BASE_DEC, NULL, 0,
6148 NULL, HFILL }
6150 { &hf_mbim_sms_send_pdu_pdu_data_offset,
6151 { "PDU Data Offset", "mbim.control.sms_send_pdu.pdu_data.offset",
6152 FT_UINT32, BASE_DEC, NULL, 0,
6153 NULL, HFILL }
6155 { &hf_mbim_sms_send_pdu_pdu_data_size,
6156 { "PDU Data Offset", "mbim.control.sms_send_pdu.pdu_data.size",
6157 FT_UINT32, BASE_DEC, NULL, 0,
6158 NULL, HFILL }
6160 { &hf_mbim_sms_send_pdu_pdu_data,
6161 { "PDU Data", "mbim.control.sms_send_pdu.pdu_data",
6162 FT_BYTES, BASE_NONE, NULL, 0,
6163 NULL, HFILL }
6165 { &hf_mbim_sms_send_cdma_encoding_id,
6166 { "Encoding Id", "mbim.control.sms_send_cdma.encoding_id",
6167 FT_UINT32, BASE_DEC, VALS(mbim_sms_cdma_encoding_vals), 0,
6168 NULL, HFILL }
6170 { &hf_mbim_sms_send_cdma_language_id,
6171 { "Language Id", "mbim.control.sms_send_cdma.language_id",
6172 FT_UINT32, BASE_DEC, VALS(mbim_sms_cdma_lang_vals), 0,
6173 NULL, HFILL }
6175 { &hf_mbim_sms_send_cdma_address_offset,
6176 { "Address Offset", "mbim.control.sms_send_cdma.address.offset",
6177 FT_UINT32, BASE_DEC, NULL, 0,
6178 NULL, HFILL }
6180 { &hf_mbim_sms_send_cdma_address_size,
6181 { "Address Size", "mbim.control.sms_send_cdma.address.size",
6182 FT_UINT32, BASE_DEC, NULL, 0,
6183 NULL, HFILL }
6185 { &hf_mbim_sms_send_cdma_encoded_message_offset,
6186 { "Encoded Message Offset", "mbim.control.sms_send_cdma.encoded_message.offset",
6187 FT_UINT32, BASE_DEC, NULL, 0,
6188 NULL, HFILL }
6190 { &hf_mbim_sms_send_cdma_size_in_bytes,
6191 { "Size In Bytes", "mbim.control.sms_send_cdma.size_in_bytes",
6192 FT_UINT32, BASE_DEC, NULL, 0,
6193 NULL, HFILL }
6195 { &hf_mbim_sms_send_cdma_size_in_characters,
6196 { "Size In Characters", "mbim.control.sms_send_cdma.size_in_characters",
6197 FT_UINT32, BASE_DEC, NULL, 0,
6198 NULL, HFILL }
6200 { &hf_mbim_sms_send_cdma_address,
6201 { "Address", "mbim.control.sms_send_cdma.address",
6202 FT_STRING, BASE_NONE, NULL, 0,
6203 NULL, HFILL }
6205 { &hf_mbim_sms_send_cdma_encoded_message,
6206 { "Encoded Message", "mbim.control.sms_send_cdma.encoded_message",
6207 FT_BYTES, BASE_NONE, NULL, 0,
6208 NULL, HFILL }
6210 { &hf_mbim_set_sms_send_format,
6211 { "Format", "mbim.control.set_sms_send.format",
6212 FT_UINT32, BASE_DEC, VALS(mbim_sms_format_vals), 0,
6213 NULL, HFILL }
6215 { &hf_mbim_sms_send_info_message_reference,
6216 { "Message Reference", "mbim.control.sms_send_info.message_reference",
6217 FT_UINT32, BASE_DEC, NULL, 0,
6218 NULL, HFILL }
6220 { &hf_mbim_set_sms_delete_flag,
6221 { "Flag", "mbim.control.set_sms_delete.flag",
6222 FT_UINT32, BASE_DEC, VALS(mbim_sms_flag_vals), 0,
6223 NULL, HFILL }
6225 { &hf_mbim_set_sms_delete_message_index,
6226 { "Message Index", "mbim.control.set_sms_delete.message_index",
6227 FT_UINT32, BASE_DEC, NULL, 0,
6228 NULL, HFILL }
6230 { &hf_mbim_sms_status_info_flags,
6231 { "Flags", "mbim.control.sms_status_info.flags",
6232 FT_UINT32, BASE_HEX, NULL, 0,
6233 NULL, HFILL }
6235 { &hf_mbim_sms_status_info_flags_message_store_full,
6236 { "Message Store Full", "mbim.control.sms_status_info.flags.message_store_full",
6237 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
6238 NULL, HFILL }
6240 { &hf_mbim_sms_status_info_flags_new_message,
6241 { "New Message", "mbim.control.sms_status_info.flags.new_message",
6242 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
6243 NULL, HFILL }
6245 { &hf_mbim_sms_status_info_message_index,
6246 { "Message Index", "mbim.control.sms_status_info.message_index",
6247 FT_UINT32, BASE_DEC, NULL, 0,
6248 NULL, HFILL }
6250 { &hf_mbim_set_ussd_ussd_action,
6251 { "USSD Action", "mbim.control.set_ussd.ussd_action",
6252 FT_UINT32, BASE_DEC, VALS(mbim_ussd_action_vals), 0,
6253 NULL, HFILL }
6255 { &hf_mbim_set_ussd_ussd_data_coding_scheme,
6256 { "USSD Data Coding Scheme", "mbim.control.set_ussd.ussd_data_coding_scheme",
6257 FT_UINT32, BASE_HEX, NULL, 0,
6258 NULL, HFILL }
6260 { &hf_mbim_set_ussd_ussd_ussd_payload_offset,
6261 { "USSD Payload Offset", "mbim.control.set_ussd.ussd_payload.offset",
6262 FT_UINT32, BASE_DEC, NULL, 0,
6263 NULL, HFILL }
6265 { &hf_mbim_set_ussd_ussd_ussd_payload_length,
6266 { "USSD Payload Length", "mbim.control.set_ussd.ussd_payload.length",
6267 FT_UINT32, BASE_DEC, NULL, 0,
6268 NULL, HFILL }
6270 { &hf_mbim_set_ussd_ussd_ussd_payload,
6271 { "USSD Payload", "mbim.control.set_ussd.ussd_payload",
6272 FT_BYTES, BASE_NONE, NULL, 0,
6273 NULL, HFILL }
6275 { &hf_mbim_ussd_info_ussd_response,
6276 { "USSD Response", "mbim.control.info_ussd.ussd_response",
6277 FT_UINT32, BASE_DEC, VALS(mbim_ussd_response_vals), 0,
6278 NULL, HFILL }
6280 { &hf_mbim_ussd_info_ussd_session_state,
6281 { "USSD Session State", "mbim.control.info_ussd.ussd_session_state",
6282 FT_UINT32, BASE_DEC, VALS(mbim_ussd_session_state_vals), 0,
6283 NULL, HFILL }
6285 { &hf_mbim_ussd_info_ussd_data_coding_scheme,
6286 { "USSD Data Coding Scheme", "mbim.control.ussd_info.ussd_data_coding_scheme",
6287 FT_UINT32, BASE_HEX, NULL, 0,
6288 NULL, HFILL }
6290 { &hf_mbim_ussd_info_ussd_payload_offset,
6291 { "USSD Payload Offset", "mbim.control.ussd_info.ussd_payload.offset",
6292 FT_UINT32, BASE_DEC, NULL, 0,
6293 NULL, HFILL }
6295 { &hf_mbim_ussd_info_ussd_payload_length,
6296 { "USSD Payload Length", "mbim.control.ussd_info.ussd_payload.length",
6297 FT_UINT32, BASE_DEC, NULL, 0,
6298 NULL, HFILL }
6300 { &hf_mbim_ussd_info_ussd_payload,
6301 { "USSD Payload", "mbim.control.ussd_info.ussd_payload",
6302 FT_BYTES, BASE_NONE, NULL, 0,
6303 NULL, HFILL }
6305 { &hf_mbim_phonebook_configuration_info_phonebook_state,
6306 { "Phonebook State", "mbim.control.phonebook_configuration_info.phonebook_state",
6307 FT_UINT32, BASE_DEC, VALS(mbim_phonebook_state_vals), 0,
6308 NULL, HFILL }
6310 { &hf_mbim_phonebook_configuration_info_total_nb_of_entries,
6311 { "Total Number Of Entries", "mbim.control.phonebook_configuration_info.total_nb_of_entries",
6312 FT_UINT32, BASE_DEC, NULL, 0,
6313 NULL, HFILL }
6315 { &hf_mbim_phonebook_configuration_info_used_entries,
6316 { "Used Entries", "mbim.control.phonebook_configuration_info.used_entries",
6317 FT_UINT32, BASE_DEC, NULL, 0,
6318 NULL, HFILL }
6320 { &hf_mbim_phonebook_configuration_info_max_number_length,
6321 { "Max Number Length", "mbim.control.phonebook_configuration_info.max_number_length",
6322 FT_UINT32, BASE_DEC, NULL, 0,
6323 NULL, HFILL }
6325 { &hf_mbim_phonebook_configuration_info_max_name_length,
6326 { "Max Name Length", "mbim.control.phonebook_configuration_info.max_name_length",
6327 FT_UINT32, BASE_DEC, NULL, 0,
6328 NULL, HFILL }
6330 { &hf_mbim_phonebook_entry_entry_index,
6331 { "Entry Index", "mbim.control.phonebook_entry.entry_index",
6332 FT_UINT32, BASE_DEC, NULL, 0,
6333 NULL, HFILL }
6335 { &hf_mbim_phonebook_entry_number_offset,
6336 { "Number Offset", "mbim.control.phonebook_entry.number.offset",
6337 FT_UINT32, BASE_DEC, NULL, 0,
6338 NULL, HFILL }
6340 { &hf_mbim_phonebook_entry_number_length,
6341 { "Number Length", "mbim.control.phonebook_entry.number.length",
6342 FT_UINT32, BASE_DEC, NULL, 0,
6343 NULL, HFILL }
6345 { &hf_mbim_phonebook_entry_name_offset,
6346 { "Name Offset", "mbim.control.phonebook_entry.name.offset",
6347 FT_UINT32, BASE_DEC, NULL, 0,
6348 NULL, HFILL }
6350 { &hf_mbim_phonebook_entry_name_length,
6351 { "Name Length", "mbim.control.phonebook_entry.name.length",
6352 FT_UINT32, BASE_DEC, NULL, 0,
6353 NULL, HFILL }
6355 { &hf_mbim_phonebook_entry_number,
6356 { "Number", "mbim.control.phonebook_entry.number",
6357 FT_STRING, BASE_NONE, NULL, 0,
6358 NULL, HFILL }
6360 { &hf_mbim_phonebook_entry_name,
6361 { "Name", "mbim.control.phonebook_entry.name",
6362 FT_STRING, BASE_NONE, NULL, 0,
6363 NULL, HFILL }
6365 { &hf_mbim_phonebook_read_req_filter_flag,
6366 { "Filter Flag", "mbim.control.phonebook_read_req.filter_flag",
6367 FT_UINT32, BASE_DEC, VALS(mbim_phonebook_flag_vals), 0,
6368 NULL, HFILL }
6370 { &hf_mbim_phonebook_read_req_filter_message_index,
6371 { "Filter Message Index", "mbim.control.phonebook_read_req.filter_message_index",
6372 FT_UINT32, BASE_DEC, NULL, 0,
6373 NULL, HFILL }
6375 { &hf_mbim_phonebook_read_info_element_count,
6376 { "Element Count", "mbim.control.phonebook_read_info.element_count",
6377 FT_UINT32, BASE_DEC, NULL, 0,
6378 NULL, HFILL }
6380 { &hf_mbim_phonebook_read_info_phonebook_offset,
6381 { "Phonebook Offset", "mbim.control.phonebook_read_info.phonebook.offset",
6382 FT_UINT32, BASE_DEC, NULL, 0,
6383 NULL, HFILL }
6385 { &hf_mbim_phonebook_read_info_phonebook_size,
6386 { "Phonebook Size", "mbim.control.phonebook_read_info.phonebook.size",
6387 FT_UINT32, BASE_DEC, NULL, 0,
6388 NULL, HFILL }
6390 { &hf_mbim_set_phonebook_delete_filter_flag,
6391 { "Filter Flag", "mbim.control.set_phonebook_delete.filter_flag",
6392 FT_UINT32, BASE_DEC, VALS(mbim_phonebook_flag_vals), 0,
6393 NULL, HFILL }
6395 { &hf_mbim_set_phonebook_delete_filter_message_index,
6396 { "Filter Message Index", "mbim.control.set_phonebook_delete.filter_message_index",
6397 FT_UINT32, BASE_DEC, NULL, 0,
6398 NULL, HFILL }
6400 { &hf_mbim_set_phonebook_write_save_flag,
6401 { "Save Flag", "mbim.control.set_phonebook_write.save_flag",
6402 FT_UINT32, BASE_DEC, VALS(mbim_phonebook_write_flag_vals), 0,
6403 NULL, HFILL }
6405 { &hf_mbim_set_phonebook_write_save_index,
6406 { "Save Index", "mbim.control.set_phonebook_write.save_index",
6407 FT_UINT32, BASE_DEC, NULL, 0,
6408 NULL, HFILL }
6410 { &hf_mbim_set_phonebook_write_number_offset,
6411 { "Number Offset", "mbim.control.set_phonebook_write.number.offset",
6412 FT_UINT32, BASE_DEC, NULL, 0,
6413 NULL, HFILL }
6415 { &hf_mbim_set_phonebook_write_number_length,
6416 { "Number Length", "mbim.control.set_phonebook_write.number.length",
6417 FT_UINT32, BASE_DEC, NULL, 0,
6418 NULL, HFILL }
6420 { &hf_mbim_set_phonebook_write_name_offset,
6421 { "Name Offset", "mbim.control.set_phonebook_write.name.offset",
6422 FT_UINT32, BASE_DEC, NULL, 0,
6423 NULL, HFILL }
6425 { &hf_mbim_set_phonebook_write_name_length,
6426 { "Name Length", "mbim.control.set_phonebook_write.name.length",
6427 FT_UINT32, BASE_DEC, NULL, 0,
6428 NULL, HFILL }
6430 { &hf_mbim_set_phonebook_write_number,
6431 { "Number", "mbim.control.set_phonebook_write.number",
6432 FT_STRING, BASE_NONE, NULL, 0,
6433 NULL, HFILL }
6435 { &hf_mbim_set_phonebook_write_name,
6436 { "Name", "mbim.control.set_phonebook_write.name",
6437 FT_STRING, BASE_NONE, NULL, 0,
6438 NULL, HFILL }
6440 { &hf_mbim_set_stk_pac_pac_host_control,
6441 { "PAC Host Control", "mbim.control.set_stk_pac.pac_host_control",
6442 FT_BYTES, BASE_NONE, NULL, 0,
6443 NULL, HFILL }
6445 { &hf_mbim_stk_pac_info_pac_support,
6446 { "PAC Host Control", "mbim.control.stk_pac_info.pac_support",
6447 FT_BYTES, BASE_NONE, NULL, 0,
6448 NULL, HFILL }
6450 { &hf_mbim_stk_pac_pac_type,
6451 { "PAC Type", "mbim.control.stk_pac.pac_type",
6452 FT_UINT32, BASE_DEC, VALS(mbim_stk_pac_type_vals), 0,
6453 NULL, HFILL }
6455 { &hf_mbim_stk_pac_pac,
6456 { "PAC", "mbim.control.stk_pac.pac",
6457 FT_BYTES, BASE_NONE, NULL, 0,
6458 NULL, HFILL }
6460 { &hf_mbim_set_stk_terminal_response_response_length,
6461 { "Response Length", "mbim.control.set_stk_terminal_response.response_length",
6462 FT_UINT32, BASE_DEC, NULL, 0,
6463 NULL, HFILL }
6465 { &hf_mbim_set_stk_terminal_response_data_buffer,
6466 { "Data Buffer", "mbim.control.set_stk_terminal_response.data_buffer",
6467 FT_BYTES, BASE_NONE, NULL, 0,
6468 NULL, HFILL }
6470 { &hf_mbim_stk_terminal_response_info_result_data_string_offset,
6471 { "Result Data String Offset", "mbim.control.stk_terminal_response_info.result_data_string.offset",
6472 FT_UINT32, BASE_DEC, NULL, 0,
6473 NULL, HFILL }
6475 { &hf_mbim_stk_terminal_response_info_result_data_string_length,
6476 { "Result Data String Length", "mbim.control.stk_terminal_response_info.result_data_string.length",
6477 FT_UINT32, BASE_DEC, NULL, 0,
6478 NULL, HFILL }
6480 { &hf_mbim_stk_terminal_response_info_status_word,
6481 { "Status Word", "mbim.control.stk_terminal_response_info.status_word",
6482 FT_UINT32, BASE_HEX, NULL, 0,
6483 NULL, HFILL }
6485 { &hf_mbim_stk_terminal_response_info_result_data_string,
6486 { "Result Data String", "mbim.control.stk_terminal_response_info.result_data_string",
6487 FT_BYTES, BASE_NONE, NULL, 0,
6488 NULL, HFILL }
6490 { &hf_mbim_set_stk_envelope_data_buffer,
6491 { "Data Buffer", "mbim.control.set_stk_envelope.data_buffer",
6492 FT_BYTES, BASE_NONE, NULL, 0,
6493 NULL, HFILL }
6495 { &hf_mbim_stk_envelope_info_envelope_support,
6496 { "Envelope Support", "mbim.control.stk_envelope_info.envelope_support",
6497 FT_BYTES, BASE_NONE, NULL, 0,
6498 NULL, HFILL }
6500 { &hf_mbim_aka_auth_req_rand,
6501 { "RAND", "mbim.control.aka_auth_req.rand",
6502 FT_BYTES, BASE_NONE, NULL, 0,
6503 NULL, HFILL }
6505 { &hf_mbim_aka_auth_req_autn,
6506 { "AUTN", "mbim.control.aka_auth_req.autn",
6507 FT_BYTES, BASE_NONE, NULL, 0,
6508 NULL, HFILL }
6510 { &hf_mbim_aka_auth_info_res,
6511 { "RES", "mbim.control.aka_auth_info.res",
6512 FT_BYTES, BASE_NONE, NULL, 0,
6513 NULL, HFILL }
6515 { &hf_mbim_aka_auth_info_res_length,
6516 { "RES Length", "mbim.control.aka_auth_info.res_length",
6517 FT_UINT32, BASE_DEC, NULL, 0,
6518 NULL, HFILL }
6520 { &hf_mbim_aka_auth_info_ik,
6521 { "IK", "mbim.control.aka_auth_info.ik",
6522 FT_BYTES, BASE_NONE, NULL, 0,
6523 NULL, HFILL }
6525 { &hf_mbim_aka_auth_info_ck,
6526 { "CK", "mbim.control.aka_auth_info.ck",
6527 FT_BYTES, BASE_NONE, NULL, 0,
6528 NULL, HFILL }
6530 { &hf_mbim_aka_auth_info_auts,
6531 { "AUTS", "mbim.control.aka_auth_info.auts",
6532 FT_BYTES, BASE_NONE, NULL, 0,
6533 NULL, HFILL }
6535 { &hf_mbim_akap_auth_req_rand,
6536 { "RAND", "mbim.control.akap_auth_req.rand",
6537 FT_BYTES, BASE_NONE, NULL, 0,
6538 NULL, HFILL }
6540 { &hf_mbim_akap_auth_req_autn,
6541 { "AUTN", "mbim.control.akap_auth_req.autn",
6542 FT_BYTES, BASE_NONE, NULL, 0,
6543 NULL, HFILL }
6545 { &hf_mbim_akap_auth_req_network_name_offset,
6546 { "Network Name Offset", "mbim.control.akap_auth_req.network_name.offset",
6547 FT_UINT32, BASE_DEC, NULL, 0,
6548 NULL, HFILL }
6550 { &hf_mbim_akap_auth_req_network_name_length,
6551 { "Network Name Length", "mbim.control.akap_auth_req.network_name.length",
6552 FT_UINT32, BASE_DEC, NULL, 0,
6553 NULL, HFILL }
6555 { &hf_mbim_akap_auth_req_network_name,
6556 { "Network Name", "mbim.control.akap_auth_req.network_name",
6557 FT_STRING, BASE_NONE, NULL, 0,
6558 NULL, HFILL }
6560 { &hf_mbim_akap_auth_info_res,
6561 { "RES", "mbim.control.akap_auth_info.res",
6562 FT_BYTES, BASE_NONE, NULL, 0,
6563 NULL, HFILL }
6565 { &hf_mbim_akap_auth_info_res_length,
6566 { "RES Length", "mbim.control.akap_auth_info.res_length",
6567 FT_UINT32, BASE_DEC, NULL, 0,
6568 NULL, HFILL }
6570 { &hf_mbim_akap_auth_info_ik,
6571 { "IK", "mbim.control.akap_auth_info.ik",
6572 FT_BYTES, BASE_NONE, NULL, 0,
6573 NULL, HFILL }
6575 { &hf_mbim_akap_auth_info_ck,
6576 { "CK", "mbim.control.akap_auth_info.ck",
6577 FT_BYTES, BASE_NONE, NULL, 0,
6578 NULL, HFILL }
6580 { &hf_mbim_akap_auth_info_auts,
6581 { "AUTS", "mbim.control.akap_auth_info.auts",
6582 FT_BYTES, BASE_NONE, NULL, 0,
6583 NULL, HFILL }
6585 { &hf_mbim_sim_auth_req_rand1,
6586 { "RAND1", "mbim.control.sim_auth_req.rand1",
6587 FT_BYTES, BASE_NONE, NULL, 0,
6588 NULL, HFILL }
6590 { &hf_mbim_sim_auth_req_rand2,
6591 { "RAND2", "mbim.control.sim_auth_req.rand2",
6592 FT_BYTES, BASE_NONE, NULL, 0,
6593 NULL, HFILL }
6595 { &hf_mbim_sim_auth_req_rand3,
6596 { "RAND3", "mbim.control.sim_auth_req.rand3",
6597 FT_BYTES, BASE_NONE, NULL, 0,
6598 NULL, HFILL }
6600 { &hf_mbim_sim_auth_req_n,
6601 { "n", "mbim.control.sim_auth_req.n",
6602 FT_UINT32, BASE_DEC, NULL, 0,
6603 NULL, HFILL }
6605 { &hf_mbim_sim_auth_info_sres1,
6606 { "SRES1", "mbim.control.sim_auth_info.sres1",
6607 FT_UINT32, BASE_HEX, NULL, 0,
6608 NULL, HFILL }
6610 { &hf_mbim_sim_auth_info_kc1,
6611 { "KC1", "mbim.control.sim_auth_info.kc1",
6612 FT_UINT64, BASE_HEX, NULL, 0,
6613 NULL, HFILL }
6615 { &hf_mbim_sim_auth_info_sres2,
6616 { "SRES2", "mbim.control.sim_auth_info.sres2",
6617 FT_UINT32, BASE_HEX, NULL, 0,
6618 NULL, HFILL }
6620 { &hf_mbim_sim_auth_info_kc2,
6621 { "KC2", "mbim.control.sim_auth_info.kc2",
6622 FT_UINT64, BASE_HEX, NULL, 0,
6623 NULL, HFILL }
6625 { &hf_mbim_sim_auth_info_sres3,
6626 { "SRES3", "mbim.control.sim_auth_info.sres3",
6627 FT_UINT32, BASE_HEX, NULL, 0,
6628 NULL, HFILL }
6630 { &hf_mbim_sim_auth_info_kc3,
6631 { "KC3", "mbim.control.sim_auth_info.kc3",
6632 FT_UINT64, BASE_HEX, NULL, 0,
6633 NULL, HFILL }
6635 { &hf_mbim_sim_auth_info_n,
6636 { "n", "mbim.control.sim_auth_info.n",
6637 FT_UINT32, BASE_DEC, NULL, 0,
6638 NULL, HFILL }
6640 { &hf_mbim_set_dss_connect_device_service_id,
6641 { "Device Service Id", "mbim.control.set_dss_connect.device_service_id",
6642 FT_GUID, BASE_NONE, NULL, 0,
6643 NULL, HFILL }
6645 { &hf_mbim_set_dss_connect_dss_session_id,
6646 { "DSS Session Id", "mbim.control.set_dss_connect.dss_session_id",
6647 FT_UINT32, BASE_DEC, NULL, 0,
6648 NULL, HFILL }
6650 { &hf_mbim_set_dss_connect_dss_link_state,
6651 { "DSS Link State", "mbim.control.set_dss_connect.dss_link_state",
6652 FT_UINT32, BASE_DEC, VALS(mbim_dss_link_state_vals), 0,
6653 NULL, HFILL }
6655 { &hf_mbim_multicarrier_capabilities_info_capabilities,
6656 { "Capabilities", "mbim.control.multicarrier_capabilities_info.capabilities",
6657 FT_UINT32, BASE_HEX, NULL, 0,
6658 NULL, HFILL }
6660 { &hf_mbim_multicarrier_capabilities_info_capabilities_static_scan,
6661 { "Static Scan", "mbim.control.multicarrier_capabilities_info.capabilities.static_scan",
6662 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000001,
6663 NULL, HFILL }
6665 { &hf_mbim_multicarrier_capabilities_info_capabilities_fw_requires_reboot,
6666 { "FW Requires Reboot", "mbim.control.multicarrier_capabilities_info.capabilities.fw_requires_reboot",
6667 FT_BOOLEAN, 32, TFS(&tfs_yes_no), 0x00000002,
6668 NULL, HFILL }
6670 { &hf_mbim_location_info_country,
6671 { "Country", "mbim.control.location_info.country",
6672 FT_UINT32, BASE_HEX|BASE_EXT_STRING, &mbim_geoid_vals_ext, 0,
6673 NULL, HFILL }
6675 { &hf_mbim_multicarrier_current_cid_list_req_uuid,
6676 { "UUID", "mbim.control.multicarrier_current_cid_list_req.uuid",
6677 FT_GUID, BASE_NONE, NULL, 0,
6678 NULL, HFILL }
6680 { &hf_mbim_multicarrier_current_cid_list_info_cid_count,
6681 { "CID Count", "mbim.control.multicarrier_current_cid_list_info.cid_count",
6682 FT_UINT32, BASE_DEC, NULL, 0,
6683 NULL, HFILL }
6685 { &hf_mbim_multicarrier_current_cid_list_info_cid,
6686 { "CID", "mbim.control.multicarrier_current_cid_list_info.cid",
6687 FT_UINT32, BASE_DEC, VALS(mbim_uuid_multicarrier_cid_vals), 0,
6688 NULL, HFILL }
6690 { &hf_mbim_msfwid_firmwareid_info_firmware_id,
6691 { "Firmware Id", "mbim.control.msfwid_firmwareid_info.firmware_id",
6692 FT_GUID, BASE_NONE, NULL, 0,
6693 NULL, HFILL }
6695 { &hf_mbim_fragmented_payload,
6696 { "Fragmented Payload", "mbim.control.fragmented_payload",
6697 FT_BYTES, BASE_NONE, NULL, 0,
6698 NULL, HFILL }
6700 { &hf_mbim_request_in,
6701 { "Request In", "mbim.control.request_in",
6702 FT_FRAMENUM, BASE_NONE, NULL, 0,
6703 NULL, HFILL }
6705 { &hf_mbim_response_in,
6706 { "Response In", "mbim.control.response_in",
6707 FT_FRAMENUM, BASE_NONE, NULL, 0,
6708 NULL, HFILL }
6710 { &hf_mbim_descriptor,
6711 { "Descriptor", "mbim.descriptor",
6712 FT_NONE, BASE_NONE, NULL, 0,
6713 NULL, HFILL }
6715 { &hf_mbim_descriptor_version,
6716 { "bcdMBIMVersion", "mbim.descriptor.version",
6717 FT_UINT16, BASE_HEX, NULL, 0,
6718 "MBIM Version", HFILL }
6720 { &hf_mbim_descriptor_max_control_message,
6721 { "wMaxControlMessage", "mbim.descriptor.max_control_message",
6722 FT_UINT16, BASE_DEC, NULL, 0,
6723 "Max Control Message", HFILL }
6725 { &hf_mbim_descriptor_number_filters,
6726 { "bNumberFilters", "mbim.descriptor.number_filters",
6727 FT_UINT8, BASE_DEC, NULL, 0,
6728 "Number Of Packet Filters", HFILL }
6730 { &hf_mbim_descriptor_max_filter_size,
6731 { "bMaxFilterSize", "mbim.descriptor.max_filter_size",
6732 FT_UINT8, BASE_DEC, NULL, 0,
6733 "Max Packet Filter Size", HFILL }
6735 { &hf_mbim_descriptor_max_segment_size,
6736 { "wMaxSegmentSize", "mbim.descriptor.max_segment_size",
6737 FT_UINT16, BASE_DEC, NULL, 0,
6738 "Max Segment Size", HFILL }
6740 { &hf_mbim_descriptor_network_capabilities,
6741 { "bmNetworkCapabilities", "mbim.descriptor.network_capabilities",
6742 FT_UINT8, BASE_HEX, NULL, 0,
6743 "Network Capabilities", HFILL }
6745 { &hf_mbim_descriptor_network_capabilities_max_datagram_size,
6746 { "SetMaxDatagramSize/GetMaxDatagramSize", "mbim.descriptor.network_capabilities.max_datagram_size",
6747 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
6748 NULL, HFILL }
6750 { &hf_mbim_descriptor_network_capabilities_ntb_input_size,
6751 { "8-byte GetNtbInputSize/SetNtbInputSize", "mbim.descriptor.network_capabilities.ntb_input_size",
6752 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
6753 NULL, HFILL }
6755 { &hf_mbim_descriptor_extended_version,
6756 { "bcdMBIMExtendedVersion", "mbim.descriptor.extended_version",
6757 FT_UINT16, BASE_HEX, NULL, 0,
6758 "MBIM Extended Version", HFILL }
6760 { &hf_mbim_descriptor_max_outstanding_command_messages,
6761 { "bMaxOutstandingCommandMessages", "mbim.descriptor.max_outstanding_command_messages",
6762 FT_UINT8, BASE_DEC, NULL, 0,
6763 "Max Outstanding Messages", HFILL }
6765 { &hf_mbim_descriptor_mtu,
6766 { "wMTU", "mbim.descriptor.mtu",
6767 FT_UINT16, BASE_DEC, NULL, 0,
6768 "MTU", HFILL }
6770 { &hf_mbim_bulk,
6771 { "Bulk", "mbim.bulk",
6772 FT_NONE, BASE_NONE, NULL, 0,
6773 NULL, HFILL }
6775 { &hf_mbim_bulk_nth_signature,
6776 { "Signature", "mbim.bulk.nth.signature",
6777 FT_STRING, BASE_NONE, NULL, 0,
6778 NULL, HFILL }
6780 { &hf_mbim_bulk_nth_header_length,
6781 { "Header Length", "mbim.bulk.nth.header_length",
6782 FT_UINT16, BASE_DEC, NULL, 0,
6783 NULL, HFILL }
6785 { &hf_mbim_bulk_nth_sequence_number,
6786 { "Sequence Number", "mbim.bulk.nth.sequence_number",
6787 FT_UINT16, BASE_DEC, NULL, 0,
6788 NULL, HFILL }
6790 { &hf_mbim_bulk_nth_block_length,
6791 { "Block Length", "mbim.bulk.nth.block_length",
6792 FT_UINT16, BASE_DEC, NULL, 0,
6793 NULL, HFILL }
6795 { &hf_mbim_bulk_nth_block_length_32,
6796 { "Block Length", "mbim.bulk.nth.block_length",
6797 FT_UINT32, BASE_DEC, NULL, 0,
6798 NULL, HFILL }
6800 { &hf_mbim_bulk_nth_ndp_index,
6801 { "NDP Index", "mbim.bulk.nth.ndp_index",
6802 FT_UINT16, BASE_DEC, NULL, 0,
6803 NULL, HFILL }
6805 { &hf_mbim_bulk_nth_ndp_index_32,
6806 { "NDP Index", "mbim.bulk.nth.ndp_index",
6807 FT_UINT32, BASE_DEC, NULL, 0,
6808 NULL, HFILL }
6810 { &hf_mbim_bulk_ndp_signature,
6811 { "Signature", "mbim.bulk.ndp.signature",
6812 FT_UINT32, BASE_HEX, NULL, 0,
6813 NULL, HFILL }
6815 { &hf_mbim_bulk_ndp_signature_ips_session_id,
6816 { "IPS Session Id", "mbim.bulk.ndp.signature.ips_session_id",
6817 FT_UINT8, BASE_DEC, NULL, 0,
6818 NULL, HFILL }
6820 { &hf_mbim_bulk_ndp_signature_dss_session_id,
6821 { "DSS Session Id", "mbim.bulk.ndp.signature.dss_session_id",
6822 FT_UINT8, BASE_DEC, NULL, 0,
6823 NULL, HFILL }
6825 { &hf_mbim_bulk_ndp_length,
6826 { "Length", "mbim.bulk.ndp.length",
6827 FT_UINT16, BASE_DEC, NULL, 0,
6828 NULL, HFILL }
6830 { &hf_mbim_bulk_ndp_next_ndp_index,
6831 { "Next NDP Index", "mbim.bulk.ndp.next_ndp_index",
6832 FT_UINT16, BASE_DEC, NULL, 0,
6833 NULL, HFILL }
6835 { &hf_mbim_bulk_ndp_next_ndp_index_32,
6836 { "Next NDP Index", "mbim.bulk.ndp.next_ndp_index",
6837 FT_UINT32, BASE_DEC, NULL, 0,
6838 NULL, HFILL }
6840 { &hf_mbim_bulk_ndp_reserved,
6841 { "Reserved", "mbim.bulk.ndp.reserved",
6842 FT_UINT16, BASE_HEX, NULL, 0,
6843 NULL, HFILL }
6845 { &hf_mbim_bulk_ndp_reserved2,
6846 { "Reserved", "mbim.bulk.ndp.reserved",
6847 FT_UINT32, BASE_HEX, NULL, 0,
6848 NULL, HFILL }
6850 { &hf_mbim_bulk_ndp_datagram_index,
6851 { "Datagram Index", "mbim.bulk.ndp.datagram.index",
6852 FT_UINT16, BASE_DEC, NULL, 0,
6853 NULL, HFILL }
6855 { &hf_mbim_bulk_ndp_datagram_index_32,
6856 { "Datagram Index", "mbim.bulk.ndp.datagram.index",
6857 FT_UINT32, BASE_DEC, NULL, 0,
6858 NULL, HFILL }
6860 { &hf_mbim_bulk_ndp_datagram_length,
6861 { "Datagram Length", "mbim.bulk.ndp.datagram.length",
6862 FT_UINT16, BASE_DEC, NULL, 0,
6863 NULL, HFILL }
6865 { &hf_mbim_bulk_ndp_datagram_length_32,
6866 { "Datagram Length", "mbim.bulk.ndp.datagram.length",
6867 FT_UINT32, BASE_DEC, NULL, 0,
6868 NULL, HFILL }
6870 { &hf_mbim_bulk_ndp_datagram,
6871 { "Datagram", "mbim.bulk.ndp.datagram",
6872 FT_BYTES, BASE_NONE, NULL, 0,
6873 NULL, HFILL }
6875 { &hf_mbim_bulk_ndp_nb_datagrams,
6876 { "Number Of Datagrams", "mbim.bulk.ndp.nb_datagrams",
6877 FT_UINT32, BASE_DEC, NULL, 0,
6878 NULL, HFILL }
6880 { &hf_mbim_bulk_total_nb_datagrams,
6881 { "Total Number Of Datagrams", "mbim.bulk.total_nb_datagrams",
6882 FT_UINT32, BASE_DEC, NULL, 0,
6883 NULL, HFILL }
6885 { &hf_mbim_fragments,
6886 { "Fragments", "mbim.control.fragments",
6887 FT_NONE, BASE_NONE, NULL, 0,
6888 NULL, HFILL }
6890 { &hf_mbim_fragment,
6891 { "Fragment", "mbim.control.fragment",
6892 FT_FRAMENUM, BASE_NONE, NULL, 0,
6893 NULL, HFILL }
6895 { &hf_mbim_fragment_overlap,
6896 { "Fragment Overlap", "mbim.control.fragment_overlap",
6897 FT_BOOLEAN, BASE_NONE, NULL, 0,
6898 NULL, HFILL }
6900 { &hf_mbim_fragment_overlap_conflict,
6901 { "Fragment Overlap Conflict", "mbim.control.fragment_overlap_conflict",
6902 FT_BOOLEAN, BASE_NONE, NULL, 0,
6903 NULL, HFILL }
6905 { &hf_mbim_fragment_multiple_tails,
6906 { "Fragment Multiple Tails", "mbim.control.fragment_multiple_tails",
6907 FT_BOOLEAN, BASE_NONE, NULL, 0,
6908 NULL, HFILL }
6910 { &hf_mbim_fragment_too_long_fragment,
6911 { "Too Long Fragment", "mbim.control.fragment_too_long_fragment",
6912 FT_BOOLEAN, BASE_NONE, NULL, 0,
6913 NULL, HFILL }
6915 { &hf_mbim_fragment_error,
6916 { "Fragment Error", "mbim.control.fragment_error",
6917 FT_FRAMENUM, BASE_NONE, NULL, 0,
6918 NULL, HFILL }
6920 { &hf_mbim_fragment_count,
6921 { "Fragment Count", "mbim.control.fragment_count",
6922 FT_UINT32, BASE_DEC, NULL, 0,
6923 NULL, HFILL }
6925 { &hf_mbim_reassembled_in,
6926 { "Reassembled In", "mbim.control.reassembled_in",
6927 FT_FRAMENUM, BASE_NONE, NULL, 0,
6928 NULL, HFILL }
6930 { &hf_mbim_reassembled_length,
6931 { "Reassembled Length", "mbim.control.reassembled_length",
6932 FT_UINT32, BASE_DEC, NULL, 0,
6933 NULL, HFILL }
6935 { &hf_mbim_reassembled_data,
6936 { "Reassembled Data", "mbim.control.reassembled_data",
6937 FT_BYTES, BASE_NONE, NULL, 0,
6938 NULL, HFILL }
6942 static gint *ett[] = {
6943 &ett_mbim,
6944 &ett_mbim_msg_header,
6945 &ett_mbim_frag_header,
6946 &ett_mbim_info_buffer,
6947 &ett_mbim_bitmap,
6948 &ett_mbim_pair_list,
6949 &ett_mbim_pin,
6950 &ett_mbim_buffer,
6951 &ett_mbim_fragment,
6952 &ett_mbim_fragments
6955 static ei_register_info ei[] = {
6956 { &ei_mbim_max_ctrl_transfer,
6957 { "mbim.max_control_transfer_too_small", PI_MALFORMED, PI_ERROR,
6958 "Max Control Transfer is less than 64 bytes", EXPFILL }},
6959 { &ei_mbim_unexpected_msg,
6960 { "mbim.unexpected_msg", PI_MALFORMED, PI_ERROR,
6961 "Unexpected message", EXPFILL }},
6962 { &ei_mbim_unexpected_info_buffer,
6963 { "mbim.unexpected_info_buffer", PI_MALFORMED, PI_WARN,
6964 "Unexpected Information Buffer", EXPFILL }},
6965 { &ei_mbim_illegal_on_link_prefix_length,
6966 { "mbim.illegal_on_link_prefix_length", PI_MALFORMED, PI_WARN,
6967 "Illegal On Link Prefix Length", EXPFILL }},
6968 { &ei_mbim_unknown_sms_format,
6969 { "mbim.unknown_sms_format", PI_PROTOCOL, PI_WARN,
6970 "Unknown SMS format", EXPFILL }},
6971 { &ei_mbim_unexpected_uuid_value,
6972 { "mbim.unexpected_uuid_value", PI_PROTOCOL, PI_WARN,
6973 "Unexpected UUID value", EXPFILL }},
6974 { &ei_mbim_too_many_items,
6975 { "mbim.too_many_items", PI_PROTOCOL, PI_WARN,
6976 "Too many items", EXPFILL }},
6977 { &ei_mbim_alignment_error,
6978 { "mbim.alignment_error", PI_MALFORMED, PI_ERROR,
6979 "Alignment error", EXPFILL }}
6982 proto_mbim = proto_register_protocol("Mobile Broadband Interface Model",
6983 "MBIM", "mbim");
6985 proto_register_field_array(proto_mbim, hf, array_length(hf));
6986 proto_register_subtree_array(ett, array_length(ett));
6987 expert_mbim = expert_register_protocol(proto_mbim);
6988 expert_register_field_array(expert_mbim, ei, array_length(ei));
6990 register_init_routine(mbim_reassembly_init);
6992 new_register_dissector("mbim.control", dissect_mbim_control, proto_mbim);
6993 new_register_dissector("mbim.descriptor", dissect_mbim_descriptor, proto_mbim);
6994 new_register_dissector("mbim.bulk", dissect_mbim_bulk, proto_mbim);
6996 mbim_module = prefs_register_protocol(proto_mbim, proto_reg_handoff_mbim);
6997 prefs_register_bool_preference(mbim_module, "bulk_heuristic",
6998 "Try to identify data traffic with heuristic",
6999 "Try to identify MBIM data packets on \"usb.bulk\" using heuristic",
7000 &mbim_bulk_heuristic);
7001 prefs_register_bool_preference(mbim_module, "control_decode_unknown_itf",
7002 "Force decoding of unknown USB control data as MBIM",
7003 "Decode control data received on \"usb.control\" with an "
7004 "unknown interface class as MBIM",
7005 &mbim_control_decode_unknown_itf);
7008 void
7009 proto_reg_handoff_mbim(void)
7011 static gboolean initialized = FALSE;
7012 dissector_handle_t mbim_control_handle;
7014 if (!initialized) {
7015 proactive_handle = find_dissector("gsm_sim.bertlv");
7016 etsi_cat_handle = find_dissector("etsi_cat");
7017 gsm_sms_handle = find_dissector("gsm_sms_handle");
7018 cdma_sms_handle = find_dissector("ansi_637_trans");
7019 eth_handle = find_dissector("eth_withoutfcs");
7020 eth_fcs_handle = find_dissector("eth_withfcs");
7021 ip_handle = find_dissector("ip");
7022 data_handle = find_dissector("data");
7023 heur_dissector_add("usb.bulk", dissect_mbim_bulk_heur, proto_mbim);
7024 initialized = TRUE;
7026 heur_dissector_set_enabled("usb.bulk", dissect_mbim_bulk_heur, proto_mbim, mbim_bulk_heuristic);
7027 mbim_control_handle = find_dissector("mbim.control");
7028 if (mbim_control_decode_unknown_itf) {
7029 dissector_add_uint("usb.control", IF_CLASS_UNKNOWN, mbim_control_handle);
7030 } else {
7031 dissector_delete_uint("usb.control", IF_CLASS_UNKNOWN, mbim_control_handle);
7036 * Editor modelines - http://www.wireshark.org/tools/modelines.html
7038 * Local variables:
7039 * c-basic-offset: 4
7040 * tab-width: 8
7041 * indent-tabs-mode: nil
7042 * End:
7044 * vi: set shiftwidth=4 tabstop=8 expandtab:
7045 * :indentSize=4:tabSize=8:noTabs=true: