Commit b7a56d6d authored by aligungr's avatar aligungr

gNB CLI improvements

parent c2374dd8
...@@ -64,21 +64,21 @@ namespace app ...@@ -64,21 +64,21 @@ namespace app
static std::map<std::string, std::string> g_gnbCmdToDescription = { static std::map<std::string, std::string> g_gnbCmdToDescription = {
{"status", "Show some status information about the gNB"}, {"status", "Show some status information about the gNB"},
{"amf-list", "List all AMFs associated with the gNB"}, {"amf-list", "List all AMFs associated with the gNB"},
{"amf-status", "Show some status information about the given AMF"}, {"amf-info", "Show some status information about the given AMF"},
{"info", "Show some information about the gNB"}, {"info", "Show some information about the gNB"},
}; };
static std::map<std::string, std::string> g_gnbCmdToUsage = { static std::map<std::string, std::string> g_gnbCmdToUsage = {
{"status", "[option...]"}, {"status", "[option...]"},
{"amf-list", "[option...]"}, {"amf-list", "[option...]"},
{"amf-status", "<amf-id> [option...]"}, {"amf-info", "<amf-id> [option...]"},
{"info", "[option...]"}, {"info", "[option...]"},
}; };
static std::map<std::string, bool> g_gnbCmdToHelpIfEmpty = { static std::map<std::string, bool> g_gnbCmdToHelpIfEmpty = {
{"status", false}, {"status", false},
{"amf-list", false}, {"amf-list", false},
{"amf-status", true}, {"amf-info", true},
{"info", false}, {"info", false},
}; };
...@@ -133,9 +133,9 @@ std::unique_ptr<GnbCliCommand> ParseGnbCliCommand(std::vector<std::string> &&tok ...@@ -133,9 +133,9 @@ std::unique_ptr<GnbCliCommand> ParseGnbCliCommand(std::vector<std::string> &&tok
{ {
return std::make_unique<GnbCliCommand>(GnbCliCommand::AMF_LIST); return std::make_unique<GnbCliCommand>(GnbCliCommand::AMF_LIST);
} }
else if (subCmd == "amf-status") else if (subCmd == "amf-info")
{ {
auto cmd = std::make_unique<GnbCliCommand>(GnbCliCommand::AMF_STATUS); auto cmd = std::make_unique<GnbCliCommand>(GnbCliCommand::AMF_INFO);
if (options.positionalCount() == 0) if (options.positionalCount() == 0)
CMD_ERR("AMF ID is expected") CMD_ERR("AMF ID is expected")
if (options.positionalCount() > 1) if (options.positionalCount() > 1)
......
...@@ -22,10 +22,10 @@ struct GnbCliCommand ...@@ -22,10 +22,10 @@ struct GnbCliCommand
STATUS, STATUS,
INFO, INFO,
AMF_LIST, AMF_LIST,
AMF_STATUS AMF_INFO
} present; } present;
// AMF_STATUS // AMF_INFO
int amfId{}; int amfId{};
explicit GnbCliCommand(PR present) : present(present) explicit GnbCliCommand(PR present) : present(present)
......
...@@ -107,7 +107,7 @@ void GnbCmdHandler::HandleCmdImpl(TaskBase &base, NwGnbCliCommand &msg) ...@@ -107,7 +107,7 @@ void GnbCmdHandler::HandleCmdImpl(TaskBase &base, NwGnbCliCommand &msg)
msg.sendResult(ss.str()); msg.sendResult(ss.str());
break; break;
} }
case app::GnbCliCommand::AMF_STATUS: { case app::GnbCliCommand::AMF_INFO: {
if (base.ngapTask->m_amfCtx.count(msg.cmd->amfId) == 0) if (base.ngapTask->m_amfCtx.count(msg.cmd->amfId) == 0)
msg.sendError("AMF not found with given ID"); msg.sendError("AMF not found with given ID");
else else
......
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