Commit f1ee3190 authored by aligungr's avatar aligungr

UAC Access identity determination

parent 22416f85
...@@ -73,4 +73,57 @@ bool NasMm::isInNonAllowedArea() ...@@ -73,4 +73,57 @@ bool NasMm::isInNonAllowedArea()
return false; return false;
} }
std::bitset<16> NasMm::determineAccessIdentities()
{
std::bitset<16> ais;
auto currentPlmn = m_base->shCtx.getCurrentPlmn();
if (m_base->config->uacAic.mps && m_rmState == ERmState::RM_REGISTERED && currentPlmn.hasValue())
{
if (currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn) ||
currentPlmn.mcc == m_base->config->hplmn.mcc)
{
ais[1] = true;
}
}
if (m_base->config->uacAic.mcs && m_rmState == ERmState::RM_REGISTERED && currentPlmn.hasValue())
{
if (currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn) ||
currentPlmn.mcc == m_base->config->hplmn.mcc)
{
ais[2] = true;
}
}
if (m_nwFeatureSupport)
{
if (m_nwFeatureSupport->mpsi == nas::EMpsIndicator::SUPPORTED)
ais[1] = true;
if (m_nwFeatureSupport->mcsi && m_nwFeatureSupport->mcsi == nas::EMcsIndicator::VALID)
ais[2] = true;
}
if (currentPlmn.hasValue() &&
(currentPlmn == m_base->config->hplmn || m_storage->equivalentPlmnList->contains(currentPlmn)))
{
ais[11] = true;
ais[15] = true;
}
if (currentPlmn.hasValue() &&
(currentPlmn == m_base->config->hplmn || currentPlmn.mcc == m_base->config->hplmn.mcc))
{
ais[12] = true;
ais[13] = true;
ais[14] = true;
}
if (ais.none())
ais[0] = true;
return ais;
}
} // namespace nr::ue } // namespace nr::ue
...@@ -58,7 +58,7 @@ class NasMm ...@@ -58,7 +58,7 @@ class NasMm
// Indicates registered for emergency services (Only meaningful in RM-REGISTERED state, or implies the last one) // Indicates registered for emergency services (Only meaningful in RM-REGISTERED state, or implies the last one)
bool m_registeredForEmergency{}; bool m_registeredForEmergency{};
// Network feature support information // Network feature support information
nas::IE5gsNetworkFeatureSupport m_nwFeatureSupport{}; std::optional<nas::IE5gsNetworkFeatureSupport> m_nwFeatureSupport{};
// Number of times the network failing the authentication check // Number of times the network failing the authentication check
int m_nwConsecutiveAuthFailure{}; int m_nwConsecutiveAuthFailure{};
// Last time PLMN search failure logged // Last time PLMN search failure logged
...@@ -174,6 +174,7 @@ class NasMm ...@@ -174,6 +174,7 @@ class NasMm
bool hasEmergency(); bool hasEmergency();
void setN1Capability(bool enabled); void setN1Capability(bool enabled);
bool isInNonAllowedArea(); bool isInNonAllowedArea();
std::bitset<16> determineAccessIdentities();
private: /* eCall */ private: /* eCall */
bool startECallInactivityIfNeeded(); bool startECallInactivityIfNeeded();
......
...@@ -381,7 +381,27 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg) ...@@ -381,7 +381,27 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
} }
// Store the network feature support // Store the network feature support
m_nwFeatureSupport = msg.networkFeatureSupport.value_or(nas::IE5gsNetworkFeatureSupport{}); if (msg.networkFeatureSupport)
{
if (m_nwFeatureSupport)
{
m_nwFeatureSupport->imsVoPs3gpp = msg.networkFeatureSupport->imsVoPs3gpp;
m_nwFeatureSupport->imsVoPsN3gpp = msg.networkFeatureSupport->imsVoPsN3gpp;
m_nwFeatureSupport->emc = msg.networkFeatureSupport->emc;
m_nwFeatureSupport->emf = msg.networkFeatureSupport->emf;
m_nwFeatureSupport->iwkN26 = msg.networkFeatureSupport->iwkN26;
m_nwFeatureSupport->mpsi = msg.networkFeatureSupport->mpsi;
if (msg.networkFeatureSupport->emcn3)
m_nwFeatureSupport->emcn3 = msg.networkFeatureSupport->emcn3;
if (msg.networkFeatureSupport->mcsi)
m_nwFeatureSupport->mcsi = msg.networkFeatureSupport->mcsi;
}
else
{
m_nwFeatureSupport = msg.networkFeatureSupport;
}
}
if (sendComplete) if (sendComplete)
{ {
...@@ -509,8 +529,27 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg ...@@ -509,8 +529,27 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
} }
// Store the network feature support // Store the network feature support
if (msg.networkFeatureSupport.has_value()) if (msg.networkFeatureSupport)
m_nwFeatureSupport = *msg.networkFeatureSupport; {
if (m_nwFeatureSupport)
{
m_nwFeatureSupport->imsVoPs3gpp = msg.networkFeatureSupport->imsVoPs3gpp;
m_nwFeatureSupport->imsVoPsN3gpp = msg.networkFeatureSupport->imsVoPsN3gpp;
m_nwFeatureSupport->emc = msg.networkFeatureSupport->emc;
m_nwFeatureSupport->emf = msg.networkFeatureSupport->emf;
m_nwFeatureSupport->iwkN26 = msg.networkFeatureSupport->iwkN26;
m_nwFeatureSupport->mpsi = msg.networkFeatureSupport->mpsi;
if (msg.networkFeatureSupport->emcn3)
m_nwFeatureSupport->emcn3 = msg.networkFeatureSupport->emcn3;
if (msg.networkFeatureSupport->mcsi)
m_nwFeatureSupport->mcsi = msg.networkFeatureSupport->mcsi;
}
else
{
m_nwFeatureSupport = msg.networkFeatureSupport;
}
}
// The service request attempt counter shall be reset when registration procedure for mobility and periodic // The service request attempt counter shall be reset when registration procedure for mobility and periodic
// registration update is successfully completed // registration update is successfully completed
......
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