Adding new comments for Oran in all files with licenses
[ric-plt/resource-status-manager.git] / RSM / 3rdparty / asn1codec / e2ap_engine / NRFreqInfo.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 "NRFreqInfo.h"
32
33 #include "SULInformation.h"
34 #include "ProtocolExtensionContainer.h"
35 #include "FreqBandNrItem.h"
36 static int
37 memb_nRARFCN_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
38                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
39         long value;
40         
41         if(!sptr) {
42                 ASN__CTFAIL(app_key, td, sptr,
43                         "%s: value not given (%s:%d)",
44                         td->name, __FILE__, __LINE__);
45                 return -1;
46         }
47         
48         value = *(const long *)sptr;
49         
50         if((value >= 0 && value <= 3279165)) {
51                 /* Constraint check succeeded */
52                 return 0;
53         } else {
54                 ASN__CTFAIL(app_key, td, sptr,
55                         "%s: constraint failed (%s:%d)",
56                         td->name, __FILE__, __LINE__);
57                 return -1;
58         }
59 }
60
61 static int
62 memb_freqBandListNr_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
63                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
64         size_t size;
65         
66         if(!sptr) {
67                 ASN__CTFAIL(app_key, td, sptr,
68                         "%s: value not given (%s:%d)",
69                         td->name, __FILE__, __LINE__);
70                 return -1;
71         }
72         
73         /* Determine the number of elements */
74         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
75         
76         if((size >= 1 && size <= 32)) {
77                 /* Perform validation of the inner elements */
78                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
79         } else {
80                 ASN__CTFAIL(app_key, td, sptr,
81                         "%s: constraint failed (%s:%d)",
82                         td->name, __FILE__, __LINE__);
83                 return -1;
84         }
85 }
86
87 static asn_per_constraints_t asn_PER_type_freqBandListNr_constr_3 CC_NOTUSED = {
88         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
89         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
90         0, 0    /* No PER value map */
91 };
92 static asn_per_constraints_t asn_PER_memb_nRARFCN_constr_2 CC_NOTUSED = {
93         { APC_CONSTRAINED,       22, -1,  0,  3279165 } /* (0..3279165) */,
94         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
95         0, 0    /* No PER value map */
96 };
97 static asn_per_constraints_t asn_PER_memb_freqBandListNr_constr_3 CC_NOTUSED = {
98         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
99         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
100         0, 0    /* No PER value map */
101 };
102 static asn_TYPE_member_t asn_MBR_freqBandListNr_3[] = {
103         { ATF_POINTER, 0, 0,
104                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
105                 0,
106                 &asn_DEF_FreqBandNrItem,
107                 0,
108                 { 0, 0, 0 },
109                 0, 0, /* No default value */
110                 ""
111                 },
112 };
113 static const ber_tlv_tag_t asn_DEF_freqBandListNr_tags_3[] = {
114         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
115         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
116 };
117 static asn_SET_OF_specifics_t asn_SPC_freqBandListNr_specs_3 = {
118         sizeof(struct NRFreqInfo__freqBandListNr),
119         offsetof(struct NRFreqInfo__freqBandListNr, _asn_ctx),
120         0,      /* XER encoding is XMLDelimitedItemList */
121 };
122 static /* Use -fall-defs-global to expose */
123 asn_TYPE_descriptor_t asn_DEF_freqBandListNr_3 = {
124         "freqBandListNr",
125         "freqBandListNr",
126         &asn_OP_SEQUENCE_OF,
127         asn_DEF_freqBandListNr_tags_3,
128         sizeof(asn_DEF_freqBandListNr_tags_3)
129                 /sizeof(asn_DEF_freqBandListNr_tags_3[0]) - 1, /* 1 */
130         asn_DEF_freqBandListNr_tags_3,  /* Same as above */
131         sizeof(asn_DEF_freqBandListNr_tags_3)
132                 /sizeof(asn_DEF_freqBandListNr_tags_3[0]), /* 2 */
133         { 0, &asn_PER_type_freqBandListNr_constr_3, SEQUENCE_OF_constraint },
134         asn_MBR_freqBandListNr_3,
135         1,      /* Single element */
136         &asn_SPC_freqBandListNr_specs_3 /* Additional specs */
137 };
138
139 asn_TYPE_member_t asn_MBR_NRFreqInfo_1[] = {
140         { ATF_NOFLAGS, 0, offsetof(struct NRFreqInfo, nRARFCN),
141                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
142                 -1,     /* IMPLICIT tag at current level */
143                 &asn_DEF_NativeInteger,
144                 0,
145                 { 0, &asn_PER_memb_nRARFCN_constr_2,  memb_nRARFCN_constraint_1 },
146                 0, 0, /* No default value */
147                 "nRARFCN"
148                 },
149         { ATF_NOFLAGS, 0, offsetof(struct NRFreqInfo, freqBandListNr),
150                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
151                 0,
152                 &asn_DEF_freqBandListNr_3,
153                 0,
154                 { 0, &asn_PER_memb_freqBandListNr_constr_3,  memb_freqBandListNr_constraint_1 },
155                 0, 0, /* No default value */
156                 "freqBandListNr"
157                 },
158         { ATF_POINTER, 2, offsetof(struct NRFreqInfo, sULInformation),
159                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
160                 -1,     /* IMPLICIT tag at current level */
161                 &asn_DEF_SULInformation,
162                 0,
163                 { 0, 0, 0 },
164                 0, 0, /* No default value */
165                 "sULInformation"
166                 },
167         { ATF_POINTER, 1, offsetof(struct NRFreqInfo, iE_Extensions),
168                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
169                 -1,     /* IMPLICIT tag at current level */
170                 &asn_DEF_ProtocolExtensionContainer_170P173,
171                 0,
172                 { 0, 0, 0 },
173                 0, 0, /* No default value */
174                 "iE-Extensions"
175                 },
176 };
177 static const int asn_MAP_NRFreqInfo_oms_1[] = { 2, 3 };
178 static const ber_tlv_tag_t asn_DEF_NRFreqInfo_tags_1[] = {
179         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
180 };
181 static const asn_TYPE_tag2member_t asn_MAP_NRFreqInfo_tag2el_1[] = {
182     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nRARFCN */
183     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* freqBandListNr */
184     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* sULInformation */
185     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
186 };
187 asn_SEQUENCE_specifics_t asn_SPC_NRFreqInfo_specs_1 = {
188         sizeof(struct NRFreqInfo),
189         offsetof(struct NRFreqInfo, _asn_ctx),
190         asn_MAP_NRFreqInfo_tag2el_1,
191         4,      /* Count of tags in the map */
192         asn_MAP_NRFreqInfo_oms_1,       /* Optional members */
193         2, 0,   /* Root/Additions */
194         4,      /* First extension addition */
195 };
196 asn_TYPE_descriptor_t asn_DEF_NRFreqInfo = {
197         "NRFreqInfo",
198         "NRFreqInfo",
199         &asn_OP_SEQUENCE,
200         asn_DEF_NRFreqInfo_tags_1,
201         sizeof(asn_DEF_NRFreqInfo_tags_1)
202                 /sizeof(asn_DEF_NRFreqInfo_tags_1[0]), /* 1 */
203         asn_DEF_NRFreqInfo_tags_1,      /* Same as above */
204         sizeof(asn_DEF_NRFreqInfo_tags_1)
205                 /sizeof(asn_DEF_NRFreqInfo_tags_1[0]), /* 1 */
206         { 0, 0, SEQUENCE_constraint },
207         asn_MBR_NRFreqInfo_1,
208         4,      /* Elements count */
209         &asn_SPC_NRFreqInfo_specs_1     /* Additional specs */
210 };
211