Upstreaming version 0.10.7
[ric-plt/submgr.git] / e2ap / lib / Subscription-Based-UE-DifferentiationInfo.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 "Subscription-Based-UE-DifferentiationInfo.h"
9
10 #include "ScheduledCommunicationTime.h"
11 #include "ProtocolExtensionContainer.h"
12 /*
13  * This type is implemented using NativeEnumerated,
14  * so here we adjust the DEF accordingly.
15  */
16 /*
17  * This type is implemented using NativeEnumerated,
18  * so here we adjust the DEF accordingly.
19  */
20 /*
21  * This type is implemented using NativeEnumerated,
22  * so here we adjust the DEF accordingly.
23  */
24 /*
25  * This type is implemented using NativeEnumerated,
26  * so here we adjust the DEF accordingly.
27  */
28 static int
29 memb_periodicTime_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
30                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
31         long value;
32         
33         if(!sptr) {
34                 ASN__CTFAIL(app_key, td, sptr,
35                         "%s: value not given (%s:%d)",
36                         td->name, __FILE__, __LINE__);
37                 return -1;
38         }
39         
40         value = *(const long *)sptr;
41         
42         if((value >= 1 && value <= 3600)) {
43                 /* Constraint check succeeded */
44                 return 0;
45         } else {
46                 ASN__CTFAIL(app_key, td, sptr,
47                         "%s: constraint failed (%s:%d)",
48                         td->name, __FILE__, __LINE__);
49                 return -1;
50         }
51 }
52
53 static asn_oer_constraints_t asn_OER_type_periodicCommunicationIndicator_constr_2 CC_NOTUSED = {
54         { 0, 0 },
55         -1};
56 static asn_per_constraints_t asn_PER_type_periodicCommunicationIndicator_constr_2 CC_NOTUSED = {
57         { APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }    /* (0..1,...) */,
58         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
59         0, 0    /* No PER value map */
60 };
61 static asn_oer_constraints_t asn_OER_type_stationaryIndication_constr_8 CC_NOTUSED = {
62         { 0, 0 },
63         -1};
64 static asn_per_constraints_t asn_PER_type_stationaryIndication_constr_8 CC_NOTUSED = {
65         { APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }    /* (0..1,...) */,
66         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
67         0, 0    /* No PER value map */
68 };
69 static asn_oer_constraints_t asn_OER_type_trafficProfile_constr_12 CC_NOTUSED = {
70         { 0, 0 },
71         -1};
72 static asn_per_constraints_t asn_PER_type_trafficProfile_constr_12 CC_NOTUSED = {
73         { APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }    /* (0..2,...) */,
74         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
75         0, 0    /* No PER value map */
76 };
77 static asn_oer_constraints_t asn_OER_type_batteryIndication_constr_17 CC_NOTUSED = {
78         { 0, 0 },
79         -1};
80 static asn_per_constraints_t asn_PER_type_batteryIndication_constr_17 CC_NOTUSED = {
81         { APC_CONSTRAINED | APC_EXTENSIBLE,  2,  2,  0,  2 }    /* (0..2,...) */,
82         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
83         0, 0    /* No PER value map */
84 };
85 static asn_oer_constraints_t asn_OER_memb_periodicTime_constr_6 CC_NOTUSED = {
86         { 0, 0 },
87         -1};
88 static asn_per_constraints_t asn_PER_memb_periodicTime_constr_6 CC_NOTUSED = {
89         { APC_CONSTRAINED | APC_EXTENSIBLE,  12,  12,  1,  3600 }       /* (1..3600,...) */,
90         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
91         0, 0    /* No PER value map */
92 };
93 static const asn_INTEGER_enum_map_t asn_MAP_periodicCommunicationIndicator_value2enum_2[] = {
94         { 0,    12,     "periodically" },
95         { 1,    8,      "ondemand" }
96         /* This list is extensible */
97 };
98 static const unsigned int asn_MAP_periodicCommunicationIndicator_enum2value_2[] = {
99         1,      /* ondemand(1) */
100         0       /* periodically(0) */
101         /* This list is extensible */
102 };
103 static const asn_INTEGER_specifics_t asn_SPC_periodicCommunicationIndicator_specs_2 = {
104         asn_MAP_periodicCommunicationIndicator_value2enum_2,    /* "tag" => N; sorted by tag */
105         asn_MAP_periodicCommunicationIndicator_enum2value_2,    /* N => "tag"; sorted by N */
106         2,      /* Number of elements in the maps */
107         3,      /* Extensions before this member */
108         1,      /* Strict enumeration */
109         0,      /* Native long size */
110         0
111 };
112 static const ber_tlv_tag_t asn_DEF_periodicCommunicationIndicator_tags_2[] = {
113         (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
114         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
115 };
116 static /* Use -fall-defs-global to expose */
117 asn_TYPE_descriptor_t asn_DEF_periodicCommunicationIndicator_2 = {
118         "periodicCommunicationIndicator",
119         "periodicCommunicationIndicator",
120         &asn_OP_NativeEnumerated,
121         asn_DEF_periodicCommunicationIndicator_tags_2,
122         sizeof(asn_DEF_periodicCommunicationIndicator_tags_2)
123                 /sizeof(asn_DEF_periodicCommunicationIndicator_tags_2[0]) - 1, /* 1 */
124         asn_DEF_periodicCommunicationIndicator_tags_2,  /* Same as above */
125         sizeof(asn_DEF_periodicCommunicationIndicator_tags_2)
126                 /sizeof(asn_DEF_periodicCommunicationIndicator_tags_2[0]), /* 2 */
127         { &asn_OER_type_periodicCommunicationIndicator_constr_2, &asn_PER_type_periodicCommunicationIndicator_constr_2, NativeEnumerated_constraint },
128         0, 0,   /* Defined elsewhere */
129         &asn_SPC_periodicCommunicationIndicator_specs_2 /* Additional specs */
130 };
131
132 static const asn_INTEGER_enum_map_t asn_MAP_stationaryIndication_value2enum_8[] = {
133         { 0,    10,     "stationary" },
134         { 1,    6,      "mobile" }
135         /* This list is extensible */
136 };
137 static const unsigned int asn_MAP_stationaryIndication_enum2value_8[] = {
138         1,      /* mobile(1) */
139         0       /* stationary(0) */
140         /* This list is extensible */
141 };
142 static const asn_INTEGER_specifics_t asn_SPC_stationaryIndication_specs_8 = {
143         asn_MAP_stationaryIndication_value2enum_8,      /* "tag" => N; sorted by tag */
144         asn_MAP_stationaryIndication_enum2value_8,      /* N => "tag"; sorted by N */
145         2,      /* Number of elements in the maps */
146         3,      /* Extensions before this member */
147         1,      /* Strict enumeration */
148         0,      /* Native long size */
149         0
150 };
151 static const ber_tlv_tag_t asn_DEF_stationaryIndication_tags_8[] = {
152         (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
153         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
154 };
155 static /* Use -fall-defs-global to expose */
156 asn_TYPE_descriptor_t asn_DEF_stationaryIndication_8 = {
157         "stationaryIndication",
158         "stationaryIndication",
159         &asn_OP_NativeEnumerated,
160         asn_DEF_stationaryIndication_tags_8,
161         sizeof(asn_DEF_stationaryIndication_tags_8)
162                 /sizeof(asn_DEF_stationaryIndication_tags_8[0]) - 1, /* 1 */
163         asn_DEF_stationaryIndication_tags_8,    /* Same as above */
164         sizeof(asn_DEF_stationaryIndication_tags_8)
165                 /sizeof(asn_DEF_stationaryIndication_tags_8[0]), /* 2 */
166         { &asn_OER_type_stationaryIndication_constr_8, &asn_PER_type_stationaryIndication_constr_8, NativeEnumerated_constraint },
167         0, 0,   /* Defined elsewhere */
168         &asn_SPC_stationaryIndication_specs_8   /* Additional specs */
169 };
170
171 static const asn_INTEGER_enum_map_t asn_MAP_trafficProfile_value2enum_12[] = {
172         { 0,    13,     "single-packet" },
173         { 1,    12,     "dual-packets" },
174         { 2,    16,     "multiple-packets" }
175         /* This list is extensible */
176 };
177 static const unsigned int asn_MAP_trafficProfile_enum2value_12[] = {
178         1,      /* dual-packets(1) */
179         2,      /* multiple-packets(2) */
180         0       /* single-packet(0) */
181         /* This list is extensible */
182 };
183 static const asn_INTEGER_specifics_t asn_SPC_trafficProfile_specs_12 = {
184         asn_MAP_trafficProfile_value2enum_12,   /* "tag" => N; sorted by tag */
185         asn_MAP_trafficProfile_enum2value_12,   /* N => "tag"; sorted by N */
186         3,      /* Number of elements in the maps */
187         4,      /* Extensions before this member */
188         1,      /* Strict enumeration */
189         0,      /* Native long size */
190         0
191 };
192 static const ber_tlv_tag_t asn_DEF_trafficProfile_tags_12[] = {
193         (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
194         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
195 };
196 static /* Use -fall-defs-global to expose */
197 asn_TYPE_descriptor_t asn_DEF_trafficProfile_12 = {
198         "trafficProfile",
199         "trafficProfile",
200         &asn_OP_NativeEnumerated,
201         asn_DEF_trafficProfile_tags_12,
202         sizeof(asn_DEF_trafficProfile_tags_12)
203                 /sizeof(asn_DEF_trafficProfile_tags_12[0]) - 1, /* 1 */
204         asn_DEF_trafficProfile_tags_12, /* Same as above */
205         sizeof(asn_DEF_trafficProfile_tags_12)
206                 /sizeof(asn_DEF_trafficProfile_tags_12[0]), /* 2 */
207         { &asn_OER_type_trafficProfile_constr_12, &asn_PER_type_trafficProfile_constr_12, NativeEnumerated_constraint },
208         0, 0,   /* Defined elsewhere */
209         &asn_SPC_trafficProfile_specs_12        /* Additional specs */
210 };
211
212 static const asn_INTEGER_enum_map_t asn_MAP_batteryIndication_value2enum_17[] = {
213         { 0,    15,     "battery-powered" },
214         { 1,    47,     "battery-powered-not-rechargeable-or-replaceable" },
215         { 2,    19,     "not-battery-powered" }
216         /* This list is extensible */
217 };
218 static const unsigned int asn_MAP_batteryIndication_enum2value_17[] = {
219         0,      /* battery-powered(0) */
220         1,      /* battery-powered-not-rechargeable-or-replaceable(1) */
221         2       /* not-battery-powered(2) */
222         /* This list is extensible */
223 };
224 static const asn_INTEGER_specifics_t asn_SPC_batteryIndication_specs_17 = {
225         asn_MAP_batteryIndication_value2enum_17,        /* "tag" => N; sorted by tag */
226         asn_MAP_batteryIndication_enum2value_17,        /* N => "tag"; sorted by N */
227         3,      /* Number of elements in the maps */
228         4,      /* Extensions before this member */
229         1,      /* Strict enumeration */
230         0,      /* Native long size */
231         0
232 };
233 static const ber_tlv_tag_t asn_DEF_batteryIndication_tags_17[] = {
234         (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
235         (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
236 };
237 static /* Use -fall-defs-global to expose */
238 asn_TYPE_descriptor_t asn_DEF_batteryIndication_17 = {
239         "batteryIndication",
240         "batteryIndication",
241         &asn_OP_NativeEnumerated,
242         asn_DEF_batteryIndication_tags_17,
243         sizeof(asn_DEF_batteryIndication_tags_17)
244                 /sizeof(asn_DEF_batteryIndication_tags_17[0]) - 1, /* 1 */
245         asn_DEF_batteryIndication_tags_17,      /* Same as above */
246         sizeof(asn_DEF_batteryIndication_tags_17)
247                 /sizeof(asn_DEF_batteryIndication_tags_17[0]), /* 2 */
248         { &asn_OER_type_batteryIndication_constr_17, &asn_PER_type_batteryIndication_constr_17, NativeEnumerated_constraint },
249         0, 0,   /* Defined elsewhere */
250         &asn_SPC_batteryIndication_specs_17     /* Additional specs */
251 };
252
253 static asn_TYPE_member_t asn_MBR_Subscription_Based_UE_DifferentiationInfo_1[] = {
254         { ATF_POINTER, 7, offsetof(struct Subscription_Based_UE_DifferentiationInfo, periodicCommunicationIndicator),
255                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
256                 -1,     /* IMPLICIT tag at current level */
257                 &asn_DEF_periodicCommunicationIndicator_2,
258                 0,
259                 { 0, 0, 0 },
260                 0, 0, /* No default value */
261                 "periodicCommunicationIndicator"
262                 },
263         { ATF_POINTER, 6, offsetof(struct Subscription_Based_UE_DifferentiationInfo, periodicTime),
264                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
265                 -1,     /* IMPLICIT tag at current level */
266                 &asn_DEF_NativeInteger,
267                 0,
268                 { &asn_OER_memb_periodicTime_constr_6, &asn_PER_memb_periodicTime_constr_6,  memb_periodicTime_constraint_1 },
269                 0, 0, /* No default value */
270                 "periodicTime"
271                 },
272         { ATF_POINTER, 5, offsetof(struct Subscription_Based_UE_DifferentiationInfo, scheduledCommunicationTime),
273                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
274                 -1,     /* IMPLICIT tag at current level */
275                 &asn_DEF_ScheduledCommunicationTime,
276                 0,
277                 { 0, 0, 0 },
278                 0, 0, /* No default value */
279                 "scheduledCommunicationTime"
280                 },
281         { ATF_POINTER, 4, offsetof(struct Subscription_Based_UE_DifferentiationInfo, stationaryIndication),
282                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
283                 -1,     /* IMPLICIT tag at current level */
284                 &asn_DEF_stationaryIndication_8,
285                 0,
286                 { 0, 0, 0 },
287                 0, 0, /* No default value */
288                 "stationaryIndication"
289                 },
290         { ATF_POINTER, 3, offsetof(struct Subscription_Based_UE_DifferentiationInfo, trafficProfile),
291                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
292                 -1,     /* IMPLICIT tag at current level */
293                 &asn_DEF_trafficProfile_12,
294                 0,
295                 { 0, 0, 0 },
296                 0, 0, /* No default value */
297                 "trafficProfile"
298                 },
299         { ATF_POINTER, 2, offsetof(struct Subscription_Based_UE_DifferentiationInfo, batteryIndication),
300                 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
301                 -1,     /* IMPLICIT tag at current level */
302                 &asn_DEF_batteryIndication_17,
303                 0,
304                 { 0, 0, 0 },
305                 0, 0, /* No default value */
306                 "batteryIndication"
307                 },
308         { ATF_POINTER, 1, offsetof(struct Subscription_Based_UE_DifferentiationInfo, iE_Extensions),
309                 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
310                 -1,     /* IMPLICIT tag at current level */
311                 &asn_DEF_ProtocolExtensionContainer_7683P196,
312                 0,
313                 { 0, 0, 0 },
314                 0, 0, /* No default value */
315                 "iE-Extensions"
316                 },
317 };
318 static const int asn_MAP_Subscription_Based_UE_DifferentiationInfo_oms_1[] = { 0, 1, 2, 3, 4, 5, 6 };
319 static const ber_tlv_tag_t asn_DEF_Subscription_Based_UE_DifferentiationInfo_tags_1[] = {
320         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
321 };
322 static const asn_TYPE_tag2member_t asn_MAP_Subscription_Based_UE_DifferentiationInfo_tag2el_1[] = {
323     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* periodicCommunicationIndicator */
324     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* periodicTime */
325     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* scheduledCommunicationTime */
326     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* stationaryIndication */
327     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* trafficProfile */
328     { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* batteryIndication */
329     { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* iE-Extensions */
330 };
331 static asn_SEQUENCE_specifics_t asn_SPC_Subscription_Based_UE_DifferentiationInfo_specs_1 = {
332         sizeof(struct Subscription_Based_UE_DifferentiationInfo),
333         offsetof(struct Subscription_Based_UE_DifferentiationInfo, _asn_ctx),
334         asn_MAP_Subscription_Based_UE_DifferentiationInfo_tag2el_1,
335         7,      /* Count of tags in the map */
336         asn_MAP_Subscription_Based_UE_DifferentiationInfo_oms_1,        /* Optional members */
337         7, 0,   /* Root/Additions */
338         7,      /* First extension addition */
339 };
340 asn_TYPE_descriptor_t asn_DEF_Subscription_Based_UE_DifferentiationInfo = {
341         "Subscription-Based-UE-DifferentiationInfo",
342         "Subscription-Based-UE-DifferentiationInfo",
343         &asn_OP_SEQUENCE,
344         asn_DEF_Subscription_Based_UE_DifferentiationInfo_tags_1,
345         sizeof(asn_DEF_Subscription_Based_UE_DifferentiationInfo_tags_1)
346                 /sizeof(asn_DEF_Subscription_Based_UE_DifferentiationInfo_tags_1[0]), /* 1 */
347         asn_DEF_Subscription_Based_UE_DifferentiationInfo_tags_1,       /* Same as above */
348         sizeof(asn_DEF_Subscription_Based_UE_DifferentiationInfo_tags_1)
349                 /sizeof(asn_DEF_Subscription_Based_UE_DifferentiationInfo_tags_1[0]), /* 1 */
350         { 0, 0, SEQUENCE_constraint },
351         asn_MBR_Subscription_Based_UE_DifferentiationInfo_1,
352         7,      /* Elements count */
353         &asn_SPC_Subscription_Based_UE_DifferentiationInfo_specs_1      /* Additional specs */
354 };
355