Commit 0b8ca423 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen
Browse files

update file/function names

parent c37fd673
# prompt has been removed for easier Ctrl+C Ctrl+V
sudo ifconfig eno1:sxc 172.55.55.101 up # SPGW-C SXab interface
sudo ifconfig eno1:sxc 172.55.55.101 up # SMF N4 interface
sudo ifconfig eno1:s5c 172.58.58.102 up # SGW-C S5S8 interface
sudo ifconfig eno1:p5c 172.58.58.101 up # PGW-C S5S8 interface
sudo ifconfig eno1:s11 172.16.1.104 up # SGW-C S11 interface
......
......@@ -20,31 +20,31 @@
*/
/*
* itti_msg_sx_restore.hpp
* itti_msg_n4_restore.hpp
*
* Created on: March 27, 2019
* Author: lionel.gauthier@eurecom.fr
*/
#ifndef ITTI_MSG_SX_RESTORE_HPP_INCLUDED_
#define ITTI_MSG_SX_RESTORE_HPP_INCLUDED_
#ifndef ITTI_MSG_N4_RESTORE_HPP_INCLUDED_
#define ITTI_MSG_N4_RESTORE_HPP_INCLUDED_
#include "3gpp_29.244.h"
#include "itti_msg.hpp"
#include <set>
class itti_sx_restore : public itti_msg {
class itti_n4_restore : public itti_msg {
public:
itti_sx_restore(const task_id_t origin, const task_id_t destination):
itti_n4_restore(const task_id_t origin, const task_id_t destination):
itti_msg(RESTORE_SX_SESSIONS, origin, destination), sessions() {}
itti_sx_restore(const itti_sx_restore& i) : itti_msg(i), sessions(i.sessions) {}
itti_sx_restore(const itti_sx_restore& i, const task_id_t orig, const task_id_t dest) : itti_sx_restore(i) {
itti_n4_restore(const itti_n4_restore& i) : itti_msg(i), sessions(i.sessions) {}
itti_n4_restore(const itti_n4_restore& i, const task_id_t orig, const task_id_t dest) : itti_n4_restore(i) {
origin = orig;
destination = dest;
}
const char* get_msg_name() {return "SX_RESTORE";};
const char* get_msg_name() {return "N4_RESTORE";};
std::set<pfcp::fseid_t> sessions;
};
#endif /* ITTI_MSG_SX_RESTORE_HPP_INCLUDED_ */
#endif /* ITTI_MSG_N4_RESTORE_HPP_INCLUDED_ */
......@@ -39,7 +39,7 @@ typedef enum {
TASK_GTPV2_C,
TASK_MME_S11,
TASK_PGWC_APP,
TASK_PGWC_SX,
TASK_SMF_N4,
TASK_PGW_UDP,
TASK_SPGWU_SX,
TASK_SMF_N10,
......@@ -86,29 +86,29 @@ typedef enum {
S1U_SUPPORTED_EXTENSION_HEADERS_NOTIFICATION,
S1U_END_MARKER,
S1U_G_PDU, // UNUSED
SXAB_HEARTBEAT_REQUEST,
SXAB_HEARTBEAT_RESPONSE,
SXAB_PFCP_PFD_MANAGEMENT_REQUEST,
SXAB_PFCP_PFD_MANAGEMENT_RESPONSE,
SXAB_ASSOCIATION_SETUP_REQUEST,
SXAB_ASSOCIATION_SETUP_RESPONSE,
SXAB_ASSOCIATION_UPDATE_REQUEST,
SXAB_ASSOCIATION_UPDATE_RESPONSE,
SXAB_ASSOCIATION_RELEASE_REQUEST,
SXAB_ASSOCIATION_RELEASE_RESPONSE,
SXAB_VERSION_NOT_SUPPORTED_RESPONSE,
SXAB_NODE_REPORT_REQUEST,
SXAB_NODE_REPORT_RESPONSE,
SXAB_SESSION_SET_DELETION_REQUEST,
SXAB_SESSION_SET_DELETION_RESPONSE,
SXAB_SESSION_ESTABLISHMENT_REQUEST,
SXAB_SESSION_ESTABLISHMENT_RESPONSE,
SXAB_SESSION_MODIFICATION_REQUEST,
SXAB_SESSION_MODIFICATION_RESPONSE,
SXAB_SESSION_DELETION_REQUEST,
SXAB_SESSION_DELETION_RESPONSE,
SXAB_SESSION_REPORT_REQUEST,
SXAB_SESSION_REPORT_RESPONSE,
N4_HEARTBEAT_REQUEST,
N4_HEARTBEAT_RESPONSE,
N4_PFCP_PFD_MANAGEMENT_REQUEST,
N4_PFCP_PFD_MANAGEMENT_RESPONSE,
N4_ASSOCIATION_SETUP_REQUEST,
N4_ASSOCIATION_SETUP_RESPONSE,
N4_ASSOCIATION_UPDATE_REQUEST,
N4_ASSOCIATION_UPDATE_RESPONSE,
N4_ASSOCIATION_RELEASE_REQUEST,
N4_ASSOCIATION_RELEASE_RESPONSE,
N4_VERSION_NOT_SUPPORTED_RESPONSE,
N4_NODE_REPORT_REQUEST,
N4_NODE_REPORT_RESPONSE,
N4_SESSION_SET_DELETION_REQUEST,
N4_SESSION_SET_DELETION_RESPONSE,
N4_SESSION_ESTABLISHMENT_REQUEST,
N4_SESSION_ESTABLISHMENT_RESPONSE,
N4_SESSION_MODIFICATION_REQUEST,
N4_SESSION_MODIFICATION_RESPONSE,
N4_SESSION_DELETION_REQUEST,
N4_SESSION_DELETION_RESPONSE,
N4_SESSION_REPORT_REQUEST,
N4_SESSION_REPORT_RESPONSE,
N10_GET_SESSION_MANAGEMENT_SUBSCRIPTION,
N11_SESSION_CREATE_SM_CONTEXT_REQUEST,
N11_SESSION_CREATE_SM_CONTEXT_RESPONSE,
......
......@@ -116,7 +116,7 @@ enum pdu_session_message_e {
#define PDU_SESSION_RELEASE_COMMAND 0b11010011
#define PDU_SESSION_RELEASE_COMPLETE 0b11010100
#define _5GSM_STAUS 0b11010110
#define _5GSM_STATUS 0b11010110
......
......@@ -21,7 +21,7 @@
#include "options.hpp"
#include "pid_file.hpp"
#include "pgw_app.hpp"
#include "pgw_config.hpp"
#include "smf_config.hpp"
#include "smf-api-server.h"
#include "pistache/endpoint.h"
#include "pistache/http.h"
......@@ -44,7 +44,7 @@ using namespace oai::smf::api;
itti_mw *itti_inst = nullptr;
async_shell_cmd *async_shell_cmd_inst = nullptr;
pgw_app *pgw_app_inst = nullptr;
pgw_config pgw_cfg;
smf_config smf_cfg;
void send_heartbeat_to_tasks(const uint32_t sequence);
......@@ -100,22 +100,22 @@ int main(int argc, char **argv)
sigaction(SIGINT, &sigIntHandler, NULL);
// Config
pgw_cfg.load(Options::getlibconfigConfig());
pgw_cfg.display();
smf_cfg.load(Options::getlibconfigConfig());
smf_cfg.display();
// Inter task Interface
itti_inst = new itti_mw();
itti_inst->start(pgw_cfg.itti.itti_timer_sched_params);
itti_inst->start(smf_cfg.itti.itti_timer_sched_params);
// system command
async_shell_cmd_inst = new async_shell_cmd(pgw_cfg.itti.async_cmd_sched_params);
async_shell_cmd_inst = new async_shell_cmd(smf_cfg.itti.async_cmd_sched_params);
// PGW application layer
pgw_app_inst = new pgw_app(Options::getlibconfigConfig());
// PID file
// Currently hard-coded value. TODO: add as config option.
string pid_file_name = get_exe_absolute_path("/var/run", pgw_cfg.instance);
string pid_file_name = get_exe_absolute_path("/var/run", smf_cfg.instance);
if (! is_pid_file_lock_success(pid_file_name.c_str())) {
Logger::pgwc_app().error( "Lock PID file %s failed\n", pid_file_name.c_str());
exit (-EDEADLK);
......
......@@ -31,12 +31,12 @@ include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
add_library (PGWC STATIC
pgw_app.cpp
pgw_config.cpp
smf_config.cpp
pgw_context.cpp
pgw_pfcp_association.cpp
pgw_pco.cpp
pgwc_procedure.cpp
pgwc_sxab.cpp
smf_pfcp_association.cpp
smf_pco.cpp
smf_procedure.cpp
smf_n4.cpp
smf_n10.cpp
smf_n11.cpp
smf_msg.cpp
......
......@@ -31,8 +31,8 @@
#include "conversions.hpp"
#include "itti.hpp"
#include "logger.hpp"
#include "pgw_paa_dynamic.hpp"
#include "pgwc_sxab.hpp"
#include "smf_paa_dynamic.hpp"
#include "smf_n4.hpp"
#include "smf_n10.hpp"
#include "smf_n11.hpp"
#include "string.hpp"
......@@ -51,8 +51,8 @@ using namespace pgwc;
#define SYSTEM_CMD_MAX_STR_SIZE 512
extern util::async_shell_cmd *async_shell_cmd_inst;
extern pgw_app *pgw_app_inst;
extern pgw_config pgw_cfg;
pgwc_sxab *pgwc_sxab_inst = nullptr;
extern smf_config smf_cfg;
smf_n4 *smf_n4_inst = nullptr;
smf_n10 *smf_n10_inst = nullptr;
smf_n11 *smf_n11_inst = nullptr;
extern itti_mw *itti_inst;
......@@ -60,7 +60,7 @@ extern itti_mw *itti_inst;
void pgw_app_task (void*);
//------------------------------------------------------------------------------
int pgw_app::apply_config (const pgw_config& cfg)
int pgw_app::apply_config (const smf_config& cfg)
{
Logger::pgwc_app().info("Apply config...");
......@@ -216,26 +216,26 @@ void pgw_app_task (void*)
auto *msg = shared_msg.get();
switch (msg->msg_type) {
case SXAB_SESSION_ESTABLISHMENT_RESPONSE:
if (itti_sxab_session_establishment_response* m = dynamic_cast<itti_sxab_session_establishment_response*>(msg)) {
case N4_SESSION_ESTABLISHMENT_RESPONSE:
if (itti_n4_session_establishment_response* m = dynamic_cast<itti_n4_session_establishment_response*>(msg)) {
pgw_app_inst->handle_itti_msg(std::ref(*m));
}
break;
case SXAB_SESSION_MODIFICATION_RESPONSE:
if (itti_sxab_session_modification_response* m = dynamic_cast<itti_sxab_session_modification_response*>(msg)) {
case N4_SESSION_MODIFICATION_RESPONSE:
if (itti_n4_session_modification_response* m = dynamic_cast<itti_n4_session_modification_response*>(msg)) {
pgw_app_inst->handle_itti_msg(std::ref(*m));
}
break;
case SXAB_SESSION_DELETION_RESPONSE:
if (itti_sxab_session_deletion_response* m = dynamic_cast<itti_sxab_session_deletion_response*>(msg)) {
case N4_SESSION_DELETION_RESPONSE:
if (itti_n4_session_deletion_response* m = dynamic_cast<itti_n4_session_deletion_response*>(msg)) {
pgw_app_inst->handle_itti_msg(std::ref(*m));
}
break;
case SXAB_SESSION_REPORT_REQUEST:
pgw_app_inst->handle_itti_msg(std::static_pointer_cast<itti_sxab_session_report_request>(shared_msg));
case N4_SESSION_REPORT_REQUEST:
pgw_app_inst->handle_itti_msg(std::static_pointer_cast<itti_n4_session_report_request>(shared_msg));
break;
case TIME_OUT:
......@@ -266,7 +266,7 @@ pgw_app::pgw_app (const std::string& config_file) : m_s5s8_cp_teid_generator(),
s5s8lteid2pgw_context = {};
s5s8cplteid = {};
apply_config (pgw_cfg);
apply_config (smf_cfg);
if (itti_inst->create_task(TASK_PGWC_APP, pgw_app_task, nullptr) ) {
Logger::pgwc_app().error( "Cannot create task TASK_PGWC_APP" );
......@@ -274,7 +274,7 @@ pgw_app::pgw_app (const std::string& config_file) : m_s5s8_cp_teid_generator(),
}
try {
pgwc_sxab_inst = new pgwc_sxab();
smf_n4_inst = new smf_n4();
smf_n10_inst = new smf_n10();
smf_n11_inst = new smf_n11();
} catch (std::exception& e) {
......@@ -287,27 +287,27 @@ pgw_app::pgw_app (const std::string& config_file) : m_s5s8_cp_teid_generator(),
//------------------------------------------------------------------------------
void pgw_app::handle_itti_msg (itti_sxab_session_establishment_response& seresp)
void pgw_app::handle_itti_msg (itti_n4_session_establishment_response& seresp)
{
std::shared_ptr<pgw_context> pc = {};
if (seid_2_pgw_context(seresp.seid, pc)) {
pc.get()->handle_itti_msg(seresp);
} else {
Logger::pgwc_app().debug("Received SXAB SESSION ESTABLISHMENT RESPONSE seid" TEID_FMT " pfcp_tx_id %" PRIX64", pgw_context not found, discarded!", seresp.seid, seresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION ESTABLISHMENT RESPONSE seid" TEID_FMT " pfcp_tx_id %" PRIX64", pgw_context not found, discarded!", seresp.seid, seresp.trxn_id);
}
}
//------------------------------------------------------------------------------
void pgw_app::handle_itti_msg (itti_sxab_session_modification_response& smresp)
void pgw_app::handle_itti_msg (itti_n4_session_modification_response& smresp)
{
std::shared_ptr<pgw_context> pc = {};
if (seid_2_pgw_context(smresp.seid, pc)) {
pc.get()->handle_itti_msg(smresp);
} else {
Logger::pgwc_app().debug("Received SXAB SESSION MODIFICATION RESPONSE seid" TEID_FMT " pfcp_tx_id %" PRIX64", pgw_context not found, discarded!", smresp.seid, smresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION MODIFICATION RESPONSE seid" TEID_FMT " pfcp_tx_id %" PRIX64", pgw_context not found, discarded!", smresp.seid, smresp.trxn_id);
}
}
//------------------------------------------------------------------------------
void pgw_app::handle_itti_msg (itti_sxab_session_deletion_response& smresp)
void pgw_app::handle_itti_msg (itti_n4_session_deletion_response& smresp)
{
std::shared_ptr<pgw_context> pc = {};
if (seid_2_pgw_context(smresp.seid, pc)) {
......@@ -317,18 +317,18 @@ void pgw_app::handle_itti_msg (itti_sxab_session_deletion_response& smresp)
delete_pgw_context(pc);
}
} else {
Logger::pgwc_app().debug("Received SXAB SESSION DELETION RESPONSE seid" TEID_FMT " pfcp_tx_id %" PRIX64", pgw_context not found, discarded!", smresp.seid, smresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION DELETION RESPONSE seid" TEID_FMT " pfcp_tx_id %" PRIX64", pgw_context not found, discarded!", smresp.seid, smresp.trxn_id);
}
}
//------------------------------------------------------------------------------
void pgw_app::handle_itti_msg (std::shared_ptr<itti_sxab_session_report_request> snr)
void pgw_app::handle_itti_msg (std::shared_ptr<itti_n4_session_report_request> snr)
{
std::shared_ptr<pgw_context> pc = {};
if (seid_2_pgw_context(snr->seid, pc)) {
pc.get()->handle_itti_msg(snr);
} else {
Logger::pgwc_app().debug("Received SXAB SESSION REPORT REQUEST seid" TEID_FMT " pfcp_tx_id %" PRIX64", pgw_context not found, discarded!", snr->seid, snr->trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION REPORT REQUEST seid" TEID_FMT " pfcp_tx_id %" PRIX64", pgw_context not found, discarded!", snr->seid, snr->trxn_id);
}
}
......@@ -396,7 +396,7 @@ void pgw_app::handle_amf_msg (std::shared_ptr<itti_n11_create_sm_context_request
//Step 2. check if the DNN requested is valid
if (not pgw_cfg.is_dotted_dnn_handled(dnn, pdu_session_type)) {
if (not smf_cfg.is_dotted_dnn_handled(dnn, pdu_session_type)) {
// Not a valid request...
Logger::pgwc_app().warn("Received PDU_SESSION_CREATESMCONTEXT_REQUEST unknown requested APN %s, ignore message!", dnn.c_str());
problem_details.setCause(pdu_session_application_error_e2str[PDU_SESSION_APPLICATION_ERROR_DNN_DENIED]);
......
......@@ -30,10 +30,10 @@
#include "smf.h"
#include "3gpp_29.274.h"
#include "itti_msg_sxab.hpp"
#include "itti_msg_n4.hpp"
#include "itti_msg_n11.hpp"
#include "pgw_context.hpp"
#include "pgw_pco.hpp"
#include "smf_pco.hpp"
#include "SmContextCreateData.h"
#include "SmContextCreateError.h"
#include "pistache/endpoint.h"
......@@ -50,7 +50,7 @@
namespace pgwc {
//typedef std::pair<shared_ptr<pgw_context>,shared_ptr<pgw_pdn_connection>> zzz;
class pgw_config; // same namespace
class smf_config; // same namespace
class pgw_app {
private:
......@@ -76,7 +76,7 @@ private:
mutable std::shared_mutex m_supi2smf_context;
int apply_config(const pgw_config& cfg);
int apply_config(const smf_config& cfg);
teid_t generate_s5s8_cp_teid();
void free_s5s8c_teid(const teid_t& teid_s5s8_cp);
......@@ -125,11 +125,11 @@ public:
protocol_configuration_options_t& pco_resp,
protocol_configuration_options_ids_t & pco_ids);
void handle_itti_msg (itti_sxab_session_establishment_response& m);
void handle_itti_msg (itti_sxab_session_modification_response& m);
void handle_itti_msg (itti_sxab_session_deletion_response& m);
void handle_itti_msg (std::shared_ptr<itti_sxab_session_report_request> snr);
void handle_itti_msg (itti_sxab_association_setup_request& m);
void handle_itti_msg (itti_n4_session_establishment_response& m);
void handle_itti_msg (itti_n4_session_modification_response& m);
void handle_itti_msg (itti_n4_session_deletion_response& m);
void handle_itti_msg (std::shared_ptr<itti_n4_session_report_request> snr);
void handle_itti_msg (itti_n4_association_setup_request& m);
void restore_sx_sessions(const seid_t& seid) const;
......@@ -194,6 +194,6 @@ public:
};
}
#include "pgw_config.hpp"
#include "smf_config.hpp"
#endif /* FILE_PGW_APP_HPP_SEEN */
......@@ -29,10 +29,10 @@
#include "itti.hpp"
#include "logger.hpp"
#include "pgw_app.hpp"
#include "pgw_config.hpp"
#include "smf_config.hpp"
#include "pgw_context.hpp"
#include "pgw_paa_dynamic.hpp"
#include "pgwc_procedure.hpp"
#include "smf_paa_dynamic.hpp"
#include "smf_procedure.hpp"
#include "ProblemDetails.h"
#include "3gpp_29.502.h"
#include "3gpp_24.501.h"
......@@ -43,7 +43,7 @@ using namespace pgwc;
extern itti_mw *itti_inst;
extern pgwc::pgw_app *pgw_app_inst;
extern pgwc::pgw_config pgw_cfg;
extern pgwc::smf_config smf_cfg;
//------------------------------------------------------------------------------
void pgw_eps_bearer::release_access_bearer()
......@@ -179,7 +179,7 @@ void pgw_pdn_connection::deallocate_ressources(const std::string& apn)
void pgw_pdn_connection::generate_seid()
{
// DO it simple now:
seid = pgw_fteid_s5_s8_cp.teid_gre_key | (((uint64_t)pgw_cfg.instance) << 32);
seid = pgw_fteid_s5_s8_cp.teid_gre_key | (((uint64_t)smf_cfg.instance) << 32);
}
//------------------------------------------------------------------------------
// TODO check if prd_id should be uniq in the (S)PGW-U or in the context of a pdn connection
......@@ -402,17 +402,17 @@ bool pgw_context::find_apn_context(const std::string& apn, std::shared_ptr<apn_c
return false;
}
//------------------------------------------------------------------------------
void pgw_context::insert_procedure(std::shared_ptr<pgw_procedure>& sproc)
void pgw_context::insert_procedure(std::shared_ptr<smf_procedure>& sproc)
{
std::unique_lock<std::recursive_mutex> lock(m_context);
pending_procedures.push_back(sproc);
}
//------------------------------------------------------------------------------
bool pgw_context::find_procedure(const uint64_t& trxn_id, std::shared_ptr<pgw_procedure>& proc)
bool pgw_context::find_procedure(const uint64_t& trxn_id, std::shared_ptr<smf_procedure>& proc)
{
std::unique_lock<std::recursive_mutex> lock(m_context);
auto found = std::find_if(pending_procedures.begin(), pending_procedures.end(),
[trxn_id](std::shared_ptr<pgw_procedure> const& i) -> bool { return i->trxn_id == trxn_id;});
[trxn_id](std::shared_ptr<smf_procedure> const& i) -> bool { return i->trxn_id == trxn_id;});
if (found != pending_procedures.end()) {
proc = *found;
return true;
......@@ -420,10 +420,10 @@ bool pgw_context::find_procedure(const uint64_t& trxn_id, std::shared_ptr<pgw_pr
return false;
}
//------------------------------------------------------------------------------
void pgw_context::remove_procedure(pgw_procedure* proc)
void pgw_context::remove_procedure(smf_procedure* proc)
{
std::unique_lock<std::recursive_mutex> lock(m_context);
auto found = std::find_if(pending_procedures.begin(), pending_procedures.end(), [proc](std::shared_ptr<pgw_procedure> const& i) {
auto found = std::find_if(pending_procedures.begin(), pending_procedures.end(), [proc](std::shared_ptr<smf_procedure> const& i) {
return i.get() == proc;
});
if (found != pending_procedures.end()) {
......@@ -433,45 +433,45 @@ void pgw_context::remove_procedure(pgw_procedure* proc)
//------------------------------------------------------------------------------
void pgw_context::handle_itti_msg (itti_sxab_session_establishment_response& seresp)
void pgw_context::handle_itti_msg (itti_n4_session_establishment_response& seresp)
{
std::shared_ptr<pgw_procedure> proc = {};
std::shared_ptr<smf_procedure> proc = {};
if (find_procedure(seresp.trxn_id, proc)) {
Logger::pgwc_app().debug("Received SXAB SESSION ESTABLISHMENT RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64"\n", seresp.seid, seresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION ESTABLISHMENT RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64"\n", seresp.seid, seresp.trxn_id);
proc->handle_itti_msg(seresp);
remove_procedure(proc.get());
} else {
Logger::pgwc_app().debug("Received SXAB SESSION ESTABLISHMENT RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64", pgw_procedure not found, discarded!", seresp.seid, seresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION ESTABLISHMENT RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64", smf_procedure not found, discarded!", seresp.seid, seresp.trxn_id);
}
}
//------------------------------------------------------------------------------
void pgw_context::handle_itti_msg (itti_sxab_session_modification_response& smresp)
void pgw_context::handle_itti_msg (itti_n4_session_modification_response& smresp)
{
std::shared_ptr<pgw_procedure> proc = {};
std::shared_ptr<smf_procedure> proc = {};
if (find_procedure(smresp.trxn_id, proc)) {
Logger::pgwc_app().debug("Received SXAB SESSION MODIFICATION RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64"\n", smresp.seid, smresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION MODIFICATION RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64"\n", smresp.seid, smresp.trxn_id);
proc->handle_itti_msg(smresp);
remove_procedure(proc.get());
} else {
Logger::pgwc_app().debug("Received SXAB SESSION MODIFICATION RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64", pgw_procedure not found, discarded!", smresp.seid, smresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION MODIFICATION RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64", smf_procedure not found, discarded!", smresp.seid, smresp.trxn_id);
}
std::cout << toString() << std::endl;
}
//------------------------------------------------------------------------------
void pgw_context::handle_itti_msg (itti_sxab_session_deletion_response& sdresp)
void pgw_context::handle_itti_msg (itti_n4_session_deletion_response& sdresp)
{
std::shared_ptr<pgw_procedure> proc = {};
std::shared_ptr<smf_procedure> proc = {};
if (find_procedure(sdresp.trxn_id, proc)) {
Logger::pgwc_app().debug("Received SXAB SESSION DELETION RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64"\n", sdresp.seid, sdresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION DELETION RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64"\n", sdresp.seid, sdresp.trxn_id);
proc->handle_itti_msg(sdresp);
remove_procedure(proc.get());
} else {
Logger::pgwc_app().debug("Received SXAB SESSION DELETION RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64", pgw_procedure not found, discarded!", sdresp.seid, sdresp.trxn_id);
Logger::pgwc_app().debug("Received N4 SESSION DELETION RESPONSE sender teid " TEID_FMT " pfcp_tx_id %" PRIX64", smf_procedure not found, discarded!", sdresp.seid, sdresp.trxn_id);
}
std::cout << toString() << std::endl;
}
//------------------------------------------------------------------------------
void pgw_context::handle_itti_msg (std::shared_ptr<itti_sxab_session_report_request>& req)
void pgw_context::handle_itti_msg (std::shared_ptr<itti_n4_session_report_request>& req)
{/*
pfcp::report_type_t report_type;
if (req->pfcp_ies.get(report_type)) {
......@@ -486,7 +486,7 @@ void pgw_context::handle_itti_msg (std::shared_ptr<itti_sxab_session_report_requ
ebi_t ebi;
if (find_pdn_connection(pdr_id, ppc, ebi)) {
downlink_data_report_procedure* p = new downlink_data_report_procedure(req);
std::shared_ptr<pgw_procedure> sproc = std::shared_ptr<pgw_procedure>(p);
std::shared_ptr<smf_procedure> sproc = std::shared_ptr<smf_procedure>(p);
insert_procedure(sproc);
if (p->run(shared_from_this(), ppc, ebi)) {
// TODO handle error code
......@@ -735,7 +735,7 @@ void pgw_context::handle_amf_msg (std::shared_ptr<itti_n11_create_sm_context_req
sm_context_resp->http_response.send(Pistache::Http::Code::Created, resBody);
session_create_sm_context_procedure* proc = new session_create_sm_context_procedure(sp);
std::shared_ptr<pgw_procedure> sproc = std::shared_ptr<pgw_procedure>(proc);
std::shared_ptr<smf_procedure> sproc = std::shared_ptr<smf_procedure>(proc);
insert_procedure(sproc);
if (proc->run(smreq, sm_context_resp_pending, shared_from_this())) {
......
......@@ -38,7 +38,7 @@
#include "3gpp_29.274.h"
#include "3gpp_29.503.h"
#include "common_root_types.h"
#include "pgwc_procedure.hpp"
#include "smf_procedure.hpp"
#include "uint_generator.hpp"
#include "SmContextCreateData.h"
#include "pistache/endpoint.h"
......@@ -186,7 +186,7 @@ public:
void release_pdr_id(const pfcp::pdr_id_t& pdr_id);
void generate_far_id(pfcp::far_id_t& far_id);
void release_far_id(const pfcp::far_id_t& far_id);
void insert_procedure(pgw_procedure* proc);
void insert_procedure(smf_procedure* proc);
bool ipv4; // IP Address(es): IPv4 address and/or IPv6 prefix
......@@ -303,12 +303,6 @@ public:
}
dnn_context(dnn_context& b) = delete;
/* Insert a session management subscription into the DNN context */
//void insert_dnn_subscription(snssai_t snssai, std::shared_ptr<session_management_subscription>& ss);
/* Find the subscription from the DNN context */
//bool find_dnn_subscription(const snssai_t snssai, std::shared_ptr<session_management_subscription>& ss);
/* Find the PDN connection */
bool find_pdn_connection(const uint32_t pdu_session_id , std::shared_ptr<pgw_pdn_connection>& pdn);
......@@ -322,9 +316,6 @@ public:
/* Store all PDN connections associated with this DNN context */
std::vector<std::shared_ptr<pgw_pdn_connection>> pdn_connections;
/* snssai-sst <-> session management subscription */
//std::map<uint8_t, std::shared_ptr<session_management_subscription>> dnn_subscriptions;
mutable std::recursive_mutex m_context;
};
......@@ -343,9 +334,9 @@ public:
pgw_context(pgw_context& b) = delete;
void insert_procedure(std::shared_ptr<pgw_procedure>& sproc);
bool find_procedure(const uint64_t& trxn_id, std::shared_ptr<pgw_procedure>& proc);
void remove_procedure(pgw_procedure* proc);
void insert_procedure(std::shared_ptr<smf_procedure>& sproc);
bool find_procedure(const uint64_t& trxn_id, std::shared_ptr<smf_procedure>& proc);
void remove_procedure(smf_procedure* proc);
#define IS_FIND_PDN_WITH_LOCAL_TEID true
#define IS_FIND_PDN_WITH_PEER_TEID false
......@@ -360,10 +351,10 @@ public:
void delete_apn_context(std::shared_ptr<apn_context>& sa);
void delete_pdn_connection(std::shared_ptr<apn_context>& sa , std::shared_ptr<pgw_pdn_connection>& sp);
void handle_itti_msg (itti_sxab_session_establishment_response& );
void handle_itti_msg (itti_sxab_session_modification_response& );
void handle_itti_msg (itti_sxab_session_deletion_response& );
void handle_itti_msg (std::shared_ptr<itti_sxab_session_report_request>&);
void handle_itti_msg (itti_n4_session_establishment_response& );
void handle_itti_msg (itti_n4_session_modification_response& );
void handle_itti_msg (itti_n4_session_deletion_response& );
void handle_itti_msg (std::shared_ptr<itti_n4_session_report_request>&);
/*
* Handle messages from AMF (e.g., PDU_SESSION_CREATESMContextRequest)
......@@ -430,7 +421,7 @@ public:
//--------------------------------------------
// internals
std::vector<std::shared_ptr<pgw_procedure>> pending_procedures;
std::vector<std::shared_ptr<smf_procedure>> pending_procedures;
// Big recursive lock
mutable std::recursive_mutex m_context;
......
......@@ -19,15 +19,15 @@
* contact@openairinterface.org
*/
/*! \file pgw_config.hpp
/*! \file smf_config.hpp
* \brief