Harald Welte | 4acaa13 | 2016-03-14 15:35:50 +0100 | [diff] [blame] | 1 | #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 | |
| 23 | struct 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 | |
| 30 | struct 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 | |
| 37 | extern const struct osim_cla_ins_card_profile osim_iso7816_cic_profile; |
| 38 | extern const struct osim_cla_ins_card_profile osim_uicc_cic_profile; |
| 39 | extern const struct osim_cla_ins_card_profile osim_uicc_sim_cic_profile; |
| 40 | |
| 41 | int osim_determine_apdu_case(const struct osim_cla_ins_card_profile *prof, |
| 42 | const uint8_t *hdr); |