Commit ed3a4ae4 authored by Lev Walkin's avatar Lev Walkin

INTEGER decoding stub

parent a7a240e8
...@@ -35,9 +35,8 @@ asn_TYPE_descriptor_t asn_DEF_INTEGER = { ...@@ -35,9 +35,8 @@ asn_TYPE_descriptor_t asn_DEF_INTEGER = {
0, 0,
0, 0,
#else #else
//INTEGER_decode_oer, /* OER decoder */ INTEGER_decode_oer, /* OER decoder */
//INTEGER_encode_oer, /* Canonical OER encoder */ 0, /*INTEGER_encode_oer,*/ /* Canonical OER encoder */
0,0,
#endif /* ASN_DISABLE_OER_SUPPORT */ #endif /* ASN_DISABLE_OER_SUPPORT */
0, /* Use generic outmost tag fetcher */ 0, /* Use generic outmost tag fetcher */
asn_DEF_INTEGER_tags, asn_DEF_INTEGER_tags,
......
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef ASN_DISABLE_OER_SUPPORT
#include <asn_internal.h>
#include <INTEGER.h>
#include <errno.h>
asn_dec_rval_t
INTEGER_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) {
asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
asn_dec_rval_t rval = {RC_OK, 0};
INTEGER_t *st = (INTEGER_t *)*sptr;
asn_oer_constraint_t *ct;
int repeat;
(void)opt_codec_ctx;
if(!st) {
st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
if(!st) ASN__DECODE_FAILED;
}
if(!constraints) constraints = td->oer_constraints;
ct = constraints ? &constraints->value : 0;
FREEMEM(st->buf);
st->buf = 0;
st->size = 0;
}
#endif /* ASN_DISABLE_OER_SUPPORT */
/*-
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _INTEGER_OER_H_
#define _INTEGER_OER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <asn_application.h>
#include <asn_codecs.h>
oer_type_decoder_f INTEGER_decode_oer;
oer_type_encoder_f INTEGER_encode_oer;
#ifdef __cplusplus
}
#endif
#endif /* _INTEGER_OER_H_ */
...@@ -32,7 +32,7 @@ asn_dec_rval_t oer_decode(struct asn_codec_ctx_s *opt_codec_ctx, ...@@ -32,7 +32,7 @@ asn_dec_rval_t oer_decode(struct asn_codec_ctx_s *opt_codec_ctx,
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, struct asn_codec_ctx_s *opt_codec_ctx,
struct asn_TYPE_descriptor_s *type_descriptor, struct asn_TYPE_descriptor_s *type_descriptor,
asn_oer_constraint_t *constraints, asn_oer_constraints_t *constraints,
void **struct_ptr, void **struct_ptr,
const void *buf_ptr, const void *buf_ptr,
size_t size); size_t size);
......
...@@ -11,6 +11,7 @@ check_PROGRAMS = \ ...@@ -11,6 +11,7 @@ check_PROGRAMS = \
check-INTEGER \ check-INTEGER \
check-REAL \ check-REAL \
check-XER \ check-XER \
check-OER-INTEGER \
check-PER \ check-PER \
check-PER-INTEGER check-PER-INTEGER
......
#include <stdio.h>
#include <assert.h>
#include <INTEGER.h>
#include <INTEGER.c>
#include <INTEGER_oer.c>
void
check_decode_ok(intmax_t control, uint8_t *buf, size_t size) {
}
int
main() {
check_decode_ok(0, "", 1);
}
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