34#ifndef LIBE3_E2SM_DAPP_HPP
35#define LIBE3_E2SM_DAPP_HPP
61template <
class EnumType,
bool Ext = false>
70 enumerated(
typename EnumType::options v) { EnumType::value = v; }
72 operator typename EnumType::options()
const {
return EnumType::value; }
76template <u
int32_t LB, u
int32_t UB,
bool Ext = false,
bool Aligned = true>
88 const std::string&
to_string()
const {
return str_; }
90 size_t size()
const {
return str_.size(); }
92 size_t length()
const {
return str_.size(); }
105template <u
int32_t N,
bool Aligned = true>
114template <u
int32_t LB, u
int32_t UB,
bool Aligned = true>
120template <
bool Aligned = true>
129 assign(data, data + len);
141template <
class T, u
int32_t UB>
163#define LIBE3_E2SM_DAPP_NEQ(T) \
164 bool operator!=(const T& o) const { return !(*this == o); }
201 const char*
to_string()
const {
return "eventTrigger-Format1"; }
208 types type()
const {
return types::event_trigger_format1; }
267 const char*
to_string()
const {
return "actionDefinition-Format1"; }
274 types type()
const {
return types::action_definition_format1; }
489 static const char* names[] = {
"indicationHeader-Format1",
"indicationHeader-Format2"};
503 case types::ind_hdr_format1: c_.emplace<1>();
break;
504 case types::ind_hdr_format2: c_.emplace<2>();
break;
505 default: c_.emplace<0>();
break;
527 set(types::ind_hdr_format1);
528 return std::get<1>(c_);
534 set(types::ind_hdr_format2);
535 return std::get<2>(c_);
545 std::variant<std::monostate, e2sm_dapp_ind_hdr_format1_s, e2sm_dapp_ind_hdr_format2_s> c_;
607 static const char* names[] = {
"indicationMessage-Format1",
"indicationMessage-Format2"};
621 case types::ind_msg_format1: c_.emplace<1>();
break;
622 case types::ind_msg_format2: c_.emplace<2>();
break;
623 default: c_.emplace<0>();
break;
645 set(types::ind_msg_format1);
646 return std::get<1>(c_);
652 set(types::ind_msg_format2);
653 return std::get<2>(c_);
663 std::variant<std::monostate, e2sm_dapp_ind_msg_format1_s, e2sm_dapp_ind_msg_format2_s> c_;
713 const char*
to_string()
const {
return "controlHeader-Format1"; }
781 const char*
to_string()
const {
return "controlMessage-Format1"; }
853 const char*
to_string()
const {
return "controlOutcome-Format1"; }
860 types type()
const {
return types::ctrl_outcome_format1; }
899#undef LIBE3_E2SM_DAPP_NEQ
SEQUENCE OF with an upper bound UB.
OCTET STRING (SIZE(LB..UB)).
SEQUENCE OF with a size constraint known only at pack time.
Mirrors OCUDU's enumerated<Opts, Ext>: derives from the options struct and converts to its enum.
operator typename types_opts::options() const
enumerated(typename EnumType::options v)
enumerated()
Holds nulltype, no alternative.
static const bool has_ext
fixed_octstring()
Zero-filled.
PrintableString (SIZE(LB..UB)).
const std::string & to_string() const
bool operator!=(const printable_string &o) const
bool operator==(const printable_string &o) const
printable_string & from_string(const std::string &s)
OCTET STRING without a size constraint.
unbounded_octstring & from_bytes(const uint8_t *data, size_t len)
#define LIBE3_E2SM_DAPP_NEQ(T)
@ ASN_ERROR_ENCODE_FAIL
a value is outside its ASN.1 constraint, or the buffer cannot be built
@ ASN_ERROR_DECODE_FAIL
the bytes are not a valid APER encoding of the type
constexpr int64_t max_e2sm_dapp_ctrl_msg_size
Largest control message data, in octets.
constexpr int64_t maxnoof_dapp_control_styles
Most control styles in a RAN function definition.
constexpr int64_t max_e2sm_dapp_ind_msg_size
Largest indication message data, in octets.
constexpr int64_t maxnoof_dapps
Most dApps in a dApp E3 subscription list.
constexpr int64_t maxnoof_subscribed_e3_ran_functions
Most E3 RAN functions one dApp can subscribe to.
constexpr int64_t maxnoof_dapp_report_styles
Most report styles in a RAN function definition.
dyn_array< dapp_e3_subscription_item_s > dapp_e3_subscription_list_l
The dApp E3 subscription map, 0 to 256 items (ASN.1 DAppE3Subscription-List ::= SEQUENCE (SIZE (0....
The E3 RAN functions one dApp has subscribed to (ASN.1 DAppE3Subscription-Item ::= SEQUENCE).
bool operator==(const dapp_e3_subscription_item_s &o) const
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
uint64_t dapp_id
The dApp.
subscribed_e3_ran_functions_l_ subscribed_e3_ran_functions
E3 RAN functions the dApp has subscribed to (1 to 64).
bounded_array< uint64_t, 64 > subscribed_e3_ran_functions_l_
List of E3 RAN function ids.
Action definition of a subscription, which selects the report style (ASN.1 E2SM-DAPP-ActionDefinition...
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
action_definition_formats_c_ action_definition_formats
Format of the element, a CHOICE with one alternative per format.
int64_t ric_style_type
Report style the subscription selects (1 or 2); it selects the indication formats.
asn_code unpack(const uint8_t *data, size_t len)
asn_code pack(std::vector< uint8_t > &out) const
bool operator==(const e2sm_dapp_action_definition_s &o) const
Control header (ASN.1 E2SM-DAPP-ControlHeader ::= SEQUENCE (top-level)).
bool operator==(const e2sm_dapp_ctrl_hdr_s &o) const
asn_code pack(std::vector< uint8_t > &out) const
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
asn_code unpack(const uint8_t *data, size_t len)
ric_ctrl_hdr_formats_c_ ric_ctrl_hdr_formats
Format of the element, a CHOICE with one alternative per format.
Control message (ASN.1 E2SM-DAPP-ControlMessage ::= SEQUENCE (top-level)).
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
ric_ctrl_msg_formats_c_ ric_ctrl_msg_formats
Format of the element, a CHOICE with one alternative per format.
asn_code pack(std::vector< uint8_t > &out) const
bool operator==(const e2sm_dapp_ctrl_msg_s &o) const
asn_code unpack(const uint8_t *data, size_t len)
Control outcome (ASN.1 E2SM-DAPP-ControlOutcome ::= SEQUENCE (top-level)).
asn_code pack(std::vector< uint8_t > &out) const
bool operator==(const e2sm_dapp_ctrl_outcome_s &o) const
asn_code unpack(const uint8_t *data, size_t len)
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
ric_ctrl_outcome_formats_c_ ric_ctrl_outcome_formats
Format of the element, a CHOICE with one alternative per format.
Event trigger definition of a subscription (ASN.1 E2SM-DAPP-EventTrigger ::= SEQUENCE (top-level)).
asn_code unpack(const uint8_t *data, size_t len)
asn_code pack(std::vector< uint8_t > &out) const
ric_event_trigger_formats_c_ ric_event_trigger_formats
Format of the element, a CHOICE with one alternative per format.
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
bool operator==(const e2sm_dapp_event_trigger_s &o) const
Indication header (ASN.1 E2SM-DAPP-IndicationHeader ::= SEQUENCE (top-level)).
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
bool operator==(const e2sm_dapp_ind_hdr_s &o) const
asn_code pack(std::vector< uint8_t > &out) const
asn_code unpack(const uint8_t *data, size_t len)
ric_ind_hdr_formats_c_ ric_ind_hdr_formats
Format of the element, a CHOICE with one alternative per format.
Indication message (ASN.1 E2SM-DAPP-IndicationMessage ::= SEQUENCE (top-level)).
bool operator==(const e2sm_dapp_ind_msg_s &o) const
asn_code pack(std::vector< uint8_t > &out) const
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
asn_code unpack(const uint8_t *data, size_t len)
ric_ind_msg_formats_c_ ric_ind_msg_formats
Format of the element, a CHOICE with one alternative per format.
RAN function definition, announced in E2 Setup and RIC Service Update (ASN.1 E2SM-DAPP-RANFunctionDef...
bool operator==(const e2sm_dapp_ran_function_definition_s &o) const
bool ran_function_definition_report_present
true when ran_function_definition_report is present
ran_function_definition_ctrl_s ran_function_definition_ctrl
Control section.
bool ran_function_definition_ctrl_present
true when ran_function_definition_ctrl is present
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
asn_code unpack(const uint8_t *data, size_t len)
ran_function_definition_event_trigger_s ran_function_definition_event_trigger
Event trigger section, empty.
ran_function_name_s ran_function_name
Name of the RAN function.
bool ran_function_definition_event_trigger_present
true when ran_function_definition_event_trigger is present
asn_code pack(std::vector< uint8_t > &out) const
ran_function_definition_report_s ran_function_definition_report
Report section.
One control style of the RAN function definition (ASN.1 RANFunctionDefinition-Control-Item ::= SEQUEN...
bool dapp_e3_subscriptions_present
true when dapp_e3_subscriptions is present
bool operator==(const ran_function_definition_ctrl_item_s &o) const
int64_t ric_ctrl_outcome_format_type
Control outcome format the style uses.
int64_t ric_ctrl_style_type
Control style number (1).
dapp_e3_subscription_list_l dapp_e3_subscriptions
dApp E3 subscription map (0 to 256 items)
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
printable_string< 1, 150, true, true > ric_ctrl_style_name
Control style name, 1 to 150 characters.
int64_t ric_ctrl_hdr_format_type
Control header format the style uses.
int64_t ric_ctrl_msg_format_type
Control message format the style uses.
Control section of the RAN function definition (ASN.1 RANFunctionDefinition-Control ::= SEQUENCE).
ric_ctrl_style_list_l_ ric_ctrl_style_list
Control styles the RAN supports (exactly 1).
bool operator==(const ran_function_definition_ctrl_s &o) const
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
dyn_array< ran_function_definition_ctrl_item_s > ric_ctrl_style_list_l_
List of control styles.
Event trigger section of the RAN function definition: empty, its presence says the function has an ev...
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
bool operator==(const ran_function_definition_event_trigger_s &) const
One report style of the RAN function definition (ASN.1 RANFunctionDefinition-Report-Item ::= SEQUENCE...
int64_t ric_report_style_type
Report style number (1 or 2).
int64_t ric_ind_hdr_format_type
Indication header format the style produces.
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
dapp_e3_subscription_list_l dapp_e3_subscriptions
dApp E3 subscription map (0 to 256 items)
bool operator==(const ran_function_definition_report_item_s &o) const
int64_t ric_ind_msg_format_type
Indication message format the style produces.
bool dapp_e3_subscriptions_present
true when dapp_e3_subscriptions is present
printable_string< 1, 150, true, true > ric_report_style_name
Report style name, 1 to 150 characters.
Report section of the RAN function definition (ASN.1 RANFunctionDefinition-Report ::= SEQUENCE).
bool operator==(const ran_function_definition_report_s &o) const
dyn_array< ran_function_definition_report_item_s > ric_report_style_list_l_
List of report styles.
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
ric_report_style_list_l_ ric_report_style_list
Report styles the RAN supports (1 to 2).
Name, OID and description of the RAN function (ASN.1 RANfunction-Name ::= SEQUENCE).
printable_string< 1, 150, true, true > ran_function_description
Description, 1 to 150 characters.
printable_string< 1, 150, true, true > ran_function_short_name
Short name (E2SM-DAPP), 1 to 150 characters.
int64_t ran_function_instance
Instance number; not used, a sender shall not set it.
bool operator==(const ran_function_name_s &o) const
bool ext
ASN.1 extension marker; ignored by pack, false after unpack.
printable_string< 1, 1000, true, true > ran_function_e2sm_o_id
Service model OID, 1 to 1000 characters.
bool ran_function_instance_present
true when ran_function_instance is present