Enhanced SIM for E2AP v1 for TS UC
[sim/e2-interface.git] / e2sim / e2apv1sim / ASN1c / SuccessfulOutcome.c
1 /*
2  *
3  * Copyright 2020 AT&T Intellectual Property
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18
19 /*
20  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
21  * From ASN.1 module "E2AP-PDU-Descriptions"
22  *      found in "../asnTextFiles/e2ap-v01.00.00.asn"
23  *      `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D.`
24  */
25
26 #include "SuccessfulOutcome.h"
27
28 static const long asn_VAL_1_id_RICsubscription = 8;
29 static const long asn_VAL_1_reject = 0;
30 static const long asn_VAL_2_id_RICsubscriptionDelete = 9;
31 static const long asn_VAL_2_reject = 0;
32 static const long asn_VAL_3_id_RICserviceUpdate = 7;
33 static const long asn_VAL_3_reject = 0;
34 static const long asn_VAL_4_id_RICcontrol = 4;
35 static const long asn_VAL_4_reject = 0;
36 static const long asn_VAL_5_id_E2setup = 1;
37 static const long asn_VAL_5_reject = 0;
38 static const long asn_VAL_6_id_Reset = 3;
39 static const long asn_VAL_6_reject = 0;
40 static const long asn_VAL_7_id_RICindication = 5;
41 static const long asn_VAL_7_ignore = 1;
42 static const long asn_VAL_8_id_RICserviceQuery = 6;
43 static const long asn_VAL_8_ignore = 1;
44 static const long asn_VAL_9_id_ErrorIndication = 2;
45 static const long asn_VAL_9_ignore = 1;
46 static const asn_ioc_cell_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
47         { "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionRequest },
48         { "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionResponse },
49         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionFailure },
50         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_1_id_RICsubscription },
51         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_1_reject },
52         { "&InitiatingMessage", aioc__type, &asn_DEF_RICsubscriptionDeleteRequest },
53         { "&SuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteResponse },
54         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICsubscriptionDeleteFailure },
55         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_2_id_RICsubscriptionDelete },
56         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_2_reject },
57         { "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceUpdate },
58         { "&SuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateAcknowledge },
59         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICserviceUpdateFailure },
60         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_3_id_RICserviceUpdate },
61         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_3_reject },
62         { "&InitiatingMessage", aioc__type, &asn_DEF_RICcontrolRequest },
63         { "&SuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolAcknowledge },
64         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_RICcontrolFailure },
65         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_4_id_RICcontrol },
66         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_4_reject },
67         { "&InitiatingMessage", aioc__type, &asn_DEF_E2setupRequest },
68         { "&SuccessfulOutcome", aioc__type, &asn_DEF_E2setupResponse },
69         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2setupFailure },
70         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_5_id_E2setup },
71         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_5_reject },
72         { "&InitiatingMessage", aioc__type, &asn_DEF_ResetRequest },
73         { "&SuccessfulOutcome", aioc__type, &asn_DEF_ResetResponse },
74         { "&UnsuccessfulOutcome",  },
75         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_6_id_Reset },
76         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_6_reject },
77         { "&InitiatingMessage", aioc__type, &asn_DEF_RICindication },
78         { "&SuccessfulOutcome",  },
79         { "&UnsuccessfulOutcome",  },
80         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_7_id_RICindication },
81         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_7_ignore },
82         { "&InitiatingMessage", aioc__type, &asn_DEF_RICserviceQuery },
83         { "&SuccessfulOutcome",  },
84         { "&UnsuccessfulOutcome",  },
85         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_8_id_RICserviceQuery },
86         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_8_ignore },
87         { "&InitiatingMessage", aioc__type, &asn_DEF_ErrorIndication },
88         { "&SuccessfulOutcome",  },
89         { "&UnsuccessfulOutcome",  },
90         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCode, &asn_VAL_9_id_ErrorIndication },
91         { "&criticality", aioc__value, &asn_DEF_Criticality, &asn_VAL_9_ignore }
92 };
93 static const asn_ioc_set_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1[] = {
94         { 9, 5, asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows }
95 };
96 static int
97 memb_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
98                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
99         long value;
100         
101         if(!sptr) {
102                 ASN__CTFAIL(app_key, td, sptr,
103                         "%s: value not given (%s:%d)",
104                         td->name, __FILE__, __LINE__);
105                 return -1;
106         }
107         
108         value = *(const long *)sptr;
109         
110         if((value >= 0 && value <= 255)) {
111                 /* Constraint check succeeded */
112                 return 0;
113         } else {
114                 ASN__CTFAIL(app_key, td, sptr,
115                         "%s: constraint failed (%s:%d)",
116                         td->name, __FILE__, __LINE__);
117                 return -1;
118         }
119 }
120
121 static asn_type_selector_result_t
122 select_SuccessfulOutcome_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
123         asn_type_selector_result_t result = {0, 0};
124         const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
125         size_t constraining_column = 3; /* &procedureCode */
126         size_t for_column = 4; /* &criticality */
127         size_t row, presence_index = 0;
128         const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SuccessfulOutcome, procedureCode));
129         
130         for(row=0; row < itable->rows_count; row++) {
131             const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
132             const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
133         
134             if(type_cell->cell_kind == aioc__undefined)
135                 continue;
136         
137             presence_index++;
138             if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
139                 result.type_descriptor = type_cell->type_descriptor;
140                 result.presence_index = presence_index;
141                 break;
142             }
143         }
144         
145         return result;
146 }
147
148 static int
149 memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
150                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
151         
152         if(!sptr) {
153                 ASN__CTFAIL(app_key, td, sptr,
154                         "%s: value not given (%s:%d)",
155                         td->name, __FILE__, __LINE__);
156                 return -1;
157         }
158         
159         
160         if(1 /* No applicable constraints whatsoever */) {
161                 /* Nothing is here. See below */
162         }
163         
164         return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
165 }
166
167 static asn_type_selector_result_t
168 select_SuccessfulOutcome_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
169         asn_type_selector_result_t result = {0, 0};
170         const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
171         size_t constraining_column = 3; /* &procedureCode */
172         size_t for_column = 1; /* &SuccessfulOutcome */
173         size_t row, presence_index = 0;
174         const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SuccessfulOutcome, procedureCode));
175         
176         for(row=0; row < itable->rows_count; row++) {
177             const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
178             const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
179         
180             if(type_cell->cell_kind == aioc__undefined)
181                 continue;
182         
183             presence_index++;
184             if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
185                 result.type_descriptor = type_cell->type_descriptor;
186                 result.presence_index = presence_index;
187                 break;
188             }
189         }
190         
191         return result;
192 }
193
194 static int
195 memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
196                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
197         
198         if(!sptr) {
199                 ASN__CTFAIL(app_key, td, sptr,
200                         "%s: value not given (%s:%d)",
201                         td->name, __FILE__, __LINE__);
202                 return -1;
203         }
204         
205         
206         if(1 /* No applicable constraints whatsoever */) {
207                 /* Nothing is here. See below */
208         }
209         
210         return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
211 }
212
213 static asn_per_constraints_t asn_PER_memb_procedureCode_constr_2 CC_NOTUSED = {
214         { APC_CONSTRAINED,       8,  8,  0,  255 }      /* (0..255) */,
215         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
216         0, 0    /* No PER value map */
217 };
218 static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
219         { APC_CONSTRAINED,       2,  2,  0,  2 }        /* (0..2) */,
220         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
221         0, 0    /* No PER value map */
222 };
223 static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
224         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
225         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
226         0, 0    /* No PER value map */
227 };
228 static asn_TYPE_member_t asn_MBR_value_4[] = {
229         { ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICsubscriptionResponse),
230                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
231                 0,
232                 &asn_DEF_RICsubscriptionResponse,
233                 0,
234                 { 0, 0, 0 },
235                 0, 0, /* No default value */
236                 "RICsubscriptionResponse"
237                 },
238         { ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICsubscriptionDeleteResponse),
239                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
240                 0,
241                 &asn_DEF_RICsubscriptionDeleteResponse,
242                 0,
243                 { 0, 0, 0 },
244                 0, 0, /* No default value */
245                 "RICsubscriptionDeleteResponse"
246                 },
247         { ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICserviceUpdateAcknowledge),
248                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
249                 0,
250                 &asn_DEF_RICserviceUpdateAcknowledge,
251                 0,
252                 { 0, 0, 0 },
253                 0, 0, /* No default value */
254                 "RICserviceUpdateAcknowledge"
255                 },
256         { ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.RICcontrolAcknowledge),
257                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
258                 0,
259                 &asn_DEF_RICcontrolAcknowledge,
260                 0,
261                 { 0, 0, 0 },
262                 0, 0, /* No default value */
263                 "RICcontrolAcknowledge"
264                 },
265         { ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.E2setupResponse),
266                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
267                 0,
268                 &asn_DEF_E2setupResponse,
269                 0,
270                 { 0, 0, 0 },
271                 0, 0, /* No default value */
272                 "E2setupResponse"
273                 },
274         { ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome__value, choice.ResetResponse),
275                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
276                 0,
277                 &asn_DEF_ResetResponse,
278                 0,
279                 { 0, 0, 0 },
280                 0, 0, /* No default value */
281                 "ResetResponse"
282                 },
283 };
284 static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
285     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 5 }, /* RICsubscriptionResponse */
286     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 4 }, /* RICsubscriptionDeleteResponse */
287     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 3 }, /* RICserviceUpdateAcknowledge */
288     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 2 }, /* RICcontrolAcknowledge */
289     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 1 }, /* E2setupResponse */
290     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 5, -5, 0 } /* ResetResponse */
291 };
292 static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
293         sizeof(struct SuccessfulOutcome__value),
294         offsetof(struct SuccessfulOutcome__value, _asn_ctx),
295         offsetof(struct SuccessfulOutcome__value, present),
296         sizeof(((struct SuccessfulOutcome__value *)0)->present),
297         asn_MAP_value_tag2el_4,
298         6,      /* Count of tags in the map */
299         0, 0,
300         -1      /* Extensions start */
301 };
302 static /* Use -fall-defs-global to expose */
303 asn_TYPE_descriptor_t asn_DEF_value_4 = {
304         "value",
305         "value",
306         &asn_OP_OPEN_TYPE,
307         0,      /* No effective tags (pointer) */
308         0,      /* No effective tags (count) */
309         0,      /* No tags (pointer) */
310         0,      /* No tags (count) */
311         { 0, 0, OPEN_TYPE_constraint },
312         asn_MBR_value_4,
313         6,      /* Elements count */
314         &asn_SPC_value_specs_4  /* Additional specs */
315 };
316
317 asn_TYPE_member_t asn_MBR_SuccessfulOutcome_1[] = {
318         { ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, procedureCode),
319                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
320                 -1,     /* IMPLICIT tag at current level */
321                 &asn_DEF_ProcedureCode,
322                 0,
323                 { 0, &asn_PER_memb_procedureCode_constr_2,  memb_procedureCode_constraint_1 },
324                 0, 0, /* No default value */
325                 "procedureCode"
326                 },
327         { ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, criticality),
328                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
329                 -1,     /* IMPLICIT tag at current level */
330                 &asn_DEF_Criticality,
331                 select_SuccessfulOutcome_criticality_type,
332                 { 0, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
333                 0, 0, /* No default value */
334                 "criticality"
335                 },
336         { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct SuccessfulOutcome, value),
337                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
338                 +1,     /* EXPLICIT tag at current level */
339                 &asn_DEF_value_4,
340                 select_SuccessfulOutcome_value_type,
341                 { 0, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
342                 0, 0, /* No default value */
343                 "value"
344                 },
345 };
346 static const ber_tlv_tag_t asn_DEF_SuccessfulOutcome_tags_1[] = {
347         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
348 };
349 static const asn_TYPE_tag2member_t asn_MAP_SuccessfulOutcome_tag2el_1[] = {
350     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
351     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
352     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
353 };
354 asn_SEQUENCE_specifics_t asn_SPC_SuccessfulOutcome_specs_1 = {
355         sizeof(struct SuccessfulOutcome),
356         offsetof(struct SuccessfulOutcome, _asn_ctx),
357         asn_MAP_SuccessfulOutcome_tag2el_1,
358         3,      /* Count of tags in the map */
359         0, 0, 0,        /* Optional elements (not needed) */
360         -1,     /* First extension addition */
361 };
362 asn_TYPE_descriptor_t asn_DEF_SuccessfulOutcome = {
363         "SuccessfulOutcome",
364         "SuccessfulOutcome",
365         &asn_OP_SEQUENCE,
366         asn_DEF_SuccessfulOutcome_tags_1,
367         sizeof(asn_DEF_SuccessfulOutcome_tags_1)
368                 /sizeof(asn_DEF_SuccessfulOutcome_tags_1[0]), /* 1 */
369         asn_DEF_SuccessfulOutcome_tags_1,       /* Same as above */
370         sizeof(asn_DEF_SuccessfulOutcome_tags_1)
371                 /sizeof(asn_DEF_SuccessfulOutcome_tags_1[0]), /* 1 */
372         { 0, 0, SEQUENCE_constraint },
373         asn_MBR_SuccessfulOutcome_1,
374         3,      /* Elements count */
375         &asn_SPC_SuccessfulOutcome_specs_1      /* Additional specs */
376 };
377