libisdn
asn1.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <ctype.h>
#include "asn1.h"
#include "asn1_common.h"
#include "asn1_log.h"
#include "asn1_types.h"
#include "asn1_list.h"
#include "asn1_codec_ber.h"

Go to the source code of this file.

Data Structures

struct  asn1_level_ref

Defines

#define ASN1_CANARIES   1
#define ASN1_CANARY   { 0xde, 0xad, 0xbe, 0xef }

Functions

void * _asn1_malloc (const long size)
void ____asn1_ptr_check (const char *file, const int line, void *obj)
void _asn1_free (void *obj)
int asn1_set_add (struct asn1_set *set, struct asn1_object *elem)
int asn1_encode (const struct asn1_tree *tree, char *output, int *size)
int asn1_decode (struct asn1_tree *tree, const char *input, const int size)
struct asn1_treeasn1_create (void)
int asn1_destroy (struct asn1_tree *tree)
int asn1_print (struct asn1_tree *tree, FILE *fp)

Define Documentation

#define ASN1_CANARIES   1

Definition at line 29 of file asn1.c.

#define ASN1_CANARY   { 0xde, 0xad, 0xbe, 0xef }

Definition at line 40 of file asn1.c.


Function Documentation

void ____asn1_ptr_check ( const char *  file,
const int  line,
void *  obj 
)
void _asn1_free ( void *  obj)

Definition at line 100 of file asn1.c.

References ARRAY_SIZE, asn1_debug(), and asn1_error().

void* _asn1_malloc ( const long  size)

Definition at line 47 of file asn1.c.

References ARRAY_SIZE, and asn1_debug().

struct asn1_tree* asn1_create ( void  ) [read]

Create new empty ASN.1 tree object

Returns:
new tree object on success, NULL on error

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_destroy ( struct asn1_tree tree)

Free tree structure (recursively)

Parameters:
[in]treeASN.1 tree to release
Returns:
0 on success, -1 on error

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_set_add ( struct asn1_set set,
struct asn1_object elem 
)

Add value to set

Definition at line 133 of file asn1.c.