4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #ifndef __TCORE_CO_SIM_H__
22 #define __TCORE_CO_SIM_H__
24 #include <core_object.h>
28 struct tcore_sim_operations {
29 TReturn (*verify_pins)(CoreObject *o, UserRequest *ur);
30 TReturn (*verify_puks)(CoreObject *o, UserRequest *ur);
31 TReturn (*change_pins)(CoreObject *o, UserRequest *ur);
32 TReturn (*get_facility_status)(CoreObject *o, UserRequest *ur);
33 TReturn (*enable_facility)(CoreObject *o, UserRequest *ur);
34 TReturn (*disable_facility)(CoreObject *o, UserRequest *ur);
35 TReturn (*get_lock_info)(CoreObject *o, UserRequest *ur);
36 TReturn (*read_file)(CoreObject *o, UserRequest *ur);
37 TReturn (*update_file)(CoreObject *o, UserRequest *ur);
38 TReturn (*transmit_apdu)(CoreObject *o, UserRequest *ur);
39 TReturn (*get_atr)(CoreObject *o, UserRequest *ur);
40 TReturn (*req_authentication)(CoreObject *o, UserRequest *ur);
43 CoreObject* tcore_sim_new(TcorePlugin *p, const char *name, struct tcore_sim_operations *ops, TcoreHal *hal);
44 void tcore_sim_free(CoreObject *n);
46 enum tel_sim_type tcore_sim_get_type(CoreObject *o);
47 gboolean tcore_sim_set_type(CoreObject *o, enum tel_sim_type type);
49 struct tel_sim_imsi* tcore_sim_get_imsi(CoreObject *o);
50 gboolean tcore_sim_set_imsi(CoreObject *o, struct tel_sim_imsi *imsi);
52 enum tel_sim_status tcore_sim_get_status(CoreObject *o);
53 gboolean tcore_sim_set_status(CoreObject *o, enum tel_sim_status status);
55 gboolean tcore_sim_get_identification(CoreObject *o);
56 gboolean tcore_sim_set_identification(CoreObject *o, gboolean b_changed);
58 gboolean tcore_sim_get_cphs_status(CoreObject *o);
59 gboolean tcore_sim_set_cphs_status(CoreObject *o, gboolean b_support);
61 gboolean tcore_sim_link_userdata(CoreObject *o, void *userdata);
62 void* tcore_sim_ref_userdata(CoreObject *o);
64 gboolean tcore_sim_decode_iccid(struct tel_sim_iccid *p_out, unsigned char *p_in, int in_length);
65 gboolean tcore_sim_decode_lp(struct tel_sim_language *p_out, unsigned char *p_in, int in_length);
66 char* tcore_sim_encode_lp(int *out_length, struct tel_sim_language *p_in);
67 gboolean tcore_sim_decode_li(enum tel_sim_file_id file_id, struct tel_sim_language *p_out, unsigned char *p_in, int in_length);
68 char* tcore_sim_encode_li(int *out_length, struct tel_sim_language *p_in);
69 gboolean tcore_sim_decode_imsi(struct tel_sim_imsi *p_out, unsigned char *p_in, int in_length);
70 gboolean tcore_sim_decode_sst(struct tel_sim_sst *p_sst, unsigned char *p_in, int in_length);
71 gboolean tcore_sim_decode_spn(struct tel_sim_spn *p_spn, unsigned char *p_in, int in_length);
72 gboolean tcore_sim_decode_spdi(struct tel_sim_spdi *p_spdi, unsigned char *p_in, int in_length);
73 gboolean tcore_sim_decode_msisdn(struct tel_sim_msisdn *p_msisdn, unsigned char *p_in, int in_length);
74 gboolean tcore_sim_decode_xdn(struct tel_sim_dialing_number *p_xdn, unsigned char *p_in, int in_length);
75 gboolean tcore_sim_encode_xdn(char *p_out, int out_length, struct tel_sim_dialing_number *p_xdn);
76 gboolean tcore_sim_decode_ecc(struct tel_sim_ecc_list *p_ecc, unsigned char *p_in, int in_length);
77 gboolean tcore_sim_decode_ust(struct tel_sim_ust *p_ust, unsigned char *p_in, int in_length);
78 gboolean tcore_sim_decode_est(struct tel_sim_est *p_est, unsigned char *p_in, int in_length);
79 gboolean tcore_sim_decode_uecc(struct tel_sim_ecc *p_ecc, unsigned char* p_in, int in_length);
80 gboolean tcore_sim_decode_gid( struct tel_sim_gid *p_gid, unsigned char* p_in, int in_length);
81 gboolean tcore_sim_decode_mbi(struct tel_sim_mbi *p_mbi, unsigned char *p_in, int in_length);
82 gboolean tcore_sim_encode_mbi(char *p_out, int out_length, struct tel_sim_mbi *p_mbi);
83 gboolean tcore_sim_decode_cff(struct tel_sim_callforwarding *cfis, unsigned char *p_in, int in_length);
84 char* tcore_sim_encode_cff(const struct tel_sim_callforwarding *cff);
85 gboolean tcore_sim_decode_csp(struct tel_sim_cphs_csp *p_csp, unsigned char *p_in, int in_length);
86 gboolean tcore_sim_encode_csp(unsigned char *p_out, int out_length, struct tel_sim_cphs_csp *p_csp);
87 gboolean tcore_sim_decode_vmwf(struct tel_sim_cphs_mw *p_vmwf, unsigned char* p_in, unsigned long in_length);
88 gboolean tcore_sim_decode_mwis(struct tel_sim_mw *pMwis, unsigned char *p_in, int in_length);
89 gboolean tcore_sim_encode_mwis( char *p_out, int out_length, struct tel_sim_mw *pMwis);
90 gboolean tcore_sim_encode_vmwf(char *p_out, int out_length, struct tel_sim_cphs_mw *p_vmwf);
91 gboolean tcore_sim_decode_ons(unsigned char *p_out, unsigned char *p_in, int in_length);
92 gboolean tcore_sim_decode_cfis(struct tel_sim_callforwarding *cfis, unsigned char *p_in, int in_length);
93 char* tcore_sim_encode_cfis(int *out_length, const struct tel_sim_callforwarding *p_cfis);
94 gboolean tcore_sim_decode_dynamic_flag(struct tel_sim_cphs_dflag *p_df, unsigned char *p_in, int in_length);
95 gboolean tcore_sim_decode_dynamic2_flag(struct tel_sim_cphs_dflag2 *p_d2f, unsigned char *p_in, int in_length);
96 gboolean tcore_sim_encode_dynamic_flag(char *p_out, int out_length, struct tel_sim_cphs_dflag *p_df);
97 gboolean tcore_sim_encode_dynamic2_flag(char *p_out, int out_length, struct tel_sim_cphs_dflag2 *p_d2f);
98 gboolean tcore_sim_decode_cphs_info(struct tel_sim_cphs_info *pCphsInfo, unsigned char *p_in, int in_length);
99 gboolean tcore_sim_decode_short_ons(unsigned char *p_out, unsigned char *p_in, int in_length);
100 gboolean tcore_sim_decode_information_number(struct tel_sim_cphs_info_number *p_info, unsigned char* p_in, int in_length);
101 gboolean tcore_sim_decode_opl(struct tel_sim_opl *p_opl, unsigned char *p_in, int in_length);
102 gboolean tcore_sim_decode_pnn(struct tel_sim_pnn *p_pnn, unsigned char* p_in, int in_length);
103 gboolean tcore_sim_decode_oplmnwact(struct tel_sim_oplmnwact_list *p_list, unsigned char *p_in, int in_length);