<p>Stefan Sperling has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11506">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">add a VTY command which shows a specific HNB<br><br>Add the 'show hnb NAME' VTY command which displays just<br>one specific HNB, addressed by its identity string.<br>This augments the functionality provided by 'show hnb all'.<br><br>Change-Id: Iab12aa4ab090b72c472358b84daf6919b30747f6<br>Related: OS#2774<br>---<br>M src/hnbgw_vty.c<br>1 file changed, 26 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/06/11506/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c</span><br><span>index 859cd31..1561aed 100644</span><br><span>--- a/src/hnbgw_vty.c</span><br><span>+++ b/src/hnbgw_vty.c</span><br><span>@@ -200,7 +200,7 @@</span><br><span>    vty_out(vty, "UE IMSI \"%s\" context ID %u%s", ue->imsi, ue->context_id, VTY_NEWLINE);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-DEFUN(show_hnb, show_hnb_cmd, "show hnb all", SHOW_STR "Display information about a HNB")</span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN(show_hnb, show_hnb_cmd, "show hnb all", SHOW_STR "Display information about all HNB")</span><br><span> {</span><br><span>         struct hnb_context *hnb;</span><br><span>     unsigned int count = 0;</span><br><span>@@ -220,6 +220,30 @@</span><br><span>       return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN(show_one_hnb, show_one_hnb_cmd, "show hnb NAME ", SHOW_STR "Display information about a HNB")</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      struct hnb_context *hnb;</span><br><span style="color: hsl(120, 100%, 40%);">+      int found = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+        const char *name = argv[0];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (llist_empty(&g_hnb_gw->hnb_list)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                vty_out(vty, "No HNB connected%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+            return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   llist_for_each_entry(hnb, &g_hnb_gw->hnb_list, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+         if (strcmp(name, hnb->identity_info) != 0)</span><br><span style="color: hsl(120, 100%, 40%);">+                 continue;</span><br><span style="color: hsl(120, 100%, 40%);">+             vty_dump_hnb_info(vty, hnb);</span><br><span style="color: hsl(120, 100%, 40%);">+          found = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+            break;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!found)</span><br><span style="color: hsl(120, 100%, 40%);">+           vty_out(vty, "No HNB found with identity '%s'%s", name, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+       return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> DEFUN(show_ue, show_ue_cmd, "show ue all", SHOW_STR "Display information about a UE")</span><br><span> {</span><br><span>   struct ue_context *ue;</span><br><span>@@ -377,6 +401,7 @@</span><br><span> </span><br><span>     install_element_ve(&show_cnlink_cmd);</span><br><span>    install_element_ve(&show_hnb_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+        install_element_ve(&show_one_hnb_cmd);</span><br><span>   install_element_ve(&show_ue_cmd);</span><br><span>        install_element_ve(&show_talloc_cmd);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11506">change 11506</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11506"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-iuh </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Iab12aa4ab090b72c472358b84daf6919b30747f6 </div>
<div style="display:none"> Gerrit-Change-Number: 11506 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@sysmocom.de> </div>