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

create multipart message (N1N2MessageTranfer) to convey Json/N1/N2 content;...

create multipart message (N1N2MessageTranfer) to convey Json/N1/N2 content; add new function to create N2 SM info
parent 028e90e8
This diff is collapsed.
......@@ -20,8 +20,10 @@
*/
/*! \file smf_app.hpp
\brief
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\date 2018
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
......
......@@ -21,10 +21,11 @@
/*! \file smf_config.cpp
\brief
\author Lionel Gauthier
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#include "3gpp_29.274.hpp"
#include "common_defs.h"
......@@ -641,9 +642,11 @@ bool smf_config::is_dotted_dnn_handled(const std::string& dnn, const pdu_session
{
Logger::smf_app().debug( "requested dnn: %s", dnn.c_str());
for (int i = 0; i < smf_cfg.num_apn; i++) {
Logger::smf_app().debug( "apn_label: %s", smf_cfg.apn[i].apn_label.c_str());
Logger::smf_app().debug( "apn_label: %s, apn: %s", smf_cfg.apn[i].apn_label.c_str(),smf_cfg.apn[i].apn.c_str() );
//if (0 == dnn.compare(smf_cfg.apn[i].apn_label)) {
if (0 == dnn.compare(smf_cfg.apn[i].apn)) {
Logger::smf_app().debug( "DNN matched! \n");
Logger::smf_app().debug( "pdu session type %d, pdn_type %d \n", pdn_session_type.pdu_session_type, smf_cfg.apn[i].pdn_type.pdn_type);
if (pdn_session_type.pdu_session_type == smf_cfg.apn[i].pdn_type.pdn_type) {
return true;
}
......
......@@ -21,9 +21,10 @@
/*! \file smf_config.hpp
* \brief
* \author Lionel Gauthier
* \company Eurecom
* \email: lionel.gauthier@eurecom.fr
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_CONFIG_HPP_SEEN
......@@ -258,12 +259,12 @@ public:
n4.port = pfcp::default_port;
n11.thread_rd_sched_params.sched_priority = 90;
n11.port = 8080;
n11.port = 80;
amf_addr.ipv4_addr.s_addr = INADDR_ANY;
amf_addr.port = 8080;
amf_addr.port = 80;
amf_addr.ipv4_addr.s_addr = INADDR_ANY;
udm_addr.port = 8080;
udm_addr.port = 80;
};
~smf_config();
......
......@@ -21,9 +21,10 @@
/*! \file smf_context.cpp
\brief
\author Lionel Gauthier
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\email: lionel.gauthier@eurecom.fr
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#include "itti.hpp"
......@@ -272,46 +273,7 @@ void smf_context::handle_itti_msg (itti_n4_session_deletion_response& sdresp)
}
//------------------------------------------------------------------------------
void smf_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)) {
pfcp::pdr_id_t pdr_id;
// Downlink Data Report
if (report_type.dldr) {
pfcp::downlink_data_report data_report;
if (req->pfcp_ies.get(data_report)) {
pfcp::pdr_id_t pdr_id;
if (data_report.get(pdr_id)) {
std::shared_ptr<smf_pdu_session> ppc = {};
ebi_t ebi;
if (find_pdu_session(pdr_id, ppc, ebi)) {
downlink_data_report_procedure* p = new downlink_data_report_procedure(req);
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
Logger::smf_app().info( "S5S8 DOWNLINK_DATA_REPORT procedure failed");
remove_procedure(p);
} else {
}
}
}
}
}
// Usage Report
if (report_type.usar) {
Logger::smf_app().debug("TODO PFCP_SESSION_REPORT_REQUEST/Usage Report");
}
// Error Indication Report
if (report_type.erir) {
Logger::smf_app().debug("TODO PFCP_SESSION_REPORT_REQUEST/Error Indication Report");
}
// User Plane Inactivity Report
if (report_type.upir) {
Logger::smf_app().debug("TODO PFCP_SESSION_REPORT_REQUEST/User Plane Inactivity Report");
}
}
*/
{
}
//------------------------------------------------------------------------------
......@@ -364,7 +326,7 @@ void smf_context::handle_amf_msg (std::shared_ptr<itti_n11_create_sm_context_req
//Step 1. get necessary information
std::string dnn = sm_context_req_msg.get_dnn();
snssai_t snssai = sm_context_req_msg.get_snssai();
request_type_t request_type = sm_context_req_msg.get_request_type();
std::string request_type = sm_context_req_msg.get_request_type();
supi_t supi = sm_context_req_msg.get_supi();
supi64_t supi64 = smf_supi_to_u64(supi);
uint32_t pdu_session_id = sm_context_req_msg.get_pdu_session_id();
......@@ -386,6 +348,7 @@ void smf_context::handle_amf_msg (std::shared_ptr<itti_n11_create_sm_context_req
itti_n11_create_sm_context_response *sm_context_resp = new itti_n11_create_sm_context_response(TASK_SMF_APP, TASK_SMF_N11, smreq->http_response);
std::shared_ptr<itti_n11_create_sm_context_response> sm_context_resp_pending = std::shared_ptr<itti_n11_create_sm_context_response>(sm_context_resp);
sm_context_resp->res.set_supi(supi);
sm_context_resp->res.set_supi_prefix(sm_context_req_msg.get_supi_prefix());
sm_context_resp->res.set_cause(REQUEST_ACCEPTED);
sm_context_resp->res.set_pdu_session_id(pdu_session_id);
sm_context_resp->res.set_snssai(snssai);
......@@ -543,15 +506,16 @@ void smf_context::handle_amf_msg (std::shared_ptr<itti_n11_create_sm_context_req
to_json(jsonData, smContextCreatedData);
std::string resBody = jsonData.dump();
std::string smContextRef = sm_context_req_msg.get_supi_prefix() + "-" + smf_supi_to_string(sm_context_req_msg.get_supi());
//headers: Location:
//Contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmf-pdusession/{apiVersion}/sm-contexts/{smContextRef}
std::string uri = sm_context_req_msg.get_api_root() + std::to_string(smreq->scid); //smContextRef
//std::string uri = sm_context_req_msg.get_api_root() + "/" + std::to_string(smreq->scid); //smContextRef
std::string uri = sm_context_req_msg.get_api_root() + "/" + smContextRef.c_str(); //smContextRef
sm_context_resp->http_response.headers().add<Pistache::Http::Header::Location>(uri);
sm_context_resp->http_response.send(Pistache::Http::Code::Created, resBody);
Logger::smf_app().info( "Create a procedure to process this message!");
session_create_sm_context_procedure* proc = new session_create_sm_context_procedure(sp);
std::shared_ptr<smf_procedure> sproc = std::shared_ptr<smf_procedure>(proc);
......@@ -560,6 +524,8 @@ void smf_context::handle_amf_msg (std::shared_ptr<itti_n11_create_sm_context_req
// error !
Logger::smf_app().info( "PDU SESSION CREATE SM CONTEXT REQUEST procedure failed");
remove_procedure(proc);
//TODO: [Verify] To send PDU Session Establishment Reject to AMF
}
}else{ //if request is rejected
......
......@@ -21,9 +21,10 @@
/*! \file smf_context.hpp
\brief
\author Lionel Gauthier
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\email: lionel.gauthier@eurecom.fr
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_CONTEXT_HPP_SEEN
#define FILE_SMF_CONTEXT_HPP_SEEN
......
......@@ -19,11 +19,12 @@
* contact@openairinterface.org
*/
/*! \file smf_msg.hpp
/*! \file smf_msg.cpp
\brief
\author
\author Tien-Thinh NGUYEN
\company Eurecom
\email:
\date 2019
\email: tien-thinh.nguyen@eurecom.fr
*/
#include "smf_msg.hpp"
......@@ -55,6 +56,20 @@ void pdu_session_msg::set_supi(supi_t const& supi)
m_supi = supi;
}
//-----------------------------------------------------------------------------
std::string pdu_session_msg::get_supi_prefix() const
{
return m_supi_prefix;
}
//-----------------------------------------------------------------------------
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
{
......@@ -115,13 +130,13 @@ void pdu_session_create_sm_context_request::set_serving_nf_id(std::string const&
}
//-----------------------------------------------------------------------------
request_type_t pdu_session_create_sm_context_request::get_request_type() const
std::string pdu_session_create_sm_context_request::get_request_type() const
{
return m_request_type;
}
//-----------------------------------------------------------------------------
void pdu_session_create_sm_context_request::set_request_type(request_type_t const& request_type)
void pdu_session_create_sm_context_request::set_request_type(std::string const& request_type)
{
m_request_type = request_type;
}
......
......@@ -21,9 +21,10 @@
/*! \file smf_msg.hpp
\brief
\author
\author Tien-Thinh NGUYEN
\company Eurecom
\email:
\date 2019
\email: tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_MSG_HPP_SEEN
#define FILE_SMF_MSG_HPP_SEEN
......@@ -60,6 +61,9 @@ public:
supi_t get_supi() const;
void set_supi(supi_t const& value);
std::string get_supi_prefix() const;
void set_supi_prefix(std::string const& value);
pdu_session_id_t get_pdu_session_id() const;
void set_pdu_session_id(pdu_session_id_t const value);
......@@ -75,6 +79,7 @@ public:
private:
std::string m_api_root;
supi_t m_supi;
std::string m_supi_prefix;
pdu_session_id_t m_pdu_session_id;
std::string m_dnn;
snssai_t m_snssai;
......@@ -221,8 +226,8 @@ public:
std::string get_serving_nf_id() const;
void set_serving_nf_id(std::string const& value);
request_type_t get_request_type() const;
void set_request_type(request_type_t const& value);
std::string get_request_type() const;
void set_request_type(std::string const& value);
void set_dnn_selection_mode(std::string const& value);
std::string get_dnn_selection_mode() const;
......@@ -252,7 +257,7 @@ private:
//Guami m_Guami;
//std::string m_ServiceName;
//PlmnId m_ServingNetwork;
request_type_t m_request_type;
std::string m_request_type;
//RefToBinaryData m_N1SmMsg;
std::string m_an_type;
//std::string m_SecondAnType;
......
......@@ -21,9 +21,10 @@
/*! \file smf_n10.cpp
\brief
\author
\author Tien-Thinh NGUYEN
\company Eurecom
\email:
\date 2019
\email: tien-thinh.nguyen@eurecom.fr
*/
#include "smf.h"
......
......@@ -20,9 +20,10 @@
*/
/*! \file smf_n10.hpp
\author
\date 2019
\email:
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_N10_HPP_SEEN
......
......@@ -21,9 +21,10 @@
/*! \file smf_n11.cpp
\brief
\author
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\email:
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#include "smf.h"
......@@ -112,101 +113,148 @@ smf_n11::smf_n11 ()
Logger::smf_n11().startup( "Started" );
}
//------------------------------------------------------------------------------
void smf_n11::send_msg_to_amf(std::shared_ptr<itti_n11_create_sm_context_response> sm_context_res)
{
//Transfer N1/N2 message via AMF by using N_amf_Communication_N1N2MessageTransfer (see TS29518_Namf_Communication.yaml)
//use curl to send data for the moment
nlohmann::json jsonData;
nlohmann::json message_transfer_req_data;
std::string n1_message;
curl_global_init(CURL_GLOBAL_DEFAULT);
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "charsets: utf-8");
//Curl multipart
CURL *curl = curl_easy_init();
supi64_t supi64 = smf_supi_to_u64(sm_context_res->res.get_supi());
//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);
CURL *curl = curl_easy_init();
//hardcoded for the moment, should get from NRF/configuration file
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/" + std::to_string(supi64) +"/n1-n2-messages";
Logger::smf_n11().debug("[Send Communication_N1N2MessageTransfer to AMF] AMF's URL: %s ", url.c_str());
//N1 SM container
if (sm_context_res->res.get_cause() != REQUEST_ACCEPTED) { //PDU Session Establishment Reject
Logger::smf_n11().debug("[Send Communication_N1N2MessageTransfer to AMF] 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
Logger::smf_n11().debug("[Send Communication_N1N2MessageTransfer to AMF] PDU Session Establishment Accept \n");
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
//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
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?
}
//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());
jsonData["n1MessageContainer"]["n1MessageClass"] = "SM";
jsonData["n1MessageContainer"]["n1MessageContent"]["contentId"] = n1_msg_hex;
Logger::smf_n11().debug("n1MessageContent: %s\n ", n1_msg_hex.c_str());
//TODO: fill the content of N1N2MessageTransferReqData
//jsonData["n2InfoContainer"]["n2InformationClass"] = "SM";
//jsonData["n2InfoContainer"]["smInfo"]["PduSessionId"] = 123;
//jsonData["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapMessageType"] = 123; //NGAP message
//jsonData["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] = "PDU_RES_SETUP_REQ"; //NGAP message
//jsonData["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "NGAP DATA"; //NGAP message
//jsonData["n2InfoContainer"]["ranInfo"] = "SM";
jsonData["ppi"] = 1;
jsonData["pduSessionId"] = sm_context_res->res.get_pdu_session_id();
//jsonData["arp"]["priorityLevel"] = 1;
//jsonData["arp"]["preemptCap"] = "NOT_PREEMPT";
//jsonData["arp"]["preemptVuln"] = "NOT_PREEMPTABLE";
std::string body = jsonData.dump();
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());
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";
message_transfer_req_data["ppi"] = 1;
message_transfer_req_data["pduSessionId"] = sm_context_res->res.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";
std::string json_part = message_transfer_req_data.dump();
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] Sending message to AMF....\n ");
if(curl) {
CURLcode res;
CURLcode res;
struct curl_slist *headers = NULL;
struct curl_slist *slist = NULL;
curl_mime *mime;
curl_mime *alt;
curl_mimepart *part;
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);
mime = curl_mime_init(curl);
alt = curl_mime_init(curl);
//part with N1N2MessageTransferReqData (JsonData)
part = curl_mime_addpart(mime);
curl_mime_data(part, json_part.c_str(), CURL_ZERO_TERMINATED);
curl_mime_type(part, "application/json");
//N1 SM Container
part = curl_mime_addpart(mime);
curl_mime_data(part, n1_msg_hex.c_str(), CURL_ZERO_TERMINATED);
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");
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());
std::unique_ptr<std::string> httpData(new std::string());
/*
// Hook up data handling function.
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &callback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, httpData.get());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)body.length());
*/
int numRetries = 0;
while (numRetries < AMF_NUMBER_RETRIES){
res = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpCode);
Logger::smf_n11().debug("[send_msg_to_amf] Response from AMF, Http Code: %d ", httpCode);
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] Response from AMF, Http Code: %d ", httpCode);
if (httpCode == HTTP_STATUS_OK)
{
Logger::smf_n11().debug("[send_msg_to_amf] Got successful response from AMF, URL: %s ", url.c_str());
Logger::smf_n11().debug("[SMF N11: N1N2MessageTransfer] Got successful response from AMF, URL: %s ", url.c_str());
break;
}
else
{
Logger::smf_n10().warn("[send_msg_to_amf] Couldn't GET response from AMF, URL %s, retry ...", url.c_str());
Logger::smf_n10().warn("[SMF N11: N1N2MessageTransfer] Couldn't GET response from AMF, URL %s, retry ...", url.c_str());
//retry
numRetries++;
}
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_mime_free(mime);
}
//TODO: process the response if necessary
}
......
......@@ -20,9 +20,10 @@
*/
/*! \file smf_n11.hpp
\author
\date 2019
\email:
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_N11_HPP_SEEN
......
......@@ -21,9 +21,10 @@
/*! \file smf_n4.cpp
\brief
\author Lionel Gauthier
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\email: lionel.gauthier@eurecom.fr
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#include "common_defs.h"
......
......@@ -20,9 +20,10 @@
*/
/*! \file smf_n4.hpp
\author Lionel GAUTHIER
\date 2019
\email: lionel.gauthier@eurecom.fr
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_N4_HPP_SEEN
......
......@@ -19,6 +19,14 @@
* contact@openairinterface.org
*/
/*! \file smf_procedure.cpp
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#include "3gpp_29.244.h"
#include "3gpp_29.274.h"
#include "common_defs.h"
......@@ -81,6 +89,7 @@ int sx_session_restore_procedure::run()
int session_create_sm_context_procedure::run(std::shared_ptr<itti_n11_create_sm_context_request> sm_context_req, std::shared_ptr<itti_n11_create_sm_context_response> sm_context_resp, std::shared_ptr<smf::smf_context> pc)
{
Logger::smf_app().info("[SMF Procedure] Create SM Context Request");
// TODO check if compatible with ongoing procedures if any
pfcp::node_id_t up_node_id = {};
if (not pfcp_associations::get_instance().select_up_node(up_node_id, NODE_SELECTION_CRITERIA_MIN_PFCP_SESSIONS)) {
......
......@@ -18,16 +18,17 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef FILE_SMF_PROCEDURE_HPP_SEEN
#define FILE_SMF_PROCEDURE_HPP_SEEN
/*! \file smf_procedure.hpp
\brief
\author Lionel Gauthier
\author Lionel GAUTHIER, Tien-Thinh NGUYEN
\company Eurecom
\email: lionel.gauthier@eurecom.fr
\date 2019
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_SMF_PROCEDURE_HPP_SEEN
#define FILE_SMF_PROCEDURE_HPP_SEEN
#include "3gpp_29.244.hpp"
#include "3gpp_29.274.hpp"
#include "itti_msg_n11.hpp"
......
This diff is collapsed.
#ifndef MULTIPARTPARSER_H
#define MULTIPARTPARSER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
typedef struct multipartparser multipartparser;
typedef struct multipartparser_callbacks multipartparser_callbacks;
typedef int (*multipart_cb) (multipartparser*);
typedef int (*multipart_data_cb) (multipartparser*, const char* data, size_t size);
struct multipartparser {
/** PRIVATE **/
char boundary[70];
int boundary_length;
int index;
uint16_t state;
/** PUBLIC **/
void* data;
};
struct multipartparser_callbacks {
multipart_cb on_body_begin;
multipart_cb on_part_begin;
multipart_data_cb on_header_field;
multipart_data_cb on_header_value;
multipart_cb on_headers_complete;
multipart_data_cb on_data;
multipart_cb on_part_end;
multipart_cb on_body_end;
};
void multipartparser_init(multipartparser* parser, const char* boundary);
void multipartparser_callbacks_init(multipartparser_callbacks* callbacks);
size_t multipartparser_execute(multipartparser* parser,
multipartparser_callbacks* callbacks,
const char* data,
size_t size);
#ifdef __cplusplus
}
#endif
#endif // MULTIPARTPARSER_H
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