<p>pespin <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-hnodeb/+/26000">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  pespin: Verified
  fixeria: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Move hnbap related code to hnbap.c/h<br><br>Change-Id: I8356421169bebe1d411b05b19241ea639dc3f733<br>---<br>M include/osmocom/hnodeb/Makefile.am<br>A include/osmocom/hnodeb/hnbap.h<br>M include/osmocom/hnodeb/hnodeb.h<br>M src/osmo-hnodeb/Makefile.am<br>A src/osmo-hnodeb/hnbap.c<br>M src/osmo-hnodeb/main.c<br>M src/osmo-hnodeb/vty.c<br>7 files changed, 261 insertions(+), 197 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/hnodeb/Makefile.am b/include/osmocom/hnodeb/Makefile.am</span><br><span>index 339f8a3..f6c91b4 100644</span><br><span>--- a/include/osmocom/hnodeb/Makefile.am</span><br><span>+++ b/include/osmocom/hnodeb/Makefile.am</span><br><span>@@ -1,4 +1,5 @@</span><br><span> noinst_HEADERS = \</span><br><span style="color: hsl(120, 100%, 40%);">+ hnbap.h \</span><br><span>    hnodeb.h \</span><br><span>   ranap.h \</span><br><span>    rua.h \</span><br><span>diff --git a/include/osmocom/hnodeb/hnbap.h b/include/osmocom/hnodeb/hnbap.h</span><br><span>new file mode 100644</span><br><span>index 0000000..22f6d25</span><br><span>--- /dev/null</span><br><span>+++ b/include/osmocom/hnodeb/hnbap.h</span><br><span>@@ -0,0 +1,31 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/* (C) 2015 by Daniel Willmann <dwillmann@sysmocom.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * Author: Pau Espin Pedrol <pespin@sysmocom.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * All Rights Reserved</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU Affero General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; either version 3 of the License, or</span><br><span style="color: hsl(120, 100%, 40%);">+ * (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU Affero General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * You should have received a copy of the GNU Affero General Public License</span><br><span style="color: hsl(120, 100%, 40%);">+ * along with this program.  If not, see <http://www.gnu.org/lienses/>.</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%);">+#pragma once</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <asn1c/ANY.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+struct hnb;</span><br><span style="color: hsl(120, 100%, 40%);">+struct msg;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+int hnb_hnbap_rx(struct hnb *hnb, struct msgb *msg);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str);</span><br><span style="color: hsl(120, 100%, 40%);">+void hnb_send_register_req(struct hnb *hnb);</span><br><span style="color: hsl(120, 100%, 40%);">+void hnb_send_deregister_req(struct hnb *hnb);</span><br><span>diff --git a/include/osmocom/hnodeb/hnodeb.h b/include/osmocom/hnodeb/hnodeb.h</span><br><span>index e36311e..b283145 100644</span><br><span>--- a/include/osmocom/hnodeb/hnodeb.h</span><br><span>+++ b/include/osmocom/hnodeb/hnodeb.h</span><br><span>@@ -103,9 +103,6 @@</span><br><span> void hnb_nas_rx_dtap(struct hnb *hnb, void *data, int len);</span><br><span> void hnb_rx_secmode_cmd(struct hnb *hnb, long ip_alg);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str);</span><br><span style="color: hsl(0, 100%, 40%);">-void hnb_send_register_req(struct hnb *hnb);</span><br><span style="color: hsl(0, 100%, 40%);">-void hnb_send_deregister_req(struct hnb *hnb);</span><br><span> struct msgb *gen_initue_lu(int is_ps, uint32_t conn_id, const char *imsi);</span><br><span> </span><br><span> extern void *tall_hnb_ctx;</span><br><span>diff --git a/src/osmo-hnodeb/Makefile.am b/src/osmo-hnodeb/Makefile.am</span><br><span>index d1cd3ec..1162944 100644</span><br><span>--- a/src/osmo-hnodeb/Makefile.am</span><br><span>+++ b/src/osmo-hnodeb/Makefile.am</span><br><span>@@ -31,6 +31,7 @@</span><br><span> osmo_hnodeb_SOURCES = \</span><br><span>      main.c \</span><br><span>     debug.c \</span><br><span style="color: hsl(120, 100%, 40%);">+     hnbap.c \</span><br><span>    ranap.c \</span><br><span>    rua.c \</span><br><span>      vty.c \</span><br><span>diff --git a/src/osmo-hnodeb/hnbap.c b/src/osmo-hnodeb/hnbap.c</span><br><span>new file mode 100644</span><br><span>index 0000000..7e54004</span><br><span>--- /dev/null</span><br><span>+++ b/src/osmo-hnodeb/hnbap.c</span><br><span>@@ -0,0 +1,226 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/* (C) 2015 by Daniel Willmann <dwillmann@sysmocom.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * Author: Pau Espin Pedrol <pespin@sysmocom.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * All Rights Reserved</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU Affero General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; either version 3 of the License, or</span><br><span style="color: hsl(120, 100%, 40%);">+ * (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU Affero General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * You should have received a copy of the GNU Affero General Public License</span><br><span style="color: hsl(120, 100%, 40%);">+ * along with this program.  If not, see <http://www.gnu.org/lienses/>.</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <errno.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <asn1c/ANY.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/core/msgb.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/netif/stream.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/hnbap/hnbap_common.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/hnbap/hnbap_ies_defs.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/ranap/iu_helpers.h> /* ranap_bcd_decode() */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/hnodeb/hnbap.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/hnodeb/hnodeb.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static int hnb_rx_hnb_register_acc(struct hnb *hnb, ANY_t *in)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+       HNBAP_HNBRegisterAcceptIEs_t accept;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        rc = hnbap_decode_hnbregisteraccepties(&accept, in);</span><br><span style="color: hsl(120, 100%, 40%);">+      if (rc < 0) {</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%);">+   hnb->rnc_id = accept.rnc_id;</span><br><span style="color: hsl(120, 100%, 40%);">+       printf("HNB Register accept with RNC ID %u\n", hnb->rnc_id);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   hnbap_free_hnbregisteraccepties(&accept);</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</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%);">+static int hnb_rx_ue_register_acc(struct hnb *hnb, ANY_t *in)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+       uint32_t ctx_id;</span><br><span style="color: hsl(120, 100%, 40%);">+      HNBAP_UERegisterAcceptIEs_t accept;</span><br><span style="color: hsl(120, 100%, 40%);">+   char imsi[16];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      rc = hnbap_decode_ueregisteraccepties(&accept, in);</span><br><span style="color: hsl(120, 100%, 40%);">+       if (rc < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+              return rc;</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 (accept.uE_Identity.present != HNBAP_UE_Identity_PR_iMSI) {</span><br><span style="color: hsl(120, 100%, 40%);">+                printf("Wrong type in UE register accept\n");</span><br><span style="color: hsl(120, 100%, 40%);">+               return -1;</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%);">+   ctx_id = asn1bitstr_to_u24(&accept.context_ID);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ranap_bcd_decode(imsi, sizeof(imsi), accept.uE_Identity.choice.iMSI.buf,</span><br><span style="color: hsl(120, 100%, 40%);">+                      accept.uE_Identity.choice.iMSI.size);</span><br><span style="color: hsl(120, 100%, 40%);">+ printf("UE Register accept for IMSI %s, context %u\n", imsi, ctx_id);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     hnb->ctx_id = ctx_id;</span><br><span style="color: hsl(120, 100%, 40%);">+      hnbap_free_ueregisteraccepties(&accept);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return 0;</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%);">+int hnb_hnbap_rx(struct hnb *hnb, struct msgb *msg)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        HNBAP_HNBAP_PDU_t _pdu, *pdu = &_pdu;</span><br><span style="color: hsl(120, 100%, 40%);">+     asn_dec_rval_t dec_ret;</span><br><span style="color: hsl(120, 100%, 40%);">+       int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     memset(pdu, 0, sizeof(*pdu));</span><br><span style="color: hsl(120, 100%, 40%);">+ dec_ret = aper_decode(NULL, &asn_DEF_HNBAP_HNBAP_PDU, (void **) &pdu,</span><br><span style="color: hsl(120, 100%, 40%);">+                       msg->data, msgb_length(msg), 0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (dec_ret.code != RC_OK) {</span><br><span style="color: hsl(120, 100%, 40%);">+          LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n");</span><br><span style="color: hsl(120, 100%, 40%);">+         return -EINVAL;</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 (pdu->present != HNBAP_HNBAP_PDU_PR_successfulOutcome) {</span><br><span style="color: hsl(120, 100%, 40%);">+                printf("Unexpected HNBAP message received\n");</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%);">+   switch (pdu->choice.successfulOutcome.procedureCode) {</span><br><span style="color: hsl(120, 100%, 40%);">+     case HNBAP_ProcedureCode_id_HNBRegister:</span><br><span style="color: hsl(120, 100%, 40%);">+              /* Get HNB id and send UE Register request */</span><br><span style="color: hsl(120, 100%, 40%);">+         rc = hnb_rx_hnb_register_acc(hnb, &pdu->choice.successfulOutcome.value);</span><br><span style="color: hsl(120, 100%, 40%);">+               break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case HNBAP_ProcedureCode_id_UERegister:</span><br><span style="color: hsl(120, 100%, 40%);">+               rc = hnb_rx_ue_register_acc(hnb, &pdu->choice.successfulOutcome.value);</span><br><span style="color: hsl(120, 100%, 40%);">+                break;</span><br><span style="color: hsl(120, 100%, 40%);">+        default:</span><br><span style="color: hsl(120, 100%, 40%);">+              rc = -ENOSPC;</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%);">+   return rc;</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%);">+int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct msgb *msg;</span><br><span style="color: hsl(120, 100%, 40%);">+     int rc, imsi_len;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   uint8_t imsi_buf[16];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       HNBAP_UERegisterRequest_t request_out;</span><br><span style="color: hsl(120, 100%, 40%);">+        HNBAP_UERegisterRequestIEs_t request;</span><br><span style="color: hsl(120, 100%, 40%);">+ memset(&request, 0, sizeof(request));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   request.uE_Identity.present = HNBAP_UE_Identity_PR_iMSI;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    imsi_len = ranap_imsi_encode(imsi_buf, sizeof(imsi_buf), imsi_str);</span><br><span style="color: hsl(120, 100%, 40%);">+   OCTET_STRING_fromBuf(&request.uE_Identity.choice.iMSI, (const char*)imsi_buf, imsi_len);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        request.registration_Cause = HNBAP_Registration_Cause_normal;</span><br><span style="color: hsl(120, 100%, 40%);">+ request.uE_Capabilities.access_stratum_release_indicator = HNBAP_Access_stratum_release_indicator_rel_6;</span><br><span style="color: hsl(120, 100%, 40%);">+      request.uE_Capabilities.csg_capability = HNBAP_CSG_Capability_not_csg_capable;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      memset(&request_out, 0, sizeof(request_out));</span><br><span style="color: hsl(120, 100%, 40%);">+     rc = hnbap_encode_ueregisterrequesties(&request_out, &request);</span><br><span style="color: hsl(120, 100%, 40%);">+       OSMO_ASSERT(rc == 0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       msg = hnbap_generate_initiating_message(HNBAP_ProcedureCode_id_UERegister,</span><br><span style="color: hsl(120, 100%, 40%);">+                                            HNBAP_Criticality_reject,</span><br><span style="color: hsl(120, 100%, 40%);">+                                             &asn_DEF_HNBAP_UERegisterRequest,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         &request_out);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_HNBAP_UERegisterRequest, &request_out);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   msgb_sctp_ppid(msg) = IUH_PPI_HNBAP;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return osmo_wqueue_enqueue(&hnb->wqueue, msg);</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%);">+void hnb_send_register_req(struct hnb *hnb)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    HNBAP_HNBRegisterRequest_t request_out;</span><br><span style="color: hsl(120, 100%, 40%);">+       struct msgb *msg;</span><br><span style="color: hsl(120, 100%, 40%);">+     int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+       uint16_t lac, sac;</span><br><span style="color: hsl(120, 100%, 40%);">+    uint8_t rac;</span><br><span style="color: hsl(120, 100%, 40%);">+  uint32_t cid;</span><br><span style="color: hsl(120, 100%, 40%);">+ uint8_t plmn[] = {0x09, 0xf1, 0x99};</span><br><span style="color: hsl(120, 100%, 40%);">+  char identity[50] = "ATestHNB@";</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  HNBAP_HNBRegisterRequestIEs_t request;</span><br><span style="color: hsl(120, 100%, 40%);">+        memset(&request, 0, sizeof(request));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   lac = 0xc0fe;</span><br><span style="color: hsl(120, 100%, 40%);">+ sac = 0xabab;</span><br><span style="color: hsl(120, 100%, 40%);">+ rac = 0x42;</span><br><span style="color: hsl(120, 100%, 40%);">+   cid = 0xadceaab;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    asn1_u16_to_str(&request.lac, &lac, lac);</span><br><span style="color: hsl(120, 100%, 40%);">+     asn1_u16_to_str(&request.sac, &sac, sac);</span><br><span style="color: hsl(120, 100%, 40%);">+     asn1_u8_to_str(&request.rac, &rac, rac);</span><br><span style="color: hsl(120, 100%, 40%);">+      asn1_u28_to_bitstring(&request.cellIdentity, &cid, cid);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    request.hnB_Identity.hNB_Identity_Info.buf = (uint8_t*) identity;</span><br><span style="color: hsl(120, 100%, 40%);">+     request.hnB_Identity.hNB_Identity_Info.size = strlen(identity);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     request.plmNidentity.buf = plmn;</span><br><span style="color: hsl(120, 100%, 40%);">+      request.plmNidentity.size = 3;</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%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  memset(&request_out, 0, sizeof(request_out));</span><br><span style="color: hsl(120, 100%, 40%);">+     rc = hnbap_encode_hnbregisterrequesties(&request_out, &request);</span><br><span style="color: hsl(120, 100%, 40%);">+      if (rc < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+              printf("Could not encode HNB register request IEs\n");</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%);">+   msg = hnbap_generate_initiating_message(HNBAP_ProcedureCode_id_HNBRegister,</span><br><span style="color: hsl(120, 100%, 40%);">+                                           HNBAP_Criticality_reject,</span><br><span style="color: hsl(120, 100%, 40%);">+                                             &asn_DEF_HNBAP_HNBRegisterRequest,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                &request_out);</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%);">+        msgb_sctp_ppid(msg) = IUH_PPI_HNBAP;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        osmo_wqueue_enqueue(&hnb->wqueue, msg);</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%);">+void hnb_send_deregister_req(struct hnb *hnb)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ struct msgb *msg;</span><br><span style="color: hsl(120, 100%, 40%);">+     int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     HNBAP_HNBDe_RegisterIEs_t request;</span><br><span style="color: hsl(120, 100%, 40%);">+    memset(&request, 0, sizeof(request));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   request.cause.present = HNBAP_Cause_PR_misc;</span><br><span style="color: hsl(120, 100%, 40%);">+  request.cause.choice.misc = HNBAP_CauseMisc_o_and_m_intervention;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   HNBAP_HNBDe_Register_t request_out;</span><br><span style="color: hsl(120, 100%, 40%);">+   memset(&request_out, 0, sizeof(request_out));</span><br><span style="color: hsl(120, 100%, 40%);">+     rc = hnbap_encode_hnbde_registeries(&request_out, &request);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (rc < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+              printf("Could not encode HNB deregister request IEs\n");</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%);">+   msg = hnbap_generate_initiating_message(HNBAP_ProcedureCode_id_HNBDe_Register,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                HNBAP_Criticality_reject,</span><br><span style="color: hsl(120, 100%, 40%);">+                                             &asn_DEF_HNBAP_HNBDe_Register,</span><br><span style="color: hsl(120, 100%, 40%);">+                                            &request_out);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  msgb_sctp_ppid(msg) = IUH_PPI_HNBAP;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        osmo_wqueue_enqueue(&hnb->wqueue, msg);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/src/osmo-hnodeb/main.c b/src/osmo-hnodeb/main.c</span><br><span>index 0fcb909..3abfc7c 100644</span><br><span>--- a/src/osmo-hnodeb/main.c</span><br><span>+++ b/src/osmo-hnodeb/main.c</span><br><span>@@ -51,8 +51,6 @@</span><br><span> </span><br><span> #include <osmocom/crypt/auth.h></span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#include <osmocom/hnbap/hnbap_common.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <osmocom/hnbap/hnbap_ies_defs.h></span><br><span> #include <osmocom/rua/rua_msg_factory.h></span><br><span> #include <osmocom/ranap/iu_helpers.h></span><br><span> </span><br><span>@@ -67,6 +65,7 @@</span><br><span> #include <osmocom/ranap/RANAP_DirectTransfer.h></span><br><span> #include <osmocom/ranap/ranap_common.h></span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/hnodeb/hnbap.h></span><br><span> #include <osmocom/hnodeb/rua.h></span><br><span> #include <osmocom/hnodeb/ranap.h></span><br><span> #include <osmocom/hnodeb/vty.h></span><br><span>@@ -81,87 +80,6 @@</span><br><span> </span><br><span> struct msgb *rua_new_udt(struct msgb *inmsg);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-        struct msgb *msg;</span><br><span style="color: hsl(0, 100%, 40%);">-       int rc, imsi_len;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       uint8_t imsi_buf[16];</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   HNBAP_UERegisterRequest_t request_out;</span><br><span style="color: hsl(0, 100%, 40%);">-  HNBAP_UERegisterRequestIEs_t request;</span><br><span style="color: hsl(0, 100%, 40%);">-   memset(&request, 0, sizeof(request));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       request.uE_Identity.present = HNBAP_UE_Identity_PR_iMSI;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        imsi_len = ranap_imsi_encode(imsi_buf, sizeof(imsi_buf), imsi_str);</span><br><span style="color: hsl(0, 100%, 40%);">-     OCTET_STRING_fromBuf(&request.uE_Identity.choice.iMSI, (const char*)imsi_buf, imsi_len);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    request.registration_Cause = HNBAP_Registration_Cause_normal;</span><br><span style="color: hsl(0, 100%, 40%);">-   request.uE_Capabilities.access_stratum_release_indicator = HNBAP_Access_stratum_release_indicator_rel_6;</span><br><span style="color: hsl(0, 100%, 40%);">-        request.uE_Capabilities.csg_capability = HNBAP_CSG_Capability_not_csg_capable;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-  memset(&request_out, 0, sizeof(request_out));</span><br><span style="color: hsl(0, 100%, 40%);">-       rc = hnbap_encode_ueregisterrequesties(&request_out, &request);</span><br><span style="color: hsl(0, 100%, 40%);">- OSMO_ASSERT(rc == 0);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-   msg = hnbap_generate_initiating_message(HNBAP_ProcedureCode_id_UERegister,</span><br><span style="color: hsl(0, 100%, 40%);">-                                              HNBAP_Criticality_reject,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               &asn_DEF_HNBAP_UERegisterRequest,</span><br><span style="color: hsl(0, 100%, 40%);">-                                           &request_out);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_HNBAP_UERegisterRequest, &request_out);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       msgb_sctp_ppid(msg) = IUH_PPI_HNBAP;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    return osmo_wqueue_enqueue(&hnb->wqueue, msg);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int hnb_rx_hnb_register_acc(struct hnb *hnb, ANY_t *in)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-   int rc;</span><br><span style="color: hsl(0, 100%, 40%);">- HNBAP_HNBRegisterAcceptIEs_t accept;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    rc = hnbap_decode_hnbregisteraccepties(&accept, in);</span><br><span style="color: hsl(0, 100%, 40%);">-        if (rc < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       hnb->rnc_id = accept.rnc_id;</span><br><span style="color: hsl(0, 100%, 40%);">- printf("HNB Register accept with RNC ID %u\n", hnb->rnc_id);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       hnbap_free_hnbregisteraccepties(&accept);</span><br><span style="color: hsl(0, 100%, 40%);">-   return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int hnb_rx_ue_register_acc(struct hnb *hnb, ANY_t *in)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-        int rc;</span><br><span style="color: hsl(0, 100%, 40%);">- uint32_t ctx_id;</span><br><span style="color: hsl(0, 100%, 40%);">-        HNBAP_UERegisterAcceptIEs_t accept;</span><br><span style="color: hsl(0, 100%, 40%);">-     char imsi[16];</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-  rc = hnbap_decode_ueregisteraccepties(&accept, in);</span><br><span style="color: hsl(0, 100%, 40%);">- if (rc < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                return rc;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (accept.uE_Identity.present != HNBAP_UE_Identity_PR_iMSI) {</span><br><span style="color: hsl(0, 100%, 40%);">-          printf("Wrong type in UE register accept\n");</span><br><span style="color: hsl(0, 100%, 40%);">-         return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       ctx_id = asn1bitstr_to_u24(&accept.context_ID);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     ranap_bcd_decode(imsi, sizeof(imsi), accept.uE_Identity.choice.iMSI.buf,</span><br><span style="color: hsl(0, 100%, 40%);">-                        accept.uE_Identity.choice.iMSI.size);</span><br><span style="color: hsl(0, 100%, 40%);">-   printf("UE Register accept for IMSI %s, context %u\n", imsi, ctx_id);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- hnb->ctx_id = ctx_id;</span><br><span style="color: hsl(0, 100%, 40%);">-        hnbap_free_ueregisteraccepties(&accept);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static struct msgb *gen_nas_id_resp()</span><br><span> {</span><br><span>     uint8_t id_resp[] = {</span><br><span>@@ -440,40 +358,6 @@</span><br><span>         /* TODO reply */</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-int hnb_hnbap_rx(struct hnb *hnb, struct msgb *msg)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-   HNBAP_HNBAP_PDU_t _pdu, *pdu = &_pdu;</span><br><span style="color: hsl(0, 100%, 40%);">-       asn_dec_rval_t dec_ret;</span><br><span style="color: hsl(0, 100%, 40%);">- int rc;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- memset(pdu, 0, sizeof(*pdu));</span><br><span style="color: hsl(0, 100%, 40%);">-   dec_ret = aper_decode(NULL, &asn_DEF_HNBAP_HNBAP_PDU, (void **) &pdu,</span><br><span style="color: hsl(0, 100%, 40%);">-                         msg->data, msgb_length(msg), 0, 0);</span><br><span style="color: hsl(0, 100%, 40%);">-    if (dec_ret.code != RC_OK) {</span><br><span style="color: hsl(0, 100%, 40%);">-            LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n");</span><br><span style="color: hsl(0, 100%, 40%);">-           return -EINVAL;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (pdu->present != HNBAP_HNBAP_PDU_PR_successfulOutcome) {</span><br><span style="color: hsl(0, 100%, 40%);">-          printf("Unexpected HNBAP message received\n");</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       switch (pdu->choice.successfulOutcome.procedureCode) {</span><br><span style="color: hsl(0, 100%, 40%);">-       case HNBAP_ProcedureCode_id_HNBRegister:</span><br><span style="color: hsl(0, 100%, 40%);">-                /* Get HNB id and send UE Register request */</span><br><span style="color: hsl(0, 100%, 40%);">-           rc = hnb_rx_hnb_register_acc(hnb, &pdu->choice.successfulOutcome.value);</span><br><span style="color: hsl(0, 100%, 40%);">-         break;</span><br><span style="color: hsl(0, 100%, 40%);">-  case HNBAP_ProcedureCode_id_UERegister:</span><br><span style="color: hsl(0, 100%, 40%);">-         rc = hnb_rx_ue_register_acc(hnb, &pdu->choice.successfulOutcome.value);</span><br><span style="color: hsl(0, 100%, 40%);">-          break;</span><br><span style="color: hsl(0, 100%, 40%);">-  default:</span><br><span style="color: hsl(0, 100%, 40%);">-                rc = -ENOSPC;</span><br><span style="color: hsl(0, 100%, 40%);">-           break;</span><br><span style="color: hsl(0, 100%, 40%);">-  }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       return rc;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> extern void direct_transfer_nas_pdu_print(ANY_t *in);</span><br><span> </span><br><span> static int hnb_read_cb(struct osmo_fd *fd)</span><br><span>@@ -557,83 +441,6 @@</span><br><span>        return rc;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-void hnb_send_register_req(struct hnb *hnb)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- HNBAP_HNBRegisterRequest_t request_out;</span><br><span style="color: hsl(0, 100%, 40%);">- struct msgb *msg;</span><br><span style="color: hsl(0, 100%, 40%);">-       int rc;</span><br><span style="color: hsl(0, 100%, 40%);">- uint16_t lac, sac;</span><br><span style="color: hsl(0, 100%, 40%);">-      uint8_t rac;</span><br><span style="color: hsl(0, 100%, 40%);">-    uint32_t cid;</span><br><span style="color: hsl(0, 100%, 40%);">-   uint8_t plmn[] = {0x09, 0xf1, 0x99};</span><br><span style="color: hsl(0, 100%, 40%);">-    char identity[50] = "ATestHNB@";</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      HNBAP_HNBRegisterRequestIEs_t request;</span><br><span style="color: hsl(0, 100%, 40%);">-  memset(&request, 0, sizeof(request));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       lac = 0xc0fe;</span><br><span style="color: hsl(0, 100%, 40%);">-   sac = 0xabab;</span><br><span style="color: hsl(0, 100%, 40%);">-   rac = 0x42;</span><br><span style="color: hsl(0, 100%, 40%);">-     cid = 0xadceaab;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        asn1_u16_to_str(&request.lac, &lac, lac);</span><br><span style="color: hsl(0, 100%, 40%);">-       asn1_u16_to_str(&request.sac, &sac, sac);</span><br><span style="color: hsl(0, 100%, 40%);">-       asn1_u8_to_str(&request.rac, &rac, rac);</span><br><span style="color: hsl(0, 100%, 40%);">-        asn1_u28_to_bitstring(&request.cellIdentity, &cid, cid);</span><br><span style="color: hsl(0, 100%, 40%);">-</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(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- request.plmNidentity.buf = plmn;</span><br><span style="color: hsl(0, 100%, 40%);">-        request.plmNidentity.size = 3;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-  memset(&request_out, 0, sizeof(request_out));</span><br><span style="color: hsl(0, 100%, 40%);">-       rc = hnbap_encode_hnbregisterrequesties(&request_out, &request);</span><br><span style="color: hsl(0, 100%, 40%);">-        if (rc < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                printf("Could not encode HNB register request IEs\n");</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       msg = hnbap_generate_initiating_message(HNBAP_ProcedureCode_id_HNBRegister,</span><br><span style="color: hsl(0, 100%, 40%);">-                                             HNBAP_Criticality_reject,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               &asn_DEF_HNBAP_HNBRegisterRequest,</span><br><span style="color: hsl(0, 100%, 40%);">-                                          &request_out);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      msgb_sctp_ppid(msg) = IUH_PPI_HNBAP;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    osmo_wqueue_enqueue(&hnb->wqueue, msg);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-void hnb_send_deregister_req(struct hnb *hnb)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-   struct msgb *msg;</span><br><span style="color: hsl(0, 100%, 40%);">-       int rc;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- HNBAP_HNBDe_RegisterIEs_t request;</span><br><span style="color: hsl(0, 100%, 40%);">-      memset(&request, 0, sizeof(request));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       request.cause.present = HNBAP_Cause_PR_misc;</span><br><span style="color: hsl(0, 100%, 40%);">-    request.cause.choice.misc = HNBAP_CauseMisc_o_and_m_intervention;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       HNBAP_HNBDe_Register_t request_out;</span><br><span style="color: hsl(0, 100%, 40%);">-     memset(&request_out, 0, sizeof(request_out));</span><br><span style="color: hsl(0, 100%, 40%);">-       rc = hnbap_encode_hnbde_registeries(&request_out, &request);</span><br><span style="color: hsl(0, 100%, 40%);">-    if (rc < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                printf("Could not encode HNB deregister request IEs\n");</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       msg = hnbap_generate_initiating_message(HNBAP_ProcedureCode_id_HNBDe_Register,</span><br><span style="color: hsl(0, 100%, 40%);">-                                          HNBAP_Criticality_reject,</span><br><span style="color: hsl(0, 100%, 40%);">-                                               &asn_DEF_HNBAP_HNBDe_Register,</span><br><span style="color: hsl(0, 100%, 40%);">-                                              &request_out);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      msgb_sctp_ppid(msg) = IUH_PPI_HNBAP;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    osmo_wqueue_enqueue(&hnb->wqueue, msg);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static struct vty_app_info vty_info = {</span><br><span>   .name           = "OsmohNodeB",</span><br><span>    .version        = "0",</span><br><span>diff --git a/src/osmo-hnodeb/vty.c b/src/osmo-hnodeb/vty.c</span><br><span>index ccca6d0..a1bb885 100644</span><br><span>--- a/src/osmo-hnodeb/vty.c</span><br><span>+++ b/src/osmo-hnodeb/vty.c</span><br><span>@@ -32,6 +32,7 @@</span><br><span> #include <osmocom/ranap/ranap_common.h></span><br><span> #include <osmocom/ranap/ranap_msg_factory.h></span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/hnodeb/hnbap.h></span><br><span> #include <osmocom/hnodeb/vty.h></span><br><span> #include <osmocom/hnodeb/hnodeb.h></span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-hnodeb/+/26000">change 26000</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/+/26000"/><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: I8356421169bebe1d411b05b19241ea639dc3f733 </div>
<div style="display:none"> Gerrit-Change-Number: 26000 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>