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 {
#define NNRF_NF_STATUS_NOTIFY_BASE "/nsmf-nfstatus-notify/"
// for CURL
#define NF_CURL_TIMEOUT_MS 100L
#define NF_CURL_TIMEOUT_MS 1000L
#define MAX_WAIT_MSECS 10000 // 1 second
#define AMF_NUMBER_RETRIES 3
#define UDM_NUMBER_RETRIES 3
......@@ -298,7 +298,7 @@ constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
#define BUF_LEN 512
// FOR FUTURE PROMISE
#define FUTURE_STATUS_TIMEOUT_MS 100
#define FUTURE_STATUS_TIMEOUT_MS 1000
// for PFCP
constexpr uint64_t SECONDS_SINCE_FIRST_EPOCH = 2208988800;
......
......@@ -3850,13 +3850,13 @@ bool smf_context::find_pdu_session(
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);
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) {
sp = pdu_sessions.at(psi);
if (sp) return true;
}
return false;
}
//-----------------------------------------------------------------------------
bool smf_context::find_pdu_session(
const pfcp::pdr_id_t& pdr_id, pfcp::qfi_t& qfi,
......@@ -3893,6 +3893,7 @@ bool smf_context::add_pdu_session(
pdu_sessions.insert(
std::pair<pdu_session_id_t, std::shared_ptr<smf_pdu_session>>(
psi, sp));
Logger::smf_app().debug(
"PDU Session Id (%d) has been added successfully", psi);
return true;
......@@ -5009,7 +5010,6 @@ void smf_context::send_pdu_session_create_response(
udpsmfcontext["seid"] = sp.get()->seid;
udpsmfcontext["ipv4_address"] = inet_ntoa(sp.get()->ipv4_address);
UdpSend_smf(udpsmfcontext,"10.103.239.31", 20023);
// json_data["smfcontext"] = udpsmfcontext.dump();
resp->res.set_json_data(json_data);
......
......@@ -59,7 +59,6 @@ extern "C" {
}
using namespace boost::placeholders;
namespace smf {
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() {
scf.get()->pdu_session_id = smfcontext["pdu_session_id"];
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);
uint64_t seid = smfcontext["seid"];
std::shared_ptr<smf_context> sc = {};
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);
......@@ -176,10 +181,14 @@ int udp_server_coop::udp_read_from_peer_smf() {
// sc.get()->set_supi_prefix(supi_prefix);
smf_app_inst->set_supi_2_smf_context(supi64, sc);
// sc.get()->set_plmn(smreq->req.get_plmn()); // PLMN
smf_app_inst->set_seid_2_smf_context(seid, sc);
}
uint64_t seid = smfcontext["seid"];
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 = {};
if (!sc.get()->find_pdu_session(scf.get()->pdu_session_id, sp)) {
......@@ -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.get()->pdu_session_type.pdu_session_type = smfcontext["pdu_session_type"];
sc.get()->add_pdu_session(scf.get()->pdu_session_id, sp);
}
std::string dnn = smfcontext["dnn"];
snssai_t snssai = {};
......@@ -260,7 +269,10 @@ int udp_server_coop::udp_read_from_peer_smf() {
// Get next UPF for the first N4 session establishment
Logger::smf_app().warn("----------liuyu-------dfs_next_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;
......
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