Adding new comments for Oran in all files with licenses
[ric-plt/resource-status-manager.git] / RSM / 3rdparty / asn1codec / e2ap_engine / FreqBandNrItem.c
1 /*
2  * Copyright 2019 AT&T Intellectual Property
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  * This source code is part of the near-RT RIC (RAN Intelligent Controller)
19  * platform project (RICP).
20  */
21
22
23
24 /*
25  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
26  * From ASN.1 module "X2AP-IEs"
27  *      found in "../../asnFiles/X2AP-IEs.asn"
28  *      `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D.`
29  */
30
31 #include "FreqBandNrItem.h"
32
33 #include "ProtocolExtensionContainer.h"
34 #include "SupportedSULFreqBandItem.h"
35 static int
36 memb_freqBandIndicatorNr_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
37                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
38         long value;
39         
40         if(!sptr) {
41                 ASN__CTFAIL(app_key, td, sptr,
42                         "%s: value not given (%s:%d)",
43                         td->name, __FILE__, __LINE__);
44                 return -1;
45         }
46         
47         value = *(const long *)sptr;
48         
49         if((value >= 1 && value <= 1024)) {
50                 /* Constraint check succeeded */
51                 return 0;
52         } else {
53                 ASN__CTFAIL(app_key, td, sptr,
54                         "%s: constraint failed (%s:%d)",
55                         td->name, __FILE__, __LINE__);
56                 return -1;
57         }
58 }
59
60 static int
61 memb_supportedSULBandList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
62                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
63         size_t size;
64         
65         if(!sptr) {
66                 ASN__CTFAIL(app_key, td, sptr,
67                         "%s: value not given (%s:%d)",
68                         td->name, __FILE__, __LINE__);
69                 return -1;
70         }
71         
72         /* Determine the number of elements */
73         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
74         
75         if((size <= 32)) {
76                 /* Perform validation of the inner elements */
77                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
78         } else {
79                 ASN__CTFAIL(app_key, td, sptr,
80                         "%s: constraint failed (%s:%d)",
81                         td->name, __FILE__, __LINE__);
82                 return -1;
83         }
84 }
85
86 static asn_per_constraints_t asn_PER_type_supportedSULBandList_constr_3 CC_NOTUSED = {
87         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
88         { APC_CONSTRAINED,       6,  6,  0,  32 }       /* (SIZE(0..32)) */,
89         0, 0    /* No PER value map */
90 };
91 static asn_per_constraints_t asn_PER_memb_freqBandIndicatorNr_constr_2 CC_NOTUSED = {
92         { APC_CONSTRAINED | APC_EXTENSIBLE,  10,  10,  1,  1024 }       /* (1..1024,...) */,
93         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
94         0, 0    /* No PER value map */
95 };
96 static asn_per_constraints_t asn_PER_memb_supportedSULBandList_constr_3 CC_NOTUSED = {
97         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
98         { APC_CONSTRAINED,       6,  6,  0,  32 }       /* (SIZE(0..32)) */,
99         0, 0    /* No PER value map */
100 };
101 static asn_TYPE_member_t asn_MBR_supportedSULBandList_3[] = {
102         { ATF_POINTER, 0, 0,
103                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
104                 0,
105                 &asn_DEF_SupportedSULFreqBandItem,
106                 0,
107                 { 0, 0, 0 },
108                 0, 0, /* No default value */
109                 ""
110                 },
111 };
112 static const ber_tlv_tag_t asn_DEF_supportedSULBandList_tags_3[] = {
113         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
114         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
115 };
116 static asn_SET_OF_specifics_t asn_SPC_supportedSULBandList_specs_3 = {
117         sizeof(struct FreqBandNrItem__supportedSULBandList),
118         offsetof(struct FreqBandNrItem__supportedSULBandList, _asn_ctx),
119         0,      /* XER encoding is XMLDelimitedItemList */
120 };
121 static /* Use -fall-defs-global to expose */
122 asn_TYPE_descriptor_t asn_DEF_supportedSULBandList_3 = {
123         "supportedSULBandList",
124         "supportedSULBandList",
125         &asn_OP_SEQUENCE_OF,
126         asn_DEF_supportedSULBandList_tags_3,
127         sizeof(asn_DEF_supportedSULBandList_tags_3)
128                 /sizeof(asn_DEF_supportedSULBandList_tags_3[0]) - 1, /* 1 */
129         asn_DEF_supportedSULBandList_tags_3,    /* Same as above */
130         sizeof(asn_DEF_supportedSULBandList_tags_3)
131                 /sizeof(asn_DEF_supportedSULBandList_tags_3[0]), /* 2 */
132         { 0, &asn_PER_type_supportedSULBandList_constr_3, SEQUENCE_OF_constraint },
133         asn_MBR_supportedSULBandList_3,
134         1,      /* Single element */
135         &asn_SPC_supportedSULBandList_specs_3   /* Additional specs */
136 };
137
138 asn_TYPE_member_t asn_MBR_FreqBandNrItem_1[] = {
139         { ATF_NOFLAGS, 0, offsetof(struct FreqBandNrItem, freqBandIndicatorNr),
140                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
141                 -1,     /* IMPLICIT tag at current level */
142                 &asn_DEF_NativeInteger,
143                 0,
144                 { 0, &asn_PER_memb_freqBandIndicatorNr_constr_2,  memb_freqBandIndicatorNr_constraint_1 },
145                 0, 0, /* No default value */
146                 "freqBandIndicatorNr"
147                 },
148         { ATF_NOFLAGS, 0, offsetof(struct FreqBandNrItem, supportedSULBandList),
149                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
150                 0,
151                 &asn_DEF_supportedSULBandList_3,
152                 0,
153                 { 0, &asn_PER_memb_supportedSULBandList_constr_3,  memb_supportedSULBandList_constraint_1 },
154                 0, 0, /* No default value */
155                 "supportedSULBandList"
156                 },
157         { ATF_POINTER, 1, offsetof(struct FreqBandNrItem, iE_Extensions),
158                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
159                 -1,     /* IMPLICIT tag at current level */
160                 &asn_DEF_ProtocolExtensionContainer_170P148,
161                 0,
162                 { 0, 0, 0 },
163                 0, 0, /* No default value */
164                 "iE-Extensions"
165                 },
166 };
167 static const int asn_MAP_FreqBandNrItem_oms_1[] = { 2 };
168 static const ber_tlv_tag_t asn_DEF_FreqBandNrItem_tags_1[] = {
169         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
170 };
171 static const asn_TYPE_tag2member_t asn_MAP_FreqBandNrItem_tag2el_1[] = {
172     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* freqBandIndicatorNr */
173     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* supportedSULBandList */
174     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
175 };
176 asn_SEQUENCE_specifics_t asn_SPC_FreqBandNrItem_specs_1 = {
177         sizeof(struct FreqBandNrItem),
178         offsetof(struct FreqBandNrItem, _asn_ctx),
179         asn_MAP_FreqBandNrItem_tag2el_1,
180         3,      /* Count of tags in the map */
181         asn_MAP_FreqBandNrItem_oms_1,   /* Optional members */
182         1, 0,   /* Root/Additions */
183         3,      /* First extension addition */
184 };
185 asn_TYPE_descriptor_t asn_DEF_FreqBandNrItem = {
186         "FreqBandNrItem",
187         "FreqBandNrItem",
188         &asn_OP_SEQUENCE,
189         asn_DEF_FreqBandNrItem_tags_1,
190         sizeof(asn_DEF_FreqBandNrItem_tags_1)
191                 /sizeof(asn_DEF_FreqBandNrItem_tags_1[0]), /* 1 */
192         asn_DEF_FreqBandNrItem_tags_1,  /* Same as above */
193         sizeof(asn_DEF_FreqBandNrItem_tags_1)
194                 /sizeof(asn_DEF_FreqBandNrItem_tags_1[0]), /* 1 */
195         { 0, 0, SEQUENCE_constraint },
196         asn_MBR_FreqBandNrItem_1,
197         3,      /* Elements count */
198         &asn_SPC_FreqBandNrItem_specs_1 /* Additional specs */
199 };
200