aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/gsm_04_08.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-06-14 03:54:33 +0700
committerHarald Welte <laforge@gnumonks.org>2018-07-29 16:22:06 +0200
commit8a0e2588e208e1975c74d7e849e66fd205129acb (patch)
treeeca86132222001be7b4ac914920ddbb751d85ef5 /src/libmsc/gsm_04_08.c
parent2760585cca854b1ca5ac7e74b015e31c157a66c5 (diff)
libvlr/vlr.c: forward unhandled GSUP messages towards MSC
Some internal sub-systems, such as SS/USSD or SMS implementation, may also need to use GSUP connection with HLR. Previously, it was only available within the libvlr code, and nowhere else. Let's introduce the generic GSUP message router, which will receive messages unhandled by VLR itself, and route them to a handler depending on the message type. Change-Id: Ib8146ce5788c8f249dcaa39d61bd0388574bf892
Diffstat (limited to 'src/libmsc/gsm_04_08.c')
-rw-r--r--src/libmsc/gsm_04_08.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index f81a6fa51..c10a701e2 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -1698,6 +1698,18 @@ static void msc_vlr_subscr_assoc(void *msc_conn_ref,
conn->vsub->cs.attached_via_ran = conn->via_ran;
}
+static int msc_vlr_route_gsup_msg(struct vlr_subscr *vsub,
+ struct osmo_gsup_message *gsup_msg)
+{
+ switch (gsup_msg->message_type) {
+ /* Nowhere to route for now */
+ default:
+ LOGP(DMM, LOGL_ERROR, "No handler found for %s, dropping message...\n",
+ osmo_gsup_message_type_name(gsup_msg->message_type));
+ return -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL;
+ }
+}
+
/* operations that we need to implement for libvlr */
static const struct vlr_ops msc_vlr_ops = {
.tx_auth_req = msc_vlr_tx_auth_req,
@@ -1712,6 +1724,7 @@ static const struct vlr_ops msc_vlr_ops = {
.tx_mm_info = msc_vlr_tx_mm_info,
.subscr_update = msc_vlr_subscr_update,
.subscr_assoc = msc_vlr_subscr_assoc,
+ .forward_gsup_msg = msc_vlr_route_gsup_msg,
};
/* Allocate net->vlr so that the VTY may configure the VLR's data structures */