Commit 1b881e3a authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

correct order of includes header files

parent 76826d58
......@@ -28,39 +28,40 @@
*/
#include "smf_app.hpp"
#include <stdexcept>
#include <iostream>
#include <cstdlib>
#include "async_shell_cmd.hpp"
#include "common_defs.h"
#include "conversions.hpp"
#include "itti.hpp"
#include "logger.hpp"
#include "smf_paa_dynamic.hpp"
#include "smf_n4.hpp"
#include "smf_n10.hpp"
#include "smf_n11.hpp"
#include "string.hpp"
#include "3gpp_29.502.h"
#include "3gpp_24.007.h"
#include "smf.h"
#include "3gpp_24.501.h"
#include "smf_n1_n2.hpp"
#include "smf_paa_dynamic.hpp"
#include "smf_n4.hpp"
#include "smf_n10.hpp"
#include "smf_n11.hpp"
#include "pfcp.hpp"
#include "itti_msg_nx.hpp"
#include "SmContextCreatedData.h"
#include "RefToBinaryData.h"
#include "SmContextCreateError.h"
#include "SmContextUpdateError.h"
#include "SmContextMessage.h"
#include "ProblemDetails.h"
#include "smf_n1_n2.hpp"
#include "SmContextCreatedData.h"
#include "pfcp.hpp"
#include "itti_msg_nx.hpp"
extern "C"{
#include "nas_message.h"
#include "mmData.h"
}
#include <stdexcept>
#include <iostream>
#include <cstdlib>
#define BUF_LEN 512
using namespace smf;
......@@ -404,7 +405,7 @@ void smf_app::handle_itti_msg (itti_n11_n1n2_message_transfer_response_status& m
//Update PDU Session accordingly
//TODO: to be completed (process cause)
pdu_session_status_e status;
if (static_cast<http_response_codes_e> (m.response_code) == http_response_codes_e::HTTP_RESPONSE_CODE_OK)
if ((static_cast<http_response_codes_e> (m.response_code) == http_response_codes_e::HTTP_RESPONSE_CODE_OK) or (static_cast<http_response_codes_e> (m.response_code) == http_response_codes_e::HTTP_RESPONSE_CODE_ACCEPTED))
{
if (m.msg_type == PDU_SESSION_ESTABLISHMENT_REJECT){
status = pdu_session_status_e::PDU_SESSION_INACTIVE;
......@@ -413,13 +414,10 @@ void smf_app::handle_itti_msg (itti_n11_n1n2_message_transfer_response_status& m
}
update_pdu_session_status(m.scid, status);
Logger::smf_app().debug("Got successful response from AMF (Response code %d), set session status to %s", m.response_code, pdu_session_status_e2str[static_cast<int>(status)].c_str());
}
else if (static_cast<http_response_codes_e> (m.response_code) == http_response_codes_e::HTTP_RESPONSE_CODE_ACCEPTED){
else {
//TODO:
Logger::smf_app().debug("Got successful response from AMF (Response code %d), set session status to ACTIVE", m.response_code);
} else{ //by default
//TODO
Logger::smf_app().debug("Got response from AMF (Response code %d)", m.response_code);
}
}
......@@ -481,6 +479,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(std::shared_ptr<itti_
smreq->req.set_pdu_session_type(PDU_SESSION_TYPE_E_IPV4); //set default value
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
Logger::smf_app().debug("NAS, pdu_session_type %d", decoded_nas_msg.plain.sm.pdu_session_establishment_request._pdusessiontype.pdu_session_type_value);
//sm_context_req_msg.set_pdu_session_type(decoded_nas_msg.plain.sm.pdu_session_establishment_request._pdusessiontype.pdu_session_type_value);
}
......
......@@ -30,6 +30,15 @@
#ifndef FILE_SMF_APP_HPP_SEEN
#define FILE_SMF_APP_HPP_SEEN
#include <map>
#include <set>
#include <shared_mutex>
#include <string>
#include <thread>
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#include "smf.h"
#include "3gpp_29.274.h"
#include "3gpp_29.502.h"
......@@ -37,20 +46,11 @@
#include "itti_msg_n11.hpp"
#include "smf_context.hpp"
#include "smf_pco.hpp"
#include "smf_msg.hpp"
#include "SmContextCreateData.h"
#include "SmContextUpdateData.h"
#include "SmContextCreateError.h"
#include "SmContextUpdateError.h"
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#include "smf_msg.hpp"
#include <map>
#include <set>
#include <shared_mutex>
#include <string>
#include <thread>
namespace smf {
......
......@@ -27,26 +27,12 @@
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#include "3gpp_29.274.hpp"
#include "common_defs.h"
#include "epc.h"
#include "if.hpp"
#include "logger.hpp"
#include "smf_app.hpp"
#include "smf_config.hpp"
#include "string.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <cstdlib>
#include <iomanip>
#include <iostream>
using namespace std;
using namespace libconfig;
using namespace smf;
#include "string.hpp"
// C includes
#include <arpa/inet.h>
......@@ -56,6 +42,20 @@ using namespace smf;
#include <sys/types.h>
#include <unistd.h>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include "3gpp_29.274.hpp"
#include "common_defs.h"
#include "epc.h"
#include "if.hpp"
#include "logger.hpp"
#include "smf_app.hpp"
using namespace std;
using namespace libconfig;
using namespace smf;
extern smf_app *smf_app_inst;
extern smf_config smf_cfg;
......
......@@ -30,14 +30,6 @@
#ifndef FILE_SMF_CONFIG_HPP_SEEN
#define FILE_SMF_CONFIG_HPP_SEEN
#include "3gpp_29.244.h"
#include "3gpp_29.274.h"
#include "gtpv2c.hpp"
#include "pfcp.hpp"
#include "thread_sched.hpp"
#include "smf.h"
#include <arpa/inet.h>
#include <libconfig.h++>
#include <netinet/in.h>
......@@ -45,6 +37,13 @@
#include <mutex>
#include <vector>
#include "thread_sched.hpp"
#include "3gpp_29.244.h"
#include "3gpp_29.274.h"
#include "gtpv2c.hpp"
#include "pfcp.hpp"
#include "smf.h"
#define SMF_CONFIG_STRING_SMF_CONFIG "SMF"
......
......@@ -27,16 +27,17 @@
\email: tien-thinh.nguyen@eurecom.fr
*/
#include "smf_n10.hpp"
#include <stdexcept>
#include <curl/curl.h>
#include <nlohmann/json.hpp>
#include "smf.h"
#include "common_defs.h"
#include "itti.hpp"
#include "logger.hpp"
#include "smf_n10.hpp"
#include "smf_config.hpp"
#include <curl/curl.h>
#include <nlohmann/json.hpp>
#include <stdexcept>
#define UDM_CURL_TIMEOUT_MS 100L
#define UDM_NUMBER_RETRIES 3
......@@ -222,6 +223,7 @@ bool smf_n10::get_sm_data(supi64_t& supi, std::string& dnn, snssai_t& snssai, st
dnn_configuration->_5g_qos_profile.arp.priority_level = it.value()["5gQosProfile"]["arp"]["priorityLevel"];
dnn_configuration->_5g_qos_profile.arp.preempt_cap = it.value()["5gQosProfile"]["arp"]["preemptCap"];
dnn_configuration->_5g_qos_profile.arp.preempt_vuln = it.value()["5gQosProfile"]["arp"]["preemptVuln"];
dnn_configuration->_5g_qos_profile.priority_level = 1; //TODO: hardcoded
//session_ambr
dnn_configuration->session_ambr.uplink = it.value()["sessionAmbr"]["uplink"];
......
......@@ -29,11 +29,12 @@
#ifndef FILE_SMF_N10_HPP_SEEN
#define FILE_SMF_N10_HPP_SEEN
#include <thread>
#include <map>
#include "smf.h"
#include "3gpp_29.503.h"
#include "smf_context.hpp"
#include <thread>
#include <map>
namespace smf {
......
......@@ -30,26 +30,27 @@
#ifndef FILE_SMF_N1_N2_HPP_SEEN
#define FILE_SMF_N1_N2_HPP_SEEN
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#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"
#include "SmContextCreateData.h"
#include "SmContextCreateError.h"
extern "C"{
#include "nas_message.h"
#include "mmData.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_PDUSessionResourceSetupResponseTransfer.h"
#include "Ngap_PDUSessionResourceModifyResponseTransfer.h"
}
#include <map>
......@@ -96,13 +97,20 @@ public:
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
* Decode N2 SM Information Ngap_PDUSessionResourceSetupResponseTransfer
* @param [std::shared_ptr<Ngap_PDUSessionResourceSetupResponseTransfer_t>&] ngap_IE Store decoded NGAP message
* @param [std::string&] n2_sm_info N2 SM Information
* @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);
int decode_n2_sm_information(std::shared_ptr<Ngap_PDUSessionResourceSetupResponseTransfer_t>& ngap_IE, std::string& n2_sm_info);
/*
* Decode N2 SM Information Ngap_PDUSessionResourceModifyResponseTransfer_t
* @param [std::shared_ptr<Ngap_PDUSessionResourceModifyResponseTransfer_t>&] ngap_IE Store decoded NGAP message
* @param [std::string&] n2_sm_info N2 SM Information
* @return status of the decode process
*/
int decode_n2_sm_information(std::shared_ptr<Ngap_PDUSessionResourceModifyResponseTransfer_t>& ngap_IE, std::string& n2_sm_info);
};
......
......@@ -27,16 +27,17 @@
\email: lionel.gauthier@eurecom.fr, tien-thinh.nguyen@eurecom.fr
*/
#include "common_defs.h"
#include "itti.hpp"
#include "logger.hpp"
#include "smf_config.hpp"
#include "smf_n4.hpp"
#include <chrono>
#include <ctime>
#include <stdexcept>
#include "common_defs.h"
#include "itti.hpp"
#include "logger.hpp"
#include "smf_config.hpp"
using namespace pfcp;
using namespace smf;
using namespace std;
......
......@@ -29,19 +29,19 @@
#ifndef FILE_SMF_N4_HPP_SEEN
#define FILE_SMF_N4_HPP_SEEN
#include <thread>
#include "itti_msg_n4.hpp"
#include "pfcp.hpp"
#include "smf_pfcp_association.hpp"
#include <thread>
namespace smf {
#define TASK_SMF_N4_TRIGGER_HEARTBEAT_REQUEST (0)
#define TASK_SMF_N4_TIMEOUT_HEARTBEAT_REQUEST (1)
#define TASK_SMF_N4_TIMEOUT_ASSOCIATION_REQUEST (2)
class smf_n4 : public pfcp::pfcp_l4_stack {
class smf_n4 : public pfcp::pfcp_l4_stack {
private:
std::thread::id thread_id;
std::thread thread;
......
......@@ -29,11 +29,11 @@
#ifndef FILE_SMF_PAA_DYNAMIC_HPP_SEEN
#define FILE_SMF_PAA_DYNAMIC_HPP_SEEN
#include "logger.hpp"
#include <map>
#include <bitset>
#include "logger.hpp"
class ipv6_pool {
public:
struct in6_addr prefix;
......
......@@ -26,15 +26,15 @@
\email: lionel.gauthier@eurecom.fr
*/
#include "smf_pco.hpp"
#include "common_defs.h"
#include "3gpp_24.008.h"
#include "rfc_1332.h"
#include "rfc_1877.h"
#include "logger.hpp"
#include "smf_app.hpp"
#include "smf_config.hpp"
#include "smf_pco.hpp"
using namespace smf;
......
......@@ -25,9 +25,11 @@
\date 2019
\email: lionel.gauthier@eurecom.fr
*/
#include "smf_pfcp_association.hpp"
#include "common_defs.h"
#include "logger.hpp"
#include "smf_pfcp_association.hpp"
#include "smf_procedure.hpp"
#include "smf_n4.hpp"
......
......@@ -28,14 +28,14 @@
#ifndef FILE_SMF_PFCP_ASSOCIATION_HPP_SEEN
#define FILE_SMF_PFCP_ASSOCIATION_HPP_SEEN
#include "3gpp_29.244.h"
#include "itti.hpp"
#include <folly/AtomicHashMap.h>
#include <folly/AtomicLinkedList.h>
#include <mutex>
#include <vector>
#include "3gpp_29.244.h"
#include "itti.hpp"
namespace smf {
#define PFCP_ASSOCIATION_HEARTBEAT_INTERVAL_SEC 10
......
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