blob: f21850eab61c3a832e2357739ddccd2f28db4906 [file] [log] [blame]
Lev Walkined3a4ae2017-07-07 10:09:51 -07001/*
2 * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
3 * All rights reserved.
4 * Redistribution and modifications are permitted subject to BSD license.
5 */
6#ifndef ASN_DISABLE_OER_SUPPORT
7
8#include <asn_internal.h>
9#include <INTEGER.h>
10#include <errno.h>
11
12asn_dec_rval_t
13INTEGER_decode_oer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
14 asn_oer_constraints_t *constraints, void **sptr,
15 const void *ptr, size_t size) {
16 asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
17 asn_dec_rval_t rval = {RC_OK, 0};
18 INTEGER_t *st = (INTEGER_t *)*sptr;
19 asn_oer_constraint_t *ct;
20 int repeat;
21
22 (void)opt_codec_ctx;
23
24 if(!st) {
25 st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
26 if(!st) ASN__DECODE_FAILED;
27 }
28
29 if(!constraints) constraints = td->oer_constraints;
30 ct = constraints ? &constraints->value : 0;
31
32 FREEMEM(st->buf);
33 st->buf = 0;
34 st->size = 0;
35}
36
37#endif /* ASN_DISABLE_OER_SUPPORT */