Coverage Report

Created: 2025-12-27 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-isi.c
Line
Count
Source
1
/* packet-isi.c
2
 * Dissector for Nokia's Intelligent Service Interface protocol
3
 * Copyright 2010, Sebastian Reichel <sre@ring0.de>
4
 * Copyright 2010, Tyson Key <tyson.key@gmail.com>
5
 *
6
 * Wireshark - Network traffic analyzer
7
 * By Gerald Combs <gerald@wireshark.org>
8
 * Copyright 1998 Gerald Combs
9
 *
10
 * SPDX-License-Identifier: GPL-2.0-or-later
11
 */
12
13
#include "config.h"
14
15
#include <epan/prefs.h>
16
#include <epan/expert.h>
17
#include <epan/packet.h>
18
19
#include "packet-sll.h"
20
#include "packet-e212.h"
21
22
void proto_register_isi(void);
23
void proto_reg_handoff_isi(void);
24
25
/* Dissector table for the isi resource */
26
static dissector_table_t isi_resource_dissector_table;
27
28
static const value_string hf_isi_device[] = {
29
  {0x00, "Modem" },
30
  {0x6c, "Host" },
31
  {0xFF, "Any" },
32
  {0x00, NULL },
33
};
34
35
static const value_string hf_isi_resource[] = {
36
  {0x01, "Call"},
37
  {0x02, "SMS"},
38
  {0x06, "Subscriber Services"},
39
  {0x08, "SIM Authentication"},
40
  {0x09, "SIM"},
41
  {0x0A, "Network"},
42
  {0x10, "Indication"},
43
  {0x15, "MTC"},
44
  {0x1B, "Phone Information"},
45
  {0x31, "GPRS"},
46
  {0x32, "General Stack Server"}, /* Mysterious type 50 - I don't know what this is*/
47
  {0x54, "GPS"},
48
  {0x62, "EPOC Info"},
49
  {0xB4, "Radio Settings"}, /* Mysterious type 180? */
50
  {0x00, NULL }
51
};
52
53
static const value_string isi_sim_auth_id[] = {
54
  {0x01, "SIM_AUTH_PROTECTED_REQ"},
55
  {0x02, "SIM_AUTH_PROTECTED_RESP"},
56
  {0x04, "SIM_AUTH_UPDATE_REQ"},
57
  {0x05, "SIM_AUTH_UPDATE_SUCCESS_RESP"},
58
  {0x06, "SIM_AUTH_UPDATE_FAIL_RESP"},
59
  {0x07, "SIM_AUTH_REQ"},
60
  {0x08, "SIM_AUTH_SUCCESS_RESP"},
61
  {0x09, "SIM_AUTH_FAIL_RESP"},
62
  {0x10, "SIM_AUTH_STATUS_IND"},
63
  {0x11, "SIM_AUTH_STATUS_REQ"},
64
  {0x12, "SIM_AUTH_STATUS_RESP"},
65
  {0x00, NULL }
66
};
67
68
static const value_string isi_sim_auth_pw_type[] = {
69
  {0x02, "SIM_AUTH_PIN"},
70
  {0x03, "SIM_AUTH_PUK"},
71
  {0x63, "SIM_AUTH_NONE"},
72
  {0x00, NULL}
73
};
74
75
static const value_string isi_sim_auth_protection_req[] = {
76
  {0x00, "SIM_AUTH_PROTECTION_DISABLE"},
77
  {0x01, "SIM_AUTH_PROTECTION_ENABLE"},
78
  {0x04, "SIM_AUTH_PROTECTION_STATUS"},
79
  {0x00, NULL}
80
};
81
82
static const value_string isi_sim_auth_resp[] = {
83
  {0x02, "SIM_AUTH_STATUS_RESP_NEED_PIN"},
84
  {0x03, "SIM_AUTH_STATUS_RESP_NEED_PUK"},
85
  {0x05, "SIM_AUTH_STATUS_RESP_RUNNING"},
86
  {0x07, "SIM_AUTH_STATUS_RESP_INIT"},
87
  {0x00, NULL}
88
};
89
90
static const value_string isi_sim_auth_indication[] = {
91
  {0x01, "SIM_AUTH_NEED_AUTH"},
92
  {0x02, "SIM_AUTH_NEED_NO_AUTH"},
93
  {0x03, "SIM_AUTH_VALID"},
94
  {0x04, "SIM_AUTH_INVALID"},
95
  {0x05, "SIM_AUTH_AUTHORIZED"},
96
  {0x06, "SIM_AUTH_IND_CONFIG"},
97
  {0x00, NULL}
98
};
99
100
static const value_string isi_sim_auth_indication_cfg[] = {
101
  {0x0B, "SIM_AUTH_PIN_PROTECTED_DISABLE"},
102
  {0x0C, "SIM_AUTH_PIN_PROTECTED_ENABLE"},
103
  {0x00, NULL}
104
};
105
106
static const value_string isi_sim_message_id[] = {
107
  {0x19, "SIM_NETWORK_INFO_REQ"},
108
  {0x1A, "SIM_NETWORK_INFO_RESP"},
109
  {0x1D, "SIM_IMSI_REQ_READ_IMSI"},
110
  {0x1E, "SIM_IMSI_RESP_READ_IMSI"},
111
  {0x21, "SIM_SERV_PROV_NAME_REQ"},
112
  {0x22, "SIM_SERV_PROV_NAME_RESP"},
113
  {0xBA, "SIM_READ_FIELD_REQ"},
114
  {0xBB, "SIM_READ_FIELD_RESP"},
115
  {0xBC, "SIM_SMS_REQ"},
116
  {0xBD, "SIM_SMS_RESP"},
117
  {0xDC, "SIM_PB_REQ_SIM_PB_READ"},
118
  {0xDD, "SIM_PB_RESP_SIM_PB_READ"},
119
  {0xEF, "SIM_IND"},
120
  {0xF0, "SIM_COMMON_MESSAGE"},
121
  {0x00, NULL}
122
};
123
124
static const value_string isi_sim_service_type[] = {
125
  {0x01, "SIM_ST_PIN"},
126
  {0x05, "SIM_ST_ALL_SERVICES"},
127
  {0x0D, "SIM_ST_INFO"},
128
  {0x2C, "SIM_ST_READ_SERV_PROV_NAME"},
129
  {0x0F, "SIM_PB_READ"},
130
  {0x2D, "READ_IMSI"},
131
  {0x2F, "READ_HPLMN"},
132
  {0x52, "READ_PARAMETER"},
133
  {0x53, "UPDATE_PARAMETER"},
134
  {0x66, "ICC"},
135
  {0x00, NULL}
136
};
137
138
static const value_string isi_sim_cause[] = {
139
  {0x00, "SIM_SERV_NOT_AVAIL"},
140
  {0x01, "SIM_SERV_OK"},
141
  {0x02, "SIM_SERV_PIN_VERIFY_REQUIRED"},
142
  {0x03, "SIM_SERV_PIN_REQUIRED"},
143
  {0x04, "SIM_SERV_SIM_BLOCKED"},
144
  {0x05, "SIM_SERV_SIM_PERMANENTLY_BLOCKED"},
145
  {0x06, "SIM_SERV_SIM_DISCONNECTED"},
146
  {0x07, "SIM_SERV_SIM_REJECTED"},
147
  {0x08, "SIM_SERV_LOCK_ACTIVE"},
148
  {0x09, "SIM_SERV_AUTOLOCK_CLOSED"},
149
  {0x0A, "SIM_SERV_AUTOLOCK_ERROR"},
150
  {0x0B, "SIM_SERV_INIT_OK"},
151
  {0x0C, "SIM_SERV_INIT_NOT_OK"},
152
  {0x0D, "SIM_SERV_WRONG_OLD_PIN"},
153
  {0x0E, "SIM_SERV_PIN_DISABLED"},
154
  {0x0F, "SIM_SERV_COMMUNICATION_ERROR"},
155
  {0x10, "SIM_SERV_UPDATE_IMPOSSIBLE"},
156
  {0x11, "SIM_SERV_NO_SECRET_CODE_IN_SIM"},
157
  {0x12, "SIM_SERV_PIN_ENABLE_OK"},
158
  {0x13, "SIM_SERV_PIN_DISABLE_OK"},
159
  {0x15, "SIM_SERV_WRONG_UNBLOCKING_KEY"},
160
  {0x19, "SIM_FDN_ENABLED"},
161
  {0x1A, "SIM_FDN_DISABLED"},
162
  {0x1C, "SIM_SERV_NOT_OK"},
163
  {0x1E, "SIM_SERV_PN_LIST_ENABLE_OK"},
164
  {0x1F, "SIM_SERV_PN_LIST_DISABLE_OK"},
165
  {0x20, "SIM_SERV_NO_PIN"},
166
  {0x21, "SIM_SERV_PIN_VERIFY_OK"},
167
  {0x22, "SIM_SERV_PIN_BLOCKED"},
168
  {0x23, "SIM_SERV_PIN_PERM_BLOCKED"},
169
  {0x24, "SIM_SERV_DATA_NOT_AVAIL"},
170
  {0x25, "SIM_SERV_IN_HOME_ZONE"},
171
  {0x27, "SIM_SERV_STATE_CHANGED"},
172
  {0x28, "SIM_SERV_INF_NBR_READ_OK"},
173
  {0x29, "SIM_SERV_INF_NBR_READ_NOT_OK"},
174
  {0x2A, "SIM_SERV_IMSI_EQUAL"},
175
  {0x2B, "SIM_SERV_IMSI_NOT_EQUAL"},
176
  {0x2C, "SIM_SERV_INVALID_LOCATION"},
177
  {0x2E, "SIM_SERV_ILLEGAL_NUMBER"},
178
  {0x30, "SIM_SERV_CIPHERING_INDICATOR_DISPLAY_REQUIRED"},
179
  {0x31, "SIM_SERV_CIPHERING_INDICATOR_DISPLAY_NOT_REQUIRED"},
180
  {0x35, "SIM_SERV_STA_SIM_REMOVED"},
181
  {0x36, "SIM_SERV_SECOND_SIM_REMOVED_CS"},
182
  {0x37, "SIM_SERV_CONNECTED_INDICATION_CS"},
183
  {0x38, "SIM_SERV_SECOND_SIM_CONNECTED_CS"},
184
  {0x39, "SIM_SERV_PIN_RIGHTS_LOST_IND_CS"},
185
  {0x3A, "SIM_SERV_PIN_RIGHTS_GRANTED_IND_CS"},
186
  {0x3B, "SIM_SERV_INIT_OK_CS"},
187
  {0x3C, "SIM_SERV_INIT_NOT_OK_CS"},
188
  {0x45, "SIM_SERV_INVALID_FILE"},
189
  {0x49, "SIM_SERV_ICC_EQUAL"},
190
  {0x4A, "SIM_SERV_ICC_NOT_EQUAL"},
191
  {0x4B, "SIM_SERV_SIM_NOT_INITIALISED"},
192
  {0x4D, "SIM_SERV_FILE_NOT_AVAILABLE"},
193
  {0x4F, "SIM_SERV_DATA_AVAIL"},
194
  {0x50, "SIM_SERV_SERVICE_NOT_AVAIL"},
195
  {0x57, "SIM_SERV_FDN_STATUS_ERROR"},
196
  {0x58, "SIM_SERV_FDN_CHECK_PASSED"},
197
  {0x59, "SIM_SERV_FDN_CHECK_FAILED"},
198
  {0x5A, "SIM_SERV_FDN_CHECK_DISABLED"},
199
  {0x5B, "SIM_SERV_FDN_CHECK_NO_FDN_SIM"},
200
  {0x5C, "SIM_STA_ISIM_AVAILABLE_PIN_REQUIRED"},
201
  {0x5D, "SIM_STA_ISIM_AVAILABLE"},
202
  {0x5E, "SIM_STA_USIM_AVAILABLE"},
203
  {0x5F, "SIM_STA_SIM_AVAILABLE"},
204
  {0x60, "SIM_STA_ISIM_NOT_INITIALISED"},
205
  {0x61, "SIM_STA_IMS_READY"},
206
  {0x96, "SIM_STA_APP_DATA_READ_OK"},
207
  {0x97, "SIM_STA_APP_ACTIVATE_OK"},
208
  {0x98, "SIM_STA_APP_ACTIVATE_NOT_OK"},
209
  {0xF9, "SIM_SERV_NOT_DEFINED"},
210
  {0xFA, "SIM_SERV_NOSERVICE"},
211
  {0xFB, "SIM_SERV_NOTREADY"},
212
  {0xFC, "SIM_SERV_ERROR"},
213
  {0x00, NULL }
214
};
215
216
static value_string_ext isi_sim_cause_ext = VALUE_STRING_EXT_INIT(isi_sim_cause);
217
218
static const value_string isi_sim_pb_subblock[] = {
219
  {0xE4, "SIM_PB_INFO_REQUEST"},
220
  {0xFB, "SIM_PB_STATUS"},
221
  {0xFE, "SIM_PB_LOCATION"},
222
  {0xFF, "SIM_PB_LOCATION_SEARCH"},
223
  {0x00, NULL }
224
};
225
226
static const value_string isi_sim_pb_type[] = {
227
  {0xC8, "SIM_PB_ADN"},
228
  {0x00, NULL }
229
};
230
231
static const value_string isi_sim_pb_tag[] = {
232
  {0xCA, "SIM_PB_ANR"},
233
  {0xDD, "SIM_PB_EMAIL"},
234
  {0xF7, "SIM_PB_SNE"},
235
  {0x00, NULL }
236
};
237
238
static const value_string isi_gss_message_id[] = {
239
  {0x00, "GSS_CS_SERVICE_REQ"},
240
  {0x01, "GSS_CS_SERVICE_RESP"},
241
  {0x02, "GSS_CS_SERVICE_FAIL_RESP"},
242
  {0xF0, "COMMON_MESSAGE"},
243
  {0x00, NULL }
244
};
245
246
#if 0
247
static const value_string isi_gss_subblock[] = {
248
  {0x0B, "GSS_RAT_INFO"},
249
  {0x00, NULL }
250
};
251
#endif
252
253
static const value_string isi_gss_operation[] = {
254
  {0x0E, "GSS_SELECTED_RAT_WRITE"},
255
  {0x9C, "GSS_SELECTED_RAT_READ"},
256
  {0x00, NULL }
257
};
258
259
static const value_string isi_gss_cause[] = {
260
  {0x01, "GSS_SERVICE_FAIL"},
261
  {0x02, "GSS_SERVICE_NOT_ALLOWED"},
262
  {0x03, "GSS_SERVICE_FAIL_CS_INACTIVE"},
263
  {0x00, NULL }
264
};
265
266
static const value_string isi_gss_common_message_id[] = {
267
  {0x01, "COMM_SERVICE_NOT_IDENTIFIED_RESP"},
268
  {0x12, "COMM_ISI_VERSION_GET_REQ"},
269
  {0x13, "COMM_ISI_VERSION_GET_RESP"},
270
  {0x14, "COMM_ISA_ENTITY_NOT_REACHABLE_RESP"},
271
  {0x00, NULL }
272
};
273
274
static const value_string isi_gps_id[] = {
275
  {0x7d, "GPS_STATUS_IND"},
276
  {0x90, "GPS_POWER_STATUS_REQ"},
277
  {0x91, "GPS_POWER_STATUS_RSP"},
278
  {0x92, "GPS_DATA_IND"},
279
  {0x00, NULL }
280
};
281
282
static const value_string isi_gps_sub_id[] = {
283
  {0x02, "GPS_POSITION"},
284
  {0x03, "GPS_TIME_DATE"},
285
  {0x04, "GPS_MOVEMENT"},
286
  {0x05, "GPS_SAT_INFO"},
287
  {0x07, "GPS_CELL_INFO_GSM"},
288
  {0x08, "GPS_CELL_INFO_WCDMA"},
289
  {0x00, NULL }
290
};
291
292
static const value_string isi_gps_status[] = {
293
  {0x00, "GPS_DISABLED"},
294
  {0x01, "GPS_NO_LOCK"},
295
  {0x02, "GPS_LOCK"},
296
  {0x00, NULL }
297
};
298
299
static const value_string isi_ss_message_id[] = {
300
  {0x00, "SS_SERVICE_REQ"},
301
  {0x01, "SS_SERVICE_COMPLETED_RESP"},
302
  {0x02, "SS_SERVICE_FAILED_RESP"},
303
  {0x03, "SS_SERVICE_NOT_SUPPORTED_RESP"},
304
  {0x04, "SS_GSM_USSD_SEND_REQ"},
305
  {0x05, "SS_GSM_USSD_SEND_RESP"},
306
  {0x06, "SS_GSM_USSD_RECEIVE_IND"},
307
  {0x09, "SS_STATUS_IND"},
308
  {0x10, "SS_SERVICE_COMPLETED_IND"},
309
  {0x11, "SS_CANCEL_REQ"},
310
  {0x12, "SS_CANCEL_RESP"},
311
  {0x15, "SS_RELEASE_REQ"},
312
  {0x16, "SS_RELEASE_RESP"},
313
  {0xF0, "COMMON_MESSAGE"},
314
  {0x00, NULL }
315
};
316
317
static const value_string isi_ss_ussd_type[] = {
318
  {0x01, "SS_GSM_USSD_MT_REPLY"},
319
  {0x02, "SS_GSM_USSD_COMMAND"},
320
  {0x03, "SS_GSM_USSD_REQUEST"},
321
  {0x04, "SS_GSM_USSD_NOTIFY"},
322
  {0x05, "SS_GSM_USSD_END"},
323
  {0x00, NULL }
324
};
325
326
static const value_string isi_ss_subblock[] = {
327
  {0x00, "SS_FORWARDING"},
328
  {0x01, "SS_STATUS_RESULT"},
329
  {0x03, "SS_GSM_PASSWORD"},
330
  {0x04, "SS_GSM_FORWARDING_INFO"},
331
  {0x05, "SS_GSM_FORWARDING_FEATURE"},
332
  {0x08, "SS_GSM_DATA"},
333
  {0x09, "SS_GSM_BSC_INFO"},
334
  {0x0B, "SS_GSM_PASSWORD_INFO"},
335
  {0x0D, "SS_GSM_INDICATE_PASSWORD_ERROR"},
336
  {0x0E, "SS_GSM_INDICATE_ERROR"},
337
  {0x2F, "SS_GSM_ADDITIONAL_INFO"},
338
  {0x32, "SS_GSM_USSD_STRING"},
339
  {0x00, NULL }
340
};
341
342
static const value_string isi_ss_operation[] = {
343
  {0x01, "SS_ACTIVATION"},
344
  {0x02, "SS_DEACTIVATION"},
345
  {0x03, "SS_REGISTRATION"},
346
  {0x04, "SS_ERASURE"},
347
  {0x05, "SS_INTERROGATION"},
348
  {0x06, "SS_GSM_PASSWORD_REGISTRATION"},
349
  {0x00, NULL }
350
};
351
352
static const value_string isi_ss_service_code[] = {
353
  {0x00, "SS_ALL_TELE_AND_BEARER"},
354
  {0x0A, "SS_GSM_ALL_TELE"},
355
  {0x0B, "SS_GSM_TELEPHONY"},
356
  {0x0C, "SS_GSM_ALL_DATA_TELE"},
357
  {0x0D, "SS_GSM_FACSIMILE"},
358
  {0x10, "SS_GSM_SMS"},
359
  {0x00, NULL}
360
};
361
362
static const value_string isi_ss_status_indication[] = {
363
  {0x00, "SS_STATUS_REQUEST_SERVICE_START"},
364
  {0x01, "SS_STATUS_REQUEST_SERVICE_STOP"},
365
  {0x02, "SS_GSM_STATUS_REQUEST_USSD_START"},
366
  {0x03, "SS_GSM_STATUS_REQUEST_USSD_STOP"},
367
  {0x00, NULL}
368
};
369
370
static const value_string isi_ss_common_message_id[] = {
371
  {0x01, "COMM_SERVICE_NOT_IDENTIFIED_RESP"},
372
  {0x12, "COMM_ISI_VERSION_GET_REQ"},
373
  {0x13, "COMM_ISI_VERSION_GET_RESP"},
374
  {0x14, "COMM_ISA_ENTITY_NOT_REACHABLE_RESP"},
375
  {0x00, NULL }
376
};
377
378
static const value_string isi_network_id[] = {
379
  {0x07, "NET_SET_REQ"},
380
  {0x08, "NET_SET_RESP"},
381
  {0x0B, "NET_RSSI_GET_REQ"},
382
  {0x0C, "NET_RSSI_GET_RESP"},
383
  {0x1E, "NET_RSSI_IND"},
384
  {0x20, "NET_CIPHERING_IND"},
385
  {0x35, "NET_RAT_IND"},
386
  {0x36, "NET_RAT_REQ"},
387
  {0x37, "NET_RAT_RESP"},
388
  {0x42, "NET_CELL_INFO_IND"},
389
  {0xE0, "NET_REG_STATUS_GET_REQ"},
390
  {0xE1, "NET_REG_STATUS_GET_RESP"},
391
  {0xE2, "NET_REG_STATUS_IND"},
392
  {0xE3, "NET_AVAILABLE_GET_REQ"},
393
  {0xE4, "NET_AVAILABLE_GET_RESP"},
394
  {0xE5, "NET_OPER_NAME_READ_REQ"},
395
  {0xE6, "NET_OPER_NAME_READ_RESP"},
396
  {0xF0, "NET_COMMON_MESSAGE"},
397
  {0x00, NULL}
398
};
399
400
static const value_string isi_network_status_sub_id[] = {
401
  {0x00, "NET_REG_INFO_COMMON"},
402
  {0x02, "NET_OPERATOR_INFO_COMMON"},
403
  {0x04, "NET_RSSI_CURRENT"},
404
  {0x09, "NET_GSM_REG_INFO"},
405
  {0x0B, "NET_DETAILED_NETWORK_INFO"},
406
  {0x0C, "NET_GSM_OPERATOR_INFO"},
407
  {0x11, "NET_GSM_BAND_INFO"},
408
  {0x2C, "NET_RAT_INFO"},
409
  {0xE1, "NET_AVAIL_NETWORK_INFO_COMMON"},
410
  {0xE7, "NET_OPER_NAME_INFO"},
411
  {0x00, NULL}
412
};
413
414
static const value_string isi_network_cell_info_sub_id[] = {
415
  {0x46, "NET_GSM_CELL_INFO"},
416
  {0x47, "NET_WCDMA_CELL_INFO"},
417
  {0x50, "NET_EPS_CELL_INFO"},
418
  {0x00, NULL}
419
};
420
421
/* centimeter per second to kilometer per hour */
422
0
#define CMS_TO_KMH 0.036
423
0
#define SAT_PKG_LEN 12
424
425
static const value_string isi_sms_message_id[] = {
426
  {0x00, "SMS_MESSAGE_CAPABILITY_REQ"},
427
  {0x01, "SMS_MESSAGE_CAPABILITY_RESP"},
428
  {0x02, "SMS_MESSAGE_SEND_REQ"},
429
  {0x03, "SMS_MESSAGE_SEND_RESP"},
430
  {0x04, "SMS_RECEIVED_MT_PP_IND"},
431
  {0x05, "SMS_RECEIVED_MWI_PP_IND"},
432
  {0x06, "SMS_PP_ROUTING_REQ"},
433
  {0x07, "SMS_PP_ROUTING_RESP"},
434
  {0x08, "SMS_PP_ROUTING_NTF"},
435
  {0x09, "SMS_GSM_RECEIVED_PP_REPORT_REQ"},
436
  {0x0A, "SMS_GSM_RECEIVED_PP_REPORT_RESP"},
437
  {0x0B, "SMS_GSM_CB_ROUTING_REQ"},
438
  {0x0C, "SMS_GSM_CB_ROUTING_RESP"},
439
  {0x0D, "SMS_GSM_CB_ROUTING_NTF"},
440
  {0x0E, "SMS_GSM_TEMP_CB_ROUTING_REQ"},
441
  {0x0F, "SMS_GSM_TEMP_CB_ROUTING_RESP"},
442
  {0x10, "SMS_GSM_TEMP_CB_ROUTING_NTF"},
443
  {0x11, "SMS_GSM_CBCH_PRESENT_IND"},
444
  {0x12, "SMS_PARAMETERS_UPDATE_REQ"},
445
  {0x13, "SMS_PARAMETERS_UPDATE_RESP"},
446
  {0x14, "SMS_PARAMETERS_READ_REQ"},
447
  {0x15, "SMS_PARAMETERS_READ_RESP"},
448
  {0x16, "SMS_PARAMETERS_CAPACITY_REQ"},
449
  {0x17, "SMS_PARAMETERS_CAPACITY_RESP"},
450
  {0x18, "SMS_GSM_SETTINGS_UPDATE_REQ"},
451
  {0x19, "SMS_GSM_SETTINGS_UPDATE_RESP"},
452
  {0x1A, "SMS_GSM_SETTINGS_READ_REQ"},
453
  {0x1B, "SMS_GSM_SETTINGS_READ_RESP"},
454
  {0x1C, "SMS_GSM_MCN_SETTING_CHANGED_IND"},
455
  {0x1D, "SMS_MEMORY_CAPACITY_EXC_IND"},
456
  {0x1E, "SMS_STORAGE_STATUS_UPDATE_REQ"},
457
  {0x1F, "SMS_STORAGE_STATUS_UPDATE_RESP"},
458
  {0x22, "SMS_MESSAGE_SEND_STATUS_IND"},
459
  {0x23, "SMS_GSM_RESEND_CANCEL_REQ"},
460
  {0x24, "SMS_GSM_RESEND_CANCEL_RESP"},
461
  {0x25, "SMS_SM_CONTROL_ACTIVATE_REQ"},
462
  {0x26, "SMS_SM_CONTROL_ACTIVATE_RESP"},
463
  /* 0x29 is undocumented, but appears in traces */
464
  {0xF0, "COMMON_MESSAGE"},
465
  {0x00, NULL}
466
};
467
468
static const value_string isi_sms_routing_command[] = {
469
  {0x00, "SMS_ROUTING_RELEASE"},
470
  {0x01, "SMS_ROUTING_SET"},
471
  {0x02, "SMS_ROUTING_SUSPEND"},
472
  {0x03, "SMS_ROUTING_RESUME"},
473
  {0x04, "SMS_ROUTING_UPDATE"},
474
  {0x05, "SMS_ROUTING_QUERY"},
475
  {0x06, "SMS_ROUTING_QUERY_ALL"},
476
  {0x00, NULL}
477
};
478
479
static const value_string isi_sms_routing_mode[] = {
480
  {0x00, "SMS_GSM_ROUTING_MODE_CLASS_DISP"},
481
  {0x01, "SMS_GSM_ROUTING_MODE_CLASS_TE"},
482
  {0x02, "SMS_GSM_ROUTING_MODE_CLASS_ME"},
483
  {0x03, "SMS_GSM_ROUTING_MODE_CLASS_SIM"},
484
  {0x04, "SMS_GSM_ROUTING_MODE_CLASS_UD1"},
485
  {0x05, "SMS_GSM_ROUTING_MODE_CLASS_UD2"},
486
  {0x06, "SMS_GSM_ROUTING_MODE_DATACODE_WAP"},
487
  {0x07, "SMS_GSM_ROUTING_MODE_DATACODE_8BIT"},
488
  {0x08, "SMS_GSM_ROUTING_MODE_DATACODE_TXT"},
489
  {0x09, "SMS_GSM_ROUTING_MODE_MWI_DISCARD"},
490
  {0x0A, "SMS_GSM_ROUTING_MODE_MWI_STORE"},
491
  {0x0B, "SMS_GSM_ROUTING_MODE_ALL"},
492
  {0x0C, "SMS_GSM_ROUTING_MODE_CB_DDL"},
493
  {0x00, NULL}
494
};
495
496
static const value_string isi_sms_route[] = {
497
  {0x00, "SMS_ROUTE_GPRS_PREF"},
498
  {0x01, "SMS_ROUTE_CS"},
499
  {0x02, "SMS_ROUTE_GPRS"},
500
  {0x03, "SMS_ROUTE_CS_PREF"},
501
  {0x04, "SMS_ROUTE_DEFAULT"},
502
  {0x00, NULL}
503
};
504
505
/*
506
static const value_string isi_sms_subblock[] = {
507
  {0x00, "SS_FORWARDING"},
508
  {0x01, "SS_STATUS_RESULT"},
509
  {0x03, "SS_GSM_PASSWORD"},
510
  {0x04, "SS_GSM_FORWARDING_INFO"},
511
  {0x05, "SS_GSM_FORWARDING_FEATURE"},
512
  {0x08, "SS_GSM_DATA"},
513
  {0x09, "SS_GSM_BSC_INFO"},
514
  {0x0B, "SS_GSM_PASSWORD_INFO"},
515
  {0x0D, "SS_GSM_INDICATE_PASSWORD_ERROR"},
516
  {0x0E, "SS_GSM_INDICATE_ERROR"},
517
  {0x2F, "SS_GSM_ADDITIONAL_INFO"},
518
  {0x32, "SS_GSM_USSD_STRING"},
519
  {0x00, NULL }
520
};
521
*/
522
523
static const value_string isi_sms_send_status[] = {
524
  {0x00, "SMS_MSG_REROUTED"},
525
  {0x01, "SMS_MSG_REPEATED"},
526
  {0x02, "SMS_MSG_WAITING_NETWORK"},
527
  {0x03, "SMS_MSG_IDLE"},
528
  {0x00, NULL},
529
};
530
531
static const value_string isi_sms_common_message_id[] = {
532
  {0x01, "COMM_SERVICE_NOT_IDENTIFIED_RESP"},
533
  {0x12, "COMM_ISI_VERSION_GET_REQ"},
534
  {0x13, "COMM_ISI_VERSION_GET_RESP"},
535
  {0x14, "COMM_ISA_ENTITY_NOT_REACHABLE_RESP"},
536
  {0x00, NULL }
537
};
538
539
540
static int proto_isi;
541
542
static int hf_isi_rdev;
543
static int hf_isi_sdev;
544
static int hf_isi_res;
545
static int hf_isi_len;
546
static int hf_isi_robj;
547
static int hf_isi_sobj;
548
static int hf_isi_id;
549
550
static int hf_isi_sim_auth_payload;
551
static int hf_isi_sim_auth_cmd;
552
static int hf_isi_sim_auth_status_rsp;
553
static int hf_isi_sim_auth_protection_req;
554
static int hf_isi_sim_auth_protection_rsp;
555
static int hf_isi_sim_auth_pin;
556
static int hf_isi_sim_auth_puk;
557
static int hf_isi_sim_auth_new_pin;
558
static int hf_isi_sim_auth_pw_type;
559
static int hf_isi_sim_auth_indication;
560
static int hf_isi_sim_auth_indication_cfg;
561
562
static int hf_isi_sim_payload;
563
static int hf_isi_sim_message_id;
564
static int hf_isi_sim_service_type;
565
static int hf_isi_sim_cause;
566
static int hf_isi_sim_secondary_cause;
567
static int hf_isi_sim_subblock_count;
568
static int hf_isi_sim_subblock_size;
569
static int hf_isi_sim_pb_subblock;
570
static int hf_isi_sim_pb_type;
571
static int hf_isi_sim_pb_location;
572
static int hf_isi_sim_pb_tag_count;
573
static int hf_isi_sim_pb_tag;
574
static int hf_isi_sim_imsi_length;
575
576
static int hf_isi_gss_payload;
577
static int hf_isi_gss_message_id;
578
#if 0
579
static int hf_isi_gss_subblock;
580
#endif
581
static int hf_isi_gss_operation;
582
static int hf_isi_gss_subblock_count;
583
static int hf_isi_gss_cause;
584
static int hf_isi_gss_common_message_id;
585
586
static int hf_isi_gps_payload;
587
static int hf_isi_gps_cmd;
588
static int hf_isi_gps_sub_pkgs;
589
static int hf_isi_gps_sub_type;
590
static int hf_isi_gps_sub_len;
591
static int hf_isi_gps_status;
592
static int hf_isi_gps_year;
593
static int hf_isi_gps_month;
594
static int hf_isi_gps_day;
595
static int hf_isi_gps_hour;
596
static int hf_isi_gps_minute;
597
static int hf_isi_gps_second;
598
static int hf_isi_gps_latitude;
599
static int hf_isi_gps_longitude;
600
static int hf_isi_gps_eph;
601
static int hf_isi_gps_altitude;
602
static int hf_isi_gps_epv;
603
static int hf_isi_gps_course;
604
static int hf_isi_gps_epd;
605
static int hf_isi_gps_speed;
606
static int hf_isi_gps_eps;
607
static int hf_isi_gps_climb;
608
static int hf_isi_gps_epc;
609
static int hf_isi_gps_mcc;
610
static int hf_isi_gps_mnc;
611
static int hf_isi_gps_lac;
612
static int hf_isi_gps_cid;
613
static int hf_isi_gps_ucid;
614
static int hf_isi_gps_satellites;
615
static int hf_isi_gps_prn;
616
static int hf_isi_gps_sat_used;
617
static int hf_isi_gps_sat_strength;
618
static int hf_isi_gps_sat_elevation;
619
static int hf_isi_gps_sat_azimuth;
620
621
static int hf_isi_ss_payload;
622
static int hf_isi_ss_message_id;
623
static int hf_isi_ss_ussd_type;
624
static int hf_isi_ss_subblock_count;
625
static int hf_isi_ss_subblock;
626
static int hf_isi_ss_operation;
627
static int hf_isi_ss_service_code;
628
static int hf_isi_ss_status_indication;
629
static int hf_isi_ss_ussd_length;
630
static int hf_isi_ss_common_message_id;
631
632
static int hf_isi_network_payload;
633
static int hf_isi_network_cmd;
634
static int hf_isi_network_data_sub_pkgs;
635
static int hf_isi_network_status_sub_type;
636
static int hf_isi_network_status_sub_len;
637
static int hf_isi_network_status_sub_lac;
638
static int hf_isi_network_status_sub_cid;
639
static int hf_isi_network_status_sub_msg;
640
static int hf_isi_network_status_sub_msg_len;
641
static int hf_isi_network_cell_info_sub_type;
642
static int hf_isi_network_cell_info_sub_len;
643
static int hf_isi_network_cell_info_sub_operator;
644
static int hf_isi_network_gsm_band_900;
645
static int hf_isi_network_gsm_band_1800;
646
static int hf_isi_network_gsm_band_1900;
647
static int hf_isi_network_gsm_band_850;
648
649
static int hf_isi_sms_payload;
650
static int hf_isi_sms_message_id;
651
static int hf_isi_sms_routing_command;
652
static int hf_isi_sms_routing_mode;
653
static int hf_isi_sms_route;
654
static int hf_isi_sms_subblock_count;
655
static int hf_isi_sms_send_status;
656
static int hf_isi_sms_common_message_id;
657
658
static int ett_isi;
659
static int ett_isi_msg;
660
static int ett_isi_network_gsm_band_info;
661
662
static expert_field ei_isi_len;
663
static expert_field ei_isi_unsupported_packet;
664
665
0
static int dissect_isi_sim_auth(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
666
0
  proto_item *item;
667
0
  proto_tree *tree;
668
0
  uint8_t cmd, code;
669
670
0
  item = proto_tree_add_item(isitree, hf_isi_sim_auth_payload, tvb, 0, -1, ENC_NA);
671
0
  tree = proto_item_add_subtree(item, ett_isi_msg);
672
673
0
  proto_tree_add_item(tree, hf_isi_sim_auth_cmd, tvb, 0, 1, ENC_BIG_ENDIAN);
674
0
  cmd = tvb_get_uint8(tvb, 0);
675
676
0
  switch(cmd) {
677
0
    case 0x01: /* SIM_AUTH_PROTECTED_REQ */
678
0
      proto_tree_add_item(tree, hf_isi_sim_auth_protection_req, tvb, 2, 1, ENC_BIG_ENDIAN);
679
0
      cmd = tvb_get_uint8(tvb, 2);
680
0
      switch(cmd) {
681
0
        case 0x00: /* DISABLE */
682
0
          proto_tree_add_item(tree, hf_isi_sim_auth_pin, tvb, 3, -1, ENC_ASCII);
683
0
          col_set_str(pinfo->cinfo, COL_INFO, "disable SIM startup protection");
684
0
          break;
685
0
        case 0x01: /* ENABLE */
686
0
          proto_tree_add_item(tree, hf_isi_sim_auth_pin, tvb, 3, -1, ENC_ASCII);
687
0
          col_set_str(pinfo->cinfo, COL_INFO, "enable SIM startup protection");
688
0
          break;
689
0
        case 0x04: /* STATUS */
690
0
          col_set_str(pinfo->cinfo, COL_INFO, "get SIM startup protection status");
691
0
          break;
692
0
        default:
693
0
          col_set_str(pinfo->cinfo, COL_INFO, "unknown SIM startup protection packet");
694
0
          break;
695
0
      }
696
0
      break;
697
0
    case 0x02: /* SIM_AUTH_PROTECTED_RESP */
698
0
      proto_tree_add_item(tree, hf_isi_sim_auth_protection_rsp, tvb, 1, 1, ENC_BIG_ENDIAN);
699
0
      if(tvb_get_uint8(tvb, 1))
700
0
        col_set_str(pinfo->cinfo, COL_INFO, "SIM startup protection enabled");
701
0
      else
702
0
        col_set_str(pinfo->cinfo, COL_INFO, "SIM startup protection disabled");
703
0
      break;
704
0
    case 0x04: /* SIM_AUTH_UPDATE_REQ */
705
0
      proto_tree_add_item(tree, hf_isi_sim_auth_pw_type, tvb, 1, 1, ENC_BIG_ENDIAN);
706
0
      code = tvb_get_uint8(tvb, 1);
707
0
      switch(code) {
708
0
        case 0x02: /* PIN */
709
0
          col_set_str(pinfo->cinfo, COL_INFO, "update SIM PIN");
710
0
          proto_tree_add_item(tree, hf_isi_sim_auth_pin, tvb, 2, 11, ENC_ASCII);
711
0
          proto_tree_add_item(tree, hf_isi_sim_auth_new_pin, tvb, 13, 11, ENC_ASCII);
712
0
          break;
713
0
        case 0x03: /* PUK */
714
0
          col_set_str(pinfo->cinfo, COL_INFO, "update SIM PUK");
715
0
          break;
716
0
        default:
717
0
          col_set_str(pinfo->cinfo, COL_INFO, "unknown SIM Authentication update request");
718
0
          break;
719
0
      }
720
0
      break;
721
0
    case 0x05: /* SIM_AUTH_UPDATE_SUCCESS_RESP */
722
0
      col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication update successful");
723
0
      break;
724
0
    case 0x06: /* SIM_AUTH_UPDATE_FAIL_RESP */
725
0
      col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication update failed");
726
0
      break;
727
0
    case 0x07: /* SIM_AUTH_REQ */
728
0
      proto_tree_add_item(tree, hf_isi_sim_auth_pw_type, tvb, 1, 1, ENC_BIG_ENDIAN);
729
0
      code = tvb_get_uint8(tvb, 1);
730
0
      switch(code) {
731
0
        case 0x02: /* PIN */
732
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication with PIN");
733
0
          proto_tree_add_item(tree, hf_isi_sim_auth_pin, tvb, 2, 11, ENC_ASCII);
734
0
          break;
735
0
        case 0x03: /* PUK */
736
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication with PUK");
737
0
          proto_tree_add_item(tree, hf_isi_sim_auth_puk, tvb, 2, 11, ENC_ASCII);
738
0
          proto_tree_add_item(tree, hf_isi_sim_auth_new_pin, tvb, 13, 11, ENC_ASCII);
739
0
          break;
740
0
        default:
741
0
          col_set_str(pinfo->cinfo, COL_INFO, "unknown SIM Authentication request");
742
0
          break;
743
0
      }
744
0
      break;
745
0
    case 0x08: /* SIM_AUTH_SUCCESS_RESP */
746
0
      col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication successful");
747
0
      break;
748
0
    case 0x09: /* SIM_AUTH_FAIL_RESP */
749
0
      col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication failed");
750
0
      break;
751
0
    case 0x10: /* SIM_AUTH_STATUS_IND */
752
0
      proto_tree_add_item(tree, hf_isi_sim_auth_indication, tvb, 1, 1, ENC_BIG_ENDIAN);
753
0
      code = tvb_get_uint8(tvb, 1);
754
0
      proto_tree_add_item(tree, hf_isi_sim_auth_pw_type, tvb, 2, 1, ENC_BIG_ENDIAN);
755
0
      switch(code) {
756
0
        case 0x01:
757
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication indication: Authentication needed");
758
0
          break;
759
0
        case 0x02:
760
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication indication: No Authentication needed");
761
0
          break;
762
0
        case 0x03:
763
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication indication: Authentication valid");
764
0
          break;
765
0
        case 0x04:
766
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication indication: Authentication invalid");
767
0
          break;
768
0
        case 0x05:
769
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication indication: Authorized");
770
0
          break;
771
0
        case 0x06:
772
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication indication: Config");
773
0
          proto_tree_add_item(tree, hf_isi_sim_auth_indication_cfg, tvb, 3, 1, ENC_BIG_ENDIAN);
774
0
          break;
775
0
        default:
776
0
          col_set_str(pinfo->cinfo, COL_INFO, "unknown SIM Authentication indication");
777
0
          break;
778
0
      }
779
0
      break;
780
0
    case 0x11: /* SIM_AUTH_STATUS_REQ */
781
0
      col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication status request");
782
0
      break;
783
0
    case 0x12: /* SIM_AUTH_STATUS_RESP */
784
0
      proto_tree_add_item(tree, hf_isi_sim_auth_status_rsp, tvb, 1, 1, ENC_BIG_ENDIAN);
785
0
      code = tvb_get_uint8(tvb, 1);
786
0
      switch(code) {
787
0
        case 0x02:
788
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication status: need PIN");
789
0
          break;
790
0
        case 0x03:
791
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication status: need PUK");
792
0
          break;
793
0
        case 0x05:
794
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication status: running");
795
0
          break;
796
0
        case 0x07:
797
0
          col_set_str(pinfo->cinfo, COL_INFO, "SIM Authentication status: initializing");
798
0
          break;
799
0
        default:
800
0
          col_set_str(pinfo->cinfo, COL_INFO, "unknown SIM Authentication status response packet");
801
0
          break;
802
0
      }
803
0
      break;
804
0
    default:
805
0
      col_set_str(pinfo->cinfo, COL_INFO, "unknown SIM Authentication packet");
806
0
      break;
807
0
  }
808
0
  return tvb_captured_length(tvb);
809
0
}
810
811
0
static int dissect_isi_sim(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
812
0
  proto_item *item;
813
0
  proto_tree *tree;
814
0
  uint8_t cmd, code;
815
816
0
  item = proto_tree_add_item(isitree, hf_isi_sim_payload, tvb, 0, -1, ENC_NA);
817
0
  tree = proto_item_add_subtree(item, ett_isi_msg);
818
819
0
  proto_tree_add_item(tree, hf_isi_sim_message_id, tvb, 0, 1, ENC_BIG_ENDIAN);
820
0
  cmd = tvb_get_uint8(tvb, 0);
821
822
0
  switch(cmd) {
823
824
0
    case 0x19: /* SIM_NETWORK_INFO_REQ */
825
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
826
0
      code = tvb_get_uint8(tvb, 1);
827
0
      switch(code) {
828
0
        case 0x2F:
829
0
          col_set_str(pinfo->cinfo, COL_INFO, "Network Information Request: Read Home PLMN");
830
0
          break;
831
0
        default:
832
0
          col_set_str(pinfo->cinfo, COL_INFO, "Network Information Request");
833
0
          break;
834
0
      }
835
0
      break;
836
837
0
    case 0x1A: /* SIM_NETWORK_INFO_RESP */
838
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
839
0
      proto_tree_add_item(tree, hf_isi_sim_cause, tvb, 2, 1, ENC_BIG_ENDIAN);
840
841
0
      code = tvb_get_uint8(tvb, 1);
842
0
      switch(code) {
843
0
        case 0x2F:
844
0
          dissect_e212_mcc_mnc(tvb, pinfo, tree, 3, E212_LAI, false);
845
0
          col_set_str(pinfo->cinfo, COL_INFO, "Network Information Response: Home PLMN");
846
0
          break;
847
0
        default:
848
0
          col_set_str(pinfo->cinfo, COL_INFO, "Network Information Response");
849
0
          break;
850
0
      }
851
0
      break;
852
853
0
    case 0x1D: /* SIM_IMSI_REQ_READ_IMSI */
854
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
855
0
      code = tvb_get_uint8(tvb, 1);
856
0
      switch(code) {
857
0
        default:
858
0
          col_set_str(pinfo->cinfo, COL_INFO, "Read IMSI Request");
859
0
          break;
860
0
      }
861
0
      break;
862
863
0
    case 0x1E: /* SIM_IMSI_RESP_READ_IMSI */
864
865
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
866
867
      /* If properly decoded, an IMSI should look like 234 100 733569423 in split Base10
868
869
      0000   1e 2d 01 08 | 29 43 01 | 70 33 65 49 32
870
                92 34 10 | 07 33 56 94 23
871
872
      Switch 0x29 to produce 0x92
873
874
      AND 0x92 with 0xF0 to strip the leading 9
875
876
      Switch 0x43 to produce 0x34
877
878
      Concatenate 0x02 and 0x34 to produce 0x02 34 - which is our MCC for the UK
879
880
      Switch 0x01 to produce 0x10 - first byte of the MNC
881
882
      Switch 0x70 to produce 0x07 - second bit of the MNC, and first bit of the MSIN
883
884
      Remainder of MSIN follows:
885
886
      Switch 0x33 to produce 0x33
887
888
      Switch 0x65 to produce 0x56
889
890
      Switch 0x49 to produce 0x94
891
892
      Switch 0x32 to produce 0x23
893
894
      When regrouped, we should have something that looks like 0x02|0x34|0x10|0x07|0x33|0x56|0x94|0x23
895
896
      Can we use the E212 dissector?
897
        No, it appears that the current version of the dissector is hard-coded in a way that ignores all of our set-up work. :(
898
899
      */
900
901
0
      code = tvb_get_uint8(tvb, 1);
902
0
      switch(code) {
903
0
        default:
904
0
          proto_tree_add_item(tree, hf_isi_sim_imsi_length, tvb, 3, 1, ENC_BIG_ENDIAN);
905
906
          /*
907
          next_tvb = tvb_new_subset_remaining(tvb, 0);
908
          proto_tree_add_item(tree, hf_isi_sim_imsi_byte_1, next_tvb, 4, 1, ENC_LITTLE_ENDIAN);
909
          dissect_e212_mcc_mnc(next_tvb, pinfo, tree, 4, false );
910
          proto_tree_add_item(tree, hf_E212_msin, tvb, 2, 7, ENC_BIG_ENDIAN);
911
912
          */
913
914
0
          col_set_str(pinfo->cinfo, COL_INFO, "Read IMSI Response");
915
0
          break;
916
0
      }
917
0
      break;
918
919
0
    case 0x21: /* SIM_SERV_PROV_NAME_REQ */
920
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
921
0
      code = tvb_get_uint8(tvb, 1);
922
0
      switch(code) {
923
0
        default:
924
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Provider Name Request");
925
0
          break;
926
0
      }
927
0
      break;
928
929
0
    case 0x22: /* SIM_SERV_PROV_NAME_RESP */
930
0
      code = tvb_get_uint8(tvb, 1);
931
0
      switch(code) {
932
0
        case 0x2c:
933
0
          proto_tree_add_item(tree, hf_isi_sim_cause, tvb, 1, 1, ENC_BIG_ENDIAN);
934
0
          proto_tree_add_item(tree, hf_isi_sim_secondary_cause, tvb, 2, 1, ENC_BIG_ENDIAN);
935
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Provider Name Response: Invalid Location");
936
0
          break;
937
0
        default:
938
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Provider Name Response");
939
0
          break;
940
0
      }
941
0
      break;
942
943
0
    case 0xBA: /* SIM_READ_FIELD_REQ */
944
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
945
0
      code = tvb_get_uint8(tvb, 1);
946
0
      switch(code) {
947
0
        case 0x66:
948
0
          col_set_str(pinfo->cinfo, COL_INFO, "Read Field Request: Integrated Circuit Card Identification (ICCID)");
949
0
          break;
950
0
        default:
951
0
          col_set_str(pinfo->cinfo, COL_INFO, "Read Field Request");
952
0
          break;
953
0
      }
954
0
      break;
955
956
0
    case 0xBB: /* SIM_READ_FIELD_RESP */
957
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
958
0
      code = tvb_get_uint8(tvb, 1);
959
0
      switch(code) {
960
0
        case 0x66:
961
0
          proto_tree_add_item(tree, hf_isi_sim_cause, tvb, 2, 1, ENC_BIG_ENDIAN);
962
0
          col_set_str(pinfo->cinfo, COL_INFO, "Read Field Response: Integrated Circuit Card Identification (ICCID)");
963
0
          break;
964
0
        default:
965
0
          col_set_str(pinfo->cinfo, COL_INFO, "Read Field Response");
966
0
          break;
967
0
      }
968
0
      break;
969
970
0
    case 0xBC: /* SIM_SMS_REQ */
971
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
972
0
      code = tvb_get_uint8(tvb, 1);
973
0
      switch(code) {
974
0
        default:
975
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS Request");
976
0
          break;
977
0
      }
978
0
      break;
979
980
0
    case 0xBD: /* SIM_SMS_RESP */
981
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
982
0
      code = tvb_get_uint8(tvb, 1);
983
0
      switch(code) {
984
0
        default:
985
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS Response");
986
0
          break;
987
0
      }
988
0
      break;
989
990
0
    case 0xDC: /* SIM_PB_REQ_SIM_PB_READ */
991
992
      /* A phonebook record in a typical O2 UK SIM card issued in 2009 can hold:
993
994
        * A name encoded in UTF-16/UCS-2 - up to 18 (or 15 double-byte/accented) characters can be entered on an S60 device
995
        * Up to 2 telephone numbers - up to 2 * 20 (or 40-1 field) characters can be entered on an S60 device
996
        * An e-mail address encoded in UTF-16/UCS-2 - up to 40 characters can be entered on an S60 device
997
998
        Up to 250 of these records can be stored, and 9 of them are pre-populated on a brand new card.
999
1000
      */
1001
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
1002
0
      proto_tree_add_item(tree, hf_isi_sim_subblock_count, tvb, 2, 2, ENC_LITTLE_ENDIAN);
1003
0
      proto_tree_add_item(tree, hf_isi_sim_pb_subblock, tvb, 4, 1, ENC_BIG_ENDIAN);
1004
1005
      /* Should probably be 8, and not 2048... Officially starts/ends at 5/3, I think. */
1006
0
      proto_tree_add_item(tree, hf_isi_sim_subblock_size, tvb, 6, 2, ENC_LITTLE_ENDIAN);
1007
1008
0
      proto_tree_add_item(tree, hf_isi_sim_pb_type, tvb, 8, 1, ENC_BIG_ENDIAN);
1009
0
      proto_tree_add_item(tree, hf_isi_sim_pb_location, tvb, 9, 2, ENC_BIG_ENDIAN);
1010
1011
0
      proto_tree_add_item(tree, hf_isi_sim_pb_subblock, tvb, 12, 1, ENC_BIG_ENDIAN);
1012
0
      proto_tree_add_item(tree, hf_isi_sim_subblock_count, tvb, 13, 2, ENC_BIG_ENDIAN);
1013
1014
0
      proto_tree_add_item(tree, hf_isi_sim_pb_tag_count, tvb, 15, 1, ENC_BIG_ENDIAN);
1015
0
      proto_tree_add_item(tree, hf_isi_sim_pb_type, tvb, 18, 1, ENC_BIG_ENDIAN);
1016
0
      proto_tree_add_item(tree, hf_isi_sim_pb_tag, tvb, 20, 1, ENC_BIG_ENDIAN);
1017
0
      proto_tree_add_item(tree, hf_isi_sim_pb_tag, tvb, 22, 1, ENC_BIG_ENDIAN);
1018
0
      proto_tree_add_item(tree, hf_isi_sim_pb_tag, tvb, 24, 1, ENC_BIG_ENDIAN);
1019
1020
0
      code = tvb_get_uint8(tvb, 1);
1021
0
      switch(code) {
1022
0
        default:
1023
0
          col_set_str(pinfo->cinfo, COL_INFO, "Phonebook Read Request");
1024
0
          break;
1025
0
      }
1026
0
      break;
1027
1028
0
    case 0xDD: /* SIM_PB_RESP_SIM_PB_READ */
1029
0
      proto_tree_add_item(tree, hf_isi_sim_service_type, tvb, 1, 1, ENC_BIG_ENDIAN);
1030
0
      code = tvb_get_uint8(tvb, 1);
1031
0
      switch(code) {
1032
0
        default:
1033
0
          col_set_str(pinfo->cinfo, COL_INFO, "Phonebook Read Response");
1034
0
          break;
1035
0
      }
1036
0
      break;
1037
1038
0
    case 0xEF: /* SIM_IND */
1039
0
      code = tvb_get_uint8(tvb, 1);
1040
0
      switch(code) {
1041
0
        default:
1042
0
          col_set_str(pinfo->cinfo, COL_INFO, "Indicator");
1043
0
          break;
1044
0
      }
1045
0
      break;
1046
1047
0
    case 0xF0: /* SIM_COMMON_MESSAGE */
1048
0
      proto_tree_add_item(tree, hf_isi_sim_cause, tvb, 1, 1, ENC_BIG_ENDIAN);
1049
0
      proto_tree_add_item(tree, hf_isi_sim_secondary_cause, tvb, 2, 1, ENC_BIG_ENDIAN);
1050
0
      code = tvb_get_uint8(tvb, 1);
1051
0
      switch(code) {
1052
0
        case 0x00:
1053
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: SIM Server Not Available");
1054
0
          break;
1055
0
        case 0x12:
1056
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: PIN Enable OK");
1057
0
          break;
1058
0
        default:
1059
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message");
1060
0
          break;
1061
0
      }
1062
0
      break;
1063
1064
0
    default:
1065
0
      col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
1066
0
      break;
1067
0
  }
1068
0
  return tvb_captured_length(tvb);
1069
0
}
1070
1071
0
static int dissect_isi_gss(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
1072
0
  proto_item *item;
1073
0
  proto_tree *tree;
1074
0
  uint8_t cmd, code;
1075
1076
0
  item = proto_tree_add_item(isitree, hf_isi_gss_payload, tvb, 0, -1, ENC_NA);
1077
0
  tree = proto_item_add_subtree(item, ett_isi_msg);
1078
1079
0
  proto_tree_add_item(tree, hf_isi_gss_message_id, tvb, 0, 1, ENC_BIG_ENDIAN);
1080
0
  cmd = tvb_get_uint8(tvb, 0);
1081
1082
0
  switch(cmd) {
1083
0
    case 0x00: /* GSS_CS_SERVICE_REQ */
1084
0
      proto_tree_add_item(tree, hf_isi_gss_operation, tvb, 1, 1, ENC_BIG_ENDIAN);
1085
0
      code = tvb_get_uint8(tvb, 1);
1086
0
      switch(code) {
1087
0
        case 0x0E:
1088
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Request: Radio Access Type Write");
1089
0
          break;
1090
1091
0
        case 0x9C:
1092
0
          proto_tree_add_item(tree, hf_isi_gss_subblock_count, tvb, 2, 1, ENC_BIG_ENDIAN);
1093
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Request: Radio Access Type Read");
1094
0
          break;
1095
1096
0
        default:
1097
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Request");
1098
0
          break;
1099
0
      }
1100
0
      break;
1101
1102
0
    case 0x01: /* GSS_CS_SERVICE_RESP */
1103
      /* proto_tree_add_item(tree, hf_isi_gss_service_type, tvb, 1, 1, ENC_NA); */
1104
0
      code = tvb_get_uint8(tvb, 1);
1105
0
      switch(code) {
1106
        /* case 0x9C:
1107
          col_set_str(pinfo->cinfo, COL_INFO, "Network Information Request: Read Home PLMN");
1108
          break; */
1109
0
        default:
1110
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Response");
1111
0
          break;
1112
0
      }
1113
0
      break;
1114
1115
0
    case 0x02: /* GSS_CS_SERVICE_FAIL_RESP */
1116
0
      proto_tree_add_item(tree, hf_isi_gss_operation, tvb, 1, 1, ENC_BIG_ENDIAN);
1117
0
      proto_tree_add_item(tree, hf_isi_gss_cause, tvb, 2, 1, ENC_BIG_ENDIAN);
1118
0
      code = tvb_get_uint8(tvb, 1);
1119
0
      switch(code) {
1120
0
        case 0x9C:
1121
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Failed Response: Radio Access Type Read");
1122
0
          break;
1123
0
        default:
1124
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Failed Response");
1125
0
          break;
1126
0
      }
1127
0
      break;
1128
1129
0
    case 0xF0: /* Common Message */
1130
0
      proto_tree_add_item(tree, hf_isi_gss_common_message_id, tvb, 1, 1, ENC_BIG_ENDIAN);
1131
      /* proto_tree_add_item(tree, hf_isi_gss_cause, tvb, 2, 1, ENC_BIG_ENDIAN); */
1132
0
      code = tvb_get_uint8(tvb, 1);
1133
0
      switch(code) {
1134
0
        case 0x01: /* COMM_SERVICE_NOT_IDENTIFIED_RESP */
1135
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: Service Not Identified Response");
1136
0
          break;
1137
0
        case 0x12: /* COMM_ISI_VERSION_GET_REQ */
1138
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISI Version Get Request");
1139
0
          break;
1140
0
        case 0x13: /* COMM_ISI_VERSION_GET_RESP */
1141
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISI Version Get Response");
1142
0
          break;
1143
0
        case 0x14: /* COMM_ISA_ENTITY_NOT_REACHABLE_RESP */
1144
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISA Entity Not Reachable");
1145
0
          break;
1146
0
        default:
1147
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message");
1148
0
          break;
1149
0
      }
1150
0
      break;
1151
1152
1153
0
    default:
1154
0
      col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
1155
0
      break;
1156
0
  }
1157
0
  return tvb_captured_length(tvb);
1158
0
}
1159
1160
static void dissect_isi_gps_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_item *item _U_, proto_tree *tree)
1161
0
{
1162
0
  int i;
1163
0
  double tmp_double;
1164
0
  float tmp_float;
1165
0
  int tmp_int32;
1166
0
  int offset = 0x0b; /* subpackets start here */
1167
1168
0
  uint8_t pkgcount = tvb_get_uint8(tvb, 0x07);
1169
0
  proto_tree_add_item(tree, hf_isi_gps_sub_pkgs, tvb, 0x07, 1, ENC_BIG_ENDIAN);
1170
1171
0
  for(i=0; i<pkgcount; i++) {
1172
0
    uint8_t sptype = tvb_get_uint8(tvb, offset+1);
1173
0
    uint8_t splen = tvb_get_uint8(tvb, offset+3);
1174
0
    proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, offset, splen, ett_isi_msg, NULL, "Subpacket (%s)", val_to_str(pinfo->pool, sptype, isi_gps_sub_id, "unknown: 0x%x"));
1175
1176
0
    proto_tree_add_item(subtree, hf_isi_gps_sub_type, tvb, offset+1, 1, ENC_BIG_ENDIAN);
1177
0
    proto_tree_add_item(subtree, hf_isi_gps_sub_len, tvb,  offset+3, 1, ENC_BIG_ENDIAN);
1178
1179
0
    offset += 4;
1180
0
    switch(sptype) {
1181
0
      case 0x02: /* Position */
1182
0
        tmp_double = tvb_get_ntohl(tvb, offset+0);
1183
0
        tmp_double = (tmp_double*360)/4294967296.0;
1184
0
        if(tmp_double > 180.0) tmp_double -= 360.0;
1185
0
        proto_tree_add_double(subtree, hf_isi_gps_latitude, tvb, offset+0, 4, tmp_double);
1186
1187
0
        tmp_double = tvb_get_ntohl(tvb, offset+4);
1188
0
        tmp_double = (tmp_double*360)/4294967296.0;
1189
0
        if(tmp_double > 180.0) tmp_double -= 360.0;
1190
0
        proto_tree_add_double(subtree, hf_isi_gps_longitude, tvb, offset+4, 4, tmp_double);
1191
1192
0
        tmp_float = (float)(tvb_get_ntohl(tvb, offset+12) / 100.0);
1193
0
        proto_tree_add_float(subtree, hf_isi_gps_eph, tvb, offset+12, 4, tmp_float);
1194
1195
0
        tmp_int32 = (tvb_get_ntohs(tvb, offset+18) - tvb_get_ntohs(tvb, offset+22))/2;
1196
0
        proto_tree_add_int(subtree, hf_isi_gps_altitude, tvb, offset+18, 6, tmp_int32);
1197
1198
0
        tmp_float = (float)(tvb_get_ntohs(tvb, offset+20) / 2.0);
1199
0
        proto_tree_add_float(subtree, hf_isi_gps_epv, tvb, offset+20, 2, tmp_float);
1200
1201
0
        break;
1202
0
      case 0x03: /* Date and Time */
1203
0
        proto_tree_add_item(subtree, hf_isi_gps_year,    tvb, offset+0, 2, ENC_BIG_ENDIAN);
1204
0
        proto_tree_add_item(subtree, hf_isi_gps_month,   tvb, offset+2, 1, ENC_BIG_ENDIAN);
1205
0
        proto_tree_add_item(subtree, hf_isi_gps_day,     tvb, offset+3, 1, ENC_BIG_ENDIAN);
1206
0
        proto_tree_add_item(subtree, hf_isi_gps_hour,    tvb, offset+5, 1, ENC_BIG_ENDIAN);
1207
0
        proto_tree_add_item(subtree, hf_isi_gps_minute,  tvb, offset+6, 1, ENC_BIG_ENDIAN);
1208
1209
0
        tmp_float = (float)(tvb_get_ntohs(tvb, offset+8) / 1000.0);
1210
0
        proto_tree_add_float(subtree, hf_isi_gps_second, tvb, offset+8, 2, tmp_float);
1211
0
        break;
1212
0
      case 0x04: /* Movement */
1213
0
        tmp_float = (float)(tvb_get_ntohs(tvb, offset+0) / 100.0);
1214
0
        proto_tree_add_float(subtree, hf_isi_gps_course, tvb, offset+0, 2, tmp_float);
1215
1216
0
        tmp_float = (float)(tvb_get_ntohs(tvb, offset+2) / 100.0);
1217
0
        proto_tree_add_float(subtree, hf_isi_gps_epd, tvb, offset+2, 2, tmp_float);
1218
1219
0
        tmp_float = (float)(tvb_get_ntohs(tvb, offset+6) * CMS_TO_KMH);
1220
0
        proto_tree_add_float(subtree, hf_isi_gps_speed, tvb, offset+6, 2, tmp_float);
1221
1222
0
        tmp_float = (float)(tvb_get_ntohs(tvb, offset+8) * CMS_TO_KMH);
1223
0
        proto_tree_add_float(subtree, hf_isi_gps_eps, tvb, offset+8, 2, tmp_float);
1224
1225
0
        tmp_float = (float)(tvb_get_ntohs(tvb, offset+10) * CMS_TO_KMH);
1226
0
        proto_tree_add_float(subtree, hf_isi_gps_climb, tvb, offset+10, 2, tmp_float);
1227
1228
0
        tmp_float = (float)(tvb_get_ntohs(tvb, offset+12) * CMS_TO_KMH);
1229
0
        proto_tree_add_float(subtree, hf_isi_gps_epc, tvb, offset+12, 2, tmp_float);
1230
0
        break;
1231
0
      case 0x05: /* Satellite Info */
1232
0
        {
1233
0
        uint8_t satellites = tvb_get_uint8(tvb, offset+0);
1234
0
        int sat;
1235
0
        proto_tree_add_item(subtree, hf_isi_gps_satellites, tvb, offset+0, 1, ENC_BIG_ENDIAN);
1236
1237
0
        for(sat = 0; sat < satellites ; sat++) {
1238
0
          int pos = offset+4+(sat*SAT_PKG_LEN);
1239
0
          proto_tree *sattree = proto_tree_add_subtree_format(subtree, tvb, pos, SAT_PKG_LEN, ett_isi_msg, NULL, "Satellite %d", sat);
1240
1241
0
          float signal_strength = (float)(tvb_get_ntohs(tvb, pos+3) / 100.0);
1242
0
          float elevation       = (float)(tvb_get_ntohs(tvb, pos+6) / 100.0);
1243
0
          float azimuth         = (float)(tvb_get_ntohs(tvb, pos+8) / 100.0);
1244
1245
0
          proto_tree_add_item(sattree, hf_isi_gps_prn,            tvb, pos+1, 1, ENC_BIG_ENDIAN);
1246
0
          proto_tree_add_item(sattree, hf_isi_gps_sat_used,       tvb, pos+2, 1, ENC_BIG_ENDIAN);
1247
0
          proto_tree_add_float(sattree, hf_isi_gps_sat_strength,  tvb, pos+3, 2, signal_strength);
1248
0
          proto_tree_add_float(sattree, hf_isi_gps_sat_elevation, tvb, pos+6, 2, elevation);
1249
0
          proto_tree_add_float(sattree, hf_isi_gps_sat_azimuth,   tvb, pos+8, 2, azimuth);
1250
0
        }
1251
0
        }
1252
0
        break;
1253
0
      case 0x07: /* CellInfo GSM */
1254
0
        proto_tree_add_item(subtree, hf_isi_gps_mcc,  tvb, offset+0, 2, ENC_BIG_ENDIAN);
1255
0
        proto_tree_add_item(subtree, hf_isi_gps_mnc,  tvb, offset+2, 2, ENC_BIG_ENDIAN);
1256
0
        proto_tree_add_item(subtree, hf_isi_gps_lac,  tvb, offset+4, 2, ENC_BIG_ENDIAN);
1257
0
        proto_tree_add_item(subtree, hf_isi_gps_cid,  tvb, offset+6, 2, ENC_BIG_ENDIAN);
1258
0
        break;
1259
0
      case 0x08: /* CellInfo WCDMA */
1260
0
        proto_tree_add_item(subtree, hf_isi_gps_mcc,  tvb, offset+0, 2, ENC_BIG_ENDIAN);
1261
0
        proto_tree_add_item(subtree, hf_isi_gps_mnc,  tvb, offset+2, 2, ENC_BIG_ENDIAN);
1262
0
        proto_tree_add_item(subtree, hf_isi_gps_ucid, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1263
0
        break;
1264
0
      default:
1265
0
        break;
1266
0
    }
1267
1268
0
    offset += splen - 4;
1269
0
  }
1270
1271
0
}
1272
1273
static int dissect_isi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_)
1274
0
{
1275
0
  proto_item *item;
1276
0
  proto_tree *tree;
1277
0
  uint8_t cmd;
1278
1279
0
  item = proto_tree_add_item(isitree, hf_isi_gps_payload, tvb, 0, -1, ENC_NA);
1280
0
  tree = proto_item_add_subtree(item, ett_isi_msg);
1281
1282
0
  proto_tree_add_item(tree, hf_isi_gps_cmd, tvb, 0, 1, ENC_BIG_ENDIAN);
1283
0
  cmd = tvb_get_uint8(tvb, 0);
1284
1285
0
  switch(cmd) {
1286
0
    case 0x7d: /* GPS Status */
1287
0
      proto_tree_add_item(tree, hf_isi_gps_status, tvb, 2, 1, ENC_BIG_ENDIAN);
1288
0
      col_add_fstr(pinfo->cinfo, COL_INFO, "GPS Status Indication: %s", val_to_str(pinfo->pool, tvb_get_uint8(tvb, 2), isi_gps_status, "unknown (0x%x)"));
1289
0
      break;
1290
0
    case 0x84:
1291
0
    case 0x85:
1292
0
    case 0x86:
1293
0
    case 0x87:
1294
0
    case 0x88:
1295
0
    case 0x89:
1296
0
    case 0x8a:
1297
0
    case 0x8b:
1298
0
      col_add_fstr(pinfo->cinfo, COL_INFO, "unknown A-GPS packet (0x%02x)", cmd);
1299
0
      break;
1300
0
    case 0x90: /* GPS Power Request */
1301
0
      col_set_str(pinfo->cinfo, COL_INFO, "GPS Power Request");
1302
0
      break;
1303
0
    case 0x91: /* GPS Power Request */
1304
0
      col_set_str(pinfo->cinfo, COL_INFO, "GPS Power Response");
1305
0
      break;
1306
0
    case 0x92: /* GPS Data */
1307
0
      col_set_str(pinfo->cinfo, COL_INFO, "GPS Data");
1308
0
      dissect_isi_gps_data(tvb, pinfo, item, tree);
1309
0
      break;
1310
0
    default:
1311
0
      col_add_fstr(pinfo->cinfo, COL_INFO, "unknown GPS packet (0x%02x)", cmd);
1312
0
      break;
1313
0
  }
1314
0
  return tvb_captured_length(tvb);
1315
0
}
1316
1317
static int dissect_isi_ss(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_)
1318
0
{
1319
0
  proto_item *item;
1320
0
  proto_tree *tree;
1321
0
  uint8_t cmd, code;
1322
1323
0
  item = proto_tree_add_item(isitree, hf_isi_ss_payload, tvb, 0, -1, ENC_NA);
1324
0
  tree = proto_item_add_subtree(item, ett_isi_msg);
1325
1326
0
  proto_tree_add_item(tree, hf_isi_ss_message_id, tvb, 0, 1, ENC_BIG_ENDIAN);
1327
0
  cmd = tvb_get_uint8(tvb, 0);
1328
1329
0
  switch(cmd) {
1330
0
    case 0x00: /* SS_SERVICE_REQ */
1331
0
      proto_tree_add_item(tree, hf_isi_ss_operation, tvb, 1, 1, ENC_BIG_ENDIAN);
1332
0
      proto_tree_add_item(tree, hf_isi_ss_service_code, tvb, 2, 1, ENC_BIG_ENDIAN);
1333
0
      code = tvb_get_uint8(tvb, 1);
1334
0
      switch(code) {
1335
0
        case 0x05:
1336
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Request: Interrogation");
1337
0
          break;
1338
0
        case 0x06:
1339
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Request: GSM Password Registration");
1340
0
          break;
1341
0
        default:
1342
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Request");
1343
0
          break;
1344
0
      }
1345
0
      break;
1346
1347
0
    case 0x01: /* SS_SERVICE_COMPLETED_RESP */
1348
0
      proto_tree_add_item(tree, hf_isi_ss_operation, tvb, 1, 1, ENC_BIG_ENDIAN);
1349
0
      proto_tree_add_item(tree, hf_isi_ss_service_code, tvb, 2, 1, ENC_BIG_ENDIAN);
1350
0
      code = tvb_get_uint8(tvb, 1);
1351
0
      switch(code) {
1352
0
        case 0x05:
1353
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Completed Response: Interrogation");
1354
0
          break;
1355
0
        default:
1356
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Completed Response");
1357
0
          break;
1358
0
      }
1359
0
      break;
1360
1361
0
    case 0x02: /* SS_SERVICE_FAILED_RESP */
1362
      /* proto_tree_add_item(tree, hf_isi_ss_service_type, tvb, 1, 1, ENC_NA); */
1363
0
      code = tvb_get_uint8(tvb, 1);
1364
0
      switch(code) {
1365
        /* case 0x2F:
1366
           col_set_str(pinfo->cinfo, COL_INFO, "Network Information Request: Read Home PLMN");
1367
           break;
1368
        */
1369
0
        default:
1370
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Failed Response");
1371
0
          break;
1372
0
      }
1373
0
      break;
1374
1375
0
    case 0x04: /* SS_GSM_USSD_SEND_REQ */
1376
0
      proto_tree_add_item(tree, hf_isi_ss_ussd_type, tvb, 1, 1, ENC_BIG_ENDIAN);
1377
0
      proto_tree_add_item(tree, hf_isi_ss_subblock_count, tvb, 2, 1, ENC_BIG_ENDIAN);
1378
1379
0
      code = tvb_get_uint8(tvb, 1);
1380
0
      switch(code) {
1381
0
        case 0x02: /* SS_GSM_USSD_COMMAND */
1382
0
          proto_tree_add_item(tree, hf_isi_ss_subblock, tvb, 3, 1, ENC_BIG_ENDIAN);
1383
0
          col_set_str(pinfo->cinfo, COL_INFO, "GSM USSD Send Command Request");
1384
0
          break;
1385
0
        default:
1386
0
          col_set_str(pinfo->cinfo, COL_INFO, "GSM USSD Message Send Request");
1387
0
          break;
1388
0
      }
1389
0
      break;
1390
1391
0
    case 0x05: /* SS_GSM_USSD_SEND_RESP */
1392
      /* proto_tree_add_item(tree, hf_isi_ss_service_type, tvb, 1, 1, ENC_NA); */
1393
0
      code = tvb_get_uint8(tvb, 1);
1394
0
      switch(code) {
1395
        /* case 0x2F:
1396
          col_set_str(pinfo->cinfo, COL_INFO, "Network Information Request: Read Home PLMN");
1397
          break; */
1398
0
        default:
1399
0
          col_set_str(pinfo->cinfo, COL_INFO, "GSM USSD Message Send Response");
1400
0
          break;
1401
0
      }
1402
0
      break;
1403
1404
0
    case 0x06: /* SS_GSM_USSD_RECEIVE_IND */
1405
      /* An unknown Encoding Information byte precedes - see 3GPP TS 23.038 chapter 5 */
1406
0
      proto_tree_add_item(tree, hf_isi_ss_ussd_type, tvb, 2, 1, ENC_BIG_ENDIAN);
1407
0
      proto_tree_add_item(tree, hf_isi_ss_ussd_length, tvb, 3, 1, ENC_BIG_ENDIAN);
1408
1409
0
      code = tvb_get_uint8(tvb, 1);
1410
0
      switch(code) {
1411
0
        case 0x04:
1412
1413
1414
1415
0
          col_set_str(pinfo->cinfo, COL_INFO, "GSM USSD Message Received Notification");
1416
0
          break;
1417
0
        default:
1418
0
          col_set_str(pinfo->cinfo, COL_INFO, "GSM USSD Message Received Indication");
1419
0
          break;
1420
0
      }
1421
0
      break;
1422
1423
0
    case 0x09: /* SS_STATUS_IND */
1424
0
      proto_tree_add_item(tree, hf_isi_ss_status_indication, tvb, 1, 1, ENC_BIG_ENDIAN);
1425
0
      proto_tree_add_item(tree, hf_isi_ss_subblock_count, tvb, 2, 1, ENC_BIG_ENDIAN);
1426
      /* proto_tree_add_item(tree, hf_isi_ss_subblock, tvb, 3, 1, ENC_BIG_ENDIAN); */
1427
0
      code = tvb_get_uint8(tvb, 1);
1428
0
      switch(code) {
1429
0
        case 0x00:
1430
0
          col_set_str(pinfo->cinfo, COL_INFO, "Status Indication: Request Service Start");
1431
0
          break;
1432
0
        case 0x01:
1433
0
          col_set_str(pinfo->cinfo, COL_INFO, "Status Indication: Request Service Stop");
1434
0
          break;
1435
0
        case 0x02:
1436
0
          col_set_str(pinfo->cinfo, COL_INFO, "Status Indication: Request USSD Start");
1437
0
          break;
1438
0
        case 0x03:
1439
0
          col_set_str(pinfo->cinfo, COL_INFO, "Status Indication: Request USSD Stop");
1440
0
          break;
1441
0
        default:
1442
0
          col_set_str(pinfo->cinfo, COL_INFO, "Status Indication");
1443
0
          break;
1444
0
      }
1445
0
      break;
1446
1447
0
    case 0x10: /* SS_SERVICE_COMPLETED_IND */
1448
0
      proto_tree_add_item(tree, hf_isi_ss_operation, tvb, 1, 1, ENC_BIG_ENDIAN);
1449
0
      proto_tree_add_item(tree, hf_isi_ss_service_code, tvb, 2, 1, ENC_BIG_ENDIAN);
1450
0
      code = tvb_get_uint8(tvb, 1);
1451
0
      switch(code) {
1452
0
        case 0x05:
1453
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Completed Indication: Interrogation");
1454
0
          break;
1455
0
        default:
1456
0
          col_set_str(pinfo->cinfo, COL_INFO, "Service Completed Indication");
1457
0
          break;
1458
0
      }
1459
0
      break;
1460
1461
0
    case 0xF0: /* SS_COMMON_MESSAGE */
1462
0
      proto_tree_add_item(tree, hf_isi_ss_common_message_id, tvb, 1, 1, ENC_BIG_ENDIAN);
1463
0
      code = tvb_get_uint8(tvb, 1);
1464
0
      switch(code) {
1465
0
        case 0x01: /* COMM_SERVICE_NOT_IDENTIFIED_RESP */
1466
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: Service Not Identified Response");
1467
0
          break;
1468
0
        case 0x12: /* COMM_ISI_VERSION_GET_REQ */
1469
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISI Version Get Request");
1470
0
          break;
1471
0
        case 0x13: /* COMM_ISI_VERSION_GET_RESP */
1472
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISI Version Get Response");
1473
0
          break;
1474
0
        case 0x14: /* COMM_ISA_ENTITY_NOT_REACHABLE_RESP */
1475
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISA Entity Not Reachable");
1476
0
          break;
1477
0
        default:
1478
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message");
1479
0
          break;
1480
0
      }
1481
0
      break;
1482
1483
1484
0
    default:
1485
0
      col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
1486
0
      break;
1487
0
  }
1488
0
  return tvb_captured_length(tvb);
1489
0
}
1490
1491
static void dissect_isi_network_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_item *item _U_, proto_tree *tree)
1492
0
{
1493
0
  int i;
1494
0
  int offset = 0x03; /* subpackets start here */
1495
0
  uint16_t len;
1496
1497
0
  uint8_t pkgcount = tvb_get_uint8(tvb, 0x02);
1498
0
  proto_tree_add_item(tree, hf_isi_network_data_sub_pkgs, tvb, 0x02, 1, ENC_BIG_ENDIAN);
1499
1500
0
  for(i=0; i<pkgcount; i++) {
1501
0
    uint8_t sptype = tvb_get_uint8(tvb, offset+0);
1502
0
    uint8_t splen = tvb_get_uint8(tvb, offset+1);
1503
1504
0
    proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, offset, splen, ett_isi_msg, NULL, "Subpacket (%s)", val_to_str(pinfo->pool, sptype, isi_network_status_sub_id, "unknown: 0x%x"));
1505
1506
0
    proto_tree_add_item(subtree, hf_isi_network_status_sub_type, tvb, offset+0, 1, ENC_BIG_ENDIAN);
1507
0
    proto_tree_add_item(subtree, hf_isi_network_status_sub_len, tvb,  offset+1, 1, ENC_BIG_ENDIAN);
1508
1509
0
    offset += 2;
1510
1511
0
    switch(sptype) {
1512
0
      case 0x00: /* NET_REG_INFO_COMMON */
1513
        /* FIXME: TODO */
1514
0
        break;
1515
0
      case 0x09: /* NET_GSM_REG_INFO */
1516
0
        proto_tree_add_item(subtree, hf_isi_network_status_sub_lac, tvb, offset+0, 2, ENC_BIG_ENDIAN);
1517
0
        proto_tree_add_item(subtree, hf_isi_network_status_sub_cid, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1518
        /* FIXME: TODO */
1519
0
        break;
1520
0
      case 0xe3: /* UNKNOWN */
1521
        /* FIXME: TODO: byte 0: message type (provider name / network name) ? */
1522
1523
0
        len = tvb_get_ntohs(tvb, offset+2);
1524
0
        proto_tree_add_item(subtree, hf_isi_network_status_sub_msg_len, tvb, offset+2, 2, ENC_BIG_ENDIAN);
1525
1526
0
        proto_tree_add_item(subtree, hf_isi_network_status_sub_msg, tvb, offset+4, len*2, ENC_UTF_16|ENC_BIG_ENDIAN);
1527
0
        break;
1528
0
      default:
1529
0
        break;
1530
0
    }
1531
1532
0
    offset += splen - 2;
1533
0
  }
1534
0
}
1535
1536
0
static void dissect_isi_network_cell_info_ind(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *tree) {
1537
0
  int i;
1538
0
  int offset = 0x03;
1539
0
  uint8_t pkgcount = tvb_get_uint8(tvb, 0x02);
1540
1541
0
  static int * const gsm_band_fields[] = {
1542
0
    &hf_isi_network_gsm_band_900,
1543
0
    &hf_isi_network_gsm_band_1800,
1544
0
    &hf_isi_network_gsm_band_1900,
1545
0
    &hf_isi_network_gsm_band_850,
1546
0
    NULL
1547
0
  };
1548
1549
0
  proto_tree_add_item(tree, hf_isi_network_data_sub_pkgs, tvb, 0x02, 1, ENC_BIG_ENDIAN);
1550
1551
0
  for(i=0; i<pkgcount; i++) {
1552
0
    uint8_t sptype = tvb_get_uint8(tvb, offset+0);
1553
0
    uint8_t splen = tvb_get_uint8(tvb, offset+1);
1554
1555
0
    proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, offset, splen, ett_isi_msg, NULL, "Subpacket (%s)", val_to_str(pinfo->pool, sptype, isi_network_cell_info_sub_id, "unknown: 0x%x"));
1556
1557
0
    proto_tree_add_item(subtree, hf_isi_network_cell_info_sub_type, tvb, offset+0, 1, ENC_BIG_ENDIAN);
1558
0
    proto_tree_add_item(subtree, hf_isi_network_cell_info_sub_len, tvb,  offset+1, 1, ENC_BIG_ENDIAN);
1559
1560
0
    offset += 2;
1561
1562
0
    switch(sptype) {
1563
0
      case 0x50: /* NET_EPS_CELL_INFO */
1564
        /* TODO: not yet implemented */
1565
0
        expert_add_info(pinfo, item, &ei_isi_unsupported_packet);
1566
0
        break;
1567
0
      case 0x46: /* NET_GSM_CELL_INFO */
1568
0
        proto_tree_add_item(subtree, hf_isi_network_status_sub_lac, tvb, offset+0, 2, ENC_BIG_ENDIAN);
1569
0
        proto_tree_add_item(subtree, hf_isi_network_status_sub_cid, tvb, offset+2, 4, ENC_BIG_ENDIAN);
1570
0
        proto_tree_add_bitmask_text(subtree, tvb, offset+6, 4, "GSM Bands: ", "all bands, since none is selected", ett_isi_network_gsm_band_info, gsm_band_fields, false, BMT_NO_FALSE | BMT_NO_TFS);
1571
0
        proto_tree_add_item(subtree, hf_isi_network_cell_info_sub_operator, tvb, offset+10, 3, ENC_BIG_ENDIAN);
1572
        /* TODO: analysis of the following 5 bytes (which were 0x00 in my dumps) */
1573
0
        break;
1574
0
      case 0x47: /* NET_WCDMA_CELL_INFO */
1575
        /* TODO: not yet implemented */
1576
0
        expert_add_info(pinfo, item, &ei_isi_unsupported_packet);
1577
0
        break;
1578
0
      default:
1579
0
        expert_add_info(pinfo, item, &ei_isi_unsupported_packet);
1580
0
        break;
1581
0
    }
1582
1583
0
    offset += splen - 2;
1584
0
  }
1585
0
}
1586
1587
0
static int dissect_isi_network(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
1588
0
  proto_item *item;
1589
0
  proto_tree *tree;
1590
0
  uint8_t cmd;
1591
1592
0
  item = proto_tree_add_item(isitree, hf_isi_network_payload, tvb, 0, -1, ENC_NA);
1593
0
  tree = proto_item_add_subtree(item, ett_isi_msg);
1594
1595
0
  proto_tree_add_item(tree, hf_isi_network_cmd, tvb, 0, 1, ENC_BIG_ENDIAN);
1596
0
  cmd = tvb_get_uint8(tvb, 0);
1597
1598
0
  switch(cmd) {
1599
0
    case 0x07:
1600
0
      col_set_str(pinfo->cinfo, COL_INFO, "Network Selection Request");
1601
0
      expert_add_info(pinfo, item, &ei_isi_unsupported_packet);
1602
0
      break;
1603
0
    case 0x20:
1604
0
      col_set_str(pinfo->cinfo, COL_INFO, "Network Ciphering Indication");
1605
0
      expert_add_info(pinfo, item, &ei_isi_unsupported_packet);
1606
0
      break;
1607
0
    case 0xE2:
1608
0
      col_set_str(pinfo->cinfo, COL_INFO, "Network Status Indication");
1609
0
      dissect_isi_network_status(tvb, pinfo, item, tree);
1610
0
      break;
1611
0
    case 0x42:
1612
0
      col_set_str(pinfo->cinfo, COL_INFO, "Network Cell Info Indication");
1613
0
      dissect_isi_network_cell_info_ind(tvb, pinfo, item, tree);
1614
0
      break;
1615
0
    default:
1616
0
      col_set_str(pinfo->cinfo, COL_INFO, "unknown Network packet");
1617
0
      expert_add_info(pinfo, item, &ei_isi_unsupported_packet);
1618
0
      break;
1619
0
  }
1620
0
  return tvb_captured_length(tvb);
1621
0
}
1622
1623
0
static int dissect_isi_sms(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
1624
0
  proto_item *item = NULL;
1625
0
  proto_tree *tree = NULL;
1626
0
  uint8_t cmd, code;
1627
1628
0
  item = proto_tree_add_item(isitree, hf_isi_sms_payload, tvb, 0, -1, ENC_NA);
1629
0
  tree = proto_item_add_subtree(item, ett_isi_msg);
1630
1631
0
  proto_tree_add_item(tree, hf_isi_sms_message_id, tvb, 0, 1, ENC_BIG_ENDIAN);
1632
0
  cmd = tvb_get_uint8(tvb, 0);
1633
1634
0
  switch(cmd) {
1635
0
    case 0x03: /* SMS_MESSAGE_SEND_RESP */
1636
0
      proto_tree_add_item(tree, hf_isi_sms_subblock_count, tvb, 2, 1, ENC_BIG_ENDIAN);
1637
0
      code = tvb_get_uint8(tvb, 1);
1638
0
      switch(code) {
1639
#if 0
1640
        case 0x05:
1641
            col_set_str(pinfo->cinfo, COL_INFO, "Service Request: Interrogation");
1642
            break;
1643
        case 0x06:
1644
            col_set_str(pinfo->cinfo, COL_INFO, "Service Request: GSM Password Registration");
1645
            break;
1646
#endif
1647
0
        default:
1648
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS Message Send Response");
1649
0
          break;
1650
0
      }
1651
0
      break;
1652
1653
0
    case 0x06: /* SMS_PP_ROUTING_REQ */
1654
0
      proto_tree_add_item(tree, hf_isi_sms_routing_command, tvb, 1, 1, ENC_BIG_ENDIAN);
1655
0
      proto_tree_add_item(tree, hf_isi_sms_subblock_count, tvb, 2, 1, ENC_BIG_ENDIAN);
1656
0
      code = tvb_get_uint8(tvb, 1);
1657
0
      switch(code) {
1658
#if 0
1659
        case 0x05:
1660
            col_set_str(pinfo->cinfo, COL_INFO, "Service Request: Interrogation");
1661
            break;
1662
        case 0x06:
1663
            col_set_str(pinfo->cinfo, COL_INFO, "Service Request: GSM Password Registration");
1664
            break;
1665
#endif
1666
0
        default:
1667
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS Point-to-Point Routing Request");
1668
0
          break;
1669
0
      }
1670
0
      break;
1671
1672
0
    case 0x07: /* SMS_PP_ROUTING_RESP */
1673
      /* proto_tree_add_item(tree, hf_isi_sms_service_type, tvb, 1, 1, ENC_NA); */
1674
0
      code = tvb_get_uint8(tvb, 1);
1675
0
      switch(code) {
1676
          /* case 0x2F:
1677
            col_set_str(pinfo->cinfo, COL_INFO, "Network Information Request: Read Home PLMN");
1678
            break; */
1679
0
        default:
1680
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS Point-to-Point Routing Response");
1681
0
          break;
1682
0
      }
1683
0
      break;
1684
1685
0
    case 0x0B: /* SMS_GSM_CB_ROUTING_REQ */
1686
0
      proto_tree_add_item(tree, hf_isi_sms_routing_command, tvb, 1, 1, ENC_BIG_ENDIAN);
1687
0
      proto_tree_add_item(tree, hf_isi_sms_routing_mode, tvb, 2, 1, ENC_BIG_ENDIAN);
1688
#if 0
1689
      proto_tree_add_item(tree, hf_isi_sms_cb_subject_list_type, tvb, 3, 1, ENC_BIG_ENDIAN);
1690
      proto_tree_add_item(tree, hf_isi_sms_cb_subject_count, tvb, 4, 1, ENC_BIG_ENDIAN);
1691
      proto_tree_add_item(tree, hf_isi_sms_cb_language_count, tvb, 5, 1, ENC_BIG_ENDIAN);
1692
      proto_tree_add_item(tree, hf_isi_sms_cb_range, tvb, 6, 1, ENC_BIG_ENDIAN);
1693
#endif
1694
0
      code = tvb_get_uint8(tvb, 1);
1695
0
      switch(code) {
1696
0
        case 0x00:
1697
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS GSM Cell Broadcast Routing Release");
1698
0
          break;
1699
0
        case 0x01:
1700
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS GSM Cell Broadcast Routing Set");
1701
0
          break;
1702
0
        default:
1703
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS GSM Cell Broadcast Routing Request");
1704
0
          break;
1705
0
      }
1706
0
      break;
1707
1708
0
    case 0x0C: /* SMS_GSM_CB_ROUTING_RESP */
1709
#if 0
1710
      proto_tree_add_item(tree, hf_isi_sms_operation, tvb, 1, 1, ENC_BIG_ENDIAN);
1711
      proto_tree_add_item(tree, hf_isi_sms_service_code, tvb, 2, 1, ENC_BIG_ENDIAN);
1712
#endif
1713
0
      code = tvb_get_uint8(tvb, 1);
1714
0
      switch(code) {
1715
          /* case 0x05:
1716
            col_set_str(pinfo->cinfo, COL_INFO, "Service Completed Response: Interrogation");
1717
            break; */
1718
0
        default:
1719
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS GSM Cell Broadcast Routing Response");
1720
0
          break;
1721
0
      }
1722
0
      break;
1723
1724
0
    case 0x22: /* SMS_MESSAGE_SEND_STATUS_IND */
1725
0
      proto_tree_add_item(tree, hf_isi_sms_send_status, tvb, 1, 1, ENC_BIG_ENDIAN);
1726
      /* The second byte is a "segment" identifier/"Message Reference" */
1727
0
      proto_tree_add_item(tree, hf_isi_sms_route, tvb, 3, 1, ENC_BIG_ENDIAN);
1728
0
      code = tvb_get_uint8(tvb, 1);
1729
0
      switch(code) {
1730
0
        case 0x02:
1731
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS Message Sending Status: Waiting for Network");
1732
0
          break;
1733
0
        case 0x03:
1734
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS Message Sending Status: Idle");
1735
0
          break;
1736
0
        default:
1737
0
          col_set_str(pinfo->cinfo, COL_INFO, "SMS Message Sending Status Indication");
1738
0
          break;
1739
0
      }
1740
0
      break;
1741
1742
0
    case 0xF0: /* SS_COMMON_MESSAGE */
1743
0
      proto_tree_add_item(tree, hf_isi_sms_common_message_id, tvb, 1, 1, ENC_BIG_ENDIAN);
1744
0
      code = tvb_get_uint8(tvb, 1);
1745
0
      switch(code) {
1746
0
        case 0x01: /* COMM_SERVICE_NOT_IDENTIFIED_RESP */
1747
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: Service Not Identified Response");
1748
0
          break;
1749
0
        case 0x12: /* COMM_ISI_VERSION_GET_REQ */
1750
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISI Version Get Request");
1751
0
          break;
1752
0
        case 0x13: /* COMM_ISI_VERSION_GET_RESP */
1753
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISI Version Get Response");
1754
0
          break;
1755
0
        case 0x14: /* COMM_ISA_ENTITY_NOT_REACHABLE_RESP */
1756
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message: ISA Entity Not Reachable");
1757
0
          break;
1758
0
        default:
1759
0
          col_set_str(pinfo->cinfo, COL_INFO, "Common Message");
1760
0
          break;
1761
0
      }
1762
0
      break;
1763
1764
0
    default:
1765
0
      col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
1766
0
      break;
1767
0
  }
1768
0
  return tvb_captured_length(tvb);
1769
0
}
1770
1771
0
static int dissect_isi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
1772
0
  proto_tree *isi_tree;
1773
0
  proto_item *item, *item_len;
1774
0
  tvbuff_t *content_tvb;
1775
1776
0
  uint8_t src;
1777
0
  uint8_t dst;
1778
0
  uint8_t resource;
1779
0
  uint16_t length;
1780
1781
0
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISI");
1782
0
  col_clear(pinfo->cinfo, COL_INFO);
1783
1784
  /* Start with a top-level item to add everything else to */
1785
0
  item = proto_tree_add_item(tree, proto_isi, tvb, 0, -1, ENC_NA);
1786
0
  isi_tree = proto_item_add_subtree(item, ett_isi);
1787
1788
  /* Common Phonet/ISI Header */
1789
0
  proto_tree_add_item(isi_tree, hf_isi_rdev, tvb, 0, 1, ENC_NA);
1790
0
  proto_tree_add_item(isi_tree, hf_isi_sdev, tvb, 1, 1, ENC_NA);
1791
0
  proto_tree_add_item(isi_tree, hf_isi_res,  tvb, 2, 1, ENC_NA);
1792
0
  item_len = proto_tree_add_item(isi_tree, hf_isi_len,  tvb, 3, 2, ENC_BIG_ENDIAN);
1793
0
  proto_tree_add_item(isi_tree, hf_isi_robj, tvb, 5, 1, ENC_NA);
1794
0
  proto_tree_add_item(isi_tree, hf_isi_sobj, tvb, 6, 1, ENC_NA);
1795
0
  proto_tree_add_item(isi_tree, hf_isi_id,   tvb, 7, 1, ENC_NA);
1796
1797
0
  length = tvb_get_ntohs(tvb, 3) - 3;
1798
0
  resource = tvb_get_uint8(tvb, 2);
1799
0
  dst = tvb_get_uint8(tvb, 0);
1800
0
  src = tvb_get_uint8(tvb, 1);
1801
1802
0
  if (tvb_reported_length(tvb) - 8 < length) {
1803
0
    expert_add_info_format(pinfo, item_len, &ei_isi_len, "Broken Length (%d > %d)", length, tvb_reported_length(tvb)-8);
1804
0
    length = tvb_reported_length(tvb) - 8;
1805
0
  }
1806
1807
0
  col_set_str(pinfo->cinfo, COL_DEF_SRC, val_to_str_const(src, hf_isi_device, "Unknown"));
1808
0
  col_set_str(pinfo->cinfo, COL_DEF_DST, val_to_str_const(dst, hf_isi_device, "Unknown"));
1809
1810
0
  content_tvb = tvb_new_subset_length(tvb, 8, length);
1811
1812
  /* Call subdissector depending on the resource ID */
1813
0
  if (!dissector_try_uint(isi_resource_dissector_table, resource, content_tvb, pinfo, isi_tree))
1814
0
    call_data_dissector(content_tvb, pinfo, isi_tree);
1815
1816
0
  return tvb_captured_length(tvb);
1817
0
}
1818
1819
/* Experimental approach based upon the one used for PPP*/
1820
static bool dissect_usb_isi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1821
0
{
1822
0
  tvbuff_t *next_tvb;
1823
1824
0
  if(tvb_get_uint8(tvb, 0) != 0x1B)
1825
0
    return false;
1826
1827
0
  next_tvb = tvb_new_subset_remaining(tvb, 1);
1828
0
  dissect_isi(next_tvb, pinfo, tree, data);
1829
1830
0
  return true;
1831
0
}
1832
1833
void
1834
proto_register_isi(void)
1835
14
{
1836
14
  static hf_register_info hf[] = {
1837
14
    { &hf_isi_rdev,
1838
14
      { "Receiver Device", "isi.rdev", FT_UINT8, BASE_HEX,
1839
14
        VALS(hf_isi_device), 0x0, NULL, HFILL }},
1840
14
    { &hf_isi_sdev,
1841
14
      { "Sender Device", "isi.sdev", FT_UINT8, BASE_HEX,
1842
14
        VALS(hf_isi_device), 0x0, NULL, HFILL }},
1843
14
    { &hf_isi_res,
1844
14
      { "Resource", "isi.res", FT_UINT8, BASE_HEX,
1845
14
        VALS(hf_isi_resource), 0x0, NULL, HFILL }},
1846
14
    { &hf_isi_len,
1847
14
      { "Length", "isi.len", FT_UINT16, BASE_DEC,
1848
14
        NULL, 0x0, NULL, HFILL }},
1849
14
    { &hf_isi_robj,
1850
14
      { "Receiver Object", "isi.robj", FT_UINT8, BASE_HEX,
1851
14
        NULL, 0x0, NULL, HFILL }},
1852
14
    { &hf_isi_sobj,
1853
14
      { "Sender Object", "isi.sobj", FT_UINT8, BASE_HEX,
1854
14
        NULL, 0x0, NULL, HFILL }},
1855
14
    { &hf_isi_id,
1856
14
      { "Packet ID", "isi.id", FT_UINT8, BASE_DEC,
1857
14
        NULL, 0x0, NULL, HFILL }}
1858
14
    };
1859
1860
14
  static hf_register_info simauth_hf[] = {
1861
14
    { &hf_isi_sim_auth_payload,
1862
14
      { "Payload", "isi.sim.auth.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1863
14
    { &hf_isi_sim_auth_cmd,
1864
14
      { "Command", "isi.sim.auth.cmd", FT_UINT8, BASE_HEX, VALS(isi_sim_auth_id), 0x0, NULL, HFILL }},
1865
14
    { &hf_isi_sim_auth_pw_type,
1866
14
      { "Password Type", "isi.sim.auth.type", FT_UINT8, BASE_HEX, VALS(isi_sim_auth_pw_type), 0x0, NULL, HFILL }},
1867
14
    { &hf_isi_sim_auth_pin,
1868
14
      { "PIN", "isi.sim.auth.pin", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1869
14
    { &hf_isi_sim_auth_puk,
1870
14
      { "PUK", "isi.sim.auth.puk", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1871
14
    { &hf_isi_sim_auth_new_pin,
1872
14
      { "New PIN", "isi.sim.auth.new_pin", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1873
14
    { &hf_isi_sim_auth_protection_req,
1874
14
      { "Protection Request", "isi.sim.auth.request.protection", FT_UINT8, BASE_HEX, VALS(isi_sim_auth_protection_req), 0x0, NULL, HFILL }},
1875
14
    { &hf_isi_sim_auth_protection_rsp,
1876
14
      { "Protection Response", "isi.sim.auth.response.protection", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1877
14
    { &hf_isi_sim_auth_status_rsp,
1878
14
      { "Status Response", "isi.sim.auth.response.status", FT_UINT8, BASE_HEX, VALS(isi_sim_auth_resp), 0x0, NULL, HFILL }},
1879
14
    { &hf_isi_sim_auth_indication,
1880
14
      { "Indication", "isi.sim.auth.indication", FT_UINT8, BASE_HEX, VALS(isi_sim_auth_indication), 0x0, NULL, HFILL }},
1881
14
    { &hf_isi_sim_auth_indication_cfg,
1882
14
      { "Configuration", "isi.sim.auth.cfg", FT_UINT8, BASE_HEX, VALS(isi_sim_auth_indication_cfg), 0x0, NULL, HFILL }}
1883
14
  };
1884
1885
14
  static hf_register_info sim_hf[] = {
1886
14
    { &hf_isi_sim_payload,
1887
14
      { "Payload", "isi.sim.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1888
14
    { &hf_isi_sim_message_id,
1889
14
      { "Message ID", "isi.sim.msg_id", FT_UINT8, BASE_HEX, VALS(isi_sim_message_id), 0x0, NULL, HFILL }},
1890
14
    { &hf_isi_sim_service_type,
1891
14
      { "Service Type", "isi.sim.service_type", FT_UINT8, BASE_HEX, VALS(isi_sim_service_type), 0x0, NULL, HFILL }},
1892
14
    { &hf_isi_sim_cause,
1893
14
      { "Cause", "isi.sim.cause", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &isi_sim_cause_ext, 0x0, NULL, HFILL }},
1894
14
    { &hf_isi_sim_secondary_cause,
1895
14
      { "Secondary Cause", "isi.sim.secondary_cause", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &isi_sim_cause_ext, 0x0, NULL, HFILL }},
1896
14
    {&hf_isi_sim_subblock_count,
1897
14
      { "Subblock Count", "isi.sim.subblock_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1898
14
    {&hf_isi_sim_subblock_size,
1899
14
      { "Subblock Size", "isi.sim.subblock_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1900
14
    { &hf_isi_sim_pb_subblock,
1901
14
      { "Subblock", "isi.sim.pb.subblock", FT_UINT8, BASE_HEX, VALS(isi_sim_pb_subblock), 0x0, NULL, HFILL }},
1902
14
    { &hf_isi_sim_pb_type,
1903
14
      { "Phonebook Type", "isi.sim.pb.type", FT_UINT8, BASE_HEX, VALS(isi_sim_pb_type), 0x0, NULL, HFILL }},
1904
14
    {&hf_isi_sim_pb_location,
1905
14
      { "Phonebook Location", "isi.sim.pb.location", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1906
14
    {&hf_isi_sim_pb_tag_count,
1907
14
      { "Tag Count", "isi.sim.pb.tag.count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1908
14
    { &hf_isi_sim_pb_tag,
1909
14
      { "Phonebook Item Type", "isi.sim.pb.tag", FT_UINT8, BASE_HEX, VALS(isi_sim_pb_tag), 0x0, NULL, HFILL }},
1910
    /* {&hf_isi_sim_imsi_byte_1,
1911
      { "IMSI Byte 1", "isi.sim.imsi.byte1", FT_UINT16, BASE_HEX, NULL, 0xF0, NULL, HFILL }},*/
1912
14
    {&hf_isi_sim_imsi_length,
1913
14
      { "IMSI Length", "isi.sim.imsi.length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1914
14
  };
1915
1916
14
  static hf_register_info gps_hf[] = {
1917
14
    { &hf_isi_gps_payload,
1918
14
      { "Payload", "isi.gps.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1919
14
    { &hf_isi_gps_cmd,
1920
14
      { "Command", "isi.gps.cmd", FT_UINT8, BASE_HEX, VALS(isi_gps_id), 0x0, NULL, HFILL }},
1921
14
    { &hf_isi_gps_sub_pkgs,
1922
14
      { "Number of Subpackets", "isi.gps.pkgs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1923
14
    { &hf_isi_gps_sub_type,
1924
14
      { "Subpacket Type", "isi.gps.sub.type", FT_UINT8, BASE_HEX, VALS(isi_gps_sub_id), 0x0, NULL, HFILL }},
1925
14
    { &hf_isi_gps_sub_len,
1926
14
      { "Subpacket Length", "isi.gps.sub.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1927
14
    { &hf_isi_gps_status,
1928
14
      { "Status", "isi.gps.status", FT_UINT8, BASE_HEX, VALS(isi_gps_status), 0x0, NULL, HFILL }},
1929
14
    { &hf_isi_gps_year,
1930
14
      { "Year", "isi.gps.date.year", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1931
14
    { &hf_isi_gps_month,
1932
14
      { "Month", "isi.gps.date.month", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1933
14
    { &hf_isi_gps_day,
1934
14
      { "Day", "isi.gps.date.day", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1935
14
    { &hf_isi_gps_hour,
1936
14
      { "Hour", "isi.gps.time.hour", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1937
14
    { &hf_isi_gps_minute,
1938
14
      { "Minute", "isi.gps.time.minute", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1939
14
    { &hf_isi_gps_second,
1940
14
      { "Second", "isi.gps.time.second", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1941
14
    { &hf_isi_gps_latitude,
1942
14
      { "Latitude", "isi.gps.lat", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1943
14
    { &hf_isi_gps_longitude,
1944
14
      { "Longitude", "isi.gps.lon", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1945
14
    { &hf_isi_gps_eph,
1946
14
      { "Position Accuracy", "isi.gps.eph", FT_FLOAT, BASE_NONE, NULL, 0x0, "EPH (position accuracy) in meter", HFILL }},
1947
14
    { &hf_isi_gps_altitude,
1948
14
      { "Altitude", "isi.gps.alt", FT_INT16, BASE_DEC, NULL, 0x0, "Altitude in meter", HFILL }},
1949
14
    { &hf_isi_gps_epv,
1950
14
      { "Altitude Accuracy", "isi.gps.epv", FT_FLOAT, BASE_NONE, NULL, 0x0, "EPV (altitude accuracy) in meter", HFILL }},
1951
14
    { &hf_isi_gps_course,
1952
14
      { "Course", "isi.gps.course", FT_FLOAT, BASE_NONE, NULL, 0x0, "Course in degree", HFILL }},
1953
14
    { &hf_isi_gps_epd,
1954
14
      { "Course Accuracy", "isi.gps.epd", FT_FLOAT, BASE_NONE, NULL, 0x0, "EPD (course accuracy) in degree", HFILL }},
1955
14
    { &hf_isi_gps_speed,
1956
14
      { "Speed", "isi.gps.speed", FT_FLOAT, BASE_NONE, NULL, 0x0, "Speed in km/h", HFILL }},
1957
14
    { &hf_isi_gps_eps,
1958
14
      { "Speed Accuracy", "isi.gps.eps", FT_FLOAT, BASE_NONE, NULL, 0x0, "EPS (speed accuracy) in km/h", HFILL }},
1959
14
    { &hf_isi_gps_climb,
1960
14
      { "Climb", "isi.gps.climb", FT_FLOAT, BASE_NONE, NULL, 0x0, "Climb in km/h", HFILL }},
1961
14
    { &hf_isi_gps_satellites,
1962
14
      { "Visible Satellites", "isi.gps.satellites", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1963
14
    { &hf_isi_gps_prn,
1964
14
      { "Pseudorandom Noise (PRN)", "isi.gps.sat.prn", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
1965
14
    { &hf_isi_gps_sat_used,
1966
14
      { "in use", "isi.gps.sat.used", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1967
14
    { &hf_isi_gps_sat_strength,
1968
14
      { "Signal Strength", "isi.gps.sat.strength", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1969
14
    { &hf_isi_gps_sat_elevation,
1970
14
      { "Elevation", "isi.gps.sat.elevation", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1971
14
    { &hf_isi_gps_sat_azimuth,
1972
14
      { "Azimuth", "isi.gps.sat.azimuth", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1973
14
    { &hf_isi_gps_epc,
1974
14
      { "Climb Accuracy", "isi.gps.epc", FT_FLOAT, BASE_NONE, NULL, 0x0, "EPC (climb accuracy) in km/h", HFILL }},
1975
14
    { &hf_isi_gps_mcc,
1976
14
      { "Mobile Country Code (MCC)", "isi.gps.gsm.mcc", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
1977
14
    { &hf_isi_gps_mnc,
1978
14
      { "Mobile Network Code (MNC)", "isi.gps.gsm.mnc", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
1979
14
    { &hf_isi_gps_lac,
1980
14
      { "Location Area Code (LAC)", "isi.gps.gsm.lac", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
1981
14
    { &hf_isi_gps_cid,
1982
14
      { "Cell ID (CID)", "isi.gps.gsm.cid", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
1983
14
    { &hf_isi_gps_ucid,
1984
14
      { "Cell ID (UCID)", "isi.gps.gsm.ucid", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }}
1985
14
  };
1986
1987
14
  static hf_register_info gss_hf[] = {
1988
14
    { &hf_isi_gss_payload,
1989
14
      { "Payload", "isi.gss.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1990
14
    { &hf_isi_gss_message_id,
1991
14
      { "Message ID", "isi.gss.msg_id", FT_UINT8, BASE_HEX, VALS(isi_gss_message_id), 0x0, NULL, HFILL }},
1992
#if 0
1993
    { &hf_isi_gss_subblock,
1994
      { "Subblock", "isi.gss.subblock", FT_UINT8, BASE_HEX, VALS(isi_gss_subblock), 0x0, NULL, HFILL }},
1995
#endif
1996
14
    { &hf_isi_gss_operation,
1997
14
      { "Operation", "isi.gss.operation", FT_UINT8, BASE_HEX, VALS(isi_gss_operation), 0x0, NULL, HFILL }},
1998
14
    { &hf_isi_gss_subblock_count,
1999
14
      { "Subblock Count", "isi.gss.subblock_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2000
14
    { &hf_isi_gss_cause,
2001
14
      { "Cause", "isi.gss.cause", FT_UINT8, BASE_HEX, VALS(isi_gss_cause), 0x0, NULL, HFILL }},
2002
14
    { &hf_isi_gss_common_message_id,
2003
14
      { "Common Message ID", "isi.gss.common.msg_id", FT_UINT8, BASE_HEX, VALS(isi_gss_common_message_id), 0x0, NULL, HFILL }},
2004
14
  };
2005
2006
14
  static hf_register_info ss_hf[] = {
2007
14
    { &hf_isi_ss_payload,
2008
14
      { "Payload", "isi.ss.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2009
14
    { &hf_isi_ss_message_id,
2010
14
      { "Message ID", "isi.ss.msg_id", FT_UINT8, BASE_HEX, VALS(isi_ss_message_id), 0x0, NULL, HFILL }},
2011
14
    { &hf_isi_ss_ussd_type,
2012
14
      { "USSD Type", "isi.ss.ussd.type", FT_UINT8, BASE_HEX, VALS(isi_ss_ussd_type), 0x0, NULL, HFILL }},
2013
14
    { &hf_isi_ss_subblock_count,
2014
14
      { "Subblock Count", "isi.ss.subblock_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2015
14
    { &hf_isi_ss_subblock,
2016
14
      { "Subblock", "isi.ss.subblock", FT_UINT8, BASE_HEX, VALS(isi_ss_subblock), 0x0, NULL, HFILL }},
2017
14
    { &hf_isi_ss_operation,
2018
14
      { "Operation", "isi.ss.operation", FT_UINT8, BASE_HEX, VALS(isi_ss_operation), 0x0, NULL, HFILL }},
2019
14
    { &hf_isi_ss_service_code,
2020
14
      { "Service Code", "isi.ss.service_code", FT_UINT8, BASE_HEX, VALS(isi_ss_service_code), 0x0, NULL, HFILL }},
2021
14
    { &hf_isi_ss_status_indication,
2022
14
      { "Status Indication", "isi.ss.status_indication", FT_UINT8, BASE_HEX, VALS(isi_ss_status_indication), 0x0, NULL, HFILL }},
2023
14
    { &hf_isi_ss_ussd_length,
2024
14
      { "Length", "isi.ss.ussd.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2025
14
    { &hf_isi_ss_common_message_id,
2026
14
      { "Common Message ID", "isi.ss.common.msg_id", FT_UINT8, BASE_HEX, VALS(isi_ss_common_message_id), 0x0, NULL, HFILL }},
2027
14
  };
2028
2029
14
  static hf_register_info network_hf[] = {
2030
14
    { &hf_isi_network_payload,
2031
14
      { "Payload", "isi.network.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2032
14
    { &hf_isi_network_cmd,
2033
14
      { "Command", "isi.network.cmd", FT_UINT8, BASE_HEX, VALS(isi_network_id), 0x0, NULL, HFILL }},
2034
14
    { &hf_isi_network_data_sub_pkgs,
2035
14
      { "Number of Subpackets", "isi.network.pkgs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2036
14
    { &hf_isi_network_status_sub_type,
2037
14
      { "Subpacket Type", "isi.network.sub.type", FT_UINT8, BASE_HEX, VALS(isi_network_status_sub_id), 0x0, NULL, HFILL }},
2038
14
    { &hf_isi_network_status_sub_len,
2039
14
      { "Subpacket Length", "isi.network.sub.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2040
14
    { &hf_isi_network_status_sub_lac,
2041
14
      { "Location Area Code (LAC)", "isi.network.sub.lac", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
2042
14
    { &hf_isi_network_status_sub_cid,
2043
14
      { "Cell ID (CID)", "isi.network.sub.cid", FT_UINT32, BASE_HEX_DEC, NULL, 0x0, NULL, HFILL }},
2044
14
    { &hf_isi_network_status_sub_msg_len,
2045
14
      { "Message Length", "isi.network.sub.msg_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2046
14
    { &hf_isi_network_status_sub_msg,
2047
14
      { "Message", "isi.network.sub.msg", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2048
14
    { &hf_isi_network_cell_info_sub_type,
2049
14
      { "Subpacket Type", "isi.network.sub.type", FT_UINT8, BASE_HEX, VALS(isi_network_cell_info_sub_id), 0x0, NULL, HFILL }},
2050
14
    { &hf_isi_network_cell_info_sub_len,
2051
14
      { "Subpacket Length", "isi.network.sub.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2052
14
    { &hf_isi_network_cell_info_sub_operator,
2053
14
      { "Operator Code", "isi.network.sub.operator", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2054
14
    { &hf_isi_network_gsm_band_900,
2055
14
      { "900 Mhz Band", "isi.network.sub.gsm_band_900", FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL }},
2056
14
    { &hf_isi_network_gsm_band_1800,
2057
14
      { "1800 Mhz Band", "isi.network.sub.gsm_band_1800", FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL }},
2058
14
    { &hf_isi_network_gsm_band_1900,
2059
14
      { "1900 Mhz Band", "isi.network.sub.gsm_band_1900", FT_BOOLEAN, 32, NULL, 0x00000004, NULL, HFILL }},
2060
14
    { &hf_isi_network_gsm_band_850,
2061
14
      { "850 Mhz Band", "isi.network.sub.gsm_band_850", FT_BOOLEAN, 32, NULL, 0x00000008, NULL, HFILL }}
2062
14
  };
2063
2064
14
  static hf_register_info sms_hf[] = {
2065
14
    { &hf_isi_sms_payload,
2066
14
      { "Payload", "isi.sms.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2067
14
    { &hf_isi_sms_message_id,
2068
14
      { "Message ID", "isi.sms.msg_id", FT_UINT8, BASE_HEX, VALS(isi_sms_message_id), 0x0, NULL, HFILL }},
2069
14
    { &hf_isi_sms_routing_command,
2070
14
      { "SMS Routing Command", "isi.sms.routing.command", FT_UINT8, BASE_HEX, VALS(isi_sms_routing_command), 0x0, NULL, HFILL }},
2071
14
    { &hf_isi_sms_routing_mode,
2072
14
      { "Routing Mode", "isi.sms.routing.mode", FT_UINT8, BASE_HEX, VALS(isi_sms_routing_mode), 0x0, NULL, HFILL }},
2073
14
    { &hf_isi_sms_route,
2074
14
      { "Message Route", "isi.sms.route", FT_UINT8, BASE_HEX, VALS(isi_sms_route), 0x0, NULL, HFILL }},
2075
14
    { &hf_isi_sms_subblock_count,
2076
14
      { "Subblock Count", "isi.sms.subblock_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2077
14
    { &hf_isi_sms_send_status,
2078
14
      { "Sending Status", "isi.sms.sending_status", FT_UINT8, BASE_HEX, VALS(isi_sms_send_status), 0x0, NULL, HFILL }},
2079
#if 0
2080
    { &hf_isi_sms_subblock,
2081
      { "Subblock", "isi.sms.subblock", FT_UINT8, BASE_HEX, VALS(isi_sms_subblock), 0x0, NULL, HFILL }},
2082
#endif
2083
14
    { &hf_isi_sms_common_message_id,
2084
14
      { "Common Message ID", "isi.sms.common.msg_id", FT_UINT8, BASE_HEX, VALS(isi_sms_common_message_id), 0x0, NULL, HFILL }},
2085
14
  };
2086
2087
14
  static int *ett[] = {
2088
14
    &ett_isi,
2089
14
    &ett_isi_msg,
2090
14
    &ett_isi_network_gsm_band_info
2091
14
  };
2092
2093
14
  static ei_register_info ei[] = {
2094
14
    { &ei_isi_len, { "isi.len.invalid", PI_PROTOCOL, PI_WARN, "Broken Length", EXPFILL }},
2095
14
    { &ei_isi_unsupported_packet, { "isi.unsupported_packet", PI_UNDECODED, PI_WARN, "Unsupported packet", EXPFILL }},
2096
14
  };
2097
2098
14
  expert_module_t* expert_isi;
2099
2100
14
  proto_isi = proto_register_protocol("Intelligent Service Interface", "ISI", "isi");
2101
2102
14
  proto_register_field_array(proto_isi, hf, array_length(hf));
2103
14
  proto_register_field_array(proto_isi, simauth_hf, array_length(simauth_hf));
2104
14
  proto_register_field_array(proto_isi, sim_hf, array_length(sim_hf));
2105
14
  proto_register_field_array(proto_isi, gss_hf, array_length(gss_hf));
2106
14
  proto_register_field_array(proto_isi, gps_hf, array_length(gps_hf));
2107
14
  proto_register_field_array(proto_isi, ss_hf, array_length(ss_hf));
2108
14
  proto_register_field_array(proto_isi, network_hf, array_length(network_hf));
2109
14
  proto_register_field_array(proto_isi, sms_hf, array_length(sms_hf));
2110
2111
14
  proto_register_subtree_array(ett, array_length(ett));
2112
14
  expert_isi = expert_register_protocol(proto_isi);
2113
14
  expert_register_field_array(expert_isi, ei, array_length(ei));
2114
2115
  /* create new dissector table for isi resource */
2116
14
  isi_resource_dissector_table = register_dissector_table("isi.resource", "ISI resource", proto_isi, FT_UINT8, BASE_HEX);
2117
14
}
2118
2119
/* Handler registration */
2120
void
2121
proto_reg_handoff_isi(void)
2122
14
{
2123
14
  static bool initialized=false;
2124
2125
14
  if(!initialized) {
2126
14
    dissector_add_uint("sll.ltype", LINUX_SLL_P_ISI, create_dissector_handle(dissect_isi, proto_isi));
2127
2128
14
    heur_dissector_add("usb.bulk", dissect_usb_isi, "ISI bulk endpoint", "usb_bulk_isi", proto_isi, HEURISTIC_DISABLE);
2129
2130
14
    dissector_add_uint("isi.resource", 0x02, create_dissector_handle(dissect_isi_sms, proto_isi));
2131
14
    dissector_add_uint("isi.resource", 0x06, create_dissector_handle(dissect_isi_ss, proto_isi));
2132
14
    dissector_add_uint("isi.resource", 0x08, create_dissector_handle(dissect_isi_sim_auth, proto_isi));
2133
14
    dissector_add_uint("isi.resource", 0x09, create_dissector_handle(dissect_isi_sim, proto_isi));
2134
14
    dissector_add_uint("isi.resource", 0x0a, create_dissector_handle(dissect_isi_network, proto_isi));
2135
14
    dissector_add_uint("isi.resource", 0x32, create_dissector_handle(dissect_isi_gss, proto_isi));
2136
14
    dissector_add_uint("isi.resource", 0x54, create_dissector_handle(dissect_isi_gps, proto_isi));
2137
14
  }
2138
14
}
2139
2140
/*
2141
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
2142
 *
2143
 * Local variables:
2144
 * c-basic-offset: 8
2145
 * tab-width: 8
2146
 * indent-tabs-mode: t
2147
 * End:
2148
 *
2149
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
2150
 * :indentSize=8:tabSize=8:noTabs=false:
2151
 */