blob: ec9ec490be92321b46967499c91e3e56dfdb19df [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file class_tables.h
2 * simtrace - tables determining APDU case for card emulation. */
3/*
Harald Welte4acaa132016-03-14 15:35:50 +01004 * (C) 2016 by Harald Welte <laforge@gnumonks.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, or
8 * any later version as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Harald Welte4acaa132016-03-14 15:35:50 +010014 */
15
Neels Hofmeyr17518fe2017-06-20 04:35:06 +020016#pragma once
17
Harald Welte4acaa132016-03-14 15:35:50 +010018#include <stdint.h>
19
20struct osim_cla_ins_case {
21 uint8_t cla;
22 uint8_t cla_mask;
23 int (*helper)(const struct osim_cla_ins_case *cic, const uint8_t *hdr);
24 const uint8_t *ins_tbl;
25};
26
27struct osim_cla_ins_card_profile {
28 const char *name;
29 const char *description;
30 const struct osim_cla_ins_case *cic_arr;
31 unsigned int cic_arr_size;
32};
33
34extern const struct osim_cla_ins_card_profile osim_iso7816_cic_profile;
35extern const struct osim_cla_ins_card_profile osim_uicc_cic_profile;
36extern const struct osim_cla_ins_card_profile osim_uicc_sim_cic_profile;
37
38int osim_determine_apdu_case(const struct osim_cla_ins_card_profile *prof,
39 const uint8_t *hdr);