Commit ca1b91c0 authored by liuyu's avatar liuyu

concourrence is ok

parent c4c3269b
This diff is collapsed.
...@@ -288,7 +288,7 @@ typedef struct qos_profile_s { ...@@ -288,7 +288,7 @@ typedef struct qos_profile_s {
#define NNRF_NF_STATUS_NOTIFY_BASE "/nsmf-nfstatus-notify/" #define NNRF_NF_STATUS_NOTIFY_BASE "/nsmf-nfstatus-notify/"
// for CURL // for CURL
#define NF_CURL_TIMEOUT_MS 100L #define NF_CURL_TIMEOUT_MS 1000L
#define MAX_WAIT_MSECS 10000 // 1 second #define MAX_WAIT_MSECS 10000 // 1 second
#define AMF_NUMBER_RETRIES 3 #define AMF_NUMBER_RETRIES 3
#define UDM_NUMBER_RETRIES 3 #define UDM_NUMBER_RETRIES 3
...@@ -298,7 +298,7 @@ constexpr auto CURL_MIME_BOUNDARY = "----Boundary"; ...@@ -298,7 +298,7 @@ constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
#define BUF_LEN 512 #define BUF_LEN 512
// FOR FUTURE PROMISE // FOR FUTURE PROMISE
#define FUTURE_STATUS_TIMEOUT_MS 100 #define FUTURE_STATUS_TIMEOUT_MS 1000
// for PFCP // for PFCP
constexpr uint64_t SECONDS_SINCE_FIRST_EPOCH = 2208988800; constexpr uint64_t SECONDS_SINCE_FIRST_EPOCH = 2208988800;
......
...@@ -3850,13 +3850,13 @@ bool smf_context::find_pdu_session( ...@@ -3850,13 +3850,13 @@ bool smf_context::find_pdu_session(
const pdu_session_id_t& psi, std::shared_ptr<smf_pdu_session>& sp) const { const pdu_session_id_t& psi, std::shared_ptr<smf_pdu_session>& sp) const {
Logger::smf_app().info("Find PDU Session with ID %d", psi); Logger::smf_app().info("Find PDU Session with ID %d", psi);
std::shared_lock lock(m_pdu_sessions_mutex); std::shared_lock lock(m_pdu_sessions_mutex);
Logger::smf_app().warn("---liuyu----pdu_sessions.count %d------------",pdu_sessions.count(psi));
if (pdu_sessions.count(psi) > 0) { if (pdu_sessions.count(psi) > 0) {
sp = pdu_sessions.at(psi); sp = pdu_sessions.at(psi);
if (sp) return true; if (sp) return true;
} }
return false; return false;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool smf_context::find_pdu_session( bool smf_context::find_pdu_session(
const pfcp::pdr_id_t& pdr_id, pfcp::qfi_t& qfi, const pfcp::pdr_id_t& pdr_id, pfcp::qfi_t& qfi,
...@@ -3893,6 +3893,7 @@ bool smf_context::add_pdu_session( ...@@ -3893,6 +3893,7 @@ bool smf_context::add_pdu_session(
pdu_sessions.insert( pdu_sessions.insert(
std::pair<pdu_session_id_t, std::shared_ptr<smf_pdu_session>>( std::pair<pdu_session_id_t, std::shared_ptr<smf_pdu_session>>(
psi, sp)); psi, sp));
Logger::smf_app().debug( Logger::smf_app().debug(
"PDU Session Id (%d) has been added successfully", psi); "PDU Session Id (%d) has been added successfully", psi);
return true; return true;
...@@ -5009,7 +5010,6 @@ void smf_context::send_pdu_session_create_response( ...@@ -5009,7 +5010,6 @@ void smf_context::send_pdu_session_create_response(
udpsmfcontext["seid"] = sp.get()->seid; udpsmfcontext["seid"] = sp.get()->seid;
udpsmfcontext["ipv4_address"] = inet_ntoa(sp.get()->ipv4_address); udpsmfcontext["ipv4_address"] = inet_ntoa(sp.get()->ipv4_address);
UdpSend_smf(udpsmfcontext,"10.103.239.31", 20023); UdpSend_smf(udpsmfcontext,"10.103.239.31", 20023);
// json_data["smfcontext"] = udpsmfcontext.dump();
resp->res.set_json_data(json_data); resp->res.set_json_data(json_data);
......
...@@ -59,7 +59,6 @@ extern "C" { ...@@ -59,7 +59,6 @@ extern "C" {
} }
using namespace boost::placeholders; using namespace boost::placeholders;
namespace smf { namespace smf {
class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> { class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> {
......
...@@ -166,8 +166,13 @@ int udp_server_coop::udp_read_from_peer_smf() { ...@@ -166,8 +166,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
scf.get()->pdu_session_id = smfcontext["pdu_session_id"]; scf.get()->pdu_session_id = smfcontext["pdu_session_id"];
smf_app_inst->set_scid_2_smf_context(scid, scf); smf_app_inst->set_scid_2_smf_context(scid, scf);
} }
else
{
scf = smf_app_inst->scid_2_smf_context(scid);
}
supi64_t supi64 = smf_supi_to_u64(supi); supi64_t supi64 = smf_supi_to_u64(supi);
uint64_t seid = smfcontext["seid"];
std::shared_ptr<smf_context> sc = {}; std::shared_ptr<smf_context> sc = {};
if (!smf_app_inst->is_supi_2_smf_context(supi64)) { if (!smf_app_inst->is_supi_2_smf_context(supi64)) {
Logger::smf_app().debug("Create a new SMF context with SUPI " SUPI_64_FMT "", supi64); Logger::smf_app().debug("Create a new SMF context with SUPI " SUPI_64_FMT "", supi64);
...@@ -176,9 +181,13 @@ int udp_server_coop::udp_read_from_peer_smf() { ...@@ -176,9 +181,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
// sc.get()->set_supi_prefix(supi_prefix); // sc.get()->set_supi_prefix(supi_prefix);
smf_app_inst->set_supi_2_smf_context(supi64, sc); smf_app_inst->set_supi_2_smf_context(supi64, sc);
// sc.get()->set_plmn(smreq->req.get_plmn()); // PLMN // sc.get()->set_plmn(smreq->req.get_plmn()); // PLMN
}
uint64_t seid = smfcontext["seid"];
smf_app_inst->set_seid_2_smf_context(seid, sc); smf_app_inst->set_seid_2_smf_context(seid, sc);
}
else
{
sc = smf_app_inst->supi_2_smf_context(supi64);
}
std::shared_ptr<smf_pdu_session> sp = {}; std::shared_ptr<smf_pdu_session> sp = {};
...@@ -187,7 +196,7 @@ int udp_server_coop::udp_read_from_peer_smf() { ...@@ -187,7 +196,7 @@ int udp_server_coop::udp_read_from_peer_smf() {
sp = std::shared_ptr<smf_pdu_session>(new smf_pdu_session(scf.get()->pdu_session_id)); sp = std::shared_ptr<smf_pdu_session>(new smf_pdu_session(scf.get()->pdu_session_id));
sp.get()->pdu_session_type.pdu_session_type = smfcontext["pdu_session_type"]; sp.get()->pdu_session_type.pdu_session_type = smfcontext["pdu_session_type"];
sc.get()->add_pdu_session(scf.get()->pdu_session_id, sp); sc.get()->add_pdu_session(scf.get()->pdu_session_id, sp);
}
std::string dnn = smfcontext["dnn"]; std::string dnn = smfcontext["dnn"];
snssai_t snssai = {}; snssai_t snssai = {};
...@@ -260,7 +269,10 @@ int udp_server_coop::udp_read_from_peer_smf() { ...@@ -260,7 +269,10 @@ int udp_server_coop::udp_read_from_peer_smf() {
// Get next UPF for the first N4 session establishment // Get next UPF for the first N4 session establishment
Logger::smf_app().warn("----------liuyu-------dfs_next_upf"); Logger::smf_app().warn("----------liuyu-------dfs_next_upf");
graph->dfs_next_upf(dl_edges, ul_edges, upf); graph->dfs_next_upf(dl_edges, ul_edges, upf);
}
else{
Logger::smf_app().warn("Could not retrieve the corresponding SMF PDU Session context!");
}
} }
} }
return 0; return 0;
......
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