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