Addition NGAP cleanup

master
Bedran Karakoc 3 years ago committed by Bedran Karakoc
parent fa87715724
commit a14cc451d0

@ -49,7 +49,6 @@ public:
virtual void user_mod(uint16_t old_rnti, uint16_t new_rnti) = 0;
virtual bool user_release(uint16_t rnti, asn1::ngap_nr::cause_radio_network_e cause_radio) = 0;
virtual bool is_amf_connected() = 0;
virtual void ue_ctxt_setup_complete(uint16_t rnti) = 0;
virtual void ue_notify_rrc_reconf_complete(uint16_t rnti, bool outcome) = 0;
};

@ -65,7 +65,6 @@ public:
bool send_error_indication(const asn1::ngap_nr::cause_c& cause,
srsran::optional<uint32_t> ran_ue_ngap_id = {},
srsran::optional<uint32_t> amf_ue_ngap_id = {});
void ue_ctxt_setup_complete(uint16_t rnti);
void ue_notify_rrc_reconf_complete(uint16_t rnti, bool outcome);
bool send_pdu_session_resource_setup_response();

@ -54,7 +54,6 @@ public:
bool handle_pdu_session_res_setup_request(const asn1::ngap_nr::pdu_session_res_setup_request_s& msg);
bool was_uectxtrelease_requested() const { return release_requested; }
void ue_ctxt_setup_complete();
void notify_rrc_reconf_complete(const bool reconf_complete_outcome);
ngap_ue_ctxt_t ctxt = {};

@ -244,15 +244,6 @@ void ngap::initial_ue(uint16_t rnti,
u->send_initial_ue_message(cause, std::move(pdu), true, s_tmsi);
}
void ngap::ue_ctxt_setup_complete(uint16_t rnti)
{
ue* u = users.find_ue_rnti(rnti);
if (u == nullptr) {
return;
}
u->ue_ctxt_setup_complete();
}
void ngap::ue_notify_rrc_reconf_complete(uint16_t rnti, bool outcome)
{
ue* u = users.find_ue_rnti(rnti);
@ -396,8 +387,6 @@ bool ngap::handle_ngap_rx_pdu(srsran::byte_buffer_t* pdu)
send_error_indication(cause);
return false;
}
// TODO:
// log_ngap_msg(rx_pdu, srsran::make_span(*pdu), true);
switch (rx_pdu.type().value) {
case ngap_pdu_c::types_opts::init_msg:
@ -459,6 +448,7 @@ bool ngap::handle_ng_setup_response(const asn1::ngap_nr::ng_setup_resp_s& msg)
amf_connected = true;
ng_setup_proc_t::ngsetupresult res;
res.success = true;
logger.info("AMF name: %s", ngsetupresponse.protocol_ies.amf_name.value.to_string());
ngsetup_proc.trigger(res);
return true;
@ -663,13 +653,11 @@ bool ngap::setup_ng()
bref.pack(args.gnb_id, 8);
memcpy(gnb_str.data(), &buffer[0], bref.distance_bytes());
// .from_number(args.gnb_id);
container.ran_node_name_present = true;
if (args.gnb_name.length() >= 150) {
args.gnb_name.resize(150);
}
// container.ran_node_name.value.from_string(args.enb_name);
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());
@ -708,12 +696,6 @@ bool ngap::sctp_send_ngap_pdu(const asn1::ngap_nr::ngap_pdu_c& tx_pdu, uint32_t
}
buf->N_bytes = bref.distance_bytes();
// TODO: when we got pcap support
// Save message to PCAP
// if (pcap != nullptr) {
// pcap->write_s1ap(buf->msg, buf->N_bytes);
// }
if (rnti != SRSRAN_INVALID_RNTI) {
logger.info(buf->msg, buf->N_bytes, "Tx NGAP SDU, %s, rnti=0x%x", procedure_name, rnti);
} else {
@ -781,12 +763,12 @@ ngap::ue* ngap::handle_ngapmsg_ue_id(uint32_t gnb_id, uint32_t amf_id)
send_error_indication(cause, gnb_id, amf_id);
if (user_ptr != nullptr) {
// rrc->release_ue(user_ptr->ctxt.rnti);
/* if (user_ptr != nullptr) {
rrc->release_ue(user_ptr->ctxt.rnti);
}
if (user_amf_ptr != nullptr and user_amf_ptr != user_ptr) {
// rrc->release_ue(user_mme_ptr->ctxt.rnti);
}
rrc->release_ue(user_mme_ptr->ctxt.rnti);
} */
return nullptr;
}

@ -105,7 +105,11 @@ bool ngap::ue::send_ul_nas_transport(srsran::unique_byte_buffer_t pdu)
asn1::ngap_nr::ul_nas_transport_ies_container& container = tx_pdu.init_msg().value.ul_nas_transport().protocol_ies;
// AMF UE NGAP ID
if (ctxt.amf_ue_ngap_id.has_value()) {
container.amf_ue_ngap_id.value = ctxt.amf_ue_ngap_id.value();
} else {
logger.error("Attempting to send UL NAS Transport without AMF context");
}
// RAN UE NGAP ID
container.ran_ue_ngap_id.value = ctxt.ran_ue_ngap_id;
@ -125,14 +129,6 @@ bool ngap::ue::send_ul_nas_transport(srsran::unique_byte_buffer_t pdu)
return ngap_ptr->sctp_send_ngap_pdu(tx_pdu, ctxt.rnti, "UplinkNASTransport");
}
void ngap::ue::ue_ctxt_setup_complete()
{
ngap_pdu_c tx_pdu;
// Handle PDU Session List once RRC interface is ready
tx_pdu.set_successful_outcome().load_info_obj(ASN1_NGAP_NR_ID_INIT_CONTEXT_SETUP);
auto& container = tx_pdu.successful_outcome().value.init_context_setup_resp().protocol_ies;
}
void ngap::ue::notify_rrc_reconf_complete(const bool outcome)
{
initial_context_setup_proc.trigger(outcome);

Loading…
Cancel
Save