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