<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-hnodeb/+/26022">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Configure HNB-Identity over VTY and use it in HnbRegisterRequest<br><br>Change-Id: Ida47bbb85b5438a2ec9805005bc2ab834c79b765<br>---<br>M include/osmocom/hnodeb/hnodeb.h<br>M src/osmo-hnodeb/hnb.c<br>M src/osmo-hnodeb/hnbap.c<br>M src/osmo-hnodeb/vty.c<br>4 files changed, 17 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/22/26022/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/hnodeb/hnodeb.h b/include/osmocom/hnodeb/hnodeb.h</span><br><span>index a9da991..7bb1511 100644</span><br><span>--- a/include/osmocom/hnodeb/hnodeb.h</span><br><span>+++ b/include/osmocom/hnodeb/hnodeb.h</span><br><span>@@ -72,6 +72,7 @@</span><br><span> };</span><br><span> </span><br><span> struct hnb {</span><br><span style="color: hsl(120, 100%, 40%);">+       char *identity; /* HNB-Identity */</span><br><span>   struct osmo_plmn_id plmn;</span><br><span>    uint16_t cell_identity;</span><br><span>      uint16_t lac;</span><br><span>diff --git a/src/osmo-hnodeb/hnb.c b/src/osmo-hnodeb/hnb.c</span><br><span>index b0628e5..34ff426 100644</span><br><span>--- a/src/osmo-hnodeb/hnb.c</span><br><span>+++ b/src/osmo-hnodeb/hnb.c</span><br><span>@@ -116,6 +116,7 @@</span><br><span>         if (!hnb)</span><br><span>            return NULL;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+      hnb->identity = talloc_strdup(hnb, "OsmoHNodeB");</span><br><span>       hnb->plmn = (struct osmo_plmn_id){</span><br><span>                .mcc = 1,</span><br><span>            .mnc = 1,</span><br><span>diff --git a/src/osmo-hnodeb/hnbap.c b/src/osmo-hnodeb/hnbap.c</span><br><span>index 8e0bfa6..5b901ac 100644</span><br><span>--- a/src/osmo-hnodeb/hnbap.c</span><br><span>+++ b/src/osmo-hnodeb/hnbap.c</span><br><span>@@ -157,7 +157,6 @@</span><br><span>     uint8_t rac;</span><br><span>         uint32_t cid;</span><br><span>        uint8_t plmn[3];</span><br><span style="color: hsl(0, 100%, 40%);">-        char identity[50] = "ATestHNB@";</span><br><span> </span><br><span>       HNBAP_HNBRegisterRequestIEs_t request;</span><br><span>       memset(&request, 0, sizeof(request));</span><br><span>@@ -167,8 +166,8 @@</span><br><span>      asn1_u8_to_str(&request.rac, &rac, hnb->rac);</span><br><span>     asn1_u28_to_bitstring(&request.cellIdentity, &cid, hnb->cell_identity);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  request.hnB_Identity.hNB_Identity_Info.buf = (uint8_t*) identity;</span><br><span style="color: hsl(0, 100%, 40%);">-       request.hnB_Identity.hNB_Identity_Info.size = strlen(identity);</span><br><span style="color: hsl(120, 100%, 40%);">+       request.hnB_Identity.hNB_Identity_Info.buf = (uint8_t*) hnb->identity;</span><br><span style="color: hsl(120, 100%, 40%);">+     request.hnB_Identity.hNB_Identity_Info.size = strlen(hnb->identity);</span><br><span> </span><br><span>  osmo_plmn_to_bcd(plmn, &hnb->plmn);</span><br><span>   request.plmNidentity.buf = plmn;</span><br><span>diff --git a/src/osmo-hnodeb/vty.c b/src/osmo-hnodeb/vty.c</span><br><span>index 6be938e..8824b77 100644</span><br><span>--- a/src/osmo-hnodeb/vty.c</span><br><span>+++ b/src/osmo-hnodeb/vty.c</span><br><span>@@ -83,6 +83,17 @@</span><br><span>       return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN_USRATTR(cfg_hnodeb_identity,</span><br><span style="color: hsl(120, 100%, 40%);">+            cfg_hnodeb_identity_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+              0,</span><br><span style="color: hsl(120, 100%, 40%);">+            "identity TEXT",</span><br><span style="color: hsl(120, 100%, 40%);">+            "Set the HNB-identity of this HnodeB\n" "HNB-Identity\n")</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        struct hnb *hnb = (struct hnb *)vty->index;</span><br><span style="color: hsl(120, 100%, 40%);">+        osmo_talloc_replace_string(g_hnb, &hnb->identity, argv[0]);</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_USRATTR(cfg_hnodeb_ncc,</span><br><span>          cfg_hnodeb_ncc_cmd,</span><br><span>          0,</span><br><span>@@ -239,6 +250,7 @@</span><br><span> static int config_write_hnodeb(struct vty *vty)</span><br><span> {</span><br><span>       vty_out(vty, "hnodeb%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+      vty_out(vty, " identity %s%s", g_hnb->identity, VTY_NEWLINE);</span><br><span>   vty_out(vty, " network country code %s%s", osmo_mcc_name(g_hnb->plmn.mcc), VTY_NEWLINE);</span><br><span>        vty_out(vty, " mobile network code %s%s",</span><br><span>          osmo_mnc_name(g_hnb->plmn.mnc, g_hnb->plmn.mnc_3_digits), VTY_NEWLINE);</span><br><span>@@ -361,6 +373,7 @@</span><br><span> {</span><br><span>     install_element(CONFIG_NODE, &cfg_hnodeb_cmd);</span><br><span>   install_node(&hnodeb_node, config_write_hnodeb);</span><br><span style="color: hsl(120, 100%, 40%);">+  install_element(HNODEB_NODE, &cfg_hnodeb_identity_cmd);</span><br><span>  install_element(HNODEB_NODE, &cfg_hnodeb_ncc_cmd);</span><br><span>       install_element(HNODEB_NODE, &cfg_hnodeb_mnc_cmd);</span><br><span>       install_element(HNODEB_NODE, &cfg_hnodeb_ci_cmd);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-hnodeb/+/26022">change 26022</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/c/osmo-hnodeb/+/26022"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hnodeb </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ida47bbb85b5438a2ec9805005bc2ab834c79b765 </div>
<div style="display:none"> Gerrit-Change-Number: 26022 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>