2009-07-09 21:40:58 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* oFono - Open Source Telephony
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
2009-07-10 23:56:44 +00:00
|
|
|
|
|
|
|
enum sim_fileid {
|
|
|
|
SIM_EFMSISDN_FILEID = 0x6f40,
|
|
|
|
SIM_EFSPN_FILEID = 0x6f46,
|
|
|
|
SIM_EFPNN_FILEID = 0x6fc5,
|
|
|
|
SIM_EFOPL_FILEID = 0x6fc6,
|
|
|
|
SIM_EFSPDI_FILEID = 0x6fcd,
|
|
|
|
};
|
|
|
|
|
2009-07-10 23:59:37 +00:00
|
|
|
#define SIM_EFSPN_DC_HOME_PLMN_BIT 0x1
|
|
|
|
#define SIM_EFSPN_DC_ROAMING_SPN_BIT 0x2
|
|
|
|
|
2009-07-13 21:12:22 +00:00
|
|
|
struct sim_spdi {
|
|
|
|
GSList *operators;
|
|
|
|
};
|
|
|
|
|
2009-07-14 15:58:52 +00:00
|
|
|
struct sim_eons_operator_info {
|
|
|
|
char *longname;
|
|
|
|
gboolean long_ci;
|
|
|
|
char *shortname;
|
|
|
|
gboolean short_ci;
|
|
|
|
char *info;
|
|
|
|
};
|
|
|
|
|
2009-07-13 23:30:17 +00:00
|
|
|
struct sim_eons {
|
2009-07-14 15:58:52 +00:00
|
|
|
struct sim_eons_operator_info *pnn_list;
|
2009-07-13 23:30:17 +00:00
|
|
|
GSList *opl_list;
|
|
|
|
gboolean pnn_valid;
|
|
|
|
int pnn_max;
|
|
|
|
};
|
2009-07-13 17:31:23 +00:00
|
|
|
|
2009-07-13 23:30:17 +00:00
|
|
|
struct sim_eons *sim_eons_new(int pnn_records);
|
|
|
|
void sim_eons_add_pnn_record(struct sim_eons *eons, int record,
|
|
|
|
const guint8 *tlv, int length);
|
|
|
|
gboolean sim_eons_pnn_is_empty(struct sim_eons *eons);
|
|
|
|
void sim_eons_add_opl_record(struct sim_eons *eons,
|
|
|
|
const guint8 *tlv, int length);
|
|
|
|
void sim_eons_optimize(struct sim_eons *eons);
|
2009-07-14 18:47:22 +00:00
|
|
|
struct sim_eons_operator_info *sim_eons_lookup_with_lac(struct sim_eons *eons,
|
|
|
|
const char *mcc,
|
|
|
|
const char *mnc,
|
|
|
|
guint16 lac);
|
2009-07-14 15:58:52 +00:00
|
|
|
struct sim_eons_operator_info *sim_eons_lookup(struct sim_eons *eons,
|
|
|
|
const char *mcc,
|
2009-07-14 18:47:22 +00:00
|
|
|
const char *mnc);
|
2009-07-13 23:30:17 +00:00
|
|
|
void sim_eons_free(struct sim_eons *eons);
|
2009-07-13 21:12:22 +00:00
|
|
|
|
|
|
|
struct sim_spdi *sim_spdi_new(const guint8 *tlv, int length);
|
|
|
|
gboolean sim_spdi_lookup(struct sim_spdi *spdi,
|
|
|
|
const char *mcc, const char *mnc);
|
|
|
|
void sim_spdi_free(struct sim_spdi *spdi);
|