1 /* packet-card_app_toolkit
2 * Routines for packet dissection of
3 * ETSI TS 102 223 v12.2.0 (Release 12 / 2015-03)
4 * 3GPP TS 11.14 v8.17.0 (Release 1999 / 2004-09)
5 * 3GPP TS 31.111 v9.7.0 (Release 9 / 2012-03)
6 * Copyright 2010-2011 by Harald Welte <laforge@gnumonks.org>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
17 #include <epan/packet.h>
18 #include <epan/conversation.h>
21 #include "packet-e212.h"
22 #include "packet-gsm_a_common.h"
23 #include "packet-gsm_sms.h"
24 #include "packet-rrc.h"
25 #include "packet-lte-rrc.h"
27 void proto_register_card_app_toolkit(void);
28 void proto_reg_handoff_card_app_toolkit(void);
32 static dissector_handle_t gsm_sms_handle
; /* SMS TPDU */
34 static int hf_cat_tlv
;
36 static int hf_ctlv_devid_src
;
37 static int hf_ctlv_devid_dst
;
38 static int hf_ctlv_cmd_nr
;
39 static int hf_ctlv_cmd_type
;
40 static int hf_ctlv_cmd_qual_refresh
;
41 static int hf_ctlv_cmd_qual_send_short_msg
;
42 static int hf_ctlv_cmd_qual_loci
;
43 static int hf_ctlv_cmd_qual_timer_mgmt
;
44 static int hf_ctlv_cmd_qual_send_data
;
45 static int hf_ctlv_cmd_qual
;
46 static int hf_ctlv_dur_time_unit
;
47 static int hf_ctlv_dur_time_intv
;
48 static int hf_ctlv_alpha_id_string
;
49 static int hf_ctlv_address_ton
;
50 static int hf_ctlv_address_npi
;
51 static int hf_ctlv_address_string
;
52 static int hf_ctlv_subaddress_string
;
53 static int hf_ctlv_result_gen
;
54 static int hf_ctlv_result_term
;
55 static int hf_ctlv_result_launch_browser
;
56 static int hf_ctlv_result_multiplecard
;
57 static int hf_ctlv_result_cc_ctrl_mo_sm_ctrl
;
58 static int hf_ctlv_result_bip
;
59 static int hf_ctlv_result_frames_cmd
;
60 static int hf_ctlv_text_string_enc
;
61 static int hf_ctlv_text_string
;
62 static int hf_ctlv_event
;
63 static int hf_ctlv_tone
;
64 static int hf_ctlv_item_id
;
65 static int hf_ctlv_item_string
;
66 static int hf_ctlv_loc_status
;
67 static int hf_ctlv_timer_val_hr
;
68 static int hf_ctlv_timer_val_min
;
69 static int hf_ctlv_timer_val_sec
;
70 static int hf_ctlv_date_time_yr
;
71 static int hf_ctlv_date_time_mo
;
72 static int hf_ctlv_date_time_day
;
73 static int hf_ctlv_date_time_hr
;
74 static int hf_ctlv_date_time_min
;
75 static int hf_ctlv_date_time_sec
;
76 static int hf_ctlv_date_time_tz
;
77 static int hf_ctlv_at_cmd
;
78 static int hf_ctlv_at_rsp
;
79 static int hf_ctlv_dtmf_string
;
80 static int hf_ctlv_language
;
81 static int hf_ctlv_me_status
;
82 static int hf_ctlv_timing_adv
;
83 static int hf_ctlv_aid_rid
;
84 static int hf_ctlv_aid_pix_app_code_etsi
;
85 static int hf_ctlv_aid_pix_app_code_3gpp
;
86 static int hf_ctlv_aid_pix_app_code_3gpp2
;
87 static int hf_ctlv_aid_pix_app_code
;
88 static int hf_ctlv_aid_pix_country_code
;
89 static int hf_ctlv_aid_pix_app_prov_code
;
90 static int hf_ctlv_aid_pix_app_prov_field
;
91 static int hf_ctlv_bearer
;
92 static int hf_ctlv_bearer_descr
;
93 static int hf_ctlv_bearer_csd_data_rate
;
94 static int hf_ctlv_bearer_csd_bearer_serv
;
95 static int hf_ctlv_bearer_csd_conn_elem
;
96 static int hf_ctlv_bearer_gprs_precedence
;
97 static int hf_ctlv_bearer_gprs_delay
;
98 static int hf_ctlv_bearer_gprs_reliability
;
99 static int hf_ctlv_bearer_gprs_peak
;
100 static int hf_ctlv_bearer_gprs_mean
;
101 static int hf_ctlv_bearer_gprs_prot_type
;
102 static int hf_ctlv_bearer_utran_traffic_class
;
103 static int hf_ctlv_bearer_utran_max_bitrate_ul
;
104 static int hf_ctlv_bearer_utran_max_bitrate_dl
;
105 static int hf_ctlv_bearer_utran_guaranteed_bitrate_ul
;
106 static int hf_ctlv_bearer_utran_guaranteed_bitrate_dl
;
107 static int hf_ctlv_bearer_utran_delivery_order
;
108 static int hf_ctlv_bearer_utran_max_sdu_size
;
109 static int hf_ctlv_bearer_utran_sdu_error_ratio
;
110 static int hf_ctlv_bearer_utran_residual_bit_error_ratio
;
111 static int hf_ctlv_bearer_utran_delivery_erroneous_sdus
;
112 static int hf_ctlv_bearer_utran_transfer_delay
;
113 static int hf_ctlv_bearer_utran_traffic_handling_prio
;
114 static int hf_ctlv_bearer_utran_pdp_type
;
115 static int hf_ctlv_bearer_params
;
116 static int hf_ctlv_buffers_size
;
117 static int hf_ctlv_transport_ptype
;
118 static int hf_ctlv_transport_port
;
119 static int hf_ctlv_other_address_coding
;
120 static int hf_ctlv_other_address_ipv4
;
121 static int hf_ctlv_other_address_ipv6
;
122 static int hf_ctlv_access_tech
;
123 static int hf_ctlv_dns_server_address_coding
;
124 static int hf_ctlv_dns_server_address_ipv4
;
125 static int hf_ctlv_dns_server_address_ipv6
;
126 static int hf_ctlv_utran_eutran_meas_qual
;
127 static int hf_ctlv_upd_attach_type
;
128 static int hf_ctlv_loci_lac
;
129 static int hf_ctlv_loci_cell_id
;
130 static int hf_ctlv_loci_ext_cell_id
;
131 static int hf_ctlv_iari
;
132 static int hf_ctlv_impu
;
133 static int hf_ctlv_ims_status_code
;
134 static int hf_ctlv_broadcast_nw_tech
;
135 static int hf_ctlv_broadcast_nw_loc_info
;
141 /* According to Section 7.2 of ETSI TS 101 220 / Chapter 7.2 */
144 /* BER-TLV tag - Remote Management application Data templates */
145 static const value_string ber_tlv_rmad_tag_vals
[] = {
146 { 0x01, "OMA SCWS" },
147 { 0x81, "OMA SCWS and GP 2.2 Amd. B" },
148 { 0xaa, "Command Scripting template for definite length coding" },
149 { 0xab, "Response Scripting Template for definite length coding" },
150 { 0xae, "Command Scripting template for indefinite length coding" },
151 { 0xaf, "Response Scripting Template for indefinite length coding" },
156 /* Comprehension-TLV tag */
157 static const value_string comp_tlv_tag_vals
[] = {
158 { 0x01, "Command details" },
159 { 0x02, "Device identity" },
161 { 0x04, "Duration" },
162 { 0x05, "Alpha identifier" },
164 { 0x07, "Capability configuration parameters" },
165 { 0x08, "Subaddress" },
166 { 0x09, "3GPP SS string" },
167 { 0x0a, "3GPP USSD string" },
168 { 0x0b, "3GPP SMS TPDU" },
169 { 0x0c, "3GPP Cell Broadcast page" },
170 { 0x0d, "Text string" },
173 { 0x10, "Item identifier" },
174 { 0x11, "Response length" },
175 { 0x12, "File List" },
176 { 0x13, "Location Information" },
178 { 0x15, "Help request" },
179 { 0x16, "Network Measurement Results" },
180 { 0x17, "Default Text" },
181 { 0x18, "Items Next Action Indicator" },
182 { 0x19, "Event list" },
183 { 0x1a, "GSM/3G Cause" },
184 { 0x1b, "Location status" },
185 { 0x1c, "Transaction identifier" },
186 { 0x1d, "GSM/3G BCCH channel list" },
187 { 0x1e, "Icon identifier" },
188 { 0x1f, "Item Icon identifier list" },
189 { 0x20, "Card reader status" },
190 { 0x21, "Card ATR / eCAT sequence number" },
191 { 0x22, "C-APDU / Encrypted TLV list" },
192 { 0x23, "R-APDU / SA template" },
193 { 0x24, "Timer identifier" },
194 { 0x25, "Timer value" },
195 { 0x26, "Date-Time and Time zone" },
196 { 0x27, "Call control requested action" },
197 { 0x28, "AT Command" },
198 { 0x29, "AT Response" },
199 { 0x2a, "GSM/3G BC Repeat Indicator" },
200 { 0x2b, "Immediate response" },
201 { 0x2c, "DTMF string" },
202 { 0x2d, "Language" },
203 { 0x2e, "GSM Timing Advance" },
205 { 0x30, "Browser Identity" },
206 { 0x31, "URL / URI" },
208 { 0x33, "Provisioning Reference File" },
209 { 0x34, "Browser Termination Cause" },
210 { 0x35, "Bearer description" },
211 { 0x36, "Channel data" },
212 { 0x37, "Channel data length" },
213 { 0x38, "Channel status" },
214 { 0x39, "Buffer size" },
215 { 0x3a, "Card reader identifier / REFRESH Enforcement Policy" },
216 { 0x3b, "File Update Information" },
217 { 0x3c, "UICC/terminal interface transport level" },
218 { 0x3e, "Other address (data destination address)" },
219 { 0x3f, "Access Technology" },
220 { 0x40, "Display parameters / DNS server address" },
221 { 0x41, "Service Record" },
222 { 0x42, "Device Filter" },
223 { 0x43, "Service Search" },
224 { 0x44, "Attribute information" },
225 { 0x45, "Service Availability" },
226 { 0x46, "3GPP2 ESN" },
227 { 0x47, "Network Access Name" },
228 { 0x48, "3GPP2 CDMA-SMS-TPDU" },
229 { 0x49, "Remote Entity Address" },
230 { 0x4a, "3GPP I-WLAN Identifier" },
231 { 0x4b, "3GPP I-WLAN Access Status" },
232 { 0x50, "Text attribute" },
233 { 0x51, "Item text attribute list" },
234 { 0x52, "3GPP PDP Context Activation parameter" },
235 { 0x53, "Contactless state request" },
236 { 0x54, "Contactless functionality state" },
237 { 0x55, "3GPP CSG cell selection status" },
238 { 0x56, "3GPP CSG ID" },
239 { 0x57, "3GPP HNB name" },
241 { 0x61, "Emergency Call Object" },
243 { 0x63, "Battery state" },
244 { 0x64, "Browsing status" },
245 { 0x65, "Network Search Mode" },
246 { 0x66, "Frame Layout" },
247 { 0x67, "Frames Information" },
248 { 0x68, "Frame identifier" },
249 { 0x69, "3GPP UTRAN/E-UTRAN Measurement qualifier" },
250 { 0x6a, "Multimedia Message Reference" },
251 { 0x6b, "Multimedia Message Identifier" },
252 { 0x6c, "Multimedia Message Transfer Status" },
254 { 0x6e, "Multimedia Message Content Identifier" },
255 { 0x6f, "Multimedia Message Notification" },
256 { 0x70, "Last Envelope" },
257 { 0x71, "Registry application data" },
258 { 0x72, "3GPP PLMNwAcT List" },
259 { 0x73, "3GPP Routing Area Information" },
260 { 0x74, "3GPP Update/Attach/Registration Type" },
261 { 0x75, "3GPP Rejection Cause Code" },
262 { 0x76, "3GPP Geographical Location Parameters / IARI" },
263 { 0x77, "3GPP GAD Shapes / IMPU list" },
264 { 0x78, "3GPP NMEA sentence / IMS Status-Code" },
265 { 0x79, "3GPP PLMN list" },
266 { 0x7a, "Broadcast Network Information" },
267 { 0x7b, "ACTIVATE descriptor" },
268 { 0x7c, "3GPP EPS PDN connection activation parameters" },
269 { 0x7d, "3GPP Tracking Area Identification" },
270 { 0x7e, "3GPP CSG ID list" },
271 { 0xaa, "IP address list" },
272 { 0xbb, "Surrounding macrocells" },
275 static value_string_ext comp_tlv_tag_vals_ext
= VALUE_STRING_EXT_INIT(comp_tlv_tag_vals
);
277 /* TS 102 223 Chapter 8.6 */
278 static const value_string cmd_qual_refresh_vals
[] = {
279 { 0x00, "NAA Initialization and Full File Change Notification" },
280 { 0x01, "File Change Notification" },
281 { 0x02, "NAA Initialization and File Change Notification" },
282 { 0x03, "NAA Initialization" },
283 { 0x04, "UICC Reset" },
284 { 0x05, "NAA Application Reset, only applicable for a 3G platform" },
285 { 0x06, "NAA Session Reset, only applicable for a 3G platform" },
286 { 0x07, "Steering of Roaming" },
287 { 0x08, "Steering of Roaming for I-WLAN" },
291 static const true_false_string cmd_qual_send_short_msg_value
= {
292 "SMS packing by the terminal required",
293 "Packing not required"
296 static const value_string cmd_qual_loci_vals
[] = {
297 { 0x00, "Location Information (MCC, MNC, LAC/TAC, Cell Identity and Extended Cell Identity)" },
298 { 0x01, "IMEI of the terminal" },
299 { 0x02, "Network Measurement results" },
300 { 0x03, "Date, time and time zone" },
301 { 0x04, "Language setting" },
302 { 0x05, "Timing Advance" },
303 { 0x06, "Access Technology (single access technology)" },
304 { 0x07, "ESN of the terminal" },
305 { 0x08, "IMEISV of the terminal" },
306 { 0x09, "Search Mode" },
307 { 0x0a, "Charge State of the Battery" },
308 { 0x0b, "MEID of the terminal" },
309 { 0x0c, "Current WSID" },
310 { 0x0d, "Broadcast Network information according to current Broadcast Network Technology used" },
311 { 0x0e, "Multiple Access Technologies" },
312 { 0x0f, "Location Information for multiple access technologies" },
313 { 0x10, "Network Measurement results for multiple access technologies" },
314 { 0x11, "CSG ID list and corresponding HNB name" },
315 { 0x12, "H(e)NB IP address" },
316 { 0x13, "H(e)NB surrounding macrocells" },
319 static value_string_ext cmd_qual_loci_vals_ext
= VALUE_STRING_EXT_INIT(cmd_qual_loci_vals
);
321 static const value_string cmd_qual_timer_mgmt_vals
[] = {
323 { 0x01, "Deactivate" },
324 { 0x02, "Get current value" },
328 static const true_false_string cmd_qual_send_data_value
= {
329 "Send data immediately",
330 "Store data in Tx buffer"
333 /* TS 102 223 Chapter 8.7 */
334 static const value_string dev_id_vals
[] = {
337 { 0x03, "Earpiece" },
338 { 0x10, "Additional Card Reader 0" },
339 { 0x11, "Additional Card Reader 1" },
340 { 0x12, "Additional Card Reader 2" },
341 { 0x13, "Additional Card Reader 3" },
342 { 0x14, "Additional Card Reader 4" },
343 { 0x15, "Additional Card Reader 5" },
344 { 0x16, "Additional Card Reader 6" },
345 { 0x17, "Additional Card Reader 7" },
346 { 0x21, "Channel ID 1" },
347 { 0x22, "Channel ID 2" },
348 { 0x23, "Channel ID 3" },
349 { 0x24, "Channel ID 4" },
350 { 0x25, "Channel ID 5" },
351 { 0x26, "Channel ID 6" },
352 { 0x27, "Channel ID 7" },
353 { 0x31, "eCAT ID 1" },
354 { 0x32, "eCAT ID 2" },
355 { 0x33, "eCAT ID 3" },
356 { 0x34, "eCAT ID 4" },
357 { 0x35, "eCAT ID 5" },
358 { 0x36, "eCAT ID 6" },
359 { 0x37, "eCAT ID 7" },
360 { 0x38, "eCAT ID 8" },
361 { 0x39, "eCAT ID 9" },
362 { 0x3a, "eCAT ID 10" },
363 { 0x3b, "eCAT ID 11" },
364 { 0x3c, "eCAT ID 12" },
365 { 0x3d, "eCAT ID 13" },
366 { 0x3e, "eCAT ID 14" },
367 { 0x3f, "eCAT ID 15" },
368 { 0x81, "SIM / USIM / UICC" },
369 { 0x82, "Terminal (Card Reader)" },
373 static value_string_ext dev_id_vals_ext
= VALUE_STRING_EXT_INIT(dev_id_vals
);
375 /* TS 102 223 Chapter 9.4 */
376 static const value_string cmd_type_vals
[] = {
378 { 0x02, "MORE TIME" },
379 { 0x03, "POLL INTERVAL" },
380 { 0x04, "POLLING OFF" },
381 { 0x05, "SET UP EVENT LIST" },
382 { 0x10, "SET UP CALL" },
384 { 0x12, "SEND USSD" },
385 { 0x13, "SEND SHORT MESSAGE" },
386 { 0x14, "SEND DTMF" },
387 { 0x15, "LAUNCH BROWSER" },
388 { 0x16, "3GPP GEOGRAPHICAL LOCATION REQUEST" },
389 { 0x20, "PLAY TONE" },
390 { 0x21, "DISPLAY TEXT" },
391 { 0x22, "GET INKEY" },
392 { 0X23, "GET INPUT" },
393 { 0x24, "SELECT ITEM" },
394 { 0x25, "SET UP MENU" },
395 { 0x26, "PROVIDE LOCAL INFORMATION" },
396 { 0x27, "TIMER MANAGEMENT" },
397 { 0x28, "SET UP IDLE MODE TEXT" },
398 { 0x30, "PERFORM CARD APDU" },
399 { 0x31, "POWER ON CARD" },
400 { 0x32, "POWER OFF CARD" },
401 { 0x33, "GET READER STATUS" },
402 { 0x34, "RUN AT COMMAND" },
403 { 0x35, "LANGUAGE NOTIFICATION" },
404 { 0x40, "OPEN CHANNEL" },
405 { 0x41, "CLOSE CHANNEL" },
406 { 0x42, "RECEIVE DATA" },
407 { 0x43, "SEND DATA" },
408 { 0x44, "GET CHANNEL STATUS" },
409 { 0x45, "SERVICE SEARCH" },
410 { 0x46, "GET SERVICE INFORMATION" },
411 { 0x47, "DECLARE SERVICE" },
412 { 0x50, "SET FRAMES" },
413 { 0x51, "GET FRAMES STATUS" },
414 { 0x60, "RETRIEVE MULTIMEDIA MESSAGE" },
415 { 0x61, "SUBMIT MULTIMEDIA MESSAGE" },
416 { 0x62, "DISPLAY MULTIMEDIA MESSAGE" },
417 { 0x70, "ACTIVATE" },
418 { 0x71, "CONTACTLESS STATE CHANGED" },
419 { 0x72, "COMMAND CONTAINER" },
420 { 0x73, "ENCAPSULATED SESSION CONTROL" },
421 { 0x81, "End of the proactive session" },
424 static value_string_ext cmd_type_vals_ext
= VALUE_STRING_EXT_INIT(cmd_type_vals
);
426 /* TS 102 223 Chapter 8.8 */
427 static const value_string time_unit_vals
[] = {
430 { 0x02, "tenths of seconds" },
434 /* TS 102 223 Chapter 8.1 */
435 static const value_string ton_vals
[] = {
437 { 0x01, "International Number" },
438 { 0x02, "National Number" },
439 { 0x03, "Network Specific Number" },
443 /* TS 102 223 Chapter 8.1 */
444 static const value_string npi_vals
[] = {
446 { 0x01, "ISDN/telephony numbering plan (Recommendation ITU-Ts E.164 and E.163" },
447 { 0x03, "Data numbering plan (Recommendation ITU-T X.121)" },
448 { 0x04, "Telex numbering plan (Recommendation ITU-T F.69)" },
449 { 0x09, "Private numbering plan" },
450 { 0x0f, "Reserved for extension" },
454 /* TS 102 223 Chapter 8.12 */
455 static const value_string result_vals
[] = {
456 { 0x00, "Command performed successfully" },
457 { 0x01, "Command performed with partial comprehension" },
458 { 0x02, "Command performed with missing information" },
459 { 0x03, "REFRESH performed with additional EFs read" },
460 { 0x04, "Command performed successfully, but requested icon could not be displayed" },
461 { 0x05, "Command performed, but modified by call control by NAA" },
462 { 0x06, "Command performed successfully, limited service" },
463 { 0x07, "Command performed with modifications" },
464 { 0x08, "REFRESH performed by indicated NAA was not active" },
465 { 0x09, "Command performed successfully, tone not played" },
466 { 0x10, "Proactive UICC session terminated by the user" },
467 { 0x11, "Backward move in the proactive UICC session requested by user" },
468 { 0x12, "No response from user" },
469 { 0x13, "Help information required by the user" },
470 { 0x14, "USSD or SS transaction terminated by the user" },
471 { 0x20, "Terminal currently unable to process command" },
472 { 0x21, "Network currently unable to process command" },
473 { 0x22, "User did not accept the proactive command" },
474 { 0x23, "User cleared down call before connection or network refuse" },
475 { 0x24, "Action in contradiction with the current timer state" },
476 { 0x25, "Interaction with call control by NAA temporary problem" },
477 { 0x26, "Launch browser generic error code" },
478 { 0x27, "MMS temporary problem" },
479 { 0x30, "Command beyond terminal's capabilities" },
480 { 0x31, "Command type not understood by terminal" },
481 { 0x32, "Command data not understood by terminal" },
482 { 0x33, "Command number not known by terminal" },
483 { 0x34, "SS Return Error" },
484 { 0x35, "SMS RP-ERROR" },
485 { 0x36, "Error, required values are missing" },
486 { 0x37, "USSD Return Error" },
487 { 0x38, "MultipleCard commands error" },
488 { 0x39, "Interaction with call control by USIM or MO short message control by USIM, permanent problem" },
489 { 0x3a, "Bearer Independent Protocol error" },
490 { 0x3b, "Access Technology unable to process command" },
491 { 0x3c, "Frames error" },
492 { 0x3d, "MMS error" },
495 static value_string_ext result_vals_ext
= VALUE_STRING_EXT_INIT(result_vals
);
497 static const value_string result_term_vals
[] = {
498 { 0x00, "No specific cause can be given" },
499 { 0x01, "Screen is busy" },
500 { 0x02, "Terminal currently busy on call" },
501 { 0x03, "ME currently busy on SS transaction" },
502 { 0x04, "No service" },
503 { 0x05, "Access control class bar" },
504 { 0x06, "Radio resource not granted" },
505 { 0x07, "Not in speech call" },
506 { 0x08, "ME currently busy on USSD transaction" },
507 { 0x09, "Terminal currently busy on SEND DTMF command" },
508 { 0x0a, "No NAA active" },
511 static value_string_ext result_term_vals_ext
= VALUE_STRING_EXT_INIT(result_term_vals
);
513 static const value_string result_launch_browser_vals
[] = {
514 { 0x00, "No specific cause can be given" },
515 { 0x01, "Bearer unavailable" },
516 { 0x02, "Browser unavailable" },
517 { 0x03, "Terminal unable to read the provisioning data" },
518 { 0x04, "Default URL unavailable" },
522 static const value_string result_multiplecard_vals
[] = {
523 { 0x00, "No specific cause can be given" },
524 { 0x01, "Card reader removed or not present" },
525 { 0x02, "Card removed or not present" },
526 { 0x03, "Card reader busy" },
527 { 0x04, "Card powered off" },
528 { 0x05, "C-APDU format error" },
529 { 0x06, "Mute card" },
530 { 0x07, "Transmission error" },
531 { 0x08, "Protocol not supported" },
532 { 0x09, "Specified reader not valid" },
535 static value_string_ext result_multiplecard_vals_ext
= VALUE_STRING_EXT_INIT(result_multiplecard_vals
);
537 static const value_string result_cc_ctrl_mo_sm_ctrl_vals
[] = {
538 { 0x00, "No specific cause can be given" },
539 { 0x01, "Action not allowed" },
540 { 0x02, "The type of request has changed" },
544 static const value_string result_bip_vals
[] = {
545 { 0x00, "No specific cause can be given" },
546 { 0x01, "No channel available" },
547 { 0x02, "Channel closed" },
548 { 0x03, "Channel identifier not valid" },
549 { 0x04, "Requested buffer size not available" },
550 { 0x05, "Security error (unsuccessful authentication)" },
551 { 0x06, "Requested UICC/terminal interface transport level not available" },
552 { 0x07, "Remote device is not reachable" },
553 { 0x08, "Service error" },
554 { 0x09, "Service identifier unknown" },
555 { 0x10, "Port not available" },
556 { 0x11, "Launch parameters missing or incorrect" },
557 { 0x12, "Application launch failed" },
560 static value_string_ext result_bip_vals_ext
= VALUE_STRING_EXT_INIT(result_bip_vals
);
562 static const value_string result_frames_cmd_vals
[] = {
563 { 0x00, "No specific cause can be given" },
564 { 0x01, "Frame identifier is not valid" },
565 { 0x02, "Number of frames beyond the terminal's capabilities" },
566 { 0x03, "No Frame defined" },
567 { 0x04, "Requested size not supported" },
568 { 0x05, "Default Active Frame is not valid" },
573 static const range_string text_encoding_vals
[] = {
574 { 0x00, 0x03, "GSM default alphabet, 7 bits packed" },
575 { 0x04, 0x07, "GSM default alphabet, 8 bits" },
576 { 0x08, 0x0b, "UCS2" },
577 { 0xf0, 0xf3, "GSM default alphabet, 7 bits packed" },
578 { 0xf4, 0xf7, "GSM default alphabet, 8 bits" },
582 /* TS 102 223 - Chapter 8.16 */
583 static const value_string tone_vals
[] = {
584 /* Standard supervisory tones */
585 { 0x01, "Dial tone" },
586 { 0x02, "Called subscriber busy" },
587 { 0x03, "Congestion" },
588 { 0x04, "Radio path acknowledge" },
589 { 0x05, "Radio path not available / Call dropped" },
590 { 0x06, "Error / Special information" },
591 { 0x07, "Call waiting tone" },
592 { 0x08, "Ringing tone" },
593 /* Terminal proprietary tones */
594 { 0x10, "General beep" },
595 { 0x11, "Positive acknowledgement tone" },
596 { 0x12, "Negative acknowledgement or error tone" },
597 { 0x13, "Ringing tone as selected by the oser for incoming speech call" },
598 { 0x14, "Alert tone as selected by the user for incoming SMS" },
599 { 0x15, "Critical alert" },
600 { 0x20, "Vibrate only, if available" },
602 { 0x30, "happy tone" },
603 { 0x31, "sad tone" },
604 { 0x32, "urgent action tone" },
605 { 0x33, "question tone" },
606 { 0x34, "message received tone" },
608 { 0x40, "Melody 1" },
609 { 0x41, "Melody 2" },
610 { 0x42, "Melody 3" },
611 { 0x43, "Melody 4" },
612 { 0x44, "Melody 5" },
613 { 0x45, "Melody 6" },
614 { 0x46, "Melody 7" },
615 { 0x47, "Melody 8" },
618 static value_string_ext tone_vals_ext
= VALUE_STRING_EXT_INIT(tone_vals
);
620 /* TS 102 223 - Chapter 8.25 */
621 static const value_string event_list_vals
[] = {
623 { 0x01, "Call connected" },
624 { 0x02, "Call disconnected" },
625 { 0x03, "Location status" },
626 { 0x04, "User activity" },
627 { 0x05, "Idle screen available" },
628 { 0x06, "Card reader status" },
629 { 0x07, "Language selection" },
630 { 0x08, "Browser termination" },
631 { 0x09, "Data available" },
632 { 0x0a, "Channel status" },
633 { 0x0b, "Access Technology Change (single access technology)" },
634 { 0x0c, "Display parameters changed" },
635 { 0x0d, "Local connection" },
636 { 0x0e, "Network Search Mode Change" },
637 { 0x0f, "Browsing status" },
638 { 0x10, "Frames Information Change" },
639 { 0x11, "I-WLAN Access Status" },
640 { 0x12, "Network Rejection" },
641 { 0x13, "HCI connectivity event" },
642 { 0x14, "Access Technology Change (multiple access technologies)" },
643 { 0x15, "CSG cell selection" },
644 { 0x16, "Contactless state request" },
645 { 0x17, "IMS Registration" },
646 { 0x18, "Incoming IMS data" },
647 { 0x19, "Profile Container" },
649 { 0x1b, "Secured Profile Container" },
650 { 0x1c, "Poll Interval Negotiation" },
653 static value_string_ext event_list_vals_ext
= VALUE_STRING_EXT_INIT(event_list_vals
);
655 /* TS 102 223 - Chapter 8.27 */
656 static const value_string loc_status_vals
[] = {
657 { 0x00, "Normal service" },
658 { 0x01, "Limited service" },
659 { 0x02, "No service" },
663 /* 31.111 - Chapter 8.46 */
664 static const value_string me_status_vals
[] = {
665 { 0x00, "ME is in the idle state" },
666 { 0x01, "ME is not in idle state" },
670 /* TS 102 223 - Chapter 8.49 + TS 11.14 Chapter 12.49 */
671 static const value_string bearer_vals
[] = {
675 { 0x03, "GPRS/UTRAN packet service/E-UTRAN" },
679 /* TS 102 223 - Chapter 8.52 + TS 11.14 Chapter 12.52 */
680 static const value_string bearer_descr_vals
[] = {
682 { 0x02, "GPRS / UTRAN packet service / E-UTRAN" },
683 { 0x03, "Default bearer for requested transport layer" },
684 { 0x04, "Local link technology independent" },
685 { 0x05, "Bluetooth" },
688 { 0x08, "TIA/EIA/IS-820 packet data service" },
689 { 0x09, "UTRAN packet service with extended parameters / HSDPA / E-UTRAN" },
691 { 0x0b, "E-UTRAN / Mapped UTRAN packet service" },
695 static value_string_ext bearer_descr_vals_ext
= VALUE_STRING_EXT_INIT(bearer_descr_vals
);
697 /* 3GPP 31.111 - Chapter 8.52 */
698 static const value_string csd_data_rate_vals
[] = {
699 { 0, "autobauding" },
700 { 1, "300 bps (V.21)" },
701 { 2, "1200 bps (V.22)" },
702 { 3, "1200/75 bps (V.23)" },
703 { 4, "2400 bps (V.22bis)" },
704 { 5, "2400 bps (V.26ter)" },
705 { 6, "4800 bps (V.32)" },
706 { 7, "9600 bps (V.32)" },
707 { 12, "9600 bps (V.34)" },
708 { 14, "14400 bps (V.34)" },
709 { 15, "19200 bps (V.34)" },
710 { 16, "28800 bps (V.34)" },
711 { 17, "33600 bps (V.34)" },
712 { 34, "1200 bps (V.120)" },
713 { 36, "2400 bps (V.120)" },
714 { 38, "4800 bps (V.120)" },
715 { 39, "9600 bps (V.120)" },
716 { 43, "14400 bps (V.120)" },
717 { 47, "19200 bps (V.120)" },
718 { 48, "28800 bps (V.120)" },
719 { 49, "38400 bps (V.120)" },
720 { 50, "48000 bps (V.120)" },
721 { 51, "56000 bps (V.120)" },
722 { 65, "300 bps (V.110)" },
723 { 66, "1200 bps (V.110)" },
724 { 68, "2400 bps (V.110 or X.31 flag stuffing)" },
725 { 70, "4800 bps (V.110 or X.31 flag stuffing)" },
726 { 71, "9600 bps (V.110 or X.31 flag stuffing)" },
727 { 75, "14400 bps (V.110 or X.31 flag stuffing)" },
728 { 79, "19200 bps (V.110 or X.31 flag stuffing)" },
729 { 80, "28800 bps (V.110 or X.31 flag stuffing)" },
730 { 81, "38400 bps (V.110 or X.31 flag stuffing)" },
731 { 82, "48000 bps (V.110 or X.31 flag stuffing)" },
732 { 83, "56000 bps (V.110 or X.31 flag stuffing)" },
733 { 84, "64000 bps (X.31 flag stuffing)" },
734 { 115, "56000 bps (bit transparent)" },
735 { 116, "64000 bps (bit transparent)" },
736 { 120, "32000 bps (PIAFS32k)" },
737 { 121, "64000 bps (PIAFS64k)" },
738 { 130, "28800 bps (multimedia)" },
739 { 131, "32000 bps (multimedia)" },
740 { 132, "33600 bps (multimedia)" },
741 { 133, "56000 bps (multimedia)" },
742 { 134, "64000 bps (multimedia)" },
745 value_string_ext csd_data_rate_vals_ext
= VALUE_STRING_EXT_INIT(csd_data_rate_vals
);
747 static const value_string csd_bearer_serv_vals
[] = {
748 { 0, "Data circuit asynchronous (UDI or 3.1 kHz modem)" },
749 { 1, "Data circuit synchronous (UDI or 3.1 kHz modem)" },
750 { 2, "PAD Access (asynchronous) (UDI)" },
751 { 3, "Packet Access (synchronous) (UDI)" },
752 { 4, "Data circuit asynchronous (RDI)" },
753 { 5, "Data circuit synchronous (RDI)" },
754 { 6, "PAD Access (asynchronous) (RDI)" },
755 { 7, "Packet Access (synchronous) (RDI)" },
758 static const value_string csd_conn_elem_vals
[] = {
759 { 0, "Transparent" },
760 { 1, "Non-transparent" },
761 { 2, "Both, transparent preferred" },
762 { 3, "Both, non-transparent preferred" },
765 static const value_string gprs_prot_type_vals
[] = {
766 { 2, "IP (Internet Protocol, IETF STD 5)" },
769 static const value_string utran_traffic_class_vals
[] = {
770 { 0, "Conversational" },
772 { 2, "Interactive" },
774 { 4, "Subscribed value" },
777 static const value_string utran_delivery_order_vals
[] = {
780 { 2, "Subscribed value" },
783 static const value_string utran_delivery_erroneous_sdus_vals
[] = {
787 { 3, "Subscribed value" },
790 static const value_string pdp_type_vals
[] = {
800 /* TS 102 223 - Chapter 8.58 */
801 static const value_string other_address_coding_vals
[] = {
802 { 0x21, "IPv4 address" },
803 { 0x57, "IPv6 address" },
807 /* TS 102 223 - Chapter 8.59 + TS 11.14 Chapter 12.59 */
808 static const value_string transport_ptype_vals
[] = {
809 { 0x01, "UDP, UICC in client mode, remote connection" },
810 { 0x02, "TCP, UICC in client mode, remote connection" },
811 { 0x03, "TCP, UICC in server mode" },
812 { 0x04, "UDP, UICC in client mode, local connection" },
813 { 0x05, "TCP, UICC in client mode, local connection" },
814 { 0x06, "direct communication channel" },
818 /* TS 102 223 - Chapter 8.61 */
819 static const value_string access_tech_vals
[] = {
821 { 0x01, "TIA/EIA-553" },
822 { 0x02, "TIA/EIA-136-C" },
825 { 0x05, "TIE/EIA-95" },
826 { 0x06, "cdma2000 1x (TIA/EIA/IS-2000)" },
827 { 0x07, "cdma2000 HRPD (TIA/EIA/IS-856)" },
833 /* 3GPP 31.111 - Chapter 8.73 */
834 static const value_string utran_eutran_meas_qual_vals
[] = {
835 { 0x01, "UTRAN Intra-frequency measurements" },
836 { 0x02, "UTRAN Inter-frequency measurements" },
837 { 0x03, "UTRAN Inter-RAT (GERAN) measurements" },
838 { 0x04, "UTRAN Inter-RAT (E-UTRAN) measurements" },
839 { 0x05, "E-UTRAN Intra-frequency measurements" },
840 { 0x06, "E-UTRAN Inter-frequency measurements" },
841 { 0x07, "E-UTRAN Inter-RAT (GERAN) measurements" },
842 { 0x08, "E-UTRAN Inter-RAT (UTRAN) measurements" },
843 { 0x09, "E-UTRAN Inter-RAT (NR) measurements" },
847 /* ETSI 102.223 - Chapter 8.90 */
848 static const value_string broadcast_nw_tech_vals
[] = {
860 /* 3GPP 31.111 - Chapter 8.92 */
861 static const value_string upd_attach_type_vals
[] = {
862 { 0x00, "\"Normal Location Updating\" in the case of a Location Updating Request message" },
863 { 0x01, "\"Periodic Updating\" in the case of a Location Updating Request message" },
864 { 0x02, "\"IMSI Attach\" in the case of a Location Updating Request message" },
865 { 0x03, "\"GPRS Attach\" in the case of a GPRS Attach Request message" },
866 { 0x04, "\"Combined GPRS/IMSI Attach\" in the case of a GPRS Attach Request message" },
867 { 0x05, "\"RA Updating\" in the case of a Routing Area Update Request message" },
868 { 0x06, "\"Combined RA/LA Updating\" in the case of a Routing Area Update Request message" },
869 { 0x07, "\"Combined RA/LA Updating with IMSI Attach\" in the case of a Routing Area Update Request message" },
870 { 0x08, "\"Periodic Updating\" in the case of a Routing Area Update Request message" },
871 { 0x09, "\"EPS Attach\" in the case of an EMM ATTACH REQUEST message" },
872 { 0x0A, "\"Combined EPS/IMSI Attach\" in the case of an EMM ATTACH REQUEST message" },
873 { 0x0B, "\"TA updating\" in the case of an EMM TRACKING AREA UPDATE REQUEST message" },
874 { 0x0C, "\"Combined TA/LA updating\" in the case of an EMM TRACKING AREA UPDATE REQUEST message" },
875 { 0x0D, "\"Combined TA/LA updating with IMSI attach\" in the case of an EMM TRACKING AREA UPDATE REQUEST message" },
876 { 0x0E, "\"Periodic updating\" in the case of an EMM TRACKING AREA UPDATE REQUEST message" },
877 { 0x0F, "\"Initial Registration\" in the case of a 5GMM REGISTRATION REQUEST message" },
878 { 0x10, "\"Mobility Registration updating\" in the case of a 5GMM REGISTRATION REQUEST message" },
879 { 0x11, "\"Periodic Registration updating\" in the case of a 5GMM REGISTRATION REQUEST message" },
882 static value_string_ext upd_attach_type_vals_ext
= VALUE_STRING_EXT_INIT(upd_attach_type_vals
);
884 /* 3GPP 31.111 - Chapter 8.112 */
885 static const string_string ims_status_code
[] = {
887 { "180", "Ringing" },
888 { "181", "Call Is Being Forwarded" },
890 { "183", "Session Progress" },
892 { "300", "Multiple Choices" },
893 { "301", "Moved Permanently" },
894 { "302", "Moved Temporarily" },
895 { "305", "Use Proxy" },
896 { "380", "Alternative Service" },
897 { "400", "Bad Request" },
898 { "401", "Unauthorized" },
899 { "402", "Payment Required" },
900 { "403", "Forbidden" },
901 { "404", "Not Found" },
902 { "405", "Method Not Allowed" },
903 { "406", "Not Acceptable" },
904 { "407", "Proxy Authentication Required" },
905 { "408", "Request Timeout" },
907 { "413", "Request Entity Too Large" },
908 { "414", "Request-URI Too Long" },
909 { "415", "Unsupported Media Type" },
910 { "416", "Unsupported URI Scheme" },
911 { "420", "Bad Extension" },
912 { "421", "Extension Required" },
913 { "423", "Interval Too Brief" },
914 { "480", "Temporarily Unavailable" },
915 { "481", "Call/Transaction Does Not Exist" },
916 { "482", "Loop Detected" },
917 { "483", "Too Many Hops" },
918 { "484", "Address Incomplete" },
919 { "485", "Ambiguous" },
920 { "486", "Busy Here" },
921 { "487", "Request Terminated" },
922 { "488", "Not Acceptable Here" },
923 { "491", "Request Pending" },
924 { "493", "Undecipherable" },
925 { "500", "Server Internal Error" },
926 { "501", "Not Implemented" },
927 { "502", "Bad Gateway" },
928 { "503", "Service Unavailable" },
929 { "504", "Server Time-out" },
930 { "505", "Version Not Supported" },
931 { "513", "Message Too Large" },
932 { "600", "Busy Everywhere" },
933 { "603", "Decline" },
934 { "604", "Does Not Exist Anywhere" },
935 { "606", "Not Acceptable" },
939 #define AID_RID_ETSI INT64_C(0xA000000009)
940 #define AID_RID_3GPP INT64_C(0xA000000087)
941 #define AID_RID_3GPP2 INT64_C(0xA000000343)
942 #define AID_RID_OMA INT64_C(0xA000000412)
943 #define AID_RID_WIMAX INT64_C(0xA000000424)
945 static const val64_string aid_rid_vals
[] = {
946 { AID_RID_ETSI
, "ETSI"},
947 { AID_RID_3GPP
, "3GPP"},
948 { AID_RID_3GPP2
, "3GPP2"},
949 { AID_RID_OMA
, "OMA"},
950 { AID_RID_WIMAX
, "WiMAX Forum"},
954 static const value_string aid_pix_app_code_etsi_vals
[] = {
956 { 0x0002, "GSM SIM toolkit"},
957 { 0x0003, "GSM SIM API for Java Card"},
959 { 0x0005, "UICC API for Java Card"},
960 { 0x0101, "DVB CBMS KMS"},
965 static const value_string aid_pix_app_code_3gpp_vals
[] = {
966 { 0x1001, "3GPP UICC"},
967 { 0x1002, "3GPP USIM"},
968 { 0x1003, "3GPP USIM toolkit"},
969 { 0x1004, "3GPP ISIM"},
970 { 0x1005, "3GPP (U)SIM API for Java Card"},
971 { 0x1006, "3GPP ISIM API for Java Card"},
972 { 0x1007, "3GPP Contact Manager API for Java Card"},
973 { 0x1008, "3GPP USIM-INI"},
974 { 0x1009, "3GPP USIM-RN"},
978 static const value_string aid_pix_app_code_3gpp2_vals
[] = {
979 { 0x1002, "3GPP2 CSIM"},
997 cat_nmr_type nmr_type
;
1001 * ETSI TS 102 221 Annex A.
1004 dissect_cat_efadn_coding(tvbuff_t
*tvb
, proto_tree
*tree
, uint32_t pos
, uint32_t len
, int hf_entry
)
1007 uint8_t first_byte
= tvb_get_uint8(tvb
, pos
);
1009 if ((first_byte
& 0x80) == 0) {
1011 * Unpacked GSM alphabet.
1013 proto_tree_add_item(tree
, hf_entry
, tvb
, pos
, len
, ENC_3GPP_TS_23_038_7BITS_UNPACKED
|ENC_NA
);
1018 proto_tree_add_item(tree
, hf_entry
, tvb
, pos
, len
, ENC_ETSI_TS_102_221_ANNEX_A
);
1024 dissect_cat(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
1027 proto_tree
*cat_tree
, *elem_tree
;
1028 unsigned int pos
= 0;
1030 bool ims_event
= false, dns_server
= false;
1031 unsigned length
= tvb_reported_length(tvb
);
1032 gsm_sms_data_t sms_data
= {0};
1033 conversation_t
*conversation
;
1034 cat_conv_info_t
*cat_info
;
1035 cat_transaction_t
*cat_trans
= NULL
;
1036 wmem_tree_key_t key
[3];
1039 conversation
= find_or_create_conversation(pinfo
);
1040 cat_info
= (cat_conv_info_t
*)conversation_get_proto_data(conversation
, proto_cat
);
1042 cat_info
= wmem_new(wmem_file_scope(), cat_conv_info_t
);
1043 cat_info
->pdus
= wmem_tree_new(wmem_file_scope());
1044 conversation_add_proto_data(conversation
, proto_cat
, cat_info
);
1047 cat_ti
= proto_tree_add_item(tree
, proto_cat
, tvb
, 0, -1, ENC_NA
);
1048 cat_tree
= proto_item_add_subtree(cat_ti
, ett_cat
);
1049 while (pos
< length
) {
1051 uint32_t g8
, cmd_nr
, cmd_qual
;
1055 uint8_t *ptr
= NULL
;
1057 tag
= tvb_get_uint8(tvb
, pos
++) & 0x7f;
1059 tag
= tvb_get_ntohs(tvb
, pos
) & 0x7fff;
1062 len
= tvb_get_uint8(tvb
, pos
++);
1065 len
= tvb_get_uint8(tvb
, pos
++);
1068 len
= tvb_get_ntohs(tvb
, pos
);
1072 len
= tvb_get_ntoh24(tvb
, pos
);
1080 ti
= proto_tree_add_bytes_format(cat_tree
, hf_cat_tlv
, tvb
, pos
,
1082 val_to_str_ext(tag
, &comp_tlv_tag_vals_ext
, "%02x"),
1083 (len
> 0) ? tvb_bytes_to_str(pinfo
->pool
, tvb
, pos
, len
) : "");
1085 ti
= proto_tree_add_bytes_format(cat_tree
, hf_cat_tlv
, tvb
, pos
,
1087 val_to_str_ext(tag
, &comp_tlv_tag_vals_ext
, "%02x"));
1089 elem_tree
= proto_item_add_subtree(ti
, ett_elem
);
1092 case 0x01: /* command details */
1095 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_cmd_nr
, tvb
, pos
, 1, ENC_BIG_ENDIAN
, &cmd_nr
);
1096 if (cmd_nr
== 0x40) {
1100 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_cmd_type
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
, &g8
);
1101 /* append command type to INFO column */
1102 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s ",
1103 val_to_str_ext(g8
, &cmd_type_vals_ext
, "%02x "));
1106 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_cmd_qual_refresh
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
, &cmd_qual
);
1109 proto_tree_add_item_ret_boolean(elem_tree
, hf_ctlv_cmd_qual_send_short_msg
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
, &cmd_qual_flag
);
1110 sms_data
.stk_packing_required
= cmd_qual_flag
;
1111 cmd_qual
= cmd_qual_flag
;
1114 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_cmd_qual_loci
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
, &cmd_qual
);
1117 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_cmd_qual_timer_mgmt
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
, &cmd_qual
);
1120 proto_tree_add_item_ret_boolean(elem_tree
, hf_ctlv_cmd_qual_send_data
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
, &cmd_qual_flag
);
1121 cmd_qual
= cmd_qual_flag
;
1124 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_cmd_qual
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
, &cmd_qual
);
1128 uint32_t id
= (cmd_nr
<< 16) | (g8
<< 8) | cmd_qual
;
1132 key
[1].key
= &pinfo
->num
;
1136 if (GPOINTER_TO_INT(data
) == 0xd0 && !PINFO_FD_VISITED(pinfo
)) {
1137 /* Proactive command */
1138 cat_trans
= wmem_new(wmem_file_scope(), cat_transaction_t
);
1139 cat_trans
->req_frame
= pinfo
->num
;
1141 cat_trans
->nmr_type
= ((id
& 0x00ffff) == 0x2602) ? CAT_NMR_GERAN
: CAT_NMR_NONE
;
1142 wmem_tree_insert32_array(cat_info
->pdus
, key
, (void*)cat_trans
);
1143 } else if (GPOINTER_TO_INT(data
) == 0x14) {
1144 /* Terminal response */
1145 cat_trans
= (cat_transaction_t
*)wmem_tree_lookup32_array_le(cat_info
->pdus
, key
);
1146 if (cat_trans
&& cat_trans
->id
!= id
)
1151 case 0x02: /* device identity */
1154 proto_tree_add_item(elem_tree
, hf_ctlv_devid_src
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1155 proto_tree_add_item(elem_tree
, hf_ctlv_devid_dst
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1157 case 0x03: /* Result */
1158 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_result_gen
, tvb
, pos
, 1, ENC_BIG_ENDIAN
, &g8
);
1161 proto_tree_add_item(elem_tree
, hf_ctlv_result_term
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1164 proto_tree_add_item(elem_tree
, hf_ctlv_result_launch_browser
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1167 proto_tree_add_item(elem_tree
, hf_ctlv_result_multiplecard
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1170 proto_tree_add_item(elem_tree
, hf_ctlv_result_cc_ctrl_mo_sm_ctrl
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1173 proto_tree_add_item(elem_tree
, hf_ctlv_result_bip
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1176 proto_tree_add_item(elem_tree
, hf_ctlv_result_frames_cmd
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1182 case 0x04: /* Duration */
1185 proto_tree_add_item(elem_tree
, hf_ctlv_dur_time_unit
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1186 proto_tree_add_item(elem_tree
, hf_ctlv_dur_time_intv
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1188 case 0x05: /* alpha identifier */
1189 dissect_cat_efadn_coding(tvb
, elem_tree
, pos
, len
, hf_ctlv_alpha_id_string
);
1191 case 0x06: /* address */
1192 proto_tree_add_item(elem_tree
, hf_ctlv_address_ton
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1193 proto_tree_add_item(elem_tree
, hf_ctlv_address_npi
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1194 dissect_cat_efadn_coding(tvb
, elem_tree
, pos
+1, len
-1, hf_ctlv_address_string
);
1196 case 0x08: /* subaddress */
1197 dissect_cat_efadn_coding(tvb
, elem_tree
, pos
, len
, hf_ctlv_subaddress_string
);
1199 case 0x0b: /* sms tpdu */
1200 new_tvb
= tvb_new_subset_length(tvb
, pos
, len
);
1202 int p2p_dir_save
= pinfo
->p2p_dir
;
1204 if (GPOINTER_TO_INT(data
) == 0xd0) {
1205 /* Proactive command */
1206 pinfo
->p2p_dir
= P2P_DIR_RECV
;
1208 pinfo
->p2p_dir
= P2P_DIR_SENT
;
1211 call_dissector_only(gsm_sms_handle
, new_tvb
, pinfo
, elem_tree
, &sms_data
);
1212 pinfo
->p2p_dir
= p2p_dir_save
;
1215 case 0x0d: /* text string */
1218 /* 1st byte: encoding */
1219 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_text_string_enc
, tvb
, pos
, 1, ENC_BIG_ENDIAN
, &g8
);
1220 switch (g8
& 0xf0) {
1231 case 0x00: /* 7bit */
1232 proto_tree_add_item(elem_tree
, hf_ctlv_text_string
, tvb
, pos
+1, len
-1, ENC_3GPP_TS_23_038_7BITS
|ENC_NA
);
1234 case 0x04: /* 8bit */
1235 /* XXX - ASCII, or some extended ASCII? */
1236 proto_tree_add_item(elem_tree
, hf_ctlv_text_string
, tvb
, pos
+1, len
-1, ENC_ASCII
);
1238 case 0x08: /* UCS2 */
1239 proto_tree_add_item(elem_tree
, hf_ctlv_text_string
, tvb
, pos
+1, len
-1, ENC_UCS_2
|ENC_BIG_ENDIAN
);
1245 case 0x0e: /* tone */
1248 proto_tree_add_item(elem_tree
, hf_ctlv_tone
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1250 case 0x0f: /* item */
1252 proto_tree_add_item(elem_tree
, hf_ctlv_item_id
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1253 dissect_cat_efadn_coding(tvb
, elem_tree
, pos
+1, len
-1, hf_ctlv_item_string
);
1256 case 0x13: /* location information */
1259 /* MCC/MNC / LAC / CellID */
1260 dissect_e212_mcc_mnc(tvb
, pinfo
, elem_tree
, pos
, E212_NONE
, true);
1261 proto_tree_add_item(elem_tree
, hf_ctlv_loci_lac
, tvb
, pos
+3, 2, ENC_BIG_ENDIAN
);
1264 proto_tree_add_item(elem_tree
, hf_ctlv_loci_cell_id
, tvb
, pos
+5, 2, ENC_BIG_ENDIAN
);
1267 proto_tree_add_item(elem_tree
, hf_ctlv_loci_ext_cell_id
, tvb
, pos
+7, 2, ENC_BIG_ENDIAN
);
1269 case 0x14: /* IMEI */
1270 case 0x62: /* IMEISV */
1271 de_mid(tvb
, elem_tree
, pinfo
, pos
, len
, NULL
, 0);
1274 if (cat_trans
&& ((cat_trans
->id
& 0x00ffff) == 0x2602)) {
1275 switch (cat_trans
->nmr_type
) {
1277 de_rr_meas_res(tvb
, elem_tree
, pinfo
, pos
, len
, NULL
, 0);
1280 new_tvb
= tvb_new_subset_length(tvb
, pos
, len
);
1281 dissect_rrc_MeasurementReport_PDU(new_tvb
, pinfo
, elem_tree
, NULL
);
1283 case CAT_NMR_E_UTRAN
:
1284 new_tvb
= tvb_new_subset_length(tvb
, pos
, len
);
1285 dissect_lte_rrc_MeasurementReport_PDU(new_tvb
, pinfo
, elem_tree
, NULL
);
1292 case 0x19: /* event list */
1293 for (i
= 0; i
< len
; i
++) {
1294 uint8_t event
= tvb_get_uint8(tvb
, pos
+i
);
1295 if ((event
== 0x17) || (event
== 0x18)) {
1298 proto_tree_add_uint(elem_tree
, hf_ctlv_event
, tvb
, pos
+i
, 1, event
);
1299 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s ",
1300 val_to_str_ext(event
, &event_list_vals_ext
, "%02x "));
1303 case 0x1b: /* location status */
1304 for (i
= 0; i
< len
; i
++)
1305 proto_tree_add_item(elem_tree
, hf_ctlv_loc_status
, tvb
, pos
+i
, 1, ENC_BIG_ENDIAN
);
1307 case 0x25: /* timer value */
1310 oct
= tvb_get_uint8(tvb
, pos
);
1311 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_timer_val_hr
, tvb
, pos
, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1312 oct
= tvb_get_uint8(tvb
, pos
+1);
1313 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_timer_val_min
, tvb
, pos
+1, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1314 oct
= tvb_get_uint8(tvb
, pos
+2);
1315 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_timer_val_sec
, tvb
, pos
+2, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1318 case 0x26: /* date-time and time zone */
1321 oct
= tvb_get_uint8(tvb
, pos
);
1322 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_date_time_yr
, tvb
, pos
, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1323 oct
= tvb_get_uint8(tvb
, pos
+1);
1324 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_date_time_mo
, tvb
, pos
+1, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1325 oct
= tvb_get_uint8(tvb
, pos
+2);
1326 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_date_time_day
, tvb
, pos
+2, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1327 oct
= tvb_get_uint8(tvb
, pos
+3);
1328 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_date_time_hr
, tvb
, pos
+3, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1329 oct
= tvb_get_uint8(tvb
, pos
+4);
1330 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_date_time_min
, tvb
, pos
+4, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1331 oct
= tvb_get_uint8(tvb
, pos
+5);
1332 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_date_time_sec
, tvb
, pos
+5, 1, oct
, "%u (0x%02x)", 10*(oct
&0x0f)+(oct
>>4), oct
);
1333 oct
= tvb_get_uint8(tvb
, pos
+6);
1335 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_date_time_tz
, tvb
, pos
+6, 1, oct
, "Unknown (0x%02x)", oct
);
1337 tz
= (oct
>> 4) + (oct
& 0x07) * 10;
1338 proto_tree_add_uint_format_value(elem_tree
, hf_ctlv_date_time_tz
, tvb
, pos
+6, 1, oct
, "GMT %c %d hr %d min (0x%02x)",
1339 (oct
& 0x08)?'-':'+', tz
/4, (tz
%4)*15, oct
);
1343 case 0x28: /* AT Command */
1344 proto_tree_add_item(elem_tree
, hf_ctlv_at_cmd
, tvb
, pos
, len
, ENC_ASCII
);
1346 case 0x29: /* AT Response */
1347 proto_tree_add_item(elem_tree
, hf_ctlv_at_rsp
, tvb
, pos
, len
, ENC_ASCII
);
1349 case 0x2c: /* DTMF string */
1350 dissect_cat_efadn_coding(tvb
, elem_tree
, pos
, len
, hf_ctlv_dtmf_string
);
1352 case 0x2d: /* language */
1353 proto_tree_add_item(elem_tree
, hf_ctlv_language
, tvb
, pos
, len
, ENC_ASCII
);
1355 case 0x2e: /* Timing Advance */
1356 proto_tree_add_item(elem_tree
, hf_ctlv_me_status
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1357 proto_tree_add_item(elem_tree
, hf_ctlv_timing_adv
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1359 case 0x2f: /* AID */
1361 uint64_t rid
= tvb_get_ntoh40(tvb
, pos
);
1363 proto_tree_add_uint64(elem_tree
, hf_ctlv_aid_rid
, tvb
, pos
, 5, rid
);
1364 if (rid
== AID_RID_ETSI
) {
1365 proto_tree_add_item(elem_tree
, hf_ctlv_aid_pix_app_code_etsi
, tvb
, pos
+5, 2, ENC_BIG_ENDIAN
);
1366 } else if (rid
== AID_RID_3GPP
) {
1367 proto_tree_add_item(elem_tree
, hf_ctlv_aid_pix_app_code_3gpp
, tvb
, pos
+5, 2, ENC_BIG_ENDIAN
);
1368 } else if (rid
== AID_RID_3GPP2
) {
1369 proto_tree_add_item(elem_tree
, hf_ctlv_aid_pix_app_code_3gpp2
, tvb
, pos
+5, 2, ENC_BIG_ENDIAN
);
1371 proto_tree_add_item(elem_tree
, hf_ctlv_aid_pix_app_code
, tvb
, pos
+5, 2, ENC_BIG_ENDIAN
);
1373 proto_tree_add_item(elem_tree
, hf_ctlv_aid_pix_country_code
, tvb
, pos
+7, 2, ENC_BIG_ENDIAN
);
1374 proto_tree_add_item(elem_tree
, hf_ctlv_aid_pix_app_prov_code
, tvb
, pos
+9, 3, ENC_BIG_ENDIAN
);
1376 proto_tree_add_item(elem_tree
, hf_ctlv_aid_pix_app_prov_field
, tvb
, pos
+12, len
-12, ENC_NA
);
1380 case 0x32: /* bearer */
1381 for (i
= 0; i
< len
; i
++)
1382 proto_tree_add_item(elem_tree
, hf_ctlv_bearer
, tvb
, pos
+i
, 1, ENC_BIG_ENDIAN
);
1384 case 0x35: /* bearer description */
1385 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_bearer_descr
, tvb
, pos
, 1, ENC_BIG_ENDIAN
, &g8
);
1388 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_csd_data_rate
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1389 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_csd_bearer_serv
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
);
1390 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_csd_conn_elem
, tvb
, pos
+3, 1, ENC_BIG_ENDIAN
);
1393 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_gprs_precedence
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1394 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_gprs_delay
, tvb
, pos
+2, 1, ENC_BIG_ENDIAN
);
1395 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_gprs_reliability
, tvb
, pos
+3, 1, ENC_BIG_ENDIAN
);
1396 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_gprs_peak
, tvb
, pos
+4, 1, ENC_BIG_ENDIAN
);
1397 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_gprs_mean
, tvb
, pos
+5, 1, ENC_BIG_ENDIAN
);
1398 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_gprs_prot_type
, tvb
, pos
+6, 1, ENC_BIG_ENDIAN
);
1401 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_traffic_class
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1402 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_max_bitrate_ul
, tvb
, pos
+2, 2, ENC_BIG_ENDIAN
);
1403 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_max_bitrate_dl
, tvb
, pos
+4, 2, ENC_BIG_ENDIAN
);
1404 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_guaranteed_bitrate_ul
, tvb
, pos
+6, 2, ENC_BIG_ENDIAN
);
1405 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_guaranteed_bitrate_dl
, tvb
, pos
+8, 2, ENC_BIG_ENDIAN
);
1406 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_delivery_order
, tvb
, pos
+10, 1, ENC_BIG_ENDIAN
);
1407 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_max_sdu_size
, tvb
, pos
+11, 1, ENC_BIG_ENDIAN
);
1408 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_sdu_error_ratio
, tvb
, pos
+12, 1, ENC_BIG_ENDIAN
);
1409 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_residual_bit_error_ratio
, tvb
, pos
+13, 1, ENC_BIG_ENDIAN
);
1410 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_delivery_erroneous_sdus
, tvb
, pos
+14, 1, ENC_BIG_ENDIAN
);
1411 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_transfer_delay
, tvb
, pos
+15, 1, ENC_BIG_ENDIAN
);
1412 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_traffic_handling_prio
, tvb
, pos
+16, 1, ENC_BIG_ENDIAN
);
1413 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_pdp_type
, tvb
, pos
+1, 1, ENC_BIG_ENDIAN
);
1418 de_esm_qos(tvb
, elem_tree
, pinfo
, pos
+1, len
-2, NULL
, 0);
1419 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_utran_pdp_type
, tvb
, pos
+len
-1, 1, ENC_BIG_ENDIAN
);
1423 proto_tree_add_item(elem_tree
, hf_ctlv_bearer_params
, tvb
, pos
+1, len
-1, ENC_NA
);
1428 case 0x39: /* buffer size */
1429 proto_tree_add_item(elem_tree
, hf_ctlv_buffers_size
, tvb
, pos
, 2, ENC_BIG_ENDIAN
);
1431 case 0x3c: /* UICC/terminal interface transport level */
1434 proto_tree_add_item(elem_tree
, hf_ctlv_transport_ptype
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1435 proto_tree_add_item(elem_tree
, hf_ctlv_transport_port
, tvb
, pos
+1, 2, ENC_BIG_ENDIAN
);
1437 case 0x3e: /* other address */
1438 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_other_address_coding
, tvb
, pos
, 1, ENC_BIG_ENDIAN
, &g8
);
1441 proto_tree_add_item(elem_tree
, hf_ctlv_other_address_ipv4
, tvb
, pos
+1, 4, ENC_NA
);
1444 proto_tree_add_item(elem_tree
, hf_ctlv_other_address_ipv6
, tvb
, pos
+1, 16, ENC_NA
);
1450 case 0x3f: /* access technology */
1451 for (i
= 0; i
< len
; i
++)
1452 proto_tree_add_item(elem_tree
, hf_ctlv_access_tech
, tvb
, pos
+i
, 1, ENC_BIG_ENDIAN
);
1454 case 0x40: /* Display parameters / DNS server address */
1456 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_dns_server_address_coding
, tvb
, pos
, 1, ENC_BIG_ENDIAN
, &g8
);
1459 proto_tree_add_item(elem_tree
, hf_ctlv_dns_server_address_ipv4
, tvb
, pos
+1, 4, ENC_NA
);
1462 proto_tree_add_item(elem_tree
, hf_ctlv_dns_server_address_ipv6
, tvb
, pos
+1, 16, ENC_NA
);
1469 case 0x47: /* network access name */
1470 de_sm_apn(tvb
, elem_tree
, pinfo
, pos
, len
, NULL
, 0);
1472 case 0x69: /* UTRAN EUTRAN measurement qualifier */
1473 proto_tree_add_item_ret_uint(elem_tree
, hf_ctlv_utran_eutran_meas_qual
, tvb
, pos
, 1, ENC_BIG_ENDIAN
, &g8
);
1474 if (cat_trans
&& ((cat_trans
->id
& 0x00ffff) == 0x2602)) {
1475 if (g8
>= 1 && g8
<= 4)
1476 cat_trans
->nmr_type
= CAT_NMR_UTRAN
;
1477 else if (g8
>= 5 && g8
<= 9)
1478 cat_trans
->nmr_type
= CAT_NMR_E_UTRAN
;
1480 cat_trans
->nmr_type
= CAT_NMR_NONE
;
1483 case 0x73: /* Routing Area Information */
1484 de_gmm_rai(tvb
, elem_tree
, pinfo
, pos
, len
, NULL
, 0);
1486 case 0x74: /* Update/Attach/Registration Type */
1487 proto_tree_add_item(elem_tree
, hf_ctlv_upd_attach_type
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1489 case 0x76: /* Geographical Location Parameters / IARI */
1491 proto_tree_add_item(elem_tree
, hf_ctlv_iari
, tvb
, pos
, len
, ENC_UTF_8
| ENC_NA
);
1494 case 0x77: /* GAD Shapes / IMPU list */
1498 if (tvb_get_uint8(tvb
, pos
+i
) == 0x80) {
1499 g8
= tvb_get_uint8(tvb
, pos
+i
+1);
1500 proto_tree_add_item(elem_tree
, hf_ctlv_impu
, tvb
, pos
+i
+2, g8
, ENC_UTF_8
| ENC_NA
);
1508 case 0x78: /* NMEA sentence / IMS Status-Code */
1510 uint8_t *status_code
= tvb_get_string_enc(pinfo
->pool
, tvb
, pos
, len
, ENC_ASCII
);
1511 proto_tree_add_string_format_value(elem_tree
, hf_ctlv_ims_status_code
, tvb
, pos
, len
,
1512 status_code
, "%s (%s)", status_code
, str_to_str(status_code
, ims_status_code
, "Unknown"));
1515 case 0x79: /* PLMN list */
1516 for (i
= 0; i
< len
; i
+=3) {
1517 dissect_e212_mcc_mnc(tvb
, pinfo
, elem_tree
, pos
+3*i
, E212_NONE
, true);
1520 case 0x7a:/* Broadcast Network Information */
1521 proto_tree_add_item(elem_tree
, hf_ctlv_broadcast_nw_tech
, tvb
, pos
, 1, ENC_BIG_ENDIAN
);
1522 proto_tree_add_item(elem_tree
, hf_ctlv_broadcast_nw_loc_info
, tvb
, pos
+1, len
-1, ENC_NA
);
1524 case 0x7c: /* EPS PDN connection activation parameters */
1525 nas_esm_pdn_con_req(tvb
, elem_tree
, pinfo
, pos
, len
);
1527 case 0x7d: /* Tracking Area Identification */
1528 de_emm_trac_area_id(tvb
, elem_tree
, pinfo
, pos
, 5, NULL
, 0);
1539 proto_register_card_app_toolkit(void)
1541 static hf_register_info hf
[] = {
1543 { "COMPREHENSIVE-TLV", "etsi_cat.comp_tlv",
1544 FT_BYTES
, BASE_NONE
, NULL
, 0,
1547 { &hf_ctlv_devid_src
,
1548 { "Source Device ID", "etsi_cat.comp_tlv.src_dev",
1549 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &dev_id_vals_ext
, 0,
1552 { &hf_ctlv_devid_dst
,
1553 { "Destination Device ID", "etsi_cat.comp_tlv.dst_dev",
1554 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &dev_id_vals_ext
, 0,
1558 { "Command Number", "etsi_cat.comp_tlv.cmd_nr",
1559 FT_UINT8
, BASE_HEX
, NULL
, 0,
1562 { &hf_ctlv_cmd_type
,
1563 { "Command Type", "etsi_cat.comp_tlv.cmd_type",
1564 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &cmd_type_vals_ext
, 0,
1567 { &hf_ctlv_cmd_qual_refresh
,
1568 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.refresh",
1569 FT_UINT8
, BASE_HEX
, VALS(cmd_qual_refresh_vals
), 0,
1572 { &hf_ctlv_cmd_qual_send_short_msg
,
1573 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.send_short_msg",
1574 FT_BOOLEAN
, 8, TFS(&cmd_qual_send_short_msg_value
), 0x01,
1577 { &hf_ctlv_cmd_qual_loci
,
1578 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.loci",
1579 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &cmd_qual_loci_vals_ext
, 0,
1582 { &hf_ctlv_cmd_qual_timer_mgmt
,
1583 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.timer_mgmt",
1584 FT_UINT8
, BASE_HEX
, VALS(cmd_qual_timer_mgmt_vals
), 0x03,
1587 { &hf_ctlv_cmd_qual_send_data
,
1588 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.send_data",
1589 FT_BOOLEAN
, 8, TFS(&cmd_qual_send_data_value
), 0x01,
1592 { &hf_ctlv_cmd_qual
,
1593 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual",
1594 FT_UINT8
, BASE_HEX
, NULL
, 0,
1597 { &hf_ctlv_dur_time_unit
,
1598 { "Time Unit", "etsi_cat.comp_tlv.time_unit",
1599 FT_UINT8
, BASE_HEX
, VALS(time_unit_vals
), 0,
1602 { &hf_ctlv_dur_time_intv
,
1603 { "Time Interval", "etsi_cat.comp_tlv.time_interval",
1604 FT_UINT8
, BASE_DEC
, NULL
, 0,
1607 { &hf_ctlv_alpha_id_string
,
1608 { "Alpha Identifier String", "etsi_cat.comp_tlv.alpha_id.string",
1609 FT_STRING
, BASE_NONE
, NULL
, 0,
1612 { &hf_ctlv_address_ton
,
1613 { "TON", "etsi_cat.comp_tlv.address.ton",
1614 FT_UINT8
, BASE_HEX
, VALS(ton_vals
), 0x70,
1617 { &hf_ctlv_address_npi
,
1618 { "NPI", "etsi_cat.comp_tlv.address.npi",
1619 FT_UINT8
, BASE_HEX
, VALS(npi_vals
), 0x0f,
1622 { &hf_ctlv_address_string
,
1623 { "Address String", "etsi_cat.comp_tlv.address.string",
1624 FT_STRING
, BASE_NONE
, NULL
, 0,
1627 { &hf_ctlv_subaddress_string
,
1628 { "Subaddress String", "etsi_cat.comp_tlv.subaddress.string",
1629 FT_STRING
, BASE_NONE
, NULL
, 0,
1632 { &hf_ctlv_result_gen
,
1633 { "Result", "etsi_cat.comp_tlv.result",
1634 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &result_vals_ext
, 0,
1637 { &hf_ctlv_result_term
,
1638 { "Additional information", "etsi_cat.comp_tlv.result.term",
1639 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &result_term_vals_ext
, 0,
1642 { &hf_ctlv_result_launch_browser
,
1643 { "Additional information", "etsi_cat.comp_tlv.result.launch_browser",
1644 FT_UINT8
, BASE_HEX
, VALS(result_launch_browser_vals
), 0,
1647 { &hf_ctlv_result_multiplecard
,
1648 { "Additional information", "etsi_cat.comp_tlv.result.multiplecard",
1649 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &result_multiplecard_vals_ext
, 0,
1652 { &hf_ctlv_result_cc_ctrl_mo_sm_ctrl
,
1653 { "Additional information", "etsi_cat.comp_tlv.result.cc_ctrl_mo_sm_ctrl",
1654 FT_UINT8
, BASE_HEX
, VALS(result_cc_ctrl_mo_sm_ctrl_vals
), 0,
1657 { &hf_ctlv_result_bip
,
1658 { "Additional information", "etsi_cat.comp_tlv.result.bip",
1659 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &result_bip_vals_ext
, 0,
1662 { &hf_ctlv_result_frames_cmd
,
1663 { "Additional information", "etsi_cat.comp_tlv.result.frames_cmd",
1664 FT_UINT8
, BASE_HEX
, VALS(result_frames_cmd_vals
), 0,
1667 { &hf_ctlv_text_string_enc
,
1668 { "Text String Encoding", "etsi_cat.comp_tlv.text_encoding",
1669 FT_UINT8
, BASE_HEX
|BASE_RANGE_STRING
, RVALS(text_encoding_vals
), 0,
1672 { &hf_ctlv_text_string
,
1673 { "Text String", "etsi_cat.comp_tlv.text",
1674 FT_STRING
, BASE_NONE
, NULL
, 0,
1678 { "Event", "etsi_cat.comp_tlv.event",
1679 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &event_list_vals_ext
, 0,
1683 { "Tone", "etsi_cat.comp_tlv.tone",
1684 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &tone_vals_ext
, 0,
1688 { "Item Identifier", "etsi_cat.comp_tlv.item.id",
1689 FT_UINT8
, BASE_DEC
, NULL
, 0,
1692 { &hf_ctlv_item_string
,
1693 { "Item String", "etsi_cat.comp_tlv.item.string",
1694 FT_STRING
, BASE_NONE
, NULL
, 0,
1697 { &hf_ctlv_loc_status
,
1698 { "Location Status", "etsi_cat.comp_tlv.loc_status",
1699 FT_UINT8
, BASE_HEX
, VALS(loc_status_vals
), 0,
1702 { &hf_ctlv_timer_val_hr
,
1703 { "Hours", "etsi_cat.comp_tlv.timer_val.hr",
1704 FT_UINT8
, BASE_HEX
, NULL
, 0,
1707 { &hf_ctlv_timer_val_min
,
1708 { "Minutes", "etsi_cat.comp_tlv.timer_val.min",
1709 FT_UINT8
, BASE_HEX
, NULL
, 0,
1712 { &hf_ctlv_timer_val_sec
,
1713 { "Seconds", "etsi_cat.comp_tlv.timer_val.sec",
1714 FT_UINT8
, BASE_HEX
, NULL
, 0,
1717 { &hf_ctlv_date_time_yr
,
1718 { "Year", "etsi_cat.comp_tlv.date_time.yr",
1719 FT_UINT8
, BASE_HEX
, NULL
, 0,
1722 { &hf_ctlv_date_time_mo
,
1723 { "Month", "etsi_cat.comp_tlv.date_time.mo",
1724 FT_UINT8
, BASE_HEX
, NULL
, 0,
1727 { &hf_ctlv_date_time_day
,
1728 { "Day", "etsi_cat.comp_tlv.date_time.day",
1729 FT_UINT8
, BASE_HEX
, NULL
, 0,
1732 { &hf_ctlv_date_time_hr
,
1733 { "Hours", "etsi_cat.comp_tlv.date_time.hr",
1734 FT_UINT8
, BASE_HEX
, NULL
, 0,
1737 { &hf_ctlv_date_time_min
,
1738 { "Minutes", "etsi_cat.comp_tlv.date_time.min",
1739 FT_UINT8
, BASE_HEX
, NULL
, 0,
1742 { &hf_ctlv_date_time_sec
,
1743 { "Seconds", "etsi_cat.comp_tlv.date_time.sec",
1744 FT_UINT8
, BASE_HEX
, NULL
, 0,
1747 { &hf_ctlv_date_time_tz
,
1748 { "Time Zone", "etsi_cat.comp_tlv.date_time.tz",
1749 FT_UINT8
, BASE_HEX
, NULL
, 0,
1753 { "AT Command", "etsi_cat.comp_tlv.at_cmd",
1754 FT_STRING
, BASE_NONE
, NULL
, 0,
1758 { "AT Response", "etsi_cat.comp_tlv.at_rsp",
1759 FT_STRING
, BASE_NONE
, NULL
, 0,
1762 { &hf_ctlv_dtmf_string
,
1763 { "DMTF String", "etsi_cat.comp_tlv.dtmf.string",
1764 FT_STRING
, BASE_NONE
, NULL
, 0,
1767 { &hf_ctlv_language
,
1768 { "Language", "etsi_cat.comp_tlv.language",
1769 FT_STRING
, BASE_NONE
, NULL
, 0,
1772 { &hf_ctlv_me_status
,
1773 { "ME Status", "etsi_cat.comp_tlv.me_status",
1774 FT_UINT8
, BASE_DEC
, VALS(me_status_vals
), 0,
1777 { &hf_ctlv_timing_adv
,
1778 { "Timing Advance", "etsi_cat.comp_tlv.timing_adv",
1779 FT_UINT8
, BASE_DEC
, NULL
, 0,
1783 { "RID", "etsi_cat.comp_tlv.aid.rid",
1784 FT_UINT64
, BASE_HEX
|BASE_VAL64_STRING
, VALS64(aid_rid_vals
), 0,
1787 { &hf_ctlv_aid_pix_app_code_etsi
,
1788 { "PIX Application Code", "etsi_cat.comp_tlv.aid.pix.app_code",
1789 FT_UINT16
, BASE_HEX
, VALS(aid_pix_app_code_etsi_vals
), 0,
1792 { &hf_ctlv_aid_pix_app_code_3gpp
,
1793 { "PIX Application Code", "etsi_cat.comp_tlv.aid.pix.app_code",
1794 FT_UINT16
, BASE_HEX
, VALS(aid_pix_app_code_3gpp_vals
), 0,
1797 { &hf_ctlv_aid_pix_app_code_3gpp2
,
1798 { "PIX Application Code", "etsi_cat.comp_tlv.aid.pix.app_code",
1799 FT_UINT16
, BASE_HEX
, VALS(aid_pix_app_code_3gpp2_vals
), 0,
1802 { &hf_ctlv_aid_pix_app_code
,
1803 { "PIX Application Code", "etsi_cat.comp_tlv.aid.pix.app_code",
1804 FT_UINT16
, BASE_HEX
, NULL
, 0,
1807 { &hf_ctlv_aid_pix_country_code
,
1808 { "PIX Country Code", "etsi_cat.comp_tlv.aid.pix.country_code",
1809 FT_UINT16
, BASE_HEX
, NULL
, 0,
1812 { &hf_ctlv_aid_pix_app_prov_code
,
1813 { "PIX Application Provider Code", "etsi_cat.comp_tlv.aid.pix.app_prov_code",
1814 FT_UINT24
, BASE_HEX
, NULL
, 0,
1817 { &hf_ctlv_aid_pix_app_prov_field
,
1818 { "PIX Application Provider Field", "etsi_cat.comp_tlv.aid.pix.app_prov_field",
1819 FT_BYTES
, BASE_NONE
, NULL
, 0,
1823 { "Bearer", "etsi_cat.comp_tlv.bearer",
1824 FT_UINT8
, BASE_HEX
, VALS(bearer_vals
), 0,
1827 { &hf_ctlv_bearer_descr
,
1828 { "Bearer Description", "etsi_cat.comp_tlv.bearer.descr",
1829 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &bearer_descr_vals_ext
, 0,
1832 { &hf_ctlv_bearer_csd_data_rate
,
1833 { "Data Rate", "etsi_cat.comp_tlv.bearer.csd.data_rate",
1834 FT_UINT8
, BASE_DEC
| BASE_EXT_STRING
, &csd_data_rate_vals_ext
, 0,
1837 { &hf_ctlv_bearer_csd_bearer_serv
,
1838 { "Bearer Service", "etsi_cat.comp_tlv.bearer.csd.bearer_serv",
1839 FT_UINT8
, BASE_DEC
, VALS(csd_bearer_serv_vals
), 0,
1842 { &hf_ctlv_bearer_csd_conn_elem
,
1843 { "Connection Element", "etsi_cat.comp_tlv.bearer.csd.conn_elem",
1844 FT_UINT8
, BASE_DEC
, VALS(csd_conn_elem_vals
), 0,
1847 { &hf_ctlv_bearer_gprs_precedence
,
1848 { "Precedence Class", "etsi_cat.comp_tlv.bearer.gprs.precedence",
1849 FT_UINT8
, BASE_DEC
, NULL
, 0,
1852 { &hf_ctlv_bearer_gprs_delay
,
1853 { "Delay Class", "etsi_cat.comp_tlv.bearer.gprs.delay",
1854 FT_UINT8
, BASE_DEC
, NULL
, 0,
1857 { &hf_ctlv_bearer_gprs_reliability
,
1858 { "Reliability Class", "etsi_cat.comp_tlv.bearer.gprs.reliability",
1859 FT_UINT8
, BASE_DEC
, NULL
, 0,
1862 { &hf_ctlv_bearer_gprs_peak
,
1863 { "Peak Throughput Class", "etsi_cat.comp_tlv.bearer.gprs.peak",
1864 FT_UINT8
, BASE_DEC
, NULL
, 0,
1867 { &hf_ctlv_bearer_gprs_mean
,
1868 { "Mean Throughput Class", "etsi_cat.comp_tlv.bearer.gprs.mean",
1869 FT_UINT8
, BASE_DEC
, NULL
, 0,
1872 { &hf_ctlv_bearer_gprs_prot_type
,
1873 { "Packet Data Protocol Type", "etsi_cat.comp_tlv.bearer.gprs.prot_type",
1874 FT_UINT8
, BASE_DEC
, VALS(gprs_prot_type_vals
), 0,
1877 { &hf_ctlv_bearer_utran_traffic_class
,
1878 { "Traffic Class", "etsi_cat.comp_tlv.bearer.utran.traffic_class",
1879 FT_UINT8
, BASE_DEC
, VALS(utran_traffic_class_vals
), 0,
1882 { &hf_ctlv_bearer_utran_max_bitrate_ul
,
1883 { "Maximum Bitrate UL", "etsi_cat.comp_tlv.bearer.utran.max_bitrate_ul",
1884 FT_UINT16
, BASE_DEC
, NULL
, 0,
1887 { &hf_ctlv_bearer_utran_max_bitrate_dl
,
1888 { "Maximum Bitrate DL", "etsi_cat.comp_tlv.bearer.utran.max_bitrate_dl",
1889 FT_UINT16
, BASE_DEC
, NULL
, 0,
1892 { &hf_ctlv_bearer_utran_guaranteed_bitrate_ul
,
1893 { "Guaranteed Bitrate DL", "etsi_cat.comp_tlv.bearer.utran.guaranteed_bitrate_ul",
1894 FT_UINT16
, BASE_DEC
, NULL
, 0,
1897 { &hf_ctlv_bearer_utran_guaranteed_bitrate_dl
,
1898 { "Guaranteed Bitrate DL", "etsi_cat.comp_tlv.bearer.utran.guaranteed_bitrate_dl",
1899 FT_UINT16
, BASE_DEC
, NULL
, 0,
1902 { &hf_ctlv_bearer_utran_delivery_order
,
1903 { "Delivery Order", "etsi_cat.comp_tlv.bearer.utran.delivery_order",
1904 FT_UINT8
, BASE_DEC
, VALS(utran_delivery_order_vals
), 0,
1907 { &hf_ctlv_bearer_utran_max_sdu_size
,
1908 { "Maximum SDU Size", "etsi_cat.comp_tlv.bearer.utran.max_sdu_size",
1909 FT_UINT8
, BASE_DEC
, NULL
, 0,
1912 { &hf_ctlv_bearer_utran_sdu_error_ratio
,
1913 { "SDU Error Ratio", "etsi_cat.comp_tlv.bearer.utran.sdu_error_ratio",
1914 FT_UINT8
, BASE_DEC
, NULL
, 0,
1917 { &hf_ctlv_bearer_utran_residual_bit_error_ratio
,
1918 { "Residual Bit Error Ratio", "etsi_cat.comp_tlv.bearer.utran.residual_bit_error_ratio",
1919 FT_UINT8
, BASE_DEC
, NULL
, 0,
1922 { &hf_ctlv_bearer_utran_delivery_erroneous_sdus
,
1923 { "Delivery of Erroneous SDUs", "etsi_cat.comp_tlv.bearer.utran.delivery_erroneous_sdus",
1924 FT_UINT8
, BASE_DEC
, VALS(utran_delivery_erroneous_sdus_vals
), 0,
1927 { &hf_ctlv_bearer_utran_transfer_delay
,
1928 { "Transfer Delay", "etsi_cat.comp_tlv.bearer.utran.transfer_delay",
1929 FT_UINT8
, BASE_DEC
, NULL
, 0,
1932 { &hf_ctlv_bearer_utran_traffic_handling_prio
,
1933 { "Traffic Handling Priority", "etsi_cat.comp_tlv.bearer.utran.traffic_handling_prio",
1934 FT_UINT8
, BASE_DEC
, NULL
, 0,
1937 { &hf_ctlv_bearer_utran_pdp_type
,
1938 { "PDP Type", "etsi_cat.comp_tlv.bearer.utran.pdp_type",
1939 FT_UINT8
, BASE_DEC
, VALS(pdp_type_vals
), 0,
1942 { &hf_ctlv_bearer_params
,
1943 { "Bearer Parameters", "etsi_cat.comp_tlv.bearer.params",
1944 FT_BYTES
, BASE_NONE
, NULL
, 0,
1947 { &hf_ctlv_buffers_size
,
1948 { "Buffer Size", "etsi_cat.comp_tlv.buffer_size",
1949 FT_UINT16
, BASE_DEC
, NULL
, 0,
1952 { &hf_ctlv_transport_ptype
,
1953 { "Transport protocol type", "etsi_cat.comp_tlv.transport.ptype",
1954 FT_UINT8
, BASE_HEX
, VALS(transport_ptype_vals
), 0,
1957 { &hf_ctlv_transport_port
,
1958 { "Transport port", "etsi_cat.comp_tlv.transport.port",
1959 FT_UINT16
, BASE_DEC
, NULL
, 0,
1962 { &hf_ctlv_other_address_coding
,
1963 { "Coding of Type of address", "etsi_cat.comp_tlv.other_address.coding",
1964 FT_UINT8
, BASE_HEX
, VALS(other_address_coding_vals
), 0,
1967 { &hf_ctlv_other_address_ipv4
,
1968 { "IPv4 address", "etsi_cat.comp_tlv.other_address.ipv4",
1969 FT_IPv4
, BASE_NONE
, NULL
, 0,
1972 { &hf_ctlv_other_address_ipv6
,
1973 { "IPv6 address", "etsi_cat.comp_tlv.other_address.ipv6",
1974 FT_IPv6
, BASE_NONE
, NULL
, 0,
1977 { &hf_ctlv_access_tech
,
1978 { "Access technology", "etsi_cat.comp_tlv.access_tech",
1979 FT_UINT8
, BASE_HEX
, VALS(access_tech_vals
), 0,
1982 { &hf_ctlv_dns_server_address_coding
,
1983 { "Type of address", "etsi_cat.comp_tlv.dns_server_address.coding",
1984 FT_UINT8
, BASE_HEX
, VALS(other_address_coding_vals
), 0,
1987 { &hf_ctlv_dns_server_address_ipv4
,
1988 { "IPv4 address", "etsi_cat.comp_tlv.dns_server_address.ipv4",
1989 FT_IPv4
, BASE_NONE
, NULL
, 0,
1992 { &hf_ctlv_dns_server_address_ipv6
,
1993 { "IPv6 address", "etsi_cat.comp_tlv.dns_server_address.ipv6",
1994 FT_IPv6
, BASE_NONE
, NULL
, 0,
1997 { &hf_ctlv_utran_eutran_meas_qual
,
1998 { "UTRAN/E-UTRAN Measurement Qualifier", "etsi_cat.comp_tlv.utran_eutran_meas_qual",
1999 FT_UINT8
, BASE_HEX
, VALS(utran_eutran_meas_qual_vals
), 0,
2002 { &hf_ctlv_upd_attach_type
,
2003 { "Update/Attach/Registration", "etsi_cat.comp_tlv.upd_attach_type",
2004 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &upd_attach_type_vals_ext
, 0,
2007 { &hf_ctlv_loci_lac
,
2008 { "Location Area Code / Tracking Area Code", "etsi_cat.comp_tlv.loci.lac",
2009 FT_UINT16
, BASE_HEX
, NULL
, 0,
2012 { &hf_ctlv_loci_cell_id
,
2013 { "Cell ID", "etsi_cat.comp_tlv.loci.cell_id",
2014 FT_UINT16
, BASE_HEX
, NULL
, 0,
2017 { &hf_ctlv_loci_ext_cell_id
,
2018 { "Extended Cell ID", "etsi_cat.comp_tlv.loci.ext_cell_id",
2019 FT_UINT16
, BASE_HEX
, NULL
, 0,
2023 { "IARI", "etsi_cat.comp_tlv.iari",
2024 FT_STRING
, BASE_NONE
, NULL
, 0,
2028 { "IMPU", "etsi_cat.comp_tlv.impu",
2029 FT_STRING
, BASE_NONE
, NULL
, 0,
2032 { &hf_ctlv_ims_status_code
,
2033 { "IMS Status-Code", "etsi_cat.comp_tlv.ims_status_code",
2034 FT_STRING
, BASE_NONE
, NULL
, 0,
2037 { &hf_ctlv_broadcast_nw_tech
,
2038 { "Broadcast Network Technology", "etsi_cat.comp_tlv.broadcast_nw.tech",
2039 FT_UINT8
, BASE_HEX
, VALS(broadcast_nw_tech_vals
), 0,
2042 { &hf_ctlv_broadcast_nw_loc_info
,
2043 { "Broadcast Network Location Information", "etsi_cat.comp_tlv.broadcast_nw.loc_info",
2044 FT_BYTES
, BASE_NONE
, NULL
, 0,
2048 static int *ett
[] = {
2053 proto_cat
= proto_register_protocol("Card Application Toolkit ETSI TS 102.223", "ETSI CAT",
2056 proto_register_field_array(proto_cat
, hf
, array_length(hf
));
2058 proto_register_subtree_array(ett
, array_length(ett
));
2060 register_dissector("etsi_cat", dissect_cat
, proto_cat
);
2064 proto_reg_handoff_card_app_toolkit(void)
2066 gsm_sms_handle
= find_dissector_add_dependency("gsm_sms", proto_cat
);
2071 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2076 * indent-tabs-mode: t
2079 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
2080 * :indentSize=8:tabSize=8:noTabs=false: