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

code cleanup/bug fixes for SMF testing

parent 59a46d6e
...@@ -19,8 +19,6 @@ openair-cn5g-smf ...@@ -19,8 +19,6 @@ openair-cn5g-smf
├── common: Common header files ├── common: Common header files
│   ├── msg: ITTI messages definitions. │   ├── msg: ITTI messages definitions.
│   └── utils: Common utilities. │   └── utils: Common utilities.
├── gtpv1u: Generic GTPV1-U stack implementation.
├── gtpv2c: Generic GTPV2-C stack implementation.
├── itti: Inter task interface. ├── itti: Inter task interface.
├── nas: NAS protocol implememtation. ├── nas: NAS protocol implememtation.
├── ngap: NGAP protocol implememtation. ├── ngap: NGAP protocol implememtation.
......
...@@ -38,8 +38,7 @@ ...@@ -38,8 +38,7 @@
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
extern const char *interface_type2char[]; //extern const char *interface_type2char[];
namespace gtpv2c { namespace gtpv2c {
struct gtpc_exception : public std::exception { struct gtpc_exception : public std::exception {
...@@ -1337,6 +1336,49 @@ struct interface_type_s { ...@@ -1337,6 +1336,49 @@ struct interface_type_s {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::string toString() const { std::string toString() const {
const char* interface_type2char[40] = {
"S1_U_ENODEB_GTP_U",
"S1_U_SGW_GTP_U",
"S12_RNC_GTP_U",
"S12_SGW_GTP_U",
"S5_S8_SGW_GTP_U",
"S5_S8_PGW_GTP_U",
"S5_S8_SGW_GTP_C",
"S5_S8_PGW_GTP_C",
"S5_S8_SGW_PMIPv6",
"S5_S8_PGW_PMIPv6",
"S11_MME_GTP_C",
"S11_S4_SGW_GTP_C",
"S10_MME_GTP_C",
"S3_MME_GTP_C",
"S3_SGSN_GTP_C",
"S4_SGSN_GTP_U",
"S4_SGW_GTP_U",
"S4_SGSN_GTP_C",
"S16_SGSN_GTP_C",
"ENODEB_GTP_U_DL_DATA_FORWARDING",
"ENODEB_GTP_U_UL_DATA_FORWARDING",
"RNC_GTP_U_DATA_FORWARDING",
"SGSN_GTP_U_DATA_FORWARDING",
"SGW_UPF_GTP_U_DL_DATA_FORWARDING",
"SM_MBMS_GW_GTP_C",
"SN_MBMS_GW_GTP_C",
"SM_MME_GTP_C",
"SN_SGSN_GTP_C",
"SGW_GTP_U_UL_DATA_FORWARDING",
"SN_SGSN_GTP_U",
"S2B_EPDG_GTP_C",
"S2B_U_EPDG_GTP_U",
"S2B_PGW_GTP_C",
"S2B_U_PGW_GTP_U",
"S2A_TWAN_GTP_U",
"S2A_TWAN_GTP_C",
"S2A_PGW_GTP_C",
"S2A_PGW_GTP_U",
"S11_MME_GTP_U",
"S11_SGW_GTP_U"};
if ((interface_type >= INTERFACE_TYPE_MIN) if ((interface_type >= INTERFACE_TYPE_MIN)
&& (interface_type <= INTERFACE_TYPE_MAX)) { && (interface_type <= INTERFACE_TYPE_MAX)) {
return std::string(interface_type2char[interface_type]); return std::string(interface_type2char[interface_type]);
......
...@@ -56,8 +56,6 @@ void Logger::_init(const char *app, const bool log_stdout, ...@@ -56,8 +56,6 @@ void Logger::_init(const char *app, const bool log_stdout,
ss << "[%Y-%m-%dT%H:%M:%S.%f] [" << app << "] [%n] [%l] %v"; ss << "[%Y-%m-%dT%H:%M:%S.%f] [" << app << "] [%n] [%l] %v";
m_async_cmd = new _Logger("async_c ", m_sinks, ss.str().c_str()); m_async_cmd = new _Logger("async_c ", m_sinks, ss.str().c_str());
m_gtpv1_u = new _Logger("gtpv1_u ", m_sinks, ss.str().c_str());
m_gtpv2_c = new _Logger("gtpv2_c ", m_sinks, ss.str().c_str());
m_itti = new _Logger("itti ", m_sinks, ss.str().c_str()); m_itti = new _Logger("itti ", m_sinks, ss.str().c_str());
m_smf_app = new _Logger("smf_app ", m_sinks, ss.str().c_str()); m_smf_app = new _Logger("smf_app ", m_sinks, ss.str().c_str());
m_system = new _Logger("system ", m_sinks, ss.str().c_str()); m_system = new _Logger("system ", m_sinks, ss.str().c_str());
......
...@@ -89,12 +89,6 @@ class Logger { ...@@ -89,12 +89,6 @@ class Logger {
static _Logger& async_cmd() { static _Logger& async_cmd() {
return *singleton().m_async_cmd; return *singleton().m_async_cmd;
} }
static _Logger& gtpv1_u() {
return *singleton().m_gtpv1_u;
}
static _Logger& gtpv2_c() {
return *singleton().m_gtpv2_c;
}
static _Logger& itti() { static _Logger& itti() {
return *singleton().m_itti; return *singleton().m_itti;
} }
...@@ -146,8 +140,6 @@ class Logger { ...@@ -146,8 +140,6 @@ class Logger {
std::string m_pattern; std::string m_pattern;
_Logger *m_async_cmd; _Logger *m_async_cmd;
_Logger *m_gtpv1_u;
_Logger *m_gtpv2_c;
_Logger *m_itti; _Logger *m_itti;
_Logger *m_smf_app; _Logger *m_smf_app;
_Logger *m_system; _Logger *m_system;
......
This diff is collapsed.
This diff is collapsed.
################################################################################
# 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
################################################################################
add_library(GTPV2C STATIC
3gpp_29.274.cpp
gtpv2c.cpp
)
include_directories(${SRC_TOP_DIR}/common)
include_directories(${SRC_TOP_DIR}/common/msg)
include_directories(${SRC_TOP_DIR}/common/utils)
include_directories(${SRC_TOP_DIR}/gtpv2c)
include_directories(${SRC_TOP_DIR}/itti)
include_directories(${SRC_TOP_DIR}/udp)
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
This diff is collapsed.
/*
* 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 gtpv2c.hpp
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_GTPV2C_HPP_SEEN
#define FILE_GTPV2C_HPP_SEEN
#include "3gpp_29.274.hpp"
#include "endpoint.hpp"
#include "itti.hpp"
#include "udp.hpp"
#include "uint_generator.hpp"
#include <iostream>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "msg_gtpv2c.hpp"
namespace gtpv2c {
static const uint16_t default_port = 2123;
class gtpv2c_procedure {
public:
std::shared_ptr<gtpv2c_msg> retry_msg;
endpoint remote_endpoint;
teid_t local_teid; // for peer not responding
timer_id_t retry_timer_id;
timer_id_t proc_cleanup_timer_id;
uint64_t gtpc_tx_id;
uint8_t initial_msg_type; // sent or received
uint8_t triggered_msg_type; // sent or received
uint8_t retry_count;
// Could add customized N3, and customized T3:
// T3-RESPONSE timer and N3-REQUESTS counter setting is implementation
// dependent. That is, the timers and counters may be configurable per procedure. Multileg communications (e.g. Create
// Session Requests and Responses) however require longer timer values and possibly a higher number of retransmission
// attempts compared to single leg communication.
gtpv2c_procedure() :
retry_msg(),
remote_endpoint(),
local_teid(0),
retry_timer_id(0),
proc_cleanup_timer_id(0),
gtpc_tx_id(0),
initial_msg_type(0),
triggered_msg_type(0),
retry_count(0) {}
gtpv2c_procedure(const gtpv2c_procedure& p) :
retry_msg(p.retry_msg),
remote_endpoint(p.remote_endpoint),
local_teid(p.local_teid),
retry_timer_id(p.retry_timer_id),
proc_cleanup_timer_id(p.proc_cleanup_timer_id),
gtpc_tx_id(p.gtpc_tx_id),
initial_msg_type(p.initial_msg_type),
triggered_msg_type(p.triggered_msg_type),
retry_count(p.retry_count) {}
};
enum gtpv2c_transaction_action {
DELETE_TX = 0,
CONTINUE_TX
};
class gtpv2c_stack : public udp_application {
#define GTPV2C_T3_RESPONSE_MS 1000
#define GTPV2C_N3_REQUESTS 3
#define GTPV2C_PROC_TIME_OUT_MS ((GTPV2C_T3_RESPONSE_MS) * (GTPV2C_N3_REQUESTS + 1) + 1000)
protected:
uint32_t id;
udp_server udp_s;
udp_server udp_s_allocated;
// seems no need for atomic
uint32_t seq_num;
std::mutex m_seq_num;
uint32_t restart_counter;
std::map<uint64_t, uint32_t> gtpc_tx_id2seq_num;
std::map<timer_id_t, uint32_t> proc_cleanup_timers;
std::map<timer_id_t, uint32_t> msg_out_retry_timers;
std::map<uint32_t , gtpv2c_procedure> pending_procedures;
static const char* msg_type2cstr[256];
uint32_t get_next_seq_num();
static uint64_t generate_gtpc_tx_id() {
return util::uint_uid_generator<uint64_t>::get_instance().get_uid();
}
static bool check_initial_message_type(const uint8_t initial);
static bool check_triggered_message_type(const uint8_t initial, const uint8_t triggered);
void start_proc_cleanup_timer(gtpv2c_procedure& p, uint32_t time_out_milli_seconds, const task_id_t& task_id, const uint32_t& seq_num);
void start_msg_retry_timer(gtpv2c_procedure& p, uint32_t time_out_milli_seconds, const task_id_t& task_id, const uint32_t& seq_num);
void stop_msg_retry_timer(gtpv2c_procedure& p);
void stop_msg_retry_timer(timer_id_t& t);
void stop_proc_cleanup_timer(gtpv2c_procedure& p);
void notify_ul_error(const gtpv2c_procedure& p, const cause_value_e cause);
public:
static const uint8_t version = 2;
gtpv2c_stack(const std::string& ip_address, const unsigned short port_num, const util::thread_sched_params& sched_param);
virtual void handle_receive(char* recv_buffer, const std::size_t bytes_transferred, const endpoint& r_endpoint);
virtual void notify_ul_error(const endpoint& r_endpoint, const teid_t l_teid, const cause_value_e cause, const uint64_t gtpc_tx_id);
void handle_receive_message_cb(const gtpv2c_msg& msg, const endpoint& r_endpoint, const task_id_t& task_id, bool& error, uint64_t& gtpc_tx_id);
// Path mangement messages
virtual uint32_t send_initial_message(const endpoint& r_endpoint, const gtpv2c_echo_request& gtp_ies, const task_id_t& task_id, const uint64_t gtp_tx_id);
virtual void send_triggered_message(const endpoint& r_endpoint, const gtpv2c_echo_response& gtp_ies, const uint64_t gtp_tx_id, const gtpv2c_transaction_action& a = DELETE_TX);
// Tunnel management messages
virtual uint32_t send_initial_message(const endpoint& r_endpoint, const teid_t r_teid, const teid_t l_teid, const gtpv2c_create_session_request& gtp_ies, const task_id_t& task_id, const uint64_t gtp_tx_id);
virtual uint32_t send_initial_message(const endpoint& r_endpoint, const teid_t r_teid, const teid_t l_teid, const gtpv2c_delete_session_request& gtp_ies, const task_id_t& task_id, const uint64_t gtp_tx_id);
virtual uint32_t send_initial_message(const endpoint& r_endpoint, const teid_t r_teid, const teid_t l_teid, const gtpv2c_modify_bearer_request& gtp_ies, const task_id_t& task_id, const uint64_t gtp_tx_id);
virtual uint32_t send_initial_message(const endpoint& r_endpoint, const teid_t r_teid, const teid_t l_teid, const gtpv2c_release_access_bearers_request& gtp_ies, const task_id_t& task_id, const uint64_t gtp_tx_id);
virtual uint32_t send_initial_message(const endpoint& r_endpoint, const teid_t r_teid, const teid_t l_teid, const gtpv2c_downlink_data_notification& gtp_ies, const task_id_t& task_id, const uint64_t gtp_tx_id);
virtual void send_triggered_message(const endpoint& r_endpoint, const teid_t teid, const gtpv2c_create_session_response& gtp_ies, const uint64_t gtp_tx_id, const gtpv2c_transaction_action& a = DELETE_TX);
virtual void send_triggered_message(const endpoint& r_endpoint, const teid_t teid, const gtpv2c_delete_session_response& gtp_ies, const uint64_t gtp_tx_id, const gtpv2c_transaction_action& a = DELETE_TX);
virtual void send_triggered_message(const endpoint& r_endpoint, const teid_t teid, const gtpv2c_modify_bearer_response& gtp_ies, const uint64_t gtp_tx_id, const gtpv2c_transaction_action& a = DELETE_TX);
virtual void send_triggered_message(const endpoint& r_endpoint, const teid_t teid, const gtpv2c_release_access_bearers_response& gtp_ies, const uint64_t gtp_tx_id, const gtpv2c_transaction_action& a = DELETE_TX);
virtual void send_triggered_message(const endpoint& r_endpoint, const teid_t teid, const gtpv2c_downlink_data_notification_acknowledge& gtp_ies, const uint64_t gtp_tx_id, const gtpv2c_transaction_action& a = DELETE_TX);
void time_out_event(const uint32_t timer_id, const task_id_t& task_id, bool &error);
};
} // namespace gtpv2c
#endif /* FILE_GTPV2C_HPP_SEEN */
This diff is collapsed.
...@@ -34,8 +34,6 @@ typedef enum { ...@@ -34,8 +34,6 @@ typedef enum {
TASK_FIRST = 0, TASK_FIRST = 0,
TASK_ITTI_TIMER = TASK_FIRST, TASK_ITTI_TIMER = TASK_FIRST,
TASK_ASYNC_SHELL_CMD, TASK_ASYNC_SHELL_CMD,
TASK_GTPV1_U,
TASK_GTPV2_C,
TASK_SMF_APP, TASK_SMF_APP,
TASK_SMF_N4, TASK_SMF_N4,
TASK_SMF_N10, TASK_SMF_N10,
......
...@@ -266,7 +266,6 @@ endif(STATIC_LINKING) ...@@ -266,7 +266,6 @@ endif(STATIC_LINKING)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/common ${CMAKE_CURRENT_BINARY_DIR}/common) ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/common ${CMAKE_CURRENT_BINARY_DIR}/common)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/common/utils ${CMAKE_CURRENT_BINARY_DIR}/utils) ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/common/utils ${CMAKE_CURRENT_BINARY_DIR}/utils)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/gtpv2c ${CMAKE_CURRENT_BINARY_DIR}/gtpv2c)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/pfcp ${CMAKE_CURRENT_BINARY_DIR}/pfcp) ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/pfcp ${CMAKE_CURRENT_BINARY_DIR}/pfcp)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/udp ${CMAKE_CURRENT_BINARY_DIR}/udp) ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/udp ${CMAKE_CURRENT_BINARY_DIR}/udp)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/api-server ${CMAKE_CURRENT_BINARY_DIR}/api-server) ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/api-server ${CMAKE_CURRENT_BINARY_DIR}/api-server)
...@@ -354,7 +353,6 @@ include_directories(${SRC_TOP_DIR}/itti) ...@@ -354,7 +353,6 @@ include_directories(${SRC_TOP_DIR}/itti)
include_directories(${SRC_TOP_DIR}/common/msg) include_directories(${SRC_TOP_DIR}/common/msg)
include_directories(${SRC_TOP_DIR}/common/nas) include_directories(${SRC_TOP_DIR}/common/nas)
include_directories(${SRC_TOP_DIR}/common/utils) include_directories(${SRC_TOP_DIR}/common/utils)
include_directories(${SRC_TOP_DIR}/gtpv2c)
include_directories(${SRC_TOP_DIR}/pfcp) include_directories(${SRC_TOP_DIR}/pfcp)
include_directories(${SRC_TOP_DIR}/udp) include_directories(${SRC_TOP_DIR}/udp)
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include) include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
...@@ -377,5 +375,5 @@ IF(STATIC_LINKING) ...@@ -377,5 +375,5 @@ IF(STATIC_LINKING)
ENDIF(STATIC_LINKING) ENDIF(STATIC_LINKING)
target_link_libraries (smf ${ASAN} target_link_libraries (smf ${ASAN}
-Wl,--start-group CN_UTILS SMF UDP GTPV2C PFCP 3GPP_COMMON_TYPES SMF_API -lnettle ${NETTLE_LIBRARIES} ${CRYPTO_LIBRARIES} -lnghttp2_asio -lboost_system -lboost_thread -lssl -lcrypto NAS gflags glog dl double-conversion folly -Wl,--end-group pthread m rt config++ event boost_system pistache curl) -Wl,--start-group CN_UTILS SMF UDP PFCP 3GPP_COMMON_TYPES SMF_API -lnettle ${NETTLE_LIBRARIES} ${CRYPTO_LIBRARIES} -lnghttp2_asio -lboost_system -lboost_thread -lssl -lcrypto NAS gflags glog dl double-conversion folly -Wl,--end-group pthread m rt config++ event boost_system pistache curl)
\ No newline at end of file
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <stdlib.h> // srand #include <stdlib.h> // srand
#include <unistd.h> // get_pid(), pause() #include <unistd.h> // get_pid(), pause()
using namespace gtpv2c;
using namespace smf; using namespace smf;
using namespace util; using namespace util;
using namespace std; using namespace std;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file gtpv2c.cpp /*! \file pfcp.cpp
\brief \brief
\author Lionel Gauthier \author Lionel Gauthier
\company Eurecom \company Eurecom
......
...@@ -23,7 +23,6 @@ include_directories(${SRC_TOP_DIR}/common/msg) ...@@ -23,7 +23,6 @@ include_directories(${SRC_TOP_DIR}/common/msg)
include_directories(${SRC_TOP_DIR}/common/utils) include_directories(${SRC_TOP_DIR}/common/utils)
include_directories(${SRC_TOP_DIR}/common/ngap) include_directories(${SRC_TOP_DIR}/common/ngap)
include_directories(${SRC_TOP_DIR}/itti) include_directories(${SRC_TOP_DIR}/itti)
include_directories(${SRC_TOP_DIR}/gtpv2c)
include_directories(${SRC_TOP_DIR}/pfcp) include_directories(${SRC_TOP_DIR}/pfcp)
include_directories(${SRC_TOP_DIR}/smf) include_directories(${SRC_TOP_DIR}/smf)
include_directories(${SRC_TOP_DIR}/ngap) include_directories(${SRC_TOP_DIR}/ngap)
......
...@@ -503,7 +503,12 @@ void smf_app::handle_itti_msg(itti_n11_create_sm_context_response &m) { ...@@ -503,7 +503,12 @@ void smf_app::handle_itti_msg(itti_n11_create_sm_context_response &m) {
Logger::smf_app().debug( Logger::smf_app().debug(
"PDU Session Create SM Context: Set promise with ID %d to ready", m.pid); "PDU Session Create SM Context: Set promise with ID %d to ready", m.pid);
pdu_session_create_sm_context_response sm_context_response = { }; pdu_session_create_sm_context_response sm_context_response = { };
std::shared_lock lock(m_sm_context_create_promises);
if (sm_context_create_promises.count(m.pid) > 0 ){
sm_context_create_promises[m.pid]->set_value(m.res); sm_context_create_promises[m.pid]->set_value(m.res);
//Remove this promise from list
sm_context_create_promises.erase(m.pid);
}
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -511,7 +516,12 @@ void smf_app::handle_itti_msg(itti_n11_update_sm_context_response &m) { ...@@ -511,7 +516,12 @@ void smf_app::handle_itti_msg(itti_n11_update_sm_context_response &m) {
Logger::smf_app().debug( Logger::smf_app().debug(
"PDU Session Update SM Context: Set promise with ID %d to ready", m.pid); "PDU Session Update SM Context: Set promise with ID %d to ready", m.pid);
pdu_session_update_sm_context_response sm_context_response = { }; pdu_session_update_sm_context_response sm_context_response = { };
std::shared_lock lock(m_sm_context_update_promises);
if (sm_context_update_promises.count(m.pid) > 0 ){
sm_context_update_promises[m.pid]->set_value(m.res); sm_context_update_promises[m.pid]->set_value(m.res);
//Remove this promise from list
sm_context_update_promises.erase(m.pid);
}
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -519,7 +529,12 @@ void smf_app::handle_itti_msg(itti_n11_release_sm_context_response &m) { ...@@ -519,7 +529,12 @@ void smf_app::handle_itti_msg(itti_n11_release_sm_context_response &m) {
Logger::smf_app().debug( Logger::smf_app().debug(
"PDU Session Release SM Context: Set promise with ID %d to ready", m.pid); "PDU Session Release SM Context: Set promise with ID %d to ready", m.pid);
pdu_session_release_sm_context_response sm_context_response = { }; pdu_session_release_sm_context_response sm_context_response = { };
std::shared_lock lock(m_sm_context_release_promises);
if (sm_context_release_promises.count(m.pid) > 0 ){
sm_context_release_promises[m.pid]->set_value(m.res); sm_context_release_promises[m.pid]->set_value(m.res);
//Remove this promise from list
sm_context_release_promises.erase(m.pid);
}
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/split.hpp>
#include "3gpp_29.274.hpp" //#include "3gpp_29.274.hpp"
#include "common_defs.h" #include "common_defs.h"
#include "epc.h" #include "epc.h"
#include "if.hpp" #include "if.hpp"
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include "3gpp_29.244.h" #include "3gpp_29.244.h"
#include "3gpp_29.274.h" #include "3gpp_29.274.h"
#include "gtpv2c.hpp"
#include "pfcp.hpp" #include "pfcp.hpp"
#include "smf.h" #include "smf.h"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "itti.hpp" #include "itti.hpp"
#include "itti_msg_n4_restore.hpp" #include "itti_msg_n4_restore.hpp"
#include "logger.hpp" #include "logger.hpp"
#include "msg_gtpv2c.hpp"
#include "smf_app.hpp" #include "smf_app.hpp"
#include "smf_config.hpp" #include "smf_config.hpp"
#include "smf_pfcp_association.hpp" #include "smf_pfcp_association.hpp"
......
...@@ -34,13 +34,12 @@ ...@@ -34,13 +34,12 @@
#include <set> #include <set>
#include "3gpp_29.244.hpp" #include "3gpp_29.244.hpp"
#include "3gpp_29.274.hpp" //#include "3gpp_29.274.hpp"
#include "itti_msg_n11.hpp" #include "itti_msg_n11.hpp"
#include "itti_msg_n4.hpp" #include "itti_msg_n4.hpp"
#include "itti_msg_n4_restore.hpp" #include "itti_msg_n4_restore.hpp"
#include "itti_msg_nx.hpp" #include "itti_msg_nx.hpp"
#include "msg_pfcp.hpp" #include "msg_pfcp.hpp"
#include "msg_gtpv2c.hpp"
#include "uint_generator.hpp" #include "uint_generator.hpp"
#include "smf_msg.hpp" #include "smf_msg.hpp"
......
...@@ -1485,7 +1485,7 @@ bool pdu_session_establishment(uint8_t pid, uint8_t context_id, ...@@ -1485,7 +1485,7 @@ bool pdu_session_establishment(uint8_t pid, uint8_t context_id,
bool status = false; bool status = false;
if (send_pdu_session_establishment_request(pid, smf_ip_address, http_version, if (send_pdu_session_establishment_request(pid, smf_ip_address, http_version,
port)) { port)) {
usleep(100000); //usleep(100000);
status = send_pdu_session_update_sm_context_establishment(context_id, status = send_pdu_session_update_sm_context_establishment(context_id,
smf_ip_address, smf_ip_address,
http_version, http_version,
...@@ -1576,10 +1576,14 @@ void test_all_procedures_for_multiple_threads(std::string smf_ip_address, ...@@ -1576,10 +1576,14 @@ void test_all_procedures_for_multiple_threads(std::string smf_ip_address,
//bool status = false; //bool status = false;
std::thread t1(&send_pdu_session_establishment_request, pid, smf_ip_address, /* std::thread t1(&send_pdu_session_establishment_request, pid, smf_ip_address,
http_version, port); http_version, port);
std::thread t2(&send_pdu_session_update_sm_context_establishment, context_id, std::thread t2(&send_pdu_session_update_sm_context_establishment, context_id,
smf_ip_address, http_version, port); smf_ip_address, http_version, port);
*/
std::thread t1(&pdu_session_establishment, pid, context_id, smf_ip_address,
http_version, port);
std::thread t3(&send_pdu_session_update_sm_context_ue_service_request, std::thread t3(&send_pdu_session_update_sm_context_ue_service_request,
context_id, smf_ip_address, http_version, port); context_id, smf_ip_address, http_version, port);
std::thread t4(&send_pdu_session_update_sm_context_ue_service_request_step2, std::thread t4(&send_pdu_session_update_sm_context_ue_service_request_step2,
...@@ -1602,7 +1606,7 @@ void test_all_procedures_for_multiple_threads(std::string smf_ip_address, ...@@ -1602,7 +1606,7 @@ void test_all_procedures_for_multiple_threads(std::string smf_ip_address,
//send_release_sm_context_request(pid, smf_ip_address, http_version, port); //send_release_sm_context_request(pid, smf_ip_address, http_version, port);
t1.join(); t1.join();
t2.join(); // t2.join();
t3.join(); t3.join();
t4.join(); t4.join();
t5.join(); t5.join();
...@@ -1662,11 +1666,11 @@ int main(int argc, char *argv[]) { ...@@ -1662,11 +1666,11 @@ int main(int argc, char *argv[]) {
uint8_t context_id = 1; uint8_t context_id = 1;
uint8_t pid = 1; uint8_t pid = 1;
test_all_procedures_for_one_session(pid, context_id, smf_ip_address, //test_all_procedures_for_one_session(pid, context_id, smf_ip_address,
http_version, port); // http_version, port);
//test_session_establishment_multiple_threads(smf_ip_address, http_version, port); //test_session_establishment_multiple_threads(smf_ip_address, http_version, port);
//test_all_procedures_for_multiple_threads(smf_ip_address, http_version, test_all_procedures_for_multiple_threads(smf_ip_address, http_version,
// port); port);
return 0; return 0;
} }
...@@ -22,15 +22,10 @@ include_directories(${SRC_TOP_DIR}/common) ...@@ -22,15 +22,10 @@ include_directories(${SRC_TOP_DIR}/common)
include_directories(${SRC_TOP_DIR}/common/msg) include_directories(${SRC_TOP_DIR}/common/msg)
include_directories(${SRC_TOP_DIR}/common/utils) include_directories(${SRC_TOP_DIR}/common/utils)
include_directories(${SRC_TOP_DIR}/itti) include_directories(${SRC_TOP_DIR}/itti)
include_directories(${SRC_TOP_DIR}/gtpv1u)
include_directories(${SRC_TOP_DIR}/gtpv2c)
include_directories(${SRC_TOP_DIR}/pfcp) include_directories(${SRC_TOP_DIR}/pfcp)
include_directories(${SRC_TOP_DIR}/udp) include_directories(${SRC_TOP_DIR}/udp)
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include) include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
add_library (UDP STATIC add_library (UDP STATIC
udp.cpp udp.cpp
) )
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