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 "GNB-ID-Choice.h" |
| 9 | |
| 10 | static int |
| 11 | memb_gnb_ID_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 >= 22 && size <= 32)) { |
| 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 | |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 41 | static asn_per_constraints_t asn_PER_memb_gnb_ID_constr_2 CC_NOTUSED = { |
| 42 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 43 | { APC_CONSTRAINED, 4, 4, 22, 32 } /* (SIZE(22..32)) */, |
| 44 | 0, 0 /* No PER value map */ |
| 45 | }; |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 46 | asn_per_constraints_t asn_PER_type_GNB_ID_Choice_constr_1 CC_NOTUSED = { |
| 47 | { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */, |
| 48 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 49 | 0, 0 /* No PER value map */ |
| 50 | }; |
| 51 | asn_TYPE_member_t asn_MBR_GNB_ID_Choice_1[] = { |
| 52 | { ATF_NOFLAGS, 0, offsetof(struct GNB_ID_Choice, choice.gnb_ID), |
| 53 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 54 | -1, /* IMPLICIT tag at current level */ |
| 55 | &asn_DEF_BIT_STRING, |
| 56 | 0, |
naman.gupta | 4e29ea3 | 2021-09-24 14:19:08 +0530 | [diff] [blame] | 57 | { 0, &asn_PER_memb_gnb_ID_constr_2, memb_gnb_ID_constraint_1 }, |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 58 | 0, 0, /* No default value */ |
| 59 | "gnb-ID" |
| 60 | }, |
| 61 | }; |
| 62 | static const asn_TYPE_tag2member_t asn_MAP_GNB_ID_Choice_tag2el_1[] = { |
| 63 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* gnb-ID */ |
| 64 | }; |
| 65 | asn_CHOICE_specifics_t asn_SPC_GNB_ID_Choice_specs_1 = { |
| 66 | sizeof(struct GNB_ID_Choice), |
| 67 | offsetof(struct GNB_ID_Choice, _asn_ctx), |
| 68 | offsetof(struct GNB_ID_Choice, present), |
| 69 | sizeof(((struct GNB_ID_Choice *)0)->present), |
| 70 | asn_MAP_GNB_ID_Choice_tag2el_1, |
| 71 | 1, /* Count of tags in the map */ |
| 72 | 0, 0, |
| 73 | 1 /* Extensions start */ |
| 74 | }; |
| 75 | asn_TYPE_descriptor_t asn_DEF_GNB_ID_Choice = { |
| 76 | "GNB-ID-Choice", |
| 77 | "GNB-ID-Choice", |
| 78 | &asn_OP_CHOICE, |
| 79 | 0, /* No effective tags (pointer) */ |
| 80 | 0, /* No effective tags (count) */ |
| 81 | 0, /* No tags (pointer) */ |
| 82 | 0, /* No tags (count) */ |
naman.gupta | 4e29ea3 | 2021-09-24 14:19:08 +0530 | [diff] [blame] | 83 | { 0, &asn_PER_type_GNB_ID_Choice_constr_1, CHOICE_constraint }, |
Ron Shacham | a9733db | 2020-09-14 12:05:31 -0400 | [diff] [blame] | 84 | asn_MBR_GNB_ID_Choice_1, |
| 85 | 1, /* Elements count */ |
| 86 | &asn_SPC_GNB_ID_Choice_specs_1 /* Additional specs */ |
| 87 | }; |
| 88 | |