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

Code cleanup/Apply Clang-format

parent 8471a3b5
...@@ -126,6 +126,7 @@ void smf_qos_flow::deallocate_ressources() { ...@@ -126,6 +126,7 @@ void smf_qos_flow::deallocate_ressources() {
void smf_pdu_session::get_pdu_session_id(uint32_t& psi) const { void smf_pdu_session::get_pdu_session_id(uint32_t& psi) const {
psi = pdu_session_id; psi = pdu_session_id;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
uint32_t smf_pdu_session::get_pdu_session_id() const { uint32_t smf_pdu_session::get_pdu_session_id() const {
return pdu_session_id; return pdu_session_id;
...@@ -3641,7 +3642,7 @@ void smf_context::trigger_ddds(scid_t scid, uint8_t http_version) { ...@@ -3641,7 +3642,7 @@ void smf_context::trigger_ddds(scid_t scid, uint8_t http_version) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void smf_context::handle_ddds( scid_t scid, uint8_t http_version) { void smf_context::handle_ddds(scid_t scid, uint8_t http_version) {
Logger::smf_app().debug( Logger::smf_app().debug(
"Send request to N11 to triger FlexCN, " "Send request to N11 to triger FlexCN, "
"SMF Context ID " SCID_FMT " ", "SMF Context ID " SCID_FMT " ",
...@@ -3658,8 +3659,8 @@ void smf_context::handle_ddds( scid_t scid, uint8_t http_version) { ...@@ -3658,8 +3659,8 @@ void smf_context::handle_ddds( scid_t scid, uint8_t http_version) {
return; return;
} }
supi_t supi = scf.get()->supi; supi_t supi = scf.get()->supi;
supi64_t supi64 = smf_supi_to_u64(supi); supi64_t supi64 = smf_supi_to_u64(supi);
// pdu_session_id_t pdu_session_id = scf.get()->pdu_session_id; // pdu_session_id_t pdu_session_id = scf.get()->pdu_session_id;
std::shared_ptr<smf_context> sc = {}; std::shared_ptr<smf_context> sc = {};
...@@ -3689,7 +3690,7 @@ void smf_context::handle_ddds( scid_t scid, uint8_t http_version) { ...@@ -3689,7 +3690,7 @@ void smf_context::handle_ddds( scid_t scid, uint8_t http_version) {
for (auto i : subscriptions) { for (auto i : subscriptions) {
event_notification ev_notif = {}; event_notification ev_notif = {};
ev_notif.set_supi(supi64); // SUPI ev_notif.set_supi(supi64); // SUPI
// ev_notif.set_pdu_session_id(pdu_session_id); // PDU session ID // ev_notif.set_pdu_session_id(pdu_session_id); // PDU session ID
ev_notif.set_smf_event(smf_event_t::SMF_EVENT_DDDS); ev_notif.set_smf_event(smf_event_t::SMF_EVENT_DDDS);
ev_notif.set_notif_uri(i.get()->notif_uri); ev_notif.set_notif_uri(i.get()->notif_uri);
...@@ -3701,7 +3702,8 @@ void smf_context::handle_ddds( scid_t scid, uint8_t http_version) { ...@@ -3701,7 +3702,8 @@ void smf_context::handle_ddds( scid_t scid, uint8_t http_version) {
// DDDS Status // DDDS Status
// TODO: where to get this information in SMF??? // TODO: where to get this information in SMF???
oai::smf_server::model::DddStatus ddds = oai::smf_server::model::DddStatus(); oai::smf_server::model::DddStatus ddds =
oai::smf_server::model::DddStatus();
ev_notif.set_Ddds(ddds); ev_notif.set_Ddds(ddds);
itti_msg->event_notifs.push_back(ev_notif); itti_msg->event_notifs.push_back(ev_notif);
} }
...@@ -3719,7 +3721,6 @@ void smf_context::handle_ddds( scid_t scid, uint8_t http_version) { ...@@ -3719,7 +3721,6 @@ void smf_context::handle_ddds( scid_t scid, uint8_t http_version) {
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void smf_context::handle_ue_ip_change(scid_t scid, uint8_t http_version) { void smf_context::handle_ue_ip_change(scid_t scid, uint8_t http_version) {
Logger::smf_app().debug( Logger::smf_app().debug(
...@@ -4037,8 +4038,8 @@ void smf_context::handle_plmn_change(scid_t scid, uint8_t http_version) { ...@@ -4037,8 +4038,8 @@ void smf_context::handle_plmn_change(scid_t scid, uint8_t http_version) {
return; return;
} }
supi_t supi = scf.get()->supi; supi_t supi = scf.get()->supi;
supi64_t supi64 = smf_supi_to_u64(supi); supi64_t supi64 = smf_supi_to_u64(supi);
// pdu_session_id_t pdu_session_id = scf.get()->pdu_session_id; // pdu_session_id_t pdu_session_id = scf.get()->pdu_session_id;
std::shared_ptr<smf_context> sc = {}; std::shared_ptr<smf_context> sc = {};
...@@ -4068,7 +4069,7 @@ void smf_context::handle_plmn_change(scid_t scid, uint8_t http_version) { ...@@ -4068,7 +4069,7 @@ void smf_context::handle_plmn_change(scid_t scid, uint8_t http_version) {
for (auto i : subscriptions) { for (auto i : subscriptions) {
event_notification ev_notif = {}; event_notification ev_notif = {};
ev_notif.set_supi(supi64); // SUPI ev_notif.set_supi(supi64); // SUPI
// ev_notif.set_pdu_session_id(pdu_session_id); // PDU session ID // ev_notif.set_pdu_session_id(pdu_session_id); // PDU session ID
ev_notif.set_smf_event(smf_event_t::SMF_EVENT_PLMN_CH); ev_notif.set_smf_event(smf_event_t::SMF_EVENT_PLMN_CH);
ev_notif.set_notif_uri(i.get()->notif_uri); ev_notif.set_notif_uri(i.get()->notif_uri);
...@@ -4103,7 +4104,6 @@ void smf_context::handle_plmn_change(scid_t scid, uint8_t http_version) { ...@@ -4103,7 +4104,6 @@ void smf_context::handle_plmn_change(scid_t scid, uint8_t http_version) {
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void smf_context::update_qos_info( void smf_context::update_qos_info(
std::shared_ptr<smf_pdu_session>& sp, std::shared_ptr<smf_pdu_session>& sp,
......
...@@ -634,8 +634,7 @@ class smf_context : public std::enable_shared_from_this<smf_context> { ...@@ -634,8 +634,7 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
ee_ue_ip_change_connection.disconnect(); ee_ue_ip_change_connection.disconnect();
if (ee_plmn_change_connection.connected()) if (ee_plmn_change_connection.connected())
ee_plmn_change_connection.disconnect(); ee_plmn_change_connection.disconnect();
if (ee_ddds_connection.connected()) if (ee_ddds_connection.connected()) ee_ddds_connection.disconnect();
ee_ddds_connection.disconnect();
if (ee_flexcn.connected()) ee_flexcn.disconnect(); if (ee_flexcn.connected()) ee_flexcn.disconnect();
} }
......
...@@ -79,9 +79,8 @@ class smf_event { ...@@ -79,9 +79,8 @@ class smf_event {
bs2::connection subscribe_ee_plmn_change( bs2::connection subscribe_ee_plmn_change(
const ee_plmn_change_sig_t::slot_type& sig); const ee_plmn_change_sig_t::slot_type& sig);
// download link data status // download link data status
bs2::connection subscribe_ee_ddds( bs2::connection subscribe_ee_ddds(const ee_ddds_sig_t::slot_type& sig);
const ee_ddds_sig_t::slot_type& sig);
bs2::connection subscribe_ee_flexcn_event( bs2::connection subscribe_ee_flexcn_event(
const ee_flexcn_sig_t::slot_type& sig); const ee_flexcn_sig_t::slot_type& sig);
...@@ -92,9 +91,9 @@ class smf_event { ...@@ -92,9 +91,9 @@ class smf_event {
ee_pdu_session_release_sig_t ee_pdu_session_release_sig_t
ee_pdu_session_release; // Signal for PDU Session Release ee_pdu_session_release; // Signal for PDU Session Release
ee_ue_ip_change_sig_t ee_ue_ip_change; // Signal for UE IP Addr change ee_ue_ip_change_sig_t ee_ue_ip_change; // Signal for UE IP Addr change
ee_plmn_change_sig_t ee_plmn_change; // Signal for UE IP Addr change ee_plmn_change_sig_t ee_plmn_change; // Signal for UE IP Addr change
ee_ddds_sig_t ee_ddds; ee_ddds_sig_t ee_ddds;
ee_flexcn_sig_t ee_flexcn; // Signal for FlexCN Event ee_flexcn_sig_t ee_flexcn; // Signal for FlexCN Event
}; };
} // namespace smf } // namespace smf
#endif /* FILE_SMF_EVENT_HPP_SEEN */ #endif /* FILE_SMF_EVENT_HPP_SEEN */
...@@ -984,19 +984,19 @@ smf_event_t event_notification::get_smf_event() const { ...@@ -984,19 +984,19 @@ smf_event_t event_notification::get_smf_event() const {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// ddds change // ddds change
void event_notification::set_Ddds(oai::smf_server::model::DddStatus const& value){ void event_notification::set_Ddds(
m_DddStatus = value; oai::smf_server::model::DddStatus const& value) {
m_DddStatus = value;
m_DddStatusIsSet = true; m_DddStatusIsSet = true;
} }
oai::smf_server::model::DddStatus event_notification::get_ddds() const{ oai::smf_server::model::DddStatus event_notification::get_ddds() const {
return m_DddStatus; return m_DddStatus;
} }
bool event_notification::is_ddds_is_set() const{ bool event_notification::is_ddds_is_set() const {
return m_DddStatusIsSet; return m_DddStatusIsSet;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void event_notification::set_timestamp(const std::string& ss) { void event_notification::set_timestamp(const std::string& ss) {
m_timestamp = ss; m_timestamp = ss;
...@@ -1061,16 +1061,17 @@ bool event_notification::is_re_ipv4_addr_is_set() const { ...@@ -1061,16 +1061,17 @@ bool event_notification::is_re_ipv4_addr_is_set() const {
} }
// m_PlmnId // m_PlmnId
void event_notification::set_PlmnId(oai::smf_server::model::PlmnId const& value){ void event_notification::set_PlmnId(
m_PlmnId = value; oai::smf_server::model::PlmnId const& value) {
m_PlmnIdIsSet = true; m_PlmnId = value;
m_PlmnIdIsSet = true;
} }
oai::smf_server::model::PlmnId event_notification::get_plmnid() const{ oai::smf_server::model::PlmnId event_notification::get_plmnid() const {
return m_PlmnId; return m_PlmnId;
} }
bool event_notification::is_plmnid_is_set() const{ bool event_notification::is_plmnid_is_set() const {
return m_PlmnIdIsSet; return m_PlmnIdIsSet;
} }
......
...@@ -47,8 +47,6 @@ extern "C" { ...@@ -47,8 +47,6 @@ extern "C" {
#include "QOSRules.h" #include "QOSRules.h"
} }
// using namespace oai::smf_server::model;
typedef enum { typedef enum {
PDU_SESSION_MSG_TYPE_NONE = -1, PDU_SESSION_MSG_TYPE_NONE = -1,
PDU_SESSION_MSG_TYPE_FIRST = 0, PDU_SESSION_MSG_TYPE_FIRST = 0,
...@@ -634,7 +632,6 @@ class event_notification { ...@@ -634,7 +632,6 @@ class event_notification {
oai::smf_server::model::DddStatus get_ddds() const; oai::smf_server::model::DddStatus get_ddds() const;
bool is_ddds_is_set() const; bool is_ddds_is_set() const;
void set_pdu_session_id(const pdu_session_id_t value); void set_pdu_session_id(const pdu_session_id_t value);
pdu_session_id_t get_pdu_session_id() const; pdu_session_id_t get_pdu_session_id() const;
bool is_psi_is_set() const; bool is_psi_is_set() const;
......
...@@ -1126,11 +1126,11 @@ void session_update_sm_context_procedure::handle_itti_msg( ...@@ -1126,11 +1126,11 @@ void session_update_sm_context_procedure::handle_itti_msg(
// set UpCnxState to ACTIVATED // set UpCnxState to ACTIVATED
sps->set_upCnx_state(upCnx_state_e::UPCNX_STATE_ACTIVATED); sps->set_upCnx_state(upCnx_state_e::UPCNX_STATE_ACTIVATED);
// Trigger Event_exposure event // Trigger Event_exposure event
std::string str_scid = n11_trigger.get()->scid; std::string str_scid = n11_trigger.get()->scid;
//TODO: validate the str_scid // TODO: validate the str_scid
// //
scid_t scid = (scid_t) std::stoul (str_scid,nullptr,0); scid_t scid = (scid_t) std::stoul(str_scid, nullptr, 0);
sc.get()->trigger_ue_ip_change(scid, 1); sc.get()->trigger_ue_ip_change(scid, 1);
sc.get()->trigger_plmn_change(scid, 1); sc.get()->trigger_plmn_change(scid, 1);
sc.get()->trigger_ddds(scid, 1); sc.get()->trigger_ddds(scid, 1);
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include "smf.h" #include "smf.h"
#include "smf_app.hpp" #include "smf_app.hpp"
#include "smf_config.hpp" #include "smf_config.hpp"
#include "PlmnId.h"
extern "C" { extern "C" {
#include "dynamic_memory_check.h" #include "dynamic_memory_check.h"
...@@ -511,10 +510,11 @@ void smf_sbi::notify_subscribed_event( ...@@ -511,10 +510,11 @@ void smf_sbi::notify_subscribed_event(
if (i.is_plmnid_is_set()) { if (i.is_plmnid_is_set()) {
event_notif["plmnId"] = i.get_plmnid(); event_notif["plmnId"] = i.get_plmnid();
} }
// add support for ddds // add support for ddds
if (i.is_ddds_is_set()) { if (i.is_ddds_is_set()) {
//TODO: change this one to the real value when finished the event for ddds // TODO: change this one to the real value when finished the event for
// ddds
// event_notif["dddStatus"] = i.get_ddds(); // event_notif["dddStatus"] = i.get_ddds();
event_notif["dddStatus"] = "TRANSMITTED"; event_notif["dddStatus"] = "TRANSMITTED";
} }
......
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