src/emv_data.c File Reference

#include <ccid.h>
#include <list.h>
#include <emv.h>
#include <ber.h>
#include <ctype.h>
#include "emv-internal.h"
Include dependency graph for emv_data.c:

Go to the source code of this file.

Data Structures

struct  db_state

Functions

static struct _emv_tagfind_tag (uint16_t id)
static struct _emv_datafind_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_temv_data_children (emv_data_t d, unsigned int *nmemb)
emv_data_temv_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)

Function Documentation

struct _emv_data* _emv_retrieve_data ( emv_t  e,
uint16_t  id 
) [read]

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void add_elements ( struct _emv_data **  d,
size_t  num,
struct _emv_data ***  db 
) [static]

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

static int composite ( emv_t  e,
struct _emv_data d 
) [static]
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static int decode_record ( struct db_state s,
const uint8_t *  ptr,
size_t  len,
int  sda 
) [static]
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int emv_read_app_data ( struct _emv e  ) 
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().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const unsigned int num_tags = sizeof(tags)/sizeof(*tags) [static]

Definition at line 123 of file emv_data.c.

Referenced by composite(), find_data(), and find_tag().

struct _emv_tag tags[] [static]

Definition at line 20 of file emv_data.c.

struct _emv_tag unknown_soldier [static]
Initial value:
 {
        .t_tag = 0x00,
        .t_type = EMV_DATA_ATOMIC | EMV_DATA_BINARY,
        .t_label = "UNKNOWN",
}

Definition at line 14 of file emv_data.c.

Generated on Sun Jan 2 08:35:28 2011 for ccid-utils by  doxygen 1.6.3