1 /*****************************************************************************
2 # Copyright 2019 AT&T Intellectual Property *
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 *
8 # http://www.apache.org/licenses/LICENSE-2.0 *
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. *
16 ******************************************************************************/
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)");
23 #include "X2AP-IEs.hpp"
26 CauseRIC ::= ENUMERATED {
32 function-resource-limit,
34 inconsistent-action-subsequent-action-sequence,
35 control-message-invalid,
36 call-process-id-invalid,
37 function-not-required,
44 struct CauseRIC : asn::enumerated<13, 0, true>
46 static constexpr const char* name() {return "CauseRIC";}
47 using parent_t = asn::enumerated<13, 0, true>;
54 ,function_resource_limit
56 ,inconsistent_action_subsequent_action_sequence
57 ,control_message_invalid
58 ,call_process_id_invalid
59 ,function_not_required
67 RANfunctionDefinition ::= OCTET STRING
70 struct RANfunctionDefinition : asn::ostring<>
72 static constexpr const char* name() {return "RANfunctionDefinition";}
73 using parent_t = asn::ostring<>;
78 RANfunctionID ::= INTEGER (0..4095)
81 struct RANfunctionID : asn::integer<>
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<>;
90 RICactionDefinition ::= OCTET STRING
93 struct RICactionDefinition : asn::ostring<>
95 static constexpr const char* name() {return "RICactionDefinition";}
96 using parent_t = asn::ostring<>;
101 RICactionID ::= INTEGER (0..255)
104 struct RICactionID : asn::integer<>
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<>;
113 RICactionType ::= ENUMERATED{
121 struct RICactionType : asn::enumerated<3, 0, true>
123 static constexpr const char* name() {return "RICactionType";}
124 using parent_t = asn::enumerated<3, 0, true>;
134 RICcallProcessID ::= OCTET STRING
137 struct RICcallProcessID : asn::ostring<>
139 static constexpr const char* name() {return "RICcallProcessID";}
140 using parent_t = asn::ostring<>;
145 RICcause ::= CHOICE {
146 radioNetwork CauseRadioNetwork,
147 transport CauseTransport,
148 protocol CauseProtocol,
155 struct RICcause : asn::choice<5, 0, true>
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
165 static constexpr const char* name() {return "radioNetwork_t";}
166 using parent_t = CauseRadioNetwork;
169 struct transport_t : CauseTransport
171 static constexpr const char* name() {return "transport_t";}
172 using parent_t = CauseTransport;
175 struct protocol_t : CauseProtocol
177 static constexpr const char* name() {return "protocol_t";}
178 using parent_t = CauseProtocol;
181 struct misc_t : CauseMisc
183 static constexpr const char* name() {return "misc_t";}
184 using parent_t = CauseMisc;
187 struct ric_t : CauseRIC
189 static constexpr const char* name() {return "ric_t";}
190 using parent_t = CauseRIC;
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;
206 template<typename V> bool decode(size_t idx, V& v)
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>());
220 template<typename V> bool encode(V& v) const
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>());
232 template<typename V> static inline void enumerate(V& v)
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);
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; }
252 void set_index(index_type i) {index = i; base::set();}
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)];
262 asn::variant<sizeof(union_type)> var;
263 index_type index {0};
266 RICcontrolAckRequest ::= ENUMERATED{
274 struct RICcontrolAckRequest : asn::enumerated<3, 0, true>
276 static constexpr const char* name() {return "RICcontrolAckRequest";}
277 using parent_t = asn::enumerated<3, 0, true>;
287 RICcontrolHeader ::= OCTET STRING
290 struct RICcontrolHeader : asn::ostring<>
292 static constexpr const char* name() {return "RICcontrolHeader";}
293 using parent_t = asn::ostring<>;
298 RICcontrolMessage ::= OCTET STRING
301 struct RICcontrolMessage : asn::ostring<>
303 static constexpr const char* name() {return "RICcontrolMessage";}
304 using parent_t = asn::ostring<>;
309 RICcontrolStatus ::= ENUMERATED{
317 struct RICcontrolStatus : asn::enumerated<3, 0, true>
319 static constexpr const char* name() {return "RICcontrolStatus";}
320 using parent_t = asn::enumerated<3, 0, true>;
330 RICeventTriggerDefinition ::= OCTET STRING
333 struct RICeventTriggerDefinition : asn::ostring<>
335 static constexpr const char* name() {return "RICeventTriggerDefinition";}
336 using parent_t = asn::ostring<>;
341 RICindicationHeader ::= OCTET STRING
344 struct RICindicationHeader : asn::ostring<>
346 static constexpr const char* name() {return "RICindicationHeader";}
347 using parent_t = asn::ostring<>;
352 RICindicationMessage ::= OCTET STRING
355 struct RICindicationMessage : asn::ostring<>
357 static constexpr const char* name() {return "RICindicationMessage";}
358 using parent_t = asn::ostring<>;
363 RICindicationSN ::= INTEGER (0..65535)
366 struct RICindicationSN : asn::integer<>
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<>;
375 RICindicationType ::= ENUMERATED{
382 struct RICindicationType : asn::enumerated<2, 0, true>
384 static constexpr const char* name() {return "RICindicationType";}
385 using parent_t = asn::enumerated<2, 0, true>;
394 RICrequestID ::= SEQUENCE {
395 ricRequestorID INTEGER (0..65535),
396 ricRequestSequenceNumber INTEGER (0..65535),
401 struct RICrequestID : asn::sequence<2, 0, true, 0>
403 static constexpr const char* name() {return "RICrequestID";}
404 using parent_t = asn::sequence<2, 0, true, 0>;
405 struct ricRequestorID_t : asn::integer<>
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<>;
413 ricRequestorID_t& ref_ricRequestorID() {return ricRequestorID;}
414 ricRequestorID_t const& ref_ricRequestorID() const {return ricRequestorID;}
415 struct ricRequestSequenceNumber_t : asn::integer<>
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<>;
423 ricRequestSequenceNumber_t& ref_ricRequestSequenceNumber() {return ricRequestSequenceNumber;}
424 ricRequestSequenceNumber_t const& ref_ricRequestSequenceNumber() const {return ricRequestSequenceNumber;}
425 template<typename V> void decode(V& v)
428 v(ricRequestSequenceNumber);
431 template<typename V> void encode(V& v) const
434 v(ricRequestSequenceNumber);
439 ricRequestorID.clear();
440 ricRequestSequenceNumber.clear();
444 ricRequestorID_t ricRequestorID;
445 ricRequestSequenceNumber_t ricRequestSequenceNumber;
449 RICsubsequentActionType ::= ENUMERATED{
456 struct RICsubsequentActionType : asn::enumerated<2, 0, true>
458 static constexpr const char* name() {return "RICsubsequentActionType";}
459 using parent_t = asn::enumerated<2, 0, true>;
468 RICtimeToWait ::= ENUMERATED{
491 struct RICtimeToWait : asn::enumerated<18, 0, true>
493 static constexpr const char* name() {return "RICtimeToWait";}
494 using parent_t = asn::enumerated<18, 0, true>;
519 RICsubsequentAction ::=SEQUENCE{
520 ricSubsequentActionType RICsubsequentActionType,
521 ricTimeToWait RICtimeToWait,
526 struct RICsubsequentAction : asn::sequence<2, 0, true, 0>
528 static constexpr const char* name() {return "RICsubsequentAction";}
529 using parent_t = asn::sequence<2, 0, true, 0>;
530 struct ricSubsequentActionType_t : RICsubsequentActionType
532 static constexpr const char* name() {return "ricSubsequentActionType_t";}
533 using parent_t = RICsubsequentActionType;
536 ricSubsequentActionType_t& ref_ricSubsequentActionType() {return ricSubsequentActionType;}
537 ricSubsequentActionType_t const& ref_ricSubsequentActionType() const {return ricSubsequentActionType;}
538 struct ricTimeToWait_t : RICtimeToWait
540 static constexpr const char* name() {return "ricTimeToWait_t";}
541 using parent_t = RICtimeToWait;
544 ricTimeToWait_t& ref_ricTimeToWait() {return ricTimeToWait;}
545 ricTimeToWait_t const& ref_ricTimeToWait() const {return ricTimeToWait;}
546 template<typename V> void decode(V& v)
548 v(ricSubsequentActionType);
552 template<typename V> void encode(V& v) const
554 v(ricSubsequentActionType);
560 ricSubsequentActionType.clear();
561 ricTimeToWait.clear();
565 ricSubsequentActionType_t ricSubsequentActionType;
566 ricTimeToWait_t ricTimeToWait;