Commit 3fa4362d authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for static vector string

parent 7b682c40
...@@ -478,7 +478,7 @@ void smf_app::handle_itti_msg( ...@@ -478,7 +478,7 @@ void smf_app::handle_itti_msg(
"Got successful response from AMF (response code %d), set session " "Got successful response from AMF (response code %d), set session "
"status to %s", "status to %s",
m.response_code, m.response_code,
pdu_session_status_e2str[static_cast<int>(status)].c_str()); pdu_session_status_e2str.at(static_cast<int>(status)).c_str());
} else { } else {
// TODO: // TODO:
Logger::smf_app().debug( Logger::smf_app().debug(
...@@ -537,7 +537,8 @@ void smf_app::handle_itti_msg( ...@@ -537,7 +537,8 @@ void smf_app::handle_itti_msg(
void smf_app::handle_itti_msg(itti_n11_update_pdu_session_status& m) { void smf_app::handle_itti_msg(itti_n11_update_pdu_session_status& m) {
Logger::smf_app().info( Logger::smf_app().info(
"Set PDU Session Status to %s", "Set PDU Session Status to %s",
pdu_session_status_e2str[static_cast<int>(m.pdu_session_status)].c_str()); pdu_session_status_e2str.at(static_cast<int>(m.pdu_session_status))
.c_str());
update_pdu_session_status(m.scid, m.pdu_session_status); update_pdu_session_status(m.scid, m.pdu_session_status);
} }
...@@ -1419,7 +1420,7 @@ void smf_app::update_pdu_session_status( ...@@ -1419,7 +1420,7 @@ void smf_app::update_pdu_session_status(
sp.get()->set_pdu_session_status(status); sp.get()->set_pdu_session_status(status);
Logger::smf_app().info( Logger::smf_app().info(
"Set PDU Session Status to %s", "Set PDU Session Status to %s",
pdu_session_status_e2str[static_cast<int>(status)].c_str()); pdu_session_status_e2str.at(static_cast<int>(status)).c_str());
} }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
...@@ -1474,7 +1475,7 @@ void smf_app::update_pdu_session_upCnx_state( ...@@ -1474,7 +1475,7 @@ void smf_app::update_pdu_session_upCnx_state(
sp.get()->set_upCnx_state(state); sp.get()->set_upCnx_state(state);
Logger::smf_app().info( Logger::smf_app().info(
"Set PDU Session UpCnxState to %s", "Set PDU Session UpCnxState to %s",
upCnx_state_e2str[static_cast<int>(state)].c_str()); upCnx_state_e2str.at(static_cast<int>(state)).c_str());
} }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
void smf_app::timer_t3591_timeout(timer_id_t timer_id, uint64_t arg2_user) { void smf_app::timer_t3591_timeout(timer_id_t timer_id, uint64_t arg2_user) {
...@@ -1527,7 +1528,7 @@ n2_sm_info_type_e smf_app::n2_sm_info_type_str2e( ...@@ -1527,7 +1528,7 @@ n2_sm_info_type_e smf_app::n2_sm_info_type_str2e(
const std::string& n2_info_type) const { const std::string& n2_info_type) const {
std::size_t number_of_types = n2_sm_info_type_e2str.size(); std::size_t number_of_types = n2_sm_info_type_e2str.size();
for (auto i = 0; i < number_of_types; ++i) { for (auto i = 0; i < number_of_types; ++i) {
if (n2_info_type.compare(n2_sm_info_type_e2str[i]) == 0) { if (n2_info_type.compare(n2_sm_info_type_e2str.at(i)) == 0) {
return static_cast<n2_sm_info_type_e>(i); return static_cast<n2_sm_info_type_e>(i);
} }
} }
...@@ -1645,7 +1646,7 @@ void smf_app::trigger_create_context_error_response( ...@@ -1645,7 +1646,7 @@ void smf_app::trigger_create_context_error_response(
oai::smf_server::model::ProblemDetails problem_details = {}; oai::smf_server::model::ProblemDetails problem_details = {};
oai::smf_server::model::RefToBinaryData refToBinaryData = {}; oai::smf_server::model::RefToBinaryData refToBinaryData = {};
Logger::smf_app().warn("Create SmContextCreateError"); Logger::smf_app().warn("Create SmContextCreateError");
problem_details.setCause(pdu_session_application_error_e2str[cause]); problem_details.setCause(pdu_session_application_error_e2str.at(cause));
sm_context.setError(problem_details); sm_context.setError(problem_details);
refToBinaryData.setContentId(N1_SM_CONTENT_ID); refToBinaryData.setContentId(N1_SM_CONTENT_ID);
sm_context.setN1SmMsg(refToBinaryData); sm_context.setN1SmMsg(refToBinaryData);
...@@ -1677,7 +1678,7 @@ void smf_app::trigger_update_context_error_response( ...@@ -1677,7 +1678,7 @@ void smf_app::trigger_update_context_error_response(
oai::smf_server::model::SmContextUpdateError smContextUpdateError = {}; oai::smf_server::model::SmContextUpdateError smContextUpdateError = {};
oai::smf_server::model::ProblemDetails problem_details = {}; oai::smf_server::model::ProblemDetails problem_details = {};
problem_details.setCause(pdu_session_application_error_e2str[cause]); problem_details.setCause(pdu_session_application_error_e2str.at(cause));
smContextUpdateError.setError(problem_details); smContextUpdateError.setError(problem_details);
std::shared_ptr<itti_n11_update_sm_context_response> itti_msg = std::shared_ptr<itti_n11_update_sm_context_response> itti_msg =
...@@ -1707,7 +1708,7 @@ void smf_app::trigger_update_context_error_response( ...@@ -1707,7 +1708,7 @@ void smf_app::trigger_update_context_error_response(
oai::smf_server::model::SmContextUpdateError smContextUpdateError = {}; oai::smf_server::model::SmContextUpdateError smContextUpdateError = {};
oai::smf_server::model::ProblemDetails problem_details = {}; oai::smf_server::model::ProblemDetails problem_details = {};
problem_details.setCause(pdu_session_application_error_e2str[cause]); problem_details.setCause(pdu_session_application_error_e2str.at(cause));
smContextUpdateError.setError(problem_details); smContextUpdateError.setError(problem_details);
std::shared_ptr<itti_n11_update_sm_context_response> itti_msg = std::shared_ptr<itti_n11_update_sm_context_response> itti_msg =
......
...@@ -409,7 +409,7 @@ void smf_pdu_session::set_pdu_session_status( ...@@ -409,7 +409,7 @@ void smf_pdu_session::set_pdu_session_status(
// TODO: Should consider congestion handling // TODO: Should consider congestion handling
Logger::smf_app().info( Logger::smf_app().info(
"Set PDU Session Status to %s", "Set PDU Session Status to %s",
pdu_session_status_e2str[static_cast<int>(status)].c_str()); pdu_session_status_e2str.at(static_cast<int>(status)).c_str());
std::unique_lock lock(m_pdu_session_mutex); std::unique_lock lock(m_pdu_session_mutex);
pdu_session_status = status; pdu_session_status = status;
} }
...@@ -424,7 +424,7 @@ pdu_session_status_e smf_pdu_session::get_pdu_session_status() const { ...@@ -424,7 +424,7 @@ pdu_session_status_e smf_pdu_session::get_pdu_session_status() const {
void smf_pdu_session::set_upCnx_state(const upCnx_state_e& state) { void smf_pdu_session::set_upCnx_state(const upCnx_state_e& state) {
Logger::smf_app().info( Logger::smf_app().info(
"Set upCnxState to %s", "Set upCnxState to %s",
upCnx_state_e2str[static_cast<int>(state)].c_str()); upCnx_state_e2str.at(static_cast<int>(state)).c_str());
std::unique_lock lock(m_pdu_session_mutex); std::unique_lock lock(m_pdu_session_mutex);
upCnx_state = state; upCnx_state = state;
} }
...@@ -1885,7 +1885,7 @@ bool smf_context::handle_pdu_session_release_complete( ...@@ -1885,7 +1885,7 @@ bool smf_context::handle_pdu_session_release_complete(
Logger::smf_app().debug("Signal the SM Context Status Change"); Logger::smf_app().debug("Signal the SM Context Status Change");
event_sub.sm_context_status( event_sub.sm_context_status(
scid, scid,
static_cast<uint32_t>(sm_context_status_e::SM_CONTEXT_STATUS_RELEASED), static_cast<uint8_t>(sm_context_status_e::SM_CONTEXT_STATUS_RELEASED),
sm_context_request.get()->http_version); sm_context_request.get()->http_version);
// Trigger PDU Session Release event notification // Trigger PDU Session Release event notification
...@@ -2512,8 +2512,8 @@ void smf_context::handle_pdu_session_update_sm_context_request( ...@@ -2512,8 +2512,8 @@ void smf_context::handle_pdu_session_update_sm_context_request(
Logger::smf_app().info( Logger::smf_app().info(
"PDU Update SM Context Request procedure failed (session procedure " "PDU Update SM Context Request procedure failed (session procedure "
"type %s)", "type %s)",
session_management_procedures_type_e2str[static_cast<int>( session_management_procedures_type_e2str
procedure_type)] .at(static_cast<int>(procedure_type))
.c_str()); .c_str());
remove_procedure(proc); remove_procedure(proc);
...@@ -2917,7 +2917,8 @@ void smf_context::handle_sm_context_status_change( ...@@ -2917,7 +2917,8 @@ void smf_context::handle_sm_context_status_change(
std::make_shared<itti_n11_notify_sm_context_status>( std::make_shared<itti_n11_notify_sm_context_status>(
TASK_SMF_APP, TASK_SMF_N11); TASK_SMF_APP, TASK_SMF_N11);
itti_msg->scid = scid; itti_msg->scid = scid;
itti_msg->sm_context_status = sm_context_status_e2str[status]; itti_msg->sm_context_status =
sm_context_status_e2str.at(static_cast<int>(status));
itti_msg->amf_status_uri = scf.get()->amf_status_uri; itti_msg->amf_status_uri = scf.get()->amf_status_uri;
itti_msg->http_version = http_version; itti_msg->http_version = http_version;
......
...@@ -520,8 +520,8 @@ int session_update_sm_context_procedure::run( ...@@ -520,8 +520,8 @@ int session_update_sm_context_procedure::run(
Logger::smf_app().debug( Logger::smf_app().debug(
"Session procedure type: %s", "Session procedure type: %s",
session_management_procedures_type_e2str[static_cast<int>( session_management_procedures_type_e2str
session_procedure_type)] .at(static_cast<int>(session_procedure_type))
.c_str()); .c_str());
switch (session_procedure_type) { switch (session_procedure_type) {
...@@ -893,8 +893,8 @@ void session_update_sm_context_procedure::handle_itti_msg( ...@@ -893,8 +893,8 @@ void session_update_sm_context_procedure::handle_itti_msg(
Logger::smf_app().debug( Logger::smf_app().debug(
"Session procedure type: %s", "Session procedure type: %s",
session_management_procedures_type_e2str[static_cast<int>( session_management_procedures_type_e2str
session_procedure_type)] .at(static_cast<int>(session_procedure_type))
.c_str()); .c_str());
switch (session_procedure_type) { switch (session_procedure_type) {
...@@ -1310,9 +1310,8 @@ void session_release_sm_context_procedure::handle_itti_msg( ...@@ -1310,9 +1310,8 @@ void session_release_sm_context_procedure::handle_itti_msg(
n11_triggered_pending->pid, N11_SESSION_RELEASE_SM_CONTEXT_RESPONSE); n11_triggered_pending->pid, N11_SESSION_RELEASE_SM_CONTEXT_RESPONSE);
} else { } else {
oai::smf_server::model::ProblemDetails problem_details = {}; oai::smf_server::model::ProblemDetails problem_details = {};
problem_details.setCause( problem_details.setCause(pdu_session_application_error_e2str.at(
pdu_session_application_error_e2str PDU_SESSION_APPLICATION_ERROR_NETWORK_FAILURE));
[PDU_SESSION_APPLICATION_ERROR_NETWORK_FAILURE]);
// trigger to send reply to AMF // trigger to send reply to AMF
/* /*
smf_app_inst->trigger_http_response( smf_app_inst->trigger_http_response(
......
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