1487f9d0fc26d066442942b9746a722850490922
[ric-app/kpimon.git] / asn1c_defs / all-defs / SgNBResourceCoordinationInformation.c
1 /*\r
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)\r
3  * From ASN.1 module "X2AP-IEs"\r
4  *      found in "../../asn_defs/asn1/x2ap-modified-15-05.asn"\r
5  *      `asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-OER`\r
6  */\r
7 \r
8 #include "SgNBResourceCoordinationInformation.h"\r
9 \r
10 #include "ProtocolExtensionContainer.h"\r
11 static int\r
12 memb_uLCoordinationInformation_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,\r
13                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {\r
14         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;\r
15         size_t size;\r
16         \r
17         if(!sptr) {\r
18                 ASN__CTFAIL(app_key, td, sptr,\r
19                         "%s: value not given (%s:%d)",\r
20                         td->name, __FILE__, __LINE__);\r
21                 return -1;\r
22         }\r
23         \r
24         if(st->size > 0) {\r
25                 /* Size in bits */\r
26                 size = 8 * st->size - (st->bits_unused & 0x07);\r
27         } else {\r
28                 size = 0;\r
29         }\r
30         \r
31         if((size >= 6 && size <= 4400)) {\r
32                 /* Constraint check succeeded */\r
33                 return 0;\r
34         } else {\r
35                 ASN__CTFAIL(app_key, td, sptr,\r
36                         "%s: constraint failed (%s:%d)",\r
37                         td->name, __FILE__, __LINE__);\r
38                 return -1;\r
39         }\r
40 }\r
41 \r
42 static int\r
43 memb_dLCoordinationInformation_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,\r
44                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {\r
45         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;\r
46         size_t size;\r
47         \r
48         if(!sptr) {\r
49                 ASN__CTFAIL(app_key, td, sptr,\r
50                         "%s: value not given (%s:%d)",\r
51                         td->name, __FILE__, __LINE__);\r
52                 return -1;\r
53         }\r
54         \r
55         if(st->size > 0) {\r
56                 /* Size in bits */\r
57                 size = 8 * st->size - (st->bits_unused & 0x07);\r
58         } else {\r
59                 size = 0;\r
60         }\r
61         \r
62         if((size >= 6 && size <= 4400)) {\r
63                 /* Constraint check succeeded */\r
64                 return 0;\r
65         } else {\r
66                 ASN__CTFAIL(app_key, td, sptr,\r
67                         "%s: constraint failed (%s:%d)",\r
68                         td->name, __FILE__, __LINE__);\r
69                 return -1;\r
70         }\r
71 }\r
72 \r
73 static asn_per_constraints_t asn_PER_memb_uLCoordinationInformation_constr_3 CC_NOTUSED = {\r
74         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },\r
75         { APC_CONSTRAINED | APC_EXTENSIBLE,  13,  13,  6,  4400 }       /* (SIZE(6..4400,...)) */,\r
76         0, 0    /* No PER value map */\r
77 };\r
78 static asn_per_constraints_t asn_PER_memb_dLCoordinationInformation_constr_4 CC_NOTUSED = {\r
79         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },\r
80         { APC_CONSTRAINED | APC_EXTENSIBLE,  13,  13,  6,  4400 }       /* (SIZE(6..4400,...)) */,\r
81         0, 0    /* No PER value map */\r
82 };\r
83 static asn_TYPE_member_t asn_MBR_SgNBResourceCoordinationInformation_1[] = {\r
84         { ATF_NOFLAGS, 0, offsetof(struct SgNBResourceCoordinationInformation, nR_CGI),\r
85                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),\r
86                 -1,     /* IMPLICIT tag at current level */\r
87                 &asn_DEF_NRCGI,\r
88                 0,\r
89                 { 0, 0, 0 },\r
90                 0, 0, /* No default value */\r
91                 "nR-CGI"\r
92                 },\r
93         { ATF_NOFLAGS, 0, offsetof(struct SgNBResourceCoordinationInformation, uLCoordinationInformation),\r
94                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),\r
95                 -1,     /* IMPLICIT tag at current level */\r
96                 &asn_DEF_BIT_STRING,\r
97                 0,\r
98                 { 0, &asn_PER_memb_uLCoordinationInformation_constr_3,  memb_uLCoordinationInformation_constraint_1 },\r
99                 0, 0, /* No default value */\r
100                 "uLCoordinationInformation"\r
101                 },\r
102         { ATF_POINTER, 2, offsetof(struct SgNBResourceCoordinationInformation, dLCoordinationInformation),\r
103                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),\r
104                 -1,     /* IMPLICIT tag at current level */\r
105                 &asn_DEF_BIT_STRING,\r
106                 0,\r
107                 { 0, &asn_PER_memb_dLCoordinationInformation_constr_4,  memb_dLCoordinationInformation_constraint_1 },\r
108                 0, 0, /* No default value */\r
109                 "dLCoordinationInformation"\r
110                 },\r
111         { ATF_POINTER, 1, offsetof(struct SgNBResourceCoordinationInformation, iE_Extensions),\r
112                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),\r
113                 -1,     /* IMPLICIT tag at current level */\r
114                 &asn_DEF_ProtocolExtensionContainer_8231P193,\r
115                 0,\r
116                 { 0, 0, 0 },\r
117                 0, 0, /* No default value */\r
118                 "iE-Extensions"\r
119                 },\r
120 };\r
121 static const int asn_MAP_SgNBResourceCoordinationInformation_oms_1[] = { 2, 3 };\r
122 static const ber_tlv_tag_t asn_DEF_SgNBResourceCoordinationInformation_tags_1[] = {\r
123         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))\r
124 };\r
125 static const asn_TYPE_tag2member_t asn_MAP_SgNBResourceCoordinationInformation_tag2el_1[] = {\r
126     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nR-CGI */\r
127     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* uLCoordinationInformation */\r
128     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* dLCoordinationInformation */\r
129     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */\r
130 };\r
131 static asn_SEQUENCE_specifics_t asn_SPC_SgNBResourceCoordinationInformation_specs_1 = {\r
132         sizeof(struct SgNBResourceCoordinationInformation),\r
133         offsetof(struct SgNBResourceCoordinationInformation, _asn_ctx),\r
134         asn_MAP_SgNBResourceCoordinationInformation_tag2el_1,\r
135         4,      /* Count of tags in the map */\r
136         asn_MAP_SgNBResourceCoordinationInformation_oms_1,      /* Optional members */\r
137         2, 0,   /* Root/Additions */\r
138         4,      /* First extension addition */\r
139 };\r
140 asn_TYPE_descriptor_t asn_DEF_SgNBResourceCoordinationInformation = {\r
141         "SgNBResourceCoordinationInformation",\r
142         "SgNBResourceCoordinationInformation",\r
143         &asn_OP_SEQUENCE,\r
144         asn_DEF_SgNBResourceCoordinationInformation_tags_1,\r
145         sizeof(asn_DEF_SgNBResourceCoordinationInformation_tags_1)\r
146                 /sizeof(asn_DEF_SgNBResourceCoordinationInformation_tags_1[0]), /* 1 */\r
147         asn_DEF_SgNBResourceCoordinationInformation_tags_1,     /* Same as above */\r
148         sizeof(asn_DEF_SgNBResourceCoordinationInformation_tags_1)\r
149                 /sizeof(asn_DEF_SgNBResourceCoordinationInformation_tags_1[0]), /* 1 */\r
150         { 0, 0, SEQUENCE_constraint },\r
151         asn_MBR_SgNBResourceCoordinationInformation_1,\r
152         4,      /* Elements count */\r
153         &asn_SPC_SgNBResourceCoordinationInformation_specs_1    /* Additional specs */\r
154 };\r
155 \r