Commit e1182d4d authored by aligungr's avatar aligungr

UAC implementation

parent d6f38e6f
......@@ -8,6 +8,8 @@
#include "task.hpp"
#include <algorithm>
#include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp>
......@@ -21,7 +23,43 @@ void UeRrcTask::performUac(std::shared_ptr<LightSync<UacInput, UacOutput>> &uacC
m_establishmentCause = input.establishmentCause;
auto output = std::make_unique<UacOutput>();
output->res = EUacResult::ALLOWED; // TODO
int cellId = m_base->shCtx.currentCell.get().cellId;
if (m_cellDesc.count(cellId))
{
auto &desc = m_cellDesc[cellId];
if (!desc.mib.hasMib || !desc.sib1.hasSib1 || desc.mib.isBarred || desc.sib1.isReserved)
output->res = EUacResult::BARRED;
else
{
size_t barredCount = 0;
if (desc.sib1.aiBarringSet.ai1 && input.identities[1])
barredCount++;
if (desc.sib1.aiBarringSet.ai2 && input.identities[2])
barredCount++;
if (desc.sib1.aiBarringSet.ai11 && input.identities[11])
barredCount++;
if (desc.sib1.aiBarringSet.ai12 && input.identities[12])
barredCount++;
if (desc.sib1.aiBarringSet.ai13 && input.identities[13])
barredCount++;
if (desc.sib1.aiBarringSet.ai14 && input.identities[14])
barredCount++;
if (desc.sib1.aiBarringSet.ai15 && input.identities[15])
barredCount++;
if (input.identities.count() == barredCount)
output->res = EUacResult::BARRED;
else
output->res = EUacResult::ALLOWED;
}
}
else
{
output->res = EUacResult::BARRED;
}
uacCtl->notifyProcessed(std::move(output));
}
......
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