[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-423] Modified RRC asn structures
[o-du/l2.git] / src / codec_utils / RRC / MobilityStateParameters.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "../../../rrc_15.3_asn.asn1"
5  *      `asn1c -D ./25_02_2022_RRC/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "MobilityStateParameters.h"
9
10 /*
11  * This type is implemented using NativeEnumerated,
12  * so here we adjust the DEF accordingly.
13  */
14 /*
15  * This type is implemented using NativeEnumerated,
16  * so here we adjust the DEF accordingly.
17  */
18 static int
19 memb_n_CellChangeMedium_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
20                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
21         long value;
22         
23         if(!sptr) {
24                 ASN__CTFAIL(app_key, td, sptr,
25                         "%s: value not given (%s:%d)",
26                         td->name, __FILE__, __LINE__);
27                 return -1;
28         }
29         
30         value = *(const long *)sptr;
31         
32         if((value >= 1 && value <= 16)) {
33                 /* Constraint check succeeded */
34                 return 0;
35         } else {
36                 ASN__CTFAIL(app_key, td, sptr,
37                         "%s: constraint failed (%s:%d)",
38                         td->name, __FILE__, __LINE__);
39                 return -1;
40         }
41 }
42
43 static int
44 memb_n_CellChangeHigh_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
45                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
46         long value;
47         
48         if(!sptr) {
49                 ASN__CTFAIL(app_key, td, sptr,
50                         "%s: value not given (%s:%d)",
51                         td->name, __FILE__, __LINE__);
52                 return -1;
53         }
54         
55         value = *(const long *)sptr;
56         
57         if((value >= 1 && value <= 16)) {
58                 /* Constraint check succeeded */
59                 return 0;
60         } else {
61                 ASN__CTFAIL(app_key, td, sptr,
62                         "%s: constraint failed (%s:%d)",
63                         td->name, __FILE__, __LINE__);
64                 return -1;
65         }
66 }
67
68 static asn_oer_constraints_t asn_OER_type_t_Evaluation_constr_2 CC_NOTUSED = {
69         { 0, 0 },
70         -1};
71 static asn_per_constraints_t asn_PER_type_t_Evaluation_constr_2 CC_NOTUSED = {
72         { APC_CONSTRAINED,       3,  3,  0,  7 }        /* (0..7) */,
73         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
74         0, 0    /* No PER value map */
75 };
76 static asn_oer_constraints_t asn_OER_type_t_HystNormal_constr_11 CC_NOTUSED = {
77         { 0, 0 },
78         -1};
79 static asn_per_constraints_t asn_PER_type_t_HystNormal_constr_11 CC_NOTUSED = {
80         { APC_CONSTRAINED,       3,  3,  0,  7 }        /* (0..7) */,
81         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
82         0, 0    /* No PER value map */
83 };
84 static asn_oer_constraints_t asn_OER_memb_n_CellChangeMedium_constr_20 CC_NOTUSED = {
85         { 1, 1 }        /* (1..16) */,
86         -1};
87 static asn_per_constraints_t asn_PER_memb_n_CellChangeMedium_constr_20 CC_NOTUSED = {
88         { APC_CONSTRAINED,       4,  4,  1,  16 }       /* (1..16) */,
89         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
90         0, 0    /* No PER value map */
91 };
92 static asn_oer_constraints_t asn_OER_memb_n_CellChangeHigh_constr_21 CC_NOTUSED = {
93         { 1, 1 }        /* (1..16) */,
94         -1};
95 static asn_per_constraints_t asn_PER_memb_n_CellChangeHigh_constr_21 CC_NOTUSED = {
96         { APC_CONSTRAINED,       4,  4,  1,  16 }       /* (1..16) */,
97         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
98         0, 0    /* No PER value map */
99 };
100 static const asn_INTEGER_enum_map_t asn_MAP_t_Evaluation_value2enum_2[] = {
101         { 0,    3,      "s30" },
102         { 1,    3,      "s60" },
103         { 2,    4,      "s120" },
104         { 3,    4,      "s180" },
105         { 4,    4,      "s240" },
106         { 5,    6,      "spare3" },
107         { 6,    6,      "spare2" },
108         { 7,    6,      "spare1" }
109 };
110 static const unsigned int asn_MAP_t_Evaluation_enum2value_2[] = {
111         2,      /* s120(2) */
112         3,      /* s180(3) */
113         4,      /* s240(4) */
114         0,      /* s30(0) */
115         1,      /* s60(1) */
116         7,      /* spare1(7) */
117         6,      /* spare2(6) */
118         5       /* spare3(5) */
119 };
120 static const asn_INTEGER_specifics_t asn_SPC_t_Evaluation_specs_2 = {
121         asn_MAP_t_Evaluation_value2enum_2,      /* "tag" => N; sorted by tag */
122         asn_MAP_t_Evaluation_enum2value_2,      /* N => "tag"; sorted by N */
123         8,      /* Number of elements in the maps */
124         0,      /* Enumeration is not extensible */
125         1,      /* Strict enumeration */
126         0,      /* Native long size */
127         0
128 };
129 static const ber_tlv_tag_t asn_DEF_t_Evaluation_tags_2[] = {
130         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
131         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
132 };
133 static /* Use -fall-defs-global to expose */
134 asn_TYPE_descriptor_t asn_DEF_t_Evaluation_2 = {
135         "t-Evaluation",
136         "t-Evaluation",
137         &asn_OP_NativeEnumerated,
138         asn_DEF_t_Evaluation_tags_2,
139         sizeof(asn_DEF_t_Evaluation_tags_2)
140                 /sizeof(asn_DEF_t_Evaluation_tags_2[0]) - 1, /* 1 */
141         asn_DEF_t_Evaluation_tags_2,    /* Same as above */
142         sizeof(asn_DEF_t_Evaluation_tags_2)
143                 /sizeof(asn_DEF_t_Evaluation_tags_2[0]), /* 2 */
144         { &asn_OER_type_t_Evaluation_constr_2, &asn_PER_type_t_Evaluation_constr_2, NativeEnumerated_constraint },
145         0, 0,   /* Defined elsewhere */
146         &asn_SPC_t_Evaluation_specs_2   /* Additional specs */
147 };
148
149 static const asn_INTEGER_enum_map_t asn_MAP_t_HystNormal_value2enum_11[] = {
150         { 0,    3,      "s30" },
151         { 1,    3,      "s60" },
152         { 2,    4,      "s120" },
153         { 3,    4,      "s180" },
154         { 4,    4,      "s240" },
155         { 5,    6,      "spare3" },
156         { 6,    6,      "spare2" },
157         { 7,    6,      "spare1" }
158 };
159 static const unsigned int asn_MAP_t_HystNormal_enum2value_11[] = {
160         2,      /* s120(2) */
161         3,      /* s180(3) */
162         4,      /* s240(4) */
163         0,      /* s30(0) */
164         1,      /* s60(1) */
165         7,      /* spare1(7) */
166         6,      /* spare2(6) */
167         5       /* spare3(5) */
168 };
169 static const asn_INTEGER_specifics_t asn_SPC_t_HystNormal_specs_11 = {
170         asn_MAP_t_HystNormal_value2enum_11,     /* "tag" => N; sorted by tag */
171         asn_MAP_t_HystNormal_enum2value_11,     /* N => "tag"; sorted by N */
172         8,      /* Number of elements in the maps */
173         0,      /* Enumeration is not extensible */
174         1,      /* Strict enumeration */
175         0,      /* Native long size */
176         0
177 };
178 static const ber_tlv_tag_t asn_DEF_t_HystNormal_tags_11[] = {
179         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
180         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
181 };
182 static /* Use -fall-defs-global to expose */
183 asn_TYPE_descriptor_t asn_DEF_t_HystNormal_11 = {
184         "t-HystNormal",
185         "t-HystNormal",
186         &asn_OP_NativeEnumerated,
187         asn_DEF_t_HystNormal_tags_11,
188         sizeof(asn_DEF_t_HystNormal_tags_11)
189                 /sizeof(asn_DEF_t_HystNormal_tags_11[0]) - 1, /* 1 */
190         asn_DEF_t_HystNormal_tags_11,   /* Same as above */
191         sizeof(asn_DEF_t_HystNormal_tags_11)
192                 /sizeof(asn_DEF_t_HystNormal_tags_11[0]), /* 2 */
193         { &asn_OER_type_t_HystNormal_constr_11, &asn_PER_type_t_HystNormal_constr_11, NativeEnumerated_constraint },
194         0, 0,   /* Defined elsewhere */
195         &asn_SPC_t_HystNormal_specs_11  /* Additional specs */
196 };
197
198 asn_TYPE_member_t asn_MBR_MobilityStateParameters_1[] = {
199         { ATF_NOFLAGS, 0, offsetof(struct MobilityStateParameters, t_Evaluation),
200                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
201                 -1,     /* IMPLICIT tag at current level */
202                 &asn_DEF_t_Evaluation_2,
203                 0,
204                 { 0, 0, 0 },
205                 0, 0, /* No default value */
206                 "t-Evaluation"
207                 },
208         { ATF_NOFLAGS, 0, offsetof(struct MobilityStateParameters, t_HystNormal),
209                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
210                 -1,     /* IMPLICIT tag at current level */
211                 &asn_DEF_t_HystNormal_11,
212                 0,
213                 { 0, 0, 0 },
214                 0, 0, /* No default value */
215                 "t-HystNormal"
216                 },
217         { ATF_NOFLAGS, 0, offsetof(struct MobilityStateParameters, n_CellChangeMedium),
218                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
219                 -1,     /* IMPLICIT tag at current level */
220                 &asn_DEF_NativeInteger,
221                 0,
222                 { &asn_OER_memb_n_CellChangeMedium_constr_20, &asn_PER_memb_n_CellChangeMedium_constr_20,  memb_n_CellChangeMedium_constraint_1 },
223                 0, 0, /* No default value */
224                 "n-CellChangeMedium"
225                 },
226         { ATF_NOFLAGS, 0, offsetof(struct MobilityStateParameters, n_CellChangeHigh),
227                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
228                 -1,     /* IMPLICIT tag at current level */
229                 &asn_DEF_NativeInteger,
230                 0,
231                 { &asn_OER_memb_n_CellChangeHigh_constr_21, &asn_PER_memb_n_CellChangeHigh_constr_21,  memb_n_CellChangeHigh_constraint_1 },
232                 0, 0, /* No default value */
233                 "n-CellChangeHigh"
234                 },
235 };
236 static const ber_tlv_tag_t asn_DEF_MobilityStateParameters_tags_1[] = {
237         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
238 };
239 static const asn_TYPE_tag2member_t asn_MAP_MobilityStateParameters_tag2el_1[] = {
240     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* t-Evaluation */
241     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* t-HystNormal */
242     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* n-CellChangeMedium */
243     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* n-CellChangeHigh */
244 };
245 asn_SEQUENCE_specifics_t asn_SPC_MobilityStateParameters_specs_1 = {
246         sizeof(struct MobilityStateParameters),
247         offsetof(struct MobilityStateParameters, _asn_ctx),
248         asn_MAP_MobilityStateParameters_tag2el_1,
249         4,      /* Count of tags in the map */
250         0, 0, 0,        /* Optional elements (not needed) */
251         -1,     /* First extension addition */
252 };
253 asn_TYPE_descriptor_t asn_DEF_MobilityStateParameters = {
254         "MobilityStateParameters",
255         "MobilityStateParameters",
256         &asn_OP_SEQUENCE,
257         asn_DEF_MobilityStateParameters_tags_1,
258         sizeof(asn_DEF_MobilityStateParameters_tags_1)
259                 /sizeof(asn_DEF_MobilityStateParameters_tags_1[0]), /* 1 */
260         asn_DEF_MobilityStateParameters_tags_1, /* Same as above */
261         sizeof(asn_DEF_MobilityStateParameters_tags_1)
262                 /sizeof(asn_DEF_MobilityStateParameters_tags_1[0]), /* 1 */
263         { 0, 0, SEQUENCE_constraint },
264         asn_MBR_MobilityStateParameters_1,
265         4,      /* Elements count */
266         &asn_SPC_MobilityStateParameters_specs_1        /* Additional specs */
267 };
268