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 "ProtectedResourceList-Item.h" |
| 9 | |
| 10 | #include "ProtocolExtensionContainer.h" |
| 11 | static int |
| 12 | memb_intraPRBProtectedResourceFootprint_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 13 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 14 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 15 | size_t size; |
| 16 | |
| 17 | if(!sptr) { |
| 18 | ASN__CTFAIL(app_key, td, sptr, |
| 19 | "%s: value not given (%s:%d)", |
| 20 | td->name, __FILE__, __LINE__); |
| 21 | return -1; |
| 22 | } |
| 23 | |
| 24 | if(st->size > 0) { |
| 25 | /* Size in bits */ |
| 26 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 27 | } else { |
| 28 | size = 0; |
| 29 | } |
| 30 | |
| 31 | if((size == 84)) { |
| 32 | /* Constraint check succeeded */ |
| 33 | return 0; |
| 34 | } else { |
| 35 | ASN__CTFAIL(app_key, td, sptr, |
| 36 | "%s: constraint failed (%s:%d)", |
| 37 | td->name, __FILE__, __LINE__); |
| 38 | return -1; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | static int |
| 43 | memb_protectedFootprintFrequencyPattern_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 44 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 45 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 46 | size_t size; |
| 47 | |
| 48 | if(!sptr) { |
| 49 | ASN__CTFAIL(app_key, td, sptr, |
| 50 | "%s: value not given (%s:%d)", |
| 51 | td->name, __FILE__, __LINE__); |
| 52 | return -1; |
| 53 | } |
| 54 | |
| 55 | if(st->size > 0) { |
| 56 | /* Size in bits */ |
| 57 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 58 | } else { |
| 59 | size = 0; |
| 60 | } |
| 61 | |
| 62 | if((size >= 6 && size <= 110)) { |
| 63 | /* Constraint check succeeded */ |
| 64 | return 0; |
| 65 | } else { |
| 66 | ASN__CTFAIL(app_key, td, sptr, |
| 67 | "%s: constraint failed (%s:%d)", |
| 68 | td->name, __FILE__, __LINE__); |
| 69 | return -1; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | static asn_per_constraints_t asn_PER_memb_intraPRBProtectedResourceFootprint_constr_3 CC_NOTUSED = { |
| 74 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 75 | { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 84, 84 } /* (SIZE(84..84,...)) */, |
| 76 | 0, 0 /* No PER value map */ |
| 77 | }; |
| 78 | static asn_per_constraints_t asn_PER_memb_protectedFootprintFrequencyPattern_constr_4 CC_NOTUSED = { |
| 79 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 80 | { APC_CONSTRAINED | APC_EXTENSIBLE, 7, 7, 6, 110 } /* (SIZE(6..110,...)) */, |
| 81 | 0, 0 /* No PER value map */ |
| 82 | }; |
| 83 | asn_TYPE_member_t asn_MBR_ProtectedResourceList_Item_1[] = { |
| 84 | { ATF_NOFLAGS, 0, offsetof(struct ProtectedResourceList_Item, resourceType), |
| 85 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 86 | -1, /* IMPLICIT tag at current level */ |
| 87 | &asn_DEF_ResourceType, |
| 88 | 0, |
| 89 | { 0, 0, 0 }, |
| 90 | 0, 0, /* No default value */ |
| 91 | "resourceType" |
| 92 | }, |
| 93 | { ATF_NOFLAGS, 0, offsetof(struct ProtectedResourceList_Item, intraPRBProtectedResourceFootprint), |
| 94 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 95 | -1, /* IMPLICIT tag at current level */ |
| 96 | &asn_DEF_BIT_STRING, |
| 97 | 0, |
| 98 | { 0, &asn_PER_memb_intraPRBProtectedResourceFootprint_constr_3, memb_intraPRBProtectedResourceFootprint_constraint_1 }, |
| 99 | 0, 0, /* No default value */ |
| 100 | "intraPRBProtectedResourceFootprint" |
| 101 | }, |
| 102 | { ATF_NOFLAGS, 0, offsetof(struct ProtectedResourceList_Item, protectedFootprintFrequencyPattern), |
| 103 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 104 | -1, /* IMPLICIT tag at current level */ |
| 105 | &asn_DEF_BIT_STRING, |
| 106 | 0, |
| 107 | { 0, &asn_PER_memb_protectedFootprintFrequencyPattern_constr_4, memb_protectedFootprintFrequencyPattern_constraint_1 }, |
| 108 | 0, 0, /* No default value */ |
| 109 | "protectedFootprintFrequencyPattern" |
| 110 | }, |
| 111 | { ATF_NOFLAGS, 0, offsetof(struct ProtectedResourceList_Item, protectedFootprintTimePattern), |
| 112 | (ASN_TAG_CLASS_CONTEXT | (3 << 2)), |
| 113 | -1, /* IMPLICIT tag at current level */ |
| 114 | &asn_DEF_ProtectedFootprintTimePattern, |
| 115 | 0, |
| 116 | { 0, 0, 0 }, |
| 117 | 0, 0, /* No default value */ |
| 118 | "protectedFootprintTimePattern" |
| 119 | }, |
| 120 | { ATF_POINTER, 1, offsetof(struct ProtectedResourceList_Item, iE_Extensions), |
| 121 | (ASN_TAG_CLASS_CONTEXT | (4 << 2)), |
| 122 | -1, /* IMPLICIT tag at current level */ |
| 123 | &asn_DEF_ProtocolExtensionContainer_8858P58, |
| 124 | 0, |
| 125 | { 0, 0, 0 }, |
| 126 | 0, 0, /* No default value */ |
| 127 | "iE-Extensions" |
| 128 | }, |
| 129 | }; |
| 130 | static const int asn_MAP_ProtectedResourceList_Item_oms_1[] = { 4 }; |
| 131 | static const ber_tlv_tag_t asn_DEF_ProtectedResourceList_Item_tags_1[] = { |
| 132 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 133 | }; |
| 134 | static const asn_TYPE_tag2member_t asn_MAP_ProtectedResourceList_Item_tag2el_1[] = { |
| 135 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* resourceType */ |
| 136 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* intraPRBProtectedResourceFootprint */ |
| 137 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* protectedFootprintFrequencyPattern */ |
| 138 | { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* protectedFootprintTimePattern */ |
| 139 | { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* iE-Extensions */ |
| 140 | }; |
| 141 | asn_SEQUENCE_specifics_t asn_SPC_ProtectedResourceList_Item_specs_1 = { |
| 142 | sizeof(struct ProtectedResourceList_Item), |
| 143 | offsetof(struct ProtectedResourceList_Item, _asn_ctx), |
| 144 | asn_MAP_ProtectedResourceList_Item_tag2el_1, |
| 145 | 5, /* Count of tags in the map */ |
| 146 | asn_MAP_ProtectedResourceList_Item_oms_1, /* Optional members */ |
| 147 | 1, 0, /* Root/Additions */ |
| 148 | 5, /* First extension addition */ |
| 149 | }; |
| 150 | asn_TYPE_descriptor_t asn_DEF_ProtectedResourceList_Item = { |
| 151 | "ProtectedResourceList-Item", |
| 152 | "ProtectedResourceList-Item", |
| 153 | &asn_OP_SEQUENCE, |
| 154 | asn_DEF_ProtectedResourceList_Item_tags_1, |
| 155 | sizeof(asn_DEF_ProtectedResourceList_Item_tags_1) |
| 156 | /sizeof(asn_DEF_ProtectedResourceList_Item_tags_1[0]), /* 1 */ |
| 157 | asn_DEF_ProtectedResourceList_Item_tags_1, /* Same as above */ |
| 158 | sizeof(asn_DEF_ProtectedResourceList_Item_tags_1) |
| 159 | /sizeof(asn_DEF_ProtectedResourceList_Item_tags_1[0]), /* 1 */ |
| 160 | { 0, 0, SEQUENCE_constraint }, |
| 161 | asn_MBR_ProtectedResourceList_Item_1, |
| 162 | 5, /* Elements count */ |
| 163 | &asn_SPC_ProtectedResourceList_Item_specs_1 /* Additional specs */ |
| 164 | }; |
| 165 | |