asn1: use typedefs for amf_ue_ngap_id, ran_ue_ngap_id, mme_ue_s1ap_id and enb_ue_s1ap_id and changed interface to access s1ap and ngap protocol_ies

master
Francisco 3 years ago committed by Francisco Paisana
parent 26f173e582
commit f7efee9884

@ -1826,11 +1826,17 @@ using protocol_ext_container_empty_l = protocol_ie_container_empty_l;
template <typename ProtocolIEs> template <typename ProtocolIEs>
class elementary_procedure_option class elementary_procedure_option
{ {
public:
bool ext;
ProtocolIEs protocol_ies; ProtocolIEs protocol_ies;
public:
bool ext;
// ... // ...
ProtocolIEs* operator->() { return &protocol_ies; }
const ProtocolIEs* operator->() const { return &protocol_ies; }
ProtocolIEs& operator*() { return protocol_ies; }
const ProtocolIEs& operator*() const { return protocol_ies; }
// sequence methods // sequence methods
SRSASN_CODE pack(bit_ref& bref) const SRSASN_CODE pack(bit_ref& bref) const
{ {

@ -291,6 +291,12 @@ namespace ngap {
* Struct Definitions * Struct Definitions
******************************************************************************/ ******************************************************************************/
// INTEGER (0..4294967295) ::= INTEGER (0..4294967295)
using ran_ue_ngap_id_t = integer<uint64_t, 0, 4294967295, false, true>;
// INTEGER (0..1099511627775) ::= INTEGER (0..1099511627775)
using amf_ue_ngap_id_t = integer<uint64_t, 0, 1099511627775, false, true>;
// CPTransportLayerInformation-ExtIEs ::= OBJECT SET OF NGAP-PROTOCOL-IES // CPTransportLayerInformation-ExtIEs ::= OBJECT SET OF NGAP-PROTOCOL-IES
using cp_transport_layer_info_ext_ies_o = protocol_ies_empty_o; using cp_transport_layer_info_ext_ies_o = protocol_ies_empty_o;
@ -3026,11 +3032,11 @@ struct cell_traffic_trace_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<fixed_octstring<8, true> > ngran_trace_id; ie_field_s<fixed_octstring<8, true> > ngran_trace_id;
ie_field_s<ngran_cgi_c> ngran_cgi; ie_field_s<ngran_cgi_c> ngran_cgi;
ie_field_s<bounded_bitstring<1, 160, true, true> > trace_collection_entity_ip_address; ie_field_s<bounded_bitstring<1, 160, true, true> > trace_collection_entity_ip_address;
// sequence methods // sequence methods
cell_traffic_trace_ies_container(); cell_traffic_trace_ies_container();
@ -3625,9 +3631,9 @@ struct deactiv_trace_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<fixed_octstring<8, true> > ngran_trace_id; ie_field_s<fixed_octstring<8, true> > ngran_trace_id;
// sequence methods // sequence methods
deactiv_trace_ies_container(); deactiv_trace_ies_container();
@ -3871,21 +3877,21 @@ struct dl_nas_transport_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool old_amf_present = false; bool old_amf_present = false;
bool ran_paging_prio_present = false; bool ran_paging_prio_present = false;
bool mob_restrict_list_present = false; bool mob_restrict_list_present = false;
bool idx_to_rfsp_present = false; bool idx_to_rfsp_present = false;
bool ue_aggregate_maximum_bit_rate_present = false; bool ue_aggregate_maximum_bit_rate_present = false;
bool allowed_nssai_present = false; bool allowed_nssai_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<printable_string<1, 150, true, true> > old_amf; ie_field_s<printable_string<1, 150, true, true> > old_amf;
ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio; ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio;
ie_field_s<unbounded_octstring<true> > nas_pdu; ie_field_s<unbounded_octstring<true> > nas_pdu;
ie_field_s<mob_restrict_list_s> mob_restrict_list; ie_field_s<mob_restrict_list_s> mob_restrict_list;
ie_field_s<integer<uint16_t, 1, 256, true, true> > idx_to_rfsp; ie_field_s<integer<uint16_t, 1, 256, true, true> > idx_to_rfsp;
ie_field_s<ue_aggregate_maximum_bit_rate_s> ue_aggregate_maximum_bit_rate; ie_field_s<ue_aggregate_maximum_bit_rate_s> ue_aggregate_maximum_bit_rate;
ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai; ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai;
// sequence methods // sequence methods
dl_nas_transport_ies_container(); dl_nas_transport_ies_container();
@ -4295,9 +4301,9 @@ struct dl_ran_status_transfer_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<ran_status_transfer_transparent_container_s> ran_status_transfer_transparent_container; ie_field_s<ran_status_transfer_transparent_container_s> ran_status_transfer_transparent_container;
// sequence methods // sequence methods
dl_ran_status_transfer_ies_container(); dl_ran_status_transfer_ies_container();
@ -4360,10 +4366,10 @@ struct dl_ueassociated_nrp_pa_transport_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<unbounded_octstring<true> > routing_id; ie_field_s<unbounded_octstring<true> > routing_id;
ie_field_s<unbounded_octstring<true> > nrp_pa_pdu; ie_field_s<unbounded_octstring<true> > nrp_pa_pdu;
// sequence methods // sequence methods
dl_ueassociated_nrp_pa_transport_ies_container(); dl_ueassociated_nrp_pa_transport_ies_container();
@ -4583,14 +4589,14 @@ struct error_ind_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool amf_ue_ngap_id_present = false; bool amf_ue_ngap_id_present = false;
bool ran_ue_ngap_id_present = false; bool ran_ue_ngap_id_present = false;
bool cause_present = false; bool cause_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
// sequence methods // sequence methods
error_ind_ies_container(); error_ind_ies_container();
@ -4708,9 +4714,9 @@ struct ho_cancel_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
// sequence methods // sequence methods
ho_cancel_ies_container(); ho_cancel_ies_container();
@ -4771,10 +4777,10 @@ struct ho_cancel_ack_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
// sequence methods // sequence methods
ho_cancel_ack_ies_container(); ho_cancel_ack_ies_container();
@ -4913,13 +4919,13 @@ struct ho_cmd_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool nas_security_params_from_ngran_present = false; bool nas_security_params_from_ngran_present = false;
bool pdu_session_res_to_release_list_ho_cmd_present = false; bool pdu_session_res_to_release_list_ho_cmd_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<handov_type_e> handov_type; ie_field_s<handov_type_e> handov_type;
ie_field_s<unbounded_octstring<true> > nas_security_params_from_ngran; ie_field_s<unbounded_octstring<true> > nas_security_params_from_ngran;
ie_field_s<dyn_seq_of<pdu_session_res_ho_item_s, 1, 256, true> > pdu_session_res_ho_list; ie_field_s<dyn_seq_of<pdu_session_res_ho_item_s, 1, 256, true> > pdu_session_res_ho_list;
ie_field_s<dyn_seq_of<pdu_session_res_to_release_item_ho_cmd_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_to_release_item_ho_cmd_s, 1, 256, true> >
pdu_session_res_to_release_list_ho_cmd; pdu_session_res_to_release_list_ho_cmd;
@ -5102,10 +5108,10 @@ struct ho_fail_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
// sequence methods // sequence methods
ho_fail_ies_container(); ho_fail_ies_container();
@ -5317,9 +5323,9 @@ struct ho_notify_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
// sequence methods // sequence methods
ho_notify_ies_container(); ho_notify_ies_container();
@ -5382,11 +5388,11 @@ struct ho_prep_fail_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
// sequence methods // sequence methods
ho_prep_fail_ies_container(); ho_prep_fail_ies_container();
@ -5717,24 +5723,24 @@ struct ho_request_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool core_network_assist_info_present = false; bool core_network_assist_info_present = false;
bool new_security_context_ind_present = false; bool new_security_context_ind_present = false;
bool nasc_present = false; bool nasc_present = false;
bool trace_activation_present = false; bool trace_activation_present = false;
bool masked_imeisv_present = false; bool masked_imeisv_present = false;
bool mob_restrict_list_present = false; bool mob_restrict_list_present = false;
bool location_report_request_type_present = false; bool location_report_request_type_present = false;
bool rrc_inactive_transition_report_request_present = false; bool rrc_inactive_transition_report_request_present = false;
bool redirection_voice_fallback_present = false; bool redirection_voice_fallback_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<handov_type_e> handov_type; ie_field_s<handov_type_e> handov_type;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
ie_field_s<ue_aggregate_maximum_bit_rate_s> ue_aggregate_maximum_bit_rate; ie_field_s<ue_aggregate_maximum_bit_rate_s> ue_aggregate_maximum_bit_rate;
ie_field_s<core_network_assist_info_s> core_network_assist_info; ie_field_s<core_network_assist_info_s> core_network_assist_info;
ie_field_s<ue_security_cap_s> ue_security_cap; ie_field_s<ue_security_cap_s> ue_security_cap;
ie_field_s<security_context_s> security_context; ie_field_s<security_context_s> security_context;
ie_field_s<new_security_context_ind_e> new_security_context_ind; ie_field_s<new_security_context_ind_e> new_security_context_ind;
ie_field_s<unbounded_octstring<true> > nasc; ie_field_s<unbounded_octstring<true> > nasc;
ie_field_s<dyn_seq_of<pdu_session_res_setup_item_ho_req_s, 1, 256, true> > pdu_session_res_setup_list_ho_req; ie_field_s<dyn_seq_of<pdu_session_res_setup_item_ho_req_s, 1, 256, true> > pdu_session_res_setup_list_ho_req;
ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai; ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai;
ie_field_s<trace_activation_s> trace_activation; ie_field_s<trace_activation_s> trace_activation;
@ -5869,10 +5875,10 @@ struct ho_request_ack_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_failed_to_setup_list_ho_ack_present = false; bool pdu_session_res_failed_to_setup_list_ho_ack_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_admitted_item_s, 1, 256, true> > pdu_session_res_admitted_list; ie_field_s<dyn_seq_of<pdu_session_res_admitted_item_s, 1, 256, true> > pdu_session_res_admitted_list;
ie_field_s<dyn_seq_of<pdu_session_res_failed_to_setup_item_ho_ack_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_failed_to_setup_item_ho_ack_s, 1, 256, true> >
pdu_session_res_failed_to_setup_list_ho_ack; pdu_session_res_failed_to_setup_list_ho_ack;
@ -6187,13 +6193,13 @@ struct ho_required_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool direct_forwarding_path_availability_present = false; bool direct_forwarding_path_availability_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<handov_type_e> handov_type; ie_field_s<handov_type_e> handov_type;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
ie_field_s<target_id_c> target_id; ie_field_s<target_id_c> target_id;
ie_field_s<direct_forwarding_path_availability_e> direct_forwarding_path_availability; ie_field_s<direct_forwarding_path_availability_e> direct_forwarding_path_availability;
ie_field_s<dyn_seq_of<pdu_session_res_item_ho_rqd_s, 1, 256, true> > pdu_session_res_list_ho_rqd; ie_field_s<dyn_seq_of<pdu_session_res_item_ho_rqd_s, 1, 256, true> > pdu_session_res_list_ho_rqd;
ie_field_s<unbounded_octstring<true> > source_to_target_transparent_container; ie_field_s<unbounded_octstring<true> > source_to_target_transparent_container;
@ -6392,10 +6398,10 @@ struct init_context_setup_fail_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_failed_to_setup_list_cxt_fail_present = false; bool pdu_session_res_failed_to_setup_list_cxt_fail_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_failed_to_setup_item_cxt_fail_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_failed_to_setup_item_cxt_fail_s, 1, 256, true> >
pdu_session_res_failed_to_setup_list_cxt_fail; pdu_session_res_failed_to_setup_list_cxt_fail;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
@ -6577,26 +6583,26 @@ struct init_context_setup_request_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool old_amf_present = false; bool old_amf_present = false;
bool ue_aggregate_maximum_bit_rate_present = false; bool ue_aggregate_maximum_bit_rate_present = false;
bool core_network_assist_info_present = false; bool core_network_assist_info_present = false;
bool pdu_session_res_setup_list_cxt_req_present = false; bool pdu_session_res_setup_list_cxt_req_present = false;
bool trace_activation_present = false; bool trace_activation_present = false;
bool mob_restrict_list_present = false; bool mob_restrict_list_present = false;
bool ue_radio_cap_present = false; bool ue_radio_cap_present = false;
bool idx_to_rfsp_present = false; bool idx_to_rfsp_present = false;
bool masked_imeisv_present = false; bool masked_imeisv_present = false;
bool nas_pdu_present = false; bool nas_pdu_present = false;
bool emergency_fallback_ind_present = false; bool emergency_fallback_ind_present = false;
bool rrc_inactive_transition_report_request_present = false; bool rrc_inactive_transition_report_request_present = false;
bool ue_radio_cap_for_paging_present = false; bool ue_radio_cap_for_paging_present = false;
bool redirection_voice_fallback_present = false; bool redirection_voice_fallback_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<printable_string<1, 150, true, true> > old_amf; ie_field_s<printable_string<1, 150, true, true> > old_amf;
ie_field_s<ue_aggregate_maximum_bit_rate_s> ue_aggregate_maximum_bit_rate; ie_field_s<ue_aggregate_maximum_bit_rate_s> ue_aggregate_maximum_bit_rate;
ie_field_s<core_network_assist_info_s> core_network_assist_info; ie_field_s<core_network_assist_info_s> core_network_assist_info;
ie_field_s<guami_s> guami; ie_field_s<guami_s> guami;
ie_field_s<dyn_seq_of<pdu_session_res_setup_item_cxt_req_s, 1, 256, true> > pdu_session_res_setup_list_cxt_req; ie_field_s<dyn_seq_of<pdu_session_res_setup_item_cxt_req_s, 1, 256, true> > pdu_session_res_setup_list_cxt_req;
ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai; ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai;
ie_field_s<ue_security_cap_s> ue_security_cap; ie_field_s<ue_security_cap_s> ue_security_cap;
@ -6731,11 +6737,11 @@ struct init_context_setup_resp_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_setup_list_cxt_res_present = false; bool pdu_session_res_setup_list_cxt_res_present = false;
bool pdu_session_res_failed_to_setup_list_cxt_res_present = false; bool pdu_session_res_failed_to_setup_list_cxt_res_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_setup_item_cxt_res_s, 1, 256, true> > pdu_session_res_setup_list_cxt_res; ie_field_s<dyn_seq_of<pdu_session_res_setup_item_cxt_res_s, 1, 256, true> > pdu_session_res_setup_list_cxt_res;
ie_field_s<dyn_seq_of<pdu_session_res_failed_to_setup_item_cxt_res_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_failed_to_setup_item_cxt_res_s, 1, 256, true> >
pdu_session_res_failed_to_setup_list_cxt_res; pdu_session_res_failed_to_setup_list_cxt_res;
@ -6857,18 +6863,18 @@ struct init_ue_msg_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool five_g_s_tmsi_present = false; bool five_g_s_tmsi_present = false;
bool amf_set_id_present = false; bool amf_set_id_present = false;
bool ue_context_request_present = false; bool ue_context_request_present = false;
bool allowed_nssai_present = false; bool allowed_nssai_present = false;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<unbounded_octstring<true> > nas_pdu; ie_field_s<unbounded_octstring<true> > nas_pdu;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
ie_field_s<rrcestablishment_cause_e> rrcestablishment_cause; ie_field_s<rrcestablishment_cause_e> rrcestablishment_cause;
ie_field_s<five_g_s_tmsi_s> five_g_s_tmsi; ie_field_s<five_g_s_tmsi_s> five_g_s_tmsi;
ie_field_s<fixed_bitstring<10, false, true> > amf_set_id; ie_field_s<fixed_bitstring<10, false, true> > amf_set_id;
ie_field_s<ue_context_request_e> ue_context_request; ie_field_s<ue_context_request_e> ue_context_request;
ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai; ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai;
// sequence methods // sequence methods
init_ue_msg_ies_container(); init_ue_msg_ies_container();
@ -10807,11 +10813,11 @@ struct location_report_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool ue_presence_in_area_of_interest_list_present = false; bool ue_presence_in_area_of_interest_list_present = false;
bool ps_cell_info_present = false; bool ps_cell_info_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
ie_field_s<dyn_seq_of<ue_presence_in_area_of_interest_item_s, 1, 64, true> > ue_presence_in_area_of_interest_list; ie_field_s<dyn_seq_of<ue_presence_in_area_of_interest_item_s, 1, 64, true> > ue_presence_in_area_of_interest_list;
ie_field_s<location_report_request_type_s> location_report_request_type; ie_field_s<location_report_request_type_s> location_report_request_type;
ie_field_s<ngran_cgi_c> ps_cell_info; ie_field_s<ngran_cgi_c> ps_cell_info;
@ -10831,9 +10837,9 @@ struct location_report_ctrl_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<location_report_request_type_s> location_report_request_type; ie_field_s<location_report_request_type_s> location_report_request_type;
// sequence methods // sequence methods
location_report_ctrl_ies_container(); location_report_ctrl_ies_container();
@ -10850,9 +10856,9 @@ struct location_report_fail_ind_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
// sequence methods // sequence methods
location_report_fail_ind_ies_container(); location_report_fail_ind_ies_container();
@ -10869,10 +10875,10 @@ struct nas_non_delivery_ind_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<unbounded_octstring<true> > nas_pdu; ie_field_s<unbounded_octstring<true> > nas_pdu;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
// sequence methods // sequence methods
nas_non_delivery_ind_ies_container(); nas_non_delivery_ind_ies_container();
@ -11022,10 +11028,10 @@ struct pdu_session_res_modify_confirm_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_failed_to_modify_list_mod_cfm_present = false; bool pdu_session_res_failed_to_modify_list_mod_cfm_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_modify_item_mod_cfm_s, 1, 256, true> > pdu_session_res_modify_list_mod_cfm; ie_field_s<dyn_seq_of<pdu_session_res_modify_item_mod_cfm_s, 1, 256, true> > pdu_session_res_modify_list_mod_cfm;
ie_field_s<dyn_seq_of<pdu_session_res_failed_to_modify_item_mod_cfm_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_failed_to_modify_item_mod_cfm_s, 1, 256, true> >
pdu_session_res_failed_to_modify_list_mod_cfm; pdu_session_res_failed_to_modify_list_mod_cfm;
@ -11046,8 +11052,8 @@ struct pdu_session_res_modify_ind_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_modify_item_mod_ind_s, 1, 256, true> > pdu_session_res_modify_list_mod_ind; ie_field_s<dyn_seq_of<pdu_session_res_modify_item_mod_ind_s, 1, 256, true> > pdu_session_res_modify_list_mod_ind;
// sequence methods // sequence methods
@ -11066,8 +11072,8 @@ struct pdu_session_res_modify_request_ies_container {
// member variables // member variables
bool ran_paging_prio_present = false; bool ran_paging_prio_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio; ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio;
ie_field_s<dyn_seq_of<pdu_session_res_modify_item_mod_req_s, 1, 256, true> > pdu_session_res_modify_list_mod_req; ie_field_s<dyn_seq_of<pdu_session_res_modify_item_mod_req_s, 1, 256, true> > pdu_session_res_modify_list_mod_req;
@ -11086,12 +11092,12 @@ struct pdu_session_res_modify_resp_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_modify_list_mod_res_present = false; bool pdu_session_res_modify_list_mod_res_present = false;
bool pdu_session_res_failed_to_modify_list_mod_res_present = false; bool pdu_session_res_failed_to_modify_list_mod_res_present = false;
bool user_location_info_present = false; bool user_location_info_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_modify_item_mod_res_s, 1, 256, true> > pdu_session_res_modify_list_mod_res; ie_field_s<dyn_seq_of<pdu_session_res_modify_item_mod_res_s, 1, 256, true> > pdu_session_res_modify_list_mod_res;
ie_field_s<dyn_seq_of<pdu_session_res_failed_to_modify_item_mod_res_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_failed_to_modify_item_mod_res_s, 1, 256, true> >
pdu_session_res_failed_to_modify_list_mod_res; pdu_session_res_failed_to_modify_list_mod_res;
@ -11113,11 +11119,11 @@ struct pdu_session_res_notify_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_notify_list_present = false; bool pdu_session_res_notify_list_present = false;
bool pdu_session_res_released_list_not_present = false; bool pdu_session_res_released_list_not_present = false;
bool user_location_info_present = false; bool user_location_info_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_notify_item_s, 1, 256, true> > pdu_session_res_notify_list; ie_field_s<dyn_seq_of<pdu_session_res_notify_item_s, 1, 256, true> > pdu_session_res_notify_list;
ie_field_s<dyn_seq_of<pdu_session_res_released_item_not_s, 1, 256, true> > pdu_session_res_released_list_not; ie_field_s<dyn_seq_of<pdu_session_res_released_item_not_s, 1, 256, true> > pdu_session_res_released_list_not;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
@ -11137,12 +11143,12 @@ struct pdu_session_res_release_cmd_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool ran_paging_prio_present = false; bool ran_paging_prio_present = false;
bool nas_pdu_present = false; bool nas_pdu_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio; ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio;
ie_field_s<unbounded_octstring<true> > nas_pdu; ie_field_s<unbounded_octstring<true> > nas_pdu;
ie_field_s<dyn_seq_of<pdu_session_res_to_release_item_rel_cmd_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_to_release_item_rel_cmd_s, 1, 256, true> >
pdu_session_res_to_release_list_rel_cmd; pdu_session_res_to_release_list_rel_cmd;
@ -11163,8 +11169,8 @@ struct pdu_session_res_release_resp_ies_container {
// member variables // member variables
bool user_location_info_present = false; bool user_location_info_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_released_item_rel_res_s, 1, 256, true> > pdu_session_res_released_list_rel_res; ie_field_s<dyn_seq_of<pdu_session_res_released_item_rel_res_s, 1, 256, true> > pdu_session_res_released_list_rel_res;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
@ -11184,13 +11190,13 @@ struct pdu_session_res_setup_request_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool ran_paging_prio_present = false; bool ran_paging_prio_present = false;
bool nas_pdu_present = false; bool nas_pdu_present = false;
bool ue_aggregate_maximum_bit_rate_present = false; bool ue_aggregate_maximum_bit_rate_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio; ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio;
ie_field_s<unbounded_octstring<true> > nas_pdu; ie_field_s<unbounded_octstring<true> > nas_pdu;
ie_field_s<dyn_seq_of<pdu_session_res_setup_item_su_req_s, 1, 256, true> > pdu_session_res_setup_list_su_req; ie_field_s<dyn_seq_of<pdu_session_res_setup_item_su_req_s, 1, 256, true> > pdu_session_res_setup_list_su_req;
ie_field_s<ue_aggregate_maximum_bit_rate_s> ue_aggregate_maximum_bit_rate; ie_field_s<ue_aggregate_maximum_bit_rate_s> ue_aggregate_maximum_bit_rate;
@ -11209,11 +11215,11 @@ struct pdu_session_res_setup_resp_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_setup_list_su_res_present = false; bool pdu_session_res_setup_list_su_res_present = false;
bool pdu_session_res_failed_to_setup_list_su_res_present = false; bool pdu_session_res_failed_to_setup_list_su_res_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_setup_item_su_res_s, 1, 256, true> > pdu_session_res_setup_list_su_res; ie_field_s<dyn_seq_of<pdu_session_res_setup_item_su_res_s, 1, 256, true> > pdu_session_res_setup_list_su_res;
ie_field_s<dyn_seq_of<pdu_session_res_failed_to_setup_item_su_res_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_failed_to_setup_item_su_res_s, 1, 256, true> >
pdu_session_res_failed_to_setup_list_su_res; pdu_session_res_failed_to_setup_list_su_res;
@ -11345,8 +11351,8 @@ struct path_switch_request_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_failed_to_setup_list_ps_req_present = false; bool pdu_session_res_failed_to_setup_list_ps_req_present = false;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > source_amf_ue_ngap_id; ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > source_amf_ue_ngap_id;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
ie_field_s<ue_security_cap_s> ue_security_cap; ie_field_s<ue_security_cap_s> ue_security_cap;
@ -11370,18 +11376,18 @@ struct path_switch_request_ack_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool ue_security_cap_present = false; bool ue_security_cap_present = false;
bool new_security_context_ind_present = false; bool new_security_context_ind_present = false;
bool pdu_session_res_released_list_ps_ack_present = false; bool pdu_session_res_released_list_ps_ack_present = false;
bool core_network_assist_info_present = false; bool core_network_assist_info_present = false;
bool rrc_inactive_transition_report_request_present = false; bool rrc_inactive_transition_report_request_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
bool redirection_voice_fallback_present = false; bool redirection_voice_fallback_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<ue_security_cap_s> ue_security_cap; ie_field_s<ue_security_cap_s> ue_security_cap;
ie_field_s<security_context_s> security_context; ie_field_s<security_context_s> security_context;
ie_field_s<new_security_context_ind_e> new_security_context_ind; ie_field_s<new_security_context_ind_e> new_security_context_ind;
ie_field_s<dyn_seq_of<pdu_session_res_switched_item_s, 1, 256, true> > pdu_session_res_switched_list; ie_field_s<dyn_seq_of<pdu_session_res_switched_item_s, 1, 256, true> > pdu_session_res_switched_list;
ie_field_s<dyn_seq_of<pdu_session_res_released_item_ps_ack_s, 1, 256, true> > pdu_session_res_released_list_ps_ack; ie_field_s<dyn_seq_of<pdu_session_res_released_item_ps_ack_s, 1, 256, true> > pdu_session_res_released_list_ps_ack;
ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai; ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai;
@ -11406,8 +11412,8 @@ struct path_switch_request_fail_ies_container {
// member variables // member variables
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_released_item_ps_fail_s, 1, 256, true> > pdu_session_res_released_list_ps_fail; ie_field_s<dyn_seq_of<pdu_session_res_released_item_ps_fail_s, 1, 256, true> > pdu_session_res_released_list_ps_fail;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
@ -11510,10 +11516,10 @@ struct rrc_inactive_transition_report_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<rrc_state_e> rrc_state; ie_field_s<rrc_state_e> rrc_state;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
// sequence methods // sequence methods
rrc_inactive_transition_report_ies_container(); rrc_inactive_transition_report_ies_container();
@ -11530,13 +11536,13 @@ struct reroute_nas_request_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool amf_ue_ngap_id_present = false; bool amf_ue_ngap_id_present = false;
bool allowed_nssai_present = false; bool allowed_nssai_present = false;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<unbounded_octstring<true> > ngap_msg; ie_field_s<unbounded_octstring<true> > ngap_msg;
ie_field_s<fixed_bitstring<10, false, true> > amf_set_id; ie_field_s<fixed_bitstring<10, false, true> > amf_set_id;
ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai; ie_field_s<dyn_seq_of<allowed_nssai_item_s, 1, 8, true> > allowed_nssai;
// sequence methods // sequence methods
reroute_nas_request_ies_container(); reroute_nas_request_ies_container();
@ -11553,9 +11559,9 @@ struct secondary_rat_data_usage_report_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool ho_flag_present = false; bool ho_flag_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_secondary_ratusage_item_s, 1, 256, true> > ie_field_s<dyn_seq_of<pdu_session_res_secondary_ratusage_item_s, 1, 256, true> >
pdu_session_res_secondary_ratusage_list; pdu_session_res_secondary_ratusage_list;
ie_field_s<ho_flag_e> ho_flag; ie_field_s<ho_flag_e> ho_flag;
@ -11575,10 +11581,10 @@ struct trace_fail_ind_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<fixed_octstring<8, true> > ngran_trace_id; ie_field_s<fixed_octstring<8, true> > ngran_trace_id;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
// sequence methods // sequence methods
trace_fail_ind_ies_container(); trace_fail_ind_ies_container();
@ -11595,9 +11601,9 @@ struct trace_start_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<trace_activation_s> trace_activation; ie_field_s<trace_activation_s> trace_activation;
// sequence methods // sequence methods
trace_start_ies_container(); trace_start_ies_container();
@ -11614,11 +11620,11 @@ struct ue_context_mod_fail_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
// sequence methods // sequence methods
ue_context_mod_fail_ies_container(); ue_context_mod_fail_ies_container();
@ -11644,8 +11650,8 @@ struct ue_context_mod_request_ies_container {
bool emergency_fallback_ind_present = false; bool emergency_fallback_ind_present = false;
bool new_amf_ue_ngap_id_present = false; bool new_amf_ue_ngap_id_present = false;
bool rrc_inactive_transition_report_request_present = false; bool rrc_inactive_transition_report_request_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio; ie_field_s<integer<uint16_t, 1, 256, false, true> > ran_paging_prio;
ie_field_s<fixed_bitstring<256, false, true> > security_key; ie_field_s<fixed_bitstring<256, false, true> > security_key;
ie_field_s<integer<uint16_t, 1, 256, true, true> > idx_to_rfsp; ie_field_s<integer<uint16_t, 1, 256, true, true> > idx_to_rfsp;
@ -11671,14 +11677,14 @@ struct ue_context_mod_resp_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool rrc_state_present = false; bool rrc_state_present = false;
bool user_location_info_present = false; bool user_location_info_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<rrc_state_e> rrc_state; ie_field_s<rrc_state_e> rrc_state;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
// sequence methods // sequence methods
ue_context_mod_resp_ies_container(); ue_context_mod_resp_ies_container();
@ -11713,13 +11719,13 @@ struct ue_context_release_complete_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool user_location_info_present = false; bool user_location_info_present = false;
bool info_on_recommended_cells_and_ran_nodes_for_paging_present = false; bool info_on_recommended_cells_and_ran_nodes_for_paging_present = false;
bool pdu_session_res_list_cxt_rel_cpl_present = false; bool pdu_session_res_list_cxt_rel_cpl_present = false;
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
ie_field_s<info_on_recommended_cells_and_ran_nodes_for_paging_s> info_on_recommended_cells_and_ran_nodes_for_paging; ie_field_s<info_on_recommended_cells_and_ran_nodes_for_paging_s> info_on_recommended_cells_and_ran_nodes_for_paging;
ie_field_s<dyn_seq_of<pdu_session_res_item_cxt_rel_cpl_s, 1, 256, true> > pdu_session_res_list_cxt_rel_cpl; ie_field_s<dyn_seq_of<pdu_session_res_item_cxt_rel_cpl_s, 1, 256, true> > pdu_session_res_list_cxt_rel_cpl;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
@ -11739,9 +11745,9 @@ struct ue_context_release_request_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool pdu_session_res_list_cxt_rel_req_present = false; bool pdu_session_res_list_cxt_rel_req_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<dyn_seq_of<pdu_session_res_item_cxt_rel_req_s, 1, 256, true> > pdu_session_res_list_cxt_rel_req; ie_field_s<dyn_seq_of<pdu_session_res_item_cxt_rel_req_s, 1, 256, true> > pdu_session_res_list_cxt_rel_req;
ie_field_s<cause_c> cause; ie_field_s<cause_c> cause;
@ -11760,10 +11766,10 @@ struct ue_radio_cap_check_request_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool ue_radio_cap_present = false; bool ue_radio_cap_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<unbounded_octstring<true> > ue_radio_cap; ie_field_s<unbounded_octstring<true> > ue_radio_cap;
// sequence methods // sequence methods
ue_radio_cap_check_request_ies_container(); ue_radio_cap_check_request_ies_container();
@ -11780,11 +11786,11 @@ struct ue_radio_cap_check_resp_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool crit_diagnostics_present = false; bool crit_diagnostics_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<ims_voice_support_ind_e> ims_voice_support_ind; ie_field_s<ims_voice_support_ind_e> ims_voice_support_ind;
ie_field_s<crit_diagnostics_s> crit_diagnostics; ie_field_s<crit_diagnostics_s> crit_diagnostics;
// sequence methods // sequence methods
ue_radio_cap_check_resp_ies_container(); ue_radio_cap_check_resp_ies_container();
@ -11801,11 +11807,11 @@ struct ue_radio_cap_info_ind_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
bool ue_radio_cap_for_paging_present = false; bool ue_radio_cap_for_paging_present = false;
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<unbounded_octstring<true> > ue_radio_cap; ie_field_s<unbounded_octstring<true> > ue_radio_cap;
ie_field_s<ue_radio_cap_for_paging_s> ue_radio_cap_for_paging; ie_field_s<ue_radio_cap_for_paging_s> ue_radio_cap_for_paging;
// sequence methods // sequence methods
ue_radio_cap_info_ind_ies_container(); ue_radio_cap_info_ind_ies_container();
@ -11822,8 +11828,8 @@ struct uetnla_binding_release_request_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
// sequence methods // sequence methods
uetnla_binding_release_request_ies_container(); uetnla_binding_release_request_ies_container();
@ -11840,10 +11846,10 @@ struct ul_nas_transport_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<unbounded_octstring<true> > nas_pdu; ie_field_s<unbounded_octstring<true> > nas_pdu;
ie_field_s<user_location_info_c> user_location_info; ie_field_s<user_location_info_c> user_location_info;
// sequence methods // sequence methods
ul_nas_transport_ies_container(); ul_nas_transport_ies_container();
@ -11899,9 +11905,9 @@ struct ul_ran_status_transfer_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<ran_status_transfer_transparent_container_s> ran_status_transfer_transparent_container; ie_field_s<ran_status_transfer_transparent_container_s> ran_status_transfer_transparent_container;
// sequence methods // sequence methods
ul_ran_status_transfer_ies_container(); ul_ran_status_transfer_ies_container();
@ -11918,10 +11924,10 @@ struct ul_ueassociated_nrp_pa_transport_ies_container {
using ie_field_s = protocol_ie_container_item_s<valueT_>; using ie_field_s = protocol_ie_container_item_s<valueT_>;
// member variables // member variables
ie_field_s<integer<uint64_t, 0, 1099511627775, false, true> > amf_ue_ngap_id; ie_field_s<amf_ue_ngap_id_t> amf_ue_ngap_id;
ie_field_s<integer<uint64_t, 0, 4294967295, false, true> > ran_ue_ngap_id; ie_field_s<ran_ue_ngap_id_t> ran_ue_ngap_id;
ie_field_s<unbounded_octstring<true> > routing_id; ie_field_s<unbounded_octstring<true> > routing_id;
ie_field_s<unbounded_octstring<true> > nrp_pa_pdu; ie_field_s<unbounded_octstring<true> > nrp_pa_pdu;
// sequence methods // sequence methods
ul_ueassociated_nrp_pa_transport_ies_container(); ul_ueassociated_nrp_pa_transport_ies_container();

File diff suppressed because it is too large Load Diff

@ -22,21 +22,30 @@
namespace asn1 { namespace asn1 {
namespace s1ap { namespace s1ap {
struct init_context_setup_request_s; struct init_context_setup_request_ies_container;
struct ue_context_mod_request_s; using init_context_setup_request_s = elementary_procedure_option<init_context_setup_request_ies_container>;
struct erab_setup_request_s; struct ue_context_mod_request_ies_container;
struct erab_release_cmd_s; using ue_context_mod_request_s = elementary_procedure_option<ue_context_mod_request_ies_container>;
struct erab_modify_request_s; struct erab_setup_request_ies_container;
using erab_setup_request_s = elementary_procedure_option<erab_setup_request_ies_container>;
struct erab_release_cmd_ies_container;
using erab_release_cmd_s = elementary_procedure_option<erab_release_cmd_ies_container>;
struct erab_modify_request_ies_container;
using erab_modify_request_s = elementary_procedure_option<erab_modify_request_ies_container>;
struct ue_paging_id_c; struct ue_paging_id_c;
struct ho_request_s; struct ho_request_ies_container;
using ho_request_s = elementary_procedure_option<ho_request_ies_container>;
struct sourceenb_to_targetenb_transparent_container_s; struct sourceenb_to_targetenb_transparent_container_s;
struct init_context_setup_resp_s; struct init_context_setup_resp_ies_container;
struct erab_setup_resp_s; using init_context_setup_resp_s = elementary_procedure_option<init_context_setup_resp_ies_container>;
struct erab_setup_resp_ies_container;
using erab_setup_resp_s = elementary_procedure_option<erab_setup_resp_ies_container>;
struct rrc_establishment_cause_opts; struct rrc_establishment_cause_opts;
struct cause_radio_network_opts; struct cause_radio_network_opts;
struct bearers_subject_to_status_transfer_item_ies_o; struct bearers_subject_to_status_transfer_item_ies_o;
struct erab_level_qos_params_s; struct erab_level_qos_params_s;
struct ho_cmd_s; struct ho_cmd_ies_container;
using ho_cmd_s = elementary_procedure_option<ho_cmd_ies_container>;
struct erab_admitted_item_s; struct erab_admitted_item_s;
struct erab_to_be_modified_item_bearer_mod_req_s; struct erab_to_be_modified_item_bearer_mod_req_s;
struct cause_c; struct cause_c;

@ -35,8 +35,8 @@ int test_amf_upd()
TESTASSERT_EQ(ngap_elem_procs_o::init_msg_c::types_opts::amf_cfg_upd, init_choice.type().value); TESTASSERT_EQ(ngap_elem_procs_o::init_msg_c::types_opts::amf_cfg_upd, init_choice.type().value);
amf_cfg_upd_s& amf_upd = init_choice.amf_cfg_upd(); amf_cfg_upd_s& amf_upd = init_choice.amf_cfg_upd();
TESTASSERT(not amf_upd.ext); TESTASSERT(not amf_upd.ext);
auto& amf_name = amf_upd.protocol_ies.amf_name; auto& amf_name = amf_upd->amf_name;
TESTASSERT(amf_upd.protocol_ies.amf_name_present); TESTASSERT(amf_upd->amf_name_present);
TESTASSERT_EQ(1, amf_name.id); TESTASSERT_EQ(1, amf_name.id);
TESTASSERT_EQ(crit_opts::reject, amf_name.crit); TESTASSERT_EQ(crit_opts::reject, amf_name.crit);
TESTASSERT_EQ("srsran", amf_name.value.to_string()); TESTASSERT_EQ("srsran", amf_name.value.to_string());
@ -70,30 +70,29 @@ int test_ngsetup_request()
ng_setup_request_s& ngsetup = pdu.init_msg().value.ng_setup_request(); ng_setup_request_s& ngsetup = pdu.init_msg().value.ng_setup_request();
TESTASSERT(not ngsetup.ext); TESTASSERT(not ngsetup.ext);
// Field 0 // Field 0
TESTASSERT(ngsetup.protocol_ies.global_ran_node_id.id == 27); TESTASSERT(ngsetup->global_ran_node_id.id == 27);
TESTASSERT(ngsetup.protocol_ies.global_ran_node_id.crit.value == crit_opts::reject); TESTASSERT(ngsetup->global_ran_node_id.crit.value == crit_opts::reject);
TESTASSERT(ngsetup.protocol_ies.global_ran_node_id.value.type().value == TESTASSERT(ngsetup->global_ran_node_id.value.type().value == global_ran_node_id_c::types_opts::global_gnb_id);
global_ran_node_id_c::types_opts::global_gnb_id); global_gnb_id_s& global_gnb = ngsetup->global_ran_node_id.value.global_gnb_id();
global_gnb_id_s& global_gnb = ngsetup.protocol_ies.global_ran_node_id.value.global_gnb_id();
TESTASSERT(global_gnb.plmn_id.to_number() == 0xF110); TESTASSERT(global_gnb.plmn_id.to_number() == 0xF110);
TESTASSERT(global_gnb.gnb_id.type().value == gnb_id_c::types_opts::gnb_id); TESTASSERT(global_gnb.gnb_id.type().value == gnb_id_c::types_opts::gnb_id);
TESTASSERT(global_gnb.gnb_id.gnb_id().to_number() == 1); TESTASSERT(global_gnb.gnb_id.gnb_id().to_number() == 1);
// Field 1 // Field 1
TESTASSERT(ngsetup.protocol_ies.ran_node_name_present); TESTASSERT(ngsetup->ran_node_name_present);
// Field 2 // Field 2
TESTASSERT(ngsetup.protocol_ies.supported_ta_list.id == 102); TESTASSERT(ngsetup->supported_ta_list.id == 102);
TESTASSERT(ngsetup.protocol_ies.supported_ta_list.crit.value == crit_opts::reject); TESTASSERT(ngsetup->supported_ta_list.crit.value == crit_opts::reject);
TESTASSERT(ngsetup.protocol_ies.supported_ta_list.value.size() == 1); TESTASSERT(ngsetup->supported_ta_list.value.size() == 1);
TESTASSERT(ngsetup.protocol_ies.supported_ta_list.value[0].tac.to_number() == 0x75); TESTASSERT(ngsetup->supported_ta_list.value[0].tac.to_number() == 0x75);
TESTASSERT(ngsetup.protocol_ies.supported_ta_list.value[0].broadcast_plmn_list.size() == 1); TESTASSERT(ngsetup->supported_ta_list.value[0].broadcast_plmn_list.size() == 1);
auto& bcast_item = ngsetup.protocol_ies.supported_ta_list.value[0].broadcast_plmn_list[0]; auto& bcast_item = ngsetup->supported_ta_list.value[0].broadcast_plmn_list[0];
TESTASSERT(bcast_item.plmn_id.to_number() == 0xF110); TESTASSERT(bcast_item.plmn_id.to_number() == 0xF110);
TESTASSERT(bcast_item.tai_slice_support_list.size()); TESTASSERT(bcast_item.tai_slice_support_list.size());
TESTASSERT(bcast_item.tai_slice_support_list[0].s_nssai.sst.to_number() == 1); TESTASSERT(bcast_item.tai_slice_support_list[0].s_nssai.sst.to_number() == 1);
// Field 3 // Field 3
TESTASSERT(ngsetup.protocol_ies.default_paging_drx.id == 21); TESTASSERT(ngsetup->default_paging_drx.id == 21);
TESTASSERT(ngsetup.protocol_ies.default_paging_drx.crit.value == crit_opts::ignore); TESTASSERT(ngsetup->default_paging_drx.crit.value == crit_opts::ignore);
TESTASSERT(ngsetup.protocol_ies.default_paging_drx.value.value == paging_drx_opts::v256); TESTASSERT(ngsetup->default_paging_drx.value.value == paging_drx_opts::v256);
TESTASSERT(ceil(bref.distance(ngap_msg) / 8.0) == sizeof(ngap_msg)); TESTASSERT(ceil(bref.distance(ngap_msg) / 8.0) == sizeof(ngap_msg));
TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS); TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS);
@ -128,19 +127,18 @@ int test_ngsetup_response()
ngap_elem_procs_o::successful_outcome_c::types_opts::ng_setup_resp); ngap_elem_procs_o::successful_outcome_c::types_opts::ng_setup_resp);
ng_setup_resp_s& resp = pdu.successful_outcome().value.ng_setup_resp(); ng_setup_resp_s& resp = pdu.successful_outcome().value.ng_setup_resp();
// field 0 // field 0
TESTASSERT(resp.protocol_ies.amf_name.id == 1); TESTASSERT(resp->amf_name.id == 1);
TESTASSERT(resp.protocol_ies.amf_name.crit.value == crit_opts::reject); TESTASSERT(resp->amf_name.crit.value == crit_opts::reject);
TESTASSERT(resp.protocol_ies.amf_name.value.size() == 56); TESTASSERT(resp->amf_name.value.size() == 56);
TESTASSERT(resp.protocol_ies.amf_name.value.to_string() == TESTASSERT(resp->amf_name.value.to_string() == "amf1.cluster1.net2.amf.5gc.mnc001.mcc001.3gppnetwork.org");
"amf1.cluster1.net2.amf.5gc.mnc001.mcc001.3gppnetwork.org");
// field 1 // field 1
TESTASSERT(resp.protocol_ies.served_guami_list.id == 96); TESTASSERT(resp->served_guami_list.id == 96);
TESTASSERT(resp.protocol_ies.served_guami_list.crit.value == crit_opts::reject); TESTASSERT(resp->served_guami_list.crit.value == crit_opts::reject);
TESTASSERT(resp.protocol_ies.served_guami_list.value.size() == 1); TESTASSERT(resp->served_guami_list.value.size() == 1);
TESTASSERT(resp.protocol_ies.served_guami_list.value[0].guami.plmn_id.to_number() == 0xF110); TESTASSERT(resp->served_guami_list.value[0].guami.plmn_id.to_number() == 0xF110);
TESTASSERT(resp.protocol_ies.served_guami_list.value[0].guami.amf_region_id.to_number() == 0b111000); TESTASSERT(resp->served_guami_list.value[0].guami.amf_region_id.to_number() == 0b111000);
TESTASSERT(resp.protocol_ies.served_guami_list.value[0].guami.amf_set_id.to_number() == 0b100010); TESTASSERT(resp->served_guami_list.value[0].guami.amf_set_id.to_number() == 0b100010);
TESTASSERT(resp.protocol_ies.served_guami_list.value[0].guami.amf_pointer.to_number() == 0b10111); TESTASSERT(resp->served_guami_list.value[0].guami.amf_pointer.to_number() == 0b10111);
// field 2 // field 2
// ... // ...
@ -172,7 +170,7 @@ int test_init_ue_msg()
TESTASSERT(pdu.init_msg().proc_code == 15); TESTASSERT(pdu.init_msg().proc_code == 15);
TESTASSERT(pdu.init_msg().crit.value == crit_opts::ignore); TESTASSERT(pdu.init_msg().crit.value == crit_opts::ignore);
TESTASSERT(pdu.init_msg().value.type().value == ngap_elem_procs_o::init_msg_c::types_opts::init_ue_msg); TESTASSERT(pdu.init_msg().value.type().value == ngap_elem_procs_o::init_msg_c::types_opts::init_ue_msg);
auto& container = pdu.init_msg().value.init_ue_msg().protocol_ies; auto& container = *pdu.init_msg().value.init_ue_msg();
// Field 0 // Field 0
TESTASSERT(container.ran_ue_ngap_id.id == 85); TESTASSERT(container.ran_ue_ngap_id.id == 85);
TESTASSERT(container.ran_ue_ngap_id.crit.value == crit_opts::reject); TESTASSERT(container.ran_ue_ngap_id.crit.value == crit_opts::reject);
@ -211,7 +209,7 @@ int test_dl_nas_transport()
// Field 0 // Field 0
// ... // ...
// Field 1 // Field 1
TESTASSERT(dl_nas.protocol_ies.nas_pdu.value.size() == 42); TESTASSERT(dl_nas->nas_pdu.value.size() == 42);
TESTASSERT(ceil(bref.distance(ngap_msg) / 8.0) == sizeof(ngap_msg)); TESTASSERT(ceil(bref.distance(ngap_msg) / 8.0) == sizeof(ngap_msg));
TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS); TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS);
@ -237,7 +235,7 @@ int test_ul_ran_status_transfer()
TESTASSERT(pdu.init_msg().value.type().value == ngap_elem_procs_o::init_msg_c::types_opts::ul_nas_transport); TESTASSERT(pdu.init_msg().value.type().value == ngap_elem_procs_o::init_msg_c::types_opts::ul_nas_transport);
auto& ul_nas = pdu.init_msg().value.ul_nas_transport(); auto& ul_nas = pdu.init_msg().value.ul_nas_transport();
// Field 1 // Field 1
TESTASSERT(ul_nas.protocol_ies.nas_pdu.value.size() == 21); TESTASSERT(ul_nas->nas_pdu.value.size() == 21);
TESTASSERT(ceil(bref.distance(ngap_msg) / 8.0) == sizeof(ngap_msg)); TESTASSERT(ceil(bref.distance(ngap_msg) / 8.0) == sizeof(ngap_msg));
TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS); TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS);
@ -308,10 +306,10 @@ int test_session_res_setup_request()
TESTASSERT(pdu.init_msg().crit.value == crit_opts::reject); TESTASSERT(pdu.init_msg().crit.value == crit_opts::reject);
TESTASSERT(pdu.init_msg().value.type().value == TESTASSERT(pdu.init_msg().value.type().value ==
ngap_elem_procs_o::init_msg_c::types_opts::pdu_session_res_setup_request); ngap_elem_procs_o::init_msg_c::types_opts::pdu_session_res_setup_request);
auto& container = pdu.init_msg().value.pdu_session_res_setup_request().protocol_ies; auto& container = pdu.init_msg().value.pdu_session_res_setup_request();
TESTASSERT(container.pdu_session_res_setup_list_su_req.id == ASN1_NGAP_ID_PDU_SESSION_RES_SETUP_LIST_SU_REQ); TESTASSERT(container->pdu_session_res_setup_list_su_req.id == ASN1_NGAP_ID_PDU_SESSION_RES_SETUP_LIST_SU_REQ);
TESTASSERT(container.pdu_session_res_setup_list_su_req.value.size() == 1); TESTASSERT(container->pdu_session_res_setup_list_su_req.value.size() == 1);
auto& item = container.pdu_session_res_setup_list_su_req.value[0]; auto& item = container->pdu_session_res_setup_list_su_req.value[0];
TESTASSERT(item.pdu_session_id == 1); TESTASSERT(item.pdu_session_id == 1);
TESTASSERT(item.s_nssai.sst.to_number() == 0); TESTASSERT(item.s_nssai.sst.to_number() == 0);
TESTASSERT(item.pdu_session_res_setup_request_transfer.to_string() == TESTASSERT(item.pdu_session_res_setup_request_transfer.to_string() ==
@ -321,10 +319,9 @@ int test_session_res_setup_request()
item.pdu_session_res_setup_request_transfer.size()); item.pdu_session_res_setup_request_transfer.size());
pdu_session_res_setup_request_transfer_s req; pdu_session_res_setup_request_transfer_s req;
TESTASSERT(req.unpack(bref2) == SRSASN_SUCCESS); TESTASSERT(req.unpack(bref2) == SRSASN_SUCCESS);
TESTASSERT(req.protocol_ies.ul_ngu_up_tnl_info.id == 139); TESTASSERT(req->ul_ngu_up_tnl_info.id == 139);
TESTASSERT(req.protocol_ies.ul_ngu_up_tnl_info.value.type().value == TESTASSERT(req->ul_ngu_up_tnl_info.value.type().value == up_transport_layer_info_c::types_opts::gtp_tunnel);
up_transport_layer_info_c::types_opts::gtp_tunnel); TESTASSERT(req->ul_ngu_up_tnl_info.value.gtp_tunnel().transport_layer_address.to_string() ==
TESTASSERT(req.protocol_ies.ul_ngu_up_tnl_info.value.gtp_tunnel().transport_layer_address.to_string() ==
"11000000101010000001000111010010"); "11000000101010000001000111010010");
TESTASSERT(bref2.distance_bytes() == (int)item.pdu_session_res_setup_request_transfer.size()); TESTASSERT(bref2.distance_bytes() == (int)item.pdu_session_res_setup_request_transfer.size());

@ -39,10 +39,10 @@ int test_s1setup_request()
TESTASSERT(init_choice.type().value == s1ap_elem_procs_o::init_msg_c::types_opts::s1_setup_request); TESTASSERT(init_choice.type().value == s1ap_elem_procs_o::init_msg_c::types_opts::s1_setup_request);
s1_setup_request_s& s1req = init_choice.s1_setup_request(); s1_setup_request_s& s1req = init_choice.s1_setup_request();
TESTASSERT(not s1req.ext); TESTASSERT(not s1req.ext);
TESTASSERT(s1req.protocol_ies.global_enb_id.id == ASN1_S1AP_ID_GLOBAL_ENB_ID); TESTASSERT(s1req->global_enb_id.id == ASN1_S1AP_ID_GLOBAL_ENB_ID);
TESTASSERT(s1req.protocol_ies.global_enb_id.crit.value == crit_opts::reject); TESTASSERT(s1req->global_enb_id.crit.value == crit_opts::reject);
TESTASSERT(s1req.protocol_ies.global_enb_id.value.enb_id.type().value == enb_id_c::types_opts::macro_enb_id); TESTASSERT(s1req->global_enb_id.value.enb_id.type().value == enb_id_c::types_opts::macro_enb_id);
TESTASSERT(s1req.protocol_ies.global_enb_id.value.enb_id.macro_enb_id().to_number() == 0x0019B); TESTASSERT(s1req->global_enb_id.value.enb_id.macro_enb_id().to_number() == 0x0019B);
// //
// // json_writer js; // // json_writer js;
// // pdu.to_json(js); // // pdu.to_json(js);
@ -77,10 +77,10 @@ int test_init_ctxt_setup_req()
TESTASSERT(pdu.init_msg().proc_code == 9); TESTASSERT(pdu.init_msg().proc_code == 9);
TESTASSERT(pdu.init_msg().crit.value == crit_opts::reject); TESTASSERT(pdu.init_msg().crit.value == crit_opts::reject);
s1ap_elem_procs_o::init_msg_c& init_choice = pdu.init_msg().value; s1ap_elem_procs_o::init_msg_c& init_choice = pdu.init_msg().value;
auto& ctxt_setup = init_choice.init_context_setup_request().protocol_ies; auto& ctxt_setup = init_choice.init_context_setup_request();
TESTASSERT(ctxt_setup.ue_security_cap.id == 107); TESTASSERT(ctxt_setup->ue_security_cap.id == 107);
TESTASSERT(ctxt_setup.ue_security_cap.value.encryption_algorithms.to_string() == "1100000000000000"); TESTASSERT(ctxt_setup->ue_security_cap.value.encryption_algorithms.to_string() == "1100000000000000");
TESTASSERT(ctxt_setup.ue_security_cap.value.integrity_protection_algorithms.to_string() == "1100000000000000"); TESTASSERT(ctxt_setup->ue_security_cap.value.integrity_protection_algorithms.to_string() == "1100000000000000");
TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS); TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS);
@ -99,11 +99,11 @@ int test_ue_ctxt_release_req()
TESTASSERT(pdu.type().value == s1ap_pdu_c::types_opts::init_msg); TESTASSERT(pdu.type().value == s1ap_pdu_c::types_opts::init_msg);
TESTASSERT(pdu.init_msg().proc_code == ASN1_S1AP_ID_UE_CONTEXT_RELEASE_REQUEST); TESTASSERT(pdu.init_msg().proc_code == ASN1_S1AP_ID_UE_CONTEXT_RELEASE_REQUEST);
auto& req = pdu.init_msg().value.ue_context_release_request().protocol_ies; auto& req = pdu.init_msg().value.ue_context_release_request();
TESTASSERT(req.mme_ue_s1ap_id.value.value == 1); TESTASSERT(req->mme_ue_s1ap_id.value.value == 1);
TESTASSERT(req.enb_ue_s1ap_id.value.value == 1); TESTASSERT(req->enb_ue_s1ap_id.value.value == 1);
TESTASSERT(req.cause.value.type().value == cause_c::types_opts::radio_network); TESTASSERT(req->cause.value.type().value == cause_c::types_opts::radio_network);
TESTASSERT(req.cause.value.radio_network().value == cause_radio_network_opts::user_inactivity); TESTASSERT(req->cause.value.radio_network().value == cause_radio_network_opts::user_inactivity);
TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS); TESTASSERT(test_pack_unpack_consistency(pdu) == SRSASN_SUCCESS);
@ -178,9 +178,9 @@ int test_ho_request()
TESTASSERT(pdu.type().value == s1ap_pdu_c::types_opts::init_msg); TESTASSERT(pdu.type().value == s1ap_pdu_c::types_opts::init_msg);
TESTASSERT(pdu.init_msg().proc_code == ASN1_S1AP_ID_HO_RES_ALLOC); TESTASSERT(pdu.init_msg().proc_code == ASN1_S1AP_ID_HO_RES_ALLOC);
TESTASSERT(pdu.init_msg().crit.value == crit_opts::reject); TESTASSERT(pdu.init_msg().crit.value == crit_opts::reject);
auto& horeq = pdu.init_msg().value.ho_request().protocol_ies; auto& horeq = pdu.init_msg().value.ho_request();
auto& erab_item = horeq.erab_to_be_setup_list_ho_req.value[0]->erab_to_be_setup_item_ho_req(); auto& erab_item = horeq->erab_to_be_setup_list_ho_req.value[0]->erab_to_be_setup_item_ho_req();
TESTASSERT(erab_item.erab_id == 5); TESTASSERT(erab_item.erab_id == 5);
TESTASSERT(erab_item.gtp_teid.to_string() == "b7361c56"); TESTASSERT(erab_item.gtp_teid.to_string() == "b7361c56");
@ -194,12 +194,13 @@ int test_enb_status_transfer()
s1ap_pdu_c pdu; s1ap_pdu_c pdu;
TESTASSERT(pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ENB_STATUS_TRANSFER)); TESTASSERT(pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ENB_STATUS_TRANSFER));
auto& enb_status_transfer = pdu.init_msg().value.enb_status_transfer().protocol_ies; auto& enb_status_transfer = pdu.init_msg().value.enb_status_transfer();
enb_status_transfer.mme_ue_s1ap_id.value.value = 1; enb_status_transfer->mme_ue_s1ap_id.value.value = 1;
enb_status_transfer.enb_ue_s1ap_id.value.value = 1; enb_status_transfer->enb_ue_s1ap_id.value.value = 1;
enb_status_transfer.enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list.resize(1); enb_status_transfer->enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list.resize(
1);
auto& bearer = auto& bearer =
enb_status_transfer.enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list[0]; enb_status_transfer->enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list[0];
TESTASSERT(bearer.load_info_obj(ASN1_S1AP_ID_BEARERS_SUBJECT_TO_STATUS_TRANSFER_ITEM)); TESTASSERT(bearer.load_info_obj(ASN1_S1AP_ID_BEARERS_SUBJECT_TO_STATUS_TRANSFER_ITEM));
auto& bearer_item = bearer->bearers_subject_to_status_transfer_item(); auto& bearer_item = bearer->bearers_subject_to_status_transfer_item();
@ -221,10 +222,9 @@ int test_enb_status_transfer()
s1ap_pdu_c pdu2; s1ap_pdu_c pdu2;
TESTASSERT(pdu2.unpack(bref2) == SRSASN_SUCCESS); TESTASSERT(pdu2.unpack(bref2) == SRSASN_SUCCESS);
auto& bearer2 = auto& bearer2 = pdu2.init_msg()
pdu2.init_msg() .value.enb_status_transfer()
.value.enb_status_transfer() ->enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list[0];
.protocol_ies.enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list[0];
auto& bearer_item2 = bearer2->bearers_subject_to_status_transfer_item(); auto& bearer_item2 = bearer2->bearers_subject_to_status_transfer_item();
TESTASSERT(bearer_item2.dl_coun_tvalue.hfn == bearer_item.dl_coun_tvalue.hfn); TESTASSERT(bearer_item2.dl_coun_tvalue.hfn == bearer_item.dl_coun_tvalue.hfn);
TESTASSERT(bearer_item2.dl_coun_tvalue.hfn == 0); TESTASSERT(bearer_item2.dl_coun_tvalue.hfn == 0);
@ -267,15 +267,15 @@ int test_initial_ctxt_setup_response()
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_INIT_CONTEXT_SETUP); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_INIT_CONTEXT_SETUP);
// Fill in the MME and eNB IDs // Fill in the MME and eNB IDs
auto& container = tx_pdu.successful_outcome().value.init_context_setup_resp().protocol_ies; auto& container = tx_pdu.successful_outcome().value.init_context_setup_resp();
container.mme_ue_s1ap_id.value = 1; container->mme_ue_s1ap_id.value = 1;
container.enb_ue_s1ap_id.value = 1; container->enb_ue_s1ap_id.value = 1;
container.erab_setup_list_ctxt_su_res.value.resize(1); container->erab_setup_list_ctxt_su_res.value.resize(1);
// Fill in the GTP bind address for all bearers // Fill in the GTP bind address for all bearers
for (uint32_t i = 0; i < container.erab_setup_list_ctxt_su_res.value.size(); ++i) { for (uint32_t i = 0; i < container->erab_setup_list_ctxt_su_res.value.size(); ++i) {
container.erab_setup_list_ctxt_su_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_SETUP_ITEM_CTXT_SU_RES); container->erab_setup_list_ctxt_su_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_SETUP_ITEM_CTXT_SU_RES);
auto& item = container.erab_setup_list_ctxt_su_res.value[i]->erab_setup_item_ctxt_su_res(); auto& item = container->erab_setup_list_ctxt_su_res.value[i]->erab_setup_item_ctxt_su_res();
item.erab_id = 1; item.erab_id = 1;
// uint32_to_uint8(teid_in, item.gtp_teid.data()); // uint32_to_uint8(teid_in, item.gtp_teid.data());
item.transport_layer_address.resize(32); item.transport_layer_address.resize(32);

@ -434,9 +434,9 @@ void rrc::ue::rrc_mobility::handle_ho_preparation_complete(rrc::ho_prep_result
} }
// Check if any E-RAB that was not admitted. Cancel Handover, in such case. // Check if any E-RAB that was not admitted. Cancel Handover, in such case.
if (msg.protocol_ies.erab_to_release_list_ho_cmd_present) { if (msg->erab_to_release_list_ho_cmd_present) {
get_logger().warning("E-RAB id=%d was not admitted in target eNB. Cancelling handover...", get_logger().warning("E-RAB id=%d was not admitted in target eNB. Cancelling handover...",
msg.protocol_ies.erab_to_release_list_ho_cmd.value[0]->erab_item().erab_id); msg->erab_to_release_list_ho_cmd.value[0]->erab_item().erab_id);
asn1::s1ap::cause_c cause; asn1::s1ap::cause_c cause;
cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::no_radio_res_available_in_target_cell; cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::no_radio_res_available_in_target_cell;
trigger(ho_cancel_ev{cause}); trigger(ho_cancel_ev{cause});
@ -622,8 +622,8 @@ rrc::ue::rrc_mobility::s1_source_ho_st::start_enb_status_transfer(const asn1::s1
} }
// Setup GTPU forwarding tunnel // Setup GTPU forwarding tunnel
if (s1ap_ho_cmd.protocol_ies.erab_subjectto_data_forwarding_list_present) { if (s1ap_ho_cmd->erab_subjectto_data_forwarding_list_present) {
const auto& fwd_erab_list = s1ap_ho_cmd.protocol_ies.erab_subjectto_data_forwarding_list.value; const auto& fwd_erab_list = s1ap_ho_cmd->erab_subjectto_data_forwarding_list.value;
const auto& erab_list = rrc_ue->bearer_list.get_erabs(); const auto& erab_list = rrc_ue->bearer_list.get_erabs();
for (const auto& e : fwd_erab_list) { for (const auto& e : fwd_erab_list) {
const auto& fwd_erab = e->erab_data_forwarding_item(); const auto& fwd_erab = e->erab_data_forwarding_item();
@ -810,7 +810,7 @@ void rrc::ue::rrc_mobility::handle_ho_requested(idle_st& s, const ho_req_rx_ev&
rrc_ue->ue_security_cfg.get_security_algorithm_cfg(); rrc_ue->ue_security_cfg.get_security_algorithm_cfg();
recfg_r8.security_cfg_ho.handov_type.intra_lte().key_change_ind = false; recfg_r8.security_cfg_ho.handov_type.intra_lte().key_change_ind = false;
recfg_r8.security_cfg_ho.handov_type.intra_lte().next_hop_chaining_count = recfg_r8.security_cfg_ho.handov_type.intra_lte().next_hop_chaining_count =
ho_req.ho_req_msg->protocol_ies.security_context.value.next_hop_chaining_count; (*ho_req.ho_req_msg)->security_context.value.next_hop_chaining_count;
/* Prepare Handover Command to be sent via S1AP */ /* Prepare Handover Command to be sent via S1AP */
srsran::unique_byte_buffer_t ho_cmd_pdu = srsran::make_byte_buffer(); srsran::unique_byte_buffer_t ho_cmd_pdu = srsran::make_byte_buffer();
@ -935,7 +935,7 @@ bool rrc::ue::rrc_mobility::apply_ho_prep_cfg(const ho_prep_info_r8_ies_s&
const cell_cfg_t& target_cell_cfg = target_cell->cell_common->cell_cfg; const cell_cfg_t& target_cell_cfg = target_cell->cell_common->cell_cfg;
// Establish ERABs/DRBs // Establish ERABs/DRBs
for (const auto& erab_item : ho_req_msg.protocol_ies.erab_to_be_setup_list_ho_req.value) { for (const auto& erab_item : ho_req_msg->erab_to_be_setup_list_ho_req.value) {
const auto& erab = erab_item->erab_to_be_setup_item_ho_req(); const auto& erab = erab_item->erab_to_be_setup_item_ho_req();
if (erab.ext) { if (erab.ext) {
get_logger().warning("Not handling E-RABToBeSetupList extensions"); get_logger().warning("Not handling E-RABToBeSetupList extensions");
@ -972,13 +972,13 @@ bool rrc::ue::rrc_mobility::apply_ho_prep_cfg(const ho_prep_info_r8_ies_s&
// Regenerate AS Keys // Regenerate AS Keys
// See TS 33.401, Sec. 7.2.8.4.3 // See TS 33.401, Sec. 7.2.8.4.3
if (not rrc_ue->ue_security_cfg.set_security_capabilities(ho_req_msg.protocol_ies.ue_security_cap.value)) { if (not rrc_ue->ue_security_cfg.set_security_capabilities(ho_req_msg->ue_security_cap.value)) {
cause.set_radio_network().value = cause.set_radio_network().value =
asn1::s1ap::cause_radio_network_opts::encryption_and_or_integrity_protection_algorithms_not_supported; asn1::s1ap::cause_radio_network_opts::encryption_and_or_integrity_protection_algorithms_not_supported;
return false; return false;
} }
rrc_ue->ue_security_cfg.set_security_key(ho_req_msg.protocol_ies.security_context.value.next_hop_param); rrc_ue->ue_security_cfg.set_security_key(ho_req_msg->security_context.value.next_hop_param);
rrc_ue->ue_security_cfg.set_ncc(ho_req_msg.protocol_ies.security_context.value.next_hop_chaining_count); rrc_ue->ue_security_cfg.set_ncc(ho_req_msg->security_context.value.next_hop_chaining_count);
rrc_ue->ue_security_cfg.regenerate_keys_handover(target_cell_cfg.pci, target_cell_cfg.dl_earfcn); rrc_ue->ue_security_cfg.regenerate_keys_handover(target_cell_cfg.pci, target_cell_cfg.dl_earfcn);
// Save UE Capabilities // Save UE Capabilities

@ -1136,14 +1136,14 @@ void rrc::ue::send_connection_release()
*/ */
void rrc::ue::handle_ue_init_ctxt_setup_req(const asn1::s1ap::init_context_setup_request_s& msg) void rrc::ue::handle_ue_init_ctxt_setup_req(const asn1::s1ap::init_context_setup_request_s& msg)
{ {
set_bitrates(msg.protocol_ies.ueaggregate_maximum_bitrate.value); set_bitrates(msg->ueaggregate_maximum_bitrate.value);
ue_security_cfg.set_security_capabilities(msg.protocol_ies.ue_security_cap.value); ue_security_cfg.set_security_capabilities(msg->ue_security_cap.value);
ue_security_cfg.set_security_key(msg.protocol_ies.security_key.value); ue_security_cfg.set_security_key(msg->security_key.value);
// CSFB // CSFB
if (msg.protocol_ies.cs_fallback_ind_present) { if (msg->cs_fallback_ind_present) {
if (msg.protocol_ies.cs_fallback_ind.value.value == asn1::s1ap::cs_fallback_ind_opts::cs_fallback_required or if (msg->cs_fallback_ind.value.value == asn1::s1ap::cs_fallback_ind_opts::cs_fallback_required or
msg.protocol_ies.cs_fallback_ind.value.value == asn1::s1ap::cs_fallback_ind_opts::cs_fallback_high_prio) { msg->cs_fallback_ind.value.value == asn1::s1ap::cs_fallback_ind_opts::cs_fallback_high_prio) {
is_csfb = true; is_csfb = true;
} }
} }
@ -1154,25 +1154,25 @@ void rrc::ue::handle_ue_init_ctxt_setup_req(const asn1::s1ap::init_context_setup
bool rrc::ue::handle_ue_ctxt_mod_req(const asn1::s1ap::ue_context_mod_request_s& msg) bool rrc::ue::handle_ue_ctxt_mod_req(const asn1::s1ap::ue_context_mod_request_s& msg)
{ {
if (msg.protocol_ies.cs_fallback_ind_present) { if (msg->cs_fallback_ind_present) {
if (msg.protocol_ies.cs_fallback_ind.value.value == asn1::s1ap::cs_fallback_ind_opts::cs_fallback_required || if (msg->cs_fallback_ind.value.value == asn1::s1ap::cs_fallback_ind_opts::cs_fallback_required ||
msg.protocol_ies.cs_fallback_ind.value.value == asn1::s1ap::cs_fallback_ind_opts::cs_fallback_high_prio) { msg->cs_fallback_ind.value.value == asn1::s1ap::cs_fallback_ind_opts::cs_fallback_high_prio) {
/* Remember that we are in a CSFB right now */ /* Remember that we are in a CSFB right now */
is_csfb = true; is_csfb = true;
} }
} }
// UEAggregateMaximumBitrate // UEAggregateMaximumBitrate
if (msg.protocol_ies.ueaggregate_maximum_bitrate_present) { if (msg->ueaggregate_maximum_bitrate_present) {
set_bitrates(msg.protocol_ies.ueaggregate_maximum_bitrate.value); set_bitrates(msg->ueaggregate_maximum_bitrate.value);
} }
if (msg.protocol_ies.ue_security_cap_present) { if (msg->ue_security_cap_present) {
ue_security_cfg.set_security_capabilities(msg.protocol_ies.ue_security_cap.value); ue_security_cfg.set_security_capabilities(msg->ue_security_cap.value);
} }
if (msg.protocol_ies.security_key_present) { if (msg->security_key_present) {
ue_security_cfg.set_security_key(msg.protocol_ies.security_key.value); ue_security_cfg.set_security_key(msg->security_key.value);
send_security_mode_command(); send_security_mode_command();
} }

@ -149,7 +149,7 @@ srsran::proc_outcome_t s1ap::ue::ho_prep_proc_t::react(const ho_prep_fail_s& msg
{ {
ue_ptr->ts1_reloc_prep.stop(); ue_ptr->ts1_reloc_prep.stop();
std::string cause = s1ap_ptr->get_cause(msg.protocol_ies.cause.value); std::string cause = s1ap_ptr->get_cause(msg->cause.value);
procError("HO preparation Failure. Cause: %s", cause.c_str()); procError("HO preparation Failure. Cause: %s", cause.c_str());
srsran::console("HO preparation Failure. Cause: %s\n", cause.c_str()); srsran::console("HO preparation Failure. Cause: %s\n", cause.c_str());
@ -167,16 +167,16 @@ srsran::proc_outcome_t s1ap::ue::ho_prep_proc_t::react(const asn1::s1ap::ho_cmd_
ue_ptr->ts1_reloc_overall.run(); ue_ptr->ts1_reloc_overall.run();
// Check for unsupported S1AP fields // Check for unsupported S1AP fields
if (msg.ext or msg.protocol_ies.target_to_source_transparent_container_secondary_present or if (msg.ext or msg->target_to_source_transparent_container_secondary_present or
msg.protocol_ies.handov_type.value.value != handov_type_opts::intralte or msg->handov_type.value.value != handov_type_opts::intralte or msg->crit_diagnostics_present or
msg.protocol_ies.crit_diagnostics_present or msg.protocol_ies.nas_security_paramsfrom_e_utran_present) { msg->nas_security_paramsfrom_e_utran_present) {
procWarning("Not handling HandoverCommand extensions and non-intraLTE params"); procWarning("Not handling HandoverCommand extensions and non-intraLTE params");
} }
// In case of intra-system Handover, Target to Source Transparent Container IE shall be encoded as // In case of intra-system Handover, Target to Source Transparent Container IE shall be encoded as
// Target eNB to Source eNB Transparent Container IE // Target eNB to Source eNB Transparent Container IE
asn1::cbit_ref bref(msg.protocol_ies.target_to_source_transparent_container.value.data(), asn1::cbit_ref bref(msg->target_to_source_transparent_container.value.data(),
msg.protocol_ies.target_to_source_transparent_container.value.size()); msg->target_to_source_transparent_container.value.size());
asn1::s1ap::targetenb_to_sourceenb_transparent_container_s container; asn1::s1ap::targetenb_to_sourceenb_transparent_container_s container;
if (container.unpack(bref) != asn1::SRSASN_SUCCESS) { if (container.unpack(bref) != asn1::SRSASN_SUCCESS) {
procError("Failed to decode TargeteNBToSourceeNBTransparentContainer"); procError("Failed to decode TargeteNBToSourceeNBTransparentContainer");
@ -528,25 +528,25 @@ bool s1ap::setup_s1()
s1ap_pdu_c pdu; s1ap_pdu_c pdu;
pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_S1_SETUP); pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_S1_SETUP);
s1_setup_request_ies_container& container = pdu.init_msg().value.s1_setup_request().protocol_ies; s1_setup_request_s& container = pdu.init_msg().value.s1_setup_request();
container.global_enb_id.value.plm_nid[0] = ((uint8_t*)&plmn)[1]; container->global_enb_id.value.plm_nid[0] = ((uint8_t*)&plmn)[1];
container.global_enb_id.value.plm_nid[1] = ((uint8_t*)&plmn)[2]; container->global_enb_id.value.plm_nid[1] = ((uint8_t*)&plmn)[2];
container.global_enb_id.value.plm_nid[2] = ((uint8_t*)&plmn)[3]; container->global_enb_id.value.plm_nid[2] = ((uint8_t*)&plmn)[3];
container.global_enb_id.value.enb_id.set_macro_enb_id().from_number(args.enb_id); container->global_enb_id.value.enb_id.set_macro_enb_id().from_number(args.enb_id);
container.enbname_present = true; container->enbname_present = true;
container.enbname.value.from_string(args.enb_name); container->enbname.value.from_string(args.enb_name);
container.supported_tas.value.resize(1); container->supported_tas.value.resize(1);
tmp16 = htons(args.tac); tmp16 = htons(args.tac);
memcpy(container.supported_tas.value[0].tac.data(), (uint8_t*)&tmp16, 2); memcpy(container->supported_tas.value[0].tac.data(), (uint8_t*)&tmp16, 2);
container.supported_tas.value[0].broadcast_plmns.resize(1); container->supported_tas.value[0].broadcast_plmns.resize(1);
container.supported_tas.value[0].broadcast_plmns[0][0] = ((uint8_t*)&plmn)[1]; container->supported_tas.value[0].broadcast_plmns[0][0] = ((uint8_t*)&plmn)[1];
container.supported_tas.value[0].broadcast_plmns[0][1] = ((uint8_t*)&plmn)[2]; container->supported_tas.value[0].broadcast_plmns[0][1] = ((uint8_t*)&plmn)[2];
container.supported_tas.value[0].broadcast_plmns[0][2] = ((uint8_t*)&plmn)[3]; container->supported_tas.value[0].broadcast_plmns[0][2] = ((uint8_t*)&plmn)[3];
container.default_paging_drx.value.value = asn1::s1ap::paging_drx_opts::v128; // Todo: add to args, config file container->default_paging_drx.value.value = asn1::s1ap::paging_drx_opts::v128; // Todo: add to args, config file
return sctp_send_s1ap_pdu(pdu, 0, "s1SetupRequest"); return sctp_send_s1ap_pdu(pdu, 0, "s1SetupRequest");
} }
@ -732,16 +732,15 @@ bool s1ap::handle_dlnastransport(const dl_nas_transport_s& msg)
if (msg.ext) { if (msg.ext) {
logger.warning("Not handling S1AP message extension"); logger.warning("Not handling S1AP message extension");
} }
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
if (msg.protocol_ies.ho_restrict_list_present) { if (msg->ho_restrict_list_present) {
logger.warning("Not handling HandoverRestrictionList"); logger.warning("Not handling HandoverRestrictionList");
} }
if (msg.protocol_ies.subscriber_profile_idfor_rfp_present) { if (msg->subscriber_profile_idfor_rfp_present) {
logger.warning("Not handling SubscriberProfileIDforRFP"); logger.warning("Not handling SubscriberProfileIDforRFP");
} }
@ -750,31 +749,29 @@ bool s1ap::handle_dlnastransport(const dl_nas_transport_s& msg)
logger.error("Fatal Error: Couldn't allocate buffer in s1ap::run_thread()."); logger.error("Fatal Error: Couldn't allocate buffer in s1ap::run_thread().");
return false; return false;
} }
memcpy(pdu->msg, msg.protocol_ies.nas_pdu.value.data(), msg.protocol_ies.nas_pdu.value.size()); memcpy(pdu->msg, msg->nas_pdu.value.data(), msg->nas_pdu.value.size());
pdu->N_bytes = msg.protocol_ies.nas_pdu.value.size(); pdu->N_bytes = msg->nas_pdu.value.size();
rrc->write_dl_info(u->ctxt.rnti, std::move(pdu)); rrc->write_dl_info(u->ctxt.rnti, std::move(pdu));
return true; return true;
} }
bool s1ap::handle_initialctxtsetuprequest(const init_context_setup_request_s& msg) bool s1ap::handle_initialctxtsetuprequest(const init_context_setup_request_s& msg)
{ {
const auto& prot_ies = msg.protocol_ies;
WarnUnsupportFeature(msg.ext, "message extension"); WarnUnsupportFeature(msg.ext, "message extension");
WarnUnsupportFeature(prot_ies.add_cs_fallback_ind_present, "AdditionalCSFallbackIndicator"); WarnUnsupportFeature(msg->add_cs_fallback_ind_present, "AdditionalCSFallbackIndicator");
WarnUnsupportFeature(prot_ies.csg_membership_status_present, "CSGMembershipStatus"); WarnUnsupportFeature(msg->csg_membership_status_present, "CSGMembershipStatus");
WarnUnsupportFeature(prot_ies.gummei_id_present, "GUMMEI_ID"); WarnUnsupportFeature(msg->gummei_id_present, "GUMMEI_ID");
WarnUnsupportFeature(prot_ies.ho_restrict_list_present, "HandoverRestrictionList"); WarnUnsupportFeature(msg->ho_restrict_list_present, "HandoverRestrictionList");
WarnUnsupportFeature(prot_ies.management_based_mdt_allowed_present, "ManagementBasedMDTAllowed"); WarnUnsupportFeature(msg->management_based_mdt_allowed_present, "ManagementBasedMDTAllowed");
WarnUnsupportFeature(prot_ies.management_based_mdtplmn_list_present, "ManagementBasedMDTPLMNList"); WarnUnsupportFeature(msg->management_based_mdtplmn_list_present, "ManagementBasedMDTPLMNList");
WarnUnsupportFeature(prot_ies.mme_ue_s1ap_id_minus2_present, "MME_UE_S1AP_ID_2"); WarnUnsupportFeature(msg->mme_ue_s1ap_id_minus2_present, "MME_UE_S1AP_ID_2");
WarnUnsupportFeature(prot_ies.registered_lai_present, "RegisteredLAI"); WarnUnsupportFeature(msg->registered_lai_present, "RegisteredLAI");
WarnUnsupportFeature(prot_ies.srvcc_operation_possible_present, "SRVCCOperationPossible"); WarnUnsupportFeature(msg->srvcc_operation_possible_present, "SRVCCOperationPossible");
WarnUnsupportFeature(prot_ies.subscriber_profile_idfor_rfp_present, "SubscriberProfileIDforRFP"); WarnUnsupportFeature(msg->subscriber_profile_idfor_rfp_present, "SubscriberProfileIDforRFP");
WarnUnsupportFeature(prot_ies.trace_activation_present, "TraceActivation"); WarnUnsupportFeature(msg->trace_activation_present, "TraceActivation");
WarnUnsupportFeature(prot_ies.ue_radio_cap_present, "UERadioCapability"); WarnUnsupportFeature(msg->ue_radio_cap_present, "UERadioCapability");
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
@ -787,9 +784,9 @@ bool s1ap::handle_initialctxtsetuprequest(const init_context_setup_request_s& ms
// Update E-RABs // Update E-RABs
erab_id_list updated_erabs; erab_id_list updated_erabs;
erab_item_list failed_cfg_erabs; erab_item_list failed_cfg_erabs;
add_repeated_erab_ids(prot_ies.erab_to_be_setup_list_ctxt_su_req.value, failed_cfg_erabs); add_repeated_erab_ids(msg->erab_to_be_setup_list_ctxt_su_req.value, failed_cfg_erabs);
for (const auto& item : msg.protocol_ies.erab_to_be_setup_list_ctxt_su_req.value) { for (const auto& item : msg->erab_to_be_setup_list_ctxt_su_req.value) {
const auto& erab = item->erab_to_be_setup_item_ctxt_su_req(); const auto& erab = item->erab_to_be_setup_item_ctxt_su_req();
if (contains_erab_id(failed_cfg_erabs, erab.erab_id)) { if (contains_erab_id(failed_cfg_erabs, erab.erab_id)) {
// E-RAB is duplicate // E-RAB is duplicate
@ -823,9 +820,9 @@ bool s1ap::handle_initialctxtsetuprequest(const init_context_setup_request_s& ms
} }
/* Ideally the check below would be "if (users[rnti].is_csfb)" */ /* Ideally the check below would be "if (users[rnti].is_csfb)" */
if (msg.protocol_ies.cs_fallback_ind_present) { if (msg->cs_fallback_ind_present) {
if (msg.protocol_ies.cs_fallback_ind.value.value == cs_fallback_ind_opts::cs_fallback_required || if (msg->cs_fallback_ind.value.value == cs_fallback_ind_opts::cs_fallback_required ||
msg.protocol_ies.cs_fallback_ind.value.value == cs_fallback_ind_opts::cs_fallback_high_prio) { msg->cs_fallback_ind.value.value == cs_fallback_ind_opts::cs_fallback_high_prio) {
// Send RRC Release (cs-fallback-triggered) to MME // Send RRC Release (cs-fallback-triggered) to MME
cause_c cause; cause_c cause;
cause.set_radio_network().value = cause_radio_network_opts::cs_fallback_triggered; cause.set_radio_network().value = cause_radio_network_opts::cs_fallback_triggered;
@ -845,8 +842,8 @@ bool s1ap::handle_paging(const asn1::s1ap::paging_s& msg)
{ {
WarnUnsupportFeature(msg.ext, "S1AP message extension"); WarnUnsupportFeature(msg.ext, "S1AP message extension");
uint32_t ueid = msg.protocol_ies.ue_id_idx_value.value.to_number(); uint32_t ueid = msg->ue_id_idx_value.value.to_number();
rrc->add_paging_id(ueid, msg.protocol_ies.ue_paging_id.value); rrc->add_paging_id(ueid, msg->ue_paging_id.value);
return true; return true;
} }
@ -854,21 +851,20 @@ bool s1ap::handle_erabsetuprequest(const erab_setup_request_s& msg)
{ {
WarnUnsupportFeature(msg.ext, "S1AP message extension"); WarnUnsupportFeature(msg.ext, "S1AP message extension");
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
if (msg.protocol_ies.ueaggregate_maximum_bitrate_present) { if (msg->ueaggregate_maximum_bitrate_present) {
rrc->set_aggregate_max_bitrate(u->ctxt.rnti, msg.protocol_ies.ueaggregate_maximum_bitrate.value); rrc->set_aggregate_max_bitrate(u->ctxt.rnti, msg->ueaggregate_maximum_bitrate.value);
} }
erab_id_list updated_erabs; erab_id_list updated_erabs;
erab_item_list failed_cfg_erabs; erab_item_list failed_cfg_erabs;
add_repeated_erab_ids(msg.protocol_ies.erab_to_be_setup_list_bearer_su_req.value, failed_cfg_erabs); add_repeated_erab_ids(msg->erab_to_be_setup_list_bearer_su_req.value, failed_cfg_erabs);
for (const auto& item : msg.protocol_ies.erab_to_be_setup_list_bearer_su_req.value) { for (const auto& item : msg->erab_to_be_setup_list_bearer_su_req.value) {
const auto& erab = item->erab_to_be_setup_item_bearer_su_req(); const auto& erab = item->erab_to_be_setup_item_bearer_su_req();
if (contains_erab_id(failed_cfg_erabs, erab.erab_id)) { if (contains_erab_id(failed_cfg_erabs, erab.erab_id)) {
// E-RAB is duplicate // E-RAB is duplicate
@ -914,21 +910,20 @@ bool s1ap::handle_erabmodifyrequest(const erab_modify_request_s& msg)
{ {
WarnUnsupportFeature(msg.ext, "S1AP message extension"); WarnUnsupportFeature(msg.ext, "S1AP message extension");
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
if (msg.protocol_ies.ueaggregate_maximum_bitrate_present) { if (msg->ueaggregate_maximum_bitrate_present) {
rrc->set_aggregate_max_bitrate(u->ctxt.rnti, msg.protocol_ies.ueaggregate_maximum_bitrate.value); rrc->set_aggregate_max_bitrate(u->ctxt.rnti, msg->ueaggregate_maximum_bitrate.value);
} }
erab_id_list updated_erabs; erab_id_list updated_erabs;
erab_item_list failed_cfg_erabs; erab_item_list failed_cfg_erabs;
add_repeated_erab_ids(msg.protocol_ies.erab_to_be_modified_list_bearer_mod_req.value, failed_cfg_erabs); add_repeated_erab_ids(msg->erab_to_be_modified_list_bearer_mod_req.value, failed_cfg_erabs);
for (const auto& item : msg.protocol_ies.erab_to_be_modified_list_bearer_mod_req.value) { for (const auto& item : msg->erab_to_be_modified_list_bearer_mod_req.value) {
const auto& erab = item->erab_to_be_modified_item_bearer_mod_req(); const auto& erab = item->erab_to_be_modified_item_bearer_mod_req();
if (contains_erab_id(failed_cfg_erabs, erab.erab_id)) { if (contains_erab_id(failed_cfg_erabs, erab.erab_id)) {
// E-RAB is duplicate // E-RAB is duplicate
@ -969,8 +964,7 @@ bool s1ap::handle_erabreleasecommand(const erab_release_cmd_s& msg)
{ {
WarnUnsupportFeature(msg.ext, "S1AP message extension"); WarnUnsupportFeature(msg.ext, "S1AP message extension");
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
@ -984,7 +978,7 @@ bool s1ap::handle_erabreleasecommand(const erab_release_cmd_s& msg)
return e.erab_id == erab_id; return e.erab_id == erab_id;
})); }));
}; };
for (const auto& item : msg.protocol_ies.erab_to_be_released_list.value) { for (const auto& item : msg->erab_to_be_released_list.value) {
const auto& erab = item->erab_item(); const auto& erab = item->erab_item();
if (is_repeated_erab_id(erab.erab_id)) { if (is_repeated_erab_id(erab.erab_id)) {
@ -1003,7 +997,7 @@ bool s1ap::handle_erabreleasecommand(const erab_release_cmd_s& msg)
// Notify RRC of E-RAB update. (RRC reconf message is going to be sent. // Notify RRC of E-RAB update. (RRC reconf message is going to be sent.
if (not updated_erabs.empty()) { if (not updated_erabs.empty()) {
rrc->notify_ue_erab_updates(u->ctxt.rnti, msg.protocol_ies.nas_pdu.value); rrc->notify_ue_erab_updates(u->ctxt.rnti, msg->nas_pdu.value);
} }
// Send E-RAB release response back to the MME // Send E-RAB release response back to the MME
@ -1019,13 +1013,12 @@ bool s1ap::handle_erabreleasecommand(const erab_release_cmd_s& msg)
bool s1ap::handle_uecontextmodifyrequest(const ue_context_mod_request_s& msg) bool s1ap::handle_uecontextmodifyrequest(const ue_context_mod_request_s& msg)
{ {
WarnUnsupportFeature(msg.ext, "S1AP message extension"); WarnUnsupportFeature(msg.ext, "S1AP message extension");
WarnUnsupportFeature(msg.protocol_ies.add_cs_fallback_ind_present, "AdditionalCSFallbackIndicator"); WarnUnsupportFeature(msg->add_cs_fallback_ind_present, "AdditionalCSFallbackIndicator");
WarnUnsupportFeature(msg.protocol_ies.csg_membership_status_present, "CSGMembershipStatus"); WarnUnsupportFeature(msg->csg_membership_status_present, "CSGMembershipStatus");
WarnUnsupportFeature(msg.protocol_ies.registered_lai_present, "RegisteredLAI"); WarnUnsupportFeature(msg->registered_lai_present, "RegisteredLAI");
WarnUnsupportFeature(msg.protocol_ies.subscriber_profile_idfor_rfp_present, "SubscriberProfileIDforRFP"); WarnUnsupportFeature(msg->subscriber_profile_idfor_rfp_present, "SubscriberProfileIDforRFP");
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
@ -1041,9 +1034,9 @@ bool s1ap::handle_uecontextmodifyrequest(const ue_context_mod_request_s& msg)
u->send_uectxtmodifyresp(); u->send_uectxtmodifyresp();
/* Ideally the check below would be "if (users[rnti].is_csfb)" */ /* Ideally the check below would be "if (users[rnti].is_csfb)" */
if (msg.protocol_ies.cs_fallback_ind_present) { if (msg->cs_fallback_ind_present) {
if (msg.protocol_ies.cs_fallback_ind.value.value == cs_fallback_ind_opts::cs_fallback_required || if (msg->cs_fallback_ind.value.value == cs_fallback_ind_opts::cs_fallback_required ||
msg.protocol_ies.cs_fallback_ind.value.value == cs_fallback_ind_opts::cs_fallback_high_prio) { msg->cs_fallback_ind.value.value == cs_fallback_ind_opts::cs_fallback_high_prio) {
// Send RRC Release (cs-fallback-triggered) to MME // Send RRC Release (cs-fallback-triggered) to MME
cause_c cause; cause_c cause;
cause.set_radio_network().value = cause_radio_network_opts::cs_fallback_triggered; cause.set_radio_network().value = cause_radio_network_opts::cs_fallback_triggered;
@ -1060,8 +1053,8 @@ bool s1ap::handle_uectxtreleasecommand(const ue_context_release_cmd_s& msg)
WarnUnsupportFeature(msg.ext, "S1AP message extension"); WarnUnsupportFeature(msg.ext, "S1AP message extension");
ue* u = nullptr; ue* u = nullptr;
if (msg.protocol_ies.ue_s1ap_ids.value.type().value == ue_s1ap_ids_c::types_opts::ue_s1ap_id_pair) { if (msg->ue_s1ap_ids.value.type().value == ue_s1ap_ids_c::types_opts::ue_s1ap_id_pair) {
const auto& idpair = msg.protocol_ies.ue_s1ap_ids.value.ue_s1ap_id_pair(); const auto& idpair = msg->ue_s1ap_ids.value.ue_s1ap_id_pair();
if (idpair.ext) { if (idpair.ext) {
logger.warning("Not handling S1AP message extension"); logger.warning("Not handling S1AP message extension");
@ -1074,7 +1067,7 @@ bool s1ap::handle_uectxtreleasecommand(const ue_context_release_cmd_s& msg)
return false; return false;
} }
} else { } else {
uint32_t mme_ue_id = msg.protocol_ies.ue_s1ap_ids.value.mme_ue_s1ap_id(); uint32_t mme_ue_id = msg->ue_s1ap_ids.value.mme_ue_s1ap_id();
u = users.find_ue_mmeid(mme_ue_id); u = users.find_ue_mmeid(mme_ue_id);
if (u == nullptr) { if (u == nullptr) {
logger.warning("UE for mme_ue_s1ap_id:%d not found - discarding message", mme_ue_id); logger.warning("UE for mme_ue_s1ap_id:%d not found - discarding message", mme_ue_id);
@ -1100,7 +1093,7 @@ bool s1ap::handle_s1setupfailure(const asn1::s1ap::s1_setup_fail_s& msg)
return false; return false;
} }
std::string cause = get_cause(msg.protocol_ies.cause.value); std::string cause = get_cause(msg->cause.value);
logger.error("S1 Setup Failure. Cause: %s", cause.c_str()); logger.error("S1 Setup Failure. Cause: %s", cause.c_str());
srsran::console("S1 Setup Failure. Cause: %s\n", cause.c_str()); srsran::console("S1 Setup Failure. Cause: %s\n", cause.c_str());
return true; return true;
@ -1108,8 +1101,7 @@ bool s1ap::handle_s1setupfailure(const asn1::s1ap::s1_setup_fail_s& msg)
bool s1ap::handle_handover_preparation_failure(const ho_prep_fail_s& msg) bool s1ap::handle_handover_preparation_failure(const ho_prep_fail_s& msg)
{ {
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
@ -1127,8 +1119,7 @@ bool s1ap::handle_handover_preparation_failure(const ho_prep_fail_s& msg)
bool s1ap::handle_handover_command(const asn1::s1ap::ho_cmd_s& msg) bool s1ap::handle_handover_command(const asn1::s1ap::ho_cmd_s& msg)
{ {
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
@ -1150,15 +1141,15 @@ bool s1ap::handle_handover_command(const asn1::s1ap::ho_cmd_s& msg)
bool s1ap::handle_handover_request(const asn1::s1ap::ho_request_s& msg) bool s1ap::handle_handover_request(const asn1::s1ap::ho_request_s& msg)
{ {
uint16_t rnti = SRSRAN_INVALID_RNTI; uint16_t rnti = SRSRAN_INVALID_RNTI;
uint32_t mme_ue_s1ap_id = msg.protocol_ies.mme_ue_s1ap_id.value.value; uint32_t mme_ue_s1ap_id = msg->mme_ue_s1ap_id.value.value;
asn1::s1ap::cause_c cause; asn1::s1ap::cause_c cause;
cause.set_misc().value = cause_misc_opts::unspecified; cause.set_misc().value = cause_misc_opts::unspecified;
if (msg.ext or msg.protocol_ies.ho_restrict_list_present) { if (msg.ext or msg->ho_restrict_list_present) {
logger.warning("Not handling S1AP Handover Request extensions or Handover Restriction List"); logger.warning("Not handling S1AP Handover Request extensions or Handover Restriction List");
} }
if (msg.protocol_ies.handov_type.value.value != handov_type_opts::intralte) { if (msg->handov_type.value.value != handov_type_opts::intralte) {
logger.error("Not handling S1AP non-intra LTE handovers"); logger.error("Not handling S1AP non-intra LTE handovers");
cause.set_radio_network().value = cause_radio_network_opts::interrat_redirection; cause.set_radio_network().value = cause_radio_network_opts::interrat_redirection;
send_ho_failure(mme_ue_s1ap_id, cause); send_ho_failure(mme_ue_s1ap_id, cause);
@ -1166,9 +1157,9 @@ bool s1ap::handle_handover_request(const asn1::s1ap::ho_request_s& msg)
} }
// Confirm the UE does not exist in TeNB // Confirm the UE does not exist in TeNB
if (users.find_ue_mmeid(msg.protocol_ies.mme_ue_s1ap_id.value.value) != nullptr) { if (users.find_ue_mmeid(msg->mme_ue_s1ap_id.value.value) != nullptr) {
logger.error("The provided MME_UE_S1AP_ID=%" PRIu64 " is already connected to the cell", logger.error("The provided MME_UE_S1AP_ID=%" PRIu64 " is already connected to the cell",
msg.protocol_ies.mme_ue_s1ap_id.value.value); msg->mme_ue_s1ap_id.value.value);
cause.set_radio_network().value = cause_radio_network_opts::unknown_mme_ue_s1ap_id; cause.set_radio_network().value = cause_radio_network_opts::unknown_mme_ue_s1ap_id;
send_ho_failure(mme_ue_s1ap_id, cause); send_ho_failure(mme_ue_s1ap_id, cause);
return false; return false;
@ -1176,13 +1167,13 @@ bool s1ap::handle_handover_request(const asn1::s1ap::ho_request_s& msg)
// Create user ctxt object and associated MME context // Create user ctxt object and associated MME context
std::unique_ptr<ue> ue_ptr{new ue{this}}; std::unique_ptr<ue> ue_ptr{new ue{this}};
ue_ptr->ctxt.mme_ue_s1ap_id = msg.protocol_ies.mme_ue_s1ap_id.value.value; ue_ptr->ctxt.mme_ue_s1ap_id = msg->mme_ue_s1ap_id.value.value;
srsran_assert(users.add_user(std::move(ue_ptr)) != nullptr, "Unexpected failure to create S1AP UE"); srsran_assert(users.add_user(std::move(ue_ptr)) != nullptr, "Unexpected failure to create S1AP UE");
// Unpack Transparent Container // Unpack Transparent Container
sourceenb_to_targetenb_transparent_container_s container; sourceenb_to_targetenb_transparent_container_s container;
asn1::cbit_ref bref{msg.protocol_ies.source_to_target_transparent_container.value.data(), asn1::cbit_ref bref{msg->source_to_target_transparent_container.value.data(),
msg.protocol_ies.source_to_target_transparent_container.value.size()}; msg->source_to_target_transparent_container.value.size()};
if (container.unpack(bref) != asn1::SRSASN_SUCCESS) { if (container.unpack(bref) != asn1::SRSASN_SUCCESS) {
logger.warning("Failed to unpack SourceToTargetTransparentContainer"); logger.warning("Failed to unpack SourceToTargetTransparentContainer");
cause.set_protocol().value = cause_protocol_opts::transfer_syntax_error; cause.set_protocol().value = cause_protocol_opts::transfer_syntax_error;
@ -1209,10 +1200,10 @@ void s1ap::send_ho_failure(uint32_t mme_ue_s1ap_id, const asn1::s1ap::cause_c& c
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_unsuccessful_outcome().load_info_obj(ASN1_S1AP_ID_HO_RES_ALLOC); tx_pdu.set_unsuccessful_outcome().load_info_obj(ASN1_S1AP_ID_HO_RES_ALLOC);
ho_fail_ies_container& container = tx_pdu.unsuccessful_outcome().value.ho_fail().protocol_ies; ho_fail_s& container = tx_pdu.unsuccessful_outcome().value.ho_fail();
container.mme_ue_s1ap_id.value = mme_ue_s1ap_id; container->mme_ue_s1ap_id.value = mme_ue_s1ap_id;
container.cause.value = cause; container->cause.value = cause;
sctp_send_s1ap_pdu(tx_pdu, SRSRAN_INVALID_RNTI, "HandoverFailure"); sctp_send_s1ap_pdu(tx_pdu, SRSRAN_INVALID_RNTI, "HandoverFailure");
} }
@ -1226,24 +1217,24 @@ bool s1ap::send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
{ {
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_HO_RES_ALLOC); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_HO_RES_ALLOC);
ho_request_ack_ies_container& container = tx_pdu.successful_outcome().value.ho_request_ack().protocol_ies; ho_request_ack_s& container = tx_pdu.successful_outcome().value.ho_request_ack();
ue* ue_ptr = users.find_ue_mmeid(msg.protocol_ies.mme_ue_s1ap_id.value.value); ue* ue_ptr = users.find_ue_mmeid(msg->mme_ue_s1ap_id.value.value);
if (ue_ptr == nullptr) { if (ue_ptr == nullptr) {
logger.error("The MME-S1AP-UE-ID=%ld is not valid", msg.protocol_ies.mme_ue_s1ap_id.value.value); logger.error("The MME-S1AP-UE-ID=%ld is not valid", msg->mme_ue_s1ap_id.value.value);
return false; return false;
} }
ue_ptr->ctxt.rnti = rnti; ue_ptr->ctxt.rnti = rnti;
ue_ptr->ctxt.enb_cc_idx = enb_cc_idx; ue_ptr->ctxt.enb_cc_idx = enb_cc_idx;
container.mme_ue_s1ap_id.value = msg.protocol_ies.mme_ue_s1ap_id.value.value; container->mme_ue_s1ap_id.value = msg->mme_ue_s1ap_id.value.value;
container.enb_ue_s1ap_id.value = ue_ptr->ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ue_ptr->ctxt.enb_ue_s1ap_id;
// Add admitted E-RABs // Add admitted E-RABs
container.erab_admitted_list.value.resize(admitted_bearers.size()); container->erab_admitted_list.value.resize(admitted_bearers.size());
for (size_t i = 0; i < admitted_bearers.size(); ++i) { for (size_t i = 0; i < admitted_bearers.size(); ++i) {
container.erab_admitted_list.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_ADMITTED_ITEM); container->erab_admitted_list.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_ADMITTED_ITEM);
auto& c = container.erab_admitted_list.value[i]->erab_admitted_item(); auto& c = container->erab_admitted_list.value[i]->erab_admitted_item();
c = admitted_bearers[i]; c = admitted_bearers[i];
if (!args.gtp_advertise_addr.empty()) { if (!args.gtp_advertise_addr.empty()) {
c.transport_layer_address = addr_to_asn1(args.gtp_advertise_addr.c_str()); c.transport_layer_address = addr_to_asn1(args.gtp_advertise_addr.c_str());
@ -1264,12 +1255,12 @@ bool s1ap::send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
// Add failed to Setup E-RABs // Add failed to Setup E-RABs
if (not not_admitted_bearers.empty()) { if (not not_admitted_bearers.empty()) {
container.erab_failed_to_setup_list_ho_req_ack_present = true; container->erab_failed_to_setup_list_ho_req_ack_present = true;
container.erab_failed_to_setup_list_ho_req_ack.value.resize(not_admitted_bearers.size()); container->erab_failed_to_setup_list_ho_req_ack.value.resize(not_admitted_bearers.size());
for (size_t i = 0; i < not_admitted_bearers.size(); ++i) { for (size_t i = 0; i < not_admitted_bearers.size(); ++i) {
container.erab_failed_to_setup_list_ho_req_ack.value[i].load_info_obj( container->erab_failed_to_setup_list_ho_req_ack.value[i].load_info_obj(
ASN1_S1AP_ID_ERAB_FAILEDTO_SETUP_ITEM_HO_REQ_ACK); ASN1_S1AP_ID_ERAB_FAILEDTO_SETUP_ITEM_HO_REQ_ACK);
auto& erab = container.erab_failed_to_setup_list_ho_req_ack.value[i]->erab_failedto_setup_item_ho_req_ack(); auto& erab = container->erab_failed_to_setup_list_ho_req_ack.value[i]->erab_failedto_setup_item_ho_req_ack();
erab.erab_id = not_admitted_bearers[i].erab_id; erab.erab_id = not_admitted_bearers[i].erab_id;
erab.cause = not_admitted_bearers[i].cause; erab.cause = not_admitted_bearers[i].cause;
} }
@ -1286,23 +1277,21 @@ bool s1ap::send_ho_req_ack(const asn1::s1ap::ho_request_s& msg,
logger.error("Failed to pack TargeteNBToSourceeNBTransparentContainer"); logger.error("Failed to pack TargeteNBToSourceeNBTransparentContainer");
return false; return false;
} }
container.target_to_source_transparent_container.value.resize(bref.distance_bytes()); container->target_to_source_transparent_container.value.resize(bref.distance_bytes());
memcpy(container.target_to_source_transparent_container.value.data(), pdu->msg, bref.distance_bytes()); memcpy(container->target_to_source_transparent_container.value.data(), pdu->msg, bref.distance_bytes());
return sctp_send_s1ap_pdu(tx_pdu, rnti, "HandoverRequestAcknowledge"); return sctp_send_s1ap_pdu(tx_pdu, rnti, "HandoverRequestAcknowledge");
} }
bool s1ap::handle_mme_status_transfer(const asn1::s1ap::mme_status_transfer_s& msg) bool s1ap::handle_mme_status_transfer(const asn1::s1ap::mme_status_transfer_s& msg)
{ {
ue* u = ue* u = handle_s1apmsg_ue_id(msg->enb_ue_s1ap_id.value.value, msg->mme_ue_s1ap_id.value.value);
handle_s1apmsg_ue_id(msg.protocol_ies.enb_ue_s1ap_id.value.value, msg.protocol_ies.mme_ue_s1ap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
return false; return false;
} }
rrc->set_erab_status( rrc->set_erab_status(u->ctxt.rnti,
u->ctxt.rnti, msg->enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list);
msg.protocol_ies.enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list);
return true; return true;
} }
@ -1316,14 +1305,14 @@ void s1ap::send_ho_notify(uint16_t rnti, uint64_t target_eci)
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_HO_NOTIF); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_HO_NOTIF);
ho_notify_ies_container& container = tx_pdu.init_msg().value.ho_notify().protocol_ies; ho_notify_s& container = tx_pdu.init_msg().value.ho_notify();
container.mme_ue_s1ap_id.value = user_ptr->ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = user_ptr->ctxt.mme_ue_s1ap_id.value();
container.enb_ue_s1ap_id.value = user_ptr->ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = user_ptr->ctxt.enb_ue_s1ap_id;
container.eutran_cgi.value = eutran_cgi; container->eutran_cgi.value = eutran_cgi;
container.eutran_cgi.value.cell_id.from_number(target_eci); container->eutran_cgi.value.cell_id.from_number(target_eci);
container.tai.value = tai; container->tai.value = tai;
sctp_send_s1ap_pdu(tx_pdu, rnti, "HandoverNotify"); sctp_send_s1ap_pdu(tx_pdu, rnti, "HandoverNotify");
} }
@ -1367,24 +1356,24 @@ bool s1ap::send_error_indication(const asn1::s1ap::cause_c& cause,
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERROR_IND); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERROR_IND);
auto& container = tx_pdu.init_msg().value.error_ind().protocol_ies; auto& container = tx_pdu.init_msg().value.error_ind();
uint16_t rnti = SRSRAN_INVALID_RNTI; uint16_t rnti = SRSRAN_INVALID_RNTI;
container.enb_ue_s1ap_id_present = enb_ue_s1ap_id.has_value(); container->enb_ue_s1ap_id_present = enb_ue_s1ap_id.has_value();
if (enb_ue_s1ap_id.has_value()) { if (enb_ue_s1ap_id.has_value()) {
container.enb_ue_s1ap_id.value = enb_ue_s1ap_id.value(); container->enb_ue_s1ap_id.value = enb_ue_s1ap_id.value();
ue* user_ptr = users.find_ue_enbid(enb_ue_s1ap_id.value()); ue* user_ptr = users.find_ue_enbid(enb_ue_s1ap_id.value());
rnti = user_ptr != nullptr ? user_ptr->ctxt.rnti : SRSRAN_INVALID_RNTI; rnti = user_ptr != nullptr ? user_ptr->ctxt.rnti : SRSRAN_INVALID_RNTI;
} }
container.mme_ue_s1ap_id_present = mme_ue_s1ap_id.has_value(); container->mme_ue_s1ap_id_present = mme_ue_s1ap_id.has_value();
if (mme_ue_s1ap_id.has_value()) { if (mme_ue_s1ap_id.has_value()) {
container.mme_ue_s1ap_id.value = mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = mme_ue_s1ap_id.value();
} }
container.s_tmsi_present = false; container->s_tmsi_present = false;
container.cause_present = true; container->cause_present = true;
container.cause.value = cause; container->cause.value = cause;
return sctp_send_s1ap_pdu(tx_pdu, rnti, "Error Indication"); return sctp_send_s1ap_pdu(tx_pdu, rnti, "Error Indication");
} }
@ -1405,30 +1394,30 @@ bool s1ap::ue::send_initialuemessage(asn1::s1ap::rrc_establishment_cause_e cause
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_INIT_UE_MSG); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_INIT_UE_MSG);
init_ue_msg_ies_container& container = tx_pdu.init_msg().value.init_ue_msg().protocol_ies; init_ue_msg_s& container = tx_pdu.init_msg().value.init_ue_msg();
// S_TMSI // S_TMSI
if (has_tmsi) { if (has_tmsi) {
container.s_tmsi_present = true; container->s_tmsi_present = true;
uint32_to_uint8(m_tmsi, container.s_tmsi.value.m_tmsi.data()); uint32_to_uint8(m_tmsi, container->s_tmsi.value.m_tmsi.data());
container.s_tmsi.value.mmec[0] = mmec; container->s_tmsi.value.mmec[0] = mmec;
} }
// ENB_UE_S1AP_ID // ENB_UE_S1AP_ID
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
// NAS_PDU // NAS_PDU
container.nas_pdu.value.resize(pdu->N_bytes); container->nas_pdu.value.resize(pdu->N_bytes);
memcpy(container.nas_pdu.value.data(), pdu->msg, pdu->N_bytes); memcpy(container->nas_pdu.value.data(), pdu->msg, pdu->N_bytes);
// TAI // TAI
container.tai.value = s1ap_ptr->tai; container->tai.value = s1ap_ptr->tai;
// EUTRAN_CGI // EUTRAN_CGI
container.eutran_cgi.value = s1ap_ptr->eutran_cgi; container->eutran_cgi.value = s1ap_ptr->eutran_cgi;
// RRC Establishment Cause // RRC Establishment Cause
container.rrc_establishment_cause.value = cause; container->rrc_establishment_cause.value = cause;
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "InitialUEMessage"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "InitialUEMessage");
} }
@ -1442,19 +1431,19 @@ bool s1ap::ue::send_ulnastransport(srsran::unique_byte_buffer_t pdu)
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UL_NAS_TRANSPORT); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UL_NAS_TRANSPORT);
asn1::s1ap::ul_nas_transport_ies_container& container = tx_pdu.init_msg().value.ul_nas_transport().protocol_ies; ul_nas_transport_s& container = tx_pdu.init_msg().value.ul_nas_transport();
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
// NAS PDU // NAS PDU
container.nas_pdu.value.resize(pdu->N_bytes); container->nas_pdu.value.resize(pdu->N_bytes);
memcpy(container.nas_pdu.value.data(), pdu->msg, pdu->N_bytes); memcpy(container->nas_pdu.value.data(), pdu->msg, pdu->N_bytes);
// EUTRAN CGI // EUTRAN CGI
container.eutran_cgi.value = s1ap_ptr->eutran_cgi; container->eutran_cgi.value = s1ap_ptr->eutran_cgi;
// TAI // TAI
container.tai.value = s1ap_ptr->tai; container->tai.value = s1ap_ptr->tai;
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UplinkNASTransport"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UplinkNASTransport");
} }
@ -1485,13 +1474,12 @@ bool s1ap::ue::send_uectxtreleaserequest(const cause_c& cause)
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_RELEASE_REQUEST); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_RELEASE_REQUEST);
ue_context_release_request_ies_container& container = ue_context_release_request_s& container = tx_pdu.init_msg().value.ue_context_release_request();
tx_pdu.init_msg().value.ue_context_release_request().protocol_ies; container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
// Cause // Cause
container.cause.value = cause; container->cause.value = cause;
release_requested = s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextReleaseRequest"); release_requested = s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextReleaseRequest");
if (not release_requested) { if (not release_requested) {
@ -1514,9 +1502,9 @@ bool s1ap::ue::send_uectxtreleasecomplete()
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_RELEASE); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_RELEASE);
auto& container = tx_pdu.successful_outcome().value.ue_context_release_complete().protocol_ies; auto& container = tx_pdu.successful_outcome().value.ue_context_release_complete();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
// Stop TS1 Reloc Overall // Stop TS1 Reloc Overall
ts1_reloc_overall.stop(); ts1_reloc_overall.stop();
@ -1552,17 +1540,17 @@ void s1ap::ue::ue_ctxt_setup_complete()
if (updated_erabs.empty()) { if (updated_erabs.empty()) {
// It is ICS Failure // It is ICS Failure
tx_pdu.set_unsuccessful_outcome().load_info_obj(ASN1_S1AP_ID_INIT_CONTEXT_SETUP); tx_pdu.set_unsuccessful_outcome().load_info_obj(ASN1_S1AP_ID_INIT_CONTEXT_SETUP);
auto& container = tx_pdu.unsuccessful_outcome().value.init_context_setup_fail().protocol_ies; auto& container = tx_pdu.unsuccessful_outcome().value.init_context_setup_fail();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
if (not failed_cfg_erabs.empty()) { if (not failed_cfg_erabs.empty()) {
container.cause.value = failed_cfg_erabs.front().cause; container->cause.value = failed_cfg_erabs.front().cause;
} else { } else {
logger.warning("Procedure %s,rnti=0x%x - no specified cause for failed configuration", logger.warning("Procedure %s,rnti=0x%x - no specified cause for failed configuration",
s1ap_elem_procs_o::init_msg_c::types_opts{current_state}.to_string(), s1ap_elem_procs_o::init_msg_c::types_opts{current_state}.to_string(),
ctxt.rnti); ctxt.rnti);
container.cause.value.set_misc().value = cause_misc_opts::unspecified; container->cause.value.set_misc().value = cause_misc_opts::unspecified;
} }
s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextModificationFailure"); s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextModificationFailure");
return; return;
@ -1570,23 +1558,23 @@ void s1ap::ue::ue_ctxt_setup_complete()
// It is ICS Response // It is ICS Response
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_INIT_CONTEXT_SETUP); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_INIT_CONTEXT_SETUP);
auto& container = tx_pdu.successful_outcome().value.init_context_setup_resp().protocol_ies; auto& container = tx_pdu.successful_outcome().value.init_context_setup_resp();
// Fill in the MME and eNB IDs // Fill in the MME and eNB IDs
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
// Add list of E-RABs that were not setup // Add list of E-RABs that were not setup
if (not failed_cfg_erabs.empty()) { if (not failed_cfg_erabs.empty()) {
container.erab_failed_to_setup_list_ctxt_su_res_present = true; container->erab_failed_to_setup_list_ctxt_su_res_present = true;
fill_erab_failed_setup_list(container.erab_failed_to_setup_list_ctxt_su_res.value, failed_cfg_erabs); fill_erab_failed_setup_list(container->erab_failed_to_setup_list_ctxt_su_res.value, failed_cfg_erabs);
} }
// Add setup E-RABs // Add setup E-RABs
container.erab_setup_list_ctxt_su_res.value.resize(updated_erabs.size()); container->erab_setup_list_ctxt_su_res.value.resize(updated_erabs.size());
for (size_t i = 0; i < updated_erabs.size(); ++i) { for (size_t i = 0; i < updated_erabs.size(); ++i) {
container.erab_setup_list_ctxt_su_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_SETUP_ITEM_CTXT_SU_RES); container->erab_setup_list_ctxt_su_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_SETUP_ITEM_CTXT_SU_RES);
auto& item = container.erab_setup_list_ctxt_su_res.value[i]->erab_setup_item_ctxt_su_res(); auto& item = container->erab_setup_list_ctxt_su_res.value[i]->erab_setup_item_ctxt_su_res();
item.erab_id = updated_erabs[i]; item.erab_id = updated_erabs[i];
get_erab_addr(item.erab_id, item.transport_layer_address, item.gtp_teid); get_erab_addr(item.erab_id, item.transport_layer_address, item.gtp_teid);
} }
@ -1604,21 +1592,21 @@ bool s1ap::ue::send_erab_setup_response(const erab_id_list& erabs_setup, const e
erab_setup_resp_s& res = tx_pdu.successful_outcome().value.erab_setup_resp(); erab_setup_resp_s& res = tx_pdu.successful_outcome().value.erab_setup_resp();
// Fill in the MME and eNB IDs // Fill in the MME and eNB IDs
res.protocol_ies.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); res->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
res.protocol_ies.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; res->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
// Add list of E-RABs that were not setup // Add list of E-RABs that were not setup
if (not erabs_failed.empty()) { if (not erabs_failed.empty()) {
res.protocol_ies.erab_failed_to_setup_list_bearer_su_res_present = true; res->erab_failed_to_setup_list_bearer_su_res_present = true;
fill_erab_failed_setup_list(res.protocol_ies.erab_failed_to_setup_list_bearer_su_res.value, erabs_failed); fill_erab_failed_setup_list(res->erab_failed_to_setup_list_bearer_su_res.value, erabs_failed);
} }
if (not erabs_setup.empty()) { if (not erabs_setup.empty()) {
res.protocol_ies.erab_setup_list_bearer_su_res_present = true; res->erab_setup_list_bearer_su_res_present = true;
res.protocol_ies.erab_setup_list_bearer_su_res.value.resize(erabs_setup.size()); res->erab_setup_list_bearer_su_res.value.resize(erabs_setup.size());
for (size_t i = 0; i < erabs_setup.size(); ++i) { for (size_t i = 0; i < erabs_setup.size(); ++i) {
res.protocol_ies.erab_setup_list_bearer_su_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_SETUP_ITEM_BEARER_SU_RES); res->erab_setup_list_bearer_su_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_SETUP_ITEM_BEARER_SU_RES);
auto& item = res.protocol_ies.erab_setup_list_bearer_su_res.value[i]->erab_setup_item_bearer_su_res(); auto& item = res->erab_setup_list_bearer_su_res.value[i]->erab_setup_item_bearer_su_res();
item.erab_id = erabs_setup[i]; item.erab_id = erabs_setup[i];
get_erab_addr(item.erab_id, item.transport_layer_address, item.gtp_teid); get_erab_addr(item.erab_id, item.transport_layer_address, item.gtp_teid);
} }
@ -1635,10 +1623,10 @@ bool s1ap::ue::send_uectxtmodifyresp()
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_MOD); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_MOD);
auto& container = tx_pdu.successful_outcome().value.ue_context_mod_resp().protocol_ies; auto& container = tx_pdu.successful_outcome().value.ue_context_mod_resp();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextModificationResponse"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextModificationResponse");
} }
@ -1651,11 +1639,11 @@ bool s1ap::ue::send_uectxtmodifyfailure(const cause_c& cause)
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_unsuccessful_outcome().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_MOD); tx_pdu.set_unsuccessful_outcome().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_MOD);
auto& container = tx_pdu.unsuccessful_outcome().value.ue_context_mod_fail().protocol_ies; auto& container = tx_pdu.unsuccessful_outcome().value.ue_context_mod_fail();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
container.cause.value = cause; container->cause.value = cause;
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextModificationFailure"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UEContextModificationFailure");
} }
@ -1672,26 +1660,26 @@ bool s1ap::ue::send_erab_release_response(const erab_id_list& erabs_released, co
asn1::s1ap::s1ap_pdu_c tx_pdu; asn1::s1ap::s1ap_pdu_c tx_pdu;
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_ERAB_RELEASE); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_ERAB_RELEASE);
auto& container = tx_pdu.successful_outcome().value.erab_release_resp().protocol_ies; auto& container = tx_pdu.successful_outcome().value.erab_release_resp();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
// Fill in which E-RABs were successfully released // Fill in which E-RABs were successfully released
if (not erabs_released.empty()) { if (not erabs_released.empty()) {
container.erab_release_list_bearer_rel_comp_present = true; container->erab_release_list_bearer_rel_comp_present = true;
container.erab_release_list_bearer_rel_comp.value.resize(erabs_released.size()); container->erab_release_list_bearer_rel_comp.value.resize(erabs_released.size());
for (size_t i = 0; i < erabs_released.size(); ++i) { for (size_t i = 0; i < erabs_released.size(); ++i) {
container.erab_release_list_bearer_rel_comp.value[i].load_info_obj( container->erab_release_list_bearer_rel_comp.value[i].load_info_obj(
ASN1_S1AP_ID_ERAB_RELEASE_ITEM_BEARER_REL_COMP); ASN1_S1AP_ID_ERAB_RELEASE_ITEM_BEARER_REL_COMP);
container.erab_release_list_bearer_rel_comp.value[i]->erab_release_item_bearer_rel_comp().erab_id = container->erab_release_list_bearer_rel_comp.value[i]->erab_release_item_bearer_rel_comp().erab_id =
erabs_released[i]; erabs_released[i];
} }
} }
// Fill in which E-RABs were *not* successfully released // Fill in which E-RABs were *not* successfully released
if (not erabs_failed.empty()) { if (not erabs_failed.empty()) {
container.erab_failed_to_release_list_present = true; container->erab_failed_to_release_list_present = true;
fill_erab_failed_setup_list(container.erab_failed_to_release_list.value, erabs_failed); fill_erab_failed_setup_list(container->erab_failed_to_release_list.value, erabs_failed);
} }
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "E-RABReleaseResponse"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "E-RABReleaseResponse");
@ -1702,24 +1690,25 @@ bool s1ap::ue::send_erab_modify_response(const erab_id_list& erabs_modified, con
asn1::s1ap::s1ap_pdu_c tx_pdu; asn1::s1ap::s1ap_pdu_c tx_pdu;
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY);
auto& container = tx_pdu.successful_outcome().value.erab_modify_resp().protocol_ies; auto& container = tx_pdu.successful_outcome().value.erab_modify_resp();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
// Fill in which E-RABs were successfully released // Fill in which E-RABs were successfully released
if (not erabs_modified.empty()) { if (not erabs_modified.empty()) {
container.erab_modify_list_bearer_mod_res_present = true; container->erab_modify_list_bearer_mod_res_present = true;
container.erab_modify_list_bearer_mod_res.value.resize(erabs_modified.size()); container->erab_modify_list_bearer_mod_res.value.resize(erabs_modified.size());
for (uint32_t i = 0; i < container.erab_modify_list_bearer_mod_res.value.size(); i++) { for (uint32_t i = 0; i < container->erab_modify_list_bearer_mod_res.value.size(); i++) {
container.erab_modify_list_bearer_mod_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY_ITEM_BEARER_MOD_RES); container->erab_modify_list_bearer_mod_res.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY_ITEM_BEARER_MOD_RES);
container.erab_modify_list_bearer_mod_res.value[i]->erab_modify_item_bearer_mod_res().erab_id = erabs_modified[i]; container->erab_modify_list_bearer_mod_res.value[i]->erab_modify_item_bearer_mod_res().erab_id =
erabs_modified[i];
} }
} }
// Fill in which E-RABs were *not* successfully released // Fill in which E-RABs were *not* successfully released
if (not erabs_failed.empty()) { if (not erabs_failed.empty()) {
container.erab_failed_to_modify_list_present = true; container->erab_failed_to_modify_list_present = true;
fill_erab_failed_setup_list(container.erab_failed_to_modify_list.value, erabs_failed); fill_erab_failed_setup_list(container->erab_failed_to_modify_list.value, erabs_failed);
} }
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "E-RABModifyResponse"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "E-RABModifyResponse");
@ -1734,16 +1723,16 @@ bool s1ap::ue::send_erab_release_indication(const std::vector<uint16_t>& erabs_s
asn1::s1ap::s1ap_pdu_c tx_pdu; asn1::s1ap::s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERAB_RELEASE_IND); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERAB_RELEASE_IND);
erab_release_ind_ies_container& container = tx_pdu.init_msg().value.erab_release_ind().protocol_ies; erab_release_ind_s& container = tx_pdu.init_msg().value.erab_release_ind();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
// Fill in which E-RABs were successfully released // Fill in which E-RABs were successfully released
container.erab_released_list.value.resize(erabs_successfully_released.size()); container->erab_released_list.value.resize(erabs_successfully_released.size());
for (size_t i = 0; i < container.erab_released_list.value.size(); ++i) { for (size_t i = 0; i < container->erab_released_list.value.size(); ++i) {
container.erab_released_list.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_ITEM); container->erab_released_list.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_ITEM);
container.erab_released_list.value[i]->erab_item().erab_id = erabs_successfully_released[i]; container->erab_released_list.value[i]->erab_item().erab_id = erabs_successfully_released[i];
} }
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "E-RABReleaseIndication"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "E-RABReleaseIndication");
@ -1753,13 +1742,13 @@ bool s1ap::ue::send_ue_cap_info_indication(srsran::unique_byte_buffer_t ue_radio
{ {
asn1::s1ap::s1ap_pdu_c tx_pdu; asn1::s1ap::s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UE_CAP_INFO_IND); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UE_CAP_INFO_IND);
ue_cap_info_ind_ies_container& container = tx_pdu.init_msg().value.ue_cap_info_ind().protocol_ies; ue_cap_info_ind_s& container = tx_pdu.init_msg().value.ue_cap_info_ind();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
container.ue_radio_cap.value.resize(ue_radio_cap->N_bytes); container->ue_radio_cap.value.resize(ue_radio_cap->N_bytes);
memcpy(container.ue_radio_cap.value.data(), ue_radio_cap->msg, ue_radio_cap->N_bytes); memcpy(container->ue_radio_cap.value.data(), ue_radio_cap->msg, ue_radio_cap->N_bytes);
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UECapabilityInfoIndication"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "UECapabilityInfoIndication");
} }
@ -1773,11 +1762,11 @@ void s1ap::ue::send_ho_cancel(const asn1::s1ap::cause_c& cause)
// Send S1AP Handover Cancel // Send S1AP Handover Cancel
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_HO_CANCEL); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_HO_CANCEL);
ho_cancel_ies_container& container = tx_pdu.init_msg().value.ho_cancel().protocol_ies; ho_cancel_s& container = tx_pdu.init_msg().value.ho_cancel();
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.cause.value = cause; container->cause.value = cause;
s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "HandoverCancel"); s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "HandoverCancel");
} }
@ -2109,25 +2098,25 @@ bool s1ap::ue::send_ho_required(uint32_t target_eci,
/*** Setup S1AP PDU as HandoverRequired ***/ /*** Setup S1AP PDU as HandoverRequired ***/
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_HO_PREP); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_HO_PREP);
ho_required_ies_container& container = tx_pdu.init_msg().value.ho_required().protocol_ies; ho_required_s& container = tx_pdu.init_msg().value.ho_required();
/*** fill HO Required message ***/ /*** fill HO Required message ***/
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
container.handov_type.value.value = handov_type_opts::intralte; // NOTE: only intra-LTE HO supported container->handov_type.value.value = handov_type_opts::intralte; // NOTE: only intra-LTE HO supported
container.cause.value.set_radio_network().value = cause_radio_network_opts::ho_desirable_for_radio_reason; container->cause.value.set_radio_network().value = cause_radio_network_opts::ho_desirable_for_radio_reason;
container.direct_forwarding_path_availability_present = has_direct_fwd_path; container->direct_forwarding_path_availability_present = has_direct_fwd_path;
if (container.direct_forwarding_path_availability_present) { if (container->direct_forwarding_path_availability_present) {
container.direct_forwarding_path_availability.value.value = container->direct_forwarding_path_availability.value.value =
asn1::s1ap::direct_forwarding_path_availability_opts::direct_path_available; asn1::s1ap::direct_forwarding_path_availability_opts::direct_path_available;
} }
/*** set the target eNB ***/ /*** set the target eNB ***/
container.csg_id_present = false; // NOTE: CSG/hybrid target cell not supported container->csg_id_present = false; // NOTE: CSG/hybrid target cell not supported
container.cell_access_mode_present = false; // only for hybrid cells container->cell_access_mode_present = false; // only for hybrid cells
// no GERAN/UTRAN/PS // no GERAN/UTRAN/PS
auto& targetenb = container.target_id.value.set_targetenb_id(); auto& targetenb = container->target_id.value.set_targetenb_id();
// set PLMN and TAI of target // set PLMN and TAI of target
// NOTE: Only HO without TAU supported. // NOTE: Only HO without TAU supported.
uint16_t tmp16; uint16_t tmp16;
@ -2140,7 +2129,7 @@ bool s1ap::ue::send_ho_required(uint32_t target_eci,
macroenb.from_number(target_eci >> 8U); macroenb.from_number(target_eci >> 8U);
/*** fill the transparent container ***/ /*** fill the transparent container ***/
container.source_to_target_transparent_container_secondary_present = false; container->source_to_target_transparent_container_secondary_present = false;
sourceenb_to_targetenb_transparent_container_s transparent_cntr; sourceenb_to_targetenb_transparent_container_s transparent_cntr;
transparent_cntr.subscriber_profile_idfor_rfp_present = false; // TODO: CHECK transparent_cntr.subscriber_profile_idfor_rfp_present = false; // TODO: CHECK
@ -2186,8 +2175,8 @@ bool s1ap::ue::send_ho_required(uint32_t target_eci,
logger.error("Failed to pack transparent container of HO Required message"); logger.error("Failed to pack transparent container of HO Required message");
return false; return false;
} }
container.source_to_target_transparent_container.value.resize(bref.distance_bytes()); container->source_to_target_transparent_container.value.resize(bref.distance_bytes());
memcpy(container.source_to_target_transparent_container.value.data(), buffer->msg, bref.distance_bytes()); memcpy(container->source_to_target_transparent_container.value.data(), buffer->msg, bref.distance_bytes());
// Send to HandoverRequired message to MME // Send to HandoverRequired message to MME
return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "Handover Required"); return s1ap_ptr->sctp_send_s1ap_pdu(tx_pdu, ctxt.rnti, "Handover Required");
@ -2201,13 +2190,13 @@ bool s1ap::ue::send_enb_status_transfer_proc(std::vector<bearer_status_info>& be
s1ap_pdu_c tx_pdu; s1ap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ENB_STATUS_TRANSFER); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ENB_STATUS_TRANSFER);
enb_status_transfer_ies_container& container = tx_pdu.init_msg().value.enb_status_transfer().protocol_ies; enb_status_transfer_s& container = tx_pdu.init_msg().value.enb_status_transfer();
container.enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id; container->enb_ue_s1ap_id.value = ctxt.enb_ue_s1ap_id;
container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value(); container->mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id.value();
/* Create StatusTransfer transparent container with all the bearer ctxt to transfer */ /* Create StatusTransfer transparent container with all the bearer ctxt to transfer */
auto& list = container.enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list; auto& list = container->enb_status_transfer_transparent_container.value.bearers_subject_to_status_transfer_list;
list.resize(bearer_status_list.size()); list.resize(bearer_status_list.size());
for (uint32_t i = 0; i < list.size(); ++i) { for (uint32_t i = 0; i < list.size(); ++i) {
list[i].load_info_obj(ASN1_S1AP_ID_BEARERS_SUBJECT_TO_STATUS_TRANSFER_ITEM); list[i].load_info_obj(ASN1_S1AP_ID_BEARERS_SUBJECT_TO_STATUS_TRANSFER_ITEM);

@ -89,11 +89,11 @@ int test_erab_setup(srsran::log_sink_spy& spy, bool qci_exists)
asn1::cbit_ref bref(byte_buf.msg, byte_buf.N_bytes); asn1::cbit_ref bref(byte_buf.msg, byte_buf.N_bytes);
TESTASSERT(s1ap_pdu.unpack(bref) == asn1::SRSASN_SUCCESS); TESTASSERT(s1ap_pdu.unpack(bref) == asn1::SRSASN_SUCCESS);
const auto& setupmsg = s1ap_pdu.init_msg().value.erab_setup_request().protocol_ies; const auto& setupmsg = s1ap_pdu.init_msg().value.erab_setup_request();
if (setupmsg.ueaggregate_maximum_bitrate_present) { if (setupmsg->ueaggregate_maximum_bitrate_present) {
rrc.set_aggregate_max_bitrate(rnti, setupmsg.ueaggregate_maximum_bitrate.value); rrc.set_aggregate_max_bitrate(rnti, setupmsg->ueaggregate_maximum_bitrate.value);
} }
for (const auto& item : setupmsg.erab_to_be_setup_list_bearer_su_req.value) { for (const auto& item : setupmsg->erab_to_be_setup_list_bearer_su_req.value) {
const auto& erab = item->erab_to_be_setup_item_bearer_su_req(); const auto& erab = item->erab_to_be_setup_item_bearer_su_req();
asn1::s1ap::cause_c cause; asn1::s1ap::cause_c cause;
int ret = rrc.setup_erab(rnti, int ret = rrc.setup_erab(rnti,

@ -272,14 +272,14 @@ int test_s1ap_tenb_mobility(test_event test_params)
/* TeNB receives S1AP Handover Request */ /* TeNB receives S1AP Handover Request */
asn1::s1ap::ho_request_s ho_req; asn1::s1ap::ho_request_s ho_req;
ho_req.protocol_ies.erab_to_be_setup_list_ho_req.value.resize(1); ho_req->erab_to_be_setup_list_ho_req.value.resize(1);
auto& erab = ho_req.protocol_ies.erab_to_be_setup_list_ho_req.value[0]->erab_to_be_setup_item_ho_req(); auto& erab = ho_req->erab_to_be_setup_list_ho_req.value[0]->erab_to_be_setup_item_ho_req();
erab.erab_id = 5; erab.erab_id = 5;
erab.erab_level_qos_params.qci = 9; erab.erab_level_qos_params.qci = 9;
if (test_params == test_event::unknown_qci) { if (test_params == test_event::unknown_qci) {
erab.erab_level_qos_params.qci = 10; erab.erab_level_qos_params.qci = 10;
} }
ho_req.protocol_ies.ue_security_cap.value.integrity_protection_algorithms.set(14, true); ho_req->ue_security_cap.value.integrity_protection_algorithms.set(14, true);
asn1::s1ap::sourceenb_to_targetenb_transparent_container_s container; asn1::s1ap::sourceenb_to_targetenb_transparent_container_s container;
container.target_cell_id.cell_id.from_number(0x19C02); container.target_cell_id.cell_id.from_number(0x19C02);
if (test_params == test_event::wrong_target_cell) { if (test_params == test_event::wrong_target_cell) {
@ -331,8 +331,8 @@ int test_s1ap_tenb_mobility(test_event test_params)
tester.pdcp.bearers[0x46].count(srb_to_lcid(lte_srb::srb2))); tester.pdcp.bearers[0x46].count(srb_to_lcid(lte_srb::srb2)));
TESTASSERT(tester.pdcp.bearers[0x46][srb_to_lcid(lte_srb::srb1)].enable_encryption); TESTASSERT(tester.pdcp.bearers[0x46][srb_to_lcid(lte_srb::srb1)].enable_encryption);
TESTASSERT(tester.pdcp.bearers[0x46][srb_to_lcid(lte_srb::srb1)].enable_integrity); TESTASSERT(tester.pdcp.bearers[0x46][srb_to_lcid(lte_srb::srb1)].enable_integrity);
sec_cfg.set_security_capabilities(ho_req.protocol_ies.ue_security_cap.value); sec_cfg.set_security_capabilities(ho_req->ue_security_cap.value);
sec_cfg.set_security_key(ho_req.protocol_ies.security_context.value.next_hop_param); sec_cfg.set_security_key(ho_req->security_context.value.next_hop_param);
sec_cfg.regenerate_keys_handover(tester.cfg.cell_list[0].pci, tester.cfg.cell_list[0].dl_earfcn); sec_cfg.regenerate_keys_handover(tester.cfg.cell_list[0].pci, tester.cfg.cell_list[0].dl_earfcn);
srsran::as_security_config_t as_sec_cfg = sec_cfg.get_as_sec_cfg(); srsran::as_security_config_t as_sec_cfg = sec_cfg.get_as_sec_cfg();
TESTASSERT(tester.pdcp.bearers[0x46][srb_to_lcid(lte_srb::srb1)].sec_cfg.k_rrc_int == as_sec_cfg.k_rrc_int); TESTASSERT(tester.pdcp.bearers[0x46][srb_to_lcid(lte_srb::srb1)].sec_cfg.k_rrc_int == as_sec_cfg.k_rrc_int);
@ -344,8 +344,7 @@ int test_s1ap_tenb_mobility(test_event test_params)
// Check if S1AP Handover Request ACK send is called // Check if S1AP Handover Request ACK send is called
TESTASSERT(tester.s1ap.last_ho_req_ack.rnti == 0x46); TESTASSERT(tester.s1ap.last_ho_req_ack.rnti == 0x46);
TESTASSERT(tester.s1ap.last_ho_req_ack.ho_cmd_pdu != nullptr); TESTASSERT(tester.s1ap.last_ho_req_ack.ho_cmd_pdu != nullptr);
TESTASSERT(tester.s1ap.last_ho_req_ack.admitted_bearers.size() == TESTASSERT(tester.s1ap.last_ho_req_ack.admitted_bearers.size() == ho_req->erab_to_be_setup_list_ho_req.value.size());
ho_req.protocol_ies.erab_to_be_setup_list_ho_req.value.size());
ho_cmd_s ho_cmd; ho_cmd_s ho_cmd;
asn1::cbit_ref bref{tester.s1ap.last_ho_req_ack.ho_cmd_pdu->msg, tester.s1ap.last_ho_req_ack.ho_cmd_pdu->N_bytes}; asn1::cbit_ref bref{tester.s1ap.last_ho_req_ack.ho_cmd_pdu->msg, tester.s1ap.last_ho_req_ack.ho_cmd_pdu->N_bytes};
TESTASSERT(ho_cmd.unpack(bref) == asn1::SRSASN_SUCCESS); TESTASSERT(ho_cmd.unpack(bref) == asn1::SRSASN_SUCCESS);

@ -128,8 +128,7 @@ int bring_rrc_to_reconf_state(srsenb::rrc& rrc, srsran::timer_handler& timers, u
asn1::cbit_ref bref(byte_buf.msg, byte_buf.N_bytes); asn1::cbit_ref bref(byte_buf.msg, byte_buf.N_bytes);
TESTASSERT(s1ap_pdu.unpack(bref) == asn1::SRSASN_SUCCESS); TESTASSERT(s1ap_pdu.unpack(bref) == asn1::SRSASN_SUCCESS);
rrc.setup_ue_ctxt(rnti, s1ap_pdu.init_msg().value.init_context_setup_request()); rrc.setup_ue_ctxt(rnti, s1ap_pdu.init_msg().value.init_context_setup_request());
for (auto& item : for (auto& item : s1ap_pdu.init_msg().value.init_context_setup_request()->erab_to_be_setup_list_ctxt_su_req.value) {
s1ap_pdu.init_msg().value.init_context_setup_request().protocol_ies.erab_to_be_setup_list_ctxt_su_req.value) {
const auto& erab = item->erab_to_be_setup_item_ctxt_su_req(); const auto& erab = item->erab_to_be_setup_item_ctxt_su_req();
asn1::s1ap::cause_c cause; asn1::s1ap::cause_c cause;
TESTASSERT(rrc.setup_erab(rnti, TESTASSERT(rrc.setup_erab(rnti,

@ -192,9 +192,9 @@ void add_rnti(s1ap& s1ap_obj, mme_dummy& mme)
TESTASSERT(s1ap_pdu.unpack(cbref) == SRSRAN_SUCCESS); TESTASSERT(s1ap_pdu.unpack(cbref) == SRSRAN_SUCCESS);
TESTASSERT(s1ap_pdu.type().value == asn1::s1ap::s1ap_pdu_c::types_opts::successful_outcome); TESTASSERT(s1ap_pdu.type().value == asn1::s1ap::s1ap_pdu_c::types_opts::successful_outcome);
TESTASSERT(s1ap_pdu.successful_outcome().proc_code == ASN1_S1AP_ID_INIT_CONTEXT_SETUP); TESTASSERT(s1ap_pdu.successful_outcome().proc_code == ASN1_S1AP_ID_INIT_CONTEXT_SETUP);
const auto& resp = s1ap_pdu.successful_outcome().value.init_context_setup_resp().protocol_ies; const auto& resp = s1ap_pdu.successful_outcome().value.init_context_setup_resp();
TESTASSERT(resp.erab_setup_list_ctxt_su_res.value.size() > 0); TESTASSERT(resp->erab_setup_list_ctxt_su_res.value.size() > 0);
TESTASSERT(not resp.erab_failed_to_setup_list_ctxt_su_res_present); TESTASSERT(not resp->erab_failed_to_setup_list_ctxt_su_res_present);
} }
enum class test_event { success, wrong_erabid_mod, wrong_mme_s1ap_id, repeated_erabid_mod }; enum class test_event { success, wrong_erabid_mod, wrong_mme_s1ap_id, repeated_erabid_mod };
@ -235,10 +235,10 @@ void test_s1ap_erab_setup(test_event event)
int flags = 0; int flags = 0;
asn1::s1ap::s1ap_pdu_c mod_req_pdu; asn1::s1ap::s1ap_pdu_c mod_req_pdu;
mod_req_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY); mod_req_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY);
auto& protocols = mod_req_pdu.init_msg().value.erab_modify_request().protocol_ies; auto& protocols = mod_req_pdu.init_msg().value.erab_modify_request();
protocols.enb_ue_s1ap_id.value = 1; protocols->enb_ue_s1ap_id.value = 1;
protocols.mme_ue_s1ap_id.value = event == test_event::wrong_mme_s1ap_id ? 2 : 1; protocols->mme_ue_s1ap_id.value = event == test_event::wrong_mme_s1ap_id ? 2 : 1;
auto& erab_list = protocols.erab_to_be_modified_list_bearer_mod_req.value; auto& erab_list = protocols->erab_to_be_modified_list_bearer_mod_req.value;
erab_list.resize(2); erab_list.resize(2);
erab_list[0].load_info_obj(ASN1_S1AP_ID_ERAB_TO_BE_MODIFIED_ITEM_BEARER_MOD_REQ); erab_list[0].load_info_obj(ASN1_S1AP_ID_ERAB_TO_BE_MODIFIED_ITEM_BEARER_MOD_REQ);
auto* erab_ptr = &erab_list[0]->erab_to_be_modified_item_bearer_mod_req(); auto* erab_ptr = &erab_list[0]->erab_to_be_modified_item_bearer_mod_req();
@ -273,33 +273,33 @@ void test_s1ap_erab_setup(test_event event)
// See TS 36.413, Section 10.6 - Handling of AP ID // See TS 36.413, Section 10.6 - Handling of AP ID
TESTASSERT(s1ap_pdu.type().value == asn1::s1ap::s1ap_pdu_c::types_opts::init_msg); TESTASSERT(s1ap_pdu.type().value == asn1::s1ap::s1ap_pdu_c::types_opts::init_msg);
TESTASSERT(s1ap_pdu.init_msg().proc_code == ASN1_S1AP_ID_ERROR_IND); TESTASSERT(s1ap_pdu.init_msg().proc_code == ASN1_S1AP_ID_ERROR_IND);
auto& protocol_ies = s1ap_pdu.init_msg().value.error_ind().protocol_ies; auto& err_ind = s1ap_pdu.init_msg().value.error_ind();
TESTASSERT(protocol_ies.mme_ue_s1ap_id_present and protocol_ies.mme_ue_s1ap_id.value.value == 2); TESTASSERT(err_ind->mme_ue_s1ap_id_present and err_ind->mme_ue_s1ap_id.value.value == 2);
TESTASSERT(protocol_ies.enb_ue_s1ap_id_present and protocol_ies.enb_ue_s1ap_id.value.value == 1); TESTASSERT(err_ind->enb_ue_s1ap_id_present and err_ind->enb_ue_s1ap_id.value.value == 1);
TESTASSERT(rrc.last_released_rnti == 0x46); TESTASSERT(rrc.last_released_rnti == 0x46);
return; return;
} }
TESTASSERT(s1ap_pdu.type().value == asn1::s1ap::s1ap_pdu_c::types_opts::successful_outcome); TESTASSERT(s1ap_pdu.type().value == asn1::s1ap::s1ap_pdu_c::types_opts::successful_outcome);
TESTASSERT(s1ap_pdu.successful_outcome().proc_code == ASN1_S1AP_ID_ERAB_MODIFY); TESTASSERT(s1ap_pdu.successful_outcome().proc_code == ASN1_S1AP_ID_ERAB_MODIFY);
auto& protocol_ies = s1ap_pdu.successful_outcome().value.erab_modify_resp().protocol_ies; auto& erab_mod = s1ap_pdu.successful_outcome().value.erab_modify_resp();
if (event == test_event::wrong_erabid_mod) { if (event == test_event::wrong_erabid_mod) {
TESTASSERT(protocol_ies.erab_modify_list_bearer_mod_res_present); TESTASSERT(erab_mod->erab_modify_list_bearer_mod_res_present);
TESTASSERT(protocol_ies.erab_modify_list_bearer_mod_res.value.size() == 1); TESTASSERT(erab_mod->erab_modify_list_bearer_mod_res.value.size() == 1);
TESTASSERT(protocol_ies.erab_modify_list_bearer_mod_res.value[0]->erab_modify_item_bearer_mod_res().erab_id == 5); TESTASSERT(erab_mod->erab_modify_list_bearer_mod_res.value[0]->erab_modify_item_bearer_mod_res().erab_id == 5);
TESTASSERT(protocol_ies.erab_failed_to_modify_list_present); TESTASSERT(erab_mod->erab_failed_to_modify_list_present);
TESTASSERT(protocol_ies.erab_failed_to_modify_list.value.size() == 1); TESTASSERT(erab_mod->erab_failed_to_modify_list.value.size() == 1);
auto& erab_item = protocol_ies.erab_failed_to_modify_list.value[0]->erab_item(); auto& erab_item = erab_mod->erab_failed_to_modify_list.value[0]->erab_item();
TESTASSERT(erab_item.erab_id == 6); TESTASSERT(erab_item.erab_id == 6);
TESTASSERT(erab_item.cause.type().value == asn1::s1ap::cause_c::types_opts::radio_network); TESTASSERT(erab_item.cause.type().value == asn1::s1ap::cause_c::types_opts::radio_network);
TESTASSERT(erab_item.cause.radio_network().value == asn1::s1ap::cause_radio_network_opts::unknown_erab_id); TESTASSERT(erab_item.cause.radio_network().value == asn1::s1ap::cause_radio_network_opts::unknown_erab_id);
return; return;
} }
if (event == test_event::repeated_erabid_mod) { if (event == test_event::repeated_erabid_mod) {
TESTASSERT(not protocol_ies.erab_modify_list_bearer_mod_res_present); TESTASSERT(not erab_mod->erab_modify_list_bearer_mod_res_present);
TESTASSERT(protocol_ies.erab_failed_to_modify_list_present); TESTASSERT(erab_mod->erab_failed_to_modify_list_present);
TESTASSERT(protocol_ies.erab_failed_to_modify_list.value.size() == 1); TESTASSERT(erab_mod->erab_failed_to_modify_list.value.size() == 1);
auto& erab_item = protocol_ies.erab_failed_to_modify_list.value[0]->erab_item(); auto& erab_item = erab_mod->erab_failed_to_modify_list.value[0]->erab_item();
TESTASSERT(erab_item.erab_id == 5); TESTASSERT(erab_item.erab_id == 5);
TESTASSERT(erab_item.cause.type().value == asn1::s1ap::cause_c::types_opts::radio_network); TESTASSERT(erab_item.cause.type().value == asn1::s1ap::cause_c::types_opts::radio_network);
TESTASSERT(erab_item.cause.radio_network().value == TESTASSERT(erab_item.cause.radio_network().value ==
@ -307,10 +307,10 @@ void test_s1ap_erab_setup(test_event event)
return; return;
} }
TESTASSERT(protocol_ies.erab_modify_list_bearer_mod_res_present); TESTASSERT(erab_mod->erab_modify_list_bearer_mod_res_present);
TESTASSERT(not protocol_ies.erab_failed_to_modify_list_present); TESTASSERT(not erab_mod->erab_failed_to_modify_list_present);
TESTASSERT(protocol_ies.erab_modify_list_bearer_mod_res.value.size() == 2); TESTASSERT(erab_mod->erab_modify_list_bearer_mod_res.value.size() == 2);
auto& erab_item = protocol_ies.erab_modify_list_bearer_mod_res.value[0]->erab_modify_item_bearer_mod_res(); auto& erab_item = erab_mod->erab_modify_list_bearer_mod_res.value[0]->erab_modify_item_bearer_mod_res();
TESTASSERT(erab_item.erab_id == 5); TESTASSERT(erab_item.erab_id == 5);
} }

@ -16,7 +16,6 @@
#include "srsran/common/buffer_pool.h" #include "srsran/common/buffer_pool.h"
#include "srsran/common/int_helpers.h" #include "srsran/common/int_helpers.h"
#include "srsran/common/liblte_security.h" #include "srsran/common/liblte_security.h"
#include <endian.h>
namespace srsepc { namespace srsepc {
@ -74,24 +73,23 @@ bool s1ap_ctx_mngmt_proc::send_initial_context_setup_request(nas* nas_ctx, uint1
s1ap_pdu_t tx_pdu; s1ap_pdu_t tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_INIT_CONTEXT_SETUP); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_INIT_CONTEXT_SETUP);
asn1::s1ap::init_context_setup_request_ies_container& in_ctx_req = asn1::s1ap::init_context_setup_request_s& in_ctx_req = tx_pdu.init_msg().value.init_context_setup_request();
tx_pdu.init_msg().value.init_context_setup_request().protocol_ies;
// Add MME and eNB S1AP Ids // Add MME and eNB S1AP Ids
in_ctx_req.mme_ue_s1ap_id.value = ecm_ctx->mme_ue_s1ap_id; in_ctx_req->mme_ue_s1ap_id.value = ecm_ctx->mme_ue_s1ap_id;
in_ctx_req.enb_ue_s1ap_id.value = ecm_ctx->enb_ue_s1ap_id; in_ctx_req->enb_ue_s1ap_id.value = ecm_ctx->enb_ue_s1ap_id;
// UE-AMBR // UE-AMBR
in_ctx_req.ueaggregate_maximum_bitrate.value.ueaggregate_maximum_bit_rate_dl = 1000000000; in_ctx_req->ueaggregate_maximum_bitrate.value.ueaggregate_maximum_bit_rate_dl = 1000000000;
in_ctx_req.ueaggregate_maximum_bitrate.value.ueaggregate_maximum_bit_rate_ul = 1000000000; in_ctx_req->ueaggregate_maximum_bitrate.value.ueaggregate_maximum_bit_rate_ul = 1000000000;
// Number of E-RABs to be setup // Number of E-RABs to be setup
in_ctx_req.erab_to_be_setup_list_ctxt_su_req.value.resize(1); in_ctx_req->erab_to_be_setup_list_ctxt_su_req.value.resize(1);
in_ctx_req.erab_to_be_setup_list_ctxt_su_req.value[0].load_info_obj(ASN1_S1AP_ID_ERAB_TO_BE_SETUP_ITEM_CTXT_SU_REQ); in_ctx_req->erab_to_be_setup_list_ctxt_su_req.value[0].load_info_obj(ASN1_S1AP_ID_ERAB_TO_BE_SETUP_ITEM_CTXT_SU_REQ);
// Setup eRAB context // Setup eRAB context
asn1::s1ap::erab_to_be_setup_item_ctxt_su_req_s& erab_ctx_req = asn1::s1ap::erab_to_be_setup_item_ctxt_su_req_s& erab_ctx_req =
in_ctx_req.erab_to_be_setup_list_ctxt_su_req.value[0]->erab_to_be_setup_item_ctxt_su_req(); in_ctx_req->erab_to_be_setup_list_ctxt_su_req.value[0]->erab_to_be_setup_item_ctxt_su_req();
erab_ctx_req.erab_id = esm_ctx->erab_id; erab_ctx_req.erab_id = esm_ctx->erab_id;
// Setup E-RAB QoS parameters // Setup E-RAB QoS parameters
@ -112,21 +110,21 @@ bool s1ap_ctx_mngmt_proc::send_initial_context_setup_request(nas* nas_ctx, uint1
// Set UE security capabilities and k_enb // Set UE security capabilities and k_enb
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
if (sec_ctx->ue_network_cap.eea[i + 1] == true) { if (sec_ctx->ue_network_cap.eea[i + 1] == true) {
in_ctx_req.ue_security_cap.value.encryption_algorithms.set(16 - i, true); // EEA supported in_ctx_req->ue_security_cap.value.encryption_algorithms.set(16 - i, true); // EEA supported
} else { } else {
in_ctx_req.ue_security_cap.value.encryption_algorithms.set(16 - i, false); // EEA not supported in_ctx_req->ue_security_cap.value.encryption_algorithms.set(16 - i, false); // EEA not supported
} }
if (sec_ctx->ue_network_cap.eia[i + 1] == true) { if (sec_ctx->ue_network_cap.eia[i + 1] == true) {
in_ctx_req.ue_security_cap.value.integrity_protection_algorithms.set(16 - i, true); // EIA supported in_ctx_req->ue_security_cap.value.integrity_protection_algorithms.set(16 - i, true); // EIA supported
} else { } else {
in_ctx_req.ue_security_cap.value.integrity_protection_algorithms.set(16 - i, false); // EIA not supported in_ctx_req->ue_security_cap.value.integrity_protection_algorithms.set(16 - i, false); // EIA not supported
} }
} }
// Get K eNB // Get K eNB
// memcpy(in_ctx_req.security_key.value.data(),sec_ctx->k_enb, 32); // memcpy(in_ctx_req->security_key.value.data(),sec_ctx->k_enb, 32);
for (uint8_t i = 0; i < 32; ++i) { for (uint8_t i = 0; i < 32; ++i) {
in_ctx_req.security_key.value.data()[31 - i] = sec_ctx->k_enb[i]; in_ctx_req->security_key.value.data()[31 - i] = sec_ctx->k_enb[i];
} }
m_logger.info(sec_ctx->k_enb, 32, "Initial Context Setup Request -- Key eNB (k_enb)"); m_logger.info(sec_ctx->k_enb, 32, "Initial Context Setup Request -- Key eNB (k_enb)");
@ -157,8 +155,8 @@ bool s1ap_ctx_mngmt_proc::send_initial_context_setup_request(nas* nas_ctx, uint1
m_logger.info( m_logger.info(
"Initial Context -- S1-U TEID 0x%" PRIx64 ". IP %s ", erab_ctx_req.gtp_teid.to_number(), inet_ntoa(addr)); "Initial Context -- S1-U TEID 0x%" PRIx64 ". IP %s ", erab_ctx_req.gtp_teid.to_number(), inet_ntoa(addr));
m_logger.info("Initial Context Setup Request -- eNB UE S1AP Id %d, MME UE S1AP Id %" PRIu64 "", m_logger.info("Initial Context Setup Request -- eNB UE S1AP Id %d, MME UE S1AP Id %" PRIu64 "",
in_ctx_req.enb_ue_s1ap_id.value.value, in_ctx_req->enb_ue_s1ap_id.value.value,
in_ctx_req.mme_ue_s1ap_id.value.value); in_ctx_req->mme_ue_s1ap_id.value.value);
m_logger.info("Initial Context Setup Request -- E-RAB id %d", erab_ctx_req.erab_id); m_logger.info("Initial Context Setup Request -- E-RAB id %d", erab_ctx_req.erab_id);
m_logger.info("Initial Context Setup Request -- S1-U TEID 0x%" PRIu64 ". IP %s ", m_logger.info("Initial Context Setup Request -- S1-U TEID 0x%" PRIu64 ". IP %s ",
erab_ctx_req.gtp_teid.to_number(), erab_ctx_req.gtp_teid.to_number(),
@ -173,7 +171,7 @@ bool s1ap_ctx_mngmt_proc::send_initial_context_setup_request(nas* nas_ctx, uint1
bool s1ap_ctx_mngmt_proc::handle_initial_context_setup_response( bool s1ap_ctx_mngmt_proc::handle_initial_context_setup_response(
const asn1::s1ap::init_context_setup_resp_s& in_ctxt_resp) const asn1::s1ap::init_context_setup_resp_s& in_ctxt_resp)
{ {
uint32_t mme_ue_s1ap_id = in_ctxt_resp.protocol_ies.mme_ue_s1ap_id.value.value; uint32_t mme_ue_s1ap_id = in_ctxt_resp->mme_ue_s1ap_id.value.value;
nas* nas_ctx = m_s1ap->find_nas_ctx_from_mme_ue_s1ap_id(mme_ue_s1ap_id); nas* nas_ctx = m_s1ap->find_nas_ctx_from_mme_ue_s1ap_id(mme_ue_s1ap_id);
if (nas_ctx == nullptr) { if (nas_ctx == nullptr) {
m_logger.error("Could not find UE's context in active UE's map"); m_logger.error("Could not find UE's context in active UE's map");
@ -187,7 +185,7 @@ bool s1ap_ctx_mngmt_proc::handle_initial_context_setup_response(
// Setup E-RABs // Setup E-RABs
for (const asn1::protocol_ie_single_container_s<asn1::s1ap::erab_setup_item_ctxt_su_res_ies_o>& ie_container : for (const asn1::protocol_ie_single_container_s<asn1::s1ap::erab_setup_item_ctxt_su_res_ies_o>& ie_container :
in_ctxt_resp.protocol_ies.erab_setup_list_ctxt_su_res.value) { in_ctxt_resp->erab_setup_list_ctxt_su_res.value) {
// Get E-RAB setup context item and E-RAB Id // Get E-RAB setup context item and E-RAB Id
const asn1::s1ap::erab_setup_item_ctxt_su_res_s& erab_setup_item_ctxt = ie_container->erab_setup_item_ctxt_su_res(); const asn1::s1ap::erab_setup_item_ctxt_su_res_s& erab_setup_item_ctxt = ie_container->erab_setup_item_ctxt_su_res();
uint8_t erab_id = erab_setup_item_ctxt.erab_id; uint8_t erab_id = erab_setup_item_ctxt.erab_id;
@ -231,7 +229,7 @@ bool s1ap_ctx_mngmt_proc::handle_initial_context_setup_response(
bool s1ap_ctx_mngmt_proc::handle_ue_context_release_request(const asn1::s1ap::ue_context_release_request_s& ue_rel, bool s1ap_ctx_mngmt_proc::handle_ue_context_release_request(const asn1::s1ap::ue_context_release_request_s& ue_rel,
struct sctp_sndrcvinfo* enb_sri) struct sctp_sndrcvinfo* enb_sri)
{ {
uint32_t mme_ue_s1ap_id = ue_rel.protocol_ies.mme_ue_s1ap_id.value.value; uint32_t mme_ue_s1ap_id = ue_rel->mme_ue_s1ap_id.value.value;
m_logger.info("Received UE Context Release Request. MME-UE S1AP Id: %d", mme_ue_s1ap_id); m_logger.info("Received UE Context Release Request. MME-UE S1AP Id: %d", mme_ue_s1ap_id);
srsran::console("Received UE Context Release Request. MME-UE S1AP Id %d\n", mme_ue_s1ap_id); srsran::console("Received UE Context Release Request. MME-UE S1AP Id %d\n", mme_ue_s1ap_id);
@ -303,14 +301,13 @@ bool s1ap_ctx_mngmt_proc::send_ue_context_release_command(nas* nas_ctx)
s1ap_pdu_t tx_pdu; s1ap_pdu_t tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_RELEASE); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_UE_CONTEXT_RELEASE);
asn1::s1ap::ue_context_release_cmd_ies_container& ctx_rel_cmd = asn1::s1ap::ue_context_release_cmd_s& ctx_rel_cmd = tx_pdu.init_msg().value.ue_context_release_cmd();
tx_pdu.init_msg().value.ue_context_release_cmd().protocol_ies; ctx_rel_cmd->ue_s1ap_ids.value.set(asn1::s1ap::ue_s1ap_ids_c::types_opts::ue_s1ap_id_pair);
ctx_rel_cmd.ue_s1ap_ids.value.set(asn1::s1ap::ue_s1ap_ids_c::types_opts::ue_s1ap_id_pair); ctx_rel_cmd->ue_s1ap_ids.value.ue_s1ap_id_pair().mme_ue_s1ap_id = nas_ctx->m_ecm_ctx.mme_ue_s1ap_id;
ctx_rel_cmd.ue_s1ap_ids.value.ue_s1ap_id_pair().mme_ue_s1ap_id = nas_ctx->m_ecm_ctx.mme_ue_s1ap_id; ctx_rel_cmd->ue_s1ap_ids.value.ue_s1ap_id_pair().enb_ue_s1ap_id = nas_ctx->m_ecm_ctx.enb_ue_s1ap_id;
ctx_rel_cmd.ue_s1ap_ids.value.ue_s1ap_id_pair().enb_ue_s1ap_id = nas_ctx->m_ecm_ctx.enb_ue_s1ap_id;
ctx_rel_cmd.cause.value.set(asn1::s1ap::cause_c::types_opts::nas); ctx_rel_cmd->cause.value.set(asn1::s1ap::cause_c::types_opts::nas);
ctx_rel_cmd.cause.value.nas().value = asn1::s1ap::cause_nas_opts::options::normal_release; ctx_rel_cmd->cause.value.nas().value = asn1::s1ap::cause_nas_opts::options::normal_release;
// Send Reply to eNB // Send Reply to eNB
if (!m_s1ap->s1ap_tx_pdu(tx_pdu, &nas_ctx->m_ecm_ctx.enb_sri)) { if (!m_s1ap->s1ap_tx_pdu(tx_pdu, &nas_ctx->m_ecm_ctx.enb_sri)) {
@ -323,7 +320,7 @@ bool s1ap_ctx_mngmt_proc::send_ue_context_release_command(nas* nas_ctx)
bool s1ap_ctx_mngmt_proc::handle_ue_context_release_complete(const asn1::s1ap::ue_context_release_complete_s& rel_comp) bool s1ap_ctx_mngmt_proc::handle_ue_context_release_complete(const asn1::s1ap::ue_context_release_complete_s& rel_comp)
{ {
uint32_t mme_ue_s1ap_id = rel_comp.protocol_ies.mme_ue_s1ap_id.value.value; uint32_t mme_ue_s1ap_id = rel_comp->mme_ue_s1ap_id.value.value;
m_logger.info("Received UE Context Release Complete. MME-UE S1AP Id: %d", mme_ue_s1ap_id); m_logger.info("Received UE Context Release Complete. MME-UE S1AP Id: %d", mme_ue_s1ap_id);
srsran::console("Received UE Context Release Complete. MME-UE S1AP Id %d\n", mme_ue_s1ap_id); srsran::console("Received UE Context Release Complete. MME-UE S1AP Id %d\n", mme_ue_s1ap_id);

@ -70,19 +70,20 @@ bool s1ap_erab_mngmt_proc::send_erab_release_command(uint32_t enb_
s1ap_pdu_t tx_pdu; s1ap_pdu_t tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERAB_RELEASE); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERAB_RELEASE);
asn1::s1ap::erab_release_cmd_ies_container& erab_rel_cmd = tx_pdu.init_msg().value.erab_release_cmd().protocol_ies; asn1::s1ap::erab_release_cmd_s& erab_rel_cmd = tx_pdu.init_msg().value.erab_release_cmd();
// Add MME and eNB S1AP Ids // Add MME and eNB S1AP Ids
erab_rel_cmd.mme_ue_s1ap_id.value = mme_ue_s1ap_id; erab_rel_cmd->mme_ue_s1ap_id.value = mme_ue_s1ap_id;
erab_rel_cmd.enb_ue_s1ap_id.value = enb_ue_s1ap_id; erab_rel_cmd->enb_ue_s1ap_id.value = enb_ue_s1ap_id;
// Number of E-RABs to be setup // Number of E-RABs to be setup
erab_rel_cmd.erab_to_be_released_list.value.resize(erabs_to_release.size()); erab_rel_cmd->erab_to_be_released_list.value.resize(erabs_to_release.size());
for (uint32_t i = 0; i < erab_rel_cmd.erab_to_be_released_list.value.size(); i++) { for (uint32_t i = 0; i < erab_rel_cmd->erab_to_be_released_list.value.size(); i++) {
erab_rel_cmd.erab_to_be_released_list.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_ITEM); erab_rel_cmd->erab_to_be_released_list.value[i].load_info_obj(ASN1_S1AP_ID_ERAB_ITEM);
erab_rel_cmd.erab_to_be_released_list.value[i]->erab_item().erab_id = erabs_to_release[i]; erab_rel_cmd->erab_to_be_released_list.value[i]->erab_item().erab_id = erabs_to_release[i];
erab_rel_cmd.erab_to_be_released_list.value[i]->erab_item().cause.set(asn1::s1ap::cause_c::types::misc); erab_rel_cmd->erab_to_be_released_list.value[i]->erab_item().cause.set(asn1::s1ap::cause_c::types::misc);
erab_rel_cmd.erab_to_be_released_list.value[i]->erab_item().cause.misc() = asn1::s1ap::cause_misc_opts::unspecified; erab_rel_cmd->erab_to_be_released_list.value[i]->erab_item().cause.misc() =
asn1::s1ap::cause_misc_opts::unspecified;
m_logger.info("Sending release comman to %d", erabs_to_release[i]); m_logger.info("Sending release comman to %d", erabs_to_release[i]);
} }
@ -105,21 +106,20 @@ bool s1ap_erab_mngmt_proc::send_erab_modify_request(uint32_t
s1ap_pdu_t tx_pdu; s1ap_pdu_t tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_ERAB_MODIFY);
asn1::s1ap::erab_modify_request_ies_container& erab_mod_req = asn1::s1ap::erab_modify_request_s& erab_mod_req = tx_pdu.init_msg().value.erab_modify_request();
tx_pdu.init_msg().value.erab_modify_request().protocol_ies;
// Add MME and eNB S1AP Ids // Add MME and eNB S1AP Ids
erab_mod_req.enb_ue_s1ap_id.value = enb_ue_s1ap_id; erab_mod_req->enb_ue_s1ap_id.value = enb_ue_s1ap_id;
erab_mod_req.mme_ue_s1ap_id.value = mme_ue_s1ap_id; erab_mod_req->mme_ue_s1ap_id.value = mme_ue_s1ap_id;
// Number of E-RABs to be setup // Number of E-RABs to be setup
erab_mod_req.erab_to_be_modified_list_bearer_mod_req.value.resize(erabs_to_modify.size()); erab_mod_req->erab_to_be_modified_list_bearer_mod_req.value.resize(erabs_to_modify.size());
uint32_t i = 0; uint32_t i = 0;
for (auto erab_it = erabs_to_modify.begin(); erab_it != erabs_to_modify.end(); erab_it++) { for (auto erab_it = erabs_to_modify.begin(); erab_it != erabs_to_modify.end(); erab_it++) {
erab_mod_req.erab_to_be_modified_list_bearer_mod_req.value[i].load_info_obj( erab_mod_req->erab_to_be_modified_list_bearer_mod_req.value[i].load_info_obj(
ASN1_S1AP_ID_ERAB_TO_BE_MODIFIED_ITEM_BEARER_MOD_REQ); ASN1_S1AP_ID_ERAB_TO_BE_MODIFIED_ITEM_BEARER_MOD_REQ);
asn1::s1ap::erab_to_be_modified_item_bearer_mod_req_s& erab_to_mod = asn1::s1ap::erab_to_be_modified_item_bearer_mod_req_s& erab_to_mod =
erab_mod_req.erab_to_be_modified_list_bearer_mod_req.value[i]->erab_to_be_modified_item_bearer_mod_req(); erab_mod_req->erab_to_be_modified_list_bearer_mod_req.value[i]->erab_to_be_modified_item_bearer_mod_req();
erab_to_mod.erab_id = erab_it->first; erab_to_mod.erab_id = erab_it->first;
erab_to_mod.erab_level_qos_params.qci = erab_it->second; erab_to_mod.erab_level_qos_params.qci = erab_it->second;
erab_to_mod.erab_level_qos_params.alloc_retention_prio.prio_level = 15; // lowest erab_to_mod.erab_level_qos_params.alloc_retention_prio.prio_level = 15; // lowest

@ -117,36 +117,35 @@ bool s1ap_mngmt_proc::handle_s1_setup_request(const asn1::s1ap::s1_setup_request
*/ */
bool s1ap_mngmt_proc::unpack_s1_setup_request(const asn1::s1ap::s1_setup_request_s& msg, enb_ctx_t* enb_ctx) bool s1ap_mngmt_proc::unpack_s1_setup_request(const asn1::s1ap::s1_setup_request_s& msg, enb_ctx_t* enb_ctx)
{ {
uint8_t enb_id_bits[32]; uint8_t enb_id_bits[32];
uint32_t plmn = 0; uint32_t plmn = 0;
uint16_t tac, bplmn; uint16_t tac, bplmn;
uint32_t tmp32 = 0; uint32_t tmp32 = 0;
const asn1::s1ap::s1_setup_request_ies_container& s1_req = msg.protocol_ies; const asn1::s1ap::s1_setup_request_s& s1_req = msg;
// eNB Name // eNB Name
enb_ctx->enb_name_present = s1_req.enbname_present; enb_ctx->enb_name_present = s1_req->enbname_present;
if (s1_req.enbname_present) { if (s1_req->enbname_present) {
enb_ctx->enb_name = s1_req.enbname.value.to_string(); enb_ctx->enb_name = s1_req->enbname.value.to_string();
} }
// eNB Id // eNB Id
enb_ctx->enb_id = s1_req.global_enb_id.value.enb_id.macro_enb_id().to_number(); enb_ctx->enb_id = s1_req->global_enb_id.value.enb_id.macro_enb_id().to_number();
// PLMN Id // PLMN Id
((uint8_t*)&plmn)[1] = s1_req.global_enb_id.value.plm_nid[0]; ((uint8_t*)&plmn)[1] = s1_req->global_enb_id.value.plm_nid[0];
((uint8_t*)&plmn)[2] = s1_req.global_enb_id.value.plm_nid[1]; ((uint8_t*)&plmn)[2] = s1_req->global_enb_id.value.plm_nid[1];
((uint8_t*)&plmn)[3] = s1_req.global_enb_id.value.plm_nid[2]; ((uint8_t*)&plmn)[3] = s1_req->global_enb_id.value.plm_nid[2];
enb_ctx->plmn = ntohl(plmn); enb_ctx->plmn = ntohl(plmn);
srsran::s1ap_plmn_to_mccmnc(enb_ctx->plmn, &enb_ctx->mcc, &enb_ctx->mnc); srsran::s1ap_plmn_to_mccmnc(enb_ctx->plmn, &enb_ctx->mcc, &enb_ctx->mnc);
// SupportedTAs // SupportedTAs
enb_ctx->nof_supported_ta = s1_req.supported_tas.value.size(); enb_ctx->nof_supported_ta = s1_req->supported_tas.value.size();
for (uint16_t i = 0; i < enb_ctx->nof_supported_ta; i++) { for (uint16_t i = 0; i < enb_ctx->nof_supported_ta; i++) {
const asn1::s1ap::supported_tas_item_s& tas = s1_req.supported_tas.value[i]; const asn1::s1ap::supported_tas_item_s& tas = s1_req->supported_tas.value[i];
// TAC // TAC
((uint8_t*)&enb_ctx->tacs[i])[0] = tas.tac[0]; ((uint8_t*)&enb_ctx->tacs[i])[0] = tas.tac[0];
((uint8_t*)&enb_ctx->tacs[i])[1] = tas.tac[1]; ((uint8_t*)&enb_ctx->tacs[i])[1] = tas.tac[1];
@ -163,7 +162,7 @@ bool s1ap_mngmt_proc::unpack_s1_setup_request(const asn1::s1ap::s1_setup_request
} }
// Default Paging DRX // Default Paging DRX
enb_ctx->drx.value = s1_req.default_paging_drx.value; enb_ctx->drx.value = s1_req->default_paging_drx.value;
return true; return true;
} }
@ -173,10 +172,10 @@ bool s1ap_mngmt_proc::send_s1_setup_failure(asn1::s1ap::cause_misc_opts::options
s1ap_pdu_t tx_pdu; s1ap_pdu_t tx_pdu;
tx_pdu.set_unsuccessful_outcome().load_info_obj(ASN1_S1AP_ID_S1_SETUP); tx_pdu.set_unsuccessful_outcome().load_info_obj(ASN1_S1AP_ID_S1_SETUP);
asn1::s1ap::s1_setup_fail_ies_container& s1_fail = tx_pdu.unsuccessful_outcome().value.s1_setup_fail().protocol_ies; asn1::s1ap::s1_setup_fail_s& s1_fail = tx_pdu.unsuccessful_outcome().value.s1_setup_fail();
s1_fail.cause.value.set(asn1::s1ap::cause_c::types_opts::misc); s1_fail->cause.value.set(asn1::s1ap::cause_c::types_opts::misc);
s1_fail.cause.value.misc().value = cause; s1_fail->cause.value.misc().value = cause;
m_s1ap->s1ap_tx_pdu(tx_pdu, enb_sri); m_s1ap->s1ap_tx_pdu(tx_pdu, enb_sri);
return true; return true;
@ -189,20 +188,20 @@ bool s1ap_mngmt_proc::send_s1_setup_response(const s1ap_args_t& s1ap_args, struc
s1ap_pdu_t tx_pdu; s1ap_pdu_t tx_pdu;
tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_S1_SETUP); tx_pdu.set_successful_outcome().load_info_obj(ASN1_S1AP_ID_S1_SETUP);
asn1::s1ap::s1_setup_resp_ies_container& s1_resp = tx_pdu.successful_outcome().value.s1_setup_resp().protocol_ies; asn1::s1ap::s1_setup_resp_s& s1_resp = tx_pdu.successful_outcome().value.s1_setup_resp();
// MME Name // MME Name
s1_resp.mm_ename_present = true; s1_resp->mm_ename_present = true;
s1_resp.mm_ename.value.from_string(s1ap_args.mme_name); s1_resp->mm_ename.value.from_string(s1ap_args.mme_name);
// Served GUMEIs // Served GUMEIs
s1_resp.served_gummeis.value.resize(1); // TODO Only one served GUMMEI supported s1_resp->served_gummeis.value.resize(1); // TODO Only one served GUMMEI supported
uint32_t plmn = 0; uint32_t plmn = 0;
srsran::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &plmn); srsran::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &plmn);
plmn = htonl(plmn); plmn = htonl(plmn);
asn1::s1ap::served_gummeis_item_s& serv_gummei = s1_resp.served_gummeis.value[0]; asn1::s1ap::served_gummeis_item_s& serv_gummei = s1_resp->served_gummeis.value[0];
serv_gummei.served_plmns.resize(1); serv_gummei.served_plmns.resize(1);
serv_gummei.served_plmns[0][0] = ((uint8_t*)&plmn)[1]; serv_gummei.served_plmns[0][0] = ((uint8_t*)&plmn)[1];
@ -215,7 +214,7 @@ bool s1ap_mngmt_proc::send_s1_setup_response(const s1ap_args_t& s1ap_args, struc
serv_gummei.served_mmecs.resize(1); // Only one MMEC served serv_gummei.served_mmecs.resize(1); // Only one MMEC served
serv_gummei.served_mmecs[0].from_number(s1ap_args.mme_code); serv_gummei.served_mmecs[0].from_number(s1ap_args.mme_code);
s1_resp.relative_mme_capacity.value = 255; s1_resp->relative_mme_capacity.value = 255;
if (!m_s1ap->s1ap_tx_pdu(tx_pdu, enb_sri)) { if (!m_s1ap->s1ap_tx_pdu(tx_pdu, enb_sri)) {
m_logger.error("Error sending S1 Setup Response."); m_logger.error("Error sending S1 Setup Response.");

@ -86,19 +86,19 @@ bool s1ap_nas_transport::handle_initial_ue_message(const asn1::s1ap::init_ue_msg
bool err, mac_valid; bool err, mac_valid;
uint8_t pd, msg_type, sec_hdr_type; uint8_t pd, msg_type, sec_hdr_type;
srsran::unique_byte_buffer_t nas_msg = srsran::make_byte_buffer(); srsran::unique_byte_buffer_t nas_msg = srsran::make_byte_buffer();
memcpy(nas_msg->msg, init_ue.protocol_ies.nas_pdu.value.data(), init_ue.protocol_ies.nas_pdu.value.size()); memcpy(nas_msg->msg, init_ue->nas_pdu.value.data(), init_ue->nas_pdu.value.size());
nas_msg->N_bytes = init_ue.protocol_ies.nas_pdu.value.size(); nas_msg->N_bytes = init_ue->nas_pdu.value.size();
uint64_t imsi = 0; uint64_t imsi = 0;
uint32_t m_tmsi = 0; uint32_t m_tmsi = 0;
uint32_t enb_ue_s1ap_id = init_ue.protocol_ies.enb_ue_s1ap_id.value.value; uint32_t enb_ue_s1ap_id = init_ue->enb_ue_s1ap_id.value.value;
liblte_mme_parse_msg_header((LIBLTE_BYTE_MSG_STRUCT*)nas_msg.get(), &pd, &msg_type); liblte_mme_parse_msg_header((LIBLTE_BYTE_MSG_STRUCT*)nas_msg.get(), &pd, &msg_type);
srsran::console("Initial UE message: %s\n", liblte_nas_msg_type_to_string(msg_type)); srsran::console("Initial UE message: %s\n", liblte_nas_msg_type_to_string(msg_type));
m_logger.info("Initial UE message: %s", liblte_nas_msg_type_to_string(msg_type)); m_logger.info("Initial UE message: %s", liblte_nas_msg_type_to_string(msg_type));
if (init_ue.protocol_ies.s_tmsi_present) { if (init_ue->s_tmsi_present) {
srsran::uint8_to_uint32(init_ue.protocol_ies.s_tmsi.value.m_tmsi.data(), &m_tmsi); srsran::uint8_to_uint32(init_ue->s_tmsi.value.m_tmsi.data(), &m_tmsi);
} }
switch (msg_type) { switch (msg_type) {
@ -135,8 +135,8 @@ bool s1ap_nas_transport::handle_uplink_nas_transport(const asn1::s1ap::ul_nas_tr
struct sctp_sndrcvinfo* enb_sri) struct sctp_sndrcvinfo* enb_sri)
{ {
uint8_t pd, msg_type, sec_hdr_type; uint8_t pd, msg_type, sec_hdr_type;
uint32_t enb_ue_s1ap_id = ul_xport.protocol_ies.enb_ue_s1ap_id.value.value; uint32_t enb_ue_s1ap_id = ul_xport->enb_ue_s1ap_id.value.value;
uint32_t mme_ue_s1ap_id = ul_xport.protocol_ies.mme_ue_s1ap_id.value.value; uint32_t mme_ue_s1ap_id = ul_xport->mme_ue_s1ap_id.value.value;
bool mac_valid = false; bool mac_valid = false;
bool increase_ul_nas_cnt = true; bool increase_ul_nas_cnt = true;
@ -154,8 +154,8 @@ bool s1ap_nas_transport::handle_uplink_nas_transport(const asn1::s1ap::ul_nas_tr
// Parse NAS message header // Parse NAS message header
srsran::unique_byte_buffer_t nas_msg = srsran::make_byte_buffer(); srsran::unique_byte_buffer_t nas_msg = srsran::make_byte_buffer();
memcpy(nas_msg->msg, ul_xport.protocol_ies.nas_pdu.value.data(), ul_xport.protocol_ies.nas_pdu.value.size()); memcpy(nas_msg->msg, ul_xport->nas_pdu.value.data(), ul_xport->nas_pdu.value.size());
nas_msg->N_bytes = ul_xport.protocol_ies.nas_pdu.value.size(); nas_msg->N_bytes = ul_xport->nas_pdu.value.size();
bool msg_encrypted = false; bool msg_encrypted = false;
// Parse the message security header // Parse the message security header
@ -353,13 +353,13 @@ bool s1ap_nas_transport::send_downlink_nas_transport(uint32_t enb_
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_DL_NAS_TRANSPORT); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_DL_NAS_TRANSPORT);
// Setup Dw NAS structure // Setup Dw NAS structure
asn1::s1ap::dl_nas_transport_ies_container& dw_nas = tx_pdu.init_msg().value.dl_nas_transport().protocol_ies; asn1::s1ap::dl_nas_transport_s& dw_nas = tx_pdu.init_msg().value.dl_nas_transport();
dw_nas.enb_ue_s1ap_id.value = enb_ue_s1ap_id; dw_nas->enb_ue_s1ap_id.value = enb_ue_s1ap_id;
dw_nas.mme_ue_s1ap_id.value = mme_ue_s1ap_id; dw_nas->mme_ue_s1ap_id.value = mme_ue_s1ap_id;
// Copy NAS PDU to Downlink NAS Trasport message buffer // Copy NAS PDU to Downlink NAS Trasport message buffer
dw_nas.nas_pdu.value.resize(nas_msg->N_bytes); dw_nas->nas_pdu.value.resize(nas_msg->N_bytes);
memcpy(dw_nas.nas_pdu.value.data(), nas_msg->msg, nas_msg->N_bytes); memcpy(dw_nas->nas_pdu.value.data(), nas_msg->msg, nas_msg->N_bytes);
// Send Downlink NAS Transport Message // Send Downlink NAS Transport Message
m_s1ap->s1ap_tx_pdu(tx_pdu, &enb_sri); m_s1ap->s1ap_tx_pdu(tx_pdu, &enb_sri);

@ -38,7 +38,7 @@ bool s1ap_paging::send_paging(uint64_t imsi, uint16_t erab_to_setup)
// Prepare reply PDU // Prepare reply PDU
s1ap_pdu_t tx_pdu; s1ap_pdu_t tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_PAGING); tx_pdu.set_init_msg().load_info_obj(ASN1_S1AP_ID_PAGING);
asn1::s1ap::paging_ies_container& paging = tx_pdu.init_msg().value.paging().protocol_ies; asn1::s1ap::paging_s& paging = tx_pdu.init_msg().value.paging();
// Getting UE NAS Context // Getting UE NAS Context
nas* nas_ctx = m_s1ap->find_nas_ctx_from_imsi(imsi); nas* nas_ctx = m_s1ap->find_nas_ctx_from_imsi(imsi);
@ -49,25 +49,25 @@ bool s1ap_paging::send_paging(uint64_t imsi, uint16_t erab_to_setup)
// UE Identity Index // UE Identity Index
uint16_t ue_index = imsi % 1024; uint16_t ue_index = imsi % 1024;
paging.ue_id_idx_value.value.from_number(ue_index); paging->ue_id_idx_value.value.from_number(ue_index);
// UE Paging Id // UE Paging Id
paging.ue_paging_id.value.set_s_tmsi(); paging->ue_paging_id.value.set_s_tmsi();
paging.ue_paging_id.value.s_tmsi().mmec.from_number(m_s1ap->m_s1ap_args.mme_code); paging->ue_paging_id.value.s_tmsi().mmec.from_number(m_s1ap->m_s1ap_args.mme_code);
paging.ue_paging_id.value.s_tmsi().m_tmsi.from_number(nas_ctx->m_sec_ctx.guti.m_tmsi); paging->ue_paging_id.value.s_tmsi().m_tmsi.from_number(nas_ctx->m_sec_ctx.guti.m_tmsi);
// CMDomain // CMDomain
paging.cn_domain.value = asn1::s1ap::cn_domain_opts::ps; paging->cn_domain.value = asn1::s1ap::cn_domain_opts::ps;
// TAI List // TAI List
paging.tai_list.value.resize(1); paging->tai_list.value.resize(1);
paging.tai_list.value[0].load_info_obj(ASN1_S1AP_ID_TAI_ITEM); paging->tai_list.value[0].load_info_obj(ASN1_S1AP_ID_TAI_ITEM);
uint32_t plmn = m_s1ap->get_plmn(); uint32_t plmn = m_s1ap->get_plmn();
paging.tai_list.value[0]->tai_item().tai.plm_nid.from_number(plmn); paging->tai_list.value[0]->tai_item().tai.plm_nid.from_number(plmn);
uint16_t tac = m_s1ap->m_s1ap_args.tac; uint16_t tac = m_s1ap->m_s1ap_args.tac;
paging.tai_list.value[0]->tai_item().tai.tac.from_number(tac); paging->tai_list.value[0]->tai_item().tai.tac.from_number(tac);
// Start T3413 // Start T3413
if (!nas_ctx->start_timer(T_3413)) { if (!nas_ctx->start_timer(T_3413)) {

@ -469,7 +469,7 @@ bool ngap::handle_ng_setup_response(const asn1::ngap::ng_setup_resp_s& msg)
amf_connected = true; amf_connected = true;
ng_setup_proc_t::ngsetupresult res; ng_setup_proc_t::ngsetupresult res;
res.success = true; res.success = true;
logger.info("AMF name: %s", ngsetupresponse.protocol_ies.amf_name.value.to_string()); logger.info("AMF name: %s", ngsetupresponse->amf_name.value.to_string());
ngsetup_proc.trigger(res); ngsetup_proc.trigger(res);
return true; return true;
@ -477,7 +477,7 @@ bool ngap::handle_ng_setup_response(const asn1::ngap::ng_setup_resp_s& msg)
bool ngap::handle_ng_setup_failure(const asn1::ngap::ng_setup_fail_s& msg) bool ngap::handle_ng_setup_failure(const asn1::ngap::ng_setup_fail_s& msg)
{ {
std::string cause = get_cause(msg.protocol_ies.cause.value); std::string cause = get_cause(msg->cause.value);
logger.error("NG Setup Failure. Cause: %s", cause.c_str()); logger.error("NG Setup Failure. Cause: %s", cause.c_str());
srsran::console("NG Setup Failure. Cause: %s\n", cause.c_str()); srsran::console("NG Setup Failure. Cause: %s\n", cause.c_str());
return true; return true;
@ -488,37 +488,36 @@ bool ngap::handle_dl_nas_transport(const asn1::ngap::dl_nas_transport_s& msg)
if (msg.ext) { if (msg.ext) {
logger.warning("Not handling NGAP message extension"); logger.warning("Not handling NGAP message extension");
} }
ue* u = ue* u = handle_ngapmsg_ue_id(msg->ran_ue_ngap_id.value.value, msg->amf_ue_ngap_id.value.value);
handle_ngapmsg_ue_id(msg.protocol_ies.ran_ue_ngap_id.value.value, msg.protocol_ies.amf_ue_ngap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
logger.warning("Couldn't find user with ran_ue_ngap_id %d and %d", logger.warning("Couldn't find user with ran_ue_ngap_id %d and %d",
msg.protocol_ies.ran_ue_ngap_id.value.value, msg->ran_ue_ngap_id.value.value,
msg.protocol_ies.amf_ue_ngap_id.value.value); msg->amf_ue_ngap_id.value.value);
return false; return false;
} }
if (msg.protocol_ies.old_amf_present) { if (msg->old_amf_present) {
logger.warning("Not handling OldAMF"); logger.warning("Not handling OldAMF");
} }
if (msg.protocol_ies.ran_paging_prio_present) { if (msg->ran_paging_prio_present) {
logger.warning("Not handling RANPagingPriority"); logger.warning("Not handling RANPagingPriority");
} }
if (msg.protocol_ies.mob_restrict_list_present) { if (msg->mob_restrict_list_present) {
logger.warning("Not handling MobilityRestrictionList"); logger.warning("Not handling MobilityRestrictionList");
} }
if (msg.protocol_ies.idx_to_rfsp_present) { if (msg->idx_to_rfsp_present) {
logger.warning("Not handling IndexToRFSP"); logger.warning("Not handling IndexToRFSP");
} }
if (msg.protocol_ies.ue_aggregate_maximum_bit_rate_present) { if (msg->ue_aggregate_maximum_bit_rate_present) {
logger.warning("Not handling UEAggregateMaximumBitRate"); logger.warning("Not handling UEAggregateMaximumBitRate");
} }
if (msg.protocol_ies.allowed_nssai_present) { if (msg->allowed_nssai_present) {
logger.warning("Not handling AllowedNSSAI"); logger.warning("Not handling AllowedNSSAI");
} }
@ -527,16 +526,15 @@ bool ngap::handle_dl_nas_transport(const asn1::ngap::dl_nas_transport_s& msg)
logger.error("Fatal Error: Couldn't allocate buffer in ngap::run_thread()."); logger.error("Fatal Error: Couldn't allocate buffer in ngap::run_thread().");
return false; return false;
} }
memcpy(pdu->msg, msg.protocol_ies.nas_pdu.value.data(), msg.protocol_ies.nas_pdu.value.size()); memcpy(pdu->msg, msg->nas_pdu.value.data(), msg->nas_pdu.value.size());
pdu->N_bytes = msg.protocol_ies.nas_pdu.value.size(); pdu->N_bytes = msg->nas_pdu.value.size();
rrc->write_dl_info(u->ctxt.rnti, std::move(pdu)); rrc->write_dl_info(u->ctxt.rnti, std::move(pdu));
return true; return true;
} }
bool ngap::handle_initial_ctxt_setup_request(const asn1::ngap::init_context_setup_request_s& msg) bool ngap::handle_initial_ctxt_setup_request(const asn1::ngap::init_context_setup_request_s& msg)
{ {
ue* u = ue* u = handle_ngapmsg_ue_id(msg->ran_ue_ngap_id.value.value, msg->amf_ue_ngap_id.value.value);
handle_ngapmsg_ue_id(msg.protocol_ies.ran_ue_ngap_id.value.value, msg.protocol_ies.amf_ue_ngap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
logger.warning("Can not find UE"); logger.warning("Can not find UE");
return false; return false;
@ -549,7 +547,7 @@ bool ngap::handle_initial_ctxt_setup_request(const asn1::ngap::init_context_setu
bool ngap::handle_ue_context_release_cmd(const asn1::ngap::ue_context_release_cmd_s& msg) bool ngap::handle_ue_context_release_cmd(const asn1::ngap::ue_context_release_cmd_s& msg)
{ {
const asn1::ngap::ue_ngap_id_pair_s& ue_ngap_id_pair = msg.protocol_ies.ue_ngap_ids.value.ue_ngap_id_pair(); const asn1::ngap::ue_ngap_id_pair_s& ue_ngap_id_pair = msg->ue_ngap_ids.value.ue_ngap_id_pair();
ue* u = handle_ngapmsg_ue_id(ue_ngap_id_pair.ran_ue_ngap_id, ue_ngap_id_pair.amf_ue_ngap_id); ue* u = handle_ngapmsg_ue_id(ue_ngap_id_pair.ran_ue_ngap_id, ue_ngap_id_pair.amf_ue_ngap_id);
if (u == nullptr) { if (u == nullptr) {
@ -562,15 +560,14 @@ bool ngap::handle_ue_context_release_cmd(const asn1::ngap::ue_context_release_cm
bool ngap::handle_ue_pdu_session_res_setup_request(const asn1::ngap::pdu_session_res_setup_request_s& msg) bool ngap::handle_ue_pdu_session_res_setup_request(const asn1::ngap::pdu_session_res_setup_request_s& msg)
{ {
ue* u = ue* u = handle_ngapmsg_ue_id(msg->ran_ue_ngap_id.value.value, msg->amf_ue_ngap_id.value.value);
handle_ngapmsg_ue_id(msg.protocol_ies.ran_ue_ngap_id.value.value, msg.protocol_ies.amf_ue_ngap_id.value.value);
if (u == nullptr) { if (u == nullptr) {
logger.warning("Can not find UE"); logger.warning("Can not find UE");
return false; return false;
} }
if (msg.protocol_ies.ue_aggregate_maximum_bit_rate_present) { if (msg->ue_aggregate_maximum_bit_rate_present) {
rrc->set_aggregate_max_bitrate(u->ctxt.rnti, msg.protocol_ies.ue_aggregate_maximum_bit_rate.value); rrc->set_aggregate_max_bitrate(u->ctxt.rnti, msg->ue_aggregate_maximum_bit_rate.value);
} }
u->handle_pdu_session_res_setup_request(msg); u->handle_pdu_session_res_setup_request(msg);
@ -592,22 +589,22 @@ bool ngap::send_error_indication(const asn1::ngap::cause_c& cause,
ngap_pdu_c tx_pdu; ngap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_ERROR_IND); tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_ERROR_IND);
auto& container = tx_pdu.init_msg().value.error_ind().protocol_ies; auto& container = tx_pdu.init_msg().value.error_ind();
uint16_t rnti = SRSRAN_INVALID_RNTI; uint16_t rnti = SRSRAN_INVALID_RNTI;
container.ran_ue_ngap_id_present = ran_ue_ngap_id.has_value(); container->ran_ue_ngap_id_present = ran_ue_ngap_id.has_value();
if (ran_ue_ngap_id.has_value()) { if (ran_ue_ngap_id.has_value()) {
container.ran_ue_ngap_id.value = ran_ue_ngap_id.value(); container->ran_ue_ngap_id.value = ran_ue_ngap_id.value();
ue* user_ptr = users.find_ue_gnbid(ran_ue_ngap_id.value()); ue* user_ptr = users.find_ue_gnbid(ran_ue_ngap_id.value());
rnti = user_ptr != nullptr ? user_ptr->ctxt.rnti : SRSRAN_INVALID_RNTI; rnti = user_ptr != nullptr ? user_ptr->ctxt.rnti : SRSRAN_INVALID_RNTI;
} }
container.amf_ue_ngap_id_present = amf_ue_ngap_id.has_value(); container->amf_ue_ngap_id_present = amf_ue_ngap_id.has_value();
if (amf_ue_ngap_id.has_value()) { if (amf_ue_ngap_id.has_value()) {
container.amf_ue_ngap_id.value = amf_ue_ngap_id.value(); container->amf_ue_ngap_id.value = amf_ue_ngap_id.value();
} }
container.cause_present = true; container->cause_present = true;
container.cause.value = cause; container->cause.value = cause;
return sctp_send_ngap_pdu(tx_pdu, rnti, "Error Indication"); return sctp_send_ngap_pdu(tx_pdu, rnti, "Error Indication");
} }
@ -656,14 +653,14 @@ bool ngap::setup_ng()
ngap_pdu_c pdu; ngap_pdu_c pdu;
pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_NG_SETUP); pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_NG_SETUP);
ng_setup_request_ies_container& container = pdu.init_msg().value.ng_setup_request().protocol_ies; ng_setup_request_s& container = pdu.init_msg().value.ng_setup_request();
global_gnb_id_s& global_gnb_id = container.global_ran_node_id.value.set_global_gnb_id(); global_gnb_id_s& global_gnb_id = container->global_ran_node_id.value.set_global_gnb_id();
global_gnb_id.plmn_id = tai.plmn_id; global_gnb_id.plmn_id = tai.plmn_id;
// TODO: when ASN1 is fixed // TODO: when ASN1 is fixed
// global_gnb_id.gnb_id.set_gnb_id().from_number(args.gnb_id); // global_gnb_id.gnb_id.set_gnb_id().from_number(args.gnb_id);
// container.ran_node_name_present = true; // container->ran_node_name_present = true;
// container.ran_node_name.value.from_string(args.gnb_name); // container->ran_node_name.value.from_string(args.gnb_name);
asn1::bounded_bitstring<22, 32, false, true>& gnb_str = global_gnb_id.gnb_id.set_gnb_id(); asn1::bounded_bitstring<22, 32, false, true>& gnb_str = global_gnb_id.gnb_id.set_gnb_id();
gnb_str.resize(32); gnb_str.resize(32);
@ -672,22 +669,22 @@ bool ngap::setup_ng()
bref.pack(args.gnb_id, 8); bref.pack(args.gnb_id, 8);
memcpy(gnb_str.data(), &buffer[0], bref.distance_bytes()); memcpy(gnb_str.data(), &buffer[0], bref.distance_bytes());
container.ran_node_name_present = true; container->ran_node_name_present = true;
if (args.gnb_name.length() >= 150) { if (args.gnb_name.length() >= 150) {
args.gnb_name.resize(150); args.gnb_name.resize(150);
} }
container.ran_node_name.value.resize(args.gnb_name.size()); container->ran_node_name.value.resize(args.gnb_name.size());
memcpy(&container.ran_node_name.value[0], &args.gnb_name[0], args.gnb_name.size()); memcpy(&container->ran_node_name.value[0], &args.gnb_name[0], args.gnb_name.size());
container.supported_ta_list.value.resize(1); container->supported_ta_list.value.resize(1);
container.supported_ta_list.value[0].tac = tai.tac; container->supported_ta_list.value[0].tac = tai.tac;
container.supported_ta_list.value[0].broadcast_plmn_list.resize(1); container->supported_ta_list.value[0].broadcast_plmn_list.resize(1);
container.supported_ta_list.value[0].broadcast_plmn_list[0].plmn_id = tai.plmn_id; container->supported_ta_list.value[0].broadcast_plmn_list[0].plmn_id = tai.plmn_id;
container.supported_ta_list.value[0].broadcast_plmn_list[0].tai_slice_support_list.resize(1); container->supported_ta_list.value[0].broadcast_plmn_list[0].tai_slice_support_list.resize(1);
container.supported_ta_list.value[0].broadcast_plmn_list[0].tai_slice_support_list[0].s_nssai.sst.from_number(1); container->supported_ta_list.value[0].broadcast_plmn_list[0].tai_slice_support_list[0].s_nssai.sst.from_number(1);
container.default_paging_drx.value.value = asn1::ngap::paging_drx_opts::v256; // Todo: add to args, config file container->default_paging_drx.value.value = asn1::ngap::paging_drx_opts::v256; // Todo: add to args, config file
return sctp_send_ngap_pdu(pdu, 0, "ngSetupRequest"); return sctp_send_ngap_pdu(pdu, 0, "ngSetupRequest");
} }

@ -57,38 +57,38 @@ bool ngap::ue::send_initial_ue_message(asn1::ngap::rrcestablishment_cause_e caus
ngap_pdu_c tx_pdu; ngap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_INIT_UE_MSG); tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_INIT_UE_MSG);
init_ue_msg_ies_container& container = tx_pdu.init_msg().value.init_ue_msg().protocol_ies; init_ue_msg_s& container = tx_pdu.init_msg().value.init_ue_msg();
// 5G-S-TMSI // 5G-S-TMSI
if (has_tmsi) { if (has_tmsi) {
container.five_g_s_tmsi_present = true; container->five_g_s_tmsi_present = true;
srsran::uint32_to_uint8(s_tmsi, container.five_g_s_tmsi.value.five_g_tmsi.data()); srsran::uint32_to_uint8(s_tmsi, container->five_g_s_tmsi.value.five_g_tmsi.data());
container.five_g_s_tmsi.value.amf_set_id.from_number(ctxt.amf_set_id); container->five_g_s_tmsi.value.amf_set_id.from_number(ctxt.amf_set_id);
container.five_g_s_tmsi.value.amf_pointer.from_number(ctxt.amf_pointer); container->five_g_s_tmsi.value.amf_pointer.from_number(ctxt.amf_pointer);
} }
// RAN_UE_NGAP_ID // RAN_UE_NGAP_ID
container.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id; container->ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id;
// NAS_PDU // NAS_PDU
container.nas_pdu.value.resize(pdu.size()); container->nas_pdu.value.resize(pdu.size());
memcpy(container.nas_pdu.value.data(), pdu.data(), pdu.size()); memcpy(container->nas_pdu.value.data(), pdu.data(), pdu.size());
// RRC Establishment Cause // RRC Establishment Cause
container.rrcestablishment_cause.value = cause; container->rrcestablishment_cause.value = cause;
// User Location Info // User Location Info
// userLocationInformationNR // userLocationInformationNR
container.user_location_info.value.set_user_location_info_nr(); container->user_location_info.value.set_user_location_info_nr();
container.user_location_info.value.user_location_info_nr().nr_cgi.nrcell_id = ngap_ptr->nr_cgi.nrcell_id; container->user_location_info.value.user_location_info_nr().nr_cgi.nrcell_id = ngap_ptr->nr_cgi.nrcell_id;
container.user_location_info.value.user_location_info_nr().nr_cgi.plmn_id = ngap_ptr->nr_cgi.plmn_id; container->user_location_info.value.user_location_info_nr().nr_cgi.plmn_id = ngap_ptr->nr_cgi.plmn_id;
container.user_location_info.value.user_location_info_nr().tai.plmn_id = ngap_ptr->tai.plmn_id; container->user_location_info.value.user_location_info_nr().tai.plmn_id = ngap_ptr->tai.plmn_id;
container.user_location_info.value.user_location_info_nr().tai.tac = ngap_ptr->tai.tac; container->user_location_info.value.user_location_info_nr().tai.tac = ngap_ptr->tai.tac;
// UE context request for setup in the NAS registration request // UE context request for setup in the NAS registration request
container.ue_context_request_present = true; container->ue_context_request_present = true;
container.ue_context_request.value = asn1::ngap::ue_context_request_opts::options::requested; container->ue_context_request.value = asn1::ngap::ue_context_request_opts::options::requested;
return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "InitialUEMessage"); return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "InitialUEMessage");
} }
@ -102,30 +102,30 @@ bool ngap::ue::send_ul_nas_transport(srsran::const_byte_span pdu)
ngap_pdu_c tx_pdu; ngap_pdu_c tx_pdu;
tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_UL_NAS_TRANSPORT); tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_UL_NAS_TRANSPORT);
asn1::ngap::ul_nas_transport_ies_container& container = tx_pdu.init_msg().value.ul_nas_transport().protocol_ies; ul_nas_transport_s& container = tx_pdu.init_msg().value.ul_nas_transport();
// AMF UE NGAP ID // AMF UE NGAP ID
if (ctxt.amf_ue_ngap_id.has_value()) { if (ctxt.amf_ue_ngap_id.has_value()) {
container.amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value(); container->amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value();
} else { } else {
logger.error("Attempting to send UL NAS Transport without AMF context"); logger.error("Attempting to send UL NAS Transport without AMF context");
return false; return false;
} }
// RAN UE NGAP ID // RAN UE NGAP ID
container.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id; container->ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id;
// NAS PDU // NAS PDU
container.nas_pdu.value.resize(pdu.size()); container->nas_pdu.value.resize(pdu.size());
memcpy(container.nas_pdu.value.data(), pdu.data(), pdu.size()); memcpy(container->nas_pdu.value.data(), pdu.data(), pdu.size());
// User Location Info // User Location Info
// userLocationInformationNR // userLocationInformationNR
container.user_location_info.value.set_user_location_info_nr(); container->user_location_info.value.set_user_location_info_nr();
container.user_location_info.value.user_location_info_nr().nr_cgi.nrcell_id = ngap_ptr->nr_cgi.nrcell_id; container->user_location_info.value.user_location_info_nr().nr_cgi.nrcell_id = ngap_ptr->nr_cgi.nrcell_id;
container.user_location_info.value.user_location_info_nr().nr_cgi.plmn_id = ngap_ptr->nr_cgi.plmn_id; container->user_location_info.value.user_location_info_nr().nr_cgi.plmn_id = ngap_ptr->nr_cgi.plmn_id;
container.user_location_info.value.user_location_info_nr().tai.plmn_id = ngap_ptr->tai.plmn_id; container->user_location_info.value.user_location_info_nr().tai.plmn_id = ngap_ptr->tai.plmn_id;
container.user_location_info.value.user_location_info_nr().tai.tac = ngap_ptr->tai.tac; container->user_location_info.value.user_location_info_nr().tai.tac = ngap_ptr->tai.tac;
return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "UplinkNASTransport"); return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "UplinkNASTransport");
} }
@ -147,10 +147,10 @@ bool ngap::ue::send_initial_ctxt_setup_response()
init_context_setup_resp_s& container = tx_pdu.successful_outcome().value.init_context_setup_resp(); init_context_setup_resp_s& container = tx_pdu.successful_outcome().value.init_context_setup_resp();
// AMF UE NGAP ID // AMF UE NGAP ID
container.protocol_ies.amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value(); container->amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value();
// RAN UE NGAP ID // RAN UE NGAP ID
container.protocol_ies.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id; container->ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id;
return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "InitialContextSetupResponse"); return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "InitialContextSetupResponse");
} }
@ -167,16 +167,16 @@ bool ngap::ue::send_initial_ctxt_setup_failure(cause_c cause)
init_context_setup_fail_s& container = tx_pdu.unsuccessful_outcome().value.init_context_setup_fail(); init_context_setup_fail_s& container = tx_pdu.unsuccessful_outcome().value.init_context_setup_fail();
// AMF UE NGAP ID // AMF UE NGAP ID
container.protocol_ies.amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value(); container->amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value();
// RAN UE NGAP ID // RAN UE NGAP ID
container.protocol_ies.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id; container->ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id;
/* // TODO: PDU Session Resource Setup Response List - Integrate PDU Session and Bearer management into NGAP /* // TODO: PDU Session Resource Setup Response List - Integrate PDU Session and Bearer management into NGAP
container.protocol_ies.pdu_session_res_setup_list_cxt_res_present = true; container->pdu_session_res_setup_list_cxt_res_present = true;
// Case PDU Session Resource Failed to Setup List // Case PDU Session Resource Failed to Setup List
container.protocol_ies.pdu_session_res_failed_to_setup_list_cxt_res_present = true; */ container->pdu_session_res_failed_to_setup_list_cxt_res_present = true; */
return true; return true;
} }
@ -192,10 +192,10 @@ bool ngap::ue::send_pdu_session_resource_setup_response(uint16_t
// TODO: QOS Params // TODO: QOS Params
ngap_pdu_c tx_pdu; ngap_pdu_c tx_pdu;
tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_ID_PDU_SESSION_RES_SETUP); tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_ID_PDU_SESSION_RES_SETUP);
pdu_session_res_setup_resp_s& container = tx_pdu.successful_outcome().value.pdu_session_res_setup_resp(); pdu_session_res_setup_resp_s& container = tx_pdu.successful_outcome().value.pdu_session_res_setup_resp();
container.protocol_ies.amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value(); container->amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value();
container.protocol_ies.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id; container->ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id;
container.protocol_ies.pdu_session_res_setup_list_su_res_present = true; container->pdu_session_res_setup_list_su_res_present = true;
pdu_session_res_setup_item_su_res_s su_res; pdu_session_res_setup_item_su_res_s su_res;
su_res.pdu_session_res_setup_resp_transfer.resize(512); su_res.pdu_session_res_setup_resp_transfer.resize(512);
su_res.pdu_session_id = pdu_session_id; su_res.pdu_session_id = pdu_session_id;
@ -216,7 +216,7 @@ bool ngap::ue::send_pdu_session_resource_setup_response(uint16_t
resp_transfer.pack(bref); resp_transfer.pack(bref);
su_res.pdu_session_res_setup_resp_transfer.resize(bref.distance_bytes()); su_res.pdu_session_res_setup_resp_transfer.resize(bref.distance_bytes());
container.protocol_ies.pdu_session_res_setup_list_su_res.value.push_back(su_res); container->pdu_session_res_setup_list_su_res.value.push_back(su_res);
return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "PDUSessionResourceSetupResponse"); return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "PDUSessionResourceSetupResponse");
} }
@ -232,14 +232,14 @@ bool ngap::ue::send_ue_ctxt_release_complete()
ue_context_release_complete_s& container = tx_pdu.successful_outcome().value.ue_context_release_complete(); ue_context_release_complete_s& container = tx_pdu.successful_outcome().value.ue_context_release_complete();
// userLocationInformationNR // userLocationInformationNR
container.protocol_ies.user_location_info.value.set_user_location_info_nr(); container->user_location_info.value.set_user_location_info_nr();
container.protocol_ies.user_location_info.value.user_location_info_nr().nr_cgi.nrcell_id = ngap_ptr->nr_cgi.nrcell_id; container->user_location_info.value.user_location_info_nr().nr_cgi.nrcell_id = ngap_ptr->nr_cgi.nrcell_id;
container.protocol_ies.user_location_info.value.user_location_info_nr().nr_cgi.plmn_id = ngap_ptr->nr_cgi.plmn_id; container->user_location_info.value.user_location_info_nr().nr_cgi.plmn_id = ngap_ptr->nr_cgi.plmn_id;
container.protocol_ies.user_location_info.value.user_location_info_nr().tai.plmn_id = ngap_ptr->tai.plmn_id; container->user_location_info.value.user_location_info_nr().tai.plmn_id = ngap_ptr->tai.plmn_id;
container.protocol_ies.user_location_info.value.user_location_info_nr().tai.tac = ngap_ptr->tai.tac; container->user_location_info.value.user_location_info_nr().tai.tac = ngap_ptr->tai.tac;
container.protocol_ies.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id; container->ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id;
container.protocol_ies.amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value(); container->amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value();
return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "UEContextReleaseComplete"); return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "UEContextReleaseComplete");
} }
@ -261,10 +261,10 @@ bool ngap::ue::send_ue_context_release_request(asn1::ngap::cause_c cause)
tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_UE_CONTEXT_RELEASE_REQUEST); tx_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_UE_CONTEXT_RELEASE_REQUEST);
ue_context_release_request_s& container = tx_pdu.init_msg().value.ue_context_release_request(); ue_context_release_request_s& container = tx_pdu.init_msg().value.ue_context_release_request();
container.protocol_ies.cause.value = cause; container->cause.value = cause;
// PDU Session Resource List // PDU Session Resource List
auto& session_lst = container.protocol_ies.pdu_session_res_list_cxt_rel_req.value; auto& session_lst = container->pdu_session_res_list_cxt_rel_req.value;
for (const auto& pdu_pair : bearer_manager.pdu_sessions()) { for (const auto& pdu_pair : bearer_manager.pdu_sessions()) {
const ngap_ue_bearer_manager::pdu_session_t& session = pdu_pair.second; const ngap_ue_bearer_manager::pdu_session_t& session = pdu_pair.second;
@ -272,10 +272,10 @@ bool ngap::ue::send_ue_context_release_request(asn1::ngap::cause_c cause)
obj.pdu_session_id = session.id; obj.pdu_session_id = session.id;
session_lst.push_back(obj); session_lst.push_back(obj);
} }
container.protocol_ies.pdu_session_res_list_cxt_rel_req_present = session_lst.size() > 0; container->pdu_session_res_list_cxt_rel_req_present = session_lst.size() > 0;
container.protocol_ies.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id; container->ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id;
container.protocol_ies.amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value(); container->amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value();
// TODO: Implement timeout // TODO: Implement timeout
return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "UEContextReleaseRequest"); return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "UEContextReleaseRequest");

@ -24,24 +24,24 @@ ngap_ue_initial_context_setup_proc::ngap_ue_initial_context_setup_proc(ngap_inte
proc_outcome_t ngap_ue_initial_context_setup_proc::init(const asn1::ngap::init_context_setup_request_s& msg) proc_outcome_t ngap_ue_initial_context_setup_proc::init(const asn1::ngap::init_context_setup_request_s& msg)
{ {
ue_ctxt->amf_pointer = msg.protocol_ies.guami.value.amf_pointer.to_number(); ue_ctxt->amf_pointer = msg->guami.value.amf_pointer.to_number();
ue_ctxt->amf_set_id = msg.protocol_ies.guami.value.amf_set_id.to_number(); ue_ctxt->amf_set_id = msg->guami.value.amf_set_id.to_number();
ue_ctxt->amf_region_id = msg.protocol_ies.guami.value.amf_region_id.to_number(); ue_ctxt->amf_region_id = msg->guami.value.amf_region_id.to_number();
if (msg.protocol_ies.ue_aggregate_maximum_bit_rate_present == true) { if (msg->ue_aggregate_maximum_bit_rate_present == true) {
rrc->ue_set_bitrates(ue_ctxt->rnti, msg.protocol_ies.ue_aggregate_maximum_bit_rate.value); rrc->ue_set_bitrates(ue_ctxt->rnti, msg->ue_aggregate_maximum_bit_rate.value);
} }
rrc->ue_set_security_cfg_capabilities(ue_ctxt->rnti, msg.protocol_ies.ue_security_cap.value); rrc->ue_set_security_cfg_capabilities(ue_ctxt->rnti, msg->ue_security_cap.value);
rrc->ue_set_security_cfg_key(ue_ctxt->rnti, msg.protocol_ies.security_key.value); rrc->ue_set_security_cfg_key(ue_ctxt->rnti, msg->security_key.value);
if (msg.protocol_ies.nas_pdu_present) { if (msg->nas_pdu_present) {
srsran::unique_byte_buffer_t pdu = srsran::make_byte_buffer(); srsran::unique_byte_buffer_t pdu = srsran::make_byte_buffer();
if (pdu == nullptr) { if (pdu == nullptr) {
logger.error("Fatal Error: Couldn't allocate buffer in %s.", __FUNCTION__); logger.error("Fatal Error: Couldn't allocate buffer in %s.", __FUNCTION__);
return proc_outcome_t::error; return proc_outcome_t::error;
} }
memcpy(pdu->msg, msg.protocol_ies.nas_pdu.value.data(), msg.protocol_ies.nas_pdu.value.size()); memcpy(pdu->msg, msg->nas_pdu.value.data(), msg->nas_pdu.value.size());
pdu->N_bytes = msg.protocol_ies.nas_pdu.value.size(); pdu->N_bytes = msg->nas_pdu.value.size();
rrc->start_security_mode_procedure(ue_ctxt->rnti, std::move(pdu)); rrc->start_security_mode_procedure(ue_ctxt->rnti, std::move(pdu));
} else { } else {
rrc->start_security_mode_procedure(ue_ctxt->rnti, nullptr); rrc->start_security_mode_procedure(ue_ctxt->rnti, nullptr);
@ -102,12 +102,12 @@ ngap_ue_pdu_session_res_setup_proc::ngap_ue_pdu_session_res_setup_proc(ngap_inte
proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap::pdu_session_res_setup_request_s& msg) proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap::pdu_session_res_setup_request_s& msg)
{ {
if (msg.protocol_ies.pdu_session_res_setup_list_su_req.value.size() != 1) { if (msg->pdu_session_res_setup_list_su_req.value.size() != 1) {
logger.error("Not handling zero or multiple su requests"); logger.error("Not handling zero or multiple su requests");
return proc_outcome_t::error; return proc_outcome_t::error;
} }
asn1::ngap::pdu_session_res_setup_item_su_req_s su_req = msg.protocol_ies.pdu_session_res_setup_list_su_req.value[0]; asn1::ngap::pdu_session_res_setup_item_su_req_s su_req = msg->pdu_session_res_setup_list_su_req.value[0];
asn1::cbit_ref pdu_session_bref(su_req.pdu_session_res_setup_request_transfer.data(), asn1::cbit_ref pdu_session_bref(su_req.pdu_session_res_setup_request_transfer.data(),
su_req.pdu_session_res_setup_request_transfer.size()); su_req.pdu_session_res_setup_request_transfer.size());
@ -119,25 +119,25 @@ proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap::pdu_se
return proc_outcome_t::error; return proc_outcome_t::error;
} }
if (pdu_ses_res_setup_req_trans.protocol_ies.qos_flow_setup_request_list.value.size() != 1) { if (pdu_ses_res_setup_req_trans->qos_flow_setup_request_list.value.size() != 1) {
logger.error("Expected one item in QoS flow setup request list"); logger.error("Expected one item in QoS flow setup request list");
return proc_outcome_t::error; return proc_outcome_t::error;
} }
if (pdu_ses_res_setup_req_trans.protocol_ies.ul_ngu_up_tnl_info.value.type() != if (pdu_ses_res_setup_req_trans->ul_ngu_up_tnl_info.value.type() !=
asn1::ngap::up_transport_layer_info_c::types::gtp_tunnel) { asn1::ngap::up_transport_layer_info_c::types::gtp_tunnel) {
logger.error("Expected GTP Tunnel"); logger.error("Expected GTP Tunnel");
return proc_outcome_t::error; return proc_outcome_t::error;
} }
asn1::ngap::qos_flow_setup_request_item_s qos_flow_setup = asn1::ngap::qos_flow_setup_request_item_s qos_flow_setup =
pdu_ses_res_setup_req_trans.protocol_ies.qos_flow_setup_request_list.value[0]; pdu_ses_res_setup_req_trans->qos_flow_setup_request_list.value[0];
srsran::const_span<uint8_t> nas_pdu_dummy; srsran::const_span<uint8_t> nas_pdu_dummy;
uint32_t teid_out = 0; uint32_t teid_out = 0;
teid_out |= pdu_ses_res_setup_req_trans.protocol_ies.ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[0] << 24u; teid_out |= pdu_ses_res_setup_req_trans->ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[0] << 24u;
teid_out |= pdu_ses_res_setup_req_trans.protocol_ies.ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[1] << 16u; teid_out |= pdu_ses_res_setup_req_trans->ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[1] << 16u;
teid_out |= pdu_ses_res_setup_req_trans.protocol_ies.ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[2] << 8u; teid_out |= pdu_ses_res_setup_req_trans->ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[2] << 8u;
teid_out |= pdu_ses_res_setup_req_trans.protocol_ies.ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[3]; teid_out |= pdu_ses_res_setup_req_trans->ul_ngu_up_tnl_info.value.gtp_tunnel().gtp_teid[3];
// TODO: Check cause // TODO: Check cause
asn1::ngap::cause_c cause; asn1::ngap::cause_c cause;
@ -149,7 +149,7 @@ proc_outcome_t ngap_ue_pdu_session_res_setup_proc::init(const asn1::ngap::pdu_se
ue_ctxt->rnti, ue_ctxt->rnti,
su_req.pdu_session_id, su_req.pdu_session_id,
qos_flow_setup.qos_flow_level_qos_params, qos_flow_setup.qos_flow_level_qos_params,
pdu_ses_res_setup_req_trans.protocol_ies.ul_ngu_up_tnl_info.value.gtp_tunnel().transport_layer_address, pdu_ses_res_setup_req_trans->ul_ngu_up_tnl_info.value.gtp_tunnel().transport_layer_address,
teid_out, teid_out,
lcid, lcid,
addr_in, addr_in,

@ -209,31 +209,31 @@ void run_ng_initial_ue(ngap& ngap_obj, amf_dummy& amf, rrc_nr_dummy& rrc)
asn1::ngap::ngap_pdu_c ngap_initial_ctx_req_pdu; asn1::ngap::ngap_pdu_c ngap_initial_ctx_req_pdu;
ngap_initial_ctx_req_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_INIT_CONTEXT_SETUP); ngap_initial_ctx_req_pdu.set_init_msg().load_info_obj(ASN1_NGAP_ID_INIT_CONTEXT_SETUP);
auto& container = ngap_initial_ctx_req_pdu.init_msg().value.init_context_setup_request().protocol_ies; auto& container = ngap_initial_ctx_req_pdu.init_msg().value.init_context_setup_request();
container.amf_ue_ngap_id.value = 0x1; container->amf_ue_ngap_id.value = 0x1;
container.ran_ue_ngap_id.value = 0x1; container->ran_ue_ngap_id.value = 0x1;
container.nas_pdu_present = true; container->nas_pdu_present = true;
// Set allowed NSSAI (FIXME) // Set allowed NSSAI (FIXME)
container.allowed_nssai.value.resize(1); container->allowed_nssai.value.resize(1);
// Set security key // Set security key
uint8_t sec_key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, uint8_t sec_key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}; 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f};
for (uint8_t i = 0; i < 32; ++i) { for (uint8_t i = 0; i < 32; ++i) {
container.security_key.value.data()[31 - i] = sec_key[i]; container->security_key.value.data()[31 - i] = sec_key[i];
} }
// Set security capabilities // Set security capabilities
container.ue_security_cap.value.nrencryption_algorithms.set(0, true); container->ue_security_cap.value.nrencryption_algorithms.set(0, true);
container.ue_security_cap.value.nrencryption_algorithms.set(1, true); container->ue_security_cap.value.nrencryption_algorithms.set(1, true);
container.ue_security_cap.value.nrintegrity_protection_algorithms.set(0, true); container->ue_security_cap.value.nrintegrity_protection_algorithms.set(0, true);
container.ue_security_cap.value.nrintegrity_protection_algorithms.set(1, true); container->ue_security_cap.value.nrintegrity_protection_algorithms.set(1, true);
container.ue_security_cap.value.eutr_aencryption_algorithms.set(0, true); container->ue_security_cap.value.eutr_aencryption_algorithms.set(0, true);
container.ue_security_cap.value.eutr_aencryption_algorithms.set(1, true); container->ue_security_cap.value.eutr_aencryption_algorithms.set(1, true);
container.ue_security_cap.value.eutr_aintegrity_protection_algorithms.set(0, true); container->ue_security_cap.value.eutr_aintegrity_protection_algorithms.set(0, true);
container.ue_security_cap.value.eutr_aintegrity_protection_algorithms.set(1, true); container->ue_security_cap.value.eutr_aintegrity_protection_algorithms.set(1, true);
// Set PDU Session Response Setup Item // Set PDU Session Response Setup Item
// TODO // TODO
@ -254,13 +254,13 @@ void run_ng_initial_ue(ngap& ngap_obj, amf_dummy& amf, rrc_nr_dummy& rrc)
// Check RRC security capabilities // Check RRC security capabilities
for (uint8_t i = 0; i < 8; ++i) { for (uint8_t i = 0; i < 8; ++i) {
TESTASSERT_EQ(container.ue_security_cap.value.nrencryption_algorithms.get(i), TESTASSERT_EQ(container->ue_security_cap.value.nrencryption_algorithms.get(i),
rrc.sec_caps.nrencryption_algorithms.get(i)); rrc.sec_caps.nrencryption_algorithms.get(i));
TESTASSERT_EQ(container.ue_security_cap.value.nrintegrity_protection_algorithms.get(i), TESTASSERT_EQ(container->ue_security_cap.value.nrintegrity_protection_algorithms.get(i),
rrc.sec_caps.nrintegrity_protection_algorithms.get(i)); rrc.sec_caps.nrintegrity_protection_algorithms.get(i));
TESTASSERT_EQ(container.ue_security_cap.value.eutr_aencryption_algorithms.get(i), TESTASSERT_EQ(container->ue_security_cap.value.eutr_aencryption_algorithms.get(i),
rrc.sec_caps.eutr_aencryption_algorithms.get(i)); rrc.sec_caps.eutr_aencryption_algorithms.get(i));
TESTASSERT_EQ(container.ue_security_cap.value.eutr_aintegrity_protection_algorithms.get(i), TESTASSERT_EQ(container->ue_security_cap.value.eutr_aintegrity_protection_algorithms.get(i),
rrc.sec_caps.eutr_aintegrity_protection_algorithms.get(i)); rrc.sec_caps.eutr_aintegrity_protection_algorithms.get(i));
} }

Loading…
Cancel
Save