Harry Tran | a1b2b29 | 2019-10-28 11:07:23 -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 "FreqBandNrItem.h" |
| 27 | |
| 28 | #include "ProtocolExtensionContainer.h" |
| 29 | #include "SupportedSULFreqBandItem.h" |
| 30 | static int |
| 31 | memb_freqBandIndicatorNr_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 32 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 33 | long value; |
| 34 | |
| 35 | if(!sptr) { |
| 36 | ASN__CTFAIL(app_key, td, sptr, |
| 37 | "%s: value not given (%s:%d)", |
| 38 | td->name, __FILE__, __LINE__); |
| 39 | return -1; |
| 40 | } |
| 41 | |
| 42 | value = *(const long *)sptr; |
| 43 | |
| 44 | if((value >= 1 && value <= 1024)) { |
| 45 | /* Constraint check succeeded */ |
| 46 | return 0; |
| 47 | } else { |
| 48 | ASN__CTFAIL(app_key, td, sptr, |
| 49 | "%s: constraint failed (%s:%d)", |
| 50 | td->name, __FILE__, __LINE__); |
| 51 | return -1; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | static int |
| 56 | memb_supportedSULBandList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 57 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 58 | size_t size; |
| 59 | |
| 60 | if(!sptr) { |
| 61 | ASN__CTFAIL(app_key, td, sptr, |
| 62 | "%s: value not given (%s:%d)", |
| 63 | td->name, __FILE__, __LINE__); |
| 64 | return -1; |
| 65 | } |
| 66 | |
| 67 | /* Determine the number of elements */ |
| 68 | size = _A_CSEQUENCE_FROM_VOID(sptr)->count; |
| 69 | |
| 70 | if((size <= 32)) { |
| 71 | /* Perform validation of the inner elements */ |
| 72 | return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); |
| 73 | } else { |
| 74 | ASN__CTFAIL(app_key, td, sptr, |
| 75 | "%s: constraint failed (%s:%d)", |
| 76 | td->name, __FILE__, __LINE__); |
| 77 | return -1; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | static asn_per_constraints_t asn_PER_type_supportedSULBandList_constr_3 CC_NOTUSED = { |
| 82 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 83 | { APC_CONSTRAINED, 6, 6, 0, 32 } /* (SIZE(0..32)) */, |
| 84 | 0, 0 /* No PER value map */ |
| 85 | }; |
| 86 | static asn_per_constraints_t asn_PER_memb_freqBandIndicatorNr_constr_2 CC_NOTUSED = { |
| 87 | { APC_CONSTRAINED | APC_EXTENSIBLE, 10, 10, 1, 1024 } /* (1..1024,...) */, |
| 88 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 89 | 0, 0 /* No PER value map */ |
| 90 | }; |
| 91 | static asn_per_constraints_t asn_PER_memb_supportedSULBandList_constr_3 CC_NOTUSED = { |
| 92 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 93 | { APC_CONSTRAINED, 6, 6, 0, 32 } /* (SIZE(0..32)) */, |
| 94 | 0, 0 /* No PER value map */ |
| 95 | }; |
| 96 | static asn_TYPE_member_t asn_MBR_supportedSULBandList_3[] = { |
| 97 | { ATF_POINTER, 0, 0, |
| 98 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 99 | 0, |
| 100 | &asn_DEF_SupportedSULFreqBandItem, |
| 101 | 0, |
| 102 | { 0, 0, 0 }, |
| 103 | 0, 0, /* No default value */ |
| 104 | "" |
| 105 | }, |
| 106 | }; |
| 107 | static const ber_tlv_tag_t asn_DEF_supportedSULBandList_tags_3[] = { |
| 108 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 109 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 110 | }; |
| 111 | static asn_SET_OF_specifics_t asn_SPC_supportedSULBandList_specs_3 = { |
| 112 | sizeof(struct FreqBandNrItem__supportedSULBandList), |
| 113 | offsetof(struct FreqBandNrItem__supportedSULBandList, _asn_ctx), |
| 114 | 0, /* XER encoding is XMLDelimitedItemList */ |
| 115 | }; |
| 116 | static /* Use -fall-defs-global to expose */ |
| 117 | asn_TYPE_descriptor_t asn_DEF_supportedSULBandList_3 = { |
| 118 | "supportedSULBandList", |
| 119 | "supportedSULBandList", |
| 120 | &asn_OP_SEQUENCE_OF, |
| 121 | asn_DEF_supportedSULBandList_tags_3, |
| 122 | sizeof(asn_DEF_supportedSULBandList_tags_3) |
| 123 | /sizeof(asn_DEF_supportedSULBandList_tags_3[0]) - 1, /* 1 */ |
| 124 | asn_DEF_supportedSULBandList_tags_3, /* Same as above */ |
| 125 | sizeof(asn_DEF_supportedSULBandList_tags_3) |
| 126 | /sizeof(asn_DEF_supportedSULBandList_tags_3[0]), /* 2 */ |
| 127 | { 0, &asn_PER_type_supportedSULBandList_constr_3, SEQUENCE_OF_constraint }, |
| 128 | asn_MBR_supportedSULBandList_3, |
| 129 | 1, /* Single element */ |
| 130 | &asn_SPC_supportedSULBandList_specs_3 /* Additional specs */ |
| 131 | }; |
| 132 | |
| 133 | asn_TYPE_member_t asn_MBR_FreqBandNrItem_1[] = { |
| 134 | { ATF_NOFLAGS, 0, offsetof(struct FreqBandNrItem, freqBandIndicatorNr), |
| 135 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 136 | -1, /* IMPLICIT tag at current level */ |
| 137 | &asn_DEF_NativeInteger, |
| 138 | 0, |
| 139 | { 0, &asn_PER_memb_freqBandIndicatorNr_constr_2, memb_freqBandIndicatorNr_constraint_1 }, |
| 140 | 0, 0, /* No default value */ |
| 141 | "freqBandIndicatorNr" |
| 142 | }, |
| 143 | { ATF_NOFLAGS, 0, offsetof(struct FreqBandNrItem, supportedSULBandList), |
| 144 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 145 | 0, |
| 146 | &asn_DEF_supportedSULBandList_3, |
| 147 | 0, |
| 148 | { 0, &asn_PER_memb_supportedSULBandList_constr_3, memb_supportedSULBandList_constraint_1 }, |
| 149 | 0, 0, /* No default value */ |
| 150 | "supportedSULBandList" |
| 151 | }, |
| 152 | { ATF_POINTER, 1, offsetof(struct FreqBandNrItem, iE_Extensions), |
| 153 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 154 | -1, /* IMPLICIT tag at current level */ |
| 155 | &asn_DEF_ProtocolExtensionContainer_170P148, |
| 156 | 0, |
| 157 | { 0, 0, 0 }, |
| 158 | 0, 0, /* No default value */ |
| 159 | "iE-Extensions" |
| 160 | }, |
| 161 | }; |
| 162 | static const int asn_MAP_FreqBandNrItem_oms_1[] = { 2 }; |
| 163 | static const ber_tlv_tag_t asn_DEF_FreqBandNrItem_tags_1[] = { |
| 164 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 165 | }; |
| 166 | static const asn_TYPE_tag2member_t asn_MAP_FreqBandNrItem_tag2el_1[] = { |
| 167 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* freqBandIndicatorNr */ |
| 168 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* supportedSULBandList */ |
| 169 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */ |
| 170 | }; |
| 171 | asn_SEQUENCE_specifics_t asn_SPC_FreqBandNrItem_specs_1 = { |
| 172 | sizeof(struct FreqBandNrItem), |
| 173 | offsetof(struct FreqBandNrItem, _asn_ctx), |
| 174 | asn_MAP_FreqBandNrItem_tag2el_1, |
| 175 | 3, /* Count of tags in the map */ |
| 176 | asn_MAP_FreqBandNrItem_oms_1, /* Optional members */ |
| 177 | 1, 0, /* Root/Additions */ |
| 178 | 3, /* First extension addition */ |
| 179 | }; |
| 180 | asn_TYPE_descriptor_t asn_DEF_FreqBandNrItem = { |
| 181 | "FreqBandNrItem", |
| 182 | "FreqBandNrItem", |
| 183 | &asn_OP_SEQUENCE, |
| 184 | asn_DEF_FreqBandNrItem_tags_1, |
| 185 | sizeof(asn_DEF_FreqBandNrItem_tags_1) |
| 186 | /sizeof(asn_DEF_FreqBandNrItem_tags_1[0]), /* 1 */ |
| 187 | asn_DEF_FreqBandNrItem_tags_1, /* Same as above */ |
| 188 | sizeof(asn_DEF_FreqBandNrItem_tags_1) |
| 189 | /sizeof(asn_DEF_FreqBandNrItem_tags_1[0]), /* 1 */ |
| 190 | { 0, 0, SEQUENCE_constraint }, |
| 191 | asn_MBR_FreqBandNrItem_1, |
| 192 | 3, /* Elements count */ |
| 193 | &asn_SPC_FreqBandNrItem_specs_1 /* Additional specs */ |
| 194 | }; |
| 195 | |