Upstreaming version 0.10.7
[ric-plt/submgr.git] / e2ap / lib / FreqBandNrItem.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 "FreqBandNrItem.h"
9
10 #include "ProtocolExtensionContainer.h"
11 #include "SupportedSULFreqBandItem.h"
12 static int
13 memb_freqBandIndicatorNr_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
14                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
15         long value;
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         value = *(const long *)sptr;
25         
26         if((value >= 1 && value <= 1024)) {
27                 /* Constraint check succeeded */
28                 return 0;
29         } else {
30                 ASN__CTFAIL(app_key, td, sptr,
31                         "%s: constraint failed (%s:%d)",
32                         td->name, __FILE__, __LINE__);
33                 return -1;
34         }
35 }
36
37 static int
38 memb_supportedSULBandList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
39                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
40         size_t size;
41         
42         if(!sptr) {
43                 ASN__CTFAIL(app_key, td, sptr,
44                         "%s: value not given (%s:%d)",
45                         td->name, __FILE__, __LINE__);
46                 return -1;
47         }
48         
49         /* Determine the number of elements */
50         size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
51         
52         if((size <= 32)) {
53                 /* Perform validation of the inner elements */
54                 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
55         } else {
56                 ASN__CTFAIL(app_key, td, sptr,
57                         "%s: constraint failed (%s:%d)",
58                         td->name, __FILE__, __LINE__);
59                 return -1;
60         }
61 }
62
63 static asn_oer_constraints_t asn_OER_type_supportedSULBandList_constr_3 CC_NOTUSED = {
64         { 0, 0 },
65         -1      /* (SIZE(0..32)) */};
66 static asn_per_constraints_t asn_PER_type_supportedSULBandList_constr_3 CC_NOTUSED = {
67         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
68         { APC_CONSTRAINED,       6,  6,  0,  32 }       /* (SIZE(0..32)) */,
69         0, 0    /* No PER value map */
70 };
71 static asn_oer_constraints_t asn_OER_memb_freqBandIndicatorNr_constr_2 CC_NOTUSED = {
72         { 0, 0 },
73         -1};
74 static asn_per_constraints_t asn_PER_memb_freqBandIndicatorNr_constr_2 CC_NOTUSED = {
75         { APC_CONSTRAINED | APC_EXTENSIBLE,  10,  10,  1,  1024 }       /* (1..1024,...) */,
76         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
77         0, 0    /* No PER value map */
78 };
79 static asn_oer_constraints_t asn_OER_memb_supportedSULBandList_constr_3 CC_NOTUSED = {
80         { 0, 0 },
81         -1      /* (SIZE(0..32)) */};
82 static asn_per_constraints_t asn_PER_memb_supportedSULBandList_constr_3 CC_NOTUSED = {
83         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
84         { APC_CONSTRAINED,       6,  6,  0,  32 }       /* (SIZE(0..32)) */,
85         0, 0    /* No PER value map */
86 };
87 static asn_TYPE_member_t asn_MBR_supportedSULBandList_3[] = {
88         { ATF_POINTER, 0, 0,
89                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
90                 0,
91                 &asn_DEF_SupportedSULFreqBandItem,
92                 0,
93                 { 0, 0, 0 },
94                 0, 0, /* No default value */
95                 ""
96                 },
97 };
98 static const ber_tlv_tag_t asn_DEF_supportedSULBandList_tags_3[] = {
99         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
100         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
101 };
102 static asn_SET_OF_specifics_t asn_SPC_supportedSULBandList_specs_3 = {
103         sizeof(struct FreqBandNrItem__supportedSULBandList),
104         offsetof(struct FreqBandNrItem__supportedSULBandList, _asn_ctx),
105         0,      /* XER encoding is XMLDelimitedItemList */
106 };
107 static /* Use -fall-defs-global to expose */
108 asn_TYPE_descriptor_t asn_DEF_supportedSULBandList_3 = {
109         "supportedSULBandList",
110         "supportedSULBandList",
111         &asn_OP_SEQUENCE_OF,
112         asn_DEF_supportedSULBandList_tags_3,
113         sizeof(asn_DEF_supportedSULBandList_tags_3)
114                 /sizeof(asn_DEF_supportedSULBandList_tags_3[0]) - 1, /* 1 */
115         asn_DEF_supportedSULBandList_tags_3,    /* Same as above */
116         sizeof(asn_DEF_supportedSULBandList_tags_3)
117                 /sizeof(asn_DEF_supportedSULBandList_tags_3[0]), /* 2 */
118         { &asn_OER_type_supportedSULBandList_constr_3, &asn_PER_type_supportedSULBandList_constr_3, SEQUENCE_OF_constraint },
119         asn_MBR_supportedSULBandList_3,
120         1,      /* Single element */
121         &asn_SPC_supportedSULBandList_specs_3   /* Additional specs */
122 };
123
124 asn_TYPE_member_t asn_MBR_FreqBandNrItem_1[] = {
125         { ATF_NOFLAGS, 0, offsetof(struct FreqBandNrItem, freqBandIndicatorNr),
126                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
127                 -1,     /* IMPLICIT tag at current level */
128                 &asn_DEF_NativeInteger,
129                 0,
130                 { &asn_OER_memb_freqBandIndicatorNr_constr_2, &asn_PER_memb_freqBandIndicatorNr_constr_2,  memb_freqBandIndicatorNr_constraint_1 },
131                 0, 0, /* No default value */
132                 "freqBandIndicatorNr"
133                 },
134         { ATF_NOFLAGS, 0, offsetof(struct FreqBandNrItem, supportedSULBandList),
135                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
136                 0,
137                 &asn_DEF_supportedSULBandList_3,
138                 0,
139                 { &asn_OER_memb_supportedSULBandList_constr_3, &asn_PER_memb_supportedSULBandList_constr_3,  memb_supportedSULBandList_constraint_1 },
140                 0, 0, /* No default value */
141                 "supportedSULBandList"
142                 },
143         { ATF_POINTER, 1, offsetof(struct FreqBandNrItem, iE_Extensions),
144                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
145                 -1,     /* IMPLICIT tag at current level */
146                 &asn_DEF_ProtocolExtensionContainer_7683P148,
147                 0,
148                 { 0, 0, 0 },
149                 0, 0, /* No default value */
150                 "iE-Extensions"
151                 },
152 };
153 static const int asn_MAP_FreqBandNrItem_oms_1[] = { 2 };
154 static const ber_tlv_tag_t asn_DEF_FreqBandNrItem_tags_1[] = {
155         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
156 };
157 static const asn_TYPE_tag2member_t asn_MAP_FreqBandNrItem_tag2el_1[] = {
158     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* freqBandIndicatorNr */
159     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* supportedSULBandList */
160     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
161 };
162 asn_SEQUENCE_specifics_t asn_SPC_FreqBandNrItem_specs_1 = {
163         sizeof(struct FreqBandNrItem),
164         offsetof(struct FreqBandNrItem, _asn_ctx),
165         asn_MAP_FreqBandNrItem_tag2el_1,
166         3,      /* Count of tags in the map */
167         asn_MAP_FreqBandNrItem_oms_1,   /* Optional members */
168         1, 0,   /* Root/Additions */
169         3,      /* First extension addition */
170 };
171 asn_TYPE_descriptor_t asn_DEF_FreqBandNrItem = {
172         "FreqBandNrItem",
173         "FreqBandNrItem",
174         &asn_OP_SEQUENCE,
175         asn_DEF_FreqBandNrItem_tags_1,
176         sizeof(asn_DEF_FreqBandNrItem_tags_1)
177                 /sizeof(asn_DEF_FreqBandNrItem_tags_1[0]), /* 1 */
178         asn_DEF_FreqBandNrItem_tags_1,  /* Same as above */
179         sizeof(asn_DEF_FreqBandNrItem_tags_1)
180                 /sizeof(asn_DEF_FreqBandNrItem_tags_1[0]), /* 1 */
181         { 0, 0, SEQUENCE_constraint },
182         asn_MBR_FreqBandNrItem_1,
183         3,      /* Elements count */
184         &asn_SPC_FreqBandNrItem_specs_1 /* Additional specs */
185 };
186