Add version 0.5.0
[ric-plt/submgr.git] / e2ap / lib / DynamicNAICSInformation.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "Spec/e2ap-v031ex.asn"
5  *      `asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER`
6  */
7
8 #include "DynamicNAICSInformation.h"
9
10 #include "ProtocolExtensionContainer.h"
11 static int
12 memb_transmissionModes_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 == 8)) {
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_pB_information_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
44                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
45         long value;
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         value = *(const long *)sptr;
55         
56         if((value >= 0 && value <= 3)) {
57                 /* Constraint check succeeded */
58                 return 0;
59         } else {
60                 ASN__CTFAIL(app_key, td, sptr,
61                         "%s: constraint failed (%s:%d)",
62                         td->name, __FILE__, __LINE__);
63                 return -1;
64         }
65 }
66
67 static int
68 memb_pA_list_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
69                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
70         size_t size;
71         
72         if(!sptr) {
73                 ASN__CTFAIL(app_key, td, sptr,
74                         "%s: value not given (%s:%d)",
75                         td->name, __FILE__, __LINE__);
76                 return -1;
77         }
78         
79         /* Determine the number of elements */
80         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
81         
82         if((size <= 3)) {
83                 /* Perform validation of the inner elements */
84                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
85         } else {
86                 ASN__CTFAIL(app_key, td, sptr,
87                         "%s: constraint failed (%s:%d)",
88                         td->name, __FILE__, __LINE__);
89                 return -1;
90         }
91 }
92
93 static asn_oer_constraints_t asn_OER_type_pA_list_constr_4 CC_NOTUSED = {
94         { 0, 0 },
95         -1      /* (SIZE(0..3)) */};
96 static asn_per_constraints_t asn_PER_type_pA_list_constr_4 CC_NOTUSED = {
97         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
98         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (SIZE(0..3)) */,
99         0, 0    /* No PER value map */
100 };
101 static asn_oer_constraints_t asn_OER_memb_transmissionModes_constr_2 CC_NOTUSED = {
102         { 0, 0 },
103         8       /* (SIZE(8..8)) */};
104 static asn_per_constraints_t asn_PER_memb_transmissionModes_constr_2 CC_NOTUSED = {
105         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
106         { APC_CONSTRAINED,       0,  0,  8,  8 }        /* (SIZE(8..8)) */,
107         0, 0    /* No PER value map */
108 };
109 static asn_oer_constraints_t asn_OER_memb_pB_information_constr_3 CC_NOTUSED = {
110         { 1, 1 }        /* (0..3) */,
111         -1};
112 static asn_per_constraints_t asn_PER_memb_pB_information_constr_3 CC_NOTUSED = {
113         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (0..3) */,
114         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
115         0, 0    /* No PER value map */
116 };
117 static asn_oer_constraints_t asn_OER_memb_pA_list_constr_4 CC_NOTUSED = {
118         { 0, 0 },
119         -1      /* (SIZE(0..3)) */};
120 static asn_per_constraints_t asn_PER_memb_pA_list_constr_4 CC_NOTUSED = {
121         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
122         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (SIZE(0..3)) */,
123         0, 0    /* No PER value map */
124 };
125 static asn_TYPE_member_t asn_MBR_pA_list_4[] = {
126         { ATF_POINTER, 0, 0,
127                 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
128                 0,
129                 &asn_DEF_PA_Values,
130                 0,
131                 { 0, 0, 0 },
132                 0, 0, /* No default value */
133                 ""
134                 },
135 };
136 static const ber_tlv_tag_t asn_DEF_pA_list_tags_4[] = {
137         (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
138         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
139 };
140 static asn_SET_OF_specifics_t asn_SPC_pA_list_specs_4 = {
141         sizeof(struct DynamicNAICSInformation__pA_list),
142         offsetof(struct DynamicNAICSInformation__pA_list, _asn_ctx),
143         1,      /* XER encoding is XMLValueList */
144 };
145 static /* Use -fall-defs-global to expose */
146 asn_TYPE_descriptor_t asn_DEF_pA_list_4 = {
147         "pA-list",
148         "pA-list",
149         &asn_OP_SEQUENCE_OF,
150         asn_DEF_pA_list_tags_4,
151         sizeof(asn_DEF_pA_list_tags_4)
152                 /sizeof(asn_DEF_pA_list_tags_4[0]) - 1, /* 1 */
153         asn_DEF_pA_list_tags_4, /* Same as above */
154         sizeof(asn_DEF_pA_list_tags_4)
155                 /sizeof(asn_DEF_pA_list_tags_4[0]), /* 2 */
156         { &asn_OER_type_pA_list_constr_4, &asn_PER_type_pA_list_constr_4, SEQUENCE_OF_constraint },
157         asn_MBR_pA_list_4,
158         1,      /* Single element */
159         &asn_SPC_pA_list_specs_4        /* Additional specs */
160 };
161
162 asn_TYPE_member_t asn_MBR_DynamicNAICSInformation_1[] = {
163         { ATF_POINTER, 2, offsetof(struct DynamicNAICSInformation, transmissionModes),
164                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
165                 -1,     /* IMPLICIT tag at current level */
166                 &asn_DEF_BIT_STRING,
167                 0,
168                 { &asn_OER_memb_transmissionModes_constr_2, &asn_PER_memb_transmissionModes_constr_2,  memb_transmissionModes_constraint_1 },
169                 0, 0, /* No default value */
170                 "transmissionModes"
171                 },
172         { ATF_POINTER, 1, offsetof(struct DynamicNAICSInformation, pB_information),
173                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
174                 -1,     /* IMPLICIT tag at current level */
175                 &asn_DEF_NativeInteger,
176                 0,
177                 { &asn_OER_memb_pB_information_constr_3, &asn_PER_memb_pB_information_constr_3,  memb_pB_information_constraint_1 },
178                 0, 0, /* No default value */
179                 "pB-information"
180                 },
181         { ATF_NOFLAGS, 0, offsetof(struct DynamicNAICSInformation, pA_list),
182                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
183                 0,
184                 &asn_DEF_pA_list_4,
185                 0,
186                 { &asn_OER_memb_pA_list_constr_4, &asn_PER_memb_pA_list_constr_4,  memb_pA_list_constraint_1 },
187                 0, 0, /* No default value */
188                 "pA-list"
189                 },
190         { ATF_POINTER, 1, offsetof(struct DynamicNAICSInformation, iE_Extensions),
191                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
192                 -1,     /* IMPLICIT tag at current level */
193                 &asn_DEF_ProtocolExtensionContainer_9566P133,
194                 0,
195                 { 0, 0, 0 },
196                 0, 0, /* No default value */
197                 "iE-Extensions"
198                 },
199 };
200 static const int asn_MAP_DynamicNAICSInformation_oms_1[] = { 0, 1, 3 };
201 static const ber_tlv_tag_t asn_DEF_DynamicNAICSInformation_tags_1[] = {
202         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
203 };
204 static const asn_TYPE_tag2member_t asn_MAP_DynamicNAICSInformation_tag2el_1[] = {
205     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* transmissionModes */
206     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* pB-information */
207     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* pA-list */
208     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
209 };
210 asn_SEQUENCE_specifics_t asn_SPC_DynamicNAICSInformation_specs_1 = {
211         sizeof(struct DynamicNAICSInformation),
212         offsetof(struct DynamicNAICSInformation, _asn_ctx),
213         asn_MAP_DynamicNAICSInformation_tag2el_1,
214         4,      /* Count of tags in the map */
215         asn_MAP_DynamicNAICSInformation_oms_1,  /* Optional members */
216         3, 0,   /* Root/Additions */
217         4,      /* First extension addition */
218 };
219 asn_TYPE_descriptor_t asn_DEF_DynamicNAICSInformation = {
220         "DynamicNAICSInformation",
221         "DynamicNAICSInformation",
222         &asn_OP_SEQUENCE,
223         asn_DEF_DynamicNAICSInformation_tags_1,
224         sizeof(asn_DEF_DynamicNAICSInformation_tags_1)
225                 /sizeof(asn_DEF_DynamicNAICSInformation_tags_1[0]), /* 1 */
226         asn_DEF_DynamicNAICSInformation_tags_1, /* Same as above */
227         sizeof(asn_DEF_DynamicNAICSInformation_tags_1)
228                 /sizeof(asn_DEF_DynamicNAICSInformation_tags_1[0]), /* 1 */
229         { 0, 0, SEQUENCE_constraint },
230         asn_MBR_DynamicNAICSInformation_1,
231         4,      /* Elements count */
232         &asn_SPC_DynamicNAICSInformation_specs_1        /* Additional specs */
233 };
234