libosmosim
1.9.2
Osmocom SIM library
|
Go to the documentation of this file.
17 int len, uint8_t *data);
23 uint16_t
fid,
const char *name,
uint8_t ins
INSTRUCTION byte.
Definition: sim.h:45
int(* card_close)(struct osim_card_hdl *card)
Definition: sim.h:378
const SCARD_IO_REQUEST * pioSendPci
Definition: reader_pcsc.c:47
osim_element_type
Definition: sim.h:95
static int pcsc_get_atr(struct osim_card_hdl *card)
Definition: reader_pcsc.c:52
struct osim_card_hdl * card
current card, if any
Definition: sim.h:389
unsigned int atr_len
Definition: sim.h:423
#define msgb_apdu_sw(__x)
Definition: sim.h:69
#define PCSC_ERROR(rv, text)
Definition: reader_pcsc.c:36
osim_proto
Definition: sim.h:362
static int pcsc_card_reset(struct osim_card_hdl *card, bool cold_reset)
Definition: reader_pcsc.c:155
struct osim_card_app_profile * osim_aprof_isim(void *ctx)
Definition: card_fs_isim.c:90
static int transceive_apdu_t0(struct osim_card_hdl *st, struct msgb *amsg)
Definition: reader.c:52
@ OSIM_READER_DRV_PCSC
Definition: sim.h:368
A card application (e.g.
Definition: sim.h:298
struct osim_card_hdl *(* card_open)(struct osim_reader_hdl *rh, enum osim_proto proto)
Definition: sim.h:376
int osim_card_close(struct osim_card_hdl *card)
Definition: reader.c:284
uint16_t fid
File Identifier.
Definition: sim.h:169
static struct osim_card_hdl * pcsc_card_open(struct osim_reader_hdl *rh, enum osim_proto proto)
Definition: reader_pcsc.c:119
struct osim_card_hdl * card
card to which this channel belongs
Definition: sim.h:430
Decoded data for a single file, consisting of all decoded elements.
Definition: sim.h:133
struct llist_head apps
list of applications found on card
Definition: sim.h:419
struct osim_file_desc * add_df_with_ef(struct osim_file_desc *parent, uint16_t fid, const char *name, const struct osim_file_desc *in, int num)
Definition: core.c:139
#define msgb_apdu_h(__x)
pointer to the command header of the APDU
Definition: sim.h:71
int default_decode(struct osim_decoded_data *dd, const struct osim_file_desc *desc, int len, uint8_t *data)
Definition: core.c:461
enum osim_element_type type
Definition: sim.h:117
uint8_t p1
Parameter 1 byte.
Definition: sim.h:46
void osim_app_profile_register(struct osim_card_app_profile *aprof)
Register an application profile.
Definition: core.c:236
struct osim_file_desc * alloc_df(void *ctx, uint16_t fid, const char *name)
Definition: core.c:123
#define msgb_apdu_de(__x)
Definition: sim.h:74
const struct osim_reader_ops pcsc_reader_ops
Definition: reader_pcsc.c:202
const char * name
Definition: sim.h:119
@ APDU_CASE_1
command header, no command data field, no response data field
Definition: sim.h:25
static int get_sw(struct msgb *resp)
Definition: reader.c:39
uint8_t p2
Parameter 2 byte.
Definition: sim.h:47
@ APDU_CASE_4E
command header, command data field (extended), response data field (extended)
Definition: sim.h:31
uint32_t proto_supported
Definition: sim.h:386
uint8_t p3
Parameter 3 byte, used for TPDU by T=0.
Definition: sim.h:48
@ APDU_CASE_4S
command header, command data field (short), response data field (short)
Definition: sim.h:30
struct osim_card_app_profile * osim_aprof_usim(void *ctx)
Definition: card_fs_usim.c:412
uint16_t sw
status word, composed of SW1 and SW2 bytes
Definition: sim.h:5
struct osim_reader_hdl * osim_reader_open(enum osim_reader_driver driver, int idx, const char *name, void *ctx)
Definition: reader.c:234
@ APDU_CASE_2E
command header, no command data field, response data field (extended)
Definition: sim.h:27
int(* card_reset)(struct osim_card_hdl *card, bool cold_reset)
Definition: sim.h:377
void add_filedesc(struct osim_file_desc *root, const struct osim_file_desc *in, int num)
Definition: core.c:113
Definition: reader_pcsc.c:43
@ APDU_CASE_2S
command header, no command data field, response data field (short)
Definition: sim.h:26
osim_reader_driver
Definition: sim.h:367
A single decoded element inside a file.
Definition: sim.h:114
osim_element_repr
Definition: sim.h:107
DWORD dwActiveProtocol
Definition: reader_pcsc.c:46
const struct osim_reader_ops pcsc_reader_ops
Definition: reader_pcsc.c:202
enum osim_proto proto
card protocol
Definition: sim.h:413
static int pcsc_transceive(struct osim_reader_hdl *rh, struct msgb *msg)
Definition: reader_pcsc.c:184
static struct osim_reader_hdl * pcsc_reader_open(int num, const char *id, void *ctx)
Definition: reader_pcsc.c:73
struct llist_head channels
list of channels for this card
Definition: sim.h:416
struct osim_reader_hdl *(* reader_open)(int idx, const char *name, void *ctx)
Definition: sim.h:375
struct osim_reader_hdl * reader
reader through which card is accessed
Definition: sim.h:409
SCARD_IO_REQUEST pioRecvPci
Definition: reader_pcsc.c:48
@ OSIM_PROTO_T0
Definition: sim.h:363
const struct osim_reader_ops * ops
Definition: sim.h:385
@ APDU_CASE_3S
command header, command data field (short), no response data field
Definition: sim.h:28
struct osim_card_app_profile * osim_aprof_hpsim(void *ctx)
Definition: card_fs_hpsim.c:55
void * priv
Definition: sim.h:387
struct osim_decoded_element * element_alloc_sub(struct osim_decoded_element *ee, const char *name, enum osim_element_type type, enum osim_element_repr repr)
Definition: core.c:98
SCARDCONTEXT hContext
Definition: reader_pcsc.c:44
struct osim_card_hdl * osim_card_open(struct osim_reader_hdl *rh, enum osim_proto proto)
Definition: reader.c:261
const char * name
Definition: sim.h:374
char * name
Definition: reader_pcsc.c:49
@ APDU_CASE_3E
command header, command data field (extended), no response data field
Definition: sim.h:29
#define msgb_apdu_case(__x)
status word from msgb->cb
Definition: sim.h:66
static int pcsc_card_close(struct osim_card_hdl *card)
Definition: reader_pcsc.c:170
SCARDHANDLE hCard
Definition: reader_pcsc.c:45
int osim_card_reset(struct osim_card_hdl *card, bool cold_reset)
Definition: reader.c:277
struct osim_file_desc * parent
parent DF
Definition: sim.h:164
struct llist_head list
linked to card->channels
Definition: sim.h:428
uint8_t atr[OSIM_MAX_ATR_LEN]
ATR (Answer To Reset) of the card.
Definition: sim.h:422
APDU/TPDU command header.
Definition: sim.h:43
struct osim_decoded_element * element_alloc(struct osim_decoded_data *dd, const char *name, enum osim_element_type type, enum osim_element_repr repr)
Definition: core.c:83
#define msgb_apdu_le(__x)
Definition: sim.h:68
#define msgb_apdu_dc(__x)
Definition: sim.h:73
#define msgb_apdu_lc(__x)
Definition: sim.h:67
struct osim_file_desc * alloc_adf_with_ef(void *ctx, const uint8_t *adf_name, uint8_t adf_name_len, const char *name, const struct osim_file_desc *in, int num)
Definition: core.c:156
int osim_transceive_apdu(struct osim_chan_hdl *st, struct msgb *amsg)
Definition: reader.c:224
int(* transceive)(struct osim_reader_hdl *rh, struct msgb *msg)
Definition: sim.h:379