[Epic-ID: ODUHIGH-475][Task-ID: ODUHIGH-476]F1AP codec update
[o-du/l2.git] / src / codec_utils / F1AP / Dynamic5QIDescriptor.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "F1AP-IEs"
4  *      found in "../F1.asn1"
5  *      `asn1c -D ../F1_output/ -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
6  */
7
8 #include "Dynamic5QIDescriptor.h"
9
10 #include "ProtocolExtensionContainer.h"
11 /*
12  * This type is implemented using NativeEnumerated,
13  * so here we adjust the DEF accordingly.
14  */
15 static int
16 memb_qoSPriorityLevel_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
17                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
18         long value;
19         
20         if(!sptr) {
21                 ASN__CTFAIL(app_key, td, sptr,
22                         "%s: value not given (%s:%d)",
23                         td->name, __FILE__, __LINE__);
24                 return -1;
25         }
26         
27         value = *(const long *)sptr;
28         
29         if((value >= 1 && value <= 127)) {
30                 /* Constraint check succeeded */
31                 return 0;
32         } else {
33                 ASN__CTFAIL(app_key, td, sptr,
34                         "%s: constraint failed (%s:%d)",
35                         td->name, __FILE__, __LINE__);
36                 return -1;
37         }
38 }
39
40 static int
41 memb_fiveQI_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
42                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
43         long value;
44         
45         if(!sptr) {
46                 ASN__CTFAIL(app_key, td, sptr,
47                         "%s: value not given (%s:%d)",
48                         td->name, __FILE__, __LINE__);
49                 return -1;
50         }
51         
52         value = *(const long *)sptr;
53         
54         if((value >= 0 && value <= 255)) {
55                 /* Constraint check succeeded */
56                 return 0;
57         } else {
58                 ASN__CTFAIL(app_key, td, sptr,
59                         "%s: constraint failed (%s:%d)",
60                         td->name, __FILE__, __LINE__);
61                 return -1;
62         }
63 }
64
65 static asn_oer_constraints_t asn_OER_type_delayCritical_constr_6 CC_NOTUSED = {
66         { 0, 0 },
67         -1};
68 static asn_per_constraints_t asn_PER_type_delayCritical_constr_6 CC_NOTUSED = {
69         { APC_CONSTRAINED,       1,  1,  0,  1 }        /* (0..1) */,
70         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
71         0, 0    /* No PER value map */
72 };
73 static asn_oer_constraints_t asn_OER_memb_qoSPriorityLevel_constr_2 CC_NOTUSED = {
74         { 1, 1 }        /* (1..127) */,
75         -1};
76 static asn_per_constraints_t asn_PER_memb_qoSPriorityLevel_constr_2 CC_NOTUSED = {
77         { APC_CONSTRAINED,       7,  7,  1,  127 }      /* (1..127) */,
78         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
79         0, 0    /* No PER value map */
80 };
81 static asn_oer_constraints_t asn_OER_memb_fiveQI_constr_5 CC_NOTUSED = {
82         { 0, 0 },
83         -1};
84 static asn_per_constraints_t asn_PER_memb_fiveQI_constr_5 CC_NOTUSED = {
85         { APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  0,  255 }  /* (0..255,...) */,
86         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
87         0, 0    /* No PER value map */
88 };
89 static const asn_INTEGER_enum_map_t asn_MAP_delayCritical_value2enum_6[] = {
90         { 0,    14,     "delay-critical" },
91         { 1,    18,     "non-delay-critical" }
92 };
93 static const unsigned int asn_MAP_delayCritical_enum2value_6[] = {
94         0,      /* delay-critical(0) */
95         1       /* non-delay-critical(1) */
96 };
97 static const asn_INTEGER_specifics_t asn_SPC_delayCritical_specs_6 = {
98         asn_MAP_delayCritical_value2enum_6,     /* "tag" => N; sorted by tag */
99         asn_MAP_delayCritical_enum2value_6,     /* N => "tag"; sorted by N */
100         2,      /* Number of elements in the maps */
101         0,      /* Enumeration is not extensible */
102         1,      /* Strict enumeration */
103         0,      /* Native long size */
104         0
105 };
106 static const ber_tlv_tag_t asn_DEF_delayCritical_tags_6[] = {
107         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
108         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
109 };
110 static /* Use -fall-defs-global to expose */
111 asn_TYPE_descriptor_t asn_DEF_delayCritical_6 = {
112         "delayCritical",
113         "delayCritical",
114         &asn_OP_NativeEnumerated,
115         asn_DEF_delayCritical_tags_6,
116         sizeof(asn_DEF_delayCritical_tags_6)
117                 /sizeof(asn_DEF_delayCritical_tags_6[0]) - 1, /* 1 */
118         asn_DEF_delayCritical_tags_6,   /* Same as above */
119         sizeof(asn_DEF_delayCritical_tags_6)
120                 /sizeof(asn_DEF_delayCritical_tags_6[0]), /* 2 */
121         { &asn_OER_type_delayCritical_constr_6, &asn_PER_type_delayCritical_constr_6, NativeEnumerated_constraint },
122         0, 0,   /* Defined elsewhere */
123         &asn_SPC_delayCritical_specs_6  /* Additional specs */
124 };
125
126 asn_TYPE_member_t asn_MBR_Dynamic5QIDescriptor_1[] = {
127         { ATF_NOFLAGS, 0, offsetof(struct Dynamic5QIDescriptor, qoSPriorityLevel),
128                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
129                 -1,     /* IMPLICIT tag at current level */
130                 &asn_DEF_NativeInteger,
131                 0,
132                 { &asn_OER_memb_qoSPriorityLevel_constr_2, &asn_PER_memb_qoSPriorityLevel_constr_2,  memb_qoSPriorityLevel_constraint_1 },
133                 0, 0, /* No default value */
134                 "qoSPriorityLevel"
135                 },
136         { ATF_NOFLAGS, 0, offsetof(struct Dynamic5QIDescriptor, packetDelayBudget),
137                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
138                 -1,     /* IMPLICIT tag at current level */
139                 &asn_DEF_PacketDelayBudget,
140                 0,
141                 { 0, 0, 0 },
142                 0, 0, /* No default value */
143                 "packetDelayBudget"
144                 },
145         { ATF_NOFLAGS, 0, offsetof(struct Dynamic5QIDescriptor, packetErrorRate),
146                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
147                 -1,     /* IMPLICIT tag at current level */
148                 &asn_DEF_PacketErrorRate,
149                 0,
150                 { 0, 0, 0 },
151                 0, 0, /* No default value */
152                 "packetErrorRate"
153                 },
154         { ATF_POINTER, 5, offsetof(struct Dynamic5QIDescriptor, fiveQI),
155                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
156                 -1,     /* IMPLICIT tag at current level */
157                 &asn_DEF_NativeInteger,
158                 0,
159                 { &asn_OER_memb_fiveQI_constr_5, &asn_PER_memb_fiveQI_constr_5,  memb_fiveQI_constraint_1 },
160                 0, 0, /* No default value */
161                 "fiveQI"
162                 },
163         { ATF_POINTER, 4, offsetof(struct Dynamic5QIDescriptor, delayCritical),
164                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
165                 -1,     /* IMPLICIT tag at current level */
166                 &asn_DEF_delayCritical_6,
167                 0,
168                 { 0, 0, 0 },
169                 0, 0, /* No default value */
170                 "delayCritical"
171                 },
172         { ATF_POINTER, 3, offsetof(struct Dynamic5QIDescriptor, averagingWindow),
173                 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
174                 -1,     /* IMPLICIT tag at current level */
175                 &asn_DEF_AveragingWindow,
176                 0,
177                 { 0, 0, 0 },
178                 0, 0, /* No default value */
179                 "averagingWindow"
180                 },
181         { ATF_POINTER, 2, offsetof(struct Dynamic5QIDescriptor, maxDataBurstVolume),
182                 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
183                 -1,     /* IMPLICIT tag at current level */
184                 &asn_DEF_MaxDataBurstVolume,
185                 0,
186                 { 0, 0, 0 },
187                 0, 0, /* No default value */
188                 "maxDataBurstVolume"
189                 },
190         { ATF_POINTER, 1, offsetof(struct Dynamic5QIDescriptor, iE_Extensions),
191                 (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
192                 -1,     /* IMPLICIT tag at current level */
193                 &asn_DEF_ProtocolExtensionContainer_4624P37,
194                 0,
195                 { 0, 0, 0 },
196                 0, 0, /* No default value */
197                 "iE-Extensions"
198                 },
199 };
200 static const int asn_MAP_Dynamic5QIDescriptor_oms_1[] = { 3, 4, 5, 6, 7 };
201 static const ber_tlv_tag_t asn_DEF_Dynamic5QIDescriptor_tags_1[] = {
202         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
203 };
204 static const asn_TYPE_tag2member_t asn_MAP_Dynamic5QIDescriptor_tag2el_1[] = {
205     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* qoSPriorityLevel */
206     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* packetDelayBudget */
207     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* packetErrorRate */
208     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* fiveQI */
209     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* delayCritical */
210     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* averagingWindow */
211     { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* maxDataBurstVolume */
212     { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 } /* iE-Extensions */
213 };
214 asn_SEQUENCE_specifics_t asn_SPC_Dynamic5QIDescriptor_specs_1 = {
215         sizeof(struct Dynamic5QIDescriptor),
216         offsetof(struct Dynamic5QIDescriptor, _asn_ctx),
217         asn_MAP_Dynamic5QIDescriptor_tag2el_1,
218         8,      /* Count of tags in the map */
219         asn_MAP_Dynamic5QIDescriptor_oms_1,     /* Optional members */
220         5, 0,   /* Root/Additions */
221         -1,     /* First extension addition */
222 };
223 asn_TYPE_descriptor_t asn_DEF_Dynamic5QIDescriptor = {
224         "Dynamic5QIDescriptor",
225         "Dynamic5QIDescriptor",
226         &asn_OP_SEQUENCE,
227         asn_DEF_Dynamic5QIDescriptor_tags_1,
228         sizeof(asn_DEF_Dynamic5QIDescriptor_tags_1)
229                 /sizeof(asn_DEF_Dynamic5QIDescriptor_tags_1[0]), /* 1 */
230         asn_DEF_Dynamic5QIDescriptor_tags_1,    /* Same as above */
231         sizeof(asn_DEF_Dynamic5QIDescriptor_tags_1)
232                 /sizeof(asn_DEF_Dynamic5QIDescriptor_tags_1[0]), /* 1 */
233         { 0, 0, SEQUENCE_constraint },
234         asn_MBR_Dynamic5QIDescriptor_1,
235         8,      /* Elements count */
236         &asn_SPC_Dynamic5QIDescriptor_specs_1   /* Additional specs */
237 };
238