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)");
25 Criticality ::= ENUMERATED { reject, ignore, notify }
28 struct Criticality : asn::enumerated<3, 0, false>
30 static constexpr const char* name() {return "Criticality";}
31 using parent_t = asn::enumerated<3, 0, false>;
41 Presence ::= ENUMERATED { optional, conditional, mandatory }
44 struct Presence : asn::enumerated<3, 0, false>
46 static constexpr const char* name() {return "Presence";}
47 using parent_t = asn::enumerated<3, 0, false>;
57 maxPrivateIEs INTEGER ::= 65535
60 constexpr int64_t maxPrivateIEs = 65535;
62 PrivateIE-ID ::= CHOICE {
63 local INTEGER (0.. maxPrivateIEs),
64 global OBJECT IDENTIFIER
68 struct PrivateIE_ID : asn::choice<2, 0, false>
70 static constexpr const char* name() {return "PrivateIE-ID";}
71 using parent_t = asn::choice<2, 0, false>;
72 index_type get_index() const {return index;}
73 ~PrivateIE_ID() {clear();}
74 struct local_t : asn::integer<>
76 using constraint_t = asn::constraints<false,asn::span<0, maxPrivateIEs >>;
77 static constexpr const char* name() {return "local_t";}
78 using parent_t = asn::integer<>;
82 struct global_t : asn::oid
84 static constexpr const char* name() {return "global_t";}
85 using parent_t = asn::oid;
92 case 1: var.destroy<local_t>(); break;
93 case 2: var.destroy<global_t>(); break;
98 template<typename V> bool decode(size_t idx, V& v)
103 case 1: set_index(1); return v(var.build<local_t>());
104 case 2: set_index(2); return v(var.build<global_t>());
109 template<typename V> bool encode(V& v) const
113 case 1: return v(var.as<local_t>());
114 case 2: return v(var.as<global_t>());
118 template<typename V> static inline void enumerate(V& v)
120 v.template operator()<local_t>(1);
121 v.template operator()<global_t>(2);
124 local_t& select_local() { if(get_index() != 1) { clear(); set_index(1); return var.build<local_t>();} return var.as<local_t>();}
125 local_t const* get_local() const { if(get_index() == 1) { return &var.as<local_t>();} return nullptr; }
126 global_t& select_global() { if(get_index() != 2) { clear(); set_index(2); return var.build<global_t>();} return var.as<global_t>();}
127 global_t const* get_global() const { if(get_index() == 2) { return &var.as<global_t>();} return nullptr; }
129 void set_index(index_type i) {index = i; base::set();}
132 char dummy1[sizeof(local_t)];
133 char dummy2[sizeof(global_t)];
136 asn::variant<sizeof(union_type)> var;
137 index_type index {0};
140 ProcedureCode ::= INTEGER (0..255)
143 struct ProcedureCode : asn::integer<>
145 using constraint_t = asn::constraints<false,asn::span<0, 255>>;
146 static constexpr const char* name() {return "ProcedureCode";}
147 using parent_t = asn::integer<>;
152 maxProtocolIEs INTEGER ::= 65535
155 constexpr int64_t maxProtocolIEs = 65535;
157 ProtocolIE-ID ::= INTEGER (0..maxProtocolIEs)
160 struct ProtocolIE_ID : asn::integer<>
162 using constraint_t = asn::constraints<false,asn::span<0, maxProtocolIEs >>;
163 static constexpr const char* name() {return "ProtocolIE-ID";}
164 using parent_t = asn::integer<>;
169 TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessful-outcome}
172 struct TriggeringMessage : asn::enumerated<3, 0, false>
174 static constexpr const char* name() {return "TriggeringMessage";}
175 using parent_t = asn::enumerated<3, 0, false>;
179 ,unsuccessful_outcome
185 maxProtocolExtensions INTEGER ::= 65535
188 constexpr int64_t maxProtocolExtensions = 65535;