Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/11506
Change subject: add a VTY command which shows a specific HNB ...................................................................... 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 --- M src/hnbgw_vty.c 1 file changed, 26 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/06/11506/1 diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c index 859cd31..1561aed 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,30 @@ 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 *name = argv[0]; + + if (llist_empty(&g_hnb_gw->hnb_list)) { + vty_out(vty, "No HNB connected%s", VTY_NEWLINE); + return CMD_SUCCESS; + } + + llist_for_each_entry(hnb, &g_hnb_gw->hnb_list, list) { + if (strcmp(name, hnb->identity_info) != 0) + continue; + vty_dump_hnb_info(vty, hnb); + found = 1; + break; + } + + if (!found) + vty_out(vty, "No HNB found with identity '%s'%s", name, VTY_NEWLINE); + 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 +401,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); } -- To view, visit https://gerrit.osmocom.org/11506 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iab12aa4ab090b72c472358b84daf6919b30747f6 Gerrit-Change-Number: 11506 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling <ssperl...@sysmocom.de>