41b0deca87e03c15a54456adcc88c566ebb64b90
[ric-plt/submgr.git] / CoMPHypothesisSetItem.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "X2AP-15-4-0.asn1"
5  *      `asn1c -D ./asn1_n1 -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
6  */
7
8 #include "CoMPHypothesisSetItem.h"
9
10 #include "ProtocolExtensionContainer.h"
11 static int
12 memb_coMPHypothesis_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 >= 6 && size <= 4400)) {
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 asn_oer_constraints_t asn_OER_memb_coMPHypothesis_constr_3 CC_NOTUSED = {
43         { 0, 0 },
44         -1      /* (SIZE(0..MAX)) */};
45 static asn_per_constraints_t asn_PER_memb_coMPHypothesis_constr_3 CC_NOTUSED = {
46         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
47         { APC_CONSTRAINED | APC_EXTENSIBLE,  13,  13,  6,  4400 }       /* (SIZE(6..4400,...)) */,
48         0, 0    /* No PER value map */
49 };
50 asn_TYPE_member_t asn_MBR_CoMPHypothesisSetItem_1[] = {
51         { ATF_NOFLAGS, 0, offsetof(struct CoMPHypothesisSetItem, coMPCellID),
52                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
53                 -1,     /* IMPLICIT tag at current level */
54                 &asn_DEF_ECGI,
55                 0,
56                 { 0, 0, 0 },
57                 0, 0, /* No default value */
58                 "coMPCellID"
59                 },
60         { ATF_NOFLAGS, 0, offsetof(struct CoMPHypothesisSetItem, coMPHypothesis),
61                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
62                 -1,     /* IMPLICIT tag at current level */
63                 &asn_DEF_BIT_STRING,
64                 0,
65                 { &asn_OER_memb_coMPHypothesis_constr_3, &asn_PER_memb_coMPHypothesis_constr_3,  memb_coMPHypothesis_constraint_1 },
66                 0, 0, /* No default value */
67                 "coMPHypothesis"
68                 },
69         { ATF_POINTER, 1, offsetof(struct CoMPHypothesisSetItem, iE_Extensions),
70                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
71                 -1,     /* IMPLICIT tag at current level */
72                 &asn_DEF_ProtocolExtensionContainer_7683P117,
73                 0,
74                 { 0, 0, 0 },
75                 0, 0, /* No default value */
76                 "iE-Extensions"
77                 },
78 };
79 static const int asn_MAP_CoMPHypothesisSetItem_oms_1[] = { 2 };
80 static const ber_tlv_tag_t asn_DEF_CoMPHypothesisSetItem_tags_1[] = {
81         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
82 };
83 static const asn_TYPE_tag2member_t asn_MAP_CoMPHypothesisSetItem_tag2el_1[] = {
84     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* coMPCellID */
85     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* coMPHypothesis */
86     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
87 };
88 asn_SEQUENCE_specifics_t asn_SPC_CoMPHypothesisSetItem_specs_1 = {
89         sizeof(struct CoMPHypothesisSetItem),
90         offsetof(struct CoMPHypothesisSetItem, _asn_ctx),
91         asn_MAP_CoMPHypothesisSetItem_tag2el_1,
92         3,      /* Count of tags in the map */
93         asn_MAP_CoMPHypothesisSetItem_oms_1,    /* Optional members */
94         1, 0,   /* Root/Additions */
95         3,      /* First extension addition */
96 };
97 asn_TYPE_descriptor_t asn_DEF_CoMPHypothesisSetItem = {
98         "CoMPHypothesisSetItem",
99         "CoMPHypothesisSetItem",
100         &asn_OP_SEQUENCE,
101         asn_DEF_CoMPHypothesisSetItem_tags_1,
102         sizeof(asn_DEF_CoMPHypothesisSetItem_tags_1)
103                 /sizeof(asn_DEF_CoMPHypothesisSetItem_tags_1[0]), /* 1 */
104         asn_DEF_CoMPHypothesisSetItem_tags_1,   /* Same as above */
105         sizeof(asn_DEF_CoMPHypothesisSetItem_tags_1)
106                 /sizeof(asn_DEF_CoMPHypothesisSetItem_tags_1[0]), /* 1 */
107         { 0, 0, SEQUENCE_constraint },
108         asn_MBR_CoMPHypothesisSetItem_1,
109         3,      /* Elements count */
110         &asn_SPC_CoMPHypothesisSetItem_specs_1  /* Additional specs */
111 };
112