Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) |
| 3 | * From ASN.1 module "X2AP-IEs" |
| 4 | * found in "Spec/e2_and_x2-combined-and-minimized.asn1" |
| 5 | * `asn1c -pdu=auto -fincludes-quoted -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example` |
| 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_per_constraints_t asn_PER_type_numberOfCellSpecificAntennaPorts_constr_4 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_rNTP_PerPRB_constr_2 CC_NOTUSED = { |
| 102 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 103 | { APC_CONSTRAINED | APC_EXTENSIBLE, 7, 7, 6, 110 } /* (SIZE(6..110,...)) */, |
| 104 | 0, 0 /* No PER value map */ |
| 105 | }; |
| 106 | static asn_per_constraints_t asn_PER_memb_p_B_constr_9 CC_NOTUSED = { |
| 107 | { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 3 } /* (0..3,...) */, |
| 108 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 109 | 0, 0 /* No PER value map */ |
| 110 | }; |
| 111 | static asn_per_constraints_t asn_PER_memb_pDCCH_InterferenceImpact_constr_10 CC_NOTUSED = { |
| 112 | { APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 4 } /* (0..4,...) */, |
| 113 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 114 | 0, 0 /* No PER value map */ |
| 115 | }; |
| 116 | static const asn_INTEGER_enum_map_t asn_MAP_numberOfCellSpecificAntennaPorts_value2enum_4[] = { |
| 117 | { 0, 3, "one" }, |
| 118 | { 1, 3, "two" }, |
| 119 | { 2, 4, "four" } |
| 120 | /* This list is extensible */ |
| 121 | }; |
| 122 | static const unsigned int asn_MAP_numberOfCellSpecificAntennaPorts_enum2value_4[] = { |
| 123 | 2, /* four(2) */ |
| 124 | 0, /* one(0) */ |
| 125 | 1 /* two(1) */ |
| 126 | /* This list is extensible */ |
| 127 | }; |
| 128 | static const asn_INTEGER_specifics_t asn_SPC_numberOfCellSpecificAntennaPorts_specs_4 = { |
| 129 | asn_MAP_numberOfCellSpecificAntennaPorts_value2enum_4, /* "tag" => N; sorted by tag */ |
| 130 | asn_MAP_numberOfCellSpecificAntennaPorts_enum2value_4, /* N => "tag"; sorted by N */ |
| 131 | 3, /* Number of elements in the maps */ |
| 132 | 4, /* Extensions before this member */ |
| 133 | 1, /* Strict enumeration */ |
| 134 | 0, /* Native long size */ |
| 135 | 0 |
| 136 | }; |
| 137 | static const ber_tlv_tag_t asn_DEF_numberOfCellSpecificAntennaPorts_tags_4[] = { |
| 138 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 139 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 140 | }; |
| 141 | static /* Use -fall-defs-global to expose */ |
| 142 | asn_TYPE_descriptor_t asn_DEF_numberOfCellSpecificAntennaPorts_4 = { |
| 143 | "numberOfCellSpecificAntennaPorts", |
| 144 | "numberOfCellSpecificAntennaPorts", |
| 145 | &asn_OP_NativeEnumerated, |
| 146 | asn_DEF_numberOfCellSpecificAntennaPorts_tags_4, |
| 147 | sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_4) |
| 148 | /sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_4[0]) - 1, /* 1 */ |
| 149 | asn_DEF_numberOfCellSpecificAntennaPorts_tags_4, /* Same as above */ |
| 150 | sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_4) |
| 151 | /sizeof(asn_DEF_numberOfCellSpecificAntennaPorts_tags_4[0]), /* 2 */ |
| 152 | { 0, &asn_PER_type_numberOfCellSpecificAntennaPorts_constr_4, NativeEnumerated_constraint }, |
| 153 | 0, 0, /* Defined elsewhere */ |
| 154 | &asn_SPC_numberOfCellSpecificAntennaPorts_specs_4 /* Additional specs */ |
| 155 | }; |
| 156 | |
| 157 | asn_TYPE_member_t asn_MBR_RelativeNarrowbandTxPower_1[] = { |
| 158 | { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, rNTP_PerPRB), |
| 159 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 160 | -1, /* IMPLICIT tag at current level */ |
| 161 | &asn_DEF_BIT_STRING, |
| 162 | 0, |
| 163 | { 0, &asn_PER_memb_rNTP_PerPRB_constr_2, memb_rNTP_PerPRB_constraint_1 }, |
| 164 | 0, 0, /* No default value */ |
| 165 | "rNTP-PerPRB" |
| 166 | }, |
| 167 | { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, rNTP_Threshold), |
| 168 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 169 | -1, /* IMPLICIT tag at current level */ |
| 170 | &asn_DEF_RNTP_Threshold, |
| 171 | 0, |
| 172 | { 0, 0, 0 }, |
| 173 | 0, 0, /* No default value */ |
| 174 | "rNTP-Threshold" |
| 175 | }, |
| 176 | { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, numberOfCellSpecificAntennaPorts), |
| 177 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 178 | -1, /* IMPLICIT tag at current level */ |
| 179 | &asn_DEF_numberOfCellSpecificAntennaPorts_4, |
| 180 | 0, |
| 181 | { 0, 0, 0 }, |
| 182 | 0, 0, /* No default value */ |
| 183 | "numberOfCellSpecificAntennaPorts" |
| 184 | }, |
| 185 | { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, p_B), |
| 186 | (ASN_TAG_CLASS_CONTEXT | (3 << 2)), |
| 187 | -1, /* IMPLICIT tag at current level */ |
| 188 | &asn_DEF_NativeInteger, |
| 189 | 0, |
| 190 | { 0, &asn_PER_memb_p_B_constr_9, memb_p_B_constraint_1 }, |
| 191 | 0, 0, /* No default value */ |
| 192 | "p-B" |
| 193 | }, |
| 194 | { ATF_NOFLAGS, 0, offsetof(struct RelativeNarrowbandTxPower, pDCCH_InterferenceImpact), |
| 195 | (ASN_TAG_CLASS_CONTEXT | (4 << 2)), |
| 196 | -1, /* IMPLICIT tag at current level */ |
| 197 | &asn_DEF_NativeInteger, |
| 198 | 0, |
| 199 | { 0, &asn_PER_memb_pDCCH_InterferenceImpact_constr_10, memb_pDCCH_InterferenceImpact_constraint_1 }, |
| 200 | 0, 0, /* No default value */ |
| 201 | "pDCCH-InterferenceImpact" |
| 202 | }, |
| 203 | { ATF_POINTER, 1, offsetof(struct RelativeNarrowbandTxPower, iE_Extensions), |
| 204 | (ASN_TAG_CLASS_CONTEXT | (5 << 2)), |
| 205 | -1, /* IMPLICIT tag at current level */ |
| 206 | &asn_DEF_ProtocolExtensionContainer_8858P60, |
| 207 | 0, |
| 208 | { 0, 0, 0 }, |
| 209 | 0, 0, /* No default value */ |
| 210 | "iE-Extensions" |
| 211 | }, |
| 212 | }; |
| 213 | static const int asn_MAP_RelativeNarrowbandTxPower_oms_1[] = { 5 }; |
| 214 | static const ber_tlv_tag_t asn_DEF_RelativeNarrowbandTxPower_tags_1[] = { |
| 215 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 216 | }; |
| 217 | static const asn_TYPE_tag2member_t asn_MAP_RelativeNarrowbandTxPower_tag2el_1[] = { |
| 218 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* rNTP-PerPRB */ |
| 219 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* rNTP-Threshold */ |
| 220 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* numberOfCellSpecificAntennaPorts */ |
| 221 | { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* p-B */ |
| 222 | { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* pDCCH-InterferenceImpact */ |
| 223 | { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* iE-Extensions */ |
| 224 | }; |
| 225 | asn_SEQUENCE_specifics_t asn_SPC_RelativeNarrowbandTxPower_specs_1 = { |
| 226 | sizeof(struct RelativeNarrowbandTxPower), |
| 227 | offsetof(struct RelativeNarrowbandTxPower, _asn_ctx), |
| 228 | asn_MAP_RelativeNarrowbandTxPower_tag2el_1, |
| 229 | 6, /* Count of tags in the map */ |
| 230 | asn_MAP_RelativeNarrowbandTxPower_oms_1, /* Optional members */ |
| 231 | 1, 0, /* Root/Additions */ |
| 232 | 6, /* First extension addition */ |
| 233 | }; |
| 234 | asn_TYPE_descriptor_t asn_DEF_RelativeNarrowbandTxPower = { |
| 235 | "RelativeNarrowbandTxPower", |
| 236 | "RelativeNarrowbandTxPower", |
| 237 | &asn_OP_SEQUENCE, |
| 238 | asn_DEF_RelativeNarrowbandTxPower_tags_1, |
| 239 | sizeof(asn_DEF_RelativeNarrowbandTxPower_tags_1) |
| 240 | /sizeof(asn_DEF_RelativeNarrowbandTxPower_tags_1[0]), /* 1 */ |
| 241 | asn_DEF_RelativeNarrowbandTxPower_tags_1, /* Same as above */ |
| 242 | sizeof(asn_DEF_RelativeNarrowbandTxPower_tags_1) |
| 243 | /sizeof(asn_DEF_RelativeNarrowbandTxPower_tags_1[0]), /* 1 */ |
| 244 | { 0, 0, SEQUENCE_constraint }, |
| 245 | asn_MBR_RelativeNarrowbandTxPower_1, |
| 246 | 6, /* Elements count */ |
| 247 | &asn_SPC_RelativeNarrowbandTxPower_specs_1 /* Additional specs */ |
| 248 | }; |
| 249 | |