Commit 30aa3e29 authored by aligungr's avatar aligungr

gNB CLI improvement

parent fc26acac
......@@ -7,6 +7,7 @@
//
#include "task.hpp"
#include "cmd_handler.hpp"
#include <gnb/nts.hpp>
namespace nr::gnb
......@@ -37,40 +38,19 @@ void GnbAppTask::onLoop()
m_statusInfo.isNgapUp = w->isNgapUp;
break;
}
delete w;
break;
}
case NtsMessageType::GNB_CLI_COMMAND: {
auto *w = dynamic_cast<NwGnbCliCommand *>(msg);
switch (w->cmd->present)
{
case app::GnbCliCommand::STATUS: {
w->sendResult(m_statusInfo.toString());
delete w;
break;
}
case app::GnbCliCommand::INFO: {
w->sendResult(m_base->config->toString());
delete w;
break;
}
case app::GnbCliCommand::AMF_LIST:
case app::GnbCliCommand::AMF_STATUS: {
m_base->ngapTask->push(w);
break;
}
default: {
delete w;
break;
}
}
GnbCmdHandler::HandleCmd(*m_base, *w);
break;
}
default:
m_logger->unhandledNts(msg);
delete msg;
break;
}
delete msg;
}
void GnbAppTask::onQuit()
......
......@@ -9,6 +9,7 @@
#include "task.hpp"
#include <asn/ngap/ASN_NGAP_QosFlowSetupRequestItem.h>
#include <gnb/mr/task.hpp>
#include <gtp/encode.hpp>
#include <gtp/message.hpp>
#include <utils/constants.hpp>
......
......@@ -9,6 +9,8 @@
#include "task.hpp"
#include "rls.hpp"
#include <gnb/nts.hpp>
#include <gnb/rrc/task.hpp>
#include <gnb/gtp/task.hpp>
#include <utils/constants.hpp>
#include <utils/libc_error.hpp>
......
......@@ -26,6 +26,7 @@
#include <asn/ngap/ASN_NGAP_QosFlowPerTNLInformationList.h>
#include <asn/ngap/ASN_NGAP_QosFlowSetupRequestItem.h>
#include <asn/ngap/ASN_NGAP_QosFlowSetupRequestList.h>
#include <gnb/gtp/task.hpp>
namespace nr::gnb
{
......
......@@ -8,8 +8,8 @@
#include "task.hpp"
#include <gnb/app/task.hpp>
#include <gnb/sctp/task.hpp>
#include <sstream>
#include <utils/common.hpp>
namespace nr::gnb
{
......@@ -82,34 +82,6 @@ void NgapTask::onLoop()
}
break;
}
case NtsMessageType::GNB_CLI_COMMAND: {
auto *w = dynamic_cast<NwGnbCliCommand *>(msg);
switch (w->cmd->present)
{
case app::GnbCliCommand::AMF_LIST: {
std::stringstream ss{};
for (auto &amf : m_amfCtx)
ss << "* amf-id: " << amf.first << "\n";
utils::Trim(ss);
w->sendResult(ss.str());
break;
}
case app::GnbCliCommand::AMF_STATUS: {
if (m_amfCtx.count(w->cmd->amfId) == 0)
w->sendError("AMF not found with given ID");
else
{
auto amf = m_amfCtx[w->cmd->amfId];
w->sendResult("state: " + std::to_string((int)amf->state));
}
break;
}
default: {
break;
}
}
break;
}
default: {
m_logger->unhandledNts(msg);
break;
......
......@@ -9,6 +9,7 @@
#include "task.hpp"
#include <asn/rrc/ASN_RRC_DLInformationTransfer-IEs.h>
#include <asn/rrc/ASN_RRC_DLInformationTransfer.h>
#include <gnb/mr/task.hpp>
#include <gnb/nts.hpp>
#include <rrc/encode.hpp>
......
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