libosmosim 1.13.1.1-afb4 Osmocom SIM library

Functions | Variables
card_fs_sim.c File Reference

classic SIM card specific structures/routines. More...

`#include <errno.h>`
`#include <string.h>`
`#include <osmocom/sim/sim.h>`
`#include <osmocom/core/talloc.h>`
`#include <osmocom/gsm/gsm48.h>`
`#include "sim_int.h"`

## Functions
static int | iccid_decode (struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
static int | elp_decode (struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
int | gsm_lp_decode (struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
int | gsm_imsi_decode (struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
static int | gsm_kc_decode (struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
static int | gsm_plmnsel_decode (struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
int | gsm_hpplmn_decode (struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
int | osim_int_cprof_add_gsm (struct osim_file_desc *mf)
int | osim_int_cprof_add_telecom (struct osim_file_desc *mf)
struct osim_card_profile * | osim_cprof_sim (void *ctx)

## Variables
static const struct osim_card_sw | ts11_11_sw []
static const struct osim_card_sw * | sim_card_sws []
static const struct osim_file_desc | sim_ef_in_mf []
static const struct osim_file_desc | sim_ef_in_gsm []
static const struct osim_file_desc | sim_ef_in_solsa []
static const struct osim_file_desc | sim_ef_in_mexe []
static const struct osim_file_desc | sim_ef_in_telecom []
const struct osim_file_desc | sim_ef_in_graphics []

## Detailed Description

classic SIM card specific structures/routines.

## Function Documentation

## ◆ elp_decode()

static int elp_decode | ( | struct osim_decoded_data * | dd,
|  | const struct osim_file_desc * | desc,
|  | int | len,
|  | uint8_t * | data
| ) |  |
| static

References osim_decoded_element::buf, data, ELEM_REPR_NONE, ELEM_T_STRING, element_alloc(), len(), and osim_decoded_element::u.

## ◆ gsm_hpplmn_decode()

int gsm_hpplmn_decode | ( | struct osim_decoded_data * | dd,
|  | const struct osim_file_desc * | desc,
|  | int | len,
|  | uint8_t * | data
| ) |  |

References data, ELEM_REPR_DEC, ELEM_T_UINT8, element_alloc(), osim_decoded_element::u, and osim_decoded_element::u8.

## ◆ gsm_imsi_decode()

int gsm_imsi_decode | ( | struct osim_decoded_data * | dd,
|  | const struct osim_file_desc * | desc,
|  | int | len,
|  | uint8_t * | data
| ) |  |

References osim_decoded_element::buf, data, ELEM_REPR_DEC, ELEM_T_BCD, element_alloc(), len(), osim_decoded_element::length, and osim_decoded_element::u.

## ◆ gsm_kc_decode()

static int gsm_kc_decode | ( | struct osim_decoded_data * | dd,
|  | const struct osim_file_desc * | desc,
|  | int | len,
|  | uint8_t * | data
| ) |  |
| static

References osim_decoded_element::buf, data, ELEM_REPR_DEC, ELEM_REPR_HEX, ELEM_T_BYTES, ELEM_T_UINT8, element_alloc(), len(), osim_decoded_element::u, and osim_decoded_element::u8.

## ◆ gsm_lp_decode()

int gsm_lp_decode | ( | struct osim_decoded_data * | dd,
|  | const struct osim_file_desc * | desc,
|  | int | len,
|  | uint8_t * | data
| ) |  |

References data, ELEM_REPR_DEC, ELEM_T_UINT8, element_alloc(), len(), osim_decoded_element::u, and osim_decoded_element::u8.

## ◆ gsm_plmnsel_decode()

static int gsm_plmnsel_decode | ( | struct osim_decoded_data * | dd,
|  | const struct osim_file_desc * | desc,
|  | int | len,
|  | uint8_t * | data
| ) |  |
| static

References data, ELEM_REPR_DEC, ELEM_REPR_NONE, ELEM_T_GROUP, ELEM_T_UINT16, element_alloc(), element_alloc_sub(), len(), osim_decoded_element::u, and osim_decoded_element::u16.

## ◆ iccid_decode()

static int iccid_decode | ( | struct osim_decoded_data * | dd,
|  | const struct osim_file_desc * | desc,
|  | int | len,
|  | uint8_t * | data
| ) |  |
| static

References osim_decoded_element::buf, data, ELEM_REPR_DEC, ELEM_T_BCD, element_alloc(), len(), osim_decoded_element::length, and osim_decoded_element::u.

## ◆ osim_cprof_sim()

struct osim_card_profile * osim_cprof_sim | ( | void * | ctx | ) |

References add_filedesc(), alloc_df(), ARRAY_SIZE, osim_card_profile::mf, osim_card_profile::name, osim_int_cprof_add_gsm(), osim_int_cprof_add_telecom(), sim_card_sws, sim_ef_in_mf, and osim_card_profile::sws.

## ◆ osim_int_cprof_add_gsm()

int osim_int_cprof_add_gsm | ( | struct osim_file_desc * | mf | ) |

References add_df_with_ef(), ARRAY_SIZE, sim_ef_in_gsm, sim_ef_in_mexe, and sim_ef_in_solsa.

Referenced by osim_cprof_sim(), and osim_cprof_uicc().

## ◆ osim_int_cprof_add_telecom()

int osim_int_cprof_add_telecom | ( | struct osim_file_desc * | mf | ) |

References add_df_with_ef(), ARRAY_SIZE, sim_ef_in_graphics, and sim_ef_in_telecom.

Referenced by osim_cprof_sim(), osim_cprof_tsim(), and osim_cprof_uicc().

## Variable Documentation

## ◆ sim_card_sws

const struct osim_card_sw* sim_card_sws[]
| static

Initial value:
= {
ts11_11_sw,
NULL
}
ts11_11_sw
static const struct osim_card_sw ts11_11_sw[]
Definition: card_fs_sim.c:32

Referenced by osim_cprof_sim().

## ◆ sim_ef_in_graphics

const struct osim_file_desc sim_ef_in_graphics[]

Initial value:
= {
EF_LIN_FIX_N(0x4F20, SFI_NONE, "EF.IMG", F_OPTIONAL, 11, 38,
"Image"),
}
SFI_NONE
#define SFI_NONE
Definition: sim.h:159
EF_LIN_FIX_N
#define EF_LIN_FIX_N(fid, sfi, ns, flags, smin, srec, nl)
Convenience macros for defining EF.
Definition: sim.h:237
F_OPTIONAL
#define F_OPTIONAL
Definition: sim.h:157

Referenced by osim_int_cprof_add_telecom().

## ◆ sim_ef_in_gsm

const struct osim_file_desc sim_ef_in_gsm[]
| static

Referenced by osim_int_cprof_add_gsm().

## ◆ sim_ef_in_mexe

const struct osim_file_desc sim_ef_in_mexe[]
| static

Initial value:
= {
EF_TRANSP_N(0x4F40, SFI_NONE, "EF.MExE-ST", F_OPTIONAL, 1, 8,
"MExE Service table"),
EF_LIN_FIX_N(0x4F41, SFI_NONE, "EF.ORPK", F_OPTIONAL, 11, 32,
"Operator Root Public Key"),
EF_LIN_FIX_N(0x4F42, SFI_NONE, "EF.ARPK", F_OPTIONAL, 11, 32,
"Administrator Root Public Key"),
EF_LIN_FIX_N(0x4F43, SFI_NONE, "EF.TRPK", F_OPTIONAL, 11, 32,
"Third Party Root Public Key"),
}
EF_TRANSP_N
#define EF_TRANSP_N(fid, sfi, ns, flags, smin, srec, nl)
Convenience macros for defining EF.
Definition: sim.h:219

Referenced by osim_int_cprof_add_gsm().

## ◆ sim_ef_in_mf

const struct osim_file_desc sim_ef_in_mf[]
| static

Initial value:
= {
EF_TRANSP(0x2FE2, SFI_NONE, "EF.ICCID", 0, 10, 10,
"ICC Identification", &iccid_decode, NULL),
EF_TRANSP(0x2F05, SFI_NONE, "EF.PL", F_OPTIONAL, 2, 20,
"Preferred language", &elp_decode, NULL),
}
iccid_decode
static int iccid_decode(struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
Definition: card_fs_sim.c:108
elp_decode
static int elp_decode(struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
Definition: card_fs_sim.c:121
EF_TRANSP
#define EF_TRANSP(fid, sfi, ns, flags, smin, srec, nl, dec, enc)
Convenience macros for defining EF.
Definition: sim.h:215

Referenced by osim_cprof_sim().

## ◆ sim_ef_in_solsa

const struct osim_file_desc sim_ef_in_solsa[]
| static

Initial value:
= {
EF_TRANSP_N(0x4F30, SFI_NONE, "EF.SAI", F_OPTIONAL, 1, 32,
"SoLSA Access Indicator"),
EF_LIN_FIX_N(0x4F31, SFI_NONE, "EF.SLL", F_OPTIONAL, 1, 32,
"SoLSA LSA List"),
}

Referenced by osim_int_cprof_add_gsm().

## ◆ sim_ef_in_telecom

const struct osim_file_desc sim_ef_in_telecom[]
| static

Referenced by osim_int_cprof_add_telecom().

## ◆ ts11_11_sw

const struct osim_card_sw ts11_11_sw[]
| static