Moving in e2sim originally from it/test/simulators
[sim/e2-interface.git] / e2sim / ASN1c / NRFreqInfo.c
1 /*****************************************************************************
2 #                                                                            *
3 # Copyright 2019 AT&T Intellectual Property                                  *
4 #                                                                            *
5 # Licensed under the Apache License, Version 2.0 (the "License");            *
6 # you may not use this file except in compliance with the License.           *
7 # You may obtain a copy of the License at                                    *
8 #                                                                            *
9 #      http://www.apache.org/licenses/LICENSE-2.0                            *
10 #                                                                            *
11 # Unless required by applicable law or agreed to in writing, software        *
12 # distributed under the License is distributed on an "AS IS" BASIS,          *
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
14 # See the License for the specific language governing permissions and        *
15 # limitations under the License.                                             *
16 #                                                                            *
17 ******************************************************************************/
18
19 /*
20  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
21  * From ASN.1 module "X2AP-IEs"
22  *      found in "../../asnFiles/X2AP-IEs.asn"
23  *      `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D.`
24  */
25
26 #include "NRFreqInfo.h"
27
28 #include "SULInformation.h"
29 #include "ProtocolExtensionContainer.h"
30 #include "FreqBandNrItem.h"
31 static int
32 memb_nRARFCN_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
33                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
34         long value;
35         
36         if(!sptr) {
37                 ASN__CTFAIL(app_key, td, sptr,
38                         "%s: value not given (%s:%d)",
39                         td->name, __FILE__, __LINE__);
40                 return -1;
41         }
42         
43         value = *(const long *)sptr;
44         
45         if((value >= 0 && value <= 3279165)) {
46                 /* Constraint check succeeded */
47                 return 0;
48         } else {
49                 ASN__CTFAIL(app_key, td, sptr,
50                         "%s: constraint failed (%s:%d)",
51                         td->name, __FILE__, __LINE__);
52                 return -1;
53         }
54 }
55
56 static int
57 memb_freqBandListNr_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
58                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
59         size_t size;
60         
61         if(!sptr) {
62                 ASN__CTFAIL(app_key, td, sptr,
63                         "%s: value not given (%s:%d)",
64                         td->name, __FILE__, __LINE__);
65                 return -1;
66         }
67         
68         /* Determine the number of elements */
69         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
70         
71         if((size >= 1 && size <= 32)) {
72                 /* Perform validation of the inner elements */
73                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
74         } else {
75                 ASN__CTFAIL(app_key, td, sptr,
76                         "%s: constraint failed (%s:%d)",
77                         td->name, __FILE__, __LINE__);
78                 return -1;
79         }
80 }
81
82 static asn_per_constraints_t asn_PER_type_freqBandListNr_constr_3 CC_NOTUSED = {
83         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
84         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
85         0, 0    /* No PER value map */
86 };
87 static asn_per_constraints_t asn_PER_memb_nRARFCN_constr_2 CC_NOTUSED = {
88         { APC_CONSTRAINED,       22, -1,  0,  3279165 } /* (0..3279165) */,
89         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
90         0, 0    /* No PER value map */
91 };
92 static asn_per_constraints_t asn_PER_memb_freqBandListNr_constr_3 CC_NOTUSED = {
93         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
94         { APC_CONSTRAINED,       5,  5,  1,  32 }       /* (SIZE(1..32)) */,
95         0, 0    /* No PER value map */
96 };
97 static asn_TYPE_member_t asn_MBR_freqBandListNr_3[] = {
98         { ATF_POINTER, 0, 0,
99                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
100                 0,
101                 &asn_DEF_FreqBandNrItem,
102                 0,
103                 { 0, 0, 0 },
104                 0, 0, /* No default value */
105                 ""
106                 },
107 };
108 static const ber_tlv_tag_t asn_DEF_freqBandListNr_tags_3[] = {
109         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
110         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
111 };
112 static asn_SET_OF_specifics_t asn_SPC_freqBandListNr_specs_3 = {
113         sizeof(struct NRFreqInfo__freqBandListNr),
114         offsetof(struct NRFreqInfo__freqBandListNr, _asn_ctx),
115         0,      /* XER encoding is XMLDelimitedItemList */
116 };
117 static /* Use -fall-defs-global to expose */
118 asn_TYPE_descriptor_t asn_DEF_freqBandListNr_3 = {
119         "freqBandListNr",
120         "freqBandListNr",
121         &asn_OP_SEQUENCE_OF,
122         asn_DEF_freqBandListNr_tags_3,
123         sizeof(asn_DEF_freqBandListNr_tags_3)
124                 /sizeof(asn_DEF_freqBandListNr_tags_3[0]) - 1, /* 1 */
125         asn_DEF_freqBandListNr_tags_3,  /* Same as above */
126         sizeof(asn_DEF_freqBandListNr_tags_3)
127                 /sizeof(asn_DEF_freqBandListNr_tags_3[0]), /* 2 */
128         { 0, &asn_PER_type_freqBandListNr_constr_3, SEQUENCE_OF_constraint },
129         asn_MBR_freqBandListNr_3,
130         1,      /* Single element */
131         &asn_SPC_freqBandListNr_specs_3 /* Additional specs */
132 };
133
134 asn_TYPE_member_t asn_MBR_NRFreqInfo_1[] = {
135         { ATF_NOFLAGS, 0, offsetof(struct NRFreqInfo, nRARFCN),
136                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
137                 -1,     /* IMPLICIT tag at current level */
138                 &asn_DEF_NativeInteger,
139                 0,
140                 { 0, &asn_PER_memb_nRARFCN_constr_2,  memb_nRARFCN_constraint_1 },
141                 0, 0, /* No default value */
142                 "nRARFCN"
143                 },
144         { ATF_NOFLAGS, 0, offsetof(struct NRFreqInfo, freqBandListNr),
145                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
146                 0,
147                 &asn_DEF_freqBandListNr_3,
148                 0,
149                 { 0, &asn_PER_memb_freqBandListNr_constr_3,  memb_freqBandListNr_constraint_1 },
150                 0, 0, /* No default value */
151                 "freqBandListNr"
152                 },
153         { ATF_POINTER, 2, offsetof(struct NRFreqInfo, sULInformation),
154                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
155                 -1,     /* IMPLICIT tag at current level */
156                 &asn_DEF_SULInformation,
157                 0,
158                 { 0, 0, 0 },
159                 0, 0, /* No default value */
160                 "sULInformation"
161                 },
162         { ATF_POINTER, 1, offsetof(struct NRFreqInfo, iE_Extensions),
163                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
164                 -1,     /* IMPLICIT tag at current level */
165                 &asn_DEF_ProtocolExtensionContainer_170P173,
166                 0,
167                 { 0, 0, 0 },
168                 0, 0, /* No default value */
169                 "iE-Extensions"
170                 },
171 };
172 static const int asn_MAP_NRFreqInfo_oms_1[] = { 2, 3 };
173 static const ber_tlv_tag_t asn_DEF_NRFreqInfo_tags_1[] = {
174         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
175 };
176 static const asn_TYPE_tag2member_t asn_MAP_NRFreqInfo_tag2el_1[] = {
177     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nRARFCN */
178     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* freqBandListNr */
179     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* sULInformation */
180     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
181 };
182 asn_SEQUENCE_specifics_t asn_SPC_NRFreqInfo_specs_1 = {
183         sizeof(struct NRFreqInfo),
184         offsetof(struct NRFreqInfo, _asn_ctx),
185         asn_MAP_NRFreqInfo_tag2el_1,
186         4,      /* Count of tags in the map */
187         asn_MAP_NRFreqInfo_oms_1,       /* Optional members */
188         2, 0,   /* Root/Additions */
189         4,      /* First extension addition */
190 };
191 asn_TYPE_descriptor_t asn_DEF_NRFreqInfo = {
192         "NRFreqInfo",
193         "NRFreqInfo",
194         &asn_OP_SEQUENCE,
195         asn_DEF_NRFreqInfo_tags_1,
196         sizeof(asn_DEF_NRFreqInfo_tags_1)
197                 /sizeof(asn_DEF_NRFreqInfo_tags_1[0]), /* 1 */
198         asn_DEF_NRFreqInfo_tags_1,      /* Same as above */
199         sizeof(asn_DEF_NRFreqInfo_tags_1)
200                 /sizeof(asn_DEF_NRFreqInfo_tags_1[0]), /* 1 */
201         { 0, 0, SEQUENCE_constraint },
202         asn_MBR_NRFreqInfo_1,
203         4,      /* Elements count */
204         &asn_SPC_NRFreqInfo_specs_1     /* Additional specs */
205 };
206