#include <ccid.h>#include <list.h>#include <emv.h>#include <ber.h>#include <ctype.h>#include "emv-internal.h"
Go to the source code of this file.
Data Structures | |
| struct | db_state |
Functions | |
| static struct _emv_tag * | find_tag (uint16_t id) |
| static struct _emv_data * | find_data (struct _emv_data **db, unsigned int num, uint16_t id) |
| struct _emv_data * | _emv_retrieve_data (emv_t e, uint16_t id) |
| emv_data_t | emv_retrieve_data (emv_t e, uint16_t id) |
| emv_data_t * | emv_data_children (emv_data_t d, unsigned int *nmemb) |
| emv_data_t * | emv_retrieve_records (emv_t e, unsigned int *nmemb) |
| const uint8_t * | emv_data (emv_data_t d, size_t *len) |
| unsigned int | emv_data_type (emv_data_t d) |
| uint16_t | emv_data_tag (emv_data_t d) |
| const char * | emv_data_tag_label (emv_data_t d) |
| int | emv_data_int (emv_data_t d) |
| int | emv_data_sda (emv_data_t d) |
| static int | composite (emv_t e, struct _emv_data *d) |
| static int | decode_record (struct db_state *s, const uint8_t *ptr, size_t len, int sda) |
| static int | cmp (const void *A, const void *B) |
| static void | count_elements (struct _emv_data **d, size_t num, unsigned int *cnt) |
| static void | add_elements (struct _emv_data **d, size_t num, struct _emv_data ***db) |
| static int | read_sfi (struct db_state *s, uint8_t sfi, uint8_t begin, uint8_t end, uint8_t num_sda) |
| int | emv_read_app_data (struct _emv *e) |
Variables | |
| static struct _emv_tag | unknown_soldier |
| static struct _emv_tag | tags [] |
| static const unsigned int | num_tags = sizeof(tags)/sizeof(*tags) |
Definition at line 172 of file emv_data.c.
References _emv_db::db_elem, _emv_db::db_nmemb, _emv::e_db, and find_data().
Referenced by get_required_data().


Definition at line 481 of file emv_data.c.
References _emv_data::d_elem, _emv_data::d_nmemb, and emv_data_composite().
Referenced by emv_read_app_data().


| static int cmp | ( | const void * | A, | |
| const void * | B | |||
| ) | [static] |
Definition at line 454 of file emv_data.c.
Referenced by count_elements(), emv_read_app_data(), find_data(), and find_tag().

Definition at line 243 of file emv_data.c.
References _emv_error(), _emv_sys_error(), ber_decode_len(), ber_decode_tag(), _emv_data::d_data, _emv_data::d_elem, _emv_data::d_flags, _emv_data::d_id, _emv_data::d_len, _emv_data::d_nmemb, _emv_data::d_tag, _emv::e_data, _emv::e_files, emv_data_composite(), EMV_ERR_BER_DECODE, find_tag(), gang_alloc(), mpool_alloc(), and num_tags.
Referenced by decode_record().


| static void count_elements | ( | struct _emv_data ** | d, | |
| size_t | num, | |||
| unsigned int * | cnt | |||
| ) | [static] |
Definition at line 460 of file emv_data.c.
References cmp(), _emv_data::d_elem, _emv_data::d_nmemb, and emv_data_composite().
Referenced by emv_read_app_data().


| static int decode_record | ( | struct db_state * | s, | |
| const uint8_t * | ptr, | |||
| size_t | len, | |||
| int | sda | |||
| ) | [static] |
Definition at line 333 of file emv_data.c.
References _emv_error(), _emv_sys_error(), ber_decode_len(), composite(), _emv_data::d_data, _emv_data::d_flags, _emv_data::d_id, _emv_data::d_len, _emv_data::d_tag, db_state::e, _emv::e_data, _emv::e_files, EMV_DATA_SDA, EMV_ERR_BER_DECODE, EMV_TAG_RECORD, find_tag(), gang_alloc(), mpool_alloc(), db_state::rec, and db_state::sda.
Referenced by read_sfi().


| const uint8_t* emv_data | ( | emv_data_t | d, | |
| size_t * | len | |||
| ) |
Definition at line 194 of file emv_data.c.
References _emv_data::d_data, and _emv_data::d_len.
Referenced by cp_data_repr(), and cp_data_value().

| emv_data_t* emv_data_children | ( | emv_data_t | d, | |
| unsigned int * | nmemb | |||
| ) |
Definition at line 182 of file emv_data.c.
References _emv_data::d_elem, and _emv_data::d_nmemb.
Referenced by cp_data_children().

| int emv_data_int | ( | emv_data_t | d | ) |
Definition at line 215 of file emv_data.c.
References _emv_data::d_data, _emv_data::d_len, _emv_data::d_tag, EMV_DATA_INT, EMV_DATA_TYPE_MASK, and _emv_tag::t_type.
Referenced by cp_data_repr(), and get_required_data().

| int emv_data_sda | ( | emv_data_t | d | ) |
Definition at line 231 of file emv_data.c.
References _emv_data::d_flags, and EMV_DATA_SDA.
Referenced by cp_data_sda().

| uint16_t emv_data_tag | ( | emv_data_t | d | ) |
Definition at line 205 of file emv_data.c.
References _emv_data::d_id.
Referenced by cp_data_tag(), and data_dict().

| const char* emv_data_tag_label | ( | emv_data_t | d | ) |
Definition at line 210 of file emv_data.c.
References _emv_data::d_tag, and _emv_tag::t_label.
Referenced by cp_data_tag_label().

| unsigned int emv_data_type | ( | emv_data_t | d | ) |
Definition at line 200 of file emv_data.c.
References _emv_data::d_tag, EMV_DATA_TYPE_MASK, and _emv_tag::t_type.
Referenced by cp_data_repr(), and cp_data_type().

| int emv_read_app_data | ( | struct _emv * | e | ) |
Definition at line 522 of file emv_data.c.
References _emv_success(), _emv_sys_error(), add_elements(), cmp(), count_elements(), _emv_data::d_elem, _emv_data::d_nmemb, db_state::db, _emv_db::db_elem, _emv_db::db_nmemb, _emv_db::db_numrec, _emv_db::db_numsda, _emv_db::db_rec, _emv_db::db_sda, db_state::e, _emv::e_afl, _emv::e_afl_len, _emv::e_data, _emv::e_db, _emv::e_files, gang_alloc(), gang_free(), gang_new(), mpool_free(), mpool_new(), read_sfi(), db_state::rec, and db_state::sda.
Referenced by cp_read_app_data(), and do_emv_stuff().


| emv_data_t emv_retrieve_data | ( | emv_t | e, | |
| uint16_t | id | |||
| ) |
Definition at line 177 of file emv_data.c.
References _emv_db::db_elem, _emv_db::db_nmemb, _emv::e_db, and find_data().

| emv_data_t* emv_retrieve_records | ( | emv_t | e, | |
| unsigned int * | nmemb | |||
| ) |
Definition at line 188 of file emv_data.c.
References _emv_db::db_numrec, _emv_db::db_rec, and _emv::e_db.
Referenced by cp_read_app_data().

| static struct _emv_data* find_data | ( | struct _emv_data ** | db, | |
| unsigned int | num, | |||
| uint16_t | id | |||
| ) | [static, read] |
Definition at line 148 of file emv_data.c.
References cmp(), _emv_data::d_id, and num_tags.
Referenced by _emv_retrieve_data(), and emv_retrieve_data().


| static struct _emv_tag* find_tag | ( | uint16_t | id | ) | [static, read] |
Definition at line 125 of file emv_data.c.
References cmp(), num_tags, and _emv_tag::t_tag.
Referenced by composite(), and decode_record().


| static int read_sfi | ( | struct db_state * | s, | |
| uint8_t | sfi, | |||
| uint8_t | begin, | |||
| uint8_t | end, | |||
| uint8_t | num_sda | |||
| ) | [static] |
Definition at line 499 of file emv_data.c.
References _emv_read_record(), decode_record(), db_state::e, _emv::e_xfr, and xfr_rx_data().
Referenced by emv_read_app_data().


Definition at line 123 of file emv_data.c.
Referenced by composite(), find_data(), and find_tag().
Definition at line 20 of file emv_data.c.
struct _emv_tag unknown_soldier [static] |
{
.t_tag = 0x00,
.t_type = EMV_DATA_ATOMIC | EMV_DATA_BINARY,
.t_label = "UNKNOWN",
}
Definition at line 14 of file emv_data.c.
1.6.3