X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=blobdiff_plain;f=e2sim%2Fasn1c%2FNULL.c;fp=e2sim%2Fasn1c%2FNULL.c;h=d160e695f47ca0bd651aa5cf942cc873c832a185;hp=0000000000000000000000000000000000000000;hb=f5900596513e4359fc839ba361da085674e90b68;hpb=215d350dbe06a4c7ee370815f26128a7f7e160cb diff --git a/e2sim/asn1c/NULL.c b/e2sim/asn1c/NULL.c new file mode 100644 index 0000000..d160e69 --- /dev/null +++ b/e2sim/asn1c/NULL.c @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2003, 2005 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include + +/* + * NULL basic type description. + */ +static const ber_tlv_tag_t asn_DEF_NULL_tags[] = { + (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)) +}; +asn_TYPE_operation_t asn_OP_NULL = { + NULL_free, +#if !defined(ASN_DISABLE_PRINT_SUPPORT) + NULL_print, +#else + 0, +#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */ + NULL_compare, +#if !defined(ASN_DISABLE_BER_SUPPORT) + NULL_decode_ber, + NULL_encode_der, /* Special handling of DER encoding */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */ +#if !defined(ASN_DISABLE_XER_SUPPORT) + NULL_decode_xer, + NULL_encode_xer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */ +#if !defined(ASN_DISABLE_JER_SUPPORT) + NULL_encode_jer, +#else + 0, +#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */ +#if !defined(ASN_DISABLE_OER_SUPPORT) + NULL_decode_oer, + NULL_encode_oer, +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) + NULL_decode_uper, /* Unaligned PER decoder */ + NULL_encode_uper, /* Unaligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */ +#if !defined(ASN_DISABLE_APER_SUPPORT) + NULL_decode_aper, /* Aligned PER decoder */ + NULL_encode_aper, /* Aligned PER encoder */ +#else + 0, + 0, +#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */ +#if !defined(ASN_DISABLE_RFILL_SUPPORT) + NULL_random_fill, +#else + 0, +#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */ + 0 /* Use generic outmost tag fetcher */ +}; +asn_TYPE_descriptor_t asn_DEF_NULL = { + "NULL", + "NULL", + &asn_OP_NULL, + asn_DEF_NULL_tags, + sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), + asn_DEF_NULL_tags, /* Same as above */ + sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), + { +#if !defined(ASN_DISABLE_OER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ +#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) + 0, +#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ + asn_generic_no_constraint + }, + 0, 0, /* No members */ + 0 /* No specifics */ +}; + +void +NULL_free(const asn_TYPE_descriptor_t *td, void *ptr, + enum asn_struct_free_method method) { + if(td && ptr) { + switch(method) { + case ASFM_FREE_EVERYTHING: + FREEMEM(ptr); + break; + case ASFM_FREE_UNDERLYING: + break; + case ASFM_FREE_UNDERLYING_AND_RESET: + memset(ptr, 0, sizeof(NULL_t)); + break; + } + } +} + +int +NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) { + (void)td; + (void)a; + (void)b; + return 0; +}