RICPLT-2981 SubFail go asn into use
[ric-plt/submgr.git] / 3rdparty / libe2ap / DynamicNAICSInformation.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "Spec/e2_and_x2-combined-and-minimized.asn1"
5  *      `asn1c -pdu=auto -fincludes-quoted -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example`
6  */
7
8 #include "DynamicNAICSInformation.h"
9
10 #include "ProtocolExtensionContainer.h"
11 static int
12 memb_transmissionModes_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
13                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
14         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
15         size_t size;
16         
17         if(!sptr) {
18                 ASN__CTFAIL(app_key, td, sptr,
19                         "%s: value not given (%s:%d)",
20                         td->name, __FILE__, __LINE__);
21                 return -1;
22         }
23         
24         if(st->size > 0) {
25                 /* Size in bits */
26                 size = 8 * st->size - (st->bits_unused & 0x07);
27         } else {
28                 size = 0;
29         }
30         
31         if((size == 8)) {
32                 /* Constraint check succeeded */
33                 return 0;
34         } else {
35                 ASN__CTFAIL(app_key, td, sptr,
36                         "%s: constraint failed (%s:%d)",
37                         td->name, __FILE__, __LINE__);
38                 return -1;
39         }
40 }
41
42 static int
43 memb_pB_information_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
44                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
45         long value;
46         
47         if(!sptr) {
48                 ASN__CTFAIL(app_key, td, sptr,
49                         "%s: value not given (%s:%d)",
50                         td->name, __FILE__, __LINE__);
51                 return -1;
52         }
53         
54         value = *(const long *)sptr;
55         
56         if((value >= 0 && value <= 3)) {
57                 /* Constraint check succeeded */
58                 return 0;
59         } else {
60                 ASN__CTFAIL(app_key, td, sptr,
61                         "%s: constraint failed (%s:%d)",
62                         td->name, __FILE__, __LINE__);
63                 return -1;
64         }
65 }
66
67 static int
68 memb_pA_list_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
69                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
70         size_t size;
71         
72         if(!sptr) {
73                 ASN__CTFAIL(app_key, td, sptr,
74                         "%s: value not given (%s:%d)",
75                         td->name, __FILE__, __LINE__);
76                 return -1;
77         }
78         
79         /* Determine the number of elements */
80         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
81         
82         if((size <= 3)) {
83                 /* Perform validation of the inner elements */
84                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
85         } else {
86                 ASN__CTFAIL(app_key, td, sptr,
87                         "%s: constraint failed (%s:%d)",
88                         td->name, __FILE__, __LINE__);
89                 return -1;
90         }
91 }
92
93 static asn_per_constraints_t asn_PER_type_pA_list_constr_4 CC_NOTUSED = {
94         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
95         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (SIZE(0..3)) */,
96         0, 0    /* No PER value map */
97 };
98 static asn_per_constraints_t asn_PER_memb_transmissionModes_constr_2 CC_NOTUSED = {
99         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
100         { APC_CONSTRAINED,       0,  0,  8,  8 }        /* (SIZE(8..8)) */,
101         0, 0    /* No PER value map */
102 };
103 static asn_per_constraints_t asn_PER_memb_pB_information_constr_3 CC_NOTUSED = {
104         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (0..3) */,
105         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
106         0, 0    /* No PER value map */
107 };
108 static asn_per_constraints_t asn_PER_memb_pA_list_constr_4 CC_NOTUSED = {
109         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
110         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (SIZE(0..3)) */,
111         0, 0    /* No PER value map */
112 };
113 static asn_TYPE_member_t asn_MBR_pA_list_4[] = {
114         { ATF_POINTER, 0, 0,
115                 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
116                 0,
117                 &asn_DEF_PA_Values,
118                 0,
119                 { 0, 0, 0 },
120                 0, 0, /* No default value */
121                 ""
122                 },
123 };
124 static const ber_tlv_tag_t asn_DEF_pA_list_tags_4[] = {
125         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
126         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
127 };
128 static asn_SET_OF_specifics_t asn_SPC_pA_list_specs_4 = {
129         sizeof(struct DynamicNAICSInformation__pA_list),
130         offsetof(struct DynamicNAICSInformation__pA_list, _asn_ctx),
131         1,      /* XER encoding is XMLValueList */
132 };
133 static /* Use -fall-defs-global to expose */
134 asn_TYPE_descriptor_t asn_DEF_pA_list_4 = {
135         "pA-list",
136         "pA-list",
137         &asn_OP_SEQUENCE_OF,
138         asn_DEF_pA_list_tags_4,
139         sizeof(asn_DEF_pA_list_tags_4)
140                 /sizeof(asn_DEF_pA_list_tags_4[0]) - 1, /* 1 */
141         asn_DEF_pA_list_tags_4, /* Same as above */
142         sizeof(asn_DEF_pA_list_tags_4)
143                 /sizeof(asn_DEF_pA_list_tags_4[0]), /* 2 */
144         { 0, &asn_PER_type_pA_list_constr_4, SEQUENCE_OF_constraint },
145         asn_MBR_pA_list_4,
146         1,      /* Single element */
147         &asn_SPC_pA_list_specs_4        /* Additional specs */
148 };
149
150 asn_TYPE_member_t asn_MBR_DynamicNAICSInformation_1[] = {
151         { ATF_POINTER, 2, offsetof(struct DynamicNAICSInformation, transmissionModes),
152                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
153                 -1,     /* IMPLICIT tag at current level */
154                 &asn_DEF_BIT_STRING,
155                 0,
156                 { 0, &asn_PER_memb_transmissionModes_constr_2,  memb_transmissionModes_constraint_1 },
157                 0, 0, /* No default value */
158                 "transmissionModes"
159                 },
160         { ATF_POINTER, 1, offsetof(struct DynamicNAICSInformation, pB_information),
161                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
162                 -1,     /* IMPLICIT tag at current level */
163                 &asn_DEF_NativeInteger,
164                 0,
165                 { 0, &asn_PER_memb_pB_information_constr_3,  memb_pB_information_constraint_1 },
166                 0, 0, /* No default value */
167                 "pB-information"
168                 },
169         { ATF_NOFLAGS, 0, offsetof(struct DynamicNAICSInformation, pA_list),
170                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
171                 0,
172                 &asn_DEF_pA_list_4,
173                 0,
174                 { 0, &asn_PER_memb_pA_list_constr_4,  memb_pA_list_constraint_1 },
175                 0, 0, /* No default value */
176                 "pA-list"
177                 },
178         { ATF_POINTER, 1, offsetof(struct DynamicNAICSInformation, iE_Extensions),
179                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
180                 -1,     /* IMPLICIT tag at current level */
181                 &asn_DEF_ProtocolExtensionContainer_8858P38,
182                 0,
183                 { 0, 0, 0 },
184                 0, 0, /* No default value */
185                 "iE-Extensions"
186                 },
187 };
188 static const int asn_MAP_DynamicNAICSInformation_oms_1[] = { 0, 1, 3 };
189 static const ber_tlv_tag_t asn_DEF_DynamicNAICSInformation_tags_1[] = {
190         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
191 };
192 static const asn_TYPE_tag2member_t asn_MAP_DynamicNAICSInformation_tag2el_1[] = {
193     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* transmissionModes */
194     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* pB-information */
195     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* pA-list */
196     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
197 };
198 asn_SEQUENCE_specifics_t asn_SPC_DynamicNAICSInformation_specs_1 = {
199         sizeof(struct DynamicNAICSInformation),
200         offsetof(struct DynamicNAICSInformation, _asn_ctx),
201         asn_MAP_DynamicNAICSInformation_tag2el_1,
202         4,      /* Count of tags in the map */
203         asn_MAP_DynamicNAICSInformation_oms_1,  /* Optional members */
204         3, 0,   /* Root/Additions */
205         4,      /* First extension addition */
206 };
207 asn_TYPE_descriptor_t asn_DEF_DynamicNAICSInformation = {
208         "DynamicNAICSInformation",
209         "DynamicNAICSInformation",
210         &asn_OP_SEQUENCE,
211         asn_DEF_DynamicNAICSInformation_tags_1,
212         sizeof(asn_DEF_DynamicNAICSInformation_tags_1)
213                 /sizeof(asn_DEF_DynamicNAICSInformation_tags_1[0]), /* 1 */
214         asn_DEF_DynamicNAICSInformation_tags_1, /* Same as above */
215         sizeof(asn_DEF_DynamicNAICSInformation_tags_1)
216                 /sizeof(asn_DEF_DynamicNAICSInformation_tags_1[0]), /* 1 */
217         { 0, 0, SEQUENCE_constraint },
218         asn_MBR_DynamicNAICSInformation_1,
219         4,      /* Elements count */
220         &asn_SPC_DynamicNAICSInformation_specs_1        /* Additional specs */
221 };
222