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