blob: d5be39dd2c25e6cc32529b2733bd8bdb09bfc108 [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.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
Neels Hofmeyr17518fe2017-06-20 04:35:06 +020020#pragma once
21
Harald Welte4acaa132016-03-14 15:35:50 +010022#include <stdint.h>
23
24struct osim_cla_ins_case {
25 uint8_t cla;
26 uint8_t cla_mask;
27 int (*helper)(const struct osim_cla_ins_case *cic, const uint8_t *hdr);
28 const uint8_t *ins_tbl;
29};
30
31struct osim_cla_ins_card_profile {
32 const char *name;
33 const char *description;
34 const struct osim_cla_ins_case *cic_arr;
35 unsigned int cic_arr_size;
36};
37
38extern const struct osim_cla_ins_card_profile osim_iso7816_cic_profile;
39extern const struct osim_cla_ins_card_profile osim_uicc_cic_profile;
40extern const struct osim_cla_ins_card_profile osim_uicc_sim_cic_profile;
41
42int osim_determine_apdu_case(const struct osim_cla_ins_card_profile *prof,
43 const uint8_t *hdr);