a5e285e9841804020c33a184c10ae63ec82b5020
[ric-plt/resource-status-manager.git] / RSM / 3rdparty / asn1codec / e2ap_engine / ABSInformationFDD.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 "ABSInformationFDD.h"
32
33 #include "ProtocolExtensionContainer.h"
34 /*
35  * This type is implemented using NativeEnumerated,
36  * so here we adjust the DEF accordingly.
37  */
38 static int
39 memb_abs_pattern_info_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
40                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
41         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
42         size_t size;
43         
44         if(!sptr) {
45                 ASN__CTFAIL(app_key, td, sptr,
46                         "%s: value not given (%s:%d)",
47                         td->name, __FILE__, __LINE__);
48                 return -1;
49         }
50         
51         if(st->size > 0) {
52                 /* Size in bits */
53                 size = 8 * st->size - (st->bits_unused & 0x07);
54         } else {
55                 size = 0;
56         }
57         
58         if((size == 40)) {
59                 /* Constraint check succeeded */
60                 return 0;
61         } else {
62                 ASN__CTFAIL(app_key, td, sptr,
63                         "%s: constraint failed (%s:%d)",
64                         td->name, __FILE__, __LINE__);
65                 return -1;
66         }
67 }
68
69 static int
70 memb_measurement_subset_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
71                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
72         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
73         size_t size;
74         
75         if(!sptr) {
76                 ASN__CTFAIL(app_key, td, sptr,
77                         "%s: value not given (%s:%d)",
78                         td->name, __FILE__, __LINE__);
79                 return -1;
80         }
81         
82         if(st->size > 0) {
83                 /* Size in bits */
84                 size = 8 * st->size - (st->bits_unused & 0x07);
85         } else {
86                 size = 0;
87         }
88         
89         if((size == 40)) {
90                 /* Constraint check succeeded */
91                 return 0;
92         } else {
93                 ASN__CTFAIL(app_key, td, sptr,
94                         "%s: constraint failed (%s:%d)",
95                         td->name, __FILE__, __LINE__);
96                 return -1;
97         }
98 }
99
100 static asn_per_constraints_t asn_PER_type_numberOfCellSpecificAntennaPorts_constr_3 CC_NOTUSED = {
101         { APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }    /* (0..2,...) */,
102         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
103         0, 0    /* No PER value map */
104 };
105 static asn_per_constraints_t asn_PER_memb_abs_pattern_info_constr_2 CC_NOTUSED = {
106         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
107         { APC_CONSTRAINED,       0,  0,  40,  40 }      /* (SIZE(40..40)) */,
108         0, 0    /* No PER value map */
109 };
110 static asn_per_constraints_t asn_PER_memb_measurement_subset_constr_8 CC_NOTUSED = {
111         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
112         { APC_CONSTRAINED,       0,  0,  40,  40 }      /* (SIZE(40..40)) */,
113         0, 0    /* No PER value map */
114 };
115 static const asn_INTEGER_enum_map_t asn_MAP_numberOfCellSpecificAntennaPorts_value2enum_3[] = {
116         { 0,    3,      "one" },
117         { 1,    3,      "two" },
118         { 2,    4,      "four" }
119         /* This list is extensible */
120 };
121 static const unsigned int asn_MAP_numberOfCellSpecificAntennaPorts_enum2value_3[] = {
122         2,      /* four(2) */
123         0,      /* one(0) */
124         1       /* two(1) */
125         /* This list is extensible */
126 };
127 static const asn_INTEGER_specifics_t asn_SPC_numberOfCellSpecificAntennaPorts_specs_3 = {
128         asn_MAP_numberOfCellSpecificAntennaPorts_value2enum_3,  /* "tag" => N; sorted by tag */
129         asn_MAP_numberOfCellSpecificAntennaPorts_enum2value_3,  /* N => "tag"; sorted by N */
130         3,      /* Number of elements in the maps */
131         4,      /* Extensions before this member */
132         1,      /* Strict enumeration */
133         0,      /* Native long size */
134         0
135 };
136 static const ber_tlv_tag_t asn_DEF_numberOfCellSpecificAntennaPorts_tags_3[] = {
137         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
138         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
139 };
140 static /* Use -fall-defs-global to expose */
141 asn_TYPE_descriptor_t asn_DEF_numberOfCellSpecificAntennaPorts_3 = {
142         "numberOfCellSpecificAntennaPorts",
143         "numberOfCellSpecificAntennaPorts",
144         &asn_OP_NativeEnumerated,
145         asn_DEF_numberOfCellSpecificAntennaPorts_tags_3,
146         sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_3)
147                 /sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_3[0]) - 1, /* 1 */
148         asn_DEF_numberOfCellSpecificAntennaPorts_tags_3,        /* Same as above */
149         sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_3)
150                 /sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_3[0]), /* 2 */
151         { 0, &asn_PER_type_numberOfCellSpecificAntennaPorts_constr_3, NativeEnumerated_constraint },
152         0, 0,   /* Defined elsewhere */
153         &asn_SPC_numberOfCellSpecificAntennaPorts_specs_3       /* Additional specs */
154 };
155
156 asn_TYPE_member_t asn_MBR_ABSInformationFDD_1[] = {
157         { ATF_NOFLAGS, 0, offsetof(struct ABSInformationFDD, abs_pattern_info),
158                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
159                 -1,     /* IMPLICIT tag at current level */
160                 &asn_DEF_BIT_STRING,
161                 0,
162                 { 0, &asn_PER_memb_abs_pattern_info_constr_2,  memb_abs_pattern_info_constraint_1 },
163                 0, 0, /* No default value */
164                 "abs-pattern-info"
165                 },
166         { ATF_NOFLAGS, 0, offsetof(struct ABSInformationFDD, numberOfCellSpecificAntennaPorts),
167                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
168                 -1,     /* IMPLICIT tag at current level */
169                 &asn_DEF_numberOfCellSpecificAntennaPorts_3,
170                 0,
171                 { 0, 0, 0 },
172                 0, 0, /* No default value */
173                 "numberOfCellSpecificAntennaPorts"
174                 },
175         { ATF_NOFLAGS, 0, offsetof(struct ABSInformationFDD, measurement_subset),
176                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
177                 -1,     /* IMPLICIT tag at current level */
178                 &asn_DEF_BIT_STRING,
179                 0,
180                 { 0, &asn_PER_memb_measurement_subset_constr_8,  memb_measurement_subset_constraint_1 },
181                 0, 0, /* No default value */
182                 "measurement-subset"
183                 },
184         { ATF_POINTER, 1, offsetof(struct ABSInformationFDD, iE_Extensions),
185                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
186                 -1,     /* IMPLICIT tag at current level */
187                 &asn_DEF_ProtocolExtensionContainer_170P104,
188                 0,
189                 { 0, 0, 0 },
190                 0, 0, /* No default value */
191                 "iE-Extensions"
192                 },
193 };
194 static const int asn_MAP_ABSInformationFDD_oms_1[] = { 3 };
195 static const ber_tlv_tag_t asn_DEF_ABSInformationFDD_tags_1[] = {
196         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
197 };
198 static const asn_TYPE_tag2member_t asn_MAP_ABSInformationFDD_tag2el_1[] = {
199     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* abs-pattern-info */
200     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* numberOfCellSpecificAntennaPorts */
201     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* measurement-subset */
202     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
203 };
204 asn_SEQUENCE_specifics_t asn_SPC_ABSInformationFDD_specs_1 = {
205         sizeof(struct ABSInformationFDD),
206         offsetof(struct ABSInformationFDD, _asn_ctx),
207         asn_MAP_ABSInformationFDD_tag2el_1,
208         4,      /* Count of tags in the map */
209         asn_MAP_ABSInformationFDD_oms_1,        /* Optional members */
210         1, 0,   /* Root/Additions */
211         4,      /* First extension addition */
212 };
213 asn_TYPE_descriptor_t asn_DEF_ABSInformationFDD = {
214         "ABSInformationFDD",
215         "ABSInformationFDD",
216         &asn_OP_SEQUENCE,
217         asn_DEF_ABSInformationFDD_tags_1,
218         sizeof(asn_DEF_ABSInformationFDD_tags_1)
219                 /sizeof(asn_DEF_ABSInformationFDD_tags_1[0]), /* 1 */
220         asn_DEF_ABSInformationFDD_tags_1,       /* Same as above */
221         sizeof(asn_DEF_ABSInformationFDD_tags_1)
222                 /sizeof(asn_DEF_ABSInformationFDD_tags_1[0]), /* 1 */
223         { 0, 0, SEQUENCE_constraint },
224         asn_MBR_ABSInformationFDD_1,
225         4,      /* Elements count */
226         &asn_SPC_ABSInformationFDD_specs_1      /* Additional specs */
227 };
228