<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/22364">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Initial handling support for RIM messages<br><br>This code doesn't do anything yet app-related with the received RIM<br>messages, but already provides the initial infrastructure to handle them<br>in the future, and does first checkings.<br><br>Related: SYS#5103<br>Change-Id: Ia0ade0e97ea781ec655439c008b6cefaf3e90dec<br>---<br>M src/Makefile.am<br>M src/gprs_bssgp_pcu.c<br>A src/gprs_bssgp_rim.c<br>A src/gprs_bssgp_rim.h<br>M src/gprs_debug.cpp<br>M src/gprs_debug.h<br>M src/gprs_pcu.c<br>M src/gprs_pcu.h<br>8 files changed, 230 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/64/22364/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/Makefile.am b/src/Makefile.am</span><br><span>index de924a6..f85a456 100644</span><br><span>--- a/src/Makefile.am</span><br><span>+++ b/src/Makefile.am</span><br><span>@@ -43,6 +43,7 @@</span><br><span>         csn1.c \</span><br><span>     gsm_rlcmac.c \</span><br><span>       gprs_bssgp_pcu.c \</span><br><span style="color: hsl(120, 100%, 40%);">+    gprs_bssgp_rim.c \</span><br><span>   gprs_rlcmac.cpp \</span><br><span>    gprs_rlcmac_sched.cpp \</span><br><span>      gprs_rlcmac_meas.cpp \</span><br><span>@@ -81,6 +82,7 @@</span><br><span>   csn1.h \</span><br><span>     gsm_rlcmac.h \</span><br><span>       gprs_bssgp_pcu.h \</span><br><span style="color: hsl(120, 100%, 40%);">+    gprs_bssgp_rim.h \</span><br><span>   gprs_rlcmac.h \</span><br><span>      gprs_ms.h \</span><br><span>  gprs_ms_storage.h \</span><br><span>diff --git a/src/gprs_bssgp_pcu.c b/src/gprs_bssgp_pcu.c</span><br><span>index c5cc39d..c24aa4d 100644</span><br><span>--- a/src/gprs_bssgp_pcu.c</span><br><span>+++ b/src/gprs_bssgp_pcu.c</span><br><span>@@ -20,6 +20,7 @@</span><br><span> </span><br><span> #include <gprs_rlcmac.h></span><br><span> #include <gprs_bssgp_pcu.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <gprs_bssgp_rim.h></span><br><span> #include <pcu_l1_if.h></span><br><span> #include <gprs_debug.h></span><br><span> #include <bts.h></span><br><span>@@ -419,10 +420,22 @@</span><br><span>        int rc = 0;</span><br><span>  struct bssgp_bvc_ctx *bctx;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (pdu_type == BSSGP_PDUT_STATUS)</span><br><span style="color: hsl(120, 100%, 40%);">+    switch (pdu_type) {</span><br><span style="color: hsl(120, 100%, 40%);">+   case BSSGP_PDUT_STATUS:</span><br><span>              /* Pass the message to the generic BSSGP parser, which handles</span><br><span>                * STATUS and RESET messages in either direction. */</span><br><span style="color: hsl(120, 100%, 40%);">+  case BSSGP_PDUT_RAN_INFO:</span><br><span style="color: hsl(120, 100%, 40%);">+     case BSSGP_PDUT_RAN_INFO_REQ:</span><br><span style="color: hsl(120, 100%, 40%);">+ case BSSGP_PDUT_RAN_INFO_ACK:</span><br><span style="color: hsl(120, 100%, 40%);">+ case BSSGP_PDUT_RAN_INFO_ERROR:</span><br><span style="color: hsl(120, 100%, 40%);">+       case BSSGP_PDUT_RAN_INFO_APP_ERROR:</span><br><span style="color: hsl(120, 100%, 40%);">+           /* Also pass all RIM related messages to the generic BSSGP</span><br><span style="color: hsl(120, 100%, 40%);">+             * parser so that it can deliver primitive to the RIM SAP</span><br><span style="color: hsl(120, 100%, 40%);">+              * (SAP_BSSGP_RIM) */</span><br><span>                return bssgp_rcvmsg(msg);</span><br><span style="color: hsl(120, 100%, 40%);">+     default:</span><br><span style="color: hsl(120, 100%, 40%);">+              break;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span> </span><br><span>        /* Identifiers from DOWN: NSEI, BVCI (both in msg->cb) */</span><br><span> </span><br><span>@@ -551,7 +564,8 @@</span><br><span>       case SAP_BSSGP_NM:</span><br><span>           if (oph->primitive == PRIM_NM_STATUS)</span><br><span>                     handle_nm_status(bp);</span><br><span style="color: hsl(0, 100%, 40%);">-           break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case SAP_BSSGP_RIM:</span><br><span style="color: hsl(120, 100%, 40%);">+           return handle_rim(bp);</span><br><span>       default:</span><br><span>             break;</span><br><span>       }</span><br><span>diff --git a/src/gprs_bssgp_rim.c b/src/gprs_bssgp_rim.c</span><br><span>new file mode 100644</span><br><span>index 0000000..8cb330f</span><br><span>--- /dev/null</span><br><span>+++ b/src/gprs_bssgp_rim.c</span><br><span>@@ -0,0 +1,169 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/* gprs_bssgp_pcu.cpp</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de></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</span><br><span style="color: hsl(120, 100%, 40%);">+ * modify it under the terms of the GNU General Public License</span><br><span style="color: hsl(120, 100%, 40%);">+ * as published by the Free Software Foundation; either version 2</span><br><span style="color: hsl(120, 100%, 40%);">+ * of the License, or (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 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 General Public License</span><br><span style="color: hsl(120, 100%, 40%);">+ * along with this program; if not, write to the Free Software</span><br><span style="color: hsl(120, 100%, 40%);">+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.</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 <osmocom/gprs/gprs_bssgp.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/gprs/gprs_bssgp_rim.h></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/gsm/tlv.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/gprs/gprs_ns.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/core/prim.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include "gprs_debug.h"</span><br><span style="color: hsl(120, 100%, 40%);">+#include "gprs_pcu.h"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static inline void gprs_ra_id_ci_to_cgi_ps(struct osmo_cell_global_id_ps *cgi_ps,</span><br><span style="color: hsl(120, 100%, 40%);">+                                          struct gprs_ra_id *raid, uint16_t cid)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+  *cgi_ps = (struct osmo_cell_global_id_ps) {</span><br><span style="color: hsl(120, 100%, 40%);">+           .rai.lac.plmn.mcc = raid->mcc,</span><br><span style="color: hsl(120, 100%, 40%);">+             .rai.lac.plmn.mnc = raid->mnc,</span><br><span style="color: hsl(120, 100%, 40%);">+             .rai.lac.plmn.mnc_3_digits = raid->mnc_3_digits,</span><br><span style="color: hsl(120, 100%, 40%);">+           .rai.lac.lac = raid->lac,</span><br><span style="color: hsl(120, 100%, 40%);">+          .rai.rac = raid->rac,</span><br><span style="color: hsl(120, 100%, 40%);">+              .cell_identity = cid,</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%);">+/* Mirror RIM routing information of a given PDU, see also 3GPP TS 48.018, section 8c.1.4.3 */</span><br><span style="color: hsl(120, 100%, 40%);">+static void mirror_rim_routing_info(struct bssgp_ran_information_pdu *resp_pdu,</span><br><span style="color: hsl(120, 100%, 40%);">+                                  struct bssgp_ran_information_pdu *req_pdu)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     memcpy(&resp_pdu->routing_info_dest, &req_pdu->routing_info_src, sizeof(resp_pdu->routing_info_dest));</span><br><span style="color: hsl(120, 100%, 40%);">+       memcpy(&resp_pdu->routing_info_src, &req_pdu->routing_info_dest, sizeof(resp_pdu->routing_info_src));</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%);">+/* Format a RAN INFORMATION ERROR PDU */</span><br><span style="color: hsl(120, 100%, 40%);">+static void format_response_pdu_err(struct bssgp_ran_information_pdu *resp_pdu,</span><br><span style="color: hsl(120, 100%, 40%);">+                                    struct bssgp_ran_information_pdu *req_pdu)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     memset(resp_pdu, 0, sizeof(*resp_pdu));</span><br><span style="color: hsl(120, 100%, 40%);">+       mirror_rim_routing_info(resp_pdu, req_pdu);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ resp_pdu->decoded.err_rim_cont = (struct bssgp_ran_inf_err_rim_cont) {</span><br><span style="color: hsl(120, 100%, 40%);">+             .app_id = BSSGP_RAN_INF_APP_ID_NACC,</span><br><span style="color: hsl(120, 100%, 40%);">+          .prot_ver = 1,</span><br><span style="color: hsl(120, 100%, 40%);">+                .err_pdu = req_pdu->rim_cont,</span><br><span style="color: hsl(120, 100%, 40%);">+              .err_pdu_len = req_pdu->rim_cont_len,</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%);">+  resp_pdu->decoded_present = true;</span><br><span style="color: hsl(120, 100%, 40%);">+  resp_pdu->rim_cont_iei = BSSGP_IE_RI_ERROR_RIM_COINTAINER;</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%);">+/* Check if the application ID in the request PDU is actually BSSGP_RAN_INF_APP_ID_NACC */</span><br><span style="color: hsl(120, 100%, 40%);">+static enum bssgp_ran_inf_app_id *get_app_id(struct bssgp_ran_information_pdu *pdu)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        switch (pdu->rim_cont_iei) {</span><br><span style="color: hsl(120, 100%, 40%);">+       case BSSGP_IE_RI_REQ_RIM_CONTAINER:</span><br><span style="color: hsl(120, 100%, 40%);">+           return &pdu->decoded.req_rim_cont.app_id;</span><br><span style="color: hsl(120, 100%, 40%);">+      case BSSGP_IE_RI_RIM_CONTAINER:</span><br><span style="color: hsl(120, 100%, 40%);">+               return &pdu->decoded.rim_cont.app_id;</span><br><span style="color: hsl(120, 100%, 40%);">+  case BSSGP_IE_RI_APP_ERROR_RIM_CONT:</span><br><span style="color: hsl(120, 100%, 40%);">+          return &pdu->decoded.app_err_rim_cont.app_id;</span><br><span style="color: hsl(120, 100%, 40%);">+  case BSSGP_IE_RI_ACK_RIM_CONTAINER:</span><br><span style="color: hsl(120, 100%, 40%);">+           return &pdu->decoded.ack_rim_cont.app_id;</span><br><span style="color: hsl(120, 100%, 40%);">+      case BSSGP_IE_RI_ERROR_RIM_COINTAINER:</span><br><span style="color: hsl(120, 100%, 40%);">+                return &pdu->decoded.err_rim_cont.app_id;</span><br><span style="color: hsl(120, 100%, 40%);">+      default:</span><br><span style="color: hsl(120, 100%, 40%);">+              return NULL;</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%);">+/* Check if the application ID in the request PDU is of a certian type */</span><br><span style="color: hsl(120, 100%, 40%);">+static bool match_app_id(struct bssgp_ran_information_pdu *pdu, enum bssgp_ran_inf_app_id exp_app_id)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+   enum bssgp_ran_inf_app_id *app_id = get_app_id(pdu);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (app_id && *app_id == exp_app_id)</span><br><span style="color: hsl(120, 100%, 40%);">+          return true;</span><br><span style="color: hsl(120, 100%, 40%);">+  return false;</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 handle_rim(struct osmo_bssgp_prim *bp)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct msgb *msg = bp->oph.msg;</span><br><span style="color: hsl(120, 100%, 40%);">+    uint16_t nsei = msgb_nsei(msg);</span><br><span style="color: hsl(120, 100%, 40%);">+       struct bssgp_ran_information_pdu *pdu = &bp->u.rim_pdu;</span><br><span style="color: hsl(120, 100%, 40%);">+        struct bssgp_ran_information_pdu resp_pdu;</span><br><span style="color: hsl(120, 100%, 40%);">+    struct osmo_cell_global_id_ps dst_addr;</span><br><span style="color: hsl(120, 100%, 40%);">+       struct gprs_rlcmac_bts *bts;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* At the moment we only support GERAN, so we block all other network</span><br><span style="color: hsl(120, 100%, 40%);">+  * types here. */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (pdu->routing_info_dest.discr != BSSGP_RIM_ROUTING_INFO_GERAN) {</span><br><span style="color: hsl(120, 100%, 40%);">+                LOGP(DRIM, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                     "BSSGP RIM (NSEI=%u) only GERAN supported, destination cell is not a GERAN cell -- rejected.\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                    nsei);</span><br><span style="color: hsl(120, 100%, 40%);">+           return bssgp_tx_status(BSSGP_CAUSE_UNKN_RIM_AI, NULL, msg);</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+     if (pdu->routing_info_src.discr != BSSGP_RIM_ROUTING_INFO_GERAN) {</span><br><span style="color: hsl(120, 100%, 40%);">+         LOGP(DRIM, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                     "BSSGP RIM (NSEI=%u) only GERAN supported, source cell is not a GERAN cell -- rejected.\n", nsei);</span><br><span style="color: hsl(120, 100%, 40%);">+             return bssgp_tx_status(BSSGP_CAUSE_UNKN_RIM_AI, NULL, 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%);">+   /* Check if the RIM pdu is really addressed to this PCU, see also</span><br><span style="color: hsl(120, 100%, 40%);">+      * 3GPP TS 48.018, section 8c.3.1.2 */</span><br><span style="color: hsl(120, 100%, 40%);">+        gprs_ra_id_ci_to_cgi_ps(&dst_addr, &pdu->routing_info_dest.geran.raid,</span><br><span style="color: hsl(120, 100%, 40%);">+                             pdu->routing_info_dest.geran.cid);</span><br><span style="color: hsl(120, 100%, 40%);">+ bts = gprs_pcu_get_bts_by_cgi_ps(the_pcu, &dst_addr);</span><br><span style="color: hsl(120, 100%, 40%);">+     if (!bts) {</span><br><span style="color: hsl(120, 100%, 40%);">+           LOGP(DRIM, LOGL_ERROR, "BSSGP RIM (NSEI=%u) cell %s unknown to this pcu\n",</span><br><span style="color: hsl(120, 100%, 40%);">+              nsei, osmo_cgi_ps_name(&dst_addr));</span><br><span style="color: hsl(120, 100%, 40%);">+          return bssgp_tx_status(BSSGP_CAUSE_UNKN_DST, NULL, 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%);">+   /* Check if the incoming RIM PDU is parseable, if not we must report</span><br><span style="color: hsl(120, 100%, 40%);">+   * an error to the controlling BSS 3GPP TS 48.018, 8c.3.4 and 8c.3.4.2 */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (!pdu->decoded_present) {</span><br><span style="color: hsl(120, 100%, 40%);">+               LOGP(DRIM, LOGL_ERROR, "BSSGP RIM (NSEI=%u) errornous RIM PDU received -- rejected.\n", nsei);</span><br><span style="color: hsl(120, 100%, 40%);">+              format_response_pdu_err(&resp_pdu, pdu);</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%);">+   /* Check if the RIM container inside the incoming RIM PDU has the correct</span><br><span style="color: hsl(120, 100%, 40%);">+      * application ID */</span><br><span style="color: hsl(120, 100%, 40%);">+  if (!match_app_id(pdu, BSSGP_RAN_INF_APP_ID_NACC)) {</span><br><span style="color: hsl(120, 100%, 40%);">+          LOGP(DRIM, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                     "BSSGP RIM (NSEI=%u) RIM PDU with unknown/wrong application ID received -- rejected.\n", nsei);</span><br><span style="color: hsl(120, 100%, 40%);">+                format_response_pdu_err(&resp_pdu, pdu);</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%);">+   /* Handle incoming RIM container */</span><br><span style="color: hsl(120, 100%, 40%);">+   switch (pdu->rim_cont_iei) {</span><br><span style="color: hsl(120, 100%, 40%);">+       case BSSGP_IE_RI_REQ_RIM_CONTAINER:</span><br><span style="color: hsl(120, 100%, 40%);">+           LOGP(DRIM, LOGL_NOTICE, "BSSGP RIM (NSEI=%u) responding to RAN INFORMATION REQUEST not yet implemented!\n", nsei);</span><br><span style="color: hsl(120, 100%, 40%);">+          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case BSSGP_IE_RI_RIM_CONTAINER:</span><br><span style="color: hsl(120, 100%, 40%);">+               LOGP(DRIM, LOGL_NOTICE, "BSSGP RIM (NSEI=%u) responding to RAN INFORMATION not yet implemented!\n", nsei);</span><br><span style="color: hsl(120, 100%, 40%);">+          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case BSSGP_IE_RI_APP_ERROR_RIM_CONT:</span><br><span style="color: hsl(120, 100%, 40%);">+  case BSSGP_IE_RI_ACK_RIM_CONTAINER:</span><br><span style="color: hsl(120, 100%, 40%);">+   case BSSGP_IE_RI_ERROR_RIM_COINTAINER:</span><br><span style="color: hsl(120, 100%, 40%);">+                LOGP(DRIM, LOGL_ERROR, "BSSGP RIM (NSEI=%u) RIM PDU not handled by this application\n", nsei);</span><br><span style="color: hsl(120, 100%, 40%);">+              return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+       default:</span><br><span style="color: hsl(120, 100%, 40%);">+              /* This should never happen. If the RIM PDU is parsed correctly, then the rim_cont_iei will</span><br><span style="color: hsl(120, 100%, 40%);">+            * be set to one of the cases above and if parsing failes this switch statement is guarded</span><br><span style="color: hsl(120, 100%, 40%);">+             * by the check on decoded_present above */</span><br><span style="color: hsl(120, 100%, 40%);">+           OSMO_ASSERT(false);</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 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/src/gprs_bssgp_rim.h b/src/gprs_bssgp_rim.h</span><br><span>new file mode 100644</span><br><span>index 0000000..5fac56f</span><br><span>--- /dev/null</span><br><span>+++ b/src/gprs_bssgp_rim.h</span><br><span>@@ -0,0 +1,24 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/* gprs_bssgp_rim.h</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de></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</span><br><span style="color: hsl(120, 100%, 40%);">+ * modify it under the terms of the GNU General Public License</span><br><span style="color: hsl(120, 100%, 40%);">+ * as published by the Free Software Foundation; either version 2</span><br><span style="color: hsl(120, 100%, 40%);">+ * of the License, or (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 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 General Public License</span><br><span style="color: hsl(120, 100%, 40%);">+ * along with this program; if not, write to the Free Software</span><br><span style="color: hsl(120, 100%, 40%);">+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.</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%);">+struct osmo_bssgp_prim;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+int handle_rim(struct osmo_bssgp_prim *bp);</span><br><span>diff --git a/src/gprs_debug.cpp b/src/gprs_debug.cpp</span><br><span>index a790e3f..669ea27 100644</span><br><span>--- a/src/gprs_debug.cpp</span><br><span>+++ b/src/gprs_debug.cpp</span><br><span>@@ -119,6 +119,13 @@</span><br><span>          .loglevel = LOGL_NOTICE,</span><br><span>             .enabled = 1,</span><br><span>        },</span><br><span style="color: hsl(120, 100%, 40%);">+    [DRIM] = {</span><br><span style="color: hsl(120, 100%, 40%);">+            .name = "DRIM",</span><br><span style="color: hsl(120, 100%, 40%);">+             .color = "\033[1;38m",</span><br><span style="color: hsl(120, 100%, 40%);">+              .description = "RAN Information Management (RIM)",</span><br><span style="color: hsl(120, 100%, 40%);">+          .loglevel = LOGL_NOTICE,</span><br><span style="color: hsl(120, 100%, 40%);">+              .enabled = 1,</span><br><span style="color: hsl(120, 100%, 40%);">+ },</span><br><span> };</span><br><span> </span><br><span> static int filter_fn(const struct log_context *ctx,</span><br><span>diff --git a/src/gprs_debug.h b/src/gprs_debug.h</span><br><span>index 84a0a07..8df405a 100644</span><br><span>--- a/src/gprs_debug.h</span><br><span>+++ b/src/gprs_debug.h</span><br><span>@@ -46,6 +46,7 @@</span><br><span>         DTBFUL,</span><br><span>      DNS,</span><br><span>         DPCU,</span><br><span style="color: hsl(120, 100%, 40%);">+ DRIM,</span><br><span>        aDebug_LastEntry</span><br><span> };</span><br><span> </span><br><span>diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c</span><br><span>index d291e71..32259b8 100644</span><br><span>--- a/src/gprs_pcu.c</span><br><span>+++ b/src/gprs_pcu.c</span><br><span>@@ -116,6 +116,16 @@</span><br><span>       return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+struct gprs_rlcmac_bts *gprs_pcu_get_bts_by_cgi_ps(struct gprs_pcu *pcu, struct osmo_cell_global_id_ps *cgi_ps)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct gprs_rlcmac_bts *pos;</span><br><span style="color: hsl(120, 100%, 40%);">+  llist_for_each_entry(pos, &pcu->bts_list, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+              if (memcmp(&pos->cgi_ps, cgi_ps, sizeof(*cgi_ps)) == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+                        return pos;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+     return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> void gprs_pcu_set_initial_cs(struct gprs_pcu *pcu, uint8_t cs_dl, uint8_t cs_ul)</span><br><span> {</span><br><span>   struct gprs_rlcmac_bts *bts;</span><br><span>diff --git a/src/gprs_pcu.h b/src/gprs_pcu.h</span><br><span>index 058d102..a1cd1ed 100644</span><br><span>--- a/src/gprs_pcu.h</span><br><span>+++ b/src/gprs_pcu.h</span><br><span>@@ -124,6 +124,7 @@</span><br><span> struct gprs_pcu *gprs_pcu_alloc(void *ctx);</span><br><span> </span><br><span> struct gprs_rlcmac_bts *gprs_pcu_get_bts_by_nr(struct gprs_pcu *pcu, uint8_t bts_nr);</span><br><span style="color: hsl(120, 100%, 40%);">+struct gprs_rlcmac_bts *gprs_pcu_get_bts_by_cgi_ps(struct gprs_pcu *pcu, struct osmo_cell_global_id_ps *cgi_ps);</span><br><span> </span><br><span> void gprs_pcu_set_initial_cs(struct gprs_pcu *pcu, uint8_t cs_dl, uint8_t cs_ul);</span><br><span> void gprs_pcu_set_initial_mcs(struct gprs_pcu *pcu, uint8_t mcs_dl, uint8_t mcs_ul);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/22364">change 22364</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-pcu/+/22364"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ia0ade0e97ea781ec655439c008b6cefaf3e90dec </div>
<div style="display:none"> Gerrit-Change-Number: 22364 </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>