Commit 049eab5a authored by aligungr's avatar aligungr

NAS MM refactor

parent f460d829
...@@ -85,7 +85,6 @@ class NasMm ...@@ -85,7 +85,6 @@ class NasMm
void receiveMmMessage(const nas::PlainMmMessage &msg); void receiveMmMessage(const nas::PlainMmMessage &msg);
void receiveDlNasTransport(const nas::DlNasTransport &msg); void receiveDlNasTransport(const nas::DlNasTransport &msg);
void receiveMmStatus(const nas::FiveGMmStatus &msg); void receiveMmStatus(const nas::FiveGMmStatus &msg);
void receiveMmCause(const nas::IE5gMmCause &msg);
void sendMmStatus(nas::EMmCause cause); void sendMmStatus(nas::EMmCause cause);
public: /* Registration */ public: /* Registration */
......
...@@ -204,11 +204,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg) ...@@ -204,11 +204,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
} }
if (msg.sht == nas::ESecurityHeaderType::NOT_PROTECTED) if (msg.sht == nas::ESecurityHeaderType::NOT_PROTECTED)
{
m_logger->warn("Not protected Service Reject message received"); m_logger->warn("Not protected Service Reject message received");
sendMmStatus(nas::EMmCause::UNSPECIFIED_PROTOCOL_ERROR);
return;
}
// "On receipt of the SERVICE REJECT message, if the UE is in state 5GMM-SERVICE-REQUEST-INITIATED and the message // "On receipt of the SERVICE REJECT message, if the UE is in state 5GMM-SERVICE-REQUEST-INITIATED and the message
// is integrity protected, the UE shall reset the service request attempt counter and stop timer T3517 if running." // is integrity protected, the UE shall reset the service request attempt counter and stop timer T3517 if running."
...@@ -216,7 +212,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg) ...@@ -216,7 +212,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
m_timers->t3517.stop(); m_timers->t3517.stop();
auto cause = msg.mmCause.value; auto cause = msg.mmCause.value;
m_logger->err("Service Request failed [%s]", nas::utils::EnumToString(cause)); m_logger->err("Service Reject received with cause [%s]", nas::utils::EnumToString(cause));
auto handleAbnormalCase = [this]() { auto handleAbnormalCase = [this]() {
m_logger->debug("Handling Service Reject abnormal case"); m_logger->debug("Handling Service Reject abnormal case");
......
...@@ -115,7 +115,7 @@ void NasMm::receiveNasMessage(const nas::NasMessage &msg) ...@@ -115,7 +115,7 @@ void NasMm::receiveNasMessage(const nas::NasMessage &msg)
if (!m_usim->m_currentNsCtx) if (!m_usim->m_currentNsCtx)
{ {
m_logger->warn("Secured NAS message received while no security context"); m_logger->err("Secured NAS message received while no security context");
sendMmStatus(nas::EMmCause::MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE); sendMmStatus(nas::EMmCause::MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE);
return; return;
} }
...@@ -203,7 +203,7 @@ void NasMm::receiveMmMessage(const nas::PlainMmMessage &msg) ...@@ -203,7 +203,7 @@ void NasMm::receiveMmMessage(const nas::PlainMmMessage &msg)
receiveDlNasTransport((const nas::DlNasTransport &)msg); receiveDlNasTransport((const nas::DlNasTransport &)msg);
break; break;
default: default:
m_logger->err("Unhandled NAS MM message received: %d", (int)msg.messageType); m_logger->err("Unhandled NAS MM message received [%d]", (int)msg.messageType);
break; break;
} }
} }
...@@ -212,7 +212,7 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg) ...@@ -212,7 +212,7 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg)
{ {
if (msg.payloadContainerType.payloadContainerType != nas::EPayloadContainerType::N1_SM_INFORMATION) if (msg.payloadContainerType.payloadContainerType != nas::EPayloadContainerType::N1_SM_INFORMATION)
{ {
m_logger->err("Unhandled DL NAS Transport type: %d", (int)msg.payloadContainerType.payloadContainerType); m_logger->err("Unhandled DL NAS Transport type [%d]", (int)msg.payloadContainerType.payloadContainerType);
return; return;
} }
...@@ -229,7 +229,7 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg) ...@@ -229,7 +229,7 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg)
void NasMm::sendMmStatus(nas::EMmCause cause) void NasMm::sendMmStatus(nas::EMmCause cause)
{ {
m_logger->warn("Sending MM Status with cause %s", nas::utils::EnumToString(cause)); m_logger->warn("Sending MM Status with cause [%s]", nas::utils::EnumToString(cause));
nas::FiveGMmStatus m; nas::FiveGMmStatus m;
m.mmCause.value = cause; m.mmCause.value = cause;
...@@ -238,12 +238,7 @@ void NasMm::sendMmStatus(nas::EMmCause cause) ...@@ -238,12 +238,7 @@ void NasMm::sendMmStatus(nas::EMmCause cause)
void NasMm::receiveMmStatus(const nas::FiveGMmStatus &msg) void NasMm::receiveMmStatus(const nas::FiveGMmStatus &msg)
{ {
receiveMmCause(msg.mmCause); m_logger->err("MM status received with cause [%s]", nas::utils::EnumToString(msg.mmCause.value));
}
void NasMm::receiveMmCause(const nas::IE5gMmCause &msg)
{
m_logger->err("MM cause received: %s", nas::utils::EnumToString(msg.value));
} }
} // namespace nr::ue } // namespace nr::ue
...@@ -70,7 +70,7 @@ void NasSm::receiveSmMessage(const nas::SmMessage &msg) ...@@ -70,7 +70,7 @@ void NasSm::receiveSmMessage(const nas::SmMessage &msg)
void NasSm::receiveSmStatus(const nas::FiveGSmStatus &msg) void NasSm::receiveSmStatus(const nas::FiveGSmStatus &msg)
{ {
m_logger->err("SM Status received: %s", nas::utils::EnumToString(msg.smCause.value)); m_logger->err("SM Status received with cause [%s]", nas::utils::EnumToString(msg.smCause.value));
if (msg.smCause.value == nas::ESmCause::INVALID_PTI_VALUE) if (msg.smCause.value == nas::ESmCause::INVALID_PTI_VALUE)
{ {
......
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