Upstreaming version 0.10.7
[ric-plt/submgr.git] / e2ap / lib / SgNBResourceCoordinationInformation.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 "SgNBResourceCoordinationInformation.h"
9
10 #include "ProtocolExtensionContainer.h"
11 static int
12 memb_uLCoordinationInformation_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 int
43 memb_dLCoordinationInformation_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 <= 4400)) {
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_oer_constraints_t asn_OER_memb_uLCoordinationInformation_constr_3 CC_NOTUSED = {
74         { 0, 0 },
75         -1      /* (SIZE(0..MAX)) */};
76 static asn_per_constraints_t asn_PER_memb_uLCoordinationInformation_constr_3 CC_NOTUSED = {
77         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
78         { APC_CONSTRAINED | APC_EXTENSIBLE,  13,  13,  6,  4400 }       /* (SIZE(6..4400,...)) */,
79         0, 0    /* No PER value map */
80 };
81 static asn_oer_constraints_t asn_OER_memb_dLCoordinationInformation_constr_4 CC_NOTUSED = {
82         { 0, 0 },
83         -1      /* (SIZE(0..MAX)) */};
84 static asn_per_constraints_t asn_PER_memb_dLCoordinationInformation_constr_4 CC_NOTUSED = {
85         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
86         { APC_CONSTRAINED | APC_EXTENSIBLE,  13,  13,  6,  4400 }       /* (SIZE(6..4400,...)) */,
87         0, 0    /* No PER value map */
88 };
89 static asn_TYPE_member_t asn_MBR_SgNBResourceCoordinationInformation_1[] = {
90         { ATF_NOFLAGS, 0, offsetof(struct SgNBResourceCoordinationInformation, nR_CGI),
91                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
92                 -1,     /* IMPLICIT tag at current level */
93                 &asn_DEF_NRCGI,
94                 0,
95                 { 0, 0, 0 },
96                 0, 0, /* No default value */
97                 "nR-CGI"
98                 },
99         { ATF_NOFLAGS, 0, offsetof(struct SgNBResourceCoordinationInformation, uLCoordinationInformation),
100                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
101                 -1,     /* IMPLICIT tag at current level */
102                 &asn_DEF_BIT_STRING,
103                 0,
104                 { &asn_OER_memb_uLCoordinationInformation_constr_3, &asn_PER_memb_uLCoordinationInformation_constr_3,  memb_uLCoordinationInformation_constraint_1 },
105                 0, 0, /* No default value */
106                 "uLCoordinationInformation"
107                 },
108         { ATF_POINTER, 2, offsetof(struct SgNBResourceCoordinationInformation, dLCoordinationInformation),
109                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
110                 -1,     /* IMPLICIT tag at current level */
111                 &asn_DEF_BIT_STRING,
112                 0,
113                 { &asn_OER_memb_dLCoordinationInformation_constr_4, &asn_PER_memb_dLCoordinationInformation_constr_4,  memb_dLCoordinationInformation_constraint_1 },
114                 0, 0, /* No default value */
115                 "dLCoordinationInformation"
116                 },
117         { ATF_POINTER, 1, offsetof(struct SgNBResourceCoordinationInformation, iE_Extensions),
118                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
119                 -1,     /* IMPLICIT tag at current level */
120                 &asn_DEF_ProtocolExtensionContainer_7683P193,
121                 0,
122                 { 0, 0, 0 },
123                 0, 0, /* No default value */
124                 "iE-Extensions"
125                 },
126 };
127 static const int asn_MAP_SgNBResourceCoordinationInformation_oms_1[] = { 2, 3 };
128 static const ber_tlv_tag_t asn_DEF_SgNBResourceCoordinationInformation_tags_1[] = {
129         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
130 };
131 static const asn_TYPE_tag2member_t asn_MAP_SgNBResourceCoordinationInformation_tag2el_1[] = {
132     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nR-CGI */
133     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* uLCoordinationInformation */
134     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* dLCoordinationInformation */
135     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
136 };
137 static asn_SEQUENCE_specifics_t asn_SPC_SgNBResourceCoordinationInformation_specs_1 = {
138         sizeof(struct SgNBResourceCoordinationInformation),
139         offsetof(struct SgNBResourceCoordinationInformation, _asn_ctx),
140         asn_MAP_SgNBResourceCoordinationInformation_tag2el_1,
141         4,      /* Count of tags in the map */
142         asn_MAP_SgNBResourceCoordinationInformation_oms_1,      /* Optional members */
143         2, 0,   /* Root/Additions */
144         4,      /* First extension addition */
145 };
146 asn_TYPE_descriptor_t asn_DEF_SgNBResourceCoordinationInformation = {
147         "SgNBResourceCoordinationInformation",
148         "SgNBResourceCoordinationInformation",
149         &asn_OP_SEQUENCE,
150         asn_DEF_SgNBResourceCoordinationInformation_tags_1,
151         sizeof(asn_DEF_SgNBResourceCoordinationInformation_tags_1)
152                 /sizeof(asn_DEF_SgNBResourceCoordinationInformation_tags_1[0]), /* 1 */
153         asn_DEF_SgNBResourceCoordinationInformation_tags_1,     /* Same as above */
154         sizeof(asn_DEF_SgNBResourceCoordinationInformation_tags_1)
155                 /sizeof(asn_DEF_SgNBResourceCoordinationInformation_tags_1[0]), /* 1 */
156         { 0, 0, SEQUENCE_constraint },
157         asn_MBR_SgNBResourceCoordinationInformation_1,
158         4,      /* Elements count */
159         &asn_SPC_SgNBResourceCoordinationInformation_specs_1    /* Additional specs */
160 };
161