X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=blobdiff_plain;f=e2sim%2Fasn1c%2FNULL_rfill.c;fp=e2sim%2Fasn1c%2FNULL_rfill.c;h=f1b60ce4fb5c90532832809d01ef1dca8268076c;hp=0000000000000000000000000000000000000000;hb=f5900596513e4359fc839ba361da085674e90b68;hpb=215d350dbe06a4c7ee370815f26128a7f7e160cb diff --git a/e2sim/asn1c/NULL_rfill.c b/e2sim/asn1c/NULL_rfill.c new file mode 100644 index 0000000..f1b60ce --- /dev/null +++ b/e2sim/asn1c/NULL_rfill.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017 Lev Walkin . + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +asn_random_fill_result_t +NULL_random_fill(const asn_TYPE_descriptor_t *td, void **sptr, + const asn_encoding_constraints_t *constr, + size_t max_length) { + asn_random_fill_result_t result_ok = {ARFILL_OK, 1}; + asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0}; + asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0}; + NULL_t *st = *sptr; + + (void)td; + (void)constr; + + if(max_length == 0) return result_skipped; + + if(st == NULL) { + st = (NULL_t *)(*sptr = CALLOC(1, sizeof(*st))); + if(st == NULL) { + return result_failed; + } + } + + return result_ok; +}