blob: ad89d9496e2ea6cb4032d097fb9cef0d70c5b889 [file] [log] [blame]
Harald Welte4acaa132016-03-14 15:35:50 +01001#pragma once
2
3/* simtrace - tables determining APDU case for card emulation
4 *
5 * (C) 2016 by Harald Welte <laforge@gnumonks.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2, or
9 * any later version as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <stdint.h>
22
23struct osim_cla_ins_case {
24 uint8_t cla;
25 uint8_t cla_mask;
26 int (*helper)(const struct osim_cla_ins_case *cic, const uint8_t *hdr);
27 const uint8_t *ins_tbl;
28};
29
30struct osim_cla_ins_card_profile {
31 const char *name;
32 const char *description;
33 const struct osim_cla_ins_case *cic_arr;
34 unsigned int cic_arr_size;
35};
36
37extern const struct osim_cla_ins_card_profile osim_iso7816_cic_profile;
38extern const struct osim_cla_ins_card_profile osim_uicc_cic_profile;
39extern const struct osim_cla_ins_card_profile osim_uicc_sim_cic_profile;
40
41int osim_determine_apdu_case(const struct osim_cla_ins_card_profile *prof,
42 const uint8_t *hdr);