[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-441]: Update name of Paging RRC Codec
[o-du/l2.git] / src / codec_utils / RRC / RRCSetupComplete-IEs.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "./22April22_Paging/rrc_15.3_asn.asn1"
5  *      `asn1c -D ./22April22_Paging -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "RRCSetupComplete-IEs.h"
9
10 #include "RegisteredAMF.h"
11 #include "S-NSSAI.h"
12 /*
13  * This type is implemented using NativeEnumerated,
14  * so here we adjust the DEF accordingly.
15  */
16 static int
17 memb_ng_5G_S_TMSI_Part2_constraint_10(const asn_TYPE_descriptor_t *td, const void *sptr,
18                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
19         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
20         size_t size;
21         
22         if(!sptr) {
23                 ASN__CTFAIL(app_key, td, sptr,
24                         "%s: value not given (%s:%d)",
25                         td->name, __FILE__, __LINE__);
26                 return -1;
27         }
28         
29         if(st->size > 0) {
30                 /* Size in bits */
31                 size = 8 * st->size - (st->bits_unused & 0x07);
32         } else {
33                 size = 0;
34         }
35         
36         if((size == 9)) {
37                 /* Constraint check succeeded */
38                 return 0;
39         } else {
40                 ASN__CTFAIL(app_key, td, sptr,
41                         "%s: constraint failed (%s:%d)",
42                         td->name, __FILE__, __LINE__);
43                 return -1;
44         }
45 }
46
47 static int
48 memb_selectedPLMN_Identity_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
49                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
50         long value;
51         
52         if(!sptr) {
53                 ASN__CTFAIL(app_key, td, sptr,
54                         "%s: value not given (%s:%d)",
55                         td->name, __FILE__, __LINE__);
56                 return -1;
57         }
58         
59         value = *(const long *)sptr;
60         
61         if((value >= 1 && value <= 12)) {
62                 /* Constraint check succeeded */
63                 return 0;
64         } else {
65                 ASN__CTFAIL(app_key, td, sptr,
66                         "%s: constraint failed (%s:%d)",
67                         td->name, __FILE__, __LINE__);
68                 return -1;
69         }
70 }
71
72 static int
73 memb_s_NSSAI_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
74                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
75         size_t size;
76         
77         if(!sptr) {
78                 ASN__CTFAIL(app_key, td, sptr,
79                         "%s: value not given (%s:%d)",
80                         td->name, __FILE__, __LINE__);
81                 return -1;
82         }
83         
84         /* Determine the number of elements */
85         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
86         
87         if((size >= 1 && size <= 8)) {
88                 /* Perform validation of the inner elements */
89                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
90         } else {
91                 ASN__CTFAIL(app_key, td, sptr,
92                         "%s: constraint failed (%s:%d)",
93                         td->name, __FILE__, __LINE__);
94                 return -1;
95         }
96 }
97
98 static asn_oer_constraints_t asn_OER_type_guami_Type_constr_4 CC_NOTUSED = {
99         { 0, 0 },
100         -1};
101 static asn_per_constraints_t asn_PER_type_guami_Type_constr_4 CC_NOTUSED = {
102         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
103         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
104         0, 0    /* No PER value map */
105 };
106 static asn_oer_constraints_t asn_OER_type_s_NSSAI_List_constr_7 CC_NOTUSED = {
107         { 0, 0 },
108         -1      /* (SIZE(1..8)) */};
109 static asn_per_constraints_t asn_PER_type_s_NSSAI_List_constr_7 CC_NOTUSED = {
110         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
111         { APC_CONSTRAINED,       3,  3,  1,  8 }        /* (SIZE(1..8)) */,
112         0, 0    /* No PER value map */
113 };
114 static asn_oer_constraints_t asn_OER_memb_ng_5G_S_TMSI_Part2_constr_12 CC_NOTUSED = {
115         { 0, 0 },
116         9       /* (SIZE(9..9)) */};
117 static asn_per_constraints_t asn_PER_memb_ng_5G_S_TMSI_Part2_constr_12 CC_NOTUSED = {
118         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
119         { APC_CONSTRAINED,       0,  0,  9,  9 }        /* (SIZE(9..9)) */,
120         0, 0    /* No PER value map */
121 };
122 static asn_oer_constraints_t asn_OER_type_ng_5G_S_TMSI_Value_constr_10 CC_NOTUSED = {
123         { 0, 0 },
124         -1};
125 static asn_per_constraints_t asn_PER_type_ng_5G_S_TMSI_Value_constr_10 CC_NOTUSED = {
126         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
127         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
128         0, 0    /* No PER value map */
129 };
130 static asn_oer_constraints_t asn_OER_memb_selectedPLMN_Identity_constr_2 CC_NOTUSED = {
131         { 1, 1 }        /* (1..12) */,
132         -1};
133 static asn_per_constraints_t asn_PER_memb_selectedPLMN_Identity_constr_2 CC_NOTUSED = {
134         { APC_CONSTRAINED,       4,  4,  1,  12 }       /* (1..12) */,
135         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
136         0, 0    /* No PER value map */
137 };
138 static asn_oer_constraints_t asn_OER_memb_s_NSSAI_List_constr_7 CC_NOTUSED = {
139         { 0, 0 },
140         -1      /* (SIZE(1..8)) */};
141 static asn_per_constraints_t asn_PER_memb_s_NSSAI_List_constr_7 CC_NOTUSED = {
142         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
143         { APC_CONSTRAINED,       3,  3,  1,  8 }        /* (SIZE(1..8)) */,
144         0, 0    /* No PER value map */
145 };
146 static const asn_INTEGER_enum_map_t asn_MAP_guami_Type_value2enum_4[] = {
147         { 0,    6,      "native" },
148         { 1,    6,      "mapped" }
149 };
150 static const unsigned int asn_MAP_guami_Type_enum2value_4[] = {
151         1,      /* mapped(1) */
152         0       /* native(0) */
153 };
154 static const asn_INTEGER_specifics_t asn_SPC_guami_Type_specs_4 = {
155         asn_MAP_guami_Type_value2enum_4,        /* "tag" => N; sorted by tag */
156         asn_MAP_guami_Type_enum2value_4,        /* N => "tag"; sorted by N */
157         2,      /* Number of elements in the maps */
158         0,      /* Enumeration is not extensible */
159         1,      /* Strict enumeration */
160         0,      /* Native long size */
161         0
162 };
163 static const ber_tlv_tag_t asn_DEF_guami_Type_tags_4[] = {
164         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
165         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
166 };
167 static /* Use -fall-defs-global to expose */
168 asn_TYPE_descriptor_t asn_DEF_guami_Type_4 = {
169         "guami-Type",
170         "guami-Type",
171         &asn_OP_NativeEnumerated,
172         asn_DEF_guami_Type_tags_4,
173         sizeof(asn_DEF_guami_Type_tags_4)
174                 /sizeof(asn_DEF_guami_Type_tags_4[0]) - 1, /* 1 */
175         asn_DEF_guami_Type_tags_4,      /* Same as above */
176         sizeof(asn_DEF_guami_Type_tags_4)
177                 /sizeof(asn_DEF_guami_Type_tags_4[0]), /* 2 */
178         { &asn_OER_type_guami_Type_constr_4, &asn_PER_type_guami_Type_constr_4, NativeEnumerated_constraint },
179         0, 0,   /* Defined elsewhere */
180         &asn_SPC_guami_Type_specs_4     /* Additional specs */
181 };
182
183 static asn_TYPE_member_t asn_MBR_s_NSSAI_List_7[] = {
184         { ATF_POINTER, 0, 0,
185                 -1 /* Ambiguous tag (CHOICE?) */,
186                 0,
187                 &asn_DEF_S_NSSAI,
188                 0,
189                 { 0, 0, 0 },
190                 0, 0, /* No default value */
191                 ""
192                 },
193 };
194 static const ber_tlv_tag_t asn_DEF_s_NSSAI_List_tags_7[] = {
195         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
196         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
197 };
198 static asn_SET_OF_specifics_t asn_SPC_s_NSSAI_List_specs_7 = {
199         sizeof(struct RRCSetupComplete_IEs__s_NSSAI_List),
200         offsetof(struct RRCSetupComplete_IEs__s_NSSAI_List, _asn_ctx),
201         2,      /* XER encoding is XMLValueList */
202 };
203 static /* Use -fall-defs-global to expose */
204 asn_TYPE_descriptor_t asn_DEF_s_NSSAI_List_7 = {
205         "s-NSSAI-List",
206         "s-NSSAI-List",
207         &asn_OP_SEQUENCE_OF,
208         asn_DEF_s_NSSAI_List_tags_7,
209         sizeof(asn_DEF_s_NSSAI_List_tags_7)
210                 /sizeof(asn_DEF_s_NSSAI_List_tags_7[0]) - 1, /* 1 */
211         asn_DEF_s_NSSAI_List_tags_7,    /* Same as above */
212         sizeof(asn_DEF_s_NSSAI_List_tags_7)
213                 /sizeof(asn_DEF_s_NSSAI_List_tags_7[0]), /* 2 */
214         { &asn_OER_type_s_NSSAI_List_constr_7, &asn_PER_type_s_NSSAI_List_constr_7, SEQUENCE_OF_constraint },
215         asn_MBR_s_NSSAI_List_7,
216         1,      /* Single element */
217         &asn_SPC_s_NSSAI_List_specs_7   /* Additional specs */
218 };
219
220 static asn_TYPE_member_t asn_MBR_ng_5G_S_TMSI_Value_10[] = {
221         { ATF_NOFLAGS, 0, offsetof(struct RRCSetupComplete_IEs__ng_5G_S_TMSI_Value, choice.ng_5G_S_TMSI),
222                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
223                 -1,     /* IMPLICIT tag at current level */
224                 &asn_DEF_NG_5G_S_TMSI,
225                 0,
226                 { 0, 0, 0 },
227                 0, 0, /* No default value */
228                 "ng-5G-S-TMSI"
229                 },
230         { ATF_NOFLAGS, 0, offsetof(struct RRCSetupComplete_IEs__ng_5G_S_TMSI_Value, choice.ng_5G_S_TMSI_Part2),
231                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
232                 -1,     /* IMPLICIT tag at current level */
233                 &asn_DEF_BIT_STRING,
234                 0,
235                 { &asn_OER_memb_ng_5G_S_TMSI_Part2_constr_12, &asn_PER_memb_ng_5G_S_TMSI_Part2_constr_12,  memb_ng_5G_S_TMSI_Part2_constraint_10 },
236                 0, 0, /* No default value */
237                 "ng-5G-S-TMSI-Part2"
238                 },
239 };
240 static const asn_TYPE_tag2member_t asn_MAP_ng_5G_S_TMSI_Value_tag2el_10[] = {
241     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ng-5G-S-TMSI */
242     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ng-5G-S-TMSI-Part2 */
243 };
244 static asn_CHOICE_specifics_t asn_SPC_ng_5G_S_TMSI_Value_specs_10 = {
245         sizeof(struct RRCSetupComplete_IEs__ng_5G_S_TMSI_Value),
246         offsetof(struct RRCSetupComplete_IEs__ng_5G_S_TMSI_Value, _asn_ctx),
247         offsetof(struct RRCSetupComplete_IEs__ng_5G_S_TMSI_Value, present),
248         sizeof(((struct RRCSetupComplete_IEs__ng_5G_S_TMSI_Value *)0)->present),
249         asn_MAP_ng_5G_S_TMSI_Value_tag2el_10,
250         2,      /* Count of tags in the map */
251         0, 0,
252         -1      /* Extensions start */
253 };
254 static /* Use -fall-defs-global to expose */
255 asn_TYPE_descriptor_t asn_DEF_ng_5G_S_TMSI_Value_10 = {
256         "ng-5G-S-TMSI-Value",
257         "ng-5G-S-TMSI-Value",
258         &asn_OP_CHOICE,
259         0,      /* No effective tags (pointer) */
260         0,      /* No effective tags (count) */
261         0,      /* No tags (pointer) */
262         0,      /* No tags (count) */
263         { &asn_OER_type_ng_5G_S_TMSI_Value_constr_10, &asn_PER_type_ng_5G_S_TMSI_Value_constr_10, CHOICE_constraint },
264         asn_MBR_ng_5G_S_TMSI_Value_10,
265         2,      /* Elements count */
266         &asn_SPC_ng_5G_S_TMSI_Value_specs_10    /* Additional specs */
267 };
268
269 static const ber_tlv_tag_t asn_DEF_nonCriticalExtension_tags_14[] = {
270         (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
271         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
272 };
273 static asn_SEQUENCE_specifics_t asn_SPC_nonCriticalExtension_specs_14 = {
274         sizeof(struct RRCSetupComplete_IEs__nonCriticalExtension),
275         offsetof(struct RRCSetupComplete_IEs__nonCriticalExtension, _asn_ctx),
276         0,      /* No top level tags */
277         0,      /* No tags in the map */
278         0, 0, 0,        /* Optional elements (not needed) */
279         -1,     /* First extension addition */
280 };
281 static /* Use -fall-defs-global to expose */
282 asn_TYPE_descriptor_t asn_DEF_nonCriticalExtension_14 = {
283         "nonCriticalExtension",
284         "nonCriticalExtension",
285         &asn_OP_SEQUENCE,
286         asn_DEF_nonCriticalExtension_tags_14,
287         sizeof(asn_DEF_nonCriticalExtension_tags_14)
288                 /sizeof(asn_DEF_nonCriticalExtension_tags_14[0]) - 1, /* 1 */
289         asn_DEF_nonCriticalExtension_tags_14,   /* Same as above */
290         sizeof(asn_DEF_nonCriticalExtension_tags_14)
291                 /sizeof(asn_DEF_nonCriticalExtension_tags_14[0]), /* 2 */
292         { 0, 0, SEQUENCE_constraint },
293         0, 0,   /* No members */
294         &asn_SPC_nonCriticalExtension_specs_14  /* Additional specs */
295 };
296
297 asn_TYPE_member_t asn_MBR_RRCSetupComplete_IEs_1[] = {
298         { ATF_NOFLAGS, 0, offsetof(struct RRCSetupComplete_IEs, selectedPLMN_Identity),
299                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
300                 -1,     /* IMPLICIT tag at current level */
301                 &asn_DEF_NativeInteger,
302                 0,
303                 { &asn_OER_memb_selectedPLMN_Identity_constr_2, &asn_PER_memb_selectedPLMN_Identity_constr_2,  memb_selectedPLMN_Identity_constraint_1 },
304                 0, 0, /* No default value */
305                 "selectedPLMN-Identity"
306                 },
307         { ATF_POINTER, 3, offsetof(struct RRCSetupComplete_IEs, registeredAMF),
308                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
309                 -1,     /* IMPLICIT tag at current level */
310                 &asn_DEF_RegisteredAMF,
311                 0,
312                 { 0, 0, 0 },
313                 0, 0, /* No default value */
314                 "registeredAMF"
315                 },
316         { ATF_POINTER, 2, offsetof(struct RRCSetupComplete_IEs, guami_Type),
317                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
318                 -1,     /* IMPLICIT tag at current level */
319                 &asn_DEF_guami_Type_4,
320                 0,
321                 { 0, 0, 0 },
322                 0, 0, /* No default value */
323                 "guami-Type"
324                 },
325         { ATF_POINTER, 1, offsetof(struct RRCSetupComplete_IEs, s_NSSAI_List),
326                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
327                 0,
328                 &asn_DEF_s_NSSAI_List_7,
329                 0,
330                 { &asn_OER_memb_s_NSSAI_List_constr_7, &asn_PER_memb_s_NSSAI_List_constr_7,  memb_s_NSSAI_List_constraint_1 },
331                 0, 0, /* No default value */
332                 "s-NSSAI-List"
333                 },
334         { ATF_NOFLAGS, 0, offsetof(struct RRCSetupComplete_IEs, dedicatedNAS_Message),
335                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
336                 -1,     /* IMPLICIT tag at current level */
337                 &asn_DEF_DedicatedNAS_Message,
338                 0,
339                 { 0, 0, 0 },
340                 0, 0, /* No default value */
341                 "dedicatedNAS-Message"
342                 },
343         { ATF_POINTER, 3, offsetof(struct RRCSetupComplete_IEs, ng_5G_S_TMSI_Value),
344                 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
345                 +1,     /* EXPLICIT tag at current level */
346                 &asn_DEF_ng_5G_S_TMSI_Value_10,
347                 0,
348                 { 0, 0, 0 },
349                 0, 0, /* No default value */
350                 "ng-5G-S-TMSI-Value"
351                 },
352         { ATF_POINTER, 2, offsetof(struct RRCSetupComplete_IEs, lateNonCriticalExtension),
353                 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
354                 -1,     /* IMPLICIT tag at current level */
355                 &asn_DEF_OCTET_STRING,
356                 0,
357                 { 0, 0, 0 },
358                 0, 0, /* No default value */
359                 "lateNonCriticalExtension"
360                 },
361         { ATF_POINTER, 1, offsetof(struct RRCSetupComplete_IEs, nonCriticalExtension),
362                 (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
363                 0,
364                 &asn_DEF_nonCriticalExtension_14,
365                 0,
366                 { 0, 0, 0 },
367                 0, 0, /* No default value */
368                 "nonCriticalExtension"
369                 },
370 };
371 static const int asn_MAP_RRCSetupComplete_IEs_oms_1[] = { 1, 2, 3, 5, 6, 7 };
372 static const ber_tlv_tag_t asn_DEF_RRCSetupComplete_IEs_tags_1[] = {
373         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
374 };
375 static const asn_TYPE_tag2member_t asn_MAP_RRCSetupComplete_IEs_tag2el_1[] = {
376     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* selectedPLMN-Identity */
377     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* registeredAMF */
378     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* guami-Type */
379     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* s-NSSAI-List */
380     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* dedicatedNAS-Message */
381     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* ng-5G-S-TMSI-Value */
382     { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* lateNonCriticalExtension */
383     { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 } /* nonCriticalExtension */
384 };
385 asn_SEQUENCE_specifics_t asn_SPC_RRCSetupComplete_IEs_specs_1 = {
386         sizeof(struct RRCSetupComplete_IEs),
387         offsetof(struct RRCSetupComplete_IEs, _asn_ctx),
388         asn_MAP_RRCSetupComplete_IEs_tag2el_1,
389         8,      /* Count of tags in the map */
390         asn_MAP_RRCSetupComplete_IEs_oms_1,     /* Optional members */
391         6, 0,   /* Root/Additions */
392         -1,     /* First extension addition */
393 };
394 asn_TYPE_descriptor_t asn_DEF_RRCSetupComplete_IEs = {
395         "RRCSetupComplete-IEs",
396         "RRCSetupComplete-IEs",
397         &asn_OP_SEQUENCE,
398         asn_DEF_RRCSetupComplete_IEs_tags_1,
399         sizeof(asn_DEF_RRCSetupComplete_IEs_tags_1)
400                 /sizeof(asn_DEF_RRCSetupComplete_IEs_tags_1[0]), /* 1 */
401         asn_DEF_RRCSetupComplete_IEs_tags_1,    /* Same as above */
402         sizeof(asn_DEF_RRCSetupComplete_IEs_tags_1)
403                 /sizeof(asn_DEF_RRCSetupComplete_IEs_tags_1[0]), /* 1 */
404         { 0, 0, SEQUENCE_constraint },
405         asn_MBR_RRCSetupComplete_IEs_1,
406         8,      /* Elements count */
407         &asn_SPC_RRCSetupComplete_IEs_specs_1   /* Additional specs */
408 };
409