df4c7d791f487572f3156cce841747631b768622
[o-du/l2.git] / src / codec_utils / RRC / PUCCH-format4.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "NR-RRC-Definitions"
4  *      found in "/home/labadmin/hlal/rrc_15.3_asn.asn1"
5  *      `asn1c -D ./15_3_rrc/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-example`
6  */
7
8 #include "PUCCH-format4.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_nrofSymbols_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 >= 4 && value <= 14)) {
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_startingSymbolIndex_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 >= 0 && value <= 10)) {
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_occ_Length_constr_3 CC_NOTUSED = {
69         { 0, 0 },
70         -1};
71 static asn_per_constraints_t asn_PER_type_occ_Length_constr_3 CC_NOTUSED = {
72         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
73         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
74         0, 0    /* No PER value map */
75 };
76 static asn_oer_constraints_t asn_OER_type_occ_Index_constr_6 CC_NOTUSED = {
77         { 0, 0 },
78         -1};
79 static asn_per_constraints_t asn_PER_type_occ_Index_constr_6 CC_NOTUSED = {
80         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (0..3) */,
81         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
82         0, 0    /* No PER value map */
83 };
84 static asn_oer_constraints_t asn_OER_memb_nrofSymbols_constr_2 CC_NOTUSED = {
85         { 1, 1 }        /* (4..14) */,
86         -1};
87 static asn_per_constraints_t asn_PER_memb_nrofSymbols_constr_2 CC_NOTUSED = {
88         { APC_CONSTRAINED,       4,  4,  4,  14 }       /* (4..14) */,
89         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
90         0, 0    /* No PER value map */
91 };
92 static asn_oer_constraints_t asn_OER_memb_startingSymbolIndex_constr_11 CC_NOTUSED = {
93         { 1, 1 }        /* (0..10) */,
94         -1};
95 static asn_per_constraints_t asn_PER_memb_startingSymbolIndex_constr_11 CC_NOTUSED = {
96         { APC_CONSTRAINED,       4,  4,  0,  10 }       /* (0..10) */,
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_occ_Length_value2enum_3[] = {
101         { 0,    2,      "n2" },
102         { 1,    2,      "n4" }
103 };
104 static const unsigned int asn_MAP_occ_Length_enum2value_3[] = {
105         0,      /* n2(0) */
106         1       /* n4(1) */
107 };
108 static const asn_INTEGER_specifics_t asn_SPC_occ_Length_specs_3 = {
109         asn_MAP_occ_Length_value2enum_3,        /* "tag" => N; sorted by tag */
110         asn_MAP_occ_Length_enum2value_3,        /* N => "tag"; sorted by N */
111         2,      /* Number of elements in the maps */
112         0,      /* Enumeration is not extensible */
113         1,      /* Strict enumeration */
114         0,      /* Native long size */
115         0
116 };
117 static const ber_tlv_tag_t asn_DEF_occ_Length_tags_3[] = {
118         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
119         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
120 };
121 static /* Use -fall-defs-global to expose */
122 asn_TYPE_descriptor_t asn_DEF_occ_Length_3 = {
123         "occ-Length",
124         "occ-Length",
125         &asn_OP_NativeEnumerated,
126         asn_DEF_occ_Length_tags_3,
127         sizeof(asn_DEF_occ_Length_tags_3)
128                 /sizeof(asn_DEF_occ_Length_tags_3[0]) - 1, /* 1 */
129         asn_DEF_occ_Length_tags_3,      /* Same as above */
130         sizeof(asn_DEF_occ_Length_tags_3)
131                 /sizeof(asn_DEF_occ_Length_tags_3[0]), /* 2 */
132         { &asn_OER_type_occ_Length_constr_3, &asn_PER_type_occ_Length_constr_3, NativeEnumerated_constraint },
133         0, 0,   /* Defined elsewhere */
134         &asn_SPC_occ_Length_specs_3     /* Additional specs */
135 };
136
137 static const asn_INTEGER_enum_map_t asn_MAP_occ_Index_value2enum_6[] = {
138         { 0,    2,      "n0" },
139         { 1,    2,      "n1" },
140         { 2,    2,      "n2" },
141         { 3,    2,      "n3" }
142 };
143 static const unsigned int asn_MAP_occ_Index_enum2value_6[] = {
144         0,      /* n0(0) */
145         1,      /* n1(1) */
146         2,      /* n2(2) */
147         3       /* n3(3) */
148 };
149 static const asn_INTEGER_specifics_t asn_SPC_occ_Index_specs_6 = {
150         asn_MAP_occ_Index_value2enum_6, /* "tag" => N; sorted by tag */
151         asn_MAP_occ_Index_enum2value_6, /* N => "tag"; sorted by N */
152         4,      /* Number of elements in the maps */
153         0,      /* Enumeration is not extensible */
154         1,      /* Strict enumeration */
155         0,      /* Native long size */
156         0
157 };
158 static const ber_tlv_tag_t asn_DEF_occ_Index_tags_6[] = {
159         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
160         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
161 };
162 static /* Use -fall-defs-global to expose */
163 asn_TYPE_descriptor_t asn_DEF_occ_Index_6 = {
164         "occ-Index",
165         "occ-Index",
166         &asn_OP_NativeEnumerated,
167         asn_DEF_occ_Index_tags_6,
168         sizeof(asn_DEF_occ_Index_tags_6)
169                 /sizeof(asn_DEF_occ_Index_tags_6[0]) - 1, /* 1 */
170         asn_DEF_occ_Index_tags_6,       /* Same as above */
171         sizeof(asn_DEF_occ_Index_tags_6)
172                 /sizeof(asn_DEF_occ_Index_tags_6[0]), /* 2 */
173         { &asn_OER_type_occ_Index_constr_6, &asn_PER_type_occ_Index_constr_6, NativeEnumerated_constraint },
174         0, 0,   /* Defined elsewhere */
175         &asn_SPC_occ_Index_specs_6      /* Additional specs */
176 };
177
178 asn_TYPE_member_t asn_MBR_PUCCH_format4_1[] = {
179         { ATF_NOFLAGS, 0, offsetof(struct PUCCH_format4, nrofSymbols),
180                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
181                 -1,     /* IMPLICIT tag at current level */
182                 &asn_DEF_NativeInteger,
183                 0,
184                 { &asn_OER_memb_nrofSymbols_constr_2, &asn_PER_memb_nrofSymbols_constr_2,  memb_nrofSymbols_constraint_1 },
185                 0, 0, /* No default value */
186                 "nrofSymbols"
187                 },
188         { ATF_NOFLAGS, 0, offsetof(struct PUCCH_format4, occ_Length),
189                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
190                 -1,     /* IMPLICIT tag at current level */
191                 &asn_DEF_occ_Length_3,
192                 0,
193                 { 0, 0, 0 },
194                 0, 0, /* No default value */
195                 "occ-Length"
196                 },
197         { ATF_NOFLAGS, 0, offsetof(struct PUCCH_format4, occ_Index),
198                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
199                 -1,     /* IMPLICIT tag at current level */
200                 &asn_DEF_occ_Index_6,
201                 0,
202                 { 0, 0, 0 },
203                 0, 0, /* No default value */
204                 "occ-Index"
205                 },
206         { ATF_NOFLAGS, 0, offsetof(struct PUCCH_format4, startingSymbolIndex),
207                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
208                 -1,     /* IMPLICIT tag at current level */
209                 &asn_DEF_NativeInteger,
210                 0,
211                 { &asn_OER_memb_startingSymbolIndex_constr_11, &asn_PER_memb_startingSymbolIndex_constr_11,  memb_startingSymbolIndex_constraint_1 },
212                 0, 0, /* No default value */
213                 "startingSymbolIndex"
214                 },
215 };
216 static const ber_tlv_tag_t asn_DEF_PUCCH_format4_tags_1[] = {
217         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
218 };
219 static const asn_TYPE_tag2member_t asn_MAP_PUCCH_format4_tag2el_1[] = {
220     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nrofSymbols */
221     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* occ-Length */
222     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* occ-Index */
223     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* startingSymbolIndex */
224 };
225 asn_SEQUENCE_specifics_t asn_SPC_PUCCH_format4_specs_1 = {
226         sizeof(struct PUCCH_format4),
227         offsetof(struct PUCCH_format4, _asn_ctx),
228         asn_MAP_PUCCH_format4_tag2el_1,
229         4,      /* Count of tags in the map */
230         0, 0, 0,        /* Optional elements (not needed) */
231         -1,     /* First extension addition */
232 };
233 asn_TYPE_descriptor_t asn_DEF_PUCCH_format4 = {
234         "PUCCH-format4",
235         "PUCCH-format4",
236         &asn_OP_SEQUENCE,
237         asn_DEF_PUCCH_format4_tags_1,
238         sizeof(asn_DEF_PUCCH_format4_tags_1)
239                 /sizeof(asn_DEF_PUCCH_format4_tags_1[0]), /* 1 */
240         asn_DEF_PUCCH_format4_tags_1,   /* Same as above */
241         sizeof(asn_DEF_PUCCH_format4_tags_1)
242                 /sizeof(asn_DEF_PUCCH_format4_tags_1[0]), /* 1 */
243         { 0, 0, SEQUENCE_constraint },
244         asn_MBR_PUCCH_format4_1,
245         4,      /* Elements count */
246         &asn_SPC_PUCCH_format4_specs_1  /* Additional specs */
247 };
248