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 { ...@@ -200,7 +200,6 @@ class smf_app {
void operator=(smf_app const&) = delete; void operator=(smf_app const&) = delete;
void test_dns();
/* /*
* Set the association between Seid and SM Context * Set the association between Seid and SM Context
* @param [const seid_t &] seid: SessionID * @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> { ...@@ -597,11 +597,11 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
amf_status_uri = {}; amf_status_uri = {};
target_amf = {}; target_amf = {};
supi_prefix = {}; supi_prefix = {};
// Subscribe to sm context status change // Subscribe to SM Context Status Change
sm_context_status_connection = sm_context_status_connection =
event_sub.subscribe_sm_context_status(boost::bind( event_sub.subscribe_sm_context_status(boost::bind(
&smf_context::handle_sm_context_status_change, this, _1, _2, _3)); &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 = ee_pdu_session_release_connection =
event_sub.subscribe_ee_pdu_session_release(boost::bind( event_sub.subscribe_ee_pdu_session_release(boost::bind(
&smf_context::handle_ee_pdu_session_release, this, _1, _2, _3)); &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> { ...@@ -1019,13 +1019,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
*/ */
supi_t get_supi() const; 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 * Get Supi prefix
* @param [const std::string &] prefix: Supi prefix (e.g., imsi) * @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> { ...@@ -1251,12 +1244,10 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
const pdu_session_id_t& pdu_session_id) const; const pdu_session_id_t& pdu_session_id) const;
private: private:
// std::vector<std::shared_ptr<dnn_context>> dnns;
std::vector<std::shared_ptr<smf_procedure>> pending_procedures; std::vector<std::shared_ptr<smf_procedure>> pending_procedures;
// snssai-sst <-> session management subscription // snssai-sst <-> session management subscription
std::map<uint8_t, std::shared_ptr<session_management_subscription>> std::map<uint8_t, std::shared_ptr<session_management_subscription>>
dnn_subscriptions; dnn_subscriptions;
std::map<pdu_session_id_t, std::shared_ptr<smf_pdu_session>> std::map<pdu_session_id_t, std::shared_ptr<smf_pdu_session>>
pdu_sessions; // Store all PDU Sessions associated with this UE pdu_sessions; // Store all PDU Sessions associated with this UE
mutable std::shared_mutex m_pdu_sessions_mutex; mutable std::shared_mutex m_pdu_sessions_mutex;
...@@ -1265,9 +1256,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> { ...@@ -1265,9 +1256,6 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
std::string supi_prefix; std::string supi_prefix;
plmn_t plmn; plmn_t plmn;
// AMF IP addr
// string amf_addr;
std::string amf_id; std::string amf_id;
std::string amf_addr; std::string amf_addr;
std::string amf_status_uri; std::string amf_status_uri;
......
...@@ -415,8 +415,7 @@ bool smf_n1::create_n1_pdu_session_modification_command( ...@@ -415,8 +415,7 @@ bool smf_n1::create_n1_pdu_session_modification_command(
Logger::smf_n1().info("PDU_SESSION_MODIFICATION_COMMAND, encode starting..."); Logger::smf_n1().info("PDU_SESSION_MODIFICATION_COMMAND, encode starting...");
// Get the SMF_PDU_Session // Get the SMF_PDU_Session
std::shared_ptr<smf_context> sc = {}; std::shared_ptr<smf_context> sc = {};
// std::shared_ptr<dnn_context> sd = {};
std::shared_ptr<smf_pdu_session> sp = {}; std::shared_ptr<smf_pdu_session> sp = {};
supi_t supi = sm_context_res.get_supi(); supi_t supi = sm_context_res.get_supi();
supi64_t supi64 = smf_supi_to_u64(supi); supi64_t supi64 = smf_supi_to_u64(supi);
...@@ -429,20 +428,6 @@ bool smf_n1::create_n1_pdu_session_modification_command( ...@@ -429,20 +428,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
"SMF context with SUPI " SUPI_64_FMT " does not exist!", supi64); "SMF context with SUPI " SUPI_64_FMT " does not exist!", supi64);
return false; 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)) { if (!sc.get()->find_pdu_session(sm_context_res.get_pdu_session_id(), sp)) {
// error // error
...@@ -573,8 +558,7 @@ bool smf_n1::create_n1_pdu_session_modification_command( ...@@ -573,8 +558,7 @@ bool smf_n1::create_n1_pdu_session_modification_command(
Logger::smf_n1().info("PDU_SESSION_MODIFICATION_COMMAND, encode starting..."); Logger::smf_n1().info("PDU_SESSION_MODIFICATION_COMMAND, encode starting...");
// Get the SMF_PDU_Session // Get the SMF_PDU_Session
std::shared_ptr<smf_context> sc = {}; std::shared_ptr<smf_context> sc = {};
// std::shared_ptr<dnn_context> sd = {};
std::shared_ptr<smf_pdu_session> sp = {}; std::shared_ptr<smf_pdu_session> sp = {};
supi_t supi = msg.get_supi(); supi_t supi = msg.get_supi();
supi64_t supi64 = smf_supi_to_u64(supi); supi64_t supi64 = smf_supi_to_u64(supi);
...@@ -587,19 +571,6 @@ bool smf_n1::create_n1_pdu_session_modification_command( ...@@ -587,19 +571,6 @@ bool smf_n1::create_n1_pdu_session_modification_command(
"SMF context with SUPI " SUPI_64_FMT " does not exist!", supi64); "SMF context with SUPI " SUPI_64_FMT " does not exist!", supi64);
return false; 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)) { if (!sc.get()->find_pdu_session(msg.get_pdu_session_id(), sp)) {
// error // error
......
...@@ -125,7 +125,7 @@ int session_create_sm_context_procedure::run( ...@@ -125,7 +125,7 @@ int session_create_sm_context_procedure::run(
PDU_SESSION_APPLICATION_ERROR_CONTEXT_NOT_FOUND); PDU_SESSION_APPLICATION_ERROR_CONTEXT_NOT_FOUND);
return RETURNerror; 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 { } else {
Logger::smf_app().warn( Logger::smf_app().warn(
...@@ -549,13 +549,9 @@ int session_update_sm_context_procedure::run( ...@@ -549,13 +549,9 @@ int session_update_sm_context_procedure::run(
std::shared_ptr<smf_pdu_session> sp = {}; std::shared_ptr<smf_pdu_session> sp = {};
if (!sc.get()->find_pdu_session(scf.get()->pdu_session_id, sp)) { if (!sc.get()->find_pdu_session(scf.get()->pdu_session_id, sp)) {
Logger::smf_app().warn("PDU session context does not exist!"); 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; return RETURNerror;
} }
sp.get()->get_upf_node_id(up_node_id);
// TODO: UPF insertion in case of Handover // TODO: UPF insertion in case of Handover
...@@ -1421,14 +1417,11 @@ int session_release_sm_context_procedure::run( ...@@ -1421,14 +1417,11 @@ int session_release_sm_context_procedure::run(
std::shared_ptr<smf_pdu_session> sp = {}; std::shared_ptr<smf_pdu_session> sp = {};
if (!sc.get()->find_pdu_session(scf.get()->pdu_session_id, sp)) { if (!sc.get()->find_pdu_session(scf.get()->pdu_session_id, sp)) {
Logger::smf_app().warn("PDU session context does not exist!"); 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; return RETURNerror;
} }
sp.get()->get_upf_node_id(up_node_id);
/* if (not pfcp_associations::get_instance().select_up_node( /* if (not pfcp_associations::get_instance().select_up_node(
up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) { up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
sm_context_res->res.set_cause( 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