libosmosim 1.13.1.1-afb4 Osmocom SIM library

Functions | Variables
class_tables.c File Reference

simtrace - tables determining APDU case for card emulation. More...

`#include <stdint.h>`
`#include <osmocom/core/utils.h>`
`#include <osmocom/sim/class_tables.h>`

## Functions
static int | uicc046_cla_ins_helper (const struct osim_cla_ins_case *cic, const uint8_t *hdr)
static int | gp_cla_ins_helper (const struct osim_cla_ins_case *cic, const uint8_t *hdr)
int | osim_determine_apdu_case (const struct osim_cla_ins_card_profile *prof, const uint8_t *hdr)

## Variables
static const uint8_t | iso7816_ins_tbl [256]
static const struct osim_cla_ins_case | iso7816_4_ins_case []
const struct osim_cla_ins_card_profile | osim_iso7816_cic_profile
static const uint8_t | gsm1111_ins_tbl [256]
static const struct osim_cla_ins_case | gsm1111_ins_case []
const struct osim_cla_ins_card_profile | osim_gsm1111_cic_profile
static const uint8_t | uicc_ins_tbl_046 [256]
static const uint8_t | uicc_ins_tbl_8ce [256]
static const uint8_t | uicc_ins_tbl_80 [256]
static const uint8_t | gp_ins_tbl_8ce [256]
static const struct osim_cla_ins_case | uicc_ins_case []
const struct osim_cla_ins_card_profile | osim_uicc_cic_profile
static const struct osim_cla_ins_case | uicc_sim_ins_case []
const struct osim_cla_ins_card_profile | osim_uicc_sim_cic_profile
const uint8_t | usim_ins_case [256]
static const uint8_t | microsoft_discovery_ins_tbl [256]

## Detailed Description

simtrace - tables determining APDU case for card emulation.

## Function Documentation

## ◆ gp_cla_ins_helper()

static int gp_cla_ins_helper | ( | const struct osim_cla_ins_case * | cic,
|  | const uint8_t * | hdr
| ) |  |
| static

References ins, p1, and p3.

## ◆ osim_determine_apdu_case()

int osim_determine_apdu_case | ( | const struct osim_cla_ins_card_profile * | prof,
|  | const uint8_t * | hdr
| ) |  |

References osim_cla_ins_card_profile::cic_arr, osim_cla_ins_card_profile::cic_arr_size, osim_cla_ins_case::cla, cla, osim_cla_ins_case::cla_mask, osim_cla_ins_case::helper, ins, osim_cla_ins_case::ins_tbl, and microsoft_discovery_ins_tbl.

## ◆ uicc046_cla_ins_helper()

static int uicc046_cla_ins_helper | ( | const struct osim_cla_ins_case * | cic,
|  | const uint8_t * | hdr
| ) |  |
| static

References ins, p1, and p2.

## Variable Documentation

## ◆ gp_ins_tbl_8ce

const uint8_t gp_ins_tbl_8ce[256]
| static

Initial value:
= {
[0xE4] = 4,
[0xE2] = 0x80,
[0xCA] = 0x80,
[0xCB] = 0x80,
[0xF2] = 0x80,
[0xE6] = 4,
[0xE8] = 4,
[0xD8] = 4,
[0xF0] = 3,
[0xC0] = 2,
}

## ◆ gsm1111_ins_case

const struct osim_cla_ins_case gsm1111_ins_case[]
| static

Initial value:
= {
{
.cla = 0xA0,
.cla_mask = 0xFF,
.ins_tbl = gsm1111_ins_tbl,
},
}
gsm1111_ins_tbl
static const uint8_t gsm1111_ins_tbl[256]
Definition: class_tables.c:76

## ◆ gsm1111_ins_tbl

const uint8_t gsm1111_ins_tbl[256]
| static

Initial value:
= {
[0xA4] = 4,
[0xF2] = 2,
[0xB0] = 2,
[0xD6] = 3,
[0xB2] = 2,
[0xDC] = 3,
[0xA2] = 4,
[0x32] = 4,
[0x20] = 3,
[0x24] = 3,
[0x26] = 3,
[0x28] = 3,
[0x2C] = 3,
[0x04] = 1,
[0x44] = 1,
[0x88] = 4,
[0xFA] = 1,
[0xC0] = 2,
[0x10] = 3,
[0xC2] = 4,
[0x12] = 2,
[0x14] = 3,
}

## ◆ iso7816_4_ins_case

const struct osim_cla_ins_case iso7816_4_ins_case[]
| static

Initial value:
= {
{
.cla = 0x00,
.cla_mask = 0xF0,
.ins_tbl = iso7816_ins_tbl,
}, {
.cla = 0x80,
.cla_mask = 0xE0,
.ins_tbl = iso7816_ins_tbl,
}, {
.cla = 0xB0,
.cla_mask = 0xF0,
.ins_tbl = iso7816_ins_tbl,
}, {
.cla = 0xC0,
.cla_mask = 0xF0,
.ins_tbl = iso7816_ins_tbl,
},
}
iso7816_ins_tbl
static const uint8_t iso7816_ins_tbl[256]
Definition: class_tables.c:30

## ◆ iso7816_ins_tbl

const uint8_t iso7816_ins_tbl[256]
| static

Initial value:
= {
[0xB0] = 2,
[0xD0] = 3,
[0xD6] = 3,
[0x0E] = 3,
[0xB2] = 2,
[0xD2] = 3,
[0xE2] = 3,
[0xDC] = 3,
[0xCA] = 2,
[0xDA] = 3,
[0xA4] = 4,
[0x20] = 3,
[0x88] = 4,
[0x82] = 3,
[0x84] = 2,
[0x70] = 2,
}

## ◆ microsoft_discovery_ins_tbl

const uint8_t microsoft_discovery_ins_tbl[256]
| static

Initial value:
= {
[0xA4] = 4,
[0xCA] = 2,
[0xC0] = 2,
}

Referenced by osim_determine_apdu_case().

## ◆ osim_gsm1111_cic_profile

const struct osim_cla_ins_card_profile osim_gsm1111_cic_profile

Initial value:
= {
.name = "GSM SIM",
.description = "GSM/3GPP TS 11.11",
.cic_arr = gsm1111_ins_case,
.cic_arr_size = ARRAY_SIZE(gsm1111_ins_case),
}
gsm1111_ins_case
static const struct osim_cla_ins_case gsm1111_ins_case[]
Definition: class_tables.c:102
ARRAY_SIZE
#define ARRAY_SIZE(x)

## ◆ osim_iso7816_cic_profile

const struct osim_cla_ins_card_profile osim_iso7816_cic_profile

Initial value:
= {
.name = "ISO 7816-4",
.description = "ISO 7816-4",
.cic_arr = iso7816_4_ins_case,
.cic_arr_size = ARRAY_SIZE(iso7816_4_ins_case),
}
iso7816_4_ins_case
static const struct osim_cla_ins_case iso7816_4_ins_case[]
Definition: class_tables.c:49

## ◆ osim_uicc_cic_profile

const struct osim_cla_ins_card_profile osim_uicc_cic_profile

Initial value:
= {
.name = "UICC",
.description = "TS 102 221 / 3GPP TS 31.102",
.cic_arr = uicc_ins_case,
.cic_arr_size = ARRAY_SIZE(uicc_ins_case),
}
uicc_ins_case
static const struct osim_cla_ins_case uicc_ins_case[]
Definition: class_tables.c:257

## ◆ osim_uicc_sim_cic_profile

const struct osim_cla_ins_card_profile osim_uicc_sim_cic_profile

Initial value:
= {
.name = "UICC+SIM",
.description = "TS 102 221 / 3GPP TS 31.102 + GSM TS 11.11",
.cic_arr = uicc_sim_ins_case,
.cic_arr_size = ARRAY_SIZE(uicc_sim_ins_case),
}
uicc_sim_ins_case
static const struct osim_cla_ins_case uicc_sim_ins_case[]
Definition: class_tables.c:316

## ◆ uicc_ins_case

const struct osim_cla_ins_case uicc_ins_case[]
| static

## ◆ uicc_ins_tbl_046

const uint8_t uicc_ins_tbl_046[256]
| static

Initial value:
= {
[0xA4] = 4,
[0xB0] = 2,
[0xD6] = 3,
[0xB2] = 2,
[0xDC] = 3,
[0xA2] = 4,
[0x20] = 3,
[0x24] = 3,
[0x26] = 3,
[0x28] = 3,
[0x2C] = 3,
[0x04] = 1,
[0x44] = 1,
[0x88] = 4,
[0x89] = 4,
[0x84] = 2,
[0x70] = 2,
[0x73] = 0x80,
[0x75] = 0x80,
[0xC0] = 2,
}

## ◆ uicc_ins_tbl_80

const uint8_t uicc_ins_tbl_80[256]
| static

Initial value:
= {
[0x10] = 3,
[0xC2] = 4,
[0x12] = 2,
[0x14] = 3,
[0x76] = 4,
[0x7A] = 4,
}

## ◆ uicc_ins_tbl_8ce

const uint8_t uicc_ins_tbl_8ce[256]
| static

Initial value:
= {
[0xF2] = 2,
[0x32] = 4,
[0xCB] = 4,
[0xDB] = 3,
[0xAA] = 3,
[0x78] = 4,
}

## ◆ uicc_sim_ins_case

const struct osim_cla_ins_case uicc_sim_ins_case[]
| static

## ◆ usim_ins_case

const uint8_t usim_ins_case[256]

Initial value:
= {
[0x88] = 4,
}