1. Transitioned to using latest asn1c compiler
[ric-app/admin.git] / asn1c_defs / E2N_InitiatingMessage.c
1 /*
2  * Generated by asn1c-0.9.29 n1 (http://lionet.info/asn1c)
3  * From ASN.1 module "E2AP-PDU-Descriptions"
4  *      found in "../../asn_defs/asn1/e2ap-v031-subset.asn"
5  *      `asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-OER`
6  */
7
8 #include "E2N_InitiatingMessage.h"
9
10 static const long asn_VAL_1_E2N_id_ricSubscription = 201;
11 static const long asn_VAL_1_E2N_reject = 0;
12 static const long asn_VAL_2_E2N_id_ricSubscriptionDelete = 202;
13 static const long asn_VAL_2_E2N_reject = 0;
14 static const long asn_VAL_3_E2N_id_ricServiceUpdate = 203;
15 static const long asn_VAL_3_E2N_reject = 0;
16 static const long asn_VAL_4_E2N_id_ricControl = 204;
17 static const long asn_VAL_4_E2N_reject = 0;
18 static const long asn_VAL_5_E2N_id_ricIndication = 205;
19 static const long asn_VAL_5_E2N_ignore = 1;
20 static const long asn_VAL_6_E2N_id_ricServiceQuery = 206;
21 static const long asn_VAL_6_E2N_ignore = 1;
22 static const asn_ioc_cell_t asn_IOS_E2N_E2AP_ELEMENTARY_PROCEDURES_1_rows[] = {
23         { "&InitiatingMessage", aioc__type, &asn_DEF_E2N_RICsubscriptionRequest },
24         { "&SuccessfulOutcome", aioc__type, &asn_DEF_E2N_RICsubscriptionResponse },
25         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2N_RICsubscriptionFailure },
26         { "&procedureCode", aioc__value, &asn_DEF_E2N_ProcedureCode, &asn_VAL_1_E2N_id_ricSubscription },
27         { "&criticality", aioc__value, &asn_DEF_E2N_Criticality, &asn_VAL_1_E2N_reject },
28         { "&InitiatingMessage", aioc__type, &asn_DEF_E2N_RICsubscriptionDeleteRequest },
29         { "&SuccessfulOutcome", aioc__type, &asn_DEF_E2N_RICsubscriptionDeleteResponse },
30         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2N_RICsubscriptionDeleteFailure },
31         { "&procedureCode", aioc__value, &asn_DEF_E2N_ProcedureCode, &asn_VAL_2_E2N_id_ricSubscriptionDelete },
32         { "&criticality", aioc__value, &asn_DEF_E2N_Criticality, &asn_VAL_2_E2N_reject },
33         { "&InitiatingMessage", aioc__type, &asn_DEF_E2N_RICserviceUpdate },
34         { "&SuccessfulOutcome", aioc__type, &asn_DEF_E2N_RICserviceUpdateAcknowledge },
35         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2N_RICserviceUpdateFailure },
36         { "&procedureCode", aioc__value, &asn_DEF_E2N_ProcedureCode, &asn_VAL_3_E2N_id_ricServiceUpdate },
37         { "&criticality", aioc__value, &asn_DEF_E2N_Criticality, &asn_VAL_3_E2N_reject },
38         { "&InitiatingMessage", aioc__type, &asn_DEF_E2N_RICcontrolRequest },
39         { "&SuccessfulOutcome", aioc__type, &asn_DEF_E2N_RICcontrolAcknowledge },
40         { "&UnsuccessfulOutcome", aioc__type, &asn_DEF_E2N_RICcontrolFailure },
41         { "&procedureCode", aioc__value, &asn_DEF_E2N_ProcedureCode, &asn_VAL_4_E2N_id_ricControl },
42         { "&criticality", aioc__value, &asn_DEF_E2N_Criticality, &asn_VAL_4_E2N_reject },
43         { "&InitiatingMessage", aioc__type, &asn_DEF_E2N_RICindication },
44         { "&SuccessfulOutcome",  },
45         { "&UnsuccessfulOutcome",  },
46         { "&procedureCode", aioc__value, &asn_DEF_E2N_ProcedureCode, &asn_VAL_5_E2N_id_ricIndication },
47         { "&criticality", aioc__value, &asn_DEF_E2N_Criticality, &asn_VAL_5_E2N_ignore },
48         { "&InitiatingMessage", aioc__type, &asn_DEF_E2N_RICserviceQuery },
49         { "&SuccessfulOutcome",  },
50         { "&UnsuccessfulOutcome",  },
51         { "&procedureCode", aioc__value, &asn_DEF_E2N_ProcedureCode, &asn_VAL_6_E2N_id_ricServiceQuery },
52         { "&criticality", aioc__value, &asn_DEF_E2N_Criticality, &asn_VAL_6_E2N_ignore }
53 };
54 static const asn_ioc_set_t asn_IOS_E2N_E2AP_ELEMENTARY_PROCEDURES_1[] = {
55         { 6, 5, asn_IOS_E2N_E2AP_ELEMENTARY_PROCEDURES_1_rows }
56 };
57 static int
58 memb_E2N_procedureCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
59                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
60         long value;
61         
62         if(!sptr) {
63                 ASN__CTFAIL(app_key, td, sptr,
64                         "%s: value not given (%s:%d)",
65                         td->name, __FILE__, __LINE__);
66                 return -1;
67         }
68         
69         value = *(const long *)sptr;
70         
71         if((value >= 0 && value <= 255)) {
72                 /* Constraint check succeeded */
73                 return 0;
74         } else {
75                 ASN__CTFAIL(app_key, td, sptr,
76                         "%s: constraint failed (%s:%d)",
77                         td->name, __FILE__, __LINE__);
78                 return -1;
79         }
80 }
81
82 static asn_type_selector_result_t
83 select_InitiatingMessage_E2N_criticality_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
84         asn_type_selector_result_t result = {0, 0};
85         const asn_ioc_set_t *itable = asn_IOS_E2N_E2AP_ELEMENTARY_PROCEDURES_1;
86         size_t constraining_column = 3; /* &procedureCode */
87         size_t for_column = 4; /* &criticality */
88         size_t row, presence_index = 0;
89         const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2N_InitiatingMessage, procedureCode));
90         
91         for(row=0; row < itable->rows_count; row++) {
92             const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
93             const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
94         
95             if(type_cell->cell_kind == aioc__undefined)
96                 continue;
97         
98             presence_index++;
99             if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
100                 result.type_descriptor = type_cell->type_descriptor;
101                 result.presence_index = presence_index;
102                 break;
103             }
104         }
105         
106         return result;
107 }
108
109 static int
110 memb_E2N_criticality_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
111                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
112         
113         if(!sptr) {
114                 ASN__CTFAIL(app_key, td, sptr,
115                         "%s: value not given (%s:%d)",
116                         td->name, __FILE__, __LINE__);
117                 return -1;
118         }
119         
120         
121         if(1 /* No applicable constraints whatsoever */) {
122                 /* Nothing is here. See below */
123         }
124         
125         return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
126 }
127
128 static asn_type_selector_result_t
129 select_InitiatingMessage_E2N_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
130         asn_type_selector_result_t result = {0, 0};
131         const asn_ioc_set_t *itable = asn_IOS_E2N_E2AP_ELEMENTARY_PROCEDURES_1;
132         size_t constraining_column = 3; /* &procedureCode */
133         size_t for_column = 0; /* &InitiatingMessage */
134         size_t row, presence_index = 0;
135         const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct E2N_InitiatingMessage, procedureCode));
136         
137         for(row=0; row < itable->rows_count; row++) {
138             const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
139             const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
140         
141             if(type_cell->cell_kind == aioc__undefined)
142                 continue;
143         
144             presence_index++;
145             if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
146                 result.type_descriptor = type_cell->type_descriptor;
147                 result.presence_index = presence_index;
148                 break;
149             }
150         }
151         
152         return result;
153 }
154
155 static int
156 memb_E2N_value_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
157                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
158         
159         if(!sptr) {
160                 ASN__CTFAIL(app_key, td, sptr,
161                         "%s: value not given (%s:%d)",
162                         td->name, __FILE__, __LINE__);
163                 return -1;
164         }
165         
166         
167         if(1 /* No applicable constraints whatsoever */) {
168                 /* Nothing is here. See below */
169         }
170         
171         return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
172 }
173
174 static asn_per_constraints_t asn_PER_memb_E2N_procedureCode_constr_2 CC_NOTUSED = {
175         { APC_CONSTRAINED,       8,  8,  0,  255 }      /* (0..255) */,
176         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
177         0, 0    /* No PER value map */
178 };
179 static asn_per_constraints_t asn_PER_memb_E2N_criticality_constr_3 CC_NOTUSED = {
180         { APC_CONSTRAINED,       2,  2,  0,  2 }        /* (0..2) */,
181         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
182         0, 0    /* No PER value map */
183 };
184 static asn_per_constraints_t asn_PER_memb_E2N_value_constr_4 CC_NOTUSED = {
185         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
186         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
187         0, 0    /* No PER value map */
188 };
189 static asn_TYPE_member_t asn_MBR_E2N_value_4[] = {
190         { ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage__value, choice.RICsubscriptionRequest),
191                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
192                 0,
193                 &asn_DEF_E2N_RICsubscriptionRequest,
194                 0,
195                 { 0, 0, 0 },
196                 0, 0, /* No default value */
197                 "RICsubscriptionRequest"
198                 },
199         { ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage__value, choice.RICsubscriptionDeleteRequest),
200                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
201                 0,
202                 &asn_DEF_E2N_RICsubscriptionDeleteRequest,
203                 0,
204                 { 0, 0, 0 },
205                 0, 0, /* No default value */
206                 "RICsubscriptionDeleteRequest"
207                 },
208         { ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage__value, choice.RICserviceUpdate),
209                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
210                 0,
211                 &asn_DEF_E2N_RICserviceUpdate,
212                 0,
213                 { 0, 0, 0 },
214                 0, 0, /* No default value */
215                 "RICserviceUpdate"
216                 },
217         { ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage__value, choice.RICcontrolRequest),
218                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
219                 0,
220                 &asn_DEF_E2N_RICcontrolRequest,
221                 0,
222                 { 0, 0, 0 },
223                 0, 0, /* No default value */
224                 "RICcontrolRequest"
225                 },
226         { ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage__value, choice.RICindication),
227                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
228                 0,
229                 &asn_DEF_E2N_RICindication,
230                 0,
231                 { 0, 0, 0 },
232                 0, 0, /* No default value */
233                 "RICindication"
234                 },
235         { ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage__value, choice.RICserviceQuery),
236                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
237                 0,
238                 &asn_DEF_E2N_RICserviceQuery,
239                 0,
240                 { 0, 0, 0 },
241                 0, 0, /* No default value */
242                 "RICserviceQuery"
243                 },
244 };
245 static const asn_TYPE_tag2member_t asn_MAP_E2N_value_tag2el_4[] = {
246     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 5 }, /* RICsubscriptionRequest */
247     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 4 }, /* RICsubscriptionDeleteRequest */
248     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 3 }, /* RICserviceUpdate */
249     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, -3, 2 }, /* RICcontrolRequest */
250     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -4, 1 }, /* RICindication */
251     { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 5, -5, 0 } /* RICserviceQuery */
252 };
253 static asn_CHOICE_specifics_t asn_SPC_E2N_value_specs_4 = {
254         sizeof(struct E2N_InitiatingMessage__value),
255         offsetof(struct E2N_InitiatingMessage__value, _asn_ctx),
256         offsetof(struct E2N_InitiatingMessage__value, present),
257         sizeof(((struct E2N_InitiatingMessage__value *)0)->present),
258         asn_MAP_E2N_value_tag2el_4,
259         6,      /* Count of tags in the map */
260         0, 0,
261         -1      /* Extensions start */
262 };
263 static /* Use -fall-defs-global to expose */
264 asn_TYPE_descriptor_t asn_DEF_E2N_value_4 = {
265         "value",
266         "value",
267         &asn_OP_OPEN_TYPE,
268         0,      /* No effective tags (pointer) */
269         0,      /* No effective tags (count) */
270         0,      /* No tags (pointer) */
271         0,      /* No tags (count) */
272         { 0, 0, OPEN_TYPE_constraint },
273         asn_MBR_E2N_value_4,
274         6,      /* Elements count */
275         &asn_SPC_E2N_value_specs_4      /* Additional specs */
276 };
277
278 asn_TYPE_member_t asn_MBR_E2N_InitiatingMessage_1[] = {
279         { ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage, procedureCode),
280                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
281                 -1,     /* IMPLICIT tag at current level */
282                 &asn_DEF_E2N_ProcedureCode,
283                 0,
284                 { 0, &asn_PER_memb_E2N_procedureCode_constr_2,  memb_E2N_procedureCode_constraint_1 },
285                 0, 0, /* No default value */
286                 "procedureCode"
287                 },
288         { ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage, criticality),
289                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
290                 -1,     /* IMPLICIT tag at current level */
291                 &asn_DEF_E2N_Criticality,
292                 select_InitiatingMessage_E2N_criticality_type,
293                 { 0, &asn_PER_memb_E2N_criticality_constr_3,  memb_E2N_criticality_constraint_1 },
294                 0, 0, /* No default value */
295                 "criticality"
296                 },
297         { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct E2N_InitiatingMessage, value),
298                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
299                 +1,     /* EXPLICIT tag at current level */
300                 &asn_DEF_E2N_value_4,
301                 select_InitiatingMessage_E2N_value_type,
302                 { 0, &asn_PER_memb_E2N_value_constr_4,  memb_E2N_value_constraint_1 },
303                 0, 0, /* No default value */
304                 "value"
305                 },
306 };
307 static const ber_tlv_tag_t asn_DEF_E2N_InitiatingMessage_tags_1[] = {
308         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
309 };
310 static const asn_TYPE_tag2member_t asn_MAP_E2N_InitiatingMessage_tag2el_1[] = {
311     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
312     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* criticality */
313     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* value */
314 };
315 asn_SEQUENCE_specifics_t asn_SPC_E2N_InitiatingMessage_specs_1 = {
316         sizeof(struct E2N_InitiatingMessage),
317         offsetof(struct E2N_InitiatingMessage, _asn_ctx),
318         asn_MAP_E2N_InitiatingMessage_tag2el_1,
319         3,      /* Count of tags in the map */
320         0, 0, 0,        /* Optional elements (not needed) */
321         -1,     /* First extension addition */
322 };
323 asn_TYPE_descriptor_t asn_DEF_E2N_InitiatingMessage = {
324         "InitiatingMessage",
325         "InitiatingMessage",
326         &asn_OP_SEQUENCE,
327         asn_DEF_E2N_InitiatingMessage_tags_1,
328         sizeof(asn_DEF_E2N_InitiatingMessage_tags_1)
329                 /sizeof(asn_DEF_E2N_InitiatingMessage_tags_1[0]), /* 1 */
330         asn_DEF_E2N_InitiatingMessage_tags_1,   /* Same as above */
331         sizeof(asn_DEF_E2N_InitiatingMessage_tags_1)
332                 /sizeof(asn_DEF_E2N_InitiatingMessage_tags_1[0]), /* 1 */
333         { 0, 0, SEQUENCE_constraint },
334         asn_MBR_E2N_InitiatingMessage_1,
335         3,      /* Elements count */
336         &asn_SPC_E2N_InitiatingMessage_specs_1  /* Additional specs */
337 };
338