src/ber.c File Reference

#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <ber.h>
Include dependency graph for ber.c:

Go to the source code of this file.

Functions

static void hex_dump (const uint8_t *tmp, size_t len, size_t llen, unsigned int depth)
static unsigned int ber_id_octet_constructed (const uint8_t cls)
static unsigned int ber_id_octet_tag (const uint8_t cls)
static unsigned int ber_len_form_short (const uint8_t cls)
static unsigned int ber_len_short (const uint8_t cls)
void ber_dump (const uint8_t *buf, size_t len, unsigned int depth)
static int tag_cmp (const struct ber_tag *tag, const uint8_t *idb, size_t len)
static struct ber_tagfind_tag (const struct ber_tag *tags, unsigned int num_tags, const uint8_t *idb, size_t tag_len)
static const uint8_t * decode_tag (const uint8_t **ptr, const uint8_t *end, size_t *tag_len)
size_t ber_tag_len (const uint8_t *ptr, const uint8_t *end)
const uint8_t * ber_decode_tag (const uint8_t **ptr, const uint8_t *end, size_t *tag_len)
static size_t decode_len (const uint8_t **ptr, const uint8_t *end)
size_t ber_decode_len (const uint8_t **ptr, const uint8_t *end)
int ber_decode (const struct ber_tag *tags, unsigned int num_tags, const uint8_t *ptr, size_t len, void *priv)

Function Documentation

int ber_decode ( const struct ber_tag tags,
unsigned int  num_tags,
const uint8_t *  ptr,
size_t  len,
void *  priv 
)

Definition at line 252 of file ber.c.

References decode_len(), decode_tag(), find_tag(), hex_dump(), ber_tag::op, ber_tag::tag, and ber_tag::tag_len.

Referenced by add_app(), atc(), bop_dtemp(), bop_fci(), bop_fci2(), bop_psd(), get_aip(), ptc(), and set_app().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t ber_decode_len ( const uint8_t **  ptr,
const uint8_t *  end 
)

Definition at line 247 of file ber.c.

References decode_len().

Referenced by composite(), and decode_record().

Here is the call graph for this function:

Here is the caller graph for this function:

const uint8_t* ber_decode_tag ( const uint8_t **  ptr,
const uint8_t *  end,
size_t *  tag_len 
)

Definition at line 211 of file ber.c.

References decode_tag().

Referenced by composite().

Here is the call graph for this function:

Here is the caller graph for this function:

void ber_dump ( const uint8_t *  buf,
size_t  len,
unsigned int  depth 
)

Definition at line 70 of file ber.c.

References ber_dump(), ber_id_octet_constructed(), ber_id_octet_tag(), ber_len_form_short(), ber_len_short(), and hex_dump().

Referenced by ber_dump(), and cp_ber_dump().

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned int ber_id_octet_constructed ( const uint8_t  cls  )  [static]

Definition at line 50 of file ber.c.

Referenced by ber_dump().

Here is the caller graph for this function:

static unsigned int ber_id_octet_tag ( const uint8_t  cls  )  [static]

Definition at line 55 of file ber.c.

Referenced by ber_dump(), and decode_tag().

Here is the caller graph for this function:

static unsigned int ber_len_form_short ( const uint8_t  cls  )  [static]

Definition at line 60 of file ber.c.

Referenced by ber_dump(), and decode_len().

Here is the caller graph for this function:

static unsigned int ber_len_short ( const uint8_t  cls  )  [static]

Definition at line 65 of file ber.c.

Referenced by ber_dump(), and decode_len().

Here is the caller graph for this function:

size_t ber_tag_len ( const uint8_t *  ptr,
const uint8_t *  end 
)

Definition at line 203 of file ber.c.

References decode_tag().

Referenced by construct_dol().

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t decode_len ( const uint8_t **  ptr,
const uint8_t *  end 
) [static]

Definition at line 218 of file ber.c.

References ber_len_form_short(), and ber_len_short().

Referenced by ber_decode(), and ber_decode_len().

Here is the call graph for this function:

Here is the caller graph for this function:

static const uint8_t* decode_tag ( const uint8_t **  ptr,
const uint8_t *  end,
size_t *  tag_len 
) [static]

Definition at line 175 of file ber.c.

References ber_id_octet_tag().

Referenced by ber_decode(), ber_decode_tag(), and ber_tag_len().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct ber_tag* find_tag ( const struct ber_tag tags,
unsigned int  num_tags,
const uint8_t *  idb,
size_t  tag_len 
) [static, read]

Definition at line 152 of file ber.c.

References cmp(), and tag_cmp().

Referenced by ber_decode(), and construct_dol().

Here is the call graph for this function:

Here is the caller graph for this function:

static void hex_dump ( const uint8_t *  tmp,
size_t  len,
size_t  llen,
unsigned int  depth 
) [static]

Definition at line 9 of file ber.c.

Referenced by ber_decode(), ber_dump(), check_ssa(), cp_gen_ac(), cp_hex_dump(), make_issuer_pk(), set_df_fci(), set_ef_fci(), and sim_new().

Here is the caller graph for this function:

static int tag_cmp ( const struct ber_tag tag,
const uint8_t *  idb,
size_t  len 
) [static]

Definition at line 143 of file ber.c.

References ber_tag::tag, and ber_tag::tag_len.

Referenced by find_tag().

Here is the caller graph for this function:

Generated on Sun Jan 2 08:34:52 2011 for ccid-utils by  doxygen 1.6.3