mirror of https://gerrit.osmocom.org/asn1c
add const
This commit is contained in:
parent
9dc9f67acd
commit
afbf2a9828
|
@ -771,7 +771,7 @@ decode_tlv_from_string(const char *datastring) {
|
|||
* Dummy functions.
|
||||
*/
|
||||
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,
|
||||
int tag_mode, int last_tag_form, ber_tlv_len_t *last_length,
|
||||
int *opt_tlv_form) {
|
||||
|
@ -803,7 +803,7 @@ der_write_tags(asn_TYPE_descriptor_t *td, size_t slen, int tag_mode,
|
|||
}
|
||||
|
||||
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,
|
||||
size_t size,
|
||||
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) {
|
|||
#ifndef ASN_DISABLE_PER_SUPPORT
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
asn_OCTET_STRING_specifics_t *specs =
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
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 void *ptr, size_t size) {
|
||||
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
|
||||
|
|
|
@ -128,7 +128,7 @@ BMPString__dump(const BMPString_t *st,
|
|||
}
|
||||
|
||||
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,
|
||||
const char *opt_mname, const void *buf_ptr, size_t size) {
|
||||
asn_dec_rval_t rc;
|
||||
|
|
|
@ -55,7 +55,7 @@ asn_TYPE_descriptor_t asn_DEF_BOOLEAN = {
|
|||
* Decode BOOLEAN type.
|
||||
*/
|
||||
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,
|
||||
void **bool_value, const void *buf_ptr, size_t size,
|
||||
int tag_mode) {
|
||||
|
@ -184,7 +184,7 @@ BOOLEAN__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun
|
|||
|
||||
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
|
||||
|
@ -262,7 +262,7 @@ BOOLEAN_free(const asn_TYPE_descriptor_t *td, void *ptr,
|
|||
}
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
asn_dec_rval_t rv;
|
||||
|
|
|
@ -54,7 +54,7 @@ asn_TYPE_descriptor_t asn_DEF_ENUMERATED = {
|
|||
};
|
||||
|
||||
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,
|
||||
const asn_per_constraints_t *constraints, void **sptr,
|
||||
asn_per_data_t *pd) {
|
||||
|
|
|
@ -541,7 +541,7 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun
|
|||
}
|
||||
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
|
||||
|
@ -572,7 +572,7 @@ INTEGER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
|
|||
#ifndef ASN_DISABLE_PER_SUPPORT
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
const asn_INTEGER_specifics_t *specs =
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
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 void *ptr, size_t size) {
|
||||
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
|
|||
}
|
||||
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
|
||||
|
@ -136,7 +136,7 @@ NULL_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
|||
#ifndef ASN_DISABLE_OER_SUPPORT
|
||||
|
||||
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 void *ptr, size_t size) {
|
||||
asn_dec_rval_t rv = {RC_OK, 0};
|
||||
|
@ -171,7 +171,7 @@ NULL_encode_oer(asn_TYPE_descriptor_t *td,
|
|||
#ifndef ASN_DISABLE_PER_SUPPORT
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
asn_dec_rval_t rv;
|
||||
|
|
|
@ -89,7 +89,7 @@ NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
|
|||
}
|
||||
|
||||
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,
|
||||
void **sptr, asn_per_data_t *pd) {
|
||||
const asn_INTEGER_specifics_t *specs =
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
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,
|
||||
const asn_oer_constraints_t *constraints,
|
||||
void **nint_ptr, const void *ptr, size_t size) {
|
||||
|
|
|
@ -62,7 +62,7 @@ asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
|
|||
* Decode INTEGER type.
|
||||
*/
|
||||
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,
|
||||
void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) {
|
||||
const asn_INTEGER_specifics_t *specs =
|
||||
|
@ -185,7 +185,7 @@ NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr,
|
|||
* Decode the chunk of XML text encoding INTEGER.
|
||||
*/
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
const asn_INTEGER_specifics_t *specs =
|
||||
|
@ -254,7 +254,7 @@ NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
|
|||
#ifndef ASN_DISABLE_PER_SUPPORT
|
||||
|
||||
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,
|
||||
const asn_per_constraints_t *constraints, void **sptr,
|
||||
asn_per_data_t *pd) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
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,
|
||||
const asn_oer_constraints_t *constraints,
|
||||
void **nint_ptr, const void *ptr, size_t size) {
|
||||
|
|
|
@ -64,7 +64,7 @@ asn_TYPE_descriptor_t asn_DEF_NativeReal = {
|
|||
* Decode REAL type.
|
||||
*/
|
||||
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,
|
||||
void **dbl_ptr, const void *buf_ptr, size_t size, int tag_mode) {
|
||||
double *Dbl = (double *)*dbl_ptr;
|
||||
|
@ -212,7 +212,7 @@ NativeReal_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
|
|||
* Decode REAL type using PER.
|
||||
*/
|
||||
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,
|
||||
const asn_per_constraints_t *constraints, void **dbl_ptr,
|
||||
asn_per_data_t *pd) {
|
||||
|
@ -285,7 +285,7 @@ NativeReal_encode_uper(asn_TYPE_descriptor_t *td,
|
|||
* Decode the chunk of XML text encoding REAL.
|
||||
*/
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
asn_dec_rval_t rval;
|
||||
|
|
|
@ -327,7 +327,7 @@ OBJECT_IDENTIFIER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const
|
|||
}
|
||||
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ _new_stack(void) {
|
|||
* Decode OCTET STRING type.
|
||||
*/
|
||||
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,
|
||||
void **sptr, const void *buf_ptr, size_t size, int tag_mode) {
|
||||
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,
|
|||
* Decode OCTET STRING from the XML element's body.
|
||||
*/
|
||||
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,
|
||||
const char *opt_mname, const void *buf_ptr, size_t size,
|
||||
int (*opt_unexpected_tag_decoder)
|
||||
|
@ -1175,7 +1175,7 @@ sta_failed:
|
|||
* Decode OCTET STRING from the hexadecimal data.
|
||||
*/
|
||||
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,
|
||||
const char *opt_mname, const void *buf_ptr, size_t size) {
|
||||
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,
|
|||
* Decode OCTET STRING from the binary (0/1) data.
|
||||
*/
|
||||
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,
|
||||
const char *opt_mname, const void *buf_ptr, size_t size) {
|
||||
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,
|
|||
* Decode OCTET STRING from the string (ASCII/UTF-8) data.
|
||||
*/
|
||||
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,
|
||||
const char *opt_mname, const void *buf_ptr, size_t size) {
|
||||
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,
|
|||
#ifndef ASN_DISABLE_PER_SUPPORT
|
||||
|
||||
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,
|
||||
const asn_per_constraints_t *constraints, void **sptr,
|
||||
asn_per_data_t *pd) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
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,
|
||||
const asn_oer_constraints_t *constraints, void **sptr,
|
||||
const void *ptr, size_t size) {
|
||||
|
|
|
@ -36,7 +36,7 @@ asn_TYPE_operation_t asn_OP_OPEN_TYPE = {
|
|||
} while(0)
|
||||
|
||||
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,
|
||||
size_t size) {
|
||||
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,
|
|||
}
|
||||
|
||||
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,
|
||||
size_t size) {
|
||||
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,
|
|||
#ifndef ASN_DISABLE_PER_SUPPORT
|
||||
|
||||
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_member_t *elm, asn_per_data_t *pd) {
|
||||
asn_type_selector_result_t selected;
|
||||
|
|
|
@ -27,25 +27,25 @@ extern asn_TYPE_operation_t asn_OP_OPEN_TYPE;
|
|||
* Decode an Open Type which is potentially constraiend
|
||||
* 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,
|
||||
void *parent_structure,
|
||||
asn_TYPE_member_t *element, const void *ptr,
|
||||
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,
|
||||
void *parent_structure,
|
||||
asn_TYPE_member_t *element, const void *ptr,
|
||||
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,
|
||||
void *parent_structure,
|
||||
asn_TYPE_member_t *element,
|
||||
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,
|
||||
void *parent_structure,
|
||||
asn_TYPE_member_t *element,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
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,
|
||||
size_t size) {
|
||||
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
|
|||
}
|
||||
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
|
||||
|
@ -805,7 +805,7 @@ asn_double2REAL(REAL_t *st, double dbl_value) {
|
|||
#ifndef ASN_DISABLE_PER_SUPPORT
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
(void)constraints; /* No PER visible constraints */
|
||||
|
|
|
@ -150,7 +150,7 @@ RELATIVE_OID__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void
|
|||
}
|
||||
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ UniversalString__dump(const UniversalString_t *st,
|
|||
}
|
||||
|
||||
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,
|
||||
const char *opt_mname, const void *buf_ptr, size_t size) {
|
||||
asn_dec_rval_t rc;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
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,
|
||||
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) {
|
|||
}
|
||||
|
||||
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,
|
||||
void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) {
|
||||
struct callback_failure_catch_key cb_key;
|
||||
|
@ -100,7 +100,7 @@ asn_encode(const asn_codec_ctx_t *opt_codec_parameters,
|
|||
cb_key.callback_key = callback_key;
|
||||
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);
|
||||
if(cb_key.callback_failed) {
|
||||
assert(er.encoded == -1);
|
||||
|
@ -112,7 +112,7 @@ asn_encode(const asn_codec_ctx_t *opt_codec_parameters,
|
|||
}
|
||||
|
||||
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,
|
||||
void *sptr, void *buffer, size_t buffer_size) {
|
||||
struct overrun_encoder_key buf_key;
|
||||
|
@ -127,7 +127,7 @@ asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_parameters,
|
|||
buf_key.buffer_size = buffer_size;
|
||||
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);
|
||||
|
||||
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,
|
|||
}
|
||||
|
||||
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,
|
||||
void *sptr, asn_app_consume_bytes_f *callback,
|
||||
void *callback_key) {
|
||||
asn_enc_rval_t er;
|
||||
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) {
|
||||
errno = EINVAL;
|
||||
|
@ -294,13 +294,10 @@ asn_encode_internal(const asn_codec_ctx_t *opt_codec_parameters,
|
|||
}
|
||||
|
||||
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,
|
||||
void **sptr, const void *buffer, size_t size) {
|
||||
|
||||
(void)opt_codec_parameters;
|
||||
asn_codec_ctx_t *opt_ctx = 0;
|
||||
|
||||
if(!td || !sptr || (size && !buffer)) {
|
||||
ASN__DECODE_FAILED;
|
||||
}
|
||||
|
@ -314,7 +311,7 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters,
|
|||
|
||||
case ATS_DER:
|
||||
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_CANONICAL_OER:
|
||||
|
@ -322,7 +319,7 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters,
|
|||
errno = ENOENT;
|
||||
ASN__DECODE_FAILED;
|
||||
#else
|
||||
return oer_decode(opt_ctx, td, sptr, buffer, size);
|
||||
return oer_decode(opt_codec_ctx, td, sptr, buffer, size);
|
||||
#endif
|
||||
|
||||
case ATS_UNALIGNED_BASIC_PER:
|
||||
|
@ -331,12 +328,12 @@ asn_decode(const asn_codec_ctx_t *opt_codec_parameters,
|
|||
errno = ENOENT;
|
||||
ASN__DECODE_FAILED;
|
||||
#else
|
||||
return uper_decode_complete(opt_ctx, td, sptr, buffer, size);
|
||||
return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
|
||||
#endif
|
||||
|
||||
case ATS_BASIC_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 @@
|
|||
* Decode an always-primitive type.
|
||||
*/
|
||||
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,
|
||||
void **sptr, const void *buf_ptr, size_t size, int tag_mode) {
|
||||
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,
|
|||
|
||||
|
||||
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,
|
||||
void **sptr,
|
||||
size_t struct_size,
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef enum xer_pbd_rval (xer_primitive_body_decoder_f)
|
|||
* Specific function to decode simple primitive types.
|
||||
* 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,
|
||||
void **struct_ptr, size_t struct_size,
|
||||
const char *opt_mname,
|
||||
|
|
|
@ -108,11 +108,11 @@ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
|
|||
*/
|
||||
#define ASN__DEFAULT_STACK_MAX (30000)
|
||||
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) {
|
||||
|
||||
/* 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! */
|
||||
|
||||
/* double negative required to avoid int wrap-around */
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
* The BER decoder of any type.
|
||||
*/
|
||||
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,
|
||||
void **struct_ptr, const void *ptr, size_t size) {
|
||||
asn_codec_ctx_t s_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.
|
||||
*/
|
||||
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,
|
||||
const void *ptr, size_t size, int tag_mode, int last_tag_form,
|
||||
ber_tlv_len_t *last_length, int *opt_tlv_form) {
|
||||
|
|
|
@ -22,7 +22,7 @@ struct asn_codec_ctx_s; /* Forward declaration */
|
|||
* NOTE: Use the der_encode() function (der_encoder.h) to produce encoding
|
||||
* 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,
|
||||
void **struct_ptr, /* Pointer to a target structure's pointer */
|
||||
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,
|
|||
* Type of generic function which decodes the byte stream into the structure.
|
||||
*/
|
||||
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,
|
||||
void **struct_ptr, const void *buf_ptr, size_t size,
|
||||
int tag_mode);
|
||||
|
@ -50,7 +50,7 @@ typedef asn_dec_rval_t (ber_type_decoder_f)(
|
|||
* head->last_tag_form is non-zero.
|
||||
*/
|
||||
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,
|
||||
asn_struct_ctx_t *opt_ctx, /* saved decoding context */
|
||||
const void *ptr, size_t size,
|
||||
|
|
|
@ -75,7 +75,7 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
|
|||
}
|
||||
|
||||
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) {
|
||||
ber_tlv_len_t vlen; /* Length of V 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,
|
|||
* Standard {-1,0,>0} convention.
|
||||
*/
|
||||
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);
|
||||
|
||||
/*
|
||||
|
|
|
@ -103,7 +103,7 @@ _search4tag(const void *ap, const void *bp) {
|
|||
* The decoder of the CHOICE type.
|
||||
*/
|
||||
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) {
|
||||
/*
|
||||
* Bring closer parts of structure description.
|
||||
|
@ -549,7 +549,7 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
|||
* Decode the XER (XML) data.
|
||||
*/
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
/*
|
||||
|
@ -830,7 +830,7 @@ cb_failed:
|
|||
}
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
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) {
|
|||
}
|
||||
|
||||
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 void *ptr, size_t size) {
|
||||
/*
|
||||
|
|
|
@ -110,7 +110,7 @@ _t2e_cmp(const void *ap, const void *bp) {
|
|||
* The decoder of the SEQUENCE type.
|
||||
*/
|
||||
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) {
|
||||
/*
|
||||
* Bring closer parts of structure description.
|
||||
|
@ -626,7 +626,7 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td,
|
|||
* Decode the XER (XML) data.
|
||||
*/
|
||||
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,
|
||||
const void *ptr, size_t size) {
|
||||
/*
|
||||
|
@ -1079,7 +1079,7 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
|||
#ifndef ASN_DISABLE_PER_SUPPORT
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
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) {
|
|||
}
|
||||
|
||||
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 void *ptr, size_t size) {
|
||||
asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
|
||||
|
|
|
@ -94,7 +94,7 @@ _t2e_cmp(const void *ap, const void *bp) {
|
|||
* The decoder of the SET type.
|
||||
*/
|
||||
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) {
|
||||
/*
|
||||
* Bring closer parts of structure description.
|
||||
|
@ -605,7 +605,7 @@ SET_encode_der(asn_TYPE_descriptor_t *td,
|
|||
* Decode the XER (XML) data.
|
||||
*/
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
/*
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
* The decoder of the SET OF type.
|
||||
*/
|
||||
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) {
|
||||
/*
|
||||
* Bring closer parts of structure description.
|
||||
|
@ -466,7 +466,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
|
|||
* Decode the XER (XML) data.
|
||||
*/
|
||||
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,
|
||||
const void *buf_ptr, size_t size) {
|
||||
/*
|
||||
|
@ -873,7 +873,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
|||
}
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
asn_dec_rval_t rv;
|
||||
|
|
|
@ -107,7 +107,7 @@ oer_fetch_quantity(const void *ptr, size_t size, size_t *qty_r) {
|
|||
}
|
||||
|
||||
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 void *ptr, size_t size) {
|
||||
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* The OER decoder of any type.
|
||||
*/
|
||||
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,
|
||||
void **struct_ptr, const void *ptr, size_t size) {
|
||||
asn_codec_ctx_t s_codec_ctx;
|
||||
|
@ -56,7 +56,7 @@ oer_open_type_skip(const void *bufptr, size_t size) {
|
|||
* >0: Number of bytes used from bufptr.
|
||||
*/
|
||||
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,
|
||||
asn_oer_constraints_t *constraints, void **struct_ptr,
|
||||
const void *bufptr, size_t size) {
|
||||
|
|
|
@ -20,7 +20,7 @@ struct asn_codec_ctx_s; /* Forward declaration */
|
|||
* This function may be invoked directly by the application.
|
||||
* 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,
|
||||
void **struct_ptr, /* Pointer to a target structure's pointer */
|
||||
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,
|
|||
* Type of generic function which decodes the byte stream into the structure.
|
||||
*/
|
||||
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,
|
||||
const asn_oer_constraints_t *constraints,
|
||||
void **struct_ptr,
|
||||
|
@ -54,7 +54,7 @@ ssize_t oer_open_type_skip(const void *bufptr, size_t size);
|
|||
* -1: Fatal error deciphering length.
|
||||
* >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,
|
||||
asn_oer_constraints_t *constraints, void **struct_ptr,
|
||||
const void *bufptr, size_t size);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* multiple of 8 bytes.
|
||||
*/
|
||||
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;
|
||||
|
||||
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,
|
|||
}
|
||||
|
||||
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_dec_rval_t rval;
|
||||
asn_per_data_t pd;
|
||||
|
|
|
@ -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.
|
||||
* 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,
|
||||
struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
|
||||
void **struct_ptr, /* Pointer to a target structure's pointer */
|
||||
const void *buffer, /* Data to be decoded */
|
||||
size_t size /* Size of data buffer */
|
||||
);
|
||||
asn_dec_rval_t uper_decode_complete(
|
||||
const struct asn_codec_ctx_s *opt_codec_ctx,
|
||||
struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
|
||||
void **struct_ptr, /* Pointer to a target structure's pointer */
|
||||
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.
|
||||
* 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,
|
||||
struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
|
||||
void **struct_ptr, /* Pointer to a target structure's pointer */
|
||||
const void *buffer, /* Data to be decoded */
|
||||
size_t size, /* Size of data buffer */
|
||||
int skip_bits, /* Number of unused leading bits, 0..7 */
|
||||
int unused_bits /* Number of unused tailing bits, 0..7 */
|
||||
);
|
||||
asn_dec_rval_t uper_decode(
|
||||
const struct asn_codec_ctx_s *opt_codec_ctx,
|
||||
struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
|
||||
void **struct_ptr, /* Pointer to a target structure's pointer */
|
||||
const void *buffer, /* Data to be decoded */
|
||||
size_t size, /* Size of data buffer */
|
||||
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.
|
||||
*/
|
||||
typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
|
||||
struct asn_TYPE_descriptor_s *type_descriptor,
|
||||
const asn_per_constraints_t *constraints,
|
||||
void **struct_ptr,
|
||||
asn_per_data_t *per_data
|
||||
);
|
||||
typedef asn_dec_rval_t(per_type_decoder_f)(
|
||||
const asn_codec_ctx_t *opt_codec_ctx,
|
||||
struct asn_TYPE_descriptor_s *type_descriptor,
|
||||
const asn_per_constraints_t *constraints, void **struct_ptr,
|
||||
asn_per_data_t *per_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ typedef struct uper_ugot_key {
|
|||
|
||||
static int uper_ugot_refill(asn_per_data_t *pd);
|
||||
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,
|
||||
const asn_per_constraints_t *constraints,
|
||||
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
|
|||
}
|
||||
|
||||
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) {
|
||||
asn_dec_rval_t rv;
|
||||
ssize_t chunk_bytes;
|
||||
|
@ -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
|
||||
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) {
|
||||
uper_ugot_key arg;
|
||||
asn_dec_rval_t rv;
|
||||
|
@ -245,14 +245,14 @@ uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
|
|||
|
||||
|
||||
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,
|
||||
asn_per_data_t *pd) {
|
||||
return uper_open_type_get_simple(ctx, td, constraints, sptr, pd);
|
||||
}
|
||||
|
||||
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_operation_t s_op;
|
||||
asn_dec_rval_t rv;
|
||||
|
@ -273,7 +273,7 @@ uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
|
|||
*/
|
||||
|
||||
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) {
|
||||
asn_dec_rval_t rv;
|
||||
|
||||
|
|
|
@ -9,9 +9,13 @@
|
|||
extern "C" {
|
||||
#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
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* Decode the XER encoding of a given type.
|
||||
*/
|
||||
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) {
|
||||
asn_codec_ctx_t s_codec_ctx;
|
||||
|
||||
|
@ -201,7 +201,7 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
|
|||
* Generalized function for decoding the primitive values.
|
||||
*/
|
||||
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 */
|
||||
void *struct_key,
|
||||
const char *xml_tag, /* Expected XML tag */
|
||||
|
|
|
@ -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.
|
||||
* 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,
|
||||
void **struct_ptr, /* Pointer to a target structure's pointer */
|
||||
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,
|
|||
/*
|
||||
* Type of the type-specific XER decoder function.
|
||||
*/
|
||||
typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
|
||||
struct asn_TYPE_descriptor_s *type_descriptor,
|
||||
void **struct_ptr,
|
||||
const char *opt_mname, /* Member name */
|
||||
const void *buf_ptr, size_t size
|
||||
);
|
||||
typedef asn_dec_rval_t(xer_type_decoder_f)(
|
||||
const asn_codec_ctx_t *opt_codec_ctx,
|
||||
struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
|
||||
const char *opt_mname, /* Member name */
|
||||
const void *buf_ptr, size_t size);
|
||||
|
||||
/*******************************
|
||||
* INTERNALLY USEFUL FUNCTIONS *
|
||||
|
@ -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
|
||||
* is subject to changes.
|
||||
*/
|
||||
asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx,
|
||||
asn_struct_ctx_t *ctx, /* Type decoder context */
|
||||
void *struct_key, /* Treated as opaque pointer */
|
||||
const char *xml_tag, /* Expected XML tag name */
|
||||
const void *buf_ptr, size_t size,
|
||||
int (*opt_unexpected_tag_decoder)
|
||||
(void *struct_key, const void *chunk_buf, size_t chunk_size),
|
||||
ssize_t (*body_receiver)
|
||||
(void *struct_key, const void *chunk_buf, size_t chunk_size,
|
||||
int have_more)
|
||||
);
|
||||
asn_dec_rval_t xer_decode_general(
|
||||
const asn_codec_ctx_t *opt_codec_ctx,
|
||||
asn_struct_ctx_t *ctx, /* Type decoder context */
|
||||
void *struct_key, /* Treated as opaque pointer */
|
||||
const char *xml_tag, /* Expected XML tag name */
|
||||
const void *buf_ptr, size_t size,
|
||||
int (*opt_unexpected_tag_decoder)(void *struct_key, const void *chunk_buf,
|
||||
size_t chunk_size),
|
||||
ssize_t (*body_receiver)(void *struct_key, const void *chunk_buf,
|
||||
size_t chunk_size, int have_more));
|
||||
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue