Commit c5f759d4 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Code cleanup

parent 4eaea279
This diff is collapsed.
......@@ -200,7 +200,6 @@ class smf_app {
void operator=(smf_app const&) = delete;
void test_dns();
/*
* Set the association between Seid and SM Context
* @param [const seid_t &] seid: SessionID
......
This diff is collapsed.
......@@ -597,11 +597,11 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
amf_status_uri = {};
target_amf = {};
supi_prefix = {};
// Subscribe to sm context status change
// Subscribe to SM Context Status Change
sm_context_status_connection =
event_sub.subscribe_sm_context_status(boost::bind(
&smf_context::handle_sm_context_status_change, this, _1, _2, _3));
// Subscribe to pdu session release (event exposure)
// Subscribe to PDU Session Release (event exposure)
ee_pdu_session_release_connection =
event_sub.subscribe_ee_pdu_session_release(boost::bind(
&smf_context::handle_ee_pdu_session_release, this, _1, _2, _3));
......@@ -1019,13 +1019,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
*/
supi_t get_supi() const;
/*
* Get the number of dnn contexts
* @param
* @return std::size_t: the number of contexts
*/
std::size_t get_number_dnn_contexts() const;
/*
* Get Supi prefix
* @param [const std::string &] prefix: Supi prefix (e.g., imsi)
......@@ -1251,12 +1244,10 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
const pdu_session_id_t& pdu_session_id) const;
private:
// std::vector<std::shared_ptr<dnn_context>> dnns;
std::vector<std::shared_ptr<smf_procedure>> pending_procedures;
// snssai-sst <-> session management subscription
std::map<uint8_t, std::shared_ptr<session_management_subscription>>
dnn_subscriptions;
std::map<pdu_session_id_t, std::shared_ptr<smf_pdu_session>>
pdu_sessions; // Store all PDU Sessions associated with this UE
mutable std::shared_mutex m_pdu_sessions_mutex;
......@@ -1265,9 +1256,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
std::string supi_prefix;
plmn_t plmn;
// AMF IP addr
// string amf_addr;
std::string amf_id;
std::string amf_addr;
std::string amf_status_uri;
......
......@@ -416,7 +416,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
// Get the SMF_PDU_Session
std::shared_ptr<smf_context> sc = {};
// std::shared_ptr<dnn_context> sd = {};
std::shared_ptr<smf_pdu_session> sp = {};
supi_t supi = sm_context_res.get_supi();
supi64_t supi64 = smf_supi_to_u64(supi);
......@@ -429,20 +428,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
"SMF context with SUPI " SUPI_64_FMT " does not exist!", supi64);
return false;
}
/*
bool find_dnn = sc.get()->find_dnn_context(
sm_context_res.get_snssai(), sm_context_res.get_dnn(), sd);
bool find_pdu = false;
if (find_dnn) {
find_pdu =
sd.get()->find_pdu_session(sm_context_res.get_pdu_session_id(), sp);
}
if (!find_dnn or !find_pdu) {
// error
Logger::smf_n1().warn("DNN or PDU session context does not exist!");
return false;
}
*/
if (!sc.get()->find_pdu_session(sm_context_res.get_pdu_session_id(), sp)) {
// error
......@@ -574,7 +559,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
// Get the SMF_PDU_Session
std::shared_ptr<smf_context> sc = {};
// std::shared_ptr<dnn_context> sd = {};
std::shared_ptr<smf_pdu_session> sp = {};
supi_t supi = msg.get_supi();
supi64_t supi64 = smf_supi_to_u64(supi);
......@@ -587,19 +571,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
"SMF context with SUPI " SUPI_64_FMT " does not exist!", supi64);
return false;
}
/*
bool find_dnn =
sc.get()->find_dnn_context(msg.get_snssai(), msg.get_dnn(), sd);
bool find_pdu = false;
if (find_dnn) {
find_pdu = sd.get()->find_pdu_session(msg.get_pdu_session_id(), sp);
}
if (!find_dnn or !find_pdu) {
// error
Logger::smf_n1().warn("DNN or PDU session context does not exist!");
return false;
}
*/
if (!sc.get()->find_pdu_session(msg.get_pdu_session_id(), sp)) {
// error
......
......@@ -125,7 +125,7 @@ int session_create_sm_context_procedure::run(
PDU_SESSION_APPLICATION_ERROR_CONTEXT_NOT_FOUND);
return RETURNerror;
}
if (sp.get() != nullptr) sp.get()->set_upf_node_id(up_node_id);
sp.get()->set_upf_node_id(up_node_id);
} else {
Logger::smf_app().warn(
......@@ -549,13 +549,9 @@ int session_update_sm_context_procedure::run(
std::shared_ptr<smf_pdu_session> sp = {};
if (!sc.get()->find_pdu_session(scf.get()->pdu_session_id, sp)) {
Logger::smf_app().warn("PDU session context does not exist!");
}
if (sp.get() != nullptr) {
sp.get()->get_upf_node_id(up_node_id);
} else {
Logger::smf_app().warn("PDU session context does not exist!");
return RETURNerror;
}
sp.get()->get_upf_node_id(up_node_id);
// TODO: UPF insertion in case of Handover
......@@ -1421,14 +1417,11 @@ int session_release_sm_context_procedure::run(
std::shared_ptr<smf_pdu_session> sp = {};
if (!sc.get()->find_pdu_session(scf.get()->pdu_session_id, sp)) {
Logger::smf_app().warn("PDU session context does not exist!");
}
if (sp.get() != nullptr) {
sp.get()->get_upf_node_id(up_node_id);
} else {
Logger::smf_app().warn("PDU session context does not exist!");
return RETURNerror;
}
sp.get()->get_upf_node_id(up_node_id);
/* if (not pfcp_associations::get_instance().select_up_node(
up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
sm_context_res->res.set_cause(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment