X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=blobdiff_plain;f=e2sim%2Fasn1c%2FNULL_aper.c;fp=e2sim%2Fasn1c%2FNULL_aper.c;h=5176880b997674c4de5be96cd4aae0c97dfd1ff9;hp=0000000000000000000000000000000000000000;hb=f5900596513e4359fc839ba361da085674e90b68;hpb=215d350dbe06a4c7ee370815f26128a7f7e160cb diff --git a/e2sim/asn1c/NULL_aper.c b/e2sim/asn1c/NULL_aper.c new file mode 100644 index 0000000..5176880 --- /dev/null +++ b/e2sim/asn1c/NULL_aper.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_dec_rval_t +NULL_decode_aper(const asn_codec_ctx_t *opt_codec_ctx, + const asn_TYPE_descriptor_t *td, + const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_dec_rval_t rv = {RC_OK, 0}; + + (void)opt_codec_ctx; + (void)td; + (void)constraints; + (void)pd; + + if(!*sptr) { + *sptr = MALLOC(sizeof(NULL_t)); + if(*sptr) { + *(NULL_t *)*sptr = 0; + } else { + ASN__DECODE_FAILED; + } + } + + /* + * NULL type does not have content octets. + */ + + rv.code = RC_OK; + rv.consumed = 0; + return rv; +} + + +asn_enc_rval_t +NULL_encode_aper(const asn_TYPE_descriptor_t *td, + const asn_per_constraints_t *constraints, + const void *sptr, asn_per_outp_t *po) { + asn_enc_rval_t er = {0,0,0}; + + (void)td; + (void)constraints; + (void)sptr; + (void)po; + + er.encoded = 0; + ASN__ENCODED_OK(er); +}