Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) |
| 3 | * From ASN.1 module "E2AP-IEs" |
subhash kumar singh | f86662b | 2022-03-22 00:39:54 +0530 | [diff] [blame^] | 4 | * found in "e2ap-v2.asn" |
| 5 | * `asn1c -pdu=auto -fincludes-quoted -fcompound-names -findirect-choice -fno-include-deps -gen-PER -no-gen-example -no-gen-OER` |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include "ENB-ID-Choice.h" |
| 9 | |
| 10 | static int |
| 11 | memb_enb_ID_macro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 12 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 13 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 14 | size_t size; |
| 15 | |
| 16 | if(!sptr) { |
| 17 | ASN__CTFAIL(app_key, td, sptr, |
| 18 | "%s: value not given (%s:%d)", |
| 19 | td->name, __FILE__, __LINE__); |
| 20 | return -1; |
| 21 | } |
| 22 | |
| 23 | if(st->size > 0) { |
| 24 | /* Size in bits */ |
| 25 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 26 | } else { |
| 27 | size = 0; |
| 28 | } |
| 29 | |
| 30 | if((size == 20)) { |
| 31 | /* Constraint check succeeded */ |
| 32 | return 0; |
| 33 | } else { |
| 34 | ASN__CTFAIL(app_key, td, sptr, |
| 35 | "%s: constraint failed (%s:%d)", |
| 36 | td->name, __FILE__, __LINE__); |
| 37 | return -1; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | static int |
| 42 | memb_enb_ID_shortmacro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 43 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 44 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 45 | size_t size; |
| 46 | |
| 47 | if(!sptr) { |
| 48 | ASN__CTFAIL(app_key, td, sptr, |
| 49 | "%s: value not given (%s:%d)", |
| 50 | td->name, __FILE__, __LINE__); |
| 51 | return -1; |
| 52 | } |
| 53 | |
| 54 | if(st->size > 0) { |
| 55 | /* Size in bits */ |
| 56 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 57 | } else { |
| 58 | size = 0; |
| 59 | } |
| 60 | |
| 61 | if((size == 18)) { |
| 62 | /* Constraint check succeeded */ |
| 63 | return 0; |
| 64 | } else { |
| 65 | ASN__CTFAIL(app_key, td, sptr, |
| 66 | "%s: constraint failed (%s:%d)", |
| 67 | td->name, __FILE__, __LINE__); |
| 68 | return -1; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | static int |
| 73 | memb_enb_ID_longmacro_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 74 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 75 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 76 | size_t size; |
| 77 | |
| 78 | if(!sptr) { |
| 79 | ASN__CTFAIL(app_key, td, sptr, |
| 80 | "%s: value not given (%s:%d)", |
| 81 | td->name, __FILE__, __LINE__); |
| 82 | return -1; |
| 83 | } |
| 84 | |
| 85 | if(st->size > 0) { |
| 86 | /* Size in bits */ |
| 87 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 88 | } else { |
| 89 | size = 0; |
| 90 | } |
| 91 | |
| 92 | if((size == 21)) { |
| 93 | /* Constraint check succeeded */ |
| 94 | return 0; |
| 95 | } else { |
| 96 | ASN__CTFAIL(app_key, td, sptr, |
| 97 | "%s: constraint failed (%s:%d)", |
| 98 | td->name, __FILE__, __LINE__); |
| 99 | return -1; |
| 100 | } |
| 101 | } |
| 102 | |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 103 | static asn_per_constraints_t asn_PER_memb_enb_ID_macro_constr_2 CC_NOTUSED = { |
| 104 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 105 | { APC_CONSTRAINED, 0, 0, 20, 20 } /* (SIZE(20..20)) */, |
| 106 | 0, 0 /* No PER value map */ |
| 107 | }; |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 108 | static asn_per_constraints_t asn_PER_memb_enb_ID_shortmacro_constr_3 CC_NOTUSED = { |
| 109 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 110 | { APC_CONSTRAINED, 0, 0, 18, 18 } /* (SIZE(18..18)) */, |
| 111 | 0, 0 /* No PER value map */ |
| 112 | }; |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 113 | static asn_per_constraints_t asn_PER_memb_enb_ID_longmacro_constr_4 CC_NOTUSED = { |
| 114 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 115 | { APC_CONSTRAINED, 0, 0, 21, 21 } /* (SIZE(21..21)) */, |
| 116 | 0, 0 /* No PER value map */ |
| 117 | }; |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 118 | asn_per_constraints_t asn_PER_type_ENB_ID_Choice_constr_1 CC_NOTUSED = { |
| 119 | { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, |
| 120 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 121 | 0, 0 /* No PER value map */ |
| 122 | }; |
| 123 | asn_TYPE_member_t asn_MBR_ENB_ID_Choice_1[] = { |
| 124 | { ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_macro), |
| 125 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 126 | -1, /* IMPLICIT tag at current level */ |
| 127 | &asn_DEF_BIT_STRING, |
| 128 | 0, |
naman.gupta | 4e29ea3 | 2021-09-24 14:19:08 +0530 | [diff] [blame] | 129 | { 0, &asn_PER_memb_enb_ID_macro_constr_2, memb_enb_ID_macro_constraint_1 }, |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 130 | 0, 0, /* No default value */ |
| 131 | "enb-ID-macro" |
| 132 | }, |
| 133 | { ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_shortmacro), |
| 134 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 135 | -1, /* IMPLICIT tag at current level */ |
| 136 | &asn_DEF_BIT_STRING, |
| 137 | 0, |
naman.gupta | 4e29ea3 | 2021-09-24 14:19:08 +0530 | [diff] [blame] | 138 | { 0, &asn_PER_memb_enb_ID_shortmacro_constr_3, memb_enb_ID_shortmacro_constraint_1 }, |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 139 | 0, 0, /* No default value */ |
| 140 | "enb-ID-shortmacro" |
| 141 | }, |
| 142 | { ATF_NOFLAGS, 0, offsetof(struct ENB_ID_Choice, choice.enb_ID_longmacro), |
| 143 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 144 | -1, /* IMPLICIT tag at current level */ |
| 145 | &asn_DEF_BIT_STRING, |
| 146 | 0, |
naman.gupta | 4e29ea3 | 2021-09-24 14:19:08 +0530 | [diff] [blame] | 147 | { 0, &asn_PER_memb_enb_ID_longmacro_constr_4, memb_enb_ID_longmacro_constraint_1 }, |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 148 | 0, 0, /* No default value */ |
| 149 | "enb-ID-longmacro" |
| 150 | }, |
| 151 | }; |
| 152 | static const asn_TYPE_tag2member_t asn_MAP_ENB_ID_Choice_tag2el_1[] = { |
| 153 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* enb-ID-macro */ |
| 154 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* enb-ID-shortmacro */ |
| 155 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* enb-ID-longmacro */ |
| 156 | }; |
| 157 | asn_CHOICE_specifics_t asn_SPC_ENB_ID_Choice_specs_1 = { |
| 158 | sizeof(struct ENB_ID_Choice), |
| 159 | offsetof(struct ENB_ID_Choice, _asn_ctx), |
| 160 | offsetof(struct ENB_ID_Choice, present), |
| 161 | sizeof(((struct ENB_ID_Choice *)0)->present), |
| 162 | asn_MAP_ENB_ID_Choice_tag2el_1, |
| 163 | 3, /* Count of tags in the map */ |
| 164 | 0, 0, |
| 165 | 3 /* Extensions start */ |
| 166 | }; |
| 167 | asn_TYPE_descriptor_t asn_DEF_ENB_ID_Choice = { |
| 168 | "ENB-ID-Choice", |
| 169 | "ENB-ID-Choice", |
| 170 | &asn_OP_CHOICE, |
| 171 | 0, /* No effective tags (pointer) */ |
| 172 | 0, /* No effective tags (count) */ |
| 173 | 0, /* No tags (pointer) */ |
| 174 | 0, /* No tags (count) */ |
naman.gupta | 4e29ea3 | 2021-09-24 14:19:08 +0530 | [diff] [blame] | 175 | { 0, &asn_PER_type_ENB_ID_Choice_constr_1, CHOICE_constraint }, |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 176 | asn_MBR_ENB_ID_Choice_1, |
| 177 | 3, /* Elements count */ |
| 178 | &asn_SPC_ENB_ID_Choice_specs_1 /* Additional specs */ |
| 179 | }; |
| 180 | |