Revert "Revise driver load routine"
[platform/core/connectivity/net-config.git] / plugin / telephony / telephony.c
1 /*
2  * Network Configuration Module
3  *
4  * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #include <errno.h>
21 #include <vconf.h>
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <unistd.h>
26 #include <arpa/inet.h>
27 #include <sys/wait.h>
28 #include <sys/stat.h>
29 #include <sys/ioctl.h>
30 #include <vconf-keys.h>
31 #include <ITapiSim.h>
32 #include <TapiUtility.h>
33
34 #include "plugin.h"
35
36 #ifdef USE_NETCONFIG_LOG
37 #include "log.h"
38 #else
39 #include <dlog.h>
40
41 #define NETCONFIG_TAG           "NETCONFIG"
42 #define __LOG(level, format, arg...) \
43         do { \
44                 SLOG(level, NETCONFIG_TAG, format, ## arg); \
45         } while (0)
46
47 #define DBG(format, arg...)     __LOG(LOG_DEBUG, format, ## arg)
48 #define ERR(format, arg...)     __LOG(LOG_ERROR, format, ## arg)
49 #endif
50
51 #define TAPI_HANDLE_MAX 2
52
53 /* #define SIM_SLOT_DUAL 2 */
54 #define SIM_SLOT_SINGLE 1
55
56 #define VCONF_TELEPHONY_DEFAULT_DATA_SERVICE    "db/telephony/dualsim/default_data_service"
57 /*
58 #define DEFAULT_DATA_SERVICE_SIM1 0
59 #define DEFAULT_DATA_SERVICE_SIM2 1
60 */
61 #define SIM_RAND_DATA_LEN 16
62 #define SIM_AUTH_MAX_RESP_DATA_LEN 128
63 #define SIM_AUTH_SRES_LEN 4
64 #define SIM_AUTH_KC_LEN 8
65
66 #define AKA_RAND_DATA_LEN 16
67 #define AKA_AUTN_DATA_LEN 16
68 #define AKA_AUTH_RES_MAX_LEN 16
69 #define AKA_AUTH_RES_MIN_LEN 4
70 #define AKA_AUTH_CK_LEN 16
71 #define AKA_AUTH_IK_LEN 16
72
73 static TapiHandle *tapi_handle_dual[TAPI_HANDLE_MAX+1];
74 static TapiHandle *tapi_handle = NULL;
75 struct wifi_authentication_data **wifi_authdata_p = NULL;
76
77 #define wifi_authdata (*wifi_authdata_p)
78
79 static int _check_current_sim()
80 {
81 #if defined TIZEN_WEARABLE
82         return -1;
83 #else
84         int current_sim = 0;
85         int sim_slot_count = 0;
86
87         if ((vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT_COUNT, &sim_slot_count) != 0)
88                 || sim_slot_count == SIM_SLOT_SINGLE) {
89                 ERR("failed to get sim slot count (%d)", sim_slot_count);
90                 return -1;
91         }
92
93         if (vconf_get_int(VCONF_TELEPHONY_DEFAULT_DATA_SERVICE, &current_sim) != 0) {
94                 ERR("failed to get default data service = %d\n", current_sim);
95                 return 0;
96         }
97
98         DBG("default data service [SIM%d]", current_sim);
99         return current_sim;
100 #endif
101 }
102
103 static TapiHandle * netconfig_tel_init(void)
104 {
105         char **cp_list = NULL;
106         int current_sim = _check_current_sim();
107
108         if (current_sim < 0) {
109                 if (tapi_handle == NULL) {
110                         tapi_handle = tel_init(NULL);
111                         if (tapi_handle == NULL)
112                                 ERR("tel_init() Failed - modem %d", current_sim);
113                 }
114                 return tapi_handle;
115         } else {
116                 if (tapi_handle_dual[current_sim] == NULL) {
117                         cp_list = tel_get_cp_name_list();
118                         if (!cp_list) {
119                                 ERR("tel_get_cp_name_list() Failed");
120                                 return NULL;
121                         }
122
123                         tapi_handle_dual[current_sim] = tel_init(cp_list[current_sim]);
124                         if (tapi_handle_dual[current_sim] == NULL)
125                                 ERR("tel_init() Failed - modem %d", current_sim);
126
127                         g_strfreev(cp_list);
128                 }
129                 return tapi_handle_dual[current_sim];
130         }
131 }
132
133 static void netconfig_tel_deinit(void)
134 {
135         int current_sim = _check_current_sim();
136
137         if (current_sim < 0) {
138                 if (tapi_handle)
139                         tel_deinit(tapi_handle);
140
141                 tapi_handle = NULL;
142         } else {
143                 unsigned int i = 0;
144                 while (tapi_handle_dual[i]) {
145                         tel_deinit(tapi_handle_dual[i]);
146                         tapi_handle_dual[i] = NULL;
147                         i++;
148                 }
149         }
150 }
151
152 void telephony_get_network_type(int *svctype, int *pstype)
153 {
154         TapiHandle *tapi_handle = NULL;
155         int telephony_svctype = 0, telephony_pstype = 0;
156
157         tapi_handle = (TapiHandle *)netconfig_tel_init();
158
159         if (NULL != tapi_handle) {
160                 tel_get_property_int(tapi_handle,
161                                 TAPI_PROP_NETWORK_SERVICE_TYPE,
162                                 &telephony_svctype);
163                 tel_get_property_int(tapi_handle, TAPI_PROP_NETWORK_PS_TYPE,
164                                 &telephony_pstype);
165                 netconfig_tel_deinit();
166         }
167
168         *svctype = telephony_svctype;
169         *pstype = telephony_pstype;
170 }
171
172 gboolean telephony_wifi_get_sim_imsi(void *wifi, GDBusMethodInvocation *context)
173 {
174         int ret;
175         TapiHandle *handle;
176         TelSimImsiInfo_t imsi_info;
177         char *imsi;
178
179         handle = (TapiHandle *)netconfig_tel_init();
180         if (handle == NULL) {
181                 ERR("tapi_init failed");
182                 netconfig_error_fail_get_imsi(context);
183                 return FALSE;
184         }
185
186         ERR("before tel_get_sim_imsi");
187         ret = tel_get_sim_imsi(handle, &imsi_info);
188         ERR("after tel_get_sim_imsi");
189         if (ret != TAPI_API_SUCCESS) {
190                 ERR("Failed tel_get_sim_imsi() : [%d]", ret);
191                 netconfig_error_fail_get_imsi(context);
192                 return FALSE;
193         }
194
195         imsi = g_strdup_printf("%s%s%s", imsi_info.szMcc,
196                         imsi_info.szMnc, imsi_info.szMsin);
197
198         netconfig_complete_get_sim_imsi(wifi, context, imsi);
199         g_free(imsi);
200
201         return TRUE;
202 }
203
204 static void *__telephony_wifi_free_wifi_authdata(
205                 struct wifi_authentication_data *data)
206 {
207         if (data != NULL) {
208                 if (data->resp_data)
209                         g_free(data->resp_data);
210                 if (data->authentication_key)
211                         g_free(data->authentication_key);
212                 if (data->cipher_data)
213                         g_free(data->cipher_data);
214                 if (data->integrity_data)
215                         g_free(data->integrity_data);
216
217                 g_free(data);
218                 data = NULL;
219         }
220
221         return NULL;
222 }
223
224 static void __telephony_response_aka_authentication(TapiHandle *handle,
225                 int result, void *data, void *user_data)
226 {
227         if (wifi_authdata != NULL)
228                 wifi_authdata = __telephony_wifi_free_wifi_authdata(wifi_authdata);
229
230         wifi_authdata = g_try_new0(struct wifi_authentication_data, 1);
231
232         if (wifi_authdata == NULL) {
233                 ERR("Out of Memory!");
234                 return;
235         }
236
237         TelSimAuthenticationResponse_t *auth_resp =
238                                         (TelSimAuthenticationResponse_t *) data;
239         if (auth_resp == NULL) {
240                 ERR("the auth response is NULL");
241
242                 wifi_authdata->auth_result = -1;
243                 return;
244         } else
245                 wifi_authdata->auth_result = auth_resp->auth_result;
246
247         if (auth_resp->auth_result == TAPI_SIM_AUTH_NO_ERROR) {
248                 wifi_authdata->resp_length = auth_resp->resp_length;
249                 wifi_authdata->cipher_length = auth_resp->cipher_length;
250                 wifi_authdata->integrity_length = auth_resp->integrity_length;
251
252                 if (wifi_authdata->resp_data != NULL)
253                         g_free(wifi_authdata->resp_data);
254
255                 wifi_authdata->resp_data = g_strdup(auth_resp->resp_data);
256
257                 if (wifi_authdata->cipher_data != NULL)
258                         g_free(wifi_authdata->cipher_data);
259
260                 wifi_authdata->cipher_data = g_strdup(auth_resp->cipher_data);
261
262                 if (wifi_authdata->integrity_data != NULL)
263                         g_free(wifi_authdata->integrity_data);
264
265                 wifi_authdata->integrity_data = g_strdup(auth_resp->integrity_data);
266         } else {
267                 ERR("the result error for aka auth : [%d]", auth_resp->auth_result);
268
269                 if (auth_resp->auth_result == TAPI_SIM_AUTH_SQN_FAILURE ||
270                                         auth_resp->auth_result == TAPI_SIM_AUTH_SYNCH_FAILURE) {
271                         wifi_authdata->resp_length = auth_resp->resp_length;
272
273                         if (wifi_authdata->resp_data != NULL)
274                                 g_free(wifi_authdata->resp_data);
275
276                         wifi_authdata->resp_data = g_strdup(auth_resp->resp_data);
277                 }
278         }
279 }
280
281 netconfig_error_e telephony_wifi_req_aka_auth(GArray *rand_data, GArray *autn_data,
282                 GDBusMethodInvocation *context, struct wifi_authentication_data **data)
283 {
284         int i;
285         int ret;
286         TapiHandle *handle;
287         TelSimAuthenticationData_t auth_data;
288
289         if (!wifi_authdata_p)
290                 wifi_authdata_p = data;
291
292         if (rand_data == NULL || autn_data == NULL)
293                 return NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH;
294
295         if (rand_data->len != AKA_RAND_DATA_LEN) {
296                 ERR("wrong rand data len : [%d]", rand_data->len);
297
298                 return NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH_WRONG_PARAM;
299         }
300
301         if (autn_data->len != AKA_AUTN_DATA_LEN) {
302                 ERR("wrong autn data len : [%d]", autn_data->len);
303
304                 return NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH_WRONG_PARAM;
305         }
306
307         if ((ret = g_array_get_element_size(rand_data)) != 1) {
308                 ERR("wrong rand data size : [%d]", ret);
309
310                 return NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH_WRONG_PARAM;
311         }
312
313         if ((ret = g_array_get_element_size(autn_data)) != 1) {
314                 ERR("wrong autn data size : [%d]", ret);
315
316                 return NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH_WRONG_PARAM;
317         }
318
319         memset(&auth_data, 0, sizeof(auth_data));
320
321         auth_data.auth_type = TAPI_SIM_AUTH_TYPE_3G;
322         auth_data.rand_length = AKA_RAND_DATA_LEN;
323         auth_data.autn_length = AKA_AUTN_DATA_LEN;
324
325         for (i = 0; i < rand_data->len; i++)
326                 auth_data.rand_data[i] = g_array_index(rand_data, guint8, i);
327
328         for (i = 0; i < autn_data->len; i++)
329                 auth_data.autn_data[i] = g_array_index(autn_data, guint8, i);
330
331         handle = (TapiHandle *)netconfig_tel_init();
332         if (handle == NULL)
333                 return NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH;
334
335         ret = tel_req_sim_authentication(handle, &auth_data,
336                         __telephony_response_aka_authentication, NULL);
337
338         if (ret != TAPI_API_SUCCESS) {
339                 ERR("Failed tel_req_sim_authentication() : [%d]", ret);
340
341                 return NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH;
342         }
343         return NETCONFIG_NO_ERROR;
344 }
345
346 static void telephony_response_sim_authentication(TapiHandle *handle,
347                 int result, void *data, void *user_data)
348 {
349         if (wifi_authdata != NULL)
350                 wifi_authdata = __telephony_wifi_free_wifi_authdata(wifi_authdata);
351
352         wifi_authdata = g_try_new0(struct wifi_authentication_data, 1);
353
354         if (wifi_authdata == NULL) {
355                 ERR("Out of Memory!");
356                 return;
357         }
358
359         TelSimAuthenticationResponse_t *auth_resp =
360                                 (TelSimAuthenticationResponse_t *) data;
361         if (auth_resp == NULL) {
362                 ERR("the auth response is NULL");
363
364                 wifi_authdata->auth_result = -1;
365                 return;
366         } else
367                 wifi_authdata->auth_result = auth_resp->auth_result;
368
369         if (auth_resp->auth_result == TAPI_SIM_AUTH_NO_ERROR) {
370                 wifi_authdata->resp_length = auth_resp->resp_length;
371                 wifi_authdata->authentication_key_length =
372                                         auth_resp->authentication_key_length;
373
374                 if (wifi_authdata->resp_data != NULL)
375                         g_free(wifi_authdata->resp_data);
376
377                 wifi_authdata->resp_data = g_strdup(auth_resp->resp_data);
378
379                 if (wifi_authdata->authentication_key != NULL)
380                         g_free(wifi_authdata->authentication_key);
381
382                 wifi_authdata->authentication_key = g_strdup(auth_resp->authentication_key);
383         } else {
384                 ERR("the result error for sim auth : [%d]", auth_resp->auth_result);
385
386                 wifi_authdata->resp_length = 0;
387                 wifi_authdata->authentication_key_length = 0;
388         }
389 }
390
391 gboolean telephony_wifi_req_sim_auth(GArray *rand_data,
392                 GDBusMethodInvocation *context, struct wifi_authentication_data **data)
393 {
394         int i;
395         int ret;
396         TapiHandle *handle;
397         TelSimAuthenticationData_t auth_data;
398
399         if (!wifi_authdata_p)
400                 wifi_authdata_p = data;
401
402         if (rand_data == NULL)
403                 return FALSE;
404
405         if (rand_data->len != SIM_RAND_DATA_LEN) {
406                 ERR("wrong rand data len : [%d]", rand_data->len);
407
408                 netconfig_error_fail_req_sim_auth_wrong_param(context);
409                 return FALSE;
410         }
411
412         if ((ret = g_array_get_element_size(rand_data)) != 1) {
413                 ERR("wrong rand data size : [%d]", ret);
414
415                 netconfig_error_fail_req_sim_auth_wrong_param(context);
416                 return FALSE;
417         }
418
419         memset(&auth_data, 0, sizeof(auth_data));
420
421         auth_data.auth_type = TAPI_SIM_AUTH_TYPE_GSM;
422         auth_data.rand_length = SIM_RAND_DATA_LEN;
423
424         for (i = 0; i < rand_data->len; i++)
425                 auth_data.rand_data[i] = g_array_index(rand_data, guint8, i);
426
427         handle = (TapiHandle *)netconfig_tel_init();
428         if (handle == NULL) {
429                 netconfig_error_fail_req_sim_auth(context);
430                 return FALSE;
431         }
432
433         ret = tel_req_sim_authentication(handle,
434                         &auth_data, telephony_response_sim_authentication, NULL);
435         if (ret != TAPI_API_SUCCESS) {
436                 ERR("Failed tel_req_sim_authentication() : [%d]", ret);
437
438                 netconfig_error_fail_req_sim_auth(context);
439                 return FALSE;
440         }
441
442         return TRUE;
443 }
444
445 static void telephony_noti_sim_status_cb(TapiHandle *handle, const char *noti_id,
446                                 void *data, void *user_data)
447 {
448         TelSimCardStatus_t *status = data;
449
450         if (*status == TAPI_SIM_STATUS_SIM_INIT_COMPLETED) {
451                 DBG("Turn Wi-Fi on automatically");
452
453                 netconfig_wifi_power_on();
454                 netconfig_tel_deinit();
455         }
456 }
457
458 gboolean telephony_tapi_check_sim_state(void)
459 {
460         int ret, card_changed;
461         TelSimCardStatus_t status = TAPI_SIM_STATUS_UNKNOWN;
462         TapiHandle *tapi_handle = NULL;
463
464         tapi_handle = (TapiHandle *)netconfig_tel_init();
465         if (tapi_handle == NULL) {
466                 ERR("Failed to tapi init");
467                 return FALSE;
468         }
469
470         ret = tel_get_sim_init_info(tapi_handle, &status, &card_changed);
471         if (ret != TAPI_API_SUCCESS) {
472                 ERR("tel_get_sim_init_info() Failed : [%d]", ret);
473                 netconfig_tel_deinit();
474                 return FALSE;
475         }
476
477         switch (status) {
478         case TAPI_SIM_STATUS_UNKNOWN:
479         case TAPI_SIM_STATUS_CARD_ERROR:
480         case TAPI_SIM_STATUS_CARD_NOT_PRESENT:
481         case TAPI_SIM_STATUS_CARD_BLOCKED:
482         case TAPI_SIM_STATUS_SIM_INIT_COMPLETED:
483                 break;
484         case TAPI_SIM_STATUS_SIM_PIN_REQUIRED:
485         case TAPI_SIM_STATUS_SIM_INITIALIZING:
486         case TAPI_SIM_STATUS_SIM_PUK_REQUIRED:
487         case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED:
488         case TAPI_SIM_STATUS_SIM_NCK_REQUIRED:
489         case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED:
490         case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED:
491         case TAPI_SIM_STATUS_SIM_CCK_REQUIRED:
492                 tel_register_noti_event(tapi_handle, TAPI_NOTI_SIM_STATUS,
493                                 telephony_noti_sim_status_cb, NULL);
494                 return FALSE;
495         default:
496                 ERR("not defined status(%d)", status);
497                 break;
498         }
499
500         netconfig_tel_deinit();
501
502         return TRUE;
503 }
504
505 static void __telephony_wifi_clean_authentication(void)
506 {
507         netconfig_tel_deinit();
508
509         wifi_authdata = __telephony_wifi_free_wifi_authdata(wifi_authdata);
510 }
511
512 gboolean telephony_wifi_get_aka_authdata(void *wifi,
513                 GDBusMethodInvocation *context, struct wifi_authentication_data **data)
514 {
515         GArray *array = NULL;
516         guchar res_len;
517
518         if (!wifi_authdata_p)
519                 wifi_authdata_p = data;
520
521         if (wifi_authdata == NULL) {
522                 DBG("the status error : no response yet");
523                 netconfig_error_fail_get_sim_auth_delay(context);
524                 return FALSE;
525         }
526
527         switch (wifi_authdata->auth_result) {
528         case TAPI_SIM_AUTH_NO_ERROR:
529                  break;
530
531         case TAPI_SIM_AUTH_SQN_FAILURE:
532         case TAPI_SIM_AUTH_SYNCH_FAILURE:
533                 array = g_array_sized_new(FALSE, FALSE, sizeof(guchar),
534                                                                         wifi_authdata->resp_length+1);
535                 res_len = (guchar)((wifi_authdata->resp_length-1) & 0xff);
536
537                 g_array_append_vals(array, &res_len, 1);
538                 g_array_append_vals(array, wifi_authdata->resp_data,
539                                                                 wifi_authdata->resp_length);
540
541                 netconfig_complete_get_aka_auth(wifi, context, array);
542                 g_array_free(array, TRUE);
543
544                 __telephony_wifi_clean_authentication();
545
546                 return TRUE;
547
548         default:
549                 netconfig_error_fail_get_sim_auth_wrong_data(context);
550                 __telephony_wifi_clean_authentication();
551                 return FALSE;
552         }
553
554         if ((wifi_authdata->resp_length >= AKA_AUTH_RES_MIN_LEN ||
555                         wifi_authdata->resp_length <= AKA_AUTH_RES_MAX_LEN) &&
556                         wifi_authdata->cipher_length == AKA_AUTH_CK_LEN &&
557                         wifi_authdata->integrity_length == AKA_AUTH_IK_LEN) {
558                 array = g_array_sized_new(FALSE, FALSE, sizeof(guchar),
559                                 wifi_authdata->resp_length+AKA_AUTH_CK_LEN+AKA_AUTH_IK_LEN+1);
560
561                 res_len = (guchar)((wifi_authdata->resp_length-1) & 0xff);
562                 g_array_append_vals(array, &res_len, 1);
563                 g_array_append_vals(array, wifi_authdata->resp_data,
564                                                                 wifi_authdata->resp_length);
565                 g_array_append_vals(array, wifi_authdata->cipher_data,
566                                                                 AKA_AUTH_CK_LEN);
567                 g_array_append_vals(array, wifi_authdata->integrity_data,
568                                                                 AKA_AUTH_IK_LEN);
569         } else {
570                 ERR("auth data length is wrong, res = [%d], Kc = [%d], Ki = [%d]",
571                                 wifi_authdata->resp_length, wifi_authdata->cipher_length,
572                                 wifi_authdata->integrity_length);
573
574                 netconfig_error_fail_get_sim_auth_wrong_data(context);
575                 __telephony_wifi_clean_authentication();
576                 return FALSE;
577         }
578
579         netconfig_complete_get_aka_auth(wifi, context, array);
580         g_array_free(array, TRUE);
581         __telephony_wifi_clean_authentication();
582
583         return TRUE;
584 }
585
586 gboolean telephony_wifi_get_sim_authdata(void *wifi,
587                 GDBusMethodInvocation *context, struct wifi_authentication_data **data)
588 {
589         GArray *array = NULL;
590
591         if (!wifi_authdata_p)
592                 wifi_authdata_p = data;
593
594         if (wifi_authdata == NULL) {
595                 DBG("the status error : no response yet");
596                 netconfig_error_fail_get_sim_auth_delay(context);
597                 return FALSE;
598         }
599
600         if (wifi_authdata->auth_result == TAPI_SIM_AUTH_NO_ERROR) {
601                 if (wifi_authdata->resp_length == SIM_AUTH_SRES_LEN &&
602                                 wifi_authdata->authentication_key_length == SIM_AUTH_KC_LEN) {
603                         array = g_array_sized_new(FALSE, FALSE, sizeof(guchar),
604                                         SIM_AUTH_SRES_LEN+SIM_AUTH_KC_LEN);
605                         g_array_append_vals(array, wifi_authdata->resp_data,
606                                         SIM_AUTH_SRES_LEN);
607                         g_array_append_vals(array, wifi_authdata->authentication_key,
608                                         SIM_AUTH_KC_LEN);
609                 } else {
610                         ERR("auth data length is wrong, SRES = [%d], Kc = [%d]",
611                                         wifi_authdata->resp_length,
612                                         wifi_authdata->authentication_key_length);
613                         netconfig_error_fail_get_sim_auth_wrong_data(context);
614                         __telephony_wifi_clean_authentication();
615                         return FALSE;
616                 }
617         } else {
618                 ERR("failed auth result = [%d]", wifi_authdata->auth_result);
619                 netconfig_error_fail_get_sim_auth_wrong_data(context);
620                 __telephony_wifi_clean_authentication();
621                 return FALSE;
622         }
623
624         netconfig_complete_get_sim_auth(wifi, context, array);
625         g_array_free(array, TRUE);
626         __telephony_wifi_clean_authentication();
627         return TRUE;
628 }
629
630
631 extern struct netconfig_telephony_plugin_t netconfig_telephony_plugin
632                 __attribute__ ((visibility("default")));
633 struct netconfig_telephony_plugin_t netconfig_telephony_plugin = {
634                 telephony_get_network_type,
635                 telephony_wifi_get_sim_imsi,
636                 telephony_wifi_req_aka_auth,
637                 telephony_wifi_req_sim_auth,
638                 telephony_tapi_check_sim_state,
639                 telephony_wifi_get_aka_authdata,
640                 telephony_wifi_get_sim_authdata
641 };
642