Enhanced SIM for E2AP v1 for TS UC
[sim/e2-interface.git] / e2sim / e2apv1sim / src / ASN1 / generated / E2AP-IEs.hpp
1 /*****************************************************************************
2 # Copyright 2019 AT&T Intellectual Property                                  *
3 #                                                                            *
4 # Licensed under the Apache License, Version 2.0 (the "License");            *
5 # you may not use this file except in compliance with the License.           *
6 # You may obtain a copy of the License at                                    *
7 #                                                                            *
8 #      http://www.apache.org/licenses/LICENSE-2.0                            *
9 #                                                                            *
10 # Unless required by applicable law or agreed to in writing, software        *
11 # distributed under the License is distributed on an "AS IS" BASIS,          *
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
13 # See the License for the specific language governing permissions and        *
14 # limitations under the License.                                             *
15 #                                                                            *
16 ******************************************************************************/
17
18 #pragma once
19
20 #include "asn/asn.hpp"
21 static_assert(ASN_API_VERSION_MAJOR == 5, "re-generate the ASN parser's code using 'make regen-asn' (do not use -j option)");
22
23 #include "X2AP-IEs.hpp"
24
25 /*
26 CauseRIC ::= ENUMERATED {
27         function-id-Invalid,
28         action-not-supported,
29         excessive-actions,
30         duplicate-action,
31         duplicate-event,
32         function-resource-limit,
33         request-id-unknown,
34         inconsistent-action-subsequent-action-sequence,
35         control-message-invalid,
36         call-process-id-invalid,
37         function-not-required,
38         excessive-functions,
39         ric-resource-limit,
40         ...
41 }
42 */
43
44 struct CauseRIC : asn::enumerated<13, 0, true>
45 {
46         static constexpr const char* name() {return "CauseRIC";}
47         using parent_t = asn::enumerated<13, 0, true>;
48         typedef enum {
49                 function_id_Invalid
50                 ,action_not_supported
51                 ,excessive_actions
52                 ,duplicate_action
53                 ,duplicate_event
54                 ,function_resource_limit
55                 ,request_id_unknown
56                 ,inconsistent_action_subsequent_action_sequence
57                 ,control_message_invalid
58                 ,call_process_id_invalid
59                 ,function_not_required
60                 ,excessive_functions
61                 ,ric_resource_limit
62         } index_t;
63
64 };
65
66 /*
67 RANfunctionDefinition ::= OCTET STRING
68 */
69
70 struct RANfunctionDefinition : asn::ostring<>
71 {
72         static constexpr const char* name() {return "RANfunctionDefinition";}
73         using parent_t = asn::ostring<>;
74
75 };
76
77 /*
78 RANfunctionID ::= INTEGER (0..4095)
79 */
80
81 struct RANfunctionID : asn::integer<>
82 {
83         using constraint_t = asn::constraints<false,asn::span<0, 4095>>;
84         static constexpr const char* name() {return "RANfunctionID";}
85         using parent_t = asn::integer<>;
86
87 };
88
89 /*
90 RICactionDefinition ::= OCTET STRING
91 */
92
93 struct RICactionDefinition : asn::ostring<>
94 {
95         static constexpr const char* name() {return "RICactionDefinition";}
96         using parent_t = asn::ostring<>;
97
98 };
99
100 /*
101 RICactionID ::= INTEGER (0..255)
102 */
103
104 struct RICactionID : asn::integer<>
105 {
106         using constraint_t = asn::constraints<false,asn::span<0, 255>>;
107         static constexpr const char* name() {return "RICactionID";}
108         using parent_t = asn::integer<>;
109
110 };
111
112 /*
113 RICactionType ::= ENUMERATED{
114         report,
115         insert,
116         policy,
117         ...
118 }
119 */
120
121 struct RICactionType : asn::enumerated<3, 0, true>
122 {
123         static constexpr const char* name() {return "RICactionType";}
124         using parent_t = asn::enumerated<3, 0, true>;
125         typedef enum {
126                 report
127                 ,insert
128                 ,policy
129         } index_t;
130
131 };
132
133 /*
134 RICcallProcessID ::= OCTET STRING
135 */
136
137 struct RICcallProcessID : asn::ostring<>
138 {
139         static constexpr const char* name() {return "RICcallProcessID";}
140         using parent_t = asn::ostring<>;
141
142 };
143
144 /*
145 RICcause ::= CHOICE {
146         radioNetwork            CauseRadioNetwork,
147         transport                       CauseTransport,
148         protocol                        CauseProtocol,
149         misc                            CauseMisc,
150         ric                                     CauseRIC,
151         ...
152 }
153 */
154
155 struct RICcause : asn::choice<5, 0, true>
156 {
157         static constexpr const char* name() {return "RICcause";}
158         using parent_t = asn::choice<5, 0, true>;
159         index_type get_index() const {return index;}
160         bool is_unknown() const {return index == 6;}
161         void set_unknown() { set_index(6);  }
162         ~RICcause() {clear();}
163         struct radioNetwork_t : CauseRadioNetwork
164         {
165                 static constexpr const char* name() {return "radioNetwork_t";}
166                 using parent_t = CauseRadioNetwork;
167
168         };
169         struct transport_t : CauseTransport
170         {
171                 static constexpr const char* name() {return "transport_t";}
172                 using parent_t = CauseTransport;
173
174         };
175         struct protocol_t : CauseProtocol
176         {
177                 static constexpr const char* name() {return "protocol_t";}
178                 using parent_t = CauseProtocol;
179
180         };
181         struct misc_t : CauseMisc
182         {
183                 static constexpr const char* name() {return "misc_t";}
184                 using parent_t = CauseMisc;
185
186         };
187         struct ric_t : CauseRIC
188         {
189                 static constexpr const char* name() {return "ric_t";}
190                 using parent_t = CauseRIC;
191
192         };
193         void clear()
194         {
195                 switch(get_index())
196                 {
197                 case 1: var.destroy<radioNetwork_t>(); break;
198                 case 2: var.destroy<transport_t>(); break;
199                 case 3: var.destroy<protocol_t>(); break;
200                 case 4: var.destroy<misc_t>(); break;
201                 case 5: var.destroy<ric_t>(); break;
202                 }
203                 index = 0;
204                 base::clear();
205         }
206         template<typename V> bool decode(size_t idx, V& v)
207         {
208                 clear();
209                 switch(idx)
210                 {
211                 case 1: set_index(1); return v(var.build<radioNetwork_t>());
212                 case 2: set_index(2); return v(var.build<transport_t>());
213                 case 3: set_index(3); return v(var.build<protocol_t>());
214                 case 4: set_index(4); return v(var.build<misc_t>());
215                 case 5: set_index(5); return v(var.build<ric_t>());
216                 }
217                 return false;
218
219         }
220         template<typename V> bool encode(V& v) const
221         {
222                 switch(get_index())
223                 {
224                 case 1: return v(var.as<radioNetwork_t>());
225                 case 2: return v(var.as<transport_t>());
226                 case 3: return v(var.as<protocol_t>());
227                 case 4: return v(var.as<misc_t>());
228                 case 5: return v(var.as<ric_t>());
229                 }
230                 return false;
231         }
232         template<typename V> static inline void enumerate(V& v)
233         {
234                 v.template operator()<radioNetwork_t>(1);
235                 v.template operator()<transport_t>(2);
236                 v.template operator()<protocol_t>(3);
237                 v.template operator()<misc_t>(4);
238                 v.template operator()<ric_t>(5);
239
240         }
241         radioNetwork_t& select_radioNetwork() { if(get_index() != 1) { clear(); set_index(1); return var.build<radioNetwork_t>();} return var.as<radioNetwork_t>();}
242         radioNetwork_t const* get_radioNetwork() const { if(get_index() == 1) { return &var.as<radioNetwork_t>();} return nullptr; }
243         transport_t& select_transport() { if(get_index() != 2) { clear(); set_index(2); return var.build<transport_t>();} return var.as<transport_t>();}
244         transport_t const* get_transport() const { if(get_index() == 2) { return &var.as<transport_t>();} return nullptr; }
245         protocol_t& select_protocol() { if(get_index() != 3) { clear(); set_index(3); return var.build<protocol_t>();} return var.as<protocol_t>();}
246         protocol_t const* get_protocol() const { if(get_index() == 3) { return &var.as<protocol_t>();} return nullptr; }
247         misc_t& select_misc() { if(get_index() != 4) { clear(); set_index(4); return var.build<misc_t>();} return var.as<misc_t>();}
248         misc_t const* get_misc() const { if(get_index() == 4) { return &var.as<misc_t>();} return nullptr; }
249         ric_t& select_ric() { if(get_index() != 5) { clear(); set_index(5); return var.build<ric_t>();} return var.as<ric_t>();}
250         ric_t const* get_ric() const { if(get_index() == 5) { return &var.as<ric_t>();} return nullptr; }
251         private:
252         void set_index(index_type i) {index = i; base::set();}
253         union union_type
254         {
255                 char dummy1[sizeof(radioNetwork_t)];
256                 char dummy2[sizeof(transport_t)];
257                 char dummy3[sizeof(protocol_t)];
258                 char dummy4[sizeof(misc_t)];
259                 char dummy5[sizeof(ric_t)];
260
261         };
262         asn::variant<sizeof(union_type)>        var;
263         index_type      index {0};
264 };
265 /*
266 RICcontrolAckRequest ::= ENUMERATED{
267         noAck,
268         ack,
269         nAck,
270         ...
271 }
272 */
273
274 struct RICcontrolAckRequest : asn::enumerated<3, 0, true>
275 {
276         static constexpr const char* name() {return "RICcontrolAckRequest";}
277         using parent_t = asn::enumerated<3, 0, true>;
278         typedef enum {
279                 noAck
280                 ,ack
281                 ,nAck
282         } index_t;
283
284 };
285
286 /*
287 RICcontrolHeader ::= OCTET STRING
288 */
289
290 struct RICcontrolHeader : asn::ostring<>
291 {
292         static constexpr const char* name() {return "RICcontrolHeader";}
293         using parent_t = asn::ostring<>;
294
295 };
296
297 /*
298 RICcontrolMessage ::= OCTET STRING
299 */
300
301 struct RICcontrolMessage : asn::ostring<>
302 {
303         static constexpr const char* name() {return "RICcontrolMessage";}
304         using parent_t = asn::ostring<>;
305
306 };
307
308 /*
309 RICcontrolStatus ::= ENUMERATED{
310         success,
311         rejected,
312         failed,
313         ...
314 }
315 */
316
317 struct RICcontrolStatus : asn::enumerated<3, 0, true>
318 {
319         static constexpr const char* name() {return "RICcontrolStatus";}
320         using parent_t = asn::enumerated<3, 0, true>;
321         typedef enum {
322                 success
323                 ,rejected
324                 ,failed
325         } index_t;
326
327 };
328
329 /*
330 RICeventTriggerDefinition ::= OCTET STRING
331 */
332
333 struct RICeventTriggerDefinition : asn::ostring<>
334 {
335         static constexpr const char* name() {return "RICeventTriggerDefinition";}
336         using parent_t = asn::ostring<>;
337
338 };
339
340 /*
341 RICindicationHeader ::= OCTET STRING
342 */
343
344 struct RICindicationHeader : asn::ostring<>
345 {
346         static constexpr const char* name() {return "RICindicationHeader";}
347         using parent_t = asn::ostring<>;
348
349 };
350
351 /*
352 RICindicationMessage ::= OCTET STRING
353 */
354
355 struct RICindicationMessage : asn::ostring<>
356 {
357         static constexpr const char* name() {return "RICindicationMessage";}
358         using parent_t = asn::ostring<>;
359
360 };
361
362 /*
363 RICindicationSN ::= INTEGER (0..65535)
364 */
365
366 struct RICindicationSN : asn::integer<>
367 {
368         using constraint_t = asn::constraints<false,asn::span<0, 65535>>;
369         static constexpr const char* name() {return "RICindicationSN";}
370         using parent_t = asn::integer<>;
371
372 };
373
374 /*
375 RICindicationType ::= ENUMERATED{
376         report,
377         insert,
378         ...
379 }
380 */
381
382 struct RICindicationType : asn::enumerated<2, 0, true>
383 {
384         static constexpr const char* name() {return "RICindicationType";}
385         using parent_t = asn::enumerated<2, 0, true>;
386         typedef enum {
387                 report
388                 ,insert
389         } index_t;
390
391 };
392
393 /*
394 RICrequestID ::= SEQUENCE {
395         ricRequestorID                          INTEGER (0..65535),
396         ricRequestSequenceNumber        INTEGER (0..65535),
397         ...
398 }
399 */
400
401 struct RICrequestID : asn::sequence<2, 0, true, 0>
402 {
403         static constexpr const char* name() {return "RICrequestID";}
404         using parent_t = asn::sequence<2, 0, true, 0>;
405         struct ricRequestorID_t : asn::integer<>
406         {
407                 using constraint_t = asn::constraints<false,asn::span<0, 65535>>;
408                 static constexpr const char* name() {return "ricRequestorID_t";}
409                 using parent_t = asn::integer<>;
410
411         };
412
413         ricRequestorID_t& ref_ricRequestorID() {return ricRequestorID;}
414         ricRequestorID_t const& ref_ricRequestorID() const {return ricRequestorID;}
415         struct ricRequestSequenceNumber_t : asn::integer<>
416         {
417                 using constraint_t = asn::constraints<false,asn::span<0, 65535>>;
418                 static constexpr const char* name() {return "ricRequestSequenceNumber_t";}
419                 using parent_t = asn::integer<>;
420
421         };
422
423         ricRequestSequenceNumber_t& ref_ricRequestSequenceNumber() {return ricRequestSequenceNumber;}
424         ricRequestSequenceNumber_t const& ref_ricRequestSequenceNumber() const {return ricRequestSequenceNumber;}
425         template<typename V> void decode(V& v)
426         {
427                 v(ricRequestorID);
428                 v(ricRequestSequenceNumber);
429
430         };
431         template<typename V> void encode(V& v) const
432         {
433                 v(ricRequestorID);
434                 v(ricRequestSequenceNumber);
435
436         };
437         void clear()
438         {
439                 ricRequestorID.clear();
440                 ricRequestSequenceNumber.clear();
441
442         };
443         private:
444         ricRequestorID_t        ricRequestorID;
445         ricRequestSequenceNumber_t      ricRequestSequenceNumber;
446
447 };
448 /*
449 RICsubsequentActionType ::= ENUMERATED{
450         continue,
451         wait,
452         ...
453 }
454 */
455
456 struct RICsubsequentActionType : asn::enumerated<2, 0, true>
457 {
458         static constexpr const char* name() {return "RICsubsequentActionType";}
459         using parent_t = asn::enumerated<2, 0, true>;
460         typedef enum {
461                 Continue
462                 ,wait
463         } index_t;
464
465 };
466
467 /*
468 RICtimeToWait ::= ENUMERATED{
469         zero,
470         w1ms,
471         w2ms,
472         w5ms,
473         w10ms,
474         w20ms,
475         w30ms,
476         w40ms,
477         w50ms,
478         w100ms,
479         w200ms,
480         w500ms,
481         w1s,
482         w2s,
483         w5s,
484         w10s,
485         w20s,
486         w60s,
487         ...
488 }
489 */
490
491 struct RICtimeToWait : asn::enumerated<18, 0, true>
492 {
493         static constexpr const char* name() {return "RICtimeToWait";}
494         using parent_t = asn::enumerated<18, 0, true>;
495         typedef enum {
496                 zero
497                 ,w1ms
498                 ,w2ms
499                 ,w5ms
500                 ,w10ms
501                 ,w20ms
502                 ,w30ms
503                 ,w40ms
504                 ,w50ms
505                 ,w100ms
506                 ,w200ms
507                 ,w500ms
508                 ,w1s
509                 ,w2s
510                 ,w5s
511                 ,w10s
512                 ,w20s
513                 ,w60s
514         } index_t;
515
516 };
517
518 /*
519 RICsubsequentAction ::=SEQUENCE{
520         ricSubsequentActionType         RICsubsequentActionType,
521         ricTimeToWait                           RICtimeToWait,
522         ...
523 }
524 */
525
526 struct RICsubsequentAction : asn::sequence<2, 0, true, 0>
527 {
528         static constexpr const char* name() {return "RICsubsequentAction";}
529         using parent_t = asn::sequence<2, 0, true, 0>;
530         struct ricSubsequentActionType_t : RICsubsequentActionType
531         {
532                 static constexpr const char* name() {return "ricSubsequentActionType_t";}
533                 using parent_t = RICsubsequentActionType;
534
535         };
536         ricSubsequentActionType_t& ref_ricSubsequentActionType() {return ricSubsequentActionType;}
537         ricSubsequentActionType_t const& ref_ricSubsequentActionType() const {return ricSubsequentActionType;}
538         struct ricTimeToWait_t : RICtimeToWait
539         {
540                 static constexpr const char* name() {return "ricTimeToWait_t";}
541                 using parent_t = RICtimeToWait;
542
543         };
544         ricTimeToWait_t& ref_ricTimeToWait() {return ricTimeToWait;}
545         ricTimeToWait_t const& ref_ricTimeToWait() const {return ricTimeToWait;}
546         template<typename V> void decode(V& v)
547         {
548                 v(ricSubsequentActionType);
549                 v(ricTimeToWait);
550
551         };
552         template<typename V> void encode(V& v) const
553         {
554                 v(ricSubsequentActionType);
555                 v(ricTimeToWait);
556
557         };
558         void clear()
559         {
560                 ricSubsequentActionType.clear();
561                 ricTimeToWait.clear();
562
563         };
564         private:
565         ricSubsequentActionType_t       ricSubsequentActionType;
566         ricTimeToWait_t ricTimeToWait;
567
568 };