add a VTY command which shows a specific HNB
Add the 'show hnb NAME' VTY command which displays just
one specific HNB, addressed by its identity string.
This augments the functionality provided by 'show hnb all'.
Change-Id: Iab12aa4ab090b72c472358b84daf6919b30747f6
Related: OS#2774
diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index 859cd31..15fdaf8 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -200,7 +200,7 @@
vty_out(vty, "UE IMSI \"%s\" context ID %u%s", ue->imsi, ue->context_id, VTY_NEWLINE);
}
-DEFUN(show_hnb, show_hnb_cmd, "show hnb all", SHOW_STR "Display information about a HNB")
+DEFUN(show_hnb, show_hnb_cmd, "show hnb all", SHOW_STR "Display information about all HNB")
{
struct hnb_context *hnb;
unsigned int count = 0;
@@ -220,6 +220,27 @@
return CMD_SUCCESS;
}
+DEFUN(show_one_hnb, show_one_hnb_cmd, "show hnb NAME ", SHOW_STR "Display information about a HNB")
+{
+ struct hnb_context *hnb;
+ int found = 0;
+ const char *identity_info = argv[0];
+
+ if (llist_empty(&g_hnb_gw->hnb_list)) {
+ vty_out(vty, "No HNB connected%s", VTY_NEWLINE);
+ return CMD_SUCCESS;
+ }
+
+ hnb = hnb_context_by_identity_info(&g_hnb_gw, identity_info);
+ if (hnb == NULL) {
+ vty_out(vty, "No HNB found with identity '%s'%s", identity_info, VTY_NEWLINE);
+ return CMD_SUCCESS;
+ }
+
+ vty_dump_hnb_info(vty, hnb);
+ return CMD_SUCCESS;
+}
+
DEFUN(show_ue, show_ue_cmd, "show ue all", SHOW_STR "Display information about a UE")
{
struct ue_context *ue;
@@ -377,6 +398,7 @@
install_element_ve(&show_cnlink_cmd);
install_element_ve(&show_hnb_cmd);
+ install_element_ve(&show_one_hnb_cmd);
install_element_ve(&show_ue_cmd);
install_element_ve(&show_talloc_cmd);
}