new E2AP and E2SMKPM files
[o-du/l2.git] / src / codec_utils / E2AP_MASTER / InitiatingMessageE2.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "E2AP-PDU-Descriptions"
4  *      found in "E2AP.asn1"
5  *      `asn1c -D ./out -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "InitiatingMessageE2.h"
9
10 static const long asn_VAL_1_id_RICsubscription = 8;
11 static const long asn_VAL_1_reject = 0;
12 static const long asn_VAL_2_id_RICsubscriptionDelete = 9;
13 static const long asn_VAL_2_reject = 0;
14 static const long asn_VAL_3_id_RICserviceUpdate = 7;
15 static const long asn_VAL_3_reject = 0;
16 static const long asn_VAL_4_id_RICcontrol = 4;
17 static const long asn_VAL_4_reject = 0;
18 static const long asn_VAL_5_id_E2setup = 1;
19 static const long asn_VAL_5_reject = 0;
20 static const long asn_VAL_6_id_Reset = 3;
21 static const long asn_VAL_6_reject = 0;
22 static const long asn_VAL_7_id_RICindication = 5;
23 static const long asn_VAL_7_ignore = 1;
24 static const long asn_VAL_8_id_RICserviceQuery = 6;
25 static const long asn_VAL_8_ignore = 1;
26 static const long asn_VAL_9_id_ErrorIndicationE2 = 2;
27 static const long asn_VAL_9_ignore = 1;
28 static const asn_ioc_cell_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
29         { "&InitiatingMessageE2", aioc__type, &asn_DEF_RICsubscriptionRequest },
30         { "&SuccessfulOutcomeE2", aioc__type, &asn_DEF_RICsubscriptionResponse },
31         { "&UnsuccessfulOutcomeE2", aioc__type, &asn_DEF_RICsubscriptionFailure },
32         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_1_id_RICsubscription },
33         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_1_reject },
34         { "&InitiatingMessageE2", aioc__type, &asn_DEF_RICsubscriptionDeleteRequest },
35         { "&SuccessfulOutcomeE2", aioc__type, &asn_DEF_RICsubscriptionDeleteResponse },
36         { "&UnsuccessfulOutcomeE2", aioc__type, &asn_DEF_RICsubscriptionDeleteFailure },
37         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_2_id_RICsubscriptionDelete },
38         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_2_reject },
39         { "&InitiatingMessageE2", aioc__type, &asn_DEF_RICserviceUpdate },
40         { "&SuccessfulOutcomeE2", aioc__type, &asn_DEF_RICserviceUpdateAcknowledge },
41         { "&UnsuccessfulOutcomeE2", aioc__type, &asn_DEF_RICserviceUpdateFailure },
42         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_3_id_RICserviceUpdate },
43         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_3_reject },
44         { "&InitiatingMessageE2", aioc__type, &asn_DEF_RICcontrolRequest },
45         { "&SuccessfulOutcomeE2", aioc__type, &asn_DEF_RICcontrolAcknowledge },
46         { "&UnsuccessfulOutcomeE2", aioc__type, &asn_DEF_RICcontrolFailure },
47         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_4_id_RICcontrol },
48         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_4_reject },
49         { "&InitiatingMessageE2", aioc__type, &asn_DEF_E2setupRequest },
50         { "&SuccessfulOutcomeE2", aioc__type, &asn_DEF_E2setupResponse },
51         { "&UnsuccessfulOutcomeE2", aioc__type, &asn_DEF_E2setupFailure },
52         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_5_id_E2setup },
53         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_5_reject },
54         { "&InitiatingMessageE2", aioc__type, &asn_DEF_ResetRequest },
55         { "&SuccessfulOutcomeE2", aioc__type, &asn_DEF_ResetResponse },
56         { "&UnsuccessfulOutcomeE2",  },
57         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_6_id_Reset },
58         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_6_reject },
59         { "&InitiatingMessageE2", aioc__type, &asn_DEF_RICindication },
60         { "&SuccessfulOutcomeE2",  },
61         { "&UnsuccessfulOutcomeE2",  },
62         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_7_id_RICindication },
63         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_7_ignore },
64         { "&InitiatingMessageE2", aioc__type, &asn_DEF_RICserviceQuery },
65         { "&SuccessfulOutcomeE2",  },
66         { "&UnsuccessfulOutcomeE2",  },
67         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_8_id_RICserviceQuery },
68         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_8_ignore },
69         { "&InitiatingMessageE2", aioc__type, &asn_DEF_ErrorIndicationE2 },
70         { "&SuccessfulOutcomeE2",  },
71         { "&UnsuccessfulOutcomeE2",  },
72         { "&procedureCode", aioc__value, &asn_DEF_ProcedureCodeE2, &asn_VAL_9_id_ErrorIndicationE2 },
73         { "&criticality", aioc__value, &asn_DEF_CriticalityE2, &asn_VAL_9_ignore }
74 };
75 static const asn_ioc_set_t asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1[] = {
76         { 9, 5, asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1_rows }
77 };
78 static int
79 memb_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
80                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
81         long value;
82         
83         if(!sptr) {
84                 ASN__CTFAIL(app_key, td, sptr,
85                         "%s: value not given (%s:%d)",
86                         td->name, __FILE__, __LINE__);
87                 return -1;
88         }
89         
90         value = *(const long *)sptr;
91         
92         if((value >= 0 && value <= 255)) {
93                 /* Constraint check succeeded */
94                 return 0;
95         } else {
96                 ASN__CTFAIL(app_key, td, sptr,
97                         "%s: constraint failed (%s:%d)",
98                         td->name, __FILE__, __LINE__);
99                 return -1;
100         }
101 }
102
103 static asn_type_selector_result_t
104 select_InitiatingMessageE2_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
105         asn_type_selector_result_t result = {0, 0};
106         const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
107         size_t constraining_column = 3; /* &procedureCode */
108         size_t for_column = 4; /* &criticality */
109         size_t row, presence_index = 0;
110         const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct InitiatingMessageE2, procedureCode));
111         
112         for(row=0; row < itable->rows_count; row++) {
113             const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
114             const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
115         
116             if(type_cell->cell_kind == aioc__undefined)
117                 continue;
118         
119             presence_index++;
120             if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
121                 result.type_descriptor = type_cell->type_descriptor;
122                 result.presence_index = presence_index;
123                 break;
124             }
125         }
126         
127         return result;
128 }
129
130 static int
131 memb_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
132                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
133         
134         if(!sptr) {
135                 ASN__CTFAIL(app_key, td, sptr,
136                         "%s: value not given (%s:%d)",
137                         td->name, __FILE__, __LINE__);
138                 return -1;
139         }
140         
141         
142         if(1 /* No applicable constraints whatsoever */) {
143                 /* Nothing is here. See below */
144         }
145         
146         return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
147 }
148
149 static asn_type_selector_result_t
150 select_InitiatingMessageE2_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
151         asn_type_selector_result_t result = {0, 0};
152         const asn_ioc_set_t *itable = asn_IOS_E2AP_ELEMENTARY_PROCEDURES_1;
153         size_t constraining_column = 3; /* &procedureCode */
154         size_t for_column = 0; /* &InitiatingMessageE2 */
155         size_t row, presence_index = 0;
156         const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct InitiatingMessageE2, procedureCode));
157         
158         for(row=0; row < itable->rows_count; row++) {
159             const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
160             const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
161         
162             if(type_cell->cell_kind == aioc__undefined)
163                 continue;
164         
165             presence_index++;
166             if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
167                 result.type_descriptor = type_cell->type_descriptor;
168                 result.presence_index = presence_index;
169                 break;
170             }
171         }
172         
173         return result;
174 }
175
176 static int
177 memb_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
178                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
179         
180         if(!sptr) {
181                 ASN__CTFAIL(app_key, td, sptr,
182                         "%s: value not given (%s:%d)",
183                         td->name, __FILE__, __LINE__);
184                 return -1;
185         }
186         
187         
188         if(1 /* No applicable constraints whatsoever */) {
189                 /* Nothing is here. See below */
190         }
191         
192         return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
193 }
194
195 static asn_oer_constraints_t asn_OER_memb_procedureCode_constr_2 CC_NOTUSED = {
196         { 1, 1 }        /* (0..255) */,
197         -1};
198 static asn_per_constraints_t asn_PER_memb_procedureCode_constr_2 CC_NOTUSED = {
199         { APC_CONSTRAINED,       8,  8,  0,  255 }      /* (0..255) */,
200         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
201         0, 0    /* No PER value map */
202 };
203 static asn_oer_constraints_t asn_OER_memb_criticality_constr_3 CC_NOTUSED = {
204         { 0, 0 },
205         -1};
206 static asn_per_constraints_t asn_PER_memb_criticality_constr_3 CC_NOTUSED = {
207         { APC_CONSTRAINED,       2,  2,  0,  2 }        /* (0..2) */,
208         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
209         0, 0    /* No PER value map */
210 };
211 static asn_oer_constraints_t asn_OER_memb_value_constr_4 CC_NOTUSED = {
212         { 0, 0 },
213         -1};
214 static asn_per_constraints_t asn_PER_memb_value_constr_4 CC_NOTUSED = {
215         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
216         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
217         0, 0    /* No PER value map */
218 };
219 static asn_TYPE_member_t asn_MBR_value_4[] = {
220         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.RICsubscriptionRequest),
221                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
222                 0,
223                 &asn_DEF_RICsubscriptionRequest,
224                 0,
225                 { 0, 0, 0 },
226                 0, 0, /* No default value */
227                 "RICsubscriptionRequest"
228                 },
229         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.RICsubscriptionDeleteRequest),
230                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
231                 0,
232                 &asn_DEF_RICsubscriptionDeleteRequest,
233                 0,
234                 { 0, 0, 0 },
235                 0, 0, /* No default value */
236                 "RICsubscriptionDeleteRequest"
237                 },
238         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.RICserviceUpdate),
239                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
240                 0,
241                 &asn_DEF_RICserviceUpdate,
242                 0,
243                 { 0, 0, 0 },
244                 0, 0, /* No default value */
245                 "RICserviceUpdate"
246                 },
247         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.RICcontrolRequest),
248                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
249                 0,
250                 &asn_DEF_RICcontrolRequest,
251                 0,
252                 { 0, 0, 0 },
253                 0, 0, /* No default value */
254                 "RICcontrolRequest"
255                 },
256         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.E2setupRequest),
257                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
258                 0,
259                 &asn_DEF_E2setupRequest,
260                 0,
261                 { 0, 0, 0 },
262                 0, 0, /* No default value */
263                 "E2setupRequest"
264                 },
265         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.ResetRequest),
266                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
267                 0,
268                 &asn_DEF_ResetRequest,
269                 0,
270                 { 0, 0, 0 },
271                 0, 0, /* No default value */
272                 "ResetRequest"
273                 },
274         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.RICindication),
275                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
276                 0,
277                 &asn_DEF_RICindication,
278                 0,
279                 { 0, 0, 0 },
280                 0, 0, /* No default value */
281                 "RICindication"
282                 },
283         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.RICserviceQuery),
284                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
285                 0,
286                 &asn_DEF_RICserviceQuery,
287                 0,
288                 { 0, 0, 0 },
289                 0, 0, /* No default value */
290                 "RICserviceQuery"
291                 },
292         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2__value, choice.ErrorIndicationE2),
293                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
294                 0,
295                 &asn_DEF_ErrorIndicationE2,
296                 0,
297                 { 0, 0, 0 },
298                 0, 0, /* No default value */
299                 "ErrorIndicationE2"
300                 },
301 };
302 static const asn_TYPE_tag2member_t asn_MAP_value_tag2el_4[] = {
303     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 8 }, /* RICsubscriptionRequest */
304     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 7 }, /* RICsubscriptionDeleteRequest */
305     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 6 }, /* RICserviceUpdate */
306     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 5 }, /* RICcontrolRequest */
307     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 4 }, /* E2setupRequest */
308     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 5, -5, 3 }, /* ResetRequest */
309     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 6, -6, 2 }, /* RICindication */
310     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 7, -7, 1 }, /* RICserviceQuery */
311     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 8, -8, 0 } /* ErrorIndicationE2 */
312 };
313 static asn_CHOICE_specifics_t asn_SPC_value_specs_4 = {
314         sizeof(struct InitiatingMessageE2__value),
315         offsetof(struct InitiatingMessageE2__value, _asn_ctx),
316         offsetof(struct InitiatingMessageE2__value, present),
317         sizeof(((struct InitiatingMessageE2__value *)0)->present),
318         asn_MAP_value_tag2el_4,
319         9,      /* Count of tags in the map */
320         0, 0,
321         -1      /* Extensions start */
322 };
323 static /* Use -fall-defs-global to expose */
324 asn_TYPE_descriptor_t asn_DEF_value_4 = {
325         "value",
326         "value",
327         &asn_OP_OPEN_TYPE,
328         0,      /* No effective tags (pointer) */
329         0,      /* No effective tags (count) */
330         0,      /* No tags (pointer) */
331         0,      /* No tags (count) */
332         { 0, 0, OPEN_TYPE_constraint },
333         asn_MBR_value_4,
334         9,      /* Elements count */
335         &asn_SPC_value_specs_4  /* Additional specs */
336 };
337
338 asn_TYPE_member_t asn_MBR_InitiatingMessageE2_1[] = {
339         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2, procedureCode),
340                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
341                 -1,     /* IMPLICIT tag at current level */
342                 &asn_DEF_ProcedureCodeE2,
343                 0,
344                 { &asn_OER_memb_procedureCode_constr_2, &asn_PER_memb_procedureCode_constr_2,  memb_procedureCode_constraint_1 },
345                 0, 0, /* No default value */
346                 "procedureCode"
347                 },
348         { ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2, criticality),
349                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
350                 -1,     /* IMPLICIT tag at current level */
351                 &asn_DEF_CriticalityE2,
352                 select_InitiatingMessageE2_criticality_type,
353                 { &asn_OER_memb_criticality_constr_3, &asn_PER_memb_criticality_constr_3,  memb_criticality_constraint_1 },
354                 0, 0, /* No default value */
355                 "criticality"
356                 },
357         { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct InitiatingMessageE2, value),
358                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
359                 +1,     /* EXPLICIT tag at current level */
360                 &asn_DEF_value_4,
361                 select_InitiatingMessageE2_value_type,
362                 { &asn_OER_memb_value_constr_4, &asn_PER_memb_value_constr_4,  memb_value_constraint_1 },
363                 0, 0, /* No default value */
364                 "value"
365                 },
366 };
367 static const ber_tlv_tag_t asn_DEF_InitiatingMessageE2_tags_1[] = {
368         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
369 };
370 static const asn_TYPE_tag2member_t asn_MAP_InitiatingMessageE2_tag2el_1[] = {
371     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
372     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
373     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
374 };
375 asn_SEQUENCE_specifics_t asn_SPC_InitiatingMessageE2_specs_1 = {
376         sizeof(struct InitiatingMessageE2),
377         offsetof(struct InitiatingMessageE2, _asn_ctx),
378         asn_MAP_InitiatingMessageE2_tag2el_1,
379         3,      /* Count of tags in the map */
380         0, 0, 0,        /* Optional elements (not needed) */
381         -1,     /* First extension addition */
382 };
383 asn_TYPE_descriptor_t asn_DEF_InitiatingMessageE2 = {
384         "InitiatingMessageE2",
385         "InitiatingMessageE2",
386         &asn_OP_SEQUENCE,
387         asn_DEF_InitiatingMessageE2_tags_1,
388         sizeof(asn_DEF_InitiatingMessageE2_tags_1)
389                 /sizeof(asn_DEF_InitiatingMessageE2_tags_1[0]), /* 1 */
390         asn_DEF_InitiatingMessageE2_tags_1,     /* Same as above */
391         sizeof(asn_DEF_InitiatingMessageE2_tags_1)
392                 /sizeof(asn_DEF_InitiatingMessageE2_tags_1[0]), /* 1 */
393         { 0, 0, SEQUENCE_constraint },
394         asn_MBR_InitiatingMessageE2_1,
395         3,      /* Elements count */
396         &asn_SPC_InitiatingMessageE2_specs_1    /* Additional specs */
397 };
398