Commit 2c1f2b6c authored by aligungr's avatar aligungr

Refactor

parent 31196a88
...@@ -95,33 +95,31 @@ nas::IE5gsMobileIdentity NasMm::getOrGeneratePreferredId() ...@@ -95,33 +95,31 @@ nas::IE5gsMobileIdentity NasMm::getOrGeneratePreferredId()
{ {
if (m_storage.m_storedGuti.type != nas::EIdentityType::NO_IDENTITY) if (m_storage.m_storedGuti.type != nas::EIdentityType::NO_IDENTITY)
return m_storage.m_storedGuti; return m_storage.m_storedGuti;
auto suci = getOrGenerateSuci();
if (suci.type != nas::EIdentityType::NO_IDENTITY)
{
return suci;
}
else if (m_base->config->imei.has_value())
{
nas::IE5gsMobileIdentity res{};
res.type = nas::EIdentityType::IMEI;
res.value = *m_base->config->imei;
return res;
}
else if (m_base->config->imeiSv.has_value())
{
nas::IE5gsMobileIdentity res{};
res.type = nas::EIdentityType::IMEISV;
res.value = *m_base->config->imeiSv;
return res;
}
else else
{ {
auto suci = getOrGenerateSuci(); nas::IE5gsMobileIdentity res{};
if (suci.type != nas::EIdentityType::NO_IDENTITY) res.type = nas::EIdentityType::NO_IDENTITY;
{ return res;
return suci;
}
else if (m_base->config->imei.has_value())
{
nas::IE5gsMobileIdentity res{};
res.type = nas::EIdentityType::IMEI;
res.value = *m_base->config->imei;
return res;
}
else if (m_base->config->imeiSv.has_value())
{
nas::IE5gsMobileIdentity res{};
res.type = nas::EIdentityType::IMEISV;
res.value = *m_base->config->imeiSv;
return res;
}
else
{
nas::IE5gsMobileIdentity res{};
res.type = nas::EIdentityType::NO_IDENTITY;
return res;
}
} }
} }
......
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