|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <asn_internal.h> |
|
|
#include <NULL.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
NULL_compare, |
|
|
NULL_copy, |
|
|
#if !defined(ASN_DISABLE_BER_SUPPORT) |
|
|
NULL_decode_ber, |
|
|
NULL_encode_der, |
|
|
#else |
|
|
0, |
|
|
0, |
|
|
#endif |
|
|
#if !defined(ASN_DISABLE_XER_SUPPORT) |
|
|
NULL_decode_xer, |
|
|
NULL_encode_xer, |
|
|
#else |
|
|
0, |
|
|
0, |
|
|
#endif |
|
|
#if !defined(ASN_DISABLE_JER_SUPPORT) |
|
|
NULL_decode_jer, |
|
|
NULL_encode_jer, |
|
|
#else |
|
|
0, |
|
|
0, |
|
|
#endif |
|
|
#if !defined(ASN_DISABLE_OER_SUPPORT) |
|
|
NULL_decode_oer, |
|
|
NULL_encode_oer, |
|
|
#else |
|
|
0, |
|
|
0, |
|
|
#endif |
|
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) |
|
|
NULL_decode_uper, |
|
|
NULL_encode_uper, |
|
|
#else |
|
|
0, |
|
|
0, |
|
|
#endif |
|
|
#if !defined(ASN_DISABLE_APER_SUPPORT) |
|
|
NULL_decode_aper, |
|
|
NULL_encode_aper, |
|
|
#else |
|
|
0, |
|
|
0, |
|
|
#endif |
|
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT) |
|
|
NULL_random_fill, |
|
|
#else |
|
|
0, |
|
|
#endif |
|
|
0 |
|
|
}; |
|
|
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, |
|
|
sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]), |
|
|
{ |
|
|
#if !defined(ASN_DISABLE_OER_SUPPORT) |
|
|
0, |
|
|
#endif |
|
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) |
|
|
0, |
|
|
#endif |
|
|
asn_generic_no_constraint |
|
|
}, |
|
|
0, 0, |
|
|
0 |
|
|
}; |
|
|
|
|
|
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; |
|
|
} |
|
|
|
|
|
int |
|
|
NULL_copy(const asn_TYPE_descriptor_t *td, void **a, const void *b) { |
|
|
(void)td; |
|
|
|
|
|
if(b && !*a) { |
|
|
*a = CALLOC(1, sizeof(NULL_t)); |
|
|
if (!*a) return -1; |
|
|
} |
|
|
|
|
|
return 0; |
|
|
} |
|
|
|