Add version 0.5.0
[ric-plt/submgr.git] / e2ap / lib / RelativeNarrowbandTxPower.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "Spec/e2ap-v031ex.asn"
5  *      `asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
6  */
7
8 #include "RelativeNarrowbandTxPower.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_rNTP_PerPRB_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 >= 6 && size <= 110)) {
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_p_B_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
48                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
49         long value;
50         
51         if(!sptr) {
52                 ASN__CTFAIL(app_key, td, sptr,
53                         "%s: value not given (%s:%d)",
54                         td->name, __FILE__, __LINE__);
55                 return -1;
56         }
57         
58         value = *(const long *)sptr;
59         
60         if((value >= 0 && value <= 3)) {
61                 /* Constraint check succeeded */
62                 return 0;
63         } else {
64                 ASN__CTFAIL(app_key, td, sptr,
65                         "%s: constraint failed (%s:%d)",
66                         td->name, __FILE__, __LINE__);
67                 return -1;
68         }
69 }
70
71 static int
72 memb_pDCCH_InterferenceImpact_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
73                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
74         long value;
75         
76         if(!sptr) {
77                 ASN__CTFAIL(app_key, td, sptr,
78                         "%s: value not given (%s:%d)",
79                         td->name, __FILE__, __LINE__);
80                 return -1;
81         }
82         
83         value = *(const long *)sptr;
84         
85         if((value >= 0 && value <= 4)) {
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_oer_constraints_t asn_OER_type_numberOfCellSpecificAntennaPorts_constr_4 CC_NOTUSED = {
97         { 0, 0 },
98         -1};
99 static asn_per_constraints_t asn_PER_type_numberOfCellSpecificAntennaPorts_constr_4 CC_NOTUSED = {
100         { APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }    /* (0..2,...) */,
101         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
102         0, 0    /* No PER value map */
103 };
104 static asn_oer_constraints_t asn_OER_memb_rNTP_PerPRB_constr_2 CC_NOTUSED = {
105         { 0, 0 },
106         -1      /* (SIZE(0..MAX)) */};
107 static asn_per_constraints_t asn_PER_memb_rNTP_PerPRB_constr_2 CC_NOTUSED = {
108         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
109         { APC_CONSTRAINED | APC_EXTENSIBLE,  7,  7,  6,  110 }  /* (SIZE(6..110,...)) */,
110         0, 0    /* No PER value map */
111 };
112 static asn_oer_constraints_t asn_OER_memb_p_B_constr_9 CC_NOTUSED = {
113         { 0, 0 },
114         -1};
115 static asn_per_constraints_t asn_PER_memb_p_B_constr_9 CC_NOTUSED = {
116         { APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  3 }    /* (0..3,...) */,
117         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
118         0, 0    /* No PER value map */
119 };
120 static asn_oer_constraints_t asn_OER_memb_pDCCH_InterferenceImpact_constr_10 CC_NOTUSED = {
121         { 0, 0 },
122         -1};
123 static asn_per_constraints_t asn_PER_memb_pDCCH_InterferenceImpact_constr_10 CC_NOTUSED = {
124         { APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  4 }    /* (0..4,...) */,
125         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
126         0, 0    /* No PER value map */
127 };
128 static const asn_INTEGER_enum_map_t asn_MAP_numberOfCellSpecificAntennaPorts_value2enum_4[] = {
129         { 0,    3,      "one" },
130         { 1,    3,      "two" },
131         { 2,    4,      "four" }
132         /* This list is extensible */
133 };
134 static const unsigned int asn_MAP_numberOfCellSpecificAntennaPorts_enum2value_4[] = {
135         2,      /* four(2) */
136         0,      /* one(0) */
137         1       /* two(1) */
138         /* This list is extensible */
139 };
140 static const asn_INTEGER_specifics_t asn_SPC_numberOfCellSpecificAntennaPorts_specs_4 = {
141         asn_MAP_numberOfCellSpecificAntennaPorts_value2enum_4,  /* "tag" => N; sorted by tag */
142         asn_MAP_numberOfCellSpecificAntennaPorts_enum2value_4,  /* N => "tag"; sorted by N */
143         3,      /* Number of elements in the maps */
144         4,      /* Extensions before this member */
145         1,      /* Strict enumeration */
146         0,      /* Native long size */
147         0
148 };
149 static const ber_tlv_tag_t asn_DEF_numberOfCellSpecificAntennaPorts_tags_4[] = {
150         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
151         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
152 };
153 static /* Use -fall-defs-global to expose */
154 asn_TYPE_descriptor_t asn_DEF_numberOfCellSpecificAntennaPorts_4 = {
155         "numberOfCellSpecificAntennaPorts",
156         "numberOfCellSpecificAntennaPorts",
157         &asn_OP_NativeEnumerated,
158         asn_DEF_numberOfCellSpecificAntennaPorts_tags_4,
159         sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_4)
160                 /sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_4[0]) - 1, /* 1 */
161         asn_DEF_numberOfCellSpecificAntennaPorts_tags_4,        /* Same as above */
162         sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_4)
163                 /sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_4[0]), /* 2 */
164         { &asn_OER_type_numberOfCellSpecificAntennaPorts_constr_4, &asn_PER_type_numberOfCellSpecificAntennaPorts_constr_4, NativeEnumerated_constraint },
165         0, 0,   /* Defined elsewhere */
166         &asn_SPC_numberOfCellSpecificAntennaPorts_specs_4       /* Additional specs */
167 };
168
169 asn_TYPE_member_t asn_MBR_RelativeNarrowbandTxPower_1[] = {
170         { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, rNTP_PerPRB),
171                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
172                 -1,     /* IMPLICIT tag at current level */
173                 &asn_DEF_BIT_STRING,
174                 0,
175                 { &asn_OER_memb_rNTP_PerPRB_constr_2, &asn_PER_memb_rNTP_PerPRB_constr_2,  memb_rNTP_PerPRB_constraint_1 },
176                 0, 0, /* No default value */
177                 "rNTP-PerPRB"
178                 },
179         { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, rNTP_Threshold),
180                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
181                 -1,     /* IMPLICIT tag at current level */
182                 &asn_DEF_RNTP_Threshold,
183                 0,
184                 { 0, 0, 0 },
185                 0, 0, /* No default value */
186                 "rNTP-Threshold"
187                 },
188         { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, numberOfCellSpecificAntennaPorts),
189                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
190                 -1,     /* IMPLICIT tag at current level */
191                 &asn_DEF_numberOfCellSpecificAntennaPorts_4,
192                 0,
193                 { 0, 0, 0 },
194                 0, 0, /* No default value */
195                 "numberOfCellSpecificAntennaPorts"
196                 },
197         { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, p_B),
198                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
199                 -1,     /* IMPLICIT tag at current level */
200                 &asn_DEF_NativeInteger,
201                 0,
202                 { &asn_OER_memb_p_B_constr_9, &asn_PER_memb_p_B_constr_9,  memb_p_B_constraint_1 },
203                 0, 0, /* No default value */
204                 "p-B"
205                 },
206         { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, pDCCH_InterferenceImpact),
207                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
208                 -1,     /* IMPLICIT tag at current level */
209                 &asn_DEF_NativeInteger,
210                 0,
211                 { &asn_OER_memb_pDCCH_InterferenceImpact_constr_10, &asn_PER_memb_pDCCH_InterferenceImpact_constr_10,  memb_pDCCH_InterferenceImpact_constraint_1 },
212                 0, 0, /* No default value */
213                 "pDCCH-InterferenceImpact"
214                 },
215         { ATF_POINTER, 1, offsetof(struct RelativeNarrowbandTxPower, iE_Extensions),
216                 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
217                 -1,     /* IMPLICIT tag at current level */
218                 &asn_DEF_ProtocolExtensionContainer_9566P184,
219                 0,
220                 { 0, 0, 0 },
221                 0, 0, /* No default value */
222                 "iE-Extensions"
223                 },
224 };
225 static const int asn_MAP_RelativeNarrowbandTxPower_oms_1[] = { 5 };
226 static const ber_tlv_tag_t asn_DEF_RelativeNarrowbandTxPower_tags_1[] = {
227         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
228 };
229 static const asn_TYPE_tag2member_t asn_MAP_RelativeNarrowbandTxPower_tag2el_1[] = {
230     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* rNTP-PerPRB */
231     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* rNTP-Threshold */
232     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* numberOfCellSpecificAntennaPorts */
233     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* p-B */
234     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* pDCCH-InterferenceImpact */
235     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* iE-Extensions */
236 };
237 asn_SEQUENCE_specifics_t asn_SPC_RelativeNarrowbandTxPower_specs_1 = {
238         sizeof(struct RelativeNarrowbandTxPower),
239         offsetof(struct RelativeNarrowbandTxPower, _asn_ctx),
240         asn_MAP_RelativeNarrowbandTxPower_tag2el_1,
241         6,      /* Count of tags in the map */
242         asn_MAP_RelativeNarrowbandTxPower_oms_1,        /* Optional members */
243         1, 0,   /* Root/Additions */
244         6,      /* First extension addition */
245 };
246 asn_TYPE_descriptor_t asn_DEF_RelativeNarrowbandTxPower = {
247         "RelativeNarrowbandTxPower",
248         "RelativeNarrowbandTxPower",
249         &asn_OP_SEQUENCE,
250         asn_DEF_RelativeNarrowbandTxPower_tags_1,
251         sizeof(asn_DEF_RelativeNarrowbandTxPower_tags_1)
252                 /sizeof(asn_DEF_RelativeNarrowbandTxPower_tags_1[0]), /* 1 */
253         asn_DEF_RelativeNarrowbandTxPower_tags_1,       /* Same as above */
254         sizeof(asn_DEF_RelativeNarrowbandTxPower_tags_1)
255                 /sizeof(asn_DEF_RelativeNarrowbandTxPower_tags_1[0]), /* 1 */
256         { 0, 0, SEQUENCE_constraint },
257         asn_MBR_RelativeNarrowbandTxPower_1,
258         6,      /* Elements count */
259         &asn_SPC_RelativeNarrowbandTxPower_specs_1      /* Additional specs */
260 };
261