676a22d9885cad24cc52089c806c9f1260eb1c79
[ric-plt/submgr.git] / 3rdparty / libe2ap / FreqBandNrItem.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "Spec/e2_and_x2-combined-and-minimized.asn1"
5  *      `asn1c -pdu=auto -fincludes-quoted -fcompound-names -fno-include-deps -gen-PER -no-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_per_constraints_t asn_PER_type_supportedSULBandList_constr_3 CC_NOTUSED = {
64         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
65         { APC_CONSTRAINED,       6,  6,  0,  32 }       /* (SIZE(0..32)) */,
66         0, 0    /* No PER value map */
67 };
68 static asn_per_constraints_t asn_PER_memb_freqBandIndicatorNr_constr_2 CC_NOTUSED = {
69         { APC_CONSTRAINED | APC_EXTENSIBLE,  10,  10,  1,  1024 }       /* (1..1024,...) */,
70         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
71         0, 0    /* No PER value map */
72 };
73 static asn_per_constraints_t asn_PER_memb_supportedSULBandList_constr_3 CC_NOTUSED = {
74         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
75         { APC_CONSTRAINED,       6,  6,  0,  32 }       /* (SIZE(0..32)) */,
76         0, 0    /* No PER value map */
77 };
78 static asn_TYPE_member_t asn_MBR_supportedSULBandList_3[] = {
79         { ATF_POINTER, 0, 0,
80                 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
81                 0,
82                 &asn_DEF_SupportedSULFreqBandItem,
83                 0,
84                 { 0, 0, 0 },
85                 0, 0, /* No default value */
86                 ""
87                 },
88 };
89 static const ber_tlv_tag_t asn_DEF_supportedSULBandList_tags_3[] = {
90         (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
91         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
92 };
93 static asn_SET_OF_specifics_t asn_SPC_supportedSULBandList_specs_3 = {
94         sizeof(struct FreqBandNrItem__supportedSULBandList),
95         offsetof(struct FreqBandNrItem__supportedSULBandList, _asn_ctx),
96         0,      /* XER encoding is XMLDelimitedItemList */
97 };
98 static /* Use -fall-defs-global to expose */
99 asn_TYPE_descriptor_t asn_DEF_supportedSULBandList_3 = {
100         "supportedSULBandList",
101         "supportedSULBandList",
102         &asn_OP_SEQUENCE_OF,
103         asn_DEF_supportedSULBandList_tags_3,
104         sizeof(asn_DEF_supportedSULBandList_tags_3)
105                 /sizeof(asn_DEF_supportedSULBandList_tags_3[0]) - 1, /* 1 */
106         asn_DEF_supportedSULBandList_tags_3,    /* Same as above */
107         sizeof(asn_DEF_supportedSULBandList_tags_3)
108                 /sizeof(asn_DEF_supportedSULBandList_tags_3[0]), /* 2 */
109         { 0, &asn_PER_type_supportedSULBandList_constr_3, SEQUENCE_OF_constraint },
110         asn_MBR_supportedSULBandList_3,
111         1,      /* Single element */
112         &asn_SPC_supportedSULBandList_specs_3   /* Additional specs */
113 };
114
115 asn_TYPE_member_t asn_MBR_FreqBandNrItem_1[] = {
116         { ATF_NOFLAGS, 0, offsetof(struct FreqBandNrItem, freqBandIndicatorNr),
117                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
118                 -1,     /* IMPLICIT tag at current level */
119                 &asn_DEF_NativeInteger,
120                 0,
121                 { 0, &asn_PER_memb_freqBandIndicatorNr_constr_2,  memb_freqBandIndicatorNr_constraint_1 },
122                 0, 0, /* No default value */
123                 "freqBandIndicatorNr"
124                 },
125         { ATF_NOFLAGS, 0, offsetof(struct FreqBandNrItem, supportedSULBandList),
126                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
127                 0,
128                 &asn_DEF_supportedSULBandList_3,
129                 0,
130                 { 0, &asn_PER_memb_supportedSULBandList_constr_3,  memb_supportedSULBandList_constraint_1 },
131                 0, 0, /* No default value */
132                 "supportedSULBandList"
133                 },
134         { ATF_POINTER, 1, offsetof(struct FreqBandNrItem, iE_Extensions),
135                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
136                 -1,     /* IMPLICIT tag at current level */
137                 &asn_DEF_ProtocolExtensionContainer_8858P44,
138                 0,
139                 { 0, 0, 0 },
140                 0, 0, /* No default value */
141                 "iE-Extensions"
142                 },
143 };
144 static const int asn_MAP_FreqBandNrItem_oms_1[] = { 2 };
145 static const ber_tlv_tag_t asn_DEF_FreqBandNrItem_tags_1[] = {
146         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
147 };
148 static const asn_TYPE_tag2member_t asn_MAP_FreqBandNrItem_tag2el_1[] = {
149     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* freqBandIndicatorNr */
150     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* supportedSULBandList */
151     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
152 };
153 asn_SEQUENCE_specifics_t asn_SPC_FreqBandNrItem_specs_1 = {
154         sizeof(struct FreqBandNrItem),
155         offsetof(struct FreqBandNrItem, _asn_ctx),
156         asn_MAP_FreqBandNrItem_tag2el_1,
157         3,      /* Count of tags in the map */
158         asn_MAP_FreqBandNrItem_oms_1,   /* Optional members */
159         1, 0,   /* Root/Additions */
160         3,      /* First extension addition */
161 };
162 asn_TYPE_descriptor_t asn_DEF_FreqBandNrItem = {
163         "FreqBandNrItem",
164         "FreqBandNrItem",
165         &asn_OP_SEQUENCE,
166         asn_DEF_FreqBandNrItem_tags_1,
167         sizeof(asn_DEF_FreqBandNrItem_tags_1)
168                 /sizeof(asn_DEF_FreqBandNrItem_tags_1[0]), /* 1 */
169         asn_DEF_FreqBandNrItem_tags_1,  /* Same as above */
170         sizeof(asn_DEF_FreqBandNrItem_tags_1)
171                 /sizeof(asn_DEF_FreqBandNrItem_tags_1[0]), /* 1 */
172         { 0, 0, SEQUENCE_constraint },
173         asn_MBR_FreqBandNrItem_1,
174         3,      /* Elements count */
175         &asn_SPC_FreqBandNrItem_specs_1 /* Additional specs */
176 };
177