Commit afbf2a98 authored by Lev Walkin's avatar Lev Walkin

add const

parent 9dc9f67a
...@@ -771,7 +771,7 @@ decode_tlv_from_string(const char *datastring) { ...@@ -771,7 +771,7 @@ decode_tlv_from_string(const char *datastring) {
* Dummy functions. * Dummy functions.
*/ */
asn_dec_rval_t asn_dec_rval_t
ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ber_check_tags(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
asn_struct_ctx_t *opt_ctx, const void *ptr, size_t size, 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 tag_mode, int last_tag_form, ber_tlv_len_t *last_length,
int *opt_tlv_form) { int *opt_tlv_form) {
...@@ -803,7 +803,7 @@ der_write_tags(asn_TYPE_descriptor_t *td, size_t slen, int tag_mode, ...@@ -803,7 +803,7 @@ der_write_tags(asn_TYPE_descriptor_t *td, size_t slen, int tag_mode,
} }
asn_dec_rval_t asn_dec_rval_t
xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx,
void *struct_key, const char *xml_tag, const void *buf_ptr, void *struct_key, const char *xml_tag, const void *buf_ptr,
size_t size, size_t size,
int (*otd)(void *struct_key, const void *chunk_buf, int (*otd)(void *struct_key, const void *chunk_buf,
......
...@@ -184,7 +184,7 @@ static int ANY__consume_bytes(const void *buffer, size_t size, void *key) { ...@@ -184,7 +184,7 @@ static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
#ifndef ASN_DISABLE_PER_SUPPORT #ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
ANY_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
asn_OCTET_STRING_specifics_t *specs = asn_OCTET_STRING_specifics_t *specs =
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <errno.h> #include <errno.h>
asn_dec_rval_t asn_dec_rval_t
BIT_STRING_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr, const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) { const void *ptr, size_t size) {
BIT_STRING_t *st = (BIT_STRING_t *)*sptr; BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
......
...@@ -128,7 +128,7 @@ BMPString__dump(const BMPString_t *st, ...@@ -128,7 +128,7 @@ BMPString__dump(const BMPString_t *st,
} }
asn_dec_rval_t asn_dec_rval_t
BMPString_decode_xer(asn_codec_ctx_t *opt_codec_ctx, BMPString_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const char *opt_mname, const void *buf_ptr, size_t size) {
asn_dec_rval_t rc; asn_dec_rval_t rc;
......
...@@ -55,7 +55,7 @@ asn_TYPE_descriptor_t asn_DEF_BOOLEAN = { ...@@ -55,7 +55,7 @@ asn_TYPE_descriptor_t asn_DEF_BOOLEAN = {
* Decode BOOLEAN type. * Decode BOOLEAN type.
*/ */
asn_dec_rval_t asn_dec_rval_t
BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx, BOOLEAN_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void **bool_value, const void *buf_ptr, size_t size, void **bool_value, const void *buf_ptr, size_t size,
int tag_mode) { int tag_mode) {
...@@ -184,7 +184,7 @@ BOOLEAN__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun ...@@ -184,7 +184,7 @@ BOOLEAN__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun
asn_dec_rval_t asn_dec_rval_t
BOOLEAN_decode_xer(asn_codec_ctx_t *opt_codec_ctx, BOOLEAN_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
...@@ -262,7 +262,7 @@ BOOLEAN_free(const asn_TYPE_descriptor_t *td, void *ptr, ...@@ -262,7 +262,7 @@ BOOLEAN_free(const asn_TYPE_descriptor_t *td, void *ptr,
} }
asn_dec_rval_t asn_dec_rval_t
BOOLEAN_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, BOOLEAN_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
asn_dec_rval_t rv; asn_dec_rval_t rv;
......
...@@ -54,7 +54,7 @@ asn_TYPE_descriptor_t asn_DEF_ENUMERATED = { ...@@ -54,7 +54,7 @@ asn_TYPE_descriptor_t asn_DEF_ENUMERATED = {
}; };
asn_dec_rval_t asn_dec_rval_t
ENUMERATED_decode_uper(asn_codec_ctx_t *opt_codec_ctx, ENUMERATED_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
......
...@@ -541,7 +541,7 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun ...@@ -541,7 +541,7 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun
} }
asn_dec_rval_t asn_dec_rval_t
INTEGER_decode_xer(asn_codec_ctx_t *opt_codec_ctx, INTEGER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
...@@ -572,7 +572,7 @@ INTEGER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, ...@@ -572,7 +572,7 @@ INTEGER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
#ifndef ASN_DISABLE_PER_SUPPORT #ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
INTEGER_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
const asn_INTEGER_specifics_t *specs = const asn_INTEGER_specifics_t *specs =
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <errno.h> #include <errno.h>
asn_dec_rval_t asn_dec_rval_t
INTEGER_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr, const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) { const void *ptr, size_t size) {
const asn_INTEGER_specifics_t *specs = const asn_INTEGER_specifics_t *specs =
......
...@@ -102,7 +102,7 @@ NULL__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_b ...@@ -102,7 +102,7 @@ NULL__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_b
} }
asn_dec_rval_t asn_dec_rval_t
NULL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, NULL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
...@@ -136,7 +136,7 @@ NULL_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, ...@@ -136,7 +136,7 @@ NULL_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
#ifndef ASN_DISABLE_OER_SUPPORT #ifndef ASN_DISABLE_OER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
NULL_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, NULL_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **struct_ptr, const asn_oer_constraints_t *constraints, void **struct_ptr,
const void *ptr, size_t size) { const void *ptr, size_t size) {
asn_dec_rval_t rv = {RC_OK, 0}; asn_dec_rval_t rv = {RC_OK, 0};
...@@ -171,7 +171,7 @@ NULL_encode_oer(asn_TYPE_descriptor_t *td, ...@@ -171,7 +171,7 @@ NULL_encode_oer(asn_TYPE_descriptor_t *td,
#ifndef ASN_DISABLE_PER_SUPPORT #ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
NULL_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, NULL_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
asn_dec_rval_t rv; asn_dec_rval_t rv;
......
...@@ -89,7 +89,7 @@ NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, ...@@ -89,7 +89,7 @@ NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
} }
asn_dec_rval_t asn_dec_rval_t
NativeEnumerated_decode_uper(asn_codec_ctx_t *opt_codec_ctx, NativeEnumerated_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, const asn_per_constraints_t *constraints, asn_TYPE_descriptor_t *td, const asn_per_constraints_t *constraints,
void **sptr, asn_per_data_t *pd) { void **sptr, asn_per_data_t *pd) {
const asn_INTEGER_specifics_t *specs = const asn_INTEGER_specifics_t *specs =
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <errno.h> #include <errno.h>
asn_dec_rval_t asn_dec_rval_t
NativeEnumerated_decode_oer(asn_codec_ctx_t *opt_codec_ctx, NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, const asn_oer_constraints_t *constraints,
void **nint_ptr, const void *ptr, size_t size) { void **nint_ptr, const void *ptr, size_t size) {
......
...@@ -62,7 +62,7 @@ asn_TYPE_descriptor_t asn_DEF_NativeInteger = { ...@@ -62,7 +62,7 @@ asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
* Decode INTEGER type. * Decode INTEGER type.
*/ */
asn_dec_rval_t asn_dec_rval_t
NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, NativeInteger_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) { void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) {
const asn_INTEGER_specifics_t *specs = const asn_INTEGER_specifics_t *specs =
...@@ -185,7 +185,7 @@ NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, ...@@ -185,7 +185,7 @@ NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr,
* Decode the chunk of XML text encoding INTEGER. * Decode the chunk of XML text encoding INTEGER.
*/ */
asn_dec_rval_t asn_dec_rval_t
NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, NativeInteger_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
const asn_INTEGER_specifics_t *specs = const asn_INTEGER_specifics_t *specs =
...@@ -254,7 +254,7 @@ NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, ...@@ -254,7 +254,7 @@ NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
#ifndef ASN_DISABLE_PER_SUPPORT #ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, NativeInteger_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <errno.h> #include <errno.h>
asn_dec_rval_t asn_dec_rval_t
NativeInteger_decode_oer(asn_codec_ctx_t *opt_codec_ctx, NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, const asn_oer_constraints_t *constraints,
void **nint_ptr, const void *ptr, size_t size) { void **nint_ptr, const void *ptr, size_t size) {
......
...@@ -64,7 +64,7 @@ asn_TYPE_descriptor_t asn_DEF_NativeReal = { ...@@ -64,7 +64,7 @@ asn_TYPE_descriptor_t asn_DEF_NativeReal = {
* Decode REAL type. * Decode REAL type.
*/ */
asn_dec_rval_t asn_dec_rval_t
NativeReal_decode_ber(asn_codec_ctx_t *opt_codec_ctx, NativeReal_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void **dbl_ptr, const void *buf_ptr, size_t size, int tag_mode) { void **dbl_ptr, const void *buf_ptr, size_t size, int tag_mode) {
double *Dbl = (double *)*dbl_ptr; double *Dbl = (double *)*dbl_ptr;
...@@ -212,7 +212,7 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr, ...@@ -212,7 +212,7 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
* Decode REAL type using PER. * Decode REAL type using PER.
*/ */
asn_dec_rval_t asn_dec_rval_t
NativeReal_decode_uper(asn_codec_ctx_t *opt_codec_ctx, NativeReal_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **dbl_ptr, const asn_per_constraints_t *constraints, void **dbl_ptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
...@@ -285,7 +285,7 @@ NativeReal_encode_uper(asn_TYPE_descriptor_t *td, ...@@ -285,7 +285,7 @@ NativeReal_encode_uper(asn_TYPE_descriptor_t *td,
* Decode the chunk of XML text encoding REAL. * Decode the chunk of XML text encoding REAL.
*/ */
asn_dec_rval_t asn_dec_rval_t
NativeReal_decode_xer(asn_codec_ctx_t *opt_codec_ctx, NativeReal_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
asn_dec_rval_t rval; asn_dec_rval_t rval;
......
...@@ -327,7 +327,7 @@ OBJECT_IDENTIFIER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const ...@@ -327,7 +327,7 @@ OBJECT_IDENTIFIER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const
} }
asn_dec_rval_t asn_dec_rval_t
OBJECT_IDENTIFIER_decode_xer(asn_codec_ctx_t *opt_codec_ctx, OBJECT_IDENTIFIER_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
......
...@@ -182,7 +182,7 @@ _new_stack(void) { ...@@ -182,7 +182,7 @@ _new_stack(void) {
* Decode OCTET STRING type. * Decode OCTET STRING type.
*/ */
asn_dec_rval_t asn_dec_rval_t
OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void **sptr, const void *buf_ptr, size_t size, int tag_mode) { void **sptr, const void *buf_ptr, size_t size, int tag_mode) {
asn_OCTET_STRING_specifics_t *specs = td->specifics asn_OCTET_STRING_specifics_t *specs = td->specifics
...@@ -1115,7 +1115,7 @@ static ssize_t OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf, ...@@ -1115,7 +1115,7 @@ static ssize_t OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf,
* Decode OCTET STRING from the XML element's body. * Decode OCTET STRING from the XML element's body.
*/ */
static asn_dec_rval_t static asn_dec_rval_t
OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING__decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size, const char *opt_mname, const void *buf_ptr, size_t size,
int (*opt_unexpected_tag_decoder) int (*opt_unexpected_tag_decoder)
...@@ -1175,7 +1175,7 @@ sta_failed: ...@@ -1175,7 +1175,7 @@ sta_failed:
* Decode OCTET STRING from the hexadecimal data. * Decode OCTET STRING from the hexadecimal data.
*/ */
asn_dec_rval_t asn_dec_rval_t
OCTET_STRING_decode_xer_hex(asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING_decode_xer_hex(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const char *opt_mname, const void *buf_ptr, size_t size) {
return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
...@@ -1186,7 +1186,7 @@ OCTET_STRING_decode_xer_hex(asn_codec_ctx_t *opt_codec_ctx, ...@@ -1186,7 +1186,7 @@ OCTET_STRING_decode_xer_hex(asn_codec_ctx_t *opt_codec_ctx,
* Decode OCTET STRING from the binary (0/1) data. * Decode OCTET STRING from the binary (0/1) data.
*/ */
asn_dec_rval_t asn_dec_rval_t
OCTET_STRING_decode_xer_binary(asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING_decode_xer_binary(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const char *opt_mname, const void *buf_ptr, size_t size) {
return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
...@@ -1197,7 +1197,7 @@ OCTET_STRING_decode_xer_binary(asn_codec_ctx_t *opt_codec_ctx, ...@@ -1197,7 +1197,7 @@ OCTET_STRING_decode_xer_binary(asn_codec_ctx_t *opt_codec_ctx,
* Decode OCTET STRING from the string (ASCII/UTF-8) data. * Decode OCTET STRING from the string (ASCII/UTF-8) data.
*/ */
asn_dec_rval_t asn_dec_rval_t
OCTET_STRING_decode_xer_utf8(asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING_decode_xer_utf8(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const char *opt_mname, const void *buf_ptr, size_t size) {
return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname,
...@@ -1338,7 +1338,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf, ...@@ -1338,7 +1338,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
#ifndef ASN_DISABLE_PER_SUPPORT #ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <errno.h> #include <errno.h>
asn_dec_rval_t asn_dec_rval_t
OCTET_STRING_decode_oer(asn_codec_ctx_t *opt_codec_ctx, OCTET_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr, const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) { const void *ptr, size_t size) {
......
...@@ -36,7 +36,7 @@ asn_TYPE_operation_t asn_OP_OPEN_TYPE = { ...@@ -36,7 +36,7 @@ asn_TYPE_operation_t asn_OP_OPEN_TYPE = {
} while(0) } while(0)
asn_dec_rval_t asn_dec_rval_t
OPEN_TYPE_ber_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void *sptr, asn_TYPE_member_t *elm, const void *ptr, void *sptr, asn_TYPE_member_t *elm, const void *ptr,
size_t size) { size_t size) {
size_t consumed_myself = 0; size_t consumed_myself = 0;
...@@ -120,7 +120,7 @@ OPEN_TYPE_ber_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -120,7 +120,7 @@ OPEN_TYPE_ber_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
} }
asn_dec_rval_t asn_dec_rval_t
OPEN_TYPE_xer_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void *sptr, asn_TYPE_member_t *elm, const void *ptr, void *sptr, asn_TYPE_member_t *elm, const void *ptr,
size_t size) { size_t size) {
size_t consumed_myself = 0; size_t consumed_myself = 0;
...@@ -283,7 +283,7 @@ OPEN_TYPE_xer_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -283,7 +283,7 @@ OPEN_TYPE_xer_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
#ifndef ASN_DISABLE_PER_SUPPORT #ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
OPEN_TYPE_uper_get(asn_codec_ctx_t *opt_codec_ctx, OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void *sptr, asn_TYPE_descriptor_t *td, void *sptr,
asn_TYPE_member_t *elm, asn_per_data_t *pd) { asn_TYPE_member_t *elm, asn_per_data_t *pd) {
asn_type_selector_result_t selected; asn_type_selector_result_t selected;
......
...@@ -27,25 +27,25 @@ extern asn_TYPE_operation_t asn_OP_OPEN_TYPE; ...@@ -27,25 +27,25 @@ extern asn_TYPE_operation_t asn_OP_OPEN_TYPE;
* Decode an Open Type which is potentially constraiend * Decode an Open Type which is potentially constraiend
* by the other members of the parent structure. * by the other members of the parent structure.
*/ */
asn_dec_rval_t OPEN_TYPE_ber_get(asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t OPEN_TYPE_ber_get(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *parent_type, asn_TYPE_descriptor_t *parent_type,
void *parent_structure, void *parent_structure,
asn_TYPE_member_t *element, const void *ptr, asn_TYPE_member_t *element, const void *ptr,
size_t size); size_t size);
asn_dec_rval_t OPEN_TYPE_xer_get(asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t OPEN_TYPE_xer_get(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *parent_type, asn_TYPE_descriptor_t *parent_type,
void *parent_structure, void *parent_structure,
asn_TYPE_member_t *element, const void *ptr, asn_TYPE_member_t *element, const void *ptr,
size_t size); size_t size);
asn_dec_rval_t OPEN_TYPE_oer_get(asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *parent_type, asn_TYPE_descriptor_t *parent_type,
void *parent_structure, void *parent_structure,
asn_TYPE_member_t *element, asn_TYPE_member_t *element,
const void *ptr, size_t size); const void *ptr, size_t size);
asn_dec_rval_t OPEN_TYPE_uper_get(asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t OPEN_TYPE_uper_get(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *parent_type, asn_TYPE_descriptor_t *parent_type,
void *parent_structure, void *parent_structure,
asn_TYPE_member_t *element, asn_TYPE_member_t *element,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <errno.h> #include <errno.h>
asn_dec_rval_t asn_dec_rval_t
OPEN_TYPE_oer_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, OPEN_TYPE_oer_get(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void *sptr, asn_TYPE_member_t *elm, const void *ptr, void *sptr, asn_TYPE_member_t *elm, const void *ptr,
size_t size) { size_t size) {
asn_type_selector_result_t selected; asn_type_selector_result_t selected;
......
...@@ -429,7 +429,7 @@ REAL__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_b ...@@ -429,7 +429,7 @@ REAL__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_b
} }
asn_dec_rval_t asn_dec_rval_t
REAL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, REAL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
...@@ -805,7 +805,7 @@ asn_double2REAL(REAL_t *st, double dbl_value) { ...@@ -805,7 +805,7 @@ asn_double2REAL(REAL_t *st, double dbl_value) {
#ifndef ASN_DISABLE_PER_SUPPORT #ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
REAL_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, REAL_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
(void)constraints; /* No PER visible constraints */ (void)constraints; /* No PER visible constraints */
......
...@@ -150,7 +150,7 @@ RELATIVE_OID__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void ...@@ -150,7 +150,7 @@ RELATIVE_OID__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void
} }
asn_dec_rval_t asn_dec_rval_t
RELATIVE_OID_decode_xer(asn_codec_ctx_t *opt_codec_ctx, RELATIVE_OID_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
......
...@@ -146,7 +146,7 @@ UniversalString__dump(const UniversalString_t *st, ...@@ -146,7 +146,7 @@ UniversalString__dump(const UniversalString_t *st,
} }
asn_dec_rval_t asn_dec_rval_t
UniversalString_decode_xer(asn_codec_ctx_t *opt_codec_ctx, UniversalString_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, void **sptr, asn_TYPE_descriptor_t *td, void **sptr,
const char *opt_mname, const void *buf_ptr, size_t size) { const char *opt_mname, const void *buf_ptr, size_t size) {
asn_dec_rval_t rc; asn_dec_rval_t rc;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <errno.h> #include <errno.h>
static asn_enc_rval_t asn_encode_internal( static asn_enc_rval_t asn_encode_internal(
const asn_codec_ctx_t *opt_codec_parameters, const asn_codec_ctx_t *opt_codec_ctx,
enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td, enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td,
void *sptr, asn_app_consume_bytes_f *callback, void *callback_key); void *sptr, asn_app_consume_bytes_f *callback, void *callback_key);
...@@ -85,7 +85,7 @@ callback_failure_catch_cb(const void *data, size_t size, void *keyp) { ...@@ -85,7 +85,7 @@ callback_failure_catch_cb(const void *data, size_t size, void *keyp) {
} }
asn_enc_rval_t asn_enc_rval_t
asn_encode(const asn_codec_ctx_t *opt_codec_parameters, asn_encode(const asn_codec_ctx_t *opt_codec_ctx,
enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td, enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td,
void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) { void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) {
struct callback_failure_catch_key cb_key; struct callback_failure_catch_key cb_key;
...@@ -100,7 +100,7 @@ asn_encode(const asn_codec_ctx_t *opt_codec_parameters, ...@@ -100,7 +100,7 @@ asn_encode(const asn_codec_ctx_t *opt_codec_parameters,
cb_key.callback_key = callback_key; cb_key.callback_key = callback_key;
cb_key.callback_failed = 0; cb_key.callback_failed = 0;
er = asn_encode_internal(opt_codec_parameters, syntax, td, sptr, er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
callback_failure_catch_cb, &cb_key); callback_failure_catch_cb, &cb_key);
if(cb_key.callback_failed) { if(cb_key.callback_failed) {
assert(er.encoded == -1); assert(er.encoded == -1);
...@@ -112,7 +112,7 @@ asn_encode(const asn_codec_ctx_t *opt_codec_parameters, ...@@ -112,7 +112,7 @@ asn_encode(const asn_codec_ctx_t *opt_codec_parameters,
} }
asn_enc_rval_t asn_enc_rval_t
asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_parameters, asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_ctx,
enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td, enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td,
void *sptr, void *buffer, size_t buffer_size) { void *sptr, void *buffer, size_t buffer_size) {
struct overrun_encoder_key buf_key; struct overrun_encoder_key buf_key;
...@@ -127,7 +127,7 @@ asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_parameters, ...@@ -127,7 +127,7 @@ asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_parameters,
buf_key.buffer_size = buffer_size; buf_key.buffer_size = buffer_size;
buf_key.computed_size = 0; buf_key.computed_size = 0;
er = asn_encode_internal(opt_codec_parameters, syntax, td, sptr, er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
overrun_encoder_cb, &buf_key); overrun_encoder_cb, &buf_key);
assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size); assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size);
...@@ -136,14 +136,14 @@ asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_parameters, ...@@ -136,14 +136,14 @@ asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_parameters,
} }
static asn_enc_rval_t static asn_enc_rval_t
asn_encode_internal(const asn_codec_ctx_t *opt_codec_parameters, asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td, enum asn_transfer_syntax syntax, asn_TYPE_descriptor_t *td,
void *sptr, asn_app_consume_bytes_f *callback, void *sptr, asn_app_consume_bytes_f *callback,
void *callback_key) { void *callback_key) {
asn_enc_rval_t er; asn_enc_rval_t er;
enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL; enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL;
(void)opt_codec_parameters; /* Parameters are not checked on encode yet. */ (void)opt_codec_ctx; /* Parameters are not checked on encode yet. */
if(!td || !sptr) { if(!td || !sptr) {
errno = EINVAL; errno = EINVAL;
...@@ -294,13 +294,10 @@ asn_encode_internal(const asn_codec_ctx_t *opt_codec_parameters, ...@@ -294,13 +294,10 @@ asn_encode_internal(const asn_codec_ctx_t *opt_codec_parameters,
} }
asn_dec_rval_t asn_dec_rval_t
asn_decode(const asn_codec_ctx_t *opt_codec_parameters, asn_decode(const asn_codec_ctx_t *opt_codec_ctx,
enum asn_transfer_syntax syntax, struct asn_TYPE_descriptor_s *td, enum asn_transfer_syntax syntax, struct asn_TYPE_descriptor_s *td,
void **sptr, const void *buffer, size_t size) { void **sptr, const void *buffer, size_t size) {
(void)opt_codec_parameters;
asn_codec_ctx_t *opt_ctx = 0;
if(!td || !sptr || (size && !buffer)) { if(!td || !sptr || (size && !buffer)) {
ASN__DECODE_FAILED; ASN__DECODE_FAILED;
} }
...@@ -314,7 +311,7 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters, ...@@ -314,7 +311,7 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters,
case ATS_DER: case ATS_DER:
case ATS_BER: case ATS_BER:
return ber_decode(opt_ctx, td, sptr, buffer, size); return ber_decode(opt_codec_ctx, td, sptr, buffer, size);
case ATS_BASIC_OER: case ATS_BASIC_OER:
case ATS_CANONICAL_OER: case ATS_CANONICAL_OER:
...@@ -322,7 +319,7 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters, ...@@ -322,7 +319,7 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters,
errno = ENOENT; errno = ENOENT;
ASN__DECODE_FAILED; ASN__DECODE_FAILED;
#else #else
return oer_decode(opt_ctx, td, sptr, buffer, size); return oer_decode(opt_codec_ctx, td, sptr, buffer, size);
#endif #endif
case ATS_UNALIGNED_BASIC_PER: case ATS_UNALIGNED_BASIC_PER:
...@@ -331,12 +328,12 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters, ...@@ -331,12 +328,12 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters,
errno = ENOENT; errno = ENOENT;
ASN__DECODE_FAILED; ASN__DECODE_FAILED;
#else #else
return uper_decode_complete(opt_ctx, td, sptr, buffer, size); return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
#endif #endif
case ATS_BASIC_XER: case ATS_BASIC_XER:
case ATS_CANONICAL_XER: case ATS_CANONICAL_XER:
return xer_decode(opt_ctx, td, sptr, buffer, size); return xer_decode(opt_codec_ctx, td, sptr, buffer, size);
} }
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Decode an always-primitive type. * Decode an always-primitive type.
*/ */
asn_dec_rval_t asn_dec_rval_t
ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, ber_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void **sptr, const void *buf_ptr, size_t size, int tag_mode) { void **sptr, const void *buf_ptr, size_t size, int tag_mode) {
ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr; ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr;
...@@ -248,7 +248,7 @@ xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size, ...@@ -248,7 +248,7 @@ xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size,
asn_dec_rval_t asn_dec_rval_t
xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
void **sptr, void **sptr,
size_t struct_size, size_t struct_size,
......
...@@ -38,7 +38,7 @@ typedef enum xer_pbd_rval (xer_primitive_body_decoder_f) ...@@ -38,7 +38,7 @@ typedef enum xer_pbd_rval (xer_primitive_body_decoder_f)
* Specific function to decode simple primitive types. * Specific function to decode simple primitive types.
* Also see xer_decode_general() in xer_decoder.h * Also see xer_decode_general() in xer_decoder.h
*/ */
asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t xer_decode_primitive(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *type_descriptor, asn_TYPE_descriptor_t *type_descriptor,
void **struct_ptr, size_t struct_size, void **struct_ptr, size_t struct_size,
const char *opt_mname, const char *opt_mname,
......
...@@ -108,11 +108,11 @@ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; } ...@@ -108,11 +108,11 @@ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
*/ */
#define ASN__DEFAULT_STACK_MAX (30000) #define ASN__DEFAULT_STACK_MAX (30000)
static int GCC_NOTUSED static int GCC_NOTUSED
ASN__STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) { ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
if(ctx && ctx->max_stack_size) { if(ctx && ctx->max_stack_size) {
/* ctx MUST be allocated on the stack */ /* ctx MUST be allocated on the stack */
ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); ptrdiff_t usedstack = ((const char *)ctx - (const char *)&ctx);
if(usedstack > 0) usedstack = -usedstack; /* grows up! */ if(usedstack > 0) usedstack = -usedstack; /* grows up! */
/* double negative required to avoid int wrap-around */ /* double negative required to avoid int wrap-around */
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* The BER decoder of any type. * The BER decoder of any type.
*/ */
asn_dec_rval_t asn_dec_rval_t
ber_decode(asn_codec_ctx_t *opt_codec_ctx, ber_decode(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *type_descriptor, asn_TYPE_descriptor_t *type_descriptor,
void **struct_ptr, const void *ptr, size_t size) { void **struct_ptr, const void *ptr, size_t size) {
asn_codec_ctx_t s_codec_ctx; asn_codec_ctx_t s_codec_ctx;
...@@ -62,7 +62,7 @@ ber_decode(asn_codec_ctx_t *opt_codec_ctx, ...@@ -62,7 +62,7 @@ ber_decode(asn_codec_ctx_t *opt_codec_ctx,
* Check the set of <TL<TL<TL...>>> tags matches the definition. * Check the set of <TL<TL<TL...>>> tags matches the definition.
*/ */
asn_dec_rval_t asn_dec_rval_t
ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, ber_check_tags(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_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, const void *ptr, size_t size, int tag_mode, int last_tag_form,
ber_tlv_len_t *last_length, int *opt_tlv_form) { ber_tlv_len_t *last_length, int *opt_tlv_form) {
......
...@@ -22,7 +22,7 @@ struct asn_codec_ctx_s; /* Forward declaration */ ...@@ -22,7 +22,7 @@ struct asn_codec_ctx_s; /* Forward declaration */
* NOTE: Use the der_encode() function (der_encoder.h) to produce encoding * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding
* which is compliant with ber_decode(). * which is compliant with ber_decode().
*/ */
asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, asn_dec_rval_t ber_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
struct asn_TYPE_descriptor_s *type_descriptor, struct asn_TYPE_descriptor_s *type_descriptor,
void **struct_ptr, /* Pointer to a target structure's pointer */ void **struct_ptr, /* Pointer to a target structure's pointer */
const void *buffer, /* Data to be decoded */ const void *buffer, /* Data to be decoded */
...@@ -33,7 +33,7 @@ asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, ...@@ -33,7 +33,7 @@ asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx,
* Type of generic function which decodes the byte stream into the structure. * Type of generic function which decodes the byte stream into the structure.
*/ */
typedef asn_dec_rval_t (ber_type_decoder_f)( typedef asn_dec_rval_t (ber_type_decoder_f)(
struct asn_codec_ctx_s *opt_codec_ctx, const struct asn_codec_ctx_s *opt_codec_ctx,
struct asn_TYPE_descriptor_s *type_descriptor, struct asn_TYPE_descriptor_s *type_descriptor,
void **struct_ptr, const void *buf_ptr, size_t size, void **struct_ptr, const void *buf_ptr, size_t size,
int tag_mode); int tag_mode);
...@@ -50,7 +50,7 @@ typedef asn_dec_rval_t (ber_type_decoder_f)( ...@@ -50,7 +50,7 @@ typedef asn_dec_rval_t (ber_type_decoder_f)(
* head->last_tag_form is non-zero. * head->last_tag_form is non-zero.
*/ */
asn_dec_rval_t ber_check_tags( asn_dec_rval_t ber_check_tags(
struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ const struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */
struct asn_TYPE_descriptor_s *type_descriptor, struct asn_TYPE_descriptor_s *type_descriptor,
asn_struct_ctx_t *opt_ctx, /* saved decoding context */ asn_struct_ctx_t *opt_ctx, /* saved decoding context */
const void *ptr, size_t size, const void *ptr, size_t size,
......
...@@ -75,7 +75,7 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, ...@@ -75,7 +75,7 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
} }
ssize_t ssize_t
ber_skip_length(asn_codec_ctx_t *opt_codec_ctx, ber_skip_length(const asn_codec_ctx_t *opt_codec_ctx,
int _is_constructed, const void *ptr, size_t size) { int _is_constructed, const void *ptr, size_t size) {
ber_tlv_len_t vlen; /* Length of V in TLV */ ber_tlv_len_t vlen; /* Length of V in TLV */
ssize_t tl; /* Length of L in TLV */ ssize_t tl; /* Length of L in TLV */
......
...@@ -32,7 +32,7 @@ ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, ...@@ -32,7 +32,7 @@ ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
* Standard {-1,0,>0} convention. * Standard {-1,0,>0} convention.
*/ */
ssize_t ber_skip_length( ssize_t ber_skip_length(
struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ const struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */
int _is_constructed, const void *bufptr, size_t size); int _is_constructed, const void *bufptr, size_t size);
/* /*
......
...@@ -103,7 +103,7 @@ _search4tag(const void *ap, const void *bp) { ...@@ -103,7 +103,7 @@ _search4tag(const void *ap, const void *bp) {
* The decoder of the CHOICE type. * The decoder of the CHOICE type.
*/ */
asn_dec_rval_t asn_dec_rval_t
CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, CHOICE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const void *ptr, size_t size, int tag_mode) { void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
/* /*
* Bring closer parts of structure description. * Bring closer parts of structure description.
...@@ -549,7 +549,7 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, ...@@ -549,7 +549,7 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
* Decode the XER (XML) data. * Decode the XER (XML) data.
*/ */
asn_dec_rval_t asn_dec_rval_t
CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, CHOICE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const char *opt_mname, void **struct_ptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
/* /*
...@@ -830,7 +830,7 @@ cb_failed: ...@@ -830,7 +830,7 @@ cb_failed:
} }
asn_dec_rval_t asn_dec_rval_t
CHOICE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, CHOICE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
......
...@@ -125,7 +125,7 @@ oer_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) { ...@@ -125,7 +125,7 @@ oer_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
} }
asn_dec_rval_t asn_dec_rval_t
CHOICE_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, CHOICE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **struct_ptr, const asn_oer_constraints_t *constraints, void **struct_ptr,
const void *ptr, size_t size) { const void *ptr, size_t size) {
/* /*
......
...@@ -110,7 +110,7 @@ _t2e_cmp(const void *ap, const void *bp) { ...@@ -110,7 +110,7 @@ _t2e_cmp(const void *ap, const void *bp) {
* The decoder of the SEQUENCE type. * The decoder of the SEQUENCE type.
*/ */
asn_dec_rval_t asn_dec_rval_t
SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const void *ptr, size_t size, int tag_mode) { void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
/* /*
* Bring closer parts of structure description. * Bring closer parts of structure description.
...@@ -626,7 +626,7 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td, ...@@ -626,7 +626,7 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
* Decode the XER (XML) data. * Decode the XER (XML) data.
*/ */
asn_dec_rval_t asn_dec_rval_t
SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SEQUENCE_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const char *opt_mname, void **struct_ptr, const char *opt_mname,
const void *ptr, size_t size) { const void *ptr, size_t size) {
/* /*
...@@ -1079,7 +1079,7 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, ...@@ -1079,7 +1079,7 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
#ifndef ASN_DISABLE_PER_SUPPORT #ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t asn_dec_rval_t
SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SEQUENCE_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics; asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
......
...@@ -76,7 +76,7 @@ static void *element_ptr(void *struct_ptr, asn_TYPE_member_t *elm) { ...@@ -76,7 +76,7 @@ static void *element_ptr(void *struct_ptr, asn_TYPE_member_t *elm) {
} }
asn_dec_rval_t asn_dec_rval_t
SEQUENCE_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **struct_ptr, const asn_oer_constraints_t *constraints, void **struct_ptr,
const void *ptr, size_t size) { const void *ptr, size_t size) {
asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics; asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
......
...@@ -94,7 +94,7 @@ _t2e_cmp(const void *ap, const void *bp) { ...@@ -94,7 +94,7 @@ _t2e_cmp(const void *ap, const void *bp) {
* The decoder of the SET type. * The decoder of the SET type.
*/ */
asn_dec_rval_t asn_dec_rval_t
SET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SET_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const void *ptr, size_t size, int tag_mode) { void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
/* /*
* Bring closer parts of structure description. * Bring closer parts of structure description.
...@@ -605,7 +605,7 @@ SET_encode_der(asn_TYPE_descriptor_t *td, ...@@ -605,7 +605,7 @@ SET_encode_der(asn_TYPE_descriptor_t *td,
* Decode the XER (XML) data. * Decode the XER (XML) data.
*/ */
asn_dec_rval_t asn_dec_rval_t
SET_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SET_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const char *opt_mname, void **struct_ptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
/* /*
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
* The decoder of the SET OF type. * The decoder of the SET OF type.
*/ */
asn_dec_rval_t asn_dec_rval_t
SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SET_OF_decode_ber(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const void *ptr, size_t size, int tag_mode) { void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
/* /*
* Bring closer parts of structure description. * Bring closer parts of structure description.
...@@ -466,7 +466,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, ...@@ -466,7 +466,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
* Decode the XER (XML) data. * Decode the XER (XML) data.
*/ */
asn_dec_rval_t asn_dec_rval_t
SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SET_OF_decode_xer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const char *opt_mname, void **struct_ptr, const char *opt_mname,
const void *buf_ptr, size_t size) { const void *buf_ptr, size_t size) {
/* /*
...@@ -873,7 +873,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, ...@@ -873,7 +873,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
} }
asn_dec_rval_t asn_dec_rval_t
SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SET_OF_decode_uper(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
asn_dec_rval_t rv; asn_dec_rval_t rv;
......
...@@ -107,7 +107,7 @@ oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) { ...@@ -107,7 +107,7 @@ oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) {
} }
asn_dec_rval_t asn_dec_rval_t
SET_OF_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **struct_ptr, const asn_oer_constraints_t *constraints, void **struct_ptr,
const void *ptr, size_t size) { const void *ptr, size_t size) {
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* The OER decoder of any type. * The OER decoder of any type.
*/ */
asn_dec_rval_t asn_dec_rval_t
oer_decode(asn_codec_ctx_t *opt_codec_ctx, oer_decode(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *type_descriptor, asn_TYPE_descriptor_t *type_descriptor,
void **struct_ptr, const void *ptr, size_t size) { void **struct_ptr, const void *ptr, size_t size) {
asn_codec_ctx_t s_codec_ctx; asn_codec_ctx_t s_codec_ctx;
...@@ -56,7 +56,7 @@ oer_open_type_skip(const void *bufptr, size_t size) { ...@@ -56,7 +56,7 @@ oer_open_type_skip(const void *bufptr, size_t size) {
* >0: Number of bytes used from bufptr. * >0: Number of bytes used from bufptr.
*/ */
ssize_t ssize_t
oer_open_type_get(asn_codec_ctx_t *opt_codec_ctx, oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
struct asn_TYPE_descriptor_s *td, struct asn_TYPE_descriptor_s *td,
asn_oer_constraints_t *constraints, void **struct_ptr, asn_oer_constraints_t *constraints, void **struct_ptr,
const void *bufptr, size_t size) { const void *bufptr, size_t size) {
......
...@@ -20,7 +20,7 @@ struct asn_codec_ctx_s; /* Forward declaration */ ...@@ -20,7 +20,7 @@ struct asn_codec_ctx_s; /* Forward declaration */
* This function may be invoked directly by the application. * This function may be invoked directly by the application.
* Parses CANONICAL-OER and BASIC-OER. * Parses CANONICAL-OER and BASIC-OER.
*/ */
asn_dec_rval_t oer_decode(struct asn_codec_ctx_s *opt_codec_ctx, asn_dec_rval_t oer_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
struct asn_TYPE_descriptor_s *type_descriptor, struct asn_TYPE_descriptor_s *type_descriptor,
void **struct_ptr, /* Pointer to a target structure's pointer */ void **struct_ptr, /* Pointer to a target structure's pointer */
const void *buffer, /* Data to be decoded */ const void *buffer, /* Data to be decoded */
...@@ -31,7 +31,7 @@ asn_dec_rval_t oer_decode(struct asn_codec_ctx_s *opt_codec_ctx, ...@@ -31,7 +31,7 @@ asn_dec_rval_t oer_decode(struct asn_codec_ctx_s *opt_codec_ctx,
* Type of generic function which decodes the byte stream into the structure. * Type of generic function which decodes the byte stream into the structure.
*/ */
typedef asn_dec_rval_t(oer_type_decoder_f)( typedef asn_dec_rval_t(oer_type_decoder_f)(
struct asn_codec_ctx_s *opt_codec_ctx, const struct asn_codec_ctx_s *opt_codec_ctx,
struct asn_TYPE_descriptor_s *type_descriptor, struct asn_TYPE_descriptor_s *type_descriptor,
const asn_oer_constraints_t *constraints, const asn_oer_constraints_t *constraints,
void **struct_ptr, void **struct_ptr,
...@@ -54,7 +54,7 @@ ssize_t oer_open_type_skip(const void *bufptr, size_t size); ...@@ -54,7 +54,7 @@ ssize_t oer_open_type_skip(const void *bufptr, size_t size);
* -1: Fatal error deciphering length. * -1: Fatal error deciphering length.
* >0: Number of bytes used from bufptr. * >0: Number of bytes used from bufptr.
*/ */
ssize_t oer_open_type_get(asn_codec_ctx_t *opt_codec_ctx, ssize_t oer_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
struct asn_TYPE_descriptor_s *td, struct asn_TYPE_descriptor_s *td,
asn_oer_constraints_t *constraints, void **struct_ptr, asn_oer_constraints_t *constraints, void **struct_ptr,
const void *bufptr, size_t size); const void *bufptr, size_t size);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* multiple of 8 bytes. * multiple of 8 bytes.
*/ */
asn_dec_rval_t asn_dec_rval_t
uper_decode_complete(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size) { uper_decode_complete(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size) {
asn_dec_rval_t rval; asn_dec_rval_t rval;
rval = uper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0); rval = uper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
...@@ -37,7 +37,7 @@ uper_decode_complete(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -37,7 +37,7 @@ uper_decode_complete(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
} }
asn_dec_rval_t asn_dec_rval_t
uper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) { uper_decode(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) {
asn_codec_ctx_t s_codec_ctx; asn_codec_ctx_t s_codec_ctx;
asn_dec_rval_t rval; asn_dec_rval_t rval;
asn_per_data_t pd; asn_per_data_t pd;
......
...@@ -18,36 +18,37 @@ struct asn_TYPE_descriptor_s; /* Forward declaration */ ...@@ -18,36 +18,37 @@ struct asn_TYPE_descriptor_s; /* Forward declaration */
* Unaligned PER decoder of a "complete encoding" as per X.691 (08/2015) #11.1. * Unaligned PER decoder of a "complete encoding" as per X.691 (08/2015) #11.1.
* On success, this call always returns (.consumed >= 1), as per #11.1.3. * On success, this call always returns (.consumed >= 1), as per #11.1.3.
*/ */
asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, asn_dec_rval_t uper_decode_complete(
struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ const struct asn_codec_ctx_s *opt_codec_ctx,
void **struct_ptr, /* Pointer to a target structure's pointer */ struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
const void *buffer, /* Data to be decoded */ void **struct_ptr, /* Pointer to a target structure's pointer */
size_t size /* Size of data buffer */ const void *buffer, /* Data to be decoded */
); size_t size /* Size of data buffer */
);
/* /*
* Unaligned PER decoder of any ASN.1 type. May be invoked by the application. * Unaligned PER decoder of any ASN.1 type. May be invoked by the application.
* WARNING: This call returns the number of BITS read from the stream. Beware. * WARNING: This call returns the number of BITS read from the stream. Beware.
*/ */
asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, asn_dec_rval_t uper_decode(
struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ const struct asn_codec_ctx_s *opt_codec_ctx,
void **struct_ptr, /* Pointer to a target structure's pointer */ struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
const void *buffer, /* Data to be decoded */ void **struct_ptr, /* Pointer to a target structure's pointer */
size_t size, /* Size of data buffer */ const void *buffer, /* Data to be decoded */
int skip_bits, /* Number of unused leading bits, 0..7 */ size_t size, /* Size of data buffer */
int unused_bits /* Number of unused tailing bits, 0..7 */ int skip_bits, /* Number of unused leading bits, 0..7 */
); int unused_bits /* Number of unused tailing bits, 0..7 */
);
/* /*
* Type of the type-specific PER decoder function. * Type of the type-specific PER decoder function.
*/ */
typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, typedef asn_dec_rval_t(per_type_decoder_f)(
struct asn_TYPE_descriptor_s *type_descriptor, const asn_codec_ctx_t *opt_codec_ctx,
const asn_per_constraints_t *constraints, struct asn_TYPE_descriptor_s *type_descriptor,
void **struct_ptr, const asn_per_constraints_t *constraints, void **struct_ptr,
asn_per_data_t *per_data asn_per_data_t *per_data);
);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -16,7 +16,7 @@ typedef struct uper_ugot_key { ...@@ -16,7 +16,7 @@ typedef struct uper_ugot_key {
static int uper_ugot_refill(asn_per_data_t *pd); static int uper_ugot_refill(asn_per_data_t *pd);
static int per_skip_bits(asn_per_data_t *pd, int skip_nbits); static int per_skip_bits(asn_per_data_t *pd, int skip_nbits);
static asn_dec_rval_t uper_sot_suck(asn_codec_ctx_t *, static asn_dec_rval_t uper_sot_suck(const asn_codec_ctx_t *,
asn_TYPE_descriptor_t *td, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const asn_per_constraints_t *constraints,
void **sptr, asn_per_data_t *pd); void **sptr, asn_per_data_t *pd);
...@@ -57,7 +57,7 @@ uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints ...@@ -57,7 +57,7 @@ uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints
} }
static asn_dec_rval_t static asn_dec_rval_t
uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, uper_open_type_get_simple(const asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
asn_dec_rval_t rv; asn_dec_rval_t rv;
ssize_t chunk_bytes; ssize_t chunk_bytes;
...@@ -135,7 +135,7 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, ...@@ -135,7 +135,7 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
} }
static asn_dec_rval_t GCC_NOTUSED static asn_dec_rval_t GCC_NOTUSED
uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, uper_open_type_get_complex(const asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
uper_ugot_key arg; uper_ugot_key arg;
asn_dec_rval_t rv; asn_dec_rval_t rv;
...@@ -245,14 +245,14 @@ uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, ...@@ -245,14 +245,14 @@ uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
asn_dec_rval_t asn_dec_rval_t
uper_open_type_get(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, uper_open_type_get(const asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) { asn_per_data_t *pd) {
return uper_open_type_get_simple(ctx, td, constraints, sptr, pd); return uper_open_type_get_simple(ctx, td, constraints, sptr, pd);
} }
int int
uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) { uper_open_type_skip(const asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
asn_TYPE_descriptor_t s_td; asn_TYPE_descriptor_t s_td;
asn_TYPE_operation_t s_op; asn_TYPE_operation_t s_op;
asn_dec_rval_t rv; asn_dec_rval_t rv;
...@@ -273,7 +273,7 @@ uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) { ...@@ -273,7 +273,7 @@ uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
*/ */
static asn_dec_rval_t static asn_dec_rval_t
uper_sot_suck(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, uper_sot_suck(const asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
asn_dec_rval_t rv; asn_dec_rval_t rv;
......
...@@ -9,9 +9,13 @@ ...@@ -9,9 +9,13 @@
extern "C" { extern "C" {
#endif #endif
asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); asn_dec_rval_t uper_open_type_get(const asn_codec_ctx_t *opt_codec_ctx,
asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints,
void **sptr, asn_per_data_t *pd);
int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); int uper_open_type_skip(const asn_codec_ctx_t *opt_codec_ctx,
asn_per_data_t *pd);
/* /*
* X.691 (2015/08), #11.2 * X.691 (2015/08), #11.2
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Decode the XER encoding of a given type. * Decode the XER encoding of a given type.
*/ */
asn_dec_rval_t asn_dec_rval_t
xer_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, xer_decode(const asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **struct_ptr, const void *buffer, size_t size) { void **struct_ptr, const void *buffer, size_t size) {
asn_codec_ctx_t s_codec_ctx; asn_codec_ctx_t s_codec_ctx;
...@@ -201,7 +201,7 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { ...@@ -201,7 +201,7 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
* Generalized function for decoding the primitive values. * Generalized function for decoding the primitive values.
*/ */
asn_dec_rval_t asn_dec_rval_t
xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, xer_decode_general(const asn_codec_ctx_t *opt_codec_ctx,
asn_struct_ctx_t *ctx, /* Type decoder context */ asn_struct_ctx_t *ctx, /* Type decoder context */
void *struct_key, void *struct_key,
const char *xml_tag, /* Expected XML tag */ const char *xml_tag, /* Expected XML tag */
......
...@@ -17,7 +17,7 @@ struct asn_TYPE_descriptor_s; /* Forward declaration */ ...@@ -17,7 +17,7 @@ struct asn_TYPE_descriptor_s; /* Forward declaration */
* The XER decoder of any ASN.1 type. May be invoked by the application. * The XER decoder of any ASN.1 type. May be invoked by the application.
* Decodes CANONICAL-XER and BASIC-XER. * Decodes CANONICAL-XER and BASIC-XER.
*/ */
asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, asn_dec_rval_t xer_decode(const struct asn_codec_ctx_s *opt_codec_ctx,
struct asn_TYPE_descriptor_s *type_descriptor, struct asn_TYPE_descriptor_s *type_descriptor,
void **struct_ptr, /* Pointer to a target structure's pointer */ void **struct_ptr, /* Pointer to a target structure's pointer */
const void *buffer, /* Data to be decoded */ const void *buffer, /* Data to be decoded */
...@@ -27,12 +27,11 @@ asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, ...@@ -27,12 +27,11 @@ asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx,
/* /*
* Type of the type-specific XER decoder function. * Type of the type-specific XER decoder function.
*/ */
typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, typedef asn_dec_rval_t(xer_type_decoder_f)(
struct asn_TYPE_descriptor_s *type_descriptor, const asn_codec_ctx_t *opt_codec_ctx,
void **struct_ptr, struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
const char *opt_mname, /* Member name */ const char *opt_mname, /* Member name */
const void *buf_ptr, size_t size const void *buf_ptr, size_t size);
);
/******************************* /*******************************
* INTERNALLY USEFUL FUNCTIONS * * INTERNALLY USEFUL FUNCTIONS *
...@@ -44,17 +43,16 @@ typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, ...@@ -44,17 +43,16 @@ typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
* and others. This function should not be used by applications, as its API * and others. This function should not be used by applications, as its API
* is subject to changes. * is subject to changes.
*/ */
asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, asn_dec_rval_t xer_decode_general(
asn_struct_ctx_t *ctx, /* Type decoder context */ const asn_codec_ctx_t *opt_codec_ctx,
void *struct_key, /* Treated as opaque pointer */ asn_struct_ctx_t *ctx, /* Type decoder context */
const char *xml_tag, /* Expected XML tag name */ void *struct_key, /* Treated as opaque pointer */
const void *buf_ptr, size_t size, const char *xml_tag, /* Expected XML tag name */
int (*opt_unexpected_tag_decoder) const void *buf_ptr, size_t size,
(void *struct_key, const void *chunk_buf, size_t chunk_size), int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf,
ssize_t (*body_receiver) size_t chunk_size),
(void *struct_key, const void *chunk_buf, size_t chunk_size, ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf,
int have_more) size_t chunk_size, int have_more));
);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment