MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-etsi_card_app_toolkit.c
blobbed43d1b574e8cc019bb04a1150fe5554278449b
1 /* packet-card_app_toolkit
2 * Routines for packet dissection of
3 * ETSI TS 102 223 v10.0.0 (Release 10 / 2010-10)
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 * $Id$
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include "config.h"
31 #include <glib.h>
33 #include <epan/packet.h>
34 #include <epan/emem.h>
35 #include <epan/lapd_sapi.h>
36 #include <epan/prefs.h>
38 #include "packet-e212.h"
39 #include "packet-gsm_a_common.h"
40 #include "packet-gsm_sms.h"
42 void proto_register_card_app_toolkit(void);
43 void proto_reg_handoff_card_app_toolkit(void);
45 static int proto_cat = -1;
47 static dissector_handle_t gsm_sms_handle; /* SMS TPDU */
49 static int hf_cat_tlv = -1;
51 static int hf_ctlv_devid_src = -1;
52 static int hf_ctlv_devid_dst = -1;
53 static int hf_ctlv_cmd_nr = -1;
54 static int hf_ctlv_cmd_type = -1;
55 static int hf_ctlv_cmd_qual_refresh = -1;
56 static int hf_ctlv_cmd_qual_send_short_msg = -1;
57 static int hf_ctlv_cmd_qual_loci = -1;
58 static int hf_ctlv_cmd_qual_timer_mgmt = -1;
59 static int hf_ctlv_cmd_qual_send_data = -1;
60 static int hf_ctlv_cmd_qual = -1;
61 static int hf_ctlv_dur_time_intv = -1;
62 static int hf_ctlv_dur_time_unit = -1;
63 static int hf_ctlv_result_gen = -1;
64 static int hf_ctlv_result_term = -1;
65 static int hf_ctlv_result_launch_browser = -1;
66 static int hf_ctlv_result_multiplecard = -1;
67 static int hf_ctlv_result_cc_ctrl_mo_sm_ctrl = -1;
68 static int hf_ctlv_result_bip = -1;
69 static int hf_ctlv_result_frames_cmd = -1;
70 static int hf_ctlv_text_string_enc = -1;
71 static int hf_ctlv_text_string = -1;
72 static int hf_ctlv_event = -1;
73 static int hf_ctlv_tone = -1;
74 static int hf_ctlv_loc_status = -1;
75 static int hf_ctlv_timer_val_hr = -1;
76 static int hf_ctlv_timer_val_min = -1;
77 static int hf_ctlv_timer_val_sec = -1;
78 static int hf_ctlv_date_time_yr = -1;
79 static int hf_ctlv_date_time_mo = -1;
80 static int hf_ctlv_date_time_day = -1;
81 static int hf_ctlv_date_time_hr = -1;
82 static int hf_ctlv_date_time_min = -1;
83 static int hf_ctlv_date_time_sec = -1;
84 static int hf_ctlv_date_time_tz = -1;
85 static int hf_ctlv_at_cmd = -1;
86 static int hf_ctlv_at_rsp = -1;
87 static int hf_ctlv_language = -1;
88 static int hf_ctlv_me_status = -1;
89 static int hf_ctlv_timing_adv = -1;
90 static int hf_ctlv_bearer = -1;
91 static int hf_ctlv_bearer_descr = -1;
92 static int hf_ctlv_bearer_csd_data_rate = -1;
93 static int hf_ctlv_bearer_csd_bearer_serv = -1;
94 static int hf_ctlv_bearer_csd_conn_elem = -1;
95 static int hf_ctlv_bearer_gprs_precedence = -1;
96 static int hf_ctlv_bearer_gprs_delay = -1;
97 static int hf_ctlv_bearer_gprs_reliability = -1;
98 static int hf_ctlv_bearer_gprs_peak = -1;
99 static int hf_ctlv_bearer_gprs_mean = -1;
100 static int hf_ctlv_bearer_gprs_prot_type = -1;
101 static int hf_ctlv_bearer_utran_traffic_class = -1;
102 static int hf_ctlv_bearer_utran_max_bitrate_ul = -1;
103 static int hf_ctlv_bearer_utran_max_bitrate_dl = -1;
104 static int hf_ctlv_bearer_utran_guaranteed_bitrate_ul = -1;
105 static int hf_ctlv_bearer_utran_guaranteed_bitrate_dl = -1;
106 static int hf_ctlv_bearer_utran_delivery_order = -1;
107 static int hf_ctlv_bearer_utran_max_sdu_size = -1;
108 static int hf_ctlv_bearer_utran_sdu_error_ratio = -1;
109 static int hf_ctlv_bearer_utran_residual_bit_error_ratio = -1;
110 static int hf_ctlv_bearer_utran_delivery_erroneous_sdus = -1;
111 static int hf_ctlv_bearer_utran_transfer_delay = -1;
112 static int hf_ctlv_bearer_utran_traffic_handling_prio = -1;
113 static int hf_ctlv_bearer_utran_pdp_type = -1;
114 static int hf_ctlv_bearer_params = -1;
115 static int hf_ctlv_buffers_size = -1;
116 static int hf_ctlv_transport_ptype = -1;
117 static int hf_ctlv_transport_port = -1;
118 static int hf_ctlv_other_address_coding = -1;
119 static int hf_ctlv_other_address_ipv4 = -1;
120 static int hf_ctlv_other_address_ipv6 = -1;
121 static int hf_ctlv_access_tech = -1;
122 static int hf_ctlv_utran_eutran_meas_qual = -1;
123 static int hf_ctlv_upd_attach_type = -1;
124 static int hf_ctlv_loci_lac = -1;
125 static int hf_ctlv_loci_cell_id = -1;
126 static int hf_ctlv_loci_ext_cell_id = -1;
127 static int hf_ctlv_iari = -1;
128 static int hf_ctlv_impu = -1;
129 static int hf_ctlv_ims_status_code = -1;
131 static int ett_cat = -1;
132 static int ett_elem = -1;
135 /* According to Section 7.2 of ETSI TS 101 220 / Chapter 7.2 */
137 #if 0
138 /* BER-TLV tag - Remote Management application Data templates */
139 static const value_string ber_tlv_rmad_tag_vals[] = {
140 { 0x01, "OMA SCWS" },
141 { 0x81, "OMA SCWS and GP 2.2 Amd. B" },
142 { 0xaa, "Command Scripting template for definite length coding" },
143 { 0xab, "Response Scripting Template for definite length coding" },
144 { 0xae, "Command Scripting template for indefinite length coding" },
145 { 0xaf, "Response Scripting Template for indefinite length coding" },
146 { 0, NULL }
148 #endif
150 /* Comprehension-TLV tag */
151 static const value_string comp_tlv_tag_vals[] = {
152 { 0x01, "Command details" },
153 { 0x02, "Device identity" },
154 { 0x03, "Result" },
155 { 0x04, "Duration" },
156 { 0x05, "Alpha identifier" },
157 { 0x06, "Address" },
158 { 0x07, "Capability configuration parameters" },
159 { 0x08, "Subaddress" },
160 { 0x09, "3GPP SS string" },
161 { 0x0a, "3GPP USSD string" },
162 { 0x0b, "3GPP SMS TPDU" },
163 { 0x0c, "3GPP Cell Broadcast page" },
164 { 0x0d, "Text string" },
165 { 0x0e, "Tone" },
166 { 0x0f, "Item" },
167 { 0x10, "Item identifier" },
168 { 0x11, "Response length" },
169 { 0x12, "File List" },
170 { 0x13, "Location Information" },
171 { 0x14, "IMEI" },
172 { 0x15, "Help request" },
173 { 0x16, "Network Measurement Results" },
174 { 0x17, "Default Text" },
175 { 0x18, "Items Next Action Indicator" },
176 { 0x19, "Event list" },
177 { 0x1a, "GSM/3G Cause" },
178 { 0x1b, "Location status" },
179 { 0x1c, "transaction identifier" },
180 { 0x1d, "GSM/3G BCCH channel list" },
181 { 0x1e, "Icon identifier" },
182 { 0x1f, "Item Icon identifier list" },
183 { 0x20, "Card reader status" },
184 { 0x21, "Card ATR" },
185 { 0x22, "C-APDU" },
186 { 0x23, "R-APDU" },
187 { 0x24, "Timer identifier" },
188 { 0x25, "Timer value" },
189 { 0x26, "Date-Time and Time zone" },
190 { 0x27, "Call control requested action" },
191 { 0x28, "AT Command" },
192 { 0x29, "AT Response" },
193 { 0x2a, "GSM/3G BC Repeat Indicator" },
194 { 0x2b, "Immediate response" },
195 { 0x2c, "DTMF string" },
196 { 0x2d, "Language" },
197 { 0x2e, "GSM Timing Advance" },
198 { 0x2f, "AID" },
199 { 0x30, "Browser Identity" },
200 { 0x31, "URL" },
201 { 0x32, "Bearer" },
202 { 0x33, "Provisioning Reference File" },
203 { 0x34, "Browser Termination Cause" },
204 { 0x35, "Bearer description" },
205 { 0x36, "Channel data" },
206 { 0x37, "Channel data length" },
207 { 0x38, "Channel status" },
208 { 0x39, "Buffer size" },
209 { 0x3a, "Card reader identifier" },
210 { 0x3b, "File Update Information" },
211 { 0x3c, "UICC/terminal interface transport level" },
212 { 0x3e, "Other address (data destination address)" },
213 { 0x3f, "Access Technology" },
214 { 0x40, "Display parameters" },
215 { 0x41, "Service Record" },
216 { 0x42, "Device Filter" },
217 { 0x43, "Service Search" },
218 { 0x44, "Attribute information" },
219 { 0x45, "Service Availability" },
220 { 0x46, "3GPP2 ESN" },
221 { 0x47, "Network Access Name" },
222 { 0x48, "3GPP2 CDMA-SMS-TPDU" },
223 { 0x49, "Remote Entity Address" },
224 { 0x4a, "3GPP I-WLAN Identifier" },
225 { 0x4b, "3GPP I-WLAN Access Status" },
226 { 0x50, "Text attribute" },
227 { 0x51, "Item text attribute list" },
228 { 0x52, "3GPP PDP Context Activation parameter" },
229 { 0x53, "Contactless state request" },
230 { 0x54, "Conactless functionality state" },
231 { 0x55, "3GPP CSG cell selection status" },
232 { 0x56, "3GPP CSG ID" },
233 { 0x57, "3GPP HNB name" },
234 { 0x62, "IMEISV" },
235 { 0x63, "Battery state" },
236 { 0x64, "Browsing status" },
237 { 0x65, "Network Search Mode" },
238 { 0x66, "Frame Layout" },
239 { 0x67, "Frames Information" },
240 { 0x68, "Frame identifier" },
241 { 0x69, "3GPP UTRAN/E-UTRAN Measurement qualifier" },
242 { 0x6a, "Multimedia Messsage Reference" },
243 { 0x6b, "Multimedia Message Identifier" },
244 { 0x6c, "Multimedia Message Transfer Status" },
245 { 0x6d, "MEID" },
246 { 0x6e, "Multimedia Message Content Identifier" },
247 { 0x6f, "Multimedia Message Notification" },
248 { 0x70, "Last Envelope" },
249 { 0x71, "Registry application data" },
250 { 0x72, "3GPP PLMNwAcT List" },
251 { 0x73, "3GPP Routing Area Information" },
252 { 0x74, "3GPP Update/Attach Type" },
253 { 0x75, "3GPP Rejection Cause Code" },
254 { 0x76, "3GPP Geographical Location Parameters / IARI" },
255 { 0x77, "3GPP GAD Shapes / IMPU list" },
256 { 0x78, "3GPP NMEA sentence / IMS Status-Code" },
257 { 0x79, "3GPP PLMN list" },
258 { 0x7a, "Broadcast Network Information" },
259 { 0x7b, "ACTIVATE descriptor" },
260 { 0x7c, "3GPP EPS PDN connection activation parameters" },
261 { 0x7d, "3GPP Tracking Area Identification" },
262 { 0x7e, "3GPP CSG ID list" },
263 { 0xaa, "IP address list" },
264 { 0xbb, "Surrounding macrocells" },
265 { 0, NULL }
268 /* TS 102 223 Chapter 8.6 */
269 static const value_string cmd_qual_refresh_vals[] = {
270 { 0x00, "NAA Initialization and Full File Change Notification" },
271 { 0x01, "File Change Notification" },
272 { 0x02, "NAA Initialization and File Change Notification" },
273 { 0x03, "NAA Initialization" },
274 { 0x04, "UICC Reset" },
275 { 0x05, "NAA Application Reset, only applicable for a 3G platform" },
276 { 0x06, "NAA Session Reset, only applicable for a 3G platform" },
277 { 0x07, "Steering of Roaming" },
278 { 0x08, "Steering of Roaming for I-WLAN" },
279 { 0, NULL }
281 static const true_false_string cmd_qual_send_short_msg_value = {
282 "SMS packing by the terminal required",
283 "Packing not required"
285 static const value_string cmd_qual_loci_vals[] = {
286 { 0x00, "Location Information (MCC, MNC, LAC/TAC, Cell Identity and Extended Cell Identity)" },
287 { 0x01, "IMEI of the terminal" },
288 { 0x02, "Network Measurement results" },
289 { 0x03, "Date, time and time zone" },
290 { 0x04, "Language setting" },
291 { 0x05, "Timing Advance" },
292 { 0x06, "Access Technology (single access technology)" },
293 { 0x07, "ESN of the terminal" },
294 { 0x08, "IMEISV of the terminal" },
295 { 0x09, "Search Mode" },
296 { 0x0a, "Charge State of the Battery" },
297 { 0x0b, "MEID of the terminal" },
298 { 0x0c, "Current WSID" },
299 { 0x0d, "Broadcast Network information according tocurrent Broadcast Network Technology used" },
300 { 0x0e, "Multiple Access Technologies" },
301 { 0x0f, "Location Information for multiple access technologies" },
302 { 0x10, "Network Measurement results for multiple access technologies" },
303 { 0x11, "CSG ID list and corresponding HNB name" },
304 { 0x12, "H(e)NB IP address" },
305 { 0x13, "H(e)NB surrounding macrocells" },
306 { 0, NULL }
308 static const value_string cmd_qual_timer_mgmt_vals[] = {
309 { 0x00, "Start" },
310 { 0x01, "Deactivate" },
311 { 0x02, "Get current value" },
312 { 0, NULL }
314 static const true_false_string cmd_qual_send_data_value = {
315 "Send data immediately",
316 "Store data in Tx buffer"
319 /* TS 102 223 Chapter 8.7 */
320 static const value_string dev_id_vals[] = {
321 { 0x01, "Keypad" },
322 { 0x02, "Display" },
323 { 0x03, "Earpiece" },
324 { 0x10, "Additional Card Reader 0" },
325 { 0x11, "Additional Card Reader 1" },
326 { 0x12, "Additional Card Reader 2" },
327 { 0x13, "Additional Card Reader 3" },
328 { 0x14, "Additional Card Reader 4" },
329 { 0x15, "Additional Card Reader 5" },
330 { 0x16, "Additional Card Reader 6" },
331 { 0x17, "Additional Card Reader 7" },
332 { 0x21, "Channel ID 1" },
333 { 0x22, "Channel ID 2" },
334 { 0x23, "Channel ID 3" },
335 { 0x24, "Channel ID 4" },
336 { 0x25, "Channel ID 5" },
337 { 0x26, "Channel ID 6" },
338 { 0x27, "Channel ID 7" },
339 { 0x81, "SIM / USIM / UICC" },
340 { 0x82, "Terminal (Card Reader)" },
341 { 0x83, "Network" },
342 { 0, NULL }
345 /* TS 102 223 Chapter 9.4 */
346 static const value_string cmd_type_vals[] = {
347 { 0x01, "REFRESH" },
348 { 0x02, "MORE TIME" },
349 { 0x03, "POLL INTERVAL" },
350 { 0x04, "POLLING OFF" },
351 { 0x05, "SET UP EVENT LIST" },
352 { 0x10, "SET UP CALL" },
353 { 0x11, "SEND SS" },
354 { 0x12, "SEND USSD" },
355 { 0x13, "SEND SHORT MESSAGE" },
356 { 0x14, "SEND DTMF" },
357 { 0x15, "LAUNCH BROWSER" },
358 { 0x16, "3GPP GEOGRAPHICAL LOCATION REQUEST" },
359 { 0x20, "PLAY TONE" },
360 { 0x21, "DISPLAY TEXT" },
361 { 0x22, "GET INKEY" },
362 { 0X23, "GET INPUT" },
363 { 0x24, "SELECT ITEM" },
364 { 0x25, "SET UP MENU" },
365 { 0x26, "PROVIDE LOCAL INFORMATION" },
366 { 0x27, "TIMER MANAGEMENT" },
367 { 0x28, "SET UP IDLE MODE TEXT" },
368 { 0x30, "PERFORM CARD APDU" },
369 { 0x31, "POWER ON CARD" },
370 { 0x32, "POWER OFF CARD" },
371 { 0x33, "GET READER STATUS" },
372 { 0x34, "RUN AT COMMAND" },
373 { 0x35, "LANGUAGE NOTIFICATION" },
374 { 0x40, "OPEN CHANNEL" },
375 { 0x41, "CLOSE CHANNEL" },
376 { 0x42, "RECEIVE DATA" },
377 { 0x43, "SEND DATA" },
378 { 0x44, "GET CHANNEL STATUS" },
379 { 0x45, "SERVICE SEARCH" },
380 { 0x46, "GET SERVICE INFORMATION" },
381 { 0x47, "DECLARE SERVICE" },
382 { 0x50, "SET FRAMES" },
383 { 0x51, "GET FRAMES STATUS" },
384 { 0x60, "RETRIEVE MULTIMEDIA MESSAGE" },
385 { 0x61, "SUBMIT MULTIMEDIA MESSAGE" },
386 { 0x62, "DISPLAY MULTIMEDIA MESSAGE" },
387 { 0x70, "ACTIVATE" },
388 { 0x71, "CONTACTLESS STATE CHANGED" },
389 { 0x81, "End of the proactive session" },
390 { 0, NULL }
393 /* TS 102 223 Chapter 8.8 */
394 static const value_string time_unit_vals[] = {
395 { 0x00, "minutes" },
396 { 0x01, "seconds" },
397 { 0x02, "tenths of seconds" },
398 { 0, NULL }
401 /* TS 102 223 Chapter 8.12 */
402 static const value_string result_vals[] = {
403 { 0x00, "Command performed successfully" },
404 { 0x01, "Command performed with partial comprehension" },
405 { 0x02, "Command performed with missing information" },
406 { 0x03, "REFRESH performed with additional EFs read" },
407 { 0x04, "Command performed successfully, but requested icon could not be displayed" },
408 { 0x05, "Command performed, but modified by call control by NAA" },
409 { 0x06, "Command performed successfully, limited service" },
410 { 0x07, "Command performed with modifications" },
411 { 0x08, "REFRESH performed by indicated NAA was not active" },
412 { 0x09, "Command performed successfully, tone not played" },
413 { 0x10, "Proactive UICC session terminated by the user" },
414 { 0x11, "Backward move in the proactive UICC session requested by user" },
415 { 0x12, "No response from user" },
416 { 0x13, "Help information required by the user" },
417 { 0x14, "USSD or SS transaction terminated by the user" },
418 { 0x20, "Terminal currently unable to process command" },
419 { 0x21, "Network currently unable to process command" },
420 { 0x22, "User did not accept the proactive command" },
421 { 0x23, "User cleared down call before connection or network refuse" },
422 { 0x24, "Action in contradiction with the current timer state" },
423 { 0x25, "Interaction with call control by NAA temporary problem" },
424 { 0x26, "Launch browser generic error code" },
425 { 0x27, "MMS temporary problem" },
426 { 0x30, "Command beyond terminal's capabilities" },
427 { 0x31, "Command type not understood by terminal" },
428 { 0x32, "Command data not understood by terminal" },
429 { 0x33, "Command number not known by terminal" },
430 { 0x34, "SS Return Error" },
431 { 0x35, "SMS RP-ERROR" },
432 { 0x36, "Error, required values are missing" },
433 { 0x37, "USSD Return Error" },
434 { 0x38, "MultipleCard commands error" },
435 { 0x39, "Interaction with call control by USIM or MO short message control by USIM, permanent problem" },
436 { 0x3a, "Bearer Independent Protocol error" },
437 { 0x3b, "Access Technology unable to process command" },
438 { 0x3c, "Frames error" },
439 { 0x3d, "MMS error" },
440 { 0, NULL }
442 static const value_string result_term_vals[] = {
443 { 0x00, "No specific cause can be given" },
444 { 0x01, "Screen is busy" },
445 { 0x02, "Terminal currently busy on call" },
446 { 0x03, "ME currently busy on SS transaction" },
447 { 0x04, "No service" },
448 { 0x05, "Access control class bar" },
449 { 0x06, "Radio resource not granted" },
450 { 0x07, "Not in speech call" },
451 { 0x08, "ME currently busy on USSD transaction" },
452 { 0x09, "Terminal currently busy on SEND DTMF command" },
453 { 0x0a, "No NAA active" },
454 { 0, NULL }
456 static const value_string result_launch_browser_vals[] = {
457 { 0x00, "No specific cause can be given" },
458 { 0x01, "Bearer unavailable" },
459 { 0x02, "Browser unavailable" },
460 { 0x03, "Terminal unable to read the provisioning data" },
461 { 0, NULL }
463 static const value_string result_multiplecard_vals[] = {
464 { 0x00, "No specific cause can be given" },
465 { 0x01, "Card reader removed or not present" },
466 { 0x02, "Card removed or not present" },
467 { 0x03, "Card reader busy" },
468 { 0x04, "Card powered off" },
469 { 0x05, "C-APDU format error" },
470 { 0x06, "Mute card" },
471 { 0x07, "Transmission error" },
472 { 0x08, "Protocol not supported" },
473 { 0x09, "Specified reader not valid" },
474 { 0, NULL }
476 static const value_string result_cc_ctrl_mo_sm_ctrl_vals[] = {
477 { 0x00, "No specific cause can be given" },
478 { 0x01, "Action not allowed" },
479 { 0x02, "The type of request has changed" },
480 { 0, NULL }
482 static const value_string result_bip_vals[] = {
483 { 0x00, "No specific cause can be given" },
484 { 0x01, "No channel available" },
485 { 0x02, "Channel closed" },
486 { 0x03, "Channel identifier not valid" },
487 { 0x04, "Requested buffer size not available" },
488 { 0x05, "Security error (unsuccessful authentication)" },
489 { 0x06, "Requested UICC/terminal interface transport level not available" },
490 { 0x07, "Remote device is not reachable" },
491 { 0x08, "Service error" },
492 { 0x09, "Service identifier unknown" },
493 { 0x10, "Port not available" },
494 { 0x11, "Launch parameters missing or incorrect" },
495 { 0x12, "Application launch failed" },
496 { 0, NULL }
498 static const value_string result_frames_cmd_vals[] = {
499 { 0x00, "No specific cause can be given" },
500 { 0x01, "Frame identifier is not valid" },
501 { 0x02, "Number of frames beyond the terminal's capabilities" },
502 { 0x03, "No Frame defined" },
503 { 0x04, "Requested size not supported" },
504 { 0x05, "Default Active Frame is not valid" },
505 { 0, NULL }
509 static const range_string text_encoding_vals[] = {
510 { 0x00, 0x03, "GSM default alphabet, 7 bits packed" },
511 { 0x04, 0x07, "GSM default alphabet, 8 bits" },
512 { 0x08, 0x0b, "UCS2" },
513 { 0xf0, 0xf3, "GSM default alphabet, 7 bits packed" },
514 { 0xf4, 0xf7, "GSM default alphabet, 8 bits" },
515 { 0, 0, NULL }
518 /* TS 102 223 - Chapter 8.16 */
519 static const value_string tone_vals[] = {
520 /* Standard supervisory tones */
521 { 0x01, "Dial tone" },
522 { 0x02, "Called subscriber busy" },
523 { 0x03, "Congestion" },
524 { 0x04, "Radio path acknowledge" },
525 { 0x05, "Radio path not available / Call dropped" },
526 { 0x06, "Error / Special information" },
527 { 0x07, "Call waiting tone" },
528 { 0x08, "Ringing tone" },
529 /* Terminal proprietary tones */
530 { 0x10, "General beep" },
531 { 0x11, "Positive acknowledgement tone" },
532 { 0x12, "Negative acknowledgement or error tone" },
533 { 0x13, "Ringing tone as selected by the oser for incoming speech call" },
534 { 0x14, "Alert tone as selected by the user for incoming SMS" },
535 { 0x15, "Critical alert" },
536 { 0x20, "Vibrate only, if available" },
537 /* Themed tones */
538 { 0x30, "happy tone" },
539 { 0x31, "sad tone" },
540 { 0x32, "urgent action tone" },
541 { 0x33, "question tone" },
542 { 0x34, "message received tone" },
543 /* Melody tones */
544 { 0x40, "Melody 1" },
545 { 0x41, "Melody 2" },
546 { 0x42, "Melody 3" },
547 { 0x43, "Melody 4" },
548 { 0x44, "Melody 5" },
549 { 0x45, "Melody 6" },
550 { 0x46, "Melody 7" },
551 { 0x47, "Melody 8" },
552 { 0, NULL }
555 /* TS 102 223 - Chapter 8.25 */
556 static const value_string event_list_vals[] = {
557 { 0x00, "MT call" },
558 { 0x01, "Call connected" },
559 { 0x02, "Call disconnected" },
560 { 0x03, "Location status" },
561 { 0x04, "User activity" },
562 { 0x05, "Idle screen available" },
563 { 0x06, "Card reader status" },
564 { 0x07, "Language selection" },
565 { 0x08, "Browser termination" },
566 { 0x09, "Data available" },
567 { 0x0a, "Channel status" },
568 { 0x0b, "Access Technology Change (single access technology)" },
569 { 0x0c, "Display parameters changed" },
570 { 0x0d, "Local connection" },
571 { 0x0e, "Network Search Mode Change" },
572 { 0x0f, "Browsing status" },
573 { 0x10, "Frames Informations Change" },
574 { 0x11, "I-WLAN Access Status" },
575 { 0x12, "Network Rejection" },
576 { 0x13, "HCI connectivity event" },
577 { 0x14, "Access Technology Change (multiple access technologies)" },
578 { 0x15, "CSG cell selection" },
579 { 0x16, "Contactless state request" },
580 { 0x17, "IMS Registration" },
581 { 0x18, "Incoming IMS data" },
582 { 0x19, "Profile Container" },
583 { 0x1a, "Void" },
584 { 0, NULL }
587 /* TS 102 223 - Chapter 8.27 */
588 static const value_string loc_status_vals[] = {
589 { 0x00, "Normal service" },
590 { 0x01, "Limited service" },
591 { 0x02, "No service" },
592 { 0, NULL }
595 /* 31.111 - Chapter 8.46 */
596 static const value_string me_status_vals[] = {
597 { 0x00, "ME is in the idle state" },
598 { 0x01, "ME is not in idle state" },
599 { 0, NULL }
602 /* TS 102 223 - Chapter 8.49 + TS 11.14 Chapter 12.49 */
603 static const value_string bearer_vals[] = {
604 { 0x00, "SMS" },
605 { 0x01, "CSD" },
606 { 0x02, "USSD" },
607 { 0x03, "GPRS/UTRAN packet service/E-UTRAN" },
608 { 0, NULL }
611 /* TS 102 223 - Chapter 8.52 + TS 11.14 Chapter 12.52 */
612 static const value_string bearer_descr_vals[] = {
613 { 0x01, "CSD" },
614 { 0x02, "GPRS / UTRAN packet service / E-UTRAN" },
615 { 0x03, "default bearer for requested transport layer" },
616 { 0x04, "local link techonlogy independent" },
617 { 0x05, "Bluetooth" },
618 { 0x06, "IrDA" },
619 { 0x07, "RS232" },
620 { 0x08, "TIA/EIA/IS-820 packet data service" },
621 { 0x09, "UTRAN packet service with extended parameters / HSDPA / E-UTRAN" },
622 { 0x0a, "I-WLAN" },
623 { 0x0b, "E-UTRAN / Mapped UTRAN packet service" },
624 { 0x10, "USB" },
625 { 0, NULL }
628 /* 3GPP 31.111 - Chapter 8.52 */
629 static const value_string csd_data_rate_vals[] = {
630 { 0, "autobauding" },
631 { 1, "300 bps (V.21)" },
632 { 2, "1200 bps (V.22)" },
633 { 3, "1200/75 bps (V.23)" },
634 { 4, "2400 bps (V.22bis)" },
635 { 5, "2400 bps (V.26ter)" },
636 { 6, "4800 bps (V.32)" },
637 { 7, "9600 bps (V.32)" },
638 { 12, "9600 bps (V.34)" },
639 { 14, "14400 bps (V.34)" },
640 { 15, "19200 bps (V.34)" },
641 { 16, "28800 bps (V.34)" },
642 { 17, "33600 bps (V.34)" },
643 { 34, "1200 bps (V.120)" },
644 { 36, "2400 bps (V.120)" },
645 { 38, "4800 bps (V.120)" },
646 { 39, "9600 bps (V.120)" },
647 { 43, "14400 bps (V.120)" },
648 { 47, "19200 bps (V.120)" },
649 { 48, "28800 bps (V.120)" },
650 { 49, "38400 bps (V.120)" },
651 { 50, "48000 bps (V.120)" },
652 { 51, "56000 bps (V.120)" },
653 { 65, "300 bps (V.110)" },
654 { 66, "1200 bps (V.110)" },
655 { 68, "2400 bps (V.110 or X.31 flag stuffing)" },
656 { 70, "4800 bps (V.110 or X.31 flag stuffing)" },
657 { 71, "9600 bps (V.110 or X.31 flag stuffing)" },
658 { 75, "14400 bps (V.110 or X.31 flag stuffing)" },
659 { 79, "19200 bps (V.110 or X.31 flag stuffing)" },
660 { 80, "28800 bps (V.110 or X.31 flag stuffing)" },
661 { 81, "38400 bps (V.110 or X.31 flag stuffing)" },
662 { 82, "48000 bps (V.110 or X.31 flag stuffing)" },
663 { 83, "56000 bps (V.110 or X.31 flag stuffing)" },
664 { 84, "64000 bps (X.31 flag stuffing)" },
665 { 115, "56000 bps (bit transparent)" },
666 { 116, "64000 bps (bit transparent)" },
667 { 120, "32000 bps (PIAFS32k)" },
668 { 121, "64000 bps (PIAFS64k)" },
669 { 130, "28800 bps (multimedia)" },
670 { 131, "32000 bps (multimedia)" },
671 { 132, "33600 bps (multimedia)" },
672 { 133, "56000 bps (multimedia)" },
673 { 134, "64000 bps (multimedia)" },
674 { 0, NULL }
676 static const value_string csd_bearer_serv_vals[] = {
677 { 0, "Data circuit asynchronous (UDI or 3.1 kHz modem)" },
678 { 1, "Data circuit synchronous (UDI or 3.1 kHz modem)" },
679 { 2, "PAD Access (asynchronous) (UDI)" },
680 { 3, "Packet Access (synchronous) (UDI)" },
681 { 4, "Data circuit asynchronous (RDI)" },
682 { 5, "Data circuit synchronous (RDI)" },
683 { 6, "PAD Access (asynchronous) (RDI)" },
684 { 7, "Packet Access (synchronous) (RDI)" },
685 { 0, NULL }
687 static const value_string csd_conn_elem_vals[] = {
688 { 0, "Transparent" },
689 { 1, "Non-transparent" },
690 { 2, "Both, transparent preferred" },
691 { 3, "Both, non-transparent preferred" },
692 { 0, NULL }
694 static const value_string gprs_prot_type_vals[] = {
695 { 2, "IP (Internet Protocol, IETF STD 5)" },
696 { 0, NULL }
698 static const value_string utran_traffic_class_vals[] = {
699 { 0, "Conversational" },
700 { 1, "Streaming" },
701 { 2, "Interactive" },
702 { 3, "Background" },
703 { 4, "Subscribed value" },
704 { 0, NULL }
706 static const value_string utran_delivery_order_vals[] = {
707 { 0, "No" },
708 { 1, "Yes" },
709 { 2, "Subscribed value" },
710 { 0, NULL }
712 static const value_string utran_delivery_erroneous_sdus_vals[] = {
713 { 0, "No" },
714 { 1, "Yes" },
715 { 2, "No detect" },
716 { 3, "Subscribed value" },
717 { 0, NULL }
719 static const value_string pdp_type_vals[] = {
720 { 1, "X.25" },
721 { 2, "IP" },
722 { 3, "IPV6" },
723 { 4, "IPV4V6" },
724 { 5, "OSPIH" },
725 { 6, "PPP" },
726 { 0, NULL }
729 /* TS 102 223 - Chapter 8.58 */
730 static const value_string other_address_coding_vals[] = {
731 { 0x21, "IPv4 address" },
732 { 0x57, "IPv6 address" },
733 { 0, NULL }
736 /* TS 102 223 - Chapter 8.59 + TS 11.14 Chapter 12.59 */
737 static const value_string transport_ptype_vals[] = {
738 { 0x01, "UDP, UICC in client mode, remote connection" },
739 { 0x02, "TCP, UICC in client mode, remote connection" },
740 { 0x03, "TCP, UICC in server mode" },
741 { 0x04, "UDP, UICC in client mode, local connection" },
742 { 0x05, "TCP, UICC in client mode, locel connection" },
743 { 0x06, "direct communication channel" },
744 { 0, NULL }
747 /* TS 102 223 - Chapter 8.61 */
748 static const value_string access_tech_vals[] = {
749 { 0x00, "GSM" },
750 { 0x01, "TIA/EIA-553" },
751 { 0x02, "TIA/EIA-136-C" },
752 { 0x03, "UTRAN" },
753 { 0x04, "TETRA" },
754 { 0x05, "TIE/EIA-95" },
755 { 0x06, "cdma2000 1x (TIA/EIA/IS-2000)" },
756 { 0x07, "cdma2000 HRPD (TIA/EIA/IS-856)" },
757 { 0x08, "E-UTRAN" },
758 { 0, NULL }
761 /* 3GPP 31.111 - Chapter 8.73 */
762 static const value_string utran_eutran_meas_qual_vals[] = {
763 { 0x01, "UTRAN Intra-frequency measurements" },
764 { 0x02, "UTRAN Inter-frequency measurements" },
765 { 0x03, "UTRAN Inter-RAT (GERAN) measurements" },
766 { 0x04, "UTRAN Inter-RAT (E-UTRAN) measurements" },
767 { 0x05, "E-UTRAN Intra-frequency measurements" },
768 { 0x06, "E-UTRAN Inter-frequency measurements" },
769 { 0x07, "E-UTRAN Inter-RAT (GERAN) measurements" },
770 { 0x08, "E-UTRAN Inter-RAT (UTRAN) measurements" },
771 { 0, NULL }
774 /* 3GPP 31.111 - Chapter 8.92 */
775 static const value_string upd_attach_type_vals[] = {
776 { 0x00, "\"Normal Location Updating\" in the case of a Location Updating Request message" },
777 { 0x01, "\"Periodic Updating\" in the case of a Location Updating Request message" },
778 { 0x02, "\"IMSI Attach\" in the case of a Location Updating Request message" },
779 { 0x03, "\"GPRS Attach\" in the case of a GPRS Attach Request message" },
780 { 0x04, "\"Combined GPRS/IMSI Attach\" in the case of a GPRS Attach Request message" },
781 { 0x05, "\"RA Updating\" in the case of a Routing Area Update Request message" },
782 { 0x06, "\"Combined RA/LA Updating\" in the case of a Routing Area Update Request message" },
783 { 0x07, "\"Combined RA/LA Updating with IMSI Attach\" in the case of a Routing Area Update Request message" },
784 { 0x08, "\"Periodic Updating\" in the case of a Routing Area Update Request message" },
785 { 0x09, "\"EPS Attach\" in the case of an EMM ATTACH REQUEST message" },
786 { 0x0A, "\"Combined EPS/IMSI Attach\" in the case of an EMM ATTACH REQUEST message" },
787 { 0x0B, "\"TA updating\" in the case of an EMM TRACKING AREA UPDATE REQUEST message" },
788 { 0x0C, "\"Combined TA/LA updating\" in the case of an EMM TRACKING AREA UPDATE REQUEST message" },
789 { 0x0D, "\"Combined TA/LA updating with IMSI attach\" in the case of an EMM TRACKING AREA UPDATE REQUEST message" },
790 { 0x0E, "\"Periodic updating\" in the case of an EMM TRACKING AREA UPDATE REQUEST message" },
791 { 0, NULL }
794 /* 3GPP 31.111 - Chapter 8.112 */
795 static const string_string ims_status_code[] = {
796 { "100", "Trying" },
797 { "180", "Ringing" },
798 { "181", "Call Is Being Forwarded" },
799 { "182", "Queued" },
800 { "183", "Session Progress" },
801 { "200", "OK" },
802 { "300", "Multiple Choices" },
803 { "301", "Moved Permanently" },
804 { "302", "Moved Temporarily" },
805 { "305", "Use Proxy" },
806 { "380", "Alternative Service" },
807 { "400", "Bad Request" },
808 { "401", "Unauthorized" },
809 { "402", "Payment Required" },
810 { "403", "Forbidden" },
811 { "404", "Not Found" },
812 { "405", "Method Not Allowed" },
813 { "406", "Not Acceptable" },
814 { "407", "Proxy Authentication Required" },
815 { "408", "Request Timeout" },
816 { "410", "Gone" },
817 { "413", "Request Entity Too Large" },
818 { "414", "Request-URI Too Long" },
819 { "415", "Unsupported Media Type" },
820 { "416", "Unsupported URI Scheme" },
821 { "420", "Bad Extension" },
822 { "421", "Extension Required" },
823 { "423", "Interval Too Brief" },
824 { "480", "Temporarily Unavailable" },
825 { "481", "Call/Transaction Does Not Exist" },
826 { "482", "Loop Detected" },
827 { "483", "Too Many Hops" },
828 { "484", "Address Incomplete" },
829 { "485", "Ambiguous" },
830 { "486", "Busy Here" },
831 { "487", "Request Terminated" },
832 { "488", "Not Acceptable Here" },
833 { "491", "Request Pending" },
834 { "493", "Undecipherable" },
835 { "500", "Server Internal Error" },
836 { "501", "Not Implemented" },
837 { "502", "Bad Gateway" },
838 { "503", "Service Unavailable" },
839 { "504", "Server Time-out" },
840 { "505", "Version Not Supported" },
841 { "513", "Message Too Large" },
842 { "600", "Busy Everywhere" },
843 { "603", "Decline" },
844 { "604", "Does Not Exist Anywhere" },
845 { "606", "Not Acceptable" },
846 { 0, NULL }
849 static void
850 dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
852 proto_item *cat_ti;
853 proto_tree *cat_tree, *elem_tree;
854 unsigned int pos = 0;
855 tvbuff_t *new_tvb;
856 gboolean ims_event = FALSE;
858 cat_ti = proto_tree_add_item(tree, proto_cat, tvb, 0, -1, ENC_NA);
859 cat_tree = proto_item_add_subtree(cat_ti, ett_cat);
860 while (pos < tvb_length(tvb)) {
861 proto_item *ti;
862 guint8 g8;
863 guint16 tag;
864 guint32 len, i;
865 guint8 *ptr = NULL;
867 tag = tvb_get_guint8(tvb, pos++) & 0x7f;
868 if (tag == 0x7f) {
869 tag = tvb_get_ntohs(tvb, pos) & 0x7fff;
870 pos += 2;
872 len = tvb_get_guint8(tvb, pos++);
873 switch (len) {
874 case 0x81:
875 len = tvb_get_guint8(tvb, pos++);
876 break;
877 case 0x82:
878 len = tvb_get_ntohs(tvb, pos);
879 pos += 2;
880 break;
881 case 0x83:
882 len = tvb_get_ntoh24(tvb, pos);
883 pos += 3;
884 break;
885 default:
886 break;
889 #if 1
890 ti = proto_tree_add_bytes_format(cat_tree, hf_cat_tlv, tvb, pos,
891 len, ptr, "%s: %s",
892 val_to_str(tag, comp_tlv_tag_vals, "%02x"),
893 (const guint8 *)tvb_bytes_to_str(tvb, pos, len));
894 #else
895 ti = proto_tree_add_bytes_format(cat_tree, hf_cat_tlv, tvb, pos,
896 len, ptr, "%s: ",
897 val_to_str(tag, comp_tlv_tag_vals, "%02x"));
898 #endif
899 elem_tree = proto_item_add_subtree(ti, ett_elem);
901 switch (tag) {
902 case 0x01: /* command details */
903 if (len < 3)
904 break;
905 proto_tree_add_item(elem_tree, hf_ctlv_cmd_nr, tvb, pos, 1, ENC_NA);
906 proto_tree_add_item(elem_tree, hf_ctlv_cmd_type, tvb, pos+1, 1, ENC_NA);
907 /* append command type to INFO column */
908 g8 = tvb_get_guint8(tvb, pos+1);
909 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
910 val_to_str(g8, cmd_type_vals, "%02x "));
911 switch (g8) {
912 case 0x01:
913 proto_tree_add_item(elem_tree, hf_ctlv_cmd_qual_refresh, tvb, pos+2, 1, ENC_NA);
914 break;
915 case 0x13:
916 proto_tree_add_item(elem_tree, hf_ctlv_cmd_qual_send_short_msg, tvb, pos+2, 1, ENC_NA);
917 break;
918 case 0x26:
919 proto_tree_add_item(elem_tree, hf_ctlv_cmd_qual_loci, tvb, pos+2, 1, ENC_NA);
920 break;
921 case 0x27:
922 proto_tree_add_item(elem_tree, hf_ctlv_cmd_qual_timer_mgmt, tvb, pos+2, 1, ENC_NA);
923 break;
924 case 0x40:
925 proto_tree_add_item(elem_tree, hf_ctlv_cmd_qual, tvb, pos+2, 1, ENC_NA);
926 ims_event = TRUE;
927 break;
928 case 0x43:
929 proto_tree_add_item(elem_tree, hf_ctlv_cmd_qual_send_data, tvb, pos+2, 1, ENC_NA);
930 break;
931 default:
932 proto_tree_add_item(elem_tree, hf_ctlv_cmd_qual, tvb, pos+2, 1, ENC_NA);
933 break;
935 break;
936 case 0x02: /* device identity */
937 if (len < 2)
938 break;
939 proto_tree_add_item(elem_tree, hf_ctlv_devid_src, tvb, pos, 1, ENC_NA);
940 proto_tree_add_item(elem_tree, hf_ctlv_devid_dst, tvb, pos+1, 1, ENC_NA);
941 break;
942 case 0x03: /* Result */
943 g8 = tvb_get_guint8(tvb, pos);
944 proto_tree_add_item(elem_tree, hf_ctlv_result_gen, tvb, pos, 1, ENC_NA);
945 switch (g8) {
946 case 0x20:
947 proto_tree_add_item(elem_tree, hf_ctlv_result_term, tvb, pos+1, 1, ENC_NA);
948 break;
949 case 0x26:
950 proto_tree_add_item(elem_tree, hf_ctlv_result_launch_browser, tvb, pos+1, 1, ENC_NA);
951 break;
952 case 0x38:
953 proto_tree_add_item(elem_tree, hf_ctlv_result_multiplecard, tvb, pos+1, 1, ENC_NA);
954 break;
955 case 0x39:
956 proto_tree_add_item(elem_tree, hf_ctlv_result_cc_ctrl_mo_sm_ctrl, tvb, pos+1, 1, ENC_NA);
957 break;
958 case 0x3a:
959 proto_tree_add_item(elem_tree, hf_ctlv_result_bip, tvb, pos+1, 1, ENC_NA);
960 break;
961 case 0x3c:
962 proto_tree_add_item(elem_tree, hf_ctlv_result_frames_cmd, tvb, pos+1, 1, ENC_NA);
963 break;
964 default:
965 break;
967 break;
968 case 0x04: /* Duration */
969 if (len < 2)
970 break;
971 proto_tree_add_item(elem_tree, hf_ctlv_dur_time_intv, tvb, pos+1, 1, ENC_NA);
972 proto_tree_add_item(elem_tree, hf_ctlv_dur_time_unit, tvb, pos, 1, ENC_NA);
973 break;
974 case 0x05: /* alpha identifier */
975 break;
976 case 0x0b: /* sms tpdu */
977 new_tvb = tvb_new_subset(tvb, pos, len, len);
978 if (new_tvb) {
979 call_dissector_only(gsm_sms_handle, new_tvb, pinfo, elem_tree, NULL);
981 break;
982 case 0x0d: /* text string */
983 if (len == 0)
984 break;
985 /* 1st byte: encoding */
986 proto_tree_add_item(elem_tree, hf_ctlv_text_string_enc, tvb, pos, 1, ENC_NA);
987 g8 = tvb_get_guint8(tvb, pos);
988 switch (g8 & 0xf0) {
989 case 0x00:
990 g8 &= 0x0c;
991 break;
992 case 0xf0:
993 g8 &= 0x04;
994 break;
995 default:
996 break;
998 switch (g8) {
999 case 0x00: /* 7bit */
1001 int out_len;
1002 unsigned char msgbuf[300];
1004 out_len = gsm_sms_char_7bit_unpack(0, len-1, sizeof(msgbuf), tvb_get_ptr(tvb, pos+1, len-1), msgbuf);
1005 msgbuf[out_len] = '\0';
1006 proto_tree_add_unicode_string(elem_tree, hf_ctlv_text_string, tvb, pos+1,
1007 len-1, gsm_sms_chars_to_utf8(msgbuf, out_len));
1009 break;
1010 case 0x04: /* 8bit */
1011 proto_tree_add_item(elem_tree, hf_ctlv_text_string, tvb, pos+1, len-1, ENC_ASCII|ENC_NA);
1012 break;
1013 case 0x08: /* UCS2 */
1015 GIConv cd;
1016 GError *l_conv_error = NULL;
1017 gchar *utf8_text;
1019 if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv)-1) {
1020 utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb, pos+1, len-1), len-1, cd, NULL, NULL, &l_conv_error);
1021 if(!l_conv_error) {
1022 proto_tree_add_unicode_string(elem_tree, hf_ctlv_text_string, tvb,
1023 pos+1, len-1, utf8_text);
1024 } else {
1025 proto_tree_add_text(elem_tree, tvb, pos+1, len-1, "Failed to decode UCS2");
1029 break;
1030 default:
1031 break;
1033 break;
1034 case 0x0e: /* tone */
1035 if (len < 1)
1036 break;
1037 proto_tree_add_item(elem_tree, hf_ctlv_tone, tvb, pos, 1, ENC_NA);
1038 break;
1039 case 0x13: /* location information */
1040 /* MCC/MNC / LAC / CellID */
1041 dissect_e212_mcc_mnc(tvb, pinfo, elem_tree, pos, TRUE);
1042 proto_tree_add_item(elem_tree, hf_ctlv_loci_lac, tvb, pos+3, 2, ENC_BIG_ENDIAN);
1043 if (len == 5)
1044 break;
1045 proto_tree_add_item(elem_tree, hf_ctlv_loci_cell_id, tvb, pos+5, 2, ENC_BIG_ENDIAN);
1046 if (len == 7)
1047 break;
1048 proto_tree_add_item(elem_tree, hf_ctlv_loci_ext_cell_id, tvb, pos+7, 2, ENC_BIG_ENDIAN);
1049 break;
1050 case 0x14: /* IMEI */
1051 case 0x62: /* IMEISV */
1052 de_mid(tvb, elem_tree, pinfo, pos, len, NULL, 0);
1053 break;
1054 case 0x19: /* event list */
1055 for (i = 0; i < len; i++) {
1056 guint8 event = tvb_get_guint8(tvb, pos+i);
1057 if ((event == 0x17) || (event == 0x18)) {
1058 ims_event = TRUE;
1060 proto_tree_add_uint(elem_tree, hf_ctlv_event, tvb, pos+i, 1, event);
1061 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
1062 val_to_str(event, event_list_vals, "%02x "));
1064 break;
1065 case 0x1b: /* location status */
1066 for (i = 0; i < len; i++)
1067 proto_tree_add_item(elem_tree, hf_ctlv_loc_status, tvb, pos+i, 1, ENC_NA);
1068 break;
1069 case 0x25: /* timer value */
1071 guint8 oct;
1072 oct = tvb_get_guint8(tvb, pos);
1073 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);
1074 oct = tvb_get_guint8(tvb, pos+1);
1075 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);
1076 oct = tvb_get_guint8(tvb, pos+2);
1077 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);
1079 break;
1080 case 0x26: /* date-time and time zone */
1082 guint8 oct, tz;
1083 oct = tvb_get_guint8(tvb, pos);
1084 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);
1085 oct = tvb_get_guint8(tvb, pos+1);
1086 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);
1087 oct = tvb_get_guint8(tvb, pos+2);
1088 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);
1089 oct = tvb_get_guint8(tvb, pos+3);
1090 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);
1091 oct = tvb_get_guint8(tvb, pos+4);
1092 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);
1093 oct = tvb_get_guint8(tvb, pos+5);
1094 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);
1095 oct = tvb_get_guint8(tvb, pos+6);
1096 if (oct == 0xff) {
1097 proto_tree_add_uint_format_value(elem_tree, hf_ctlv_date_time_tz, tvb, pos+6, 1, oct, "Unknown (0x%02x)", oct);
1098 } else {
1099 tz = (oct >> 4) + (oct & 0x07) * 10;
1100 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)",
1101 (oct & 0x08)?'-':'+', tz/4, (tz%4)*15, oct);
1104 break;
1105 case 0x28: /* AT Command */
1106 proto_tree_add_item(elem_tree, hf_ctlv_at_cmd, tvb, pos, len, ENC_ASCII|ENC_NA);
1107 break;
1108 case 0x29: /* AT Response */
1109 proto_tree_add_item(elem_tree, hf_ctlv_at_rsp, tvb, pos, len, ENC_ASCII|ENC_NA);
1110 break;
1111 case 0x2d: /* language */
1112 proto_tree_add_item(elem_tree, hf_ctlv_language, tvb, pos, len, ENC_ASCII|ENC_NA);
1113 break;
1114 case 0x2e: /* Timing Advance */
1115 proto_tree_add_item(elem_tree, hf_ctlv_me_status, tvb, pos, 1, ENC_NA);
1116 proto_tree_add_item(elem_tree, hf_ctlv_timing_adv, tvb, pos+1, 1, ENC_NA);
1117 break;
1118 case 0x32: /* bearer */
1119 for (i = 0; i < len; i++)
1120 proto_tree_add_item(elem_tree, hf_ctlv_bearer, tvb, pos+i, 1, ENC_NA);
1121 break;
1122 case 0x35: /* bearer description */
1123 g8 = tvb_get_guint8(tvb, pos);
1124 proto_tree_add_uint(elem_tree, hf_ctlv_bearer_descr, tvb, pos, 1, g8);
1125 switch (g8) {
1126 case 0x01:
1127 proto_tree_add_item(elem_tree, hf_ctlv_bearer_csd_data_rate, tvb, pos+1, 1, ENC_BIG_ENDIAN);
1128 proto_tree_add_item(elem_tree, hf_ctlv_bearer_csd_bearer_serv, tvb, pos+2, 1, ENC_BIG_ENDIAN);
1129 proto_tree_add_item(elem_tree, hf_ctlv_bearer_csd_conn_elem, tvb, pos+3, 1, ENC_BIG_ENDIAN);
1130 break;
1131 case 0x02:
1132 proto_tree_add_item(elem_tree, hf_ctlv_bearer_gprs_precedence, tvb, pos+1, 1, ENC_BIG_ENDIAN);
1133 proto_tree_add_item(elem_tree, hf_ctlv_bearer_gprs_delay, tvb, pos+2, 1, ENC_BIG_ENDIAN);
1134 proto_tree_add_item(elem_tree, hf_ctlv_bearer_gprs_reliability, tvb, pos+3, 1, ENC_BIG_ENDIAN);
1135 proto_tree_add_item(elem_tree, hf_ctlv_bearer_gprs_peak, tvb, pos+4, 1, ENC_BIG_ENDIAN);
1136 proto_tree_add_item(elem_tree, hf_ctlv_bearer_gprs_mean, tvb, pos+5, 1, ENC_BIG_ENDIAN);
1137 proto_tree_add_item(elem_tree, hf_ctlv_bearer_gprs_prot_type, tvb, pos+6, 1, ENC_BIG_ENDIAN);
1138 break;
1139 case 0x09:
1140 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_traffic_class, tvb, pos+1, 1, ENC_BIG_ENDIAN);
1141 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_max_bitrate_ul, tvb, pos+2, 2, ENC_BIG_ENDIAN);
1142 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_max_bitrate_dl, tvb, pos+4, 2, ENC_BIG_ENDIAN);
1143 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_guaranteed_bitrate_ul, tvb, pos+6, 2, ENC_BIG_ENDIAN);
1144 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_guaranteed_bitrate_dl, tvb, pos+8, 2, ENC_BIG_ENDIAN);
1145 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_delivery_order, tvb, pos+10, 1, ENC_BIG_ENDIAN);
1146 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_max_sdu_size, tvb, pos+11, 1, ENC_BIG_ENDIAN);
1147 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_sdu_error_ratio, tvb, pos+12, 1, ENC_BIG_ENDIAN);
1148 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_residual_bit_error_ratio, tvb, pos+13, 1, ENC_BIG_ENDIAN);
1149 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_delivery_erroneous_sdus, tvb, pos+14, 1, ENC_BIG_ENDIAN);
1150 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_transfer_delay, tvb, pos+15, 1, ENC_BIG_ENDIAN);
1151 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_traffic_handling_prio, tvb, pos+16, 1, ENC_BIG_ENDIAN);
1152 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_pdp_type, tvb, pos+1, 17, ENC_BIG_ENDIAN);
1153 break;
1154 case 0x0a:
1155 break;
1156 case 0x0b:
1157 de_esm_qos(tvb, elem_tree, pinfo, pos+1, len-2, NULL, 0);
1158 proto_tree_add_item(elem_tree, hf_ctlv_bearer_utran_pdp_type, tvb, pos+len-1, 1, ENC_BIG_ENDIAN);
1159 break;
1160 default:
1161 if (len > 1) {
1162 proto_tree_add_item(elem_tree, hf_ctlv_bearer_params, tvb, pos+1, len-1, ENC_NA);
1164 break;
1166 break;
1167 case 0x39: /* buffer size */
1168 proto_tree_add_item(elem_tree, hf_ctlv_buffers_size, tvb, pos, 2, ENC_BIG_ENDIAN);
1169 break;
1170 case 0x3c: /* UICC/terminal interface transport level */
1171 if (len < 3)
1172 break;
1173 proto_tree_add_item(elem_tree, hf_ctlv_transport_ptype, tvb, pos, 1, ENC_NA);
1174 proto_tree_add_item(elem_tree, hf_ctlv_transport_port, tvb, pos+1, 2, ENC_BIG_ENDIAN);
1175 break;
1176 case 0x3e: /* other address */
1177 g8 = tvb_get_guint8(tvb, pos);
1178 proto_tree_add_uint(elem_tree, hf_ctlv_other_address_coding, tvb, pos, 1, g8);
1179 switch (g8) {
1180 case 0x21:
1181 proto_tree_add_item(elem_tree, hf_ctlv_other_address_ipv4, tvb, pos+1, 4, ENC_NA);
1182 break;
1183 case 0x57:
1184 proto_tree_add_item(elem_tree, hf_ctlv_other_address_ipv6, tvb, pos+1, 16, ENC_NA);
1185 break;
1186 default:
1187 break;
1189 break;
1190 case 0x3f: /* access technology */
1191 for (i = 0; i < len; i++)
1192 proto_tree_add_item(elem_tree, hf_ctlv_access_tech, tvb, pos+i, 1, ENC_NA);
1193 break;
1194 case 0x47: /* network access name */
1195 de_sm_apn(tvb, elem_tree, pinfo, pos, len, NULL, 0);
1196 break;
1197 case 0x69: /* UTRAN EUTRAN measurement qualifier */
1198 proto_tree_add_item(elem_tree, hf_ctlv_utran_eutran_meas_qual, tvb, pos, 1, ENC_NA);
1199 break;
1200 case 0x73: /* Routing Area Information */
1201 de_gmm_rai(tvb, elem_tree, pinfo, pos, len, NULL, 0);
1202 break;
1203 case 0x74: /* Update/Attach Type */
1204 proto_tree_add_item(elem_tree, hf_ctlv_upd_attach_type, tvb, pos, 1, ENC_NA);
1205 break;
1206 case 0x76: /* Geographical Location Parameters / IARI */
1207 if (ims_event) {
1208 proto_tree_add_unicode_string(elem_tree, hf_ctlv_iari, tvb, pos, len,
1209 tvb_get_string_enc(wmem_packet_scope(), tvb, pos, len, ENC_UTF_8 | ENC_NA));
1211 break;
1212 case 0x77: /* GAD Shapes / IMPU list */
1213 if (ims_event) {
1214 i = 0;
1215 while (i < len) {
1216 if (tvb_get_guint8(tvb, pos+i) == 0x80) {
1217 g8 = tvb_get_guint8(tvb, pos+i+1);
1218 proto_tree_add_unicode_string(elem_tree, hf_ctlv_impu, tvb, pos+i+2, g8,
1219 tvb_get_string_enc(wmem_packet_scope(), tvb, pos+i+2, g8, ENC_UTF_8 | ENC_NA));
1220 i += 2+g8;
1221 } else {
1222 break;
1226 break;
1227 case 0x78: /* NMEA sentence / IMS Status-Code */
1228 if (ims_event) {
1229 guint8 *status_code = tvb_get_string(wmem_packet_scope(), tvb, pos, len);
1230 proto_tree_add_string_format_value(elem_tree, hf_ctlv_ims_status_code, tvb, pos, len,
1231 status_code, "%s (%s)", status_code, str_to_str(status_code, ims_status_code, "Unknown"));
1233 break;
1234 case 0x79: /* PLMN list */
1235 for (i = 0; i < len; i+=3) {
1236 dissect_e212_mcc_mnc(tvb, pinfo, elem_tree, pos+3*i, TRUE);
1238 break;
1239 case 0x7c: /* EPS PDN connection activation parameters */
1240 nas_esm_pdn_con_req(tvb, elem_tree, pinfo, pos, len);
1241 break;
1242 case 0x7d: /* Tracking Area Identification */
1243 de_emm_trac_area_id(tvb, elem_tree, pinfo, pos, 5, NULL, 0);
1244 break;
1245 default:
1246 break;
1249 pos += len;
1253 void
1254 proto_register_card_app_toolkit(void)
1256 static hf_register_info hf[] = {
1257 { &hf_cat_tlv,
1258 { "COMPREHENSIVE-TLV", "etsi_cat.comp_tlv",
1259 FT_BYTES, BASE_NONE, NULL, 0,
1260 NULL, HFILL },
1262 { &hf_ctlv_devid_src,
1263 { "Source Device ID", "etsi_cat.comp_tlv.src_dev",
1264 FT_UINT8, BASE_HEX, VALS(dev_id_vals), 0,
1265 NULL, HFILL },
1267 { &hf_ctlv_devid_dst,
1268 { "Destination Device ID", "etsi_cat.comp_tlv.dst_dev",
1269 FT_UINT8, BASE_HEX, VALS(dev_id_vals), 0,
1270 NULL, HFILL },
1272 { &hf_ctlv_cmd_nr,
1273 { "Command Number", "etsi_cat.comp_tlv.cmd_nr",
1274 FT_UINT8, BASE_HEX, NULL, 0,
1275 NULL, HFILL },
1277 { &hf_ctlv_cmd_type,
1278 { "Command Type", "etsi_cat.comp_tlv.cmd_type",
1279 FT_UINT8, BASE_HEX, VALS(cmd_type_vals), 0,
1280 NULL, HFILL },
1282 { &hf_ctlv_cmd_qual_refresh,
1283 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.refresh",
1284 FT_UINT8, BASE_HEX, VALS(cmd_qual_refresh_vals), 0,
1285 NULL, HFILL },
1287 { &hf_ctlv_cmd_qual_send_short_msg,
1288 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.send_short_msg",
1289 FT_BOOLEAN, 8, TFS(&cmd_qual_send_short_msg_value), 0x01,
1290 NULL, HFILL },
1292 { &hf_ctlv_cmd_qual_loci,
1293 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.loci",
1294 FT_UINT8, BASE_HEX, VALS(cmd_qual_loci_vals), 0,
1295 NULL, HFILL },
1297 { &hf_ctlv_cmd_qual_timer_mgmt,
1298 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.timer_mgmt",
1299 FT_UINT8, BASE_HEX, VALS(cmd_qual_timer_mgmt_vals), 0x03,
1300 NULL, HFILL },
1302 { &hf_ctlv_cmd_qual_send_data,
1303 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual.send_data",
1304 FT_BOOLEAN, 8, TFS(&cmd_qual_send_data_value), 0x01,
1305 NULL, HFILL },
1307 { &hf_ctlv_cmd_qual,
1308 { "Command Qualifier", "etsi_cat.comp_tlv.cmd_qual",
1309 FT_UINT8, BASE_HEX, NULL, 0,
1310 NULL, HFILL },
1312 { &hf_ctlv_dur_time_intv,
1313 { "Time Interval", "etsi_cat.comp_tlv.time_interval",
1314 FT_UINT8, BASE_DEC, NULL, 0,
1315 NULL, HFILL },
1317 { &hf_ctlv_dur_time_unit,
1318 { "Time Unit", "etsi_cat.comp_tlv.time_unit",
1319 FT_UINT8, BASE_HEX, VALS(time_unit_vals), 0,
1320 NULL, HFILL },
1322 { &hf_ctlv_result_gen,
1323 { "Result", "etsi_cat.comp_tlv.result",
1324 FT_UINT8, BASE_HEX, VALS(result_vals), 0,
1325 NULL, HFILL },
1327 { &hf_ctlv_result_term,
1328 { "Additional information", "etsi_cat.comp_tlv.result.term",
1329 FT_UINT8, BASE_HEX, VALS(result_term_vals), 0,
1330 NULL, HFILL },
1332 { &hf_ctlv_result_launch_browser,
1333 { "Additional information", "etsi_cat.comp_tlv.result.launch_browser",
1334 FT_UINT8, BASE_HEX, VALS(result_launch_browser_vals), 0,
1335 NULL, HFILL },
1337 { &hf_ctlv_result_multiplecard,
1338 { "Additional information", "etsi_cat.comp_tlv.result.multiplecard",
1339 FT_UINT8, BASE_HEX, VALS(result_multiplecard_vals), 0,
1340 NULL, HFILL },
1342 { &hf_ctlv_result_cc_ctrl_mo_sm_ctrl,
1343 { "Additional information", "etsi_cat.comp_tlv.result.cc_ctrl_mo_sm_ctrl",
1344 FT_UINT8, BASE_HEX, VALS(result_cc_ctrl_mo_sm_ctrl_vals), 0,
1345 NULL, HFILL },
1347 { &hf_ctlv_result_bip,
1348 { "Additional information", "etsi_cat.comp_tlv.result.bip",
1349 FT_UINT8, BASE_HEX, VALS(result_bip_vals), 0,
1350 NULL, HFILL },
1352 { &hf_ctlv_result_frames_cmd,
1353 { "Additional information", "etsi_cat.comp_tlv.result.frames_cmd",
1354 FT_UINT8, BASE_HEX, VALS(result_frames_cmd_vals), 0,
1355 NULL, HFILL },
1357 { &hf_ctlv_text_string_enc,
1358 { "Text String Encoding", "etsi_cat.comp_tlv.text_encoding",
1359 FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(text_encoding_vals), 0,
1360 NULL, HFILL },
1362 { &hf_ctlv_text_string,
1363 { "Text String", "etsi_cat.comp_tlv.text",
1364 FT_STRING, BASE_NONE, NULL, 0,
1365 NULL, HFILL },
1367 { &hf_ctlv_event,
1368 { "Event", "etsi_cat.comp_tlv.event",
1369 FT_UINT8, BASE_HEX, VALS(event_list_vals), 0,
1370 NULL, HFILL },
1372 { &hf_ctlv_tone,
1373 { "Tone", "etsi_cat.comp_tlv.tone",
1374 FT_UINT8, BASE_HEX, VALS(tone_vals), 0,
1375 NULL, HFILL },
1377 { &hf_ctlv_loc_status,
1378 { "Location Status", "etsi_cat.comp_tlv.loc_status",
1379 FT_UINT8, BASE_HEX, VALS(loc_status_vals), 0,
1380 NULL, HFILL },
1382 { &hf_ctlv_timer_val_hr,
1383 { "Hours", "etsi_cat.comp_tlv.timer_val.hr",
1384 FT_UINT8, BASE_HEX, NULL, 0,
1385 NULL, HFILL },
1387 { &hf_ctlv_timer_val_min,
1388 { "Minutes", "etsi_cat.comp_tlv.timer_val.min",
1389 FT_UINT8, BASE_HEX, NULL, 0,
1390 NULL, HFILL },
1392 { &hf_ctlv_timer_val_sec,
1393 { "Seconds", "etsi_cat.comp_tlv.timer_val.sec",
1394 FT_UINT8, BASE_HEX, NULL, 0,
1395 NULL, HFILL },
1397 { &hf_ctlv_date_time_yr,
1398 { "Year", "etsi_cat.comp_tlv.date_time.yr",
1399 FT_UINT8, BASE_HEX, NULL, 0,
1400 NULL, HFILL },
1402 { &hf_ctlv_date_time_mo,
1403 { "Month", "etsi_cat.comp_tlv.date_time.mo",
1404 FT_UINT8, BASE_HEX, NULL, 0,
1405 NULL, HFILL },
1407 { &hf_ctlv_date_time_day,
1408 { "Day", "etsi_cat.comp_tlv.date_time.day",
1409 FT_UINT8, BASE_HEX, NULL, 0,
1410 NULL, HFILL },
1412 { &hf_ctlv_date_time_hr,
1413 { "Hours", "etsi_cat.comp_tlv.date_time.hr",
1414 FT_UINT8, BASE_HEX, NULL, 0,
1415 NULL, HFILL },
1417 { &hf_ctlv_date_time_min,
1418 { "Minutes", "etsi_cat.comp_tlv.date_time.min",
1419 FT_UINT8, BASE_HEX, NULL, 0,
1420 NULL, HFILL },
1422 { &hf_ctlv_date_time_sec,
1423 { "Seconds", "etsi_cat.comp_tlv.date_time.sec",
1424 FT_UINT8, BASE_HEX, NULL, 0,
1425 NULL, HFILL },
1427 { &hf_ctlv_date_time_tz,
1428 { "Time Zone", "etsi_cat.comp_tlv.date_time.tz",
1429 FT_UINT8, BASE_HEX, NULL, 0,
1430 NULL, HFILL },
1432 { &hf_ctlv_at_cmd,
1433 { "AT Command", "etsi_cat.comp_tlv.at_cmd",
1434 FT_STRING, BASE_NONE, NULL, 0,
1435 NULL, HFILL },
1437 { &hf_ctlv_at_rsp,
1438 { "AT Response", "etsi_cat.comp_tlv.at_rsp",
1439 FT_STRING, BASE_NONE, NULL, 0,
1440 NULL, HFILL },
1442 { &hf_ctlv_language,
1443 { "Language", "etsi_cat.comp_tlv.language",
1444 FT_STRING, BASE_NONE, NULL, 0,
1445 NULL, HFILL },
1447 { &hf_ctlv_me_status,
1448 { "ME Status", "etsi_cat.comp_tlv.me_status",
1449 FT_UINT8, BASE_DEC, VALS(me_status_vals), 0,
1450 NULL, HFILL },
1452 { &hf_ctlv_timing_adv,
1453 { "Timing Advance", "etsi_cat.comp_tlv.timing_adv",
1454 FT_UINT8, BASE_DEC, NULL, 0,
1455 NULL, HFILL },
1457 { &hf_ctlv_bearer,
1458 { "Bearer", "etsi_cat.comp_tlv.bearer",
1459 FT_UINT8, BASE_HEX, VALS(bearer_vals), 0,
1460 NULL, HFILL },
1462 { &hf_ctlv_bearer_descr,
1463 { "Bearer Description", "etsi_cat.comp_tlv.bearer.descr",
1464 FT_UINT8, BASE_HEX, VALS(bearer_descr_vals), 0,
1465 NULL, HFILL },
1467 { &hf_ctlv_bearer_csd_data_rate,
1468 { "Data Rate", "etsi_cat.comp_tlv.bearer.csd.data_rate",
1469 FT_UINT8, BASE_DEC, VALS(csd_data_rate_vals), 0,
1470 NULL, HFILL },
1472 { &hf_ctlv_bearer_csd_bearer_serv,
1473 { "Bearer Service", "etsi_cat.comp_tlv.bearer.csd.bearer_serv",
1474 FT_UINT8, BASE_DEC, VALS(csd_bearer_serv_vals), 0,
1475 NULL, HFILL },
1477 { &hf_ctlv_bearer_csd_conn_elem,
1478 { "Connection Element", "etsi_cat.comp_tlv.bearer.csd.conn_elem",
1479 FT_UINT8, BASE_DEC, VALS(csd_conn_elem_vals), 0,
1480 NULL, HFILL },
1482 { &hf_ctlv_bearer_gprs_precedence,
1483 { "Precedence Class", "etsi_cat.comp_tlv.bearer.gprs.precedence",
1484 FT_UINT8, BASE_DEC, NULL, 0,
1485 NULL, HFILL },
1487 { &hf_ctlv_bearer_gprs_delay,
1488 { "Delay Class", "etsi_cat.comp_tlv.bearer.gprs.delay",
1489 FT_UINT8, BASE_DEC, NULL, 0,
1490 NULL, HFILL },
1492 { &hf_ctlv_bearer_gprs_reliability,
1493 { "Reliability Class", "etsi_cat.comp_tlv.bearer.gprs.reliability",
1494 FT_UINT8, BASE_DEC, NULL, 0,
1495 NULL, HFILL },
1497 { &hf_ctlv_bearer_gprs_peak,
1498 { "Peak Throughput Class", "etsi_cat.comp_tlv.bearer.gprs.peak",
1499 FT_UINT8, BASE_DEC, NULL, 0,
1500 NULL, HFILL },
1502 { &hf_ctlv_bearer_gprs_mean,
1503 { "Mean Throuhgput Class", "etsi_cat.comp_tlv.bearer.gprs.mean",
1504 FT_UINT8, BASE_DEC, NULL, 0,
1505 NULL, HFILL },
1507 { &hf_ctlv_bearer_gprs_prot_type,
1508 { "Packet Data Protocol Type", "etsi_cat.comp_tlv.bearer.gprs.prot_type",
1509 FT_UINT8, BASE_DEC, VALS(gprs_prot_type_vals), 0,
1510 NULL, HFILL },
1512 { &hf_ctlv_bearer_utran_traffic_class,
1513 { "Traffic Class", "etsi_cat.comp_tlv.bearer.utran.traffic_class",
1514 FT_UINT8, BASE_DEC, VALS(utran_traffic_class_vals), 0,
1515 NULL, HFILL },
1517 { &hf_ctlv_bearer_utran_max_bitrate_ul,
1518 { "Maximum Bitrate UL", "etsi_cat.comp_tlv.bearer.utran.max_bitrate_ul",
1519 FT_UINT16, BASE_DEC, NULL, 0,
1520 NULL, HFILL },
1522 { &hf_ctlv_bearer_utran_max_bitrate_dl,
1523 { "Maximum Bitrate DL", "etsi_cat.comp_tlv.bearer.utran.max_bitrate_dl",
1524 FT_UINT16, BASE_DEC, NULL, 0,
1525 NULL, HFILL },
1527 { &hf_ctlv_bearer_utran_guaranteed_bitrate_ul,
1528 { "Guaranteed Bitrate DL", "etsi_cat.comp_tlv.bearer.utran.guaranteed_bitrate_ul",
1529 FT_UINT16, BASE_DEC, NULL, 0,
1530 NULL, HFILL },
1532 { &hf_ctlv_bearer_utran_guaranteed_bitrate_dl,
1533 { "Guaranteed Bitrate DL", "etsi_cat.comp_tlv.bearer.utran.guaranteed_bitrate_dl",
1534 FT_UINT16, BASE_DEC, NULL, 0,
1535 NULL, HFILL },
1537 { &hf_ctlv_bearer_utran_delivery_order,
1538 { "Delivery Order", "etsi_cat.comp_tlv.bearer.utran.delivery_order",
1539 FT_UINT8, BASE_DEC, VALS(utran_delivery_order_vals), 0,
1540 NULL, HFILL },
1542 { &hf_ctlv_bearer_utran_max_sdu_size,
1543 { "Maximum SDU Size", "etsi_cat.comp_tlv.bearer.utran.max_sdu_size",
1544 FT_UINT8, BASE_DEC, NULL, 0,
1545 NULL, HFILL },
1547 { &hf_ctlv_bearer_utran_sdu_error_ratio,
1548 { "SDU Error Ratio", "etsi_cat.comp_tlv.bearer.utran.sdu_error_ratio",
1549 FT_UINT8, BASE_DEC, NULL, 0,
1550 NULL, HFILL },
1552 { &hf_ctlv_bearer_utran_residual_bit_error_ratio,
1553 { "Residual Bit Error Ratio", "etsi_cat.comp_tlv.bearer.utran.residual_bit_error_ratio",
1554 FT_UINT8, BASE_DEC, NULL, 0,
1555 NULL, HFILL },
1557 { &hf_ctlv_bearer_utran_delivery_erroneous_sdus,
1558 { "Delivery of Erroneous SDUs", "etsi_cat.comp_tlv.bearer.utran.delivery_erroneous_sdus",
1559 FT_UINT8, BASE_DEC, VALS(utran_delivery_erroneous_sdus_vals), 0,
1560 NULL, HFILL },
1562 { &hf_ctlv_bearer_utran_transfer_delay,
1563 { "Transfer Delay", "etsi_cat.comp_tlv.bearer.utran.transfer_delay",
1564 FT_UINT8, BASE_DEC, NULL, 0,
1565 NULL, HFILL },
1567 { &hf_ctlv_bearer_utran_traffic_handling_prio,
1568 { "Traffic Handling Priority", "etsi_cat.comp_tlv.bearer.utran.traffic_handling_prio",
1569 FT_UINT8, BASE_DEC, NULL, 0,
1570 NULL, HFILL },
1572 { &hf_ctlv_bearer_utran_pdp_type,
1573 { "PDP Type", "etsi_cat.comp_tlv.bearer.utran.pdp_type",
1574 FT_UINT8, BASE_DEC, VALS(pdp_type_vals), 0,
1575 NULL, HFILL },
1577 { &hf_ctlv_bearer_params,
1578 { "Bearer Parameters", "etsi_cat.comp_tlv.bearer.params",
1579 FT_BYTES, BASE_NONE, NULL, 0,
1580 NULL, HFILL },
1582 { &hf_ctlv_buffers_size,
1583 { "Buffer Size", "etsi_cat.comp_tlv.buffer_size",
1584 FT_UINT16, BASE_DEC, NULL, 0,
1585 NULL, HFILL },
1587 { &hf_ctlv_transport_ptype,
1588 { "Transport protocol type", "etsi_cat.comp_tlv.transport.ptype",
1589 FT_UINT8, BASE_HEX, VALS(transport_ptype_vals), 0,
1590 NULL, HFILL },
1592 { &hf_ctlv_transport_port,
1593 { "Transport port", "etsi_cat.comp_tlv.transport.port",
1594 FT_UINT16, BASE_DEC, NULL, 0,
1595 NULL, HFILL },
1597 { &hf_ctlv_other_address_coding,
1598 { "Coding of Type of address", "etsi_cat.comp_tlv.other_address.coding",
1599 FT_UINT8, BASE_HEX, VALS(other_address_coding_vals), 0,
1600 NULL, HFILL },
1602 { &hf_ctlv_other_address_ipv4,
1603 { "IPv4 address", "etsi_cat.comp_tlv.other_address.ipv4",
1604 FT_IPv4, BASE_NONE, NULL, 0,
1605 NULL, HFILL },
1607 { &hf_ctlv_other_address_ipv6,
1608 { "IPv4 address", "etsi_cat.comp_tlv.other_address.ipv6",
1609 FT_IPv6, BASE_NONE, NULL, 0,
1610 NULL, HFILL },
1612 { &hf_ctlv_access_tech,
1613 { "Access technology", "etsi_cat.comp_tlv.access_tech",
1614 FT_UINT8, BASE_HEX, VALS(access_tech_vals), 0,
1615 NULL, HFILL },
1617 { &hf_ctlv_utran_eutran_meas_qual,
1618 { "UTRAN/E-UTRAN Measurement Qualifier", "etsi_cat.comp_tlv.utran_eutran_meas_qual",
1619 FT_UINT8, BASE_HEX, VALS(utran_eutran_meas_qual_vals), 0,
1620 NULL, HFILL },
1622 { &hf_ctlv_upd_attach_type,
1623 { "UTRAN/E-UTRAN Measurement Qualifier", "etsi_cat.comp_tlv.upd_attach_type",
1624 FT_UINT8, BASE_HEX, VALS(upd_attach_type_vals), 0,
1625 NULL, HFILL },
1627 { &hf_ctlv_loci_lac,
1628 { "Location Area Code / Tracking Area Code", "etsi_cat.comp_tlv.loci.lac",
1629 FT_UINT16, BASE_HEX, NULL, 0,
1630 NULL, HFILL },
1632 { &hf_ctlv_loci_cell_id,
1633 { "Cell ID", "etsi_cat.comp_tlv.loci.cell_id",
1634 FT_UINT16, BASE_HEX, NULL, 0,
1635 NULL, HFILL },
1637 { &hf_ctlv_loci_ext_cell_id,
1638 { "Extended Cell ID", "etsi_cat.comp_tlv.loci.ext_cell_id",
1639 FT_UINT16, BASE_HEX, NULL, 0,
1640 NULL, HFILL },
1642 { &hf_ctlv_iari,
1643 { "IARI", "etsi_cat.comp_tlv.iari",
1644 FT_STRING, BASE_NONE, NULL, 0,
1645 NULL, HFILL },
1647 { &hf_ctlv_impu,
1648 { "IMPU", "etsi_cat.comp_tlv.impu",
1649 FT_STRING, BASE_NONE, NULL, 0,
1650 NULL, HFILL },
1652 { &hf_ctlv_ims_status_code,
1653 { "IMS Status-Code", "etsi_cat.comp_tlv.ims_status_code",
1654 FT_STRING, BASE_NONE, NULL, 0,
1655 NULL, HFILL },
1658 static gint *ett[] = {
1659 &ett_cat,
1660 &ett_elem,
1663 proto_cat = proto_register_protocol("Card Application Tookit ETSI TS 102.223", "ETSI CAT",
1664 "etsi_cat");
1666 proto_register_field_array(proto_cat, hf, array_length(hf));
1668 proto_register_subtree_array(ett, array_length(ett));
1670 register_dissector("etsi_cat", dissect_cat, proto_cat);
1673 /* This function is called once at startup and every time the user hits
1674 * 'apply' in the preferences dialogue */
1675 void
1676 proto_reg_handoff_card_app_toolkit(void)
1678 gsm_sms_handle = find_dissector("gsm_sms");