Harald Welte | ee09189 | 2015-09-10 10:22:03 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) |
| 3 | * From ASN.1 module "RANAP-IEs" |
| 4 | * found in "../../asn1/ranap/RANAP-IEs.asn" |
| 5 | */ |
| 6 | |
| 7 | #include "RANAP_ENB-ID.h" |
| 8 | |
| 9 | static int |
| 10 | memb_macroENB_ID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 11 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 12 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 13 | size_t size; |
| 14 | |
| 15 | if(!sptr) { |
| 16 | _ASN_CTFAIL(app_key, td, sptr, |
| 17 | "%s: value not given (%s:%d)", |
| 18 | td->name, __FILE__, __LINE__); |
| 19 | return -1; |
| 20 | } |
| 21 | |
| 22 | if(st->size > 0) { |
| 23 | /* Size in bits */ |
| 24 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 25 | } else { |
| 26 | size = 0; |
| 27 | } |
| 28 | |
| 29 | if((size == 20l)) { |
| 30 | /* Constraint check succeeded */ |
| 31 | return 0; |
| 32 | } else { |
| 33 | _ASN_CTFAIL(app_key, td, sptr, |
| 34 | "%s: constraint failed (%s:%d)", |
| 35 | td->name, __FILE__, __LINE__); |
| 36 | return -1; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | static int |
| 41 | memb_homeENB_ID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 42 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 43 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 44 | size_t size; |
| 45 | |
| 46 | if(!sptr) { |
| 47 | _ASN_CTFAIL(app_key, td, sptr, |
| 48 | "%s: value not given (%s:%d)", |
| 49 | td->name, __FILE__, __LINE__); |
| 50 | return -1; |
| 51 | } |
| 52 | |
| 53 | if(st->size > 0) { |
| 54 | /* Size in bits */ |
| 55 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 56 | } else { |
| 57 | size = 0; |
| 58 | } |
| 59 | |
| 60 | if((size == 28l)) { |
| 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 asn_per_constraints_t asn_PER_memb_macroENB_ID_constr_2 GCC_NOTUSED = { |
| 72 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 73 | { APC_CONSTRAINED, 0, 0, 20l, 20l } /* (SIZE(20..20)) */, |
| 74 | 0, 0 /* No PER value map */ |
| 75 | }; |
| 76 | static asn_per_constraints_t asn_PER_memb_homeENB_ID_constr_3 GCC_NOTUSED = { |
| 77 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 78 | { APC_CONSTRAINED, 0, 0, 28l, 28l } /* (SIZE(28..28)) */, |
| 79 | 0, 0 /* No PER value map */ |
| 80 | }; |
| 81 | static asn_per_constraints_t asn_PER_type_RANAP_ENB_ID_constr_1 GCC_NOTUSED = { |
| 82 | { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0l, 1l } /* (0..1,...) */, |
| 83 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 84 | 0, 0 /* No PER value map */ |
| 85 | }; |
| 86 | static asn_TYPE_member_t asn_MBR_RANAP_ENB_ID_1[] = { |
| 87 | { ATF_NOFLAGS, 0, offsetof(struct RANAP_ENB_ID, choice.macroENB_ID), |
| 88 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 89 | -1, /* IMPLICIT tag at current level */ |
| 90 | &asn_DEF_BIT_STRING, |
| 91 | memb_macroENB_ID_constraint_1, |
| 92 | &asn_PER_memb_macroENB_ID_constr_2, |
| 93 | 0, |
| 94 | "macroENB-ID" |
| 95 | }, |
| 96 | { ATF_NOFLAGS, 0, offsetof(struct RANAP_ENB_ID, choice.homeENB_ID), |
| 97 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 98 | -1, /* IMPLICIT tag at current level */ |
| 99 | &asn_DEF_BIT_STRING, |
| 100 | memb_homeENB_ID_constraint_1, |
| 101 | &asn_PER_memb_homeENB_ID_constr_3, |
| 102 | 0, |
| 103 | "homeENB-ID" |
| 104 | }, |
| 105 | }; |
| 106 | static const asn_TYPE_tag2member_t asn_MAP_RANAP_ENB_ID_tag2el_1[] = { |
| 107 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* macroENB-ID */ |
| 108 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* homeENB-ID */ |
| 109 | }; |
| 110 | static asn_CHOICE_specifics_t asn_SPC_RANAP_ENB_ID_specs_1 = { |
| 111 | sizeof(struct RANAP_ENB_ID), |
| 112 | offsetof(struct RANAP_ENB_ID, _asn_ctx), |
| 113 | offsetof(struct RANAP_ENB_ID, present), |
| 114 | sizeof(((struct RANAP_ENB_ID *)0)->present), |
| 115 | asn_MAP_RANAP_ENB_ID_tag2el_1, |
| 116 | 2, /* Count of tags in the map */ |
| 117 | 0, |
| 118 | 2 /* Extensions start */ |
| 119 | }; |
| 120 | asn_TYPE_descriptor_t asn_DEF_RANAP_ENB_ID = { |
| 121 | "RANAP_ENB-ID", |
| 122 | "RANAP_ENB-ID", |
| 123 | CHOICE_free, |
| 124 | CHOICE_print, |
| 125 | CHOICE_constraint, |
| 126 | CHOICE_decode_ber, |
| 127 | CHOICE_encode_der, |
| 128 | CHOICE_decode_xer, |
| 129 | CHOICE_encode_xer, |
| 130 | CHOICE_decode_uper, |
| 131 | CHOICE_encode_uper, |
| 132 | CHOICE_decode_aper, |
| 133 | CHOICE_encode_aper, |
| 134 | CHOICE_outmost_tag, |
| 135 | 0, /* No effective tags (pointer) */ |
| 136 | 0, /* No effective tags (count) */ |
| 137 | 0, /* No tags (pointer) */ |
| 138 | 0, /* No tags (count) */ |
| 139 | &asn_PER_type_RANAP_ENB_ID_constr_1, |
| 140 | asn_MBR_RANAP_ENB_ID_1, |
| 141 | 2, /* Elements count */ |
| 142 | &asn_SPC_RANAP_ENB_ID_specs_1 /* Additional specs */ |
| 143 | }; |
| 144 | |