diff --git a/lib/include/srsran/asn1/e2ap.h b/lib/include/srsran/asn1/e2ap.h new file mode 100644 index 000000000..650a0bc01 --- /dev/null +++ b/lib/include/srsran/asn1/e2ap.h @@ -0,0 +1,4486 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2021 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ + +/******************************************************************************* + * + * 3GPP TS ASN1 E2AP v15.3.0 (2019-03) + * + ******************************************************************************/ + +#ifndef SRSASN1_E2AP_H +#define SRSASN1_E2AP_H + +#include "asn1_utils.h" +#include +#include + +namespace asn1 { +namespace e2ap { + +/******************************************************************************* + * Constant Definitions + ******************************************************************************/ + +#define ASN1_E2AP_ID_E2SETUP 1 +#define ASN1_E2AP_ID_ERROR_IND 2 +#define ASN1_E2AP_ID_RESET 3 +#define ASN1_E2AP_ID_RI_CCTRL 4 +#define ASN1_E2AP_ID_RI_CIND 5 +#define ASN1_E2AP_ID_RICSERVICE_QUERY 6 +#define ASN1_E2AP_ID_RICSERVICE_UPD 7 +#define ASN1_E2AP_ID_RICSUBSCRIPTION 8 +#define ASN1_E2AP_ID_RICSUBSCRIPTION_DELETE 9 +#define ASN1_E2AP_ID_E2NODE_CFG_UPD 10 +#define ASN1_E2AP_ID_E2CONN_UPD 11 +#define ASN1_E2AP_ID_RICSUBSCRIPTION_DELETE_REQUIRED 12 +#define ASN1_E2AP_ID_E2REMOVAL 13 +#define ASN1_E2AP_MAX_PROTOCOL_IES 65535 +#define ASN1_E2AP_MAXNOOF_ERRORS 256 +#define ASN1_E2AP_MAXOF_E2NODE_COMPONENTS 1024 +#define ASN1_E2AP_MAXOF_RA_NFUNCTION_ID 256 +#define ASN1_E2AP_MAXOF_RI_CACTION_ID 16 +#define ASN1_E2AP_MAXOF_TNLA 32 +#define ASN1_E2AP_MAXOF_RI_CREQUEST_ID 1024 +#define ASN1_E2AP_ID_CAUSE 1 +#define ASN1_E2AP_ID_CRIT_DIAGNOSTICS 2 +#define ASN1_E2AP_ID_GLOBAL_E2NODE_ID 3 +#define ASN1_E2AP_ID_GLOBAL_RIC_ID 4 +#define ASN1_E2AP_ID_RA_NFUNCTION_ID 5 +#define ASN1_E2AP_ID_RA_NFUNCTION_ID_ITEM 6 +#define ASN1_E2AP_ID_RA_NFUNCTION_IECAUSE_ITEM 7 +#define ASN1_E2AP_ID_RA_NFUNCTION_ITEM 8 +#define ASN1_E2AP_ID_RA_NFUNCTIONS_ACCEPTED 9 +#define ASN1_E2AP_ID_RA_NFUNCTIONS_ADDED 10 +#define ASN1_E2AP_ID_RA_NFUNCTIONS_DELETED 11 +#define ASN1_E2AP_ID_RA_NFUNCTIONS_MODIFIED 12 +#define ASN1_E2AP_ID_RA_NFUNCTIONS_REJECTED 13 +#define ASN1_E2AP_ID_RI_CACTION_ADMITTED_ITEM 14 +#define ASN1_E2AP_ID_RI_CACTION_ID 15 +#define ASN1_E2AP_ID_RI_CACTION_NOT_ADMITTED_ITEM 16 +#define ASN1_E2AP_ID_RI_CACTIONS_ADMITTED 17 +#define ASN1_E2AP_ID_RI_CACTIONS_NOT_ADMITTED 18 +#define ASN1_E2AP_ID_RI_CACTION_TO_BE_SETUP_ITEM 19 +#define ASN1_E2AP_ID_RI_CCALL_PROCESS_ID 20 +#define ASN1_E2AP_ID_RI_CCTRL_ACK_REQUEST 21 +#define ASN1_E2AP_ID_RI_CCTRL_HDR 22 +#define ASN1_E2AP_ID_RI_CCTRL_MSG 23 +#define ASN1_E2AP_ID_RI_CCTRL_STATUS 24 +#define ASN1_E2AP_ID_RI_CIND_HDR 25 +#define ASN1_E2AP_ID_RI_CIND_MSG 26 +#define ASN1_E2AP_ID_RI_CIND_SN 27 +#define ASN1_E2AP_ID_RI_CIND_TYPE 28 +#define ASN1_E2AP_ID_RI_CREQUEST_ID 29 +#define ASN1_E2AP_ID_RICSUBSCRIPTION_DETAILS 30 +#define ASN1_E2AP_ID_TIME_TO_WAIT 31 +#define ASN1_E2AP_ID_RI_CCTRL_OUTCOME 32 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_UPD 33 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_UPD_ITEM 34 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_UPD_ACK 35 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_UPD_ACK_ITEM 36 +#define ASN1_E2AP_ID_E2CONN_SETUP 39 +#define ASN1_E2AP_ID_E2CONN_SETUP_FAILED 40 +#define ASN1_E2AP_ID_E2CONN_SETUP_FAILED_ITEM 41 +#define ASN1_E2AP_ID_E2CONN_FAILED_ITEM 42 +#define ASN1_E2AP_ID_E2CONN_UPD_ITEM 43 +#define ASN1_E2AP_ID_E2CONN_UPD_ADD 44 +#define ASN1_E2AP_ID_E2CONN_UPD_MODIFY 45 +#define ASN1_E2AP_ID_E2CONN_UPD_REM 46 +#define ASN1_E2AP_ID_E2CONN_UPD_REM_ITEM 47 +#define ASN1_E2AP_ID_TN_LINFO 48 +#define ASN1_E2AP_ID_TRANSACTION_ID 49 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_ADDITION 50 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_ADDITION_ITEM 51 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_ADDITION_ACK 52 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_ADDITION_ACK_ITEM 53 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_REMOVAL 54 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_REMOVAL_ITEM 55 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_REMOVAL_ACK 56 +#define ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_REMOVAL_ACK_ITEM 57 +#define ASN1_E2AP_ID_E2NODE_TN_LASSOC_REMOVAL 58 +#define ASN1_E2AP_ID_E2NODE_TN_LASSOC_REMOVAL_ITEM 59 +#define ASN1_E2AP_ID_RICSUBSCRIPTION_TO_BE_REMD 60 +#define ASN1_E2AP_ID_RICSUBSCRIPTION_WITH_CAUSE_ITEM 61 + +/******************************************************************************* + * Struct Definitions + ******************************************************************************/ + +// CauseE2node ::= ENUMERATED +struct cause_e2node_opts { + enum options { e2node_component_unknown, /*...*/ nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; +}; +typedef enumerated cause_e2node_e; + +// CauseMisc ::= ENUMERATED +struct cause_misc_opts { + enum options { ctrl_processing_overload, hardware_fail, om_intervention, unspecified, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated cause_misc_e; + +// CauseProtocol ::= ENUMERATED +struct cause_protocol_opts { + enum options { + transfer_syntax_error, + abstract_syntax_error_reject, + abstract_syntax_error_ignore_and_notify, + msg_not_compatible_with_receiver_state, + semantic_error, + abstract_syntax_error_falsely_constructed_msg, + unspecified, + // ... + nulltype + } value; + + const char* to_string() const; +}; +typedef enumerated cause_protocol_e; + +// CauseRICrequest ::= ENUMERATED +struct cause_ri_crequest_opts { + enum options { + ran_function_id_invalid, + action_not_supported, + excessive_actions, + duplicate_action, + duplicate_event_trigger, + function_res_limit, + request_id_unknown, + inconsistent_action_subsequent_action_seq, + ctrl_msg_invalid, + ric_call_process_id_invalid, + ctrl_timer_expired, + ctrl_failed_to_execute, + sys_not_ready, + unspecified, + // ... + nulltype + } value; + + const char* to_string() const; +}; +typedef enumerated cause_ri_crequest_e; + +// CauseRICservice ::= ENUMERATED +struct cause_ricservice_opts { + enum options { ran_function_not_supported, excessive_functions, ric_res_limit, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated cause_ricservice_e; + +// CauseTransport ::= ENUMERATED +struct cause_transport_opts { + enum options { unspecified, transport_res_unavailable, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated cause_transport_e; + +// Cause ::= CHOICE +struct cause_c { + struct types_opts { + enum options { ric_request, ric_service, e2_node, transport, protocol, misc, /*...*/ nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + cause_c() = default; + cause_c(const cause_c& other); + cause_c& operator=(const cause_c& other); + ~cause_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + cause_ri_crequest_e& ric_request() + { + assert_choice_type(types::ric_request, type_, "Cause"); + return c.get(); + } + cause_ricservice_e& ric_service() + { + assert_choice_type(types::ric_service, type_, "Cause"); + return c.get(); + } + cause_e2node_e& e2_node() + { + assert_choice_type(types::e2_node, type_, "Cause"); + return c.get(); + } + cause_transport_e& transport() + { + assert_choice_type(types::transport, type_, "Cause"); + return c.get(); + } + cause_protocol_e& protocol() + { + assert_choice_type(types::protocol, type_, "Cause"); + return c.get(); + } + cause_misc_e& misc() + { + assert_choice_type(types::misc, type_, "Cause"); + return c.get(); + } + const cause_ri_crequest_e& ric_request() const + { + assert_choice_type(types::ric_request, type_, "Cause"); + return c.get(); + } + const cause_ricservice_e& ric_service() const + { + assert_choice_type(types::ric_service, type_, "Cause"); + return c.get(); + } + const cause_e2node_e& e2_node() const + { + assert_choice_type(types::e2_node, type_, "Cause"); + return c.get(); + } + const cause_transport_e& transport() const + { + assert_choice_type(types::transport, type_, "Cause"); + return c.get(); + } + const cause_protocol_e& protocol() const + { + assert_choice_type(types::protocol, type_, "Cause"); + return c.get(); + } + const cause_misc_e& misc() const + { + assert_choice_type(types::misc, type_, "Cause"); + return c.get(); + } + cause_ri_crequest_e& set_ric_request(); + cause_ricservice_e& set_ric_service(); + cause_e2node_e& set_e2_node(); + cause_transport_e& set_transport(); + cause_protocol_e& set_protocol(); + cause_misc_e& set_misc(); + +private: + types type_; + pod_choice_buffer_t c; + + void destroy_(); +}; + +// TypeOfError ::= ENUMERATED +struct type_of_error_opts { + enum options { not_understood, missing, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated type_of_error_e; + +// CriticalityDiagnostics-IE-Item ::= SEQUENCE +struct crit_diagnostics_ie_item_s { + bool ext = false; + crit_e iecrit; + uint32_t ie_id = 0; + type_of_error_e type_of_error; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// CriticalityDiagnostics-IE-List ::= SEQUENCE (SIZE (1..256)) OF CriticalityDiagnostics-IE-Item +using crit_diagnostics_ie_list_l = dyn_array; + +// RICrequestID ::= SEQUENCE +struct ri_crequest_id_s { + bool ext = false; + uint32_t ric_requestor_id = 0; + uint32_t ric_instance_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// TriggeringMessage ::= ENUMERATED +struct trigger_msg_opts { + enum options { init_msg, successful_outcome, unsuccessfull_outcome, nulltype } value; + + const char* to_string() const; +}; +typedef enumerated trigger_msg_e; + +// CriticalityDiagnostics ::= SEQUENCE +struct crit_diagnostics_s { + bool ext = false; + bool proc_code_present = false; + bool trigger_msg_present = false; + bool proc_crit_present = false; + bool ric_requestor_id_present = false; + uint16_t proc_code = 0; + trigger_msg_e trigger_msg; + crit_e proc_crit; + ri_crequest_id_s ric_requestor_id; + crit_diagnostics_ie_list_l ies_crit_diagnostics; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// ENB-ID-Choice ::= CHOICE +struct enb_id_choice_c { + struct types_opts { + enum options { enb_id_macro, enb_id_shortmacro, enb_id_longmacro, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + enb_id_choice_c() = default; + enb_id_choice_c(const enb_id_choice_c& other); + enb_id_choice_c& operator=(const enb_id_choice_c& other); + ~enb_id_choice_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + fixed_bitstring<20, false, true>& enb_id_macro() + { + assert_choice_type(types::enb_id_macro, type_, "ENB-ID-Choice"); + return c.get >(); + } + fixed_bitstring<18, false, true>& enb_id_shortmacro() + { + assert_choice_type(types::enb_id_shortmacro, type_, "ENB-ID-Choice"); + return c.get >(); + } + fixed_bitstring<21, false, true>& enb_id_longmacro() + { + assert_choice_type(types::enb_id_longmacro, type_, "ENB-ID-Choice"); + return c.get >(); + } + const fixed_bitstring<20, false, true>& enb_id_macro() const + { + assert_choice_type(types::enb_id_macro, type_, "ENB-ID-Choice"); + return c.get >(); + } + const fixed_bitstring<18, false, true>& enb_id_shortmacro() const + { + assert_choice_type(types::enb_id_shortmacro, type_, "ENB-ID-Choice"); + return c.get >(); + } + const fixed_bitstring<21, false, true>& enb_id_longmacro() const + { + assert_choice_type(types::enb_id_longmacro, type_, "ENB-ID-Choice"); + return c.get >(); + } + fixed_bitstring<20, false, true>& set_enb_id_macro(); + fixed_bitstring<18, false, true>& set_enb_id_shortmacro(); + fixed_bitstring<21, false, true>& set_enb_id_longmacro(); + +private: + types type_; + choice_buffer_t > c; + + void destroy_(); +}; + +// GNB-ID-Choice ::= CHOICE +struct gnb_id_choice_c { + struct types_opts { + enum options { gnb_id, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::gnb_id; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + bounded_bitstring<22, 32, false, true>& gnb_id() { return c; } + const bounded_bitstring<22, 32, false, true>& gnb_id() const { return c; } + +private: + bounded_bitstring<22, 32, false, true> c; +}; + +// ENB-ID ::= CHOICE +struct enb_id_c { + struct types_opts { + enum options { macro_enb_id, home_enb_id, /*...*/ short_macro_enb_id, long_macro_enb_id, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + enb_id_c() = default; + enb_id_c(const enb_id_c& other); + enb_id_c& operator=(const enb_id_c& other); + ~enb_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + fixed_bitstring<20, false, true>& macro_enb_id() + { + assert_choice_type(types::macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + fixed_bitstring<28, false, true>& home_enb_id() + { + assert_choice_type(types::home_enb_id, type_, "ENB-ID"); + return c.get >(); + } + fixed_bitstring<18, false, true>& short_macro_enb_id() + { + assert_choice_type(types::short_macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + fixed_bitstring<21, false, true>& long_macro_enb_id() + { + assert_choice_type(types::long_macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + const fixed_bitstring<20, false, true>& macro_enb_id() const + { + assert_choice_type(types::macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + const fixed_bitstring<28, false, true>& home_enb_id() const + { + assert_choice_type(types::home_enb_id, type_, "ENB-ID"); + return c.get >(); + } + const fixed_bitstring<18, false, true>& short_macro_enb_id() const + { + assert_choice_type(types::short_macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + const fixed_bitstring<21, false, true>& long_macro_enb_id() const + { + assert_choice_type(types::long_macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + fixed_bitstring<20, false, true>& set_macro_enb_id(); + fixed_bitstring<28, false, true>& set_home_enb_id(); + fixed_bitstring<18, false, true>& set_short_macro_enb_id(); + fixed_bitstring<21, false, true>& set_long_macro_enb_id(); + +private: + types type_; + choice_buffer_t > c; + + void destroy_(); +}; + +// ENGNB-ID ::= CHOICE +struct engnb_id_c { + struct types_opts { + enum options { gnb_id, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::gnb_id; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + bounded_bitstring<22, 32, false, true>& gnb_id() { return c; } + const bounded_bitstring<22, 32, false, true>& gnb_id() const { return c; } + +private: + bounded_bitstring<22, 32, false, true> c; +}; + +// GlobalgNB-ID ::= SEQUENCE +struct globalg_nb_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + gnb_id_choice_c gnb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GlobalngeNB-ID ::= SEQUENCE +struct globalngenb_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + enb_id_choice_c enb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GlobalENB-ID ::= SEQUENCE +struct global_enb_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + enb_id_c enb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GlobalNG-RANNode-ID ::= CHOICE +struct global_ng_ran_node_id_c { + struct types_opts { + enum options { gnb, ng_enb, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + global_ng_ran_node_id_c() = default; + global_ng_ran_node_id_c(const global_ng_ran_node_id_c& other); + global_ng_ran_node_id_c& operator=(const global_ng_ran_node_id_c& other); + ~global_ng_ran_node_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + globalg_nb_id_s& gnb() + { + assert_choice_type(types::gnb, type_, "GlobalNG-RANNode-ID"); + return c.get(); + } + globalngenb_id_s& ng_enb() + { + assert_choice_type(types::ng_enb, type_, "GlobalNG-RANNode-ID"); + return c.get(); + } + const globalg_nb_id_s& gnb() const + { + assert_choice_type(types::gnb, type_, "GlobalNG-RANNode-ID"); + return c.get(); + } + const globalngenb_id_s& ng_enb() const + { + assert_choice_type(types::ng_enb, type_, "GlobalNG-RANNode-ID"); + return c.get(); + } + globalg_nb_id_s& set_gnb(); + globalngenb_id_s& set_ng_enb(); + +private: + types type_; + choice_buffer_t c; + + void destroy_(); +}; + +// GlobalenGNB-ID ::= SEQUENCE +struct globalen_gnb_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + engnb_id_c gnb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICsubsequentActionType ::= ENUMERATED +struct ricsubsequent_action_type_opts { + enum options { continuee, wait, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated ricsubsequent_action_type_e; + +// RICtimeToWait ::= ENUMERATED +struct ri_ctime_to_wait_opts { + enum options { + w1ms, + w2ms, + w5ms, + w10ms, + w20ms, + w30ms, + w40ms, + w50ms, + w100ms, + w200ms, + w500ms, + w1s, + w2s, + w5s, + w10s, + w20s, + w60s, + // ... + nulltype + } value; + + const char* to_string() const; +}; +typedef enumerated ri_ctime_to_wait_e; + +// E2nodeComponentInterfaceE1 ::= SEQUENCE +struct e2node_component_interface_e1_s { + bool ext = false; + uint64_t gnb_cu_cp_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentInterfaceF1 ::= SEQUENCE +struct e2node_component_interface_f1_s { + bool ext = false; + uint64_t gnb_du_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentInterfaceNG ::= SEQUENCE +struct e2node_component_interface_ng_s { + bool ext = false; + printable_string<1, 150, true, true> amf_name; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentInterfaceS1 ::= SEQUENCE +struct e2node_component_interface_s1_s { + bool ext = false; + printable_string<1, 150, true, true> mme_name; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentInterfaceW1 ::= SEQUENCE +struct e2node_component_interface_w1_s { + bool ext = false; + uint64_t ng_enb_du_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentInterfaceX2 ::= SEQUENCE +struct e2node_component_interface_x2_s { + bool ext = false; + bool global_enb_id_present = false; + bool global_en_g_nb_id_present = false; + global_enb_id_s global_enb_id; + globalen_gnb_id_s global_en_g_nb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentInterfaceXn ::= SEQUENCE +struct e2node_component_interface_xn_s { + bool ext = false; + global_ng_ran_node_id_c global_ng_ran_node_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICactionType ::= ENUMERATED +struct ri_caction_type_opts { + enum options { report, insert, policy, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated ri_caction_type_e; + +// RICsubsequentAction ::= SEQUENCE +struct ricsubsequent_action_s { + bool ext = false; + ricsubsequent_action_type_e ric_subsequent_action_type; + ri_ctime_to_wait_e ric_time_to_wait; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentConfiguration ::= SEQUENCE +struct e2node_component_cfg_s { + bool ext = false; + unbounded_octstring e2node_component_request_part; + unbounded_octstring e2node_component_resp_part; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentConfigurationAck ::= SEQUENCE +struct e2node_component_cfg_ack_s { + struct upd_outcome_opts { + enum options { success, fail, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated upd_outcome_e_; + + // member variables + bool ext = false; + bool fail_cause_present = false; + upd_outcome_e_ upd_outcome; + cause_c fail_cause; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentID ::= CHOICE +struct e2node_component_id_c { + struct types_opts { + enum options { + e2node_component_interface_type_ng, + e2node_component_interface_type_xn, + e2node_component_interface_type_e1, + e2node_component_interface_type_f1, + e2node_component_interface_type_w1, + e2node_component_interface_type_s1, + e2node_component_interface_type_x2, + // ... + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + e2node_component_id_c() = default; + e2node_component_id_c(const e2node_component_id_c& other); + e2node_component_id_c& operator=(const e2node_component_id_c& other); + ~e2node_component_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2node_component_interface_ng_s& e2node_component_interface_type_ng() + { + assert_choice_type(types::e2node_component_interface_type_ng, type_, "E2nodeComponentID"); + return c.get(); + } + e2node_component_interface_xn_s& e2node_component_interface_type_xn() + { + assert_choice_type(types::e2node_component_interface_type_xn, type_, "E2nodeComponentID"); + return c.get(); + } + e2node_component_interface_e1_s& e2node_component_interface_type_e1() + { + assert_choice_type(types::e2node_component_interface_type_e1, type_, "E2nodeComponentID"); + return c.get(); + } + e2node_component_interface_f1_s& e2node_component_interface_type_f1() + { + assert_choice_type(types::e2node_component_interface_type_f1, type_, "E2nodeComponentID"); + return c.get(); + } + e2node_component_interface_w1_s& e2node_component_interface_type_w1() + { + assert_choice_type(types::e2node_component_interface_type_w1, type_, "E2nodeComponentID"); + return c.get(); + } + e2node_component_interface_s1_s& e2node_component_interface_type_s1() + { + assert_choice_type(types::e2node_component_interface_type_s1, type_, "E2nodeComponentID"); + return c.get(); + } + e2node_component_interface_x2_s& e2node_component_interface_type_x2() + { + assert_choice_type(types::e2node_component_interface_type_x2, type_, "E2nodeComponentID"); + return c.get(); + } + const e2node_component_interface_ng_s& e2node_component_interface_type_ng() const + { + assert_choice_type(types::e2node_component_interface_type_ng, type_, "E2nodeComponentID"); + return c.get(); + } + const e2node_component_interface_xn_s& e2node_component_interface_type_xn() const + { + assert_choice_type(types::e2node_component_interface_type_xn, type_, "E2nodeComponentID"); + return c.get(); + } + const e2node_component_interface_e1_s& e2node_component_interface_type_e1() const + { + assert_choice_type(types::e2node_component_interface_type_e1, type_, "E2nodeComponentID"); + return c.get(); + } + const e2node_component_interface_f1_s& e2node_component_interface_type_f1() const + { + assert_choice_type(types::e2node_component_interface_type_f1, type_, "E2nodeComponentID"); + return c.get(); + } + const e2node_component_interface_w1_s& e2node_component_interface_type_w1() const + { + assert_choice_type(types::e2node_component_interface_type_w1, type_, "E2nodeComponentID"); + return c.get(); + } + const e2node_component_interface_s1_s& e2node_component_interface_type_s1() const + { + assert_choice_type(types::e2node_component_interface_type_s1, type_, "E2nodeComponentID"); + return c.get(); + } + const e2node_component_interface_x2_s& e2node_component_interface_type_x2() const + { + assert_choice_type(types::e2node_component_interface_type_x2, type_, "E2nodeComponentID"); + return c.get(); + } + e2node_component_interface_ng_s& set_e2node_component_interface_type_ng(); + e2node_component_interface_xn_s& set_e2node_component_interface_type_xn(); + e2node_component_interface_e1_s& set_e2node_component_interface_type_e1(); + e2node_component_interface_f1_s& set_e2node_component_interface_type_f1(); + e2node_component_interface_w1_s& set_e2node_component_interface_type_w1(); + e2node_component_interface_s1_s& set_e2node_component_interface_type_s1(); + e2node_component_interface_x2_s& set_e2node_component_interface_type_x2(); + +private: + types type_; + choice_buffer_t + c; + + void destroy_(); +}; + +// E2nodeComponentInterfaceType ::= ENUMERATED +struct e2node_component_interface_type_opts { + enum options { ng, xn, e1, f1, w1, s1, x2, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated e2node_component_interface_type_e; + +// RICaction-ToBeSetup-Item ::= SEQUENCE +struct ri_caction_to_be_setup_item_s { + bool ext = false; + bool ric_subsequent_action_present = false; + uint16_t ric_action_id = 0; + ri_caction_type_e ric_action_type; + unbounded_octstring ric_action_definition; + ricsubsequent_action_s ric_subsequent_action; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// TNLinformation ::= SEQUENCE +struct tn_linfo_s { + bool ext = false; + bool tnl_port_present = false; + bounded_bitstring<1, 160, true, true> tnl_address; + fixed_bitstring<16, false, true> tnl_port; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// TNLusage ::= ENUMERATED +struct tn_lusage_opts { + enum options { ric_service, support_function, both, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated tn_lusage_e; + +// E2connectionSetupFailed-Item ::= SEQUENCE +struct e2conn_setup_failed_item_s { + bool ext = false; + tn_linfo_s tnl_info; + cause_c cause; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2connectionUpdate-Item ::= SEQUENCE +struct e2conn_upd_item_s { + bool ext = false; + tn_linfo_s tnl_info; + tn_lusage_e tnl_usage; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2connectionUpdateRemove-Item ::= SEQUENCE +struct e2conn_upd_rem_item_s { + bool ext = false; + tn_linfo_s tnl_info; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentConfigAddition-Item ::= SEQUENCE +struct e2node_component_cfg_addition_item_s { + bool ext = false; + e2node_component_interface_type_e e2node_component_interface_type; + e2node_component_id_c e2node_component_id; + e2node_component_cfg_s e2node_component_cfg; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentConfigAdditionAck-Item ::= SEQUENCE +struct e2node_component_cfg_addition_ack_item_s { + bool ext = false; + e2node_component_interface_type_e e2node_component_interface_type; + e2node_component_id_c e2node_component_id; + e2node_component_cfg_ack_s e2node_component_cfg_ack; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentConfigRemoval-Item ::= SEQUENCE +struct e2node_component_cfg_removal_item_s { + bool ext = false; + e2node_component_interface_type_e e2node_component_interface_type; + e2node_component_id_c e2node_component_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentConfigRemovalAck-Item ::= SEQUENCE +struct e2node_component_cfg_removal_ack_item_s { + bool ext = false; + e2node_component_interface_type_e e2node_component_interface_type; + e2node_component_id_c e2node_component_id; + e2node_component_cfg_ack_s e2node_component_cfg_ack; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentConfigUpdate-Item ::= SEQUENCE +struct e2node_component_cfg_upd_item_s { + bool ext = false; + e2node_component_interface_type_e e2node_component_interface_type; + e2node_component_id_c e2node_component_id; + e2node_component_cfg_s e2node_component_cfg; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeComponentConfigUpdateAck-Item ::= SEQUENCE +struct e2node_component_cfg_upd_ack_item_s { + bool ext = false; + e2node_component_interface_type_e e2node_component_interface_type; + e2node_component_id_c e2node_component_id; + e2node_component_cfg_ack_s e2node_component_cfg_ack; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeTNLassociationRemoval-Item ::= SEQUENCE +struct e2node_tn_lassoc_removal_item_s { + bool ext = false; + tn_linfo_s tnl_info; + tn_linfo_s tnl_info_ric; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RANfunction-Item ::= SEQUENCE +struct ra_nfunction_item_s { + bool ext = false; + uint16_t ran_function_id = 0; + unbounded_octstring ran_function_definition; + uint16_t ran_function_revision = 0; + printable_string<1, 1000, true, true> ran_function_oid; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RANfunctionID-Item ::= SEQUENCE +struct ra_nfunction_id_item_s { + bool ext = false; + uint16_t ran_function_id = 0; + uint16_t ran_function_revision = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RANfunctionIDcause-Item ::= SEQUENCE +struct ra_nfunction_idcause_item_s { + bool ext = false; + uint16_t ran_function_id = 0; + cause_c cause; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICaction-Admitted-Item ::= SEQUENCE +struct ri_caction_admitted_item_s { + bool ext = false; + uint16_t ric_action_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICaction-NotAdmitted-Item ::= SEQUENCE +struct ri_caction_not_admitted_item_s { + bool ext = false; + uint16_t ric_action_id = 0; + cause_c cause; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICaction-ToBeSetup-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ri_caction_to_be_setup_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_caction_to_be_setup_item, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::ri_caction_to_be_setup_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_caction_to_be_setup_item_s& ri_caction_to_be_setup_item() { return c; } + const ri_caction_to_be_setup_item_s& ri_caction_to_be_setup_item() const { return c; } + + private: + ri_caction_to_be_setup_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICsubscription-withCause-Item ::= SEQUENCE +struct ricsubscription_with_cause_item_s { + bool ext = false; + ri_crequest_id_s ric_request_id; + uint16_t ran_function_id = 0; + cause_c cause; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2connectionSetupFailed-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2conn_setup_failed_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2conn_setup_failed_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2conn_setup_failed_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2conn_setup_failed_item_s& e2conn_setup_failed_item() { return c; } + const e2conn_setup_failed_item_s& e2conn_setup_failed_item() const { return c; } + + private: + e2conn_setup_failed_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2connectionUpdate-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2conn_upd_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2conn_upd_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2conn_upd_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2conn_upd_item_s& e2conn_upd_item() { return c; } + const e2conn_upd_item_s& e2conn_upd_item() const { return c; } + + private: + e2conn_upd_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2connectionUpdateRemove-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2conn_upd_rem_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2conn_upd_rem_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2conn_upd_rem_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2conn_upd_rem_item_s& e2conn_upd_rem_item() { return c; } + const e2conn_upd_rem_item_s& e2conn_upd_rem_item() const { return c; } + + private: + e2conn_upd_rem_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeComponentConfigAddition-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_component_cfg_addition_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2node_component_cfg_addition_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2node_component_cfg_addition_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2node_component_cfg_addition_item_s& e2node_component_cfg_addition_item() { return c; } + const e2node_component_cfg_addition_item_s& e2node_component_cfg_addition_item() const { return c; } + + private: + e2node_component_cfg_addition_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeComponentConfigAdditionAck-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_component_cfg_addition_ack_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2node_component_cfg_addition_ack_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2node_component_cfg_addition_ack_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2node_component_cfg_addition_ack_item_s& e2node_component_cfg_addition_ack_item() { return c; } + const e2node_component_cfg_addition_ack_item_s& e2node_component_cfg_addition_ack_item() const { return c; } + + private: + e2node_component_cfg_addition_ack_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeComponentConfigRemoval-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_component_cfg_removal_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2node_component_cfg_removal_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2node_component_cfg_removal_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2node_component_cfg_removal_item_s& e2node_component_cfg_removal_item() { return c; } + const e2node_component_cfg_removal_item_s& e2node_component_cfg_removal_item() const { return c; } + + private: + e2node_component_cfg_removal_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeComponentConfigRemovalAck-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_component_cfg_removal_ack_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2node_component_cfg_removal_ack_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2node_component_cfg_removal_ack_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2node_component_cfg_removal_ack_item_s& e2node_component_cfg_removal_ack_item() { return c; } + const e2node_component_cfg_removal_ack_item_s& e2node_component_cfg_removal_ack_item() const { return c; } + + private: + e2node_component_cfg_removal_ack_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeComponentConfigUpdate-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_component_cfg_upd_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2node_component_cfg_upd_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2node_component_cfg_upd_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2node_component_cfg_upd_item_s& e2node_component_cfg_upd_item() { return c; } + const e2node_component_cfg_upd_item_s& e2node_component_cfg_upd_item() const { return c; } + + private: + e2node_component_cfg_upd_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeComponentConfigUpdateAck-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_component_cfg_upd_ack_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2node_component_cfg_upd_ack_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2node_component_cfg_upd_ack_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2node_component_cfg_upd_ack_item_s& e2node_component_cfg_upd_ack_item() { return c; } + const e2node_component_cfg_upd_ack_item_s& e2node_component_cfg_upd_ack_item() const { return c; } + + private: + e2node_component_cfg_upd_ack_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeTNLassociationRemoval-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_tn_lassoc_removal_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { e2node_tn_lassoc_removal_item, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::e2node_tn_lassoc_removal_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + e2node_tn_lassoc_removal_item_s& e2node_tn_lassoc_removal_item() { return c; } + const e2node_tn_lassoc_removal_item_s& e2node_tn_lassoc_removal_item() const { return c; } + + private: + e2node_tn_lassoc_removal_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// GlobalE2node-eNB-ID ::= SEQUENCE +struct global_e2node_enb_id_s { + bool ext = false; + global_enb_id_s global_enb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GlobalE2node-en-gNB-ID ::= SEQUENCE +struct global_e2node_en_g_nb_id_s { + bool ext = false; + bool en_g_nb_cu_up_id_present = false; + bool en_g_nb_du_id_present = false; + globalen_gnb_id_s global_en_g_nb_id; + uint64_t en_g_nb_cu_up_id = 0; + uint64_t en_g_nb_du_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GlobalE2node-gNB-ID ::= SEQUENCE +struct global_e2node_g_nb_id_s { + bool ext = false; + bool global_en_g_nb_id_present = false; + bool gnb_cu_up_id_present = false; + bool gnb_du_id_present = false; + globalg_nb_id_s global_g_nb_id; + globalen_gnb_id_s global_en_g_nb_id; + uint64_t gnb_cu_up_id = 0; + uint64_t gnb_du_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GlobalE2node-ng-eNB-ID ::= SEQUENCE +struct global_e2node_ng_enb_id_s { + bool ext = false; + bool global_enb_id_present = false; + bool ng_enb_du_id_present = false; + globalngenb_id_s global_ng_enb_id; + global_enb_id_s global_enb_id; + uint64_t ng_enb_du_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RANfunction-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ra_nfunction_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ra_nfunction_item, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::ra_nfunction_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ra_nfunction_item_s& ra_nfunction_item() { return c; } + const ra_nfunction_item_s& ra_nfunction_item() const { return c; } + + private: + ra_nfunction_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RANfunctionID-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ra_nfunction_id_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ra_nfunction_id_item, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::ra_nfunction_id_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ra_nfunction_id_item_s& ra_nfunction_id_item() { return c; } + const ra_nfunction_id_item_s& ra_nfunction_id_item() const { return c; } + + private: + ra_nfunction_id_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RANfunctionIDcause-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ra_nfunction_idcause_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ra_nfunction_iecause_item, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::ra_nfunction_iecause_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ra_nfunction_idcause_item_s& ra_nfunction_iecause_item() { return c; } + const ra_nfunction_idcause_item_s& ra_nfunction_iecause_item() const { return c; } + + private: + ra_nfunction_idcause_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICaction-Admitted-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ri_caction_admitted_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_caction_admitted_item, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::ri_caction_admitted_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_caction_admitted_item_s& ri_caction_admitted_item() { return c; } + const ri_caction_admitted_item_s& ri_caction_admitted_item() const { return c; } + + private: + ri_caction_admitted_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICaction-NotAdmitted-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ri_caction_not_admitted_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_caction_not_admitted_item, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::ri_caction_not_admitted_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_caction_not_admitted_item_s& ri_caction_not_admitted_item() { return c; } + const ri_caction_not_admitted_item_s& ri_caction_not_admitted_item() const { return c; } + + private: + ri_caction_not_admitted_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICactions-ToBeSetup-List ::= SEQUENCE (SIZE (1..16)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : IEsSetParam} +using ri_cactions_to_be_setup_list_l = + bounded_array, 16>; + +// RICsubscription-withCause-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricsubscription_with_cause_item_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ricsubscription_with_cause_item, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::ricsubscription_with_cause_item; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ricsubscription_with_cause_item_s& ricsubscription_with_cause_item() { return c; } + const ricsubscription_with_cause_item_s& ricsubscription_with_cause_item() const { return c; } + + private: + ricsubscription_with_cause_item_s c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2connectionSetupFailed-List ::= SEQUENCE (SIZE (1..32)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2conn_setup_failed_list_l = bounded_array, 32>; + +// E2connectionUpdate-List ::= SEQUENCE (SIZE (1..32)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : IEsSetParam} +using e2conn_upd_list_l = bounded_array, 32>; + +// E2connectionUpdateRemove-List ::= SEQUENCE (SIZE (1..32)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2conn_upd_rem_list_l = bounded_array, 32>; + +// E2nodeComponentConfigAddition-List ::= SEQUENCE (SIZE (1..1024)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2node_component_cfg_addition_list_l = + dyn_array >; + +// E2nodeComponentConfigAdditionAck-List ::= SEQUENCE (SIZE (1..1024)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2node_component_cfg_addition_ack_list_l = + dyn_array >; + +// E2nodeComponentConfigRemoval-List ::= SEQUENCE (SIZE (1..1024)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2node_component_cfg_removal_list_l = + dyn_array >; + +// E2nodeComponentConfigRemovalAck-List ::= SEQUENCE (SIZE (1..1024)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2node_component_cfg_removal_ack_list_l = + dyn_array >; + +// E2nodeComponentConfigUpdate-List ::= SEQUENCE (SIZE (1..1024)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2node_component_cfg_upd_list_l = dyn_array >; + +// E2nodeComponentConfigUpdateAck-List ::= SEQUENCE (SIZE (1..1024)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2node_component_cfg_upd_ack_list_l = + dyn_array >; + +// E2nodeTNLassociationRemoval-List ::= SEQUENCE (SIZE (1..32)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using e2node_tn_lassoc_removal_list_l = + bounded_array, 32>; + +// GlobalE2node-ID ::= CHOICE +struct global_e2node_id_c { + struct types_opts { + enum options { gnb, en_g_nb, ng_enb, enb, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + global_e2node_id_c() = default; + global_e2node_id_c(const global_e2node_id_c& other); + global_e2node_id_c& operator=(const global_e2node_id_c& other); + ~global_e2node_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + global_e2node_g_nb_id_s& gnb() + { + assert_choice_type(types::gnb, type_, "GlobalE2node-ID"); + return c.get(); + } + global_e2node_en_g_nb_id_s& en_g_nb() + { + assert_choice_type(types::en_g_nb, type_, "GlobalE2node-ID"); + return c.get(); + } + global_e2node_ng_enb_id_s& ng_enb() + { + assert_choice_type(types::ng_enb, type_, "GlobalE2node-ID"); + return c.get(); + } + global_e2node_enb_id_s& enb() + { + assert_choice_type(types::enb, type_, "GlobalE2node-ID"); + return c.get(); + } + const global_e2node_g_nb_id_s& gnb() const + { + assert_choice_type(types::gnb, type_, "GlobalE2node-ID"); + return c.get(); + } + const global_e2node_en_g_nb_id_s& en_g_nb() const + { + assert_choice_type(types::en_g_nb, type_, "GlobalE2node-ID"); + return c.get(); + } + const global_e2node_ng_enb_id_s& ng_enb() const + { + assert_choice_type(types::ng_enb, type_, "GlobalE2node-ID"); + return c.get(); + } + const global_e2node_enb_id_s& enb() const + { + assert_choice_type(types::enb, type_, "GlobalE2node-ID"); + return c.get(); + } + global_e2node_g_nb_id_s& set_gnb(); + global_e2node_en_g_nb_id_s& set_en_g_nb(); + global_e2node_ng_enb_id_s& set_ng_enb(); + global_e2node_enb_id_s& set_enb(); + +private: + types type_; + choice_buffer_t + c; + + void destroy_(); +}; + +// GlobalRIC-ID ::= SEQUENCE +struct global_ric_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + fixed_bitstring<20, false, true> ric_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RANfunctions-List ::= SEQUENCE (SIZE (1..256)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : IEsSetParam} +using ra_nfunctions_list_l = dyn_array >; + +// RANfunctionsID-List ::= SEQUENCE (SIZE (1..256)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : IEsSetParam} +using ra_nfunctions_id_list_l = dyn_array >; + +// RANfunctionsIDcause-List ::= SEQUENCE (SIZE (1..256)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : IEsSetParam} +using ra_nfunctions_idcause_list_l = dyn_array >; + +// RICaction-Admitted-List ::= SEQUENCE (SIZE (1..16)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : IEsSetParam} +using ri_caction_admitted_list_l = bounded_array, 16>; + +// RICaction-NotAdmitted-List ::= SEQUENCE (SIZE (0..16)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : IEsSetParam} +using ri_caction_not_admitted_list_l = + bounded_array, 16>; + +// RICcontrolAckRequest ::= ENUMERATED +struct ri_cctrl_ack_request_opts { + enum options { no_ack, ack, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated ri_cctrl_ack_request_e; + +// RICindicationType ::= ENUMERATED +struct ri_cind_type_opts { + enum options { report, insert, /*...*/ nulltype } value; + + const char* to_string() const; +}; +typedef enumerated ri_cind_type_e; + +// RICsubscription-List-withCause ::= SEQUENCE (SIZE (1..1024)) OF ProtocolIE-SingleContainer{E2AP-PROTOCOL-IES : +// IEsSetParam} +using ricsubscription_list_with_cause_l = + dyn_array >; + +// RICsubscriptionDetails ::= SEQUENCE +struct ricsubscription_details_s { + bool ext = false; + unbounded_octstring ric_event_trigger_definition; + ri_cactions_to_be_setup_list_l ric_action_to_be_setup_list; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// TimeToWait ::= ENUMERATED +struct time_to_wait_opts { + enum options { v1s, v2s, v5s, v10s, v20s, v60s, /*...*/ nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; +}; +typedef enumerated time_to_wait_e; + +// E2RemovalFailureIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2_removal_fail_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, cause, crit_diagnostics, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + cause_c& cause(); + crit_diagnostics_s& crit_diagnostics(); + const uint16_t& transaction_id() const; + const cause_c& cause() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2RemovalRequestIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2_removal_request_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::transaction_id; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id() { return c; } + const uint16_t& transaction_id() const { return c; } + + private: + uint16_t c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2RemovalResponseIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2_removal_resp_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, crit_diagnostics, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + crit_diagnostics_s& crit_diagnostics(); + const uint16_t& transaction_id() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2connectionUpdate-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2conn_upd_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, e2conn_upd_add, e2conn_upd_rem, e2conn_upd_modify, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + e2conn_upd_list_l& e2conn_upd_add(); + e2conn_upd_rem_list_l& e2conn_upd_rem(); + e2conn_upd_list_l& e2conn_upd_modify(); + const uint16_t& transaction_id() const; + const e2conn_upd_list_l& e2conn_upd_add() const; + const e2conn_upd_rem_list_l& e2conn_upd_rem() const; + const e2conn_upd_list_l& e2conn_upd_modify() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2connectionUpdateAck-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2conn_upd_ack_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, e2conn_setup, e2conn_setup_failed, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + e2conn_upd_list_l& e2conn_setup(); + e2conn_setup_failed_list_l& e2conn_setup_failed(); + const uint16_t& transaction_id() const; + const e2conn_upd_list_l& e2conn_setup() const; + const e2conn_setup_failed_list_l& e2conn_setup_failed() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2connectionUpdateFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2conn_upd_fail_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, cause, time_to_wait, crit_diagnostics, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + cause_c& cause(); + time_to_wait_e& time_to_wait(); + crit_diagnostics_s& crit_diagnostics(); + const uint16_t& transaction_id() const; + const cause_c& cause() const; + const time_to_wait_e& time_to_wait() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeConfigurationUpdate-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_cfg_upd_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { + transaction_id, + global_e2node_id, + e2node_component_cfg_addition, + e2node_component_cfg_upd, + e2node_component_cfg_removal, + e2node_tn_lassoc_removal, + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + global_e2node_id_c& global_e2node_id(); + e2node_component_cfg_addition_list_l& e2node_component_cfg_addition(); + e2node_component_cfg_upd_list_l& e2node_component_cfg_upd(); + e2node_component_cfg_removal_list_l& e2node_component_cfg_removal(); + e2node_tn_lassoc_removal_list_l& e2node_tn_lassoc_removal(); + const uint16_t& transaction_id() const; + const global_e2node_id_c& global_e2node_id() const; + const e2node_component_cfg_addition_list_l& e2node_component_cfg_addition() const; + const e2node_component_cfg_upd_list_l& e2node_component_cfg_upd() const; + const e2node_component_cfg_removal_list_l& e2node_component_cfg_removal() const; + const e2node_tn_lassoc_removal_list_l& e2node_tn_lassoc_removal() const; + + private: + types type_; + choice_buffer_t + c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeConfigurationUpdateAcknowledge-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_cfg_upd_ack_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { + transaction_id, + e2node_component_cfg_addition_ack, + e2node_component_cfg_upd_ack, + e2node_component_cfg_removal_ack, + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + e2node_component_cfg_addition_ack_list_l& e2node_component_cfg_addition_ack(); + e2node_component_cfg_upd_ack_list_l& e2node_component_cfg_upd_ack(); + e2node_component_cfg_removal_ack_list_l& e2node_component_cfg_removal_ack(); + const uint16_t& transaction_id() const; + const e2node_component_cfg_addition_ack_list_l& e2node_component_cfg_addition_ack() const; + const e2node_component_cfg_upd_ack_list_l& e2node_component_cfg_upd_ack() const; + const e2node_component_cfg_removal_ack_list_l& e2node_component_cfg_removal_ack() const; + + private: + types type_; + choice_buffer_t + c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2nodeConfigurationUpdateFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2node_cfg_upd_fail_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, cause, time_to_wait, crit_diagnostics, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + cause_c& cause(); + time_to_wait_e& time_to_wait(); + crit_diagnostics_s& crit_diagnostics(); + const uint16_t& transaction_id() const; + const cause_c& cause() const; + const time_to_wait_e& time_to_wait() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2setupFailureIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2setup_fail_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, cause, time_to_wait, crit_diagnostics, tn_linfo, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + cause_c& cause(); + time_to_wait_e& time_to_wait(); + crit_diagnostics_s& crit_diagnostics(); + tn_linfo_s& tn_linfo(); + const uint16_t& transaction_id() const; + const cause_c& cause() const; + const time_to_wait_e& time_to_wait() const; + const crit_diagnostics_s& crit_diagnostics() const; + const tn_linfo_s& tn_linfo() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2setupRequestIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2setup_request_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { + transaction_id, + global_e2node_id, + ra_nfunctions_added, + e2node_component_cfg_addition, + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + global_e2node_id_c& global_e2node_id(); + ra_nfunctions_list_l& ra_nfunctions_added(); + e2node_component_cfg_addition_list_l& e2node_component_cfg_addition(); + const uint16_t& transaction_id() const; + const global_e2node_id_c& global_e2node_id() const; + const ra_nfunctions_list_l& ra_nfunctions_added() const; + const e2node_component_cfg_addition_list_l& e2node_component_cfg_addition() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// E2setupResponseIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct e2setup_resp_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { + transaction_id, + global_ric_id, + ra_nfunctions_accepted, + ra_nfunctions_rejected, + e2node_component_cfg_addition_ack, + nulltype + } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + global_ric_id_s& global_ric_id(); + ra_nfunctions_id_list_l& ra_nfunctions_accepted(); + ra_nfunctions_idcause_list_l& ra_nfunctions_rejected(); + e2node_component_cfg_addition_ack_list_l& e2node_component_cfg_addition_ack(); + const uint16_t& transaction_id() const; + const global_ric_id_s& global_ric_id() const; + const ra_nfunctions_id_list_l& ra_nfunctions_accepted() const; + const ra_nfunctions_idcause_list_l& ra_nfunctions_rejected() const; + const e2node_component_cfg_addition_ack_list_l& e2node_component_cfg_addition_ack() const; + + private: + types type_; + choice_buffer_t + c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// ErrorIndication-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct error_ind_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, ri_crequest_id, ra_nfunction_id, cause, crit_diagnostics, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + cause_c& cause(); + crit_diagnostics_s& crit_diagnostics(); + const uint16_t& transaction_id() const; + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const cause_c& cause() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICcontrolAcknowledge-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ri_cctrl_ack_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_crequest_id, ra_nfunction_id, ri_ccall_process_id, ri_cctrl_outcome, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + unbounded_octstring& ri_ccall_process_id(); + unbounded_octstring& ri_cctrl_outcome(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const unbounded_octstring& ri_ccall_process_id() const; + const unbounded_octstring& ri_cctrl_outcome() const; + + private: + types type_; + choice_buffer_t > c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICcontrolFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ri_cctrl_fail_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_crequest_id, ra_nfunction_id, ri_ccall_process_id, cause, ri_cctrl_outcome, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + unbounded_octstring& ri_ccall_process_id(); + cause_c& cause(); + unbounded_octstring& ri_cctrl_outcome(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const unbounded_octstring& ri_ccall_process_id() const; + const cause_c& cause() const; + const unbounded_octstring& ri_cctrl_outcome() const; + + private: + types type_; + choice_buffer_t > c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICcontrolRequest-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ri_cctrl_request_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { + ri_crequest_id, + ra_nfunction_id, + ri_ccall_process_id, + ri_cctrl_hdr, + ri_cctrl_msg, + ri_cctrl_ack_request, + nulltype + } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + unbounded_octstring& ri_ccall_process_id(); + unbounded_octstring& ri_cctrl_hdr(); + unbounded_octstring& ri_cctrl_msg(); + ri_cctrl_ack_request_e& ri_cctrl_ack_request(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const unbounded_octstring& ri_ccall_process_id() const; + const unbounded_octstring& ri_cctrl_hdr() const; + const unbounded_octstring& ri_cctrl_msg() const; + const ri_cctrl_ack_request_e& ri_cctrl_ack_request() const; + + private: + types type_; + choice_buffer_t > c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICindication-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ri_cind_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { + ri_crequest_id, + ra_nfunction_id, + ri_caction_id, + ri_cind_sn, + ri_cind_type, + ri_cind_hdr, + ri_cind_msg, + ri_ccall_process_id, + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + uint16_t& ri_caction_id(); + uint32_t& ri_cind_sn(); + ri_cind_type_e& ri_cind_type(); + unbounded_octstring& ri_cind_hdr(); + unbounded_octstring& ri_cind_msg(); + unbounded_octstring& ri_ccall_process_id(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const uint16_t& ri_caction_id() const; + const uint32_t& ri_cind_sn() const; + const ri_cind_type_e& ri_cind_type() const; + const unbounded_octstring& ri_cind_hdr() const; + const unbounded_octstring& ri_cind_msg() const; + const unbounded_octstring& ri_ccall_process_id() const; + + private: + types type_; + choice_buffer_t > c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICserviceQuery-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricservice_query_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, ra_nfunctions_accepted, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + ra_nfunctions_id_list_l& ra_nfunctions_accepted(); + const uint16_t& transaction_id() const; + const ra_nfunctions_id_list_l& ra_nfunctions_accepted() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICserviceUpdate-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricservice_upd_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { + transaction_id, + ra_nfunctions_added, + ra_nfunctions_modified, + ra_nfunctions_deleted, + nulltype + } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + ra_nfunctions_list_l& ra_nfunctions_added(); + ra_nfunctions_list_l& ra_nfunctions_modified(); + ra_nfunctions_id_list_l& ra_nfunctions_deleted(); + const uint16_t& transaction_id() const; + const ra_nfunctions_list_l& ra_nfunctions_added() const; + const ra_nfunctions_list_l& ra_nfunctions_modified() const; + const ra_nfunctions_id_list_l& ra_nfunctions_deleted() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICserviceUpdateAcknowledge-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricservice_upd_ack_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, ra_nfunctions_accepted, ra_nfunctions_rejected, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + ra_nfunctions_id_list_l& ra_nfunctions_accepted(); + ra_nfunctions_idcause_list_l& ra_nfunctions_rejected(); + const uint16_t& transaction_id() const; + const ra_nfunctions_id_list_l& ra_nfunctions_accepted() const; + const ra_nfunctions_idcause_list_l& ra_nfunctions_rejected() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICserviceUpdateFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricservice_upd_fail_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, cause, time_to_wait, crit_diagnostics, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + cause_c& cause(); + time_to_wait_e& time_to_wait(); + crit_diagnostics_s& crit_diagnostics(); + const uint16_t& transaction_id() const; + const cause_c& cause() const; + const time_to_wait_e& time_to_wait() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICsubscriptionDeleteFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricsubscription_delete_fail_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_crequest_id, ra_nfunction_id, cause, crit_diagnostics, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + cause_c& cause(); + crit_diagnostics_s& crit_diagnostics(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const cause_c& cause() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICsubscriptionDeleteRequest-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricsubscription_delete_request_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_crequest_id, ra_nfunction_id, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICsubscriptionDeleteRequired-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricsubscription_delete_required_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ricsubscription_to_be_remd, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::ricsubscription_to_be_remd; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ricsubscription_list_with_cause_l& ricsubscription_to_be_remd() { return c; } + const ricsubscription_list_with_cause_l& ricsubscription_to_be_remd() const { return c; } + + private: + ricsubscription_list_with_cause_l c; + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICsubscriptionDeleteResponse-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricsubscription_delete_resp_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_crequest_id, ra_nfunction_id, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICsubscriptionFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricsubscription_fail_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_crequest_id, ra_nfunction_id, cause, crit_diagnostics, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + cause_c& cause(); + crit_diagnostics_s& crit_diagnostics(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const cause_c& cause() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICsubscriptionRequest-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricsubscription_request_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_crequest_id, ra_nfunction_id, ricsubscription_details, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + ricsubscription_details_s& ricsubscription_details(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const ricsubscription_details_s& ricsubscription_details() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// RICsubscriptionResponse-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct ricsubscription_resp_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { ri_crequest_id, ra_nfunction_id, ri_cactions_admitted, ri_cactions_not_admitted, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ri_crequest_id_s& ri_crequest_id(); + uint16_t& ra_nfunction_id(); + ri_caction_admitted_list_l& ri_cactions_admitted(); + ri_caction_not_admitted_list_l& ri_cactions_not_admitted(); + const ri_crequest_id_s& ri_crequest_id() const; + const uint16_t& ra_nfunction_id() const; + const ri_caction_admitted_list_l& ri_cactions_admitted() const; + const ri_caction_not_admitted_list_l& ri_cactions_not_admitted() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// ResetRequestIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct reset_request_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, cause, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + cause_c& cause(); + const uint16_t& transaction_id() const; + const cause_c& cause() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +// ResetResponseIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +struct reset_resp_ies_o { + // Value ::= OPEN TYPE + struct value_c { + struct types_opts { + enum options { transaction_id, crit_diagnostics, nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + value_c() = default; + value_c(const value_c& other); + value_c& operator=(const value_c& other); + ~value_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& transaction_id(); + crit_diagnostics_s& crit_diagnostics(); + const uint16_t& transaction_id() const; + const crit_diagnostics_s& crit_diagnostics() const; + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // members lookup methods + static uint32_t idx_to_id(uint32_t idx); + static bool is_id_valid(const uint32_t& id); + static crit_e get_crit(const uint32_t& id); + static value_c get_value(const uint32_t& id); + static presence_e get_presence(const uint32_t& id); +}; + +struct e2_removal_fail_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool crit_diagnostics_present = false; + ie_field_s > transaction_id; + ie_field_s cause; + ie_field_s crit_diagnostics; + + // sequence methods + e2_removal_fail_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2RemovalFailure ::= SEQUENCE +using e2_removal_fail_s = elementary_procedure_option; + +// E2RemovalRequest ::= SEQUENCE +using e2_removal_request_s = elementary_procedure_option >; + +struct e2_removal_resp_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool crit_diagnostics_present = false; + ie_field_s > transaction_id; + ie_field_s crit_diagnostics; + + // sequence methods + e2_removal_resp_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2RemovalResponse ::= SEQUENCE +using e2_removal_resp_s = elementary_procedure_option; + +struct e2conn_upd_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool e2conn_upd_add_present = false; + bool e2conn_upd_rem_present = false; + bool e2conn_upd_modify_present = false; + ie_field_s > transaction_id; + ie_field_s, 1, 32, true> > e2conn_upd_add; + ie_field_s, 1, 32, true> > e2conn_upd_rem; + ie_field_s, 1, 32, true> > e2conn_upd_modify; + + // sequence methods + e2conn_upd_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2connectionUpdate ::= SEQUENCE +using e2conn_upd_s = elementary_procedure_option; + +struct e2conn_upd_ack_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool e2conn_setup_present = false; + bool e2conn_setup_failed_present = false; + ie_field_s > transaction_id; + ie_field_s, 1, 32, true> > e2conn_setup; + ie_field_s, 1, 32, true> > + e2conn_setup_failed; + + // sequence methods + e2conn_upd_ack_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2connectionUpdateAcknowledge ::= SEQUENCE +using e2conn_upd_ack_s = elementary_procedure_option; + +struct e2conn_upd_fail_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool cause_present = false; + bool time_to_wait_present = false; + bool crit_diagnostics_present = false; + ie_field_s > transaction_id; + ie_field_s cause; + ie_field_s time_to_wait; + ie_field_s crit_diagnostics; + + // sequence methods + e2conn_upd_fail_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2connectionUpdateFailure ::= SEQUENCE +using e2conn_upd_fail_s = elementary_procedure_option; + +struct e2node_cfg_upd_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool global_e2node_id_present = false; + bool e2node_component_cfg_addition_present = false; + bool e2node_component_cfg_upd_present = false; + bool e2node_component_cfg_removal_present = false; + bool e2node_tn_lassoc_removal_present = false; + ie_field_s > transaction_id; + ie_field_s global_e2node_id; + ie_field_s, 1, 1024, true> > + e2node_component_cfg_addition; + ie_field_s, 1, 1024, true> > + e2node_component_cfg_upd; + ie_field_s, 1, 1024, true> > + e2node_component_cfg_removal; + ie_field_s, 1, 32, true> > + e2node_tn_lassoc_removal; + + // sequence methods + e2node_cfg_upd_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeConfigurationUpdate ::= SEQUENCE +using e2node_cfg_upd_s = elementary_procedure_option; + +struct e2node_cfg_upd_ack_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool e2node_component_cfg_addition_ack_present = false; + bool e2node_component_cfg_upd_ack_present = false; + bool e2node_component_cfg_removal_ack_present = false; + ie_field_s > transaction_id; + ie_field_s, 1, 1024, true> > + e2node_component_cfg_addition_ack; + ie_field_s, 1, 1024, true> > + e2node_component_cfg_upd_ack; + ie_field_s, 1, 1024, true> > + e2node_component_cfg_removal_ack; + + // sequence methods + e2node_cfg_upd_ack_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeConfigurationUpdateAcknowledge ::= SEQUENCE +using e2node_cfg_upd_ack_s = elementary_procedure_option; + +struct e2node_cfg_upd_fail_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool time_to_wait_present = false; + bool crit_diagnostics_present = false; + ie_field_s > transaction_id; + ie_field_s cause; + ie_field_s time_to_wait; + ie_field_s crit_diagnostics; + + // sequence methods + e2node_cfg_upd_fail_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2nodeConfigurationUpdateFailure ::= SEQUENCE +using e2node_cfg_upd_fail_s = elementary_procedure_option; + +struct e2setup_fail_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool time_to_wait_present = false; + bool crit_diagnostics_present = false; + bool tn_linfo_present = false; + ie_field_s > transaction_id; + ie_field_s cause; + ie_field_s time_to_wait; + ie_field_s crit_diagnostics; + ie_field_s tn_linfo; + + // sequence methods + e2setup_fail_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2setupFailure ::= SEQUENCE +using e2setup_fail_s = elementary_procedure_option; + +struct e2setup_request_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + ie_field_s > transaction_id; + ie_field_s global_e2node_id; + ie_field_s, 1, 256, true> > ra_nfunctions_added; + ie_field_s, 1, 1024, true> > + e2node_component_cfg_addition; + + // sequence methods + e2setup_request_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2setupRequest ::= SEQUENCE +using e2setup_request_s = elementary_procedure_option; + +struct e2setup_resp_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ra_nfunctions_accepted_present = false; + bool ra_nfunctions_rejected_present = false; + ie_field_s > transaction_id; + ie_field_s global_ric_id; + ie_field_s, 1, 256, true> > + ra_nfunctions_accepted; + ie_field_s, 1, 256, true> > + ra_nfunctions_rejected; + ie_field_s, 1, 1024, true> > + e2node_component_cfg_addition_ack; + + // sequence methods + e2setup_resp_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// E2setupResponse ::= SEQUENCE +using e2setup_resp_s = elementary_procedure_option; + +struct error_ind_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool transaction_id_present = false; + bool ri_crequest_id_present = false; + bool ra_nfunction_id_present = false; + bool cause_present = false; + bool crit_diagnostics_present = false; + ie_field_s > transaction_id; + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s cause; + ie_field_s crit_diagnostics; + + // sequence methods + error_ind_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// ErrorIndication ::= SEQUENCE +using error_ind_s = elementary_procedure_option; + +struct ri_cctrl_ack_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ri_ccall_process_id_present = false; + bool ri_cctrl_outcome_present = false; + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s > ri_ccall_process_id; + ie_field_s > ri_cctrl_outcome; + + // sequence methods + ri_cctrl_ack_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICcontrolAcknowledge ::= SEQUENCE +using ri_cctrl_ack_s = elementary_procedure_option; + +struct ri_cctrl_fail_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ri_ccall_process_id_present = false; + bool ri_cctrl_outcome_present = false; + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s > ri_ccall_process_id; + ie_field_s cause; + ie_field_s > ri_cctrl_outcome; + + // sequence methods + ri_cctrl_fail_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICcontrolFailure ::= SEQUENCE +using ri_cctrl_fail_s = elementary_procedure_option; + +struct ri_cctrl_request_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ri_ccall_process_id_present = false; + bool ri_cctrl_ack_request_present = false; + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s > ri_ccall_process_id; + ie_field_s > ri_cctrl_hdr; + ie_field_s > ri_cctrl_msg; + ie_field_s ri_cctrl_ack_request; + + // sequence methods + ri_cctrl_request_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICcontrolRequest ::= SEQUENCE +using ri_cctrl_request_s = elementary_procedure_option; + +struct ri_cind_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ri_cind_sn_present = false; + bool ri_ccall_process_id_present = false; + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s > ri_caction_id; + ie_field_s > ri_cind_sn; + ie_field_s ri_cind_type; + ie_field_s > ri_cind_hdr; + ie_field_s > ri_cind_msg; + ie_field_s > ri_ccall_process_id; + + // sequence methods + ri_cind_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICindication ::= SEQUENCE +using ri_cind_s = elementary_procedure_option; + +struct ricservice_query_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ra_nfunctions_accepted_present = false; + ie_field_s > transaction_id; + ie_field_s, 1, 256, true> > + ra_nfunctions_accepted; + + // sequence methods + ricservice_query_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICserviceQuery ::= SEQUENCE +using ricservice_query_s = elementary_procedure_option; + +struct ricservice_upd_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ra_nfunctions_added_present = false; + bool ra_nfunctions_modified_present = false; + bool ra_nfunctions_deleted_present = false; + ie_field_s > transaction_id; + ie_field_s, 1, 256, true> > ra_nfunctions_added; + ie_field_s, 1, 256, true> > ra_nfunctions_modified; + ie_field_s, 1, 256, true> > + ra_nfunctions_deleted; + + // sequence methods + ricservice_upd_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICserviceUpdate ::= SEQUENCE +using ricservice_upd_s = elementary_procedure_option; + +struct ricservice_upd_ack_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ra_nfunctions_accepted_present = false; + bool ra_nfunctions_rejected_present = false; + ie_field_s > transaction_id; + ie_field_s, 1, 256, true> > + ra_nfunctions_accepted; + ie_field_s, 1, 256, true> > + ra_nfunctions_rejected; + + // sequence methods + ricservice_upd_ack_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICserviceUpdateAcknowledge ::= SEQUENCE +using ricservice_upd_ack_s = elementary_procedure_option; + +struct ricservice_upd_fail_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool time_to_wait_present = false; + bool crit_diagnostics_present = false; + ie_field_s > transaction_id; + ie_field_s cause; + ie_field_s time_to_wait; + ie_field_s crit_diagnostics; + + // sequence methods + ricservice_upd_fail_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICserviceUpdateFailure ::= SEQUENCE +using ricservice_upd_fail_s = elementary_procedure_option; + +struct ricsubscription_delete_fail_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool crit_diagnostics_present = false; + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s cause; + ie_field_s crit_diagnostics; + + // sequence methods + ricsubscription_delete_fail_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICsubscriptionDeleteFailure ::= SEQUENCE +using ricsubscription_delete_fail_s = elementary_procedure_option; + +struct ricsubscription_delete_request_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + + // sequence methods + ricsubscription_delete_request_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICsubscriptionDeleteRequest ::= SEQUENCE +using ricsubscription_delete_request_s = elementary_procedure_option; + +// RICsubscriptionDeleteRequired ::= SEQUENCE +using ricsubscription_delete_required_s = + elementary_procedure_option >; + +struct ricsubscription_delete_resp_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + + // sequence methods + ricsubscription_delete_resp_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICsubscriptionDeleteResponse ::= SEQUENCE +using ricsubscription_delete_resp_s = elementary_procedure_option; + +struct ricsubscription_fail_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool crit_diagnostics_present = false; + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s cause; + ie_field_s crit_diagnostics; + + // sequence methods + ricsubscription_fail_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICsubscriptionFailure ::= SEQUENCE +using ricsubscription_fail_s = elementary_procedure_option; + +struct ricsubscription_request_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s ricsubscription_details; + + // sequence methods + ricsubscription_request_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICsubscriptionRequest ::= SEQUENCE +using ricsubscription_request_s = elementary_procedure_option; + +struct ricsubscription_resp_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool ri_cactions_not_admitted_present = false; + ie_field_s ri_crequest_id; + ie_field_s > ra_nfunction_id; + ie_field_s, 1, 16, true> > + ri_cactions_admitted; + ie_field_s, 0, 16, true> > + ri_cactions_not_admitted; + + // sequence methods + ricsubscription_resp_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// RICsubscriptionResponse ::= SEQUENCE +using ricsubscription_resp_s = elementary_procedure_option; + +struct reset_request_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + ie_field_s > transaction_id; + ie_field_s cause; + + // sequence methods + reset_request_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// ResetRequest ::= SEQUENCE +using reset_request_s = elementary_procedure_option; + +struct reset_resp_ies_container { + template + using ie_field_s = protocol_ie_container_item_s; + + // member variables + bool crit_diagnostics_present = false; + ie_field_s > transaction_id; + ie_field_s crit_diagnostics; + + // sequence methods + reset_resp_ies_container(); + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// ResetResponse ::= SEQUENCE +using reset_resp_s = elementary_procedure_option; + +// E2AP-ELEMENTARY-PROCEDURES ::= OBJECT SET OF E2AP-ELEMENTARY-PROCEDURE +struct e2_ap_elem_procs_o { + // InitiatingMessage ::= OPEN TYPE + struct init_msg_c { + struct types_opts { + enum options { + ricsubscription_request, + ricsubscription_delete_request, + ricservice_upd, + ri_cctrl_request, + e2setup_request, + e2node_cfg_upd, + e2conn_upd, + reset_request, + e2_removal_request, + ri_cind, + ricservice_query, + error_ind, + ricsubscription_delete_required, + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + init_msg_c() = default; + init_msg_c(const init_msg_c& other); + init_msg_c& operator=(const init_msg_c& other); + ~init_msg_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ricsubscription_request_s& ricsubscription_request(); + ricsubscription_delete_request_s& ricsubscription_delete_request(); + ricservice_upd_s& ricservice_upd(); + ri_cctrl_request_s& ri_cctrl_request(); + e2setup_request_s& e2setup_request(); + e2node_cfg_upd_s& e2node_cfg_upd(); + e2conn_upd_s& e2conn_upd(); + reset_request_s& reset_request(); + e2_removal_request_s& e2_removal_request(); + ri_cind_s& ri_cind(); + ricservice_query_s& ricservice_query(); + error_ind_s& error_ind(); + ricsubscription_delete_required_s& ricsubscription_delete_required(); + const ricsubscription_request_s& ricsubscription_request() const; + const ricsubscription_delete_request_s& ricsubscription_delete_request() const; + const ricservice_upd_s& ricservice_upd() const; + const ri_cctrl_request_s& ri_cctrl_request() const; + const e2setup_request_s& e2setup_request() const; + const e2node_cfg_upd_s& e2node_cfg_upd() const; + const e2conn_upd_s& e2conn_upd() const; + const reset_request_s& reset_request() const; + const e2_removal_request_s& e2_removal_request() const; + const ri_cind_s& ri_cind() const; + const ricservice_query_s& ricservice_query() const; + const error_ind_s& error_ind() const; + const ricsubscription_delete_required_s& ricsubscription_delete_required() const; + + private: + types type_; + choice_buffer_t + c; + + void destroy_(); + }; + // SuccessfulOutcome ::= OPEN TYPE + struct successful_outcome_c { + struct types_opts { + enum options { + ricsubscription_resp, + ricsubscription_delete_resp, + ricservice_upd_ack, + ri_cctrl_ack, + e2setup_resp, + e2node_cfg_upd_ack, + e2conn_upd_ack, + reset_resp, + e2_removal_resp, + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + successful_outcome_c() = default; + successful_outcome_c(const successful_outcome_c& other); + successful_outcome_c& operator=(const successful_outcome_c& other); + ~successful_outcome_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ricsubscription_resp_s& ricsubscription_resp(); + ricsubscription_delete_resp_s& ricsubscription_delete_resp(); + ricservice_upd_ack_s& ricservice_upd_ack(); + ri_cctrl_ack_s& ri_cctrl_ack(); + e2setup_resp_s& e2setup_resp(); + e2node_cfg_upd_ack_s& e2node_cfg_upd_ack(); + e2conn_upd_ack_s& e2conn_upd_ack(); + reset_resp_s& reset_resp(); + e2_removal_resp_s& e2_removal_resp(); + const ricsubscription_resp_s& ricsubscription_resp() const; + const ricsubscription_delete_resp_s& ricsubscription_delete_resp() const; + const ricservice_upd_ack_s& ricservice_upd_ack() const; + const ri_cctrl_ack_s& ri_cctrl_ack() const; + const e2setup_resp_s& e2setup_resp() const; + const e2node_cfg_upd_ack_s& e2node_cfg_upd_ack() const; + const e2conn_upd_ack_s& e2conn_upd_ack() const; + const reset_resp_s& reset_resp() const; + const e2_removal_resp_s& e2_removal_resp() const; + + private: + types type_; + choice_buffer_t + c; + + void destroy_(); + }; + // UnsuccessfulOutcome ::= OPEN TYPE + struct unsuccessful_outcome_c { + struct types_opts { + enum options { + ricsubscription_fail, + ricsubscription_delete_fail, + ricservice_upd_fail, + ri_cctrl_fail, + e2setup_fail, + e2node_cfg_upd_fail, + e2conn_upd_fail, + e2_removal_fail, + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + unsuccessful_outcome_c() = default; + unsuccessful_outcome_c(const unsuccessful_outcome_c& other); + unsuccessful_outcome_c& operator=(const unsuccessful_outcome_c& other); + ~unsuccessful_outcome_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ricsubscription_fail_s& ricsubscription_fail(); + ricsubscription_delete_fail_s& ricsubscription_delete_fail(); + ricservice_upd_fail_s& ricservice_upd_fail(); + ri_cctrl_fail_s& ri_cctrl_fail(); + e2setup_fail_s& e2setup_fail(); + e2node_cfg_upd_fail_s& e2node_cfg_upd_fail(); + e2conn_upd_fail_s& e2conn_upd_fail(); + e2_removal_fail_s& e2_removal_fail(); + const ricsubscription_fail_s& ricsubscription_fail() const; + const ricsubscription_delete_fail_s& ricsubscription_delete_fail() const; + const ricservice_upd_fail_s& ricservice_upd_fail() const; + const ri_cctrl_fail_s& ri_cctrl_fail() const; + const e2setup_fail_s& e2setup_fail() const; + const e2node_cfg_upd_fail_s& e2node_cfg_upd_fail() const; + const e2conn_upd_fail_s& e2conn_upd_fail() const; + const e2_removal_fail_s& e2_removal_fail() const; + + private: + types type_; + choice_buffer_t + c; + + void destroy_(); + }; + + // members lookup methods + static uint16_t idx_to_proc_code(uint32_t idx); + static bool is_proc_code_valid(const uint16_t& proc_code); + static init_msg_c get_init_msg(const uint16_t& proc_code); + static successful_outcome_c get_successful_outcome(const uint16_t& proc_code); + static unsuccessful_outcome_c get_unsuccessful_outcome(const uint16_t& proc_code); + static crit_e get_crit(const uint16_t& proc_code); +}; + +// InitiatingMessage ::= SEQUENCE{{E2AP-ELEMENTARY-PROCEDURE}} +struct init_msg_s { + uint16_t proc_code = 0; + crit_e crit; + e2_ap_elem_procs_o::init_msg_c value; + + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + bool load_info_obj(const uint16_t& proc_code_); +}; + +// SuccessfulOutcome ::= SEQUENCE{{E2AP-ELEMENTARY-PROCEDURE}} +struct successful_outcome_s { + uint16_t proc_code = 0; + crit_e crit; + e2_ap_elem_procs_o::successful_outcome_c value; + + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + bool load_info_obj(const uint16_t& proc_code_); +}; + +// UnsuccessfulOutcome ::= SEQUENCE{{E2AP-ELEMENTARY-PROCEDURE}} +struct unsuccessful_outcome_s { + uint16_t proc_code = 0; + crit_e crit; + e2_ap_elem_procs_o::unsuccessful_outcome_c value; + + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + bool load_info_obj(const uint16_t& proc_code_); +}; + +// E2AP-PDU ::= CHOICE +struct e2_ap_pdu_c { + struct types_opts { + enum options { init_msg, successful_outcome, unsuccessful_outcome, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + e2_ap_pdu_c() = default; + e2_ap_pdu_c(const e2_ap_pdu_c& other); + e2_ap_pdu_c& operator=(const e2_ap_pdu_c& other); + ~e2_ap_pdu_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + init_msg_s& init_msg() + { + assert_choice_type(types::init_msg, type_, "E2AP-PDU"); + return c.get(); + } + successful_outcome_s& successful_outcome() + { + assert_choice_type(types::successful_outcome, type_, "E2AP-PDU"); + return c.get(); + } + unsuccessful_outcome_s& unsuccessful_outcome() + { + assert_choice_type(types::unsuccessful_outcome, type_, "E2AP-PDU"); + return c.get(); + } + const init_msg_s& init_msg() const + { + assert_choice_type(types::init_msg, type_, "E2AP-PDU"); + return c.get(); + } + const successful_outcome_s& successful_outcome() const + { + assert_choice_type(types::successful_outcome, type_, "E2AP-PDU"); + return c.get(); + } + const unsuccessful_outcome_s& unsuccessful_outcome() const + { + assert_choice_type(types::unsuccessful_outcome, type_, "E2AP-PDU"); + return c.get(); + } + init_msg_s& set_init_msg(); + successful_outcome_s& set_successful_outcome(); + unsuccessful_outcome_s& set_unsuccessful_outcome(); + +private: + types type_; + choice_buffer_t c; + + void destroy_(); +}; + +// ProtocolIE-FieldPair{E2AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE{{E2AP-PROTOCOL-IES-PAIR}} +template +struct protocol_ie_field_pair_s { + uint32_t id = 0; + crit_e first_crit; + typename ies_set_paramT_::first_value_c first_value; + crit_e second_crit; + typename ies_set_paramT_::second_value_c second_value; + + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + bool load_info_obj(const uint32_t& id_); +}; + +// ProtocolIE-ContainerPair{E2AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE (SIZE (0..65535)) OF ProtocolIE-FieldPair +template +using protocol_ie_container_pair_l = dyn_seq_of, 0, 65535, true>; + +} // namespace e2ap +} // namespace asn1 + +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_single_container_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; +extern template struct asn1::protocol_ie_field_s; + +#endif // SRSASN1_E2AP_H diff --git a/lib/include/srsran/asn1/e2sm.h b/lib/include/srsran/asn1/e2sm.h new file mode 100644 index 000000000..21fd75453 --- /dev/null +++ b/lib/include/srsran/asn1/e2sm.h @@ -0,0 +1,1344 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2021 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ + +/******************************************************************************* + * + * 3GPP TS ASN1 E2SM v15.3.0 (2019-03) + * + ******************************************************************************/ + +#ifndef SRSASN1_E2SM_H +#define SRSASN1_E2SM_H + +#include "asn1_utils.h" +#include +#include + +namespace asn1 { +namespace e2sm { + +/******************************************************************************* + * Constant Definitions + ******************************************************************************/ + +#define ASN1_E2SM_MAX_E1_APID 65535 +#define ASN1_E2SM_MAX_F1_APID 4 +#define ASN1_E2SM_MAX_EARFCN 65535 +#define ASN1_E2SM_MAX_NRARFCN 3279165 +#define ASN1_E2SM_MAXNOOF_NR_CELL_BANDS 32 + +/******************************************************************************* + * Struct Definitions + ******************************************************************************/ + +// EUTRA-CGI ::= SEQUENCE +struct eutra_cgi_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + fixed_bitstring<28, false, true> eutra_cell_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// NR-CGI ::= SEQUENCE +struct nr_cgi_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + fixed_bitstring<36, false, true> nrcell_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// CGI ::= CHOICE +struct cgi_c { + struct types_opts { + enum options { nr_cgi, eutra_cgi, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + cgi_c() = default; + cgi_c(const cgi_c& other); + cgi_c& operator=(const cgi_c& other); + ~cgi_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + nr_cgi_s& nr_cgi() + { + assert_choice_type(types::nr_cgi, type_, "CGI"); + return c.get(); + } + eutra_cgi_s& eutra_cgi() + { + assert_choice_type(types::eutra_cgi, type_, "CGI"); + return c.get(); + } + const nr_cgi_s& nr_cgi() const + { + assert_choice_type(types::nr_cgi, type_, "CGI"); + return c.get(); + } + const eutra_cgi_s& eutra_cgi() const + { + assert_choice_type(types::eutra_cgi, type_, "CGI"); + return c.get(); + } + nr_cgi_s& set_nr_cgi(); + eutra_cgi_s& set_eutra_cgi(); + +private: + types type_; + choice_buffer_t c; + + void destroy_(); +}; + +// GUAMI ::= SEQUENCE +struct guami_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + fixed_bitstring<8, false, true> amf_region_id; + fixed_bitstring<10, false, true> amf_set_id; + fixed_bitstring<6, false, true> amf_pointer; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GUMMEI ::= SEQUENCE +struct gummei_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + fixed_octstring<2, true> mme_group_id; + fixed_octstring<1, true> mme_code; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// CoreCPID ::= CHOICE +struct core_cpid_c { + struct types_opts { + enum options { five_gc, epc, /*...*/ nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + core_cpid_c() = default; + core_cpid_c(const core_cpid_c& other); + core_cpid_c& operator=(const core_cpid_c& other); + ~core_cpid_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + guami_s& five_gc() + { + assert_choice_type(types::five_gc, type_, "CoreCPID"); + return c.get(); + } + gummei_s& epc() + { + assert_choice_type(types::epc, type_, "CoreCPID"); + return c.get(); + } + const guami_s& five_gc() const + { + assert_choice_type(types::five_gc, type_, "CoreCPID"); + return c.get(); + } + const gummei_s& epc() const + { + assert_choice_type(types::epc, type_, "CoreCPID"); + return c.get(); + } + guami_s& set_five_gc(); + gummei_s& set_epc(); + +private: + types type_; + choice_buffer_t c; + + void destroy_(); +}; + +// ENB-ID ::= CHOICE +struct enb_id_c { + struct types_opts { + enum options { macro_enb_id, home_enb_id, /*...*/ short_macro_enb_id, long_macro_enb_id, nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + enb_id_c() = default; + enb_id_c(const enb_id_c& other); + enb_id_c& operator=(const enb_id_c& other); + ~enb_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + fixed_bitstring<20, false, true>& macro_enb_id() + { + assert_choice_type(types::macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + fixed_bitstring<28, false, true>& home_enb_id() + { + assert_choice_type(types::home_enb_id, type_, "ENB-ID"); + return c.get >(); + } + fixed_bitstring<18, false, true>& short_macro_enb_id() + { + assert_choice_type(types::short_macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + fixed_bitstring<21, false, true>& long_macro_enb_id() + { + assert_choice_type(types::long_macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + const fixed_bitstring<20, false, true>& macro_enb_id() const + { + assert_choice_type(types::macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + const fixed_bitstring<28, false, true>& home_enb_id() const + { + assert_choice_type(types::home_enb_id, type_, "ENB-ID"); + return c.get >(); + } + const fixed_bitstring<18, false, true>& short_macro_enb_id() const + { + assert_choice_type(types::short_macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + const fixed_bitstring<21, false, true>& long_macro_enb_id() const + { + assert_choice_type(types::long_macro_enb_id, type_, "ENB-ID"); + return c.get >(); + } + fixed_bitstring<20, false, true>& set_macro_enb_id(); + fixed_bitstring<28, false, true>& set_home_enb_id(); + fixed_bitstring<18, false, true>& set_short_macro_enb_id(); + fixed_bitstring<21, false, true>& set_long_macro_enb_id(); + +private: + types type_; + choice_buffer_t > c; + + void destroy_(); +}; + +// GlobalENB-ID ::= SEQUENCE +struct global_enb_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + enb_id_c enb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GNB-ID ::= CHOICE +struct gnb_id_c { + struct types_opts { + enum options { gnb_id, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::gnb_id; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + bounded_bitstring<22, 32, false, true>& gnb_id() { return c; } + const bounded_bitstring<22, 32, false, true>& gnb_id() const { return c; } + +private: + bounded_bitstring<22, 32, false, true> c; +}; + +// GlobalGNB-ID ::= SEQUENCE +struct global_gnb_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + gnb_id_c gnb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// NgENB-ID ::= CHOICE +struct ng_enb_id_c { + struct types_opts { + enum options { macro_ng_enb_id, short_macro_ng_enb_id, long_macro_ng_enb_id, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + ng_enb_id_c() = default; + ng_enb_id_c(const ng_enb_id_c& other); + ng_enb_id_c& operator=(const ng_enb_id_c& other); + ~ng_enb_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + fixed_bitstring<20, false, true>& macro_ng_enb_id() + { + assert_choice_type(types::macro_ng_enb_id, type_, "NgENB-ID"); + return c.get >(); + } + fixed_bitstring<18, false, true>& short_macro_ng_enb_id() + { + assert_choice_type(types::short_macro_ng_enb_id, type_, "NgENB-ID"); + return c.get >(); + } + fixed_bitstring<21, false, true>& long_macro_ng_enb_id() + { + assert_choice_type(types::long_macro_ng_enb_id, type_, "NgENB-ID"); + return c.get >(); + } + const fixed_bitstring<20, false, true>& macro_ng_enb_id() const + { + assert_choice_type(types::macro_ng_enb_id, type_, "NgENB-ID"); + return c.get >(); + } + const fixed_bitstring<18, false, true>& short_macro_ng_enb_id() const + { + assert_choice_type(types::short_macro_ng_enb_id, type_, "NgENB-ID"); + return c.get >(); + } + const fixed_bitstring<21, false, true>& long_macro_ng_enb_id() const + { + assert_choice_type(types::long_macro_ng_enb_id, type_, "NgENB-ID"); + return c.get >(); + } + fixed_bitstring<20, false, true>& set_macro_ng_enb_id(); + fixed_bitstring<18, false, true>& set_short_macro_ng_enb_id(); + fixed_bitstring<21, false, true>& set_long_macro_ng_enb_id(); + +private: + types type_; + choice_buffer_t > c; + + void destroy_(); +}; + +// GlobalNgENB-ID ::= SEQUENCE +struct global_ng_enb_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + ng_enb_id_c ng_enb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GlobalRANNodeID ::= CHOICE +struct global_ran_node_id_c { + struct types_opts { + enum options { global_gnb_id, global_ng_enb_id, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + global_ran_node_id_c() = default; + global_ran_node_id_c(const global_ran_node_id_c& other); + global_ran_node_id_c& operator=(const global_ran_node_id_c& other); + ~global_ran_node_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + global_gnb_id_s& global_gnb_id() + { + assert_choice_type(types::global_gnb_id, type_, "GlobalRANNodeID"); + return c.get(); + } + global_ng_enb_id_s& global_ng_enb_id() + { + assert_choice_type(types::global_ng_enb_id, type_, "GlobalRANNodeID"); + return c.get(); + } + const global_gnb_id_s& global_gnb_id() const + { + assert_choice_type(types::global_gnb_id, type_, "GlobalRANNodeID"); + return c.get(); + } + const global_ng_enb_id_s& global_ng_enb_id() const + { + assert_choice_type(types::global_ng_enb_id, type_, "GlobalRANNodeID"); + return c.get(); + } + global_gnb_id_s& set_global_gnb_id(); + global_ng_enb_id_s& set_global_ng_enb_id(); + +private: + types type_; + choice_buffer_t c; + + void destroy_(); +}; + +// EN-GNB-ID ::= CHOICE +struct en_gnb_id_c { + struct types_opts { + enum options { en_g_nb_id, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + types type() const { return types::en_g_nb_id; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + bounded_bitstring<22, 32, false, true>& en_g_nb_id() { return c; } + const bounded_bitstring<22, 32, false, true>& en_g_nb_id() const { return c; } + +private: + bounded_bitstring<22, 32, false, true> c; +}; + +// GlobalenGNB-ID ::= SEQUENCE +struct globalen_gnb_id_s { + bool ext = false; + fixed_octstring<3, true> plmn_id; + en_gnb_id_c en_g_nb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// GroupID ::= CHOICE +struct group_id_c { + struct types_opts { + enum options { five_gc, epc, /*...*/ nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + group_id_c() = default; + group_id_c(const group_id_c& other); + group_id_c& operator=(const group_id_c& other); + ~group_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& five_gc() + { + assert_choice_type(types::five_gc, type_, "GroupID"); + return c.get(); + } + uint16_t& epc() + { + assert_choice_type(types::epc, type_, "GroupID"); + return c.get(); + } + const uint16_t& five_gc() const + { + assert_choice_type(types::five_gc, type_, "GroupID"); + return c.get(); + } + const uint16_t& epc() const + { + assert_choice_type(types::epc, type_, "GroupID"); + return c.get(); + } + uint16_t& set_five_gc(); + uint16_t& set_epc(); + +private: + types type_; + pod_choice_buffer_t c; + + void destroy_(); +}; + +// InterfaceID-E1 ::= SEQUENCE +struct interface_id_e1_s { + bool ext = false; + global_ran_node_id_c global_ng_ran_id; + uint64_t gnb_cu_up_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// InterfaceID-F1 ::= SEQUENCE +struct interface_id_f1_s { + bool ext = false; + global_ran_node_id_c global_ng_ran_id; + uint64_t gnb_du_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// InterfaceID-NG ::= SEQUENCE +struct interface_id_ng_s { + bool ext = false; + guami_s guami; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// InterfaceID-S1 ::= SEQUENCE +struct interface_id_s1_s { + bool ext = false; + gummei_s gummei; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// InterfaceID-W1 ::= SEQUENCE +struct interface_id_w1_s { + bool ext = false; + global_ng_enb_id_s global_ng_enb_id; + uint64_t ng_enb_du_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// InterfaceID-X2 ::= SEQUENCE +struct interface_id_x2_s { + struct node_type_c_ { + struct types_opts { + enum options { global_enb_id, global_en_g_nb_id, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + node_type_c_() = default; + node_type_c_(const node_type_c_& other); + node_type_c_& operator=(const node_type_c_& other); + ~node_type_c_() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + global_enb_id_s& global_enb_id() + { + assert_choice_type(types::global_enb_id, type_, "nodeType"); + return c.get(); + } + globalen_gnb_id_s& global_en_g_nb_id() + { + assert_choice_type(types::global_en_g_nb_id, type_, "nodeType"); + return c.get(); + } + const global_enb_id_s& global_enb_id() const + { + assert_choice_type(types::global_enb_id, type_, "nodeType"); + return c.get(); + } + const globalen_gnb_id_s& global_en_g_nb_id() const + { + assert_choice_type(types::global_en_g_nb_id, type_, "nodeType"); + return c.get(); + } + global_enb_id_s& set_global_enb_id(); + globalen_gnb_id_s& set_global_en_g_nb_id(); + + private: + types type_; + choice_buffer_t c; + + void destroy_(); + }; + + // member variables + bool ext = false; + node_type_c_ node_type; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// InterfaceID-Xn ::= SEQUENCE +struct interface_id_xn_s { + bool ext = false; + global_ran_node_id_c global_ng_ran_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// InterfaceIdentifier ::= CHOICE +struct interface_id_c { + struct types_opts { + enum options { ng, xn, f1, e1, s1, x2, w1, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + interface_id_c() = default; + interface_id_c(const interface_id_c& other); + interface_id_c& operator=(const interface_id_c& other); + ~interface_id_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + interface_id_ng_s& ng() + { + assert_choice_type(types::ng, type_, "InterfaceIdentifier"); + return c.get(); + } + interface_id_xn_s& xn() + { + assert_choice_type(types::xn, type_, "InterfaceIdentifier"); + return c.get(); + } + interface_id_f1_s& f1() + { + assert_choice_type(types::f1, type_, "InterfaceIdentifier"); + return c.get(); + } + interface_id_e1_s& e1() + { + assert_choice_type(types::e1, type_, "InterfaceIdentifier"); + return c.get(); + } + interface_id_s1_s& s1() + { + assert_choice_type(types::s1, type_, "InterfaceIdentifier"); + return c.get(); + } + interface_id_x2_s& x2() + { + assert_choice_type(types::x2, type_, "InterfaceIdentifier"); + return c.get(); + } + interface_id_w1_s& w1() + { + assert_choice_type(types::w1, type_, "InterfaceIdentifier"); + return c.get(); + } + const interface_id_ng_s& ng() const + { + assert_choice_type(types::ng, type_, "InterfaceIdentifier"); + return c.get(); + } + const interface_id_xn_s& xn() const + { + assert_choice_type(types::xn, type_, "InterfaceIdentifier"); + return c.get(); + } + const interface_id_f1_s& f1() const + { + assert_choice_type(types::f1, type_, "InterfaceIdentifier"); + return c.get(); + } + const interface_id_e1_s& e1() const + { + assert_choice_type(types::e1, type_, "InterfaceIdentifier"); + return c.get(); + } + const interface_id_s1_s& s1() const + { + assert_choice_type(types::s1, type_, "InterfaceIdentifier"); + return c.get(); + } + const interface_id_x2_s& x2() const + { + assert_choice_type(types::x2, type_, "InterfaceIdentifier"); + return c.get(); + } + const interface_id_w1_s& w1() const + { + assert_choice_type(types::w1, type_, "InterfaceIdentifier"); + return c.get(); + } + interface_id_ng_s& set_ng(); + interface_id_xn_s& set_xn(); + interface_id_f1_s& set_f1(); + interface_id_e1_s& set_e1(); + interface_id_s1_s& set_s1(); + interface_id_x2_s& set_x2(); + interface_id_w1_s& set_w1(); + +private: + types type_; + choice_buffer_t + c; + + void destroy_(); +}; + +// FreqBandNrItem ::= SEQUENCE +struct freq_band_nr_item_s { + bool ext = false; + uint16_t freq_band_ind_nr = 1; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// NR-ARFCN ::= SEQUENCE +struct nr_arfcn_s { + using freq_band_list_nr_l_ = dyn_array; + + // member variables + bool ext = false; + uint32_t nrarfcn = 0; + freq_band_list_nr_l_ freq_band_list_nr; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// QoSID ::= CHOICE +struct qo_sid_c { + struct types_opts { + enum options { five_gc, epc, /*...*/ nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; + }; + typedef enumerated types; + + // choice methods + qo_sid_c() = default; + qo_sid_c(const qo_sid_c& other); + qo_sid_c& operator=(const qo_sid_c& other); + ~qo_sid_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& five_gc() + { + assert_choice_type(types::five_gc, type_, "QoSID"); + return c.get(); + } + uint16_t& epc() + { + assert_choice_type(types::epc, type_, "QoSID"); + return c.get(); + } + const uint16_t& five_gc() const + { + assert_choice_type(types::five_gc, type_, "QoSID"); + return c.get(); + } + const uint16_t& epc() const + { + assert_choice_type(types::epc, type_, "QoSID"); + return c.get(); + } + uint16_t& set_five_gc(); + uint16_t& set_epc(); + +private: + types type_; + pod_choice_buffer_t c; + + void destroy_(); +}; + +// RRCclass-LTE ::= ENUMERATED +struct rr_cclass_lte_opts { + enum options { + bcch_bch, + bcch_bch_mbms, + bcch_dl_sch, + bcch_dl_sch_br, + bcch_dl_sch_mbms, + mcch, + pcch, + dl_ccch, + dl_dcch, + ul_ccch, + ul_dcch, + sc_mcch, + // ... + nulltype + } value; + + const char* to_string() const; +}; +typedef enumerated rr_cclass_lte_e; + +// RRCclass-NR ::= ENUMERATED +struct rr_cclass_nr_opts { + enum options { bcch_bch, bcch_dl_sch, dl_ccch, dl_dcch, pcch, ul_ccch, ul_ccch1, ul_dcch, /*...*/ nulltype } value; + typedef uint8_t number_type; + + const char* to_string() const; + uint8_t to_number() const; +}; +typedef enumerated rr_cclass_nr_e; + +// RRC-MessageID ::= SEQUENCE +struct rrc_msg_id_s { + struct rrc_type_c_ { + struct types_opts { + enum options { lte, nr, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + rrc_type_c_() = default; + rrc_type_c_(const rrc_type_c_& other); + rrc_type_c_& operator=(const rrc_type_c_& other); + ~rrc_type_c_() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + rr_cclass_lte_e& lte() + { + assert_choice_type(types::lte, type_, "rrcType"); + return c.get(); + } + rr_cclass_nr_e& nr() + { + assert_choice_type(types::nr, type_, "rrcType"); + return c.get(); + } + const rr_cclass_lte_e& lte() const + { + assert_choice_type(types::lte, type_, "rrcType"); + return c.get(); + } + const rr_cclass_nr_e& nr() const + { + assert_choice_type(types::nr, type_, "rrcType"); + return c.get(); + } + rr_cclass_lte_e& set_lte(); + rr_cclass_nr_e& set_nr(); + + private: + types type_; + pod_choice_buffer_t c; + + void destroy_(); + }; + + // member variables + bool ext = false; + rrc_type_c_ rrc_type; + int64_t msg_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// S-NSSAI ::= SEQUENCE +struct s_nssai_s { + bool ext = false; + bool sd_present = false; + fixed_octstring<1, true> sst; + fixed_octstring<3, true> sd; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// ServingCell-ARFCN ::= CHOICE +struct serving_cell_arfcn_c { + struct types_opts { + enum options { nr, eutra, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + serving_cell_arfcn_c() = default; + serving_cell_arfcn_c(const serving_cell_arfcn_c& other); + serving_cell_arfcn_c& operator=(const serving_cell_arfcn_c& other); + ~serving_cell_arfcn_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + nr_arfcn_s& nr() + { + assert_choice_type(types::nr, type_, "ServingCell-ARFCN"); + return c.get(); + } + uint32_t& eutra() + { + assert_choice_type(types::eutra, type_, "ServingCell-ARFCN"); + return c.get(); + } + const nr_arfcn_s& nr() const + { + assert_choice_type(types::nr, type_, "ServingCell-ARFCN"); + return c.get(); + } + const uint32_t& eutra() const + { + assert_choice_type(types::eutra, type_, "ServingCell-ARFCN"); + return c.get(); + } + nr_arfcn_s& set_nr(); + uint32_t& set_eutra(); + +private: + types type_; + choice_buffer_t c; + + void destroy_(); +}; + +// ServingCell-PCI ::= CHOICE +struct serving_cell_pci_c { + struct types_opts { + enum options { nr, eutra, /*...*/ nulltype } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + serving_cell_pci_c() = default; + serving_cell_pci_c(const serving_cell_pci_c& other); + serving_cell_pci_c& operator=(const serving_cell_pci_c& other); + ~serving_cell_pci_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + uint16_t& nr() + { + assert_choice_type(types::nr, type_, "ServingCell-PCI"); + return c.get(); + } + uint16_t& eutra() + { + assert_choice_type(types::eutra, type_, "ServingCell-PCI"); + return c.get(); + } + const uint16_t& nr() const + { + assert_choice_type(types::nr, type_, "ServingCell-PCI"); + return c.get(); + } + const uint16_t& eutra() const + { + assert_choice_type(types::eutra, type_, "ServingCell-PCI"); + return c.get(); + } + uint16_t& set_nr(); + uint16_t& set_eutra(); + +private: + types type_; + pod_choice_buffer_t c; + + void destroy_(); +}; + +// UEID-GNB-CU-CP-E1AP-ID-Item ::= SEQUENCE +struct ueid_gnb_cu_cp_e1_ap_id_item_s { + bool ext = false; + uint64_t gnb_cu_cp_ue_e1_ap_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID-GNB-CU-CP-F1AP-ID-Item ::= SEQUENCE +struct ueid_gnb_cu_cp_f1_ap_id_item_s { + bool ext = false; + uint64_t gnb_cu_ue_f1_ap_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID-GNB-CU-CP-E1AP-ID-List ::= SEQUENCE (SIZE (1..65535)) OF UEID-GNB-CU-CP-E1AP-ID-Item +using ueid_gnb_cu_cp_e1_ap_id_list_l = dyn_array; + +// UEID-GNB-CU-F1AP-ID-List ::= SEQUENCE (SIZE (1..4)) OF UEID-GNB-CU-CP-F1AP-ID-Item +using ueid_gnb_cu_f1_ap_id_list_l = dyn_array; + +// UEID-EN-GNB ::= SEQUENCE +struct ueid_en_gnb_s { + bool ext = false; + bool m_enb_ue_x2ap_id_ext_present = false; + bool gnb_cu_ue_f1_ap_id_present = false; + bool ran_ueid_present = false; + uint16_t m_enb_ue_x2ap_id = 0; + uint16_t m_enb_ue_x2ap_id_ext = 0; + global_enb_id_s global_enb_id; + uint64_t gnb_cu_ue_f1_ap_id = 0; + ueid_gnb_cu_cp_e1_ap_id_list_l gnb_cu_cp_ue_e1_ap_id_list; + fixed_octstring<8, true> ran_ueid; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID-ENB ::= SEQUENCE +struct ueid_enb_s { + bool ext = false; + bool m_enb_ue_x2ap_id_present = false; + bool m_enb_ue_x2ap_id_ext_present = false; + bool global_enb_id_present = false; + uint64_t mme_ue_s1ap_id = 0; + gummei_s gummei; + uint16_t m_enb_ue_x2ap_id = 0; + uint16_t m_enb_ue_x2ap_id_ext = 0; + global_enb_id_s global_enb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID-GNB ::= SEQUENCE +struct ueid_gnb_s { + bool ext = false; + bool ran_ueid_present = false; + bool m_ng_ran_ue_xn_ap_id_present = false; + bool global_gnb_id_present = false; + uint64_t amf_ue_ngap_id = 0; + guami_s guami; + ueid_gnb_cu_f1_ap_id_list_l gnb_cu_ue_f1_ap_id_list; + ueid_gnb_cu_cp_e1_ap_id_list_l gnb_cu_cp_ue_e1_ap_id_list; + fixed_octstring<8, true> ran_ueid; + uint64_t m_ng_ran_ue_xn_ap_id = 0; + global_gnb_id_s global_gnb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID-GNB-CU-UP ::= SEQUENCE +struct ueid_gnb_cu_up_s { + bool ext = false; + bool ran_ueid_present = false; + uint64_t gnb_cu_cp_ue_e1_ap_id = 0; + fixed_octstring<8, true> ran_ueid; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID-GNB-DU ::= SEQUENCE +struct ueid_gnb_du_s { + bool ext = false; + bool ran_ueid_present = false; + uint64_t gnb_cu_ue_f1_ap_id = 0; + fixed_octstring<8, true> ran_ueid; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID-NG-ENB ::= SEQUENCE +struct ueid_ng_enb_s { + bool ext = false; + bool ng_enb_cu_ue_w1_ap_id_present = false; + bool m_ng_ran_ue_xn_ap_id_present = false; + bool global_ng_enb_id_present = false; + uint64_t amf_ue_ngap_id = 0; + guami_s guami; + uint64_t ng_enb_cu_ue_w1_ap_id = 0; + uint64_t m_ng_ran_ue_xn_ap_id = 0; + global_ng_enb_id_s global_ng_enb_id; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID-NG-ENB-DU ::= SEQUENCE +struct ueid_ng_enb_du_s { + bool ext = false; + uint64_t ng_enb_cu_ue_w1_ap_id = 0; + // ... + + // sequence methods + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; +}; + +// UEID ::= CHOICE +struct ueid_c { + struct types_opts { + enum options { + gnb_ueid, + gnb_du_ueid, + gnb_cu_up_ueid, + ng_enb_ueid, + ng_enb_du_ueid, + en_g_nb_ueid, + enb_ueid, + // ... + nulltype + } value; + + const char* to_string() const; + }; + typedef enumerated types; + + // choice methods + ueid_c() = default; + ueid_c(const ueid_c& other); + ueid_c& operator=(const ueid_c& other); + ~ueid_c() { destroy_(); } + void set(types::options e = types::nulltype); + types type() const { return type_; } + SRSASN_CODE pack(bit_ref& bref) const; + SRSASN_CODE unpack(cbit_ref& bref); + void to_json(json_writer& j) const; + // getters + ueid_gnb_s& gnb_ueid() + { + assert_choice_type(types::gnb_ueid, type_, "UEID"); + return c.get(); + } + ueid_gnb_du_s& gnb_du_ueid() + { + assert_choice_type(types::gnb_du_ueid, type_, "UEID"); + return c.get(); + } + ueid_gnb_cu_up_s& gnb_cu_up_ueid() + { + assert_choice_type(types::gnb_cu_up_ueid, type_, "UEID"); + return c.get(); + } + ueid_ng_enb_s& ng_enb_ueid() + { + assert_choice_type(types::ng_enb_ueid, type_, "UEID"); + return c.get(); + } + ueid_ng_enb_du_s& ng_enb_du_ueid() + { + assert_choice_type(types::ng_enb_du_ueid, type_, "UEID"); + return c.get(); + } + ueid_en_gnb_s& en_g_nb_ueid() + { + assert_choice_type(types::en_g_nb_ueid, type_, "UEID"); + return c.get(); + } + ueid_enb_s& enb_ueid() + { + assert_choice_type(types::enb_ueid, type_, "UEID"); + return c.get(); + } + const ueid_gnb_s& gnb_ueid() const + { + assert_choice_type(types::gnb_ueid, type_, "UEID"); + return c.get(); + } + const ueid_gnb_du_s& gnb_du_ueid() const + { + assert_choice_type(types::gnb_du_ueid, type_, "UEID"); + return c.get(); + } + const ueid_gnb_cu_up_s& gnb_cu_up_ueid() const + { + assert_choice_type(types::gnb_cu_up_ueid, type_, "UEID"); + return c.get(); + } + const ueid_ng_enb_s& ng_enb_ueid() const + { + assert_choice_type(types::ng_enb_ueid, type_, "UEID"); + return c.get(); + } + const ueid_ng_enb_du_s& ng_enb_du_ueid() const + { + assert_choice_type(types::ng_enb_du_ueid, type_, "UEID"); + return c.get(); + } + const ueid_en_gnb_s& en_g_nb_ueid() const + { + assert_choice_type(types::en_g_nb_ueid, type_, "UEID"); + return c.get(); + } + const ueid_enb_s& enb_ueid() const + { + assert_choice_type(types::enb_ueid, type_, "UEID"); + return c.get(); + } + ueid_gnb_s& set_gnb_ueid(); + ueid_gnb_du_s& set_gnb_du_ueid(); + ueid_gnb_cu_up_s& set_gnb_cu_up_ueid(); + ueid_ng_enb_s& set_ng_enb_ueid(); + ueid_ng_enb_du_s& set_ng_enb_du_ueid(); + ueid_en_gnb_s& set_en_g_nb_ueid(); + ueid_enb_s& set_enb_ueid(); + +private: + types type_; + choice_buffer_t + c; + + void destroy_(); +}; + +} // namespace e2sm +} // namespace asn1 + +#endif // SRSASN1_E2SM_H diff --git a/lib/src/asn1/CMakeLists.txt b/lib/src/asn1/CMakeLists.txt index a95fe2b44..94fb79bf0 100644 --- a/lib/src/asn1/CMakeLists.txt +++ b/lib/src/asn1/CMakeLists.txt @@ -66,5 +66,9 @@ add_library(nas_5g_msg STATIC nas_5g_msg.cc nas_5g_ies.cc nas_5g_utils.cc) target_compile_options(nas_5g_msg PRIVATE "-Os") target_link_libraries(nas_5g_msg asn1_utils srsran_common) install(TARGETS nas_5g_msg DESTINATION ${LIBRARY_DIR} OPTIONAL) - +## ORAN E2 RIC +add_library(ric_e2 STATIC e2ap.cpp e2sm.cpp) +target_compile_options(ric_e2 PRIVATE "-Os") +target_link_libraries(ric_e2 asn1_utils srsran_common) +install(TARGETS ric_e2 DESTINATION ${LIBRARY_DIR} OPTIONAL) diff --git a/lib/src/asn1/e2ap.cpp b/lib/src/asn1/e2ap.cpp new file mode 100644 index 000000000..f6c492608 --- /dev/null +++ b/lib/src/asn1/e2ap.cpp @@ -0,0 +1,16048 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2021 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ + +#include "srsran/asn1/e2ap.h" +#include + +using namespace asn1; +using namespace asn1::e2ap; + +/******************************************************************************* + * Struct Methods + ******************************************************************************/ + +// CauseE2node ::= ENUMERATED +const char* cause_e2node_opts::to_string() const +{ + static const char* options[] = {"e2node-component-unknown"}; + return convert_enum_idx(options, 1, value, "cause_e2node_e"); +} +uint8_t cause_e2node_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "cause_e2node_e"); +} + +// CauseMisc ::= ENUMERATED +const char* cause_misc_opts::to_string() const +{ + static const char* options[] = {"control-processing-overload", "hardware-failure", "om-intervention", "unspecified"}; + return convert_enum_idx(options, 4, value, "cause_misc_e"); +} + +// CauseProtocol ::= ENUMERATED +const char* cause_protocol_opts::to_string() const +{ + static const char* options[] = {"transfer-syntax-error", + "abstract-syntax-error-reject", + "abstract-syntax-error-ignore-and-notify", + "message-not-compatible-with-receiver-state", + "semantic-error", + "abstract-syntax-error-falsely-constructed-message", + "unspecified"}; + return convert_enum_idx(options, 7, value, "cause_protocol_e"); +} + +// CauseRICrequest ::= ENUMERATED +const char* cause_ri_crequest_opts::to_string() const +{ + static const char* options[] = {"ran-function-id-invalid", + "action-not-supported", + "excessive-actions", + "duplicate-action", + "duplicate-event-trigger", + "function-resource-limit", + "request-id-unknown", + "inconsistent-action-subsequent-action-sequence", + "control-message-invalid", + "ric-call-process-id-invalid", + "control-timer-expired", + "control-failed-to-execute", + "system-not-ready", + "unspecified"}; + return convert_enum_idx(options, 14, value, "cause_ri_crequest_e"); +} + +// CauseRICservice ::= ENUMERATED +const char* cause_ricservice_opts::to_string() const +{ + static const char* options[] = {"ran-function-not-supported", "excessive-functions", "ric-resource-limit"}; + return convert_enum_idx(options, 3, value, "cause_ricservice_e"); +} + +// CauseTransport ::= ENUMERATED +const char* cause_transport_opts::to_string() const +{ + static const char* options[] = {"unspecified", "transport-resource-unavailable"}; + return convert_enum_idx(options, 2, value, "cause_transport_e"); +} + +// Cause ::= CHOICE +void cause_c::destroy_() {} +void cause_c::set(types::options e) +{ + destroy_(); + type_ = e; +} +cause_c::cause_c(const cause_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ric_request: + c.init(other.c.get()); + break; + case types::ric_service: + c.init(other.c.get()); + break; + case types::e2_node: + c.init(other.c.get()); + break; + case types::transport: + c.init(other.c.get()); + break; + case types::protocol: + c.init(other.c.get()); + break; + case types::misc: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "cause_c"); + } +} +cause_c& cause_c::operator=(const cause_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ric_request: + c.set(other.c.get()); + break; + case types::ric_service: + c.set(other.c.get()); + break; + case types::e2_node: + c.set(other.c.get()); + break; + case types::transport: + c.set(other.c.get()); + break; + case types::protocol: + c.set(other.c.get()); + break; + case types::misc: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "cause_c"); + } + + return *this; +} +cause_ri_crequest_e& cause_c::set_ric_request() +{ + set(types::ric_request); + return c.get(); +} +cause_ricservice_e& cause_c::set_ric_service() +{ + set(types::ric_service); + return c.get(); +} +cause_e2node_e& cause_c::set_e2_node() +{ + set(types::e2_node); + return c.get(); +} +cause_transport_e& cause_c::set_transport() +{ + set(types::transport); + return c.get(); +} +cause_protocol_e& cause_c::set_protocol() +{ + set(types::protocol); + return c.get(); +} +cause_misc_e& cause_c::set_misc() +{ + set(types::misc); + return c.get(); +} +void cause_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ric_request: + j.write_str("ricRequest", c.get().to_string()); + break; + case types::ric_service: + j.write_str("ricService", c.get().to_string()); + break; + case types::e2_node: + j.write_str("e2Node", "e2node-component-unknown"); + break; + case types::transport: + j.write_str("transport", c.get().to_string()); + break; + case types::protocol: + j.write_str("protocol", c.get().to_string()); + break; + case types::misc: + j.write_str("misc", c.get().to_string()); + break; + default: + log_invalid_choice_id(type_, "cause_c"); + } + j.end_obj(); +} +SRSASN_CODE cause_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::ric_request: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ric_service: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2_node: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::transport: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::protocol: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::misc: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "cause_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE cause_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::ric_request: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ric_service: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2_node: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::transport: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::protocol: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::misc: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "cause_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* cause_c::types_opts::to_string() const +{ + static const char* options[] = {"ricRequest", "ricService", "e2Node", "transport", "protocol", "misc"}; + return convert_enum_idx(options, 6, value, "cause_c::types"); +} +uint8_t cause_c::types_opts::to_number() const +{ + if (value == e2_node) { + return 2; + } + invalid_enum_number(value, "cause_c::types"); + return 0; +} + +// TypeOfError ::= ENUMERATED +const char* type_of_error_opts::to_string() const +{ + static const char* options[] = {"not-understood", "missing"}; + return convert_enum_idx(options, 2, value, "type_of_error_e"); +} + +// CriticalityDiagnostics-IE-Item ::= SEQUENCE +SRSASN_CODE crit_diagnostics_ie_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(iecrit.pack(bref)); + HANDLE_CODE(pack_integer(bref, ie_id, (uint32_t)0u, (uint32_t)65535u, false, true)); + HANDLE_CODE(type_of_error.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE crit_diagnostics_ie_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(iecrit.unpack(bref)); + HANDLE_CODE(unpack_integer(ie_id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + HANDLE_CODE(type_of_error.unpack(bref)); + + return SRSASN_SUCCESS; +} +void crit_diagnostics_ie_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("iECriticality", iecrit.to_string()); + j.write_int("iE-ID", ie_id); + j.write_str("typeOfError", type_of_error.to_string()); + j.end_obj(); +} + +// RICrequestID ::= SEQUENCE +SRSASN_CODE ri_crequest_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, ric_requestor_id, (uint32_t)0u, (uint32_t)65535u, false, true)); + HANDLE_CODE(pack_integer(bref, ric_instance_id, (uint32_t)0u, (uint32_t)65535u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_crequest_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(ric_requestor_id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + HANDLE_CODE(unpack_integer(ric_instance_id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + + return SRSASN_SUCCESS; +} +void ri_crequest_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ricRequestorID", ric_requestor_id); + j.write_int("ricInstanceID", ric_instance_id); + j.end_obj(); +} + +// TriggeringMessage ::= ENUMERATED +const char* trigger_msg_opts::to_string() const +{ + static const char* options[] = {"initiating-message", "successful-outcome", "unsuccessfull-outcome"}; + return convert_enum_idx(options, 3, value, "trigger_msg_e"); +} + +// CriticalityDiagnostics ::= SEQUENCE +SRSASN_CODE crit_diagnostics_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(proc_code_present, 1)); + HANDLE_CODE(bref.pack(trigger_msg_present, 1)); + HANDLE_CODE(bref.pack(proc_crit_present, 1)); + HANDLE_CODE(bref.pack(ric_requestor_id_present, 1)); + HANDLE_CODE(bref.pack(ies_crit_diagnostics.size() > 0, 1)); + + if (proc_code_present) { + HANDLE_CODE(pack_integer(bref, proc_code, (uint16_t)0u, (uint16_t)255u, false, true)); + } + if (trigger_msg_present) { + HANDLE_CODE(trigger_msg.pack(bref)); + } + if (proc_crit_present) { + HANDLE_CODE(proc_crit.pack(bref)); + } + if (ric_requestor_id_present) { + HANDLE_CODE(ric_requestor_id.pack(bref)); + } + if (ies_crit_diagnostics.size() > 0) { + HANDLE_CODE(pack_dyn_seq_of(bref, ies_crit_diagnostics, 1, 256, true)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE crit_diagnostics_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(proc_code_present, 1)); + HANDLE_CODE(bref.unpack(trigger_msg_present, 1)); + HANDLE_CODE(bref.unpack(proc_crit_present, 1)); + HANDLE_CODE(bref.unpack(ric_requestor_id_present, 1)); + bool ies_crit_diagnostics_present; + HANDLE_CODE(bref.unpack(ies_crit_diagnostics_present, 1)); + + if (proc_code_present) { + HANDLE_CODE(unpack_integer(proc_code, bref, (uint16_t)0u, (uint16_t)255u, false, true)); + } + if (trigger_msg_present) { + HANDLE_CODE(trigger_msg.unpack(bref)); + } + if (proc_crit_present) { + HANDLE_CODE(proc_crit.unpack(bref)); + } + if (ric_requestor_id_present) { + HANDLE_CODE(ric_requestor_id.unpack(bref)); + } + if (ies_crit_diagnostics_present) { + HANDLE_CODE(unpack_dyn_seq_of(ies_crit_diagnostics, bref, 1, 256, true)); + } + + return SRSASN_SUCCESS; +} +void crit_diagnostics_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (proc_code_present) { + j.write_int("procedureCode", proc_code); + } + if (trigger_msg_present) { + j.write_str("triggeringMessage", trigger_msg.to_string()); + } + if (proc_crit_present) { + j.write_str("procedureCriticality", proc_crit.to_string()); + } + if (ric_requestor_id_present) { + j.write_fieldname("ricRequestorID"); + ric_requestor_id.to_json(j); + } + if (ies_crit_diagnostics.size() > 0) { + j.start_array("iEsCriticalityDiagnostics"); + for (const auto& e1 : ies_crit_diagnostics) { + e1.to_json(j); + } + j.end_array(); + } + j.end_obj(); +} + +// ENB-ID-Choice ::= CHOICE +void enb_id_choice_c::destroy_() +{ + switch (type_) { + case types::enb_id_macro: + c.destroy >(); + break; + case types::enb_id_shortmacro: + c.destroy >(); + break; + case types::enb_id_longmacro: + c.destroy >(); + break; + default: + break; + } +} +void enb_id_choice_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::enb_id_macro: + c.init >(); + break; + case types::enb_id_shortmacro: + c.init >(); + break; + case types::enb_id_longmacro: + c.init >(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_choice_c"); + } +} +enb_id_choice_c::enb_id_choice_c(const enb_id_choice_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::enb_id_macro: + c.init(other.c.get >()); + break; + case types::enb_id_shortmacro: + c.init(other.c.get >()); + break; + case types::enb_id_longmacro: + c.init(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_choice_c"); + } +} +enb_id_choice_c& enb_id_choice_c::operator=(const enb_id_choice_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::enb_id_macro: + c.set(other.c.get >()); + break; + case types::enb_id_shortmacro: + c.set(other.c.get >()); + break; + case types::enb_id_longmacro: + c.set(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_choice_c"); + } + + return *this; +} +fixed_bitstring<20, false, true>& enb_id_choice_c::set_enb_id_macro() +{ + set(types::enb_id_macro); + return c.get >(); +} +fixed_bitstring<18, false, true>& enb_id_choice_c::set_enb_id_shortmacro() +{ + set(types::enb_id_shortmacro); + return c.get >(); +} +fixed_bitstring<21, false, true>& enb_id_choice_c::set_enb_id_longmacro() +{ + set(types::enb_id_longmacro); + return c.get >(); +} +void enb_id_choice_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::enb_id_macro: + j.write_str("enb-ID-macro", c.get >().to_string()); + break; + case types::enb_id_shortmacro: + j.write_str("enb-ID-shortmacro", c.get >().to_string()); + break; + case types::enb_id_longmacro: + j.write_str("enb-ID-longmacro", c.get >().to_string()); + break; + default: + log_invalid_choice_id(type_, "enb_id_choice_c"); + } + j.end_obj(); +} +SRSASN_CODE enb_id_choice_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::enb_id_macro: + HANDLE_CODE((c.get >().pack(bref))); + break; + case types::enb_id_shortmacro: + HANDLE_CODE((c.get >().pack(bref))); + break; + case types::enb_id_longmacro: + HANDLE_CODE((c.get >().pack(bref))); + break; + default: + log_invalid_choice_id(type_, "enb_id_choice_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE enb_id_choice_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::enb_id_macro: + HANDLE_CODE((c.get >().unpack(bref))); + break; + case types::enb_id_shortmacro: + HANDLE_CODE((c.get >().unpack(bref))); + break; + case types::enb_id_longmacro: + HANDLE_CODE((c.get >().unpack(bref))); + break; + default: + log_invalid_choice_id(type_, "enb_id_choice_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* enb_id_choice_c::types_opts::to_string() const +{ + static const char* options[] = {"enb-ID-macro", "enb-ID-shortmacro", "enb-ID-longmacro"}; + return convert_enum_idx(options, 3, value, "enb_id_choice_c::types"); +} + +// GNB-ID-Choice ::= CHOICE +void gnb_id_choice_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("gnb-ID", c.to_string()); + j.end_obj(); +} +SRSASN_CODE gnb_id_choice_c::pack(bit_ref& bref) const +{ + pack_enum(bref, type()); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE gnb_id_choice_c::unpack(cbit_ref& bref) +{ + types e; + unpack_enum(e, bref); + if (e != type()) { + log_invalid_choice_id(e, "gnb_id_choice_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* gnb_id_choice_c::types_opts::to_string() const +{ + static const char* options[] = {"gnb-ID"}; + return convert_enum_idx(options, 1, value, "gnb_id_choice_c::types"); +} + +// ENB-ID ::= CHOICE +void enb_id_c::destroy_() +{ + switch (type_) { + case types::macro_enb_id: + c.destroy >(); + break; + case types::home_enb_id: + c.destroy >(); + break; + case types::short_macro_enb_id: + c.destroy >(); + break; + case types::long_macro_enb_id: + c.destroy >(); + break; + default: + break; + } +} +void enb_id_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::macro_enb_id: + c.init >(); + break; + case types::home_enb_id: + c.init >(); + break; + case types::short_macro_enb_id: + c.init >(); + break; + case types::long_macro_enb_id: + c.init >(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + } +} +enb_id_c::enb_id_c(const enb_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::macro_enb_id: + c.init(other.c.get >()); + break; + case types::home_enb_id: + c.init(other.c.get >()); + break; + case types::short_macro_enb_id: + c.init(other.c.get >()); + break; + case types::long_macro_enb_id: + c.init(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + } +} +enb_id_c& enb_id_c::operator=(const enb_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::macro_enb_id: + c.set(other.c.get >()); + break; + case types::home_enb_id: + c.set(other.c.get >()); + break; + case types::short_macro_enb_id: + c.set(other.c.get >()); + break; + case types::long_macro_enb_id: + c.set(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + } + + return *this; +} +fixed_bitstring<20, false, true>& enb_id_c::set_macro_enb_id() +{ + set(types::macro_enb_id); + return c.get >(); +} +fixed_bitstring<28, false, true>& enb_id_c::set_home_enb_id() +{ + set(types::home_enb_id); + return c.get >(); +} +fixed_bitstring<18, false, true>& enb_id_c::set_short_macro_enb_id() +{ + set(types::short_macro_enb_id); + return c.get >(); +} +fixed_bitstring<21, false, true>& enb_id_c::set_long_macro_enb_id() +{ + set(types::long_macro_enb_id); + return c.get >(); +} +void enb_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::macro_enb_id: + j.write_str("macro-eNB-ID", c.get >().to_string()); + break; + case types::home_enb_id: + j.write_str("home-eNB-ID", c.get >().to_string()); + break; + case types::short_macro_enb_id: + j.write_str("short-Macro-eNB-ID", c.get >().to_string()); + break; + case types::long_macro_enb_id: + j.write_str("long-Macro-eNB-ID", c.get >().to_string()); + break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + } + j.end_obj(); +} +SRSASN_CODE enb_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::macro_enb_id: + HANDLE_CODE((c.get >().pack(bref))); + break; + case types::home_enb_id: + HANDLE_CODE((c.get >().pack(bref))); + break; + case types::short_macro_enb_id: { + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE((c.get >().pack(bref))); + } break; + case types::long_macro_enb_id: { + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE((c.get >().pack(bref))); + } break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE enb_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::macro_enb_id: + HANDLE_CODE((c.get >().unpack(bref))); + break; + case types::home_enb_id: + HANDLE_CODE((c.get >().unpack(bref))); + break; + case types::short_macro_enb_id: { + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE((c.get >().unpack(bref))); + } break; + case types::long_macro_enb_id: { + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE((c.get >().unpack(bref))); + } break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* enb_id_c::types_opts::to_string() const +{ + static const char* options[] = {"macro-eNB-ID", "home-eNB-ID", "short-Macro-eNB-ID", "long-Macro-eNB-ID"}; + return convert_enum_idx(options, 4, value, "enb_id_c::types"); +} + +// ENGNB-ID ::= CHOICE +void engnb_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("gNB-ID", c.to_string()); + j.end_obj(); +} +SRSASN_CODE engnb_id_c::pack(bit_ref& bref) const +{ + pack_enum(bref, type()); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE engnb_id_c::unpack(cbit_ref& bref) +{ + types e; + unpack_enum(e, bref); + if (e != type()) { + log_invalid_choice_id(e, "engnb_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* engnb_id_c::types_opts::to_string() const +{ + static const char* options[] = {"gNB-ID"}; + return convert_enum_idx(options, 1, value, "engnb_id_c::types"); +} + +// GlobalgNB-ID ::= SEQUENCE +SRSASN_CODE globalg_nb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(gnb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE globalg_nb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(gnb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void globalg_nb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("plmn-id", plmn_id.to_string()); + j.write_fieldname("gnb-id"); + gnb_id.to_json(j); + j.end_obj(); +} + +// GlobalngeNB-ID ::= SEQUENCE +SRSASN_CODE globalngenb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(enb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE globalngenb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(enb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void globalngenb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("plmn-id", plmn_id.to_string()); + j.write_fieldname("enb-id"); + enb_id.to_json(j); + j.end_obj(); +} + +// GlobalENB-ID ::= SEQUENCE +SRSASN_CODE global_enb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(enb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_enb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(enb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void global_enb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMN-Identity", plmn_id.to_string()); + j.write_fieldname("eNB-ID"); + enb_id.to_json(j); + j.end_obj(); +} + +// GlobalNG-RANNode-ID ::= CHOICE +void global_ng_ran_node_id_c::destroy_() +{ + switch (type_) { + case types::gnb: + c.destroy(); + break; + case types::ng_enb: + c.destroy(); + break; + default: + break; + } +} +void global_ng_ran_node_id_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::gnb: + c.init(); + break; + case types::ng_enb: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_ng_ran_node_id_c"); + } +} +global_ng_ran_node_id_c::global_ng_ran_node_id_c(const global_ng_ran_node_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::gnb: + c.init(other.c.get()); + break; + case types::ng_enb: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_ng_ran_node_id_c"); + } +} +global_ng_ran_node_id_c& global_ng_ran_node_id_c::operator=(const global_ng_ran_node_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::gnb: + c.set(other.c.get()); + break; + case types::ng_enb: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_ng_ran_node_id_c"); + } + + return *this; +} +globalg_nb_id_s& global_ng_ran_node_id_c::set_gnb() +{ + set(types::gnb); + return c.get(); +} +globalngenb_id_s& global_ng_ran_node_id_c::set_ng_enb() +{ + set(types::ng_enb); + return c.get(); +} +void global_ng_ran_node_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::gnb: + j.write_fieldname("gNB"); + c.get().to_json(j); + break; + case types::ng_enb: + j.write_fieldname("ng-eNB"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "global_ng_ran_node_id_c"); + } + j.end_obj(); +} +SRSASN_CODE global_ng_ran_node_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::gnb: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ng_enb: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "global_ng_ran_node_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE global_ng_ran_node_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::gnb: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ng_enb: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "global_ng_ran_node_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* global_ng_ran_node_id_c::types_opts::to_string() const +{ + static const char* options[] = {"gNB", "ng-eNB"}; + return convert_enum_idx(options, 2, value, "global_ng_ran_node_id_c::types"); +} + +// GlobalenGNB-ID ::= SEQUENCE +SRSASN_CODE globalen_gnb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(gnb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE globalen_gnb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(gnb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void globalen_gnb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMN-Identity", plmn_id.to_string()); + j.write_fieldname("gNB-ID"); + gnb_id.to_json(j); + j.end_obj(); +} + +// RICsubsequentActionType ::= ENUMERATED +const char* ricsubsequent_action_type_opts::to_string() const +{ + static const char* options[] = {"continue", "wait"}; + return convert_enum_idx(options, 2, value, "ricsubsequent_action_type_e"); +} + +// RICtimeToWait ::= ENUMERATED +const char* ri_ctime_to_wait_opts::to_string() const +{ + static const char* options[] = {"w1ms", + "w2ms", + "w5ms", + "w10ms", + "w20ms", + "w30ms", + "w40ms", + "w50ms", + "w100ms", + "w200ms", + "w500ms", + "w1s", + "w2s", + "w5s", + "w10s", + "w20s", + "w60s"}; + return convert_enum_idx(options, 17, value, "ri_ctime_to_wait_e"); +} + +// E2nodeComponentInterfaceE1 ::= SEQUENCE +SRSASN_CODE e2node_component_interface_e1_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, gnb_cu_cp_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_interface_e1_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(gnb_cu_cp_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +void e2node_component_interface_e1_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("gNB-CU-CP-ID", gnb_cu_cp_id); + j.end_obj(); +} + +// E2nodeComponentInterfaceF1 ::= SEQUENCE +SRSASN_CODE e2node_component_interface_f1_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, gnb_du_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_interface_f1_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(gnb_du_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +void e2node_component_interface_f1_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("gNB-DU-ID", gnb_du_id); + j.end_obj(); +} + +// E2nodeComponentInterfaceNG ::= SEQUENCE +SRSASN_CODE e2node_component_interface_ng_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(amf_name.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_interface_ng_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(amf_name.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_interface_ng_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("amf-name", amf_name.to_string()); + j.end_obj(); +} + +// E2nodeComponentInterfaceS1 ::= SEQUENCE +SRSASN_CODE e2node_component_interface_s1_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(mme_name.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_interface_s1_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(mme_name.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_interface_s1_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("mme-name", mme_name.to_string()); + j.end_obj(); +} + +// E2nodeComponentInterfaceW1 ::= SEQUENCE +SRSASN_CODE e2node_component_interface_w1_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, ng_enb_du_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_interface_w1_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(ng_enb_du_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +void e2node_component_interface_w1_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ng-eNB-DU-ID", ng_enb_du_id); + j.end_obj(); +} + +// E2nodeComponentInterfaceX2 ::= SEQUENCE +SRSASN_CODE e2node_component_interface_x2_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(global_enb_id_present, 1)); + HANDLE_CODE(bref.pack(global_en_g_nb_id_present, 1)); + + if (global_enb_id_present) { + HANDLE_CODE(global_enb_id.pack(bref)); + } + if (global_en_g_nb_id_present) { + HANDLE_CODE(global_en_g_nb_id.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_interface_x2_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(global_enb_id_present, 1)); + HANDLE_CODE(bref.unpack(global_en_g_nb_id_present, 1)); + + if (global_enb_id_present) { + HANDLE_CODE(global_enb_id.unpack(bref)); + } + if (global_en_g_nb_id_present) { + HANDLE_CODE(global_en_g_nb_id.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void e2node_component_interface_x2_s::to_json(json_writer& j) const +{ + j.start_obj(); + if (global_enb_id_present) { + j.write_fieldname("global-eNB-ID"); + global_enb_id.to_json(j); + } + if (global_en_g_nb_id_present) { + j.write_fieldname("global-en-gNB-ID"); + global_en_g_nb_id.to_json(j); + } + j.end_obj(); +} + +// E2nodeComponentInterfaceXn ::= SEQUENCE +SRSASN_CODE e2node_component_interface_xn_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(global_ng_ran_node_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_interface_xn_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(global_ng_ran_node_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_interface_xn_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-NG-RAN-Node-ID"); + global_ng_ran_node_id.to_json(j); + j.end_obj(); +} + +// RICactionType ::= ENUMERATED +const char* ri_caction_type_opts::to_string() const +{ + static const char* options[] = {"report", "insert", "policy"}; + return convert_enum_idx(options, 3, value, "ri_caction_type_e"); +} + +// RICsubsequentAction ::= SEQUENCE +SRSASN_CODE ricsubsequent_action_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(ric_subsequent_action_type.pack(bref)); + HANDLE_CODE(ric_time_to_wait.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubsequent_action_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(ric_subsequent_action_type.unpack(bref)); + HANDLE_CODE(ric_time_to_wait.unpack(bref)); + + return SRSASN_SUCCESS; +} +void ricsubsequent_action_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("ricSubsequentActionType", ric_subsequent_action_type.to_string()); + j.write_str("ricTimeToWait", ric_time_to_wait.to_string()); + j.end_obj(); +} + +// E2nodeComponentConfiguration ::= SEQUENCE +SRSASN_CODE e2node_component_cfg_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(e2node_component_request_part.pack(bref)); + HANDLE_CODE(e2node_component_resp_part.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(e2node_component_request_part.unpack(bref)); + HANDLE_CODE(e2node_component_resp_part.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_cfg_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("e2nodeComponentRequestPart", e2node_component_request_part.to_string()); + j.write_str("e2nodeComponentResponsePart", e2node_component_resp_part.to_string()); + j.end_obj(); +} + +// E2nodeComponentConfigurationAck ::= SEQUENCE +SRSASN_CODE e2node_component_cfg_ack_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(fail_cause_present, 1)); + + HANDLE_CODE(upd_outcome.pack(bref)); + if (fail_cause_present) { + HANDLE_CODE(fail_cause.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_ack_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(fail_cause_present, 1)); + + HANDLE_CODE(upd_outcome.unpack(bref)); + if (fail_cause_present) { + HANDLE_CODE(fail_cause.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void e2node_component_cfg_ack_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("updateOutcome", upd_outcome.to_string()); + if (fail_cause_present) { + j.write_fieldname("failureCause"); + fail_cause.to_json(j); + } + j.end_obj(); +} + +const char* e2node_component_cfg_ack_s::upd_outcome_opts::to_string() const +{ + static const char* options[] = {"success", "failure"}; + return convert_enum_idx(options, 2, value, "e2node_component_cfg_ack_s::upd_outcome_e_"); +} + +// E2nodeComponentID ::= CHOICE +void e2node_component_id_c::destroy_() +{ + switch (type_) { + case types::e2node_component_interface_type_ng: + c.destroy(); + break; + case types::e2node_component_interface_type_xn: + c.destroy(); + break; + case types::e2node_component_interface_type_e1: + c.destroy(); + break; + case types::e2node_component_interface_type_f1: + c.destroy(); + break; + case types::e2node_component_interface_type_w1: + c.destroy(); + break; + case types::e2node_component_interface_type_s1: + c.destroy(); + break; + case types::e2node_component_interface_type_x2: + c.destroy(); + break; + default: + break; + } +} +void e2node_component_id_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::e2node_component_interface_type_ng: + c.init(); + break; + case types::e2node_component_interface_type_xn: + c.init(); + break; + case types::e2node_component_interface_type_e1: + c.init(); + break; + case types::e2node_component_interface_type_f1: + c.init(); + break; + case types::e2node_component_interface_type_w1: + c.init(); + break; + case types::e2node_component_interface_type_s1: + c.init(); + break; + case types::e2node_component_interface_type_x2: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_component_id_c"); + } +} +e2node_component_id_c::e2node_component_id_c(const e2node_component_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::e2node_component_interface_type_ng: + c.init(other.c.get()); + break; + case types::e2node_component_interface_type_xn: + c.init(other.c.get()); + break; + case types::e2node_component_interface_type_e1: + c.init(other.c.get()); + break; + case types::e2node_component_interface_type_f1: + c.init(other.c.get()); + break; + case types::e2node_component_interface_type_w1: + c.init(other.c.get()); + break; + case types::e2node_component_interface_type_s1: + c.init(other.c.get()); + break; + case types::e2node_component_interface_type_x2: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_component_id_c"); + } +} +e2node_component_id_c& e2node_component_id_c::operator=(const e2node_component_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::e2node_component_interface_type_ng: + c.set(other.c.get()); + break; + case types::e2node_component_interface_type_xn: + c.set(other.c.get()); + break; + case types::e2node_component_interface_type_e1: + c.set(other.c.get()); + break; + case types::e2node_component_interface_type_f1: + c.set(other.c.get()); + break; + case types::e2node_component_interface_type_w1: + c.set(other.c.get()); + break; + case types::e2node_component_interface_type_s1: + c.set(other.c.get()); + break; + case types::e2node_component_interface_type_x2: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_component_id_c"); + } + + return *this; +} +e2node_component_interface_ng_s& e2node_component_id_c::set_e2node_component_interface_type_ng() +{ + set(types::e2node_component_interface_type_ng); + return c.get(); +} +e2node_component_interface_xn_s& e2node_component_id_c::set_e2node_component_interface_type_xn() +{ + set(types::e2node_component_interface_type_xn); + return c.get(); +} +e2node_component_interface_e1_s& e2node_component_id_c::set_e2node_component_interface_type_e1() +{ + set(types::e2node_component_interface_type_e1); + return c.get(); +} +e2node_component_interface_f1_s& e2node_component_id_c::set_e2node_component_interface_type_f1() +{ + set(types::e2node_component_interface_type_f1); + return c.get(); +} +e2node_component_interface_w1_s& e2node_component_id_c::set_e2node_component_interface_type_w1() +{ + set(types::e2node_component_interface_type_w1); + return c.get(); +} +e2node_component_interface_s1_s& e2node_component_id_c::set_e2node_component_interface_type_s1() +{ + set(types::e2node_component_interface_type_s1); + return c.get(); +} +e2node_component_interface_x2_s& e2node_component_id_c::set_e2node_component_interface_type_x2() +{ + set(types::e2node_component_interface_type_x2); + return c.get(); +} +void e2node_component_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::e2node_component_interface_type_ng: + j.write_fieldname("e2nodeComponentInterfaceTypeNG"); + c.get().to_json(j); + break; + case types::e2node_component_interface_type_xn: + j.write_fieldname("e2nodeComponentInterfaceTypeXn"); + c.get().to_json(j); + break; + case types::e2node_component_interface_type_e1: + j.write_fieldname("e2nodeComponentInterfaceTypeE1"); + c.get().to_json(j); + break; + case types::e2node_component_interface_type_f1: + j.write_fieldname("e2nodeComponentInterfaceTypeF1"); + c.get().to_json(j); + break; + case types::e2node_component_interface_type_w1: + j.write_fieldname("e2nodeComponentInterfaceTypeW1"); + c.get().to_json(j); + break; + case types::e2node_component_interface_type_s1: + j.write_fieldname("e2nodeComponentInterfaceTypeS1"); + c.get().to_json(j); + break; + case types::e2node_component_interface_type_x2: + j.write_fieldname("e2nodeComponentInterfaceTypeX2"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2node_component_id_c"); + } + j.end_obj(); +} +SRSASN_CODE e2node_component_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::e2node_component_interface_type_ng: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_component_interface_type_xn: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_component_interface_type_e1: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_component_interface_type_f1: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_component_interface_type_w1: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_component_interface_type_s1: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_component_interface_type_x2: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2node_component_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::e2node_component_interface_type_ng: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_component_interface_type_xn: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_component_interface_type_e1: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_component_interface_type_f1: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_component_interface_type_w1: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_component_interface_type_s1: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_component_interface_type_x2: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2node_component_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2node_component_id_c::types_opts::to_string() const +{ + static const char* options[] = {"e2nodeComponentInterfaceTypeNG", + "e2nodeComponentInterfaceTypeXn", + "e2nodeComponentInterfaceTypeE1", + "e2nodeComponentInterfaceTypeF1", + "e2nodeComponentInterfaceTypeW1", + "e2nodeComponentInterfaceTypeS1", + "e2nodeComponentInterfaceTypeX2"}; + return convert_enum_idx(options, 7, value, "e2node_component_id_c::types"); +} + +// E2nodeComponentInterfaceType ::= ENUMERATED +const char* e2node_component_interface_type_opts::to_string() const +{ + static const char* options[] = {"ng", "xn", "e1", "f1", "w1", "s1", "x2"}; + return convert_enum_idx(options, 7, value, "e2node_component_interface_type_e"); +} + +// RICaction-ToBeSetup-Item ::= SEQUENCE +SRSASN_CODE ri_caction_to_be_setup_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(ric_action_definition.size() > 0, 1)); + HANDLE_CODE(bref.pack(ric_subsequent_action_present, 1)); + + HANDLE_CODE(pack_integer(bref, ric_action_id, (uint16_t)0u, (uint16_t)255u, false, true)); + HANDLE_CODE(ric_action_type.pack(bref)); + if (ric_action_definition.size() > 0) { + HANDLE_CODE(ric_action_definition.pack(bref)); + } + if (ric_subsequent_action_present) { + HANDLE_CODE(ric_subsequent_action.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_caction_to_be_setup_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + bool ric_action_definition_present; + HANDLE_CODE(bref.unpack(ric_action_definition_present, 1)); + HANDLE_CODE(bref.unpack(ric_subsequent_action_present, 1)); + + HANDLE_CODE(unpack_integer(ric_action_id, bref, (uint16_t)0u, (uint16_t)255u, false, true)); + HANDLE_CODE(ric_action_type.unpack(bref)); + if (ric_action_definition_present) { + HANDLE_CODE(ric_action_definition.unpack(bref)); + } + if (ric_subsequent_action_present) { + HANDLE_CODE(ric_subsequent_action.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ri_caction_to_be_setup_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ricActionID", ric_action_id); + j.write_str("ricActionType", ric_action_type.to_string()); + if (ric_action_definition.size() > 0) { + j.write_str("ricActionDefinition", ric_action_definition.to_string()); + } + if (ric_subsequent_action_present) { + j.write_fieldname("ricSubsequentAction"); + ric_subsequent_action.to_json(j); + } + j.end_obj(); +} + +// TNLinformation ::= SEQUENCE +SRSASN_CODE tn_linfo_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(tnl_port_present, 1)); + + HANDLE_CODE(tnl_address.pack(bref)); + if (tnl_port_present) { + HANDLE_CODE(tnl_port.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE tn_linfo_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(tnl_port_present, 1)); + + HANDLE_CODE(tnl_address.unpack(bref)); + if (tnl_port_present) { + HANDLE_CODE(tnl_port.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void tn_linfo_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("tnlAddress", tnl_address.to_string()); + if (tnl_port_present) { + j.write_str("tnlPort", tnl_port.to_string()); + } + j.end_obj(); +} + +// TNLusage ::= ENUMERATED +const char* tn_lusage_opts::to_string() const +{ + static const char* options[] = {"ric-service", "support-function", "both"}; + return convert_enum_idx(options, 3, value, "tn_lusage_e"); +} + +// E2connectionSetupFailed-Item ::= SEQUENCE +SRSASN_CODE e2conn_setup_failed_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(tnl_info.pack(bref)); + HANDLE_CODE(cause.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_setup_failed_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(tnl_info.unpack(bref)); + HANDLE_CODE(cause.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2conn_setup_failed_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("tnlInformation"); + tnl_info.to_json(j); + j.write_fieldname("cause"); + cause.to_json(j); + j.end_obj(); +} + +// E2connectionUpdate-Item ::= SEQUENCE +SRSASN_CODE e2conn_upd_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(tnl_info.pack(bref)); + HANDLE_CODE(tnl_usage.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(tnl_info.unpack(bref)); + HANDLE_CODE(tnl_usage.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2conn_upd_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("tnlInformation"); + tnl_info.to_json(j); + j.write_str("tnlUsage", tnl_usage.to_string()); + j.end_obj(); +} + +// E2connectionUpdateRemove-Item ::= SEQUENCE +SRSASN_CODE e2conn_upd_rem_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(tnl_info.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_rem_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(tnl_info.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2conn_upd_rem_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("tnlInformation"); + tnl_info.to_json(j); + j.end_obj(); +} + +// E2nodeComponentConfigAddition-Item ::= SEQUENCE +SRSASN_CODE e2node_component_cfg_addition_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.pack(bref)); + HANDLE_CODE(e2node_component_id.pack(bref)); + HANDLE_CODE(e2node_component_cfg.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_addition_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.unpack(bref)); + HANDLE_CODE(e2node_component_id.unpack(bref)); + HANDLE_CODE(e2node_component_cfg.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_cfg_addition_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("e2nodeComponentInterfaceType", e2node_component_interface_type.to_string()); + j.write_fieldname("e2nodeComponentID"); + e2node_component_id.to_json(j); + j.write_fieldname("e2nodeComponentConfiguration"); + e2node_component_cfg.to_json(j); + j.end_obj(); +} + +// E2nodeComponentConfigAdditionAck-Item ::= SEQUENCE +SRSASN_CODE e2node_component_cfg_addition_ack_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.pack(bref)); + HANDLE_CODE(e2node_component_id.pack(bref)); + HANDLE_CODE(e2node_component_cfg_ack.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_addition_ack_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.unpack(bref)); + HANDLE_CODE(e2node_component_id.unpack(bref)); + HANDLE_CODE(e2node_component_cfg_ack.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_cfg_addition_ack_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("e2nodeComponentInterfaceType", e2node_component_interface_type.to_string()); + j.write_fieldname("e2nodeComponentID"); + e2node_component_id.to_json(j); + j.write_fieldname("e2nodeComponentConfigurationAck"); + e2node_component_cfg_ack.to_json(j); + j.end_obj(); +} + +// E2nodeComponentConfigRemoval-Item ::= SEQUENCE +SRSASN_CODE e2node_component_cfg_removal_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.pack(bref)); + HANDLE_CODE(e2node_component_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_removal_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.unpack(bref)); + HANDLE_CODE(e2node_component_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_cfg_removal_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("e2nodeComponentInterfaceType", e2node_component_interface_type.to_string()); + j.write_fieldname("e2nodeComponentID"); + e2node_component_id.to_json(j); + j.end_obj(); +} + +// E2nodeComponentConfigRemovalAck-Item ::= SEQUENCE +SRSASN_CODE e2node_component_cfg_removal_ack_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.pack(bref)); + HANDLE_CODE(e2node_component_id.pack(bref)); + HANDLE_CODE(e2node_component_cfg_ack.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_removal_ack_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.unpack(bref)); + HANDLE_CODE(e2node_component_id.unpack(bref)); + HANDLE_CODE(e2node_component_cfg_ack.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_cfg_removal_ack_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("e2nodeComponentInterfaceType", e2node_component_interface_type.to_string()); + j.write_fieldname("e2nodeComponentID"); + e2node_component_id.to_json(j); + j.write_fieldname("e2nodeComponentConfigurationAck"); + e2node_component_cfg_ack.to_json(j); + j.end_obj(); +} + +// E2nodeComponentConfigUpdate-Item ::= SEQUENCE +SRSASN_CODE e2node_component_cfg_upd_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.pack(bref)); + HANDLE_CODE(e2node_component_id.pack(bref)); + HANDLE_CODE(e2node_component_cfg.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_upd_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.unpack(bref)); + HANDLE_CODE(e2node_component_id.unpack(bref)); + HANDLE_CODE(e2node_component_cfg.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_cfg_upd_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("e2nodeComponentInterfaceType", e2node_component_interface_type.to_string()); + j.write_fieldname("e2nodeComponentID"); + e2node_component_id.to_json(j); + j.write_fieldname("e2nodeComponentConfiguration"); + e2node_component_cfg.to_json(j); + j.end_obj(); +} + +// E2nodeComponentConfigUpdateAck-Item ::= SEQUENCE +SRSASN_CODE e2node_component_cfg_upd_ack_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.pack(bref)); + HANDLE_CODE(e2node_component_id.pack(bref)); + HANDLE_CODE(e2node_component_cfg_ack.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_upd_ack_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(e2node_component_interface_type.unpack(bref)); + HANDLE_CODE(e2node_component_id.unpack(bref)); + HANDLE_CODE(e2node_component_cfg_ack.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_component_cfg_upd_ack_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("e2nodeComponentInterfaceType", e2node_component_interface_type.to_string()); + j.write_fieldname("e2nodeComponentID"); + e2node_component_id.to_json(j); + j.write_fieldname("e2nodeComponentConfigurationAck"); + e2node_component_cfg_ack.to_json(j); + j.end_obj(); +} + +// E2nodeTNLassociationRemoval-Item ::= SEQUENCE +SRSASN_CODE e2node_tn_lassoc_removal_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(tnl_info.pack(bref)); + HANDLE_CODE(tnl_info_ric.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_tn_lassoc_removal_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(tnl_info.unpack(bref)); + HANDLE_CODE(tnl_info_ric.unpack(bref)); + + return SRSASN_SUCCESS; +} +void e2node_tn_lassoc_removal_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("tnlInformation"); + tnl_info.to_json(j); + j.write_fieldname("tnlInformationRIC"); + tnl_info_ric.to_json(j); + j.end_obj(); +} + +// RANfunction-Item ::= SEQUENCE +SRSASN_CODE ra_nfunction_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, ran_function_id, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(ran_function_definition.pack(bref)); + HANDLE_CODE(pack_integer(bref, ran_function_revision, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(ran_function_oid.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ra_nfunction_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(ran_function_id, bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(ran_function_definition.unpack(bref)); + HANDLE_CODE(unpack_integer(ran_function_revision, bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(ran_function_oid.unpack(bref)); + + return SRSASN_SUCCESS; +} +void ra_nfunction_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ranFunctionID", ran_function_id); + j.write_str("ranFunctionDefinition", ran_function_definition.to_string()); + j.write_int("ranFunctionRevision", ran_function_revision); + j.write_str("ranFunctionOID", ran_function_oid.to_string()); + j.end_obj(); +} + +// RANfunctionID-Item ::= SEQUENCE +SRSASN_CODE ra_nfunction_id_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, ran_function_id, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(pack_integer(bref, ran_function_revision, (uint16_t)0u, (uint16_t)4095u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ra_nfunction_id_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(ran_function_id, bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(unpack_integer(ran_function_revision, bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + + return SRSASN_SUCCESS; +} +void ra_nfunction_id_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ranFunctionID", ran_function_id); + j.write_int("ranFunctionRevision", ran_function_revision); + j.end_obj(); +} + +// RANfunctionIDcause-Item ::= SEQUENCE +SRSASN_CODE ra_nfunction_idcause_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, ran_function_id, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(cause.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ra_nfunction_idcause_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(ran_function_id, bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(cause.unpack(bref)); + + return SRSASN_SUCCESS; +} +void ra_nfunction_idcause_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ranFunctionID", ran_function_id); + j.write_fieldname("cause"); + cause.to_json(j); + j.end_obj(); +} + +// RICaction-Admitted-Item ::= SEQUENCE +SRSASN_CODE ri_caction_admitted_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, ric_action_id, (uint16_t)0u, (uint16_t)255u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_caction_admitted_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(ric_action_id, bref, (uint16_t)0u, (uint16_t)255u, false, true)); + + return SRSASN_SUCCESS; +} +void ri_caction_admitted_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ricActionID", ric_action_id); + j.end_obj(); +} + +// RICaction-NotAdmitted-Item ::= SEQUENCE +SRSASN_CODE ri_caction_not_admitted_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, ric_action_id, (uint16_t)0u, (uint16_t)255u, false, true)); + HANDLE_CODE(cause.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_caction_not_admitted_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(ric_action_id, bref, (uint16_t)0u, (uint16_t)255u, false, true)); + HANDLE_CODE(cause.unpack(bref)); + + return SRSASN_SUCCESS; +} +void ri_caction_not_admitted_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ricActionID", ric_action_id); + j.write_fieldname("cause"); + cause.to_json(j); + j.end_obj(); +} + +// RICaction-ToBeSetup-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ri_caction_to_be_setup_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {19}; + return map_enum_number(options, 1, idx, "id"); +} +bool ri_caction_to_be_setup_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 19 == id; +} +crit_e ri_caction_to_be_setup_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 19) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +ri_caction_to_be_setup_item_ies_o::value_c ri_caction_to_be_setup_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 19) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ri_caction_to_be_setup_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 19) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void ri_caction_to_be_setup_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("RICaction-ToBeSetup-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE ri_caction_to_be_setup_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_caction_to_be_setup_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* ri_caction_to_be_setup_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICaction-ToBeSetup-Item"}; + return convert_enum_idx(options, 1, value, "ri_caction_to_be_setup_item_ies_o::value_c::types"); +} + +// RICsubscription-withCause-Item ::= SEQUENCE +SRSASN_CODE ricsubscription_with_cause_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(ric_request_id.pack(bref)); + HANDLE_CODE(pack_integer(bref, ran_function_id, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(cause.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_with_cause_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(ric_request_id.unpack(bref)); + HANDLE_CODE(unpack_integer(ran_function_id, bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + HANDLE_CODE(cause.unpack(bref)); + + return SRSASN_SUCCESS; +} +void ricsubscription_with_cause_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("ricRequestID"); + ric_request_id.to_json(j); + j.write_int("ranFunctionID", ran_function_id); + j.write_fieldname("cause"); + cause.to_json(j); + j.end_obj(); +} + +// E2connectionSetupFailed-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2conn_setup_failed_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {41}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2conn_setup_failed_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 41 == id; +} +crit_e e2conn_setup_failed_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 41) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2conn_setup_failed_item_ies_o::value_c e2conn_setup_failed_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 41) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2conn_setup_failed_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 41) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2conn_setup_failed_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2connectionSetupFailed-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2conn_setup_failed_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_setup_failed_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2conn_setup_failed_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2connectionSetupFailed-Item"}; + return convert_enum_idx(options, 1, value, "e2conn_setup_failed_item_ies_o::value_c::types"); +} +uint8_t e2conn_setup_failed_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2conn_setup_failed_item_ies_o::value_c::types"); +} + +// E2connectionUpdate-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2conn_upd_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {43}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2conn_upd_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 43 == id; +} +crit_e e2conn_upd_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 43) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2conn_upd_item_ies_o::value_c e2conn_upd_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 43) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2conn_upd_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 43) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2conn_upd_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2connectionUpdate-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2conn_upd_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2conn_upd_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2connectionUpdate-Item"}; + return convert_enum_idx(options, 1, value, "e2conn_upd_item_ies_o::value_c::types"); +} +uint8_t e2conn_upd_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2conn_upd_item_ies_o::value_c::types"); +} + +// E2connectionUpdateRemove-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2conn_upd_rem_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {47}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2conn_upd_rem_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 47 == id; +} +crit_e e2conn_upd_rem_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 47) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2conn_upd_rem_item_ies_o::value_c e2conn_upd_rem_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 47) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2conn_upd_rem_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 47) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2conn_upd_rem_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2connectionUpdateRemove-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2conn_upd_rem_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_rem_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2conn_upd_rem_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2connectionUpdateRemove-Item"}; + return convert_enum_idx(options, 1, value, "e2conn_upd_rem_item_ies_o::value_c::types"); +} +uint8_t e2conn_upd_rem_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2conn_upd_rem_item_ies_o::value_c::types"); +} + +// E2nodeComponentConfigAddition-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_component_cfg_addition_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {51}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2node_component_cfg_addition_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 51 == id; +} +crit_e e2node_component_cfg_addition_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 51) { + return crit_e::reject; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2node_component_cfg_addition_item_ies_o::value_c +e2node_component_cfg_addition_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 51) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_component_cfg_addition_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 51) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2node_component_cfg_addition_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2nodeComponentConfigAddition-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2node_component_cfg_addition_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_addition_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2node_component_cfg_addition_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2nodeComponentConfigAddition-Item"}; + return convert_enum_idx(options, 1, value, "e2node_component_cfg_addition_item_ies_o::value_c::types"); +} +uint8_t e2node_component_cfg_addition_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2node_component_cfg_addition_item_ies_o::value_c::types"); +} + +// E2nodeComponentConfigAdditionAck-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_component_cfg_addition_ack_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {53}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2node_component_cfg_addition_ack_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 53 == id; +} +crit_e e2node_component_cfg_addition_ack_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 53) { + return crit_e::reject; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2node_component_cfg_addition_ack_item_ies_o::value_c +e2node_component_cfg_addition_ack_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 53) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_component_cfg_addition_ack_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 53) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2node_component_cfg_addition_ack_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2nodeComponentConfigAdditionAck-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2node_component_cfg_addition_ack_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_addition_ack_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2node_component_cfg_addition_ack_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2nodeComponentConfigAdditionAck-Item"}; + return convert_enum_idx(options, 1, value, "e2node_component_cfg_addition_ack_item_ies_o::value_c::types"); +} +uint8_t e2node_component_cfg_addition_ack_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2node_component_cfg_addition_ack_item_ies_o::value_c::types"); +} + +// E2nodeComponentConfigRemoval-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_component_cfg_removal_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {55}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2node_component_cfg_removal_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 55 == id; +} +crit_e e2node_component_cfg_removal_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 55) { + return crit_e::reject; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2node_component_cfg_removal_item_ies_o::value_c e2node_component_cfg_removal_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 55) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_component_cfg_removal_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 55) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2node_component_cfg_removal_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2nodeComponentConfigRemoval-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2node_component_cfg_removal_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_removal_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2node_component_cfg_removal_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2nodeComponentConfigRemoval-Item"}; + return convert_enum_idx(options, 1, value, "e2node_component_cfg_removal_item_ies_o::value_c::types"); +} +uint8_t e2node_component_cfg_removal_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2node_component_cfg_removal_item_ies_o::value_c::types"); +} + +// E2nodeComponentConfigRemovalAck-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_component_cfg_removal_ack_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {57}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2node_component_cfg_removal_ack_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 57 == id; +} +crit_e e2node_component_cfg_removal_ack_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 57) { + return crit_e::reject; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2node_component_cfg_removal_ack_item_ies_o::value_c +e2node_component_cfg_removal_ack_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 57) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_component_cfg_removal_ack_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 57) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2node_component_cfg_removal_ack_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2nodeComponentConfigRemovalAck-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2node_component_cfg_removal_ack_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_removal_ack_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2node_component_cfg_removal_ack_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2nodeComponentConfigRemovalAck-Item"}; + return convert_enum_idx(options, 1, value, "e2node_component_cfg_removal_ack_item_ies_o::value_c::types"); +} +uint8_t e2node_component_cfg_removal_ack_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2node_component_cfg_removal_ack_item_ies_o::value_c::types"); +} + +// E2nodeComponentConfigUpdate-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_component_cfg_upd_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {34}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2node_component_cfg_upd_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 34 == id; +} +crit_e e2node_component_cfg_upd_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 34) { + return crit_e::reject; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2node_component_cfg_upd_item_ies_o::value_c e2node_component_cfg_upd_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 34) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_component_cfg_upd_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 34) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2node_component_cfg_upd_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2nodeComponentConfigUpdate-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2node_component_cfg_upd_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_upd_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2node_component_cfg_upd_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2nodeComponentConfigUpdate-Item"}; + return convert_enum_idx(options, 1, value, "e2node_component_cfg_upd_item_ies_o::value_c::types"); +} +uint8_t e2node_component_cfg_upd_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2node_component_cfg_upd_item_ies_o::value_c::types"); +} + +// E2nodeComponentConfigUpdateAck-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_component_cfg_upd_ack_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {36}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2node_component_cfg_upd_ack_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 36 == id; +} +crit_e e2node_component_cfg_upd_ack_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 36) { + return crit_e::reject; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2node_component_cfg_upd_ack_item_ies_o::value_c e2node_component_cfg_upd_ack_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 36) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_component_cfg_upd_ack_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 36) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2node_component_cfg_upd_ack_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2nodeComponentConfigUpdateAck-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2node_component_cfg_upd_ack_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_component_cfg_upd_ack_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2node_component_cfg_upd_ack_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2nodeComponentConfigUpdateAck-Item"}; + return convert_enum_idx(options, 1, value, "e2node_component_cfg_upd_ack_item_ies_o::value_c::types"); +} +uint8_t e2node_component_cfg_upd_ack_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2node_component_cfg_upd_ack_item_ies_o::value_c::types"); +} + +// E2nodeTNLassociationRemoval-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_tn_lassoc_removal_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {59}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2node_tn_lassoc_removal_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 59 == id; +} +crit_e e2node_tn_lassoc_removal_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 59) { + return crit_e::reject; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2node_tn_lassoc_removal_item_ies_o::value_c e2node_tn_lassoc_removal_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 59) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_tn_lassoc_removal_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 59) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2node_tn_lassoc_removal_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("E2nodeTNLassociationRemoval-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE e2node_tn_lassoc_removal_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_tn_lassoc_removal_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* e2node_tn_lassoc_removal_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"E2nodeTNLassociationRemoval-Item"}; + return convert_enum_idx(options, 1, value, "e2node_tn_lassoc_removal_item_ies_o::value_c::types"); +} +uint8_t e2node_tn_lassoc_removal_item_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {2}; + return map_enum_number(options, 1, value, "e2node_tn_lassoc_removal_item_ies_o::value_c::types"); +} + +// GlobalE2node-eNB-ID ::= SEQUENCE +SRSASN_CODE global_e2node_enb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(global_enb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_e2node_enb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(global_enb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void global_e2node_enb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-eNB-ID"); + global_enb_id.to_json(j); + j.end_obj(); +} + +// GlobalE2node-en-gNB-ID ::= SEQUENCE +SRSASN_CODE global_e2node_en_g_nb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(en_g_nb_cu_up_id_present, 1)); + HANDLE_CODE(bref.pack(en_g_nb_du_id_present, 1)); + + HANDLE_CODE(global_en_g_nb_id.pack(bref)); + if (en_g_nb_cu_up_id_present) { + HANDLE_CODE(pack_integer(bref, en_g_nb_cu_up_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + if (en_g_nb_du_id_present) { + HANDLE_CODE(pack_integer(bref, en_g_nb_du_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_e2node_en_g_nb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(en_g_nb_cu_up_id_present, 1)); + HANDLE_CODE(bref.unpack(en_g_nb_du_id_present, 1)); + + HANDLE_CODE(global_en_g_nb_id.unpack(bref)); + if (en_g_nb_cu_up_id_present) { + HANDLE_CODE(unpack_integer(en_g_nb_cu_up_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + if (en_g_nb_du_id_present) { + HANDLE_CODE(unpack_integer(en_g_nb_du_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + + return SRSASN_SUCCESS; +} +void global_e2node_en_g_nb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-en-gNB-ID"); + global_en_g_nb_id.to_json(j); + if (en_g_nb_cu_up_id_present) { + j.write_int("en-gNB-CU-UP-ID", en_g_nb_cu_up_id); + } + if (en_g_nb_du_id_present) { + j.write_int("en-gNB-DU-ID", en_g_nb_du_id); + } + j.end_obj(); +} + +// GlobalE2node-gNB-ID ::= SEQUENCE +SRSASN_CODE global_e2node_g_nb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(global_en_g_nb_id_present, 1)); + HANDLE_CODE(bref.pack(gnb_cu_up_id_present, 1)); + HANDLE_CODE(bref.pack(gnb_du_id_present, 1)); + + HANDLE_CODE(global_g_nb_id.pack(bref)); + if (global_en_g_nb_id_present) { + HANDLE_CODE(global_en_g_nb_id.pack(bref)); + } + if (gnb_cu_up_id_present) { + HANDLE_CODE(pack_integer(bref, gnb_cu_up_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + if (gnb_du_id_present) { + HANDLE_CODE(pack_integer(bref, gnb_du_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_e2node_g_nb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(global_en_g_nb_id_present, 1)); + HANDLE_CODE(bref.unpack(gnb_cu_up_id_present, 1)); + HANDLE_CODE(bref.unpack(gnb_du_id_present, 1)); + + HANDLE_CODE(global_g_nb_id.unpack(bref)); + if (global_en_g_nb_id_present) { + HANDLE_CODE(global_en_g_nb_id.unpack(bref)); + } + if (gnb_cu_up_id_present) { + HANDLE_CODE(unpack_integer(gnb_cu_up_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + if (gnb_du_id_present) { + HANDLE_CODE(unpack_integer(gnb_du_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + + return SRSASN_SUCCESS; +} +void global_e2node_g_nb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-gNB-ID"); + global_g_nb_id.to_json(j); + if (global_en_g_nb_id_present) { + j.write_fieldname("global-en-gNB-ID"); + global_en_g_nb_id.to_json(j); + } + if (gnb_cu_up_id_present) { + j.write_int("gNB-CU-UP-ID", gnb_cu_up_id); + } + if (gnb_du_id_present) { + j.write_int("gNB-DU-ID", gnb_du_id); + } + j.end_obj(); +} + +// GlobalE2node-ng-eNB-ID ::= SEQUENCE +SRSASN_CODE global_e2node_ng_enb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(global_enb_id_present, 1)); + HANDLE_CODE(bref.pack(ng_enb_du_id_present, 1)); + + HANDLE_CODE(global_ng_enb_id.pack(bref)); + if (global_enb_id_present) { + HANDLE_CODE(global_enb_id.pack(bref)); + } + if (ng_enb_du_id_present) { + HANDLE_CODE(pack_integer(bref, ng_enb_du_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_e2node_ng_enb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(global_enb_id_present, 1)); + HANDLE_CODE(bref.unpack(ng_enb_du_id_present, 1)); + + HANDLE_CODE(global_ng_enb_id.unpack(bref)); + if (global_enb_id_present) { + HANDLE_CODE(global_enb_id.unpack(bref)); + } + if (ng_enb_du_id_present) { + HANDLE_CODE(unpack_integer(ng_enb_du_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + } + + return SRSASN_SUCCESS; +} +void global_e2node_ng_enb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-ng-eNB-ID"); + global_ng_enb_id.to_json(j); + if (global_enb_id_present) { + j.write_fieldname("global-eNB-ID"); + global_enb_id.to_json(j); + } + if (ng_enb_du_id_present) { + j.write_int("ngENB-DU-ID", ng_enb_du_id); + } + j.end_obj(); +} + +// RANfunction-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ra_nfunction_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {8}; + return map_enum_number(options, 1, idx, "id"); +} +bool ra_nfunction_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 8 == id; +} +crit_e ra_nfunction_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 8) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +ra_nfunction_item_ies_o::value_c ra_nfunction_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 8) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ra_nfunction_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 8) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void ra_nfunction_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("RANfunction-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE ra_nfunction_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ra_nfunction_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* ra_nfunction_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RANfunction-Item"}; + return convert_enum_idx(options, 1, value, "ra_nfunction_item_ies_o::value_c::types"); +} + +// RANfunctionID-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ra_nfunction_id_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {6}; + return map_enum_number(options, 1, idx, "id"); +} +bool ra_nfunction_id_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 6 == id; +} +crit_e ra_nfunction_id_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 6) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +ra_nfunction_id_item_ies_o::value_c ra_nfunction_id_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 6) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ra_nfunction_id_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 6) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void ra_nfunction_id_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("RANfunctionID-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE ra_nfunction_id_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ra_nfunction_id_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* ra_nfunction_id_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RANfunctionID-Item"}; + return convert_enum_idx(options, 1, value, "ra_nfunction_id_item_ies_o::value_c::types"); +} + +// RANfunctionIDcause-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ra_nfunction_idcause_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {7}; + return map_enum_number(options, 1, idx, "id"); +} +bool ra_nfunction_idcause_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 7 == id; +} +crit_e ra_nfunction_idcause_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 7) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +ra_nfunction_idcause_item_ies_o::value_c ra_nfunction_idcause_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 7) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ra_nfunction_idcause_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 7) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void ra_nfunction_idcause_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("RANfunctionIDcause-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE ra_nfunction_idcause_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ra_nfunction_idcause_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* ra_nfunction_idcause_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RANfunctionIDcause-Item"}; + return convert_enum_idx(options, 1, value, "ra_nfunction_idcause_item_ies_o::value_c::types"); +} + +// RICaction-Admitted-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ri_caction_admitted_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {14}; + return map_enum_number(options, 1, idx, "id"); +} +bool ri_caction_admitted_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 14 == id; +} +crit_e ri_caction_admitted_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 14) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +ri_caction_admitted_item_ies_o::value_c ri_caction_admitted_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 14) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ri_caction_admitted_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 14) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void ri_caction_admitted_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("RICaction-Admitted-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE ri_caction_admitted_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_caction_admitted_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* ri_caction_admitted_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICaction-Admitted-Item"}; + return convert_enum_idx(options, 1, value, "ri_caction_admitted_item_ies_o::value_c::types"); +} + +// RICaction-NotAdmitted-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ri_caction_not_admitted_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {16}; + return map_enum_number(options, 1, idx, "id"); +} +bool ri_caction_not_admitted_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 16 == id; +} +crit_e ri_caction_not_admitted_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 16) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +ri_caction_not_admitted_item_ies_o::value_c ri_caction_not_admitted_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 16) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ri_caction_not_admitted_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 16) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void ri_caction_not_admitted_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("RICaction-NotAdmitted-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE ri_caction_not_admitted_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_caction_not_admitted_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* ri_caction_not_admitted_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICaction-NotAdmitted-Item"}; + return convert_enum_idx(options, 1, value, "ri_caction_not_admitted_item_ies_o::value_c::types"); +} + +template struct asn1::protocol_ie_single_container_s; + +// RICsubscription-withCause-ItemIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricsubscription_with_cause_item_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {61}; + return map_enum_number(options, 1, idx, "id"); +} +bool ricsubscription_with_cause_item_ies_o::is_id_valid(const uint32_t& id) +{ + return 61 == id; +} +crit_e ricsubscription_with_cause_item_ies_o::get_crit(const uint32_t& id) +{ + if (id == 61) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +ricsubscription_with_cause_item_ies_o::value_c ricsubscription_with_cause_item_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 61) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricsubscription_with_cause_item_ies_o::get_presence(const uint32_t& id) +{ + if (id == 61) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void ricsubscription_with_cause_item_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("RICsubscription-withCause-Item"); + c.to_json(j); + j.end_obj(); +} +SRSASN_CODE ricsubscription_with_cause_item_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_with_cause_item_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* ricsubscription_with_cause_item_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICsubscription-withCause-Item"}; + return convert_enum_idx(options, 1, value, "ricsubscription_with_cause_item_ies_o::value_c::types"); +} + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +// GlobalE2node-ID ::= CHOICE +void global_e2node_id_c::destroy_() +{ + switch (type_) { + case types::gnb: + c.destroy(); + break; + case types::en_g_nb: + c.destroy(); + break; + case types::ng_enb: + c.destroy(); + break; + case types::enb: + c.destroy(); + break; + default: + break; + } +} +void global_e2node_id_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::gnb: + c.init(); + break; + case types::en_g_nb: + c.init(); + break; + case types::ng_enb: + c.init(); + break; + case types::enb: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_e2node_id_c"); + } +} +global_e2node_id_c::global_e2node_id_c(const global_e2node_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::gnb: + c.init(other.c.get()); + break; + case types::en_g_nb: + c.init(other.c.get()); + break; + case types::ng_enb: + c.init(other.c.get()); + break; + case types::enb: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_e2node_id_c"); + } +} +global_e2node_id_c& global_e2node_id_c::operator=(const global_e2node_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::gnb: + c.set(other.c.get()); + break; + case types::en_g_nb: + c.set(other.c.get()); + break; + case types::ng_enb: + c.set(other.c.get()); + break; + case types::enb: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_e2node_id_c"); + } + + return *this; +} +global_e2node_g_nb_id_s& global_e2node_id_c::set_gnb() +{ + set(types::gnb); + return c.get(); +} +global_e2node_en_g_nb_id_s& global_e2node_id_c::set_en_g_nb() +{ + set(types::en_g_nb); + return c.get(); +} +global_e2node_ng_enb_id_s& global_e2node_id_c::set_ng_enb() +{ + set(types::ng_enb); + return c.get(); +} +global_e2node_enb_id_s& global_e2node_id_c::set_enb() +{ + set(types::enb); + return c.get(); +} +void global_e2node_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::gnb: + j.write_fieldname("gNB"); + c.get().to_json(j); + break; + case types::en_g_nb: + j.write_fieldname("en-gNB"); + c.get().to_json(j); + break; + case types::ng_enb: + j.write_fieldname("ng-eNB"); + c.get().to_json(j); + break; + case types::enb: + j.write_fieldname("eNB"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "global_e2node_id_c"); + } + j.end_obj(); +} +SRSASN_CODE global_e2node_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::gnb: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::en_g_nb: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ng_enb: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::enb: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "global_e2node_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE global_e2node_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::gnb: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::en_g_nb: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ng_enb: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::enb: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "global_e2node_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* global_e2node_id_c::types_opts::to_string() const +{ + static const char* options[] = {"gNB", "en-gNB", "ng-eNB", "eNB"}; + return convert_enum_idx(options, 4, value, "global_e2node_id_c::types"); +} + +// GlobalRIC-ID ::= SEQUENCE +SRSASN_CODE global_ric_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(ric_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_ric_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(ric_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void global_ric_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMN-Identity", plmn_id.to_string()); + j.write_str("ric-ID", ric_id.to_string()); + j.end_obj(); +} + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +template struct asn1::protocol_ie_single_container_s; + +// RICcontrolAckRequest ::= ENUMERATED +const char* ri_cctrl_ack_request_opts::to_string() const +{ + static const char* options[] = {"noAck", "ack"}; + return convert_enum_idx(options, 2, value, "ri_cctrl_ack_request_e"); +} + +// RICindicationType ::= ENUMERATED +const char* ri_cind_type_opts::to_string() const +{ + static const char* options[] = {"report", "insert"}; + return convert_enum_idx(options, 2, value, "ri_cind_type_e"); +} + +template struct asn1::protocol_ie_single_container_s; + +// RICsubscriptionDetails ::= SEQUENCE +SRSASN_CODE ricsubscription_details_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(ric_event_trigger_definition.pack(bref)); + HANDLE_CODE(pack_dyn_seq_of(bref, ric_action_to_be_setup_list, 1, 16, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_details_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(ric_event_trigger_definition.unpack(bref)); + HANDLE_CODE(unpack_dyn_seq_of(ric_action_to_be_setup_list, bref, 1, 16, true)); + + return SRSASN_SUCCESS; +} +void ricsubscription_details_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("ricEventTriggerDefinition", ric_event_trigger_definition.to_string()); + j.start_array("ricAction-ToBeSetup-List"); + for (const auto& e1 : ric_action_to_be_setup_list) { + e1.to_json(j); + } + j.end_array(); + j.end_obj(); +} + +// TimeToWait ::= ENUMERATED +const char* time_to_wait_opts::to_string() const +{ + static const char* options[] = {"v1s", "v2s", "v5s", "v10s", "v20s", "v60s"}; + return convert_enum_idx(options, 6, value, "time_to_wait_e"); +} +uint8_t time_to_wait_opts::to_number() const +{ + static const uint8_t options[] = {1, 2, 5, 10, 20, 60}; + return map_enum_number(options, 6, value, "time_to_wait_e"); +} + +// E2RemovalFailureIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2_removal_fail_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 1, 2}; + return map_enum_number(options, 3, idx, "id"); +} +bool e2_removal_fail_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 1, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2_removal_fail_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 1: + return crit_e::ignore; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2_removal_fail_ies_o::value_c e2_removal_fail_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2_removal_fail_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 1: + return presence_e::mandatory; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2_removal_fail_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::cause: + c.destroy(); + break; + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void e2_removal_fail_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::cause: + c.init(); + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_removal_fail_ies_o::value_c"); + } +} +e2_removal_fail_ies_o::value_c::value_c(const e2_removal_fail_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_removal_fail_ies_o::value_c"); + } +} +e2_removal_fail_ies_o::value_c& e2_removal_fail_ies_o::value_c::operator=(const e2_removal_fail_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_removal_fail_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2_removal_fail_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +cause_c& e2_removal_fail_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& e2_removal_fail_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const uint16_t& e2_removal_fail_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const cause_c& e2_removal_fail_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& e2_removal_fail_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void e2_removal_fail_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2_removal_fail_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2_removal_fail_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_removal_fail_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_removal_fail_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_removal_fail_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2_removal_fail_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "Cause", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 3, value, "e2_removal_fail_ies_o::value_c::types"); +} +uint8_t e2_removal_fail_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "e2_removal_fail_ies_o::value_c::types"); +} + +// E2RemovalRequestIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2_removal_request_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49}; + return map_enum_number(options, 1, idx, "id"); +} +bool e2_removal_request_ies_o::is_id_valid(const uint32_t& id) +{ + return 49 == id; +} +crit_e e2_removal_request_ies_o::get_crit(const uint32_t& id) +{ + if (id == 49) { + return crit_e::reject; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +e2_removal_request_ies_o::value_c e2_removal_request_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 49) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2_removal_request_ies_o::get_presence(const uint32_t& id) +{ + if (id == 49) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void e2_removal_request_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("INTEGER (0..255,...)", c); + j.end_obj(); +} +SRSASN_CODE e2_removal_request_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(pack_integer(bref, c, (uint16_t)0u, (uint16_t)255u, true, true)); + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_removal_request_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(unpack_integer(c, bref, (uint16_t)0u, (uint16_t)255u, true, true)); + return SRSASN_SUCCESS; +} + +const char* e2_removal_request_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)"}; + return convert_enum_idx(options, 1, value, "e2_removal_request_ies_o::value_c::types"); +} +uint8_t e2_removal_request_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "e2_removal_request_ies_o::value_c::types"); +} + +// E2RemovalResponseIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2_removal_resp_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 2}; + return map_enum_number(options, 2, idx, "id"); +} +bool e2_removal_resp_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2_removal_resp_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2_removal_resp_ies_o::value_c e2_removal_resp_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2_removal_resp_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2_removal_resp_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void e2_removal_resp_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_removal_resp_ies_o::value_c"); + } +} +e2_removal_resp_ies_o::value_c::value_c(const e2_removal_resp_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_removal_resp_ies_o::value_c"); + } +} +e2_removal_resp_ies_o::value_c& e2_removal_resp_ies_o::value_c::operator=(const e2_removal_resp_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_removal_resp_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2_removal_resp_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& e2_removal_resp_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const uint16_t& e2_removal_resp_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& e2_removal_resp_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void e2_removal_resp_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2_removal_resp_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2_removal_resp_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_removal_resp_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_removal_resp_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_removal_resp_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2_removal_resp_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 2, value, "e2_removal_resp_ies_o::value_c::types"); +} +uint8_t e2_removal_resp_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "e2_removal_resp_ies_o::value_c::types"); +} + +// E2connectionUpdate-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2conn_upd_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 44, 46, 45}; + return map_enum_number(options, 4, idx, "id"); +} +bool e2conn_upd_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 44, 46, 45}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2conn_upd_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 44: + return crit_e::reject; + case 46: + return crit_e::reject; + case 45: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2conn_upd_ies_o::value_c e2conn_upd_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 44: + ret.set(value_c::types::e2conn_upd_add); + break; + case 46: + ret.set(value_c::types::e2conn_upd_rem); + break; + case 45: + ret.set(value_c::types::e2conn_upd_modify); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2conn_upd_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 44: + return presence_e::optional; + case 46: + return presence_e::optional; + case 45: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2conn_upd_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::e2conn_upd_add: + c.destroy(); + break; + case types::e2conn_upd_rem: + c.destroy(); + break; + case types::e2conn_upd_modify: + c.destroy(); + break; + default: + break; + } +} +void e2conn_upd_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::e2conn_upd_add: + c.init(); + break; + case types::e2conn_upd_rem: + c.init(); + break; + case types::e2conn_upd_modify: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ies_o::value_c"); + } +} +e2conn_upd_ies_o::value_c::value_c(const e2conn_upd_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::e2conn_upd_add: + c.init(other.c.get()); + break; + case types::e2conn_upd_rem: + c.init(other.c.get()); + break; + case types::e2conn_upd_modify: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ies_o::value_c"); + } +} +e2conn_upd_ies_o::value_c& e2conn_upd_ies_o::value_c::operator=(const e2conn_upd_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::e2conn_upd_add: + c.set(other.c.get()); + break; + case types::e2conn_upd_rem: + c.set(other.c.get()); + break; + case types::e2conn_upd_modify: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2conn_upd_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +e2conn_upd_list_l& e2conn_upd_ies_o::value_c::e2conn_upd_add() +{ + assert_choice_type(types::e2conn_upd_add, type_, "Value"); + return c.get(); +} +e2conn_upd_rem_list_l& e2conn_upd_ies_o::value_c::e2conn_upd_rem() +{ + assert_choice_type(types::e2conn_upd_rem, type_, "Value"); + return c.get(); +} +e2conn_upd_list_l& e2conn_upd_ies_o::value_c::e2conn_upd_modify() +{ + assert_choice_type(types::e2conn_upd_modify, type_, "Value"); + return c.get(); +} +const uint16_t& e2conn_upd_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const e2conn_upd_list_l& e2conn_upd_ies_o::value_c::e2conn_upd_add() const +{ + assert_choice_type(types::e2conn_upd_add, type_, "Value"); + return c.get(); +} +const e2conn_upd_rem_list_l& e2conn_upd_ies_o::value_c::e2conn_upd_rem() const +{ + assert_choice_type(types::e2conn_upd_rem, type_, "Value"); + return c.get(); +} +const e2conn_upd_list_l& e2conn_upd_ies_o::value_c::e2conn_upd_modify() const +{ + assert_choice_type(types::e2conn_upd_modify, type_, "Value"); + return c.get(); +} +void e2conn_upd_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::e2conn_upd_add: + j.start_array("E2connectionUpdate-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2conn_upd_rem: + j.start_array("E2connectionUpdateRemove-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2conn_upd_modify: + j.start_array("E2connectionUpdate-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2conn_upd_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::e2conn_upd_add: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 32, true)); + break; + case types::e2conn_upd_rem: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 32, true)); + break; + case types::e2conn_upd_modify: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 32, true)); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::e2conn_upd_add: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 32, true)); + break; + case types::e2conn_upd_rem: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 32, true)); + break; + case types::e2conn_upd_modify: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 32, true)); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2conn_upd_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = { + "INTEGER (0..255,...)", "E2connectionUpdate-List", "E2connectionUpdateRemove-List", "E2connectionUpdate-List"}; + return convert_enum_idx(options, 4, value, "e2conn_upd_ies_o::value_c::types"); +} + +// E2connectionUpdateAck-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2conn_upd_ack_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 39, 40}; + return map_enum_number(options, 3, idx, "id"); +} +bool e2conn_upd_ack_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 39, 40}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2conn_upd_ack_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 39: + return crit_e::reject; + case 40: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2conn_upd_ack_ies_o::value_c e2conn_upd_ack_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 39: + ret.set(value_c::types::e2conn_setup); + break; + case 40: + ret.set(value_c::types::e2conn_setup_failed); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2conn_upd_ack_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 39: + return presence_e::optional; + case 40: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2conn_upd_ack_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::e2conn_setup: + c.destroy(); + break; + case types::e2conn_setup_failed: + c.destroy(); + break; + default: + break; + } +} +void e2conn_upd_ack_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::e2conn_setup: + c.init(); + break; + case types::e2conn_setup_failed: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ack_ies_o::value_c"); + } +} +e2conn_upd_ack_ies_o::value_c::value_c(const e2conn_upd_ack_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::e2conn_setup: + c.init(other.c.get()); + break; + case types::e2conn_setup_failed: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ack_ies_o::value_c"); + } +} +e2conn_upd_ack_ies_o::value_c& e2conn_upd_ack_ies_o::value_c::operator=(const e2conn_upd_ack_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::e2conn_setup: + c.set(other.c.get()); + break; + case types::e2conn_setup_failed: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ack_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2conn_upd_ack_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +e2conn_upd_list_l& e2conn_upd_ack_ies_o::value_c::e2conn_setup() +{ + assert_choice_type(types::e2conn_setup, type_, "Value"); + return c.get(); +} +e2conn_setup_failed_list_l& e2conn_upd_ack_ies_o::value_c::e2conn_setup_failed() +{ + assert_choice_type(types::e2conn_setup_failed, type_, "Value"); + return c.get(); +} +const uint16_t& e2conn_upd_ack_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const e2conn_upd_list_l& e2conn_upd_ack_ies_o::value_c::e2conn_setup() const +{ + assert_choice_type(types::e2conn_setup, type_, "Value"); + return c.get(); +} +const e2conn_setup_failed_list_l& e2conn_upd_ack_ies_o::value_c::e2conn_setup_failed() const +{ + assert_choice_type(types::e2conn_setup_failed, type_, "Value"); + return c.get(); +} +void e2conn_upd_ack_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::e2conn_setup: + j.start_array("E2connectionUpdate-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2conn_setup_failed: + j.start_array("E2connectionSetupFailed-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ack_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2conn_upd_ack_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::e2conn_setup: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 32, true)); + break; + case types::e2conn_setup_failed: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 32, true)); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ack_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_ack_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::e2conn_setup: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 32, true)); + break; + case types::e2conn_setup_failed: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 32, true)); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_ack_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2conn_upd_ack_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "E2connectionUpdate-List", "E2connectionSetupFailed-List"}; + return convert_enum_idx(options, 3, value, "e2conn_upd_ack_ies_o::value_c::types"); +} + +// E2connectionUpdateFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2conn_upd_fail_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 1, 31, 2}; + return map_enum_number(options, 4, idx, "id"); +} +bool e2conn_upd_fail_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 1, 31, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2conn_upd_fail_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 1: + return crit_e::reject; + case 31: + return crit_e::ignore; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2conn_upd_fail_ies_o::value_c e2conn_upd_fail_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 31: + ret.set(value_c::types::time_to_wait); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2conn_upd_fail_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 1: + return presence_e::optional; + case 31: + return presence_e::optional; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2conn_upd_fail_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::cause: + c.destroy(); + break; + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void e2conn_upd_fail_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::cause: + c.init(); + break; + case types::time_to_wait: + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_fail_ies_o::value_c"); + } +} +e2conn_upd_fail_ies_o::value_c::value_c(const e2conn_upd_fail_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::time_to_wait: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_fail_ies_o::value_c"); + } +} +e2conn_upd_fail_ies_o::value_c& e2conn_upd_fail_ies_o::value_c::operator=(const e2conn_upd_fail_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::time_to_wait: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_fail_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2conn_upd_fail_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +cause_c& e2conn_upd_fail_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +time_to_wait_e& e2conn_upd_fail_ies_o::value_c::time_to_wait() +{ + assert_choice_type(types::time_to_wait, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& e2conn_upd_fail_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const uint16_t& e2conn_upd_fail_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const cause_c& e2conn_upd_fail_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const time_to_wait_e& e2conn_upd_fail_ies_o::value_c::time_to_wait() const +{ + assert_choice_type(types::time_to_wait, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& e2conn_upd_fail_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void e2conn_upd_fail_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::time_to_wait: + j.write_str("TimeToWait", c.get().to_string()); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_fail_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2conn_upd_fail_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::time_to_wait: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_fail_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_fail_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::time_to_wait: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2conn_upd_fail_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2conn_upd_fail_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "Cause", "TimeToWait", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 4, value, "e2conn_upd_fail_ies_o::value_c::types"); +} +uint8_t e2conn_upd_fail_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "e2conn_upd_fail_ies_o::value_c::types"); +} + +// E2nodeConfigurationUpdate-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_cfg_upd_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 3, 50, 33, 54, 58}; + return map_enum_number(options, 6, idx, "id"); +} +bool e2node_cfg_upd_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 3, 50, 33, 54, 58}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2node_cfg_upd_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 3: + return crit_e::reject; + case 50: + return crit_e::reject; + case 33: + return crit_e::reject; + case 54: + return crit_e::reject; + case 58: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2node_cfg_upd_ies_o::value_c e2node_cfg_upd_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 3: + ret.set(value_c::types::global_e2node_id); + break; + case 50: + ret.set(value_c::types::e2node_component_cfg_addition); + break; + case 33: + ret.set(value_c::types::e2node_component_cfg_upd); + break; + case 54: + ret.set(value_c::types::e2node_component_cfg_removal); + break; + case 58: + ret.set(value_c::types::e2node_tn_lassoc_removal); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_cfg_upd_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 3: + return presence_e::optional; + case 50: + return presence_e::optional; + case 33: + return presence_e::optional; + case 54: + return presence_e::optional; + case 58: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2node_cfg_upd_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::global_e2node_id: + c.destroy(); + break; + case types::e2node_component_cfg_addition: + c.destroy(); + break; + case types::e2node_component_cfg_upd: + c.destroy(); + break; + case types::e2node_component_cfg_removal: + c.destroy(); + break; + case types::e2node_tn_lassoc_removal: + c.destroy(); + break; + default: + break; + } +} +void e2node_cfg_upd_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::global_e2node_id: + c.init(); + break; + case types::e2node_component_cfg_addition: + c.init(); + break; + case types::e2node_component_cfg_upd: + c.init(); + break; + case types::e2node_component_cfg_removal: + c.init(); + break; + case types::e2node_tn_lassoc_removal: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ies_o::value_c"); + } +} +e2node_cfg_upd_ies_o::value_c::value_c(const e2node_cfg_upd_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::global_e2node_id: + c.init(other.c.get()); + break; + case types::e2node_component_cfg_addition: + c.init(other.c.get()); + break; + case types::e2node_component_cfg_upd: + c.init(other.c.get()); + break; + case types::e2node_component_cfg_removal: + c.init(other.c.get()); + break; + case types::e2node_tn_lassoc_removal: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ies_o::value_c"); + } +} +e2node_cfg_upd_ies_o::value_c& e2node_cfg_upd_ies_o::value_c::operator=(const e2node_cfg_upd_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::global_e2node_id: + c.set(other.c.get()); + break; + case types::e2node_component_cfg_addition: + c.set(other.c.get()); + break; + case types::e2node_component_cfg_upd: + c.set(other.c.get()); + break; + case types::e2node_component_cfg_removal: + c.set(other.c.get()); + break; + case types::e2node_tn_lassoc_removal: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2node_cfg_upd_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +global_e2node_id_c& e2node_cfg_upd_ies_o::value_c::global_e2node_id() +{ + assert_choice_type(types::global_e2node_id, type_, "Value"); + return c.get(); +} +e2node_component_cfg_addition_list_l& e2node_cfg_upd_ies_o::value_c::e2node_component_cfg_addition() +{ + assert_choice_type(types::e2node_component_cfg_addition, type_, "Value"); + return c.get(); +} +e2node_component_cfg_upd_list_l& e2node_cfg_upd_ies_o::value_c::e2node_component_cfg_upd() +{ + assert_choice_type(types::e2node_component_cfg_upd, type_, "Value"); + return c.get(); +} +e2node_component_cfg_removal_list_l& e2node_cfg_upd_ies_o::value_c::e2node_component_cfg_removal() +{ + assert_choice_type(types::e2node_component_cfg_removal, type_, "Value"); + return c.get(); +} +e2node_tn_lassoc_removal_list_l& e2node_cfg_upd_ies_o::value_c::e2node_tn_lassoc_removal() +{ + assert_choice_type(types::e2node_tn_lassoc_removal, type_, "Value"); + return c.get(); +} +const uint16_t& e2node_cfg_upd_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const global_e2node_id_c& e2node_cfg_upd_ies_o::value_c::global_e2node_id() const +{ + assert_choice_type(types::global_e2node_id, type_, "Value"); + return c.get(); +} +const e2node_component_cfg_addition_list_l& e2node_cfg_upd_ies_o::value_c::e2node_component_cfg_addition() const +{ + assert_choice_type(types::e2node_component_cfg_addition, type_, "Value"); + return c.get(); +} +const e2node_component_cfg_upd_list_l& e2node_cfg_upd_ies_o::value_c::e2node_component_cfg_upd() const +{ + assert_choice_type(types::e2node_component_cfg_upd, type_, "Value"); + return c.get(); +} +const e2node_component_cfg_removal_list_l& e2node_cfg_upd_ies_o::value_c::e2node_component_cfg_removal() const +{ + assert_choice_type(types::e2node_component_cfg_removal, type_, "Value"); + return c.get(); +} +const e2node_tn_lassoc_removal_list_l& e2node_cfg_upd_ies_o::value_c::e2node_tn_lassoc_removal() const +{ + assert_choice_type(types::e2node_tn_lassoc_removal, type_, "Value"); + return c.get(); +} +void e2node_cfg_upd_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::global_e2node_id: + j.write_fieldname("GlobalE2node-ID"); + c.get().to_json(j); + break; + case types::e2node_component_cfg_addition: + j.start_array("E2nodeComponentConfigAddition-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2node_component_cfg_upd: + j.start_array("E2nodeComponentConfigUpdate-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2node_component_cfg_removal: + j.start_array("E2nodeComponentConfigRemoval-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2node_tn_lassoc_removal: + j.start_array("E2nodeTNLassociationRemoval-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2node_cfg_upd_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::global_e2node_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_component_cfg_addition: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 1024, true)); + break; + case types::e2node_component_cfg_upd: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 1024, true)); + break; + case types::e2node_component_cfg_removal: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 1024, true)); + break; + case types::e2node_tn_lassoc_removal: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 32, true)); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_cfg_upd_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::global_e2node_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_component_cfg_addition: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 1024, true)); + break; + case types::e2node_component_cfg_upd: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 1024, true)); + break; + case types::e2node_component_cfg_removal: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 1024, true)); + break; + case types::e2node_tn_lassoc_removal: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 32, true)); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2node_cfg_upd_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", + "GlobalE2node-ID", + "E2nodeComponentConfigAddition-List", + "E2nodeComponentConfigUpdate-List", + "E2nodeComponentConfigRemoval-List", + "E2nodeTNLassociationRemoval-List"}; + return convert_enum_idx(options, 6, value, "e2node_cfg_upd_ies_o::value_c::types"); +} + +// E2nodeConfigurationUpdateAcknowledge-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_cfg_upd_ack_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 52, 35, 56}; + return map_enum_number(options, 4, idx, "id"); +} +bool e2node_cfg_upd_ack_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 52, 35, 56}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2node_cfg_upd_ack_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 52: + return crit_e::reject; + case 35: + return crit_e::reject; + case 56: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2node_cfg_upd_ack_ies_o::value_c e2node_cfg_upd_ack_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 52: + ret.set(value_c::types::e2node_component_cfg_addition_ack); + break; + case 35: + ret.set(value_c::types::e2node_component_cfg_upd_ack); + break; + case 56: + ret.set(value_c::types::e2node_component_cfg_removal_ack); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_cfg_upd_ack_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 52: + return presence_e::optional; + case 35: + return presence_e::optional; + case 56: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2node_cfg_upd_ack_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::e2node_component_cfg_addition_ack: + c.destroy(); + break; + case types::e2node_component_cfg_upd_ack: + c.destroy(); + break; + case types::e2node_component_cfg_removal_ack: + c.destroy(); + break; + default: + break; + } +} +void e2node_cfg_upd_ack_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::e2node_component_cfg_addition_ack: + c.init(); + break; + case types::e2node_component_cfg_upd_ack: + c.init(); + break; + case types::e2node_component_cfg_removal_ack: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ack_ies_o::value_c"); + } +} +e2node_cfg_upd_ack_ies_o::value_c::value_c(const e2node_cfg_upd_ack_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::e2node_component_cfg_addition_ack: + c.init(other.c.get()); + break; + case types::e2node_component_cfg_upd_ack: + c.init(other.c.get()); + break; + case types::e2node_component_cfg_removal_ack: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ack_ies_o::value_c"); + } +} +e2node_cfg_upd_ack_ies_o::value_c& +e2node_cfg_upd_ack_ies_o::value_c::operator=(const e2node_cfg_upd_ack_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::e2node_component_cfg_addition_ack: + c.set(other.c.get()); + break; + case types::e2node_component_cfg_upd_ack: + c.set(other.c.get()); + break; + case types::e2node_component_cfg_removal_ack: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ack_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2node_cfg_upd_ack_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +e2node_component_cfg_addition_ack_list_l& e2node_cfg_upd_ack_ies_o::value_c::e2node_component_cfg_addition_ack() +{ + assert_choice_type(types::e2node_component_cfg_addition_ack, type_, "Value"); + return c.get(); +} +e2node_component_cfg_upd_ack_list_l& e2node_cfg_upd_ack_ies_o::value_c::e2node_component_cfg_upd_ack() +{ + assert_choice_type(types::e2node_component_cfg_upd_ack, type_, "Value"); + return c.get(); +} +e2node_component_cfg_removal_ack_list_l& e2node_cfg_upd_ack_ies_o::value_c::e2node_component_cfg_removal_ack() +{ + assert_choice_type(types::e2node_component_cfg_removal_ack, type_, "Value"); + return c.get(); +} +const uint16_t& e2node_cfg_upd_ack_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const e2node_component_cfg_addition_ack_list_l& +e2node_cfg_upd_ack_ies_o::value_c::e2node_component_cfg_addition_ack() const +{ + assert_choice_type(types::e2node_component_cfg_addition_ack, type_, "Value"); + return c.get(); +} +const e2node_component_cfg_upd_ack_list_l& e2node_cfg_upd_ack_ies_o::value_c::e2node_component_cfg_upd_ack() const +{ + assert_choice_type(types::e2node_component_cfg_upd_ack, type_, "Value"); + return c.get(); +} +const e2node_component_cfg_removal_ack_list_l& +e2node_cfg_upd_ack_ies_o::value_c::e2node_component_cfg_removal_ack() const +{ + assert_choice_type(types::e2node_component_cfg_removal_ack, type_, "Value"); + return c.get(); +} +void e2node_cfg_upd_ack_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::e2node_component_cfg_addition_ack: + j.start_array("E2nodeComponentConfigAdditionAck-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2node_component_cfg_upd_ack: + j.start_array("E2nodeComponentConfigUpdateAck-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2node_component_cfg_removal_ack: + j.start_array("E2nodeComponentConfigRemovalAck-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ack_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2node_cfg_upd_ack_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::e2node_component_cfg_addition_ack: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 1024, true)); + break; + case types::e2node_component_cfg_upd_ack: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 1024, true)); + break; + case types::e2node_component_cfg_removal_ack: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 1024, true)); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ack_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_cfg_upd_ack_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::e2node_component_cfg_addition_ack: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 1024, true)); + break; + case types::e2node_component_cfg_upd_ack: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 1024, true)); + break; + case types::e2node_component_cfg_removal_ack: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 1024, true)); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_ack_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2node_cfg_upd_ack_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", + "E2nodeComponentConfigAdditionAck-List", + "E2nodeComponentConfigUpdateAck-List", + "E2nodeComponentConfigRemovalAck-List"}; + return convert_enum_idx(options, 4, value, "e2node_cfg_upd_ack_ies_o::value_c::types"); +} + +// E2nodeConfigurationUpdateFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2node_cfg_upd_fail_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 1, 31, 2}; + return map_enum_number(options, 4, idx, "id"); +} +bool e2node_cfg_upd_fail_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 1, 31, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2node_cfg_upd_fail_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 1: + return crit_e::ignore; + case 31: + return crit_e::ignore; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2node_cfg_upd_fail_ies_o::value_c e2node_cfg_upd_fail_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 31: + ret.set(value_c::types::time_to_wait); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2node_cfg_upd_fail_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 1: + return presence_e::mandatory; + case 31: + return presence_e::optional; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2node_cfg_upd_fail_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::cause: + c.destroy(); + break; + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void e2node_cfg_upd_fail_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::cause: + c.init(); + break; + case types::time_to_wait: + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_fail_ies_o::value_c"); + } +} +e2node_cfg_upd_fail_ies_o::value_c::value_c(const e2node_cfg_upd_fail_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::time_to_wait: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_fail_ies_o::value_c"); + } +} +e2node_cfg_upd_fail_ies_o::value_c& +e2node_cfg_upd_fail_ies_o::value_c::operator=(const e2node_cfg_upd_fail_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::time_to_wait: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_fail_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2node_cfg_upd_fail_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +cause_c& e2node_cfg_upd_fail_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +time_to_wait_e& e2node_cfg_upd_fail_ies_o::value_c::time_to_wait() +{ + assert_choice_type(types::time_to_wait, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& e2node_cfg_upd_fail_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const uint16_t& e2node_cfg_upd_fail_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const cause_c& e2node_cfg_upd_fail_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const time_to_wait_e& e2node_cfg_upd_fail_ies_o::value_c::time_to_wait() const +{ + assert_choice_type(types::time_to_wait, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& e2node_cfg_upd_fail_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void e2node_cfg_upd_fail_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::time_to_wait: + j.write_str("TimeToWait", c.get().to_string()); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_fail_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2node_cfg_upd_fail_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::time_to_wait: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_fail_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_cfg_upd_fail_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::time_to_wait: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2node_cfg_upd_fail_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2node_cfg_upd_fail_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "Cause", "TimeToWait", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 4, value, "e2node_cfg_upd_fail_ies_o::value_c::types"); +} +uint8_t e2node_cfg_upd_fail_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "e2node_cfg_upd_fail_ies_o::value_c::types"); +} + +// E2setupFailureIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2setup_fail_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 1, 31, 2, 48}; + return map_enum_number(options, 5, idx, "id"); +} +bool e2setup_fail_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 1, 31, 2, 48}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2setup_fail_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 1: + return crit_e::ignore; + case 31: + return crit_e::ignore; + case 2: + return crit_e::ignore; + case 48: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2setup_fail_ies_o::value_c e2setup_fail_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 31: + ret.set(value_c::types::time_to_wait); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + case 48: + ret.set(value_c::types::tn_linfo); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2setup_fail_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 1: + return presence_e::mandatory; + case 31: + return presence_e::optional; + case 2: + return presence_e::optional; + case 48: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2setup_fail_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::cause: + c.destroy(); + break; + case types::crit_diagnostics: + c.destroy(); + break; + case types::tn_linfo: + c.destroy(); + break; + default: + break; + } +} +void e2setup_fail_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::cause: + c.init(); + break; + case types::time_to_wait: + break; + case types::crit_diagnostics: + c.init(); + break; + case types::tn_linfo: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_fail_ies_o::value_c"); + } +} +e2setup_fail_ies_o::value_c::value_c(const e2setup_fail_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::time_to_wait: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::tn_linfo: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_fail_ies_o::value_c"); + } +} +e2setup_fail_ies_o::value_c& e2setup_fail_ies_o::value_c::operator=(const e2setup_fail_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::time_to_wait: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::tn_linfo: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_fail_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2setup_fail_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +cause_c& e2setup_fail_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +time_to_wait_e& e2setup_fail_ies_o::value_c::time_to_wait() +{ + assert_choice_type(types::time_to_wait, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& e2setup_fail_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +tn_linfo_s& e2setup_fail_ies_o::value_c::tn_linfo() +{ + assert_choice_type(types::tn_linfo, type_, "Value"); + return c.get(); +} +const uint16_t& e2setup_fail_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const cause_c& e2setup_fail_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const time_to_wait_e& e2setup_fail_ies_o::value_c::time_to_wait() const +{ + assert_choice_type(types::time_to_wait, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& e2setup_fail_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const tn_linfo_s& e2setup_fail_ies_o::value_c::tn_linfo() const +{ + assert_choice_type(types::tn_linfo, type_, "Value"); + return c.get(); +} +void e2setup_fail_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::time_to_wait: + j.write_str("TimeToWait", c.get().to_string()); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + case types::tn_linfo: + j.write_fieldname("TNLinformation"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2setup_fail_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2setup_fail_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::time_to_wait: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::tn_linfo: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2setup_fail_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2setup_fail_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::time_to_wait: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::tn_linfo: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2setup_fail_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2setup_fail_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = { + "INTEGER (0..255,...)", "Cause", "TimeToWait", "CriticalityDiagnostics", "TNLinformation"}; + return convert_enum_idx(options, 5, value, "e2setup_fail_ies_o::value_c::types"); +} +uint8_t e2setup_fail_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "e2setup_fail_ies_o::value_c::types"); +} + +// E2setupRequestIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2setup_request_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 3, 10, 50}; + return map_enum_number(options, 4, idx, "id"); +} +bool e2setup_request_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 3, 10, 50}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2setup_request_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 3: + return crit_e::reject; + case 10: + return crit_e::reject; + case 50: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2setup_request_ies_o::value_c e2setup_request_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 3: + ret.set(value_c::types::global_e2node_id); + break; + case 10: + ret.set(value_c::types::ra_nfunctions_added); + break; + case 50: + ret.set(value_c::types::e2node_component_cfg_addition); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2setup_request_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 3: + return presence_e::mandatory; + case 10: + return presence_e::mandatory; + case 50: + return presence_e::mandatory; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2setup_request_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::global_e2node_id: + c.destroy(); + break; + case types::ra_nfunctions_added: + c.destroy(); + break; + case types::e2node_component_cfg_addition: + c.destroy(); + break; + default: + break; + } +} +void e2setup_request_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::global_e2node_id: + c.init(); + break; + case types::ra_nfunctions_added: + c.init(); + break; + case types::e2node_component_cfg_addition: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_request_ies_o::value_c"); + } +} +e2setup_request_ies_o::value_c::value_c(const e2setup_request_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::global_e2node_id: + c.init(other.c.get()); + break; + case types::ra_nfunctions_added: + c.init(other.c.get()); + break; + case types::e2node_component_cfg_addition: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_request_ies_o::value_c"); + } +} +e2setup_request_ies_o::value_c& e2setup_request_ies_o::value_c::operator=(const e2setup_request_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::global_e2node_id: + c.set(other.c.get()); + break; + case types::ra_nfunctions_added: + c.set(other.c.get()); + break; + case types::e2node_component_cfg_addition: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_request_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2setup_request_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +global_e2node_id_c& e2setup_request_ies_o::value_c::global_e2node_id() +{ + assert_choice_type(types::global_e2node_id, type_, "Value"); + return c.get(); +} +ra_nfunctions_list_l& e2setup_request_ies_o::value_c::ra_nfunctions_added() +{ + assert_choice_type(types::ra_nfunctions_added, type_, "Value"); + return c.get(); +} +e2node_component_cfg_addition_list_l& e2setup_request_ies_o::value_c::e2node_component_cfg_addition() +{ + assert_choice_type(types::e2node_component_cfg_addition, type_, "Value"); + return c.get(); +} +const uint16_t& e2setup_request_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const global_e2node_id_c& e2setup_request_ies_o::value_c::global_e2node_id() const +{ + assert_choice_type(types::global_e2node_id, type_, "Value"); + return c.get(); +} +const ra_nfunctions_list_l& e2setup_request_ies_o::value_c::ra_nfunctions_added() const +{ + assert_choice_type(types::ra_nfunctions_added, type_, "Value"); + return c.get(); +} +const e2node_component_cfg_addition_list_l& e2setup_request_ies_o::value_c::e2node_component_cfg_addition() const +{ + assert_choice_type(types::e2node_component_cfg_addition, type_, "Value"); + return c.get(); +} +void e2setup_request_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::global_e2node_id: + j.write_fieldname("GlobalE2node-ID"); + c.get().to_json(j); + break; + case types::ra_nfunctions_added: + j.start_array("RANfunctions-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2node_component_cfg_addition: + j.start_array("E2nodeComponentConfigAddition-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "e2setup_request_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2setup_request_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::global_e2node_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunctions_added: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + case types::e2node_component_cfg_addition: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 1024, true)); + break; + default: + log_invalid_choice_id(type_, "e2setup_request_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2setup_request_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::global_e2node_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunctions_added: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + case types::e2node_component_cfg_addition: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 1024, true)); + break; + default: + log_invalid_choice_id(type_, "e2setup_request_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2setup_request_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = { + "INTEGER (0..255,...)", "GlobalE2node-ID", "RANfunctions-List", "E2nodeComponentConfigAddition-List"}; + return convert_enum_idx(options, 4, value, "e2setup_request_ies_o::value_c::types"); +} + +// E2setupResponseIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t e2setup_resp_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 4, 9, 13, 52}; + return map_enum_number(options, 5, idx, "id"); +} +bool e2setup_resp_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 4, 9, 13, 52}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e e2setup_resp_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 4: + return crit_e::reject; + case 9: + return crit_e::reject; + case 13: + return crit_e::reject; + case 52: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +e2setup_resp_ies_o::value_c e2setup_resp_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 4: + ret.set(value_c::types::global_ric_id); + break; + case 9: + ret.set(value_c::types::ra_nfunctions_accepted); + break; + case 13: + ret.set(value_c::types::ra_nfunctions_rejected); + break; + case 52: + ret.set(value_c::types::e2node_component_cfg_addition_ack); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e e2setup_resp_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 4: + return presence_e::mandatory; + case 9: + return presence_e::optional; + case 13: + return presence_e::optional; + case 52: + return presence_e::mandatory; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void e2setup_resp_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::global_ric_id: + c.destroy(); + break; + case types::ra_nfunctions_accepted: + c.destroy(); + break; + case types::ra_nfunctions_rejected: + c.destroy(); + break; + case types::e2node_component_cfg_addition_ack: + c.destroy(); + break; + default: + break; + } +} +void e2setup_resp_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::global_ric_id: + c.init(); + break; + case types::ra_nfunctions_accepted: + c.init(); + break; + case types::ra_nfunctions_rejected: + c.init(); + break; + case types::e2node_component_cfg_addition_ack: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_resp_ies_o::value_c"); + } +} +e2setup_resp_ies_o::value_c::value_c(const e2setup_resp_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::global_ric_id: + c.init(other.c.get()); + break; + case types::ra_nfunctions_accepted: + c.init(other.c.get()); + break; + case types::ra_nfunctions_rejected: + c.init(other.c.get()); + break; + case types::e2node_component_cfg_addition_ack: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_resp_ies_o::value_c"); + } +} +e2setup_resp_ies_o::value_c& e2setup_resp_ies_o::value_c::operator=(const e2setup_resp_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::global_ric_id: + c.set(other.c.get()); + break; + case types::ra_nfunctions_accepted: + c.set(other.c.get()); + break; + case types::ra_nfunctions_rejected: + c.set(other.c.get()); + break; + case types::e2node_component_cfg_addition_ack: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2setup_resp_ies_o::value_c"); + } + + return *this; +} +uint16_t& e2setup_resp_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +global_ric_id_s& e2setup_resp_ies_o::value_c::global_ric_id() +{ + assert_choice_type(types::global_ric_id, type_, "Value"); + return c.get(); +} +ra_nfunctions_id_list_l& e2setup_resp_ies_o::value_c::ra_nfunctions_accepted() +{ + assert_choice_type(types::ra_nfunctions_accepted, type_, "Value"); + return c.get(); +} +ra_nfunctions_idcause_list_l& e2setup_resp_ies_o::value_c::ra_nfunctions_rejected() +{ + assert_choice_type(types::ra_nfunctions_rejected, type_, "Value"); + return c.get(); +} +e2node_component_cfg_addition_ack_list_l& e2setup_resp_ies_o::value_c::e2node_component_cfg_addition_ack() +{ + assert_choice_type(types::e2node_component_cfg_addition_ack, type_, "Value"); + return c.get(); +} +const uint16_t& e2setup_resp_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const global_ric_id_s& e2setup_resp_ies_o::value_c::global_ric_id() const +{ + assert_choice_type(types::global_ric_id, type_, "Value"); + return c.get(); +} +const ra_nfunctions_id_list_l& e2setup_resp_ies_o::value_c::ra_nfunctions_accepted() const +{ + assert_choice_type(types::ra_nfunctions_accepted, type_, "Value"); + return c.get(); +} +const ra_nfunctions_idcause_list_l& e2setup_resp_ies_o::value_c::ra_nfunctions_rejected() const +{ + assert_choice_type(types::ra_nfunctions_rejected, type_, "Value"); + return c.get(); +} +const e2node_component_cfg_addition_ack_list_l& e2setup_resp_ies_o::value_c::e2node_component_cfg_addition_ack() const +{ + assert_choice_type(types::e2node_component_cfg_addition_ack, type_, "Value"); + return c.get(); +} +void e2setup_resp_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::global_ric_id: + j.write_fieldname("GlobalRIC-ID"); + c.get().to_json(j); + break; + case types::ra_nfunctions_accepted: + j.start_array("RANfunctionsID-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::ra_nfunctions_rejected: + j.start_array("RANfunctionsIDcause-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::e2node_component_cfg_addition_ack: + j.start_array("E2nodeComponentConfigAdditionAck-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "e2setup_resp_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE e2setup_resp_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::global_ric_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunctions_accepted: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + case types::ra_nfunctions_rejected: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + case types::e2node_component_cfg_addition_ack: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 1024, true)); + break; + default: + log_invalid_choice_id(type_, "e2setup_resp_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2setup_resp_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::global_ric_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunctions_accepted: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + case types::ra_nfunctions_rejected: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + case types::e2node_component_cfg_addition_ack: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 1024, true)); + break; + default: + log_invalid_choice_id(type_, "e2setup_resp_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2setup_resp_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", + "GlobalRIC-ID", + "RANfunctionsID-List", + "RANfunctionsIDcause-List", + "E2nodeComponentConfigAdditionAck-List"}; + return convert_enum_idx(options, 5, value, "e2setup_resp_ies_o::value_c::types"); +} +uint8_t e2setup_resp_ies_o::value_c::types_opts::to_number() const +{ + switch (value) { + case transaction_id: + return 0; + case e2node_component_cfg_addition_ack: + return 2; + default: + invalid_enum_number(value, "e2setup_resp_ies_o::value_c::types"); + } + return 0; +} + +// ErrorIndication-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t error_ind_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 29, 5, 1, 2}; + return map_enum_number(options, 5, idx, "id"); +} +bool error_ind_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 29, 5, 1, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e error_ind_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 1: + return crit_e::ignore; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +error_ind_ies_o::value_c error_ind_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e error_ind_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::optional; + case 29: + return presence_e::optional; + case 5: + return presence_e::optional; + case 1: + return presence_e::optional; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void error_ind_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::cause: + c.destroy(); + break; + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void error_ind_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::cause: + c.init(); + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "error_ind_ies_o::value_c"); + } +} +error_ind_ies_o::value_c::value_c(const error_ind_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "error_ind_ies_o::value_c"); + } +} +error_ind_ies_o::value_c& error_ind_ies_o::value_c::operator=(const error_ind_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "error_ind_ies_o::value_c"); + } + + return *this; +} +uint16_t& error_ind_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +ri_crequest_id_s& error_ind_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& error_ind_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +cause_c& error_ind_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& error_ind_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const uint16_t& error_ind_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const ri_crequest_id_s& error_ind_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& error_ind_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const cause_c& error_ind_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& error_ind_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void error_ind_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "error_ind_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE error_ind_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "error_ind_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE error_ind_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "error_ind_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* error_ind_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = { + "INTEGER (0..255,...)", "RICrequestID", "INTEGER (0..4095)", "Cause", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 5, value, "error_ind_ies_o::value_c::types"); +} + +// RICcontrolAcknowledge-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ri_cctrl_ack_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5, 20, 32}; + return map_enum_number(options, 4, idx, "id"); +} +bool ri_cctrl_ack_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5, 20, 32}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ri_cctrl_ack_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 20: + return crit_e::reject; + case 32: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ri_cctrl_ack_ies_o::value_c ri_cctrl_ack_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 20: + ret.set(value_c::types::ri_ccall_process_id); + break; + case 32: + ret.set(value_c::types::ri_cctrl_outcome); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ri_cctrl_ack_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + case 20: + return presence_e::optional; + case 32: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ri_cctrl_ack_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::ri_ccall_process_id: + c.destroy >(); + break; + case types::ri_cctrl_outcome: + c.destroy >(); + break; + default: + break; + } +} +void ri_cctrl_ack_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::ri_ccall_process_id: + c.init >(); + break; + case types::ri_cctrl_outcome: + c.init >(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_ack_ies_o::value_c"); + } +} +ri_cctrl_ack_ies_o::value_c::value_c(const ri_cctrl_ack_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::ri_ccall_process_id: + c.init(other.c.get >()); + break; + case types::ri_cctrl_outcome: + c.init(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_ack_ies_o::value_c"); + } +} +ri_cctrl_ack_ies_o::value_c& ri_cctrl_ack_ies_o::value_c::operator=(const ri_cctrl_ack_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::ri_ccall_process_id: + c.set(other.c.get >()); + break; + case types::ri_cctrl_outcome: + c.set(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_ack_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ri_cctrl_ack_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ri_cctrl_ack_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +unbounded_octstring& ri_cctrl_ack_ies_o::value_c::ri_ccall_process_id() +{ + assert_choice_type(types::ri_ccall_process_id, type_, "Value"); + return c.get >(); +} +unbounded_octstring& ri_cctrl_ack_ies_o::value_c::ri_cctrl_outcome() +{ + assert_choice_type(types::ri_cctrl_outcome, type_, "Value"); + return c.get >(); +} +const ri_crequest_id_s& ri_cctrl_ack_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ri_cctrl_ack_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const unbounded_octstring& ri_cctrl_ack_ies_o::value_c::ri_ccall_process_id() const +{ + assert_choice_type(types::ri_ccall_process_id, type_, "Value"); + return c.get >(); +} +const unbounded_octstring& ri_cctrl_ack_ies_o::value_c::ri_cctrl_outcome() const +{ + assert_choice_type(types::ri_cctrl_outcome, type_, "Value"); + return c.get >(); +} +void ri_cctrl_ack_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::ri_ccall_process_id: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + case types::ri_cctrl_outcome: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_ack_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ri_cctrl_ack_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_ccall_process_id: + HANDLE_CODE(c.get >().pack(bref)); + break; + case types::ri_cctrl_outcome: + HANDLE_CODE(c.get >().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_ack_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_cctrl_ack_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_ccall_process_id: + HANDLE_CODE(c.get >().unpack(bref)); + break; + case types::ri_cctrl_outcome: + HANDLE_CODE(c.get >().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_ack_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ri_cctrl_ack_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICrequestID", "INTEGER (0..4095)", "OCTET STRING", "OCTET STRING"}; + return convert_enum_idx(options, 4, value, "ri_cctrl_ack_ies_o::value_c::types"); +} +uint8_t ri_cctrl_ack_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ri_cctrl_ack_ies_o::value_c::types"); + return 0; +} + +// RICcontrolFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ri_cctrl_fail_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5, 20, 1, 32}; + return map_enum_number(options, 5, idx, "id"); +} +bool ri_cctrl_fail_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5, 20, 1, 32}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ri_cctrl_fail_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 20: + return crit_e::reject; + case 1: + return crit_e::ignore; + case 32: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ri_cctrl_fail_ies_o::value_c ri_cctrl_fail_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 20: + ret.set(value_c::types::ri_ccall_process_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 32: + ret.set(value_c::types::ri_cctrl_outcome); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ri_cctrl_fail_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + case 20: + return presence_e::optional; + case 1: + return presence_e::mandatory; + case 32: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ri_cctrl_fail_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::ri_ccall_process_id: + c.destroy >(); + break; + case types::cause: + c.destroy(); + break; + case types::ri_cctrl_outcome: + c.destroy >(); + break; + default: + break; + } +} +void ri_cctrl_fail_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::ri_ccall_process_id: + c.init >(); + break; + case types::cause: + c.init(); + break; + case types::ri_cctrl_outcome: + c.init >(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_fail_ies_o::value_c"); + } +} +ri_cctrl_fail_ies_o::value_c::value_c(const ri_cctrl_fail_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::ri_ccall_process_id: + c.init(other.c.get >()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::ri_cctrl_outcome: + c.init(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_fail_ies_o::value_c"); + } +} +ri_cctrl_fail_ies_o::value_c& ri_cctrl_fail_ies_o::value_c::operator=(const ri_cctrl_fail_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::ri_ccall_process_id: + c.set(other.c.get >()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::ri_cctrl_outcome: + c.set(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_fail_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ri_cctrl_fail_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ri_cctrl_fail_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +unbounded_octstring& ri_cctrl_fail_ies_o::value_c::ri_ccall_process_id() +{ + assert_choice_type(types::ri_ccall_process_id, type_, "Value"); + return c.get >(); +} +cause_c& ri_cctrl_fail_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +unbounded_octstring& ri_cctrl_fail_ies_o::value_c::ri_cctrl_outcome() +{ + assert_choice_type(types::ri_cctrl_outcome, type_, "Value"); + return c.get >(); +} +const ri_crequest_id_s& ri_cctrl_fail_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ri_cctrl_fail_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const unbounded_octstring& ri_cctrl_fail_ies_o::value_c::ri_ccall_process_id() const +{ + assert_choice_type(types::ri_ccall_process_id, type_, "Value"); + return c.get >(); +} +const cause_c& ri_cctrl_fail_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const unbounded_octstring& ri_cctrl_fail_ies_o::value_c::ri_cctrl_outcome() const +{ + assert_choice_type(types::ri_cctrl_outcome, type_, "Value"); + return c.get >(); +} +void ri_cctrl_fail_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::ri_ccall_process_id: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::ri_cctrl_outcome: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_fail_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ri_cctrl_fail_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_ccall_process_id: + HANDLE_CODE(c.get >().pack(bref)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ri_cctrl_outcome: + HANDLE_CODE(c.get >().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_fail_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_cctrl_fail_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_ccall_process_id: + HANDLE_CODE(c.get >().unpack(bref)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ri_cctrl_outcome: + HANDLE_CODE(c.get >().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_fail_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ri_cctrl_fail_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICrequestID", "INTEGER (0..4095)", "OCTET STRING", "Cause", "OCTET STRING"}; + return convert_enum_idx(options, 5, value, "ri_cctrl_fail_ies_o::value_c::types"); +} +uint8_t ri_cctrl_fail_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ri_cctrl_fail_ies_o::value_c::types"); + return 0; +} + +// RICcontrolRequest-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ri_cctrl_request_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5, 20, 22, 23, 21}; + return map_enum_number(options, 6, idx, "id"); +} +bool ri_cctrl_request_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5, 20, 22, 23, 21}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ri_cctrl_request_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 20: + return crit_e::reject; + case 22: + return crit_e::reject; + case 23: + return crit_e::reject; + case 21: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ri_cctrl_request_ies_o::value_c ri_cctrl_request_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 20: + ret.set(value_c::types::ri_ccall_process_id); + break; + case 22: + ret.set(value_c::types::ri_cctrl_hdr); + break; + case 23: + ret.set(value_c::types::ri_cctrl_msg); + break; + case 21: + ret.set(value_c::types::ri_cctrl_ack_request); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ri_cctrl_request_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + case 20: + return presence_e::optional; + case 22: + return presence_e::mandatory; + case 23: + return presence_e::mandatory; + case 21: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ri_cctrl_request_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::ri_ccall_process_id: + c.destroy >(); + break; + case types::ri_cctrl_hdr: + c.destroy >(); + break; + case types::ri_cctrl_msg: + c.destroy >(); + break; + default: + break; + } +} +void ri_cctrl_request_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::ri_ccall_process_id: + c.init >(); + break; + case types::ri_cctrl_hdr: + c.init >(); + break; + case types::ri_cctrl_msg: + c.init >(); + break; + case types::ri_cctrl_ack_request: + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_request_ies_o::value_c"); + } +} +ri_cctrl_request_ies_o::value_c::value_c(const ri_cctrl_request_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::ri_ccall_process_id: + c.init(other.c.get >()); + break; + case types::ri_cctrl_hdr: + c.init(other.c.get >()); + break; + case types::ri_cctrl_msg: + c.init(other.c.get >()); + break; + case types::ri_cctrl_ack_request: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_request_ies_o::value_c"); + } +} +ri_cctrl_request_ies_o::value_c& +ri_cctrl_request_ies_o::value_c::operator=(const ri_cctrl_request_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::ri_ccall_process_id: + c.set(other.c.get >()); + break; + case types::ri_cctrl_hdr: + c.set(other.c.get >()); + break; + case types::ri_cctrl_msg: + c.set(other.c.get >()); + break; + case types::ri_cctrl_ack_request: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_request_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ri_cctrl_request_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ri_cctrl_request_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +unbounded_octstring& ri_cctrl_request_ies_o::value_c::ri_ccall_process_id() +{ + assert_choice_type(types::ri_ccall_process_id, type_, "Value"); + return c.get >(); +} +unbounded_octstring& ri_cctrl_request_ies_o::value_c::ri_cctrl_hdr() +{ + assert_choice_type(types::ri_cctrl_hdr, type_, "Value"); + return c.get >(); +} +unbounded_octstring& ri_cctrl_request_ies_o::value_c::ri_cctrl_msg() +{ + assert_choice_type(types::ri_cctrl_msg, type_, "Value"); + return c.get >(); +} +ri_cctrl_ack_request_e& ri_cctrl_request_ies_o::value_c::ri_cctrl_ack_request() +{ + assert_choice_type(types::ri_cctrl_ack_request, type_, "Value"); + return c.get(); +} +const ri_crequest_id_s& ri_cctrl_request_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ri_cctrl_request_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const unbounded_octstring& ri_cctrl_request_ies_o::value_c::ri_ccall_process_id() const +{ + assert_choice_type(types::ri_ccall_process_id, type_, "Value"); + return c.get >(); +} +const unbounded_octstring& ri_cctrl_request_ies_o::value_c::ri_cctrl_hdr() const +{ + assert_choice_type(types::ri_cctrl_hdr, type_, "Value"); + return c.get >(); +} +const unbounded_octstring& ri_cctrl_request_ies_o::value_c::ri_cctrl_msg() const +{ + assert_choice_type(types::ri_cctrl_msg, type_, "Value"); + return c.get >(); +} +const ri_cctrl_ack_request_e& ri_cctrl_request_ies_o::value_c::ri_cctrl_ack_request() const +{ + assert_choice_type(types::ri_cctrl_ack_request, type_, "Value"); + return c.get(); +} +void ri_cctrl_request_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::ri_ccall_process_id: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + case types::ri_cctrl_hdr: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + case types::ri_cctrl_msg: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + case types::ri_cctrl_ack_request: + j.write_str("RICcontrolAckRequest", c.get().to_string()); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_request_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ri_cctrl_request_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_ccall_process_id: + HANDLE_CODE(c.get >().pack(bref)); + break; + case types::ri_cctrl_hdr: + HANDLE_CODE(c.get >().pack(bref)); + break; + case types::ri_cctrl_msg: + HANDLE_CODE(c.get >().pack(bref)); + break; + case types::ri_cctrl_ack_request: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_request_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_cctrl_request_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_ccall_process_id: + HANDLE_CODE(c.get >().unpack(bref)); + break; + case types::ri_cctrl_hdr: + HANDLE_CODE(c.get >().unpack(bref)); + break; + case types::ri_cctrl_msg: + HANDLE_CODE(c.get >().unpack(bref)); + break; + case types::ri_cctrl_ack_request: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ri_cctrl_request_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ri_cctrl_request_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = { + "RICrequestID", "INTEGER (0..4095)", "OCTET STRING", "OCTET STRING", "OCTET STRING", "RICcontrolAckRequest"}; + return convert_enum_idx(options, 6, value, "ri_cctrl_request_ies_o::value_c::types"); +} +uint8_t ri_cctrl_request_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ri_cctrl_request_ies_o::value_c::types"); + return 0; +} + +// RICindication-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ri_cind_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5, 15, 27, 28, 25, 26, 20}; + return map_enum_number(options, 8, idx, "id"); +} +bool ri_cind_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5, 15, 27, 28, 25, 26, 20}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ri_cind_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 15: + return crit_e::reject; + case 27: + return crit_e::reject; + case 28: + return crit_e::reject; + case 25: + return crit_e::reject; + case 26: + return crit_e::reject; + case 20: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ri_cind_ies_o::value_c ri_cind_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 15: + ret.set(value_c::types::ri_caction_id); + break; + case 27: + ret.set(value_c::types::ri_cind_sn); + break; + case 28: + ret.set(value_c::types::ri_cind_type); + break; + case 25: + ret.set(value_c::types::ri_cind_hdr); + break; + case 26: + ret.set(value_c::types::ri_cind_msg); + break; + case 20: + ret.set(value_c::types::ri_ccall_process_id); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ri_cind_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + case 15: + return presence_e::mandatory; + case 27: + return presence_e::optional; + case 28: + return presence_e::mandatory; + case 25: + return presence_e::mandatory; + case 26: + return presence_e::mandatory; + case 20: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ri_cind_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::ri_cind_hdr: + c.destroy >(); + break; + case types::ri_cind_msg: + c.destroy >(); + break; + case types::ri_ccall_process_id: + c.destroy >(); + break; + default: + break; + } +} +void ri_cind_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::ri_caction_id: + break; + case types::ri_cind_sn: + break; + case types::ri_cind_type: + break; + case types::ri_cind_hdr: + c.init >(); + break; + case types::ri_cind_msg: + c.init >(); + break; + case types::ri_ccall_process_id: + c.init >(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cind_ies_o::value_c"); + } +} +ri_cind_ies_o::value_c::value_c(const ri_cind_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::ri_caction_id: + c.init(other.c.get()); + break; + case types::ri_cind_sn: + c.init(other.c.get()); + break; + case types::ri_cind_type: + c.init(other.c.get()); + break; + case types::ri_cind_hdr: + c.init(other.c.get >()); + break; + case types::ri_cind_msg: + c.init(other.c.get >()); + break; + case types::ri_ccall_process_id: + c.init(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cind_ies_o::value_c"); + } +} +ri_cind_ies_o::value_c& ri_cind_ies_o::value_c::operator=(const ri_cind_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::ri_caction_id: + c.set(other.c.get()); + break; + case types::ri_cind_sn: + c.set(other.c.get()); + break; + case types::ri_cind_type: + c.set(other.c.get()); + break; + case types::ri_cind_hdr: + c.set(other.c.get >()); + break; + case types::ri_cind_msg: + c.set(other.c.get >()); + break; + case types::ri_ccall_process_id: + c.set(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ri_cind_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ri_cind_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ri_cind_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +uint16_t& ri_cind_ies_o::value_c::ri_caction_id() +{ + assert_choice_type(types::ri_caction_id, type_, "Value"); + return c.get(); +} +uint32_t& ri_cind_ies_o::value_c::ri_cind_sn() +{ + assert_choice_type(types::ri_cind_sn, type_, "Value"); + return c.get(); +} +ri_cind_type_e& ri_cind_ies_o::value_c::ri_cind_type() +{ + assert_choice_type(types::ri_cind_type, type_, "Value"); + return c.get(); +} +unbounded_octstring& ri_cind_ies_o::value_c::ri_cind_hdr() +{ + assert_choice_type(types::ri_cind_hdr, type_, "Value"); + return c.get >(); +} +unbounded_octstring& ri_cind_ies_o::value_c::ri_cind_msg() +{ + assert_choice_type(types::ri_cind_msg, type_, "Value"); + return c.get >(); +} +unbounded_octstring& ri_cind_ies_o::value_c::ri_ccall_process_id() +{ + assert_choice_type(types::ri_ccall_process_id, type_, "Value"); + return c.get >(); +} +const ri_crequest_id_s& ri_cind_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ri_cind_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const uint16_t& ri_cind_ies_o::value_c::ri_caction_id() const +{ + assert_choice_type(types::ri_caction_id, type_, "Value"); + return c.get(); +} +const uint32_t& ri_cind_ies_o::value_c::ri_cind_sn() const +{ + assert_choice_type(types::ri_cind_sn, type_, "Value"); + return c.get(); +} +const ri_cind_type_e& ri_cind_ies_o::value_c::ri_cind_type() const +{ + assert_choice_type(types::ri_cind_type, type_, "Value"); + return c.get(); +} +const unbounded_octstring& ri_cind_ies_o::value_c::ri_cind_hdr() const +{ + assert_choice_type(types::ri_cind_hdr, type_, "Value"); + return c.get >(); +} +const unbounded_octstring& ri_cind_ies_o::value_c::ri_cind_msg() const +{ + assert_choice_type(types::ri_cind_msg, type_, "Value"); + return c.get >(); +} +const unbounded_octstring& ri_cind_ies_o::value_c::ri_ccall_process_id() const +{ + assert_choice_type(types::ri_ccall_process_id, type_, "Value"); + return c.get >(); +} +void ri_cind_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::ri_caction_id: + j.write_int("INTEGER (0..255)", c.get()); + break; + case types::ri_cind_sn: + j.write_int("INTEGER (0..65535)", c.get()); + break; + case types::ri_cind_type: + j.write_str("RICindicationType", c.get().to_string()); + break; + case types::ri_cind_hdr: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + case types::ri_cind_msg: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + case types::ri_ccall_process_id: + j.write_str("OCTET STRING", c.get >().to_string()); + break; + default: + log_invalid_choice_id(type_, "ri_cind_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ri_cind_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_caction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, false, true)); + break; + case types::ri_cind_sn: + HANDLE_CODE(pack_integer(bref, c.get(), (uint32_t)0u, (uint32_t)65535u, false, true)); + break; + case types::ri_cind_type: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ri_cind_hdr: + HANDLE_CODE(c.get >().pack(bref)); + break; + case types::ri_cind_msg: + HANDLE_CODE(c.get >().pack(bref)); + break; + case types::ri_ccall_process_id: + HANDLE_CODE(c.get >().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ri_cind_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_cind_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_caction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, false, true)); + break; + case types::ri_cind_sn: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + break; + case types::ri_cind_type: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ri_cind_hdr: + HANDLE_CODE(c.get >().unpack(bref)); + break; + case types::ri_cind_msg: + HANDLE_CODE(c.get >().unpack(bref)); + break; + case types::ri_ccall_process_id: + HANDLE_CODE(c.get >().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ri_cind_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ri_cind_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICrequestID", + "INTEGER (0..4095)", + "INTEGER (0..255)", + "INTEGER (0..65535)", + "RICindicationType", + "OCTET STRING", + "OCTET STRING", + "OCTET STRING"}; + return convert_enum_idx(options, 8, value, "ri_cind_ies_o::value_c::types"); +} + +// RICserviceQuery-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricservice_query_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 9}; + return map_enum_number(options, 2, idx, "id"); +} +bool ricservice_query_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 9}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricservice_query_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 9: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricservice_query_ies_o::value_c ricservice_query_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 9: + ret.set(value_c::types::ra_nfunctions_accepted); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricservice_query_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 9: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricservice_query_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ra_nfunctions_accepted: + c.destroy(); + break; + default: + break; + } +} +void ricservice_query_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::ra_nfunctions_accepted: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_query_ies_o::value_c"); + } +} +ricservice_query_ies_o::value_c::value_c(const ricservice_query_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::ra_nfunctions_accepted: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_query_ies_o::value_c"); + } +} +ricservice_query_ies_o::value_c& +ricservice_query_ies_o::value_c::operator=(const ricservice_query_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::ra_nfunctions_accepted: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_query_ies_o::value_c"); + } + + return *this; +} +uint16_t& ricservice_query_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +ra_nfunctions_id_list_l& ricservice_query_ies_o::value_c::ra_nfunctions_accepted() +{ + assert_choice_type(types::ra_nfunctions_accepted, type_, "Value"); + return c.get(); +} +const uint16_t& ricservice_query_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const ra_nfunctions_id_list_l& ricservice_query_ies_o::value_c::ra_nfunctions_accepted() const +{ + assert_choice_type(types::ra_nfunctions_accepted, type_, "Value"); + return c.get(); +} +void ricservice_query_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::ra_nfunctions_accepted: + j.start_array("RANfunctionsID-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "ricservice_query_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricservice_query_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::ra_nfunctions_accepted: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + default: + log_invalid_choice_id(type_, "ricservice_query_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricservice_query_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::ra_nfunctions_accepted: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + default: + log_invalid_choice_id(type_, "ricservice_query_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricservice_query_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "RANfunctionsID-List"}; + return convert_enum_idx(options, 2, value, "ricservice_query_ies_o::value_c::types"); +} +uint8_t ricservice_query_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "ricservice_query_ies_o::value_c::types"); +} + +// RICserviceUpdate-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricservice_upd_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 10, 12, 11}; + return map_enum_number(options, 4, idx, "id"); +} +bool ricservice_upd_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 10, 12, 11}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricservice_upd_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 10: + return crit_e::reject; + case 12: + return crit_e::reject; + case 11: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricservice_upd_ies_o::value_c ricservice_upd_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 10: + ret.set(value_c::types::ra_nfunctions_added); + break; + case 12: + ret.set(value_c::types::ra_nfunctions_modified); + break; + case 11: + ret.set(value_c::types::ra_nfunctions_deleted); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricservice_upd_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 10: + return presence_e::optional; + case 12: + return presence_e::optional; + case 11: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricservice_upd_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ra_nfunctions_added: + c.destroy(); + break; + case types::ra_nfunctions_modified: + c.destroy(); + break; + case types::ra_nfunctions_deleted: + c.destroy(); + break; + default: + break; + } +} +void ricservice_upd_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::ra_nfunctions_added: + c.init(); + break; + case types::ra_nfunctions_modified: + c.init(); + break; + case types::ra_nfunctions_deleted: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ies_o::value_c"); + } +} +ricservice_upd_ies_o::value_c::value_c(const ricservice_upd_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::ra_nfunctions_added: + c.init(other.c.get()); + break; + case types::ra_nfunctions_modified: + c.init(other.c.get()); + break; + case types::ra_nfunctions_deleted: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ies_o::value_c"); + } +} +ricservice_upd_ies_o::value_c& ricservice_upd_ies_o::value_c::operator=(const ricservice_upd_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::ra_nfunctions_added: + c.set(other.c.get()); + break; + case types::ra_nfunctions_modified: + c.set(other.c.get()); + break; + case types::ra_nfunctions_deleted: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ies_o::value_c"); + } + + return *this; +} +uint16_t& ricservice_upd_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +ra_nfunctions_list_l& ricservice_upd_ies_o::value_c::ra_nfunctions_added() +{ + assert_choice_type(types::ra_nfunctions_added, type_, "Value"); + return c.get(); +} +ra_nfunctions_list_l& ricservice_upd_ies_o::value_c::ra_nfunctions_modified() +{ + assert_choice_type(types::ra_nfunctions_modified, type_, "Value"); + return c.get(); +} +ra_nfunctions_id_list_l& ricservice_upd_ies_o::value_c::ra_nfunctions_deleted() +{ + assert_choice_type(types::ra_nfunctions_deleted, type_, "Value"); + return c.get(); +} +const uint16_t& ricservice_upd_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const ra_nfunctions_list_l& ricservice_upd_ies_o::value_c::ra_nfunctions_added() const +{ + assert_choice_type(types::ra_nfunctions_added, type_, "Value"); + return c.get(); +} +const ra_nfunctions_list_l& ricservice_upd_ies_o::value_c::ra_nfunctions_modified() const +{ + assert_choice_type(types::ra_nfunctions_modified, type_, "Value"); + return c.get(); +} +const ra_nfunctions_id_list_l& ricservice_upd_ies_o::value_c::ra_nfunctions_deleted() const +{ + assert_choice_type(types::ra_nfunctions_deleted, type_, "Value"); + return c.get(); +} +void ricservice_upd_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::ra_nfunctions_added: + j.start_array("RANfunctions-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::ra_nfunctions_modified: + j.start_array("RANfunctions-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::ra_nfunctions_deleted: + j.start_array("RANfunctionsID-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricservice_upd_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::ra_nfunctions_added: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + case types::ra_nfunctions_modified: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + case types::ra_nfunctions_deleted: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricservice_upd_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::ra_nfunctions_added: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + case types::ra_nfunctions_modified: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + case types::ra_nfunctions_deleted: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricservice_upd_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = { + "INTEGER (0..255,...)", "RANfunctions-List", "RANfunctions-List", "RANfunctionsID-List"}; + return convert_enum_idx(options, 4, value, "ricservice_upd_ies_o::value_c::types"); +} +uint8_t ricservice_upd_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "ricservice_upd_ies_o::value_c::types"); +} + +// RICserviceUpdateAcknowledge-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricservice_upd_ack_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 9, 13}; + return map_enum_number(options, 3, idx, "id"); +} +bool ricservice_upd_ack_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 9, 13}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricservice_upd_ack_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 9: + return crit_e::reject; + case 13: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricservice_upd_ack_ies_o::value_c ricservice_upd_ack_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 9: + ret.set(value_c::types::ra_nfunctions_accepted); + break; + case 13: + ret.set(value_c::types::ra_nfunctions_rejected); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricservice_upd_ack_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 9: + return presence_e::optional; + case 13: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricservice_upd_ack_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ra_nfunctions_accepted: + c.destroy(); + break; + case types::ra_nfunctions_rejected: + c.destroy(); + break; + default: + break; + } +} +void ricservice_upd_ack_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::ra_nfunctions_accepted: + c.init(); + break; + case types::ra_nfunctions_rejected: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ack_ies_o::value_c"); + } +} +ricservice_upd_ack_ies_o::value_c::value_c(const ricservice_upd_ack_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::ra_nfunctions_accepted: + c.init(other.c.get()); + break; + case types::ra_nfunctions_rejected: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ack_ies_o::value_c"); + } +} +ricservice_upd_ack_ies_o::value_c& +ricservice_upd_ack_ies_o::value_c::operator=(const ricservice_upd_ack_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::ra_nfunctions_accepted: + c.set(other.c.get()); + break; + case types::ra_nfunctions_rejected: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ack_ies_o::value_c"); + } + + return *this; +} +uint16_t& ricservice_upd_ack_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +ra_nfunctions_id_list_l& ricservice_upd_ack_ies_o::value_c::ra_nfunctions_accepted() +{ + assert_choice_type(types::ra_nfunctions_accepted, type_, "Value"); + return c.get(); +} +ra_nfunctions_idcause_list_l& ricservice_upd_ack_ies_o::value_c::ra_nfunctions_rejected() +{ + assert_choice_type(types::ra_nfunctions_rejected, type_, "Value"); + return c.get(); +} +const uint16_t& ricservice_upd_ack_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const ra_nfunctions_id_list_l& ricservice_upd_ack_ies_o::value_c::ra_nfunctions_accepted() const +{ + assert_choice_type(types::ra_nfunctions_accepted, type_, "Value"); + return c.get(); +} +const ra_nfunctions_idcause_list_l& ricservice_upd_ack_ies_o::value_c::ra_nfunctions_rejected() const +{ + assert_choice_type(types::ra_nfunctions_rejected, type_, "Value"); + return c.get(); +} +void ricservice_upd_ack_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::ra_nfunctions_accepted: + j.start_array("RANfunctionsID-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::ra_nfunctions_rejected: + j.start_array("RANfunctionsIDcause-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ack_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricservice_upd_ack_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::ra_nfunctions_accepted: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + case types::ra_nfunctions_rejected: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 256, true)); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ack_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricservice_upd_ack_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::ra_nfunctions_accepted: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + case types::ra_nfunctions_rejected: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 256, true)); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_ack_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricservice_upd_ack_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "RANfunctionsID-List", "RANfunctionsIDcause-List"}; + return convert_enum_idx(options, 3, value, "ricservice_upd_ack_ies_o::value_c::types"); +} +uint8_t ricservice_upd_ack_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "ricservice_upd_ack_ies_o::value_c::types"); +} + +// RICserviceUpdateFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricservice_upd_fail_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 1, 31, 2}; + return map_enum_number(options, 4, idx, "id"); +} +bool ricservice_upd_fail_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 1, 31, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricservice_upd_fail_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 1: + return crit_e::reject; + case 31: + return crit_e::ignore; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricservice_upd_fail_ies_o::value_c ricservice_upd_fail_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 31: + ret.set(value_c::types::time_to_wait); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricservice_upd_fail_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 1: + return presence_e::mandatory; + case 31: + return presence_e::optional; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricservice_upd_fail_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::cause: + c.destroy(); + break; + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void ricservice_upd_fail_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::cause: + c.init(); + break; + case types::time_to_wait: + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_fail_ies_o::value_c"); + } +} +ricservice_upd_fail_ies_o::value_c::value_c(const ricservice_upd_fail_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::time_to_wait: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_fail_ies_o::value_c"); + } +} +ricservice_upd_fail_ies_o::value_c& +ricservice_upd_fail_ies_o::value_c::operator=(const ricservice_upd_fail_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::time_to_wait: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_fail_ies_o::value_c"); + } + + return *this; +} +uint16_t& ricservice_upd_fail_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +cause_c& ricservice_upd_fail_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +time_to_wait_e& ricservice_upd_fail_ies_o::value_c::time_to_wait() +{ + assert_choice_type(types::time_to_wait, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& ricservice_upd_fail_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const uint16_t& ricservice_upd_fail_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const cause_c& ricservice_upd_fail_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const time_to_wait_e& ricservice_upd_fail_ies_o::value_c::time_to_wait() const +{ + assert_choice_type(types::time_to_wait, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& ricservice_upd_fail_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void ricservice_upd_fail_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::time_to_wait: + j.write_str("TimeToWait", c.get().to_string()); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_fail_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricservice_upd_fail_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::time_to_wait: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_fail_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricservice_upd_fail_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::time_to_wait: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ricservice_upd_fail_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricservice_upd_fail_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "Cause", "TimeToWait", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 4, value, "ricservice_upd_fail_ies_o::value_c::types"); +} +uint8_t ricservice_upd_fail_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "ricservice_upd_fail_ies_o::value_c::types"); +} + +// RICsubscriptionDeleteFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricsubscription_delete_fail_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5, 1, 2}; + return map_enum_number(options, 4, idx, "id"); +} +bool ricsubscription_delete_fail_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5, 1, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricsubscription_delete_fail_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 1: + return crit_e::ignore; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricsubscription_delete_fail_ies_o::value_c ricsubscription_delete_fail_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricsubscription_delete_fail_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + case 1: + return presence_e::mandatory; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricsubscription_delete_fail_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::cause: + c.destroy(); + break; + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void ricsubscription_delete_fail_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::cause: + c.init(); + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_fail_ies_o::value_c"); + } +} +ricsubscription_delete_fail_ies_o::value_c::value_c(const ricsubscription_delete_fail_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_fail_ies_o::value_c"); + } +} +ricsubscription_delete_fail_ies_o::value_c& +ricsubscription_delete_fail_ies_o::value_c::operator=(const ricsubscription_delete_fail_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_fail_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ricsubscription_delete_fail_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ricsubscription_delete_fail_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +cause_c& ricsubscription_delete_fail_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& ricsubscription_delete_fail_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const ri_crequest_id_s& ricsubscription_delete_fail_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ricsubscription_delete_fail_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const cause_c& ricsubscription_delete_fail_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& ricsubscription_delete_fail_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void ricsubscription_delete_fail_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_fail_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricsubscription_delete_fail_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_fail_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_delete_fail_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_fail_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricsubscription_delete_fail_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICrequestID", "INTEGER (0..4095)", "Cause", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 4, value, "ricsubscription_delete_fail_ies_o::value_c::types"); +} +uint8_t ricsubscription_delete_fail_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ricsubscription_delete_fail_ies_o::value_c::types"); + return 0; +} + +// RICsubscriptionDeleteRequest-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricsubscription_delete_request_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5}; + return map_enum_number(options, 2, idx, "id"); +} +bool ricsubscription_delete_request_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricsubscription_delete_request_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricsubscription_delete_request_ies_o::value_c ricsubscription_delete_request_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricsubscription_delete_request_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricsubscription_delete_request_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + default: + break; + } +} +void ricsubscription_delete_request_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_request_ies_o::value_c"); + } +} +ricsubscription_delete_request_ies_o::value_c::value_c(const ricsubscription_delete_request_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_request_ies_o::value_c"); + } +} +ricsubscription_delete_request_ies_o::value_c& +ricsubscription_delete_request_ies_o::value_c::operator=(const ricsubscription_delete_request_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_request_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ricsubscription_delete_request_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ricsubscription_delete_request_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const ri_crequest_id_s& ricsubscription_delete_request_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ricsubscription_delete_request_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +void ricsubscription_delete_request_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_request_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricsubscription_delete_request_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_request_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_delete_request_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_request_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricsubscription_delete_request_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICrequestID", "INTEGER (0..4095)"}; + return convert_enum_idx(options, 2, value, "ricsubscription_delete_request_ies_o::value_c::types"); +} +uint8_t ricsubscription_delete_request_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ricsubscription_delete_request_ies_o::value_c::types"); + return 0; +} + +// RICsubscriptionDeleteRequired-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricsubscription_delete_required_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {60}; + return map_enum_number(options, 1, idx, "id"); +} +bool ricsubscription_delete_required_ies_o::is_id_valid(const uint32_t& id) +{ + return 60 == id; +} +crit_e ricsubscription_delete_required_ies_o::get_crit(const uint32_t& id) +{ + if (id == 60) { + return crit_e::ignore; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} +ricsubscription_delete_required_ies_o::value_c ricsubscription_delete_required_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + if (id != 60) { + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricsubscription_delete_required_ies_o::get_presence(const uint32_t& id) +{ + if (id == 60) { + return presence_e::mandatory; + } + asn1::log_error("The id=%d is not recognized", id); + return {}; +} + +// Value ::= OPEN TYPE +void ricsubscription_delete_required_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.start_array("RICsubscription-List-withCause"); + for (const auto& e1 : c) { + e1.to_json(j); + } + j.end_array(); + j.end_obj(); +} +SRSASN_CODE ricsubscription_delete_required_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE(pack_dyn_seq_of(bref, c, 1, 1024, true)); + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_delete_required_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(unpack_dyn_seq_of(c, bref, 1, 1024, true)); + return SRSASN_SUCCESS; +} + +const char* ricsubscription_delete_required_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICsubscription-List-withCause"}; + return convert_enum_idx(options, 1, value, "ricsubscription_delete_required_ies_o::value_c::types"); +} + +// RICsubscriptionDeleteResponse-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricsubscription_delete_resp_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5}; + return map_enum_number(options, 2, idx, "id"); +} +bool ricsubscription_delete_resp_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricsubscription_delete_resp_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricsubscription_delete_resp_ies_o::value_c ricsubscription_delete_resp_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricsubscription_delete_resp_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricsubscription_delete_resp_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + default: + break; + } +} +void ricsubscription_delete_resp_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_resp_ies_o::value_c"); + } +} +ricsubscription_delete_resp_ies_o::value_c::value_c(const ricsubscription_delete_resp_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_resp_ies_o::value_c"); + } +} +ricsubscription_delete_resp_ies_o::value_c& +ricsubscription_delete_resp_ies_o::value_c::operator=(const ricsubscription_delete_resp_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_resp_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ricsubscription_delete_resp_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ricsubscription_delete_resp_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const ri_crequest_id_s& ricsubscription_delete_resp_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ricsubscription_delete_resp_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +void ricsubscription_delete_resp_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_resp_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricsubscription_delete_resp_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_resp_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_delete_resp_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_delete_resp_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricsubscription_delete_resp_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICrequestID", "INTEGER (0..4095)"}; + return convert_enum_idx(options, 2, value, "ricsubscription_delete_resp_ies_o::value_c::types"); +} +uint8_t ricsubscription_delete_resp_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ricsubscription_delete_resp_ies_o::value_c::types"); + return 0; +} + +// RICsubscriptionFailure-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricsubscription_fail_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5, 1, 2}; + return map_enum_number(options, 4, idx, "id"); +} +bool ricsubscription_fail_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5, 1, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricsubscription_fail_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 1: + return crit_e::reject; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricsubscription_fail_ies_o::value_c ricsubscription_fail_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricsubscription_fail_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + case 1: + return presence_e::mandatory; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricsubscription_fail_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::cause: + c.destroy(); + break; + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void ricsubscription_fail_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::cause: + c.init(); + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_fail_ies_o::value_c"); + } +} +ricsubscription_fail_ies_o::value_c::value_c(const ricsubscription_fail_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_fail_ies_o::value_c"); + } +} +ricsubscription_fail_ies_o::value_c& +ricsubscription_fail_ies_o::value_c::operator=(const ricsubscription_fail_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_fail_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ricsubscription_fail_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ricsubscription_fail_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +cause_c& ricsubscription_fail_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& ricsubscription_fail_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const ri_crequest_id_s& ricsubscription_fail_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ricsubscription_fail_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const cause_c& ricsubscription_fail_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& ricsubscription_fail_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void ricsubscription_fail_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_fail_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricsubscription_fail_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_fail_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_fail_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_fail_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricsubscription_fail_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICrequestID", "INTEGER (0..4095)", "Cause", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 4, value, "ricsubscription_fail_ies_o::value_c::types"); +} +uint8_t ricsubscription_fail_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ricsubscription_fail_ies_o::value_c::types"); + return 0; +} + +// RICsubscriptionRequest-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricsubscription_request_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5, 30}; + return map_enum_number(options, 3, idx, "id"); +} +bool ricsubscription_request_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5, 30}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricsubscription_request_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 30: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricsubscription_request_ies_o::value_c ricsubscription_request_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 30: + ret.set(value_c::types::ricsubscription_details); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricsubscription_request_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + case 30: + return presence_e::mandatory; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricsubscription_request_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::ricsubscription_details: + c.destroy(); + break; + default: + break; + } +} +void ricsubscription_request_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::ricsubscription_details: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_request_ies_o::value_c"); + } +} +ricsubscription_request_ies_o::value_c::value_c(const ricsubscription_request_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::ricsubscription_details: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_request_ies_o::value_c"); + } +} +ricsubscription_request_ies_o::value_c& +ricsubscription_request_ies_o::value_c::operator=(const ricsubscription_request_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::ricsubscription_details: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_request_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ricsubscription_request_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ricsubscription_request_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +ricsubscription_details_s& ricsubscription_request_ies_o::value_c::ricsubscription_details() +{ + assert_choice_type(types::ricsubscription_details, type_, "Value"); + return c.get(); +} +const ri_crequest_id_s& ricsubscription_request_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ricsubscription_request_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const ricsubscription_details_s& ricsubscription_request_ies_o::value_c::ricsubscription_details() const +{ + assert_choice_type(types::ricsubscription_details, type_, "Value"); + return c.get(); +} +void ricsubscription_request_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::ricsubscription_details: + j.write_fieldname("RICsubscriptionDetails"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_request_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricsubscription_request_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ricsubscription_details: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_request_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_request_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ricsubscription_details: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_request_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricsubscription_request_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"RICrequestID", "INTEGER (0..4095)", "RICsubscriptionDetails"}; + return convert_enum_idx(options, 3, value, "ricsubscription_request_ies_o::value_c::types"); +} +uint8_t ricsubscription_request_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ricsubscription_request_ies_o::value_c::types"); + return 0; +} + +// RICsubscriptionResponse-IEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t ricsubscription_resp_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {29, 5, 17, 18}; + return map_enum_number(options, 4, idx, "id"); +} +bool ricsubscription_resp_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {29, 5, 17, 18}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e ricsubscription_resp_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 29: + return crit_e::reject; + case 5: + return crit_e::reject; + case 17: + return crit_e::reject; + case 18: + return crit_e::reject; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +ricsubscription_resp_ies_o::value_c ricsubscription_resp_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 29: + ret.set(value_c::types::ri_crequest_id); + break; + case 5: + ret.set(value_c::types::ra_nfunction_id); + break; + case 17: + ret.set(value_c::types::ri_cactions_admitted); + break; + case 18: + ret.set(value_c::types::ri_cactions_not_admitted); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e ricsubscription_resp_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 29: + return presence_e::mandatory; + case 5: + return presence_e::mandatory; + case 17: + return presence_e::mandatory; + case 18: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void ricsubscription_resp_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::ri_crequest_id: + c.destroy(); + break; + case types::ri_cactions_admitted: + c.destroy(); + break; + case types::ri_cactions_not_admitted: + c.destroy(); + break; + default: + break; + } +} +void ricsubscription_resp_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ri_crequest_id: + c.init(); + break; + case types::ra_nfunction_id: + break; + case types::ri_cactions_admitted: + c.init(); + break; + case types::ri_cactions_not_admitted: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_resp_ies_o::value_c"); + } +} +ricsubscription_resp_ies_o::value_c::value_c(const ricsubscription_resp_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ri_crequest_id: + c.init(other.c.get()); + break; + case types::ra_nfunction_id: + c.init(other.c.get()); + break; + case types::ri_cactions_admitted: + c.init(other.c.get()); + break; + case types::ri_cactions_not_admitted: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_resp_ies_o::value_c"); + } +} +ricsubscription_resp_ies_o::value_c& +ricsubscription_resp_ies_o::value_c::operator=(const ricsubscription_resp_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ri_crequest_id: + c.set(other.c.get()); + break; + case types::ra_nfunction_id: + c.set(other.c.get()); + break; + case types::ri_cactions_admitted: + c.set(other.c.get()); + break; + case types::ri_cactions_not_admitted: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ricsubscription_resp_ies_o::value_c"); + } + + return *this; +} +ri_crequest_id_s& ricsubscription_resp_ies_o::value_c::ri_crequest_id() +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +uint16_t& ricsubscription_resp_ies_o::value_c::ra_nfunction_id() +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +ri_caction_admitted_list_l& ricsubscription_resp_ies_o::value_c::ri_cactions_admitted() +{ + assert_choice_type(types::ri_cactions_admitted, type_, "Value"); + return c.get(); +} +ri_caction_not_admitted_list_l& ricsubscription_resp_ies_o::value_c::ri_cactions_not_admitted() +{ + assert_choice_type(types::ri_cactions_not_admitted, type_, "Value"); + return c.get(); +} +const ri_crequest_id_s& ricsubscription_resp_ies_o::value_c::ri_crequest_id() const +{ + assert_choice_type(types::ri_crequest_id, type_, "Value"); + return c.get(); +} +const uint16_t& ricsubscription_resp_ies_o::value_c::ra_nfunction_id() const +{ + assert_choice_type(types::ra_nfunction_id, type_, "Value"); + return c.get(); +} +const ri_caction_admitted_list_l& ricsubscription_resp_ies_o::value_c::ri_cactions_admitted() const +{ + assert_choice_type(types::ri_cactions_admitted, type_, "Value"); + return c.get(); +} +const ri_caction_not_admitted_list_l& ricsubscription_resp_ies_o::value_c::ri_cactions_not_admitted() const +{ + assert_choice_type(types::ri_cactions_not_admitted, type_, "Value"); + return c.get(); +} +void ricsubscription_resp_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ri_crequest_id: + j.write_fieldname("RICrequestID"); + c.get().to_json(j); + break; + case types::ra_nfunction_id: + j.write_int("INTEGER (0..4095)", c.get()); + break; + case types::ri_cactions_admitted: + j.start_array("RICaction-Admitted-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + case types::ri_cactions_not_admitted: + j.start_array("RICaction-NotAdmitted-List"); + for (const auto& e1 : c.get()) { + e1.to_json(j); + } + j.end_array(); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_resp_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE ricsubscription_resp_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_cactions_admitted: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 1, 16, true)); + break; + case types::ri_cactions_not_admitted: + HANDLE_CODE(pack_dyn_seq_of(bref, c.get(), 0, 16, true)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_resp_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_resp_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ri_crequest_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ra_nfunction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + break; + case types::ri_cactions_admitted: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 1, 16, true)); + break; + case types::ri_cactions_not_admitted: + HANDLE_CODE(unpack_dyn_seq_of(c.get(), bref, 0, 16, true)); + break; + default: + log_invalid_choice_id(type_, "ricsubscription_resp_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ricsubscription_resp_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = { + "RICrequestID", "INTEGER (0..4095)", "RICaction-Admitted-List", "RICaction-NotAdmitted-List"}; + return convert_enum_idx(options, 4, value, "ricsubscription_resp_ies_o::value_c::types"); +} +uint8_t ricsubscription_resp_ies_o::value_c::types_opts::to_number() const +{ + if (value == ra_nfunction_id) { + return 0; + } + invalid_enum_number(value, "ricsubscription_resp_ies_o::value_c::types"); + return 0; +} + +// ResetRequestIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t reset_request_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 1}; + return map_enum_number(options, 2, idx, "id"); +} +bool reset_request_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 1}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e reset_request_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 1: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +reset_request_ies_o::value_c reset_request_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 1: + ret.set(value_c::types::cause); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e reset_request_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 1: + return presence_e::mandatory; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void reset_request_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::cause: + c.destroy(); + break; + default: + break; + } +} +void reset_request_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::cause: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "reset_request_ies_o::value_c"); + } +} +reset_request_ies_o::value_c::value_c(const reset_request_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::cause: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "reset_request_ies_o::value_c"); + } +} +reset_request_ies_o::value_c& reset_request_ies_o::value_c::operator=(const reset_request_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::cause: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "reset_request_ies_o::value_c"); + } + + return *this; +} +uint16_t& reset_request_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +cause_c& reset_request_ies_o::value_c::cause() +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +const uint16_t& reset_request_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const cause_c& reset_request_ies_o::value_c::cause() const +{ + assert_choice_type(types::cause, type_, "Value"); + return c.get(); +} +void reset_request_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::cause: + j.write_fieldname("Cause"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "reset_request_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE reset_request_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "reset_request_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE reset_request_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::cause: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "reset_request_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* reset_request_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "Cause"}; + return convert_enum_idx(options, 2, value, "reset_request_ies_o::value_c::types"); +} +uint8_t reset_request_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "reset_request_ies_o::value_c::types"); +} + +// ResetResponseIEs ::= OBJECT SET OF E2AP-PROTOCOL-IES +uint32_t reset_resp_ies_o::idx_to_id(uint32_t idx) +{ + static const uint32_t options[] = {49, 2}; + return map_enum_number(options, 2, idx, "id"); +} +bool reset_resp_ies_o::is_id_valid(const uint32_t& id) +{ + static const uint32_t options[] = {49, 2}; + for (const auto& o : options) { + if (o == id) { + return true; + } + } + return false; +} +crit_e reset_resp_ies_o::get_crit(const uint32_t& id) +{ + switch (id) { + case 49: + return crit_e::reject; + case 2: + return crit_e::ignore; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} +reset_resp_ies_o::value_c reset_resp_ies_o::get_value(const uint32_t& id) +{ + value_c ret{}; + switch (id) { + case 49: + ret.set(value_c::types::transaction_id); + break; + case 2: + ret.set(value_c::types::crit_diagnostics); + break; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return ret; +} +presence_e reset_resp_ies_o::get_presence(const uint32_t& id) +{ + switch (id) { + case 49: + return presence_e::mandatory; + case 2: + return presence_e::optional; + default: + asn1::log_error("The id=%d is not recognized", id); + } + return {}; +} + +// Value ::= OPEN TYPE +void reset_resp_ies_o::value_c::destroy_() +{ + switch (type_) { + case types::crit_diagnostics: + c.destroy(); + break; + default: + break; + } +} +void reset_resp_ies_o::value_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::transaction_id: + break; + case types::crit_diagnostics: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "reset_resp_ies_o::value_c"); + } +} +reset_resp_ies_o::value_c::value_c(const reset_resp_ies_o::value_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::transaction_id: + c.init(other.c.get()); + break; + case types::crit_diagnostics: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "reset_resp_ies_o::value_c"); + } +} +reset_resp_ies_o::value_c& reset_resp_ies_o::value_c::operator=(const reset_resp_ies_o::value_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::transaction_id: + c.set(other.c.get()); + break; + case types::crit_diagnostics: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "reset_resp_ies_o::value_c"); + } + + return *this; +} +uint16_t& reset_resp_ies_o::value_c::transaction_id() +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +crit_diagnostics_s& reset_resp_ies_o::value_c::crit_diagnostics() +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +const uint16_t& reset_resp_ies_o::value_c::transaction_id() const +{ + assert_choice_type(types::transaction_id, type_, "Value"); + return c.get(); +} +const crit_diagnostics_s& reset_resp_ies_o::value_c::crit_diagnostics() const +{ + assert_choice_type(types::crit_diagnostics, type_, "Value"); + return c.get(); +} +void reset_resp_ies_o::value_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::transaction_id: + j.write_int("INTEGER (0..255,...)", c.get()); + break; + case types::crit_diagnostics: + j.write_fieldname("CriticalityDiagnostics"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "reset_resp_ies_o::value_c"); + } + j.end_obj(); +} +SRSASN_CODE reset_resp_ies_o::value_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "reset_resp_ies_o::value_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE reset_resp_ies_o::value_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::transaction_id: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::crit_diagnostics: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "reset_resp_ies_o::value_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* reset_resp_ies_o::value_c::types_opts::to_string() const +{ + static const char* options[] = {"INTEGER (0..255,...)", "CriticalityDiagnostics"}; + return convert_enum_idx(options, 2, value, "reset_resp_ies_o::value_c::types"); +} +uint8_t reset_resp_ies_o::value_c::types_opts::to_number() const +{ + static const uint8_t options[] = {0}; + return map_enum_number(options, 1, value, "reset_resp_ies_o::value_c::types"); +} + +template struct asn1::protocol_ie_field_s; + +e2_removal_fail_ies_container::e2_removal_fail_ies_container() : + transaction_id(49, crit_e::reject), cause(1, crit_e::ignore), crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE e2_removal_fail_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 2; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + HANDLE_CODE(cause.pack(bref)); + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_removal_fail_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 2; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 1: { + nof_mandatory_ies--; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2_removal_fail_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + j.write_fieldname(""); + cause.to_json(j); + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2_removal_resp_ies_container::e2_removal_resp_ies_container() : + transaction_id(49, crit_e::reject), crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE e2_removal_resp_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_removal_resp_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2_removal_resp_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2conn_upd_ies_container::e2conn_upd_ies_container() : + transaction_id(49, crit_e::reject), + e2conn_upd_add(44, crit_e::reject), + e2conn_upd_rem(46, crit_e::reject), + e2conn_upd_modify(45, crit_e::reject) +{ +} +SRSASN_CODE e2conn_upd_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += e2conn_upd_add_present ? 1 : 0; + nof_ies += e2conn_upd_rem_present ? 1 : 0; + nof_ies += e2conn_upd_modify_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (e2conn_upd_add_present) { + HANDLE_CODE(e2conn_upd_add.pack(bref)); + } + if (e2conn_upd_rem_present) { + HANDLE_CODE(e2conn_upd_rem.pack(bref)); + } + if (e2conn_upd_modify_present) { + HANDLE_CODE(e2conn_upd_modify.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 44: { + e2conn_upd_add_present = true; + e2conn_upd_add.id = id; + HANDLE_CODE(e2conn_upd_add.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2conn_upd_add.value.unpack(bref)); + break; + } + case 46: { + e2conn_upd_rem_present = true; + e2conn_upd_rem.id = id; + HANDLE_CODE(e2conn_upd_rem.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2conn_upd_rem.value.unpack(bref)); + break; + } + case 45: { + e2conn_upd_modify_present = true; + e2conn_upd_modify.id = id; + HANDLE_CODE(e2conn_upd_modify.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2conn_upd_modify.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2conn_upd_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (e2conn_upd_add_present) { + j.write_fieldname(""); + e2conn_upd_add.to_json(j); + } + if (e2conn_upd_rem_present) { + j.write_fieldname(""); + e2conn_upd_rem.to_json(j); + } + if (e2conn_upd_modify_present) { + j.write_fieldname(""); + e2conn_upd_modify.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2conn_upd_ack_ies_container::e2conn_upd_ack_ies_container() : + transaction_id(49, crit_e::reject), e2conn_setup(39, crit_e::reject), e2conn_setup_failed(40, crit_e::reject) +{ +} +SRSASN_CODE e2conn_upd_ack_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += e2conn_setup_present ? 1 : 0; + nof_ies += e2conn_setup_failed_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (e2conn_setup_present) { + HANDLE_CODE(e2conn_setup.pack(bref)); + } + if (e2conn_setup_failed_present) { + HANDLE_CODE(e2conn_setup_failed.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_ack_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 39: { + e2conn_setup_present = true; + e2conn_setup.id = id; + HANDLE_CODE(e2conn_setup.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2conn_setup.value.unpack(bref)); + break; + } + case 40: { + e2conn_setup_failed_present = true; + e2conn_setup_failed.id = id; + HANDLE_CODE(e2conn_setup_failed.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2conn_setup_failed.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2conn_upd_ack_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (e2conn_setup_present) { + j.write_fieldname(""); + e2conn_setup.to_json(j); + } + if (e2conn_setup_failed_present) { + j.write_fieldname(""); + e2conn_setup_failed.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2conn_upd_fail_ies_container::e2conn_upd_fail_ies_container() : + transaction_id(49, crit_e::reject), + cause(1, crit_e::reject), + time_to_wait(31, crit_e::ignore), + crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE e2conn_upd_fail_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += cause_present ? 1 : 0; + nof_ies += time_to_wait_present ? 1 : 0; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (cause_present) { + HANDLE_CODE(cause.pack(bref)); + } + if (time_to_wait_present) { + HANDLE_CODE(time_to_wait.pack(bref)); + } + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2conn_upd_fail_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 1: { + cause_present = true; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 31: { + time_to_wait_present = true; + time_to_wait.id = id; + HANDLE_CODE(time_to_wait.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(time_to_wait.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2conn_upd_fail_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (cause_present) { + j.write_fieldname(""); + cause.to_json(j); + } + if (time_to_wait_present) { + j.write_fieldname(""); + time_to_wait.to_json(j); + } + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2node_cfg_upd_ies_container::e2node_cfg_upd_ies_container() : + transaction_id(49, crit_e::reject), + global_e2node_id(3, crit_e::reject), + e2node_component_cfg_addition(50, crit_e::reject), + e2node_component_cfg_upd(33, crit_e::reject), + e2node_component_cfg_removal(54, crit_e::reject), + e2node_tn_lassoc_removal(58, crit_e::reject) +{ +} +SRSASN_CODE e2node_cfg_upd_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += global_e2node_id_present ? 1 : 0; + nof_ies += e2node_component_cfg_addition_present ? 1 : 0; + nof_ies += e2node_component_cfg_upd_present ? 1 : 0; + nof_ies += e2node_component_cfg_removal_present ? 1 : 0; + nof_ies += e2node_tn_lassoc_removal_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (global_e2node_id_present) { + HANDLE_CODE(global_e2node_id.pack(bref)); + } + if (e2node_component_cfg_addition_present) { + HANDLE_CODE(e2node_component_cfg_addition.pack(bref)); + } + if (e2node_component_cfg_upd_present) { + HANDLE_CODE(e2node_component_cfg_upd.pack(bref)); + } + if (e2node_component_cfg_removal_present) { + HANDLE_CODE(e2node_component_cfg_removal.pack(bref)); + } + if (e2node_tn_lassoc_removal_present) { + HANDLE_CODE(e2node_tn_lassoc_removal.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_cfg_upd_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 3: { + global_e2node_id_present = true; + global_e2node_id.id = id; + HANDLE_CODE(global_e2node_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(global_e2node_id.value.unpack(bref)); + break; + } + case 50: { + e2node_component_cfg_addition_present = true; + e2node_component_cfg_addition.id = id; + HANDLE_CODE(e2node_component_cfg_addition.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_component_cfg_addition.value.unpack(bref)); + break; + } + case 33: { + e2node_component_cfg_upd_present = true; + e2node_component_cfg_upd.id = id; + HANDLE_CODE(e2node_component_cfg_upd.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_component_cfg_upd.value.unpack(bref)); + break; + } + case 54: { + e2node_component_cfg_removal_present = true; + e2node_component_cfg_removal.id = id; + HANDLE_CODE(e2node_component_cfg_removal.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_component_cfg_removal.value.unpack(bref)); + break; + } + case 58: { + e2node_tn_lassoc_removal_present = true; + e2node_tn_lassoc_removal.id = id; + HANDLE_CODE(e2node_tn_lassoc_removal.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_tn_lassoc_removal.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2node_cfg_upd_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (global_e2node_id_present) { + j.write_fieldname(""); + global_e2node_id.to_json(j); + } + if (e2node_component_cfg_addition_present) { + j.write_fieldname(""); + e2node_component_cfg_addition.to_json(j); + } + if (e2node_component_cfg_upd_present) { + j.write_fieldname(""); + e2node_component_cfg_upd.to_json(j); + } + if (e2node_component_cfg_removal_present) { + j.write_fieldname(""); + e2node_component_cfg_removal.to_json(j); + } + if (e2node_tn_lassoc_removal_present) { + j.write_fieldname(""); + e2node_tn_lassoc_removal.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2node_cfg_upd_ack_ies_container::e2node_cfg_upd_ack_ies_container() : + transaction_id(49, crit_e::reject), + e2node_component_cfg_addition_ack(52, crit_e::reject), + e2node_component_cfg_upd_ack(35, crit_e::reject), + e2node_component_cfg_removal_ack(56, crit_e::reject) +{ +} +SRSASN_CODE e2node_cfg_upd_ack_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += e2node_component_cfg_addition_ack_present ? 1 : 0; + nof_ies += e2node_component_cfg_upd_ack_present ? 1 : 0; + nof_ies += e2node_component_cfg_removal_ack_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (e2node_component_cfg_addition_ack_present) { + HANDLE_CODE(e2node_component_cfg_addition_ack.pack(bref)); + } + if (e2node_component_cfg_upd_ack_present) { + HANDLE_CODE(e2node_component_cfg_upd_ack.pack(bref)); + } + if (e2node_component_cfg_removal_ack_present) { + HANDLE_CODE(e2node_component_cfg_removal_ack.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_cfg_upd_ack_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 52: { + e2node_component_cfg_addition_ack_present = true; + e2node_component_cfg_addition_ack.id = id; + HANDLE_CODE(e2node_component_cfg_addition_ack.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_component_cfg_addition_ack.value.unpack(bref)); + break; + } + case 35: { + e2node_component_cfg_upd_ack_present = true; + e2node_component_cfg_upd_ack.id = id; + HANDLE_CODE(e2node_component_cfg_upd_ack.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_component_cfg_upd_ack.value.unpack(bref)); + break; + } + case 56: { + e2node_component_cfg_removal_ack_present = true; + e2node_component_cfg_removal_ack.id = id; + HANDLE_CODE(e2node_component_cfg_removal_ack.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_component_cfg_removal_ack.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2node_cfg_upd_ack_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (e2node_component_cfg_addition_ack_present) { + j.write_fieldname(""); + e2node_component_cfg_addition_ack.to_json(j); + } + if (e2node_component_cfg_upd_ack_present) { + j.write_fieldname(""); + e2node_component_cfg_upd_ack.to_json(j); + } + if (e2node_component_cfg_removal_ack_present) { + j.write_fieldname(""); + e2node_component_cfg_removal_ack.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2node_cfg_upd_fail_ies_container::e2node_cfg_upd_fail_ies_container() : + transaction_id(49, crit_e::reject), + cause(1, crit_e::ignore), + time_to_wait(31, crit_e::ignore), + crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE e2node_cfg_upd_fail_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 2; + nof_ies += time_to_wait_present ? 1 : 0; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + HANDLE_CODE(cause.pack(bref)); + if (time_to_wait_present) { + HANDLE_CODE(time_to_wait.pack(bref)); + } + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2node_cfg_upd_fail_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 2; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 1: { + nof_mandatory_ies--; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 31: { + time_to_wait_present = true; + time_to_wait.id = id; + HANDLE_CODE(time_to_wait.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(time_to_wait.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2node_cfg_upd_fail_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + j.write_fieldname(""); + cause.to_json(j); + if (time_to_wait_present) { + j.write_fieldname(""); + time_to_wait.to_json(j); + } + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2setup_fail_ies_container::e2setup_fail_ies_container() : + transaction_id(49, crit_e::reject), + cause(1, crit_e::ignore), + time_to_wait(31, crit_e::ignore), + crit_diagnostics(2, crit_e::ignore), + tn_linfo(48, crit_e::ignore) +{ +} +SRSASN_CODE e2setup_fail_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 2; + nof_ies += time_to_wait_present ? 1 : 0; + nof_ies += crit_diagnostics_present ? 1 : 0; + nof_ies += tn_linfo_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + HANDLE_CODE(cause.pack(bref)); + if (time_to_wait_present) { + HANDLE_CODE(time_to_wait.pack(bref)); + } + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + if (tn_linfo_present) { + HANDLE_CODE(tn_linfo.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2setup_fail_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 2; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 1: { + nof_mandatory_ies--; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 31: { + time_to_wait_present = true; + time_to_wait.id = id; + HANDLE_CODE(time_to_wait.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(time_to_wait.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + case 48: { + tn_linfo_present = true; + tn_linfo.id = id; + HANDLE_CODE(tn_linfo.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(tn_linfo.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2setup_fail_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + j.write_fieldname(""); + cause.to_json(j); + if (time_to_wait_present) { + j.write_fieldname(""); + time_to_wait.to_json(j); + } + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + if (tn_linfo_present) { + j.write_fieldname(""); + tn_linfo.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2setup_request_ies_container::e2setup_request_ies_container() : + transaction_id(49, crit_e::reject), + global_e2node_id(3, crit_e::reject), + ra_nfunctions_added(10, crit_e::reject), + e2node_component_cfg_addition(50, crit_e::reject) +{ +} +SRSASN_CODE e2setup_request_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 4; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + HANDLE_CODE(global_e2node_id.pack(bref)); + HANDLE_CODE(ra_nfunctions_added.pack(bref)); + HANDLE_CODE(e2node_component_cfg_addition.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2setup_request_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 4; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 3: { + nof_mandatory_ies--; + global_e2node_id.id = id; + HANDLE_CODE(global_e2node_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(global_e2node_id.value.unpack(bref)); + break; + } + case 10: { + nof_mandatory_ies--; + ra_nfunctions_added.id = id; + HANDLE_CODE(ra_nfunctions_added.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_added.value.unpack(bref)); + break; + } + case 50: { + nof_mandatory_ies--; + e2node_component_cfg_addition.id = id; + HANDLE_CODE(e2node_component_cfg_addition.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_component_cfg_addition.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2setup_request_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + j.write_fieldname(""); + global_e2node_id.to_json(j); + j.write_fieldname(""); + ra_nfunctions_added.to_json(j); + j.write_fieldname(""); + e2node_component_cfg_addition.to_json(j); + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +e2setup_resp_ies_container::e2setup_resp_ies_container() : + transaction_id(49, crit_e::reject), + global_ric_id(4, crit_e::reject), + ra_nfunctions_accepted(9, crit_e::reject), + ra_nfunctions_rejected(13, crit_e::reject), + e2node_component_cfg_addition_ack(52, crit_e::reject) +{ +} +SRSASN_CODE e2setup_resp_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 3; + nof_ies += ra_nfunctions_accepted_present ? 1 : 0; + nof_ies += ra_nfunctions_rejected_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + HANDLE_CODE(global_ric_id.pack(bref)); + if (ra_nfunctions_accepted_present) { + HANDLE_CODE(ra_nfunctions_accepted.pack(bref)); + } + if (ra_nfunctions_rejected_present) { + HANDLE_CODE(ra_nfunctions_rejected.pack(bref)); + } + HANDLE_CODE(e2node_component_cfg_addition_ack.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE e2setup_resp_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 3; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 4: { + nof_mandatory_ies--; + global_ric_id.id = id; + HANDLE_CODE(global_ric_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(global_ric_id.value.unpack(bref)); + break; + } + case 9: { + ra_nfunctions_accepted_present = true; + ra_nfunctions_accepted.id = id; + HANDLE_CODE(ra_nfunctions_accepted.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_accepted.value.unpack(bref)); + break; + } + case 13: { + ra_nfunctions_rejected_present = true; + ra_nfunctions_rejected.id = id; + HANDLE_CODE(ra_nfunctions_rejected.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_rejected.value.unpack(bref)); + break; + } + case 52: { + nof_mandatory_ies--; + e2node_component_cfg_addition_ack.id = id; + HANDLE_CODE(e2node_component_cfg_addition_ack.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(e2node_component_cfg_addition_ack.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void e2setup_resp_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + j.write_fieldname(""); + global_ric_id.to_json(j); + if (ra_nfunctions_accepted_present) { + j.write_fieldname(""); + ra_nfunctions_accepted.to_json(j); + } + if (ra_nfunctions_rejected_present) { + j.write_fieldname(""); + ra_nfunctions_rejected.to_json(j); + } + j.write_fieldname(""); + e2node_component_cfg_addition_ack.to_json(j); + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +error_ind_ies_container::error_ind_ies_container() : + transaction_id(49, crit_e::reject), + ri_crequest_id(29, crit_e::reject), + ra_nfunction_id(5, crit_e::reject), + cause(1, crit_e::ignore), + crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE error_ind_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 0; + nof_ies += transaction_id_present ? 1 : 0; + nof_ies += ri_crequest_id_present ? 1 : 0; + nof_ies += ra_nfunction_id_present ? 1 : 0; + nof_ies += cause_present ? 1 : 0; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + if (transaction_id_present) { + HANDLE_CODE(transaction_id.pack(bref)); + } + if (ri_crequest_id_present) { + HANDLE_CODE(ri_crequest_id.pack(bref)); + } + if (ra_nfunction_id_present) { + HANDLE_CODE(ra_nfunction_id.pack(bref)); + } + if (cause_present) { + HANDLE_CODE(cause.pack(bref)); + } + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE error_ind_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + transaction_id_present = true; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 29: { + ri_crequest_id_present = true; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + ra_nfunction_id_present = true; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 1: { + cause_present = true; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + + return SRSASN_SUCCESS; +} +void error_ind_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + if (transaction_id_present) { + j.write_fieldname(""); + transaction_id.to_json(j); + } + if (ri_crequest_id_present) { + j.write_fieldname(""); + ri_crequest_id.to_json(j); + } + if (ra_nfunction_id_present) { + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + } + if (cause_present) { + j.write_fieldname(""); + cause.to_json(j); + } + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ri_cctrl_ack_ies_container::ri_cctrl_ack_ies_container() : + ri_crequest_id(29, crit_e::reject), + ra_nfunction_id(5, crit_e::reject), + ri_ccall_process_id(20, crit_e::reject), + ri_cctrl_outcome(32, crit_e::reject) +{ +} +SRSASN_CODE ri_cctrl_ack_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 2; + nof_ies += ri_ccall_process_id_present ? 1 : 0; + nof_ies += ri_cctrl_outcome_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + if (ri_ccall_process_id_present) { + HANDLE_CODE(ri_ccall_process_id.pack(bref)); + } + if (ri_cctrl_outcome_present) { + HANDLE_CODE(ri_cctrl_outcome.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_cctrl_ack_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 2; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 20: { + ri_ccall_process_id_present = true; + ri_ccall_process_id.id = id; + HANDLE_CODE(ri_ccall_process_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_ccall_process_id.value.unpack(bref)); + break; + } + case 32: { + ri_cctrl_outcome_present = true; + ri_cctrl_outcome.id = id; + HANDLE_CODE(ri_cctrl_outcome.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cctrl_outcome.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ri_cctrl_ack_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + if (ri_ccall_process_id_present) { + j.write_fieldname(""); + ri_ccall_process_id.to_json(j); + } + if (ri_cctrl_outcome_present) { + j.write_fieldname(""); + ri_cctrl_outcome.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ri_cctrl_fail_ies_container::ri_cctrl_fail_ies_container() : + ri_crequest_id(29, crit_e::reject), + ra_nfunction_id(5, crit_e::reject), + ri_ccall_process_id(20, crit_e::reject), + cause(1, crit_e::ignore), + ri_cctrl_outcome(32, crit_e::reject) +{ +} +SRSASN_CODE ri_cctrl_fail_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 3; + nof_ies += ri_ccall_process_id_present ? 1 : 0; + nof_ies += ri_cctrl_outcome_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + if (ri_ccall_process_id_present) { + HANDLE_CODE(ri_ccall_process_id.pack(bref)); + } + HANDLE_CODE(cause.pack(bref)); + if (ri_cctrl_outcome_present) { + HANDLE_CODE(ri_cctrl_outcome.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_cctrl_fail_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 3; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 20: { + ri_ccall_process_id_present = true; + ri_ccall_process_id.id = id; + HANDLE_CODE(ri_ccall_process_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_ccall_process_id.value.unpack(bref)); + break; + } + case 1: { + nof_mandatory_ies--; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 32: { + ri_cctrl_outcome_present = true; + ri_cctrl_outcome.id = id; + HANDLE_CODE(ri_cctrl_outcome.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cctrl_outcome.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ri_cctrl_fail_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + if (ri_ccall_process_id_present) { + j.write_fieldname(""); + ri_ccall_process_id.to_json(j); + } + j.write_fieldname(""); + cause.to_json(j); + if (ri_cctrl_outcome_present) { + j.write_fieldname(""); + ri_cctrl_outcome.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ri_cctrl_request_ies_container::ri_cctrl_request_ies_container() : + ri_crequest_id(29, crit_e::reject), + ra_nfunction_id(5, crit_e::reject), + ri_ccall_process_id(20, crit_e::reject), + ri_cctrl_hdr(22, crit_e::reject), + ri_cctrl_msg(23, crit_e::reject), + ri_cctrl_ack_request(21, crit_e::reject) +{ +} +SRSASN_CODE ri_cctrl_request_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 4; + nof_ies += ri_ccall_process_id_present ? 1 : 0; + nof_ies += ri_cctrl_ack_request_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + if (ri_ccall_process_id_present) { + HANDLE_CODE(ri_ccall_process_id.pack(bref)); + } + HANDLE_CODE(ri_cctrl_hdr.pack(bref)); + HANDLE_CODE(ri_cctrl_msg.pack(bref)); + if (ri_cctrl_ack_request_present) { + HANDLE_CODE(ri_cctrl_ack_request.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_cctrl_request_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 4; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 20: { + ri_ccall_process_id_present = true; + ri_ccall_process_id.id = id; + HANDLE_CODE(ri_ccall_process_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_ccall_process_id.value.unpack(bref)); + break; + } + case 22: { + nof_mandatory_ies--; + ri_cctrl_hdr.id = id; + HANDLE_CODE(ri_cctrl_hdr.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cctrl_hdr.value.unpack(bref)); + break; + } + case 23: { + nof_mandatory_ies--; + ri_cctrl_msg.id = id; + HANDLE_CODE(ri_cctrl_msg.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cctrl_msg.value.unpack(bref)); + break; + } + case 21: { + ri_cctrl_ack_request_present = true; + ri_cctrl_ack_request.id = id; + HANDLE_CODE(ri_cctrl_ack_request.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cctrl_ack_request.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ri_cctrl_request_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + if (ri_ccall_process_id_present) { + j.write_fieldname(""); + ri_ccall_process_id.to_json(j); + } + j.write_fieldname(""); + ri_cctrl_hdr.to_json(j); + j.write_fieldname(""); + ri_cctrl_msg.to_json(j); + if (ri_cctrl_ack_request_present) { + j.write_fieldname(""); + ri_cctrl_ack_request.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ri_cind_ies_container::ri_cind_ies_container() : + ri_crequest_id(29, crit_e::reject), + ra_nfunction_id(5, crit_e::reject), + ri_caction_id(15, crit_e::reject), + ri_cind_sn(27, crit_e::reject), + ri_cind_type(28, crit_e::reject), + ri_cind_hdr(25, crit_e::reject), + ri_cind_msg(26, crit_e::reject), + ri_ccall_process_id(20, crit_e::reject) +{ +} +SRSASN_CODE ri_cind_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 6; + nof_ies += ri_cind_sn_present ? 1 : 0; + nof_ies += ri_ccall_process_id_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + HANDLE_CODE(ri_caction_id.pack(bref)); + if (ri_cind_sn_present) { + HANDLE_CODE(ri_cind_sn.pack(bref)); + } + HANDLE_CODE(ri_cind_type.pack(bref)); + HANDLE_CODE(ri_cind_hdr.pack(bref)); + HANDLE_CODE(ri_cind_msg.pack(bref)); + if (ri_ccall_process_id_present) { + HANDLE_CODE(ri_ccall_process_id.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ri_cind_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 6; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 15: { + nof_mandatory_ies--; + ri_caction_id.id = id; + HANDLE_CODE(ri_caction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_caction_id.value.unpack(bref)); + break; + } + case 27: { + ri_cind_sn_present = true; + ri_cind_sn.id = id; + HANDLE_CODE(ri_cind_sn.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cind_sn.value.unpack(bref)); + break; + } + case 28: { + nof_mandatory_ies--; + ri_cind_type.id = id; + HANDLE_CODE(ri_cind_type.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cind_type.value.unpack(bref)); + break; + } + case 25: { + nof_mandatory_ies--; + ri_cind_hdr.id = id; + HANDLE_CODE(ri_cind_hdr.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cind_hdr.value.unpack(bref)); + break; + } + case 26: { + nof_mandatory_ies--; + ri_cind_msg.id = id; + HANDLE_CODE(ri_cind_msg.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cind_msg.value.unpack(bref)); + break; + } + case 20: { + ri_ccall_process_id_present = true; + ri_ccall_process_id.id = id; + HANDLE_CODE(ri_ccall_process_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_ccall_process_id.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ri_cind_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + j.write_fieldname(""); + ri_caction_id.to_json(j); + if (ri_cind_sn_present) { + j.write_fieldname(""); + ri_cind_sn.to_json(j); + } + j.write_fieldname(""); + ri_cind_type.to_json(j); + j.write_fieldname(""); + ri_cind_hdr.to_json(j); + j.write_fieldname(""); + ri_cind_msg.to_json(j); + if (ri_ccall_process_id_present) { + j.write_fieldname(""); + ri_ccall_process_id.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricservice_query_ies_container::ricservice_query_ies_container() : + transaction_id(49, crit_e::reject), ra_nfunctions_accepted(9, crit_e::reject) +{ +} +SRSASN_CODE ricservice_query_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += ra_nfunctions_accepted_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (ra_nfunctions_accepted_present) { + HANDLE_CODE(ra_nfunctions_accepted.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricservice_query_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 9: { + ra_nfunctions_accepted_present = true; + ra_nfunctions_accepted.id = id; + HANDLE_CODE(ra_nfunctions_accepted.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_accepted.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricservice_query_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (ra_nfunctions_accepted_present) { + j.write_fieldname(""); + ra_nfunctions_accepted.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricservice_upd_ies_container::ricservice_upd_ies_container() : + transaction_id(49, crit_e::reject), + ra_nfunctions_added(10, crit_e::reject), + ra_nfunctions_modified(12, crit_e::reject), + ra_nfunctions_deleted(11, crit_e::reject) +{ +} +SRSASN_CODE ricservice_upd_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += ra_nfunctions_added_present ? 1 : 0; + nof_ies += ra_nfunctions_modified_present ? 1 : 0; + nof_ies += ra_nfunctions_deleted_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (ra_nfunctions_added_present) { + HANDLE_CODE(ra_nfunctions_added.pack(bref)); + } + if (ra_nfunctions_modified_present) { + HANDLE_CODE(ra_nfunctions_modified.pack(bref)); + } + if (ra_nfunctions_deleted_present) { + HANDLE_CODE(ra_nfunctions_deleted.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricservice_upd_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 10: { + ra_nfunctions_added_present = true; + ra_nfunctions_added.id = id; + HANDLE_CODE(ra_nfunctions_added.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_added.value.unpack(bref)); + break; + } + case 12: { + ra_nfunctions_modified_present = true; + ra_nfunctions_modified.id = id; + HANDLE_CODE(ra_nfunctions_modified.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_modified.value.unpack(bref)); + break; + } + case 11: { + ra_nfunctions_deleted_present = true; + ra_nfunctions_deleted.id = id; + HANDLE_CODE(ra_nfunctions_deleted.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_deleted.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricservice_upd_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (ra_nfunctions_added_present) { + j.write_fieldname(""); + ra_nfunctions_added.to_json(j); + } + if (ra_nfunctions_modified_present) { + j.write_fieldname(""); + ra_nfunctions_modified.to_json(j); + } + if (ra_nfunctions_deleted_present) { + j.write_fieldname(""); + ra_nfunctions_deleted.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricservice_upd_ack_ies_container::ricservice_upd_ack_ies_container() : + transaction_id(49, crit_e::reject), + ra_nfunctions_accepted(9, crit_e::reject), + ra_nfunctions_rejected(13, crit_e::reject) +{ +} +SRSASN_CODE ricservice_upd_ack_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += ra_nfunctions_accepted_present ? 1 : 0; + nof_ies += ra_nfunctions_rejected_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (ra_nfunctions_accepted_present) { + HANDLE_CODE(ra_nfunctions_accepted.pack(bref)); + } + if (ra_nfunctions_rejected_present) { + HANDLE_CODE(ra_nfunctions_rejected.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricservice_upd_ack_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 9: { + ra_nfunctions_accepted_present = true; + ra_nfunctions_accepted.id = id; + HANDLE_CODE(ra_nfunctions_accepted.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_accepted.value.unpack(bref)); + break; + } + case 13: { + ra_nfunctions_rejected_present = true; + ra_nfunctions_rejected.id = id; + HANDLE_CODE(ra_nfunctions_rejected.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunctions_rejected.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricservice_upd_ack_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (ra_nfunctions_accepted_present) { + j.write_fieldname(""); + ra_nfunctions_accepted.to_json(j); + } + if (ra_nfunctions_rejected_present) { + j.write_fieldname(""); + ra_nfunctions_rejected.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricservice_upd_fail_ies_container::ricservice_upd_fail_ies_container() : + transaction_id(49, crit_e::reject), + cause(1, crit_e::reject), + time_to_wait(31, crit_e::ignore), + crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE ricservice_upd_fail_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 2; + nof_ies += time_to_wait_present ? 1 : 0; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + HANDLE_CODE(cause.pack(bref)); + if (time_to_wait_present) { + HANDLE_CODE(time_to_wait.pack(bref)); + } + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricservice_upd_fail_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 2; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 1: { + nof_mandatory_ies--; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 31: { + time_to_wait_present = true; + time_to_wait.id = id; + HANDLE_CODE(time_to_wait.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(time_to_wait.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricservice_upd_fail_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + j.write_fieldname(""); + cause.to_json(j); + if (time_to_wait_present) { + j.write_fieldname(""); + time_to_wait.to_json(j); + } + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricsubscription_delete_fail_ies_container::ricsubscription_delete_fail_ies_container() : + ri_crequest_id(29, crit_e::reject), + ra_nfunction_id(5, crit_e::reject), + cause(1, crit_e::ignore), + crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE ricsubscription_delete_fail_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 3; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + HANDLE_CODE(cause.pack(bref)); + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_delete_fail_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 3; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 1: { + nof_mandatory_ies--; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricsubscription_delete_fail_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + j.write_fieldname(""); + cause.to_json(j); + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricsubscription_delete_request_ies_container::ricsubscription_delete_request_ies_container() : + ri_crequest_id(29, crit_e::reject), ra_nfunction_id(5, crit_e::reject) +{ +} +SRSASN_CODE ricsubscription_delete_request_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 2; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_delete_request_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 2; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricsubscription_delete_request_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricsubscription_delete_resp_ies_container::ricsubscription_delete_resp_ies_container() : + ri_crequest_id(29, crit_e::reject), ra_nfunction_id(5, crit_e::reject) +{ +} +SRSASN_CODE ricsubscription_delete_resp_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 2; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_delete_resp_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 2; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricsubscription_delete_resp_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricsubscription_fail_ies_container::ricsubscription_fail_ies_container() : + ri_crequest_id(29, crit_e::reject), + ra_nfunction_id(5, crit_e::reject), + cause(1, crit_e::reject), + crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE ricsubscription_fail_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 3; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + HANDLE_CODE(cause.pack(bref)); + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_fail_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 3; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 1: { + nof_mandatory_ies--; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricsubscription_fail_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + j.write_fieldname(""); + cause.to_json(j); + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricsubscription_request_ies_container::ricsubscription_request_ies_container() : + ri_crequest_id(29, crit_e::reject), ra_nfunction_id(5, crit_e::reject), ricsubscription_details(30, crit_e::reject) +{ +} +SRSASN_CODE ricsubscription_request_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 3; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + HANDLE_CODE(ricsubscription_details.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_request_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 3; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 30: { + nof_mandatory_ies--; + ricsubscription_details.id = id; + HANDLE_CODE(ricsubscription_details.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ricsubscription_details.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricsubscription_request_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + j.write_fieldname(""); + ricsubscription_details.to_json(j); + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +ricsubscription_resp_ies_container::ricsubscription_resp_ies_container() : + ri_crequest_id(29, crit_e::reject), + ra_nfunction_id(5, crit_e::reject), + ri_cactions_admitted(17, crit_e::reject), + ri_cactions_not_admitted(18, crit_e::reject) +{ +} +SRSASN_CODE ricsubscription_resp_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 3; + nof_ies += ri_cactions_not_admitted_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(ri_crequest_id.pack(bref)); + HANDLE_CODE(ra_nfunction_id.pack(bref)); + HANDLE_CODE(ri_cactions_admitted.pack(bref)); + if (ri_cactions_not_admitted_present) { + HANDLE_CODE(ri_cactions_not_admitted.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ricsubscription_resp_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 3; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 29: { + nof_mandatory_ies--; + ri_crequest_id.id = id; + HANDLE_CODE(ri_crequest_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_crequest_id.value.unpack(bref)); + break; + } + case 5: { + nof_mandatory_ies--; + ra_nfunction_id.id = id; + HANDLE_CODE(ra_nfunction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ra_nfunction_id.value.unpack(bref)); + break; + } + case 17: { + nof_mandatory_ies--; + ri_cactions_admitted.id = id; + HANDLE_CODE(ri_cactions_admitted.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cactions_admitted.value.unpack(bref)); + break; + } + case 18: { + ri_cactions_not_admitted_present = true; + ri_cactions_not_admitted.id = id; + HANDLE_CODE(ri_cactions_not_admitted.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(ri_cactions_not_admitted.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void ricsubscription_resp_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + ri_crequest_id.to_json(j); + j.write_fieldname(""); + ra_nfunction_id.to_json(j); + j.write_fieldname(""); + ri_cactions_admitted.to_json(j); + if (ri_cactions_not_admitted_present) { + j.write_fieldname(""); + ri_cactions_not_admitted.to_json(j); + } + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +reset_request_ies_container::reset_request_ies_container() : + transaction_id(49, crit_e::reject), cause(1, crit_e::ignore) +{ +} +SRSASN_CODE reset_request_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 2; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + HANDLE_CODE(cause.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE reset_request_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 2; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 1: { + nof_mandatory_ies--; + cause.id = id; + HANDLE_CODE(cause.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(cause.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void reset_request_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + j.write_fieldname(""); + cause.to_json(j); + j.end_obj(); +} + +template struct asn1::protocol_ie_field_s; + +reset_resp_ies_container::reset_resp_ies_container() : + transaction_id(49, crit_e::reject), crit_diagnostics(2, crit_e::ignore) +{ +} +SRSASN_CODE reset_resp_ies_container::pack(bit_ref& bref) const +{ + uint32_t nof_ies = 1; + nof_ies += crit_diagnostics_present ? 1 : 0; + pack_length(bref, nof_ies, 0u, 65535u, true); + + HANDLE_CODE(transaction_id.pack(bref)); + if (crit_diagnostics_present) { + HANDLE_CODE(crit_diagnostics.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE reset_resp_ies_container::unpack(cbit_ref& bref) +{ + uint32_t nof_ies = 0; + unpack_length(nof_ies, bref, 0u, 65535u, true); + + uint32_t nof_mandatory_ies = 1; + + for (; nof_ies > 0; --nof_ies) { + uint32_t id; + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + switch (id) { + case 49: { + nof_mandatory_ies--; + transaction_id.id = id; + HANDLE_CODE(transaction_id.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(transaction_id.value.unpack(bref)); + break; + } + case 2: { + crit_diagnostics_present = true; + crit_diagnostics.id = id; + HANDLE_CODE(crit_diagnostics.crit.unpack(bref)); + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE(crit_diagnostics.value.unpack(bref)); + break; + } + default: + asn1::log_error("Unpacked object ID=%d is not recognized\n", id); + return SRSASN_ERROR_DECODE_FAIL; + } + } + if (nof_mandatory_ies > 0) { + asn1::log_error("Mandatory fields are missing\n"); + + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} +void reset_resp_ies_container::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname(""); + transaction_id.to_json(j); + if (crit_diagnostics_present) { + j.write_fieldname(""); + crit_diagnostics.to_json(j); + } + j.end_obj(); +} + +// E2AP-ELEMENTARY-PROCEDURES ::= OBJECT SET OF E2AP-ELEMENTARY-PROCEDURE +uint16_t e2_ap_elem_procs_o::idx_to_proc_code(uint32_t idx) +{ + static const uint16_t options[] = {8, 9, 7, 4, 1, 10, 11, 3, 13, 5, 6, 2, 12}; + return map_enum_number(options, 13, idx, "proc_code"); +} +bool e2_ap_elem_procs_o::is_proc_code_valid(const uint16_t& proc_code) +{ + static const uint16_t options[] = {8, 9, 7, 4, 1, 10, 11, 3, 13, 5, 6, 2, 12}; + for (const auto& o : options) { + if (o == proc_code) { + return true; + } + } + return false; +} +e2_ap_elem_procs_o::init_msg_c e2_ap_elem_procs_o::get_init_msg(const uint16_t& proc_code) +{ + init_msg_c ret{}; + switch (proc_code) { + case 8: + ret.set(init_msg_c::types::ricsubscription_request); + break; + case 9: + ret.set(init_msg_c::types::ricsubscription_delete_request); + break; + case 7: + ret.set(init_msg_c::types::ricservice_upd); + break; + case 4: + ret.set(init_msg_c::types::ri_cctrl_request); + break; + case 1: + ret.set(init_msg_c::types::e2setup_request); + break; + case 10: + ret.set(init_msg_c::types::e2node_cfg_upd); + break; + case 11: + ret.set(init_msg_c::types::e2conn_upd); + break; + case 3: + ret.set(init_msg_c::types::reset_request); + break; + case 13: + ret.set(init_msg_c::types::e2_removal_request); + break; + case 5: + ret.set(init_msg_c::types::ri_cind); + break; + case 6: + ret.set(init_msg_c::types::ricservice_query); + break; + case 2: + ret.set(init_msg_c::types::error_ind); + break; + case 12: + ret.set(init_msg_c::types::ricsubscription_delete_required); + break; + default: + asn1::log_error("The proc_code=%d is not recognized", proc_code); + } + return ret; +} +e2_ap_elem_procs_o::successful_outcome_c e2_ap_elem_procs_o::get_successful_outcome(const uint16_t& proc_code) +{ + successful_outcome_c ret{}; + switch (proc_code) { + case 8: + ret.set(successful_outcome_c::types::ricsubscription_resp); + break; + case 9: + ret.set(successful_outcome_c::types::ricsubscription_delete_resp); + break; + case 7: + ret.set(successful_outcome_c::types::ricservice_upd_ack); + break; + case 4: + ret.set(successful_outcome_c::types::ri_cctrl_ack); + break; + case 1: + ret.set(successful_outcome_c::types::e2setup_resp); + break; + case 10: + ret.set(successful_outcome_c::types::e2node_cfg_upd_ack); + break; + case 11: + ret.set(successful_outcome_c::types::e2conn_upd_ack); + break; + case 3: + ret.set(successful_outcome_c::types::reset_resp); + break; + case 13: + ret.set(successful_outcome_c::types::e2_removal_resp); + break; + default: + asn1::log_error("The proc_code=%d is not recognized", proc_code); + } + return ret; +} +e2_ap_elem_procs_o::unsuccessful_outcome_c e2_ap_elem_procs_o::get_unsuccessful_outcome(const uint16_t& proc_code) +{ + unsuccessful_outcome_c ret{}; + switch (proc_code) { + case 8: + ret.set(unsuccessful_outcome_c::types::ricsubscription_fail); + break; + case 9: + ret.set(unsuccessful_outcome_c::types::ricsubscription_delete_fail); + break; + case 7: + ret.set(unsuccessful_outcome_c::types::ricservice_upd_fail); + break; + case 4: + ret.set(unsuccessful_outcome_c::types::ri_cctrl_fail); + break; + case 1: + ret.set(unsuccessful_outcome_c::types::e2setup_fail); + break; + case 10: + ret.set(unsuccessful_outcome_c::types::e2node_cfg_upd_fail); + break; + case 11: + ret.set(unsuccessful_outcome_c::types::e2conn_upd_fail); + break; + case 13: + ret.set(unsuccessful_outcome_c::types::e2_removal_fail); + break; + default: + asn1::log_error("The proc_code=%d is not recognized", proc_code); + } + return ret; +} +crit_e e2_ap_elem_procs_o::get_crit(const uint16_t& proc_code) +{ + switch (proc_code) { + case 8: + return crit_e::reject; + case 9: + return crit_e::reject; + case 7: + return crit_e::reject; + case 4: + return crit_e::reject; + case 1: + return crit_e::reject; + case 10: + return crit_e::reject; + case 11: + return crit_e::reject; + case 3: + return crit_e::reject; + case 13: + return crit_e::reject; + case 5: + return crit_e::ignore; + case 6: + return crit_e::ignore; + case 2: + return crit_e::ignore; + case 12: + return crit_e::ignore; + default: + asn1::log_error("The proc_code=%d is not recognized", proc_code); + } + return {}; +} + +// InitiatingMessage ::= OPEN TYPE +void e2_ap_elem_procs_o::init_msg_c::destroy_() +{ + switch (type_) { + case types::ricsubscription_request: + c.destroy(); + break; + case types::ricsubscription_delete_request: + c.destroy(); + break; + case types::ricservice_upd: + c.destroy(); + break; + case types::ri_cctrl_request: + c.destroy(); + break; + case types::e2setup_request: + c.destroy(); + break; + case types::e2node_cfg_upd: + c.destroy(); + break; + case types::e2conn_upd: + c.destroy(); + break; + case types::reset_request: + c.destroy(); + break; + case types::e2_removal_request: + c.destroy(); + break; + case types::ri_cind: + c.destroy(); + break; + case types::ricservice_query: + c.destroy(); + break; + case types::error_ind: + c.destroy(); + break; + case types::ricsubscription_delete_required: + c.destroy(); + break; + default: + break; + } +} +void e2_ap_elem_procs_o::init_msg_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ricsubscription_request: + c.init(); + break; + case types::ricsubscription_delete_request: + c.init(); + break; + case types::ricservice_upd: + c.init(); + break; + case types::ri_cctrl_request: + c.init(); + break; + case types::e2setup_request: + c.init(); + break; + case types::e2node_cfg_upd: + c.init(); + break; + case types::e2conn_upd: + c.init(); + break; + case types::reset_request: + c.init(); + break; + case types::e2_removal_request: + c.init(); + break; + case types::ri_cind: + c.init(); + break; + case types::ricservice_query: + c.init(); + break; + case types::error_ind: + c.init(); + break; + case types::ricsubscription_delete_required: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::init_msg_c"); + } +} +e2_ap_elem_procs_o::init_msg_c::init_msg_c(const e2_ap_elem_procs_o::init_msg_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ricsubscription_request: + c.init(other.c.get()); + break; + case types::ricsubscription_delete_request: + c.init(other.c.get()); + break; + case types::ricservice_upd: + c.init(other.c.get()); + break; + case types::ri_cctrl_request: + c.init(other.c.get()); + break; + case types::e2setup_request: + c.init(other.c.get()); + break; + case types::e2node_cfg_upd: + c.init(other.c.get()); + break; + case types::e2conn_upd: + c.init(other.c.get()); + break; + case types::reset_request: + c.init(other.c.get()); + break; + case types::e2_removal_request: + c.init(other.c.get()); + break; + case types::ri_cind: + c.init(other.c.get()); + break; + case types::ricservice_query: + c.init(other.c.get()); + break; + case types::error_ind: + c.init(other.c.get()); + break; + case types::ricsubscription_delete_required: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::init_msg_c"); + } +} +e2_ap_elem_procs_o::init_msg_c& e2_ap_elem_procs_o::init_msg_c::operator=(const e2_ap_elem_procs_o::init_msg_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ricsubscription_request: + c.set(other.c.get()); + break; + case types::ricsubscription_delete_request: + c.set(other.c.get()); + break; + case types::ricservice_upd: + c.set(other.c.get()); + break; + case types::ri_cctrl_request: + c.set(other.c.get()); + break; + case types::e2setup_request: + c.set(other.c.get()); + break; + case types::e2node_cfg_upd: + c.set(other.c.get()); + break; + case types::e2conn_upd: + c.set(other.c.get()); + break; + case types::reset_request: + c.set(other.c.get()); + break; + case types::e2_removal_request: + c.set(other.c.get()); + break; + case types::ri_cind: + c.set(other.c.get()); + break; + case types::ricservice_query: + c.set(other.c.get()); + break; + case types::error_ind: + c.set(other.c.get()); + break; + case types::ricsubscription_delete_required: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::init_msg_c"); + } + + return *this; +} +ricsubscription_request_s& e2_ap_elem_procs_o::init_msg_c::ricsubscription_request() +{ + assert_choice_type(types::ricsubscription_request, type_, "InitiatingMessage"); + return c.get(); +} +ricsubscription_delete_request_s& e2_ap_elem_procs_o::init_msg_c::ricsubscription_delete_request() +{ + assert_choice_type(types::ricsubscription_delete_request, type_, "InitiatingMessage"); + return c.get(); +} +ricservice_upd_s& e2_ap_elem_procs_o::init_msg_c::ricservice_upd() +{ + assert_choice_type(types::ricservice_upd, type_, "InitiatingMessage"); + return c.get(); +} +ri_cctrl_request_s& e2_ap_elem_procs_o::init_msg_c::ri_cctrl_request() +{ + assert_choice_type(types::ri_cctrl_request, type_, "InitiatingMessage"); + return c.get(); +} +e2setup_request_s& e2_ap_elem_procs_o::init_msg_c::e2setup_request() +{ + assert_choice_type(types::e2setup_request, type_, "InitiatingMessage"); + return c.get(); +} +e2node_cfg_upd_s& e2_ap_elem_procs_o::init_msg_c::e2node_cfg_upd() +{ + assert_choice_type(types::e2node_cfg_upd, type_, "InitiatingMessage"); + return c.get(); +} +e2conn_upd_s& e2_ap_elem_procs_o::init_msg_c::e2conn_upd() +{ + assert_choice_type(types::e2conn_upd, type_, "InitiatingMessage"); + return c.get(); +} +reset_request_s& e2_ap_elem_procs_o::init_msg_c::reset_request() +{ + assert_choice_type(types::reset_request, type_, "InitiatingMessage"); + return c.get(); +} +e2_removal_request_s& e2_ap_elem_procs_o::init_msg_c::e2_removal_request() +{ + assert_choice_type(types::e2_removal_request, type_, "InitiatingMessage"); + return c.get(); +} +ri_cind_s& e2_ap_elem_procs_o::init_msg_c::ri_cind() +{ + assert_choice_type(types::ri_cind, type_, "InitiatingMessage"); + return c.get(); +} +ricservice_query_s& e2_ap_elem_procs_o::init_msg_c::ricservice_query() +{ + assert_choice_type(types::ricservice_query, type_, "InitiatingMessage"); + return c.get(); +} +error_ind_s& e2_ap_elem_procs_o::init_msg_c::error_ind() +{ + assert_choice_type(types::error_ind, type_, "InitiatingMessage"); + return c.get(); +} +ricsubscription_delete_required_s& e2_ap_elem_procs_o::init_msg_c::ricsubscription_delete_required() +{ + assert_choice_type(types::ricsubscription_delete_required, type_, "InitiatingMessage"); + return c.get(); +} +const ricsubscription_request_s& e2_ap_elem_procs_o::init_msg_c::ricsubscription_request() const +{ + assert_choice_type(types::ricsubscription_request, type_, "InitiatingMessage"); + return c.get(); +} +const ricsubscription_delete_request_s& e2_ap_elem_procs_o::init_msg_c::ricsubscription_delete_request() const +{ + assert_choice_type(types::ricsubscription_delete_request, type_, "InitiatingMessage"); + return c.get(); +} +const ricservice_upd_s& e2_ap_elem_procs_o::init_msg_c::ricservice_upd() const +{ + assert_choice_type(types::ricservice_upd, type_, "InitiatingMessage"); + return c.get(); +} +const ri_cctrl_request_s& e2_ap_elem_procs_o::init_msg_c::ri_cctrl_request() const +{ + assert_choice_type(types::ri_cctrl_request, type_, "InitiatingMessage"); + return c.get(); +} +const e2setup_request_s& e2_ap_elem_procs_o::init_msg_c::e2setup_request() const +{ + assert_choice_type(types::e2setup_request, type_, "InitiatingMessage"); + return c.get(); +} +const e2node_cfg_upd_s& e2_ap_elem_procs_o::init_msg_c::e2node_cfg_upd() const +{ + assert_choice_type(types::e2node_cfg_upd, type_, "InitiatingMessage"); + return c.get(); +} +const e2conn_upd_s& e2_ap_elem_procs_o::init_msg_c::e2conn_upd() const +{ + assert_choice_type(types::e2conn_upd, type_, "InitiatingMessage"); + return c.get(); +} +const reset_request_s& e2_ap_elem_procs_o::init_msg_c::reset_request() const +{ + assert_choice_type(types::reset_request, type_, "InitiatingMessage"); + return c.get(); +} +const e2_removal_request_s& e2_ap_elem_procs_o::init_msg_c::e2_removal_request() const +{ + assert_choice_type(types::e2_removal_request, type_, "InitiatingMessage"); + return c.get(); +} +const ri_cind_s& e2_ap_elem_procs_o::init_msg_c::ri_cind() const +{ + assert_choice_type(types::ri_cind, type_, "InitiatingMessage"); + return c.get(); +} +const ricservice_query_s& e2_ap_elem_procs_o::init_msg_c::ricservice_query() const +{ + assert_choice_type(types::ricservice_query, type_, "InitiatingMessage"); + return c.get(); +} +const error_ind_s& e2_ap_elem_procs_o::init_msg_c::error_ind() const +{ + assert_choice_type(types::error_ind, type_, "InitiatingMessage"); + return c.get(); +} +const ricsubscription_delete_required_s& e2_ap_elem_procs_o::init_msg_c::ricsubscription_delete_required() const +{ + assert_choice_type(types::ricsubscription_delete_required, type_, "InitiatingMessage"); + return c.get(); +} +void e2_ap_elem_procs_o::init_msg_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ricsubscription_request: + j.write_fieldname("RICsubscriptionRequest"); + c.get().to_json(j); + break; + case types::ricsubscription_delete_request: + j.write_fieldname("RICsubscriptionDeleteRequest"); + c.get().to_json(j); + break; + case types::ricservice_upd: + j.write_fieldname("RICserviceUpdate"); + c.get().to_json(j); + break; + case types::ri_cctrl_request: + j.write_fieldname("RICcontrolRequest"); + c.get().to_json(j); + break; + case types::e2setup_request: + j.write_fieldname("E2setupRequest"); + c.get().to_json(j); + break; + case types::e2node_cfg_upd: + j.write_fieldname("E2nodeConfigurationUpdate"); + c.get().to_json(j); + break; + case types::e2conn_upd: + j.write_fieldname("E2connectionUpdate"); + c.get().to_json(j); + break; + case types::reset_request: + j.write_fieldname("ResetRequest"); + c.get().to_json(j); + break; + case types::e2_removal_request: + j.write_fieldname("E2RemovalRequest"); + c.get().to_json(j); + break; + case types::ri_cind: + j.write_fieldname("RICindication"); + c.get().to_json(j); + break; + case types::ricservice_query: + j.write_fieldname("RICserviceQuery"); + c.get().to_json(j); + break; + case types::error_ind: + j.write_fieldname("ErrorIndication"); + c.get().to_json(j); + break; + case types::ricsubscription_delete_required: + j.write_fieldname("RICsubscriptionDeleteRequired"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::init_msg_c"); + } + j.end_obj(); +} +SRSASN_CODE e2_ap_elem_procs_o::init_msg_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ricsubscription_request: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ricsubscription_delete_request: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ricservice_upd: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ri_cctrl_request: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2setup_request: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_cfg_upd: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2conn_upd: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::reset_request: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2_removal_request: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ri_cind: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ricservice_query: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::error_ind: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ricsubscription_delete_required: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::init_msg_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_ap_elem_procs_o::init_msg_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ricsubscription_request: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ricsubscription_delete_request: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ricservice_upd: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ri_cctrl_request: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2setup_request: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_cfg_upd: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2conn_upd: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::reset_request: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2_removal_request: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ri_cind: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ricservice_query: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::error_ind: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ricsubscription_delete_required: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::init_msg_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2_ap_elem_procs_o::init_msg_c::types_opts::to_string() const +{ + static const char* options[] = {"RICsubscriptionRequest", + "RICsubscriptionDeleteRequest", + "RICserviceUpdate", + "RICcontrolRequest", + "E2setupRequest", + "E2nodeConfigurationUpdate", + "E2connectionUpdate", + "ResetRequest", + "E2RemovalRequest", + "RICindication", + "RICserviceQuery", + "ErrorIndication", + "RICsubscriptionDeleteRequired"}; + return convert_enum_idx(options, 13, value, "e2_ap_elem_procs_o::init_msg_c::types"); +} + +// SuccessfulOutcome ::= OPEN TYPE +void e2_ap_elem_procs_o::successful_outcome_c::destroy_() +{ + switch (type_) { + case types::ricsubscription_resp: + c.destroy(); + break; + case types::ricsubscription_delete_resp: + c.destroy(); + break; + case types::ricservice_upd_ack: + c.destroy(); + break; + case types::ri_cctrl_ack: + c.destroy(); + break; + case types::e2setup_resp: + c.destroy(); + break; + case types::e2node_cfg_upd_ack: + c.destroy(); + break; + case types::e2conn_upd_ack: + c.destroy(); + break; + case types::reset_resp: + c.destroy(); + break; + case types::e2_removal_resp: + c.destroy(); + break; + default: + break; + } +} +void e2_ap_elem_procs_o::successful_outcome_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ricsubscription_resp: + c.init(); + break; + case types::ricsubscription_delete_resp: + c.init(); + break; + case types::ricservice_upd_ack: + c.init(); + break; + case types::ri_cctrl_ack: + c.init(); + break; + case types::e2setup_resp: + c.init(); + break; + case types::e2node_cfg_upd_ack: + c.init(); + break; + case types::e2conn_upd_ack: + c.init(); + break; + case types::reset_resp: + c.init(); + break; + case types::e2_removal_resp: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::successful_outcome_c"); + } +} +e2_ap_elem_procs_o::successful_outcome_c::successful_outcome_c(const e2_ap_elem_procs_o::successful_outcome_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ricsubscription_resp: + c.init(other.c.get()); + break; + case types::ricsubscription_delete_resp: + c.init(other.c.get()); + break; + case types::ricservice_upd_ack: + c.init(other.c.get()); + break; + case types::ri_cctrl_ack: + c.init(other.c.get()); + break; + case types::e2setup_resp: + c.init(other.c.get()); + break; + case types::e2node_cfg_upd_ack: + c.init(other.c.get()); + break; + case types::e2conn_upd_ack: + c.init(other.c.get()); + break; + case types::reset_resp: + c.init(other.c.get()); + break; + case types::e2_removal_resp: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::successful_outcome_c"); + } +} +e2_ap_elem_procs_o::successful_outcome_c& +e2_ap_elem_procs_o::successful_outcome_c::operator=(const e2_ap_elem_procs_o::successful_outcome_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ricsubscription_resp: + c.set(other.c.get()); + break; + case types::ricsubscription_delete_resp: + c.set(other.c.get()); + break; + case types::ricservice_upd_ack: + c.set(other.c.get()); + break; + case types::ri_cctrl_ack: + c.set(other.c.get()); + break; + case types::e2setup_resp: + c.set(other.c.get()); + break; + case types::e2node_cfg_upd_ack: + c.set(other.c.get()); + break; + case types::e2conn_upd_ack: + c.set(other.c.get()); + break; + case types::reset_resp: + c.set(other.c.get()); + break; + case types::e2_removal_resp: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::successful_outcome_c"); + } + + return *this; +} +ricsubscription_resp_s& e2_ap_elem_procs_o::successful_outcome_c::ricsubscription_resp() +{ + assert_choice_type(types::ricsubscription_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +ricsubscription_delete_resp_s& e2_ap_elem_procs_o::successful_outcome_c::ricsubscription_delete_resp() +{ + assert_choice_type(types::ricsubscription_delete_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +ricservice_upd_ack_s& e2_ap_elem_procs_o::successful_outcome_c::ricservice_upd_ack() +{ + assert_choice_type(types::ricservice_upd_ack, type_, "SuccessfulOutcome"); + return c.get(); +} +ri_cctrl_ack_s& e2_ap_elem_procs_o::successful_outcome_c::ri_cctrl_ack() +{ + assert_choice_type(types::ri_cctrl_ack, type_, "SuccessfulOutcome"); + return c.get(); +} +e2setup_resp_s& e2_ap_elem_procs_o::successful_outcome_c::e2setup_resp() +{ + assert_choice_type(types::e2setup_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +e2node_cfg_upd_ack_s& e2_ap_elem_procs_o::successful_outcome_c::e2node_cfg_upd_ack() +{ + assert_choice_type(types::e2node_cfg_upd_ack, type_, "SuccessfulOutcome"); + return c.get(); +} +e2conn_upd_ack_s& e2_ap_elem_procs_o::successful_outcome_c::e2conn_upd_ack() +{ + assert_choice_type(types::e2conn_upd_ack, type_, "SuccessfulOutcome"); + return c.get(); +} +reset_resp_s& e2_ap_elem_procs_o::successful_outcome_c::reset_resp() +{ + assert_choice_type(types::reset_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +e2_removal_resp_s& e2_ap_elem_procs_o::successful_outcome_c::e2_removal_resp() +{ + assert_choice_type(types::e2_removal_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +const ricsubscription_resp_s& e2_ap_elem_procs_o::successful_outcome_c::ricsubscription_resp() const +{ + assert_choice_type(types::ricsubscription_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +const ricsubscription_delete_resp_s& e2_ap_elem_procs_o::successful_outcome_c::ricsubscription_delete_resp() const +{ + assert_choice_type(types::ricsubscription_delete_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +const ricservice_upd_ack_s& e2_ap_elem_procs_o::successful_outcome_c::ricservice_upd_ack() const +{ + assert_choice_type(types::ricservice_upd_ack, type_, "SuccessfulOutcome"); + return c.get(); +} +const ri_cctrl_ack_s& e2_ap_elem_procs_o::successful_outcome_c::ri_cctrl_ack() const +{ + assert_choice_type(types::ri_cctrl_ack, type_, "SuccessfulOutcome"); + return c.get(); +} +const e2setup_resp_s& e2_ap_elem_procs_o::successful_outcome_c::e2setup_resp() const +{ + assert_choice_type(types::e2setup_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +const e2node_cfg_upd_ack_s& e2_ap_elem_procs_o::successful_outcome_c::e2node_cfg_upd_ack() const +{ + assert_choice_type(types::e2node_cfg_upd_ack, type_, "SuccessfulOutcome"); + return c.get(); +} +const e2conn_upd_ack_s& e2_ap_elem_procs_o::successful_outcome_c::e2conn_upd_ack() const +{ + assert_choice_type(types::e2conn_upd_ack, type_, "SuccessfulOutcome"); + return c.get(); +} +const reset_resp_s& e2_ap_elem_procs_o::successful_outcome_c::reset_resp() const +{ + assert_choice_type(types::reset_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +const e2_removal_resp_s& e2_ap_elem_procs_o::successful_outcome_c::e2_removal_resp() const +{ + assert_choice_type(types::e2_removal_resp, type_, "SuccessfulOutcome"); + return c.get(); +} +void e2_ap_elem_procs_o::successful_outcome_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ricsubscription_resp: + j.write_fieldname("RICsubscriptionResponse"); + c.get().to_json(j); + break; + case types::ricsubscription_delete_resp: + j.write_fieldname("RICsubscriptionDeleteResponse"); + c.get().to_json(j); + break; + case types::ricservice_upd_ack: + j.write_fieldname("RICserviceUpdateAcknowledge"); + c.get().to_json(j); + break; + case types::ri_cctrl_ack: + j.write_fieldname("RICcontrolAcknowledge"); + c.get().to_json(j); + break; + case types::e2setup_resp: + j.write_fieldname("E2setupResponse"); + c.get().to_json(j); + break; + case types::e2node_cfg_upd_ack: + j.write_fieldname("E2nodeConfigurationUpdateAcknowledge"); + c.get().to_json(j); + break; + case types::e2conn_upd_ack: + j.write_fieldname("E2connectionUpdateAcknowledge"); + c.get().to_json(j); + break; + case types::reset_resp: + j.write_fieldname("ResetResponse"); + c.get().to_json(j); + break; + case types::e2_removal_resp: + j.write_fieldname("E2RemovalResponse"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::successful_outcome_c"); + } + j.end_obj(); +} +SRSASN_CODE e2_ap_elem_procs_o::successful_outcome_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ricsubscription_resp: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ricsubscription_delete_resp: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ricservice_upd_ack: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ri_cctrl_ack: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2setup_resp: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_cfg_upd_ack: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2conn_upd_ack: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::reset_resp: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2_removal_resp: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::successful_outcome_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_ap_elem_procs_o::successful_outcome_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ricsubscription_resp: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ricsubscription_delete_resp: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ricservice_upd_ack: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ri_cctrl_ack: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2setup_resp: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_cfg_upd_ack: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2conn_upd_ack: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::reset_resp: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2_removal_resp: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::successful_outcome_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2_ap_elem_procs_o::successful_outcome_c::types_opts::to_string() const +{ + static const char* options[] = {"RICsubscriptionResponse", + "RICsubscriptionDeleteResponse", + "RICserviceUpdateAcknowledge", + "RICcontrolAcknowledge", + "E2setupResponse", + "E2nodeConfigurationUpdateAcknowledge", + "E2connectionUpdateAcknowledge", + "ResetResponse", + "E2RemovalResponse"}; + return convert_enum_idx(options, 9, value, "e2_ap_elem_procs_o::successful_outcome_c::types"); +} + +// UnsuccessfulOutcome ::= OPEN TYPE +void e2_ap_elem_procs_o::unsuccessful_outcome_c::destroy_() +{ + switch (type_) { + case types::ricsubscription_fail: + c.destroy(); + break; + case types::ricsubscription_delete_fail: + c.destroy(); + break; + case types::ricservice_upd_fail: + c.destroy(); + break; + case types::ri_cctrl_fail: + c.destroy(); + break; + case types::e2setup_fail: + c.destroy(); + break; + case types::e2node_cfg_upd_fail: + c.destroy(); + break; + case types::e2conn_upd_fail: + c.destroy(); + break; + case types::e2_removal_fail: + c.destroy(); + break; + default: + break; + } +} +void e2_ap_elem_procs_o::unsuccessful_outcome_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ricsubscription_fail: + c.init(); + break; + case types::ricsubscription_delete_fail: + c.init(); + break; + case types::ricservice_upd_fail: + c.init(); + break; + case types::ri_cctrl_fail: + c.init(); + break; + case types::e2setup_fail: + c.init(); + break; + case types::e2node_cfg_upd_fail: + c.init(); + break; + case types::e2conn_upd_fail: + c.init(); + break; + case types::e2_removal_fail: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::unsuccessful_outcome_c"); + } +} +e2_ap_elem_procs_o::unsuccessful_outcome_c::unsuccessful_outcome_c( + const e2_ap_elem_procs_o::unsuccessful_outcome_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ricsubscription_fail: + c.init(other.c.get()); + break; + case types::ricsubscription_delete_fail: + c.init(other.c.get()); + break; + case types::ricservice_upd_fail: + c.init(other.c.get()); + break; + case types::ri_cctrl_fail: + c.init(other.c.get()); + break; + case types::e2setup_fail: + c.init(other.c.get()); + break; + case types::e2node_cfg_upd_fail: + c.init(other.c.get()); + break; + case types::e2conn_upd_fail: + c.init(other.c.get()); + break; + case types::e2_removal_fail: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::unsuccessful_outcome_c"); + } +} +e2_ap_elem_procs_o::unsuccessful_outcome_c& +e2_ap_elem_procs_o::unsuccessful_outcome_c::operator=(const e2_ap_elem_procs_o::unsuccessful_outcome_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ricsubscription_fail: + c.set(other.c.get()); + break; + case types::ricsubscription_delete_fail: + c.set(other.c.get()); + break; + case types::ricservice_upd_fail: + c.set(other.c.get()); + break; + case types::ri_cctrl_fail: + c.set(other.c.get()); + break; + case types::e2setup_fail: + c.set(other.c.get()); + break; + case types::e2node_cfg_upd_fail: + c.set(other.c.get()); + break; + case types::e2conn_upd_fail: + c.set(other.c.get()); + break; + case types::e2_removal_fail: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::unsuccessful_outcome_c"); + } + + return *this; +} +ricsubscription_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::ricsubscription_fail() +{ + assert_choice_type(types::ricsubscription_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +ricsubscription_delete_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::ricsubscription_delete_fail() +{ + assert_choice_type(types::ricsubscription_delete_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +ricservice_upd_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::ricservice_upd_fail() +{ + assert_choice_type(types::ricservice_upd_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +ri_cctrl_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::ri_cctrl_fail() +{ + assert_choice_type(types::ri_cctrl_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +e2setup_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::e2setup_fail() +{ + assert_choice_type(types::e2setup_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +e2node_cfg_upd_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::e2node_cfg_upd_fail() +{ + assert_choice_type(types::e2node_cfg_upd_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +e2conn_upd_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::e2conn_upd_fail() +{ + assert_choice_type(types::e2conn_upd_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +e2_removal_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::e2_removal_fail() +{ + assert_choice_type(types::e2_removal_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +const ricsubscription_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::ricsubscription_fail() const +{ + assert_choice_type(types::ricsubscription_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +const ricsubscription_delete_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::ricsubscription_delete_fail() const +{ + assert_choice_type(types::ricsubscription_delete_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +const ricservice_upd_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::ricservice_upd_fail() const +{ + assert_choice_type(types::ricservice_upd_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +const ri_cctrl_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::ri_cctrl_fail() const +{ + assert_choice_type(types::ri_cctrl_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +const e2setup_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::e2setup_fail() const +{ + assert_choice_type(types::e2setup_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +const e2node_cfg_upd_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::e2node_cfg_upd_fail() const +{ + assert_choice_type(types::e2node_cfg_upd_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +const e2conn_upd_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::e2conn_upd_fail() const +{ + assert_choice_type(types::e2conn_upd_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +const e2_removal_fail_s& e2_ap_elem_procs_o::unsuccessful_outcome_c::e2_removal_fail() const +{ + assert_choice_type(types::e2_removal_fail, type_, "UnsuccessfulOutcome"); + return c.get(); +} +void e2_ap_elem_procs_o::unsuccessful_outcome_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ricsubscription_fail: + j.write_fieldname("RICsubscriptionFailure"); + c.get().to_json(j); + break; + case types::ricsubscription_delete_fail: + j.write_fieldname("RICsubscriptionDeleteFailure"); + c.get().to_json(j); + break; + case types::ricservice_upd_fail: + j.write_fieldname("RICserviceUpdateFailure"); + c.get().to_json(j); + break; + case types::ri_cctrl_fail: + j.write_fieldname("RICcontrolFailure"); + c.get().to_json(j); + break; + case types::e2setup_fail: + j.write_fieldname("E2setupFailure"); + c.get().to_json(j); + break; + case types::e2node_cfg_upd_fail: + j.write_fieldname("E2nodeConfigurationUpdateFailure"); + c.get().to_json(j); + break; + case types::e2conn_upd_fail: + j.write_fieldname("E2connectionUpdateFailure"); + c.get().to_json(j); + break; + case types::e2_removal_fail: + j.write_fieldname("E2RemovalFailure"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::unsuccessful_outcome_c"); + } + j.end_obj(); +} +SRSASN_CODE e2_ap_elem_procs_o::unsuccessful_outcome_c::pack(bit_ref& bref) const +{ + varlength_field_pack_guard varlen_scope(bref, true); + switch (type_) { + case types::ricsubscription_fail: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ricsubscription_delete_fail: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ricservice_upd_fail: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ri_cctrl_fail: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2setup_fail: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2node_cfg_upd_fail: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2conn_upd_fail: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e2_removal_fail: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::unsuccessful_outcome_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_ap_elem_procs_o::unsuccessful_outcome_c::unpack(cbit_ref& bref) +{ + varlength_field_unpack_guard varlen_scope(bref, true); + switch (type_) { + case types::ricsubscription_fail: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ricsubscription_delete_fail: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ricservice_upd_fail: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ri_cctrl_fail: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2setup_fail: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2node_cfg_upd_fail: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2conn_upd_fail: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e2_removal_fail: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_ap_elem_procs_o::unsuccessful_outcome_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2_ap_elem_procs_o::unsuccessful_outcome_c::types_opts::to_string() const +{ + static const char* options[] = {"RICsubscriptionFailure", + "RICsubscriptionDeleteFailure", + "RICserviceUpdateFailure", + "RICcontrolFailure", + "E2setupFailure", + "E2nodeConfigurationUpdateFailure", + "E2connectionUpdateFailure", + "E2RemovalFailure"}; + return convert_enum_idx(options, 8, value, "e2_ap_elem_procs_o::unsuccessful_outcome_c::types"); +} + +// InitiatingMessage ::= SEQUENCE{{E2AP-ELEMENTARY-PROCEDURE}} +SRSASN_CODE init_msg_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, proc_code, (uint16_t)0u, (uint16_t)255u, false, true)); + warn_assert(crit != e2_ap_elem_procs_o::get_crit(proc_code), __func__, __LINE__); + HANDLE_CODE(crit.pack(bref)); + HANDLE_CODE(value.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE init_msg_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(unpack_integer(proc_code, bref, (uint16_t)0u, (uint16_t)255u, false, true)); + HANDLE_CODE(crit.unpack(bref)); + value = e2_ap_elem_procs_o::get_init_msg(proc_code); + HANDLE_CODE(value.unpack(bref)); + + return SRSASN_SUCCESS; +} +void init_msg_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("procedureCode", proc_code); + j.write_str("criticality", crit.to_string()); + j.write_fieldname("value"); + value.to_json(j); + j.end_obj(); +} +bool init_msg_s::load_info_obj(const uint16_t& proc_code_) +{ + if (not e2_ap_elem_procs_o::is_proc_code_valid(proc_code_)) { + return false; + } + proc_code = proc_code_; + crit = e2_ap_elem_procs_o::get_crit(proc_code); + value = e2_ap_elem_procs_o::get_init_msg(proc_code); + return value.type().value != e2_ap_elem_procs_o::init_msg_c::types_opts::nulltype; +} + +// SuccessfulOutcome ::= SEQUENCE{{E2AP-ELEMENTARY-PROCEDURE}} +SRSASN_CODE successful_outcome_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, proc_code, (uint16_t)0u, (uint16_t)255u, false, true)); + warn_assert(crit != e2_ap_elem_procs_o::get_crit(proc_code), __func__, __LINE__); + HANDLE_CODE(crit.pack(bref)); + HANDLE_CODE(value.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE successful_outcome_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(unpack_integer(proc_code, bref, (uint16_t)0u, (uint16_t)255u, false, true)); + HANDLE_CODE(crit.unpack(bref)); + value = e2_ap_elem_procs_o::get_successful_outcome(proc_code); + HANDLE_CODE(value.unpack(bref)); + + return SRSASN_SUCCESS; +} +void successful_outcome_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("procedureCode", proc_code); + j.write_str("criticality", crit.to_string()); + j.write_fieldname("value"); + value.to_json(j); + j.end_obj(); +} +bool successful_outcome_s::load_info_obj(const uint16_t& proc_code_) +{ + if (not e2_ap_elem_procs_o::is_proc_code_valid(proc_code_)) { + return false; + } + proc_code = proc_code_; + crit = e2_ap_elem_procs_o::get_crit(proc_code); + value = e2_ap_elem_procs_o::get_successful_outcome(proc_code); + return value.type().value != e2_ap_elem_procs_o::successful_outcome_c::types_opts::nulltype; +} + +// UnsuccessfulOutcome ::= SEQUENCE{{E2AP-ELEMENTARY-PROCEDURE}} +SRSASN_CODE unsuccessful_outcome_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, proc_code, (uint16_t)0u, (uint16_t)255u, false, true)); + warn_assert(crit != e2_ap_elem_procs_o::get_crit(proc_code), __func__, __LINE__); + HANDLE_CODE(crit.pack(bref)); + HANDLE_CODE(value.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE unsuccessful_outcome_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(unpack_integer(proc_code, bref, (uint16_t)0u, (uint16_t)255u, false, true)); + HANDLE_CODE(crit.unpack(bref)); + value = e2_ap_elem_procs_o::get_unsuccessful_outcome(proc_code); + HANDLE_CODE(value.unpack(bref)); + + return SRSASN_SUCCESS; +} +void unsuccessful_outcome_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("procedureCode", proc_code); + j.write_str("criticality", crit.to_string()); + j.write_fieldname("value"); + value.to_json(j); + j.end_obj(); +} +bool unsuccessful_outcome_s::load_info_obj(const uint16_t& proc_code_) +{ + if (not e2_ap_elem_procs_o::is_proc_code_valid(proc_code_)) { + return false; + } + proc_code = proc_code_; + crit = e2_ap_elem_procs_o::get_crit(proc_code); + value = e2_ap_elem_procs_o::get_unsuccessful_outcome(proc_code); + return value.type().value != e2_ap_elem_procs_o::unsuccessful_outcome_c::types_opts::nulltype; +} + +// E2AP-PDU ::= CHOICE +void e2_ap_pdu_c::destroy_() +{ + switch (type_) { + case types::init_msg: + c.destroy(); + break; + case types::successful_outcome: + c.destroy(); + break; + case types::unsuccessful_outcome: + c.destroy(); + break; + default: + break; + } +} +void e2_ap_pdu_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::init_msg: + c.init(); + break; + case types::successful_outcome: + c.init(); + break; + case types::unsuccessful_outcome: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_pdu_c"); + } +} +e2_ap_pdu_c::e2_ap_pdu_c(const e2_ap_pdu_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::init_msg: + c.init(other.c.get()); + break; + case types::successful_outcome: + c.init(other.c.get()); + break; + case types::unsuccessful_outcome: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_pdu_c"); + } +} +e2_ap_pdu_c& e2_ap_pdu_c::operator=(const e2_ap_pdu_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::init_msg: + c.set(other.c.get()); + break; + case types::successful_outcome: + c.set(other.c.get()); + break; + case types::unsuccessful_outcome: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "e2_ap_pdu_c"); + } + + return *this; +} +init_msg_s& e2_ap_pdu_c::set_init_msg() +{ + set(types::init_msg); + return c.get(); +} +successful_outcome_s& e2_ap_pdu_c::set_successful_outcome() +{ + set(types::successful_outcome); + return c.get(); +} +unsuccessful_outcome_s& e2_ap_pdu_c::set_unsuccessful_outcome() +{ + set(types::unsuccessful_outcome); + return c.get(); +} +void e2_ap_pdu_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::init_msg: + j.write_fieldname("initiatingMessage"); + c.get().to_json(j); + break; + case types::successful_outcome: + j.write_fieldname("successfulOutcome"); + c.get().to_json(j); + break; + case types::unsuccessful_outcome: + j.write_fieldname("unsuccessfulOutcome"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "e2_ap_pdu_c"); + } + j.end_obj(); +} +SRSASN_CODE e2_ap_pdu_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::init_msg: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::successful_outcome: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::unsuccessful_outcome: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_ap_pdu_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE e2_ap_pdu_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::init_msg: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::successful_outcome: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::unsuccessful_outcome: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "e2_ap_pdu_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* e2_ap_pdu_c::types_opts::to_string() const +{ + static const char* options[] = {"initiatingMessage", "successfulOutcome", "unsuccessfulOutcome"}; + return convert_enum_idx(options, 3, value, "e2_ap_pdu_c::types"); +} + +// ProtocolIE-FieldPair{E2AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE{{E2AP-PROTOCOL-IES-PAIR}} +template +SRSASN_CODE protocol_ie_field_pair_s::pack(bit_ref& bref) const +{ + HANDLE_CODE(pack_integer(bref, id, (uint32_t)0u, (uint32_t)65535u, false, true)); + warn_assert(first_crit != ies_set_paramT_::get_first_crit(id), __func__, __LINE__); + HANDLE_CODE(first_crit.pack(bref)); + HANDLE_CODE(first_value.pack(bref)); + warn_assert(second_crit != ies_set_paramT_::get_second_crit(id), __func__, __LINE__); + HANDLE_CODE(second_crit.pack(bref)); + HANDLE_CODE(second_value.pack(bref)); + + return SRSASN_SUCCESS; +} +template +SRSASN_CODE protocol_ie_field_pair_s::unpack(cbit_ref& bref) +{ + HANDLE_CODE(unpack_integer(id, bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + HANDLE_CODE(first_crit.unpack(bref)); + first_value = ies_set_paramT_::get_first_value(id); + HANDLE_CODE(first_value.unpack(bref)); + HANDLE_CODE(second_crit.unpack(bref)); + second_value = ies_set_paramT_::get_second_value(id); + HANDLE_CODE(second_value.unpack(bref)); + + return SRSASN_SUCCESS; +} +template +void protocol_ie_field_pair_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("id", id); + j.write_str("firstCriticality", first_crit.to_string()); + j.write_str("secondCriticality", second_crit.to_string()); + j.end_obj(); +} +template +bool protocol_ie_field_pair_s::load_info_obj(const uint32_t& id_) +{ + if (not ies_set_paramT_::is_id_valid(id_)) { + return false; + } + id = id_; + first_crit = ies_set_paramT_::get_first_crit(id); + first_value = ies_set_paramT_::get_first_value(id); + second_crit = ies_set_paramT_::get_second_crit(id); + second_value = ies_set_paramT_::get_second_value(id); + return first_value.type().value != ies_set_paramT_::first_value_c::types_opts::nulltype and + second_value.type().value != ies_set_paramT_::second_value_c::types_opts::nulltype; +} diff --git a/lib/src/asn1/e2sm.cpp b/lib/src/asn1/e2sm.cpp new file mode 100644 index 000000000..354c0953a --- /dev/null +++ b/lib/src/asn1/e2sm.cpp @@ -0,0 +1,3065 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2021 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ + +#include "srsran/asn1/e2sm.h" +#include + +using namespace asn1; +using namespace asn1::e2sm; + +/******************************************************************************* + * Struct Methods + ******************************************************************************/ + +// EUTRA-CGI ::= SEQUENCE +SRSASN_CODE eutra_cgi_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(eutra_cell_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE eutra_cgi_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(eutra_cell_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void eutra_cgi_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMNIdentity", plmn_id.to_string()); + j.write_str("eUTRACellIdentity", eutra_cell_id.to_string()); + j.end_obj(); +} + +// NR-CGI ::= SEQUENCE +SRSASN_CODE nr_cgi_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(nrcell_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE nr_cgi_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(nrcell_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void nr_cgi_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMNIdentity", plmn_id.to_string()); + j.write_str("nRCellIdentity", nrcell_id.to_string()); + j.end_obj(); +} + +// CGI ::= CHOICE +void cgi_c::destroy_() +{ + switch (type_) { + case types::nr_cgi: + c.destroy(); + break; + case types::eutra_cgi: + c.destroy(); + break; + default: + break; + } +} +void cgi_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::nr_cgi: + c.init(); + break; + case types::eutra_cgi: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "cgi_c"); + } +} +cgi_c::cgi_c(const cgi_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::nr_cgi: + c.init(other.c.get()); + break; + case types::eutra_cgi: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "cgi_c"); + } +} +cgi_c& cgi_c::operator=(const cgi_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::nr_cgi: + c.set(other.c.get()); + break; + case types::eutra_cgi: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "cgi_c"); + } + + return *this; +} +nr_cgi_s& cgi_c::set_nr_cgi() +{ + set(types::nr_cgi); + return c.get(); +} +eutra_cgi_s& cgi_c::set_eutra_cgi() +{ + set(types::eutra_cgi); + return c.get(); +} +void cgi_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::nr_cgi: + j.write_fieldname("nR-CGI"); + c.get().to_json(j); + break; + case types::eutra_cgi: + j.write_fieldname("eUTRA-CGI"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "cgi_c"); + } + j.end_obj(); +} +SRSASN_CODE cgi_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::nr_cgi: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::eutra_cgi: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "cgi_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE cgi_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::nr_cgi: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::eutra_cgi: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "cgi_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* cgi_c::types_opts::to_string() const +{ + static const char* options[] = {"nR-CGI", "eUTRA-CGI"}; + return convert_enum_idx(options, 2, value, "cgi_c::types"); +} + +// GUAMI ::= SEQUENCE +SRSASN_CODE guami_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(amf_region_id.pack(bref)); + HANDLE_CODE(amf_set_id.pack(bref)); + HANDLE_CODE(amf_pointer.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE guami_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(amf_region_id.unpack(bref)); + HANDLE_CODE(amf_set_id.unpack(bref)); + HANDLE_CODE(amf_pointer.unpack(bref)); + + return SRSASN_SUCCESS; +} +void guami_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMNIdentity", plmn_id.to_string()); + j.write_str("aMFRegionID", amf_region_id.to_string()); + j.write_str("aMFSetID", amf_set_id.to_string()); + j.write_str("aMFPointer", amf_pointer.to_string()); + j.end_obj(); +} + +// GUMMEI ::= SEQUENCE +SRSASN_CODE gummei_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(mme_group_id.pack(bref)); + HANDLE_CODE(mme_code.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE gummei_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(mme_group_id.unpack(bref)); + HANDLE_CODE(mme_code.unpack(bref)); + + return SRSASN_SUCCESS; +} +void gummei_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMN-Identity", plmn_id.to_string()); + j.write_str("mME-Group-ID", mme_group_id.to_string()); + j.write_str("mME-Code", mme_code.to_string()); + j.end_obj(); +} + +// CoreCPID ::= CHOICE +void core_cpid_c::destroy_() +{ + switch (type_) { + case types::five_gc: + c.destroy(); + break; + case types::epc: + c.destroy(); + break; + default: + break; + } +} +void core_cpid_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::five_gc: + c.init(); + break; + case types::epc: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "core_cpid_c"); + } +} +core_cpid_c::core_cpid_c(const core_cpid_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::five_gc: + c.init(other.c.get()); + break; + case types::epc: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "core_cpid_c"); + } +} +core_cpid_c& core_cpid_c::operator=(const core_cpid_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::five_gc: + c.set(other.c.get()); + break; + case types::epc: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "core_cpid_c"); + } + + return *this; +} +guami_s& core_cpid_c::set_five_gc() +{ + set(types::five_gc); + return c.get(); +} +gummei_s& core_cpid_c::set_epc() +{ + set(types::epc); + return c.get(); +} +void core_cpid_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::five_gc: + j.write_fieldname("fiveGC"); + c.get().to_json(j); + break; + case types::epc: + j.write_fieldname("ePC"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "core_cpid_c"); + } + j.end_obj(); +} +SRSASN_CODE core_cpid_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::five_gc: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::epc: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "core_cpid_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE core_cpid_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::five_gc: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::epc: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "core_cpid_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* core_cpid_c::types_opts::to_string() const +{ + static const char* options[] = {"fiveGC", "ePC"}; + return convert_enum_idx(options, 2, value, "core_cpid_c::types"); +} +uint8_t core_cpid_c::types_opts::to_number() const +{ + static const uint8_t options[] = {5}; + return map_enum_number(options, 1, value, "core_cpid_c::types"); +} + +// ENB-ID ::= CHOICE +void enb_id_c::destroy_() +{ + switch (type_) { + case types::macro_enb_id: + c.destroy >(); + break; + case types::home_enb_id: + c.destroy >(); + break; + case types::short_macro_enb_id: + c.destroy >(); + break; + case types::long_macro_enb_id: + c.destroy >(); + break; + default: + break; + } +} +void enb_id_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::macro_enb_id: + c.init >(); + break; + case types::home_enb_id: + c.init >(); + break; + case types::short_macro_enb_id: + c.init >(); + break; + case types::long_macro_enb_id: + c.init >(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + } +} +enb_id_c::enb_id_c(const enb_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::macro_enb_id: + c.init(other.c.get >()); + break; + case types::home_enb_id: + c.init(other.c.get >()); + break; + case types::short_macro_enb_id: + c.init(other.c.get >()); + break; + case types::long_macro_enb_id: + c.init(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + } +} +enb_id_c& enb_id_c::operator=(const enb_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::macro_enb_id: + c.set(other.c.get >()); + break; + case types::home_enb_id: + c.set(other.c.get >()); + break; + case types::short_macro_enb_id: + c.set(other.c.get >()); + break; + case types::long_macro_enb_id: + c.set(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + } + + return *this; +} +fixed_bitstring<20, false, true>& enb_id_c::set_macro_enb_id() +{ + set(types::macro_enb_id); + return c.get >(); +} +fixed_bitstring<28, false, true>& enb_id_c::set_home_enb_id() +{ + set(types::home_enb_id); + return c.get >(); +} +fixed_bitstring<18, false, true>& enb_id_c::set_short_macro_enb_id() +{ + set(types::short_macro_enb_id); + return c.get >(); +} +fixed_bitstring<21, false, true>& enb_id_c::set_long_macro_enb_id() +{ + set(types::long_macro_enb_id); + return c.get >(); +} +void enb_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::macro_enb_id: + j.write_str("macro-eNB-ID", c.get >().to_string()); + break; + case types::home_enb_id: + j.write_str("home-eNB-ID", c.get >().to_string()); + break; + case types::short_macro_enb_id: + j.write_str("short-Macro-eNB-ID", c.get >().to_string()); + break; + case types::long_macro_enb_id: + j.write_str("long-Macro-eNB-ID", c.get >().to_string()); + break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + } + j.end_obj(); +} +SRSASN_CODE enb_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::macro_enb_id: + HANDLE_CODE((c.get >().pack(bref))); + break; + case types::home_enb_id: + HANDLE_CODE((c.get >().pack(bref))); + break; + case types::short_macro_enb_id: { + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE((c.get >().pack(bref))); + } break; + case types::long_macro_enb_id: { + varlength_field_pack_guard varlen_scope(bref, true); + HANDLE_CODE((c.get >().pack(bref))); + } break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE enb_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::macro_enb_id: + HANDLE_CODE((c.get >().unpack(bref))); + break; + case types::home_enb_id: + HANDLE_CODE((c.get >().unpack(bref))); + break; + case types::short_macro_enb_id: { + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE((c.get >().unpack(bref))); + } break; + case types::long_macro_enb_id: { + varlength_field_unpack_guard varlen_scope(bref, true); + HANDLE_CODE((c.get >().unpack(bref))); + } break; + default: + log_invalid_choice_id(type_, "enb_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* enb_id_c::types_opts::to_string() const +{ + static const char* options[] = {"macro-eNB-ID", "home-eNB-ID", "short-Macro-eNB-ID", "long-Macro-eNB-ID"}; + return convert_enum_idx(options, 4, value, "enb_id_c::types"); +} + +// GlobalENB-ID ::= SEQUENCE +SRSASN_CODE global_enb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(enb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_enb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(enb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void global_enb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMNIdentity", plmn_id.to_string()); + j.write_fieldname("eNB-ID"); + enb_id.to_json(j); + j.end_obj(); +} + +// GNB-ID ::= CHOICE +void gnb_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("gNB-ID", c.to_string()); + j.end_obj(); +} +SRSASN_CODE gnb_id_c::pack(bit_ref& bref) const +{ + pack_enum(bref, type()); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE gnb_id_c::unpack(cbit_ref& bref) +{ + types e; + unpack_enum(e, bref); + if (e != type()) { + log_invalid_choice_id(e, "gnb_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* gnb_id_c::types_opts::to_string() const +{ + static const char* options[] = {"gNB-ID"}; + return convert_enum_idx(options, 1, value, "gnb_id_c::types"); +} + +// GlobalGNB-ID ::= SEQUENCE +SRSASN_CODE global_gnb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(gnb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_gnb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(gnb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void global_gnb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMNIdentity", plmn_id.to_string()); + j.write_fieldname("gNB-ID"); + gnb_id.to_json(j); + j.end_obj(); +} + +// NgENB-ID ::= CHOICE +void ng_enb_id_c::destroy_() +{ + switch (type_) { + case types::macro_ng_enb_id: + c.destroy >(); + break; + case types::short_macro_ng_enb_id: + c.destroy >(); + break; + case types::long_macro_ng_enb_id: + c.destroy >(); + break; + default: + break; + } +} +void ng_enb_id_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::macro_ng_enb_id: + c.init >(); + break; + case types::short_macro_ng_enb_id: + c.init >(); + break; + case types::long_macro_ng_enb_id: + c.init >(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ng_enb_id_c"); + } +} +ng_enb_id_c::ng_enb_id_c(const ng_enb_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::macro_ng_enb_id: + c.init(other.c.get >()); + break; + case types::short_macro_ng_enb_id: + c.init(other.c.get >()); + break; + case types::long_macro_ng_enb_id: + c.init(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ng_enb_id_c"); + } +} +ng_enb_id_c& ng_enb_id_c::operator=(const ng_enb_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::macro_ng_enb_id: + c.set(other.c.get >()); + break; + case types::short_macro_ng_enb_id: + c.set(other.c.get >()); + break; + case types::long_macro_ng_enb_id: + c.set(other.c.get >()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ng_enb_id_c"); + } + + return *this; +} +fixed_bitstring<20, false, true>& ng_enb_id_c::set_macro_ng_enb_id() +{ + set(types::macro_ng_enb_id); + return c.get >(); +} +fixed_bitstring<18, false, true>& ng_enb_id_c::set_short_macro_ng_enb_id() +{ + set(types::short_macro_ng_enb_id); + return c.get >(); +} +fixed_bitstring<21, false, true>& ng_enb_id_c::set_long_macro_ng_enb_id() +{ + set(types::long_macro_ng_enb_id); + return c.get >(); +} +void ng_enb_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::macro_ng_enb_id: + j.write_str("macroNgENB-ID", c.get >().to_string()); + break; + case types::short_macro_ng_enb_id: + j.write_str("shortMacroNgENB-ID", c.get >().to_string()); + break; + case types::long_macro_ng_enb_id: + j.write_str("longMacroNgENB-ID", c.get >().to_string()); + break; + default: + log_invalid_choice_id(type_, "ng_enb_id_c"); + } + j.end_obj(); +} +SRSASN_CODE ng_enb_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::macro_ng_enb_id: + HANDLE_CODE((c.get >().pack(bref))); + break; + case types::short_macro_ng_enb_id: + HANDLE_CODE((c.get >().pack(bref))); + break; + case types::long_macro_ng_enb_id: + HANDLE_CODE((c.get >().pack(bref))); + break; + default: + log_invalid_choice_id(type_, "ng_enb_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ng_enb_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::macro_ng_enb_id: + HANDLE_CODE((c.get >().unpack(bref))); + break; + case types::short_macro_ng_enb_id: + HANDLE_CODE((c.get >().unpack(bref))); + break; + case types::long_macro_ng_enb_id: + HANDLE_CODE((c.get >().unpack(bref))); + break; + default: + log_invalid_choice_id(type_, "ng_enb_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ng_enb_id_c::types_opts::to_string() const +{ + static const char* options[] = {"macroNgENB-ID", "shortMacroNgENB-ID", "longMacroNgENB-ID"}; + return convert_enum_idx(options, 3, value, "ng_enb_id_c::types"); +} + +// GlobalNgENB-ID ::= SEQUENCE +SRSASN_CODE global_ng_enb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(ng_enb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE global_ng_enb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(ng_enb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void global_ng_enb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMNIdentity", plmn_id.to_string()); + j.write_fieldname("ngENB-ID"); + ng_enb_id.to_json(j); + j.end_obj(); +} + +// GlobalRANNodeID ::= CHOICE +void global_ran_node_id_c::destroy_() +{ + switch (type_) { + case types::global_gnb_id: + c.destroy(); + break; + case types::global_ng_enb_id: + c.destroy(); + break; + default: + break; + } +} +void global_ran_node_id_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::global_gnb_id: + c.init(); + break; + case types::global_ng_enb_id: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_ran_node_id_c"); + } +} +global_ran_node_id_c::global_ran_node_id_c(const global_ran_node_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::global_gnb_id: + c.init(other.c.get()); + break; + case types::global_ng_enb_id: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_ran_node_id_c"); + } +} +global_ran_node_id_c& global_ran_node_id_c::operator=(const global_ran_node_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::global_gnb_id: + c.set(other.c.get()); + break; + case types::global_ng_enb_id: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "global_ran_node_id_c"); + } + + return *this; +} +global_gnb_id_s& global_ran_node_id_c::set_global_gnb_id() +{ + set(types::global_gnb_id); + return c.get(); +} +global_ng_enb_id_s& global_ran_node_id_c::set_global_ng_enb_id() +{ + set(types::global_ng_enb_id); + return c.get(); +} +void global_ran_node_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::global_gnb_id: + j.write_fieldname("globalGNB-ID"); + c.get().to_json(j); + break; + case types::global_ng_enb_id: + j.write_fieldname("globalNgENB-ID"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "global_ran_node_id_c"); + } + j.end_obj(); +} +SRSASN_CODE global_ran_node_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::global_gnb_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::global_ng_enb_id: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "global_ran_node_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE global_ran_node_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::global_gnb_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::global_ng_enb_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "global_ran_node_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* global_ran_node_id_c::types_opts::to_string() const +{ + static const char* options[] = {"globalGNB-ID", "globalNgENB-ID"}; + return convert_enum_idx(options, 2, value, "global_ran_node_id_c::types"); +} + +// EN-GNB-ID ::= CHOICE +void en_gnb_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("en-gNB-ID", c.to_string()); + j.end_obj(); +} +SRSASN_CODE en_gnb_id_c::pack(bit_ref& bref) const +{ + pack_enum(bref, type()); + HANDLE_CODE(c.pack(bref)); + return SRSASN_SUCCESS; +} +SRSASN_CODE en_gnb_id_c::unpack(cbit_ref& bref) +{ + types e; + unpack_enum(e, bref); + if (e != type()) { + log_invalid_choice_id(e, "en_gnb_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + HANDLE_CODE(c.unpack(bref)); + return SRSASN_SUCCESS; +} + +const char* en_gnb_id_c::types_opts::to_string() const +{ + static const char* options[] = {"en-gNB-ID"}; + return convert_enum_idx(options, 1, value, "en_gnb_id_c::types"); +} + +// GlobalenGNB-ID ::= SEQUENCE +SRSASN_CODE globalen_gnb_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(plmn_id.pack(bref)); + HANDLE_CODE(en_g_nb_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE globalen_gnb_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(plmn_id.unpack(bref)); + HANDLE_CODE(en_g_nb_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void globalen_gnb_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("pLMN-Identity", plmn_id.to_string()); + j.write_fieldname("en-gNB-ID"); + en_g_nb_id.to_json(j); + j.end_obj(); +} + +// GroupID ::= CHOICE +void group_id_c::destroy_() {} +void group_id_c::set(types::options e) +{ + destroy_(); + type_ = e; +} +group_id_c::group_id_c(const group_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::five_gc: + c.init(other.c.get()); + break; + case types::epc: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "group_id_c"); + } +} +group_id_c& group_id_c::operator=(const group_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::five_gc: + c.set(other.c.get()); + break; + case types::epc: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "group_id_c"); + } + + return *this; +} +uint16_t& group_id_c::set_five_gc() +{ + set(types::five_gc); + return c.get(); +} +uint16_t& group_id_c::set_epc() +{ + set(types::epc); + return c.get(); +} +void group_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::five_gc: + j.write_int("fiveGC", c.get()); + break; + case types::epc: + j.write_int("ePC", c.get()); + break; + default: + log_invalid_choice_id(type_, "group_id_c"); + } + j.end_obj(); +} +SRSASN_CODE group_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::five_gc: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::epc: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, false, true)); + break; + default: + log_invalid_choice_id(type_, "group_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE group_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::five_gc: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::epc: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, false, true)); + break; + default: + log_invalid_choice_id(type_, "group_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* group_id_c::types_opts::to_string() const +{ + static const char* options[] = {"fiveGC", "ePC"}; + return convert_enum_idx(options, 2, value, "group_id_c::types"); +} +uint8_t group_id_c::types_opts::to_number() const +{ + static const uint8_t options[] = {5}; + return map_enum_number(options, 1, value, "group_id_c::types"); +} + +// InterfaceID-E1 ::= SEQUENCE +SRSASN_CODE interface_id_e1_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(global_ng_ran_id.pack(bref)); + HANDLE_CODE(pack_integer(bref, gnb_cu_up_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_e1_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(global_ng_ran_id.unpack(bref)); + HANDLE_CODE(unpack_integer(gnb_cu_up_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +void interface_id_e1_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-NG-RAN-ID"); + global_ng_ran_id.to_json(j); + j.write_int("gNB-CU-UP-ID", gnb_cu_up_id); + j.end_obj(); +} + +// InterfaceID-F1 ::= SEQUENCE +SRSASN_CODE interface_id_f1_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(global_ng_ran_id.pack(bref)); + HANDLE_CODE(pack_integer(bref, gnb_du_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_f1_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(global_ng_ran_id.unpack(bref)); + HANDLE_CODE(unpack_integer(gnb_du_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +void interface_id_f1_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-NG-RAN-ID"); + global_ng_ran_id.to_json(j); + j.write_int("gNB-DU-ID", gnb_du_id); + j.end_obj(); +} + +// InterfaceID-NG ::= SEQUENCE +SRSASN_CODE interface_id_ng_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(guami.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_ng_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(guami.unpack(bref)); + + return SRSASN_SUCCESS; +} +void interface_id_ng_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("guami"); + guami.to_json(j); + j.end_obj(); +} + +// InterfaceID-S1 ::= SEQUENCE +SRSASN_CODE interface_id_s1_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(gummei.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_s1_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(gummei.unpack(bref)); + + return SRSASN_SUCCESS; +} +void interface_id_s1_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("gUMMEI"); + gummei.to_json(j); + j.end_obj(); +} + +// InterfaceID-W1 ::= SEQUENCE +SRSASN_CODE interface_id_w1_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(global_ng_enb_id.pack(bref)); + HANDLE_CODE(pack_integer(bref, ng_enb_du_id, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_w1_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(global_ng_enb_id.unpack(bref)); + HANDLE_CODE(unpack_integer(ng_enb_du_id, bref, (uint64_t)0u, (uint64_t)68719476735u, false, true)); + + return SRSASN_SUCCESS; +} +void interface_id_w1_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-ng-eNB-ID"); + global_ng_enb_id.to_json(j); + j.write_int("ng-eNB-DU-ID", ng_enb_du_id); + j.end_obj(); +} + +// InterfaceID-X2 ::= SEQUENCE +SRSASN_CODE interface_id_x2_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(node_type.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_x2_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(node_type.unpack(bref)); + + return SRSASN_SUCCESS; +} +void interface_id_x2_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("nodeType"); + node_type.to_json(j); + j.end_obj(); +} + +void interface_id_x2_s::node_type_c_::destroy_() +{ + switch (type_) { + case types::global_enb_id: + c.destroy(); + break; + case types::global_en_g_nb_id: + c.destroy(); + break; + default: + break; + } +} +void interface_id_x2_s::node_type_c_::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::global_enb_id: + c.init(); + break; + case types::global_en_g_nb_id: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "interface_id_x2_s::node_type_c_"); + } +} +interface_id_x2_s::node_type_c_::node_type_c_(const interface_id_x2_s::node_type_c_& other) +{ + type_ = other.type(); + switch (type_) { + case types::global_enb_id: + c.init(other.c.get()); + break; + case types::global_en_g_nb_id: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "interface_id_x2_s::node_type_c_"); + } +} +interface_id_x2_s::node_type_c_& +interface_id_x2_s::node_type_c_::operator=(const interface_id_x2_s::node_type_c_& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::global_enb_id: + c.set(other.c.get()); + break; + case types::global_en_g_nb_id: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "interface_id_x2_s::node_type_c_"); + } + + return *this; +} +global_enb_id_s& interface_id_x2_s::node_type_c_::set_global_enb_id() +{ + set(types::global_enb_id); + return c.get(); +} +globalen_gnb_id_s& interface_id_x2_s::node_type_c_::set_global_en_g_nb_id() +{ + set(types::global_en_g_nb_id); + return c.get(); +} +void interface_id_x2_s::node_type_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::global_enb_id: + j.write_fieldname("global-eNB-ID"); + c.get().to_json(j); + break; + case types::global_en_g_nb_id: + j.write_fieldname("global-en-gNB-ID"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "interface_id_x2_s::node_type_c_"); + } + j.end_obj(); +} +SRSASN_CODE interface_id_x2_s::node_type_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::global_enb_id: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::global_en_g_nb_id: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "interface_id_x2_s::node_type_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_x2_s::node_type_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::global_enb_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::global_en_g_nb_id: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "interface_id_x2_s::node_type_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* interface_id_x2_s::node_type_c_::types_opts::to_string() const +{ + static const char* options[] = {"global-eNB-ID", "global-en-gNB-ID"}; + return convert_enum_idx(options, 2, value, "interface_id_x2_s::node_type_c_::types"); +} + +// InterfaceID-Xn ::= SEQUENCE +SRSASN_CODE interface_id_xn_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(global_ng_ran_id.pack(bref)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_xn_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(global_ng_ran_id.unpack(bref)); + + return SRSASN_SUCCESS; +} +void interface_id_xn_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("global-NG-RAN-ID"); + global_ng_ran_id.to_json(j); + j.end_obj(); +} + +// InterfaceIdentifier ::= CHOICE +void interface_id_c::destroy_() +{ + switch (type_) { + case types::ng: + c.destroy(); + break; + case types::xn: + c.destroy(); + break; + case types::f1: + c.destroy(); + break; + case types::e1: + c.destroy(); + break; + case types::s1: + c.destroy(); + break; + case types::x2: + c.destroy(); + break; + case types::w1: + c.destroy(); + break; + default: + break; + } +} +void interface_id_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::ng: + c.init(); + break; + case types::xn: + c.init(); + break; + case types::f1: + c.init(); + break; + case types::e1: + c.init(); + break; + case types::s1: + c.init(); + break; + case types::x2: + c.init(); + break; + case types::w1: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "interface_id_c"); + } +} +interface_id_c::interface_id_c(const interface_id_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::ng: + c.init(other.c.get()); + break; + case types::xn: + c.init(other.c.get()); + break; + case types::f1: + c.init(other.c.get()); + break; + case types::e1: + c.init(other.c.get()); + break; + case types::s1: + c.init(other.c.get()); + break; + case types::x2: + c.init(other.c.get()); + break; + case types::w1: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "interface_id_c"); + } +} +interface_id_c& interface_id_c::operator=(const interface_id_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::ng: + c.set(other.c.get()); + break; + case types::xn: + c.set(other.c.get()); + break; + case types::f1: + c.set(other.c.get()); + break; + case types::e1: + c.set(other.c.get()); + break; + case types::s1: + c.set(other.c.get()); + break; + case types::x2: + c.set(other.c.get()); + break; + case types::w1: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "interface_id_c"); + } + + return *this; +} +interface_id_ng_s& interface_id_c::set_ng() +{ + set(types::ng); + return c.get(); +} +interface_id_xn_s& interface_id_c::set_xn() +{ + set(types::xn); + return c.get(); +} +interface_id_f1_s& interface_id_c::set_f1() +{ + set(types::f1); + return c.get(); +} +interface_id_e1_s& interface_id_c::set_e1() +{ + set(types::e1); + return c.get(); +} +interface_id_s1_s& interface_id_c::set_s1() +{ + set(types::s1); + return c.get(); +} +interface_id_x2_s& interface_id_c::set_x2() +{ + set(types::x2); + return c.get(); +} +interface_id_w1_s& interface_id_c::set_w1() +{ + set(types::w1); + return c.get(); +} +void interface_id_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::ng: + j.write_fieldname("nG"); + c.get().to_json(j); + break; + case types::xn: + j.write_fieldname("xN"); + c.get().to_json(j); + break; + case types::f1: + j.write_fieldname("f1"); + c.get().to_json(j); + break; + case types::e1: + j.write_fieldname("e1"); + c.get().to_json(j); + break; + case types::s1: + j.write_fieldname("s1"); + c.get().to_json(j); + break; + case types::x2: + j.write_fieldname("x2"); + c.get().to_json(j); + break; + case types::w1: + j.write_fieldname("w1"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "interface_id_c"); + } + j.end_obj(); +} +SRSASN_CODE interface_id_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::ng: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::xn: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::f1: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::e1: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::s1: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::x2: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::w1: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "interface_id_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE interface_id_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::ng: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::xn: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::f1: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::e1: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::s1: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::x2: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::w1: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "interface_id_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* interface_id_c::types_opts::to_string() const +{ + static const char* options[] = {"nG", "xN", "f1", "e1", "s1", "x2", "w1"}; + return convert_enum_idx(options, 7, value, "interface_id_c::types"); +} + +// FreqBandNrItem ::= SEQUENCE +SRSASN_CODE freq_band_nr_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, freq_band_ind_nr, (uint16_t)1u, (uint16_t)1024u, true, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE freq_band_nr_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(freq_band_ind_nr, bref, (uint16_t)1u, (uint16_t)1024u, true, true)); + + return SRSASN_SUCCESS; +} +void freq_band_nr_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("freqBandIndicatorNr", freq_band_ind_nr); + j.end_obj(); +} + +// NR-ARFCN ::= SEQUENCE +SRSASN_CODE nr_arfcn_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, nrarfcn, (uint32_t)0u, (uint32_t)3279165u, false, true)); + HANDLE_CODE(pack_dyn_seq_of(bref, freq_band_list_nr, 1, 32, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE nr_arfcn_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(nrarfcn, bref, (uint32_t)0u, (uint32_t)3279165u, false, true)); + HANDLE_CODE(unpack_dyn_seq_of(freq_band_list_nr, bref, 1, 32, true)); + + return SRSASN_SUCCESS; +} +void nr_arfcn_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("nRARFCN", nrarfcn); + j.start_array("freqBandListNr"); + for (const auto& e1 : freq_band_list_nr) { + e1.to_json(j); + } + j.end_array(); + j.end_obj(); +} + +// QoSID ::= CHOICE +void qo_sid_c::destroy_() {} +void qo_sid_c::set(types::options e) +{ + destroy_(); + type_ = e; +} +qo_sid_c::qo_sid_c(const qo_sid_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::five_gc: + c.init(other.c.get()); + break; + case types::epc: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "qo_sid_c"); + } +} +qo_sid_c& qo_sid_c::operator=(const qo_sid_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::five_gc: + c.set(other.c.get()); + break; + case types::epc: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "qo_sid_c"); + } + + return *this; +} +uint16_t& qo_sid_c::set_five_gc() +{ + set(types::five_gc); + return c.get(); +} +uint16_t& qo_sid_c::set_epc() +{ + set(types::epc); + return c.get(); +} +void qo_sid_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::five_gc: + j.write_int("fiveGC", c.get()); + break; + case types::epc: + j.write_int("ePC", c.get()); + break; + default: + log_invalid_choice_id(type_, "qo_sid_c"); + } + j.end_obj(); +} +SRSASN_CODE qo_sid_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::five_gc: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::epc: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)255u, false, true)); + break; + default: + log_invalid_choice_id(type_, "qo_sid_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE qo_sid_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::five_gc: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, true, true)); + break; + case types::epc: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)255u, false, true)); + break; + default: + log_invalid_choice_id(type_, "qo_sid_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* qo_sid_c::types_opts::to_string() const +{ + static const char* options[] = {"fiveGC", "ePC"}; + return convert_enum_idx(options, 2, value, "qo_sid_c::types"); +} +uint8_t qo_sid_c::types_opts::to_number() const +{ + static const uint8_t options[] = {5}; + return map_enum_number(options, 1, value, "qo_sid_c::types"); +} + +// RRCclass-LTE ::= ENUMERATED +const char* rr_cclass_lte_opts::to_string() const +{ + static const char* options[] = {"bCCH-BCH", + "bCCH-BCH-MBMS", + "bCCH-DL-SCH", + "bCCH-DL-SCH-BR", + "bCCH-DL-SCH-MBMS", + "mCCH", + "pCCH", + "dL-CCCH", + "dL-DCCH", + "uL-CCCH", + "uL-DCCH", + "sC-MCCH"}; + return convert_enum_idx(options, 12, value, "rr_cclass_lte_e"); +} + +// RRCclass-NR ::= ENUMERATED +const char* rr_cclass_nr_opts::to_string() const +{ + static const char* options[] = { + "bCCH-BCH", "bCCH-DL-SCH", "dL-CCCH", "dL-DCCH", "pCCH", "uL-CCCH", "uL-CCCH1", "uL-DCCH"}; + return convert_enum_idx(options, 8, value, "rr_cclass_nr_e"); +} +uint8_t rr_cclass_nr_opts::to_number() const +{ + if (value == ul_ccch1) { + return 1; + } + invalid_enum_number(value, "rr_cclass_nr_e"); + return 0; +} + +// RRC-MessageID ::= SEQUENCE +SRSASN_CODE rrc_msg_id_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(rrc_type.pack(bref)); + HANDLE_CODE(pack_unconstrained_integer(bref, msg_id, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_msg_id_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(rrc_type.unpack(bref)); + HANDLE_CODE(unpack_unconstrained_integer(msg_id, bref, false, true)); + + return SRSASN_SUCCESS; +} +void rrc_msg_id_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_fieldname("rrcType"); + rrc_type.to_json(j); + j.write_int("messageID", msg_id); + j.end_obj(); +} + +void rrc_msg_id_s::rrc_type_c_::destroy_() {} +void rrc_msg_id_s::rrc_type_c_::set(types::options e) +{ + destroy_(); + type_ = e; +} +rrc_msg_id_s::rrc_type_c_::rrc_type_c_(const rrc_msg_id_s::rrc_type_c_& other) +{ + type_ = other.type(); + switch (type_) { + case types::lte: + c.init(other.c.get()); + break; + case types::nr: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "rrc_msg_id_s::rrc_type_c_"); + } +} +rrc_msg_id_s::rrc_type_c_& rrc_msg_id_s::rrc_type_c_::operator=(const rrc_msg_id_s::rrc_type_c_& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::lte: + c.set(other.c.get()); + break; + case types::nr: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "rrc_msg_id_s::rrc_type_c_"); + } + + return *this; +} +rr_cclass_lte_e& rrc_msg_id_s::rrc_type_c_::set_lte() +{ + set(types::lte); + return c.get(); +} +rr_cclass_nr_e& rrc_msg_id_s::rrc_type_c_::set_nr() +{ + set(types::nr); + return c.get(); +} +void rrc_msg_id_s::rrc_type_c_::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::lte: + j.write_str("lTE", c.get().to_string()); + break; + case types::nr: + j.write_str("nR", c.get().to_string()); + break; + default: + log_invalid_choice_id(type_, "rrc_msg_id_s::rrc_type_c_"); + } + j.end_obj(); +} +SRSASN_CODE rrc_msg_id_s::rrc_type_c_::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::lte: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::nr: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "rrc_msg_id_s::rrc_type_c_"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE rrc_msg_id_s::rrc_type_c_::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::lte: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::nr: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "rrc_msg_id_s::rrc_type_c_"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* rrc_msg_id_s::rrc_type_c_::types_opts::to_string() const +{ + static const char* options[] = {"lTE", "nR"}; + return convert_enum_idx(options, 2, value, "rrc_msg_id_s::rrc_type_c_::types"); +} + +// S-NSSAI ::= SEQUENCE +SRSASN_CODE s_nssai_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(sd_present, 1)); + + HANDLE_CODE(sst.pack(bref)); + if (sd_present) { + HANDLE_CODE(sd.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE s_nssai_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(sd_present, 1)); + + HANDLE_CODE(sst.unpack(bref)); + if (sd_present) { + HANDLE_CODE(sd.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void s_nssai_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_str("sST", sst.to_string()); + if (sd_present) { + j.write_str("sD", sd.to_string()); + } + j.end_obj(); +} + +// ServingCell-ARFCN ::= CHOICE +void serving_cell_arfcn_c::destroy_() +{ + switch (type_) { + case types::nr: + c.destroy(); + break; + default: + break; + } +} +void serving_cell_arfcn_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::nr: + c.init(); + break; + case types::eutra: + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "serving_cell_arfcn_c"); + } +} +serving_cell_arfcn_c::serving_cell_arfcn_c(const serving_cell_arfcn_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::nr: + c.init(other.c.get()); + break; + case types::eutra: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "serving_cell_arfcn_c"); + } +} +serving_cell_arfcn_c& serving_cell_arfcn_c::operator=(const serving_cell_arfcn_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::nr: + c.set(other.c.get()); + break; + case types::eutra: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "serving_cell_arfcn_c"); + } + + return *this; +} +nr_arfcn_s& serving_cell_arfcn_c::set_nr() +{ + set(types::nr); + return c.get(); +} +uint32_t& serving_cell_arfcn_c::set_eutra() +{ + set(types::eutra); + return c.get(); +} +void serving_cell_arfcn_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::nr: + j.write_fieldname("nR"); + c.get().to_json(j); + break; + case types::eutra: + j.write_int("eUTRA", c.get()); + break; + default: + log_invalid_choice_id(type_, "serving_cell_arfcn_c"); + } + j.end_obj(); +} +SRSASN_CODE serving_cell_arfcn_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::nr: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::eutra: + HANDLE_CODE(pack_integer(bref, c.get(), (uint32_t)0u, (uint32_t)65535u, false, true)); + break; + default: + log_invalid_choice_id(type_, "serving_cell_arfcn_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE serving_cell_arfcn_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::nr: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::eutra: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint32_t)0u, (uint32_t)65535u, false, true)); + break; + default: + log_invalid_choice_id(type_, "serving_cell_arfcn_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* serving_cell_arfcn_c::types_opts::to_string() const +{ + static const char* options[] = {"nR", "eUTRA"}; + return convert_enum_idx(options, 2, value, "serving_cell_arfcn_c::types"); +} + +// ServingCell-PCI ::= CHOICE +void serving_cell_pci_c::destroy_() {} +void serving_cell_pci_c::set(types::options e) +{ + destroy_(); + type_ = e; +} +serving_cell_pci_c::serving_cell_pci_c(const serving_cell_pci_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::nr: + c.init(other.c.get()); + break; + case types::eutra: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "serving_cell_pci_c"); + } +} +serving_cell_pci_c& serving_cell_pci_c::operator=(const serving_cell_pci_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::nr: + c.set(other.c.get()); + break; + case types::eutra: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "serving_cell_pci_c"); + } + + return *this; +} +uint16_t& serving_cell_pci_c::set_nr() +{ + set(types::nr); + return c.get(); +} +uint16_t& serving_cell_pci_c::set_eutra() +{ + set(types::eutra); + return c.get(); +} +void serving_cell_pci_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::nr: + j.write_int("nR", c.get()); + break; + case types::eutra: + j.write_int("eUTRA", c.get()); + break; + default: + log_invalid_choice_id(type_, "serving_cell_pci_c"); + } + j.end_obj(); +} +SRSASN_CODE serving_cell_pci_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::nr: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)1007u, false, true)); + break; + case types::eutra: + HANDLE_CODE(pack_integer(bref, c.get(), (uint16_t)0u, (uint16_t)503u, true, true)); + break; + default: + log_invalid_choice_id(type_, "serving_cell_pci_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE serving_cell_pci_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::nr: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)1007u, false, true)); + break; + case types::eutra: + HANDLE_CODE(unpack_integer(c.get(), bref, (uint16_t)0u, (uint16_t)503u, true, true)); + break; + default: + log_invalid_choice_id(type_, "serving_cell_pci_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* serving_cell_pci_c::types_opts::to_string() const +{ + static const char* options[] = {"nR", "eUTRA"}; + return convert_enum_idx(options, 2, value, "serving_cell_pci_c::types"); +} + +// UEID-GNB-CU-CP-E1AP-ID-Item ::= SEQUENCE +SRSASN_CODE ueid_gnb_cu_cp_e1_ap_id_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, gnb_cu_cp_ue_e1_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_gnb_cu_cp_e1_ap_id_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(gnb_cu_cp_ue_e1_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + + return SRSASN_SUCCESS; +} +void ueid_gnb_cu_cp_e1_ap_id_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("gNB-CU-CP-UE-E1AP-ID", gnb_cu_cp_ue_e1_ap_id); + j.end_obj(); +} + +// UEID-GNB-CU-CP-F1AP-ID-Item ::= SEQUENCE +SRSASN_CODE ueid_gnb_cu_cp_f1_ap_id_item_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, gnb_cu_ue_f1_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_gnb_cu_cp_f1_ap_id_item_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(gnb_cu_ue_f1_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + + return SRSASN_SUCCESS; +} +void ueid_gnb_cu_cp_f1_ap_id_item_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("gNB-CU-UE-F1AP-ID", gnb_cu_ue_f1_ap_id); + j.end_obj(); +} + +// UEID-EN-GNB ::= SEQUENCE +SRSASN_CODE ueid_en_gnb_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(m_enb_ue_x2ap_id_ext_present, 1)); + HANDLE_CODE(bref.pack(gnb_cu_ue_f1_ap_id_present, 1)); + HANDLE_CODE(bref.pack(gnb_cu_cp_ue_e1_ap_id_list.size() > 0, 1)); + HANDLE_CODE(bref.pack(ran_ueid_present, 1)); + + HANDLE_CODE(pack_integer(bref, m_enb_ue_x2ap_id, (uint16_t)0u, (uint16_t)4095u, false, true)); + if (m_enb_ue_x2ap_id_ext_present) { + HANDLE_CODE(pack_integer(bref, m_enb_ue_x2ap_id_ext, (uint16_t)0u, (uint16_t)4095u, true, true)); + } + HANDLE_CODE(global_enb_id.pack(bref)); + if (gnb_cu_ue_f1_ap_id_present) { + HANDLE_CODE(pack_integer(bref, gnb_cu_ue_f1_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + } + if (gnb_cu_cp_ue_e1_ap_id_list.size() > 0) { + HANDLE_CODE(pack_dyn_seq_of(bref, gnb_cu_cp_ue_e1_ap_id_list, 1, 65535, true)); + } + if (ran_ueid_present) { + HANDLE_CODE(ran_ueid.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_en_gnb_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(m_enb_ue_x2ap_id_ext_present, 1)); + HANDLE_CODE(bref.unpack(gnb_cu_ue_f1_ap_id_present, 1)); + bool gnb_cu_cp_ue_e1_ap_id_list_present; + HANDLE_CODE(bref.unpack(gnb_cu_cp_ue_e1_ap_id_list_present, 1)); + HANDLE_CODE(bref.unpack(ran_ueid_present, 1)); + + HANDLE_CODE(unpack_integer(m_enb_ue_x2ap_id, bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + if (m_enb_ue_x2ap_id_ext_present) { + HANDLE_CODE(unpack_integer(m_enb_ue_x2ap_id_ext, bref, (uint16_t)0u, (uint16_t)4095u, true, true)); + } + HANDLE_CODE(global_enb_id.unpack(bref)); + if (gnb_cu_ue_f1_ap_id_present) { + HANDLE_CODE(unpack_integer(gnb_cu_ue_f1_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + } + if (gnb_cu_cp_ue_e1_ap_id_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(gnb_cu_cp_ue_e1_ap_id_list, bref, 1, 65535, true)); + } + if (ran_ueid_present) { + HANDLE_CODE(ran_ueid.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ueid_en_gnb_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("m-eNB-UE-X2AP-ID", m_enb_ue_x2ap_id); + if (m_enb_ue_x2ap_id_ext_present) { + j.write_int("m-eNB-UE-X2AP-ID-Extension", m_enb_ue_x2ap_id_ext); + } + j.write_fieldname("globalENB-ID"); + global_enb_id.to_json(j); + if (gnb_cu_ue_f1_ap_id_present) { + j.write_int("gNB-CU-UE-F1AP-ID", gnb_cu_ue_f1_ap_id); + } + if (gnb_cu_cp_ue_e1_ap_id_list.size() > 0) { + j.start_array("gNB-CU-CP-UE-E1AP-ID-List"); + for (const auto& e1 : gnb_cu_cp_ue_e1_ap_id_list) { + e1.to_json(j); + } + j.end_array(); + } + if (ran_ueid_present) { + j.write_str("ran-UEID", ran_ueid.to_string()); + } + j.end_obj(); +} + +// UEID-ENB ::= SEQUENCE +SRSASN_CODE ueid_enb_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(m_enb_ue_x2ap_id_present, 1)); + HANDLE_CODE(bref.pack(m_enb_ue_x2ap_id_ext_present, 1)); + HANDLE_CODE(bref.pack(global_enb_id_present, 1)); + + HANDLE_CODE(pack_integer(bref, mme_ue_s1ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + HANDLE_CODE(gummei.pack(bref)); + if (m_enb_ue_x2ap_id_present) { + HANDLE_CODE(pack_integer(bref, m_enb_ue_x2ap_id, (uint16_t)0u, (uint16_t)4095u, false, true)); + } + if (m_enb_ue_x2ap_id_ext_present) { + HANDLE_CODE(pack_integer(bref, m_enb_ue_x2ap_id_ext, (uint16_t)0u, (uint16_t)4095u, true, true)); + } + if (global_enb_id_present) { + HANDLE_CODE(global_enb_id.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_enb_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(m_enb_ue_x2ap_id_present, 1)); + HANDLE_CODE(bref.unpack(m_enb_ue_x2ap_id_ext_present, 1)); + HANDLE_CODE(bref.unpack(global_enb_id_present, 1)); + + HANDLE_CODE(unpack_integer(mme_ue_s1ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + HANDLE_CODE(gummei.unpack(bref)); + if (m_enb_ue_x2ap_id_present) { + HANDLE_CODE(unpack_integer(m_enb_ue_x2ap_id, bref, (uint16_t)0u, (uint16_t)4095u, false, true)); + } + if (m_enb_ue_x2ap_id_ext_present) { + HANDLE_CODE(unpack_integer(m_enb_ue_x2ap_id_ext, bref, (uint16_t)0u, (uint16_t)4095u, true, true)); + } + if (global_enb_id_present) { + HANDLE_CODE(global_enb_id.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ueid_enb_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("mME-UE-S1AP-ID", mme_ue_s1ap_id); + j.write_fieldname("gUMMEI"); + gummei.to_json(j); + if (m_enb_ue_x2ap_id_present) { + j.write_int("m-eNB-UE-X2AP-ID", m_enb_ue_x2ap_id); + } + if (m_enb_ue_x2ap_id_ext_present) { + j.write_int("m-eNB-UE-X2AP-ID-Extension", m_enb_ue_x2ap_id_ext); + } + if (global_enb_id_present) { + j.write_fieldname("globalENB-ID"); + global_enb_id.to_json(j); + } + j.end_obj(); +} + +// UEID-GNB ::= SEQUENCE +SRSASN_CODE ueid_gnb_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(gnb_cu_ue_f1_ap_id_list.size() > 0, 1)); + HANDLE_CODE(bref.pack(gnb_cu_cp_ue_e1_ap_id_list.size() > 0, 1)); + HANDLE_CODE(bref.pack(ran_ueid_present, 1)); + HANDLE_CODE(bref.pack(m_ng_ran_ue_xn_ap_id_present, 1)); + HANDLE_CODE(bref.pack(global_gnb_id_present, 1)); + + HANDLE_CODE(pack_integer(bref, amf_ue_ngap_id, (uint64_t)0u, (uint64_t)1099511627775u, false, true)); + HANDLE_CODE(guami.pack(bref)); + if (gnb_cu_ue_f1_ap_id_list.size() > 0) { + HANDLE_CODE(pack_dyn_seq_of(bref, gnb_cu_ue_f1_ap_id_list, 1, 4, true)); + } + if (gnb_cu_cp_ue_e1_ap_id_list.size() > 0) { + HANDLE_CODE(pack_dyn_seq_of(bref, gnb_cu_cp_ue_e1_ap_id_list, 1, 65535, true)); + } + if (ran_ueid_present) { + HANDLE_CODE(ran_ueid.pack(bref)); + } + if (m_ng_ran_ue_xn_ap_id_present) { + HANDLE_CODE(pack_integer(bref, m_ng_ran_ue_xn_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + } + if (global_gnb_id_present) { + HANDLE_CODE(global_gnb_id.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_gnb_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + bool gnb_cu_ue_f1_ap_id_list_present; + HANDLE_CODE(bref.unpack(gnb_cu_ue_f1_ap_id_list_present, 1)); + bool gnb_cu_cp_ue_e1_ap_id_list_present; + HANDLE_CODE(bref.unpack(gnb_cu_cp_ue_e1_ap_id_list_present, 1)); + HANDLE_CODE(bref.unpack(ran_ueid_present, 1)); + HANDLE_CODE(bref.unpack(m_ng_ran_ue_xn_ap_id_present, 1)); + HANDLE_CODE(bref.unpack(global_gnb_id_present, 1)); + + HANDLE_CODE(unpack_integer(amf_ue_ngap_id, bref, (uint64_t)0u, (uint64_t)1099511627775u, false, true)); + HANDLE_CODE(guami.unpack(bref)); + if (gnb_cu_ue_f1_ap_id_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(gnb_cu_ue_f1_ap_id_list, bref, 1, 4, true)); + } + if (gnb_cu_cp_ue_e1_ap_id_list_present) { + HANDLE_CODE(unpack_dyn_seq_of(gnb_cu_cp_ue_e1_ap_id_list, bref, 1, 65535, true)); + } + if (ran_ueid_present) { + HANDLE_CODE(ran_ueid.unpack(bref)); + } + if (m_ng_ran_ue_xn_ap_id_present) { + HANDLE_CODE(unpack_integer(m_ng_ran_ue_xn_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + } + if (global_gnb_id_present) { + HANDLE_CODE(global_gnb_id.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ueid_gnb_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("amf-UE-NGAP-ID", amf_ue_ngap_id); + j.write_fieldname("guami"); + guami.to_json(j); + if (gnb_cu_ue_f1_ap_id_list.size() > 0) { + j.start_array("gNB-CU-UE-F1AP-ID-List"); + for (const auto& e1 : gnb_cu_ue_f1_ap_id_list) { + e1.to_json(j); + } + j.end_array(); + } + if (gnb_cu_cp_ue_e1_ap_id_list.size() > 0) { + j.start_array("gNB-CU-CP-UE-E1AP-ID-List"); + for (const auto& e1 : gnb_cu_cp_ue_e1_ap_id_list) { + e1.to_json(j); + } + j.end_array(); + } + if (ran_ueid_present) { + j.write_str("ran-UEID", ran_ueid.to_string()); + } + if (m_ng_ran_ue_xn_ap_id_present) { + j.write_int("m-NG-RAN-UE-XnAP-ID", m_ng_ran_ue_xn_ap_id); + } + if (global_gnb_id_present) { + j.write_fieldname("globalGNB-ID"); + global_gnb_id.to_json(j); + } + j.end_obj(); +} + +// UEID-GNB-CU-UP ::= SEQUENCE +SRSASN_CODE ueid_gnb_cu_up_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(ran_ueid_present, 1)); + + HANDLE_CODE(pack_integer(bref, gnb_cu_cp_ue_e1_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + if (ran_ueid_present) { + HANDLE_CODE(ran_ueid.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_gnb_cu_up_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(ran_ueid_present, 1)); + + HANDLE_CODE(unpack_integer(gnb_cu_cp_ue_e1_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + if (ran_ueid_present) { + HANDLE_CODE(ran_ueid.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ueid_gnb_cu_up_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("gNB-CU-CP-UE-E1AP-ID", gnb_cu_cp_ue_e1_ap_id); + if (ran_ueid_present) { + j.write_str("ran-UEID", ran_ueid.to_string()); + } + j.end_obj(); +} + +// UEID-GNB-DU ::= SEQUENCE +SRSASN_CODE ueid_gnb_du_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(ran_ueid_present, 1)); + + HANDLE_CODE(pack_integer(bref, gnb_cu_ue_f1_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + if (ran_ueid_present) { + HANDLE_CODE(ran_ueid.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_gnb_du_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(ran_ueid_present, 1)); + + HANDLE_CODE(unpack_integer(gnb_cu_ue_f1_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + if (ran_ueid_present) { + HANDLE_CODE(ran_ueid.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ueid_gnb_du_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("gNB-CU-UE-F1AP-ID", gnb_cu_ue_f1_ap_id); + if (ran_ueid_present) { + j.write_str("ran-UEID", ran_ueid.to_string()); + } + j.end_obj(); +} + +// UEID-NG-ENB ::= SEQUENCE +SRSASN_CODE ueid_ng_enb_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(bref.pack(ng_enb_cu_ue_w1_ap_id_present, 1)); + HANDLE_CODE(bref.pack(m_ng_ran_ue_xn_ap_id_present, 1)); + HANDLE_CODE(bref.pack(global_ng_enb_id_present, 1)); + + HANDLE_CODE(pack_integer(bref, amf_ue_ngap_id, (uint64_t)0u, (uint64_t)1099511627775u, false, true)); + HANDLE_CODE(guami.pack(bref)); + if (ng_enb_cu_ue_w1_ap_id_present) { + HANDLE_CODE(pack_integer(bref, ng_enb_cu_ue_w1_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + } + if (m_ng_ran_ue_xn_ap_id_present) { + HANDLE_CODE(pack_integer(bref, m_ng_ran_ue_xn_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + } + if (global_ng_enb_id_present) { + HANDLE_CODE(global_ng_enb_id.pack(bref)); + } + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_ng_enb_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(bref.unpack(ng_enb_cu_ue_w1_ap_id_present, 1)); + HANDLE_CODE(bref.unpack(m_ng_ran_ue_xn_ap_id_present, 1)); + HANDLE_CODE(bref.unpack(global_ng_enb_id_present, 1)); + + HANDLE_CODE(unpack_integer(amf_ue_ngap_id, bref, (uint64_t)0u, (uint64_t)1099511627775u, false, true)); + HANDLE_CODE(guami.unpack(bref)); + if (ng_enb_cu_ue_w1_ap_id_present) { + HANDLE_CODE(unpack_integer(ng_enb_cu_ue_w1_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + } + if (m_ng_ran_ue_xn_ap_id_present) { + HANDLE_CODE(unpack_integer(m_ng_ran_ue_xn_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + } + if (global_ng_enb_id_present) { + HANDLE_CODE(global_ng_enb_id.unpack(bref)); + } + + return SRSASN_SUCCESS; +} +void ueid_ng_enb_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("amf-UE-NGAP-ID", amf_ue_ngap_id); + j.write_fieldname("guami"); + guami.to_json(j); + if (ng_enb_cu_ue_w1_ap_id_present) { + j.write_int("ng-eNB-CU-UE-W1AP-ID", ng_enb_cu_ue_w1_ap_id); + } + if (m_ng_ran_ue_xn_ap_id_present) { + j.write_int("m-NG-RAN-UE-XnAP-ID", m_ng_ran_ue_xn_ap_id); + } + if (global_ng_enb_id_present) { + j.write_fieldname("globalNgENB-ID"); + global_ng_enb_id.to_json(j); + } + j.end_obj(); +} + +// UEID-NG-ENB-DU ::= SEQUENCE +SRSASN_CODE ueid_ng_enb_du_s::pack(bit_ref& bref) const +{ + bref.pack(ext, 1); + HANDLE_CODE(pack_integer(bref, ng_enb_cu_ue_w1_ap_id, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_ng_enb_du_s::unpack(cbit_ref& bref) +{ + bref.unpack(ext, 1); + HANDLE_CODE(unpack_integer(ng_enb_cu_ue_w1_ap_id, bref, (uint64_t)0u, (uint64_t)4294967295u, false, true)); + + return SRSASN_SUCCESS; +} +void ueid_ng_enb_du_s::to_json(json_writer& j) const +{ + j.start_obj(); + j.write_int("ng-eNB-CU-UE-W1AP-ID", ng_enb_cu_ue_w1_ap_id); + j.end_obj(); +} + +// UEID ::= CHOICE +void ueid_c::destroy_() +{ + switch (type_) { + case types::gnb_ueid: + c.destroy(); + break; + case types::gnb_du_ueid: + c.destroy(); + break; + case types::gnb_cu_up_ueid: + c.destroy(); + break; + case types::ng_enb_ueid: + c.destroy(); + break; + case types::ng_enb_du_ueid: + c.destroy(); + break; + case types::en_g_nb_ueid: + c.destroy(); + break; + case types::enb_ueid: + c.destroy(); + break; + default: + break; + } +} +void ueid_c::set(types::options e) +{ + destroy_(); + type_ = e; + switch (type_) { + case types::gnb_ueid: + c.init(); + break; + case types::gnb_du_ueid: + c.init(); + break; + case types::gnb_cu_up_ueid: + c.init(); + break; + case types::ng_enb_ueid: + c.init(); + break; + case types::ng_enb_du_ueid: + c.init(); + break; + case types::en_g_nb_ueid: + c.init(); + break; + case types::enb_ueid: + c.init(); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ueid_c"); + } +} +ueid_c::ueid_c(const ueid_c& other) +{ + type_ = other.type(); + switch (type_) { + case types::gnb_ueid: + c.init(other.c.get()); + break; + case types::gnb_du_ueid: + c.init(other.c.get()); + break; + case types::gnb_cu_up_ueid: + c.init(other.c.get()); + break; + case types::ng_enb_ueid: + c.init(other.c.get()); + break; + case types::ng_enb_du_ueid: + c.init(other.c.get()); + break; + case types::en_g_nb_ueid: + c.init(other.c.get()); + break; + case types::enb_ueid: + c.init(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ueid_c"); + } +} +ueid_c& ueid_c::operator=(const ueid_c& other) +{ + if (this == &other) { + return *this; + } + set(other.type()); + switch (type_) { + case types::gnb_ueid: + c.set(other.c.get()); + break; + case types::gnb_du_ueid: + c.set(other.c.get()); + break; + case types::gnb_cu_up_ueid: + c.set(other.c.get()); + break; + case types::ng_enb_ueid: + c.set(other.c.get()); + break; + case types::ng_enb_du_ueid: + c.set(other.c.get()); + break; + case types::en_g_nb_ueid: + c.set(other.c.get()); + break; + case types::enb_ueid: + c.set(other.c.get()); + break; + case types::nulltype: + break; + default: + log_invalid_choice_id(type_, "ueid_c"); + } + + return *this; +} +ueid_gnb_s& ueid_c::set_gnb_ueid() +{ + set(types::gnb_ueid); + return c.get(); +} +ueid_gnb_du_s& ueid_c::set_gnb_du_ueid() +{ + set(types::gnb_du_ueid); + return c.get(); +} +ueid_gnb_cu_up_s& ueid_c::set_gnb_cu_up_ueid() +{ + set(types::gnb_cu_up_ueid); + return c.get(); +} +ueid_ng_enb_s& ueid_c::set_ng_enb_ueid() +{ + set(types::ng_enb_ueid); + return c.get(); +} +ueid_ng_enb_du_s& ueid_c::set_ng_enb_du_ueid() +{ + set(types::ng_enb_du_ueid); + return c.get(); +} +ueid_en_gnb_s& ueid_c::set_en_g_nb_ueid() +{ + set(types::en_g_nb_ueid); + return c.get(); +} +ueid_enb_s& ueid_c::set_enb_ueid() +{ + set(types::enb_ueid); + return c.get(); +} +void ueid_c::to_json(json_writer& j) const +{ + j.start_obj(); + switch (type_) { + case types::gnb_ueid: + j.write_fieldname("gNB-UEID"); + c.get().to_json(j); + break; + case types::gnb_du_ueid: + j.write_fieldname("gNB-DU-UEID"); + c.get().to_json(j); + break; + case types::gnb_cu_up_ueid: + j.write_fieldname("gNB-CU-UP-UEID"); + c.get().to_json(j); + break; + case types::ng_enb_ueid: + j.write_fieldname("ng-eNB-UEID"); + c.get().to_json(j); + break; + case types::ng_enb_du_ueid: + j.write_fieldname("ng-eNB-DU-UEID"); + c.get().to_json(j); + break; + case types::en_g_nb_ueid: + j.write_fieldname("en-gNB-UEID"); + c.get().to_json(j); + break; + case types::enb_ueid: + j.write_fieldname("eNB-UEID"); + c.get().to_json(j); + break; + default: + log_invalid_choice_id(type_, "ueid_c"); + } + j.end_obj(); +} +SRSASN_CODE ueid_c::pack(bit_ref& bref) const +{ + type_.pack(bref); + switch (type_) { + case types::gnb_ueid: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::gnb_du_ueid: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::gnb_cu_up_ueid: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ng_enb_ueid: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::ng_enb_du_ueid: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::en_g_nb_ueid: + HANDLE_CODE(c.get().pack(bref)); + break; + case types::enb_ueid: + HANDLE_CODE(c.get().pack(bref)); + break; + default: + log_invalid_choice_id(type_, "ueid_c"); + return SRSASN_ERROR_ENCODE_FAIL; + } + return SRSASN_SUCCESS; +} +SRSASN_CODE ueid_c::unpack(cbit_ref& bref) +{ + types e; + e.unpack(bref); + set(e); + switch (type_) { + case types::gnb_ueid: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::gnb_du_ueid: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::gnb_cu_up_ueid: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ng_enb_ueid: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::ng_enb_du_ueid: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::en_g_nb_ueid: + HANDLE_CODE(c.get().unpack(bref)); + break; + case types::enb_ueid: + HANDLE_CODE(c.get().unpack(bref)); + break; + default: + log_invalid_choice_id(type_, "ueid_c"); + return SRSASN_ERROR_DECODE_FAIL; + } + return SRSASN_SUCCESS; +} + +const char* ueid_c::types_opts::to_string() const +{ + static const char* options[] = { + "gNB-UEID", "gNB-DU-UEID", "gNB-CU-UP-UEID", "ng-eNB-UEID", "ng-eNB-DU-UEID", "en-gNB-UEID", "eNB-UEID"}; + return convert_enum_idx(options, 7, value, "ueid_c::types"); +} diff --git a/srsenb/hdr/enb.h b/srsenb/hdr/enb.h index 3bc690713..3c42bb44c 100644 --- a/srsenb/hdr/enb.h +++ b/srsenb/hdr/enb.h @@ -33,6 +33,7 @@ #include "srsenb/hdr/stack/mac/sched_interface.h" #include "srsgnb/hdr/stack/gnb_stack_nr.h" +#include "srsgnb/hdr/stack/ric/ric_client.h" #include "srsran/common/bcd_helpers.h" #include "srsran/common/buffer_pool.h" #include "srsran/common/interfaces_common.h" @@ -169,6 +170,7 @@ private: std::unique_ptr nr_stack = nullptr; std::unique_ptr radio = nullptr; std::unique_ptr phy = nullptr; + std::unique_ptr ric = nullptr; // System metrics processor. srsran::sys_metrics_processor sys_proc; diff --git a/srsenb/src/CMakeLists.txt b/srsenb/src/CMakeLists.txt index 8c92d1b67..b994c3c96 100644 --- a/srsenb/src/CMakeLists.txt +++ b/srsenb/src/CMakeLists.txt @@ -29,8 +29,8 @@ add_executable(srsenb main.cc enb.cc metrics_stdout.cc metrics_csv.cc metrics_js set(SRSENB_SOURCES srsenb_phy srsenb_stack srsenb_common srsenb_s1ap srsenb_upper srsenb_mac srsenb_rrc srslog system) set(SRSRAN_SOURCES srsran_common srsran_mac srsran_phy srsran_gtpu srsran_rlc srsran_pdcp srsran_radio rrc_asn1 s1ap_asn1 enb_cfg_parser srslog support system) -set(SRSENB_SOURCES ${SRSENB_SOURCES} srsgnb_stack srsgnb_ngap srsgnb_mac srsgnb_rrc) -set(SRSRAN_SOURCES ${SRSRAN_SOURCES} rrc_nr_asn1 ngap_nr_asn1) +set(SRSENB_SOURCES ${SRSENB_SOURCES} srsgnb_stack srsgnb_ric srsgnb_ngap srsgnb_mac srsgnb_rrc) +set(SRSRAN_SOURCES ${SRSRAN_SOURCES} rrc_nr_asn1 ngap_nr_asn1 ric_e2) target_link_libraries(srsenb ${SRSENB_SOURCES} ${SRSRAN_SOURCES} diff --git a/srsenb/src/enb.cc b/srsenb/src/enb.cc index 5b1a8c5ae..f8130ba3e 100644 --- a/srsenb/src/enb.cc +++ b/srsenb/src/enb.cc @@ -118,6 +118,15 @@ int enb::init(const all_args_t& args_) ret = SRSRAN_ERROR; } } + std::unique_ptr tmp_ric_client = std::unique_ptr(new srsenb::ric_client()); + if (tmp_ric_client == nullptr) { + srsran::console("Error creating RIC client instance.\n"); + return SRSRAN_ERROR; + } + if (tmp_ric_client->init()) { + srsran::console("Error initializing RIC client.\n"); + return SRSRAN_ERROR; + } if (tmp_eutra_stack) { eutra_stack = std::move(tmp_eutra_stack); @@ -127,7 +136,7 @@ int enb::init(const all_args_t& args_) } phy = std::move(tmp_phy); radio = std::move(tmp_radio); - + ric = std::move(tmp_ric_client); started = true; // set to true in any case to allow stopping the eNB if an error happened // Now that everything is setup, log sector start events. diff --git a/srsgnb/hdr/stack/ric/e2ap.h b/srsgnb/hdr/stack/ric/e2ap.h new file mode 100644 index 000000000..5e2d97194 --- /dev/null +++ b/srsgnb/hdr/stack/ric/e2ap.h @@ -0,0 +1,36 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2022 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + * + */ + +#include "srsran/asn1/e2ap.h" +#include "srsran/srsran.h" + +#ifndef RIC_E2AP_H +#define RIC_E2AP_H + +using namespace asn1::e2ap; + +class e2ap +{ +public: + e2_ap_pdu_c generate_setup_request(); + int process_setup_response(); + int process_setup_failure(); + int process_subscription_request(); + int generate_subscription_response(); + int generate_subscription_failure(); + int generate_indication(); + +private: +}; + +#endif /* RIC_E2AP_H */ diff --git a/srsgnb/hdr/stack/ric/ric_client.h b/srsgnb/hdr/stack/ric/ric_client.h new file mode 100644 index 000000000..a0ac9e731 --- /dev/null +++ b/srsgnb/hdr/stack/ric/ric_client.h @@ -0,0 +1,42 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2022 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + * + */ + +#ifndef RIC_CLIENT_H +#define RIC_CLIENT_H + +#include "srsgnb/hdr/stack/ric/e2ap.h" +#include "srsran/common/network_utils.h" +#include "srsran/common/threads.h" +#include "srsran/srsran.h" +static const int e2ap_ppid = 70; +static const int e2ap_port = 36422; +namespace srsenb { +class ric_client : public srsran::thread +{ +public: + ric_client(); + bool init(); + void stop(); + void run_thread(); + bool send_sctp(srsran::unique_byte_buffer_t& buf); + bool send_e2_setup_request(); + +private: + e2ap e2ap_; + srsran::unique_socket ric_socket; + struct sockaddr_in ric_addr = {}; // RIC address + bool running = false; +}; +} // namespace srsenb + +#endif /* RIC_CLIENT_H */ diff --git a/srsgnb/src/stack/CMakeLists.txt b/srsgnb/src/stack/CMakeLists.txt index 369888e94..cdf0d97ea 100644 --- a/srsgnb/src/stack/CMakeLists.txt +++ b/srsgnb/src/stack/CMakeLists.txt @@ -10,6 +10,7 @@ include_directories(${PROJECT_SOURCE_DIR}) add_subdirectory(mac) add_subdirectory(ngap) +add_subdirectory(ric) add_subdirectory(rrc) add_subdirectory(sdap) diff --git a/srsgnb/src/stack/ric/CMakeLists.txt b/srsgnb/src/stack/ric/CMakeLists.txt new file mode 100644 index 000000000..651b588fc --- /dev/null +++ b/srsgnb/src/stack/ric/CMakeLists.txt @@ -0,0 +1,5 @@ +set(SOURCES ric_client.cc e2ap.cc) +add_library(srsgnb_ric STATIC ${SOURCES}) +#target_link_libraries(srsgnb_ric srsran_asn1) + +add_subdirectory(test) diff --git a/srsgnb/src/stack/ric/e2ap.cc b/srsgnb/src/stack/ric/e2ap.cc new file mode 100644 index 000000000..1252f71aa --- /dev/null +++ b/srsgnb/src/stack/ric/e2ap.cc @@ -0,0 +1,53 @@ + +#include "srsgnb/hdr/stack/ric/e2ap.h" +#include "stdint.h" + +e2_ap_pdu_c e2ap::generate_setup_request() +{ + e2_ap_pdu_c pdu; + init_msg_s& initmsg = pdu.set_init_msg(); + initmsg.load_info_obj(ASN1_E2AP_ID_E2SETUP); + + e2setup_request_s& setup = initmsg.value.e2setup_request(); + + setup->transaction_id.crit = asn1::crit_opts::reject; + setup->transaction_id.value.value = 1; + + setup->global_e2node_id.crit = asn1::crit_opts::reject; + auto& gnb_id = setup->global_e2node_id.value.set_gnb(); + // gnb_id.ext = true; + gnb_id.global_g_nb_id.plmn_id.from_number(3617847); + gnb_id.global_g_nb_id.gnb_id.gnb_id().from_number(381210353); + + setup->ra_nfunctions_added.crit = asn1::crit_opts::reject; + auto& list = setup->ra_nfunctions_added.value; + + setup->ra_nfunctions_added.id = ASN1_E2AP_ID_RA_NFUNCTIONS_ADDED; + asn1::protocol_ie_single_container_s item; + item.load_info_obj(ASN1_E2AP_ID_RA_NFUNCTION_ITEM); + item.value().ra_nfunction_item().ran_function_id = 0; + // TODO use E2SM to correctly generate this message + item.value().ra_nfunction_item().ran_function_definition.from_string( + "20C04F52414E2D4532534D2D4B504D0000054F494431323305004B504D206D6F6E69746F720860283861AAE33F0060000101070050657269" + "6F646963207265706F727401051401011D004F2D4455204D6561737572656D656E7420436F6E7461696E657220666F722074686520354743" + "20636F6E6E6563746564206465706C6F796D656E74010101010001021D004F2D4455204D6561737572656D656E7420436F6E7461696E6572" + "20666F72207468652045504320636F6E6E6563746564206465706C6F796D656E74010101010001031E804F2D43552D4350204D6561737572" + "656D656E7420436F6E7461696E657220666F72207468652035474320636F6E6E6563746564206465706C6F796D656E74010101010001041E" + "804F2D43552D4350204D6561737572656D656E7420436F6E7461696E657220666F72207468652045504320636F6E6E656374656420646570" + "6C6F796D656E74010101010001051E804F2D43552D5550204D6561737572656D656E7420436F6E7461696E657220666F7220746865203547" + "4320636F6E6E6563746564206465706C6F796D656E74010101010001061E804F2D43552D5550204D6561737572656D656E7420436F6E7461" + "696E657220666F72207468652045504320636F6E6E6563746564206465706C6F796D656E7401010101"); + item.value().ra_nfunction_item().ran_function_oid.resize(1); + setup->ra_nfunctions_added.value.push_back(item); + + setup->e2node_component_cfg_addition.crit = asn1::crit_opts::reject; + auto& list1 = setup->e2node_component_cfg_addition.value; + list1.resize(1); + list1[0].load_info_obj(ASN1_E2AP_ID_E2NODE_COMPONENT_CFG_ADDITION_ITEM); + e2node_component_cfg_addition_item_s& item1 = list1[0].value().e2node_component_cfg_addition_item(); + item1.e2node_component_interface_type = e2node_component_interface_type_opts::ng; + item1.e2node_component_id.set_e2node_component_interface_type_ng().amf_name.from_string("nginterf"); + item1.e2node_component_cfg.e2node_component_request_part.from_string("72657170617274"); + item1.e2node_component_cfg.e2node_component_resp_part.from_string("72657370617274"); + return pdu; +} diff --git a/srsgnb/src/stack/ric/ric_client.cc b/srsgnb/src/stack/ric/ric_client.cc new file mode 100644 index 000000000..6e150551e --- /dev/null +++ b/srsgnb/src/stack/ric/ric_client.cc @@ -0,0 +1,105 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2022 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ + +#include "srsgnb/hdr/stack/ric/ric_client.h" +#include "srsran/asn1/e2ap.h" +#include "stdint.h" + +using namespace srsenb; +ric_client::ric_client() : thread("RIC_CLIENT_THREAD") {} +bool ric_client::init() +{ + printf("RIC_CLIENT: Init\n"); + using namespace srsran::net_utils; + // Open SCTP socket + if (not ric_socket.open_socket(addr_family::ipv4, socket_type::seqpacket, protocol_type::SCTP)) { + return false; + } + printf("RIC SCTP socket opened. fd=%d\n", ric_socket.fd()); + if (not ric_socket.sctp_subscribe_to_events()) { + ric_socket.close(); + return false; + } + + // Bind socket + + if (not ric_socket.bind_addr("172.17.0.3", 36422)) { + ric_socket.close(); + return false; + } + + // Connect to the AMF address + if (not ric_socket.connect_to("10.104.149.217", e2ap_port, &ric_addr)) { + return false; + } + printf("SCTP socket connected with RIC. fd=%d", ric_socket.fd()); + running = true; + start(0); + + return SRSRAN_SUCCESS; +} +void ric_client::stop() +{ + running = false; + wait_thread_finish(); +} +void ric_client::run_thread() +{ + while (running) { + send_e2_setup_request(); + printf("e2 setup request sent\n"); + sleep(5); + } +} +bool ric_client::send_sctp(srsran::unique_byte_buffer_t& buf) +{ + ssize_t ret; + ret = sctp_sendmsg(ric_socket.fd(), + buf->msg, + buf->N_bytes, + (struct sockaddr*)&ric_addr, + sizeof(ric_addr), + htonl(e2ap_ppid), + 0, + 0, + 0, + 0); + if (ret == -1) { + printf("failed to send %d bytes\n", buf->N_bytes); + return false; + } + return true; +} + +bool ric_client::send_e2_setup_request() +{ + srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer(); + if (buf == nullptr) { + // logger.error("Fatal Error: Couldn't allocate buffer for %s.", procedure_name); + return false; + } + + e2_ap_pdu_c setup_req_pdu = e2ap_.generate_setup_request(); + + asn1::bit_ref bref(buf->msg, buf->get_tailroom()); + if (setup_req_pdu.pack(bref) != asn1::SRSASN_SUCCESS) { + printf("Failed to pack TX E2 PDU\n"); + return false; + } + buf->N_bytes = bref.distance_bytes(); + printf("try to send %d bytes to addr %s \n", buf->N_bytes, inet_ntoa(ric_addr.sin_addr)); + if (!send_sctp(buf)) { + printf("failed to send e2 setup request\n"); + return false; + } + return true; +} diff --git a/srsgnb/src/stack/ric/test/CMakeLists.txt b/srsgnb/src/stack/ric/test/CMakeLists.txt new file mode 100644 index 000000000..a29d444f0 --- /dev/null +++ b/srsgnb/src/stack/ric/test/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright 2013-2021 Software Radio Systems Limited +# +# By using this file, you agree to the terms and conditions set +# forth in the LICENSE file which can be found at the top level of +# the distribution. +# + +add_executable(e2ap_test e2ap_test.cc) +target_link_libraries(e2ap_test srsran_common ric_e2 srsgnb_ric srsenb_upper srsgnb_stack ${SCTP_LIBRARIES}) + +add_test(e2ap_test e2ap_test) \ No newline at end of file diff --git a/srsgnb/src/stack/ric/test/e2ap_test.cc b/srsgnb/src/stack/ric/test/e2ap_test.cc new file mode 100644 index 000000000..4a0835650 --- /dev/null +++ b/srsgnb/src/stack/ric/test/e2ap_test.cc @@ -0,0 +1,106 @@ +#include "srsgnb/hdr/stack/ric/e2ap.h" +#include "srsran/asn1/e2ap.h" +#include "srsran/common/test_common.h" +#include "srsran/srsran.h" + +// function to test the encoding of the E2AP message +void test_reference_e2ap_setup_request() +{ + uint8_t e2ap_msg_foreign[] = { + 0x00, 0x01, 0x00, 0x82, 0x40, 0x00, 0x00, 0x04, 0x00, 0x31, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x09, 0x00, + 0x37, 0x34, 0x37, 0x38, 0xb5, 0xc6, 0x77, 0x88, 0x00, 0x0a, 0x00, 0x81, 0xff, 0x00, 0x00, 0x08, 0x00, 0x81, 0xf9, + 0x00, 0x00, 0x00, 0x81, 0xe9, 0x20, 0xc0, 0x4f, 0x52, 0x41, 0x4e, 0x2d, 0x45, 0x32, 0x53, 0x4d, 0x2d, 0x4b, 0x50, + 0x4d, 0x00, 0x00, 0x05, 0x4f, 0x49, 0x44, 0x31, 0x32, 0x33, 0x05, 0x00, 0x4b, 0x50, 0x4d, 0x20, 0x6d, 0x6f, 0x6e, + 0x69, 0x74, 0x6f, 0x72, 0x08, 0xdc, 0x2b, 0xda, 0xe3, 0xae, 0xd1, 0x4d, 0x00, 0x60, 0x00, 0x01, 0x01, 0x07, 0x00, + 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x01, 0x05, 0x14, 0x01, + 0x01, 0x1d, 0x00, 0x4f, 0x2d, 0x44, 0x55, 0x20, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x35, 0x47, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x02, 0x1d, 0x00, 0x4f, 0x2d, 0x44, 0x55, 0x20, + 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x45, 0x50, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x01, 0x03, 0x1e, 0x80, 0x4f, 0x2d, 0x43, 0x55, 0x2d, 0x43, 0x50, 0x20, 0x4d, 0x65, 0x61, 0x73, 0x75, + 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x35, 0x47, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x04, 0x1e, + 0x80, 0x4f, 0x2d, 0x43, 0x55, 0x2d, 0x43, 0x50, 0x20, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x45, 0x50, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x05, 0x1e, 0x80, 0x4f, 0x2d, 0x43, 0x55, + 0x2d, 0x55, 0x50, 0x20, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x35, 0x47, 0x43, 0x20, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x06, 0x1e, 0x80, 0x4f, 0x2d, 0x43, 0x55, 0x2d, 0x55, 0x50, 0x20, 0x4d, + 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x45, 0x50, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, 0x01, + 0x00, 0x02, 0x00, 0x00, 0x05, 0x4f, 0x49, 0x44, 0x31, 0x32, 0x33, 0x00, 0x32, 0x00, 0x22, 0x00, 0x00, 0x00, 0x33, + 0x00, 0x1c, 0x00, 0x00, 0xe0, 0x6e, 0x67, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x00, 0x07, 0x72, 0x65, 0x71, 0x70, + 0x61, 0x72, 0x74, 0x07, 0x72, 0x65, 0x73, 0x70, 0x61, 0x72, 0x74}; + uint8_t e2ap_msg_self[] = { + 0x00, 0x01, 0x00, 0x82, 0x3c, 0x00, 0x00, 0x04, 0x00, 0x31, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x09, 0x00, + 0x37, 0x34, 0x37, 0x38, 0xb5, 0xc6, 0x77, 0x88, 0x00, 0x0a, 0x00, 0x81, 0xfa, 0x00, 0x00, 0x08, 0x00, 0x81, 0xf4, + 0x00, 0x00, 0x00, 0x81, 0xe9, 0x20, 0xc0, 0x4f, 0x52, 0x41, 0x4e, 0x2d, 0x45, 0x32, 0x53, 0x4d, 0x2d, 0x4b, 0x50, + 0x4d, 0x00, 0x00, 0x05, 0x4f, 0x49, 0x44, 0x31, 0x32, 0x33, 0x05, 0x00, 0x4b, 0x50, 0x4d, 0x20, 0x6d, 0x6f, 0x6e, + 0x69, 0x74, 0x6f, 0x72, 0x08, 0x60, 0x28, 0x38, 0x61, 0xaa, 0xe3, 0x3f, 0x00, 0x60, 0x00, 0x01, 0x01, 0x07, 0x00, + 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x01, 0x05, 0x14, 0x01, + 0x01, 0x1d, 0x00, 0x4f, 0x2d, 0x44, 0x55, 0x20, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x35, 0x47, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x02, 0x1d, 0x00, 0x4f, 0x2d, 0x44, 0x55, 0x20, + 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x45, 0x50, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x01, 0x03, 0x1e, 0x80, 0x4f, 0x2d, 0x43, 0x55, 0x2d, 0x43, 0x50, 0x20, 0x4d, 0x65, 0x61, 0x73, 0x75, + 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x35, 0x47, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x04, 0x1e, + 0x80, 0x4f, 0x2d, 0x43, 0x55, 0x2d, 0x43, 0x50, 0x20, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, + 0x20, 0x45, 0x50, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x05, 0x1e, 0x80, 0x4f, 0x2d, 0x43, 0x55, + 0x2d, 0x55, 0x50, 0x20, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x35, 0x47, 0x43, 0x20, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x06, 0x1e, 0x80, 0x4f, 0x2d, 0x43, 0x55, 0x2d, 0x55, 0x50, 0x20, 0x4d, + 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x45, 0x50, 0x43, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x01, 0x01, 0x01, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x23, 0x00, 0x00, 0x00, 0x33, 0x00, 0x1d, 0x00, 0x00, 0x03, + 0x80, 0x6e, 0x67, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x00, 0x07, 0x72, 0x65, 0x71, 0x70, 0x61, 0x72, 0x74, 0x07, + 0x72, 0x65, 0x73, 0x70, 0x61, 0x72, 0x74}; + + asn1::cbit_ref bref(&e2ap_msg_foreign[0], sizeof(e2ap_msg_foreign)); + e2_ap_pdu_c pdu, pdu2; + asn1::SRSASN_CODE unpack_ret = pdu2.unpack(bref); + TESTASSERT_EQ(asn1::SRSASN_SUCCESS, unpack_ret); + printf("Unpacked E2AP PDU %d\n", (int)unpack_ret); +} + +void test_native_e2ap_setup_request() +{ + srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer(); + e2_ap_pdu_c pdu, pdu2; + e2ap e2ap_; + pdu = e2ap_.generate_setup_request(); + + asn1::bit_ref bref(buf->msg, buf->get_tailroom()); + if (pdu.pack(bref) != asn1::SRSASN_SUCCESS) { + printf("Failed to pack TX E2 PDU\n"); + return; + } + + asn1::cbit_ref bref2(buf->msg, buf->get_tailroom()); + + asn1::SRSASN_CODE unpack_ret = pdu2.unpack(bref2); + TESTASSERT_EQ(asn1::SRSASN_SUCCESS, unpack_ret); + printf("Unpacked native E2AP PDU %d\n", (int)unpack_ret); +} + +int main() +{ + test_reference_e2ap_setup_request(); + test_native_e2ap_setup_request(); + return 0; +} \ No newline at end of file