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