Commit 5a88cd6f authored by aligungr's avatar aligungr

Service request handling

parent eae9085b
...@@ -15,7 +15,7 @@ namespace nr::ue ...@@ -15,7 +15,7 @@ namespace nr::ue
void NasMm::sendServiceRequest(EServiceReqCause reqCause) void NasMm::sendServiceRequest(EServiceReqCause reqCause)
{ {
m_logger->debug("Sending Service Request"); m_logger->debug("Sending Service Request due to [%s]", ToJson(reqCause).str().c_str());
auto request = std::make_unique<nas::ServiceRequest>(); auto request = std::make_unique<nas::ServiceRequest>();
...@@ -170,15 +170,24 @@ void NasMm::receiveServiceAccept(const nas::ServiceAccept &msg) ...@@ -170,15 +170,24 @@ void NasMm::receiveServiceAccept(const nas::ServiceAccept &msg)
void NasMm::receiveServiceReject(const nas::ServiceReject &msg) void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
{ {
if (m_mmState != EMmState::MM_SERVICE_REQUEST_INITIATED)
{
m_logger->warn("Service Reject ignored since the MM state is not MM_SERVICE_REQUEST_INITIATED");
sendMmStatus(nas::EMmCause::MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE);
return;
}
auto cause = msg.mmCause.value;
m_logger->err("Service Request failed [%s]", nas::utils::EnumToString(cause));
// Handle EAP message
if (msg.eapMessage.has_value()) if (msg.eapMessage.has_value())
{ {
if (msg.eapMessage->eap->code == eap::ECode::FAILURE) if (msg.eapMessage->eap->code == eap::ECode::FAILURE)
receiveEapFailureMessage(*msg.eapMessage->eap); receiveEapFailureMessage(*msg.eapMessage->eap);
else else
m_logger->warn("Network sent EAP with inconvenient type in ServiceAccept, ignoring EAP IE."); m_logger->warn("Network sent EAP with inconvenient type in ServiceReject, ignoring EAP IE.");
} }
// TODO
} }
} // namespace nr::ue } // namespace nr::ue
...@@ -243,4 +243,33 @@ Json ToJson(const UePduSessionInfo &v) ...@@ -243,4 +243,33 @@ Json ToJson(const UePduSessionInfo &v)
}); });
} }
Json ToJson(const EServiceReqCause &v)
{
switch (v)
{
case EServiceReqCause::UNSPECIFIED:
return "UNSPECIFIED";
case EServiceReqCause::IDLE_PAGING:
return "IDLE_PAGING";
case EServiceReqCause::CONNECTED_3GPP_NOTIFICATION_N3GPP:
return "CONNECTED_3GPP_NOTIFICATION_N3GPP";
case EServiceReqCause::IDLE_UPLINK_SIGNAL_PENDING:
return "IDLE_UPLINK_SIGNAL_PENDING";
case EServiceReqCause::IDLE_UPLINK_DATA_PENDING:
return "IDLE_UPLINK_DATA_PENDING";
case EServiceReqCause::CONNECTED_UPLINK_DATA_PENDING:
return "CONNECTED_UPLINK_DATA_PENDING";
case EServiceReqCause::NON_3GPP_AS_ESTABLISHED:
return "NON_3GPP_AS_ESTABLISHED";
case EServiceReqCause::IDLE_3GPP_NOTIFICATION_N3GPP:
return "IDLE_3GPP_NOTIFICATION_N3GPP";
case EServiceReqCause::EMERGENCY_FALLBACK:
return "EMERGENCY_FALLBACK";
case EServiceReqCause::FALLBACK_INDICATION:
return "FALLBACK_INDICATION";
default:
return "?";
}
}
} // namespace nr::ue } // namespace nr::ue
...@@ -495,5 +495,6 @@ Json ToJson(const UeTimers &v); ...@@ -495,5 +495,6 @@ Json ToJson(const UeTimers &v);
Json ToJson(const ERegUpdateCause &v); Json ToJson(const ERegUpdateCause &v);
Json ToJson(const EPsState &v); Json ToJson(const EPsState &v);
Json ToJson(const UePduSessionInfo &v); Json ToJson(const UePduSessionInfo &v);
Json ToJson(const EServiceReqCause &v);
} // namespace nr::ue } // namespace nr::ue
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