libisdn
|
Go to the source code of this file.
#define ASN1_MAXDEPTH 10 |
#define ASN1_MINSIZE 2 |
enum asn1_class_t |
enum asn1_codec_t |
enum asn1_loglevel_t |
enum asn1_type_t |
ASN.1 primitives
const char* asn1_class_name | ( | const asn1_class_t | id | ) |
Definition at line 24 of file asn1_types.c.
References ASN1_CLASS_PRIVATE, and id.
Referenced by ____asn1_ptr_check(), and asn1_print().
struct asn1_tree* asn1_create | ( | void | ) | [read] |
Create new empty ASN.1 tree object
Definition at line 597 of file asn1.c.
References ASN1_CODEC_BER, ASN1_INIT_HEAD, asn1_set_codec_by_id(), and asn1_tree::root.
int asn1_decode | ( | struct asn1_tree * | tree, |
const char * | input, | ||
const int | size | ||
) |
Decode binary ASN.1 into tree structure
[out] | tree | ASN.1 tree to encode |
[in] | input | Input buffer |
[in] | size | Size of input in bytes |
Definition at line 418 of file asn1.c.
References __asn1_ptr_check, ASN1_CLASS_UNIVERSAL, asn1_debug(), asn1_eq_type(), asn1_error(), ASN1_INIT_HEAD, ASN1_MINSIZE, asn1_trace(), ASN1_TYPE_BIT_STRING, ASN1_TYPE_BOOLEAN, ASN1_TYPE_ENUMERATED, ASN1_TYPE_EOC, ASN1_TYPE_IA5_STRING, ASN1_TYPE_INTEGER, asn1_type_name(), ASN1_TYPE_NUMERIC_STRING, ASN1_TYPE_OCTET_STRING, ASN1_TYPE_OID, ASN1_TYPE_REAL, ASN1_TYPE_UTF8_STRING, asn1_header::asn_class, asn1_header::asn_complex, asn1_header::asn_type, asn1_complex::children, asn1_tree::codec, asn1_buffer::data, asn1_codec::decode_header, asn1_codec::decode_value, MAX, asn1_codec::name, asn1_buffer::offset, asn1_level_ref::offset, asn1_level_ref::ptr, asn1_tree::root, asn1_object::siblings, asn1_header::size, asn1_buffer::size, and asn1_level_ref::size.
int asn1_destroy | ( | struct asn1_tree * | tree | ) |
Free tree structure (recursively)
[in] | tree | ASN.1 tree to release |
Definition at line 611 of file asn1.c.
References __asn1_ptr_check, asn1_free, asn1_header::asn_complex, container_of, asn1_object::hdr, asn1_list::next, asn1_tree::root, and asn1_object::siblings.
int asn1_encode | ( | const struct asn1_tree * | tree, |
char * | output, | ||
int * | size | ||
) |
Encode ASN.1 tree to binary
[in] | tree | ASN.1 tree to encode |
[out] | output | Output buffer |
size | Size of output buffer, number of encoded bytes |
Definition at line 207 of file asn1.c.
References __asn1_ptr_check, ASN1_CLASS_UNIVERSAL, asn1_debug(), asn1_error(), asn1_trace(), ASN1_TYPE_BIT_STRING, ASN1_TYPE_BOOLEAN, ASN1_TYPE_ENUMERATED, ASN1_TYPE_IA5_STRING, ASN1_TYPE_INTEGER, ASN1_TYPE_NUMERIC_STRING, ASN1_TYPE_OCTET_STRING, ASN1_TYPE_OID, ASN1_TYPE_REAL, ASN1_TYPE_UTF8_STRING, asn1_header::asn_class, asn1_header::asn_complex, asn1_header::asn_type, asn1_tree::codec, container_of, asn1_buffer::data, asn1_codec::encode_header, asn1_codec::encode_value, asn1_object::hdr, asn1_codec::header_size, asn1_codec::name, asn1_buffer::offset, asn1_level_ref::offset, asn1_level_ref::ptr, asn1_tree::root, asn1_header::size, asn1_buffer::size, and asn1_level_ref::size.
int asn1_eq_class | ( | const struct asn1_object * | elem, |
const asn1_class_t | asn_class | ||
) |
Definition at line 97 of file asn1_types.c.
References asn1_header::asn_class, and asn1_object::hdr.
int asn1_eq_type | ( | const struct asn1_object * | elem, |
const asn1_type_t | asn_type | ||
) |
Definition at line 102 of file asn1_types.c.
References asn1_header::asn_type, and asn1_object::hdr.
Referenced by asn1_decode().
int asn1_get_class | ( | const struct asn1_object * | elem | ) |
Definition at line 82 of file asn1_types.c.
References asn1_header::asn_class, and asn1_object::hdr.
Referenced by ____asn1_ptr_check(), and asn1_print().
asn1_codec_t asn1_get_codec_id | ( | const struct asn1_tree * | tree | ) |
Definition at line 40 of file asn1_codec.c.
References ASN1_CODEC_NONE, asn1_tree::codec, and asn1_codec::id.
const char* asn1_get_codec_name | ( | const struct asn1_tree * | tree | ) |
Definition at line 32 of file asn1_codec.c.
References asn1_tree::codec, and asn1_codec::name.
int asn1_get_size | ( | const struct asn1_object * | elem | ) |
Definition at line 92 of file asn1_types.c.
References asn1_object::hdr, and asn1_header::size.
int asn1_get_type | ( | const struct asn1_object * | elem | ) |
Definition at line 87 of file asn1_types.c.
References asn1_header::asn_type, and asn1_object::hdr.
Referenced by ____asn1_ptr_check(), and asn1_print().
int asn1_print | ( | struct asn1_tree * | tree, |
FILE * | fp | ||
) |
Dump tree on file handle
[in] | tree | ASN.1 tree |
[in] | fp | File handle to dump tree to |
Definition at line 654 of file asn1.c.
References __asn1_ptr_check, asn1_class_name(), ASN1_CLASS_UNIVERSAL, asn1_error(), asn1_get_class(), asn1_get_type(), ASN1_MAXDEPTH, asn1_trace(), ASN1_TYPE_BIT_STRING, ASN1_TYPE_BOOLEAN, ASN1_TYPE_ENUMERATED, ASN1_TYPE_EOC, ASN1_TYPE_IA5_STRING, ASN1_TYPE_INTEGER, asn1_type_name(), ASN1_TYPE_NUMERIC_STRING, ASN1_TYPE_OCTET_STRING, ASN1_TYPE_OID, ASN1_TYPE_SEQUENCE, ASN1_TYPE_SET, ASN1_TYPE_UTF8_STRING, asn1_header::asn_class, asn1_header::asn_complex, asn1_header::asn_type, container_of, asn1_object::hdr, HEX_INT8_FMT, asn1_oid::length, asn1_tree::root, asn1_object::siblings, asn1_string::siblings, asn1_header::size, asn1_boolean::value, asn1_string::value, asn1_integer::value, asn1_oid::value, and asn1_enumerated::value.
int asn1_set_codec_by_id | ( | struct asn1_tree * | tree, |
const asn1_codec_t | id | ||
) |
Definition at line 62 of file asn1_codec.c.
References ARRAY_SIZE, ASN1_CODEC_MAX, and asn1_tree::codec.
Referenced by asn1_create().
int asn1_set_codec_by_name | ( | struct asn1_tree * | tree, |
const char * | name | ||
) |
Definition at line 48 of file asn1_codec.c.
References ARRAY_SIZE, and asn1_tree::codec.
const char* asn1_type_name | ( | const asn1_type_t | id | ) |
Definition at line 67 of file asn1_types.c.
References ARRAY_SIZE, and ASN1_TYPE_BMP_STRING.
Referenced by ____asn1_ptr_check(), asn1_decode(), and asn1_print().