Commit 7dcfb78e authored by liuyu's avatar liuyu

release

parent ca1b91c0
......@@ -37,3 +37,4 @@ src/oai_rules_result*
test_results_oai_smf.html
.vscode
build
*.log
\ No newline at end of file
This diff is collapsed.
......@@ -5009,6 +5009,8 @@ void smf_context::send_pdu_session_create_response(
udpsmfcontext["up_fseid"] = sp.get()->up_fseid.seid;
udpsmfcontext["seid"] = sp.get()->seid;
udpsmfcontext["ipv4_address"] = inet_ntoa(sp.get()->ipv4_address);
udpsmfcontext["direction"]="ground_to_satellite";
UdpSend_smf(udpsmfcontext,"10.103.239.31", 20023);
resp->res.set_json_data(json_data);
......@@ -5075,6 +5077,29 @@ void smf_context::send_pdu_session_update_response(
trigger_ddds(scid, 1);
trigger_pdusesest(scid, 1);
trigger_flexcn_event(scid, 1);
Logger::smf_app().info("---------------liuyu--udpsend",scid);
nlohmann::json udpsmfcontext_to_ground;
udpsmfcontext_to_ground["scid"] = scid;
// udpsmfcontext_to_ground["supi"] = smf_supi_to_string(resp->res.get_supi());
// udpsmfcontext_to_ground["pdu_session_id"] = resp->res.get_pdu_session_id();
// udpsmfcontext_to_ground["dnn"] = resp->res.get_dnn();
// udpsmfcontext_to_ground["snssai"] = resp->res.get_snssai().toString();
// udpsmfcontext_to_ground["pdu_session_type"] = 1;
// supi64_t supi64 = smf_supi_to_u64(resp->res.get_supi());
// std::shared_ptr<smf_context> sc = {};
// sc = smf_app_inst->supi_2_smf_context(supi64);
// std::shared_ptr<smf_pdu_session> sp = {};
// sc.get()->find_pdu_session(resp->res.get_pdu_session_id(), sp);
// udpsmfcontext_to_ground["up_fseid"] = sp.get()->up_fseid.seid;
// udpsmfcontext_to_ground["seid"] = sp.get()->seid;
// udpsmfcontext_to_ground["ipv4_address"] = inet_ntoa(sp.get()->ipv4_address);
udpsmfcontext_to_ground["direction"]="satellite_to_ground";
UdpSend_smf(udpsmfcontext_to_ground,"10.103.239.47", 20023);
} break;
// UE-Triggered Service Request Procedure (Step 1)
......
......@@ -150,8 +150,13 @@ int udp_server_coop::udp_read_from_peer_smf() {
bytes_received = recvfrom(serverSocket, (void *)udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
if(bytes_received > 0){
std::string received_data(reinterpret_cast<char*>(udp_recv), bytes_received);
nlohmann::json smfcontext = nlohmann::json::parse(received_data);
if(smfcontext["direction"]=="ground_to_satellite")
{
printf("smf receive context from ground smf\n");
Logger::smf_app().info("smf receive context from ground smf\n");
std::string received_data(reinterpret_cast<char*>(udp_recv), bytes_received);
nlohmann::json smfcontext = nlohmann::json::parse(received_data);
supi_t supi = {.length = 0};
......@@ -261,19 +266,54 @@ int udp_server_coop::udp_read_from_peer_smf() {
smf_qos_flow current_flow{};
current_flow = flow;
Logger::smf_app().warn("----------liuyu-------start_asynch_dfs_procedure");
// Logger::smf_app().warn("----------liuyu-------start_asynch_dfs_procedure");
graph->start_asynch_dfs_procedure(true, flow);
std::vector<edge> dl_edges;
std::vector<edge> ul_edges;
std::shared_ptr<pfcp_association> upf = {};
// 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);
}
else{
Logger::smf_app().warn("Could not retrieve the corresponding SMF PDU Session context!");
}
}
else{
Logger::smf_app().info("ground smf receive context from satellite smf\n");
scid_t scid = smfcontext["scid"];
std::shared_ptr<smf_context_ref> scf = {};
if (!smf_app_inst->is_scid_2_smf_context(scid)) {
Logger::smf_app().error("Error, cooudp smf_context_ref don't exist" SCID_FMT " does not exit!", scid);
}
else
{
scf = smf_app_inst->scid_2_smf_context(scid);
}
std::shared_ptr<smf_context> sc = {};
// supi_t supi = {.length = 0};
// std::string supiudp = smfcontext["supi"];
// smf_string_to_supi(&supi, supiudp.c_str());
supi64_t supi64 = smf_supi_to_u64(scf.get()->supi);
if (!smf_app_inst->is_supi_2_smf_context(supi64)) {
Logger::smf_app().error("Error, cooudp smf_context don't exist" SUPI_64_FMT "", supi64);
}
else
{
sc = smf_app_inst->supi_2_smf_context(supi64);
}
std::shared_ptr<smf_pdu_session> sps = {};
if (!sc.get()->find_pdu_session(scf.get()->pdu_session_id, sps)) {
Logger::smf_app().error("Error, cooudp PDU session don't exist");
}
sps->set_pdu_session_status(pdu_session_status_e::PDU_SESSION_ACTIVE);
sps->set_upCnx_state(upCnx_state_e::UPCNX_STATE_ACTIVATED);
}
}
}
return 0;
}
......@@ -302,15 +342,15 @@ int udp_server_coop::udp_read_from_socket_to_center() {
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
if(bytes_received > 0){
printf("smf receive udp success from satellite amf\n");
gettimeofday(&time, NULL);
// printf("smf receive udp success from satellite amf\n");
// gettimeofday(&time, NULL);
// std::cout<<"receive from plugin, ms: "<<(time.tv_sec*1000 + time.tv_usec/1000)<<std::endl;
// cout<<"bytes"<<bytes_received<<endl;
// cout<<"content:"<<udp_recv<<endl;
// string udp_recv_str(&udp_recv[0],&udp_recv[strlen(udp_recv)]);
// cout<<"content:"<<udp_recv_str<<endl;
// handle_receive_udp(bytes_received,udp_recv);
printf("smf send udp to center amf\n");
// printf("smf send udp to center amf\n");
UdpSend(udp_recv,bytes_received,"10.103.239.47",20003);
// assoc_id++;
......@@ -344,15 +384,15 @@ int udp_server_coop::udp_read_from_socket_from_center() {
//bytes_received = recvfrom(serverSocket, udp_recv, UDP_RECV_BUFFER_SIZE , 0, (struct sockaddr*)&r_endpoint.addr_storage, &r_endpoint.addr_storage_len);
if(bytes_received > 0){
printf("smf receive udp success from center amf\n");
gettimeofday(&time, NULL);
// printf("smf receive udp success from center amf\n");
// gettimeofday(&time, NULL);
// std::cout<<"receive from plugin, ms: "<<(time.tv_sec*1000 + time.tv_usec/1000)<<std::endl;
// cout<<"bytes"<<bytes_received<<endl;
// cout<<"content:"<<udp_recv<<endl;
// string udp_recv_str(&udp_recv[0],&udp_recv[strlen(udp_recv)]);
// cout<<"content:"<<udp_recv_str<<endl;
// handle_receive_udp(bytes_received,udp_recv);
printf("smf send udp to satellite amf\n");
// printf("smf send udp to satellite amf\n");
UdpSend(udp_recv,bytes_received,"10.103.239.31",20002);
// assoc_id++;
......
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