Commit 751f3898 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen
Browse files

update SMF log/namespace/api-server, AMF addr/port, UDM addr/port

parent c19f14f0
......@@ -18,7 +18,7 @@
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
P-GW =
SMF =
{
INSTANCE = @INSTANCE@; # 0 is the default
PID_DIRECTORY = "@PID_DIRECTORY@"; # /var/run is the default
......@@ -65,19 +65,21 @@ P-GW =
INTERFACES :
{
S5_S8_CP :
N4 :
{
# P-GW binded interface for S5 or S8 communication
INTERFACE_NAME = "@PGW_INTERFACE_NAME_FOR_S5_S8_CP@"; # STRING, interface name
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
#PORT = 2123;
#SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
# SMF binded interface for N4 communication (UPF)
INTERFACE_NAME = "@SMF_INTERFACE_NAME_FOR_N4@"; # STRING, interface name
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
};
N11 :
{
# SMF binded interface for N11 communication (AMF)
INTERFACE_NAME = "@SMF_INTERFACE_NAME_FOR_N11@"; # STRING, interface name
IPV4_ADDRESS = "@SMF_INTERFACE_IPV4_ADDRESS_FOR_N11@"; # STRING, CIDR or "read" to let app read interface configured IP address
PORT = @SMF_INTERFACE_PORT_FOR_N11@
};
SX :
{
# P-GW binded interface for SX communication
......@@ -138,6 +140,16 @@ P-GW =
APN_AMBR_UL = 500000; # Maximum UL bandwidth that can be used by non guaranteed bit rate traffic in Kbits/seconds.
APN_AMBR_DL = 500000; # Maximum DL bandwidth that can be used by non guaranteed bit rate traffic in Kbits/seconds.
};
AMF :
{
IPV4_ADDRESS="@SMF_AMF_IPV4_ADDRESS@";
PORT = @SMF_AMF_PORT@;
};
UDM :
{
IPV4_ADDRESS="@SMF_UDM_IPV4_ADDRESS@";
PORT = @SMF_UDM_PORT@;
};
};
......@@ -14,11 +14,11 @@
#include "Helpers.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::smf::model;
using namespace oai::smf_server::helpers;
using namespace oai::smf_server::model;
IndividualPDUSessionHSMFApi::IndividualPDUSessionHSMFApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
......
......@@ -33,10 +33,10 @@
#include <string>
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
class IndividualPDUSessionHSMFApi {
public:
......
......@@ -14,11 +14,11 @@
#include "Helpers.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::smf::model;
using namespace oai::smf_server::helpers;
using namespace oai::smf_server::model;
IndividualSMContextApi::IndividualSMContextApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
......
......@@ -35,10 +35,10 @@
#include <string>
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
class IndividualSMContextApi {
public:
......
......@@ -14,11 +14,11 @@
#include "Helpers.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::smf::model;
using namespace oai::smf_server::helpers;
using namespace oai::smf_server::model;
PDUSessionsCollectionApi::PDUSessionsCollectionApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
......
......@@ -31,10 +31,10 @@
#include "ProblemDetails.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
class PDUSessionsCollectionApi {
public:
......
......@@ -14,11 +14,11 @@
#include "Helpers.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::smf::model;
using namespace oai::smf_server::helpers;
using namespace oai::smf_server::model;
SMContextsCollectionApi::SMContextsCollectionApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
......
......@@ -31,10 +31,10 @@
#include "SmContextCreatedData.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
class SMContextsCollectionApi {
public:
......
......@@ -13,12 +13,12 @@
#include "IndividualPDUSessionHSMFApiImpl.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
IndividualPDUSessionHSMFApiImpl::IndividualPDUSessionHSMFApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr, pgwc::pgw_app *smf_app_inst)
IndividualPDUSessionHSMFApiImpl::IndividualPDUSessionHSMFApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr, smf::smf_app *smf_app_inst)
: IndividualPDUSessionHSMFApi(rtr), m_smf_app(smf_app_inst)
{ }
......
......@@ -35,23 +35,23 @@
#include "ProblemDetails.h"
#include "ReleaseData.h"
#include <string>
#include "pgw_app.hpp"
#include "smf_app.hpp"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
class IndividualPDUSessionHSMFApiImpl : public oai::smf::api::IndividualPDUSessionHSMFApi {
class IndividualPDUSessionHSMFApiImpl : public oai::smf_server::api::IndividualPDUSessionHSMFApi {
public:
IndividualPDUSessionHSMFApiImpl(std::shared_ptr<Pistache::Rest::Router>, pgwc::pgw_app *smf_app_inst);
IndividualPDUSessionHSMFApiImpl(std::shared_ptr<Pistache::Rest::Router>, smf::smf_app *smf_app_inst);
~IndividualPDUSessionHSMFApiImpl() {}
void release_pdu_session(const std::string &pduSessionRef, const ReleaseData &releaseData, Pistache::Http::ResponseWriter &response);
void update_pdu_session(const std::string &pduSessionRef, const HsmfUpdateData &hsmfUpdateData, Pistache::Http::ResponseWriter &response);
private:
pgwc::pgw_app *m_smf_app;
smf::smf_app *m_smf_app;
};
}
......
......@@ -13,12 +13,12 @@
#include "IndividualSMContextApiImpl.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
IndividualSMContextApiImpl::IndividualSMContextApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr, pgwc::pgw_app *smf_app_inst)
IndividualSMContextApiImpl::IndividualSMContextApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr, smf::smf_app *smf_app_inst)
: IndividualSMContextApi(rtr), m_smf_app(smf_app_inst)
{ }
......
......@@ -37,24 +37,24 @@
#include "SmContextUpdateError.h"
#include "SmContextUpdatedData.h"
#include <string>
#include "pgw_app.hpp"
#include "smf_app.hpp"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
class IndividualSMContextApiImpl : public oai::smf::api::IndividualSMContextApi {
class IndividualSMContextApiImpl : public oai::smf_server::api::IndividualSMContextApi {
public:
IndividualSMContextApiImpl(std::shared_ptr<Pistache::Rest::Router>, pgwc::pgw_app *smf_app_inst);
IndividualSMContextApiImpl(std::shared_ptr<Pistache::Rest::Router>, smf::smf_app *smf_app_inst);
~IndividualSMContextApiImpl() {}
void release_sm_context(const std::string &smContextRef, const SmContextReleaseData &smContextReleaseData, Pistache::Http::ResponseWriter &response);
void retrieve_sm_context(const std::string &smContextRef, const SmContextRetrieveData &smContextRetrieveData, Pistache::Http::ResponseWriter &response);
void update_sm_context(const std::string &smContextRef, const SmContextUpdateData &smContextUpdateData, Pistache::Http::ResponseWriter &response);
private:
pgwc::pgw_app *m_smf_app;
smf::smf_app *m_smf_app;
};
}
......
......@@ -13,12 +13,12 @@
#include "PDUSessionsCollectionApiImpl.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
PDUSessionsCollectionApiImpl::PDUSessionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr, pgwc::pgw_app *smf_app_inst)
PDUSessionsCollectionApiImpl::PDUSessionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr, smf::smf_app *smf_app_inst)
: PDUSessionsCollectionApi(rtr), m_smf_app(smf_app_inst)
{ }
......
......@@ -33,22 +33,22 @@
#include "PduSessionCreateError.h"
#include "PduSessionCreatedData.h"
#include "ProblemDetails.h"
#include "pgw_app.hpp"
#include "smf_app.hpp"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
class PDUSessionsCollectionApiImpl : public oai::smf::api::PDUSessionsCollectionApi {
class PDUSessionsCollectionApiImpl : public oai::smf_server::api::PDUSessionsCollectionApi {
public:
PDUSessionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router>, pgwc::pgw_app *smf_app_inst);
PDUSessionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router>, smf::smf_app *smf_app_inst);
~PDUSessionsCollectionApiImpl() {}
void post_pdu_sessions(const PduSessionCreateData &pduSessionCreateData, Pistache::Http::ResponseWriter &response);
private:
pgwc::pgw_app *m_smf_app;
smf::smf_app *m_smf_app;
};
}
......
......@@ -16,19 +16,18 @@
#include "itti_msg_n11.hpp"
extern "C" {
#include <ctype.h>
#include "nas_message.h"
#include "mmData.h"
#include "nas_sm_encode_to_json.h"
//#include "NasMain.h"
}
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
SMContextsCollectionApiImpl::SMContextsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr, pgwc::pgw_app *smf_app_inst)
SMContextsCollectionApiImpl::SMContextsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr, smf::smf_app *smf_app_inst)
: SMContextsCollectionApi(rtr), m_smf_app(smf_app_inst)
{ }
......@@ -37,7 +36,7 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
Logger::smf_api_server().info("post_sm_contexts...");
//decode NAS message and assign the necessary informations to pgwc::pdu_session_create_sm_context_request
//decode NAS message and assign the necessary informations to smf::pdu_session_create_sm_context_request
//and pass this message to SMF to handle this message
nas_message_t decoded_nas_msg;
......@@ -45,9 +44,7 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
SmContextCreateData smContextCreateData = smContextMessage.getJsonData();
std::string n1_sm_msg = smContextMessage.getBinaryDataN1SmMessage();
//FOR DEBUG ONLY!!, GENERATE A PDU SESSION ESTABLISHMENT MESSAGE HERE!!
//sm_encode_establishment_request();
//FOR DEBUG ONLY!!, GENERATE A PDU SESSION ESTABLISHMENT MESSAGE HERE!!
//m_smf_app->create_n1_sm_container(PDU_SESSION_ESTABLISHMENT_REQUEST, n1_sm_msg);
Logger::smf_api_server().debug("smContextMessage, n1 sm msg %s",n1_sm_msg.c_str());
......@@ -55,6 +52,12 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
//Step1. Decode N1 SM container into decoded nas msg
int decoder_rc = m_smf_app->decode_nas_message_n1_sm_container(decoded_nas_msg, n1_sm_msg);
if (decoder_rc != RETURNok){
//error, should send reply to AMF with error code!!
}
Logger::smf_api_server().debug("nas header decode extended_protocol_discriminator %d, security_header_type:%d,sequence_number:%d,message_authentication_code:%d\n",
decoded_nas_msg.header.extended_protocol_discriminator,
decoded_nas_msg.header.security_header_type,
......@@ -62,7 +65,7 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
decoded_nas_msg.header.message_authentication_code);
//Step 2. Create a pdu_session_create_sm_context_request message and store the necessary information
pgwc::pdu_session_create_sm_context_request sm_context_req_msg = {};
smf::pdu_session_create_sm_context_request sm_context_req_msg = {};
//supi
supi_t supi = {.length = 0};
......@@ -125,11 +128,13 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
//Step 3. Handle the pdu_session_create_sm_context_request message in pwg_app
//m_smf_app->handle_amf_msg(sm_context_req_msg, response);
itti_n11_create_sm_context_request *itti_msg = new itti_n11_create_sm_context_request(TASK_SMF_N11, TASK_PGWC_APP, response);
//itti_n11_create_sm_context_request *itti_msg = new itti_n11_create_sm_context_request(TASK_SMF_N11, TASK_SMF_APP, response);
//itti_msg->req = sm_context_req_msg;
// std::shared_ptr<itti_n11_create_sm_context_request> i = std::shared_ptr<itti_n11_create_sm_context_request>(itti_msg);
std::shared_ptr<itti_n11_create_sm_context_request> itti_msg = std::make_shared<itti_n11_create_sm_context_request>(TASK_SMF_N11, TASK_SMF_APP, response);
itti_msg->req = sm_context_req_msg;
std::shared_ptr<itti_n11_create_sm_context_request> i = std::shared_ptr<itti_n11_create_sm_context_request>(itti_msg);
m_smf_app->handle_amf_msg(i);
m_smf_app->handle_amf_msg(itti_msg);
}
......
......@@ -33,22 +33,22 @@
#include "ProblemDetails.h"
#include "SmContextCreateError.h"
#include "SmContextCreatedData.h"
#include "pgw_app.hpp"
#include "smf_app.hpp"
namespace oai {
namespace smf {
namespace smf_server {
namespace api {
using namespace oai::smf::model;
using namespace oai::smf_server::model;
class SMContextsCollectionApiImpl : public oai::smf::api::SMContextsCollectionApi {
class SMContextsCollectionApiImpl : public oai::smf_server::api::SMContextsCollectionApi {
public:
SMContextsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router>, pgwc::pgw_app *smf_app_inst);
SMContextsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router>, smf::smf_app *smf_app_inst);
~SMContextsCollectionApiImpl() {}
void post_sm_contexts(const SmContextMessage &smContextMessage, Pistache::Http::ResponseWriter &response);
private:
pgwc::pgw_app *m_smf_app;
smf::smf_app *m_smf_app;
};
}
......
......@@ -14,7 +14,7 @@
#include "AccessType.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace model {
AccessType::AccessType()
......
......@@ -22,7 +22,7 @@
#include <nlohmann/json.hpp>
namespace oai {
namespace smf {
namespace smf_server {
namespace model {
/// <summary>
......
......@@ -14,7 +14,7 @@
#include "AdditionalQosFlowInfo.h"
namespace oai {
namespace smf {
namespace smf_server {
namespace model {
AdditionalQosFlowInfo::AdditionalQosFlowInfo()
......
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