<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9656">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">libvlr/vlr.c: introduce the generic GSUP message router<br><br>Some internal sub-systems, such as SS/USSD or SMS implementation,<br>may also need to use GSUP connection with HLR. Previously, it was<br>only available within the libvlr code, and nowhere else.<br><br>Let's introduce the generic GSUP message router, which will<br>receive messages unhandled by VLR itself, and route them to<br>a handler depending on the message type.<br><br>Change-Id: Ib8146ce5788c8f249dcaa39d61bd0388574bf892<br>---<br>M src/libvlr/vlr.c<br>1 file changed, 15 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/56/9656/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c</span><br><span>index 29098b1..fc5bc07 100644</span><br><span>--- a/src/libvlr/vlr.c</span><br><span>+++ b/src/libvlr/vlr.c</span><br><span>@@ -966,6 +966,18 @@</span><br><span>       return rc;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static int vlr_route_gsup_msg(struct vlr_instance *vlr,</span><br><span style="color: hsl(120, 100%, 40%);">+                        struct osmo_gsup_message *gsup_msg)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+  switch (gsup_msg->message_type) {</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Nowhere to route for now */</span><br><span style="color: hsl(120, 100%, 40%);">+        default:</span><br><span style="color: hsl(120, 100%, 40%);">+              LOGP(DVLR, LOGL_ERROR, "No handler found for %s, dropping message...\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                    osmo_gsup_message_type_name(gsup_msg->message_type));</span><br><span style="color: hsl(120, 100%, 40%);">+              return -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL;</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> /* Incoming handler for GSUP from HLR.</span><br><span>  * Keep this function non-static for direct invocation by unit tests. */</span><br><span> int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg)</span><br><span>@@ -1037,9 +1049,9 @@</span><br><span>           break;</span><br><span>       default:</span><br><span>             LOGVSUBP(LOGL_ERROR, vsub,</span><br><span style="color: hsl(0, 100%, 40%);">-                      "Rx GSUP msg_type=%d not valid at VLR/SGSN side\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                   gsup.message_type);</span><br><span style="color: hsl(0, 100%, 40%);">-             rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL;</span><br><span style="color: hsl(120, 100%, 40%);">+                        "Rx GSUP msg_type=%d not handled at VLR, "</span><br><span style="color: hsl(120, 100%, 40%);">+                  "forwarding to the router at MSC\n", gsup.message_type);</span><br><span style="color: hsl(120, 100%, 40%);">+            rc = vlr_route_gsup_msg(vlr, &gsup);</span><br><span>             break;</span><br><span>       }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9656">change 9656</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/9656"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib8146ce5788c8f249dcaa39d61bd0388574bf892 </div>
<div style="display:none"> Gerrit-Change-Number: 9656 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>