SIM-115: update simulator to use latest E2SM KPM version 3
[sim/e2-interface.git] / e2sim / asn1c / NULL.c
1 /*-
2  * Copyright (c) 2003, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
3  * Redistribution and modifications are permitted subject to BSD license.
4  */
5 #include <asn_internal.h>
6 #include <NULL.h>
7
8 /*
9  * NULL basic type description.
10  */
11 static const ber_tlv_tag_t asn_DEF_NULL_tags[] = {
12     (ASN_TAG_CLASS_UNIVERSAL | (5 << 2))
13 };
14 asn_TYPE_operation_t asn_OP_NULL = {
15     NULL_free,
16 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
17     NULL_print,
18 #else
19     0,
20 #endif  /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
21     NULL_compare,
22 #if !defined(ASN_DISABLE_BER_SUPPORT)
23     NULL_decode_ber,
24     NULL_encode_der,  /* Special handling of DER encoding */
25 #else
26     0,
27     0,
28 #endif  /* !defined(ASN_DISABLE_BER_SUPPORT) */
29 #if !defined(ASN_DISABLE_XER_SUPPORT)
30     NULL_decode_xer,
31     NULL_encode_xer,
32 #else
33     0,
34     0,
35 #endif  /* !defined(ASN_DISABLE_XER_SUPPORT) */
36 #if !defined(ASN_DISABLE_JER_SUPPORT)
37     NULL_encode_jer,
38 #else
39     0,
40 #endif  /* !defined(ASN_DISABLE_JER_SUPPORT) */
41 #if !defined(ASN_DISABLE_OER_SUPPORT)
42     NULL_decode_oer,
43     NULL_encode_oer,
44 #else
45     0,
46     0,
47 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
48 #if !defined(ASN_DISABLE_UPER_SUPPORT)
49     NULL_decode_uper,  /* Unaligned PER decoder */
50     NULL_encode_uper,  /* Unaligned PER encoder */
51 #else
52     0,
53     0,
54 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) */
55 #if !defined(ASN_DISABLE_APER_SUPPORT)
56     NULL_decode_aper,  /* Aligned PER decoder */
57     NULL_encode_aper,  /* Aligned PER encoder */
58 #else
59     0,
60     0,
61 #endif  /* !defined(ASN_DISABLE_APER_SUPPORT) */
62 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
63     NULL_random_fill,
64 #else
65     0,
66 #endif  /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
67     0  /* Use generic outmost tag fetcher */
68 };
69 asn_TYPE_descriptor_t asn_DEF_NULL = {
70     "NULL",
71     "NULL",
72     &asn_OP_NULL,
73     asn_DEF_NULL_tags,
74     sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
75     asn_DEF_NULL_tags,  /* Same as above */
76     sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
77     {
78 #if !defined(ASN_DISABLE_OER_SUPPORT)
79         0,
80 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
81 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
82         0,
83 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
84         asn_generic_no_constraint
85     },
86     0, 0,  /* No members */
87     0  /* No specifics */
88 };
89
90 void
91 NULL_free(const asn_TYPE_descriptor_t *td, void *ptr,
92           enum asn_struct_free_method method) {
93     if(td && ptr) {
94         switch(method) {
95         case ASFM_FREE_EVERYTHING:
96             FREEMEM(ptr);
97             break;
98         case ASFM_FREE_UNDERLYING:
99             break;
100         case ASFM_FREE_UNDERLYING_AND_RESET:
101             memset(ptr, 0, sizeof(NULL_t));
102             break;
103         }
104     }
105 }
106
107 int
108 NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) {
109     (void)td;
110     (void)a;
111     (void)b;
112     return 0;
113 }