ITS
ber_decoder.c File Reference
#include <asn_internal.h>
Include dependency graph for ber_decoder.c:

Go to the source code of this file.

Macros

#define ADVANCE(num_bytes)
 
#define RETURN(_code)
 

Functions

asn_dec_rval_t ber_decode (asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *type_descriptor, void **struct_ptr, const void *ptr, size_t size)
 
asn_dec_rval_t ber_check_tags (asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx, const void *ptr, size_t size, int tag_mode, int last_tag_form, ber_tlv_len_t *last_length, int *opt_tlv_form)
 

Macro Definition Documentation

◆ ADVANCE

#define ADVANCE (   num_bytes)
Value:
do { \
size_t num = num_bytes; \
ptr = ((const char *)ptr) + num; \
size -= num; \
consumed_myself += num; \
} while(0)

Definition at line 8 of file ber_decoder.c.

Referenced by ber_check_tags().

◆ RETURN

#define RETURN (   _code)
Value:
do { \
asn_dec_rval_t rval; \
rval.code = _code; \
if(opt_ctx) opt_ctx->step = step; /* Save context */ \
if(_code == RC_OK || opt_ctx) \
rval.consumed = consumed_myself; \
else \
rval.consumed = 0; /* Context-free */ \
return rval; \
} while(0)

Definition at line 15 of file ber_decoder.c.

Referenced by ber_check_tags().

Function Documentation

◆ ber_check_tags()

asn_dec_rval_t ber_check_tags ( asn_codec_ctx_t opt_codec_ctx,
asn_TYPE_descriptor_t td,
asn_struct_ctx_t opt_ctx,
const void *  ptr,
size_t  size,
int  tag_mode,
int  last_tag_form,
ber_tlv_len_t last_length,
int *  opt_tlv_form 
)

Definition at line 65 of file ber_decoder.c.

References _ASN_STACK_OVERFLOW_CHECK(), ADVANCE, ASN_DEBUG(), ber_fetch_length(), ber_fetch_tag(), BER_TLV_CONSTRUCTED, ber_tlv_tag_string(), asn_TYPE_descriptor_s::name, RC_FAIL, RC_OK, RC_WMORE, RETURN, asn_struct_ctx_s::step, asn_TYPE_descriptor_s::tags, and asn_TYPE_descriptor_s::tags_count.

Referenced by ber_decode_primitive(), BOOLEAN_decode_ber(), CHOICE_decode_ber(), NativeInteger_decode_ber(), OCTET_STRING_decode_ber(), SEQUENCE_decode_ber(), and SET_OF_decode_ber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ber_decode()

asn_dec_rval_t ber_decode ( asn_codec_ctx_t opt_codec_ctx,
asn_TYPE_descriptor_t type_descriptor,
void **  struct_ptr,
const void *  ptr,
size_t  size 
)