Commit b6d14237 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'pdu_session_establishment' into develop

parents 663017d6 7d47f5f0
......@@ -49,7 +49,7 @@ SMF =
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#PGW_APP_SCHED_PARAMS :
#SMF_APP_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
......
......@@ -10,6 +10,27 @@
* Do not edit the class manually.
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "SMContextsCollectionApi.h"
#include "logger.hpp"
#include "Helpers.h"
......@@ -133,9 +154,8 @@ void SMContextsCollectionApi::setupRoutes() {
void SMContextsCollectionApi::post_sm_contexts_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
Logger::smf_api_server().debug("[SMF API] Received a SM context create request %s",request.body().c_str());
Logger::smf_api_server().info("Received a SM context create request from AMF");
Logger::smf_api_server().debug("Request body: %s\n",request.body().c_str());
SmContextMessage smContextMessage;
SmContextCreateData smContextCreateData;
......@@ -151,15 +171,18 @@ void SMContextsCollectionApi::post_sm_contexts_handler(const Pistache::Rest::Req
g_callbacks.on_body_end = &on_body_end;
multipartparser parser;
init_globals();
multipartparser_init(&parser, BOUNDARY);
if ((multipartparser_execute(&parser, &g_callbacks, request.body().c_str(), strlen(request.body().c_str())) != strlen(request.body().c_str())) or (!g_body_begin_called)){
response.send(Pistache::Http::Code::Bad_Request, "");
return;
}
assert(multipartparser_execute(&parser, &g_callbacks, request.body().c_str(), strlen(request.body().c_str())) == strlen(request.body().c_str()));
assert(g_body_begin_called);
//at least 2 parts for Json data and N1 (+ N2)
assert(g_parts.size() >= 2);
//at least 2 parts for Json data and N1 (+ N2)
if (g_parts.size() < 2){
response.send(Pistache::Http::Code::Bad_Request, "");
return;
}
part p0 = g_parts.front(); g_parts.pop_front();
Logger::smf_api_server().debug("Request body, part 1: \n%s", p0.body.c_str());
part p1 = g_parts.front(); g_parts.pop_front();
......@@ -171,7 +194,6 @@ void SMContextsCollectionApi::post_sm_contexts_handler(const Pistache::Rest::Req
//step 2. process the request
try {
//nlohmann::json::parse(p0.body.c_str()).get_to(smContextMessage);
nlohmann::json::parse(p0.body.c_str()).get_to(smContextCreateData);
smContextMessage.setJsonData(smContextCreateData);
smContextMessage.setBinaryDataN1SmMessage(p1.body.c_str());
......
......@@ -10,10 +10,29 @@
* Do not edit the class manually.
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "IndividualSMContextApiImpl.h"
extern "C" {
#include "Ngap_NGAP-PDU.h"
}
namespace oai {
namespace smf_server {
namespace api {
......@@ -36,37 +55,19 @@ void IndividualSMContextApiImpl::retrieve_sm_context(const std::string &smContex
void IndividualSMContextApiImpl::update_sm_context(const std::string &smContextRef, const SmContextUpdateData &smContextUpdateData, Pistache::Http::ResponseWriter &response) {
//handle Nsmf_PDUSession_UpdateSMContext Request
Logger::smf_api_server().info("update_sm_contexts...");
Logger::smf_api_server().info("Received a PDUSession_UpdateSMContext Request from AMF.");
//Get the SmContextUpdateData from this message and process in smf_app
smf::pdu_session_update_sm_context_request sm_context_req_msg = {};
//decode NGAP message and assign the necessary informations to pdu_session_update_sm_context_request
//and pass this message to SMF to handle this message
Ngap_NGAP_PDU_t decoded_ngap_msg = {};
std::string n2_sm_information = (smContextUpdateData.getN2SmInfo()).getContentId();
std::string n2_sm_msg_hex;
m_smf_app->convert_string_2_hex(n2_sm_information, n2_sm_msg_hex);
Logger::smf_api_server().debug("smContextMessage, n2 sm information %s",n2_sm_information.c_str());
std::string n2_sm_info_type = smContextUpdateData.getN2SmInfoType();
sm_context_req_msg.set_n2_sm_information(n2_sm_msg_hex);
sm_context_req_msg.set_n2_sm_info_type(n2_sm_info_type);
/*
// do it from SMF_APP
int decoder_rc = m_smf_app->decode_ngap_message(decoded_ngap_msg, n2_sm_msg_hex);
if (decoder_rc != RETURNok) {
//TODO: error, should send reply to AMF with error code!!
}
*/
//Step 2. TODO: initialize necessary values for sm context req from smContextUpdateData
//Step 3. Handle the itti_n11_update_sm_context_request message in smf_app
......@@ -76,7 +77,6 @@ void IndividualSMContextApiImpl::update_sm_context(const std::string &smContextR
m_smf_app->handle_amf_msg(itti_msg);
}
}
......
......@@ -10,18 +10,34 @@
* Do not edit the class manually.
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "SMContextsCollectionApiImpl.h"
#include "logger.hpp"
#include "smf_msg.hpp"
#include "itti_msg_n11.hpp"
#include "3gpp_29.502.h"
extern "C" {
#include "nas_message.h"
#include "mmData.h"
#include "nas_sm_encode_to_json.h"
}
namespace oai {
namespace smf_server {
namespace api {
......@@ -35,13 +51,11 @@ SMContextsCollectionApiImpl::SMContextsCollectionApiImpl(std::shared_ptr<Pistach
void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smContextMessage, Pistache::Http::ResponseWriter &response) {
Logger::smf_api_server().info("[SMF API] Process SmContextMessage ...");
Logger::smf_api_server().info("Process SmContextMessage ...");
//decode NAS message and assign the necessary informations to smf::pdu_session_create_sm_context_request
//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;
memset (&decoded_nas_msg, 0, sizeof (nas_message_t));
//decode NAS should be done in SMF APP
SmContextCreateData smContextCreateData = smContextMessage.getJsonData();
std::string n1_sm_msg = smContextMessage.getBinaryDataN1SmMessage();
......@@ -49,44 +63,12 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
m_smf_app->convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
Logger::smf_api_server().debug("smContextMessage, N1 SM message: %s",n1_sm_msg.c_str());
//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_hex);
if (decoder_rc != RETURNok) {
//error, should send reply to AMF with error code!!
Logger::smf_api_server().warn("N1 SM container cannot be decoded correctly!\n");
SmContextCreateError smContextCreateError;
ProblemDetails problem_details;
RefToBinaryData binary_data;
std::string n1_container;
problem_details.setCause(pdu_session_application_error_e2str[PDU_SESSION_APPLICATION_ERROR_N1_SM_ERROR]);
smContextCreateError.setError(problem_details);
//PDU Session Establishment Reject
//24.501: response with a 5GSM STATUS message including cause "#95 Semantically incorrect message"
m_smf_app->create_n1_sm_container(PDU_SESSION_ESTABLISHMENT_REJECT, n1_container, 95); //TODO: should define 5GSM cause in 24.501
binary_data.setContentId(n1_container);
smContextCreateError.setN1SmMsg(binary_data);
//Send response to AMF
nlohmann::json jsonData;
to_json(jsonData, smContextCreateError);
std::string resBody = jsonData.dump();
//httpResponse.headers().add<Pistache::Http::Header::Location>(url);
response.send(Pistache::Http::Code::Forbidden, resBody);
return;
}
Logger::smf_api_server().debug("NAS header information: 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,
decoded_nas_msg.header.sequence_number,
decoded_nas_msg.header.message_authentication_code);
//Step 2. Create a pdu_session_create_sm_context_request message and store the necessary information
Logger::smf_api_server().debug("Create a pdu_session_create_sm_context_request message and store the necessary information\n");
smf::pdu_session_create_sm_context_request sm_context_req_msg = {};
//set N1 SM Message
sm_context_req_msg.set_n1_sm_message(n1_sm_msg_hex);
//set api root to be used as location header in HTTP response
sm_context_req_msg.set_api_root(m_address + base + "/sm-contexts");
......@@ -135,35 +117,6 @@ void SMContextsCollectionApiImpl::post_sm_contexts(const SmContextMessage &smCon
//Subscription for PDU Session Status Notification
// Trace requirement
//From N1 Container (NAS)
//Extended protocol discriminator (Mandatory)
Logger::smf_api_server().debug("SmContextCreateData, Extended protocol discriminator \n");
sm_context_req_msg.set_epd(decoded_nas_msg.header.extended_protocol_discriminator);
//PDU session ID (Mandatory)
Logger::smf_api_server().debug("SmContextCreateData, PDU session identity %d\n", decoded_nas_msg.plain.sm.header.pdu_session_identity);
sm_context_req_msg.set_pdu_session_id(decoded_nas_msg.plain.sm.header.pdu_session_identity);
//PTI (Mandatory)
Logger::smf_api_server().debug("SmContextCreateData, Procedure transaction ID %d\n", decoded_nas_msg.plain.sm.header.procedure_transaction_identity);
procedure_transaction_id_t pti = {.procedure_transaction_id = decoded_nas_msg.plain.sm.header.procedure_transaction_identity};
sm_context_req_msg.set_pti(pti);
//Message type (Mandatory) (PDU SESSION ESTABLISHMENT REQUEST message identity)
Logger::smf_api_server().debug("SmContextCreateData, Message Type %d\n", decoded_nas_msg.plain.sm.header.message_type);
sm_context_req_msg.set_message_type(decoded_nas_msg.plain.sm.header.message_type);
//Integrity protection maximum data rate (Mandatory)
//PDU session type (Optional)
Logger::smf_api_server().debug("SmContextCreateData, Message Type %d\n", PDN_TYPE_E_IPV4);
sm_context_req_msg.set_pdu_session_type(PDN_TYPE_E_IPV4);
if (decoded_nas_msg.plain.sm.header.message_type == PDU_SESSION_ESTABLISHMENT_REQUEST){
//TODO: Disable this command temporarily since can't get this info from tester
//sm_context_req_msg.set_pdu_session_type(decoded_nas_msg.plain.sm.specific_msg.pdu_session_establishment_request._pdusessiontype.pdu_session_type_value);
}
//SSC mode (Optional)
//5GSM capability (Optional)
//Maximum number of supported (Optional)
......
......@@ -65,7 +65,6 @@ public:
};
//-----------------------------------------------------------------------------
class itti_n11_create_sm_context_response : public itti_n11_msg {
public:
......@@ -108,7 +107,6 @@ public:
smf::pdu_session_update_sm_context_response res;
Pistache::Http::ResponseWriter http_response;
};
#endif /* ITTI_MSG_N11_HPP_INCLUDED_ */
......@@ -78,6 +78,7 @@ typedef uint8_t pdu_session_id;
//should move to 24.501
enum pdu_session_type_e {
PDU_SESSION_TYPE_E_UNKNOWN = 0,
PDU_SESSION_TYPE_E_IPV4 = 1,
PDU_SESSION_TYPE_E_IPV6 = 2,
PDU_SESSION_TYPE_E_IPV4V6 = 3,
......
......@@ -81,6 +81,8 @@ extern "C" {
//0b11******
//5GS Session Management Messages
//TODO should be updated with enum
#define PDU_SESSION_MESSAGE_TYPE_UNKNOWN 0b00000000
#define PDU_SESSION_ESTABLISHMENT_REQUEST 0b11000001
#define PDU_SESSION_ESTABLISHMENT_ACCEPT 0b11000010
#define PDU_SESSION_ESTABLISHMENT_REJECT 0b11000011
......
......@@ -32,7 +32,7 @@ Ngap_PDUSessionResourceSetupRequestIEs_t *make_req_RAN_UE_NGAP_ID(uint32_t rAN_
ie->value.present = Ngap_PDUSessionResourceSetupRequestIEs__value_PR_RAN_UE_NGAP_ID;
ie->value.choice.RAN_UE_NGAP_ID = rAN_UE_NGAP_ID ;
printf("RAN_UE_NGAP_ID: 0x%x\n",ie->value.choice.RAN_UE_NGAP_ID);
printf("RAN_UE_NGAP_ID: %lu\n",ie->value.choice.RAN_UE_NGAP_ID);
return ie;
}
......@@ -48,7 +48,7 @@ Ngap_PDUSessionResourceSetupRequestIEs_t *make_req_AMF_UE_NGAP_ID(uint64_t amf_
asn_ulong2INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, amf_UE_NGAP_ID & AMF_UE_NGAP_ID_MASK_);
printf("AMF_UE_NGAP_ID: 0x%x\n",amf_UE_NGAP_ID);
printf("AMF_UE_NGAP_ID: %lu\n",amf_UE_NGAP_ID);
return ie;
}
......@@ -62,7 +62,7 @@ Ngap_PDUSessionResourceSetupRequestIEs_t *make_RANPagingPriority(const long ra
ie->value.present = Ngap_PDUSessionResourceSetupRequestIEs__value_PR_RANPagingPriority;
ie->value.choice.RANPagingPriority = ranPagingPriority;
printf("RANPagingPriority: 0x%x\n",ie->value.choice.RANPagingPriority);
printf("RANPagingPriority: %ld",ie->value.choice.RANPagingPriority);
return ie;
}
......@@ -76,7 +76,7 @@ Ngap_PDUSessionResourceSetupRequestIEs_t *make_NAS_PDU(const char *nas_pdu)
ie->value.present = Ngap_PDUSessionResourceSetupRequestIEs__value_PR_NAS_PDU;
OCTET_STRING_fromBuf (&ie->value.choice.NAS_PDU, nas_pdu, strlen(nas_pdu));
printf("nas_pdu, nas_pdu_size:%d, nas_pdu:%s,\n", strlen(nas_pdu), nas_pdu);
printf("nas_pdu, nas_pdu_size:%ld, nas_pdu:%s,\n", strlen(nas_pdu), nas_pdu);
return ie;
}
......
......@@ -89,7 +89,7 @@ int main(int argc, char **argv)
}
// Logger
Logger::init( "spgwc" , Options::getlogStdout() , Options::getlogRotFilelog());
Logger::init( "smf" , Options::getlogStdout() , Options::getlogRotFilelog());
Logger::smf_app().startup( "Options parsed" );
......
......@@ -59,6 +59,7 @@ add_library (SMF STATIC
smf_app.cpp
smf_config.cpp
smf_context.cpp
smf_ngap.cpp
smf_pfcp_association.cpp
smf_pco.cpp
smf_procedure.cpp
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -43,12 +43,6 @@
#include "pistache/router.h"
#include "smf_msg.hpp"
extern "C"{
#include "nas_message.h"
#include "mmData.h"
#include "Ngap_NGAP-PDU.h"
}
#include <map>
#include <set>
#include <shared_mutex>
......@@ -195,59 +189,12 @@ public:
void send_create_session_response(Pistache::Http::ResponseWriter& httpResponse, oai::smf_server::model::SmContextCreateError& smContextCreateError, Pistache::Http::Code code);
/*
* Create N1 SM Container to send to AMF (using NAS lib)
* @param [std::shared_ptr<itti_n11_create_sm_context_response>] sm_context_res
* @param [uint8_t] msg_type Type of N1 message
* @param [std::string&] nas_msg_str store NAS message in form of string
*
* Convert a string to hex representing this string
* @param [std::string&] input_str Input string
* @param [std::string&] output_str String represents string in hex format
* @return void
*/
void create_n1_sm_container(std::shared_ptr<itti_n11_create_sm_context_response> sm_context_res, uint8_t msg_type, std::string& nas_msg_str, uint8_t sm_cause = 0);
//for testing purpose!!
void create_n1_sm_container(uint8_t msg_type, std::string& nas_msg_str, uint8_t sm_cause = 0);
/*
* Create N1 SM Container to send to AMF (using NAS lib)
* @param [std::shared_ptr<itti_n11_create_sm_context_request>] sm_context_req
* @param [uint8_t] msg_type Type of N1 message
* @param [std::string&] nas_msg_str store NAS message in form of string
*
*/
void create_n1_sm_container(std::shared_ptr<itti_n11_create_sm_context_request> sm_context_req, uint8_t msg_type, std::string& nas_msg_str, uint8_t sm_cause = 0);
/*
* Create N2 SM Information to send to AMF (using NAS lib)
* @param [std::shared_ptr<itti_n11_create_sm_context_response>] sm_context_res
* @param [uint8_t] msg_type Type of N2 message
* @param [std::string&] ngap_msg_str store NGAP message in form of string
*
*/
void create_n2_sm_information(std::shared_ptr<itti_n11_create_sm_context_response> sm_context_res, uint8_t ngap_msg_type, uint8_t ngap_ie_type, std::string& ngap_msg_str);
/*
* Decode N1 SM Container into the NAS mesasge (using NAS lib)
* @param [nas_message_t&] nas_msg Store NAS message after decoded
* @param [std::string&] n1_sm_msg N1 SM Container from AMF
* @return status of the decode process
*/
int decode_nas_message_n1_sm_container(nas_message_t& nas_msg, std::string& n1_sm_msg);
/*
* Convert a string to hex representing this string
* @param [std::string&] input_str Input string
* @param [std::string&] output_str String represents string in hex format
* @return void
*/
void convert_string_2_hex(std::string& input_str, std::string& output_str);
/*
* Decode N2 SM Information (using NGAP lib)
* @param [Ngap_NGAP_PDU_t&] ngap_msg Store decoded NGAP message
* @param [std::string&] n2_sm_info N2 SM Information from AMF
* @return status of the decode process
*/
int decode_ngap_message(Ngap_NGAP_PDU_t& ngap_msg, std::string& n2_sm_info);
void convert_string_2_hex(std::string& input_str, std::string& output_str);
};
}
......
......@@ -151,8 +151,8 @@ int smf_config::load_itti(const Setting& itti_cfg, itti_cfg_t& cfg)
}
try {
const Setting& pgw_app_sched_params_cfg = itti_cfg[SMF_CONFIG_STRING_PGW_APP_SCHED_PARAMS];
load_thread_sched_params(pgw_app_sched_params_cfg, cfg.pgw_app_sched_params);
const Setting& smf_app_sched_params_cfg = itti_cfg[SMF_CONFIG_STRING_SMF_APP_SCHED_PARAMS];
load_thread_sched_params(smf_app_sched_params_cfg, cfg.smf_app_sched_params);
} catch(const SettingNotFoundException &nfex) {
Logger::smf_app().info("%s : %s, using defaults", nfex.what(), nfex.getPath());
}
......@@ -500,7 +500,7 @@ int smf_config::load(const string& config_file)
void smf_config::display ()
{
Logger::smf_app().info( "==== EURECOM %s v%s ====", PACKAGE_NAME, PACKAGE_VERSION);
Logger::smf_app().info( "Configuration PGW-C:");
Logger::smf_app().info( "Configuration SMF:");
Logger::smf_app().info( "- Instance ..............: %d\n", instance);
Logger::smf_app().info( "- PID dir ...............: %s\n", pid_dir.c_str());
......@@ -542,10 +542,10 @@ void smf_config::display ()
Logger::smf_app().info( " CPU id............: %d", itti.sx_sched_params.cpu_id);
Logger::smf_app().info( " Scheduling policy : %d", itti.sx_sched_params.sched_policy);
Logger::smf_app().info( " Scheduling prio .: %d", itti.sx_sched_params.sched_priority);
Logger::smf_app().info( "- ITTI PGW_APP task Threading:");
Logger::smf_app().info( " CPU id............: %d", itti.pgw_app_sched_params.cpu_id);
Logger::smf_app().info( " Scheduling policy : %d", itti.pgw_app_sched_params.sched_policy);
Logger::smf_app().info( " Scheduling prio .: %d", itti.pgw_app_sched_params.sched_priority);
Logger::smf_app().info( "- ITTI SMF_APP task Threading:");
Logger::smf_app().info( " CPU id............: %d", itti.smf_app_sched_params.cpu_id);
Logger::smf_app().info( " Scheduling policy : %d", itti.smf_app_sched_params.sched_policy);
Logger::smf_app().info( " Scheduling prio .: %d", itti.smf_app_sched_params.sched_priority);
Logger::smf_app().info( "- ITTI ASYNC_CMD task Threading:");
Logger::smf_app().info( " CPU id............: %d", itti.async_cmd_sched_params.cpu_id);
Logger::smf_app().info( " Scheduling policy : %d", itti.async_cmd_sched_params.sched_policy);
......
......@@ -122,7 +122,7 @@
#define SMF_CONFIG_STRING_S11_SCHED_PARAMS "S11_SCHED_PARAMS"
#define SMF_CONFIG_STRING_S5S8_SCHED_PARAMS "S5S8_SCHED_PARAMS"
#define SMF_CONFIG_STRING_SX_SCHED_PARAMS "SX_SCHED_PARAMS"
#define SMF_CONFIG_STRING_PGW_APP_SCHED_PARAMS "PGW_APP_SCHED_PARAMS"
#define SMF_CONFIG_STRING_SMF_APP_SCHED_PARAMS "SMF_APP_SCHED_PARAMS"
#define SMF_CONFIG_STRING_ASYNC_CMD_SCHED_PARAMS "ASYNC_CMD_SCHED_PARAMS"
......@@ -162,7 +162,7 @@ typedef struct itti_cfg_s {
util::thread_sched_params itti_timer_sched_params;
util::thread_sched_params sx_sched_params;
util::thread_sched_params s5s8_sched_params;
util::thread_sched_params pgw_app_sched_params;
util::thread_sched_params smf_app_sched_params;
util::thread_sched_params async_cmd_sched_params;
} itti_cfg_t;
......@@ -262,7 +262,7 @@ public:
itti.itti_timer_sched_params.sched_priority = 85;
itti.sx_sched_params.sched_priority = 84;
itti.s5s8_sched_params.sched_priority = 84;
itti.pgw_app_sched_params.sched_priority = 84;
itti.smf_app_sched_params.sched_priority = 84;
itti.async_cmd_sched_params.sched_priority = 84;
sx.thread_rd_sched_params.sched_priority = 90;
......@@ -292,7 +292,7 @@ public:
bool is_dotted_dnn_handled(const std::string& apn, const pdu_session_type_t& pdn_session_type);
};
} // namespace pgw
} // namespace smf
#endif /* FILE_SMF_CONFIG_HPP_SEEN */
......@@ -32,6 +32,7 @@
#include "smf_app.hpp"
#include "smf_config.hpp"
#include "smf_context.hpp"
#include "smf_ngap.hpp"
#include "smf_paa_dynamic.hpp"
#include "smf_procedure.hpp"
#include "ProblemDetails.h"
......@@ -162,25 +163,25 @@ void smf_pdu_session::set_seid(const uint64_t& s){
}
//------------------------------------------------------------------------------
// TODO check if prd_id should be uniq in the (S)PGW-U or in the context of a pdn connection
// TODO check if prd_id should be uniq in the UPF or in the context of a pdn connection
void smf_pdu_session::generate_far_id(pfcp::far_id_t& far_id)
{
far_id.far_id = far_id_generator.get_uid();
}
//------------------------------------------------------------------------------
// TODO check if prd_id should be uniq in the (S)PGW-U or in the context of a pdn connection
// TODO check if prd_id should be uniq in the UPF or in the context of a pdn connection
void smf_pdu_session::release_far_id(const pfcp::far_id_t& far_id)
{
far_id_generator.free_uid(far_id.far_id);
}
//------------------------------------------------------------------------------
// TODO check if prd_id should be uniq in the (S)PGW-U or in the context of a pdn connection
// TODO check if prd_id should be uniq in the UPF or in the context of a pdn connection
void smf_pdu_session::generate_pdr_id(pfcp::pdr_id_t& pdr_id)
{
pdr_id.rule_id = pdr_id_generator.get_uid();
}
//------------------------------------------------------------------------------
// TODO check if prd_id should be uniq in the (S)PGW-U or in the context of a pdn connection
// TODO check if prd_id should be uniq in the UPF or in the context of a pdn connection
void smf_pdu_session::release_pdr_id(const pfcp::pdr_id_t& pdr_id)
{
pdr_id_generator.free_uid(pdr_id.rule_id);
......@@ -281,7 +282,7 @@ std::string smf_context::toString() const
{
std::unique_lock<std::recursive_mutex> lock(m_context);
std::string s = {};
s.append("PGW CONTEXT:\n");
s.append("SMF CONTEXT:\n");
s.append("\tIMSI:\t\t\t\t").append(imsi.toString()).append("\n");
s.append("\tIMSI UNAUTHENTICATED:\t\t").append(std::to_string(imsi_unauthenticated_indicator)).append("\n");
for (auto it : dnns) {
......@@ -354,6 +355,7 @@ void smf_context::handle_amf_msg (std::shared_ptr<itti_n11_create_sm_context_req
sm_context_resp->res.set_snssai(snssai);
sm_context_resp->res.set_dnn(dnn);
//Step 3. find pdu_session
std::shared_ptr<dnn_context> sd;
bool find_dnn = find_dnn_context (dnn, sd);
......@@ -595,7 +597,7 @@ void smf_context::handle_amf_msg (std::shared_ptr<itti_n11_update_sm_context_req
//decode Ngap_PDUSessionResourceSetupResponseTransfer
if (n2_sm_info_type.compare(n2_sm_info_type_e2str[PDU_RES_SETUP_RSP]) == 0){
Ngap_PDUSessionResourceSetupResponseTransfer_t *decoded_msg = NULL;
std::unique_ptr<Ngap_PDUSessionResourceSetupResponseTransfer_t> decoded_msg = std::unique_ptr<Ngap_PDUSessionResourceSetupResponseTransfer_t>();
//Decode N2 SM info into decoded nas msg
asn_dec_rval_t rc = asn_decode(NULL,ATS_ALIGNED_CANONICAL_PER, &asn_DEF_Ngap_PDUSessionResourceSetupResponseTransfer, (void **)&decoded_msg, (void *)n2_sm_infomation.c_str(), n2_sm_infomation.length());
if(rc.code != RC_OK)
......
......@@ -31,20 +31,35 @@
using namespace smf;
//-----------------------------------------------------------------------------
void qos_flow_context_created::set_cause(const uint8_t cause)
{
cause_value = cause;
}
//-----------------------------------------------------------------------------
void qos_flow_context_created::set_qfi(const pfcp::qfi_t& q)
{
qfi = q;
}
//-----------------------------------------------------------------------------
void qos_flow_context_created::set_ul_fteid(const fteid_t& teid)
{
ul_fteid = teid;
}
//-----------------------------------------------------------------------------
pdu_session_msg_type_t pdu_session_msg::get_msg_type() const
{
return m_msg_type;
}
//-----------------------------------------------------------------------------
void pdu_session_msg::set_msg_type(pdu_session_msg_type_t const& msg_type)
{
m_msg_type = msg_type;
}
//-----------------------------------------------------------------------------
supi_t pdu_session_msg::get_supi() const
{
return m_supi;
......@@ -68,8 +83,6 @@ void pdu_session_msg::set_supi_prefix(std::string const& prefix)
m_supi_prefix = prefix;
}
//-----------------------------------------------------------------------------
pdu_session_id_t pdu_session_msg::get_pdu_session_id() const
{
......@@ -118,86 +131,96 @@ std::string pdu_session_msg::get_api_root() const
}
//-----------------------------------------------------------------------------
std::string pdu_session_create_sm_context_request::get_serving_nf_id() const
uint8_t pdu_session_create_sm_context::get_pdu_session_type() const
{
return m_serving_nf_id;
return m_pdu_session_type;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_request::set_serving_nf_id(std::string const& serving_nf_id)
void pdu_session_create_sm_context::set_pdu_session_type (uint8_t const& pdu_session_type)
{
m_serving_nf_id = serving_nf_id;
m_pdu_session_type = pdu_session_type;
}
//-----------------------------------------------------------------------------
std::string pdu_session_create_sm_context_request::get_request_type() const
extended_protocol_discriminator_t pdu_session_create_sm_context::get_epd() const
{
return m_request_type;
return m_epd;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_request::set_request_type(std::string const& request_type)
void pdu_session_create_sm_context::set_epd(extended_protocol_discriminator_t const& epd)
{
m_request_type = request_type;
m_epd = epd;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_request::set_dnn_selection_mode(std::string const& dnn_selection_mode)
procedure_transaction_id_t pdu_session_create_sm_context::get_pti() const
{
m_dnn_selection_mode = dnn_selection_mode;
return m_pti;
}
//-----------------------------------------------------------------------------
std::string pdu_session_create_sm_context_request::get_dnn_selection_mode() const
void pdu_session_create_sm_context::set_pti(procedure_transaction_id_t const& pti)
{
return m_dnn_selection_mode;
m_pti = pti;
}
//-----------------------------------------------------------------------------
uint8_t pdu_session_create_sm_context_request::get_pdu_session_type() const
uint8_t pdu_session_create_sm_context::get_message_type() const
{
return m_pdu_session_type;
return m_message_type;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_request::set_pdu_session_type (uint8_t const& pdu_session_type)
{
m_pdu_session_type = pdu_session_type;
void pdu_session_create_sm_context::set_message_type(uint8_t const& message_type){
m_message_type = message_type;
}
std::string pdu_session_create_sm_context_request::get_n1_sm_message() const{
return m_n1_sm_message;
}
void pdu_session_create_sm_context_request::set_n1_sm_message(std::string const& value){
m_n1_sm_message = value;
}
//-----------------------------------------------------------------------------
extended_protocol_discriminator_t pdu_session_create_sm_context_request::get_epd() const
std::string pdu_session_create_sm_context_request::get_serving_nf_id() const
{
return m_epd;
return m_serving_nf_id;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_request::set_epd(extended_protocol_discriminator_t const& epd)
void pdu_session_create_sm_context_request::set_serving_nf_id(std::string const& serving_nf_id)
{
m_epd = epd;
m_serving_nf_id = serving_nf_id;
}
//-----------------------------------------------------------------------------
procedure_transaction_id_t pdu_session_create_sm_context_request::get_pti() const
std::string pdu_session_create_sm_context_request::get_request_type() const
{
return m_pti;
return m_request_type;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_request::set_pti(procedure_transaction_id_t const& pti)
void pdu_session_create_sm_context_request::set_request_type(std::string const& request_type)
{
m_pti = pti;
m_request_type = request_type;
}
//-----------------------------------------------------------------------------
uint8_t pdu_session_create_sm_context_request::get_message_type() const
void pdu_session_create_sm_context_request::set_dnn_selection_mode(std::string const& dnn_selection_mode)
{
return m_message_type;
m_dnn_selection_mode = dnn_selection_mode;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_request::set_message_type(uint8_t const& message_type){
m_message_type = message_type;
std::string pdu_session_create_sm_context_request::get_dnn_selection_mode() const
{
return m_dnn_selection_mode;
}
//-----------------------------------------------------------------------------
......@@ -247,24 +270,29 @@ Pistache::Http::Code pdu_session_create_sm_context_response::get_http_code()
return m_code;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_response::set_qos_flow_context(const qos_flow_context_created qos_flow)
{
qos_flow_context = qos_flow;
}
//-----------------------------------------------------------------------------
/* pdu_session_update_sm_context_request */
std::string pdu_session_update_sm_context_request::get_n2_sm_information() const{
return n2_sm_information;
}
//-----------------------------------------------------------------------------
void pdu_session_update_sm_context_request::set_n2_sm_information(std::string const& value){
n2_sm_information = value;
}
//-----------------------------------------------------------------------------
std::string pdu_session_update_sm_context_request::get_n2_sm_info_type() const{
return n2_sm_info_type;
}
//-----------------------------------------------------------------------------
void pdu_session_update_sm_context_request::set_n2_sm_info_type(std::string const& value){
n2_sm_info_type = value;
}
......
This diff is collapsed.
......@@ -32,6 +32,7 @@
#include "itti.hpp"
#include "logger.hpp"
#include "smf_n11.hpp"
#include "smf_ngap.hpp"
#include "smf_app.hpp"
#include "smf_config.hpp"
#include <curl/curl.h>
......@@ -121,62 +122,74 @@ void smf_n11::send_msg_to_amf(std::shared_ptr<itti_n11_create_sm_context_respons
nlohmann::json message_transfer_req_data;
std::string n1_message;
std::string n2_message;
smf_ngap smf_ngap_inst;
pdu_session_create_sm_context_response context_res_msg = sm_context_res->res;
//Curl multipart
CURL *curl = curl_easy_init();
//get supi and put into URL
std::string supi_str;
supi_t supi = sm_context_res->res.get_supi();
supi_str = sm_context_res->res.get_supi_prefix() + "-" + smf_supi_to_string (supi);
supi_t supi = context_res_msg.get_supi();
supi_str = context_res_msg.get_supi_prefix() + "-" + smf_supi_to_string (supi);
std::string url = std::string(inet_ntoa (*((struct in_addr *)&smf_cfg.amf_addr.ipv4_addr))) + ":" + std::to_string(smf_cfg.amf_addr.port) + "/namf-comm/v1/ue-contexts/" + supi_str.c_str() +"/n1-n2-messages";
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] Sending Communication_N1N2MessageTransfer to AMF, AMF's URL: %s", url.c_str());
std::string ngap_msg_str;
//N1 SM container & N2 SM Information
//Create N1 SM container & N2 SM Information
//TODO: should uncomment these lines when including UPF in the test
// if (sm_context_res->res.get_cause() != REQUEST_ACCEPTED) { //PDU Session Establishment Reject
// Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] PDU Session Establishment Reject\n");
// smf_app_inst->create_n1_sm_container(sm_context_res, PDU_SESSION_ESTABLISHMENT_REJECT, n1_message); //need cause?
// } else { //PDU Session Establishment Accept
//for the moment, can only test with PDU Session Establishment Reject!!
context_res_msg.set_cause(REQUEST_ACCEPTED);//for testing purpose
if (context_res_msg.get_cause() != REQUEST_ACCEPTED) { //PDU Session Establishment Reject
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] PDU Session Establishment Reject\n");
//pdu_session_msg& msg = context_res_msg;
smf_ngap_inst.create_n1_sm_container(context_res_msg, PDU_SESSION_ESTABLISHMENT_REJECT, n1_message, 0); //TODO: need cause?
} else { //PDU Session Establishment Accept
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] PDU Session Establishment Accept \n");
smf_app_inst->create_n1_sm_container(sm_context_res, PDU_SESSION_ESTABLISHMENT_ACCEPT, n1_message); //need cause?
smf_ngap_inst.create_n1_sm_container(context_res_msg, PDU_SESSION_ESTABLISHMENT_ACCEPT, n1_message, 0); //TODO: need cause?
//TODO: N2 SM Information (Step 11, section 4.3.2.2.1 @ 3GPP TS 23.502)
smf_app_inst->create_n2_sm_information(sm_context_res, 1, 1, ngap_msg_str);
// }
//fill the content
std::string n1_msg_hex;
smf_app_inst->convert_string_2_hex(n1_message, n1_msg_hex);
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] n1MessageContent: %s\n ", n1_msg_hex.c_str());
std::string n2_msg_hex;
smf_app_inst->convert_string_2_hex(ngap_msg_str, n2_msg_hex);
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] n2SMInformation %s\n ", n2_msg_hex.c_str());
smf_ngap_inst.create_n2_sm_information(context_res_msg, 1, 1, n2_message);
}
//Fill the json part
//N1SM
message_transfer_req_data["n1MessageContainer"]["n1MessageClass"] = "SM";
message_transfer_req_data["n1MessageContainer"]["n1MessageContent"]["contentId"] = "n1SmMsg"; //part 2
//TODO: fill the content of N1N2MessageTransferReqData
message_transfer_req_data["n2InfoContainer"]["n2InformationClass"] = "SM";
message_transfer_req_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = 1;
//N2InfoContent (section 6.1.6.2.27@3GPP TS 29.518)
//message_transfer_req_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapMessageType"] = 123; //NGAP message -to be verified: doesn't exist in tester
message_transfer_req_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] = "PDU_RES_SETUP_REQ"; //NGAP message
message_transfer_req_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2SmMsg"; //part 3
//message_transfer_req_data["n2InfoContainer"]["smInfo"]["nasPdu"] = ;
//message_transfer_req_data["n2InfoContainer"]["smInfo"]["sNssai"] = ;
message_transfer_req_data["n2InfoContainer"]["ranInfo"] = "SM";
//N2SM
if (context_res_msg.get_cause() == REQUEST_ACCEPTED){
//TODO: fill the content of N1N2MessageTransferReqData
message_transfer_req_data["n2InfoContainer"]["n2InformationClass"] = "SM";
message_transfer_req_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = 1;
//N2InfoContent (section 6.1.6.2.27@3GPP TS 29.518)
//message_transfer_req_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapMessageType"] = 123; //NGAP message -to be verified: doesn't exist in tester
message_transfer_req_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] = "PDU_RES_SETUP_REQ"; //NGAP message
message_transfer_req_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2SmMsg"; //part 3
//message_transfer_req_data["n2InfoContainer"]["smInfo"]["sNssai"]["sst"] = 1;
//message_transfer_req_data["n2InfoContainer"]["smInfo"]["sNssai"]["sd"] = "";
message_transfer_req_data["n2InfoContainer"]["ranInfo"] = "SM";
}
//Others information
message_transfer_req_data["ppi"] = 1;
message_transfer_req_data["pduSessionId"] = sm_context_res->res.get_pdu_session_id();
message_transfer_req_data["pduSessionId"] = context_res_msg.get_pdu_session_id();
//message_transfer_req_data["arp"]["priorityLevel"] = 1;
//message_transfer_req_data["arp"]["preemptCap"] = "NOT_PREEMPT";
//message_transfer_req_data["arp"]["preemptVuln"] = "NOT_PREEMPTABLE";
//message_transfer_req_data["5qi"] = ;
std::string json_part = message_transfer_req_data.dump();
//fill the N1SmMsg, N2SmMsg content
std::string n1_msg_hex;
smf_app_inst->convert_string_2_hex(n1_message, n1_msg_hex);
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] n1MessageContent: %s\n ", n1_msg_hex.c_str());
std::string n2_msg_hex;
if (context_res_msg.get_cause() == REQUEST_ACCEPTED){
smf_app_inst->convert_string_2_hex(n2_message, n2_msg_hex);
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] n2SMInformation %s\n ", n2_msg_hex.c_str());
}
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] Sending message to AMF....\n ");
if(curl) {
......@@ -187,10 +200,9 @@ void smf_n11::send_msg_to_amf(std::shared_ptr<itti_n11_create_sm_context_respons
curl_mime *alt;
curl_mimepart *part;
headers = curl_slist_append(headers, "charsets: utf-8");
// headers = curl_slist_append(headers, "charsets: utf-8");
headers = curl_slist_append(headers, "content-type: multipart/related");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str() );
curl_easy_setopt(curl, CURLOPT_HTTPGET,1);
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, AMF_CURL_TIMEOUT_MS);
......@@ -209,18 +221,20 @@ void smf_n11::send_msg_to_amf(std::shared_ptr<itti_n11_create_sm_context_respons
curl_mime_type(part, "application/vnd.3gpp.5gnas");
curl_mime_name (part, "n1SmMsg");
//N2 SM Information
part = curl_mime_addpart(mime);
curl_mime_data(part, n2_msg_hex.c_str(), CURL_ZERO_TERMINATED);
curl_mime_type(part, "application/vnd.3gpp.ngap");
curl_mime_name (part, "n2SmMsg");
if (sm_context_res->res.get_cause() == REQUEST_ACCEPTED) {
//N2 SM Information
part = curl_mime_addpart(mime);
//TODO:
curl_mime_data(part, n2_msg_hex.substr(0,86).c_str(), CURL_ZERO_TERMINATED); //TODO: need to be solved
curl_mime_type(part, "application/vnd.3gpp.ngap");
curl_mime_name (part, "n2SmMsg");
}
curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
res = curl_easy_perform(curl);
// Response information.
long httpCode(0);
std::unique_ptr<std::string> httpData(new std::string());
/*
// Hook up data handling function.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file smf_ngap.hpp
* \brief
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_NGAP_HPP_SEEN
#define FILE_SMF_NGAP_HPP_SEEN
#include "smf.h"
#include "3gpp_29.274.h"
#include "itti_msg_n4.hpp"
#include "itti_msg_n11.hpp"
#include "smf_context.hpp"
#include "smf_pco.hpp"
#include "SmContextCreateData.h"
#include "SmContextCreateError.h"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#include "smf_msg.hpp"
#include "smf_app.hpp"
#include "3gpp_29.502.h"
extern "C"{
#include "nas_message.h"
#include "mmData.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_PDUSessionResourceSetupResponseTransfer.h"
}
#include <map>
#include <set>
#include <shared_mutex>
#include <string>
#include <thread>
namespace smf {
class smf_ngap {
private:
public:
smf_ngap(){};
smf_ngap(smf_ngap const&) = delete;
void operator=(smf_ngap const&) = delete;
/*
* Create N1 SM Container to send to AMF (using NAS lib)
* @param [pdu_session_msg&] msg
* @param [uint8_t] msg_type Type of N1 message
* @param [std::string&] nas_msg_str store NAS message in form of string
* @param [uint8_t] sm_cause store NAS Cause
*
*/
void create_n1_sm_container(pdu_session_msg& msg, uint8_t msg_type, std::string& nas_msg_str, uint8_t sm_cause);
//for testing purpose!!
void create_n1_sm_container(uint8_t msg_type, std::string& nas_msg_str, uint8_t sm_cause = 0);
/*
* Create N2 SM Information to send to AMF (using NAS lib)
* @param [std::shared_ptr<itti_n11_create_sm_context_response>] sm_context_res
* @param [uint8_t] msg_type Type of N2 message
* @param [std::string&] ngap_msg_str store NGAP message in form of string
*
*/
void create_n2_sm_information(pdu_session_msg& msg, uint8_t ngap_msg_type, uint8_t ngap_ie_type, std::string& ngap_msg_str);
/*
* Decode N1 SM Container into the NAS mesasge (using NAS lib)
* @param [nas_message_t&] nas_msg Store NAS message after decoded
* @param [std::string&] n1_sm_msg N1 SM Container from AMF
* @return status of the decode process
*/
int decode_n1_sm_container(nas_message_t& nas_msg, std::string& n1_sm_msg);
/*
* Decode N2 SM Information (using NGAP lib)
* @param [Ngap_NGAP_PDU_t&] ngap_msg Store decoded NGAP message
* @param [std::string&] n2_sm_info N2 SM Information from AMF
* @return status of the decode process
*/
int decode_n2_sm_information(std::unique_ptr<Ngap_PDUSessionResourceSetupResponseTransfer_t>& ngap_IE, std::string& n2_sm_info, std::string& n2_sm_info_type);
};
} // namespace smf
#endif /* FILE_SMF_NGAP_HPP_SEEN */
......@@ -307,4 +307,4 @@ public:
};
#endif /* FILE_PGW_PAA_DYNAMIC_HPP_SEEN */
#endif /* FILE_SMF_PAA_DYNAMIC_HPP_SEEN */
......@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
/*! \file pgw_pco.cpp
/*! \file smf_pco.cpp
\brief
\author Lionel Gauthier
\company Eurecom
......
......@@ -38,6 +38,7 @@
#include "msg_gtpv2c.hpp"
#include "smf_app.hpp"
#include "smf_config.hpp"
#include "smf_ngap.hpp"
#include "smf_pfcp_association.hpp"
#include "smf_procedure.hpp"
#include "smf_context.hpp"
......@@ -267,8 +268,6 @@ int session_create_sm_context_procedure::run(std::shared_ptr<itti_n11_create_sm_
return RETURNok;
}
//------------------------------------------------------------------------------
void session_create_sm_context_procedure::handle_itti_msg (itti_n4_session_establishment_response& resp, std::shared_ptr<smf::smf_context> sc)
{
......@@ -315,7 +314,6 @@ void session_create_sm_context_procedure::handle_itti_msg (itti_n4_session_estab
sc.get()->get_default_qos(n11_triggered_pending->res.get_snssai(), n11_triggered_pending->res.get_dnn(), default_qos);
qfi.qfi = default_qos._5qi;
//TODO: how about pdu_session_id??
smf_qos_flow q = {};
gtpv2c::bearer_context_created_within_create_session_response bcc = {};
......@@ -347,21 +345,12 @@ void session_create_sm_context_procedure::handle_itti_msg (itti_n4_session_estab
qos_flow.set_qfi(qfi);
n11_triggered_pending->res.set_qos_flow_context(qos_flow);
//TODO: for qos bearer bearer_qos_t bearer_qos = {}; if(b.get(bearer_qos)){bcc.set(bearer_level_qos)};
//TODO
//should send information of created bearer to AMF
// set the necessary information to be sent to AMF (N1N2MessageTransfer)
//n11_triggered_pending->add_bearer_context_created(bcc);
//N1N2MessageTransferReqData
//Step 11, section 4.3.2.2.1@TS 23.502
//Namf_Communication_N1N2MessageTransfer (PDU Session ID,
// N2 SM information (PDU Session ID, QFI(s), QoS Profile(s), CN Tunnel Info, S-NSSAI from the Allowed NSSAI, Session-AMBR, PDU
//Session Type, User Plane Security Enforcement information, UE Integrity Protection Maximum Data Rate),
//N1 SM container (PDU Session Establishment Accept (QoS Rule(s) and QoS Flow level QoS parameters if needed
//for the QoS Flow(s) associated with the QoS rule(s), selected SSC mode, S-NSSAI(s), DNN, allocated IPv4
//address, interface identifier, Session-AMBR, selected PDU Session Type, Reflective QoS Timer (if available),
//P-CSCF address(es), [Always-on PDU Session])))
//send ITTI message to N11 interface to trigger N1N2MessageTransfer towards AMFs
Logger::smf_app().info( "Sending ITTI message %s to task TASK_SMF_N11", n11_triggered_pending->get_msg_name());
......
......@@ -24,9 +24,7 @@ include_directories(${SRC_TOP_DIR}/common/utils)
include_directories(${SRC_TOP_DIR}/itti)
include_directories(${SRC_TOP_DIR}/gtpv1u)
include_directories(${SRC_TOP_DIR}/gtpv2c)
include_directories(${SRC_TOP_DIR}/oai_spgwu)
include_directories(${SRC_TOP_DIR}/pfcp)
include_directories(${SRC_TOP_DIR}/spgwu)
include_directories(${SRC_TOP_DIR}/udp)
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
......
This diff is collapsed.
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