tizen 2.3.1 release
[framework/telephony/libtcore.git] / include / type / sim.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef __TYPE_SIM_H__
22 #define __TYPE_SIM_H__
23
24 __BEGIN_DECLS
25
26 #include <glib.h>
27
28 #define SIM_ICCID_LEN_MAX 20 // 3gpp
29 #define SIM_LANG_CNT_MAX 30 //telephony defined
30 #define SIM_SST_LEN_MAX 20 //telephony defined
31 #define SIM_SST_SERVICE_CNT_MAX 56 //3gpp
32 #define SIM_UST_BYTE_LEN_MAX 8 //telephony defined
33 #define SIM_UST_SERVICE_CNT_MAX 64
34 #define SIM_CDMA_ST_SERVICE_LEN_MAX 12
35 #define SIM_CDMA_ST_SERVICE_CNT_MAX 47
36 #define SIM_CSIM_ST_SERVICE_LEN_MAX 6
37 #define SIM_CSIM_ST_SERVICE_CNT_MAX 41
38 #define SIM_SPN_LEN_MAX 16 //3gpp
39 #define SIM_CDMA_SPN_LEN_MAX 32 //3gpp2
40 #define SIM_SPDI_PLMN_MAX 41 //telephony defined
41 #define SIM_XDN_ALPHA_ID_LEN_MAX 30 //telephony defined
42 #define SIM_XDN_NUMBER_LEN_MAX 20 //telephony defined
43 #define SIM_MSISDN_NUMBER_LEN_MAX 26 //telephony defined
44 #define SIM_ECC_BYTE_LEN_MAX 3 //3gpp
45 #define SIM_ECC_STRING_LEN_MAX 50 //telephony defined
46 #define SIM_ECC_RECORD_CNT_MAX 15 //telephony defined
47 #define SIM_EXT_RECORD_CNT_MAX 15 //telephony defined
48 #define SIM_CF_RECORD_CNT_MAX 2 //telephony defined
49 #define SIM_MSISDN_RECORD_CNT_MAX 10 //telephony defined
50 #define SIM_GROUP_IDENTIFIER_LEN_MAX 10 //telephony defined
51 #define SIM_MAIL_BOX_IDENTIFIER_LEN_MAX 5 //3gpp
52 #define SIM_MSP_CNT_MAX 2 //telephony defined
53 #define SIM_NW_FULL_NAME_LEN_MAX 40 //telephony defined TODO should be defined one value in all.
54 #define SIM_OPLMNWACT_LEN_MAX 100 //telephony defined
55 #define SIM_AUTH_REQ_DATA_LEN_MAX 256 //telephony defined
56 #define SIM_AUTH_RESP_DATA_LEN_MAX 128 //telephony defined
57 #define SIM_APDU_DATA_LEN_MAX 2048 //telephony defined. (2048 is for QMI definition. (1024 : general length, 1024 : extra length for additional response)).
58 #define SIM_CPHS_CALL_FORWARDING_LEN_MIN 2 //telephony defined
59 #define SIM_CPHS_CSP_ENTRY_CNT_MAX 11 //telephony defined
60 #define SIM_CPHS_CSP_LEN_MAX 22 //telephony defined
61 #define SIM_CPHS_VMWF_LEN_MAX 2 //telephony defined
62 #define SIM_CPHS_OPERATOR_NAME_LEN_MAX 25 //telephony defined
63 #define SIM_CPHS_OPERATOR_NAME_SHORT_FORM_LEN_MAX 10 //CPHS spec
64 #define SIM_CPHS_INFO_LEN_MAX 3 //telephony defined
65 #define SIM_GID_LEN_MAX 16 //telephony defined
66 #define SIM_FILE_ID_LIST_MAX_COUNT 255 //followed SAT_FILE_ID_LIST_MAX_COUNT in sat.h
67
68 enum tel_sim_file_id {
69         SIM_EF_DIR = 0x2F00, /**< Root Directory for the USIM */
70         SIM_EF_ICCID = 0x2FE2, /**< the ICC Identification file */
71         SIM_EF_IMSI = 0x6F07, /**< the IMSI file */
72         SIM_EF_SST = 0x6F38, /**< the SIM Service Table file. EF UST has same address */
73         SIM_EF_EST = 0x6F56, /**< the Enabled Service Table file   */
74         SIM_EF_OPLMN_ACT = 0x6F61, /**< the OPLMN List file*/
75         SIM_EF_GID1 = 0x6F3E, /**< the Group Identifier Level 1 */
76         SIM_EF_GID2 = 0x6F3F, /**< the Group Identifier Level 2 */
77
78         SIM_EF_ELP = 0x2F05, /**< the Extended Language Preference file */
79         SIM_EF_LP = 0x6F05, /**< SIM: Language preference */
80         SIM_EF_ECC = 0x6FB7, /**< the Emergency Call Codes     */
81         SIM_EF_SPN = 0x6F46, /**< the Service Provider Name    */
82         SIM_EF_SPDI = 0x6FCD, /**< the Service provider display information*/
83         SIM_EF_PNN = 0x6FC5, /**< the PLMN Network Name File*/
84         SIM_EF_OPL = 0x6FC6, /**< the Operator PLMN List File*/
85         SIM_EF_MBDN = 0x6FC7, /** < SIM Mail Box Dialing Number file */
86         SIM_EF_MSISDN = 0x6F40, /**< MSISDN */
87         SIM_EF_EXT1 = 0x6F4A, /**< Extension File-1 */
88         SIM_EF_EXT5 = 0x6F4E, /**< Extension File-5 */
89         SIM_EF_EXT6 = 0x6FC8, /**< Extension File-6 */
90         SIM_EF_IMG = 0x4F20, /**Image file*/
91
92         SIM_EF_USIM_LI = 0x6A05, /**< USIM: Language Indication */
93         SIM_EF_USIM_PL = 0x2A05, /**< the Language Preference file of USIM */
94         SIM_EF_USIM_MBI = 0x6FC9, /** < Mailbox Identifier -linear fixed*/
95         SIM_EF_USIM_MWIS = 0x6FCA, /** < Message Waiting Indication Status -linear fixed*/
96         SIM_EF_USIM_CFIS = 0x6FCB, /** < Call forward indication status -linear fixed*/
97
98         /* CPHS FILE ID */
99         SIM_EF_CPHS_VOICE_MSG_WAITING = 0x6F11, /** < CPHS voice MSG waiting indication  */
100         SIM_EF_CPHS_SERVICE_STRING_TABLE = 0x6F12, /** < CPHS service string table  */
101         SIM_EF_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /** < CPHS call forward flags  */
102         SIM_EF_CPHS_OPERATOR_NAME_STRING = 0x6F14, /** < CPHS operator name string  */
103         SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /** < CPHS customer service profile  */
104         SIM_EF_CPHS_CPHS_INFO = 0x6F16, /** < CPHS information  */
105         SIM_EF_CPHS_MAILBOX_NUMBERS = 0x6F17, /** < CPHS mail box numbers  */
106         SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /** < CPHS operator name short form string  */
107         SIM_EF_CPHS_INFORMATION_NUMBERS = 0x6F19, /** < CPHS information numbers  */
108         /*  CPHS ALS FILE ID */
109         SIM_EF_CPHS_DYNAMICFLAGS = 0x6F9F, /** < CPHS Dynamics flags  */
110         SIM_EF_CPHS_DYNAMIC2FLAG = 0x6F92, /** < CPHS Dynamics2 flags  */
111         SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /** < CPHS CSP2  */
112         SIM_EF_PBR = 0x4F30,
113
114         /* CDMA FILE ID*/
115         SIM_EF_CDMA_IMSI = 0x6F22,                              /** < CDMA IMSI_M  */
116         SIM_EF_CST = 0x6F32,                                    /** < CDMA Service table */
117         SIM_EF_CDMA_SPN = 0x6F41,                               /** < CDMA Service Provider Name  */
118         SIM_EF_MDN = 0x6F44,                                    /** < CDMA Mobile Directory Number  */
119         SIM_EF_CDMA_ECC = 0x6F47,                               /** < CDMA Emergency Call Codes  */
120         SIM_EF_CDMA_PL = 0x6F3A,                                /** < CDMA Preferred Languages  */
121
122         /* Invalid File ID, All the file ID are less than this Value*/
123         SIM_EF_INVALID = 0xFFFF, /**< Invalid file.*/
124         SIM_EF_OTHERS, /**< Element to indicate an unknown file.*/
125 };
126
127 enum tel_sim_type {
128         SIM_TYPE_UNKNOWN,       /**< Unknown card */
129         SIM_TYPE_GSM,           /**< 2G GSM card*/
130         SIM_TYPE_USIM,          /**< 3G USIM card */
131         SIM_TYPE_RUIM,          /** CDMA based card*/
132         SIM_TYPE_NVSIM,         /**< CDMA NV SIM */
133         SIM_TYPE_ISIM           /** IMS based card */
134 };
135
136 enum tel_sim_status {
137         SIM_STATUS_CARD_ERROR = 0x00, /**< Bad card / On the fly SIM gone bad **/
138         SIM_STATUS_CARD_NOT_PRESENT = 0x01, /**<  Card not present **/
139         SIM_STATUS_INITIALIZING = 0x02, /**<  SIM is Initializing state **/
140         SIM_STATUS_INIT_COMPLETED = 0x03, /**<  SIM Initialization OK **/
141         SIM_STATUS_PIN_REQUIRED = 0x04, /**<  PIN  required state **/
142         SIM_STATUS_PUK_REQUIRED = 0x05, /**<  PUK required state **/
143         SIM_STATUS_CARD_BLOCKED = 0x06, /**<  PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed) **/
144         SIM_STATUS_NCK_REQUIRED = 0x07, /**<  Network Control Key required state **/
145         SIM_STATUS_NSCK_REQUIRED = 0x08, /**<  Network Subset Control Key required state **/
146         SIM_STATUS_SPCK_REQUIRED = 0x09, /**<  Service Provider Control Key required state **/
147         SIM_STATUS_CCK_REQUIRED = 0x0a, /**<  Corporate Control Key required state **/
148         SIM_STATUS_CARD_REMOVED = 0x0b, /**<  Card removed **/
149         SIM_STATUS_LOCK_REQUIRED = 0x0c, /**<  PH-SIM (phone-SIM) locked state **/
150         SIM_STATUS_CARD_CRASHED = 0x0d, /**< Runtime SIM card error **/
151         SIM_STATUS_CARD_POWEROFF = 0x0e, /**< SIM Powered OFF **/
152         SIM_STATUS_UNKNOWN = 0xff /**<  unknown state. not checked yet. **/
153 };
154
155 enum tel_sim_facility_status {
156         SIM_FACILITY_STATUS_DISABLED = 0x00, /**< PIN1 or PIN2 Disabled */
157         SIM_FACILITY_STATUS_ENABLED = 0x01, /**< PIN1 or PIN2 Enabled */
158         SIM_FACILITY_STATUS_BLOCKED = 0x02, /**< SIM is present, but PIN1 or PIN2  is blocked. need unblocking by PUK or PUK2 */
159         SIM_FACILITY_STATUS_PUK_BLOCKED = 0x03, /**< SIM is present, but PUK is blocked. */
160         SIM_FACILITY_STATUS_UNKNOWN = 0xFF /**< SIM is in unknown state */
161 };
162
163 enum tel_sim_access_result {
164         SIM_ACCESS_SUCCESS, /**< Access to file successful.  */
165         SIM_ACCESS_CARD_ERROR, /**< SIM card error    */
166         SIM_ACCESS_FILE_NOT_FOUND, /**< File not found  */
167         SIM_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition is not fulfilled  */
168         SIM_ACCESS_FAILED, /**< Access failed.  */
169 };
170
171 enum tel_sim_pin_operation_result {
172         SIM_PIN_OPERATION_SUCCESS, /**< Operation involving PIN (verification/change/enable/disable, etc) is successful.  */
173         SIM_BUSY, /**< SIM is busy  */
174         SIM_CARD_ERROR, /**< SIM card error - General errors   */
175         SIM_INCOMPATIBLE_PIN_OPERATION, /**< SIM Incompatible pin operation that is in case when invalid SIM command is given or incorrect parameters are supplied to the SIM. */
176         SIM_INCORRECT_PASSWORD, /**< SIM PIN  Incorrect password */
177         SIM_PIN_REQUIRED, /**< PIN Required */
178         SIM_PUK_REQUIRED, /**< PUK Required */
179         SIM_NCK_REQUIRED, /**< Network Control Key Required */
180         SIM_NSCK_REQUIRED, /**< Network Subset Control Key Required */
181         SIM_SPCK_REQUIRED, /**< Service Provider Control Key Required */
182         SIM_CCK_REQUIRED, /**< Corporate Control Key Required */
183         SIM_LOCK_REQUIRED, /**<  PH-SIM (phone-SIM) locked state **/
184         SIM_ADM_REQUIRED, /**<  Admin key locked state **/
185         SIM_PERM_BLOCKED /**< Permanently Blocked **/
186 };
187
188 enum tel_sim_language_type {
189         SIM_LANG_GERMAN = 0x00, /**< German */
190         SIM_LANG_ENGLISH = 0x01, /**< English */
191         SIM_LANG_ITALIAN = 0x02, /**< Italian */
192         SIM_LANG_FRENCH = 0x03, /**< French */
193         SIM_LANG_SPANISH = 0x04, /**< Spanish */
194         SIM_LANG_DUTCH = 0x05, /**< Dutch */
195         SIM_LANG_SWEDISH = 0x06, /**< Swedish */
196         SIM_LANG_DANISH = 0x07, /**< Danish */
197         SIM_LANG_PORTUGUESE = 0x08, /**< Portuguese */
198         SIM_LANG_FINNISH = 0x09, /**< Finnish */
199         SIM_LANG_NORWEGIAN = 0x0A, /**< Norwegian */
200         SIM_LANG_GREEK = 0x0B, /**< Greek */
201         SIM_LANG_TURKISH = 0x0C, /**< Turkish */
202         SIM_LANG_HUNGARIAN = 0x0D, /**< Hungarian */
203         SIM_LANG_POLISH = 0x0E, /**< Polish */
204         SIM_LANG_KOREAN = 0x0F, /**< Korean */
205         SIM_LANG_CHINESE = 0x10, /**< Chinese */
206         SIM_LANG_RUSSIAN = 0x11, /**< Russian */
207         SIM_LANG_JAPANESE = 0x12, /**< Japanese */
208         SIM_LANG_UNSPECIFIED = 0xFF /**< Unspecified */
209 };
210
211 enum tel_sim_msgwaiting_idication_mask {
212         SIM_MWIS_NONE = 0x00, /**< MWIS none*/
213         SIM_MWIS_VOICE = 0x01, /**< MWIS voice*/
214         SIM_MWIS_FAX = 0x02, /**< MWIS FAX*/
215         SIM_MWIS_EMAIL = 0x04, /**< MWIS email*/
216         SIM_MWIS_OTHER = 0x08, /**< MWIS other*/
217         SIM_MWIS_VIDEO = 0x10, /**< MWIS video*/
218         SIM_MWIS_RFU = 0xff /**< MWIS RFU*/
219 };
220
221 enum tel_sim_pin_type {
222         SIM_PTYPE_PIN1 = 0x00, /**< PIN 1 code */
223         SIM_PTYPE_PIN2 = 0x01, /**< PIN 2 code */
224         SIM_PTYPE_PUK1 = 0x02, /**< PUK 1 code */
225         SIM_PTYPE_PUK2 = 0x03, /**< PUK 2 code */
226         SIM_PTYPE_UPIN = 0x04, /**< Universal PIN - Unused now */
227         SIM_PTYPE_ADM = 0x05, /**< Administrator - Unused now */
228         SIM_PTYPE_SIM = 0x06 /**< SIM Lock code */
229 };
230
231 enum tel_sim_facility_type {
232         SIM_FACILITY_PS, /**< PH-SIM, Lock PHone to SIM/UICC card*/
233         SIM_FACILITY_SC, /**< Lock SIM/UICC card, simply PIN1 */
234         SIM_FACILITY_FD, /**< Fixed Dialing Number feature, need PIN2 */
235         SIM_FACILITY_PN, /**< Network Personalization */
236         SIM_FACILITY_PU, /**< network sUbset Personalization */
237         SIM_FACILITY_PP, /**< service Provider Personalization */
238         SIM_FACILITY_PC, /**< Corporate Personalization */
239 };
240
241 enum tel_sim_lock_status {
242         SIM_LOCK_STATUS_UNLOCKED,               /* 0x00 : Not necessary */
243         SIM_LOCK_STATUS_PIN,                    /* 0x01 : PIN required as a password */
244         SIM_LOCK_STATUS_PUK,                    /* 0x02 : PUK required as a password */
245         SIM_LOCK_STATUS_PIN2,                   /* 0x03 : PIN2 required as a password */
246         SIM_LOCK_STATUS_PUK2,                   /* 0x04 : PUK2 required as a password */
247         SIM_LOCK_STATUS_PERM_BLOCKED,   /* 0x05 : PIN Permanent Blocked */
248 };
249
250 enum tel_sim_cphs_dynamic_flag_selected_line {
251         SIM_DYNAMIC_FLAGS_LINE1 = 0x01, /**< line 1 */
252         SIM_DYNAMIC_FLAGS_LINE2 = 0x00, /**< line 2*/
253         SIM_DYNAMIC_FLAGS_RFU = 0xff /**< rfu*/
254 };
255
256 enum tel_sim_cphs_dynamic2_flag_als_status {
257         SIM_PIN2_ACCESSIBLE_FLAGS_LOCKED = 0x01, /**< Dynamic flags locked */
258         SIM_PIN2_ACCESSIBLE_FLAGS_UNLOCKED = 0x00, /**< Dynamic flags unlocked */
259         SIM_PIN2_ACCESSIBLE_FLAGS_RFU = 0xff /**< rfu */
260 };
261
262 enum tel_sim_cphs_phase {
263         SIM_CPHS_PHASE1 = 0x01, /**< phase1  */
264         SIM_CPHS_PHASE2 = 0x02, /**< phase2  */
265         SIM_CPHS_PHASE_RFU = 0xff /**< RFU  */
266 };
267
268 enum tel_sim_ton {
269         SIM_TON_UNKNOWN = 0, /**< unknown */
270         SIM_TON_INTERNATIONAL = 1, /**< international number */
271         SIM_TON_NATIONAL = 2, /**< national number */
272         SIM_TON_NETWORK_SPECIFIC = 3, /**< network specific number */
273         SIM_TON_DEDICATED_ACCESS = 4, /**< subscriber number */
274         SIM_TON_ALPHA_NUMERIC = 5, /**< alphanumeric, GSM 7-bit default alphabet) */
275         SIM_TON_ABBREVIATED_NUMBER = 6, /**< abbreviated number */
276         SIM_TON_RESERVED_FOR_EXT = 7 /**< reserved for extension */
277 };
278
279 enum tel_sim_npi {
280         SIM_NPI_UNKNOWN = 0, /**< Unknown */
281         SIM_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */
282         SIM_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */
283         SIM_NPI_TELEX = 4, /**< Telex numbering plan */
284         SIM_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */
285         SIM_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */
286         SIM_NPI_NATIONAL = 8, /**< National numbering plan */
287         SIM_NPI_PRIVATE = 9, /**< Private numbering plan */
288         SIM_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */
289         SIM_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */
290 };
291
292 enum tel_sim_emergency_service_type {
293         SIM_ECC_POLICE = 0x01, /**< Police */
294         SIM_ECC_AMBULANCE = 0x02, /**< Ambulance */
295         SIM_ECC_FIREBRIGADE = 0x04, /**< Fire brigade */
296         SIM_ECC_MARAINEGUARD = 0x08, /**< Marine guard */
297         SIM_ECC_MOUTAINRESCUE = 0x10, /**< Mountain rescue */
298         SIM_ECC_SPARE = 0x00 /**< Spare */
299 };
300
301 enum tel_sim_mailbox_type {
302         SIM_MAILBOX_VOICE = 0x01, /**< Voicemail*/
303         SIM_MAILBOX_FAX = 0x02, /**< Fax*/
304         SIM_MAILBOX_EMAIL = 0x03, /**< Email*/
305         SIM_MAILBOX_OTHER = 0x04, /**< Other*/
306         SIM_MAILBOX_VIDEO = 0x05, /**< Videomail*/
307         SIM_MAILBOX_DATA = 0x06, /**< Data*/
308 };
309
310 enum tel_sim_cphs_csp_group {
311         SIM_CPHS_CSP_GROUP_CALL_OFFERING = 0x01, /**< Group CSP offering*/
312         SIM_CPHS_CSP_GROUP_CALL_RESTRICTION = 0x02, /**< Group CSP restriction*/
313         SIM_CPHS_CSP_GROUP_OTHER_SUPP_SERVICES = 0x03, /**< Group CSP supplementary services*/
314         SIM_CPHS_CSP_GROUP_CALL_COMPLETION = 0x04, /**< Group CSP completion*/
315         SIM_CPHS_CSP_GROUP_TELESERVICES = 0x05, /**< Group CSP teleservices*/
316         SIM_CPHS_CSP_GROUP_CPHS_TELESERVICES = 0x06, /**< Group CSP CPHS teleservies*/
317         SIM_CPHS_CSP_GROUP_CPHS_FEATURES = 0x07, /**< Group CSP CPHS features*/
318         SIM_CPHS_CSP_GROUP_NUMBER_IDENTIFIERS = 0x08, /**< Group CSP number identifiers*/
319         SIM_CPHS_CSP_GROUP_PHASE_SERVICES = 0x09, /**< Group CSP phase services*/
320         SIM_CPHS_CSP_GROUP_VALUE_ADDED_SERVICES = 0xC0, /**< Group CSP value added services*/
321         SIM_CPHS_CSP_GROUP_INFORMATION_NUMBERS = 0xD5 /**< Group CSP information numbers*/
322 };
323
324 enum tel_sim_cphs_index_level {
325         SIM_CPHS_INDEX_LEVEL_ONE = 0x01, /**< SIM CPHS index level one */
326         SIM_CPHS_INDEX_LEVEL_TWO = 0x02, /**< SIM CPHS index level two */
327         SIM_CPHS_INDEX_LEVEL_THREE = 0x03, /**< SIM CPHS index level three */
328         SIM_CPHS_INDEX_LEVEL_RFU = 0xff /**< SIM CPHS index level RFU */
329 };
330
331 enum tel_sim_auth_type {
332         SIM_AUTH_TYPE_IMS = 0x00,       /**< IMS Authentication */
333         SIM_AUTH_TYPE_GSM,              /**< GSM Authentication */
334         SIM_AUTH_TYPE_3G,               /**< 3G Authentication */
335         SIM_AUTH_RUIM_CAVE,             /**< CDMA CAVE Authentication */
336         SIM_AUTH_RUIM_CHAP,             /**< CDMA CHAP Authentication */
337         SIM_AUTH_RUIM_MNHA,             /**< CDMA MNHA Authentication */
338         SIM_AUTH_RUIM_MIPRRQ,           /**< CDMA MIPRRQ Authentication */
339         SIM_AUTH_RUIM_MNAAA,            /**< CDMA MNAAA Authentication */
340         SIM_AUTH_RUIM_HRPD,             /**< CDMA HRPD Authentication */
341         SIM_AUTH_TYPE_MAX               /**< TBD */
342 };
343
344 enum tel_sim_auth_result {
345         SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */
346         SIM_AUTH_CANNOT_PERFORM, /**< status - can't perform authentication */
347         SIM_AUTH_SKIP_RESPONSE, /**< status - skip authentication response */
348         SIM_AUTH_MAK_CODE_FAILURE, /**< status - MAK(Multiple Activation Key) code failure */
349         SIM_AUTH_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */
350         SIM_AUTH_SYNCH_FAILURE, /**< status - synch failure */
351         SIM_AUTH_UNSUPPORTED_CONTEXT, /**< status - unsupported context */
352         SIM_AUTH_MAX /**< TBD */
353 };
354
355 enum tel_sim_power_set_result {
356         SIM_POWER_SET_SUCCESS = 0x00, /**< Change Power State Success */
357         SIM_POWER_SET_FAILURE         /**< Change Power State Failure*/
358 };
359
360
361 enum tel_sim_sst_service {
362         // service 1 ~ 8
363         SIM_SST_CHV1_DISABLE_FUNC = 0,  /**< CHV1 disable function */
364         SIM_SST_ADN,                                    /**< abbreviated Dialing number */
365         SIM_SST_FDN,                                    /**< fixed Dialing number */
366         SIM_SST_SMS,                                    /**< short message storage */
367         SIM_SST_AOC,                                    /**< advice of charge */
368         SIM_SST_CCP,                                    /**< capability configuration parameters */
369         SIM_SST_PLMN_SELECTOR,                  /**< plmn selector */
370         SIM_SST_RFU1,                                   /**< rfu */
371
372         // service 9 ~ 16
373         SIM_SST_MSISDN = 8,                             /**< msisdn */
374         SIM_SST_EXT1,                                   /**< extension1 */
375         SIM_SST_EXT2,                                   /**< extension2 */
376         SIM_SST_SMS_PARAMS,                             /**< sms parameteres */
377         SIM_SST_LND,                                    /**< last number dialed */
378         SIM_SST_CELL_BROADCAST_MSG_ID,  /**< cell broadcast message identifier */
379         SIM_SST_GID_LV1,                                /**< group identifier level 1 */
380         SIM_SST_GID_LV2,                                /**< group identifier level 2 */
381
382         // service 17 ~ 24
383         SIM_SST_SPN = 16,                               /**< service provider name */
384         SIM_SST_SDN,                                    /**< service Dialing number */
385         SIM_SST_EXT3,                                   /**< extension3 */
386         SIM_SST_RFU2,                                   /**< rfu */
387         SIM_SST_VGCS_GID_LIST,                  /**< vgcs group identifier (EF-VGCS, EF-VGCSS) */
388         SIM_SST_VBS_GID_LIST,                   /**< vbs group identifier (EF-VBS, EF-VBSS) */
389         SIM_SST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC,   /**< enhanced multi-level precedence and pre-emption service */
390         SIM_SST_AUTO_ANSWER_FOR_EMLPP,  /**< automatic answer fro eMLPP */
391
392         // service 25 ~ 32,
393         SIM_SST_DATA_DOWNLOAD_VIA_SMS_CB = 24,  /**< data download via sms-cb */
394         SIM_SST_DATA_DOWNLOAD_VIA_SMS_PP,               /**< data download via sms-pp */
395         SIM_SST_MENU_SELECTION,                                 /**< menu selection */
396         SIM_SST_CALL_CTRL,                                              /**< call control */
397         SIM_SST_PROACTIVE_SIM,                                  /**< proactive sim command */
398         SIM_SST_CELL_BROADCAST_MSG_ID_RANGES,   /**< cell broadcast message identifier ranges */
399         SIM_SST_BDN,                                                    /**< barred Dialing numbers */
400         SIM_SST_EXT4,                                                   /**< extension 4 */
401
402         // service 33 ~ 40
403         SIM_SST_DEPERSONALIZATION_CTRL_KEYS = 32,       /**< de-personalization control keys */
404         SIM_SST_COOPERATIVE_NETWORK_LIST,                       /**< co-operative network list */
405         SIM_SST_SMS_STATUS_REPORTS,                                     /**< short message status reports */
406         SIM_SST_NIA,                                    /**< network's indication of alerting in the MS (NIA) */
407         SIM_SST_MO_SMS_CTRL_BY_SIM,             /**< mobile-originated short message control by sim */
408         SIM_SST_GPRS,                                   /**< gprs */
409         SIM_SST_IMG,                                    /**< image */
410         SIM_SST_SOLSA,                                  /**< support of local service area */
411
412         // service 41 ~ 48
413         SIM_SST_USSD_STR_DATA_OBJECT_SUPPORTED_IN_CALL_CTRL = 40,       /**< ussd string data object supported in call control */
414         SIM_SST_RUN_AT_CMD_CMD,                                                 /**< RUN AT COMMAND command */
415         SIM_SST_USER_CTRLED_PLMN_SELECTOR_WACT,                 /**< user controlled PLMN selector with Access technology */
416         SIM_SST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT,             /**< operator controlled PLMN selector with Access technology */
417         SIM_SST_HPLMN_SELECTOR_WACT,                    /**< HPLMN selector with access technology */
418         SIM_SST_CPBCCH_INFO,                                    /**< CPBCCH information */
419         SIM_SST_INVESTIGATION_SCAN,                             /**< investigation scan */
420         SIM_SST_EXTENDED_CAPA_CONF_PARAMS,              /**< extended capability configuration parameters */
421
422         //      service 49 ~ 56
423         SIM_SST_MEXE = 48,                              /**< MExE */
424         SIM_SST_RPLMN_LAST_USED_ACCESS_TECH,    /**< RPLMN last used access technology */
425         SIM_SST_PLMN_NETWORK_NAME,              /*PLMN Network Name*/
426         SIM_SST_OPERATOR_PLMN_LIST,             /*Operator PLMN List*/
427         SIM_SST_MBDN,                                   /*Mailbox Dialling Numbers*/
428         SIM_SST_MWIS,                                   /*Message Waiting Indication Status*/
429         SIM_SST_CFIS,                                   /*Call Forwarding Indication Status*/
430         SIM_SST_SPDI,                                   /*Service Provider Display Information*/
431 };
432
433 enum tel_sim_ust_service {
434         // service 1 ~ 8
435         SIM_UST_LOCAL_PB = 0,           /**< local phone book */
436         SIM_UST_FDN,                            /**< fixed Dialing number */
437         SIM_UST_EXT2,                           /**< extension2 */
438         SIM_UST_SDN,                            /**< service Dialing number */
439         SIM_UST_EXT3,                           /**< extension3 */
440         SIM_UST_BDN,                            /**< barred Dialing numbers */
441         SIM_UST_EXT4,                           /**< extension 4 */
442         SIM_UST_OUTGOING_CALL_INFO,     /**< outgoing call information */
443
444         // service 9 ~ 16
445         SIM_UST_INCOMING_CALL_INFO = 8,         /**< incoming call information */
446         SIM_UST_SMS,                                            /**< short message storage */
447         SIM_UST_SMS_STATUS_REPORTS,                     /**< short message status reports */
448         SIM_UST_SMS_PARAMS,                                     /**< sms parameteres */
449         SIM_UST_AOC,                                            /**< advice of charge */
450         SIM_UST_CCP,                                            /**< capability configuration parameters */
451         SIM_UST_CELL_BROADCAST_MSG_ID,          /**< cell broadcast message identifier */
452         SIM_UST_CELL_BROADCAST_MSG_ID_RANGES,   /**< cell broadcast message identifier ranges */
453
454         // service 17 ~ 24
455         SIM_UST_GID_LV1 = 16,                                           /**< group identifier level 1 */
456         SIM_UST_GID_LV2,                                                        /**< group identifier level 2 */
457         SIM_UST_SPN,                                                            /**< service provider name */
458         SIM_UST_USER_CTRLED_PLMN_SELECTOR_WACT,         /**< user controlled PLMN selector with Access technology */
459         SIM_UST_MSISDN,                                                                                 /**< msisdn */
460         SIM_UST_IMG,                                                                                    /**< image */
461         SIM_UST_SOLSA,                                                                                  /**< support of local service area */
462         SIM_UST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC,   /**< enhanced multi-level precedence and pre-emption service */
463
464         // service 25 ~ 32
465         SIM_UST_AUTO_ANSWER_FOR_EMLPP = 24,     /**< automatic answer fro eMLPP */
466         SIM_UST_RFU1,                                           /**< rfu */
467         SIM_UST_GSM_ACCESS,                                     /**< gsm access */
468         SIM_UST_DATA_DOWNLOAD_VIA_SMS_PP,       /**< data download via sms-pp */
469         SIM_UST_DATA_DOWNLOAD_VIA_SMS_CB,       /**< data download via sms-cb */
470         SIM_UST_CALL_CTRL,                                      /**< call control by usim*/
471         SIM_UST_MO_SMS_CTRL,                            /**< mobile-originated short message control by usim */
472         SIM_UST_RUN_AT_CMD_CMD,                         /**< RUN AT COMMAND command */
473
474         // service 33 ~ 40
475         SIM_UST_SHALL_BE_SET_TO_ONE = 32,       /**< shall be set to 1 */
476         SIM_UST_ENABLED_SRVC_TABLE,                     /**< enabled service table */
477         SIM_UST_ACL,                                            /**< APN control list */
478         SIM_UST_DEPERSONALIZATION_CTRL_KEYS,    /**< de-personalization control keys */
479         SIM_UST_COOPERATIVE_NETWORK_LIST,               /**< co-operative network list */
480         SIM_UST_GSM_SEC_CONTEXT,                                /**< gsm security context */
481         SIM_UST_CPBCCH_INFO,                                    /**< CPBCCH information */
482         SIM_UST_INVESTIGATION_SCAN,                             /**< investigation scan */
483
484         // service 41 ~ 48
485         SIM_UST_MEXE = 40,                                                              /**< MExE */
486         SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT,             /**< operator controlled PLMN selector with Access technology */
487         SIM_UST_HPLMN_SELECTOR_WACT,    /**< HPLMN selector with access technology */
488         SIM_UST_EXT5,                                   /**< extension 5 */
489         SIM_UST_PLMN_NETWORK_NAME,              /*PLMN Network Name*/
490         SIM_UST_OPERATOR_PLMN_LIST,             /*Operator PLMN List*/
491         SIM_UST_MBDN,                                   /*Mailbox Dialling Numbers*/
492         SIM_UST_MWIS,                                   /*Message Waiting Indication Status*/
493
494         // service 49 ~ 56
495         SIM_UST_CFIS = 48,                                              /*Call Forwarding Indication Status*/
496         SIM_UST_RPLMN_LAST_USED_ACCESS_TECH,    /**< RPLMN last used access technology */
497         SIM_UST_SPDI,                                                   /*Service Provider Display Information*/
498         SIM_UST_MMS,                                                    /**< multi media messaging service */
499         SIM_UST_EXT8,                                                   /**< extension 8 */
500         SIM_UST_CALL_CTRL_ON_GPRS,                              /**< call control on gprs by usim */
501         SIM_UST_MMS_USER_CONNECTIVITY_PARAMS,   /**< mms user connectivity parameters */
502         SIM_UST_NIA,                                                    /**< network's indication of alerting in the MS (NIA) */
503
504         // service 57 ~ 64
505         SIM_UST_VGCS_GID_LIST,                  /**< vgcs group identifier List (EF-VGCS, EF-VGCSS) */
506         SIM_UST_VBS_GID_LIST,                   /**< vbs group identifier List (EF-VBS, EF-VBSS) */
507         SIM_UST_PSEUDONYM,
508         SIM_UST_USER_CTRLED_PLMN_SELECTOR_IWLAN,                /**< user controlled PLMN selector for I-WLAN access */
509         SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_IWLAN,            /**< operator controlled PLMN selector for I-WLAN access */
510         SIM_UST_USER_CTRLED_WSID_LIST,
511         SIM_UST_OPERATOR_CTRLED_WSID_LIST,
512         SIM_UST_VGCS_SEC,
513 };
514
515 /**
516  * @enum tel_sim_cdma_service
517  *  This enumeration defines the list of CST services in CDMA Service Table.
518  */
519 enum tel_sim_cdma_service {
520         // service 1 ~ 8
521         SIM_CDMA_ST_CHV_DISABLE = 0,    /**< CHV Disable Option*/
522         SIM_CDMA_ST_ADN,                /**< Abbreviated Dialing number */
523         SIM_CDMA_ST_FDN,                /**< Fixed Dialing number */
524         SIM_CDMA_ST_SMS,                /**< short message storage  */
525         SIM_CDMA_ST_HRPD,               /**< HRPD*/
526         SIM_CDMA_ST_EPB,                /**< Enhanced Phone Book */
527         SIM_CDMA_ST_MMD,                /**< Multimedia domain */
528         SIM_CDMA_ST_EUIMID,             /**< SF_EUIMID- based  EUIMID*/
529
530         // service 9 ~ 16
531         SIM_CDMA_ST_MEID = 8,           /**< MEID */
532         SIM_CDMA_ST_EXT1,               /**< Extension1 */
533         SIM_CDMA_ST_EXT2,               /**< Extension2 */
534         SIM_CDMA_ST_SMSP,               /**< sms parameteres */
535         SIM_CDMA_ST_LND,                /**< Last number dialled */
536         SIM_CDMA_ST_SCP,                /**< Service Category Program for BC-SMS */
537         SIM_CDMA_ST_RFU1,               /**< RFU */
538         SIM_CDMA_ST_RFU2,               /**< RFU */
539
540         // service 17 ~ 24
541         SIM_CDMA_ST_HSPN = 16,          /**< CDMA Home Service Provider Name */
542         SIM_CDMA_ST_SDN,                /**< Service Dialing number */
543         SIM_CDMA_ST_EXT3,               /**< Extension3 */
544         SIM_CDMA_ST_3GPDSIP,            /**< 3GPD-SIP */
545         SIM_CDMA_ST_RFU3,               /**< RFU */
546         SIM_CDMA_ST_RFU4,               /**< RFU */
547         SIM_CDMA_ST_RFU5,               /**< RFU */
548         SIM_CDMA_ST_RFU6,               /**< RFU */
549
550         // service 25 ~ 32
551         SIM_CDMA_ST_DDSMSB = 24,        /**< Data download by SMS broadcast */
552         SIM_CDMA_ST_DDSMSPP,            /**< Data download by SMS PP */
553         SIM_CDMA_ST_MENU,               /**< Menu Selection */
554         SIM_CDMA_ST_CALLC,              /**< Call Control */
555         SIM_CDMA_ST_PROACTIVE,          /**< Proactive RUIM */
556         SIM_CDMA_ST_AKA,                /**< AKA*/
557         SIM_CDMA_ST_RFU7,               /**< RFU */
558         SIM_CDMA_ST_RFU8,               /**< RFU */
559
560         // service 33 ~ 40
561         SIM_CDMA_ST_RFU9 = 32,          /**< RFU */
562         SIM_CDMA_ST_RFU10,              /**< RFU */
563         SIM_CDMA_ST_RFU11,              /**< RFU */
564         SIM_CDMA_ST_RFU12,              /**< RFU */
565         SIM_CDMA_ST_RFU13,              /**< RFU */
566         SIM_CDMA_ST_3GPDMIP,            /**< 3GPD- MIP */
567         SIM_CDMA_ST_BCMCS,              /**< BCMCS */
568         SIM_CDMA_ST_MMS,                /**< Multimedia messaging service */
569
570         // service 41 ~ 48
571         SIM_CDMA_ST_EXT8 = 40,          /**< Extension 8 */
572         SIM_CDMA_ST_MMSUCP,             /**< MMS User Connectivity Parameters */
573         SIM_CDMA_ST_AA,                 /**< Application Authentication */
574         SIM_CDMA_ST_GIL1,               /**< Group Identifier Level 1 */
575         SIM_CDMA_ST_GIL2,               /**< Group Identifier Level 2 */
576         SIM_CDMA_ST_DEPERSO,            /**< Depersonalisation control keys */
577         SIM_CDMA_ST_CNL                 /**< Co-operative Network List */
578 };
579
580 /**
581  * @enum tel_sim_csim_service
582  *  This enumeration defines the list of CST services in CSIM Service Table. (CSIM)
583  */
584 enum tel_sim_csim_service {
585         // service 1 ~ 8
586         SIM_CSIM_ST_LOCAL_PHONEBOOK = 0,        /**< Local Phone book */
587         SIM_CSIM_ST_FDN,                        /**< Fixed Dialing Numbers (FDN) */
588         SIM_CSIM_ST_EXT2,                       /**< Extension 2 */
589         SIM_CSIM_ST_SDN,                        /**< Service Dialing Numbers (SDN)  */
590         SIM_CSIM_ST_EXT3,                       /**< Extension 3 */
591         SIM_CSIM_ST_SMS,                        /**< Short Message Storage (SMS) */
592         SIM_CSIM_ST_SMSP,                       /**< Short Message Parameters */
593         SIM_CSIM_ST_HRPD,                       /**< HRPD */
594
595         // service 9 ~ 16
596         SIM_CSIM_ST_SCP = 8,                    /**< Service Category Program for BC-SMS */
597         SIM_CSIM_ST_HSPN,                       /**< CDMA Home Service Provider Name */
598         SIM_CSIM_ST_DDSMSB,                     /**< Data Download via SMS Broadcast */
599         SIM_CSIM_ST_DDSMSPP,                    /**< Data Download via SMS-PP */
600         SIM_CSIM_ST_CALLC,                      /**< Call Control */
601         SIM_CSIM_ST_3GPDSIP,                    /**< 3GPD-SIP */
602         SIM_CSIM_ST_3GPDMIP,                    /**< 3GPD-MIP */
603         SIM_CSIM_ST_AKA,                        /**< AKA */
604
605         // service 17 ~ 24
606         SIM_CSIM_ST_IP_LCS = 16,                /**< IP-based Location Services (LCS) */
607         SIM_CSIM_ST_BCMCS,                      /**< BCMCS */
608         SIM_CSIM_ST_MMS,                        /**< Multimedia Messaging Service (MMS) */
609         SIM_CSIM_ST_EXT8,                       /**< Extension 8 */
610         SIM_CSIM_ST_MMSUCP,                     /**< MMS User Connectivity Parameters */
611         SIM_CSIM_ST_AA,                         /**< Application Authentication */
612         SIM_CSIM_ST_GIL1,                       /**< Group Identifier Level 1 */
613         SIM_CSIM_ST_GIL2,                       /**< Group Identifier Level 2 */
614
615         // service 25 ~ 32
616         SIM_CSIM_ST_DEPERSO = 24,               /**< De-Personalization Control Keys */
617         SIM_CSIM_ST_CNL,                        /**< Cooperative Network List */
618         SIM_CSIM_ST_OCI,                        /**< Outgoing Call Information (OCI) */
619         SIM_CSIM_ST_ICI,                        /**< Incoming Call Information (ICI) */
620         SIM_CSIM_ST_EXT5,                       /**< Extension 5 */
621         SIM_CSIM_ST_MM_STORAGE,                 /**< Multimedia Storage */
622         SIM_CSIM_ST_IMG,                        /**< Image (EFIMG) */
623         SIM_CSIM_ST_EST,                        /**< Enabled Services Table */
624
625         // service 33 ~ 41
626         SIM_CSIM_ST_CCP = 32,                   /**< Capability Configuration Parameters (CCP) */
627         SIM_CSIM_ST_EUIMIDl,                    /**< SF_EUIMID-based EUIMID */
628         SIM_CSIM_ST_3GPD_EXT,                   /**< Messaging and 3GPD Extensions */
629         SIM_CSIM_ST_ROOT_CERTI,                 /**< Root Certificates */
630         SIM_CSIM_ST_WAP,                        /**< WAP Browser */
631         SIM_CSIM_ST_JAVA,                       /**< Java */
632         SIM_CSIM_ST_RSVD_CDG1,                  /**< Reserved for CDG */
633         SIM_CSIM_ST_RSVD_CDG2,                  /**< Reserved for CDG */
634         SIM_CSIM_ST_IPV6 = 40,                  /**< IPv6 */
635 };
636
637
638 enum tel_sim_refresh_command{
639         SIM_REFRESH_CMD_INIT_AND_FULL_FCN = 0, /**<     command qualifier for REFRESH SIM INIT AND FULL FILE CHANGE_NOTIFICATION                */
640         SIM_REFRESH_CMD_FCN = 1, /**<   command qualifier for REFRESH FILE CHANGE NOTIFICATION          */
641         SIM_REFRESH_CMD_INIT_AND_FCN = 2, /**<  command qualifier for REFRESH SIM INIT AND FILE CHANGE NOTIFICATION             */
642         SIM_REFRESH_CMD_INIT = 3, /**<  command qualifier for REFRESH SIM INIT          */
643         SIM_REFRESH_CMD_RESET = 4, /**< command qualifier for REFRESH SIM RESET         */
644         SIM_REFRESH_CMD_3G_APPLICATION_RESET = 5, /**<  command qualifier for REFRESH 3G APPLICATION RESET              */
645         SIM_REFRESH_CMD_3G_SESSION_RESET = 6, /**<      command qualifier for REFRESH 3G SESSION RESET          */
646         SIM_REFRESH_CMD_RESERVED = 0xFF /**<    command qualifier for REFRESH RESERVED          */
647 };
648
649 enum tel_sim_cst_type {
650         SIM_CDMA_SVC_TABLE = 0,
651         SIM_CSIM_SVC_TABLE,
652         SIM_MAX_SVC_TABLE
653 };
654
655 struct tel_sim_sst {
656         char service[SIM_SST_SERVICE_CNT_MAX];  // should accessed with 'enum tel_sim_sst_service' as index
657 };
658
659 struct tel_sim_ust {
660         char service[SIM_UST_SERVICE_CNT_MAX];  // should accessed with 'enum tel_sim_ust_service' as index
661 };
662
663 struct tel_sim_cst {
664         enum tel_sim_cst_type cdma_svc_table;
665         union {
666                 char cdma_service[SIM_CDMA_ST_SERVICE_CNT_MAX]; /**< should accessed with 'enum tel_sim_cdma_service' as index */
667                 char csim_service[SIM_CSIM_ST_SERVICE_CNT_MAX]; /**< should accessed with 'enum tel_sim_csim_service' as index */
668         } service;
669 };
670
671 struct tel_sim_service_table {
672         enum tel_sim_type sim_type;
673         union {
674                 struct tel_sim_sst sst;
675                 struct tel_sim_ust ust;
676                 struct tel_sim_cst cst;
677         } table;
678 };
679
680 struct tel_sim_est {
681         gboolean bFdnEnabled;
682         gboolean bBdnEnabled;
683         gboolean bAclEnabled;
684 };
685
686 struct tel_sim_imsi {
687         char plmn[6 + 1]; /**< SIM MCC, MNC code. MNC is 2 digit or 3digit */
688         char msin[10 + 1]; /**< Mobile Station Identification Number */
689 };
690
691 struct tel_sim_dialing_number {
692         int alpha_id_max_len; /**< alpha max length in SIM - READ ONLY*/
693         char alpha_id[SIM_XDN_ALPHA_ID_LEN_MAX + 1]; /**< Alpha Identifier */
694         enum tel_sim_ton ton; /**< Type Of Number */
695         enum tel_sim_npi npi; /**< Number Plan Identity */
696         char num[SIM_XDN_NUMBER_LEN_MAX + 1]; /**< Dialing Number/SSC String */
697         unsigned char cc_id; /**< Capability/Configuration Identifier */
698         unsigned char ext1_id; /**< Extensiion1 Record Identifier */
699 };
700
701 struct tel_sim_gid {
702         int GroupIdentifierLen; /**< Group identifier length */
703         unsigned char szGroupIdentifier[SIM_GROUP_IDENTIFIER_LEN_MAX]; /**< Group identifier */
704 };
705
706 struct tel_sim_cphs_svc_call_offering_s {
707         int b_call_forwarding_unconditional; /**< CallForwarding Unconditional */
708         int b_call_forwarding_on_user_busy; /**< CallForwarding On UserBusy */
709         int b_call_forwarding_on_no_reply; /**< CallForwarding On NoReply */
710         int b_call_forwarding_on_user_not_reachable; /**< CallForwarding On User Not Reachable */
711         int b_call_transfer; /**< Call Transfer */
712 };
713
714 struct tel_sim_cphs_svc_call_restriction_s {
715         int b_barring_of_all_outgoing_calls; /**< Barring Of All Outgoing Calls*/
716         int b_barring_of_outgoing_international_calls; /**< Barring Of Outgoing International Calls */
717         int b_barring_of_outgoing_international_calls_except_hplmn; /**< Barring Of Outgoing International Calls Except HPLMN */
718         int b_barring_of_all_incoming_calls_roaming_outside_hplmn; /**< Barring Of All Incoming Calls Roaming Outside HPLMN */
719         int b_barring_of_incoming_calls_when_roaming; /**< Barring Of IncomingCalls When Roaming */
720 };
721
722 struct tel_sim_cphs_svc_other_ss_s {
723         int b_multi_party_service; /**< MultiPartyService*/
724         int b_closed_user_group; /**< ClosedUserGroup*/
725         int b_advice_of_charge; /**< AdviceOfCharge*/
726         int b_preferential_closed_user_group; /**< PreferentialClosedUserGroup*/
727         int b_closed_user_group_outgoing_access; /**< ClosedUserGroupOutgoingAccess*/
728 };
729
730 struct tel_sim_cphs_svc_call_complete_s {
731         int b_call_hold; /**< Call Hold*/
732         int b_call_waiting; /**< Call Waiting*/
733         int b_completion_of_call_to_busy_subscriber; /**< Completion Of Call To Busy Subscriber*/
734         int b_user_user_signalling; /**< User User Signaling*/
735 };
736
737 struct tel_sim_cphs_svc_teleservices_s {
738         int b_short_message_mobile_originated; /**< Short Message Mobile Originated*/
739         int b_short_message_mobile_terminated; /**< Short Message Mobile Terminated*/
740         int b_short_message_cell_broadcast; /**< Short Message Cell Broadcast*/
741         int b_short_message_reply_path; /**< Short      Message Reply Path*/
742         int b_short_message_delivery_conf; /**< Short Message Delivery Conf*/
743         int b_short_message_protocol_identifier; /**< Short Message Protocol Identifier*/
744         int b_short_message_validity_period; /**< Short Message Validity Period*/
745 };
746
747 struct tel_sim_cphs_svc_cphs_teleservices_s {
748         int b_alternative_line_service; /**< Alternative Line Service*/
749 };
750
751 struct tel_sim_cphs_svc_cphs_features_s {
752         int b_string_service_table; /**< String Service Table*/
753 };
754
755 struct tel_sim_cphs_svc_number_identifier_s {
756         int b_calling_line_identification_present; /**< Calling Line Identification Present*/
757         int b_connected_line_identification_restrict; /**< Connected Line Identification Restrict*/
758         int b_connected_line_identification_present; /**< Connected Line Identification Present*/
759         int b_malicious_call_identifier; /**< Malicious Call Identifier*/
760         int b_calling_line_identification_send; /**< Calling Line Identification Send*/
761         int b_calling_line_identification_block; /**< Calling Line Identification Block*/
762 };
763
764 struct tel_sim_cphs_svc_phase_services_s {
765         int b_menu_for_gprs; /**< Menu For GPRS*/
766         int b_menu_for_high_speed_csd; /**< Menu For HighSpeedCsd*/
767         int b_menu_for_voice_group_call; /**< Menu For VoiceGroupCall*/
768         int b_menu_for_voice_broadcast_service; /**< Menu For VoiceBroadcastService*/
769         int b_menu_for_multiple_subscriber_profile; /**< Menu For MultipleSubscriberProfile*/
770         int b_menu_for_multiple_band; /**< Menu For MultipleBand*/
771 };
772
773 struct tel_sim_cphs_svc_value_added_services_s {
774         int b_restrict_menu_for_manual_selection; /**< RestrictMenu For ManualSelection*/
775         int b_restrict_menu_for_voice_mail; /**< RestrictMenu For VoiceMail*/
776         int b_restrict_menu_for_mo_sms_and_paging; /**< RestrictMenu For MoSmsAndPaging*/
777         int b_restrict_menu_for_mo_sms_with_emial_type; /**< RestrictMenu For MoSmsWithEmialType*/
778         int b_restrict_menu_for_fax_calls; /**< RestrictMenu For FaxCalls*/
779         int b_restrict_menu_for_data_calls; /**< RestrictMenu For DataCalls*/
780         int b_restrict_menu_for_change_language; /**< RestrictMenu For ChangeLanguage*/
781 };
782
783 struct tel_sim_cphs_svc_information_numbers_s {
784         int b_information_numbers;      /**< Information Numbers*/
785 };
786
787 struct tel_sim_cphs_csp_entry_s {
788         enum tel_sim_cphs_csp_group customer_service_group; /**< customer service group*/
789         union {
790                 struct tel_sim_cphs_svc_call_offering_s call_offering;                  /**< call offering*/
791                 struct tel_sim_cphs_svc_call_restriction_s call_restriction;            /**< call restriction*/
792                 struct tel_sim_cphs_svc_other_ss_s other_supp_services;                 /**< other SS services*/
793                 struct tel_sim_cphs_svc_call_complete_s call_complete;                  /**< call complete*/
794                 struct tel_sim_cphs_svc_teleservices_s teleservices;                    /**< teleservices*/
795                 struct tel_sim_cphs_svc_cphs_teleservices_s cphs_teleservices;          /**< CPHS teleservices*/
796                 struct tel_sim_cphs_svc_cphs_features_s cphs_features;                  /**< CPHS features*/
797                 struct tel_sim_cphs_svc_number_identifier_s number_identifiers;         /**< number identifiers*/
798                 struct tel_sim_cphs_svc_phase_services_s phase_services;                        /**< phase services*/
799                 struct tel_sim_cphs_svc_value_added_services_s value_added_services;    /**< value added services*/
800                 struct tel_sim_cphs_svc_information_numbers_s information_numbers;      /**< information numbers*/
801         } service;
802 };
803
804 struct tel_sim_cphs_csp {
805         struct tel_sim_cphs_csp_entry_s service_profile_entry[SIM_CPHS_CSP_ENTRY_CNT_MAX];      /**< service profile entry*/
806 };
807
808 #if defined TIZEN_GLOBALCONFIG_ENABLE_CSP
809 struct treq_sim_set_cphs_csp_info {
810         struct tel_sim_cphs_csp cphs_csp_info;
811 };
812 #endif
813
814 struct tel_sim_cphs_dflag {
815         enum tel_sim_cphs_dynamic_flag_selected_line DynamicFlags; /**< Dynamic flags information */
816 };
817
818 struct tel_sim_cphs_dflag2 {
819         enum tel_sim_cphs_dynamic2_flag_als_status Dynamic2Flag; /**< Dynamic flags status */
820 };
821
822 struct tel_sim_cphs_service_tablie_s {
823         /* Byte 2 - bit1 & 2*/
824         int bCustomerServiceProfile; /**< Customer Service Profile (CSP)  */
825         /* Byte 2 - bit3 & 4*/
826         int bServiceStringTable; /**< Service String Table (SST) */
827         /* Byte 2 - bit5 & 6*/
828         int bMailBoxNumbers; /**< MailBoxNumbers */
829         /* Byte 2 - bit7 & 8*/
830         int bOperatorNameShortForm; /**< Short form of operator name */
831         /* Byte 3 - bit1 & 2*/
832         int bInformationNumbers; /**< Information numbers */
833 };
834
835 struct tel_sim_cphs_info {
836         enum tel_sim_cphs_phase CphsPhase; /**< CPHS phase type */
837         struct tel_sim_cphs_service_tablie_s CphsServiceTable; /**< CPHS service table */
838 };
839
840 struct tel_sim_cphs_info_number {
841         int AlphaIdLength; /**< length of alpha identifier */
842         enum tel_sim_cphs_index_level IndexLevelIndicator; /**< SIM CPHS index level one */
843         int PremiumServiceIndicator; /**< SIM CPHS index level one */
844         int NetworkSpecificIndicator; /**< SIM CPHS index level one */
845         unsigned char Alpha_id[SIM_XDN_ALPHA_ID_LEN_MAX + 1]; /**<  Alpha Identifier */
846         unsigned long DiallingnumLength; /**< Length of BCD number/SSC contents */
847         enum tel_sim_ton TypeOfNumber; /**< TON */
848         enum tel_sim_npi NumberingPlanIdentity; /**< NPI */
849         char DiallingNum[SIM_XDN_NUMBER_LEN_MAX + 1]; /**< Dialing Number/SSC String */
850         unsigned char Ext1RecordId; /**< Extensiion1 Record Identifier */
851 };
852
853 enum tel_sim_powerstate {
854         SIM_POWER_OFF = 0x00, /**< OFF */
855         SIM_POWER_ON = 0x01, /**< ON */
856         SIM_POWER_UNSPECIFIED = 0xFF /**< Unspecified */
857 };
858
859
860 struct treq_sim_verify_pins {
861         enum tel_sim_pin_type pin_type;
862         unsigned int pin_length;
863         char pin[9];
864 };
865
866 struct treq_sim_verify_puks {
867         enum tel_sim_pin_type puk_type;
868         unsigned int puk_length;
869         char puk[9];
870         unsigned int pin_length;
871         char pin[9];
872 };
873
874 struct treq_sim_change_pins {
875         enum tel_sim_pin_type type;
876         unsigned int old_pin_length;
877         char old_pin[9];
878         unsigned int new_pin_length;
879         char new_pin[9];
880 };
881
882 struct treq_sim_get_facility_status {
883         enum tel_sim_facility_type type;
884 };
885
886 struct treq_sim_disable_facility {
887         enum tel_sim_facility_type type;
888         unsigned int password_length;
889         char password[39];
890 };
891
892 struct treq_sim_enable_facility {
893         enum tel_sim_facility_type type;
894         unsigned int password_length;
895         char password[39];
896 };
897
898 struct treq_sim_get_lock_info {
899         enum tel_sim_facility_type type;
900 };
901
902 struct treq_sim_transmit_apdu {
903         unsigned int apdu_length;
904         unsigned char apdu[SIM_APDU_DATA_LEN_MAX];
905 };
906
907 struct treq_sim_set_language {
908         enum tel_sim_language_type language;
909 };
910
911 struct treq_sim_req_authentication {
912         enum tel_sim_auth_type auth_type; /**< Authentication type */
913         unsigned int rand_length; /**< the length of RAND */
914         unsigned int autn_length; /**< the length of AUTN. it is not used in case of GSM AUTH */
915         char rand_data[SIM_AUTH_REQ_DATA_LEN_MAX + 1]; /**< RAND data */
916         char autn_data[SIM_AUTH_REQ_DATA_LEN_MAX + 1]; /**< AUTN data. it is not used in case of GSM AUTH */
917 };
918
919 struct treq_sim_set_powerstate {
920         enum tel_sim_powerstate state;
921 };
922
923 struct tresp_sim_set_powerstate {
924         enum tel_sim_power_set_result result;
925 };
926
927
928
929 struct tresp_sim_verify_pins {
930         enum tel_sim_pin_operation_result result;
931         enum tel_sim_pin_type pin_type;
932         int retry_count;
933 };
934
935 struct tresp_sim_verify_puks {
936         enum tel_sim_pin_operation_result result;
937         enum tel_sim_pin_type pin_type;
938         int retry_count;
939 };
940
941 struct tresp_sim_change_pins {
942         enum tel_sim_pin_operation_result result;
943         enum tel_sim_pin_type pin_type;
944         int retry_count;
945 };
946
947 struct tresp_sim_get_facility_status {
948         enum tel_sim_pin_operation_result result;
949         enum tel_sim_facility_type type;
950         gboolean b_enable;
951 };
952
953 struct tresp_sim_disable_facility {
954         enum tel_sim_pin_operation_result result;
955         enum tel_sim_facility_type type;
956         int retry_count;
957 };
958
959 struct tresp_sim_enable_facility {
960         enum tel_sim_pin_operation_result result;
961         enum tel_sim_facility_type type;
962         int retry_count;
963 };
964
965 struct tresp_sim_get_lock_info {
966         enum tel_sim_pin_operation_result result;
967         enum tel_sim_facility_type type;
968         enum tel_sim_lock_status lock_status;
969         int retry_count;
970 };
971
972 struct tresp_sim_transmit_apdu {
973         enum tel_sim_access_result result;
974         unsigned int apdu_resp_length;
975         unsigned char *apdu_resp;
976 };
977
978 struct tresp_sim_get_atr {
979         enum tel_sim_access_result result;
980         unsigned int atr_length;
981         unsigned char atr[256 + 2];
982 };
983
984 struct tel_sim_ecc {
985         char ecc_num[SIM_ECC_BYTE_LEN_MAX * 2 + 1]; /**< Emergency Call Code info-ECC is coded in BCD format. null termination used*/
986         char ecc_string[SIM_ECC_STRING_LEN_MAX + 1]; /**< Alphabet identifier. null termination used*/
987         enum tel_sim_emergency_service_type ecc_category; /**< ECC emergency service information */
988 };
989
990 struct tel_sim_ecc_list {
991         int ecc_count;
992         struct tel_sim_ecc ecc[SIM_ECC_RECORD_CNT_MAX];
993 };
994
995 struct tel_sim_ext {
996         int ext_len;
997         char ext[SIM_EXT_RECORD_CNT_MAX + 1];
998         unsigned short next_record;
999 };
1000
1001 struct tel_sim_language {
1002         int language_count;
1003         enum tel_sim_language_type language[SIM_LANG_CNT_MAX];
1004 };
1005
1006 struct tresp_sim_set_data {
1007         enum tel_sim_access_result result;
1008 };
1009
1010 struct tel_sim_iccid {
1011         char iccid[SIM_ICCID_LEN_MAX + 1];
1012 };
1013
1014 struct tel_sim_mbi {
1015         /*      '00' - no mailbox dialing number associated with message waiting indication group type.
1016          'xx' - record number in EFMBDN associated with message waiting indication group type.
1017          */
1018         int voice_index;        /**< voice mailbox identifier*/
1019         int fax_index;  /**< FAX mailbox identifier*/
1020         int email_index;        /**< email mailbox identifier*/
1021         int other_index;        /**< other mailbox identifier*/
1022         int video_index;        /**< video mailbox identifier*/
1023 };
1024
1025 struct tel_sim_mbi_list {
1026         int profile_count;
1027         struct tel_sim_mbi mbi[SIM_MSP_CNT_MAX];
1028 };
1029
1030 struct tel_sim_mb_number{
1031         int rec_index; // SIM record index;
1032         int profile_number; // Subscriber profile number(ex: line1, line2, lineX)
1033         enum tel_sim_mailbox_type mb_type;
1034         struct tel_sim_dialing_number number_info;
1035 };
1036
1037 struct tel_sim_mailbox {
1038         gboolean b_cphs;
1039         int count;
1040         struct tel_sim_mb_number mb[SIM_MSP_CNT_MAX*5]; //each profile mailbox number can exist 5 numbers
1041 };
1042
1043 struct treq_sim_set_mailbox {
1044         gboolean b_cphs;
1045         struct tel_sim_mb_number mb_info;
1046 };
1047
1048 struct tel_sim_cfis {
1049         int rec_index;
1050         unsigned char msp_num; /**< MSP number*/
1051         unsigned char cfu_status; /**< call forwarding unconditional indication status*/
1052         enum tel_sim_ton ton; /**< TON*/
1053         enum tel_sim_npi npi; /**< NPI*/
1054         char cfu_num[SIM_XDN_NUMBER_LEN_MAX + 1];/**< Dialing Number/SSC String*/
1055         unsigned char cc2_id; /**< Capability/Configuration2 Record Identifier */
1056         unsigned char ext7_id; /**< Extension 7 Record Identifier */
1057 };
1058
1059 struct tel_sim_cf_list {
1060         int profile_count;
1061         struct tel_sim_cfis cf[SIM_MSP_CNT_MAX];
1062 };
1063
1064 struct tel_sim_cphs_cf {
1065         gboolean b_line1; /**< CallForwardUnconditionalLine 1 */
1066         gboolean b_line2; /**< CallForwardUnconditionalLine 2 */
1067         gboolean b_fax; /**< CallForwardUnconditional FAX */
1068         gboolean b_data; /**<CallForwardUnconditional data*/
1069 };
1070
1071 struct tel_sim_callforwarding {
1072         gboolean b_cphs;
1073         struct tel_sim_cf_list cf_list;
1074         struct tel_sim_cphs_cf cphs_cf;
1075 };
1076
1077 struct treq_sim_set_callforwarding {
1078         gboolean b_cphs;
1079         struct tel_sim_cfis cf;
1080         struct tel_sim_cphs_cf cphs_cf;
1081 };
1082
1083 struct tel_sim_mw {
1084         int rec_index;
1085         unsigned char indicator_status; /**< Indicator status*/
1086         int voice_count; /**< VoiceMail Count*/
1087         int fax_count; /**< FAX Count*/
1088         int email_count; /**< Email Count*/
1089         int other_count; /**< Other Count*/
1090         int video_count; /**< VideoMail Count*/
1091 };
1092
1093 struct tel_sim_mw_list {
1094         int profile_count;
1095         struct tel_sim_mw mw[SIM_MSP_CNT_MAX];
1096 };
1097
1098 struct tel_sim_cphs_mw {
1099         gboolean b_voice1; /**< VoiceMsgLine1 message waiting flag */
1100         gboolean b_voice2; /**< VoiceMsgLine2 message waiting flag */
1101         gboolean b_fax; /**< FAX message waiting flag */
1102         gboolean b_data; /**< Data message waiting flag */
1103 };
1104
1105 struct tel_sim_messagewaiting {
1106         gboolean b_cphs;
1107         struct tel_sim_mw_list mw_list;
1108         struct tel_sim_cphs_mw cphs_mw;
1109 };
1110
1111 struct treq_sim_set_messagewaiting {
1112         gboolean b_cphs;
1113         struct tel_sim_mw mw;
1114         struct tel_sim_cphs_mw cphs_mw;
1115 };
1116
1117 struct tel_sim_msisdn {
1118         unsigned char num[SIM_MSISDN_NUMBER_LEN_MAX + 1];
1119         enum tel_sim_ton ton;
1120         unsigned char name[SIM_XDN_ALPHA_ID_LEN_MAX + 1];
1121         unsigned short next_record;
1122 };
1123
1124 struct tel_sim_msisdn_list {
1125         int count;
1126         struct tel_sim_msisdn msisdn[SIM_MSISDN_RECORD_CNT_MAX];
1127 };
1128
1129 struct tel_sim_spn {
1130         unsigned char display_condition; /**< display condition (1 byte) */
1131         unsigned char spn[SIM_CDMA_SPN_LEN_MAX + 1]; /**< SPN */
1132 };
1133
1134 struct tel_sim_spdi {
1135         int plmn_count;
1136         struct {
1137                 unsigned char plmn[6+1];
1138         }list[SIM_SPDI_PLMN_MAX];
1139 };
1140
1141 struct tel_sim_opl {
1142         unsigned char plmn[6+1];
1143         unsigned short lac_from;
1144         unsigned short lac_to;
1145         unsigned char rec_identifier;
1146 };
1147
1148 struct tel_sim_opl_list {
1149         int opl_count;
1150         struct tel_sim_opl *list;
1151 };
1152
1153 struct tel_sim_pnn{
1154         unsigned char full_name[SIM_NW_FULL_NAME_LEN_MAX + 1];
1155         unsigned char short_name[SIM_NW_FULL_NAME_LEN_MAX + 1];
1156 };
1157
1158 struct tel_sim_pnn_list {
1159         int pnn_count;
1160         struct tel_sim_pnn *list;
1161 };
1162
1163 struct tel_sim_cphs_netname {
1164         unsigned char full_name[SIM_CPHS_OPERATOR_NAME_LEN_MAX+1];
1165         unsigned char short_name[SIM_CPHS_OPERATOR_NAME_SHORT_FORM_LEN_MAX+1];
1166 };
1167
1168 struct tel_sim_oplmnwact {
1169         unsigned char plmn[6+1];
1170         gboolean b_umts;
1171         gboolean b_gsm;
1172 };
1173
1174 struct tel_sim_oplmnwact_list {
1175         int opwa_count;
1176         struct tel_sim_oplmnwact opwa[SIM_OPLMNWACT_LEN_MAX];
1177 };
1178
1179 struct tel_sim_file_list{
1180         int file_count;
1181         enum tel_sim_file_id file_id[SIM_FILE_ID_LIST_MAX_COUNT];
1182 };
1183
1184 enum img_coding_scheme{
1185         IMAGE_CODING_SCHEME_BASIC = 0x11,
1186         IMAGE_CODING_SCHEME_COLOUR = 0x21,
1187         IMAGE_CODING_SCHEME_RESERVED = 0xFF
1188 };
1189
1190 struct tel_sim_img{
1191         unsigned char width;
1192         unsigned char height;
1193         enum img_coding_scheme ics;
1194         unsigned short iidf_fileid;
1195         unsigned short offset;
1196         unsigned short length;
1197         unsigned char icon_data[1000];/*Data length should be telephony defined as no restriction as per spec - Need to decide*/
1198 };
1199
1200 struct tresp_sim_read {
1201         enum tel_sim_access_result result;
1202         union {
1203                 struct tel_sim_ecc_list ecc;
1204                 struct tel_sim_language language;
1205                 struct tel_sim_iccid iccid;
1206                 struct tel_sim_mailbox mb;
1207                 struct tel_sim_callforwarding cf;
1208                 struct tel_sim_messagewaiting mw;
1209                 struct tel_sim_cphs_info cphs;
1210                 struct tel_sim_service_table svct;
1211                 struct tel_sim_msisdn_list msisdn_list;
1212                 struct tel_sim_spn spn;
1213                 struct tel_sim_spdi spdi;
1214                 struct tel_sim_opl_list opl;
1215                 struct tel_sim_pnn_list pnn;
1216                 struct tel_sim_cphs_netname cphs_net;
1217                 struct tel_sim_oplmnwact_list opwa;
1218                 struct tel_sim_img img;
1219                 struct tel_sim_gid gid;
1220         } data;
1221 };
1222
1223 struct tresp_sim_req_authentication {
1224         enum tel_sim_access_result result;
1225         enum tel_sim_auth_type auth_type; /**< authentication type */
1226         enum tel_sim_auth_result auth_result; /**< authentication result */
1227         unsigned int resp_length; /**< response length. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
1228         char resp_data[SIM_AUTH_RESP_DATA_LEN_MAX + 1]; /**< response data. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
1229         unsigned int authentication_key_length; /**< the length of authentication key, Kc*/
1230         char authentication_key[SIM_AUTH_RESP_DATA_LEN_MAX + 1]; /**< the data of of authentication key, Kc*/
1231         unsigned int cipher_length; /**< the length of cipher key length */
1232         char cipher_data[SIM_AUTH_RESP_DATA_LEN_MAX + 1]; /**< cipher key */
1233         unsigned int integrity_length; /**< the length of integrity key length */
1234         char integrity_data[SIM_AUTH_RESP_DATA_LEN_MAX + 1]; /**< integrity key */
1235 };
1236
1237 struct tnoti_sim_status {
1238         enum tel_sim_status sim_status;
1239         gboolean b_changed;
1240 };
1241
1242 struct tnoti_sim_refreshed {
1243         struct tel_sim_file_list file_list;
1244         gboolean b_full_file_changed;
1245         enum tel_sim_refresh_command cmd_type;
1246 };
1247
1248 struct tnoti_sim_call_forward_state {
1249         gboolean b_forward;
1250 };
1251
1252 __END_DECLS
1253
1254 #endif