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